Skip to content

Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.

chore: remove tarui (#7089)

Nathan.foood9b3f3f6c6f8
diff --git a/.github/workflows/android_ci.yaml.bak b/.github/workflows/android_ci.yaml.bak
index a45ef67711..4e159e845b 100644
--- a/.github/workflows/android_ci.yaml.bak
+++ b/.github/workflows/android_ci.yaml.bak
@@ -7,7 +7,6 @@ on:
paths:
- ".github/workflows/mobile_ci.yaml"
- "frontend/**"
- - "!frontend/appflowy_tauri/**"
pull_request:
branches:
diff --git a/.github/workflows/ios_ci.yaml b/.github/workflows/ios_ci.yaml
index bd71c77b3b..d9bee0242a 100644
--- a/.github/workflows/ios_ci.yaml
+++ b/.github/workflows/ios_ci.yaml
@@ -7,7 +7,6 @@ on:
paths:
- ".github/workflows/mobile_ci.yaml"
- "frontend/**"
- - "!frontend/appflowy_tauri/**"
- "!frontend/appflowy_web_app/**"
pull_request:
@@ -16,7 +15,6 @@ on:
paths:
- ".github/workflows/mobile_ci.yaml"
- "frontend/**"
- - "!frontend/appflowy_tauri/**"
- "!frontend/appflowy_web_app/**"
env:
diff --git a/frontend/.vscode/launch.json b/frontend/.vscode/launch.json
index 09965baee1..4c4f7aa8e6 100644
--- a/frontend/.vscode/launch.json
+++ b/frontend/.vscode/launch.json
@@ -121,20 +121,5 @@
// "request": "launch",
// "program": "[YOUR_APPLICATION_PATH]",
},
- {
- // https://tauri.app/v1/guides/debugging/vs-code
- "type": "lldb",
- "request": "launch",
- "name": "AF-tauri: Debug backend",
- "cargo": {
- "args": [
- "build",
- "--manifest-path=./appflowy_tauri/src-tauri/Cargo.toml",
- "--no-default-features"
- ]
- },
- "preLaunchTask": "AF: Tauri UI Dev",
- "cwd": "${workspaceRoot}/appflowy_tauri/"
- },
]
}
diff --git a/frontend/.vscode/tasks.json b/frontend/.vscode/tasks.json
index d940eef0a8..0be167fb12 100644
--- a/frontend/.vscode/tasks.json
+++ b/frontend/.vscode/tasks.json
@@ -245,51 +245,6 @@
"problemMatcher": [],
"detail": "appflowy_flutter"
},
- {
- "label": "AF: Tauri UI Build",
- "type": "shell",
- "command": "pnpm run build",
- "options": {
- "cwd": "${workspaceFolder}/appflowy_tauri"
- }
- },
- {
- "label": "AF: Tauri UI Dev",
- "type": "shell",
- "isBackground": true,
- "command": "pnpm sync:i18n && pnpm run dev",
- "options": {
- "cwd": "${workspaceFolder}/appflowy_tauri"
- }
- },
- {
- "label": "AF: Tauri Clean",
- "type": "shell",
- "command": "cargo make tauri_clean",
- "options": {
- "cwd": "${workspaceFolder}"
- }
- },
- {
- "label": "AF: Tauri Clean + Dev",
- "type": "shell",
- "dependsOrder": "sequence",
- "dependsOn": [
- "AF: Tauri Clean",
- "AF: Tauri UI Dev"
- ],
- "options": {
- "cwd": "${workspaceFolder}"
- }
- },
- {
- "label": "AF: Tauri ESLint",
- "type": "shell",
- "command": "npx eslint --fix src",
- "options": {
- "cwd": "${workspaceFolder}/appflowy_tauri"
- }
- },
{
"label": "AF: Generate Env File",
"type": "shell",
diff --git a/frontend/appflowy_tauri/.eslintignore b/frontend/appflowy_tauri/.eslintignore
deleted file mode 100644
index e0ff674834..0000000000
--- a/frontend/appflowy_tauri/.eslintignore
+++ /dev/null
@@ -1,7 +0,0 @@
-src/services
-src/styles
-node_modules/
-dist/
-src-tauri/
-.eslintrc.cjs
-tsconfig.json
\ No newline at end of file
diff --git a/frontend/appflowy_tauri/.eslintrc.cjs b/frontend/appflowy_tauri/.eslintrc.cjs
deleted file mode 100644
index a1160f0bd3..0000000000
--- a/frontend/appflowy_tauri/.eslintrc.cjs
+++ /dev/null
@@ -1,73 +0,0 @@
-module.exports = {
- // https://eslint.org/docs/latest/use/configure/configuration-files
- env: {
- browser: true,
- es6: true,
- node: true,
- },
- extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
- parser: '@typescript-eslint/parser',
- parserOptions: {
- project: 'tsconfig.json',
- sourceType: 'module',
- tsconfigRootDir: __dirname,
- extraFileExtensions: ['.json'],
- },
- plugins: ['@typescript-eslint', "react-hooks"],
- rules: {
- "react-hooks/rules-of-hooks": "error",
- "react-hooks/exhaustive-deps": "error",
- '@typescript-eslint/adjacent-overload-signatures': 'error',
- '@typescript-eslint/no-empty-function': 'error',
- '@typescript-eslint/no-empty-interface': 'error',
- '@typescript-eslint/no-floating-promises': 'error',
- '@typescript-eslint/await-thenable': 'error',
- '@typescript-eslint/no-namespace': 'error',
- '@typescript-eslint/no-unnecessary-type-assertion': 'error',
- '@typescript-eslint/no-redeclare': 'error',
- '@typescript-eslint/prefer-for-of': 'error',
- '@typescript-eslint/triple-slash-reference': 'error',
- '@typescript-eslint/unified-signatures': 'error',
- 'no-shadow': 'off',
- '@typescript-eslint/no-shadow': 'off',
- 'constructor-super': 'error',
- eqeqeq: ['error', 'always'],
- 'no-cond-assign': 'error',
- 'no-duplicate-case': 'error',
- 'no-duplicate-imports': 'error',
- 'no-empty': [
- 'error',
- {
- allowEmptyCatch: true,
- },
- ],
- 'no-invalid-this': 'error',
- 'no-new-wrappers': 'error',
- 'no-param-reassign': 'error',
- 'no-sequences': 'error',
- 'no-throw-literal': 'error',
- 'no-unsafe-finally': 'error',
- 'no-unused-labels': 'error',
- 'no-var': 'error',
- 'no-void': 'off',
- 'prefer-const': 'error',
- 'prefer-spread': 'off',
- '@typescript-eslint/no-unused-vars': [
- 'error',
- {
- argsIgnorePattern: '^_',
- }
- ],
- 'padding-line-between-statements': [
- "error",
- { blankLine: "always", prev: ["const", "let", "var"], next: "*"},
- { blankLine: "any", prev: ["const", "let", "var"], next: ["const", "let", "var"]},
- { blankLine: "always", prev: "import", next: "*" },
- { blankLine: "any", prev: "import", next: "import" },
- { blankLine: "always", prev: "block-like", next: "*" },
- { blankLine: "always", prev: "block", next: "*" },
-
- ]
- },
- ignorePatterns: ['src/**/*.test.ts', '**/__tests__/**/*.json', 'package.json']
-};
diff --git a/frontend/appflowy_tauri/.gitignore b/frontend/appflowy_tauri/.gitignore
deleted file mode 100644
index 32a3d59bc2..0000000000
--- a/frontend/appflowy_tauri/.gitignore
+++ /dev/null
@@ -1,33 +0,0 @@
-# Logs
-logs
-*.log
-npm-debug.log*
-yarn-debug.log*
-yarn-error.log*
-pnpm-debug.log*
-lerna-debug.log*
-
-node_modules
-dist
-dist-ssr
-*.local
-
-# Editor directories and files
-.vscode/*
-!.vscode/extensions.json
-.idea
-.DS_Store
-*.suo
-*.ntvs*
-*.njsproj
-*.sln
-*.sw?
-
-**/src/services/backend/models/
-**/src/services/backend/events/
-**/src/appflowy_app/i18n/translations/
-
-coverage
-**/AppFlowy-Collab
-
-.env
\ No newline at end of file
diff --git a/frontend/appflowy_tauri/.prettierignore b/frontend/appflowy_tauri/.prettierignore
deleted file mode 100644
index d515c1c2f2..0000000000
--- a/frontend/appflowy_tauri/.prettierignore
+++ /dev/null
@@ -1,19 +0,0 @@
-.DS_Store
-node_modules
-/build
-/public
-/.svelte-kit
-/package
-/.vscode
-.env
-.env.*
-!.env.example
-
-# rust and generated ts code
-/src-tauri
-/src/services
-
-# Ignore files for PNPM, NPM and YARN
-pnpm-lock.yaml
-package-lock.json
-yarn.lock
diff --git a/frontend/appflowy_tauri/.prettierrc.cjs b/frontend/appflowy_tauri/.prettierrc.cjs
deleted file mode 100644
index f283db53a2..0000000000
--- a/frontend/appflowy_tauri/.prettierrc.cjs
+++ /dev/null
@@ -1,20 +0,0 @@
-module.exports = {
- arrowParens: 'always',
- bracketSpacing: true,
- endOfLine: 'lf',
- htmlWhitespaceSensitivity: 'css',
- insertPragma: false,
- jsxBracketSameLine: false,
- jsxSingleQuote: true,
- printWidth: 121,
- plugins: [require('prettier-plugin-tailwindcss')],
- proseWrap: 'preserve',
- quoteProps: 'as-needed',
- requirePragma: false,
- semi: true,
- singleQuote: true,
- tabWidth: 2,
- trailingComma: 'es5',
- useTabs: false,
- vueIndentScriptAndStyle: false,
-};
diff --git a/frontend/appflowy_tauri/.vscode/extensions.json b/frontend/appflowy_tauri/.vscode/extensions.json
deleted file mode 100644
index 24d7cc6de8..0000000000
--- a/frontend/appflowy_tauri/.vscode/extensions.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "recommendations": ["tauri-apps.tauri-vscode", "rust-lang.rust-analyzer"]
-}
diff --git a/frontend/appflowy_tauri/README.md b/frontend/appflowy_tauri/README.md
deleted file mode 100644
index 102e366893..0000000000
--- a/frontend/appflowy_tauri/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Tauri + React + Typescript
-
-This template should help get you started developing with Tauri, React and Typescript in Vite.
-
-## Recommended IDE Setup
-
-- [VS Code](https://code.visualstudio.com/) + [Tauri](https://marketplace.visualstudio.com/items?itemName=tauri-apps.tauri-vscode) + [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer)
diff --git a/frontend/appflowy_tauri/index.html b/frontend/appflowy_tauri/index.html
deleted file mode 100644
index 4983fb648b..0000000000
--- a/frontend/appflowy_tauri/index.html
+++ /dev/null
@@ -1,14 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta charset="UTF-8" />
- <link rel="icon" type="image/svg+xml" href="/vite.svg" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
- <title>AppFlowy: The Open Source Alternative To Notion</title>
- </head>
-
- <body id="body">
- <div id="root"></div>
- <script type="module" src="/src/main.tsx"></script>
- </body>
-</html>
diff --git a/frontend/appflowy_tauri/jest.config.cjs b/frontend/appflowy_tauri/jest.config.cjs
deleted file mode 100644
index 4939478165..0000000000
--- a/frontend/appflowy_tauri/jest.config.cjs
+++ /dev/null
@@ -1,21 +0,0 @@
-const { compilerOptions } = require('./tsconfig.json');
-const { pathsToModuleNameMapper } = require("ts-jest");
-const esModules = ["lodash-es", "nanoid"].join("|");
-
-/** @type {import('ts-jest').JestConfigWithTsJest} */
-module.exports = {
- preset: 'ts-jest',
- testEnvironment: 'node',
- roots: ['<rootDir>'],
- modulePaths: [compilerOptions.baseUrl],
- moduleNameMapper: {
- ...pathsToModuleNameMapper(compilerOptions.paths),
- "^lodash-es(/(.*)|$)": "lodash$1",
- "^nanoid(/(.*)|$)": "nanoid$1",
- },
- "transform": {
- "(.*)/node_modules/nanoid/.+\\.(j|t)sx?$": "ts-jest"
- },
- "transformIgnorePatterns": [`/node_modules/(?!${esModules})`],
- "testRegex": "(/__tests__/.*\.(test|spec))\\.(jsx?|tsx?)$",
-};
\ No newline at end of file
diff --git a/frontend/appflowy_tauri/package.json b/frontend/appflowy_tauri/package.json
deleted file mode 100644
index 30c7978771..0000000000
--- a/frontend/appflowy_tauri/package.json
+++ /dev/null
@@ -1,126 +0,0 @@
-{
- "name": "appflowy_tauri",
- "private": true,
- "version": "0.0.0",
- "type": "module",
- "scripts": {
- "dev": "vite",
- "build": "pnpm sync:i18n && tsc && vite build",
- "preview": "vite preview",
- "format": "prettier --write .",
- "test:code": "eslint --max-warnings=0 --ext .js,.ts,.tsx .",
- "test:errors": "pnpm sync:i18n && tsc --noEmit && eslint --ext .js,.ts,.tsx .",
- "test:prettier": "pnpm prettier --list-different src",
- "tauri:clean": "cargo make --cwd .. tauri_clean",
- "tauri:dev": "pnpm sync:i18n && tauri dev",
- "sync:i18n": "node scripts/i18n/index.cjs",
- "css:variables": "node style-dictionary/config.cjs",
- "test": "jest"
- },
- "dependencies": {
- "@emoji-mart/data": "^1.1.2",
- "@emoji-mart/react": "^1.1.1",
- "@emotion/react": "^11.10.6",
- "@emotion/styled": "^11.10.6",
- "@mui/icons-material": "^5.11.11",
- "@mui/material": "^5.11.12",
- "@mui/system": "^5.14.4",
- "@mui/x-date-pickers-pro": "^6.18.2",
- "@reduxjs/toolkit": "2.0.0",
- "@slate-yjs/core": "^1.0.2",
- "@tauri-apps/api": "^1.2.0",
- "@types/react-swipeable-views": "^0.13.4",
- "dayjs": "^1.11.9",
- "emoji-mart": "^5.5.2",
- "emoji-regex": "^10.2.1",
- "events": "^3.3.0",
- "google-protobuf": "^3.15.12",
- "i18next": "^22.4.10",
- "i18next-browser-languagedetector": "^7.0.1",
- "i18next-resources-to-backend": "^1.1.4",
- "is-hotkey": "^0.2.0",
- "jest": "^29.5.0",
- "js-base64": "^3.7.5",
- "katex": "^0.16.7",
- "lodash-es": "^4.17.21",
- "nanoid": "^4.0.0",
- "prismjs": "^1.29.0",
- "protoc-gen-ts": "0.8.7",
- "quill": "^1.3.7",
- "quill-delta": "^5.1.0",
- "react": "^18.2.0",
- "react-beautiful-dnd": "^13.1.1",
- "react-big-calendar": "^1.8.5",
- "react-color": "^2.19.3",
- "react-custom-scrollbars": "^4.2.1",
- "react-datepicker": "^4.23.0",
- "react-dom": "^18.2.0",
- "react-error-boundary": "^3.1.4",
- "react-hot-toast": "^2.4.1",
- "react-i18next": "^12.2.0",
- "react-katex": "^3.0.1",
- "react-redux": "^8.0.5",
- "react-router-dom": "^6.8.0",
- "react-swipeable-views": "^0.14.0",
- "react-transition-group": "^4.4.5",
- "react-virtualized-auto-sizer": "^1.0.20",
- "react-vtree": "^2.0.4",
- "react-window": "^1.8.10",
- "react18-input-otp": "^1.1.2",
- "redux": "^4.2.1",
- "rxjs": "^7.8.0",
- "sass": "^1.70.0",
- "slate": "^0.101.4",
- "slate-history": "^0.100.0",
- "slate-react": "^0.101.3",
- "ts-results": "^3.3.0",
- "unsplash-js": "^7.0.19",
- "utf8": "^3.0.0",
- "valtio": "^1.12.1",
- "yjs": "^13.5.51"
- },
- "devDependencies": {
- "@svgr/plugin-svgo": "^8.0.1",
- "@tauri-apps/cli": "^1.5.6",
- "@types/google-protobuf": "^3.15.12",
- "@types/is-hotkey": "^0.1.7",
- "@types/jest": "^29.5.3",
- "@types/katex": "^0.16.0",
- "@types/lodash-es": "^4.17.11",
- "@types/node": "^18.7.10",
- "@types/prismjs": "^1.26.0",
- "@types/quill": "^2.0.10",
- "@types/react": "^18.0.15",
- "@types/react-beautiful-dnd": "^13.1.3",
- "@types/react-color": "^3.0.6",
- "@types/react-custom-scrollbars": "^4.0.13",
- "@types/react-datepicker": "^4.19.3",
- "@types/react-dom": "^18.0.6",
- "@types/react-katex": "^3.0.0",
- "@types/react-transition-group": "^4.4.6",
- "@types/react-window": "^1.8.8",
- "@types/utf8": "^3.0.1",
- "@types/uuid": "^9.0.1",
- "@typescript-eslint/eslint-plugin": "^5.51.0",
- "@typescript-eslint/parser": "^5.51.0",
- "@vitejs/plugin-react": "^3.0.0",
- "autoprefixer": "^10.4.13",
- "babel-jest": "^29.6.2",
- "eslint": "^8.34.0",
- "eslint-plugin-react": "^7.32.2",
- "eslint-plugin-react-hooks": "^4.6.0",
- "jest-environment-jsdom": "^29.6.2",
- "postcss": "^8.4.21",
- "prettier": "2.8.4",
- "prettier-plugin-tailwindcss": "^0.2.2",
- "style-dictionary": "^3.8.0",
- "tailwindcss": "^3.2.7",
- "ts-jest": "^29.1.1",
- "ts-node-dev": "^2.0.0",
- "tsconfig-paths-jest": "^0.0.1",
- "typescript": "^4.6.4",
- "uuid": "^9.0.0",
- "vite": "^4.0.0",
- "vite-plugin-svgr": "^3.2.0"
- }
-}
diff --git a/frontend/appflowy_tauri/pnpm-lock.yaml b/frontend/appflowy_tauri/pnpm-lock.yaml
deleted file mode 100644
index d670b8b312..0000000000
--- a/frontend/appflowy_tauri/pnpm-lock.yaml
+++ /dev/null
@@ -1,7264 +0,0 @@
-lockfileVersion: '6.0'
-
-dependencies:
- '@emoji-mart/data':
- specifier: ^1.1.2
- version: 1.1.2
- '@emoji-mart/react':
- specifier: ^1.1.1
- '@emotion/react':
- specifier: ^11.10.6
- version: 11.11.0(@types/[email protected])([email protected])
- '@emotion/styled':
- specifier: ^11.10.6
- version: 11.11.0(@emotion/[email protected])(@types/[email protected])([email protected])
- '@mui/icons-material':
- specifier: ^5.11.11
- version: 5.11.16(@mui/[email protected])(@types/[email protected])([email protected])
- '@mui/material':
- specifier: ^5.11.12
- '@mui/system':
- specifier: ^5.14.4
- version: 5.14.4(@emotion/[email protected])(@emotion/[email protected])(@types/[email protected])([email protected])
- '@mui/x-date-pickers-pro':
- specifier: ^6.18.2
- '@reduxjs/toolkit':
- specifier: 2.0.0
- '@slate-yjs/core':
- specifier: ^1.0.2
- '@tauri-apps/api':
- specifier: ^1.2.0
- version: 1.3.0
- '@types/react-swipeable-views':
- specifier: ^0.13.4
- version: 0.13.4
- dayjs:
- specifier: ^1.11.9
- version: 1.11.9
- emoji-mart:
- specifier: ^5.5.2
- version: 5.5.2
- emoji-regex:
- specifier: ^10.2.1
- version: 10.2.1
- events:
- specifier: ^3.3.0
- version: 3.3.0
- google-protobuf:
- specifier: ^3.15.12
- version: 3.21.2
- i18next:
- specifier: ^22.4.10
- version: 22.4.15
- i18next-browser-languagedetector:
- specifier: ^7.0.1
- version: 7.0.1
- i18next-resources-to-backend:
- specifier: ^1.1.4
- version: 1.1.4
- is-hotkey:
- specifier: ^0.2.0
- version: 0.2.0
- jest:
- specifier: ^29.5.0
- version: 29.5.0(@types/[email protected])
- js-base64:
- specifier: ^3.7.5
- version: 3.7.5
- katex:
- specifier: ^0.16.7
- version: 0.16.7
- lodash-es:
- specifier: ^4.17.21
- version: 4.17.21
- nanoid:
- specifier: ^4.0.0
- version: 4.0.2
- prismjs:
- specifier: ^1.29.0
- version: 1.29.0
- protoc-gen-ts:
- specifier: 0.8.7
- version: 0.8.7
- quill:
- specifier: ^1.3.7
- version: 1.3.7
- quill-delta:
- specifier: ^5.1.0
- version: 5.1.0
- react:
- specifier: ^18.2.0
- version: 18.2.0
- react-beautiful-dnd:
- specifier: ^13.1.1
- react-big-calendar:
- specifier: ^1.8.5
- react-color:
- specifier: ^2.19.3
- version: 2.19.3([email protected])
- react-custom-scrollbars:
- specifier: ^4.2.1
- react-datepicker:
- specifier: ^4.23.0
- react-dom:
- specifier: ^18.2.0
- version: 18.2.0([email protected])
- react-error-boundary:
- specifier: ^3.1.4
- version: 3.1.4([email protected])
- react-hot-toast:
- specifier: ^2.4.1
- react-i18next:
- specifier: ^12.2.0
- react-katex:
- specifier: ^3.0.1
- react-redux:
- specifier: ^8.0.5
- react-router-dom:
- specifier: ^6.8.0
- react-swipeable-views:
- specifier: ^0.14.0
- version: 0.14.0([email protected])
- react-transition-group:
- specifier: ^4.4.5
- react-virtualized-auto-sizer:
- specifier: ^1.0.20
- react-vtree:
- specifier: ^2.0.4
- react-window:
- specifier: ^1.8.10
- react18-input-otp:
- specifier: ^1.1.2
- redux:
- specifier: ^4.2.1
- version: 4.2.1
- rxjs:
- specifier: ^7.8.0
- version: 7.8.1
- sass:
- specifier: ^1.70.0
- version: 1.70.0
- slate:
- specifier: ^0.101.4
- version: 0.101.4
- slate-history:
- specifier: ^0.100.0
- version: 0.100.0([email protected])
- slate-react:
- specifier: ^0.101.3
- ts-results:
- specifier: ^3.3.0
- version: 3.3.0
- unsplash-js:
- specifier: ^7.0.19
- version: 7.0.19
- utf8:
- specifier: ^3.0.0
- version: 3.0.0
- valtio:
- specifier: ^1.12.1
- version: 1.12.1(@types/[email protected])([email protected])
- yjs:
- specifier: ^13.5.51
- version: 13.6.1
-
-devDependencies:
- '@svgr/plugin-svgo':
- specifier: ^8.0.1
- version: 8.0.1(@svgr/[email protected])
- '@tauri-apps/cli':
- specifier: ^1.5.6
- version: 1.5.6
- '@types/google-protobuf':
- specifier: ^3.15.12
- version: 3.15.12
- '@types/is-hotkey':
- specifier: ^0.1.7
- version: 0.1.7
- '@types/jest':
- specifier: ^29.5.3
- version: 29.5.3
- '@types/katex':
- specifier: ^0.16.0
- version: 0.16.0
- '@types/lodash-es':
- specifier: ^4.17.11
- version: 4.17.11
- '@types/node':
- specifier: ^18.7.10
- version: 18.16.9
- '@types/prismjs':
- specifier: ^1.26.0
- version: 1.26.0
- '@types/quill':
- specifier: ^2.0.10
- version: 2.0.10
- '@types/react':
- specifier: ^18.0.15
- version: 18.2.6
- '@types/react-beautiful-dnd':
- specifier: ^13.1.3
- version: 13.1.4
- '@types/react-color':
- specifier: ^3.0.6
- version: 3.0.6
- '@types/react-custom-scrollbars':
- specifier: ^4.0.13
- version: 4.0.13
- '@types/react-datepicker':
- specifier: ^4.19.3
- '@types/react-dom':
- specifier: ^18.0.6
- version: 18.2.4
- '@types/react-katex':
- specifier: ^3.0.0
- version: 3.0.0
- '@types/react-transition-group':
- specifier: ^4.4.6
- version: 4.4.6
- '@types/react-window':
- specifier: ^1.8.8
- version: 1.8.8
- '@types/utf8':
- specifier: ^3.0.1
- version: 3.0.1
- '@types/uuid':
- specifier: ^9.0.1
- version: 9.0.1
- '@typescript-eslint/eslint-plugin':
- specifier: ^5.51.0
- version: 5.59.5(@typescript-eslint/[email protected])([email protected])([email protected])
- '@typescript-eslint/parser':
- specifier: ^5.51.0
- '@vitejs/plugin-react':
- specifier: ^3.0.0
- version: 3.1.0([email protected])
- autoprefixer:
- specifier: ^10.4.13
- version: 10.4.14([email protected])
- babel-jest:
- specifier: ^29.6.2
- version: 29.6.2(@babel/[email protected])
- eslint:
- specifier: ^8.34.0
- version: 8.40.0
- eslint-plugin-react:
- specifier: ^7.32.2
- version: 7.32.2([email protected])
- eslint-plugin-react-hooks:
- specifier: ^4.6.0
- version: 4.6.0([email protected])
- jest-environment-jsdom:
- specifier: ^29.6.2
- version: 29.6.2
- postcss:
- specifier: ^8.4.21
- version: 8.4.23
- prettier:
- specifier: 2.8.4
- version: 2.8.4
- prettier-plugin-tailwindcss:
- specifier: ^0.2.2
- version: 0.2.8([email protected])
- style-dictionary:
- specifier: ^3.8.0
- version: 3.8.0
- tailwindcss:
- specifier: ^3.2.7
- version: 3.3.2
- ts-jest:
- specifier: ^29.1.1
- ts-node-dev:
- specifier: ^2.0.0
- version: 2.0.0(@types/[email protected])([email protected])
- tsconfig-paths-jest:
- specifier: ^0.0.1
- version: 0.0.1
- typescript:
- specifier: ^4.6.4
- version: 4.9.5
- uuid:
- specifier: ^9.0.0
- version: 9.0.0
- vite:
- specifier: ^4.0.0
- version: 4.3.5(@types/[email protected])([email protected])
- vite-plugin-svgr:
- specifier: ^3.2.0
- version: 3.2.0([email protected])
-
-packages:
-
- resolution: {integrity: sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==}
- engines: {node: '>=10'}
- dev: true
-
- /@ampproject/[email protected]:
- resolution: {integrity: sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==}
- engines: {node: '>=6.0.0'}
- dependencies:
- '@jridgewell/gen-mapping': 0.3.3
- '@jridgewell/trace-mapping': 0.3.18
-
- resolution: {integrity: sha512-LYvhNKfwWSPpocw8GI7gpK2nq3HSDuEPC/uSYaALSJu9xjsalaaYFOq0Pwt5KmVqwEbZlDu81aLXwBOmD/Fv9g==}
- engines: {node: '>=6.9.0'}
- dependencies:
- '@babel/highlight': 7.18.6
-
- resolution: {integrity: sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==}
- engines: {node: '>=6.9.0'}
- dependencies:
- '@babel/highlight': 7.23.4
- chalk: 2.4.2
-
- resolution: {integrity: sha512-KYMqFYTaenzMK4yUtf4EW9wc4N9ef80FsbMtkwool5zpwl4YrT1SdWYSTRcT94KO4hannogdS+LxY7L+arP3gA==}
- engines: {node: '>=6.9.0'}
-
- resolution: {integrity: sha512-YeM22Sondbo523Sz0+CirSPnbj9bG3P0CdHcBZdqUuaeOaYEFbOLoGU7lebvGP6P5J/WE9wOn7u7C4J9HvS1xQ==}
- engines: {node: '>=6.9.0'}
- dependencies:
- '@ampproject/remapping': 2.2.1
- '@babel/code-frame': 7.21.4
- '@babel/generator': 7.21.5
- '@babel/helper-compilation-targets': 7.21.5(@babel/[email protected])
- '@babel/helper-module-transforms': 7.21.5
- '@babel/helpers': 7.21.5
- '@babel/parser': 7.21.8
- '@babel/template': 7.20.7
- '@babel/traverse': 7.23.7
- '@babel/types': 7.21.5
- convert-source-map: 1.9.0
- debug: 4.3.4
- gensync: 1.0.0-beta.2
- json5: 2.2.3
- semver: 6.3.0
- transitivePeerDependencies:
- - supports-color
-
- resolution: {integrity: sha512-SrKK/sRv8GesIW1bDagf9cCG38IOMYZusoe1dfg0D8aiUe3Amvoj1QtjTPAWcfrZFvIwlleLb0gxzQidL9w14w==}
- engines: {node: '>=6.9.0'}
- dependencies:
- '@babel/types': 7.21.5
- '@jridgewell/gen-mapping': 0.3.3
- '@jridgewell/trace-mapping': 0.3.18
- jsesc: 2.5.2
-
- resolution: {integrity: sha512-qrSfCYxYQB5owCmGLbl8XRpX1ytXlpueOb0N0UmQwA073KZxejgQTzAmJezxvpwQD9uGtK2shHdi55QT+MbjIw==}
- engines: {node: '>=6.9.0'}
- dependencies:
- '@babel/types': 7.23.6
- '@jridgewell/gen-mapping': 0.3.3
- '@jridgewell/trace-mapping': 0.3.18
- jsesc: 2.5.2
-
- resolution: {integrity: sha512-1RkbFGUKex4lvsB9yhIfWltJM5cZKUftB2eNajaDv3dCMEp49iBG0K14uH8NnX9IPux2+mK7JGEOB0jn48/J6w==}
- engines: {node: '>=6.9.0'}
- peerDependencies:
- '@babel/core': ^7.0.0
- dependencies:
- '@babel/compat-data': 7.21.7
- '@babel/core': 7.21.8
- '@babel/helper-validator-option': 7.21.0
- browserslist: 4.21.5
- lru-cache: 5.1.1
- semver: 6.3.0
-
- resolution: {integrity: sha512-IYl4gZ3ETsWocUWgsFZLM5i1BYx9SoemminVEXadgLBa9TdeorzgLKm8wWLA6J1N/kT3Kch8XIk1laNzYoHKvQ==}
- engines: {node: '>=6.9.0'}
-
- resolution: {integrity: sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==}
- engines: {node: '>=6.9.0'}
-
- resolution: {integrity: sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==}
- engines: {node: '>=6.9.0'}
- dependencies:
- '@babel/template': 7.22.15
- '@babel/types': 7.23.6
-
- resolution: {integrity: sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==}
- engines: {node: '>=6.9.0'}
- dependencies:
- '@babel/types': 7.23.6
-
- resolution: {integrity: sha512-orajc5T2PsRYUN3ZryCEFeMDYwyw09c/pZeaQEZPH0MpKzSvn3e0uXsDBu3k03VI+9DBiRo+l22BfKTpKwa/Wg==}
- engines: {node: '>=6.9.0'}
- dependencies:
- '@babel/types': 7.21.5
-
- resolution: {integrity: sha512-bI2Z9zBGY2q5yMHoBvJ2a9iX3ZOAzJPm7Q8Yz6YeoUjU/Cvhmi2G4QyTNyPBqqXSgTjUxRg3L0xV45HvkNWWBw==}
- engines: {node: '>=6.9.0'}
- dependencies:
- '@babel/helper-environment-visitor': 7.21.5
- '@babel/helper-module-imports': 7.21.4
- '@babel/helper-simple-access': 7.21.5
- '@babel/helper-split-export-declaration': 7.18.6
- '@babel/helper-validator-identifier': 7.19.1
- '@babel/template': 7.20.7
- '@babel/traverse': 7.23.7
- '@babel/types': 7.21.5
- transitivePeerDependencies:
- - supports-color
-
- resolution: {integrity: sha512-0WDaIlXKOX/3KfBK/dwP1oQGiPh6rjMkT7HIRv7i5RR2VUMwrx5ZL0dwBkKx7+SW1zwNdgjHd34IMk5ZjTeHVg==}
- engines: {node: '>=6.9.0'}
-
- resolution: {integrity: sha512-ENPDAMC1wAjR0uaCUwliBdiSl1KBJAVnMTzXqi64c2MG8MPR6ii4qf7bSXDqSFbr4W6W028/rf5ivoHop5/mkg==}
- engines: {node: '>=6.9.0'}
- dependencies:
- '@babel/types': 7.21.5
-
- resolution: {integrity: sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==}
- engines: {node: '>=6.9.0'}
- dependencies:
- '@babel/types': 7.21.5
-
- resolution: {integrity: sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==}
- engines: {node: '>=6.9.0'}
- dependencies:
- '@babel/types': 7.23.6
-
- resolution: {integrity: sha512-5pTUx3hAJaZIdW99sJ6ZUUgWq/Y+Hja7TowEnLNMm1VivRgZQL3vpBY3qUACVsvw+yQU6+YgfBVmcbLaZtrA1w==}
- engines: {node: '>=6.9.0'}
-
- resolution: {integrity: sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==}
- engines: {node: '>=6.9.0'}
-
- resolution: {integrity: sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==}
- engines: {node: '>=6.9.0'}
-
- resolution: {integrity: sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==}
- engines: {node: '>=6.9.0'}
-
- resolution: {integrity: sha512-rmL/B8/f0mKS2baE9ZpyTcTavvEuWhTTW8amjzXNvYG4AwBsqTLikfXsEofsJEfKHf+HQVQbFOHy6o+4cnC/fQ==}
- engines: {node: '>=6.9.0'}
-
- resolution: {integrity: sha512-BSY+JSlHxOmGsPTydUkPf1MdMQ3M81x5xGCOVgWM3G8XH77sJ292Y2oqcp0CbbgxhqBuI46iUz1tT7hqP7EfgA==}
- engines: {node: '>=6.9.0'}
- dependencies:
- '@babel/template': 7.20.7
- '@babel/traverse': 7.23.7
- '@babel/types': 7.21.5
- transitivePeerDependencies:
- - supports-color
-
- resolution: {integrity: sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==}
- engines: {node: '>=6.9.0'}
- dependencies:
- '@babel/helper-validator-identifier': 7.19.1
- chalk: 2.4.2
- js-tokens: 4.0.0
-
- resolution: {integrity: sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==}
- engines: {node: '>=6.9.0'}
- dependencies:
- '@babel/helper-validator-identifier': 7.22.20
- chalk: 2.4.2
- js-tokens: 4.0.0
-
- resolution: {integrity: sha512-6zavDGdzG3gUqAdWvlLFfk+36RilI+Pwyuuh7HItyeScCWP3k6i8vKclAQ0bM/0y/Kz/xiwvxhMv9MgTJP5gmA==}
- engines: {node: '>=6.0.0'}
- hasBin: true
- dependencies:
- '@babel/types': 7.21.5
-
- resolution: {integrity: sha512-Z2uID7YJ7oNvAI20O9X0bblw7Qqs8Q2hFy0R9tAfnfLkp5MW0UH9eUvnDSnFwKZ0AvgS1ucqR4KzvVHgnke1VQ==}
- engines: {node: '>=6.0.0'}
- hasBin: true
- dependencies:
- '@babel/types': 7.23.6
-
- resolution: {integrity: sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==}
- peerDependencies:
- '@babel/core': ^7.0.0-0
- dependencies:
- '@babel/core': 7.21.8
- '@babel/helper-plugin-utils': 7.21.5
-
- resolution: {integrity: sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==}
- peerDependencies:
- '@babel/core': ^7.0.0-0
- dependencies:
- '@babel/core': 7.21.8
- '@babel/helper-plugin-utils': 7.21.5
-
- resolution: {integrity: sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==}
- peerDependencies:
- '@babel/core': ^7.0.0-0
- dependencies:
- '@babel/core': 7.21.8
- '@babel/helper-plugin-utils': 7.21.5
-
- resolution: {integrity: sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==}
- peerDependencies:
- '@babel/core': ^7.0.0-0
- dependencies:
- '@babel/core': 7.21.8
- '@babel/helper-plugin-utils': 7.21.5
-
- resolution: {integrity: sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==}
- peerDependencies:
- '@babel/core': ^7.0.0-0
- dependencies:
- '@babel/core': 7.21.8
- '@babel/helper-plugin-utils': 7.21.5
-
- resolution: {integrity: sha512-5hewiLct5OKyh6PLKEYaFclcqtIgCb6bmELouxjF6up5q3Sov7rOayW4RwhbaBL0dit8rA80GNfY+UuDp2mBbQ==}
- engines: {node: '>=6.9.0'}
- peerDependencies:
- '@babel/core': ^7.0.0-0
- dependencies:
- '@babel/core': 7.21.8
- '@babel/helper-plugin-utils': 7.21.5
-
- resolution: {integrity: sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==}
- peerDependencies:
- '@babel/core': ^7.0.0-0
- dependencies:
- '@babel/core': 7.21.8
- '@babel/helper-plugin-utils': 7.21.5
-
- resolution: {integrity: sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==}
- peerDependencies:
- '@babel/core': ^7.0.0-0
- dependencies:
- '@babel/core': 7.21.8
- '@babel/helper-plugin-utils': 7.21.5
-
- resolution: {integrity: sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==}
- peerDependencies:
- '@babel/core': ^7.0.0-0
- dependencies:
- '@babel/core': 7.21.8
- '@babel/helper-plugin-utils': 7.21.5
-
- resolution: {integrity: sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==}
- peerDependencies:
- '@babel/core': ^7.0.0-0
- dependencies:
- '@babel/core': 7.21.8
- '@babel/helper-plugin-utils': 7.21.5
-
- resolution: {integrity: sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==}
- peerDependencies:
- '@babel/core': ^7.0.0-0
- dependencies:
- '@babel/core': 7.21.8
- '@babel/helper-plugin-utils': 7.21.5
-
- resolution: {integrity: sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==}
- peerDependencies:
- '@babel/core': ^7.0.0-0
- dependencies:
- '@babel/core': 7.21.8
- '@babel/helper-plugin-utils': 7.21.5
-
- resolution: {integrity: sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==}
- engines: {node: '>=6.9.0'}
- peerDependencies:
- '@babel/core': ^7.0.0-0
- dependencies:
- '@babel/core': 7.21.8
- '@babel/helper-plugin-utils': 7.21.5
-
- resolution: {integrity: sha512-xz0D39NvhQn4t4RNsHmDnnsaQizIlUkdtYvLs8La1BlfjQ6JEwxkJGeqJMW2tAXx+q6H+WFuUTXNdYVpEya0YA==}
- engines: {node: '>=6.9.0'}
- peerDependencies:
- '@babel/core': ^7.0.0-0
- dependencies:
- '@babel/core': 7.21.8
- '@babel/helper-plugin-utils': 7.21.5
-
- resolution: {integrity: sha512-f/Eq+79JEu+KUANFks9UZCcvydOOGMgF7jBrcwjHa5jTZD8JivnhCJYvmlhR/WTXBWonDExPoW0eO/CR4QJirA==}
- engines: {node: '>=6.9.0'}
- peerDependencies:
- '@babel/core': ^7.0.0-0
- dependencies:
- '@babel/core': 7.21.8
- '@babel/helper-plugin-utils': 7.21.5
- dev: true
-
- resolution: {integrity: sha512-RpAi004QyMNisst/pvSanoRdJ4q+jMCWyk9zdw/CyLB9j8RXEahodR6l2GyttDRyEVWZtbN+TpLiHJ3t34LbsQ==}
- engines: {node: '>=6.9.0'}
- peerDependencies:
- '@babel/core': ^7.0.0-0
- dependencies:
- '@babel/core': 7.21.8
- '@babel/helper-plugin-utils': 7.21.5
- dev: true
-
- resolution: {integrity: sha512-7hGhzlcmg01CvH1EHdSPVXYX1aJ8KCEyz6I9xYIi/asDtzBPMyMhVibhM/K6g/5qnKBwjZtp10bNZIEFTRW1MA==}
- dependencies:
- regenerator-runtime: 0.12.1
- dev: false
-
- resolution: {integrity: sha512-8jI69toZqqcsnqGGqwGS4Qb1VwLOEp4hz+CXPywcvjs60u3B4Pom/U/7rm4W8tMOYEB+E9wgD0mW1l3r8qlI9Q==}
- engines: {node: '>=6.9.0'}
- dependencies:
- regenerator-runtime: 0.13.11
- dev: false
-
- resolution: {integrity: sha512-21t/fkKLMZI4pqP2wlmsQAWnYW1PDyKyyUV4vCi+B25ydmdaYTKXPwCj0BzSUnZf4seIiYvSA3jcZ3gdsMFkLQ==}
- engines: {node: '>=6.9.0'}
- dependencies:
- regenerator-runtime: 0.14.0
- dev: false
-
- resolution: {integrity: sha512-2Yv65nlWnWlSpe3fXEyX5i7fx5kIKo4Qbcj+hMO0odwaneFjfXw5fdum+4yL20O0QiaHpia0cYQ9xpNMqrBwHg==}
- engines: {node: '>=6.9.0'}
- dependencies:
- regenerator-runtime: 0.14.0
-
- resolution: {integrity: sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw==}
- engines: {node: '>=6.9.0'}
- dependencies:
- '@babel/code-frame': 7.21.4
- '@babel/parser': 7.21.8
- '@babel/types': 7.21.5
-
- resolution: {integrity: sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==}
- engines: {node: '>=6.9.0'}
- dependencies:
- '@babel/code-frame': 7.23.5
- '@babel/parser': 7.23.6
- '@babel/types': 7.23.6
-
- resolution: {integrity: sha512-tY3mM8rH9jM0YHFGyfC0/xf+SB5eKUu7HPj7/k3fpi9dAlsMc5YbQvDi0Sh2QTPXqMhyaAtzAr807TIyfQrmyg==}
- engines: {node: '>=6.9.0'}
- dependencies:
- '@babel/code-frame': 7.23.5
- '@babel/generator': 7.23.6
- '@babel/helper-environment-visitor': 7.22.20
- '@babel/helper-function-name': 7.23.0
- '@babel/helper-hoist-variables': 7.22.5
- '@babel/helper-split-export-declaration': 7.22.6
- '@babel/parser': 7.23.6
- '@babel/types': 7.23.6
- debug: 4.3.4
- globals: 11.12.0
- transitivePeerDependencies:
- - supports-color
-
- resolution: {integrity: sha512-m4AfNvVF2mVC/F7fDEdH2El3HzUg9It/XsCxZiOTTA3m3qYfcSVSbTfM6Q9xG+hYDniZssYhlXKKUMD5m8tF4Q==}
- engines: {node: '>=6.9.0'}
- dependencies:
- '@babel/helper-string-parser': 7.21.5
- '@babel/helper-validator-identifier': 7.19.1
- to-fast-properties: 2.0.0
-
- resolution: {integrity: sha512-+uarb83brBzPKN38NX1MkB6vb6+mwvR6amUulqAE7ccQw1pEl+bCia9TbdG1lsnFP7lZySvUn37CHyXQdfTwzg==}
- engines: {node: '>=6.9.0'}
- dependencies:
- '@babel/helper-string-parser': 7.23.4
- '@babel/helper-validator-identifier': 7.22.20
- to-fast-properties: 2.0.0
-
- resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==}
-
- /@cspotcode/[email protected]:
- resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==}
- engines: {node: '>=12'}
- dependencies:
- '@jridgewell/trace-mapping': 0.3.9
- dev: true
-
- /@emoji-mart/[email protected]:
- resolution: {integrity: sha512-1HP8BxD2azjqWJvxIaWAMyTySeZY0Osr83ukYjltPVkNXeJvTz7yDrPLBtnrD5uqJ3tg4CcLuuBW09wahqL/fg==}
- dev: false
-
- resolution: {integrity: sha512-NMlFNeWgv1//uPsvLxvGQoIerPuVdXwK/EUek8OOkJ6wVOWPUizRBJU0hDqWZCOROVpfBgCemaC3m6jDOXi03g==}
- peerDependencies:
- emoji-mart: ^5.2
- react: ^16.8 || ^17 || ^18
- dependencies:
- emoji-mart: 5.5.2
- react: 18.2.0
- dev: false
-
- /@emotion/[email protected]:
- resolution: {integrity: sha512-m4HEDZleaaCH+XgDDsPF15Ht6wTLsgDTeR3WYj9Q/k76JtWhrJjcP4+/XlG8LGT/Rol9qUfOIztXeA84ATpqPQ==}
- dependencies:
- '@babel/helper-module-imports': 7.21.4
- '@babel/runtime': 7.21.5
- '@emotion/hash': 0.9.1
- '@emotion/memoize': 0.8.1
- '@emotion/serialize': 1.1.2
- babel-plugin-macros: 3.1.0
- convert-source-map: 1.9.0
- escape-string-regexp: 4.0.0
- find-root: 1.1.0
- source-map: 0.5.7
- stylis: 4.2.0
- dev: false
-
- /@emotion/[email protected]:
- resolution: {integrity: sha512-P34z9ssTCBi3e9EI1ZsWpNHcfY1r09ZO0rZbRO2ob3ZQMnFI35jB536qoXbkdesr5EUhYi22anuEJuyxifaqAQ==}
- dependencies:
- '@emotion/memoize': 0.8.1
- '@emotion/sheet': 1.2.2
- '@emotion/utils': 1.2.1
- '@emotion/weak-memoize': 0.3.1
- stylis: 4.2.0
- dev: false
-
- /@emotion/[email protected]:
- resolution: {integrity: sha512-gJB6HLm5rYwSLI6PQa+X1t5CFGrv1J1TWG+sOyMCeKz2ojaj6Fnl/rZEspogG+cvqbt4AE/2eIyD2QfLKTBNlQ==}
- dev: false
-
- /@emotion/[email protected]:
- resolution: {integrity: sha512-61Mf7Ufx4aDxx1xlDeOm8aFFigGHE4z+0sKCa+IHCeZKiyP9RLD0Mmx7m8b9/Cf37f7NAvQOOJAbQQGVr5uERw==}
- dependencies:
- '@emotion/memoize': 0.8.1
- dev: false
-
- /@emotion/[email protected]:
- resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==}
- dev: false
-
- resolution: {integrity: sha512-ZSK3ZJsNkwfjT3JpDAWJZlrGD81Z3ytNDsxw1LKq1o+xkmO5pnWfr6gmCC8gHEFf3nSSX/09YrG67jybNPxSUw==}
- peerDependencies:
- '@types/react': '*'
- react: '>=16.8.0'
- peerDependenciesMeta:
- '@types/react':
- optional: true
- dependencies:
- '@babel/runtime': 7.21.5
- '@emotion/babel-plugin': 11.11.0
- '@emotion/cache': 11.11.0
- '@emotion/serialize': 1.1.2
- '@emotion/use-insertion-effect-with-fallbacks': 1.0.1([email protected])
- '@emotion/utils': 1.2.1
- '@emotion/weak-memoize': 0.3.1
- '@types/react': 18.2.6
- hoist-non-react-statics: 3.3.2
- react: 18.2.0
- dev: false
-
- /@emotion/[email protected]:
- resolution: {integrity: sha512-zR6a/fkFP4EAcCMQtLOhIgpprZOwNmCldtpaISpvz348+DP4Mz8ZoKaGGCQpbzepNIUWbq4w6hNZkwDyKoS+HA==}
- dependencies:
- '@emotion/hash': 0.9.1
- '@emotion/memoize': 0.8.1
- '@emotion/unitless': 0.8.1
- '@emotion/utils': 1.2.1
- csstype: 3.1.2
- dev: false
-
- /@emotion/[email protected]:
- resolution: {integrity: sha512-0QBtGvaqtWi+nx6doRwDdBIzhNdZrXUppvTM4dtZZWEGTXL/XE/yJxLMGlDT1Gt+UHH5IX1n+jkXyytE/av7OA==}
- dev: false
-
- resolution: {integrity: sha512-hM5Nnvu9P3midq5aaXj4I+lnSfNi7Pmd4EWk1fOZ3pxookaQTNew6bp4JaCBYM4HVFZF9g7UjJmsUmC2JlxOng==}
- peerDependencies:
- '@emotion/react': ^11.0.0-rc.0
- '@types/react': '*'
- react: '>=16.8.0'
- peerDependenciesMeta:
- '@types/react':
- optional: true
- dependencies:
- '@babel/runtime': 7.21.5
- '@emotion/babel-plugin': 11.11.0
- '@emotion/is-prop-valid': 1.2.1
- '@emotion/react': 11.11.0(@types/[email protected])([email protected])
- '@emotion/serialize': 1.1.2
- '@emotion/use-insertion-effect-with-fallbacks': 1.0.1([email protected])
- '@emotion/utils': 1.2.1
- '@types/react': 18.2.6
- react: 18.2.0
- dev: false
-
- /@emotion/[email protected]:
- resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==}
- dev: false
-
- resolution: {integrity: sha512-jT/qyKZ9rzLErtrjGgdkMBn2OP8wl0G3sQlBb3YPryvKHsjvINUhVaPFfP+fpBcOkmrVOVEEHQFJ7nbj2TH2gw==}
- peerDependencies:
- react: '>=16.8.0'
- dependencies:
- react: 18.2.0
- dev: false
-
- /@emotion/[email protected]:
- resolution: {integrity: sha512-Y2tGf3I+XVnajdItskUCn6LX+VUDmP6lTL4fcqsXAv43dnlbZiuW4MWQW38rW/BVWSE7Q/7+XQocmpnRYILUmg==}
- dev: false
-
- /@emotion/[email protected]:
- resolution: {integrity: sha512-EsBwpc7hBUJWAsNPBmJy4hxWx12v6bshQsldrVmjxJoc3isbxhOrF2IcCpaXxfvq03NwkI7sbsOLXbYuqF/8Ww==}
- dev: false
-
- /@esbuild/[email protected]:
- resolution: {integrity: sha512-KBMWvEZooR7+kzY0BtbTQn0OAYY7CsiydT63pVEaPtVYF0hXbUaOyZog37DKxK7NF3XacBJOpYT4adIJh+avxA==}
- engines: {node: '>=12'}
- cpu: [arm64]
- os: [android]
- requiresBuild: true
- dev: true
- optional: true
-
- /@esbuild/[email protected]:
- resolution: {integrity: sha512-rIKddzqhmav7MSmoFCmDIb6e2W57geRsM94gV2l38fzhXMwq7hZoClug9USI2pFRGL06f4IOPHHpFNOkWieR8A==}
- engines: {node: '>=12'}
- cpu: [arm]
- os: [android]
- requiresBuild: true
- dev: true
- optional: true
-
- /@esbuild/[email protected]:
- resolution: {integrity: sha512-uUTTc4xGNDT7YSArp/zbtmbhO0uEEK9/ETW29Wk1thYUJBz3IVnvgEiEwEa9IeLyvnpKrWK64Utw2bgUmDveww==}
- engines: {node: '>=12'}
- cpu: [x64]
- os: [android]
- requiresBuild: true
- dev: true
- optional: true
-
- /@esbuild/[email protected]:
- resolution: {integrity: sha512-80wEoCfF/hFKM6WE1FyBHc9SfUblloAWx6FJkFWTWiCoht9Mc0ARGEM47e67W9rI09YoUxJL68WHfDRYEAvOhg==}
- engines: {node: '>=12'}
- cpu: [arm64]
- os: [darwin]
- requiresBuild: true
- dev: true
- optional: true
-
- /@esbuild/[email protected]:
- resolution: {integrity: sha512-IJM4JJsLhRYr9xdtLytPLSH9k/oxR3boaUIYiHkAawtwNOXKE8KoU8tMvryogdcT8AU+Bflmh81Xn6Q0vTZbQw==}
- engines: {node: '>=12'}
- cpu: [x64]
- os: [darwin]
- requiresBuild: true
- dev: true
- optional: true
-
- /@esbuild/[email protected]:
- resolution: {integrity: sha512-pBwbc7DufluUeGdjSU5Si+P3SoMF5DQ/F/UmTSb8HXO80ZEAJmrykPyzo1IfNbAoaqw48YRpv8shwd1NoI0jcQ==}
- engines: {node: '>=12'}
- cpu: [arm64]
- os: [freebsd]
- requiresBuild: true
- dev: true
- optional: true
-
- /@esbuild/[email protected]:
- resolution: {integrity: sha512-4lu+n8Wk0XlajEhbEffdy2xy53dpR06SlzvhGByyg36qJw6Kpfk7cp45DR/62aPH9mtJRmIyrXAS5UWBrJT6TQ==}
- engines: {node: '>=12'}
- cpu: [x64]
- os: [freebsd]
- requiresBuild: true
- dev: true
- optional: true
-
- /@esbuild/[email protected]:
- resolution: {integrity: sha512-ct1Tg3WGwd3P+oZYqic+YZF4snNl2bsnMKRkb3ozHmnM0dGWuxcPTTntAF6bOP0Sp4x0PjSF+4uHQ1xvxfRKqg==}
- engines: {node: '>=12'}
- cpu: [arm64]
- os: [linux]
- requiresBuild: true
- dev: true
- optional: true
-
- /@esbuild/[email protected]:
- resolution: {integrity: sha512-cdmT3KxjlOQ/gZ2cjfrQOtmhG4HJs6hhvm3mWSRDPtZ/lP5oe8FWceS10JaSJC13GBd4eH/haHnqf7hhGNLerA==}
- engines: {node: '>=12'}
- cpu: [arm]
- os: [linux]
- requiresBuild: true
- dev: true
- optional: true
-
- /@esbuild/[email protected]:
- resolution: {integrity: sha512-w4IRhSy1VbsNxHRQpeGCHEmibqdTUx61Vc38APcsRbuVgK0OPEnQ0YD39Brymn96mOx48Y2laBQGqgZ0j9w6SQ==}
- engines: {node: '>=12'}
- cpu: [ia32]
- os: [linux]
- requiresBuild: true
- dev: true
- optional: true
-
- /@esbuild/[email protected]:
- resolution: {integrity: sha512-2iAngUbBPMq439a+z//gE+9WBldoMp1s5GWsUSgqHLzLJ9WoZLZhpwWuym0u0u/4XmZ3gpHmzV84PonE+9IIdQ==}
- engines: {node: '>=12'}
- cpu: [loong64]
- os: [linux]
- requiresBuild: true
- dev: true
- optional: true
-
- /@esbuild/[email protected]:
- resolution: {integrity: sha512-LKJltc4LVdMKHsrFe4MGNPp0hqDFA1Wpt3jE1gEyM3nKUvOiO//9PheZZHfYRfYl6AwdTH4aTcXSqBerX0ml4A==}
- engines: {node: '>=12'}
- cpu: [mips64el]
- os: [linux]
- requiresBuild: true
- dev: true
- optional: true
-
- /@esbuild/[email protected]:
- resolution: {integrity: sha512-/c/DGybs95WXNS8y3Ti/ytqETiW7EU44MEKuCAcpPto3YjQbyK3IQVKfF6nbghD7EcLUGl0NbiL5Rt5DMhn5tg==}
- engines: {node: '>=12'}
- cpu: [ppc64]
- os: [linux]
- requiresBuild: true
- dev: true
- optional: true
-
- /@esbuild/[email protected]:
- resolution: {integrity: sha512-FC3nUAWhvFoutlhAkgHf8f5HwFWUL6bYdvLc/TTuxKlvLi3+pPzdZiFKSWz/PF30TB1K19SuCxDTI5KcqASJqA==}
- engines: {node: '>=12'}
- cpu: [riscv64]
- os: [linux]
- requiresBuild: true
- dev: true
- optional: true
-
- /@esbuild/[email protected]:
- resolution: {integrity: sha512-IbFsFbxMWLuKEbH+7sTkKzL6NJmG2vRyy6K7JJo55w+8xDk7RElYn6xvXtDW8HCfoKBFK69f3pgBJSUSQPr+4Q==}
- engines: {node: '>=12'}
- cpu: [s390x]
- os: [linux]
- requiresBuild: true
- dev: true
- optional: true
-
- /@esbuild/[email protected]:
- resolution: {integrity: sha512-68ngA9lg2H6zkZcyp22tsVt38mlhWde8l3eJLWkyLrp4HwMUr3c1s/M2t7+kHIhvMjglIBrFpncX1SzMckomGw==}
- engines: {node: '>=12'}
- cpu: [x64]
- os: [linux]
- requiresBuild: true
- dev: true
- optional: true
-
- /@esbuild/[email protected]:
- resolution: {integrity: sha512-CwFq42rXCR8TYIjIfpXCbRX0rp1jo6cPIUPSaWwzbVI4aOfX96OXY8M6KNmtPcg7QjYeDmN+DD0Wp3LaBOLf4Q==}
- engines: {node: '>=12'}
- cpu: [x64]
- os: [netbsd]
- requiresBuild: true
- dev: true
- optional: true
-
- /@esbuild/[email protected]:
- resolution: {integrity: sha512-cnq5brJYrSZ2CF6c35eCmviIN3k3RczmHz8eYaVlNasVqsNY+JKohZU5MKmaOI+KkllCdzOKKdPs762VCPC20g==}
- engines: {node: '>=12'}
- cpu: [x64]
- os: [openbsd]
- requiresBuild: true
- dev: true
- optional: true
-
- /@esbuild/[email protected]:
- resolution: {integrity: sha512-vCRT7yP3zX+bKWFeP/zdS6SqdWB8OIpaRq/mbXQxTGHnIxspRtigpkUcDMlSCOejlHowLqII7K2JKevwyRP2rg==}
- engines: {node: '>=12'}
- cpu: [x64]
- os: [sunos]
- requiresBuild: true
- dev: true
- optional: true
-
- /@esbuild/[email protected]:
- resolution: {integrity: sha512-yYx+8jwowUstVdorcMdNlzklLYhPxjniHWFKgRqH7IFlUEa0Umu3KuYplf1HUZZ422e3NU9F4LGb+4O0Kdcaag==}
- engines: {node: '>=12'}
- cpu: [arm64]
- os: [win32]
- requiresBuild: true
- dev: true
- optional: true
-
- /@esbuild/[email protected]:
- resolution: {integrity: sha512-eggDKanJszUtCdlVs0RB+h35wNlb5v4TWEkq4vZcmVt5u/HiDZrTXe2bWFQUez3RgNHwx/x4sk5++4NSSicKkw==}
- engines: {node: '>=12'}
- cpu: [ia32]
- os: [win32]
- requiresBuild: true
- dev: true
- optional: true
-
- /@esbuild/[email protected]:
- resolution: {integrity: sha512-lAhycmKnVOuRYNtRtatQR1LPQf2oYCkRGkSFnseDAKPl8lu5SOsK/e1sXe5a0Pc5kHIHe6P2I/ilntNv2xf3cA==}
- engines: {node: '>=12'}
- cpu: [x64]
- os: [win32]
- requiresBuild: true
- dev: true
- optional: true
-
- /@eslint-community/[email protected]([email protected]):
- resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==}
- engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
- peerDependencies:
- eslint: ^6.0.0 || ^7.0.0 || >=8.0.0
- dependencies:
- eslint: 8.40.0
- eslint-visitor-keys: 3.4.1
- dev: true
-
- /@eslint-community/[email protected]:
- resolution: {integrity: sha512-Z5ba73P98O1KUYCCJTUeVpja9RcGoMdncZ6T49FCUl2lN38JtCJ+3WgIDBv0AuY4WChU5PmtJmOCTlN6FZTFKQ==}
- engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0}
- dev: true
-
- /@eslint/[email protected]:
- resolution: {integrity: sha512-+5gy6OQfk+xx3q0d6jGZZC3f3KzAkXc/IanVxd1is/VIIziRqqt3ongQz0FiTUXqTk0c7aDB3OaFuKnuSoJicQ==}
- engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
- dependencies:
- ajv: 6.12.6
- debug: 4.3.4
- espree: 9.5.2
- globals: 13.20.0
- ignore: 5.2.4
- import-fresh: 3.3.0
- js-yaml: 4.1.0
- minimatch: 3.1.2
- strip-json-comments: 3.1.1
- transitivePeerDependencies:
- - supports-color
- dev: true
-
- /@eslint/[email protected]:
- resolution: {integrity: sha512-ElyB54bJIhXQYVKjDSvCkPO1iU1tSAeVQJbllWJq1XQSmmA4dgFk8CbiBGpiOPxleE48vDogxCtmMYku4HSVLA==}
- engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
- dev: true
-
- /@floating-ui/[email protected]:
- resolution: {integrity: sha512-kK1h4m36DQ0UHGj5Ah4db7R0rHemTqqO0QLvUqi1/mUUp3LuAWbWxdxSIf/XsnH9VS6rRVPLJCncjRzUvyCLXg==}
- dependencies:
- '@floating-ui/utils': 0.1.6
- dev: false
-
- /@floating-ui/[email protected]:
- resolution: {integrity: sha512-ClAbQnEqJAKCJOEbbLo5IUlZHkNszqhuxS4fHAVxRPXPya6Ysf2G8KypnYcOTpx6I8xcgF9bbHb6g/2KpbV8qA==}
- dependencies:
- '@floating-ui/core': 1.5.0
- '@floating-ui/utils': 0.1.6
- dev: false
-
- resolution: {integrity: sha512-CF8k2rgKeh/49UrnIBs4BdxPUV6vize/Db1d/YbCLyp9GiVZ0BEwf5AiDSxJRCr6yOkGqTFHtmrULxkEfYZ7dQ==}
- peerDependencies:
- react: '>=16.8.0'
- react-dom: '>=16.8.0'
- dependencies:
- '@floating-ui/dom': 1.5.3
- react: 18.2.0
- react-dom: 18.2.0([email protected])
- dev: false
-
- /@floating-ui/[email protected]:
- resolution: {integrity: sha512-OfX7E2oUDYxtBvsuS4e/jSn4Q9Qb6DzgeYtsAdkPZ47znpoNsMgZw0+tVijiv3uGNR6dgNlty6r9rzIzHjtd/A==}
- dev: false
-
- /@humanwhocodes/[email protected]:
- resolution: {integrity: sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==}
- engines: {node: '>=10.10.0'}
- dependencies:
- '@humanwhocodes/object-schema': 1.2.1
- debug: 4.3.4
- minimatch: 3.1.2
- transitivePeerDependencies:
- - supports-color
- dev: true
-
- /@humanwhocodes/[email protected]:
- resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==}
- engines: {node: '>=12.22'}
- dev: true
-
- /@humanwhocodes/[email protected]:
- resolution: {integrity: sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==}
- dev: true
-
- resolution: {integrity: sha512-QPcGmICAPbGLGb6F/yNf/KzKqvFx8z5qx3D1yFqVAjoFmXK35EgyW+cJ57Te3CNsmzblwtzakLGFqHPqrfb4Tw==}
- peerDependencies:
- react: '*'
- dependencies:
- react: 18.2.0
- dev: false
-
- /@istanbuljs/[email protected]:
- resolution: {integrity: sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==}
- engines: {node: '>=8'}
- dependencies:
- camelcase: 5.3.1
- find-up: 4.1.0
- get-package-type: 0.1.0
- js-yaml: 3.14.1
- resolve-from: 5.0.0
-
- /@istanbuljs/[email protected]:
- resolution: {integrity: sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==}
- engines: {node: '>=8'}
-
- resolution: {integrity: sha512-NEpkObxPwyw/XxZVLPmAGKE89IQRp4puc6IQRPru6JKd1M3fW9v1xM1AnzIJE65hbCkzQAdnL8P47e9hzhiYLQ==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- dependencies:
- '@jest/types': 29.5.0
- '@types/node': 18.16.9
- chalk: 4.1.2
- jest-message-util: 29.5.0
- jest-util: 29.5.0
- slash: 3.0.0
-
- resolution: {integrity: sha512-28UzQc7ulUrOQw1IsN/kv1QES3q2kkbl/wGslyhAclqZ/8cMdB5M68BffkIdSJgKBUt50d3hbwJ92XESlE7LiQ==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- peerDependencies:
- node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0
- peerDependenciesMeta:
- node-notifier:
- optional: true
- dependencies:
- '@jest/console': 29.5.0
- '@jest/reporters': 29.5.0
- '@jest/test-result': 29.5.0
- '@jest/transform': 29.5.0
- '@jest/types': 29.5.0
- '@types/node': 18.16.9
- ansi-escapes: 4.3.2
- chalk: 4.1.2
- ci-info: 3.8.0
- exit: 0.1.2
- graceful-fs: 4.2.11
- jest-changed-files: 29.5.0
- jest-config: 29.5.0(@types/[email protected])
- jest-haste-map: 29.5.0
- jest-message-util: 29.5.0
- jest-regex-util: 29.4.3
- jest-resolve: 29.5.0
- jest-resolve-dependencies: 29.5.0
- jest-runner: 29.5.0
- jest-runtime: 29.5.0
- jest-snapshot: 29.5.0
- jest-util: 29.5.0
- jest-validate: 29.5.0
- jest-watcher: 29.5.0
- micromatch: 4.0.5
- pretty-format: 29.5.0
- slash: 3.0.0
- strip-ansi: 6.0.1
- transitivePeerDependencies:
- - supports-color
- - ts-node
-
- resolution: {integrity: sha512-5FXw2+wD29YU1d4I2htpRX7jYnAyTRjP2CsXQdo9SAM8g3ifxWPSV0HnClSn71xwctr0U3oZIIH+dtbfmnbXVQ==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- dependencies:
- '@jest/fake-timers': 29.5.0
- '@jest/types': 29.5.0
- '@types/node': 18.16.9
- jest-mock: 29.5.0
-
- resolution: {integrity: sha512-sQ0SULEjA1XUTHmkBRl7A1dyITM9yb1yb3ZNKPX3KlTd6IG7mWUe3e2yfExtC2Zz1Q+mMckOLHmL/qLiuQJrBQ==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- dependencies:
- '@jest/fake-timers': 29.6.4
- '@jest/types': 29.6.3
- '@types/node': 18.16.9
- jest-mock: 29.6.3
-
- resolution: {integrity: sha512-fmKzsidoXQT2KwnrwE0SQq3uj8Z763vzR8LnLBwC2qYWEFpjX8daRsk6rHUM1QvNlEW/UJXNXm59ztmJJWs2Mg==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- dependencies:
- jest-get-type: 29.4.3
-
- resolution: {integrity: sha512-PueDR2HGihN3ciUNGr4uelropW7rqUfTiOn+8u0leg/42UhblPxHkfoh0Ruu3I9Y1962P3u2DY4+h7GVTSVU6g==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- dependencies:
- expect: 29.5.0
- jest-snapshot: 29.5.0
- transitivePeerDependencies:
- - supports-color
-
- resolution: {integrity: sha512-9ARvuAAQcBwDAqOnglWq2zwNIRUDtk/SCkp/ToGEhFv5r86K21l+VEs0qNTaXtyiY0lEePl3kylijSYJQqdbDg==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- dependencies:
- '@jest/types': 29.5.0
- '@sinonjs/fake-timers': 10.1.0
- '@types/node': 18.16.9
- jest-message-util: 29.5.0
- jest-mock: 29.5.0
- jest-util: 29.5.0
-
- resolution: {integrity: sha512-6UkCwzoBK60edXIIWb0/KWkuj7R7Qq91vVInOe3De6DSpaEiqjKcJw4F7XUet24Wupahj9J6PlR09JqJ5ySDHw==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- dependencies:
- '@jest/types': 29.6.3
- '@sinonjs/fake-timers': 10.1.0
- '@types/node': 18.16.9
- jest-message-util: 29.6.3
- jest-mock: 29.6.3
- jest-util: 29.6.3
-
- resolution: {integrity: sha512-S02y0qMWGihdzNbUiqSAiKSpSozSuHX5UYc7QbnHP+D9Lyw8DgGGCinrN9uSuHPeKgSSzvPom2q1nAtBvUsvPQ==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- dependencies:
- '@jest/environment': 29.5.0
- '@jest/expect': 29.5.0
- '@jest/types': 29.5.0
- jest-mock: 29.5.0
- transitivePeerDependencies:
- - supports-color
-
- resolution: {integrity: sha512-D05STXqj/M8bP9hQNSICtPqz97u7ffGzZu+9XLucXhkOFBqKcXe04JLZOgIekOxdb73MAoBUFnqvf7MCpKk5OA==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- peerDependencies:
- node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0
- peerDependenciesMeta:
- node-notifier:
- optional: true
- dependencies:
- '@bcoe/v8-coverage': 0.2.3
- '@jest/console': 29.5.0
- '@jest/test-result': 29.5.0
- '@jest/transform': 29.5.0
- '@jest/types': 29.5.0
- '@jridgewell/trace-mapping': 0.3.18
- '@types/node': 18.16.9
- chalk: 4.1.2
- collect-v8-coverage: 1.0.1
- exit: 0.1.2
- glob: 7.2.3
- graceful-fs: 4.2.11
- istanbul-lib-coverage: 3.2.0
- istanbul-lib-instrument: 5.2.1
- istanbul-lib-report: 3.0.0
- istanbul-lib-source-maps: 4.0.1
- istanbul-reports: 3.1.5
- jest-message-util: 29.5.0
- jest-util: 29.5.0
- jest-worker: 29.5.0
- slash: 3.0.0
- string-length: 4.0.2
- strip-ansi: 6.0.1
- v8-to-istanbul: 9.1.0
- transitivePeerDependencies:
- - supports-color
-
- resolution: {integrity: sha512-VLYKXQmtmuEz6IxJsrZwzG9NvtkQsWNnWMsKxqWNu3+CnfzJQhp0WDDKWLVV9hLKr0l3SLLFRqcYHjhtyuDVxg==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- dependencies:
- '@sinclair/typebox': 0.25.24
-
- resolution: {integrity: sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- dependencies:
- '@sinclair/typebox': 0.27.8
-
- resolution: {integrity: sha512-qyt/mb6rLyd9j1jUts4EQncvS6Yy3PM9HghnNv86QBlV+zdL2inCdK1tuVlL+J+lpiw2BI67qXOrX3UurBqQ1w==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- dependencies:
- '@jridgewell/trace-mapping': 0.3.18
- callsites: 3.1.0
- graceful-fs: 4.2.11
-
- resolution: {integrity: sha512-fGl4rfitnbfLsrfx1uUpDEESS7zM8JdgZgOCQuxQvL1Sn/I6ijeAVQWGfXI9zb1i9Mzo495cIpVZhA0yr60PkQ==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- dependencies:
- '@jest/console': 29.5.0
- '@jest/types': 29.5.0
- '@types/istanbul-lib-coverage': 2.0.4
- collect-v8-coverage: 1.0.1
-
- resolution: {integrity: sha512-yPafQEcKjkSfDXyvtgiV4pevSeyuA6MQr6ZIdVkWJly9vkqjnFfcfhRQqpD5whjoU8EORki752xQmjaqoFjzMQ==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- dependencies:
- '@jest/test-result': 29.5.0
- graceful-fs: 4.2.11
- jest-haste-map: 29.6.4
- slash: 3.0.0
-
- resolution: {integrity: sha512-8vbeZWqLJOvHaDfeMuoHITGKSz5qWc9u04lnWrQE3VyuSw604PzQM824ZeX9XSjUCeDiE3GuxZe5UKa8J61NQw==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- dependencies:
- '@babel/core': 7.21.8
- '@jest/types': 29.5.0
- '@jridgewell/trace-mapping': 0.3.18
- babel-plugin-istanbul: 6.1.1
- chalk: 4.1.2
- convert-source-map: 2.0.0
- fast-json-stable-stringify: 2.1.0
- graceful-fs: 4.2.11
- jest-haste-map: 29.5.0
- jest-regex-util: 29.4.3
- jest-util: 29.5.0
- micromatch: 4.0.5
- pirates: 4.0.5
- slash: 3.0.0
- write-file-atomic: 4.0.2
- transitivePeerDependencies:
- - supports-color
-
- resolution: {integrity: sha512-8thgRSiXUqtr/pPGY/OsyHuMjGyhVnWrFAwoxmIemlBuiMyU1WFs0tXoNxzcr4A4uErs/ABre76SGmrr5ab/AA==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- dependencies:
- '@babel/core': 7.21.8
- '@jest/types': 29.6.3
- '@jridgewell/trace-mapping': 0.3.18
- babel-plugin-istanbul: 6.1.1
- chalk: 4.1.2
- convert-source-map: 2.0.0
- fast-json-stable-stringify: 2.1.0
- graceful-fs: 4.2.11
- jest-haste-map: 29.6.4
- jest-regex-util: 29.6.3
- jest-util: 29.6.3
- micromatch: 4.0.5
- pirates: 4.0.5
- slash: 3.0.0
- write-file-atomic: 4.0.2
- transitivePeerDependencies:
- - supports-color
-
- resolution: {integrity: sha512-qbu7kN6czmVRc3xWFQcAN03RAUamgppVUdXrvl1Wr3jlNF93o9mJbGcDWrwGB6ht44u7efB1qCFgVQmca24Uog==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- dependencies:
- '@jest/schemas': 29.4.3
- '@types/istanbul-lib-coverage': 2.0.4
- '@types/istanbul-reports': 3.0.1
- '@types/node': 18.16.9
- '@types/yargs': 17.0.24
- chalk: 4.1.2
-
- resolution: {integrity: sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- dependencies:
- '@jest/schemas': 29.6.3
- '@types/istanbul-lib-coverage': 2.0.4
- '@types/istanbul-reports': 3.0.1
- '@types/node': 18.16.9
- '@types/yargs': 17.0.24
- chalk: 4.1.2
-
- /@jridgewell/[email protected]:
- resolution: {integrity: sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==}
- engines: {node: '>=6.0.0'}
- dependencies:
- '@jridgewell/set-array': 1.1.2
- '@jridgewell/sourcemap-codec': 1.4.15
- '@jridgewell/trace-mapping': 0.3.18
-
- /@jridgewell/[email protected]:
- resolution: {integrity: sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==}
- engines: {node: '>=6.0.0'}
-
- /@jridgewell/[email protected]:
- resolution: {integrity: sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==}
- engines: {node: '>=6.0.0'}
-
- /@jridgewell/[email protected]:
- resolution: {integrity: sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==}
-
- /@jridgewell/[email protected]:
- resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==}
-
- /@jridgewell/[email protected]:
- resolution: {integrity: sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==}
- dependencies:
- '@jridgewell/resolve-uri': 3.1.0
- '@jridgewell/sourcemap-codec': 1.4.14
-
- /@jridgewell/[email protected]:
- resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==}
- dependencies:
- '@jridgewell/resolve-uri': 3.1.0
- '@jridgewell/sourcemap-codec': 1.4.15
- dev: true
-
- /@juggle/[email protected]:
- resolution: {integrity: sha512-dfLbk+PwWvFzSxwk3n5ySL0hfBog779o8h68wK/7/APo/7cgyWp5jcXockbxdk5kFRkbeXWm4Fbi9FrdN381sA==}
- dev: false
-
- resolution: {integrity: sha512-ap+juKvt8R8n3cBqd/pGtZydQ4v2I/hgJKnvJRGjpSh3RvsvnDHO4rXov8MHQlH6VqpOekwgilFLGxMZjNTucA==}
- engines: {node: '>=12.0.0'}
- peerDependencies:
- '@types/react': ^17.0.0 || ^18.0.0
- react: ^17.0.0 || ^18.0.0
- react-dom: ^17.0.0 || ^18.0.0
- peerDependenciesMeta:
- '@types/react':
- optional: true
- dependencies:
- '@babel/runtime': 7.21.5
- '@emotion/is-prop-valid': 1.2.1
- '@mui/types': 7.2.4(@types/[email protected])
- '@mui/utils': 5.12.3([email protected])
- '@popperjs/core': 2.11.7
- '@types/react': 18.2.6
- clsx: 1.2.1
- prop-types: 15.8.1
- react: 18.2.0
- react-dom: 18.2.0([email protected])
- react-is: 18.2.0
- dev: false
-
- resolution: {integrity: sha512-bKt2pUADHGQtqWDZ8nvL2Lvg2GNJyd/ZUgZAJoYzRgmnxBL9j36MSlS3+exEdYkikcnvVafcBtD904RypFKb0w==}
- engines: {node: '>=12.0.0'}
- peerDependencies:
- '@types/react': ^17.0.0 || ^18.0.0
- react: ^17.0.0 || ^18.0.0
- react-dom: ^17.0.0 || ^18.0.0
- peerDependenciesMeta:
- '@types/react':
- optional: true
- dependencies:
- '@babel/runtime': 7.23.4
- '@floating-ui/react-dom': 2.0.4([email protected])([email protected])
- '@mui/types': 7.2.9(@types/[email protected])
- '@mui/utils': 5.14.18(@types/[email protected])([email protected])
- '@popperjs/core': 2.11.8
- '@types/react': 18.2.6
- clsx: 2.0.0
- prop-types: 15.8.1
- react: 18.2.0
- react-dom: 18.2.0([email protected])
- dev: false
-
- resolution: {integrity: sha512-5nXz2k8Rv2ZjtQY6kXirJVyn2+ODaQuAJmXSJtLDUQDKWp3PFUj6j3bILqR0JGOs9R5ejgwz3crLKsl6GwjwkQ==}
- dev: false
-
- resolution: {integrity: sha512-oKkx9z9Kwg40NtcIajF9uOXhxiyTZrrm9nmIJ4UjkU2IdHpd4QVLbCc/5hZN/y0C6qzi2Zlxyr9TGddQx2vx2A==}
- engines: {node: '>=12.0.0'}
- peerDependencies:
- '@mui/material': ^5.0.0
- '@types/react': ^17.0.0 || ^18.0.0
- react: ^17.0.0 || ^18.0.0
- peerDependenciesMeta:
- '@types/react':
- optional: true
- dependencies:
- '@babel/runtime': 7.21.5
- '@mui/material': 5.13.0(@emotion/[email protected])(@emotion/[email protected])(@types/[email protected])([email protected])([email protected])
- '@types/react': 18.2.6
- react: 18.2.0
- dev: false
-
- resolution: {integrity: sha512-ckS+9tCpAzpdJdaTF+btF0b6mF9wbXg/EVKtnoAWYi0UKXoXBAVvEUMNpLGA5xdpCdf+A6fPbVUEHs9TsfU+Yw==}
- engines: {node: '>=12.0.0'}
- peerDependencies:
- '@emotion/react': ^11.5.0
- '@emotion/styled': ^11.3.0
- '@types/react': ^17.0.0 || ^18.0.0
- react: ^17.0.0 || ^18.0.0
- react-dom: ^17.0.0 || ^18.0.0
- peerDependenciesMeta:
- '@emotion/react':
- optional: true
- '@emotion/styled':
- optional: true
- '@types/react':
- optional: true
- dependencies:
- '@babel/runtime': 7.21.5
- '@emotion/react': 11.11.0(@types/[email protected])([email protected])
- '@emotion/styled': 11.11.0(@emotion/[email protected])(@types/[email protected])([email protected])
- '@mui/base': 5.0.0-beta.0(@types/[email protected])([email protected])([email protected])
- '@mui/core-downloads-tracker': 5.13.0
- '@mui/system': 5.14.4(@emotion/[email protected])(@emotion/[email protected])(@types/[email protected])([email protected])
- '@mui/types': 7.2.4(@types/[email protected])
- '@mui/utils': 5.12.3([email protected])
- '@types/react': 18.2.6
- '@types/react-transition-group': 4.4.6
- clsx: 1.2.1
- csstype: 3.1.2
- prop-types: 15.8.1
- react: 18.2.0
- react-dom: 18.2.0([email protected])
- react-is: 18.2.0
- react-transition-group: 4.4.5([email protected])([email protected])
- dev: false
-
- resolution: {integrity: sha512-ISXsHDiQ3z1XA4IuKn+iXDWvDjcz/UcQBiFZqtdoIsEBt8CB7wgdQf3LwcwqO81dl5ofg/vNQBEnXuKfZHrnYA==}
- engines: {node: '>=12.0.0'}
- peerDependencies:
- '@types/react': ^17.0.0 || ^18.0.0
- react: ^17.0.0 || ^18.0.0
- peerDependenciesMeta:
- '@types/react':
- optional: true
- dependencies:
- '@babel/runtime': 7.22.10
- '@mui/utils': 5.14.4([email protected])
- '@types/react': 18.2.6
- prop-types: 15.8.1
- react: 18.2.0
- dev: false
-
- resolution: {integrity: sha512-VCYCU6xVtXOrIN8lcbuPmoG+u7FYuOERG++fpY74hPpEWkyFQG97F+/XfTQVYzlR2m7nPjnwVUgATcTCMEaMvw==}
- engines: {node: '>=12.0.0'}
- peerDependencies:
- '@emotion/react': ^11.4.1
- '@emotion/styled': ^11.3.0
- react: ^17.0.0 || ^18.0.0
- peerDependenciesMeta:
- '@emotion/react':
- optional: true
- '@emotion/styled':
- optional: true
- dependencies:
- '@babel/runtime': 7.22.10
- '@emotion/cache': 11.11.0
- '@emotion/react': 11.11.0(@types/[email protected])([email protected])
- '@emotion/styled': 11.11.0(@emotion/[email protected])(@types/[email protected])([email protected])
- csstype: 3.1.2
- prop-types: 15.8.1
- react: 18.2.0
- dev: false
-
- resolution: {integrity: sha512-oPgfWS97QNfHcDBapdkZIs4G5i85BJt69Hp6wbXF6s7vi3Evcmhdk8AbCRW6n0sX4vTj8oe0mh0RIm1G2A1KDA==}
- engines: {node: '>=12.0.0'}
- peerDependencies:
- '@emotion/react': ^11.5.0
- '@emotion/styled': ^11.3.0
- '@types/react': ^17.0.0 || ^18.0.0
- react: ^17.0.0 || ^18.0.0
- peerDependenciesMeta:
- '@emotion/react':
- optional: true
- '@emotion/styled':
- optional: true
- '@types/react':
- optional: true
- dependencies:
- '@babel/runtime': 7.22.10
- '@emotion/react': 11.11.0(@types/[email protected])([email protected])
- '@emotion/styled': 11.11.0(@emotion/[email protected])(@types/[email protected])([email protected])
- '@mui/private-theming': 5.14.4(@types/[email protected])([email protected])
- '@mui/styled-engine': 5.13.2(@emotion/[email protected])(@emotion/[email protected])([email protected])
- '@mui/types': 7.2.4(@types/[email protected])
- '@mui/utils': 5.14.4([email protected])
- '@types/react': 18.2.6
- clsx: 2.0.0
- csstype: 3.1.2
- prop-types: 15.8.1
- react: 18.2.0
- dev: false
-
- resolution: {integrity: sha512-LBcwa8rN84bKF+f5sDyku42w1NTxaPgPyYKODsh01U1fVstTClbUoSA96oyRBnSNyEiAVjKm6Gwx9vjR+xyqHA==}
- peerDependencies:
- '@types/react': '*'
- peerDependenciesMeta:
- '@types/react':
- optional: true
- dependencies:
- '@types/react': 18.2.6
- dev: false
-
- resolution: {integrity: sha512-k1lN/PolaRZfNsRdAqXtcR71sTnv3z/VCCGPxU8HfdftDkzi335MdJ6scZxvofMAd/K/9EbzCZTFBmlNpQVdCg==}
- peerDependencies:
- '@types/react': ^17.0.0 || ^18.0.0
- peerDependenciesMeta:
- '@types/react':
- optional: true
- dependencies:
- '@types/react': 18.2.6
- dev: false
-
- resolution: {integrity: sha512-D/Z4Ub3MRl7HiUccid7sQYclTr24TqUAQFFlxHQF8FR177BrCTQ0JJZom7EqYjZCdXhwnSkOj2ph685MSKNtIA==}
- engines: {node: '>=12.0.0'}
- peerDependencies:
- react: ^17.0.0 || ^18.0.0
- dependencies:
- '@babel/runtime': 7.21.5
- '@types/prop-types': 15.7.5
- '@types/react-is': 17.0.4
- prop-types: 15.8.1
- react: 18.2.0
- react-is: 18.2.0
- dev: false
-
- resolution: {integrity: sha512-HZDRsJtEZ7WMSnrHV9uwScGze4wM/Y+u6pDVo+grUjt5yXzn+wI8QX/JwTHh9YSw/WpnUL80mJJjgCnWj2VrzQ==}
- engines: {node: '>=12.0.0'}
- peerDependencies:
- '@types/react': ^17.0.0 || ^18.0.0
- react: ^17.0.0 || ^18.0.0
- peerDependenciesMeta:
- '@types/react':
- optional: true
- dependencies:
- '@babel/runtime': 7.23.4
- '@types/prop-types': 15.7.11
- '@types/react': 18.2.6
- prop-types: 15.8.1
- react: 18.2.0
- react-is: 18.2.0
- dev: false
-
- resolution: {integrity: sha512-4ANV0txPD3x0IcTCSEHKDWnsutg1K3m6Vz5IckkbLXVYu17oOZCVUdOKsb/txUmaCd0v0PmSRe5PW+Mlvns5dQ==}
- engines: {node: '>=12.0.0'}
- peerDependencies:
- react: ^17.0.0 || ^18.0.0
- dependencies:
- '@babel/runtime': 7.22.10
- '@types/prop-types': 15.7.5
- '@types/react-is': 18.2.1
- prop-types: 15.8.1
- react: 18.2.0
- react-is: 18.2.0
- dev: false
-
- resolution: {integrity: sha512-8lEVEOtCQssKWel4Ey1pRulGPXUQ73TnkHKzHWsjdv03FjiUs3eYB+Ej0Uk5yWPmsqlShWhOzOlOGDpzsYJsUg==}
- engines: {node: '>=14.0.0'}
- peerDependencies:
- '@emotion/react': ^11.9.0
- '@emotion/styled': ^11.8.1
- '@mui/material': ^5.8.6
- '@mui/system': ^5.8.0
- date-fns: ^2.25.0
- date-fns-jalali: ^2.13.0-0
- dayjs: ^1.10.7
- luxon: ^3.0.2
- moment: ^2.29.4
- moment-hijri: ^2.1.2
- moment-jalaali: ^0.7.4 || ^0.8.0 || ^0.9.0 || ^0.10.0
- react: ^17.0.0 || ^18.0.0
- react-dom: ^17.0.0 || ^18.0.0
- peerDependenciesMeta:
- '@emotion/react':
- optional: true
- '@emotion/styled':
- optional: true
- date-fns:
- optional: true
- date-fns-jalali:
- optional: true
- dayjs:
- optional: true
- luxon:
- optional: true
- moment:
- optional: true
- moment-hijri:
- optional: true
- moment-jalaali:
- optional: true
- dependencies:
- '@babel/runtime': 7.23.4
- '@emotion/react': 11.11.0(@types/[email protected])([email protected])
- '@emotion/styled': 11.11.0(@emotion/[email protected])(@types/[email protected])([email protected])
- '@mui/base': 5.0.0-beta.24(@types/[email protected])([email protected])([email protected])
- '@mui/material': 5.13.0(@emotion/[email protected])(@emotion/[email protected])(@types/[email protected])([email protected])([email protected])
- '@mui/system': 5.14.4(@emotion/[email protected])(@emotion/[email protected])(@types/[email protected])([email protected])
- '@mui/utils': 5.14.18(@types/[email protected])([email protected])
- '@mui/x-license-pro': 6.10.2(@types/[email protected])([email protected])
- clsx: 2.0.0
- dayjs: 1.11.9
- prop-types: 15.8.1
- react: 18.2.0
- react-dom: 18.2.0([email protected])
- react-transition-group: 4.4.5([email protected])([email protected])
- transitivePeerDependencies:
- - '@types/react'
- dev: false
-
- resolution: {integrity: sha512-HJq4uoFQSu5isa/mesWw2BKh8KBRYUQb+KaSlVlWfJNgP3YhPvWZ6yqCNYyxOAiPMxb0n3nBjS9ErO27OHjFMA==}
- engines: {node: '>=14.0.0'}
- peerDependencies:
- '@emotion/react': ^11.9.0
- '@emotion/styled': ^11.8.1
- '@mui/material': ^5.8.6
- '@mui/system': ^5.8.0
- date-fns: ^2.25.0
- date-fns-jalali: ^2.13.0-0
- dayjs: ^1.10.7
- luxon: ^3.0.2
- moment: ^2.29.4
- moment-hijri: ^2.1.2
- moment-jalaali: ^0.7.4 || ^0.8.0 || ^0.9.0 || ^0.10.0
- react: ^17.0.0 || ^18.0.0
- react-dom: ^17.0.0 || ^18.0.0
- peerDependenciesMeta:
- '@emotion/react':
- optional: true
- '@emotion/styled':
- optional: true
- date-fns:
- optional: true
- date-fns-jalali:
- optional: true
- dayjs:
- optional: true
- luxon:
- optional: true
- moment:
- optional: true
- moment-hijri:
- optional: true
- moment-jalaali:
- optional: true
- dependencies:
- '@babel/runtime': 7.23.4
- '@emotion/react': 11.11.0(@types/[email protected])([email protected])
- '@emotion/styled': 11.11.0(@emotion/[email protected])(@types/[email protected])([email protected])
- '@mui/base': 5.0.0-beta.24(@types/[email protected])([email protected])([email protected])
- '@mui/material': 5.13.0(@emotion/[email protected])(@emotion/[email protected])(@types/[email protected])([email protected])([email protected])
- '@mui/system': 5.14.4(@emotion/[email protected])(@emotion/[email protected])(@types/[email protected])([email protected])
- '@mui/utils': 5.14.18(@types/[email protected])([email protected])
- '@types/react-transition-group': 4.4.9
- clsx: 2.0.0
- dayjs: 1.11.9
- prop-types: 15.8.1
- react: 18.2.0
- react-dom: 18.2.0([email protected])
- react-transition-group: 4.4.5([email protected])([email protected])
- transitivePeerDependencies:
- - '@types/react'
- dev: false
-
- resolution: {integrity: sha512-Baw3shilU+eHgU+QYKNPFUKvfS5rSyNJ98pQx02E0gKA22hWp/XAt88K1qUfUMPlkPpvg/uci6gviQSSLZkuKw==}
- engines: {node: '>=14.0.0'}
- peerDependencies:
- react: ^17.0.0 || ^18.0.0
- dependencies:
- '@babel/runtime': 7.23.4
- '@mui/utils': 5.14.18(@types/[email protected])([email protected])
- react: 18.2.0
- transitivePeerDependencies:
- - '@types/react'
- dev: false
-
- /@nodelib/[email protected]:
- resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==}
- engines: {node: '>= 8'}
- dependencies:
- '@nodelib/fs.stat': 2.0.5
- run-parallel: 1.2.0
- dev: true
-
- /@nodelib/[email protected]:
- resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==}
- engines: {node: '>= 8'}
- dev: true
-
- /@nodelib/[email protected]:
- resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==}
- engines: {node: '>= 8'}
- dependencies:
- '@nodelib/fs.scandir': 2.1.5
- fastq: 1.15.0
- dev: true
-
- /@popperjs/[email protected]:
- resolution: {integrity: sha512-Cr4OjIkipTtcXKjAsm8agyleBuDHvxzeBoa1v543lbv1YaIwQjESsVcmjiWiPEbC1FIeHOG/Op9kdCmAmiS3Kw==}
- dev: false
-
- /@popperjs/[email protected]:
- resolution: {integrity: sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==}
-
- resolution: {integrity: sha512-Kq/a+aO28adYdPoNEu9p800MYPKoUc0tlkYfv035Ief9J7MPq8JvmT7UdpYhvXsoMtOdt567KwZjc9H3Rf8yjg==}
- peerDependencies:
- react: ^16.9.0 || ^17.0.0 || ^18
- react-redux: ^7.2.1 || ^8.1.3 || ^9.0.0
- peerDependenciesMeta:
- react:
- optional: true
- react-redux:
- optional: true
- dependencies:
- immer: 10.0.3
- react: 18.2.0
- redux: 5.0.0
- redux-thunk: 3.1.0([email protected])
- reselect: 5.0.1
- dev: false
-
- /@remix-run/[email protected]:
- resolution: {integrity: sha512-YUkWj+xs0oOzBe74OgErsuR3wVn+efrFhXBWrit50kOiED+pvQe2r6MWY0iJMQU/mSVKxvNzL4ZaYvjdX+G7ZA==}
- engines: {node: '>=14'}
- dev: false
-
- resolution: {integrity: sha512-cZFXYTxbpzYcieq/mBwSyXgqnGMHoBVh3J7MU0CCoIB4NRZxV9/TuwTBAaLMqpNhC3zTPMCgkQ5Ey07L02Xmcw==}
- peerDependencies:
- react: '>=16.8.0'
- dependencies:
- dequal: 2.0.3
- react: 18.2.0
- dev: false
-
- /@rollup/[email protected]:
- resolution: {integrity: sha512-pTd9rIsP92h+B6wWwFbW8RkZv4hiR/xKsqre4SIuAOaOEQRxi0lqLke9k2/7WegC85GgUs9pjmOjCUi3In4vwA==}
- engines: {node: '>=14.0.0'}
- peerDependencies:
- rollup: ^1.20.0||^2.0.0||^3.0.0
- peerDependenciesMeta:
- rollup:
- optional: true
- dependencies:
- '@types/estree': 1.0.1
- estree-walker: 2.0.2
- picomatch: 2.3.1
- dev: true
-
- /@sinclair/[email protected]:
- resolution: {integrity: sha512-XJfwUVUKDHF5ugKwIcxEgc9k8b7HbznCp6eUfWgu710hMPNIO4aw4/zB5RogDQz8nd6gyCDpU9O/m6qYEWY6yQ==}
-
- /@sinclair/[email protected]:
- resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==}
-
- /@sinonjs/[email protected]:
- resolution: {integrity: sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA==}
- dependencies:
- type-detect: 4.0.8
-
- /@sinonjs/[email protected]:
- resolution: {integrity: sha512-w1qd368vtrwttm1PRJWPW1QHlbmHrVDGs1eBH/jZvRPUFS4MNXV9Q33EQdjOdeAxZ7O8+3wM7zxztm2nfUSyKw==}
- dependencies:
- '@sinonjs/commons': 3.0.0
-
- resolution: {integrity: sha512-X0hLFJbQu9c1ItWBaNuEn0pqcXYK76KCp8C4Gvy/VaTQVMo1VgAb2WiiJ0Je/AyuIYEPPSTNVOcyrGHwgA7e6Q==}
- peerDependencies:
- slate: '>=0.70.0'
- yjs: ^13.5.29
- dependencies:
- slate: 0.101.4
- y-protocols: 1.0.6([email protected])
- yjs: 13.6.1
- dev: false
-
- resolution: {integrity: sha512-khWbXesWIP9v8HuKCl2NU2HNAyqpSQ/vkIl36Nbn4HIwEYSRWL0H7Gs6idJdha2DkpFDWlsqMELvoCE8lfFY6Q==}
- engines: {node: '>=14'}
- peerDependencies:
- '@babel/core': ^7.0.0-0
- dependencies:
- '@babel/core': 7.21.8
- dev: true
-
- resolution: {integrity: sha512-iiZaIvb3H/c7d3TH2HBeK91uI2rMhZNwnsIrvd7ZwGLkFw6mmunOCoVnjdYua662MqGFxlN9xTq4fv9hgR4VXQ==}
- engines: {node: '>=14'}
- peerDependencies:
- '@babel/core': ^7.0.0-0
- dependencies:
- '@babel/core': 7.21.8
- dev: true
-
- resolution: {integrity: sha512-sQQmyo+qegBx8DfFc04PFmIO1FP1MHI1/QEpzcIcclo5OAISsOJPW76ZIs0bDyO/DBSJEa/tDa1W26pVtt0FRw==}
- engines: {node: '>=14'}
- peerDependencies:
- '@babel/core': ^7.0.0-0
- dependencies:
- '@babel/core': 7.21.8
- dev: true
-
- resolution: {integrity: sha512-i6MaAqIZXDOJeikJuzocByBf8zO+meLwfQ/qMHIjCcvpnfvWf82PFvredEZElErB5glQFJa2KVKk8N2xV6tRRA==}
- engines: {node: '>=14'}
- peerDependencies:
- '@babel/core': ^7.0.0-0
- dependencies:
- '@babel/core': 7.21.8
- dev: true
-
- resolution: {integrity: sha512-BoVSh6ge3SLLpKC0pmmN9DFlqgFy4NxNgdZNLPNJWBUU7TQpDWeBuyVuDW88iXydb5Cv0ReC+ffa5h3VrKfk1w==}
- engines: {node: '>=14'}
- peerDependencies:
- '@babel/core': ^7.0.0-0
- dependencies:
- '@babel/core': 7.21.8
- dev: true
-
- resolution: {integrity: sha512-tNDcBa+hYn0gO+GkP/AuNKdVtMufVhU9fdzu+vUQsR18RIJ9RWe7h/pSBY338RO08wArntwbDk5WhQBmhf2PaA==}
- engines: {node: '>=14'}
- peerDependencies:
- '@babel/core': ^7.0.0-0
- dependencies:
- '@babel/core': 7.21.8
- dev: true
-
- resolution: {integrity: sha512-qw54u8ljCJYL2KtBOjI5z7Nzg8LnSvQOP5hPKj77H4VQL4+HdKbAT5pnkkZLmHKYwzsIHSYKXxHouD8zZamCFQ==}
- engines: {node: '>=14'}
- peerDependencies:
- '@babel/core': ^7.0.0-0
- dependencies:
- '@babel/core': 7.21.8
- dev: true
-
- resolution: {integrity: sha512-CcFECkDj98daOg9jE3Bh3uyD9kzevCAnZ+UtzG6+BQG/jOQ2OA3jHnX6iG4G1MCJkUQFnUvEv33NvQfqrb/F3A==}
- engines: {node: '>=12'}
- peerDependencies:
- '@babel/core': ^7.0.0-0
- dependencies:
- '@babel/core': 7.21.8
- dev: true
-
- resolution: {integrity: sha512-EX/NHeFa30j5UjldQGVQikuuQNHUdGmbh9kEpBKofGUtF0GUPJ4T4rhoYiqDAOmBOxojyot36JIFiDUHUK1ilQ==}
- engines: {node: '>=14'}
- peerDependencies:
- '@babel/core': ^7.0.0-0
- dependencies:
- '@babel/core': 7.21.8
- '@svgr/babel-plugin-add-jsx-attribute': 7.0.0(@babel/[email protected])
- '@svgr/babel-plugin-remove-jsx-attribute': 7.0.0(@babel/[email protected])
- '@svgr/babel-plugin-remove-jsx-empty-expression': 7.0.0(@babel/[email protected])
- '@svgr/babel-plugin-replace-jsx-attribute-value': 7.0.0(@babel/[email protected])
- '@svgr/babel-plugin-svg-dynamic-title': 7.0.0(@babel/[email protected])
- '@svgr/babel-plugin-svg-em-dimensions': 7.0.0(@babel/[email protected])
- '@svgr/babel-plugin-transform-react-native-svg': 7.0.0(@babel/[email protected])
- '@svgr/babel-plugin-transform-svg-component': 7.0.0(@babel/[email protected])
- dev: true
-
- resolution: {integrity: sha512-ztAoxkaKhRVloa3XydohgQQCb0/8x9T63yXovpmHzKMkHO6pkjdsIAWKOS4bE95P/2quVh1NtjSKlMRNzSBffw==}
- engines: {node: '>=14'}
- dependencies:
- '@babel/core': 7.21.8
- '@svgr/babel-preset': 7.0.0(@babel/[email protected])
- camelcase: 6.3.0
- cosmiconfig: 8.2.0
- transitivePeerDependencies:
- - supports-color
- dev: true
-
- resolution: {integrity: sha512-42Ej9sDDEmsJKjrfQ1PHmiDiHagh/u9AHO9QWbeNx4KmD9yS5d1XHmXUNINfUcykAU+4431Cn+k6Vn5mWBYimQ==}
- engines: {node: '>=14'}
- dependencies:
- '@babel/types': 7.21.5
- entities: 4.5.0
- dev: true
-
- resolution: {integrity: sha512-SWlTpPQmBUtLKxXWgpv8syzqIU8XgFRvyhfkam2So8b3BE0OS0HPe5UfmlJ2KIC+a7dpuuYovPR2WAQuSyMoPw==}
- engines: {node: '>=14'}
- dependencies:
- '@babel/core': 7.21.8
- '@svgr/babel-preset': 7.0.0(@babel/[email protected])
- '@svgr/hast-util-to-babel-ast': 7.0.0
- svg-parser: 2.0.4
- transitivePeerDependencies:
- - supports-color
- dev: true
-
- resolution: {integrity: sha512-29OJ1QmJgnohQHDAgAuY2h21xWD6TZiXji+hnx+W635RiXTAlHTbjrZDktfqzkN0bOeQEtNe+xgq73/XeWFfSg==}
- engines: {node: '>=14'}
- peerDependencies:
- '@svgr/core': '*'
- dependencies:
- '@svgr/core': 7.0.0
- cosmiconfig: 8.2.0
- deepmerge: 4.3.1
- svgo: 3.0.2
- dev: true
-
- /@tauri-apps/[email protected]:
- resolution: {integrity: sha512-AH+3FonkKZNtfRtGrObY38PrzEj4d+1emCbwNGu0V2ENbXjlLHMZQlUh+Bhu/CRmjaIwZMGJ3yFvWaZZgTHoog==}
- engines: {node: '>= 14.6.0', npm: '>= 6.6.0', yarn: '>= 1.19.1'}
- dev: false
-
- /@tauri-apps/[email protected]:
- resolution: {integrity: sha512-NNvG3XLtciCMsBahbDNUEvq184VZmOveTGOuy0So2R33b/6FDkuWaSgWZsR1mISpOuP034htQYW0VITCLelfqg==}
- engines: {node: '>= 10'}
- cpu: [arm64]
- os: [darwin]
- requiresBuild: true
- dev: true
- optional: true
-
- /@tauri-apps/[email protected]:
- resolution: {integrity: sha512-nkiqmtUQw3N1j4WoVjv81q6zWuZFhBLya/RNGUL94oafORloOZoSY0uTZJAoeieb3Y1YK0rCHSDl02MyV2Fi4A==}
- engines: {node: '>= 10'}
- cpu: [x64]
- os: [darwin]
- requiresBuild: true
- dev: true
- optional: true
-
- /@tauri-apps/[email protected]:
- resolution: {integrity: sha512-z6SPx+axZexmWXTIVPNs4Tg7FtvdJl9EKxYN6JPjOmDZcqA13iyqWBQal2DA/GMZ1Xqo3vyJf6EoEaKaliymPQ==}
- engines: {node: '>= 10'}
- cpu: [arm]
- os: [linux]
- requiresBuild: true
- dev: true
- optional: true
-
- /@tauri-apps/[email protected]:
- resolution: {integrity: sha512-QuQjMQmpsCbzBrmtQiG4uhnfAbdFx3nzm+9LtqjuZlurc12+Mj5MTgqQ3AOwQedH3f7C+KlvbqD2AdXpwTg7VA==}
- engines: {node: '>= 10'}
- cpu: [arm64]
- os: [linux]
- requiresBuild: true
- dev: true
- optional: true
-
- /@tauri-apps/[email protected]:
- resolution: {integrity: sha512-8j5dH3odweFeom7bRGlfzDApWVOT4jIq8/214Wl+JeiNVehouIBo9lZGeghZBH3XKFRwEvU23i7sRVjuh2s8mg==}
- engines: {node: '>= 10'}
- cpu: [arm64]
- os: [linux]
- requiresBuild: true
- dev: true
- optional: true
-
- /@tauri-apps/[email protected]:
- resolution: {integrity: sha512-gbFHYHfdEGW0ffk8SigDsoXks6USpilF6wR0nqB/JbWzbzFR/sBuLVNQlJl1RKNakyJHu+lsFxGy0fcTdoX8xA==}
- engines: {node: '>= 10'}
- cpu: [x64]
- os: [linux]
- requiresBuild: true
- dev: true
- optional: true
-
- /@tauri-apps/[email protected]:
- resolution: {integrity: sha512-9v688ogoLkeFYQNgqiSErfhTreLUd8B3prIBSYUt+x4+5Kcw91zWvIh+VSxL1n3KCGGsM7cuXhkGPaxwlEh1ug==}
- engines: {node: '>= 10'}
- cpu: [x64]
- os: [linux]
- requiresBuild: true
- dev: true
- optional: true
-
- /@tauri-apps/[email protected]:
- resolution: {integrity: sha512-DRNDXFNZb6y5IZrw+lhTTA9l4wbzO4TNRBAlHAiXUrH+pRFZ/ZJtv5WEuAj9ocVSahVw2NaK5Yaold4NPAxHog==}
- engines: {node: '>= 10'}
- cpu: [arm64]
- os: [win32]
- requiresBuild: true
- dev: true
- optional: true
-
- /@tauri-apps/[email protected]:
- resolution: {integrity: sha512-oUYKNR/IZjF4fsOzRpw0xesl2lOjhsQEyWlgbpT25T83EU113Xgck9UjtI7xemNI/OPCv1tPiaM1e7/ABdg5iA==}
- engines: {node: '>= 10'}
- cpu: [ia32]
- os: [win32]
- requiresBuild: true
- dev: true
- optional: true
-
- /@tauri-apps/[email protected]:
- resolution: {integrity: sha512-RmEf1os9C8//uq2hbjXi7Vgz9ne7798ZxqemAZdUwo1pv3oLVZSz1/IvZmUHPdy2e6zSeySqWu1D0Y3QRNN+dg==}
- engines: {node: '>= 10'}
- cpu: [x64]
- os: [win32]
- requiresBuild: true
- dev: true
- optional: true
-
- /@tauri-apps/[email protected]:
- resolution: {integrity: sha512-k4Y19oVCnt7WZb2TnDzLqfs7o98Jq0tUoVMv+JQSzuRDJqaVu2xMBZ8dYplEn+EccdR5SOMyzaLBJWu38TVK1A==}
- engines: {node: '>= 10'}
- hasBin: true
- optionalDependencies:
- '@tauri-apps/cli-darwin-arm64': 1.5.6
- '@tauri-apps/cli-darwin-x64': 1.5.6
- '@tauri-apps/cli-linux-arm-gnueabihf': 1.5.6
- '@tauri-apps/cli-linux-arm64-gnu': 1.5.6
- '@tauri-apps/cli-linux-arm64-musl': 1.5.6
- '@tauri-apps/cli-linux-x64-gnu': 1.5.6
- '@tauri-apps/cli-linux-x64-musl': 1.5.6
- '@tauri-apps/cli-win32-arm64-msvc': 1.5.6
- '@tauri-apps/cli-win32-ia32-msvc': 1.5.6
- '@tauri-apps/cli-win32-x64-msvc': 1.5.6
- dev: true
-
- /@tootallnate/[email protected]:
- resolution: {integrity: sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==}
- engines: {node: '>= 10'}
- dev: true
-
- /@trysound/[email protected]:
- resolution: {integrity: sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==}
- engines: {node: '>=10.13.0'}
- dev: true
-
- /@tsconfig/[email protected]:
- resolution: {integrity: sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==}
- dev: true
-
- /@tsconfig/[email protected]:
- resolution: {integrity: sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==}
- dev: true
-
- /@tsconfig/[email protected]:
- resolution: {integrity: sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==}
- dev: true
-
- /@tsconfig/[email protected]:
- resolution: {integrity: sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==}
- dev: true
-
- resolution: {integrity: sha512-+n8dL/9GWblDO0iU6eZAwEIJVr5DWigtle+Q6HLOrh/pdbXOhOtqzq8VPPE2zvNJzSKY4vH/z3iT3tn0A3ypiQ==}
- dependencies:
- '@babel/parser': 7.21.8
- '@babel/types': 7.21.5
- '@types/babel__generator': 7.6.4
- '@types/babel__template': 7.4.1
- '@types/babel__traverse': 7.18.5
-
- resolution: {integrity: sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg==}
- dependencies:
- '@babel/types': 7.21.5
-
- resolution: {integrity: sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==}
- dependencies:
- '@babel/parser': 7.21.8
- '@babel/types': 7.21.5
-
- resolution: {integrity: sha512-enCvTL8m/EHS/zIvJno9nE+ndYPh1/oNFzRYRmtUqJICG2VnCSBzMLW5VN2KCQU91f23tsNKR8v7VJJQMatl7Q==}
- dependencies:
- '@babel/types': 7.21.5
-
- resolution: {integrity: sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==}
- dev: true
-
- resolution: {integrity: sha512-40um9QqwHjRS92qnOaDpL7RmDK15NuZYo9HihiJRbYkMQZlWnuH8AdvbMy8/o6lgLmKbDUKa+OALCltHdbOTpQ==}
- dev: true
-
- resolution: {integrity: sha512-Sig0SNORX9fdW+bQuTEovKj3uHcUL6LQKbCrrqb1X7J6/ReAbhCXRAhc+SMejhLELFj2QcyuxmUooZ4bt5ReSw==}
- dependencies:
- '@types/node': 18.16.9
-
- resolution: {integrity: sha512-iMIqiko6ooLrTh1joXodJK5X9xeEALT1kM5G3ZLhD3hszxBdIEd5C75U834D9mLcINgD4OyZf5uQXjkuYydWvA==}
- dependencies:
- '@types/react': 18.2.6
- hoist-non-react-statics: 3.3.2
- dev: false
-
- resolution: {integrity: sha512-RvC8KMw5BCac1NvRRyaHgMMEtBaZ6wh0pyPTBu7izn4Sj/AX9Y4aXU5c7rX8PnM/knsuUpC1IeoBkANtxBypsQ==}
- dev: false
-
- resolution: {integrity: sha512-yB5C7zcOM7idwYZZ1wKQ3pTfjA9BbvFqRWvKB46GFddxnJtHwi/b9y84ykQtxQPg5qhdpg4Q/kWU3EGoCTmLzQ==}
- dev: true
-
- resolution: {integrity: sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==}
-
- resolution: {integrity: sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==}
- dependencies:
- '@types/istanbul-lib-coverage': 2.0.4
-
- resolution: {integrity: sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==}
- dependencies:
- '@types/istanbul-lib-report': 3.0.0
-
- resolution: {integrity: sha512-1Nq7YrO/vJE/FYnqYyw0FS8LdrjExSgIiHyKg7xPpn+yi8Q4huZryKnkJatN1ZRH89Kw2v33/8ZMB7DuZeSLlA==}
- dependencies:
- expect: 29.5.0
- pretty-format: 29.5.0
- dev: true
-
- resolution: {integrity: sha512-d0r18sZPmMQr1eG35u12FZfhIXNrnsPU/g5wvRKCUf/tOGilKKwYMYGqh33BNR6ba+2gkHw1EUiHoN3mn7E5IQ==}
- dependencies:
- '@types/node': 18.16.9
- '@types/tough-cookie': 4.0.2
- parse5: 7.1.2
- dev: true
-
- resolution: {integrity: sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==}
- dev: true
-
- resolution: {integrity: sha512-hz+S3nV6Mym5xPbT9fnO8dDhBFQguMYpY0Ipxv06JMi1ORgnEM4M1ymWDUhUNer3ElLmT583opRo4RzxKmh9jw==}
- dev: true
-
- resolution: {integrity: sha512-eCw8FYAWHt2DDl77s+AMLLzPn310LKohruumpucZI4oOFJkIgnlaJcy23OKMJxx4r9PeTF13Gv6w+jqjWQaYUg==}
- dependencies:
- '@types/lodash': 4.14.194
- dev: true
-
- resolution: {integrity: sha512-r22s9tAS7imvBt2lyHC9B8AGwWnXaYb1tY09oyLkXDs4vArpYJzw09nj8MLx5VfciBPGIb+ZwG0ssYnEPJxn/g==}
- dev: true
-
- resolution: {integrity: sha512-OvlIYQK9tNneDlS0VN54LLd5uiPCBOp7gS5Z0f1mjoJYBrtStzgmJBxONW3U6OZqdtNzZPmn9BS/7WI7BFFcFQ==}
- dev: false
-
- resolution: {integrity: sha512-IeB32oIV4oGArLrd7znD2rkHQ6EDCM+2Sr76dJnrHwv9OHBTTM6nuDLK9bmikXzPa0ZlWMWtRGo/Uw4mrzQedA==}
-
- resolution: {integrity: sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==}
- dev: false
-
- resolution: {integrity: sha512-KufADq8uQqo1pYKVIYzfKbJfBAc0sOeXqGbFaSpv8MRmC/zXgowNZmFcbngndGk922QDmOASEXUZCaY48gs4cg==}
-
- resolution: {integrity: sha512-ZTaqn/qSqUuAq1YwvOFQfVW1AR/oQJlLSZVustdjwI+GZ8kr0MSHBj0tsXPW1EqHubx50gtBEjbPGsdZwQwCjQ==}
- dev: true
-
- resolution: {integrity: sha512-ga8y9v9uyeiLdpKddhxYQkxNDrfvuPrlFb0N1qnZZByvcElJaXthF1UhvCh9TLWJBEHeNtdnbysW7Y6Uq8CVng==}
- dev: false
-
- resolution: {integrity: sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==}
-
- resolution: {integrity: sha512-L6OHONEj2v4NRbWQOsn7j1N0SyzhRR3M4g1M6j/uuIwIsIW2ShWHhwbqNvH8hSmVktzqu0lITfdnqVOQ4qkrhA==}
- dependencies:
- parchment: 1.1.4
- quill-delta: 4.2.2
- dev: true
-
- resolution: {integrity: sha512-4bIBdzOr0aavN+88q3C7Pgz+xkb7tz3whORYrmSj77wfVEMfiWiooIwVWFR7KM2e+uGTe5BVrXqSfb0aHeflJA==}
- dependencies:
- '@types/react': 18.2.6
- dev: true
-
- resolution: {integrity: sha512-OzPIO5AyRmLA7PlOyISlgabpYUa3En74LP8mTMa0veCA719SvYQov4WLMsHvCgXP+L+KI9yGhYnqZafVGG0P4w==}
- dependencies:
- '@types/react': 18.2.6
- '@types/reactcss': 1.2.6
- dev: true
-
- resolution: {integrity: sha512-t+15reWgAE1jXlrhaZoxjuH/SQf+EG0rzAzSCzTIkSiP5CDT7KhoExNPwIa6uUxtPkjc3gdW/ry7GetLEwCfGA==}
- dependencies:
- '@types/react': 18.2.6
- dev: true
-
- resolution: {integrity: sha512-85F9eKWu9fGiD9r4KVVMPYAdkJJswR3Wci9PvqplmB6T+D+VbUqPeKtifg96NZ4nEhufjehW+SX4JLrEWVplWw==}
- dependencies:
- '@popperjs/core': 2.11.8
- '@types/react': 18.2.6
- date-fns: 2.30.0
- react-popper: 2.3.0(@popperjs/[email protected])([email protected])([email protected])
- transitivePeerDependencies:
- - react
- - react-dom
- dev: true
-
- resolution: {integrity: sha512-G2mHoTMTL4yoydITgOGwWdWMVd8sNgyEP85xVmMKAPUBwQWm9wBPQUmvbeF4V3WBY1P7mmL4BkjQ0SqUpf1snw==}
- dependencies:
- '@types/react': 18.2.6
-
- resolution: {integrity: sha512-FLzd0K9pnaEvKz4D1vYxK9JmgQPiGk1lu23o1kqGsLeT0iPbRSF7b76+S5T9fD8aRa0B8bY7I/3DebEj+1ysBA==}
- dependencies:
- '@types/react': 17.0.59
- dev: false
-
- resolution: {integrity: sha512-wyUkmaaSZEzFZivD8F2ftSyAfk6L+DfFliVj/mYdOXbVjRcS87fQJLTnhk6dRZPuJjI+9g6RZJO4PNCngUrmyw==}
- dependencies:
- '@types/react': 18.2.6
- dev: false
-
- resolution: {integrity: sha512-AiHHXh71a2M7Z6z1wj6iA23SkiRF9r0neHUdu8zjU/cT3MyLxDefYHbcceKhV/gjDEZgF3YaiNHyPNtoGUjPvg==}
- dependencies:
- '@types/react': 18.2.6
- dev: true
-
- resolution: {integrity: sha512-bAGh4e+w5D8dajd6InASVIyCo4pZLJ66oLb80F9OBLO1gKESbZcRCJpTT6uLXX+HAB57zw1WTdwJdAsewuTweg==}
- dependencies:
- '@types/hoist-non-react-statics': 3.3.1
- '@types/react': 18.2.6
- hoist-non-react-statics: 3.3.2
- redux: 4.2.1
- dev: false
-
- resolution: {integrity: sha512-hQV9Oq6oa+9HKdnGd43xkckElwf5dThOiegtQxqE7qX761oHhxnZO07fz6IsKSnUy9J3tzlRQBu3sNyvC8+kYw==}
- dependencies:
- '@types/react': 18.2.6
- dev: false
-
- resolution: {integrity: sha512-VnCdSxfcm08KjsJVQcfBmhEQAPnLB8G08hAxn39azX1qYBQ/5RVQuoHuKIcfKOdncuaUvEpFKFzEvbtIMsfVew==}
- dependencies:
- '@types/react': 18.2.6
-
- resolution: {integrity: sha512-ZVNmWumUIh5NhH8aMD9CR2hdW0fNuYInlocZHaZ+dgk/1K49j1w/HoAuK1ki+pgscQrOFRTlXeoURtuzEkV3dg==}
- dependencies:
- '@types/react': 18.2.6
- dev: false
-
- resolution: {integrity: sha512-8Ls660bHR1AUA2kuRvVG9D/4XpRC6wjAaPT9dil7Ckc76eP9TKWZwwmgfq8Q1LANX3QNDnoU4Zp48A3w+zK69Q==}
- dependencies:
- '@types/react': 18.2.6
-
- resolution: {integrity: sha512-gSON5zWYIGyoBcycCE75E9+r6dCC2dHdsrVkOEiIYNU5+Q28HcBAuqvDuxHcCbMfHBHdeT5Tva/AFn3rnMKE4g==}
- dependencies:
- '@types/prop-types': 15.7.5
- '@types/scheduler': 0.16.3
- csstype: 3.1.2
- dev: false
-
- resolution: {integrity: sha512-wRZClXn//zxCFW+ye/D2qY65UsYP1Fpex2YXorHc8awoNamkMZSvBxwxdYVInsHOZZd2Ppq8isnSzJL5Mpf8OA==}
- dependencies:
- '@types/prop-types': 15.7.5
- '@types/scheduler': 0.16.3
- csstype: 3.1.2
-
- resolution: {integrity: sha512-qaIzpCuXNWomGR1Xq8SCFTtF4v8V27Y6f+b9+bzHiv087MylI/nTCqqdChNeWS7tslgROmYB7yeiruWX7WnqNg==}
- dependencies:
- '@types/react': 18.2.6
- dev: true
-
- resolution: {integrity: sha512-5cJ8CB4yAx7BH1oMvdU0Jh9lrEXyPkar6F9G/ERswkCuvP4KQZfZkSjcMbAICCpQTN4OuZn8tz0HiKv9TGZgrQ==}
-
- resolution: {integrity: sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw==}
- dev: true
-
- resolution: {integrity: sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==}
-
- resolution: {integrity: sha512-xevGOReSYGM7g/kUBZzPqCrR/KYAo+F0yiPc85WFTJa0MSLtyFTVTU6cJu/aV4mid7IffDIWqo69THF2o4JiEQ==}
- dev: true
-
- resolution: {integrity: sha512-7NQmHra/JILCd1QqpSzl8+mJRc8ZHz3uDm8YV1Ks9IhK0epEiTw8aIErbvH9PI+6XbqhyIQy3462nEsn7UVzjQ==}
- dev: true
-
- resolution: {integrity: sha512-Q5vtl1W5ue16D+nIaW8JWebSSraJVlK+EthKn7e7UcD4KWsaSJ8BqGPXNaPghgtcn/fhvrN17Tv8ksUsQpiplw==}
- dev: true
-
- resolution: {integrity: sha512-EwmlvuaxPNej9+T4v5AuBPJa2x2UOJVdjCtDHgcDqitUeOtjnJKJ+apYjVcAoBEMjKW1VVFGZLUb5+qqa09XFA==}
- dev: false
-
- resolution: {integrity: sha512-1EkWuw7rT3BMz2HpmcEOr/HL61mWNA6Ulr/KdbXR9AI0A55wD4Qfv8hizd8Q1DnknSIzzDvQmvvY/guvX7jjZA==}
- dev: true
-
- resolution: {integrity: sha512-rFT3ak0/2trgvp4yYZo5iKFEPsET7vKydKF+VRCxlQ9bpheehyAJH89dAkaLEq/j/RZXJIqcgsmPJKUP1Z28HA==}
- dev: true
-
- resolution: {integrity: sha512-D1XC7WK8K+zZEveUPY+cf4+kgauk8N4eHr/XIHXGlGYkHLud6hK9lYfZk1ry1TNh798cZUCgb6MqGEG8DkJt6Q==}
- dev: false
-
- resolution: {integrity: sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==}
-
- resolution: {integrity: sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw==}
- dependencies:
- '@types/yargs-parser': 21.0.0
-
- /@typescript-eslint/[email protected](@typescript-eslint/[email protected])([email protected])([email protected]):
- resolution: {integrity: sha512-feA9xbVRWJZor+AnLNAr7A8JRWeZqHUf4T9tlP+TN04b05pFVhO5eN7/O93Y/1OUlLMHKbnJisgDURs/qvtqdg==}
- engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
- peerDependencies:
- '@typescript-eslint/parser': ^5.0.0
- eslint: ^6.0.0 || ^7.0.0 || ^8.0.0
- typescript: '*'
- peerDependenciesMeta:
- typescript:
- optional: true
- dependencies:
- '@eslint-community/regexpp': 4.5.1
- '@typescript-eslint/parser': 5.59.5([email protected])([email protected])
- '@typescript-eslint/scope-manager': 5.59.5
- '@typescript-eslint/type-utils': 5.59.5([email protected])([email protected])
- '@typescript-eslint/utils': 5.59.5([email protected])([email protected])
- debug: 4.3.4
- eslint: 8.40.0
- grapheme-splitter: 1.0.4
- ignore: 5.2.4
- natural-compare-lite: 1.4.0
- semver: 7.5.1
- tsutils: 3.21.0([email protected])
- typescript: 4.9.5
- transitivePeerDependencies:
- - supports-color
- dev: true
-
- resolution: {integrity: sha512-NJXQC4MRnF9N9yWqQE2/KLRSOLvrrlZb48NGVfBa+RuPMN6B7ZcK5jZOvhuygv4D64fRKnZI4L4p8+M+rfeQuw==}
- engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
- peerDependencies:
- eslint: ^6.0.0 || ^7.0.0 || ^8.0.0
- typescript: '*'
- peerDependenciesMeta:
- typescript:
- optional: true
- dependencies:
- '@typescript-eslint/scope-manager': 5.59.5
- '@typescript-eslint/types': 5.59.5
- '@typescript-eslint/typescript-estree': 5.59.5([email protected])
- debug: 4.3.4
- eslint: 8.40.0
- typescript: 4.9.5
- transitivePeerDependencies:
- - supports-color
- dev: true
-
- /@typescript-eslint/[email protected]:
- resolution: {integrity: sha512-jVecWwnkX6ZgutF+DovbBJirZcAxgxC0EOHYt/niMROf8p4PwxxG32Qdhj/iIQQIuOflLjNkxoXyArkcIP7C3A==}
- engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
- dependencies:
- '@typescript-eslint/types': 5.59.5
- '@typescript-eslint/visitor-keys': 5.59.5
- dev: true
-
- resolution: {integrity: sha512-4eyhS7oGym67/pSxA2mmNq7X164oqDYNnZCUayBwJZIRVvKpBCMBzFnFxjeoDeShjtO6RQBHBuwybuX3POnDqg==}
- engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
- peerDependencies:
- eslint: '*'
- typescript: '*'
- peerDependenciesMeta:
- typescript:
- optional: true
- dependencies:
- '@typescript-eslint/typescript-estree': 5.59.5([email protected])
- '@typescript-eslint/utils': 5.59.5([email protected])([email protected])
- debug: 4.3.4
- eslint: 8.40.0
- tsutils: 3.21.0([email protected])
- typescript: 4.9.5
- transitivePeerDependencies:
- - supports-color
- dev: true
-
- /@typescript-eslint/[email protected]:
- resolution: {integrity: sha512-xkfRPHbqSH4Ggx4eHRIO/eGL8XL4Ysb4woL8c87YuAo8Md7AUjyWKa9YMwTL519SyDPrfEgKdewjkxNCVeJW7w==}
- engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
- dev: true
-
- /@typescript-eslint/[email protected]([email protected]):
- resolution: {integrity: sha512-+XXdLN2CZLZcD/mO7mQtJMvCkzRfmODbeSKuMY/yXbGkzvA9rJyDY5qDYNoiz2kP/dmyAxXquL2BvLQLJFPQIg==}
- engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
- peerDependencies:
- typescript: '*'
- peerDependenciesMeta:
- typescript:
- optional: true
- dependencies:
- '@typescript-eslint/types': 5.59.5
- '@typescript-eslint/visitor-keys': 5.59.5
- debug: 4.3.4
- globby: 11.1.0
- is-glob: 4.0.3
- semver: 7.5.1
- tsutils: 3.21.0([email protected])
- typescript: 4.9.5
- transitivePeerDependencies:
- - supports-color
- dev: true
-
- resolution: {integrity: sha512-sCEHOiw+RbyTii9c3/qN74hYDPNORb8yWCoPLmB7BIflhplJ65u2PBpdRla12e3SSTJ2erRkPjz7ngLHhUegxA==}
- engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
- peerDependencies:
- eslint: ^6.0.0 || ^7.0.0 || ^8.0.0
- dependencies:
- '@eslint-community/eslint-utils': 4.4.0([email protected])
- '@types/json-schema': 7.0.11
- '@types/semver': 7.5.0
- '@typescript-eslint/scope-manager': 5.59.5
- '@typescript-eslint/types': 5.59.5
- '@typescript-eslint/typescript-estree': 5.59.5([email protected])
- eslint: 8.40.0
- eslint-scope: 5.1.1
- semver: 7.5.1
- transitivePeerDependencies:
- - supports-color
- - typescript
- dev: true
-
- /@typescript-eslint/[email protected]:
- resolution: {integrity: sha512-qL+Oz+dbeBRTeyJTIy0eniD3uvqU7x+y1QceBismZ41hd4aBSRh8UAw4pZP0+XzLuPZmx4raNMq/I+59W2lXKA==}
- engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
- dependencies:
- '@typescript-eslint/types': 5.59.5
- eslint-visitor-keys: 3.4.1
- dev: true
-
- resolution: {integrity: sha512-AfgcRL8ZBhAlc3BFdigClmTUMISmmzHn7sB2h9U1odvc5U/MjWXsAaz18b/WoppUTDBzxOJwo2VdClfUcItu9g==}
- engines: {node: ^14.18.0 || >=16.0.0}
- peerDependencies:
- vite: ^4.1.0-beta.0
- dependencies:
- '@babel/core': 7.21.8
- '@babel/plugin-transform-react-jsx-self': 7.21.0(@babel/[email protected])
- '@babel/plugin-transform-react-jsx-source': 7.19.6(@babel/[email protected])
- magic-string: 0.27.0
- react-refresh: 0.14.0
- vite: 4.3.5(@types/[email protected])([email protected])
- transitivePeerDependencies:
- - supports-color
- dev: true
-
- resolution: {integrity: sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==}
- dev: true
-
- resolution: {integrity: sha512-umOSDSDrfHbTNPuNpC2NSnnA3LUrqpevPb4T9jRx4MagXNS0rs+gwiTcAvqCRmsD6utzsrzNt+ebm00SNWiC3Q==}
- dependencies:
- acorn: 8.8.2
- acorn-walk: 8.2.0
- dev: true
-
- resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==}
- peerDependencies:
- acorn: ^6.0.0 || ^7.0.0 || ^8.0.0
- dependencies:
- acorn: 8.8.2
- dev: true
-
- resolution: {integrity: sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==}
- engines: {node: '>=0.4.0'}
- dev: true
-
- resolution: {integrity: sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==}
- engines: {node: '>=0.4.0'}
- hasBin: true
- dev: true
-
- resolution: {integrity: sha512-YMyxSlXpPjD8uWekCQGuN40lV4bnZagUwqa2m/uFv1z/tNImSk9fnXVMUI5qwME/zzI3MMQRvjZ+69zyfSSyew==}
- dev: false
-
- resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==}
- engines: {node: '>= 6.0.0'}
- dependencies:
- debug: 4.3.4
- transitivePeerDependencies:
- - supports-color
- dev: true
-
- resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==}
- dependencies:
- fast-deep-equal: 3.1.3
- fast-json-stable-stringify: 2.1.0
- json-schema-traverse: 0.4.1
- uri-js: 4.4.1
- dev: true
-
- resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==}
- engines: {node: '>=8'}
- dependencies:
- type-fest: 0.21.3
-
- resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==}
- engines: {node: '>=8'}
-
- resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==}
- engines: {node: '>=4'}
- dependencies:
- color-convert: 1.9.3
-
- resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==}
- engines: {node: '>=8'}
- dependencies:
- color-convert: 2.0.1
-
- resolution: {integrity: sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==}
- engines: {node: '>=10'}
-
- resolution: {integrity: sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==}
- dev: true
-
- resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==}
- engines: {node: '>= 8'}
- dependencies:
- normalize-path: 3.0.0
- picomatch: 2.3.1
-
- resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==}
- dev: true
-
- resolution: {integrity: sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==}
- dev: true
-
- resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==}
- dependencies:
- sprintf-js: 1.0.3
-
- resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==}
- dev: true
-
- resolution: {integrity: sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==}
- dependencies:
- call-bind: 1.0.2
- is-array-buffer: 3.0.2
- dev: true
-
- resolution: {integrity: sha512-sgTbLvL6cNnw24FnbaDyjmvddQ2ML8arZsgaJhoABMoplz/4QRhtrYS+alr1BUM1Bwp6dhx8vVCBSLG+StwOFw==}
- engines: {node: '>= 0.4'}
- dependencies:
- call-bind: 1.0.2
- define-properties: 1.2.0
- es-abstract: 1.21.2
- get-intrinsic: 1.2.1
- is-string: 1.0.7
- dev: true
-
- resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==}
- engines: {node: '>=8'}
- dev: true
-
- resolution: {integrity: sha512-8UGn9O1FDVvMNB0UlLv4voxRMze7+FpHyF5mSMRjWHUMlpoDViniy05870VlxhfgTnLbpuwTzvD76MTtWxB/mQ==}
- engines: {node: '>= 0.4'}
- dependencies:
- call-bind: 1.0.2
- define-properties: 1.2.0
- es-abstract: 1.21.2
- es-shim-unscopables: 1.0.0
- dev: true
-
- resolution: {integrity: sha512-pZYPXPRl2PqWcsUs6LOMn+1f1532nEoPTYowBtqLwAW+W8vSVhkIGnmOX1t/UQjD6YGI0vcD2B1U7ZFGQH9jnQ==}
- dependencies:
- call-bind: 1.0.2
- define-properties: 1.2.0
- es-abstract: 1.21.2
- es-shim-unscopables: 1.0.0
- get-intrinsic: 1.2.1
- dev: true
-
- resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==}
- dev: true
-
- resolution: {integrity: sha512-FQzyfOsTlwVzjHxKEqRIAdJx9niO6VCBCoEwax/VLSoQF29ggECcPuBqUMZ+u8jCZOPSy8b8/8KnuFbp0SaFZQ==}
- engines: {node: ^10 || ^12 || >=14}
- hasBin: true
- peerDependencies:
- postcss: ^8.1.0
- dependencies:
- browserslist: 4.21.5
- caniuse-lite: 1.0.30001487
- fraction.js: 4.2.0
- normalize-range: 0.1.2
- picocolors: 1.0.0
- postcss: 8.4.23
- postcss-value-parser: 4.2.0
- dev: true
-
- resolution: {integrity: sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==}
- engines: {node: '>= 0.4'}
- dev: true
-
- resolution: {integrity: sha512-BYCzImLos6J3BH/+HvUCHG1dTf2MzmAB4jaVxHV+29RZLjR29XuYTmsf2sdDwkrb+FczkGo3kOhE7ga6sI0P4A==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- peerDependencies:
- '@babel/core': ^7.8.0
- dependencies:
- '@babel/core': 7.21.8
- '@jest/transform': 29.6.4
- '@types/babel__core': 7.20.0
- babel-plugin-istanbul: 6.1.1
- babel-preset-jest: 29.5.0(@babel/[email protected])
- chalk: 4.1.2
- graceful-fs: 4.2.11
- slash: 3.0.0
- transitivePeerDependencies:
- - supports-color
-
- resolution: {integrity: sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==}
- engines: {node: '>=8'}
- dependencies:
- '@babel/helper-plugin-utils': 7.21.5
- '@istanbuljs/load-nyc-config': 1.1.0
- '@istanbuljs/schema': 0.1.3
- istanbul-lib-instrument: 5.2.1
- test-exclude: 6.0.0
- transitivePeerDependencies:
- - supports-color
-
- resolution: {integrity: sha512-zSuuuAlTMT4mzLj2nPnUm6fsE6270vdOfnpbJ+RmruU75UhLFvL0N2NgI7xpeS7NaB6hGqmd5pVpGTDYvi4Q3w==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- dependencies:
- '@babel/template': 7.20.7
- '@babel/types': 7.21.5
- '@types/babel__core': 7.20.0
- '@types/babel__traverse': 7.18.5
-
- resolution: {integrity: sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg==}
- engines: {node: '>=10', npm: '>=6'}
- dependencies:
- '@babel/runtime': 7.23.4
- cosmiconfig: 7.1.0
- resolve: 1.22.2
- dev: false
-
- resolution: {integrity: sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==}
- peerDependencies:
- '@babel/core': ^7.0.0
- dependencies:
- '@babel/core': 7.21.8
- '@babel/plugin-syntax-async-generators': 7.8.4(@babel/[email protected])
- '@babel/plugin-syntax-bigint': 7.8.3(@babel/[email protected])
- '@babel/plugin-syntax-class-properties': 7.12.13(@babel/[email protected])
- '@babel/plugin-syntax-import-meta': 7.10.4(@babel/[email protected])
- '@babel/plugin-syntax-json-strings': 7.8.3(@babel/[email protected])
- '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/[email protected])
- '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/[email protected])
- '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/[email protected])
- '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/[email protected])
- '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/[email protected])
- '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/[email protected])
- '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/[email protected])
-
- resolution: {integrity: sha512-JOMloxOqdiBSxMAzjRaH023/vvcaSaec49zvg+2LmNsktC7ei39LTJGw02J+9uUtTZUq6xbLyJ4dxe9sSmIuAg==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- peerDependencies:
- '@babel/core': ^7.0.0
- dependencies:
- '@babel/core': 7.21.8
- babel-plugin-jest-hoist: 29.5.0
- babel-preset-current-node-syntax: 1.0.1(@babel/[email protected])
-
- resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==}
-
- resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==}
- engines: {node: '>=8'}
-
- resolution: {integrity: sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==}
- dev: true
-
- resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==}
- dependencies:
- balanced-match: 1.0.2
- concat-map: 0.0.1
-
- resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==}
- engines: {node: '>=8'}
- dependencies:
- fill-range: 7.0.1
-
- resolution: {integrity: sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w==}
- engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7}
- hasBin: true
- dependencies:
- caniuse-lite: 1.0.30001487
- electron-to-chromium: 1.4.394
- node-releases: 2.0.10
- update-browserslist-db: 1.0.11([email protected])
-
- resolution: {integrity: sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==}
- engines: {node: '>= 6'}
- dependencies:
- fast-json-stable-stringify: 2.1.0
- dev: true
-
- resolution: {integrity: sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==}
- dependencies:
- node-int64: 0.4.0
-
- resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==}
-
- resolution: {integrity: sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==}
- dependencies:
- function-bind: 1.1.1
- get-intrinsic: 1.2.1
-
- resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==}
- engines: {node: '>=6'}
-
- resolution: {integrity: sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw==}
- dependencies:
- pascal-case: 3.1.2
- tslib: 2.5.0
- dev: true
-
- resolution: {integrity: sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==}
- engines: {node: '>= 6'}
- dev: true
-
- resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==}
- engines: {node: '>=6'}
-
- resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==}
- engines: {node: '>=10'}
-
- resolution: {integrity: sha512-83564Z3yWGqXsh2vaH/mhXfEM0wX+NlBCm1jYHOb97TrTWJEmPTccZgeLTPBUUb0PNVo+oomb7wkimZBIERClA==}
-
- resolution: {integrity: sha512-ds37W8CytHgwnhGGTi88pcPyR15qoNkOpYwmMMfnWqqWgESapLqvDx6huFjQ5vqWSn2Z06173XNA7LtMOeUh1A==}
- dependencies:
- no-case: 3.0.4
- tslib: 2.5.0
- upper-case-first: 2.0.2
- dev: true
-
- resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==}
- engines: {node: '>=4'}
- dependencies:
- ansi-styles: 3.2.1
- escape-string-regexp: 1.0.5
- supports-color: 5.5.0
-
- resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==}
- engines: {node: '>=10'}
- dependencies:
- ansi-styles: 4.3.0
- supports-color: 7.2.0
-
- resolution: {integrity: sha512-bSxY2ws9OtviILG1EiY5K7NNxkqg/JnRnFxLtKQ96JaviiIxi7djMrSd0ECT9AC+lttClmYwKw53BWpOMblo7A==}
- dependencies:
- camel-case: 4.1.2
- capital-case: 1.0.4
- constant-case: 3.0.4
- dot-case: 3.0.4
- header-case: 2.0.4
- no-case: 3.0.4
- param-case: 3.0.4
- pascal-case: 3.1.2
- path-case: 3.0.4
- sentence-case: 3.0.4
- snake-case: 3.0.4
- tslib: 2.5.0
- dev: true
-
- resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==}
- engines: {node: '>=10'}
-
- resolution: {integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==}
- engines: {node: '>= 8.10.0'}
- dependencies:
- anymatch: 3.1.3
- braces: 3.0.2
- glob-parent: 5.1.2
- is-binary-path: 2.1.0
- is-glob: 4.0.3
- normalize-path: 3.0.0
- readdirp: 3.6.0
- optionalDependencies:
- fsevents: 2.3.2
-
- resolution: {integrity: sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==}
- engines: {node: '>=8'}
-
- resolution: {integrity: sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA==}
-
- resolution: {integrity: sha512-CSbhY4cFEJRe6/GQzIk5qXZ4Jeg5pcsP7b5peFSDpffpe1cqjASH/n9UTjBwOp6XpMSTwQ8Za2K5V02ueA7Tmw==}
- dev: false
-
- resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==}
- engines: {node: '>=12'}
- dependencies:
- string-width: 4.2.3
- strip-ansi: 6.0.1
- wrap-ansi: 7.0.0
-
- resolution: {integrity: sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w==}
- engines: {node: '>=0.8'}
- dev: false
-
- resolution: {integrity: sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==}
- engines: {node: '>=6'}
- dev: false
-
- resolution: {integrity: sha512-rQ1+kcj+ttHG0MKVGBUXwayCCF1oh39BF5COIpRzuCEv8Mwjv0XucrI2ExNTOn9IlLifGClWQcU9BrZORvtw6Q==}
- engines: {node: '>=6'}
- dev: false
-
- resolution: {integrity: sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==}
- engines: {iojs: '>= 1.0.0', node: '>= 0.12.0'}
-
- resolution: {integrity: sha512-iBPtljfCNcTKNAto0KEtDfZ3qzjJvqE3aTGZsbhjSBlorqpXJlaWWtPO35D+ZImoC3KWejX64o+yPGxhWSTzfg==}
-
- resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==}
- dependencies:
- color-name: 1.1.3
-
- resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==}
- engines: {node: '>=7.0.0'}
- dependencies:
- color-name: 1.1.4
-
- resolution: {integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==}
-
- resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==}
-
- resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==}
- engines: {node: '>= 0.8'}
- dependencies:
- delayed-stream: 1.0.0
- dev: true
-
- resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==}
- engines: {node: '>= 6'}
- dev: true
-
- resolution: {integrity: sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==}
- engines: {node: '>= 10'}
- dev: true
-
- resolution: {integrity: sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==}
- engines: {node: '>= 12'}
-
- resolution: {integrity: sha512-rj8l8pD4bJ1nx+dAkMhV1xB5RuZEyVysfxJqB1pRchh1KVvwOv9b7CGB8ZfjTImVv2oF+sYMUkMZq6Na5Ftmbg==}
- dev: false
-
- resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==}
-
- resolution: {integrity: sha512-I2hSBi7Vvs7BEuJDr5dDHfzb/Ruj3FyvFyh7KLilAjNQw3Be+xgqUBA2W6scVEcL0hL1dwPRtIqEPVUCKkSsyQ==}
- dependencies:
- no-case: 3.0.4
- tslib: 2.5.0
- upper-case: 2.0.2
- dev: true
-
- resolution: {integrity: sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==}
-
- resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==}
-
- resolution: {integrity: sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==}
- engines: {node: '>=10'}
- dependencies:
- '@types/parse-json': 4.0.0
- import-fresh: 3.3.0
- parse-json: 5.2.0
- path-type: 4.0.0
- yaml: 1.10.2
- dev: false
-
- resolution: {integrity: sha512-3rTMnFJA1tCOPwRxtgF4wd7Ab2qvDbL8jX+3smjIbS4HlZBagTlpERbdN7iAbWlrfxE3M8c27kTwTawQ7st+OQ==}
- engines: {node: '>=14'}
- dependencies:
- import-fresh: 3.3.0
- js-yaml: 4.1.0
- parse-json: 5.2.0
- path-type: 4.0.0
- dev: true
-
- resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==}
- dev: true
-
- resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==}
- engines: {node: '>= 8'}
- dependencies:
- path-key: 3.1.1
- shebang-command: 2.0.0
- which: 2.0.2
-
- resolution: {integrity: sha512-a7Vr4Q/kd/aw96bnJG332W9V9LkJO69JRcaCYDUqjp6/z0w6VcZjgAcTbgFxEPfBgdnAwlh3iwu+hLopa+flJw==}
- dependencies:
- tiny-invariant: 1.3.1
- dev: false
-
- resolution: {integrity: sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==}
- dependencies:
- boolbase: 1.0.0
- css-what: 6.1.0
- domhandler: 5.0.3
- domutils: 3.1.0
- nth-check: 2.1.1
- dev: true
-
- resolution: {integrity: sha512-OA0mILzGc1kCOCSJerOeqDxDQ4HOh+G8NbOJFOTgOCzpw7fCBubk0fEyxp8AgOL/jvLgYA/uV0cMbe43ElF1JA==}
- engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0, npm: '>=7.0.0'}
- dependencies:
- mdn-data: 2.0.28
- source-map-js: 1.0.2
- dev: true
-
- resolution: {integrity: sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==}
- engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0}
- dependencies:
- mdn-data: 2.0.30
- source-map-js: 1.0.2
- dev: true
-
- resolution: {integrity: sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==}
- engines: {node: '>= 6'}
- dev: true
-
- resolution: {integrity: sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==}
- engines: {node: '>=4'}
- hasBin: true
- dev: true
-
- resolution: {integrity: sha512-0LrrStPOdJj+SPCCrGhzryycLjwcgUSHBtxNA8aIDxf0GLsRh1cKYhB00Gd1lDOS4yGH69+SNn13+TWbVHETFQ==}
- engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0, npm: '>=7.0.0'}
- dependencies:
- css-tree: 2.2.1
- dev: true
-
- resolution: {integrity: sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==}
- dev: true
-
- resolution: {integrity: sha512-iKuQcq+NdHqlAcwUY0o/HL69XQrUaQdMjmStJ8JFmUaiiQErlhrmuigkg/CU4E2J0IyUKUrMAgl36TvN67MqTw==}
- dev: true
-
- resolution: {integrity: sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==}
- engines: {node: '>=8'}
- dependencies:
- cssom: 0.3.8
- dev: true
-
- resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==}
-
- resolution: {integrity: sha512-Jy/tj3ldjZJo63sVAvg6LHt2mHvl4V6AgRAmNDtLdm7faqtsx+aJG42rsyCo9JCoRVKwPFzKlIPx3DIibwSIaQ==}
- engines: {node: '>=12'}
- dependencies:
- abab: 2.0.6
- whatwg-mimetype: 3.0.0
- whatwg-url: 11.0.0
- dev: true
-
- resolution: {integrity: sha512-QWxYLR5P/6GStZcdem+V1xoto6DMadYWpMXU82ES3/RfR3Wdwr3D0+be7mgOJ+Ov0G9D5Dmb9T17sNLQYj9XOg==}
- dev: false
-
- resolution: {integrity: sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==}
- engines: {node: '>=0.11'}
- dependencies:
- '@babel/runtime': 7.23.4
-
- resolution: {integrity: sha512-QvzAURSbQ0pKdIye2txOzNaHmxtUBXerpY0FJsFXUMKbIZeFm5ht1LS/jFsrncjnmtv8HsG0W2g6c0zUjZWmpA==}
- dev: false
-
- resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==}
- engines: {node: '>=6.0'}
- peerDependencies:
- supports-color: '*'
- peerDependenciesMeta:
- supports-color:
- optional: true
- dependencies:
- ms: 2.1.2
-
- resolution: {integrity: sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==}
- dev: true
-
- resolution: {integrity: sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==}
-
- resolution: {integrity: sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g==}
- dependencies:
- is-arguments: 1.1.1
- is-date-object: 1.0.5
- is-regex: 1.1.4
- object-is: 1.1.5
- object-keys: 1.1.1
- regexp.prototype.flags: 1.5.0
- dev: false
-
- resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==}
- dev: true
-
- resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==}
- engines: {node: '>=0.10.0'}
-
- resolution: {integrity: sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==}
- engines: {node: '>= 0.4'}
- dependencies:
- has-property-descriptors: 1.0.0
- object-keys: 1.1.1
-
- resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==}
- engines: {node: '>=0.4.0'}
- dev: true
-
- resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==}
- engines: {node: '>=6'}
- dev: false
-
- resolution: {integrity: sha512-OCg2UsLbXK7GmmpzMXhYkdO64vhJ1ROUUGaTFyHjVwEdMEcTTRj7W1TxLbSBxdY8QLBPCcp66MTyaSy0RpO17A==}
- peerDependencies:
- valtio: '*'
- dependencies:
- valtio: 1.12.1(@types/[email protected])([email protected])
- dev: false
-
- resolution: {integrity: sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==}
- engines: {node: '>=8'}
-
- resolution: {integrity: sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==}
- dev: true
-
- resolution: {integrity: sha512-ofrBgwpPhCD85kMKtE9RYFFq6OC1A89oW2vvgWZNCwxrUpRUILopY7lsYyMDSjc8g6U6aiO0Qubg6r4Wgt5ZnA==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
-
- resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==}
- engines: {node: '>=0.3.1'}
- dev: true
-
- resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==}
- engines: {node: '>=8'}
- dependencies:
- path-type: 4.0.0
- dev: true
-
- resolution: {integrity: sha512-GYqKi1aH7PJXxdhTeZBFrg8vUBeKXi+cNprXsC1kpJcbcVnV9wBsrOu1cQEdG0WeQwlfHiy3XvnKfIrJ2R0NzQ==}
- hasBin: true
- dev: false
-
- resolution: {integrity: sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==}
- dev: true
-
- resolution: {integrity: sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==}
- engines: {node: '>=0.10.0'}
- dependencies:
- esutils: 2.0.3
- dev: true
-
- resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==}
- engines: {node: '>=6.0.0'}
- dependencies:
- esutils: 2.0.3
- dev: true
-
- resolution: {integrity: sha512-w9kU7FAbaSh3QKijL6n59ofAhkkmMJ31GclJIz/vyQdjogfyxcB6Zf8CZyibOERI5o0Hxz30VmJS7+7r5fEj2Q==}
- dependencies:
- add-px-to-style: 1.0.0
- prefix-style: 2.0.1
- to-camel-case: 1.0.0
- dev: false
-
- resolution: {integrity: sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA==}
- dependencies:
- '@babel/runtime': 7.23.4
- csstype: 3.1.2
- dev: false
-
- resolution: {integrity: sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==}
- dependencies:
- domelementtype: 2.3.0
- domhandler: 5.0.3
- entities: 4.5.0
- dev: true
-
- resolution: {integrity: sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==}
- dev: true
-
- resolution: {integrity: sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==}
- engines: {node: '>=12'}
- dependencies:
- webidl-conversions: 7.0.0
- dev: true
-
- resolution: {integrity: sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==}
- engines: {node: '>= 4'}
- dependencies:
- domelementtype: 2.3.0
- dev: true
-
- resolution: {integrity: sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==}
- dependencies:
- dom-serializer: 2.0.0
- domelementtype: 2.3.0
- domhandler: 5.0.3
- dev: true
-
- resolution: {integrity: sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==}
- dependencies:
- no-case: 3.0.4
- tslib: 2.5.0
- dev: true
-
- resolution: {integrity: sha512-ssuANeD+z97meYOqd50e04Ze5qp4bPqo8cCkI4TRjZkzAUgIDTrXV1R8QCdINpiI+hw14+rYazvTRdQrz0/rFQ==}
- dependencies:
- xtend: 4.0.2
- dev: true
-
- resolution: {integrity: sha512-0IbC2cfr8w5LxTz+nmn2cJTGafsK9iauV2r5A5scfzyovqLrxuLoxOHE5OBobP3oVIggJT+0JfKnw9sm87c8Hw==}
-
- resolution: {integrity: sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==}
- engines: {node: '>=12'}
-
- resolution: {integrity: sha512-Sqc/nso4cjxhOwWJsp9xkVm8OF5c+mJLZJFoFfzRuKO+yWiN7K8c96xmtughYb0d/fZ8UC6cLIQ/p4BR6Pv3/A==}
- dev: false
-
- resolution: {integrity: sha512-97g6QgOk8zlDRdgq1WxwgTMgEWGVAQvB5Fdpgc1MkNy56la5SKP9GsMXKDOdqwn90/41a8yPwIGk1Y6WVbeMQA==}
- dev: false
-
- resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==}
-
- resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==}
- engines: {node: '>=0.12'}
- dev: true
-
- resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==}
- dependencies:
- is-arrayish: 0.2.1
-
- resolution: {integrity: sha512-y/B5POM2iBnIxCiernH1G7rC9qQoM77lLIMQLuob0zhp8C56Po81+2Nj0WFKnd0pNReDTnkYryc+zhOzpEIROg==}
- engines: {node: '>= 0.4'}
- dependencies:
- array-buffer-byte-length: 1.0.0
- available-typed-arrays: 1.0.5
- call-bind: 1.0.2
- es-set-tostringtag: 2.0.1
- es-to-primitive: 1.2.1
- function.prototype.name: 1.1.5
- get-intrinsic: 1.2.1
- get-symbol-description: 1.0.0
- globalthis: 1.0.3
- gopd: 1.0.1
- has: 1.0.3
- has-property-descriptors: 1.0.0
- has-proto: 1.0.1
- has-symbols: 1.0.3
- internal-slot: 1.0.5
- is-array-buffer: 3.0.2
- is-callable: 1.2.7
- is-negative-zero: 2.0.2
- is-regex: 1.1.4
- is-shared-array-buffer: 1.0.2
- is-string: 1.0.7
- is-typed-array: 1.1.10
- is-weakref: 1.0.2
- object-inspect: 1.12.3
- object-keys: 1.1.1
- object.assign: 4.1.4
- regexp.prototype.flags: 1.5.0
- safe-regex-test: 1.0.0
- string.prototype.trim: 1.2.7
- string.prototype.trimend: 1.0.6
- string.prototype.trimstart: 1.0.6
- typed-array-length: 1.0.4
- unbox-primitive: 1.0.2
- which-typed-array: 1.1.9
- dev: true
-
- resolution: {integrity: sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==}
- engines: {node: '>= 0.4'}
- dependencies:
- get-intrinsic: 1.2.1
- has: 1.0.3
- has-tostringtag: 1.0.0
- dev: true
-
- resolution: {integrity: sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==}
- dependencies:
- has: 1.0.3
- dev: true
-
- resolution: {integrity: sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==}
- engines: {node: '>= 0.4'}
- dependencies:
- is-callable: 1.2.7
- is-date-object: 1.0.5
- is-symbol: 1.0.4
- dev: true
-
- resolution: {integrity: sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw==}
- engines: {node: '>=12'}
- hasBin: true
- requiresBuild: true
- optionalDependencies:
- '@esbuild/android-arm': 0.17.19
- '@esbuild/android-arm64': 0.17.19
- '@esbuild/android-x64': 0.17.19
- '@esbuild/darwin-arm64': 0.17.19
- '@esbuild/darwin-x64': 0.17.19
- '@esbuild/freebsd-arm64': 0.17.19
- '@esbuild/freebsd-x64': 0.17.19
- '@esbuild/linux-arm': 0.17.19
- '@esbuild/linux-arm64': 0.17.19
- '@esbuild/linux-ia32': 0.17.19
- '@esbuild/linux-loong64': 0.17.19
- '@esbuild/linux-mips64el': 0.17.19
- '@esbuild/linux-ppc64': 0.17.19
- '@esbuild/linux-riscv64': 0.17.19
- '@esbuild/linux-s390x': 0.17.19
- '@esbuild/linux-x64': 0.17.19
- '@esbuild/netbsd-x64': 0.17.19
- '@esbuild/openbsd-x64': 0.17.19
- '@esbuild/sunos-x64': 0.17.19
- '@esbuild/win32-arm64': 0.17.19
- '@esbuild/win32-ia32': 0.17.19
- '@esbuild/win32-x64': 0.17.19
- dev: true
-
- resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==}
- engines: {node: '>=6'}
-
- resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==}
- engines: {node: '>=0.8.0'}
-
- resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==}
- engines: {node: '>=8'}
-
- resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==}
- engines: {node: '>=10'}
-
- resolution: {integrity: sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==}
- engines: {node: '>=6.0'}
- hasBin: true
- dependencies:
- esprima: 4.0.1
- estraverse: 5.3.0
- esutils: 2.0.3
- optionalDependencies:
- source-map: 0.6.1
- dev: true
-
- resolution: {integrity: sha512-oFc7Itz9Qxh2x4gNHStv3BqJq54ExXmfC+a1NjAta66IAN87Wu0R/QArgIS9qKzX3dXKPI9H5crl9QchNMY9+g==}
- engines: {node: '>=10'}
- peerDependencies:
- eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0
- dependencies:
- eslint: 8.40.0
- dev: true
-
- resolution: {integrity: sha512-t2fBMa+XzonrrNkyVirzKlvn5RXzzPwRHtMvLAtVZrt8oxgnTQaYbU6SXTOO1mwQgp1y5+toMSKInnzGr0Knqg==}
- engines: {node: '>=4'}
- peerDependencies:
- eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8
- dependencies:
- array-includes: 3.1.6
- array.prototype.flatmap: 1.3.1
- array.prototype.tosorted: 1.1.1
- doctrine: 2.1.0
- eslint: 8.40.0
- estraverse: 5.3.0
- jsx-ast-utils: 3.3.3
- minimatch: 3.1.2
- object.entries: 1.1.6
- object.fromentries: 2.0.6
- object.hasown: 1.1.2
- object.values: 1.1.6
- prop-types: 15.8.1
- resolve: 2.0.0-next.4
- semver: 6.3.0
- string.prototype.matchall: 4.0.8
- dev: true
-
- resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==}
- engines: {node: '>=8.0.0'}
- dependencies:
- esrecurse: 4.3.0
- estraverse: 4.3.0
- dev: true
-
- resolution: {integrity: sha512-DYj5deGlHBfMt15J7rdtyKNq/Nqlv5KfU4iodrQ019XESsRnwXH9KAE0y3cwtUHDo2ob7CypAnCqefh6vioWRw==}
- engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
- dependencies:
- esrecurse: 4.3.0
- estraverse: 5.3.0
- dev: true
-
- resolution: {integrity: sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==}
- engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
- dev: true
-
- resolution: {integrity: sha512-bvR+TsP9EHL3TqNtj9sCNJVAFK3fBN8Q7g5waghxyRsPLIMwL73XSKnZFK0hk/O2ANC+iAoq6PWMQ+IfBAJIiQ==}
- engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
- hasBin: true
- dependencies:
- '@eslint-community/eslint-utils': 4.4.0([email protected])
- '@eslint-community/regexpp': 4.5.1
- '@eslint/eslintrc': 2.0.3
- '@eslint/js': 8.40.0
- '@humanwhocodes/config-array': 0.11.8
- '@humanwhocodes/module-importer': 1.0.1
- '@nodelib/fs.walk': 1.2.8
- ajv: 6.12.6
- chalk: 4.1.2
- cross-spawn: 7.0.3
- debug: 4.3.4
- doctrine: 3.0.0
- escape-string-regexp: 4.0.0
- eslint-scope: 7.2.0
- eslint-visitor-keys: 3.4.1
- espree: 9.5.2
- esquery: 1.5.0
- esutils: 2.0.3
- fast-deep-equal: 3.1.3
- file-entry-cache: 6.0.1
- find-up: 5.0.0
- glob-parent: 6.0.2
- globals: 13.20.0
- grapheme-splitter: 1.0.4
- ignore: 5.2.4
- import-fresh: 3.3.0
- imurmurhash: 0.1.4
- is-glob: 4.0.3
- is-path-inside: 3.0.3
- js-sdsl: 4.4.0
- js-yaml: 4.1.0
- json-stable-stringify-without-jsonify: 1.0.1
- levn: 0.4.1
- lodash.merge: 4.6.2
- minimatch: 3.1.2
- natural-compare: 1.4.0
- optionator: 0.9.1
- strip-ansi: 6.0.1
- strip-json-comments: 3.1.1
- text-table: 0.2.0
- transitivePeerDependencies:
- - supports-color
- dev: true
-
- resolution: {integrity: sha512-7OASN1Wma5fum5SrNhFMAMJxOUAbhyfQ8dQ//PJaJbNw0URTPWqIghHWt1MmAANKhHZIYOHruW4Kw4ruUWOdGw==}
- engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
- dependencies:
- acorn: 8.8.2
- acorn-jsx: 5.3.2([email protected])
- eslint-visitor-keys: 3.4.1
- dev: true
-
- resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==}
- engines: {node: '>=4'}
- hasBin: true
-
- resolution: {integrity: sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==}
- engines: {node: '>=0.10'}
- dependencies:
- estraverse: 5.3.0
- dev: true
-
- resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==}
- engines: {node: '>=4.0'}
- dependencies:
- estraverse: 5.3.0
- dev: true
-
- resolution: {integrity: sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==}
- engines: {node: '>=4.0'}
- dev: true
-
- resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==}
- engines: {node: '>=4.0'}
- dev: true
-
- resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==}
- dev: true
-
- resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==}
- engines: {node: '>=0.10.0'}
- dev: true
-
- resolution: {integrity: sha512-jLN68Dx5kyFHaePoXWPsCGW5qdyZQtLYHkxkg02/Mz6g0kYpDx4FyP6XfArhQdlOC4b8Mv+EMxPo/8La7Tzghg==}
- dev: false
-
- resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==}
- engines: {node: '>=0.8.x'}
- dev: false
-
- resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==}
- engines: {node: '>=10'}
- dependencies:
- cross-spawn: 7.0.3
- get-stream: 6.0.1
- human-signals: 2.1.0
- is-stream: 2.0.1
- merge-stream: 2.0.0
- npm-run-path: 4.0.1
- onetime: 5.1.2
- signal-exit: 3.0.7
- strip-final-newline: 2.0.0
-
- resolution: {integrity: sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==}
- engines: {node: '>= 0.8.0'}
-
- resolution: {integrity: sha512-yM7xqUrCO2JdpFo4XpM82t+PJBFybdqoQuJLDGeDX2ij8NZzqRHyu3Hp188/JX7SWqud+7t4MUdvcgGBICMHZg==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- dependencies:
- '@jest/expect-utils': 29.5.0
- jest-get-type: 29.4.3
- jest-matcher-utils: 29.5.0
- jest-message-util: 29.5.0
- jest-util: 29.5.0
-
- resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==}
- dev: false
-
- resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==}
- dev: true
-
- resolution: {integrity: sha512-KaJUt+M9t1qaIteSvjc6P3RbMdXsNhK61GRftR6SNxqmhthcd9MGIi4T+o0jD8LUSpSnSKXE20nLtJ3fOHxQig==}
- dev: false
-
- resolution: {integrity: sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==}
- dev: true
-
- resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==}
- dev: false
-
- resolution: {integrity: sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==}
- engines: {node: '>=8.6.0'}
- dependencies:
- '@nodelib/fs.stat': 2.0.5
- '@nodelib/fs.walk': 1.2.8
- glob-parent: 5.1.2
- merge2: 1.4.1
- micromatch: 4.0.5
- dev: true
-
- resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==}
-
- resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==}
- dev: true
-
- resolution: {integrity: sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==}
- dependencies:
- reusify: 1.0.4
- dev: true
-
- resolution: {integrity: sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==}
- dependencies:
- bser: 2.1.1
-
- resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==}
- engines: {node: ^10.12.0 || >=12.0.0}
- dependencies:
- flat-cache: 3.0.4
- dev: true
-
- resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==}
- engines: {node: '>=8'}
- dependencies:
- to-regex-range: 5.0.1
-
- resolution: {integrity: sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==}
- dev: false
-
- resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==}
- engines: {node: '>=8'}
- dependencies:
- locate-path: 5.0.0
- path-exists: 4.0.0
-
- resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==}
- engines: {node: '>=10'}
- dependencies:
- locate-path: 6.0.0
- path-exists: 4.0.0
- dev: true
-
- resolution: {integrity: sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==}
- engines: {node: ^10.12.0 || >=12.0.0}
- dependencies:
- flatted: 3.2.7
- rimraf: 3.0.2
- dev: true
-
- resolution: {integrity: sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==}
- dev: true
-
- resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==}
- dependencies:
- is-callable: 1.2.7
- dev: true
-
- resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==}
- engines: {node: '>= 6'}
- dependencies:
- asynckit: 0.4.0
- combined-stream: 1.0.8
- mime-types: 2.1.35
- dev: true
-
- resolution: {integrity: sha512-MhLuK+2gUcnZe8ZHlaaINnQLl0xRIGRfcGk2yl8xoQAfHrSsL3rYu6FCmBdkdbhc9EPlwyGHewaRsvwRMJtAlA==}
- dev: true
-
- resolution: {integrity: sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==}
- engines: {node: '>=12'}
- dependencies:
- graceful-fs: 4.2.11
- jsonfile: 6.1.0
- universalify: 2.0.0
- dev: true
-
- resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==}
-
- resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==}
- engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0}
- os: [darwin]
- requiresBuild: true
- optional: true
-
- resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==}
-
- resolution: {integrity: sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==}
- engines: {node: '>= 0.4'}
- dependencies:
- call-bind: 1.0.2
- define-properties: 1.2.0
- es-abstract: 1.21.2
- functions-have-names: 1.2.3
- dev: true
-
- resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==}
-
- resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==}
- engines: {node: '>=6.9.0'}
-
- resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==}
- engines: {node: 6.* || 8.* || >= 10.*}
-
- resolution: {integrity: sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==}
- dependencies:
- function-bind: 1.1.1
- has: 1.0.3
- has-proto: 1.0.1
- has-symbols: 1.0.3
-
- resolution: {integrity: sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==}
- engines: {node: '>=8.0.0'}
-
- resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==}
- engines: {node: '>=10'}
-
- resolution: {integrity: sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==}
- engines: {node: '>= 0.4'}
- dependencies:
- call-bind: 1.0.2
- get-intrinsic: 1.2.1
- dev: true
-
- resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==}
- engines: {node: '>= 6'}
- dependencies:
- is-glob: 4.0.3
-
- resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==}
- engines: {node: '>=10.13.0'}
- dependencies:
- is-glob: 4.0.3
- dev: true
-
- resolution: {integrity: sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==}
- dependencies:
- fs.realpath: 1.0.0
- inflight: 1.0.6
- inherits: 2.0.4
- minimatch: 3.1.2
- once: 1.4.0
- path-is-absolute: 1.0.1
- dev: true
-
- resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==}
- dependencies:
- fs.realpath: 1.0.0
- inflight: 1.0.6
- inherits: 2.0.4
- minimatch: 3.1.2
- once: 1.4.0
- path-is-absolute: 1.0.1
-
- resolution: {integrity: sha512-5e01v8eLGfuQSOvx2MsDMOWS0GFtCx1wPzQSmcHw4hkxFzrQDBO3Xwg/m8Hr/7qXMrHeOIE29qWVzyv06u1TZA==}
- dev: false
-
- resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==}
- engines: {node: '>=4'}
-
- resolution: {integrity: sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==}
- engines: {node: '>=8'}
- dependencies:
- type-fest: 0.20.2
- dev: true
-
- resolution: {integrity: sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==}
- engines: {node: '>= 0.4'}
- dependencies:
- define-properties: 1.2.0
- dev: true
-
- resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==}
- engines: {node: '>=10'}
- dependencies:
- array-union: 2.1.0
- dir-glob: 3.0.1
- fast-glob: 3.2.12
- ignore: 5.2.4
- merge2: 1.4.1
- slash: 3.0.0
- dev: true
-
- resolution: {integrity: sha512-jFj3BQeleOoy7t93E9rZ2de+ScC4lQICLwiAQmKMg9F6roKGaLSHoCDYKkWlSafg138jejvq/mTdvmnwDQgqoQ==}
- peerDependencies:
- csstype: ^3.0.10
- dependencies:
- csstype: 3.1.2
- dev: false
-
- resolution: {integrity: sha512-3MSOYFO5U9mPGikIYCzK0SaThypfGgS6bHqrUGXG3DPHCrb+txNqeEcns1W0lkGfk0rCyNXm7xB9rMxnCiZOoA==}
- dev: false
-
- resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==}
- dependencies:
- get-intrinsic: 1.2.1
- dev: true
-
- resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==}
-
- resolution: {integrity: sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==}
- dev: true
-
- resolution: {integrity: sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==}
- dev: true
-
- resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==}
- engines: {node: '>=4'}
-
- resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==}
- engines: {node: '>=8'}
-
- resolution: {integrity: sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==}
- dependencies:
- get-intrinsic: 1.2.1
-
- resolution: {integrity: sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==}
- engines: {node: '>= 0.4'}
-
- resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==}
- engines: {node: '>= 0.4'}
-
- resolution: {integrity: sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==}
- engines: {node: '>= 0.4'}
- dependencies:
- has-symbols: 1.0.3
-
- resolution: {integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==}
- engines: {node: '>= 0.4.0'}
- dependencies:
- function-bind: 1.1.1
-
- resolution: {integrity: sha512-H/vuk5TEEVZwrR0lp2zed9OCo1uAILMlx0JEMgC26rzyJJ3N1v6XkwHHXJQdR2doSjcGPM6OKPYoJgf0plJ11Q==}
- dependencies:
- capital-case: 1.0.4
- tslib: 2.5.0
- dev: true
-
- resolution: {integrity: sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==}
- dependencies:
- react-is: 16.13.1
- dev: false
-
- resolution: {integrity: sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==}
- engines: {node: '>=12'}
- dependencies:
- whatwg-encoding: 2.0.0
- dev: true
-
- resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==}
-
- resolution: {integrity: sha512-KknJ50kTInJ7qIScF3jeaFRpMpE8/lfiTdzf/twXyPBLAGrLRTmkz3AdTnKeh40X8k9L2fdYwEp/42WGXIRGcg==}
- dependencies:
- void-elements: 3.1.0
- dev: false
-
- resolution: {integrity: sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==}
- engines: {node: '>= 6'}
- dependencies:
- '@tootallnate/once': 2.0.0
- agent-base: 6.0.2
- debug: 4.3.4
- transitivePeerDependencies:
- - supports-color
- dev: true
-
- resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==}
- engines: {node: '>= 6'}
- dependencies:
- agent-base: 6.0.2
- debug: 4.3.4
- transitivePeerDependencies:
- - supports-color
- dev: true
-
- resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==}
- engines: {node: '>=10.17.0'}
-
- resolution: {integrity: sha512-Pa5kFwaczXJAeHE56CHG2aWzFBMJNUNghf0Pm4SwSrEMps/PTKqW90EYWlIvhuYStf3Sn1K0vw+gH3+TLdkH1g==}
- dependencies:
- '@babel/runtime': 7.21.5
- dev: false
-
- resolution: {integrity: sha512-hMyr9AOmIea17AOaVe1srNxK/l3mbk81P7Uf3fdcjlw3ehZy3UNTd0OP3EEi6yu4J02kf9jzhCcjokz6AFlEOg==}
- dependencies:
- '@babel/runtime': 7.21.5
- dev: false
-
- resolution: {integrity: sha512-yYudtbFrrmWKLEhl6jvKUYyYunj4bTBCe2qIUYAxbXoPusY7YmdwPvOE6fx6UIfWvmlbCWDItr7wIs8KEBZ5Zg==}
- dependencies:
- '@babel/runtime': 7.21.5
- dev: false
-
- resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==}
- engines: {node: '>=0.10.0'}
- dependencies:
- safer-buffer: 2.1.2
- dev: true
-
- resolution: {integrity: sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==}
- engines: {node: '>= 4'}
- dev: true
-
- resolution: {integrity: sha512-pwupu3eWfouuaowscykeckFmVTpqbzW+rXFCX8rQLkZzM9ftBmU/++Ra+o+L27mz03zJTlyV4UUr+fdKNffo4A==}
- dev: false
-
- resolution: {integrity: sha512-fsXeu4J4i6WNWSikpI88v/PcVflZz+6kMhUfIwc5SY+poQRPnaf5V7qds6SUyUN3cVxEzuCab7QIoLOQ+DQ1wA==}
-
- resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==}
- engines: {node: '>=6'}
- dependencies:
- parent-module: 1.0.1
- resolve-from: 4.0.0
-
- resolution: {integrity: sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==}
- engines: {node: '>=8'}
- hasBin: true
- dependencies:
- pkg-dir: 4.2.0
- resolve-cwd: 3.0.0
-
- resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==}
- engines: {node: '>=0.8.19'}
-
- resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==}
- dependencies:
- once: 1.4.0
- wrappy: 1.0.2
-
- resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==}
-
- resolution: {integrity: sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==}
- engines: {node: '>= 0.4'}
- dependencies:
- get-intrinsic: 1.2.1
- has: 1.0.3
- side-channel: 1.0.4
- dev: true
-
- resolution: {integrity: sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==}
- dependencies:
- loose-envify: 1.4.0
- dev: false
-
- resolution: {integrity: sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==}
- engines: {node: '>= 0.4'}
- dependencies:
- call-bind: 1.0.2
- has-tostringtag: 1.0.0
- dev: false
-
- resolution: {integrity: sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==}
- dependencies:
- call-bind: 1.0.2
- get-intrinsic: 1.2.1
- is-typed-array: 1.1.10
- dev: true
-
- resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==}
-
- resolution: {integrity: sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==}
- dependencies:
- has-bigints: 1.0.2
- dev: true
-
- resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==}
- engines: {node: '>=8'}
- dependencies:
- binary-extensions: 2.2.0
-
- resolution: {integrity: sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==}
- engines: {node: '>= 0.4'}
- dependencies:
- call-bind: 1.0.2
- has-tostringtag: 1.0.0
- dev: true
-
- resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==}
- engines: {node: '>= 0.4'}
- dev: true
-
- resolution: {integrity: sha512-RECHCBCd/viahWmwj6enj19sKbHfJrddi/6cBDsNTKbNq0f7VeaUkBo60BqzvPqo/W54ChS62Z5qyun7cfOMqQ==}
- dependencies:
- has: 1.0.3
-
- resolution: {integrity: sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==}
- engines: {node: '>= 0.4'}
- dependencies:
- has-tostringtag: 1.0.0
-
- resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==}
- engines: {node: '>=0.10.0'}
-
- resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==}
- engines: {node: '>=8'}
-
- resolution: {integrity: sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==}
- engines: {node: '>=6'}
-
- resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==}
- engines: {node: '>=0.10.0'}
- dependencies:
- is-extglob: 2.1.1
-
- resolution: {integrity: sha512-UknnZK4RakDmTgz4PI1wIph5yxSs/mvChWs9ifnlXsKuXgWmOkY/hAE0H/k2MIqH0RlRye0i1oC07MCRSD28Mw==}
- dev: false
-
- resolution: {integrity: sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==}
- engines: {node: '>= 0.4'}
- dev: true
-
- resolution: {integrity: sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==}
- engines: {node: '>= 0.4'}
- dependencies:
- has-tostringtag: 1.0.0
- dev: true
-
- resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==}
- engines: {node: '>=0.12.0'}
-
- resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==}
- engines: {node: '>=8'}
- dev: true
-
- resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==}
- engines: {node: '>=0.10.0'}
- dev: false
-
- resolution: {integrity: sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==}
- dev: true
-
- resolution: {integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==}
- engines: {node: '>= 0.4'}
- dependencies:
- call-bind: 1.0.2
- has-tostringtag: 1.0.0
-
- resolution: {integrity: sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==}
- dependencies:
- call-bind: 1.0.2
- dev: true
-
- resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==}
- engines: {node: '>=8'}
-
- resolution: {integrity: sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==}
- engines: {node: '>= 0.4'}
- dependencies:
- has-tostringtag: 1.0.0
- dev: true
-
- resolution: {integrity: sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==}
- engines: {node: '>= 0.4'}
- dependencies:
- has-symbols: 1.0.3
- dev: true
-
- resolution: {integrity: sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A==}
- engines: {node: '>= 0.4'}
- dependencies:
- available-typed-arrays: 1.0.5
- call-bind: 1.0.2
- for-each: 0.3.3
- gopd: 1.0.1
- has-tostringtag: 1.0.0
- dev: true
-
- resolution: {integrity: sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==}
- dependencies:
- call-bind: 1.0.2
- dev: true
-
- resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==}
-
- resolution: {integrity: sha512-PIeMbHqMt4DnUP3MA/Flc0HElYjMXArsw1qwJZcm9sqR8mq3l8NYizFMty0pWwE/tzIGH3EKK5+jes5mAr85yw==}
- dev: false
-
- resolution: {integrity: sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==}
- engines: {node: '>=8'}
-
- resolution: {integrity: sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==}
- engines: {node: '>=8'}
- dependencies:
- '@babel/core': 7.21.8
- '@babel/parser': 7.21.8
- '@istanbuljs/schema': 0.1.3
- istanbul-lib-coverage: 3.2.0
- semver: 6.3.0
- transitivePeerDependencies:
- - supports-color
-
- resolution: {integrity: sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==}
- engines: {node: '>=8'}
- dependencies:
- istanbul-lib-coverage: 3.2.0
- make-dir: 3.1.0
- supports-color: 7.2.0
-
- resolution: {integrity: sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==}
- engines: {node: '>=10'}
- dependencies:
- debug: 4.3.4
- istanbul-lib-coverage: 3.2.0
- source-map: 0.6.1
- transitivePeerDependencies:
- - supports-color
-
- resolution: {integrity: sha512-nUsEMa9pBt/NOHqbcbeJEgqIlY/K7rVWUX6Lql2orY5e9roQOthbR3vtY4zzf2orPELg80fnxxk9zUyPlgwD1w==}
- engines: {node: '>=8'}
- dependencies:
- html-escaper: 2.0.2
- istanbul-lib-report: 3.0.0
-
- resolution: {integrity: sha512-IFG34IUMUaNBIxjQXF/iu7g6EcdMrGRRxaUSw92I/2g2YC6vCdTltl4nHvt7Ci5nSJwXIkCu8Ka1DKF+X7Z1Ag==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- dependencies:
- execa: 5.1.1
- p-limit: 3.1.0
-
- resolution: {integrity: sha512-gq/ongqeQKAplVxqJmbeUOJJKkW3dDNPY8PjhJ5G0lBRvu0e3EWGxGy5cI4LAGA7gV2UHCtWBI4EMXK8c9nQKA==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- dependencies:
- '@jest/environment': 29.6.4
- '@jest/expect': 29.5.0
- '@jest/test-result': 29.5.0
- '@jest/types': 29.6.3
- '@types/node': 18.16.9
- chalk: 4.1.2
- co: 4.6.0
- dedent: 0.7.0
- is-generator-fn: 2.1.0
- jest-each: 29.5.0
- jest-matcher-utils: 29.5.0
- jest-message-util: 29.6.3
- jest-runtime: 29.5.0
- jest-snapshot: 29.5.0
- jest-util: 29.6.3
- p-limit: 3.1.0
- pretty-format: 29.5.0
- pure-rand: 6.0.2
- slash: 3.0.0
- stack-utils: 2.0.6
- transitivePeerDependencies:
- - supports-color
-
- resolution: {integrity: sha512-L1KcP1l4HtfwdxXNFCL5bmUbLQiKrakMUriBEcc1Vfz6gx31ORKdreuWvmQVBit+1ss9NNR3yxjwfwzZNdQXJw==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- hasBin: true
- peerDependencies:
- node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0
- peerDependenciesMeta:
- node-notifier:
- optional: true
- dependencies:
- '@jest/core': 29.5.0
- '@jest/test-result': 29.5.0
- '@jest/types': 29.5.0
- chalk: 4.1.2
- exit: 0.1.2
- graceful-fs: 4.2.11
- import-local: 3.1.0
- jest-config: 29.5.0(@types/[email protected])
- jest-util: 29.5.0
- jest-validate: 29.5.0
- prompts: 2.4.2
- yargs: 17.7.2
- transitivePeerDependencies:
- - '@types/node'
- - supports-color
- - ts-node
-
- resolution: {integrity: sha512-kvDUKBnNJPNBmFFOhDbm59iu1Fii1Q6SxyhXfvylq3UTHbg6o7j/g8k2dZyXWLvfdKB1vAPxNZnMgtKJcmu3kA==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- peerDependencies:
- '@types/node': '*'
- ts-node: '>=9.0.0'
- peerDependenciesMeta:
- '@types/node':
- optional: true
- ts-node:
- optional: true
- dependencies:
- '@babel/core': 7.21.8
- '@jest/test-sequencer': 29.5.0
- '@jest/types': 29.5.0
- '@types/node': 18.16.9
- babel-jest: 29.6.2(@babel/[email protected])
- chalk: 4.1.2
- ci-info: 3.8.0
- deepmerge: 4.3.1
- glob: 7.2.3
- graceful-fs: 4.2.11
- jest-circus: 29.5.0
- jest-environment-node: 29.5.0
- jest-get-type: 29.4.3
- jest-regex-util: 29.4.3
- jest-resolve: 29.5.0
- jest-runner: 29.5.0
- jest-util: 29.5.0
- jest-validate: 29.5.0
- micromatch: 4.0.5
- parse-json: 5.2.0
- pretty-format: 29.5.0
- slash: 3.0.0
- strip-json-comments: 3.1.1
- transitivePeerDependencies:
- - supports-color
-
- resolution: {integrity: sha512-LtxijLLZBduXnHSniy0WMdaHjmQnt3g5sa16W4p0HqukYTTsyTW3GD1q41TyGl5YFXj/5B2U6dlh5FM1LIMgxw==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- dependencies:
- chalk: 4.1.2
- diff-sequences: 29.4.3
- jest-get-type: 29.4.3
- pretty-format: 29.5.0
-
- resolution: {integrity: sha512-fzdTftThczeSD9nZ3fzA/4KkHtnmllawWrXO69vtI+L9WjEIuXWs4AmyME7lN5hU7dB0sHhuPfcKofRsUb/2Fg==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- dependencies:
- detect-newline: 3.1.0
-
- resolution: {integrity: sha512-HM5kIJ1BTnVt+DQZ2ALp3rzXEl+g726csObrW/jpEGl+CDSSQpOJJX2KE/vEg8cxcMXdyEPu6U4QX5eruQv5hA==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- dependencies:
- '@jest/types': 29.6.3
- chalk: 4.1.2
- jest-get-type: 29.4.3
- jest-util: 29.6.3
- pretty-format: 29.5.0
-
- resolution: {integrity: sha512-7oa/+266AAEgkzae8i1awNEfTfjwawWKLpiw2XesZmaoVVj9u9t8JOYx18cG29rbPNtkUlZ8V4b5Jb36y/VxoQ==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- peerDependencies:
- canvas: ^2.5.0
- peerDependenciesMeta:
- canvas:
- optional: true
- dependencies:
- '@jest/environment': 29.6.4
- '@jest/fake-timers': 29.6.4
- '@jest/types': 29.6.3
- '@types/jsdom': 20.0.1
- '@types/node': 18.16.9
- jest-mock: 29.6.3
- jest-util: 29.6.3
- jsdom: 20.0.3
- transitivePeerDependencies:
- - bufferutil
- - supports-color
- - utf-8-validate
- dev: true
-
- resolution: {integrity: sha512-ExxuIK/+yQ+6PRGaHkKewYtg6hto2uGCgvKdb2nfJfKXgZ17DfXjvbZ+jA1Qt9A8EQSfPnt5FKIfnOO3u1h9qw==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- dependencies:
- '@jest/environment': 29.6.4
- '@jest/fake-timers': 29.6.4
- '@jest/types': 29.6.3
- '@types/node': 18.16.9
- jest-mock: 29.6.3
- jest-util: 29.6.3
-
- resolution: {integrity: sha512-J5Xez4nRRMjk8emnTpWrlkyb9pfRQQanDrvWHhsR1+VUfbwxi30eVcZFlcdGInRibU4G5LwHXpI7IRHU0CY+gg==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
-
- resolution: {integrity: sha512-IspOPnnBro8YfVYSw6yDRKh/TiCdRngjxeacCps1cQ9cgVN6+10JUcuJ1EabrgYLOATsIAigxA0rLR9x/YlrSA==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- dependencies:
- '@jest/types': 29.5.0
- '@types/graceful-fs': 4.1.6
- '@types/node': 18.16.9
- anymatch: 3.1.3
- fb-watchman: 2.0.2
- graceful-fs: 4.2.11
- jest-regex-util: 29.4.3
- jest-util: 29.5.0
- jest-worker: 29.5.0
- micromatch: 4.0.5
- walker: 1.0.8
- optionalDependencies:
- fsevents: 2.3.2
-
- resolution: {integrity: sha512-12Ad+VNTDHxKf7k+M65sviyynRoZYuL1/GTuhEVb8RYsNSNln71nANRb/faSyWvx0j+gHcivChXHIoMJrGYjog==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- dependencies:
- '@jest/types': 29.6.3
- '@types/graceful-fs': 4.1.6
- '@types/node': 18.16.9
- anymatch: 3.1.3
- fb-watchman: 2.0.2
- graceful-fs: 4.2.11
- jest-regex-util: 29.6.3
- jest-util: 29.6.3
- jest-worker: 29.6.4
- micromatch: 4.0.5
- walker: 1.0.8
- optionalDependencies:
- fsevents: 2.3.2
-
- resolution: {integrity: sha512-u9YdeeVnghBUtpN5mVxjID7KbkKE1QU4f6uUwuxiY0vYRi9BUCLKlPEZfDGR67ofdFmDz9oPAy2G92Ujrntmow==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- dependencies:
- jest-get-type: 29.4.3
- pretty-format: 29.5.0
-
- resolution: {integrity: sha512-lecRtgm/rjIK0CQ7LPQwzCs2VwW6WAahA55YBuI+xqmhm7LAaxokSB8C97yJeYyT+HvQkH741StzpU41wohhWw==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- dependencies:
- chalk: 4.1.2
- jest-diff: 29.5.0
- jest-get-type: 29.4.3
- pretty-format: 29.5.0
-
- resolution: {integrity: sha512-Kijeg9Dag6CKtIDA7O21zNTACqD5MD/8HfIV8pdD94vFyFuer52SigdC3IQMhab3vACxXMiFk+yMHNdbqtyTGA==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- dependencies:
- '@babel/code-frame': 7.21.4
- '@jest/types': 29.5.0
- '@types/stack-utils': 2.0.1
- chalk: 4.1.2
- graceful-fs: 4.2.11
- micromatch: 4.0.5
- pretty-format: 29.5.0
- slash: 3.0.0
- stack-utils: 2.0.6
-
- resolution: {integrity: sha512-FtzaEEHzjDpQp51HX4UMkPZjy46ati4T5pEMyM6Ik48ztu4T9LQplZ6OsimHx7EuM9dfEh5HJa6D3trEftu3dA==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- dependencies:
- '@babel/code-frame': 7.21.4
- '@jest/types': 29.6.3
- '@types/stack-utils': 2.0.1
- chalk: 4.1.2
- graceful-fs: 4.2.11
- micromatch: 4.0.5
- pretty-format: 29.6.3
- slash: 3.0.0
- stack-utils: 2.0.6
-
- resolution: {integrity: sha512-GqOzvdWDE4fAV2bWQLQCkujxYWL7RxjCnj71b5VhDAGOevB3qj3Ovg26A5NI84ZpODxyzaozXLOh2NCgkbvyaw==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- dependencies:
- '@jest/types': 29.5.0
- '@types/node': 18.16.9
- jest-util: 29.5.0
-
- resolution: {integrity: sha512-Z7Gs/mOyTSR4yPsaZ72a/MtuK6RnC3JYqWONe48oLaoEcYwEDxqvbXz85G4SJrm2Z5Ar9zp6MiHF4AlFlRM4Pg==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- dependencies:
- '@jest/types': 29.6.3
- '@types/node': 18.16.9
- jest-util: 29.6.3
-
- resolution: {integrity: sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==}
- engines: {node: '>=6'}
- peerDependencies:
- jest-resolve: '*'
- peerDependenciesMeta:
- jest-resolve:
- optional: true
- dependencies:
- jest-resolve: 29.5.0
-
- resolution: {integrity: sha512-O4FglZaMmWXbGHSQInfXewIsd1LMn9p3ZXB/6r4FOkyhX2/iP/soMG98jGvk/A3HAN78+5VWcBGO0BJAPRh4kg==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
-
- resolution: {integrity: sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
-
- resolution: {integrity: sha512-sjV3GFr0hDJMBpYeUuGduP+YeCRbd7S/ck6IvL3kQ9cpySYKqcqhdLLC2rFwrcL7tz5vYibomBrsFYWkIGGjOg==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- dependencies:
- jest-regex-util: 29.4.3
- jest-snapshot: 29.5.0
- transitivePeerDependencies:
- - supports-color
-
- resolution: {integrity: sha512-1TzxJ37FQq7J10jPtQjcc+MkCkE3GBpBecsSUWJ0qZNJpmg6m0D9/7II03yJulm3H/fvVjgqLh/k2eYg+ui52w==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- dependencies:
- chalk: 4.1.2
- graceful-fs: 4.2.11
- jest-haste-map: 29.5.0
- jest-pnp-resolver: 1.2.3([email protected])
- jest-util: 29.5.0
- jest-validate: 29.5.0
- resolve: 1.22.2
- resolve.exports: 2.0.2
- slash: 3.0.0
-
- resolution: {integrity: sha512-m7b6ypERhFghJsslMLhydaXBiLf7+jXy8FwGRHO3BGV1mcQpPbwiqiKUR2zU2NJuNeMenJmlFZCsIqzJCTeGLQ==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- dependencies:
- '@jest/console': 29.5.0
- '@jest/environment': 29.5.0
- '@jest/test-result': 29.5.0
- '@jest/transform': 29.5.0
- '@jest/types': 29.5.0
- '@types/node': 18.16.9
- chalk: 4.1.2
- emittery: 0.13.1
- graceful-fs: 4.2.11
- jest-docblock: 29.4.3
- jest-environment-node: 29.5.0
- jest-haste-map: 29.5.0
- jest-leak-detector: 29.5.0
- jest-message-util: 29.5.0
- jest-resolve: 29.5.0
- jest-runtime: 29.5.0
- jest-util: 29.5.0
- jest-watcher: 29.5.0
- jest-worker: 29.5.0
- p-limit: 3.1.0
- source-map-support: 0.5.13
- transitivePeerDependencies:
- - supports-color
-
- resolution: {integrity: sha512-1Hr6Hh7bAgXQP+pln3homOiEZtCDZFqwmle7Ew2j8OlbkIu6uE3Y/etJQG8MLQs3Zy90xrp2C0BRrtPHG4zryw==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- dependencies:
- '@jest/environment': 29.5.0
- '@jest/fake-timers': 29.5.0
- '@jest/globals': 29.5.0
- '@jest/source-map': 29.4.3
- '@jest/test-result': 29.5.0
- '@jest/transform': 29.5.0
- '@jest/types': 29.5.0
- '@types/node': 18.16.9
- chalk: 4.1.2
- cjs-module-lexer: 1.2.2
- collect-v8-coverage: 1.0.1
- glob: 7.2.3
- graceful-fs: 4.2.11
- jest-haste-map: 29.5.0
- jest-message-util: 29.5.0
- jest-mock: 29.5.0
- jest-regex-util: 29.4.3
- jest-resolve: 29.5.0
- jest-snapshot: 29.5.0
- jest-util: 29.5.0
- slash: 3.0.0
- strip-bom: 4.0.0
- transitivePeerDependencies:
- - supports-color
-
- resolution: {integrity: sha512-x7Wolra5V0tt3wRs3/ts3S6ciSQVypgGQlJpz2rsdQYoUKxMxPNaoHMGJN6qAuPJqS+2iQ1ZUn5kl7HCyls84g==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- dependencies:
- '@babel/core': 7.21.8
- '@babel/generator': 7.21.5
- '@babel/plugin-syntax-jsx': 7.21.4(@babel/[email protected])
- '@babel/plugin-syntax-typescript': 7.21.4(@babel/[email protected])
- '@babel/traverse': 7.23.7
- '@babel/types': 7.21.5
- '@jest/expect-utils': 29.5.0
- '@jest/transform': 29.5.0
- '@jest/types': 29.5.0
- '@types/babel__traverse': 7.18.5
- '@types/prettier': 2.7.2
- babel-preset-current-node-syntax: 1.0.1(@babel/[email protected])
- chalk: 4.1.2
- expect: 29.5.0
- graceful-fs: 4.2.11
- jest-diff: 29.5.0
- jest-get-type: 29.4.3
- jest-matcher-utils: 29.5.0
- jest-message-util: 29.5.0
- jest-util: 29.5.0
- natural-compare: 1.4.0
- pretty-format: 29.5.0
- semver: 7.5.1
- transitivePeerDependencies:
- - supports-color
-
- resolution: {integrity: sha512-RYMgG/MTadOr5t8KdhejfvUU82MxsCu5MF6KuDUHl+NuwzUt+Sm6jJWxTJVrDR1j5M/gJVCPKQEpWXY+yIQ6lQ==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- dependencies:
- '@jest/types': 29.5.0
- '@types/node': 18.16.9
- chalk: 4.1.2
- ci-info: 3.8.0
- graceful-fs: 4.2.11
- picomatch: 2.3.1
-
- resolution: {integrity: sha512-QUjna/xSy4B32fzcKTSz1w7YYzgiHrjjJjevdRf61HYk998R5vVMMNmrHESYZVDS5DSWs+1srPLPKxXPkeSDOA==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- dependencies:
- '@jest/types': 29.6.3
- '@types/node': 18.16.9
- chalk: 4.1.2
- ci-info: 3.8.0
- graceful-fs: 4.2.11
- picomatch: 2.3.1
-
- resolution: {integrity: sha512-pC26etNIi+y3HV8A+tUGr/lph9B18GnzSRAkPaaZJIE1eFdiYm6/CewuiJQ8/RlfHd1u/8Ioi8/sJ+CmbA+zAQ==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- dependencies:
- '@jest/types': 29.5.0
- camelcase: 6.3.0
- chalk: 4.1.2
- jest-get-type: 29.4.3
- leven: 3.1.0
- pretty-format: 29.5.0
-
- resolution: {integrity: sha512-KmTojKcapuqYrKDpRwfqcQ3zjMlwu27SYext9pt4GlF5FUgB+7XE1mcCnSm6a4uUpFyQIkb6ZhzZvHl+jiBCiA==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- dependencies:
- '@jest/test-result': 29.5.0
- '@jest/types': 29.5.0
- '@types/node': 18.16.9
- ansi-escapes: 4.3.2
- chalk: 4.1.2
- emittery: 0.13.1
- jest-util: 29.5.0
- string-length: 4.0.2
-
- resolution: {integrity: sha512-NcrQnevGoSp4b5kg+akIpthoAFHxPBcb5P6mYPY0fUNT+sSvmtu6jlkEle3anczUKIKEbMxFimk9oTP/tpIPgA==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- dependencies:
- '@types/node': 18.16.9
- jest-util: 29.5.0
- merge-stream: 2.0.0
- supports-color: 8.1.1
-
- resolution: {integrity: sha512-6dpvFV4WjcWbDVGgHTWo/aupl8/LbBx2NSKfiwqf79xC/yeJjKHT1+StcKy/2KTmW16hE68ccKVOtXf+WZGz7Q==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- dependencies:
- '@types/node': 18.16.9
- jest-util: 29.6.3
- merge-stream: 2.0.0
- supports-color: 8.1.1
-
- resolution: {integrity: sha512-juMg3he2uru1QoXX078zTa7pO85QyB9xajZc6bU+d9yEGwrKX6+vGmJQ3UdVZsvTEUARIdObzH68QItim6OSSQ==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- hasBin: true
- peerDependencies:
- node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0
- peerDependenciesMeta:
- node-notifier:
- optional: true
- dependencies:
- '@jest/core': 29.5.0
- '@jest/types': 29.5.0
- import-local: 3.1.0
- jest-cli: 29.5.0(@types/[email protected])
- transitivePeerDependencies:
- - '@types/node'
- - supports-color
- - ts-node
-
- resolution: {integrity: sha512-QAdOptna2NYiSSpv0O/BwoHBSmz4YhpzJHyi+fnMRTXFjp7B8i/YG5Z8IfusxB1ufjcD2Sre1F3R+nX3fvy7gg==}
- hasBin: true
- dev: true
-
- resolution: {integrity: sha512-3MEt5DTINKqfScXKfJFrRbxkrnk2AxPWGBL/ycjz4dK8iqiSJ06UxD8jh8xuh6p10TX4t2+7FsBYVxxQbMg+qA==}
- dev: false
-
- resolution: {integrity: sha512-FfVSdx6pJ41Oa+CF7RDaFmTnCaFhua+SNYQX74riGOpl96x+2jQCqEfQ2bnXu/5DPCqlRuiqyvTJM0Qjz26IVg==}
- dev: true
-
- resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==}
-
- resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==}
- hasBin: true
- dependencies:
- argparse: 1.0.10
- esprima: 4.0.1
-
- resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==}
- hasBin: true
- dependencies:
- argparse: 2.0.1
- dev: true
-
- resolution: {integrity: sha512-SYhBvTh89tTfCD/CRdSOm13mOBa42iTaTyfyEWBdKcGdPxPtLFBXuHR8XHb33YNYaP+lLbmSvBTsnoesCNJEsQ==}
- engines: {node: '>=14'}
- peerDependencies:
- canvas: ^2.5.0
- peerDependenciesMeta:
- canvas:
- optional: true
- dependencies:
- abab: 2.0.6
- acorn: 8.8.2
- acorn-globals: 7.0.1
- cssom: 0.5.0
- cssstyle: 2.3.0
- data-urls: 3.0.2
- decimal.js: 10.4.3
- domexception: 4.0.0
- escodegen: 2.1.0
- form-data: 4.0.0
- html-encoding-sniffer: 3.0.0
- http-proxy-agent: 5.0.0
- https-proxy-agent: 5.0.1
- is-potential-custom-element-name: 1.0.1
- nwsapi: 2.2.7
- parse5: 7.1.2
- saxes: 6.0.0
- symbol-tree: 3.2.4
- tough-cookie: 4.1.3
- w3c-xmlserializer: 4.0.0
- webidl-conversions: 7.0.0
- whatwg-encoding: 2.0.0
- whatwg-mimetype: 3.0.0
- whatwg-url: 11.0.0
- ws: 8.14.1
- xml-name-validator: 4.0.0
- transitivePeerDependencies:
- - bufferutil
- - supports-color
- - utf-8-validate
- dev: true
-
- resolution: {integrity: sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==}
- engines: {node: '>=4'}
- hasBin: true
-
- resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==}
-
- resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==}
- dev: true
-
- resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==}
- dev: true
-
- resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==}
- engines: {node: '>=6'}
- hasBin: true
-
- resolution: {integrity: sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==}
- dev: true
-
- resolution: {integrity: sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==}
- dependencies:
- universalify: 2.0.0
- optionalDependencies:
- graceful-fs: 4.2.11
- dev: true
-
- resolution: {integrity: sha512-fYQHZTZ8jSfmWZ0iyzfwiU4WDX4HpHbMCZ3gPlWYiCl3BoeOTsqKBqnTVfH2rYT7eP5c3sVbeSPHnnJOaTrWiw==}
- engines: {node: '>=4.0'}
- dependencies:
- array-includes: 3.1.6
- object.assign: 4.1.4
- dev: true
-
- resolution: {integrity: sha512-Xk9C6oGKRwJTfqfIbtr0Kes9OSv6IFsuhFGc7tW4urlpMJtuh+7YhzU6YEG9n8gmWKcMAFzkp7nr+r69kV0zrA==}
- hasBin: true
- dependencies:
- commander: 8.3.0
- dev: false
-
- resolution: {integrity: sha512-Rdgz9Hl9Iv4QKi8b0OlCRQEzp4AgVxyCtz5S/+VIHezDmrDhkp2N2TqBWOLz0/gbeREXOOiI9/4b8BY9uw2vFg==}
- dev: false
-
- resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==}
- engines: {node: '>=6'}
-
- resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==}
- engines: {node: '>=6'}
-
- resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==}
- engines: {node: '>= 0.8.0'}
- dependencies:
- prelude-ls: 1.2.1
- type-check: 0.4.0
- dev: true
-
- resolution: {integrity: sha512-roj9i46/JwG5ik5KNTkxP2IytlnrssAkD/OhlAVtE+GqectrdkfR+pttszVLrOzMDeXNs1MPt6yo66MUolWSiA==}
- engines: {node: '>=14'}
- hasBin: true
- dependencies:
- isomorphic.js: 0.2.5
- dev: false
-
- resolution: {integrity: sha512-KyroiEvCeZcZEMx5Ys+b4u4eEBbA1ch7XUaBhYpwa/nPMrzTjUhI4RfcytmQfYoTBPcdyx+FX6WFNIoNuJzJfQ==}
- engines: {node: '>=16'}
- hasBin: true
- dependencies:
- isomorphic.js: 0.2.5
- dev: false
-
- resolution: {integrity: sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==}
- engines: {node: '>=10'}
- dev: true
-
- resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==}
-
- resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==}
- engines: {node: '>=8'}
- dependencies:
- p-locate: 4.1.0
-
- resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==}
- engines: {node: '>=10'}
- dependencies:
- p-locate: 5.0.0
- dev: true
-
- resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==}
- dev: false
-
- resolution: {integrity: sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==}
-
- resolution: {integrity: sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==}
-
- resolution: {integrity: sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==}
- dev: true
-
- resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==}
- dev: true
-
- resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==}
-
- resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==}
- hasBin: true
- dependencies:
- js-tokens: 4.0.0
-
- resolution: {integrity: sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==}
- dependencies:
- tslib: 2.5.0
- dev: true
-
- resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==}
- dependencies:
- yallist: 3.1.1
-
- resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==}
- engines: {node: '>=10'}
- dependencies:
- yallist: 4.0.0
-
- resolution: {integrity: sha512-zobTr7akeGHnv7eBOXcRgMeCP6+uyYsczwmeRCauvpvaAltgNyTbLH/+VaEAPUeWBT+1GuNmz4wC/6jtQzbbVA==}
- engines: {node: '>=12'}
- dev: false
-
- resolution: {integrity: sha512-8UnnX2PeRAPZuN12svgR9j7M1uWMovg/CEnIwIG0LFkXSJJe4PdfUGiTGl8V9bsBHFUtfVINcSyYxd7q+kx9fA==}
- engines: {node: '>=12'}
- dependencies:
- '@jridgewell/sourcemap-codec': 1.4.15
- dev: true
-
- resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==}
- engines: {node: '>=8'}
- dependencies:
- semver: 6.3.0
-
- resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==}
- dev: true
-
- resolution: {integrity: sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==}
- dependencies:
- tmpl: 1.0.5
-
- resolution: {integrity: sha512-6qE4B9deFBIa9YSpOc9O0Sgc43zTeVYbgDT5veRKSlB2+ZuHNoVVxA1L/ckMUayV9Ay9y7Z/SZCLcGteW9i7bg==}
- dev: false
-
- resolution: {integrity: sha512-aylIc7Z9y4yzHYAJNuESG3hfhC+0Ibp/MAMiaOZgNv4pmEdFyfZhhhny4MNiAfWdBQ1RQ2mfDWmM1x8SvGyp8g==}
- dev: true
-
- resolution: {integrity: sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==}
- dev: true
-
- resolution: {integrity: sha512-zYiwtZUcYyXKo/np96AGZAckk+FWWsUdJ3cHGGmld7+AhvcWmQyGCYUh1hc4Q/pkOhb65dQR/pqCyK0cOaHz4Q==}
- dev: false
-
- resolution: {integrity: sha512-rkpe71W0N0c0Xz6QD0eJETuWAJGnJ9afsl1srmwPrI+yBCkge5EycXXbYRyvL29zZVUWQCY7InPRCv3GDXuZNw==}
- dev: false
-
- resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==}
-
- resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==}
- engines: {node: '>= 8'}
- dev: true
-
- resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==}
- engines: {node: '>=8.6'}
- dependencies:
- braces: 3.0.2
- picomatch: 2.3.1
-
- resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==}
- engines: {node: '>= 0.6'}
- dev: true
-
- resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==}
- engines: {node: '>= 0.6'}
- dependencies:
- mime-db: 1.52.0
- dev: true
-
- resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==}
- engines: {node: '>=6'}
-
- resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==}
- dependencies:
- brace-expansion: 1.1.11
-
- resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==}
- dev: true
-
- resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==}
- engines: {node: '>=10'}
- hasBin: true
- dev: true
-
- resolution: {integrity: sha512-nv3YpzI/8lkQn0U6RkLd+f0W/zy/JnoR5/EyPz/dNkPTBjA2jNLCVxaiQ8QpeLymhSZvX0wCL5s27NQWdOPwAw==}
- dependencies:
- moment: 2.30.1
- dev: false
-
- resolution: {integrity: sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==}
- dev: false
-
- resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==}
-
- resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==}
- dependencies:
- any-promise: 1.3.0
- object-assign: 4.1.1
- thenify-all: 1.6.0
- dev: true
-
- resolution: {integrity: sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==}
- engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}
- hasBin: true
- dev: true
-
- resolution: {integrity: sha512-7ZtY5KTCNheRGfEFxnedV5zFiORN1+Y1N6zvPTnHQd8ENUvfaDBeuJDZb2bN/oXwXxu3qkTXDzy57W5vAmDTBw==}
- engines: {node: ^14 || ^16 || >=18}
- hasBin: true
- dev: false
-
- resolution: {integrity: sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==}
- dev: true
-
- resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==}
-
- resolution: {integrity: sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==}
- dependencies:
- lower-case: 2.0.2
- tslib: 2.5.0
- dev: true
-
- resolution: {integrity: sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==}
-
- resolution: {integrity: sha512-5GFldHPXVG/YZmFzJvKK2zDSzPKhEp0+ZR5SVaoSag9fsL5YgHbUHDfnG5494ISANDcK4KwPXAx2xqVEydmd7w==}
-
- resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==}
- engines: {node: '>=0.10.0'}
-
- resolution: {integrity: sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA==}
- engines: {node: '>=0.10.0'}
- dev: true
-
- resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==}
- engines: {node: '>=8'}
- dependencies:
- path-key: 3.1.1
-
- resolution: {integrity: sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==}
- dependencies:
- boolbase: 1.0.0
- dev: true
-
- resolution: {integrity: sha512-ub5E4+FBPKwAZx0UwIQOjYWGHTEq5sPqHQNRN8Z9e4A7u3Tj1weLJsL59yH9vmvqEtBHaOmT6cYQKIZOxp35FQ==}
- dev: true
-
- resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==}
- engines: {node: '>=0.10.0'}
-
- resolution: {integrity: sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==}
- engines: {node: '>= 6'}
- dev: true
-
- resolution: {integrity: sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==}
- dev: true
-
- resolution: {integrity: sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==}
- engines: {node: '>= 0.4'}
- dependencies:
- call-bind: 1.0.2
- define-properties: 1.2.0
- dev: false
-
- resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==}
- engines: {node: '>= 0.4'}
-
- resolution: {integrity: sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==}
- engines: {node: '>= 0.4'}
- dependencies:
- call-bind: 1.0.2
- define-properties: 1.2.0
- has-symbols: 1.0.3
- object-keys: 1.1.1
- dev: true
-
- resolution: {integrity: sha512-leTPzo4Zvg3pmbQ3rDK69Rl8GQvIqMWubrkxONG9/ojtFE2rD9fjMKfSI5BxW3osRH1m6VdzmqK8oAY9aT4x5w==}
- engines: {node: '>= 0.4'}
- dependencies:
- call-bind: 1.0.2
- define-properties: 1.2.0
- es-abstract: 1.21.2
- dev: true
-
- resolution: {integrity: sha512-VciD13dswC4j1Xt5394WR4MzmAQmlgN72phd/riNp9vtD7tp4QQWJ0R4wvclXcafgcYK8veHRed2W6XeGBvcfg==}
- engines: {node: '>= 0.4'}
- dependencies:
- call-bind: 1.0.2
- define-properties: 1.2.0
- es-abstract: 1.21.2
- dev: true
-
- resolution: {integrity: sha512-B5UIT3J1W+WuWIU55h0mjlwaqxiE5vYENJXIXZ4VFe05pNYrkKuK0U/6aFcb0pKywYJh7IhfoqUfKVmrJJHZHw==}
- dependencies:
- define-properties: 1.2.0
- es-abstract: 1.21.2
- dev: true
-
- resolution: {integrity: sha512-FVVTkD1vENCsAcwNs9k6jea2uHC/X0+JcjG8YA60FN5CMaJmG95wT9jek/xX9nornqGRrBkKtzuAu2wuHpKqvw==}
- engines: {node: '>= 0.4'}
- dependencies:
- call-bind: 1.0.2
- define-properties: 1.2.0
- es-abstract: 1.21.2
- dev: true
-
- resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==}
- dependencies:
- wrappy: 1.0.2
-
- resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==}
- engines: {node: '>=6'}
- dependencies:
- mimic-fn: 2.1.0
-
- resolution: {integrity: sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==}
- engines: {node: '>= 0.8.0'}
- dependencies:
- deep-is: 0.1.4
- fast-levenshtein: 2.0.6
- levn: 0.4.1
- prelude-ls: 1.2.1
- type-check: 0.4.0
- word-wrap: 1.2.3
- dev: true
-
- resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==}
- engines: {node: '>=6'}
- dependencies:
- p-try: 2.2.0
-
- resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==}
- engines: {node: '>=10'}
- dependencies:
- yocto-queue: 0.1.0
-
- resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==}
- engines: {node: '>=8'}
- dependencies:
- p-limit: 2.3.0
-
- resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==}
- engines: {node: '>=10'}
- dependencies:
- p-limit: 3.1.0
- dev: true
-
- resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==}
- engines: {node: '>=6'}
-
- resolution: {integrity: sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A==}
- dependencies:
- dot-case: 3.0.4
- tslib: 2.5.0
- dev: true
-
- resolution: {integrity: sha512-J5FBQt/pM2inLzg4hEWmzQx/8h8D0CiDxaG3vyp9rKrQRSDgBlhjdP5jQGgosEajXPSQouXGHOmVdgo7QmJuOg==}
-
- resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==}
- engines: {node: '>=6'}
- dependencies:
- callsites: 3.1.0
-
- resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==}
- engines: {node: '>=8'}
- dependencies:
- '@babel/code-frame': 7.21.4
- error-ex: 1.3.2
- json-parse-even-better-errors: 2.3.1
- lines-and-columns: 1.2.4
-
- resolution: {integrity: sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==}
- dependencies:
- entities: 4.5.0
- dev: true
-
- resolution: {integrity: sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g==}
- dependencies:
- no-case: 3.0.4
- tslib: 2.5.0
- dev: true
-
- resolution: {integrity: sha512-qO4qCFjXqVTrcbPt/hQfhTQ+VhFsqNKOPtytgNKkKxSoEp3XPUQ8ObFuePylOIok5gjn69ry8XiULxCwot3Wfg==}
- dependencies:
- dot-case: 3.0.4
- tslib: 2.5.0
- dev: true
-
- resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==}
- engines: {node: '>=8'}
-
- resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==}
- engines: {node: '>=0.10.0'}
-
- resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==}
- engines: {node: '>=8'}
-
- resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==}
-
- resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==}
- engines: {node: '>=8'}
-
- resolution: {integrity: sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==}
- dev: false
-
- resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==}
-
- resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==}
- engines: {node: '>=8.6'}
-
- resolution: {integrity: sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==}
- engines: {node: '>=0.10.0'}
- dev: true
-
- resolution: {integrity: sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ==}
- engines: {node: '>= 6'}
-
- resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==}
- engines: {node: '>=8'}
- dependencies:
- find-up: 4.1.0
-
- resolution: {integrity: sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==}
- engines: {node: '>=14.0.0'}
- peerDependencies:
- postcss: ^8.0.0
- dependencies:
- postcss: 8.4.23
- postcss-value-parser: 4.2.0
- read-cache: 1.0.0
- resolve: 1.22.2
- dev: true
-
- resolution: {integrity: sha512-dDLF8pEO191hJMtlHFPRa8xsizHaM82MLfNkUHdUtVEV3tgTp5oj+8qbEqYM57SLfc74KSbw//4SeJma2LRVIw==}
- engines: {node: ^12 || ^14 || >= 16}
- peerDependencies:
- postcss: ^8.4.21
- dependencies:
- camelcase-css: 2.0.1
- postcss: 8.4.23
- dev: true
-
- resolution: {integrity: sha512-vEJIc8RdiBRu3oRAI0ymerOn+7rPuMvRXslTvZUKZonDHFIczxztIyJ1urxM1x9JXEikvpWWTUUqal5j/8QgvA==}
- engines: {node: '>= 14'}
- peerDependencies:
- postcss: '>=8.0.9'
- ts-node: '>=9.0.0'
- peerDependenciesMeta:
- postcss:
- optional: true
- ts-node:
- optional: true
- dependencies:
- lilconfig: 2.1.0
- postcss: 8.4.23
- yaml: 2.2.2
- dev: true
-
- resolution: {integrity: sha512-mEp4xPMi5bSWiMbsgoPfcP74lsWLHkQbZc3sY+jWYd65CUwXrUaTp0fmNpa01ZcETKlIgUdFN/MpS2xZtqL9dQ==}
- engines: {node: '>=12.0'}
- peerDependencies:
- postcss: ^8.2.14
- dependencies:
- postcss: 8.4.23
- postcss-selector-parser: 6.0.12
- dev: true
-
- resolution: {integrity: sha512-NdxGCAZdRrwVI1sy59+Wzrh+pMMHxapGnpfenDVlMEXoOcvt4pGE0JLK9YY2F5dLxcFYA/YbVQKhcGU+FtSYQg==}
- engines: {node: '>=4'}
- dependencies:
- cssesc: 3.0.0
- util-deprecate: 1.0.2
- dev: true
-
- resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==}
- dev: true
-
- resolution: {integrity: sha512-bQ3qMcpF6A/YjR55xtoTr0jGOlnPOKAIMdOWiv0EIT6HVPEaJiJB4NLljSbiHoC2RX7DN5Uvjtpbg1NPdwv1oA==}
- engines: {node: ^10 || ^12 || >=14}
- dependencies:
- nanoid: 3.3.6
- picocolors: 1.0.0
- source-map-js: 1.0.2
- dev: true
-
- resolution: {integrity: sha512-gdr1MBNVT0drzTq95CbSNdsrBDoHGlb2aDJP/FoY+1e+jSDPOb1Cv554gH2MGiSr2WTcXi/zu+NaFzfcHQkfBQ==}
- dev: false
-
- resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==}
- engines: {node: '>= 0.8.0'}
- dev: true
-
- resolution: {integrity: sha512-KgPcEnJeIijlMjsA6WwYgRs5rh3/q76oInqtMXBA/EMcamrcYJpyhtRhyX1ayT9hnHlHTuO8sIifHF10WuSDKg==}
- engines: {node: '>=12.17.0'}
- peerDependencies:
- '@ianvs/prettier-plugin-sort-imports': '*'
- '@prettier/plugin-pug': '*'
- '@shopify/prettier-plugin-liquid': '*'
- '@shufo/prettier-plugin-blade': '*'
- '@trivago/prettier-plugin-sort-imports': '*'
- prettier: '>=2.2.0'
- prettier-plugin-astro: '*'
- prettier-plugin-css-order: '*'
- prettier-plugin-import-sort: '*'
- prettier-plugin-jsdoc: '*'
- prettier-plugin-organize-attributes: '*'
- prettier-plugin-organize-imports: '*'
- prettier-plugin-style-order: '*'
- prettier-plugin-svelte: '*'
- prettier-plugin-twig-melody: '*'
- peerDependenciesMeta:
- '@ianvs/prettier-plugin-sort-imports':
- optional: true
- '@prettier/plugin-pug':
- optional: true
- '@shopify/prettier-plugin-liquid':
- optional: true
- '@shufo/prettier-plugin-blade':
- optional: true
- '@trivago/prettier-plugin-sort-imports':
- optional: true
- prettier-plugin-astro:
- optional: true
- prettier-plugin-css-order:
- optional: true
- prettier-plugin-import-sort:
- optional: true
- prettier-plugin-jsdoc:
- optional: true
- prettier-plugin-organize-attributes:
- optional: true
- prettier-plugin-organize-imports:
- optional: true
- prettier-plugin-style-order:
- optional: true
- prettier-plugin-svelte:
- optional: true
- prettier-plugin-twig-melody:
- optional: true
- dependencies:
- prettier: 2.8.4
- dev: true
-
- resolution: {integrity: sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw==}
- engines: {node: '>=10.13.0'}
- hasBin: true
- dev: true
-
- resolution: {integrity: sha512-V2mGkI31qdttvTFX7Mt4efOqHXqJWMu4/r66Xh3Z3BwZaPfPJgp6/gbwoujRpPUtfEF6AUUWx3Jim3GCw5g/Qw==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- dependencies:
- '@jest/schemas': 29.4.3
- ansi-styles: 5.2.0
- react-is: 18.2.0
-
- resolution: {integrity: sha512-ZsBgjVhFAj5KeK+nHfF1305/By3lechHQSMWCTl8iHSbfOm2TN5nHEtFc/+W7fAyUeCs2n5iow72gld4gW0xDw==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- dependencies:
- '@jest/schemas': 29.6.3
- ansi-styles: 5.2.0
- react-is: 18.2.0
-
- resolution: {integrity: sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q==}
- engines: {node: '>=6'}
- dev: false
-
- resolution: {integrity: sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==}
- engines: {node: '>= 6'}
- dependencies:
- kleur: 3.0.3
- sisteransi: 1.0.5
-
- resolution: {integrity: sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==}
- dependencies:
- loose-envify: 1.4.0
- object-assign: 4.1.1
- react-is: 16.13.1
-
- resolution: {integrity: sha512-jr4VJey2J9LVYCV7EVyVe53g1VMw28cCmYJhBe5e3YX5wiyiDwgxWxeDf9oTqAe4P1bN/YGAkW2jhlH8LohwiQ==}
- hasBin: true
- dev: false
-
- resolution: {integrity: sha512-oyfc0Tx87Cpwva5ZXezSp5V9vht1c7dZBhvuV/y3ctkgMVUmiAGDVeeB0dKhGSyT0v1ZTEQYpe/RXlBVBNuCLA==}
- dev: false
-
- resolution: {integrity: sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==}
- dev: true
-
- resolution: {integrity: sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==}
- engines: {node: '>=6'}
- dev: true
-
- resolution: {integrity: sha512-6Yg0ekpKICSjPswYOuC5sku/TSWaRYlA0qsXqJgM/d/4pLPHPuTxK7Nbf7jFKzAeedUhR8C7K9Uv63FBsSo8xQ==}
-
- resolution: {integrity: sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==}
- dev: true
-
- resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==}
- dev: true
-
- resolution: {integrity: sha512-wdIGBlcX13tCHOXGMVnnTVFtGRLoP0imqxM696fIPwIf5ODIYUHIvHbZcyvGlZFiFhK5XzDC2lpjbxRhnM05Tg==}
- engines: {node: '>=0.10'}
- dependencies:
- deep-equal: 1.1.1
- extend: 3.0.2
- fast-diff: 1.1.2
- dev: false
-
- resolution: {integrity: sha512-qjbn82b/yJzOjstBgkhtBjN2TNK+ZHP/BgUQO+j6bRhWQQdmj2lH6hXG7+nwwLF41Xgn//7/83lxs9n2BkTtTg==}
- dependencies:
- fast-diff: 1.2.0
- lodash.clonedeep: 4.5.0
- lodash.isequal: 4.5.0
- dev: true
-
- resolution: {integrity: sha512-X74oCeRI4/p0ucjb5Ma8adTXd9Scumz367kkMK5V/IatcX6A0vlgLgKbzXWy5nZmCGeNJm2oQX0d2Eqj+ZIlCA==}
- engines: {node: '>= 12.0.0'}
- dependencies:
- fast-diff: 1.3.0
- lodash.clonedeep: 4.5.0
- lodash.isequal: 4.5.0
- dev: false
-
- resolution: {integrity: sha512-hG/DVzh/TiknWtE6QmWAF/pxoZKYxfe3J/d/+ShUWkDvvkZQVTPeVmUJVu1uE6DDooC4fWTiCLh84ul89oNz5g==}
- dependencies:
- clone: 2.1.2
- deep-equal: 1.1.1
- eventemitter3: 2.0.3
- extend: 3.0.2
- parchment: 1.1.4
- quill-delta: 3.6.3
- dev: false
-
- resolution: {integrity: sha512-tQkJl2GRWh83ui2DiPTJz9wEiMN20syf+5oKfB03yYP7ioZcJwsIK8FjrtLwH1m7C7e+Tt2yYBlrOpdT+dyeIQ==}
- dev: false
-
- resolution: {integrity: sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA==}
- dependencies:
- performance-now: 2.1.0
- dev: false
-
- resolution: {integrity: sha512-0Lvs4tq2VcrEjEgDXHjT98r+63drkKEgqyxdA7qD3mvKwga6a5SscbdLPO2IExotU1jW8L0Ksdl0Cj2AF67nPQ==}
- peerDependencies:
- react: ^16.8.5 || ^17.0.0 || ^18.0.0
- react-dom: ^16.8.5 || ^17.0.0 || ^18.0.0
- dependencies:
- '@babel/runtime': 7.21.5
- css-box-model: 1.2.1
- memoize-one: 5.2.1
- raf-schd: 4.0.3
- react: 18.2.0
- react-dom: 18.2.0([email protected])
- react-redux: 7.2.9([email protected])([email protected])
- redux: 4.2.1
- use-memo-one: 1.1.3([email protected])
- transitivePeerDependencies:
- - react-native
- dev: false
-
- resolution: {integrity: sha512-cra8WPfoTSQthFfqxi0k9xm/Shv5jWSw19LkNzpSJcnQhP6XGes/eJjd8P8g/iwaJjXIWPpg3+HB5wO5wabRyA==}
- peerDependencies:
- react: ^16.14.0 || ^17 || ^18
- react-dom: ^16.14.0 || ^17 || ^18
- dependencies:
- '@babel/runtime': 7.23.4
- clsx: 1.2.1
- date-arithmetic: 4.1.0
- dayjs: 1.11.9
- dom-helpers: 5.2.1
- globalize: 0.1.1
- invariant: 2.2.4
- lodash: 4.17.21
- lodash-es: 4.17.21
- luxon: 3.4.4
- memoize-one: 6.0.0
- moment: 2.30.1
- moment-timezone: 0.5.44
- prop-types: 15.8.1
- react: 18.2.0
- react-dom: 18.2.0([email protected])
- react-overlays: 5.2.1([email protected])([email protected])
- uncontrollable: 7.2.1([email protected])
- dev: false
-
- resolution: {integrity: sha512-LEeGE/ZzNLIsFWa1TMe8y5VYqr7bibneWmvJwm1pCn/eNmrabWDh659JSPn9BuaMpEfU83WTOJfnCcjDZwNQTA==}
- peerDependencies:
- react: '*'
- dependencies:
- '@icons/material': 0.2.4([email protected])
- lodash: 4.17.21
- lodash-es: 4.17.21
- material-colors: 1.2.6
- prop-types: 15.8.1
- react: 18.2.0
- reactcss: 1.2.3([email protected])
- tinycolor2: 1.6.0
- dev: false
-
- resolution: {integrity: sha512-VtJTUvZ7kPh/auZWIbBRceGPkE30XBYe+HktFxuMWBR2eVQQ+Ur6yFJMoaYcNpyGq22uYJ9Wx4UAEcC0K+LNPQ==}
- peerDependencies:
- react: ^0.14.0 || ^15.0.0 || ^16.0.0
- react-dom: ^0.14.0 || ^15.0.0 || ^16.0.0
- dependencies:
- dom-css: 2.1.0
- prop-types: 15.8.1
- raf: 3.4.1
- react: 18.2.0
- react-dom: 18.2.0([email protected])
- dev: false
-
- resolution: {integrity: sha512-w+msqlOZ14v6H1UknTKtZw/dw9naFMgAOspf59eY130gWpvy5dvKj/bgsFICDdvxB7PtKWxDcbGlAqCloY1d2A==}
- peerDependencies:
- react: ^16.9.0 || ^17 || ^18
- react-dom: ^16.9.0 || ^17 || ^18
- dependencies:
- '@popperjs/core': 2.11.8
- classnames: 2.3.2
- date-fns: 2.30.0
- prop-types: 15.8.1
- react: 18.2.0
- react-dom: 18.2.0([email protected])
- react-onclickoutside: 6.13.0([email protected])([email protected])
- react-popper: 2.3.0(@popperjs/[email protected])([email protected])([email protected])
- dev: false
-
- resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==}
- peerDependencies:
- react: ^18.2.0
- dependencies:
- loose-envify: 1.4.0
- react: 18.2.0
- scheduler: 0.23.0
-
- resolution: {integrity: sha512-uM9uPzZJTF6wRQORmSrvOIgt4lJ9MC1sNgEOj2XGsDTRE4kmpWxg7ENK9EWNKJRMAOY9z0MuF4yIfl6gp4sotA==}
- engines: {node: '>=10', npm: '>=6'}
- peerDependencies:
- react: '>=16.13.1'
- dependencies:
- '@babel/runtime': 7.21.5
- react: 18.2.0
- dev: false
-
- resolution: {integrity: sha512-+hCNqfy7o9wvO6UgjqFmBzARJS7qrNoda0VqzvOuioEpoEXKutiKuv92dSz6kP7rYLmyHPyYNLesi5t/aH1gfw==}
- peerDependencies:
- react: ^16.3.0
- dependencies:
- '@babel/runtime': 7.23.4
- prop-types: 15.8.1
- react: 18.2.0
- warning: 4.0.3
- dev: false
-
- resolution: {integrity: sha512-nsO+KSNgo1SbJqJEYRE9ERzo7YtYbou/OqjSQKxV7jcKox7+usiUVZOAC+XnDOABXggQTno0Y1CpVnuWEc1boQ==}
-
- resolution: {integrity: sha512-j8z+cQbWIM5LY37pR6uZR6D4LfseplqnuAO4co4u8917hBUvXlEqyP1ZzqVLcqoyUesZZv/ImreoCeHVDpE5pQ==}
- engines: {node: '>=10'}
- peerDependencies:
- react: '>=16'
- react-dom: '>=16'
- dependencies:
- goober: 2.1.13([email protected])
- react: 18.2.0
- react-dom: 18.2.0([email protected])
- transitivePeerDependencies:
- - csstype
- dev: false
-
- resolution: {integrity: sha512-KBB6buBmVKXUWNxXHdnthp+38gPyBT46hJCAIQ8rX19NFL/m2ahte2KARfIDf2tMnSAL7wwck6eDOd/9zn6aFg==}
- peerDependencies:
- i18next: '>= 19.0.0'
- react: '>= 16.8.0'
- react-dom: '*'
- react-native: '*'
- peerDependenciesMeta:
- react-dom:
- optional: true
- react-native:
- optional: true
- dependencies:
- '@babel/runtime': 7.21.5
- html-parse-stringify: 3.0.1
- i18next: 22.4.15
- react: 18.2.0
- react-dom: 18.2.0([email protected])
- dev: false
-
- resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==}
-
- resolution: {integrity: sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==}
- dev: false
-
- resolution: {integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==}
-
- resolution: {integrity: sha512-wIUW1fU5dHlkKvq4POfDkHruQsYp3fM8xNb/jnc8dnQ+nNCnaj0sx5pw7E6UyuEdLRyFKK0HZjmXBo+AtXXy0A==}
- peerDependencies:
- prop-types: ^15.8.1
- react: '>=15.3.2 <=18'
- dependencies:
- katex: 0.16.7
- prop-types: 15.8.1
- react: 18.2.0
- dev: false
-
- resolution: {integrity: sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==}
- dev: false
-
- resolution: {integrity: sha512-ty8So6tcUpIb+ZE+1HAhbLROvAIJYyJe/1vRrrcmW+jLsaM+/powDRqxzo6hSh9CuRZGSL1Q8mvcF5WRD93a0A==}
- peerDependencies:
- react: ^15.5.x || ^16.x || ^17.x || ^18.x
- react-dom: ^15.5.x || ^16.x || ^17.x || ^18.x
- dependencies:
- react: 18.2.0
- react-dom: 18.2.0([email protected])
- dev: false
-
- resolution: {integrity: sha512-GLLSOLWr21CqtJn8geSwQfoJufdt3mfdsnIiQswouuQ2MMPns+ihZklxvsTDKD3cR2tF8ELbi5xUsvqVhR6WvA==}
- peerDependencies:
- react: '>=16.3.0'
- react-dom: '>=16.3.0'
- dependencies:
- '@babel/runtime': 7.23.4
- '@popperjs/core': 2.11.8
- '@restart/hooks': 0.4.15([email protected])
- '@types/warning': 3.0.3
- dom-helpers: 5.2.1
- prop-types: 15.8.1
- react: 18.2.0
- react-dom: 18.2.0([email protected])
- uncontrollable: 7.2.1([email protected])
- warning: 4.0.3
- dev: false
-
- resolution: {integrity: sha512-e1hj8lL3uM+sgSR4Lxzn5h1GxBlpa4CQz0XLF8kx4MDrDRWY0Ena4c97PUeSX9i5W3UAfDP0z0FXCTQkoXUl3Q==}
- peerDependencies:
- '@popperjs/core': ^2.0.0
- react: ^16.8.0 || ^17 || ^18
- react-dom: ^16.8.0 || ^17 || ^18
- dependencies:
- '@popperjs/core': 2.11.8
- react: 18.2.0
- react-dom: 18.2.0([email protected])
- react-fast-compare: 3.2.2
- warning: 4.0.3
-
- resolution: {integrity: sha512-Gx4L3uM182jEEayZfRbI/G11ZpYdNAnBs70lFVMNdHJI76XYtR+7m0MN+eAs7UHBPhWXcnFPaS+9owSCJQHNpQ==}
- peerDependencies:
- react: ^16.8.3 || ^17 || ^18
- react-dom: '*'
- react-native: '*'
- peerDependenciesMeta:
- react-dom:
- optional: true
- react-native:
- optional: true
- dependencies:
- '@babel/runtime': 7.23.4
- '@types/react-redux': 7.1.25
- hoist-non-react-statics: 3.3.2
- loose-envify: 1.4.0
- prop-types: 15.8.1
- react: 18.2.0
- react-dom: 18.2.0([email protected])
- react-is: 17.0.2
- dev: false
-
- resolution: {integrity: sha512-Q2f6fCKxPFpkXt1qNRZdEDLlScsDWyrgSj0mliK59qU6W5gvBiKkdMEG2lJzhd1rCctf0hb6EtePPLZ2e0m1uw==}
- peerDependencies:
- '@types/react': ^16.8 || ^17.0 || ^18.0
- '@types/react-dom': ^16.8 || ^17.0 || ^18.0
- react: ^16.8 || ^17.0 || ^18.0
- react-dom: ^16.8 || ^17.0 || ^18.0
- react-native: '>=0.59'
- redux: ^4
- peerDependenciesMeta:
- '@types/react':
- optional: true
- '@types/react-dom':
- optional: true
- react-dom:
- optional: true
- react-native:
- optional: true
- redux:
- optional: true
- dependencies:
- '@babel/runtime': 7.21.5
- '@types/hoist-non-react-statics': 3.3.1
- '@types/react': 18.2.6
- '@types/react-dom': 18.2.4
- '@types/use-sync-external-store': 0.0.3
- hoist-non-react-statics: 3.3.2
- react: 18.2.0
- react-dom: 18.2.0([email protected])
- react-is: 18.2.0
- redux: 4.2.1
- use-sync-external-store: 1.2.0([email protected])
- dev: false
-
- resolution: {integrity: sha512-wViHqhAd8OHeLS/IRMJjTSDHF3U9eWi62F/MledQGPdJGDhodXJ9PBLNGr6WWL7qlH12Mt3TyTpbS+hGXMjCzQ==}
- engines: {node: '>=0.10.0'}
- dev: true
-
- resolution: {integrity: sha512-dPC2MhoPeTQ1YUOt5uIK376SMNWbwUxYRWk2ZmTT4fZfwlOvabF8uduRKKJIyfkCZvMgiF0GSCQckmkGGijIrg==}
- engines: {node: '>=14'}
- peerDependencies:
- react: '>=16.8'
- react-dom: '>=16.8'
- dependencies:
- '@remix-run/router': 1.6.1
- react: 18.2.0
- react-dom: 18.2.0([email protected])
- react-router: 6.11.1([email protected])
- dev: false
-
- resolution: {integrity: sha512-OZINSdjJ2WgvAi7hgNLazrEV8SGn6xrKA+MkJe9wVDMZ3zQ6fdJocUjpCUCI0cNrelWjcvon0S/QK/j0NzL3KA==}
- engines: {node: '>=14'}
- peerDependencies:
- react: '>=16.8'
- dependencies:
- '@remix-run/router': 1.6.1
- react: 18.2.0
- dev: false
-
- resolution: {integrity: sha512-0W/e9uPweNEOSPjmYtuKSC/SvKKg1sfo+WtPdnxeLF3t2L82h7jjszuOHz9C23fzkvLfdgkaOmcbAxE9w2GEjA==}
- engines: {node: '>=6.0.0'}
- dependencies:
- '@babel/runtime': 7.0.0
- warning: 4.0.3
- dev: false
-
- resolution: {integrity: sha512-W+fXBOsDqgFK1/g7MzRMVcDurp3LqO3ksC8UgInh2P/tKgb5DusuuB1geKHFc6o1wKl+4oyER4Zh3Lxmr8xbXA==}
- engines: {node: '>=6.0.0'}
- dependencies:
- '@babel/runtime': 7.0.0
- keycode: 2.2.1
- prop-types: 15.8.1
- react-event-listener: 0.6.6([email protected])
- react-swipeable-views-core: 0.14.0
- shallow-equal: 1.2.1
- transitivePeerDependencies:
- - react
- dev: false
-
- resolution: {integrity: sha512-wrTT6bi2nC3JbmyNAsPXffUXLn0DVT9SbbcFr36gKpbaCgEp7rX/OFxsu5hPc/NBsUhHyoSRGvwqJNNrWTwCww==}
- engines: {node: '>=6.0.0'}
- peerDependencies:
- react: ^15.3.0 || ^16.0.0 || ^17.0.0
- dependencies:
- '@babel/runtime': 7.0.0
- prop-types: 15.8.1
- react: 18.2.0
- react-swipeable-views-core: 0.14.0
- react-swipeable-views-utils: 0.14.0([email protected])
- warning: 4.0.3
- dev: false
-
- resolution: {integrity: sha512-pZcd1MCJoiKiBR2NRxeCRg13uCXbydPnmB4EOeRrY7480qNWO8IIgQG6zlDkm6uRMsURXPuKq0GWtiM59a5Q6g==}
- peerDependencies:
- react: '>=16.6.0'
- react-dom: '>=16.6.0'
- dependencies:
- '@babel/runtime': 7.21.5
- dom-helpers: 5.2.1
- loose-envify: 1.4.0
- prop-types: 15.8.1
- react: 18.2.0
- react-dom: 18.2.0([email protected])
- dev: false
-
- resolution: {integrity: sha512-OdIyHwj4S4wyhbKHOKM1wLSj/UDXm839Z3Cvfg2a9j+He6yDa6i5p0qQvEiCnyQlGO/HyfSnigQwuxvYalaAXA==}
- peerDependencies:
- react: ^15.3.0 || ^16.0.0-alpha || ^17.0.0 || ^18.0.0-rc
- react-dom: ^15.3.0 || ^16.0.0-alpha || ^17.0.0 || ^18.0.0-rc
- dependencies:
- react: 18.2.0
- react-dom: 18.2.0([email protected])
- dev: false
-
- resolution: {integrity: sha512-UOld0VqyAZrryF06K753X4bcEVN6/wW831exvVlMZeZAVHk9KXnlHs4rpqDAeoiBgUwJqoW/rtn0hwsokRRxPA==}
- peerDependencies:
- '@types/react-window': ^1.8.2
- react: ^16.13.1
- react-dom: ^16.13.1
- react-window: ^1.8.5
- dependencies:
- '@babel/runtime': 7.23.4
- '@types/react-window': 1.8.8
- react: 18.2.0
- react-dom: 18.2.0([email protected])
- react-window: 1.8.10([email protected])([email protected])
- dev: false
-
- resolution: {integrity: sha512-Y0Cx+dnU6NLa5/EvoHukUD0BklJ8qITCtVEPY1C/nL8wwoZ0b5aEw8Ff1dOVHw7fCzMt55XfJDd8S8W8LCaUCg==}
- engines: {node: '>8.0.0'}
- peerDependencies:
- react: ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0
- react-dom: ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0
- dependencies:
- '@babel/runtime': 7.23.4
- memoize-one: 5.2.1
- react: 18.2.0
- react-dom: 18.2.0([email protected])
- dev: false
-
- resolution: {integrity: sha512-55dZMVX61In2ngUhA4Fv0NMY4j5RZjxrJaSOAnJGJmkAhxKB6puVHYEmipyy2+W2CPydFF7pv+0NKzPUA03EVg==}
- peerDependencies:
- react: 16.2.0 - 18
- react-dom: 16.2.0 - 18
- dependencies:
- react: 18.2.0
- react-dom: 18.2.0([email protected])
- dev: false
-
- resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==}
- engines: {node: '>=0.10.0'}
- dependencies:
- loose-envify: 1.4.0
-
- resolution: {integrity: sha512-KiwVUcFu1RErkI97ywr8nvx8dNOpT03rbnma0SSalTYjkrPYaEajR4a/MRt6DZ46K6arDRbWMNHF+xH7G7n/8A==}
- peerDependencies:
- react: '*'
- dependencies:
- lodash: 4.17.21
- react: 18.2.0
- dev: false
-
- resolution: {integrity: sha512-Owdv/Ft7IjOgm/i0xvNDZ1LrRANRfew4b2prF3OWMQLxLfu3bS8FVhCsrSCMK4lR56Y9ya+AThoTpDCTxCmpRA==}
- dependencies:
- pify: 2.3.0
- dev: true
-
- resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==}
- engines: {node: '>=8.10.0'}
- dependencies:
- picomatch: 2.3.1
-
- resolution: {integrity: sha512-NW2r5T6ksUKXCabzhL9z+h206HQw/NJkcLm1GPImRQ8IzfXwRGqjVhKJGauHirT0DAuyy6hjdnMZaRoAcy0Klw==}
- peerDependencies:
- redux: ^5.0.0
- dependencies:
- redux: 5.0.0
- dev: false
-
- resolution: {integrity: sha512-LAUYz4lc+Do8/g7aeRa8JkyDErK6ekstQaqWQrNRW//MY1TvCEpMtpTWvlQ+FPbWCx+Xixu/6SHt5N0HR+SB4w==}
- dependencies:
- '@babel/runtime': 7.21.5
- dev: false
-
- resolution: {integrity: sha512-blLIYmYetpZMET6Q6uCY7Jtl/Im5OBldy+vNPauA8vvsdqyt66oep4EUpAMWNHauTC6xa9JuRPhRB72rY82QGA==}
- dev: false
-
- resolution: {integrity: sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg==}
- dev: false
-
- resolution: {integrity: sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==}
- dev: false
-
- resolution: {integrity: sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==}
-
- resolution: {integrity: sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA==}
- engines: {node: '>= 0.4'}
- dependencies:
- call-bind: 1.0.2
- define-properties: 1.2.0
- functions-have-names: 1.2.3
-
- resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==}
- engines: {node: '>=0.10.0'}
-
- resolution: {integrity: sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==}
- dev: true
-
- resolution: {integrity: sha512-D72j2ubjgHpvuCiORWkOUxndHJrxDaSolheiz5CO+roz8ka97/4msh2E8F5qay4GawR5vzBt5MkbDHT+Rdy/Wg==}
- dev: false
-
- resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==}
- engines: {node: '>=8'}
- dependencies:
- resolve-from: 5.0.0
-
- resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==}
- engines: {node: '>=4'}
-
- resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==}
- engines: {node: '>=8'}
-
- resolution: {integrity: sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==}
- engines: {node: '>=10'}
-
- resolution: {integrity: sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==}
- hasBin: true
- dependencies:
- is-core-module: 2.12.0
- path-parse: 1.0.7
- supports-preserve-symlinks-flag: 1.0.0
-
- resolution: {integrity: sha512-iMDbmAWtfU+MHpxt/I5iWI7cY6YVEZUQ3MBgPQ++XD1PELuJHIl82xBmObyP2KyQmkNB2dsqF7seoQQiAn5yDQ==}
- hasBin: true
- dependencies:
- is-core-module: 2.12.0
- path-parse: 1.0.7
- supports-preserve-symlinks-flag: 1.0.0
- dev: true
-
- resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==}
- engines: {iojs: '>=1.0.0', node: '>=0.10.0'}
- dev: true
-
- resolution: {integrity: sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==}
- hasBin: true
- dependencies:
- glob: 7.2.3
- dev: true
-
- resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==}
- hasBin: true
- dependencies:
- glob: 7.2.3
- dev: true
-
- resolution: {integrity: sha512-KXPaEuR8FfUoK2uHwNjxTmJ18ApyvD6zJpYv9FOJSqLStmt6xOY84l1IjK2dSolQmoXknrhEFRaPRgOPdqCT5w==}
- engines: {node: '>=14.18.0', npm: '>=8.0.0'}
- hasBin: true
- optionalDependencies:
- fsevents: 2.3.2
- dev: true
-
- resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==}
- dependencies:
- queue-microtask: 1.2.3
- dev: true
-
- resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==}
- dependencies:
- tslib: 2.5.0
- dev: false
-
- resolution: {integrity: sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==}
- dependencies:
- call-bind: 1.0.2
- get-intrinsic: 1.2.1
- is-regex: 1.1.4
- dev: true
-
- resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==}
- dev: true
-
- resolution: {integrity: sha512-uUxNQ3zAHeAx5nRFskBnrWzDUJrrvpCPD5FNAoRvTi0WwremlheES3tg+56PaVtCs5QDRX5CBLxxKMDJMEa1WQ==}
- engines: {node: '>=14.0.0'}
- hasBin: true
- dependencies:
- chokidar: 3.5.3
- immutable: 4.3.4
- source-map-js: 1.0.2
-
- resolution: {integrity: sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==}
- engines: {node: '>=v12.22.7'}
- dependencies:
- xmlchars: 2.2.0
- dev: true
-
- resolution: {integrity: sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==}
- dependencies:
- loose-envify: 1.4.0
-
- resolution: {integrity: sha512-49oNpRjWRvnU8NyGVmUaYG4jtTkNonFZI86MmGRDqBphEK2EXT9gdEUoQPZhuBM8yWHxCWbobltqYO5M4XrUvQ==}
- dependencies:
- compute-scroll-into-view: 3.1.0
- dev: false
-
- resolution: {integrity: sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==}
- hasBin: true
-
- resolution: {integrity: sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw==}
- engines: {node: '>=10'}
- hasBin: true
- dependencies:
- lru-cache: 6.0.0
-
- resolution: {integrity: sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==}
- engines: {node: '>=10'}
- hasBin: true
- dependencies:
- lru-cache: 6.0.0
- dev: true
-
- resolution: {integrity: sha512-8LS0JInaQMCRoQ7YUytAo/xUu5W2XnQxV2HI/6uM6U7CITS1RqPElr30V6uIqyMKM9lJGRVFy5/4CuzcixNYSg==}
- dependencies:
- no-case: 3.0.4
- tslib: 2.5.0
- upper-case-first: 2.0.2
- dev: true
-
- resolution: {integrity: sha512-S4vJDjHHMBaiZuT9NPb616CSmLf618jawtv3sufLl6ivK8WocjAo58cXwbRV1cgqxH0Qbv+iUt6m05eqEa2IRA==}
- dev: false
-
- resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==}
- engines: {node: '>=8'}
- dependencies:
- shebang-regex: 3.0.0
-
- resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==}
- engines: {node: '>=8'}
-
- resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==}
- dependencies:
- call-bind: 1.0.2
- get-intrinsic: 1.2.1
- object-inspect: 1.12.3
- dev: true
-
- resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==}
-
- resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==}
-
- resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==}
- engines: {node: '>=8'}
-
- resolution: {integrity: sha512-x5rUuWLNtH97hs9PrFovGgt3Qc5zkTm/5mcUB+0NR/TK923eLax4HsL6xACLHMs245nI6aJElyM1y6hN0y5W/Q==}
- peerDependencies:
- slate: '>=0.65.3'
- dependencies:
- is-plain-object: 5.0.0
- slate: 0.101.4
- dev: false
-
- resolution: {integrity: sha512-KMXK9FLeS7HYhhoVcI8SUi4Qp1I9C1lTQ2EgbPH95sVXfH/vq+hbhurEGIGCe0VQ9Opj4rSKJIv/g7De1+nJMA==}
- peerDependencies:
- react: '>=18.2.0'
- react-dom: '>=18.2.0'
- slate: '>=0.99.0'
- dependencies:
- '@juggle/resize-observer': 3.4.0
- '@types/is-hotkey': 0.1.10
- '@types/lodash': 4.14.202
- direction: 1.0.4
- is-hotkey: 0.2.0
- is-plain-object: 5.0.0
- lodash: 4.17.21
- react: 18.2.0
- react-dom: 18.2.0([email protected])
- scroll-into-view-if-needed: 3.1.0
- slate: 0.101.4
- tiny-invariant: 1.3.1
- dev: false
-
- resolution: {integrity: sha512-8LazZrNDsYFKDg1wpb0HouAfX5Pw/UmOZ/vIrtqD2GSCDZvraOkV2nVJ9Ery8kIlsU1jeybwgcaCy4KkVwfvEg==}
- dependencies:
- immer: 10.0.3
- is-plain-object: 5.0.0
- tiny-warning: 1.0.3
- dev: false
-
- resolution: {integrity: sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==}
- dependencies:
- dot-case: 3.0.4
- tslib: 2.5.0
- dev: true
-
- resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==}
- engines: {node: '>=0.10.0'}
-
- resolution: {integrity: sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==}
- dependencies:
- buffer-from: 1.1.2
- source-map: 0.6.1
-
- resolution: {integrity: sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==}
- engines: {node: '>=0.10.0'}
- dev: false
-
- resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==}
- engines: {node: '>=0.10.0'}
-
- resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==}
-
- resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==}
- engines: {node: '>=10'}
- dependencies:
- escape-string-regexp: 2.0.0
-
- resolution: {integrity: sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==}
- engines: {node: '>=10'}
- dependencies:
- char-regex: 1.0.2
- strip-ansi: 6.0.1
-
- resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==}
- engines: {node: '>=8'}
- dependencies:
- emoji-regex: 8.0.0
- is-fullwidth-code-point: 3.0.0
- strip-ansi: 6.0.1
-
- resolution: {integrity: sha512-6zOCOcJ+RJAQshcTvXPHoxoQGONa3e/Lqx90wUA+wEzX78sg5Bo+1tQo4N0pohS0erG9qtCqJDjNCQBjeWVxyg==}
- dependencies:
- call-bind: 1.0.2
- define-properties: 1.2.0
- es-abstract: 1.21.2
- get-intrinsic: 1.2.1
- has-symbols: 1.0.3
- internal-slot: 1.0.5
- regexp.prototype.flags: 1.5.0
- side-channel: 1.0.4
- dev: true
-
- resolution: {integrity: sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg==}
- engines: {node: '>= 0.4'}
- dependencies:
- call-bind: 1.0.2
- define-properties: 1.2.0
- es-abstract: 1.21.2
- dev: true
-
- resolution: {integrity: sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ==}
- dependencies:
- call-bind: 1.0.2
- define-properties: 1.2.0
- es-abstract: 1.21.2
- dev: true
-
- resolution: {integrity: sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA==}
- dependencies:
- call-bind: 1.0.2
- define-properties: 1.2.0
- es-abstract: 1.21.2
- dev: true
-
- resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==}
- engines: {node: '>=8'}
- dependencies:
- ansi-regex: 5.0.1
-
- resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==}
- engines: {node: '>=4'}
- dev: true
-
- resolution: {integrity: sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==}
- engines: {node: '>=8'}
-
- resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==}
- engines: {node: '>=6'}
-
- resolution: {integrity: sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==}
- engines: {node: '>=0.10.0'}
- dev: true
-
- resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==}
- engines: {node: '>=8'}
-
- resolution: {integrity: sha512-wHlB/f5eO3mDcYv6WtOz6gvQC477jBKrwuIXe+PtHskTCBsJdAOvL8hCquczJxDui2TnwpeNE+2msK91JJomZg==}
- engines: {node: '>=12.0.0'}
- hasBin: true
- dependencies:
- chalk: 4.1.2
- change-case: 4.1.2
- commander: 8.3.0
- fs-extra: 10.1.0
- glob: 7.2.3
- json5: 2.2.3
- jsonc-parser: 3.2.0
- lodash: 4.17.21
- tinycolor2: 1.6.0
- dev: true
-
- resolution: {integrity: sha512-Orov6g6BB1sDfYgzWfTHDOxamtX1bE/zo104Dh9e6fqJ3PooipYyfJ0pUmrZO2wAvO8YbEyeFrkV91XTsGMSrw==}
- dev: false
-
- resolution: {integrity: sha512-ydQOU34rpSyj2TGyz4D2p8rbktIOZ8QY9s+DGLvFU1i5pWJE8vkpruCjGCMHsdXwnD7JDcS+noSwM/a7zyNFDQ==}
- engines: {node: '>=8'}
- hasBin: true
- dependencies:
- '@jridgewell/gen-mapping': 0.3.3
- commander: 4.1.1
- glob: 7.1.6
- lines-and-columns: 1.2.4
- mz: 2.7.0
- pirates: 4.0.5
- ts-interface-checker: 0.1.13
- dev: true
-
- resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==}
- engines: {node: '>=4'}
- dependencies:
- has-flag: 3.0.0
-
- resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==}
- engines: {node: '>=8'}
- dependencies:
- has-flag: 4.0.0
-
- resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==}
- engines: {node: '>=10'}
- dependencies:
- has-flag: 4.0.0
-
- resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==}
- engines: {node: '>= 0.4'}
-
- resolution: {integrity: sha512-e4hG1hRwoOdRb37cIMSgzNsxyzKfayW6VOflrwvR+/bzrkyxY/31WkbgnQpgtrNp1SdpJvpUAGTa/ZoiPNDuRQ==}
- dev: true
-
- resolution: {integrity: sha512-Z706C1U2pb1+JGP48fbazf3KxHrWOsLme6Rv7imFBn5EnuanDW1GPaA/P1/dvObE670JDePC3mnj0k0B7P0jjQ==}
- engines: {node: '>=14.0.0'}
- hasBin: true
- dependencies:
- '@trysound/sax': 0.2.0
- commander: 7.2.0
- css-select: 5.1.0
- css-tree: 2.3.1
- csso: 5.0.5
- picocolors: 1.0.0
- dev: true
-
- resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==}
- dev: true
-
- resolution: {integrity: sha512-9jPkMiIBXvPc2KywkraqsUfbfj+dHDb+JPWtSJa9MLFdrPyazI7q6WX2sUrm7R9eVR7qqv3Pas7EvQFzxKnI6w==}
- engines: {node: '>=14.0.0'}
- hasBin: true
- dependencies:
- '@alloc/quick-lru': 5.2.0
- arg: 5.0.2
- chokidar: 3.5.3
- didyoumean: 1.2.2
- dlv: 1.1.3
- fast-glob: 3.2.12
- glob-parent: 6.0.2
- is-glob: 4.0.3
- jiti: 1.18.2
- lilconfig: 2.1.0
- micromatch: 4.0.5
- normalize-path: 3.0.0
- object-hash: 3.0.0
- picocolors: 1.0.0
- postcss: 8.4.23
- postcss-import: 15.1.0([email protected])
- postcss-js: 4.0.1([email protected])
- postcss-load-config: 4.0.1([email protected])
- postcss-nested: 6.0.1([email protected])
- postcss-selector-parser: 6.0.12
- postcss-value-parser: 4.2.0
- resolve: 1.22.2
- sucrase: 3.32.0
- transitivePeerDependencies:
- - ts-node
- dev: true
-
- resolution: {integrity: sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==}
- engines: {node: '>=8'}
- dependencies:
- '@istanbuljs/schema': 0.1.3
- glob: 7.2.3
- minimatch: 3.1.2
-
- resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==}
- dev: true
-
- resolution: {integrity: sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==}
- engines: {node: '>=0.8'}
- dependencies:
- thenify: 3.3.1
- dev: true
-
- resolution: {integrity: sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==}
- dependencies:
- any-promise: 1.3.0
- dev: true
-
- resolution: {integrity: sha512-AD5ih2NlSssTCwsMznbvwMZpJ1cbhkGd2uueNxzv2jDlEeZdU04JQfRnggJQ8DrcVBGjAsCKwFBbDlVNtEMlzw==}
- dev: false
-
- resolution: {integrity: sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==}
- dev: false
-
- resolution: {integrity: sha512-XPaBkWQJdsf3pLKJV9p4qN/S+fm2Oj8AIPo1BTUhg5oxkvm9+SVEGFdhyOz7tTdUTfvxMiAs4sp6/eZO2Ew+pw==}
-
- resolution: {integrity: sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==}
-
- resolution: {integrity: sha512-nD8pQi5H34kyu1QDMFjzEIYqk0xa9Alt6ZfrdEMuHCFOfTLhDG5pgTu/aAM9Wt9lXILwlXmWP43b8sav0GNE8Q==}
- dependencies:
- to-space-case: 1.0.0
- dev: false
-
- resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==}
- engines: {node: '>=4'}
-
- resolution: {integrity: sha512-Z3g735FxuZY8rodxV4gH7LxClE4H0hTIyHNIHdk+vpQxjLm0cwnKXq/OFVZ76SOQmto7txVcwSCwkU5kqp+FKg==}
- dev: false
-
- resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==}
- engines: {node: '>=8.0'}
- dependencies:
- is-number: 7.0.0
-
- resolution: {integrity: sha512-rLdvwXZ39VOn1IxGL3V6ZstoTbwLRckQmn/U8ZDLuWwIXNpuZDhQ3AiRUlhTbOXFVE9C+dR51wM0CBDhk31VcA==}
- dependencies:
- to-no-case: 1.0.2
- dev: false
-
- resolution: {integrity: sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==}
- engines: {node: '>=6'}
- dependencies:
- psl: 1.9.0
- punycode: 2.3.0
- universalify: 0.2.0
- url-parse: 1.5.10
- dev: true
-
- resolution: {integrity: sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==}
- engines: {node: '>=12'}
- dependencies:
- punycode: 2.3.0
- dev: true
-
- resolution: {integrity: sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==}
- hasBin: true
- dev: true
-
- resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==}
- dev: true
-
- resolution: {integrity: sha512-D6xjnnbP17cC85nliwGiL+tpoKN0StpgE0TeOjXQTU6MVCfsB4v7aW05CgQ/1OywGb0x/oy9hHFnN+sczTiRaA==}
- engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
- hasBin: true
- peerDependencies:
- '@babel/core': '>=7.0.0-beta.0 <8'
- '@jest/types': ^29.0.0
- babel-jest: ^29.0.0
- esbuild: '*'
- jest: ^29.0.0
- typescript: '>=4.3 <6'
- peerDependenciesMeta:
- '@babel/core':
- optional: true
- '@jest/types':
- optional: true
- babel-jest:
- optional: true
- esbuild:
- optional: true
- dependencies:
- '@babel/core': 7.21.8
- babel-jest: 29.6.2(@babel/[email protected])
- bs-logger: 0.2.6
- fast-json-stable-stringify: 2.1.0
- jest: 29.5.0(@types/[email protected])
- jest-util: 29.5.0
- json5: 2.2.3
- lodash.memoize: 4.1.2
- make-error: 1.3.6
- semver: 7.5.4
- typescript: 4.9.5
- yargs-parser: 21.1.1
- dev: true
-
- resolution: {integrity: sha512-ywMrhCfH6M75yftYvrvNarLEY+SUXtUvU8/0Z6llrHQVBx12GiFk5sStF8UdfE/yfzk9IAq7O5EEbTQsxlBI8w==}
- engines: {node: '>=0.8.0'}
- hasBin: true
- peerDependencies:
- node-notifier: '*'
- typescript: '*'
- peerDependenciesMeta:
- node-notifier:
- optional: true
- dependencies:
- chokidar: 3.5.3
- dynamic-dedupe: 0.3.0
- minimist: 1.2.8
- mkdirp: 1.0.4
- resolve: 1.22.2
- rimraf: 2.7.1
- source-map-support: 0.5.13
- tree-kill: 1.2.2
- ts-node: 10.9.1(@types/[email protected])([email protected])
- tsconfig: 7.0.0
- typescript: 4.9.5
- transitivePeerDependencies:
- - '@swc/core'
- - '@swc/wasm'
- - '@types/node'
- dev: true
-
- resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==}
- hasBin: true
- peerDependencies:
- '@swc/core': '>=1.2.50'
- '@swc/wasm': '>=1.2.50'
- '@types/node': '*'
- typescript: '>=2.7'
- peerDependenciesMeta:
- '@swc/core':
- optional: true
- '@swc/wasm':
- optional: true
- dependencies:
- '@cspotcode/source-map-support': 0.8.1
- '@tsconfig/node10': 1.0.9
- '@tsconfig/node12': 1.0.11
- '@tsconfig/node14': 1.0.3
- '@tsconfig/node16': 1.0.4
- '@types/node': 18.16.9
- acorn: 8.8.2
- acorn-walk: 8.2.0
- arg: 4.1.3
- create-require: 1.1.1
- diff: 4.0.2
- make-error: 1.3.6
- typescript: 4.9.5
- v8-compile-cache-lib: 3.0.1
- yn: 3.1.1
- dev: true
-
- resolution: {integrity: sha512-FWqxGX2NHp5oCyaMd96o2y2uMQmSu8Dey6kvyuFdRJ2AzfmWo3kWa4UsPlCGlfQ/qu03m09ZZtppMoY8EMHuiA==}
- dev: false
-
- resolution: {integrity: sha512-YKhUKqbteklNppC2NqL7dv1cWF8eEobgHVD5kjF1y9Q4ocqpBiaDlYslQ9eMhtbqIPRrA68RIEXqknEjlxdwxw==}
- dev: true
-
- resolution: {integrity: sha512-vZXmzPrL+EmC4T/4rVlT2jNVMWCi/O4DIiSj3UHg1OE5kCKbk4mfrXc6dZksLgRM/TZlKnousKH9bbTazUWRRw==}
- dependencies:
- '@types/strip-bom': 3.0.0
- '@types/strip-json-comments': 0.0.30
- strip-bom: 3.0.0
- strip-json-comments: 2.0.1
- dev: true
-
- resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==}
- dev: true
-
- resolution: {integrity: sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==}
-
- resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==}
- engines: {node: '>= 6'}
- peerDependencies:
- typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta'
- dependencies:
- tslib: 1.14.1
- typescript: 4.9.5
- dev: true
-
- resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==}
- engines: {node: '>= 0.8.0'}
- dependencies:
- prelude-ls: 1.2.1
- dev: true
-
- resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==}
- engines: {node: '>=4'}
-
- resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==}
- engines: {node: '>=10'}
- dev: true
-
- resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==}
- engines: {node: '>=10'}
-
- resolution: {integrity: sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==}
- dependencies:
- call-bind: 1.0.2
- for-each: 0.3.3
- is-typed-array: 1.1.10
- dev: true
-
- resolution: {integrity: sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==}
- engines: {node: '>=4.2.0'}
- hasBin: true
- dev: true
-
- resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==}
- dependencies:
- call-bind: 1.0.2
- has-bigints: 1.0.2
- has-symbols: 1.0.3
- which-boxed-primitive: 1.0.2
- dev: true
-
- resolution: {integrity: sha512-svtcfoTADIB0nT9nltgjujTi7BzVmwjZClOmskKu/E8FW9BXzg9os8OLr4f8Dlnk0rYWJIWr4wv9eKUXiQvQwQ==}
- peerDependencies:
- react: '>=15.0.0'
- dependencies:
- '@babel/runtime': 7.23.4
- '@types/react': 18.2.6
- invariant: 2.2.4
- react: 18.2.0
- react-lifecycles-compat: 3.0.4
- dev: false
-
- resolution: {integrity: sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==}
- engines: {node: '>= 4.0.0'}
- dev: true
-
- resolution: {integrity: sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==}
- engines: {node: '>= 10.0.0'}
- dev: true
-
- resolution: {integrity: sha512-j6qT2floy5Q2g2d939FJpwey1yw/GpQecFiSouyJtsHQPj3oqmqq3K4rI+GF8vU1zwGCT7ZwIGQd2dtCQLjYJw==}
- engines: {node: '>=10'}
- dev: false
-
- resolution: {integrity: sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==}
- hasBin: true
- peerDependencies:
- browserslist: '>= 4.21.0'
- dependencies:
- browserslist: 4.21.5
- escalade: 3.1.1
- picocolors: 1.0.0
-
- resolution: {integrity: sha512-514ppYHBaKwfJRK/pNC6c/OxfGa0obSnAl106u97Ed0I625Nin96KAjttZF6ZL3e1XLtphxnqrOi9iWgm+u+bg==}
- dependencies:
- tslib: 2.5.0
- dev: true
-
- resolution: {integrity: sha512-KgdgDGJt2TpuwBUIjgG6lzw2GWFRCW9Qkfkiv0DxqHHLYJHmtmdUIKcZd8rHgFSjopVTlw6ggzCm1b8MFQwikg==}
- dependencies:
- tslib: 2.5.0
- dev: true
-
- resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==}
- dependencies:
- punycode: 2.3.0
- dev: true
-
- resolution: {integrity: sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==}
- dependencies:
- querystringify: 2.2.0
- requires-port: 1.0.0
- dev: true
-
- resolution: {integrity: sha512-g66/K7ZQGYrI6dy8GLpVcMsBp4s17xNkYJVSMvTEevGy3nDxHOfE6z8BVE22+5G5x7t3+bhzrlTDB7ObrEE0cQ==}
- peerDependencies:
- react: ^16.8.0 || ^17.0.0 || ^18.0.0
- dependencies:
- react: 18.2.0
- dev: false
-
- resolution: {integrity: sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==}
- peerDependencies:
- react: ^16.8.0 || ^17.0.0 || ^18.0.0
- dependencies:
- react: 18.2.0
- dev: false
-
- resolution: {integrity: sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ==}
- dev: false
-
- resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==}
- dev: true
-
- resolution: {integrity: sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==}
- hasBin: true
- dev: true
-
- resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==}
- dev: true
-
- resolution: {integrity: sha512-6z3GW9x8G1gd+JIIgQQQxXuiJtCXeAjp6RaPEPLv62mH3iPHPxV6W3robxtCzNErRo6ZwTmzWhsbNvjyEBKzKA==}
- engines: {node: '>=10.12.0'}
- dependencies:
- '@jridgewell/trace-mapping': 0.3.18
- '@types/istanbul-lib-coverage': 2.0.4
- convert-source-map: 1.9.0
-
- resolution: {integrity: sha512-R0V4H86Xi2Pp7pmxN/EtV4Q6jr6PMN3t1IwxEvKUp6160r8FimvPh941oWyeK1iec/DTsh9Jb3Q+GputMS8SYg==}
- engines: {node: '>=12.20.0'}
- peerDependencies:
- '@types/react': '>=16.8'
- react: '>=16.8'
- peerDependenciesMeta:
- '@types/react':
- optional: true
- react:
- optional: true
- dependencies:
- '@types/react': 18.2.6
- derive-valtio: 0.1.0([email protected])
- proxy-compare: 2.5.1
- react: 18.2.0
- use-sync-external-store: 1.2.0([email protected])
- dev: false
-
- resolution: {integrity: sha512-Uvq6niTvhqJU6ga78qLKBFJSDvxWhOnyfQSoKpDPMAGxJPo5S3+9hyjExE5YDj6Lpa4uaLkGc1cBgxXov+LjSw==}
- peerDependencies:
- vite: ^2.6.0 || 3 || 4
- dependencies:
- '@rollup/pluginutils': 5.0.2
- '@svgr/core': 7.0.0
- '@svgr/plugin-jsx': 7.0.0
- vite: 4.3.5(@types/[email protected])([email protected])
- transitivePeerDependencies:
- - rollup
- - supports-color
- dev: true
-
- resolution: {integrity: sha512-0gEnL9wiRFxgz40o/i/eTBwm+NEbpUeTWhzKrZDSdKm6nplj+z4lKz8ANDgildxHm47Vg8EUia0aicKbawUVVA==}
- engines: {node: ^14.18.0 || >=16.0.0}
- hasBin: true
- peerDependencies:
- '@types/node': '>= 14'
- less: '*'
- sass: '*'
- stylus: '*'
- sugarss: '*'
- terser: ^5.4.0
- peerDependenciesMeta:
- '@types/node':
- optional: true
- less:
- optional: true
- sass:
- optional: true
- stylus:
- optional: true
- sugarss:
- optional: true
- terser:
- optional: true
- dependencies:
- '@types/node': 18.16.9
- esbuild: 0.17.19
- postcss: 8.4.23
- rollup: 3.21.7
- sass: 1.70.0
- optionalDependencies:
- fsevents: 2.3.2
- dev: true
-
- resolution: {integrity: sha512-Dhxzh5HZuiHQhbvTW9AMetFfBHDMYpo23Uo9btPXgdYP+3T5S+p+jgNy7spra+veYhBP2dCSgxR/i2Y02h5/6w==}
- engines: {node: '>=0.10.0'}
- dev: false
-
- resolution: {integrity: sha512-d+BFHzbiCx6zGfz0HyQ6Rg69w9k19nviJspaj4yNscGjrHu94sVP+aRm75yEbCh+r2/yR+7q6hux9LVtbuTGBw==}
- engines: {node: '>=14'}
- dependencies:
- xml-name-validator: 4.0.0
- dev: true
-
- resolution: {integrity: sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==}
- dependencies:
- makeerror: 1.0.12
-
- resolution: {integrity: sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w==}
- dependencies:
- loose-envify: 1.4.0
-
- resolution: {integrity: sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==}
- engines: {node: '>=12'}
- dev: true
-
- resolution: {integrity: sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg==}
- engines: {node: '>=12'}
- dependencies:
- iconv-lite: 0.6.3
- dev: true
-
- resolution: {integrity: sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==}
- engines: {node: '>=12'}
- dev: true
-
- resolution: {integrity: sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ==}
- engines: {node: '>=12'}
- dependencies:
- tr46: 3.0.0
- webidl-conversions: 7.0.0
- dev: true
-
- resolution: {integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==}
- dependencies:
- is-bigint: 1.0.4
- is-boolean-object: 1.1.2
- is-number-object: 1.0.7
- is-string: 1.0.7
- is-symbol: 1.0.4
- dev: true
-
- resolution: {integrity: sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==}
- engines: {node: '>= 0.4'}
- dependencies:
- available-typed-arrays: 1.0.5
- call-bind: 1.0.2
- for-each: 0.3.3
- gopd: 1.0.1
- has-tostringtag: 1.0.0
- is-typed-array: 1.1.10
- dev: true
-
- resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==}
- engines: {node: '>= 8'}
- hasBin: true
- dependencies:
- isexe: 2.0.0
-
- resolution: {integrity: sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==}
- engines: {node: '>=0.10.0'}
- dev: true
-
- resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==}
- engines: {node: '>=10'}
- dependencies:
- ansi-styles: 4.3.0
- string-width: 4.2.3
- strip-ansi: 6.0.1
-
- resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==}
-
- resolution: {integrity: sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==}
- engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0}
- dependencies:
- imurmurhash: 0.1.4
- signal-exit: 3.0.7
-
- resolution: {integrity: sha512-4OOseMUq8AzRBI/7SLMUwO+FEDnguetSk7KMb1sHwvF2w2Wv5Hoj0nlifx8vtGsftE/jWHojPy8sMMzYLJ2G/A==}
- engines: {node: '>=10.0.0'}
- peerDependencies:
- bufferutil: ^4.0.1
- utf-8-validate: '>=5.0.2'
- peerDependenciesMeta:
- bufferutil:
- optional: true
- utf-8-validate:
- optional: true
- dev: true
-
- resolution: {integrity: sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==}
- engines: {node: '>=12'}
- dev: true
-
- resolution: {integrity: sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==}
- dev: true
-
- resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==}
- engines: {node: '>=0.4'}
- dev: true
-
- resolution: {integrity: sha512-vHRF2L6iT3rwj1jub/K5tYcTT/mEYDUppgNPXwp8fmLpui9f7Yeq3OEtTLVF012j39QnV+KEQpNqoN7CWU7Y9Q==}
- engines: {node: '>=16.0.0', npm: '>=8.0.0'}
- peerDependencies:
- yjs: ^13.0.0
- dependencies:
- lib0: 0.2.88
- yjs: 13.6.1
- dev: false
-
- resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==}
- engines: {node: '>=10'}
-
- resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==}
-
- resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==}
-
- resolution: {integrity: sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==}
- engines: {node: '>= 6'}
- dev: false
-
- resolution: {integrity: sha512-CBKFWExMn46Foo4cldiChEzn7S7SRV+wqiluAb6xmueD/fGyRHIhX8m14vVGgeFWjN540nKCNVj6P21eQjgTuA==}
- engines: {node: '>= 14'}
- dev: true
-
- resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==}
- engines: {node: '>=12'}
-
- resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==}
- engines: {node: '>=12'}
- dependencies:
- cliui: 8.0.1
- escalade: 3.1.1
- get-caller-file: 2.0.5
- require-directory: 2.1.1
- string-width: 4.2.3
- y18n: 5.0.8
- yargs-parser: 21.1.1
-
- resolution: {integrity: sha512-IyyHL+/v9N2S4YLSjGHMa0vMAfFxq8RDG5Nvb77raTTHJPweU3L/fRlqw6ElZvZUuHWnax3ufHR0Tx0ntfG63Q==}
- engines: {node: '>=16.0.0', npm: '>=8.0.0'}
- dependencies:
- lib0: 0.2.74
- dev: false
-
- resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==}
- engines: {node: '>=6'}
- dev: true
-
- resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==}
- engines: {node: '>=10'}
-
-settings:
- autoInstallPeers: true
- excludeLinksFromLockfile: false
diff --git a/frontend/appflowy_tauri/postcss.config.cjs b/frontend/appflowy_tauri/postcss.config.cjs
deleted file mode 100644
index 12a703d900..0000000000
--- a/frontend/appflowy_tauri/postcss.config.cjs
+++ /dev/null
@@ -1,6 +0,0 @@
-module.exports = {
- plugins: {
- tailwindcss: {},
- autoprefixer: {},
- },
-};
diff --git a/frontend/appflowy_tauri/public/google_fonts/Poppins/OFL.txt b/frontend/appflowy_tauri/public/google_fonts/Poppins/OFL.txt
deleted file mode 100644
index 246c977c9f..0000000000
--- a/frontend/appflowy_tauri/public/google_fonts/Poppins/OFL.txt
+++ /dev/null
@@ -1,93 +0,0 @@
-Copyright 2020 The Poppins Project Authors (https://github.com/itfoundry/Poppins)
-
-This Font Software is licensed under the SIL Open Font License, Version 1.1.
-This license is copied below, and is also available with a FAQ at:
-http://scripts.sil.org/OFL
-
-
------------------------------------------------------------
-SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
------------------------------------------------------------
-
-PREAMBLE
-The goals of the Open Font License (OFL) are to stimulate worldwide
-development of collaborative font projects, to support the font creation
-efforts of academic and linguistic communities, and to provide a free and
-open framework in which fonts may be shared and improved in partnership
-with others.
-
-The OFL allows the licensed fonts to be used, studied, modified and
-redistributed freely as long as they are not sold by themselves. The
-fonts, including any derivative works, can be bundled, embedded,
-redistributed and/or sold with any software provided that any reserved
-names are not used by derivative works. The fonts and derivatives,
-however, cannot be released under any other type of license. The
-requirement for fonts to remain under this license does not apply
-to any document created using the fonts or their derivatives.
-
-DEFINITIONS
-"Font Software" refers to the set of files released by the Copyright
-Holder(s) under this license and clearly marked as such. This may
-include source files, build scripts and documentation.
-
-"Reserved Font Name" refers to any names specified as such after the
-copyright statement(s).
-
-"Original Version" refers to the collection of Font Software components as
-distributed by the Copyright Holder(s).
-
-"Modified Version" refers to any derivative made by adding to, deleting,
-or substituting -- in part or in whole -- any of the components of the
-Original Version, by changing formats or by porting the Font Software to a
-new environment.
-
-"Author" refers to any designer, engineer, programmer, technical
-writer or other person who contributed to the Font Software.
-
-PERMISSION & CONDITIONS
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of the Font Software, to use, study, copy, merge, embed, modify,
-redistribute, and sell modified and unmodified copies of the Font
-Software, subject to the following conditions:
-
-1) Neither the Font Software nor any of its individual components,
-in Original or Modified Versions, may be sold by itself.
-
-2) Original or Modified Versions of the Font Software may be bundled,
-redistributed and/or sold with any software, provided that each copy
-contains the above copyright notice and this license. These can be
-included either as stand-alone text files, human-readable headers or
-in the appropriate machine-readable metadata fields within text or
-binary files as long as those fields can be easily viewed by the user.
-
-3) No Modified Version of the Font Software may use the Reserved Font
-Name(s) unless explicit written permission is granted by the corresponding
-Copyright Holder. This restriction only applies to the primary font name as
-presented to the users.
-
-4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
-Software shall not be used to promote, endorse or advertise any
-Modified Version, except to acknowledge the contribution(s) of the
-Copyright Holder(s) and the Author(s) or with their explicit written
-permission.
-
-5) The Font Software, modified or unmodified, in part or in whole,
-must be distributed entirely under this license, and must not be
-distributed under any other license. The requirement for fonts to
-remain under this license does not apply to any document created
-using the Font Software.
-
-TERMINATION
-This license becomes null and void if any of the above conditions are
-not met.
-
-DISCLAIMER
-THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
-OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
-DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
-OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/frontend/appflowy_tauri/public/google_fonts/Poppins/Poppins-Black.ttf b/frontend/appflowy_tauri/public/google_fonts/Poppins/Poppins-Black.ttf
deleted file mode 100644
index 71c0f995ee..0000000000
Binary files a/frontend/appflowy_tauri/public/google_fonts/Poppins/Poppins-Black.ttf and /dev/null differ
diff --git a/frontend/appflowy_tauri/public/google_fonts/Poppins/Poppins-BlackItalic.ttf b/frontend/appflowy_tauri/public/google_fonts/Poppins/Poppins-BlackItalic.ttf
deleted file mode 100644
index 7aeb58bd1b..0000000000
Binary files a/frontend/appflowy_tauri/public/google_fonts/Poppins/Poppins-BlackItalic.ttf and /dev/null differ
diff --git a/frontend/appflowy_tauri/public/google_fonts/Poppins/Poppins-Bold.ttf b/frontend/appflowy_tauri/public/google_fonts/Poppins/Poppins-Bold.ttf
deleted file mode 100644
index 00559eeb29..0000000000
Binary files a/frontend/appflowy_tauri/public/google_fonts/Poppins/Poppins-Bold.ttf and /dev/null differ
diff --git a/frontend/appflowy_tauri/public/google_fonts/Poppins/Poppins-BoldItalic.ttf b/frontend/appflowy_tauri/public/google_fonts/Poppins/Poppins-BoldItalic.ttf
deleted file mode 100644
index e61e8e88bd..0000000000
Binary files a/frontend/appflowy_tauri/public/google_fonts/Poppins/Poppins-BoldItalic.ttf and /dev/null differ
diff --git a/frontend/appflowy_tauri/public/google_fonts/Poppins/Poppins-ExtraBold.ttf b/frontend/appflowy_tauri/public/google_fonts/Poppins/Poppins-ExtraBold.ttf
deleted file mode 100644
index df7093608a..0000000000
Binary files a/frontend/appflowy_tauri/public/google_fonts/Poppins/Poppins-ExtraBold.ttf and /dev/null differ
diff --git a/frontend/appflowy_tauri/public/google_fonts/Poppins/Poppins-ExtraBoldItalic.ttf b/frontend/appflowy_tauri/public/google_fonts/Poppins/Poppins-ExtraBoldItalic.ttf
deleted file mode 100644
index 14d2b375dc..0000000000
Binary files a/frontend/appflowy_tauri/public/google_fonts/Poppins/Poppins-ExtraBoldItalic.ttf and /dev/null differ
diff --git a/frontend/appflowy_tauri/public/google_fonts/Poppins/Poppins-ExtraLight.ttf b/frontend/appflowy_tauri/public/google_fonts/Poppins/Poppins-ExtraLight.ttf
deleted file mode 100644
index e76ec69a65..0000000000
Binary files a/frontend/appflowy_tauri/public/google_fonts/Poppins/Poppins-ExtraLight.ttf and /dev/null differ
diff --git a/frontend/appflowy_tauri/public/google_fonts/Poppins/Poppins-ExtraLightItalic.ttf b/frontend/appflowy_tauri/public/google_fonts/Poppins/Poppins-ExtraLightItalic.ttf
deleted file mode 100644
index 89513d9469..0000000000
Binary files a/frontend/appflowy_tauri/public/google_fonts/Poppins/Poppins-ExtraLightItalic.ttf and /dev/null differ
diff --git a/frontend/appflowy_tauri/public/google_fonts/Poppins/Poppins-Italic.ttf b/frontend/appflowy_tauri/public/google_fonts/Poppins/Poppins-Italic.ttf
deleted file mode 100644
index 12b7b3c40b..0000000000
Binary files a/frontend/appflowy_tauri/public/google_fonts/Poppins/Poppins-Italic.ttf and /dev/null differ
diff --git a/frontend/appflowy_tauri/public/google_fonts/Poppins/Poppins-Light.ttf b/frontend/appflowy_tauri/public/google_fonts/Poppins/Poppins-Light.ttf
deleted file mode 100644
index bc36bcc242..0000000000
Binary files a/frontend/appflowy_tauri/public/google_fonts/Poppins/Poppins-Light.ttf and /dev/null differ
diff --git a/frontend/appflowy_tauri/public/google_fonts/Poppins/Poppins-LightItalic.ttf b/frontend/appflowy_tauri/public/google_fonts/Poppins/Poppins-LightItalic.ttf
deleted file mode 100644
index 9e70be6a9e..0000000000
Binary files a/frontend/appflowy_tauri/public/google_fonts/Poppins/Poppins-LightItalic.ttf and /dev/null differ
diff --git a/frontend/appflowy_tauri/public/google_fonts/Poppins/Poppins-Medium.ttf b/frontend/appflowy_tauri/public/google_fonts/Poppins/Poppins-Medium.ttf
deleted file mode 100644
index 6bcdcc27f2..0000000000
Binary files a/frontend/appflowy_tauri/public/google_fonts/Poppins/Poppins-Medium.ttf and /dev/null differ
diff --git a/frontend/appflowy_tauri/public/google_fonts/Poppins/Poppins-MediumItalic.ttf b/frontend/appflowy_tauri/public/google_fonts/Poppins/Poppins-MediumItalic.ttf
deleted file mode 100644
index be67410fd0..0000000000
Binary files a/frontend/appflowy_tauri/public/google_fonts/Poppins/Poppins-MediumItalic.ttf and /dev/null differ
diff --git a/frontend/appflowy_tauri/public/google_fonts/Poppins/Poppins-Regular.ttf b/frontend/appflowy_tauri/public/google_fonts/Poppins/Poppins-Regular.ttf
deleted file mode 100644
index 9f0c71b70a..0000000000
Binary files a/frontend/appflowy_tauri/public/google_fonts/Poppins/Poppins-Regular.ttf and /dev/null differ
diff --git a/frontend/appflowy_tauri/public/google_fonts/Poppins/Poppins-SemiBold.ttf b/frontend/appflowy_tauri/public/google_fonts/Poppins/Poppins-SemiBold.ttf
deleted file mode 100644
index 74c726e327..0000000000
Binary files a/frontend/appflowy_tauri/public/google_fonts/Poppins/Poppins-SemiBold.ttf and /dev/null differ
diff --git a/frontend/appflowy_tauri/public/google_fonts/Poppins/Poppins-SemiBoldItalic.ttf b/frontend/appflowy_tauri/public/google_fonts/Poppins/Poppins-SemiBoldItalic.ttf
deleted file mode 100644
index 3e6c942233..0000000000
Binary files a/frontend/appflowy_tauri/public/google_fonts/Poppins/Poppins-SemiBoldItalic.ttf and /dev/null differ
diff --git a/frontend/appflowy_tauri/public/google_fonts/Poppins/Poppins-Thin.ttf b/frontend/appflowy_tauri/public/google_fonts/Poppins/Poppins-Thin.ttf
deleted file mode 100644
index 03e736613a..0000000000
Binary files a/frontend/appflowy_tauri/public/google_fonts/Poppins/Poppins-Thin.ttf and /dev/null differ
diff --git a/frontend/appflowy_tauri/public/google_fonts/Poppins/Poppins-ThinItalic.ttf b/frontend/appflowy_tauri/public/google_fonts/Poppins/Poppins-ThinItalic.ttf
deleted file mode 100644
index e26db5dd3d..0000000000
Binary files a/frontend/appflowy_tauri/public/google_fonts/Poppins/Poppins-ThinItalic.ttf and /dev/null differ
diff --git a/frontend/appflowy_tauri/public/google_fonts/Roboto_Mono/LICENSE.txt b/frontend/appflowy_tauri/public/google_fonts/Roboto_Mono/LICENSE.txt
deleted file mode 100644
index 75b52484ea..0000000000
--- a/frontend/appflowy_tauri/public/google_fonts/Roboto_Mono/LICENSE.txt
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/frontend/appflowy_tauri/public/google_fonts/Roboto_Mono/RobotoMono-Italic.ttf b/frontend/appflowy_tauri/public/google_fonts/Roboto_Mono/RobotoMono-Italic.ttf
deleted file mode 100644
index 61e5303325..0000000000
Binary files a/frontend/appflowy_tauri/public/google_fonts/Roboto_Mono/RobotoMono-Italic.ttf and /dev/null differ
diff --git a/frontend/appflowy_tauri/public/google_fonts/Roboto_Mono/RobotoMono-Regular.ttf b/frontend/appflowy_tauri/public/google_fonts/Roboto_Mono/RobotoMono-Regular.ttf
deleted file mode 100644
index 6df2b25360..0000000000
Binary files a/frontend/appflowy_tauri/public/google_fonts/Roboto_Mono/RobotoMono-Regular.ttf and /dev/null differ
diff --git a/frontend/appflowy_tauri/public/launch_splash.jpg b/frontend/appflowy_tauri/public/launch_splash.jpg
deleted file mode 100644
index 7e3bb9cee6..0000000000
Binary files a/frontend/appflowy_tauri/public/launch_splash.jpg and /dev/null differ
diff --git a/frontend/appflowy_tauri/public/tauri.svg b/frontend/appflowy_tauri/public/tauri.svg
deleted file mode 100644
index 31b62c9280..0000000000
--- a/frontend/appflowy_tauri/public/tauri.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-<svg width="206" height="231" viewBox="0 0 206 231" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M143.143 84C143.143 96.1503 133.293 106 121.143 106C108.992 106 99.1426 96.1503 99.1426 84C99.1426 71.8497 108.992 62 121.143 62C133.293 62 143.143 71.8497 143.143 84Z" fill="#FFC131"/>
-<ellipse cx="84.1426" cy="147" rx="22" ry="22" transform="rotate(180 84.1426 147)" fill="#24C8DB"/>
-<path fill-rule="evenodd" clip-rule="evenodd" d="M166.738 154.548C157.86 160.286 148.023 164.269 137.757 166.341C139.858 160.282 141 153.774 141 147C141 144.543 140.85 142.121 140.558 139.743C144.975 138.204 149.215 136.139 153.183 133.575C162.73 127.404 170.292 118.608 174.961 108.244C179.63 97.8797 181.207 86.3876 179.502 75.1487C177.798 63.9098 172.884 53.4021 165.352 44.8883C157.82 36.3744 147.99 30.2165 137.042 27.1546C126.095 24.0926 114.496 24.2568 103.64 27.6274C92.7839 30.998 83.1319 37.4317 75.8437 46.1553C74.9102 47.2727 74.0206 48.4216 73.176 49.5993C61.9292 50.8488 51.0363 54.0318 40.9629 58.9556C44.2417 48.4586 49.5653 38.6591 56.679 30.1442C67.0505 17.7298 80.7861 8.57426 96.2354 3.77762C111.685 -1.01901 128.19 -1.25267 143.769 3.10474C159.348 7.46215 173.337 16.2252 184.056 28.3411C194.775 40.457 201.767 55.4101 204.193 71.404C206.619 87.3978 204.374 103.752 197.73 118.501C191.086 133.25 180.324 145.767 166.738 154.548ZM41.9631 74.275L62.5557 76.8042C63.0459 72.813 63.9401 68.9018 65.2138 65.1274C57.0465 67.0016 49.2088 70.087 41.9631 74.275Z" fill="#FFC131"/>
-<path fill-rule="evenodd" clip-rule="evenodd" d="M38.4045 76.4519C47.3493 70.6709 57.2677 66.6712 67.6171 64.6132C65.2774 70.9669 64 77.8343 64 85.0001C64 87.1434 64.1143 89.26 64.3371 91.3442C60.0093 92.8732 55.8533 94.9092 51.9599 97.4256C42.4128 103.596 34.8505 112.392 30.1816 122.756C25.5126 133.12 23.9357 144.612 25.6403 155.851C27.3449 167.09 32.2584 177.598 39.7906 186.112C47.3227 194.626 57.153 200.784 68.1003 203.846C79.0476 206.907 90.6462 206.743 101.502 203.373C112.359 200.002 122.011 193.568 129.299 184.845C130.237 183.722 131.131 182.567 131.979 181.383C143.235 180.114 154.132 176.91 164.205 171.962C160.929 182.49 155.596 192.319 148.464 200.856C138.092 213.27 124.357 222.426 108.907 227.222C93.458 232.019 76.9524 232.253 61.3736 227.895C45.7948 223.538 31.8055 214.775 21.0867 202.659C10.3679 190.543 3.37557 175.59 0.949823 159.596C-1.47592 143.602 0.768139 127.248 7.41237 112.499C14.0566 97.7497 24.8183 85.2327 38.4045 76.4519ZM163.062 156.711L163.062 156.711C162.954 156.773 162.846 156.835 162.738 156.897C162.846 156.835 162.954 156.773 163.062 156.711Z" fill="#24C8DB"/>
-</svg>
diff --git a/frontend/appflowy_tauri/public/vite.svg b/frontend/appflowy_tauri/public/vite.svg
deleted file mode 100644
index e7b8dfb1b2..0000000000
--- a/frontend/appflowy_tauri/public/vite.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
\ No newline at end of file
diff --git a/frontend/appflowy_tauri/scripts/i18n/index.cjs b/frontend/appflowy_tauri/scripts/i18n/index.cjs
deleted file mode 100644
index c3789e0c56..0000000000
--- a/frontend/appflowy_tauri/scripts/i18n/index.cjs
+++ /dev/null
@@ -1,63 +0,0 @@
-const languages = [
- 'ar-SA',
- 'ca-ES',
- 'de-DE',
- 'en',
- 'es-VE',
- 'eu-ES',
- 'fr-FR',
- 'hu-HU',
- 'id-ID',
- 'it-IT',
- 'ja-JP',
- 'ko-KR',
- 'pl-PL',
- 'pt-BR',
- 'pt-PT',
- 'ru-RU',
- 'sv-SE',
- 'th-TH',
- 'tr-TR',
- 'zh-CN',
- 'zh-TW',
-];
-
-const fs = require('fs');
-languages.forEach(language => {
- const json = require(`../../../resources/translations/${language}.json`);
- const outputJSON = flattenJSON(json);
- const output = JSON.stringify(outputJSON);
- const isExistDir = fs.existsSync('./src/appflowy_app/i18n/translations');
- if (!isExistDir) {
- fs.mkdirSync('./src/appflowy_app/i18n/translations');
- }
- fs.writeFile(`./src/appflowy_app/i18n/translations/${language}.json`, new Uint8Array(Buffer.from(output)), (res) => {
- if (res) {
- console.error(res);
- }
- })
-});
-
-
-function flattenJSON(obj, prefix = '') {
- let result = {};
- const pluralsKey = ["one", "other", "few", "many", "two", "zero"];
-
- for (let key in obj) {
- if (typeof obj[key] === 'object' && obj[key] !== null) {
-
- const nestedKeys = flattenJSON(obj[key], `${prefix}${key}.`);
- result = { ...result, ...nestedKeys };
- } else {
- let newKey = `${prefix}${key}`;
- let replaceChar = '{'
- if (pluralsKey.includes(key)) {
- newKey = `${prefix.slice(0, -1)}_${key}`;
- }
- result[newKey] = obj[key].replaceAll('{', '{{').replaceAll('}', '}}');
- }
- }
-
- return result;
-}
-
diff --git a/frontend/appflowy_tauri/scripts/update_version.cjs b/frontend/appflowy_tauri/scripts/update_version.cjs
deleted file mode 100644
index 498b8c3e4f..0000000000
--- a/frontend/appflowy_tauri/scripts/update_version.cjs
+++ /dev/null
@@ -1,31 +0,0 @@
-const fs = require('fs');
-const path = require('path');
-
-if (process.argv.length < 3) {
- console.error('Usage: node update-tauri-version.js <version>');
- process.exit(1);
-}
-
-const newVersion = process.argv[2];
-
-const tauriConfigPath = path.join(__dirname, '../src-tauri', 'tauri.conf.json');
-
-fs.readFile(tauriConfigPath, 'utf8', (err, data) => {
- if (err) {
- console.error('Error reading tauri.conf.json:', err);
- return;
- }
-
- const config = JSON.parse(data);
-
- config.package.version = newVersion;
-
- fs.writeFile(tauriConfigPath, JSON.stringify(config, null, 2), 'utf8', (err) => {
- if (err) {
- console.error('Error writing tauri.conf.json:', err);
- return;
- }
-
- console.log(`Tauri version updated to ${newVersion} successfully.`);
- });
-});
diff --git a/frontend/appflowy_tauri/src-tauri/.cargo/config.toml b/frontend/appflowy_tauri/src-tauri/.cargo/config.toml
deleted file mode 100644
index bff29e6e17..0000000000
--- a/frontend/appflowy_tauri/src-tauri/.cargo/config.toml
+++ /dev/null
@@ -1,2 +0,0 @@
-[build]
-rustflags = ["--cfg", "tokio_unstable"]
diff --git a/frontend/appflowy_tauri/src-tauri/.gitignore b/frontend/appflowy_tauri/src-tauri/.gitignore
deleted file mode 100644
index 61e1bdd46a..0000000000
--- a/frontend/appflowy_tauri/src-tauri/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-# Generated by Cargo
-# will have compiled files and executables
-/target/
-.env
diff --git a/frontend/appflowy_tauri/src-tauri/Cargo.lock b/frontend/appflowy_tauri/src-tauri/Cargo.lock
deleted file mode 100644
index 4b4d22625e..0000000000
--- a/frontend/appflowy_tauri/src-tauri/Cargo.lock
+++ /dev/null
@@ -1,9227 +0,0 @@
-# This file is automatically @generated by Cargo.
-# It is not intended for manual editing.
-version = 3
-
-[[package]]
-name = "accessory"
-version = "1.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "850bb534b9dc04744fbbb71d30ad6d25a7e4cf6dc33e223c81ef3a92ebab4e0b"
-dependencies = [
- "macroific",
- "proc-macro2",
- "quote",
- "syn 2.0.47",
-]
-
-[[package]]
-name = "addr2line"
-version = "0.19.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97"
-dependencies = [
- "gimli",
-]
-
-[[package]]
-name = "adler"
-version = "1.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
-
-[[package]]
-name = "aead"
-version = "0.5.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0"
-dependencies = [
- "crypto-common",
- "generic-array",
-]
-
-[[package]]
-name = "aes"
-version = "0.8.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0"
-dependencies = [
- "cfg-if",
- "cipher",
- "cpufeatures",
-]
-
-[[package]]
-name = "aes-gcm"
-version = "0.10.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "209b47e8954a928e1d72e86eca7000ebb6655fe1436d33eefc2201cad027e237"
-dependencies = [
- "aead",
- "aes",
- "cipher",
- "ctr",
- "ghash",
- "subtle",
-]
-
-[[package]]
-name = "again"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "05802a5ad4d172eaf796f7047b42d0af9db513585d16d4169660a21613d34b93"
-dependencies = [
- "log",
- "rand 0.7.3",
- "wasm-timer",
-]
-
-[[package]]
-name = "ahash"
-version = "0.7.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47"
-dependencies = [
- "getrandom 0.2.10",
- "once_cell",
- "version_check",
-]
-
-[[package]]
-name = "ahash"
-version = "0.8.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a"
-dependencies = [
- "cfg-if",
- "getrandom 0.2.10",
- "once_cell",
- "version_check",
- "zerocopy",
-]
-
-[[package]]
-name = "aho-corasick"
-version = "0.7.20"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac"
-dependencies = [
- "memchr",
-]
-
-[[package]]
-name = "aho-corasick"
-version = "1.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41"
-dependencies = [
- "memchr",
-]
-
-[[package]]
-name = "allo-isolate"
-version = "0.1.25"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "97b6d794345b06592d0ebeed8e477e41b71e5a0a49df4fc0e4184d5938b99509"
-dependencies = [
- "atomic",
- "pin-project",
-]
-
-[[package]]
-name = "alloc-no-stdlib"
-version = "2.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3"
-
-[[package]]
-name = "alloc-stdlib"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece"
-dependencies = [
- "alloc-no-stdlib",
-]
-
-[[package]]
-name = "allocator-api2"
-version = "0.2.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5"
-
-[[package]]
-name = "android-tzdata"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0"
-
-[[package]]
-name = "android_system_properties"
-version = "0.1.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "anyhow"
-version = "1.0.94"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c1fd03a028ef38ba2276dce7e33fcd6369c158a1bca17946c4b1b701891c1ff7"
-
-[[package]]
-name = "app-error"
-version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ea131f0baab67defe7591067357eced490072372#ea131f0baab67defe7591067357eced490072372"
-dependencies = [
- "anyhow",
- "bincode",
- "getrandom 0.2.10",
- "reqwest",
- "serde",
- "serde_json",
- "serde_repr",
- "thiserror",
- "tokio",
- "tsify",
- "url",
- "uuid",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "appflowy-ai-client"
-version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ea131f0baab67defe7591067357eced490072372#ea131f0baab67defe7591067357eced490072372"
-dependencies = [
- "anyhow",
- "bytes",
- "futures",
- "pin-project",
- "serde",
- "serde_json",
- "serde_repr",
- "thiserror",
-]
-
-[[package]]
-name = "appflowy-local-ai"
-version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-LocalAI?rev=6f064efe232268f8d396edbb4b84d57fbb640f13#6f064efe232268f8d396edbb4b84d57fbb640f13"
-dependencies = [
- "anyhow",
- "appflowy-plugin",
- "bytes",
- "reqwest",
- "serde",
- "serde_json",
- "tokio",
- "tokio-stream",
- "tokio-util",
- "tracing",
- "zip 2.2.0",
- "zip-extensions",
-]
-
-[[package]]
-name = "appflowy-plugin"
-version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-LocalAI?rev=6f064efe232268f8d396edbb4b84d57fbb640f13#6f064efe232268f8d396edbb4b84d57fbb640f13"
-dependencies = [
- "anyhow",
- "cfg-if",
- "crossbeam-utils",
- "log",
- "once_cell",
- "parking_lot 0.12.1",
- "serde",
- "serde_json",
- "thiserror",
- "tokio",
- "tokio-stream",
- "tracing",
- "xattr 1.3.1",
-]
-
-[[package]]
-name = "appflowy_tauri"
-version = "0.0.0"
-dependencies = [
- "bytes",
- "dotenv",
- "flowy-ai",
- "flowy-config",
- "flowy-core",
- "flowy-date",
- "flowy-document",
- "flowy-error",
- "flowy-notification",
- "flowy-search",
- "flowy-user",
- "lib-dispatch",
- "semver",
- "serde",
- "serde_json",
- "tauri",
- "tauri-build",
- "tauri-plugin-deep-link",
- "tauri-utils",
- "tracing",
- "uuid",
-]
-
-[[package]]
-name = "arbitrary"
-version = "1.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110"
-dependencies = [
- "derive_arbitrary",
-]
-
-[[package]]
-name = "arc-swap"
-version = "1.7.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457"
-
-[[package]]
-name = "arrayvec"
-version = "0.7.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711"
-
-[[package]]
-name = "async-compression"
-version = "0.4.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "103db485efc3e41214fe4fda9f3dbeae2eb9082f48fd236e6095627a9422066e"
-dependencies = [
- "bzip2",
- "deflate64",
- "flate2",
- "futures-core",
- "futures-io",
- "memchr",
- "pin-project-lite",
- "xz2",
- "zstd 0.13.2",
- "zstd-safe 7.2.0",
-]
-
-[[package]]
-name = "async-lock"
-version = "3.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18"
-dependencies = [
- "event-listener",
- "event-listener-strategy",
- "pin-project-lite",
-]
-
-[[package]]
-name = "async-recursion"
-version = "1.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.47",
-]
-
-[[package]]
-name = "async-stream"
-version = "0.3.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51"
-dependencies = [
- "async-stream-impl",
- "futures-core",
- "pin-project-lite",
-]
-
-[[package]]
-name = "async-stream-impl"
-version = "0.3.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.47",
-]
-
-[[package]]
-name = "async-trait"
-version = "0.1.81"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.47",
-]
-
-[[package]]
-name = "async_zip"
-version = "0.0.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "00b9f7252833d5ed4b00aa9604b563529dd5e11de9c23615de2dcdf91eb87b52"
-dependencies = [
- "async-compression",
- "chrono",
- "crc32fast",
- "futures-lite",
- "pin-project",
- "thiserror",
- "tokio",
- "tokio-util",
-]
-
-[[package]]
-name = "atk"
-version = "0.15.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2c3d816ce6f0e2909a96830d6911c2aff044370b1ef92d7f267b43bae5addedd"
-dependencies = [
- "atk-sys",
- "bitflags 1.3.2",
- "glib",
- "libc",
-]
-
-[[package]]
-name = "atk-sys"
-version = "0.15.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "58aeb089fb698e06db8089971c7ee317ab9644bade33383f63631437b03aafb6"
-dependencies = [
- "glib-sys",
- "gobject-sys",
- "libc",
- "system-deps 6.1.1",
-]
-
-[[package]]
-name = "atomic"
-version = "0.5.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c59bdb34bc650a32731b31bd8f0829cc15d24a708ee31559e0bb34f2bc320cba"
-
-[[package]]
-name = "atomic_refcell"
-version = "0.1.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "79d6dc922a2792b006573f60b2648076355daeae5ce9cb59507e5908c9625d31"
-
-[[package]]
-name = "autocfg"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
-
-[[package]]
-name = "backtrace"
-version = "0.3.67"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "233d376d6d185f2a3093e58f283f60f880315b6c60075b01f36b3b85154564ca"
-dependencies = [
- "addr2line",
- "cc",
- "cfg-if",
- "libc",
- "miniz_oxide 0.6.2",
- "object",
- "rustc-demangle",
-]
-
-[[package]]
-name = "base64"
-version = "0.13.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8"
-
-[[package]]
-name = "base64"
-version = "0.21.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9"
-
-[[package]]
-name = "base64"
-version = "0.22.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
-
-[[package]]
-name = "base64ct"
-version = "1.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b"
-
-[[package]]
-name = "bincode"
-version = "1.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad"
-dependencies = [
- "serde",
-]
-
-[[package]]
-name = "bindgen"
-version = "0.69.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0"
-dependencies = [
- "bitflags 2.4.0",
- "cexpr",
- "clang-sys",
- "itertools 0.12.1",
- "lazy_static",
- "lazycell",
- "proc-macro2",
- "quote",
- "regex",
- "rustc-hash",
- "shlex",
- "syn 2.0.47",
-]
-
-[[package]]
-name = "bit-set"
-version = "0.5.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1"
-dependencies = [
- "bit-vec",
-]
-
-[[package]]
-name = "bit-vec"
-version = "0.6.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb"
-
-[[package]]
-name = "bitflags"
-version = "1.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
-
-[[package]]
-name = "bitflags"
-version = "2.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635"
-
-[[package]]
-name = "bitpacking"
-version = "0.9.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4c1d3e2bfd8d06048a179f7b17afc3188effa10385e7b00dc65af6aae732ea92"
-dependencies = [
- "crunchy",
-]
-
-[[package]]
-name = "bitvec"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c"
-dependencies = [
- "funty",
- "radium",
- "tap",
- "wyz",
-]
-
-[[package]]
-name = "block"
-version = "0.1.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a"
-
-[[package]]
-name = "block-buffer"
-version = "0.10.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71"
-dependencies = [
- "generic-array",
-]
-
-[[package]]
-name = "borsh"
-version = "1.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "26d4d6dafc1a3bb54687538972158f07b2c948bc57d5890df22c0739098b3028"
-dependencies = [
- "borsh-derive",
- "cfg_aliases",
-]
-
-[[package]]
-name = "borsh-derive"
-version = "1.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bf4918709cc4dd777ad2b6303ed03cb37f3ca0ccede8c1b0d28ac6db8f4710e0"
-dependencies = [
- "once_cell",
- "proc-macro-crate 2.0.2",
- "proc-macro2",
- "quote",
- "syn 2.0.47",
- "syn_derive",
-]
-
-[[package]]
-name = "brotli"
-version = "3.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "516074a47ef4bce09577a3b379392300159ce5b1ba2e501ff1c819950066100f"
-dependencies = [
- "alloc-no-stdlib",
- "alloc-stdlib",
- "brotli-decompressor",
-]
-
-[[package]]
-name = "brotli-decompressor"
-version = "2.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4e2e4afe60d7dd600fdd3de8d0f08c2b7ec039712e3b6137ff98b7004e82de4f"
-dependencies = [
- "alloc-no-stdlib",
- "alloc-stdlib",
-]
-
-[[package]]
-name = "bstr"
-version = "1.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a246e68bb43f6cd9db24bea052a53e40405417c5fb372e3d1a8a7f770a564ef5"
-dependencies = [
- "memchr",
- "serde",
-]
-
-[[package]]
-name = "bumpalo"
-version = "3.16.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c"
-
-[[package]]
-name = "bytecheck"
-version = "0.6.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8b6372023ac861f6e6dc89c8344a8f398fb42aaba2b5dbc649ca0c0e9dbcb627"
-dependencies = [
- "bytecheck_derive",
- "ptr_meta",
- "simdutf8",
-]
-
-[[package]]
-name = "bytecheck_derive"
-version = "0.6.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a7ec4c6f261935ad534c0c22dbef2201b45918860eb1c574b972bd213a76af61"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 1.0.109",
-]
-
-[[package]]
-name = "bytemuck"
-version = "1.13.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "17febce684fd15d89027105661fec94afb475cb995fbc59d2865198446ba2eea"
-
-[[package]]
-name = "byteorder"
-version = "1.4.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610"
-
-[[package]]
-name = "bytes"
-version = "1.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b"
-dependencies = [
- "serde",
-]
-
-[[package]]
-name = "bzip2"
-version = "0.4.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8"
-dependencies = [
- "bzip2-sys",
- "libc",
-]
-
-[[package]]
-name = "bzip2-sys"
-version = "0.1.11+1.0.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc"
-dependencies = [
- "cc",
- "libc",
- "pkg-config",
-]
-
-[[package]]
-name = "cairo-rs"
-version = "0.15.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c76ee391b03d35510d9fa917357c7f1855bd9a6659c95a1b392e33f49b3369bc"
-dependencies = [
- "bitflags 1.3.2",
- "cairo-sys-rs",
- "glib",
- "libc",
- "thiserror",
-]
-
-[[package]]
-name = "cairo-sys-rs"
-version = "0.15.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3c55d429bef56ac9172d25fecb85dc8068307d17acd74b377866b7a1ef25d3c8"
-dependencies = [
- "glib-sys",
- "libc",
- "system-deps 6.1.1",
-]
-
-[[package]]
-name = "cargo_toml"
-version = "0.15.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "599aa35200ffff8f04c1925aa1acc92fa2e08874379ef42e210a80e527e60838"
-dependencies = [
- "serde",
- "toml 0.7.5",
-]
-
-[[package]]
-name = "cc"
-version = "1.0.79"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f"
-dependencies = [
- "jobserver",
-]
-
-[[package]]
-name = "census"
-version = "0.4.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4f4c707c6a209cbe82d10abd08e1ea8995e9ea937d2550646e02798948992be0"
-
-[[package]]
-name = "cesu8"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c"
-
-[[package]]
-name = "cexpr"
-version = "0.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766"
-dependencies = [
- "nom",
-]
-
-[[package]]
-name = "cfb"
-version = "0.7.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d38f2da7a0a2c4ccf0065be06397cc26a81f4e528be095826eee9d4adbb8c60f"
-dependencies = [
- "byteorder",
- "fnv",
- "uuid",
-]
-
-[[package]]
-name = "cfg-expr"
-version = "0.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3431df59f28accaf4cb4eed4a9acc66bea3f3c3753aa6cdc2f024174ef232af7"
-dependencies = [
- "smallvec",
-]
-
-[[package]]
-name = "cfg-expr"
-version = "0.15.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "215c0072ecc28f92eeb0eea38ba63ddfcb65c2828c46311d646f1a3ff5f9841c"
-dependencies = [
- "smallvec",
- "target-lexicon",
-]
-
-[[package]]
-name = "cfg-if"
-version = "1.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
-
-[[package]]
-name = "cfg_aliases"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e"
-
-[[package]]
-name = "chrono"
-version = "0.4.38"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401"
-dependencies = [
- "android-tzdata",
- "iana-time-zone",
- "js-sys",
- "num-traits",
- "serde",
- "wasm-bindgen",
- "windows-targets 0.52.0",
-]
-
-[[package]]
-name = "chrono-tz"
-version = "0.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "58549f1842da3080ce63002102d5bc954c7bc843d4f47818e642abdc36253552"
-dependencies = [
- "chrono",
- "chrono-tz-build 0.0.2",
- "phf 0.10.1",
-]
-
-[[package]]
-name = "chrono-tz"
-version = "0.8.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cf9cc2b23599e6d7479755f3594285efb3f74a1bdca7a7374948bc831e23a552"
-dependencies = [
- "chrono",
- "chrono-tz-build 0.1.0",
- "phf 0.11.2",
-]
-
-[[package]]
-name = "chrono-tz"
-version = "0.10.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cd6dd8046d00723a59a2f8c5f295c515b9bb9a331ee4f8f3d4dd49e428acd3b6"
-dependencies = [
- "chrono",
- "chrono-tz-build 0.4.0",
- "phf 0.11.2",
-]
-
-[[package]]
-name = "chrono-tz-build"
-version = "0.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "db058d493fb2f65f41861bfed7e3fe6335264a9f0f92710cab5bdf01fef09069"
-dependencies = [
- "parse-zoneinfo",
- "phf 0.10.1",
- "phf_codegen 0.10.0",
-]
-
-[[package]]
-name = "chrono-tz-build"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d9998fb9f7e9b2111641485bf8beb32f92945f97f92a3d061f744cfef335f751"
-dependencies = [
- "parse-zoneinfo",
- "phf 0.11.2",
- "phf_codegen 0.11.2",
-]
-
-[[package]]
-name = "chrono-tz-build"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e94fea34d77a245229e7746bd2beb786cd2a896f306ff491fb8cecb3074b10a7"
-dependencies = [
- "parse-zoneinfo",
- "phf_codegen 0.11.2",
-]
-
-[[package]]
-name = "cipher"
-version = "0.4.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad"
-dependencies = [
- "crypto-common",
- "inout",
-]
-
-[[package]]
-name = "clang-sys"
-version = "1.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f"
-dependencies = [
- "glob",
- "libc",
- "libloading",
-]
-
-[[package]]
-name = "client-api"
-version = "0.2.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ea131f0baab67defe7591067357eced490072372#ea131f0baab67defe7591067357eced490072372"
-dependencies = [
- "again",
- "anyhow",
- "app-error",
- "arc-swap",
- "async-trait",
- "base64 0.22.1",
- "bincode",
- "brotli",
- "bytes",
- "chrono",
- "client-api-entity",
- "client-websocket",
- "collab",
- "collab-rt-entity",
- "collab-rt-protocol",
- "futures",
- "futures-core",
- "futures-util",
- "getrandom 0.2.10",
- "gotrue",
- "infra",
- "lazy_static",
- "md5",
- "mime",
- "mime_guess",
- "parking_lot 0.12.1",
- "percent-encoding",
- "pin-project",
- "prost 0.13.3",
- "rayon",
- "reqwest",
- "scraper 0.17.1",
- "semver",
- "serde",
- "serde_json",
- "serde_repr",
- "serde_urlencoded",
- "shared-entity",
- "thiserror",
- "tokio",
- "tokio-retry",
- "tokio-stream",
- "tokio-util",
- "tracing",
- "url",
- "uuid",
- "wasm-bindgen-futures",
- "yrs",
- "zstd 0.13.2",
-]
-
-[[package]]
-name = "client-api-entity"
-version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ea131f0baab67defe7591067357eced490072372#ea131f0baab67defe7591067357eced490072372"
-dependencies = [
- "collab-entity",
- "collab-rt-entity",
- "database-entity",
- "gotrue-entity",
- "shared-entity",
- "uuid",
-]
-
-[[package]]
-name = "client-websocket"
-version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ea131f0baab67defe7591067357eced490072372#ea131f0baab67defe7591067357eced490072372"
-dependencies = [
- "futures-channel",
- "futures-util",
- "http",
- "httparse",
- "js-sys",
- "percent-encoding",
- "thiserror",
- "tokio",
- "tokio-tungstenite",
- "wasm-bindgen",
- "web-sys",
-]
-
-[[package]]
-name = "cmd_lib"
-version = "1.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0ba0f413777386d37f85afa5242f277a7b461905254c1af3c339d4af06800f62"
-dependencies = [
- "cmd_lib_macros",
- "faccess",
- "lazy_static",
- "log",
- "os_pipe",
-]
-
-[[package]]
-name = "cmd_lib_macros"
-version = "1.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9e66605092ff6c6e37e0246601ae6c3f62dc1880e0599359b5f303497c112dc0"
-dependencies = [
- "proc-macro-error",
- "proc-macro2",
- "quote",
- "syn 1.0.109",
-]
-
-[[package]]
-name = "cocoa"
-version = "0.24.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f425db7937052c684daec3bd6375c8abe2d146dca4b8b143d6db777c39138f3a"
-dependencies = [
- "bitflags 1.3.2",
- "block",
- "cocoa-foundation",
- "core-foundation",
- "core-graphics",
- "foreign-types",
- "libc",
- "objc",
-]
-
-[[package]]
-name = "cocoa-foundation"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "931d3837c286f56e3c58423ce4eba12d08db2374461a785c86f672b08b5650d6"
-dependencies = [
- "bitflags 1.3.2",
- "block",
- "core-foundation",
- "core-graphics-types",
- "foreign-types",
- "libc",
- "objc",
-]
-
-[[package]]
-name = "collab"
-version = "0.2.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=67b31e4bcc64d81332c37efecb0a8618681f1db9#67b31e4bcc64d81332c37efecb0a8618681f1db9"
-dependencies = [
- "anyhow",
- "arc-swap",
- "async-trait",
- "bincode",
- "bytes",
- "chrono",
- "js-sys",
- "lazy_static",
- "serde",
- "serde_json",
- "serde_repr",
- "thiserror",
- "tokio",
- "tokio-stream",
- "tracing",
- "unicode-segmentation",
- "web-sys",
- "yrs",
-]
-
-[[package]]
-name = "collab-database"
-version = "0.2.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=67b31e4bcc64d81332c37efecb0a8618681f1db9#67b31e4bcc64d81332c37efecb0a8618681f1db9"
-dependencies = [
- "anyhow",
- "async-trait",
- "base64 0.22.1",
- "chrono",
- "chrono-tz 0.10.0",
- "collab",
- "collab-entity",
- "csv",
- "dashmap 5.5.3",
- "fancy-regex 0.13.0",
- "futures",
- "getrandom 0.2.10",
- "iana-time-zone",
- "js-sys",
- "lazy_static",
- "nanoid",
- "percent-encoding",
- "rayon",
- "rust_decimal",
- "rusty-money",
- "serde",
- "serde_json",
- "serde_repr",
- "sha2",
- "strum",
- "strum_macros 0.25.2",
- "thiserror",
- "tokio",
- "tokio-stream",
- "tokio-util",
- "tracing",
- "uuid",
- "yrs",
-]
-
-[[package]]
-name = "collab-document"
-version = "0.2.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=67b31e4bcc64d81332c37efecb0a8618681f1db9#67b31e4bcc64d81332c37efecb0a8618681f1db9"
-dependencies = [
- "anyhow",
- "arc-swap",
- "collab",
- "collab-entity",
- "getrandom 0.2.10",
- "markdown",
- "nanoid",
- "serde",
- "serde_json",
- "thiserror",
- "tokio",
- "tokio-stream",
- "tracing",
- "uuid",
-]
-
-[[package]]
-name = "collab-entity"
-version = "0.2.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=67b31e4bcc64d81332c37efecb0a8618681f1db9#67b31e4bcc64d81332c37efecb0a8618681f1db9"
-dependencies = [
- "anyhow",
- "bytes",
- "collab",
- "getrandom 0.2.10",
- "prost 0.13.3",
- "prost-build",
- "protoc-bin-vendored",
- "serde",
- "serde_json",
- "serde_repr",
- "thiserror",
- "uuid",
- "walkdir",
-]
-
-[[package]]
-name = "collab-folder"
-version = "0.2.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=67b31e4bcc64d81332c37efecb0a8618681f1db9#67b31e4bcc64d81332c37efecb0a8618681f1db9"
-dependencies = [
- "anyhow",
- "arc-swap",
- "chrono",
- "collab",
- "collab-entity",
- "dashmap 5.5.3",
- "getrandom 0.2.10",
- "serde",
- "serde_json",
- "serde_repr",
- "thiserror",
- "tokio",
- "tokio-stream",
- "tracing",
- "uuid",
-]
-
-[[package]]
-name = "collab-importer"
-version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=67b31e4bcc64d81332c37efecb0a8618681f1db9#67b31e4bcc64d81332c37efecb0a8618681f1db9"
-dependencies = [
- "anyhow",
- "async-recursion",
- "async-trait",
- "async_zip",
- "base64 0.22.1",
- "chrono",
- "collab",
- "collab-database",
- "collab-document",
- "collab-entity",
- "collab-folder",
- "csv",
- "fancy-regex 0.13.0",
- "futures",
- "futures-lite",
- "futures-util",
- "fxhash",
- "hex",
- "markdown",
- "percent-encoding",
- "rayon",
- "sanitize-filename",
- "serde",
- "serde_json",
- "sha2",
- "thiserror",
- "tokio",
- "tokio-util",
- "tracing",
- "uuid",
- "walkdir",
- "zip 0.6.6",
-]
-
-[[package]]
-name = "collab-integrate"
-version = "0.1.0"
-dependencies = [
- "anyhow",
- "arc-swap",
- "async-trait",
- "collab",
- "collab-database",
- "collab-document",
- "collab-entity",
- "collab-folder",
- "collab-plugins",
- "collab-user",
- "diesel",
- "flowy-error",
- "flowy-sqlite",
- "futures",
- "lib-infra",
- "serde",
- "serde_json",
- "tokio",
- "tracing",
-]
-
-[[package]]
-name = "collab-plugins"
-version = "0.2.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=67b31e4bcc64d81332c37efecb0a8618681f1db9#67b31e4bcc64d81332c37efecb0a8618681f1db9"
-dependencies = [
- "anyhow",
- "async-stream",
- "async-trait",
- "bincode",
- "bytes",
- "chrono",
- "collab",
- "collab-entity",
- "futures",
- "futures-util",
- "getrandom 0.2.10",
- "indexed_db_futures",
- "js-sys",
- "lazy_static",
- "rand 0.8.5",
- "rocksdb",
- "serde",
- "serde_json",
- "similar 2.2.1",
- "smallvec",
- "thiserror",
- "tokio",
- "tokio-retry",
- "tokio-stream",
- "tracing",
- "tracing-wasm",
- "uuid",
- "wasm-bindgen",
- "wasm-bindgen-futures",
- "web-sys",
- "yrs",
-]
-
-[[package]]
-name = "collab-rt-entity"
-version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ea131f0baab67defe7591067357eced490072372#ea131f0baab67defe7591067357eced490072372"
-dependencies = [
- "anyhow",
- "bincode",
- "bytes",
- "chrono",
- "client-websocket",
- "collab",
- "collab-entity",
- "collab-rt-protocol",
- "database-entity",
- "prost 0.13.3",
- "prost-build",
- "protoc-bin-vendored",
- "serde",
- "serde_json",
- "serde_repr",
- "thiserror",
- "tokio-tungstenite",
- "yrs",
-]
-
-[[package]]
-name = "collab-rt-protocol"
-version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ea131f0baab67defe7591067357eced490072372#ea131f0baab67defe7591067357eced490072372"
-dependencies = [
- "anyhow",
- "async-trait",
- "bincode",
- "collab",
- "collab-entity",
- "serde",
- "thiserror",
- "tokio",
- "tracing",
- "yrs",
-]
-
-[[package]]
-name = "collab-user"
-version = "0.2.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=67b31e4bcc64d81332c37efecb0a8618681f1db9#67b31e4bcc64d81332c37efecb0a8618681f1db9"
-dependencies = [
- "anyhow",
- "collab",
- "collab-entity",
- "getrandom 0.2.10",
- "serde",
- "serde_json",
- "tokio",
- "tokio-stream",
- "tracing",
-]
-
-[[package]]
-name = "color_quant"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b"
-
-[[package]]
-name = "combine"
-version = "4.6.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4"
-dependencies = [
- "bytes",
- "memchr",
-]
-
-[[package]]
-name = "concurrent-queue"
-version = "2.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973"
-dependencies = [
- "crossbeam-utils",
-]
-
-[[package]]
-name = "console"
-version = "0.14.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3993e6445baa160675931ec041a5e03ca84b9c6e32a056150d3aa2bdda0a1f45"
-dependencies = [
- "encode_unicode",
- "lazy_static",
- "libc",
- "regex",
- "terminal_size",
- "unicode-width",
- "winapi",
-]
-
-[[package]]
-name = "constant_time_eq"
-version = "0.1.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc"
-
-[[package]]
-name = "constant_time_eq"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2"
-
-[[package]]
-name = "convert_case"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e"
-
-[[package]]
-name = "cookie"
-version = "0.17.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7efb37c3e1ccb1ff97164ad95ac1606e8ccd35b3fa0a7d99a304c7f4a428cc24"
-dependencies = [
- "percent-encoding",
- "time",
- "version_check",
-]
-
-[[package]]
-name = "cookie_store"
-version = "0.20.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "387461abbc748185c3a6e1673d826918b450b87ff22639429c694619a83b6cf6"
-dependencies = [
- "cookie",
- "idna 0.3.0",
- "log",
- "publicsuffix",
- "serde",
- "serde_derive",
- "serde_json",
- "time",
- "url",
-]
-
-[[package]]
-name = "core-foundation"
-version = "0.9.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146"
-dependencies = [
- "core-foundation-sys",
- "libc",
-]
-
-[[package]]
-name = "core-foundation-sys"
-version = "0.8.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa"
-
-[[package]]
-name = "core-graphics"
-version = "0.22.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2581bbab3b8ffc6fcbd550bf46c355135d16e9ff2a6ea032ad6b9bf1d7efe4fb"
-dependencies = [
- "bitflags 1.3.2",
- "core-foundation",
- "core-graphics-types",
- "foreign-types",
- "libc",
-]
-
-[[package]]
-name = "core-graphics-types"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2bb142d41022986c1d8ff29103a1411c8a3dfad3552f87a4f8dc50d61d4f4e33"
-dependencies = [
- "bitflags 1.3.2",
- "core-foundation",
- "libc",
-]
-
-[[package]]
-name = "cpufeatures"
-version = "0.2.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "03e69e28e9f7f77debdedbaafa2866e1de9ba56df55a8bd7cfc724c25a09987c"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "crc"
-version = "3.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "69e6e4d7b33a94f0991c26729976b10ebde1d34c3ee82408fb536164fa10d636"
-dependencies = [
- "crc-catalog",
-]
-
-[[package]]
-name = "crc-catalog"
-version = "2.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5"
-
-[[package]]
-name = "crc32fast"
-version = "1.4.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3"
-dependencies = [
- "cfg-if",
-]
-
-[[package]]
-name = "crossbeam-channel"
-version = "0.5.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200"
-dependencies = [
- "cfg-if",
- "crossbeam-utils",
-]
-
-[[package]]
-name = "crossbeam-deque"
-version = "0.8.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef"
-dependencies = [
- "cfg-if",
- "crossbeam-epoch",
- "crossbeam-utils",
-]
-
-[[package]]
-name = "crossbeam-epoch"
-version = "0.9.15"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7"
-dependencies = [
- "autocfg",
- "cfg-if",
- "crossbeam-utils",
- "memoffset",
- "scopeguard",
-]
-
-[[package]]
-name = "crossbeam-utils"
-version = "0.8.20"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80"
-
-[[package]]
-name = "crunchy"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7"
-
-[[package]]
-name = "crypto-common"
-version = "0.1.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3"
-dependencies = [
- "generic-array",
- "rand_core 0.6.4",
- "typenum",
-]
-
-[[package]]
-name = "cssparser"
-version = "0.27.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "754b69d351cdc2d8ee09ae203db831e005560fc6030da058f86ad60c92a9cb0a"
-dependencies = [
- "cssparser-macros",
- "dtoa-short",
- "itoa 0.4.8",
- "matches",
- "phf 0.8.0",
- "proc-macro2",
- "quote",
- "smallvec",
- "syn 1.0.109",
-]
-
-[[package]]
-name = "cssparser"
-version = "0.31.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5b3df4f93e5fbbe73ec01ec8d3f68bba73107993a5b1e7519273c32db9b0d5be"
-dependencies = [
- "cssparser-macros",
- "dtoa-short",
- "itoa 1.0.6",
- "phf 0.8.0",
- "smallvec",
-]
-
-[[package]]
-name = "cssparser-macros"
-version = "0.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331"
-dependencies = [
- "quote",
- "syn 2.0.47",
-]
-
-[[package]]
-name = "csv"
-version = "1.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ac574ff4d437a7b5ad237ef331c17ccca63c46479e5b5453eb8e10bb99a759fe"
-dependencies = [
- "csv-core",
- "itoa 1.0.6",
- "ryu",
- "serde",
-]
-
-[[package]]
-name = "csv-core"
-version = "0.1.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5efa2b3d7902f4b634a20cae3c9c4e6209dc4779feb6863329607560143efa70"
-dependencies = [
- "memchr",
-]
-
-[[package]]
-name = "ctor"
-version = "0.2.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "30d2b3721e861707777e3195b0158f950ae6dc4a27e4d02ff9f67e3eb3de199e"
-dependencies = [
- "quote",
- "syn 2.0.47",
-]
-
-[[package]]
-name = "ctr"
-version = "0.9.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835"
-dependencies = [
- "cipher",
-]
-
-[[package]]
-name = "darling"
-version = "0.20.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0558d22a7b463ed0241e993f76f09f30b126687447751a8638587b864e4b3944"
-dependencies = [
- "darling_core",
- "darling_macro",
-]
-
-[[package]]
-name = "darling_core"
-version = "0.20.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ab8bfa2e259f8ee1ce5e97824a3c55ec4404a0d772ca7fa96bf19f0752a046eb"
-dependencies = [
- "fnv",
- "ident_case",
- "proc-macro2",
- "quote",
- "strsim 0.10.0",
- "syn 2.0.47",
-]
-
-[[package]]
-name = "darling_macro"
-version = "0.20.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "29a358ff9f12ec09c3e61fef9b5a9902623a695a46a917b07f269bff1445611a"
-dependencies = [
- "darling_core",
- "quote",
- "syn 2.0.47",
-]
-
-[[package]]
-name = "dashmap"
-version = "5.5.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856"
-dependencies = [
- "cfg-if",
- "hashbrown 0.14.3",
- "lock_api",
- "once_cell",
- "parking_lot_core 0.9.8",
-]
-
-[[package]]
-name = "dashmap"
-version = "6.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "804c8821570c3f8b70230c2ba75ffa5c0f9a4189b9a432b6656c536712acae28"
-dependencies = [
- "cfg-if",
- "crossbeam-utils",
- "hashbrown 0.14.3",
- "lock_api",
- "once_cell",
- "parking_lot_core 0.9.8",
-]
-
-[[package]]
-name = "data-encoding"
-version = "2.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308"
-
-[[package]]
-name = "database-entity"
-version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ea131f0baab67defe7591067357eced490072372#ea131f0baab67defe7591067357eced490072372"
-dependencies = [
- "anyhow",
- "app-error",
- "appflowy-ai-client",
- "bincode",
- "bytes",
- "chrono",
- "collab-entity",
- "infra",
- "prost 0.13.3",
- "serde",
- "serde_json",
- "serde_repr",
- "thiserror",
- "tracing",
- "uuid",
- "validator 0.19.0",
-]
-
-[[package]]
-name = "date_time_parser"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f0521d96e513670773ac503e5f5239178c3aef16cffda1e77a3cdbdbe993fb5a"
-dependencies = [
- "chrono",
- "regex",
-]
-
-[[package]]
-name = "deflate64"
-version = "0.1.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "da692b8d1080ea3045efaab14434d40468c3d8657e42abddfffca87b428f4c1b"
-
-[[package]]
-name = "delegate-display"
-version = "2.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "98a85201f233142ac819bbf6226e36d0b5e129a47bd325084674261c82d4cd66"
-dependencies = [
- "macroific",
- "proc-macro2",
- "quote",
- "syn 2.0.47",
-]
-
-[[package]]
-name = "deranged"
-version = "0.3.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4"
-dependencies = [
- "powerfmt",
- "serde",
-]
-
-[[package]]
-name = "derivative"
-version = "2.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 1.0.109",
-]
-
-[[package]]
-name = "derive_arbitrary"
-version = "1.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.47",
-]
-
-[[package]]
-name = "derive_more"
-version = "0.99.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321"
-dependencies = [
- "convert_case",
- "proc-macro2",
- "quote",
- "rustc_version",
- "syn 1.0.109",
-]
-
-[[package]]
-name = "deunicode"
-version = "0.4.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "850878694b7933ca4c9569d30a34b55031b9b139ee1fc7b94a527c4ef960d690"
-
-[[package]]
-name = "diesel"
-version = "2.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "62c6fcf842f17f8c78ecf7c81d75c5ce84436b41ee07e03f490fbb5f5a8731d8"
-dependencies = [
- "chrono",
- "diesel_derives",
- "libsqlite3-sys",
- "r2d2",
- "serde_json",
- "time",
-]
-
-[[package]]
-name = "diesel_derives"
-version = "2.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ef8337737574f55a468005a83499da720f20c65586241ffea339db9ecdfd2b44"
-dependencies = [
- "diesel_table_macro_syntax",
- "proc-macro2",
- "quote",
- "syn 2.0.47",
-]
-
-[[package]]
-name = "diesel_migrations"
-version = "2.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6036b3f0120c5961381b570ee20a02432d7e2d27ea60de9578799cf9156914ac"
-dependencies = [
- "diesel",
- "migrations_internals",
- "migrations_macros",
-]
-
-[[package]]
-name = "diesel_table_macro_syntax"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fc5557efc453706fed5e4fa85006fe9817c224c3f480a34c7e5959fd700921c5"
-dependencies = [
- "syn 2.0.47",
-]
-
-[[package]]
-name = "digest"
-version = "0.10.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
-dependencies = [
- "block-buffer",
- "crypto-common",
- "subtle",
-]
-
-[[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"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1"
-dependencies = [
- "cfg-if",
- "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"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d"
-dependencies = [
- "libc",
- "redox_users",
- "winapi",
-]
-
-[[package]]
-name = "dispatch"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b"
-
-[[package]]
-name = "displaydoc"
-version = "0.2.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.47",
-]
-
-[[package]]
-name = "dotenv"
-version = "0.15.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f"
-
-[[package]]
-name = "downcast-rs"
-version = "1.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650"
-
-[[package]]
-name = "dtoa"
-version = "1.0.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "65d09067bfacaa79114679b279d7f5885b53295b1e2cfb4e79c8e4bd3d633169"
-
-[[package]]
-name = "dtoa-short"
-version = "0.3.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dbaceec3c6e4211c79e7b1800fb9680527106beb2f9c51904a3210c03a448c74"
-dependencies = [
- "dtoa",
-]
-
-[[package]]
-name = "dunce"
-version = "1.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b"
-
-[[package]]
-name = "dyn-clone"
-version = "1.0.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "68b0cf012f1230e43cd00ebb729c6bb58707ecfa8ad08b52ef3a4ccd2697fc30"
-
-[[package]]
-name = "ego-tree"
-version = "0.6.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3a68a4904193147e0a8dec3314640e6db742afd5f6e634f428a6af230d9b3591"
-
-[[package]]
-name = "either"
-version = "1.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91"
-
-[[package]]
-name = "embed-resource"
-version = "2.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "80663502655af01a2902dff3f06869330782267924bf1788410b74edcd93770a"
-dependencies = [
- "cc",
- "rustc_version",
- "toml 0.7.5",
- "vswhom",
- "winreg 0.11.0",
-]
-
-[[package]]
-name = "embed_plist"
-version = "1.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4ef6b89e5b37196644d8796de5268852ff179b44e96276cf4290264843743bb7"
-
-[[package]]
-name = "encode_unicode"
-version = "0.3.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f"
-
-[[package]]
-name = "encoding_rs"
-version = "0.8.32"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394"
-dependencies = [
- "cfg-if",
-]
-
-[[package]]
-name = "equivalent"
-version = "1.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "88bffebc5d80432c9b140ee17875ff173a8ab62faad5b257da912bd2f6c1c0a1"
-
-[[package]]
-name = "errno"
-version = "0.3.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245"
-dependencies = [
- "libc",
- "windows-sys 0.52.0",
-]
-
-[[package]]
-name = "event-listener"
-version = "5.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba"
-dependencies = [
- "concurrent-queue",
- "parking",
- "pin-project-lite",
-]
-
-[[package]]
-name = "event-listener-strategy"
-version = "0.5.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1"
-dependencies = [
- "event-listener",
- "pin-project-lite",
-]
-
-[[package]]
-name = "faccess"
-version = "0.2.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "59ae66425802d6a903e268ae1a08b8c38ba143520f227a205edf4e9c7e3e26d5"
-dependencies = [
- "bitflags 1.3.2",
- "libc",
- "winapi",
-]
-
-[[package]]
-name = "fancy-regex"
-version = "0.10.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0678ab2d46fa5195aaf59ad034c083d351377d4af57f3e073c074d0da3e3c766"
-dependencies = [
- "bit-set",
- "regex",
-]
-
-[[package]]
-name = "fancy-regex"
-version = "0.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b95f7c0680e4142284cf8b22c14a476e87d61b004a3a0861872b32ef7ead40a2"
-dependencies = [
- "bit-set",
- "regex",
-]
-
-[[package]]
-name = "fancy-regex"
-version = "0.13.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "531e46835a22af56d1e3b66f04844bed63158bc094a628bec1d321d9b4c44bf2"
-dependencies = [
- "bit-set",
- "regex-automata 0.4.7",
- "regex-syntax 0.8.4",
-]
-
-[[package]]
-name = "fancy_constructor"
-version = "1.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f71f317e4af73b2f8f608fac190c52eac4b1879d2145df1db2fe48881ca69435"
-dependencies = [
- "macroific",
- "proc-macro2",
- "quote",
- "syn 2.0.47",
-]
-
-[[package]]
-name = "fastdivide"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "25c7df09945d65ea8d70b3321547ed414bbc540aad5bac6883d021b970f35b04"
-
-[[package]]
-name = "fastrand"
-version = "2.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5"
-dependencies = [
- "getrandom 0.2.10",
-]
-
-[[package]]
-name = "fdeflate"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d329bdeac514ee06249dabc27877490f17f5d371ec693360768b838e19f3ae10"
-dependencies = [
- "simd-adler32",
-]
-
-[[package]]
-name = "field-offset"
-version = "0.3.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "38e2275cc4e4fc009b0669731a1e5ab7ebf11f469eaede2bab9309a5b4d6057f"
-dependencies = [
- "memoffset",
- "rustc_version",
-]
-
-[[package]]
-name = "filetime"
-version = "0.2.23"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd"
-dependencies = [
- "cfg-if",
- "libc",
- "redox_syscall 0.4.1",
- "windows-sys 0.52.0",
-]
-
-[[package]]
-name = "fixedbitset"
-version = "0.4.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80"
-
-[[package]]
-name = "flate2"
-version = "1.0.30"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae"
-dependencies = [
- "crc32fast",
- "miniz_oxide 0.7.1",
-]
-
-[[package]]
-name = "flowy-ai"
-version = "0.1.0"
-dependencies = [
- "allo-isolate",
- "anyhow",
- "appflowy-local-ai",
- "appflowy-plugin",
- "arc-swap",
- "base64 0.21.5",
- "bytes",
- "collab-integrate",
- "dashmap 6.0.1",
- "flowy-ai-pub",
- "flowy-codegen",
- "flowy-derive",
- "flowy-error",
- "flowy-notification",
- "flowy-sqlite",
- "flowy-storage-pub",
- "futures",
- "futures-util",
- "lib-dispatch",
- "lib-infra",
- "log",
- "md5",
- "notify",
- "pin-project",
- "protobuf",
- "reqwest",
- "serde",
- "serde_json",
- "sha2",
- "strum_macros 0.21.1",
- "tokio",
- "tokio-stream",
- "tokio-util",
- "tracing",
- "uuid",
- "validator 0.18.1",
- "zip 2.2.0",
- "zip-extensions",
-]
-
-[[package]]
-name = "flowy-ai-pub"
-version = "0.1.0"
-dependencies = [
- "bytes",
- "client-api",
- "flowy-error",
- "futures",
- "lib-infra",
- "serde_json",
-]
-
-[[package]]
-name = "flowy-ast"
-version = "0.1.0"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 1.0.109",
-]
-
-[[package]]
-name = "flowy-codegen"
-version = "0.1.0"
-dependencies = [
- "cmd_lib",
- "console",
- "fancy-regex 0.10.0",
- "flowy-ast",
- "itertools 0.10.5",
- "lazy_static",
- "log",
- "phf 0.8.0",
- "protoc-bin-vendored",
- "protoc-rust",
- "quote",
- "serde",
- "serde_json",
- "similar 1.3.0",
- "syn 1.0.109",
- "tera",
- "toml 0.5.11",
- "walkdir",
-]
-
-[[package]]
-name = "flowy-config"
-version = "0.1.0"
-dependencies = [
- "bytes",
- "flowy-codegen",
- "flowy-derive",
- "flowy-error",
- "flowy-sqlite",
- "lib-dispatch",
- "protobuf",
- "strum_macros 0.21.1",
-]
-
-[[package]]
-name = "flowy-core"
-version = "0.1.0"
-dependencies = [
- "anyhow",
- "appflowy-local-ai",
- "arc-swap",
- "base64 0.21.5",
- "bytes",
- "client-api",
- "collab",
- "collab-entity",
- "collab-folder",
- "collab-integrate",
- "collab-plugins",
- "dashmap 6.0.1",
- "diesel",
- "flowy-ai",
- "flowy-ai-pub",
- "flowy-config",
- "flowy-database-pub",
- "flowy-database2",
- "flowy-date",
- "flowy-document",
- "flowy-document-pub",
- "flowy-error",
- "flowy-folder",
- "flowy-folder-pub",
- "flowy-search",
- "flowy-search-pub",
- "flowy-server",
- "flowy-server-pub",
- "flowy-sqlite",
- "flowy-storage",
- "flowy-storage-pub",
- "flowy-user",
- "flowy-user-pub",
- "futures",
- "futures-core",
- "lib-dispatch",
- "lib-infra",
- "lib-log",
- "semver",
- "serde",
- "serde_json",
- "serde_repr",
- "sysinfo",
- "tokio",
- "tokio-stream",
- "tracing",
- "uuid",
- "walkdir",
-]
-
-[[package]]
-name = "flowy-database-pub"
-version = "0.1.0"
-dependencies = [
- "anyhow",
- "client-api",
- "collab",
- "collab-entity",
- "flowy-error",
- "lib-infra",
-]
-
-[[package]]
-name = "flowy-database2"
-version = "0.1.0"
-dependencies = [
- "anyhow",
- "arc-swap",
- "async-stream",
- "async-trait",
- "bytes",
- "chrono",
- "chrono-tz 0.8.2",
- "collab",
- "collab-database",
- "collab-entity",
- "collab-integrate",
- "collab-plugins",
- "csv",
- "dashmap 6.0.1",
- "fancy-regex 0.11.0",
- "flowy-codegen",
- "flowy-database-pub",
- "flowy-derive",
- "flowy-error",
- "flowy-notification",
- "futures",
- "indexmap 2.1.0",
- "lazy_static",
- "lib-dispatch",
- "lib-infra",
- "moka",
- "nanoid",
- "protobuf",
- "rayon",
- "rust_decimal",
- "rusty-money",
- "serde",
- "serde_json",
- "serde_repr",
- "strum",
- "strum_macros 0.25.2",
- "tokio",
- "tokio-util",
- "tracing",
- "url",
- "validator 0.18.1",
-]
-
-[[package]]
-name = "flowy-date"
-version = "0.1.0"
-dependencies = [
- "bytes",
- "chrono",
- "date_time_parser",
- "fancy-regex 0.11.0",
- "flowy-codegen",
- "flowy-derive",
- "flowy-error",
- "lib-dispatch",
- "protobuf",
- "strum_macros 0.21.1",
- "tracing",
-]
-
-[[package]]
-name = "flowy-derive"
-version = "0.1.0"
-dependencies = [
- "dashmap 6.0.1",
- "flowy-ast",
- "flowy-codegen",
- "lazy_static",
- "proc-macro2",
- "quote",
- "serde_json",
- "syn 1.0.109",
- "walkdir",
-]
-
-[[package]]
-name = "flowy-document"
-version = "0.1.0"
-dependencies = [
- "anyhow",
- "bytes",
- "collab",
- "collab-document",
- "collab-entity",
- "collab-integrate",
- "collab-plugins",
- "dashmap 6.0.1",
- "flowy-codegen",
- "flowy-derive",
- "flowy-document-pub",
- "flowy-error",
- "flowy-notification",
- "flowy-storage-pub",
- "futures",
- "getrandom 0.2.10",
- "indexmap 2.1.0",
- "lib-dispatch",
- "lib-infra",
- "nanoid",
- "protobuf",
- "scraper 0.18.1",
- "serde",
- "serde_json",
- "strum_macros 0.21.1",
- "tokio",
- "tokio-stream",
- "tracing",
- "uuid",
- "validator 0.18.1",
-]
-
-[[package]]
-name = "flowy-document-pub"
-version = "0.1.0"
-dependencies = [
- "anyhow",
- "collab",
- "collab-document",
- "flowy-error",
- "lib-infra",
-]
-
-[[package]]
-name = "flowy-encrypt"
-version = "0.1.0"
-dependencies = [
- "aes-gcm",
- "anyhow",
- "base64 0.21.5",
- "getrandom 0.2.10",
- "hmac",
- "pbkdf2 0.12.2",
- "rand 0.8.5",
- "sha2",
-]
-
-[[package]]
-name = "flowy-error"
-version = "0.1.0"
-dependencies = [
- "anyhow",
- "bytes",
- "client-api",
- "collab",
- "collab-database",
- "collab-document",
- "collab-folder",
- "collab-plugins",
- "fancy-regex 0.11.0",
- "flowy-codegen",
- "flowy-derive",
- "flowy-sqlite",
- "lib-dispatch",
- "protobuf",
- "r2d2",
- "reqwest",
- "serde",
- "serde_json",
- "serde_repr",
- "tantivy",
- "thiserror",
- "tokio",
- "url",
- "validator 0.18.1",
-]
-
-[[package]]
-name = "flowy-folder"
-version = "0.1.0"
-dependencies = [
- "arc-swap",
- "async-trait",
- "bytes",
- "chrono",
- "client-api",
- "collab",
- "collab-document",
- "collab-entity",
- "collab-folder",
- "collab-integrate",
- "collab-plugins",
- "dashmap 6.0.1",
- "flowy-codegen",
- "flowy-derive",
- "flowy-error",
- "flowy-folder-pub",
- "flowy-notification",
- "flowy-search-pub",
- "flowy-sqlite",
- "futures",
- "lazy_static",
- "lib-dispatch",
- "lib-infra",
- "nanoid",
- "protobuf",
- "regex",
- "serde",
- "serde_json",
- "strum_macros 0.21.1",
- "tokio",
- "tokio-stream",
- "tracing",
- "unicode-segmentation",
- "uuid",
- "validator 0.18.1",
-]
-
-[[package]]
-name = "flowy-folder-pub"
-version = "0.1.0"
-dependencies = [
- "anyhow",
- "client-api",
- "collab",
- "collab-entity",
- "collab-folder",
- "flowy-error",
- "lib-infra",
- "serde",
- "serde_json",
- "uuid",
-]
-
-[[package]]
-name = "flowy-notification"
-version = "0.1.0"
-dependencies = [
- "bytes",
- "dashmap 6.0.1",
- "flowy-codegen",
- "flowy-derive",
- "lazy_static",
- "lib-dispatch",
- "protobuf",
- "serde",
- "tokio",
- "tokio-util",
- "tracing",
-]
-
-[[package]]
-name = "flowy-search"
-version = "0.1.0"
-dependencies = [
- "async-stream",
- "bytes",
- "collab",
- "collab-folder",
- "diesel",
- "diesel_derives",
- "diesel_migrations",
- "flowy-codegen",
- "flowy-derive",
- "flowy-error",
- "flowy-folder",
- "flowy-notification",
- "flowy-search-pub",
- "flowy-sqlite",
- "flowy-user",
- "futures",
- "lib-dispatch",
- "lib-infra",
- "protobuf",
- "serde",
- "serde_json",
- "strsim 0.11.0",
- "strum_macros 0.26.1",
- "tantivy",
- "tempfile",
- "tokio",
- "tracing",
- "validator 0.18.1",
-]
-
-[[package]]
-name = "flowy-search-pub"
-version = "0.1.0"
-dependencies = [
- "client-api",
- "collab",
- "collab-folder",
- "flowy-error",
- "futures",
- "lib-infra",
-]
-
-[[package]]
-name = "flowy-server"
-version = "0.1.0"
-dependencies = [
- "anyhow",
- "arc-swap",
- "bytes",
- "chrono",
- "client-api",
- "collab",
- "collab-database",
- "collab-document",
- "collab-entity",
- "collab-folder",
- "collab-plugins",
- "collab-user",
- "dashmap 6.0.1",
- "flowy-ai-pub",
- "flowy-database-pub",
- "flowy-document-pub",
- "flowy-encrypt",
- "flowy-error",
- "flowy-folder-pub",
- "flowy-search-pub",
- "flowy-server-pub",
- "flowy-storage",
- "flowy-storage-pub",
- "flowy-user-pub",
- "futures",
- "futures-util",
- "hex",
- "hyper",
- "lazy_static",
- "lib-dispatch",
- "lib-infra",
- "mime_guess",
- "postgrest",
- "rand 0.8.5",
- "reqwest",
- "semver",
- "serde",
- "serde_json",
- "thiserror",
- "tokio",
- "tokio-retry",
- "tokio-stream",
- "tokio-util",
- "tracing",
- "url",
- "uuid",
- "yrs",
-]
-
-[[package]]
-name = "flowy-server-pub"
-version = "0.1.0"
-dependencies = [
- "flowy-error",
- "serde",
- "serde_repr",
-]
-
-[[package]]
-name = "flowy-sqlite"
-version = "0.1.0"
-dependencies = [
- "anyhow",
- "diesel",
- "diesel_derives",
- "diesel_migrations",
- "libsqlite3-sys",
- "r2d2",
- "scheduled-thread-pool",
- "serde",
- "serde_json",
- "thiserror",
- "tracing",
-]
-
-[[package]]
-name = "flowy-storage"
-version = "0.1.0"
-dependencies = [
- "allo-isolate",
- "anyhow",
- "async-trait",
- "bytes",
- "chrono",
- "collab-importer",
- "dashmap 6.0.1",
- "flowy-codegen",
- "flowy-derive",
- "flowy-error",
- "flowy-notification",
- "flowy-sqlite",
- "flowy-storage-pub",
- "futures-util",
- "fxhash",
- "lib-dispatch",
- "lib-infra",
- "mime_guess",
- "protobuf",
- "serde",
- "serde_json",
- "strum_macros 0.25.2",
- "tokio",
- "tracing",
- "url",
-]
-
-[[package]]
-name = "flowy-storage-pub"
-version = "0.1.0"
-dependencies = [
- "anyhow",
- "async-trait",
- "bytes",
- "client-api-entity",
- "flowy-error",
- "lib-infra",
- "mime",
- "mime_guess",
- "serde",
- "serde_json",
- "tokio",
- "tracing",
-]
-
-[[package]]
-name = "flowy-user"
-version = "0.1.0"
-dependencies = [
- "anyhow",
- "arc-swap",
- "base64 0.21.5",
- "bytes",
- "chrono",
- "client-api",
- "collab",
- "collab-database",
- "collab-document",
- "collab-entity",
- "collab-folder",
- "collab-integrate",
- "collab-plugins",
- "collab-user",
- "dashmap 6.0.1",
- "diesel",
- "diesel_derives",
- "fancy-regex 0.11.0",
- "flowy-codegen",
- "flowy-derive",
- "flowy-encrypt",
- "flowy-error",
- "flowy-folder-pub",
- "flowy-notification",
- "flowy-server-pub",
- "flowy-sqlite",
- "flowy-user-pub",
- "lazy_static",
- "lib-dispatch",
- "lib-infra",
- "once_cell",
- "protobuf",
- "rayon",
- "semver",
- "serde",
- "serde_json",
- "serde_repr",
- "strum",
- "strum_macros 0.25.2",
- "tokio",
- "tokio-stream",
- "tracing",
- "unicode-segmentation",
- "uuid",
- "validator 0.18.1",
-]
-
-[[package]]
-name = "flowy-user-pub"
-version = "0.1.0"
-dependencies = [
- "anyhow",
- "base64 0.21.5",
- "chrono",
- "client-api",
- "collab",
- "collab-entity",
- "collab-folder",
- "flowy-error",
- "flowy-folder-pub",
- "lib-infra",
- "serde",
- "serde_json",
- "serde_repr",
- "tokio",
- "tokio-stream",
- "tracing",
- "uuid",
-]
-
-[[package]]
-name = "fnv"
-version = "1.0.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
-
-[[package]]
-name = "foreign-types"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1"
-dependencies = [
- "foreign-types-shared",
-]
-
-[[package]]
-name = "foreign-types-shared"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
-
-[[package]]
-name = "form_urlencoded"
-version = "1.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456"
-dependencies = [
- "percent-encoding",
-]
-
-[[package]]
-name = "fs4"
-version = "0.8.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f7e180ac76c23b45e767bd7ae9579bc0bb458618c4bc71835926e098e61d15f8"
-dependencies = [
- "rustix",
- "windows-sys 0.52.0",
-]
-
-[[package]]
-name = "fsevent-sys"
-version = "4.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "76ee7a02da4d231650c7cea31349b889be2f45ddb3ef3032d2ec8185f6313fd2"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "funty"
-version = "2.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c"
-
-[[package]]
-name = "futf"
-version = "0.1.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "df420e2e84819663797d1ec6544b13c5be84629e7bb00dc960d6917db2987843"
-dependencies = [
- "mac",
- "new_debug_unreachable",
-]
-
-[[package]]
-name = "futures"
-version = "0.3.30"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0"
-dependencies = [
- "futures-channel",
- "futures-core",
- "futures-executor",
- "futures-io",
- "futures-sink",
- "futures-task",
- "futures-util",
-]
-
-[[package]]
-name = "futures-channel"
-version = "0.3.30"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78"
-dependencies = [
- "futures-core",
- "futures-sink",
-]
-
-[[package]]
-name = "futures-core"
-version = "0.3.30"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d"
-
-[[package]]
-name = "futures-executor"
-version = "0.3.30"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d"
-dependencies = [
- "futures-core",
- "futures-task",
- "futures-util",
-]
-
-[[package]]
-name = "futures-io"
-version = "0.3.30"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1"
-
-[[package]]
-name = "futures-lite"
-version = "2.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5"
-dependencies = [
- "fastrand",
- "futures-core",
- "futures-io",
- "parking",
- "pin-project-lite",
-]
-
-[[package]]
-name = "futures-macro"
-version = "0.3.30"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.47",
-]
-
-[[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"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004"
-
-[[package]]
-name = "futures-util"
-version = "0.3.30"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48"
-dependencies = [
- "futures-channel",
- "futures-core",
- "futures-io",
- "futures-macro",
- "futures-sink",
- "futures-task",
- "memchr",
- "pin-project-lite",
- "pin-utils",
- "slab",
-]
-
-[[package]]
-name = "fxhash"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c"
-dependencies = [
- "byteorder",
-]
-
-[[package]]
-name = "gdk"
-version = "0.15.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a6e05c1f572ab0e1f15be94217f0dc29088c248b14f792a5ff0af0d84bcda9e8"
-dependencies = [
- "bitflags 1.3.2",
- "cairo-rs",
- "gdk-pixbuf",
- "gdk-sys",
- "gio",
- "glib",
- "libc",
- "pango",
-]
-
-[[package]]
-name = "gdk-pixbuf"
-version = "0.15.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ad38dd9cc8b099cceecdf41375bb6d481b1b5a7cd5cd603e10a69a9383f8619a"
-dependencies = [
- "bitflags 1.3.2",
- "gdk-pixbuf-sys",
- "gio",
- "glib",
- "libc",
-]
-
-[[package]]
-name = "gdk-pixbuf-sys"
-version = "0.15.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "140b2f5378256527150350a8346dbdb08fadc13453a7a2d73aecd5fab3c402a7"
-dependencies = [
- "gio-sys",
- "glib-sys",
- "gobject-sys",
- "libc",
- "system-deps 6.1.1",
-]
-
-[[package]]
-name = "gdk-sys"
-version = "0.15.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "32e7a08c1e8f06f4177fb7e51a777b8c1689f743a7bc11ea91d44d2226073a88"
-dependencies = [
- "cairo-sys-rs",
- "gdk-pixbuf-sys",
- "gio-sys",
- "glib-sys",
- "gobject-sys",
- "libc",
- "pango-sys",
- "pkg-config",
- "system-deps 6.1.1",
-]
-
-[[package]]
-name = "gdkwayland-sys"
-version = "0.15.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cca49a59ad8cfdf36ef7330fe7bdfbe1d34323220cc16a0de2679ee773aee2c2"
-dependencies = [
- "gdk-sys",
- "glib-sys",
- "gobject-sys",
- "libc",
- "pkg-config",
- "system-deps 6.1.1",
-]
-
-[[package]]
-name = "gdkx11-sys"
-version = "0.15.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b4b7f8c7a84b407aa9b143877e267e848ff34106578b64d1e0a24bf550716178"
-dependencies = [
- "gdk-sys",
- "glib-sys",
- "libc",
- "system-deps 6.1.1",
- "x11",
-]
-
-[[package]]
-name = "generator"
-version = "0.7.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5cc16584ff22b460a382b7feec54b23d2908d858152e5739a120b949293bd74e"
-dependencies = [
- "cc",
- "libc",
- "log",
- "rustversion",
- "windows 0.48.0",
-]
-
-[[package]]
-name = "generic-array"
-version = "0.14.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a"
-dependencies = [
- "typenum",
- "version_check",
-]
-
-[[package]]
-name = "gethostname"
-version = "0.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c1ebd34e35c46e00bb73e81363248d627782724609fe1b6396f553f68fe3862e"
-dependencies = [
- "libc",
- "winapi",
-]
-
-[[package]]
-name = "getopts"
-version = "0.2.21"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "14dbbfd5c71d70241ecf9e6f13737f7b5ce823821063188d7e46c41d371eebd5"
-dependencies = [
- "unicode-width",
-]
-
-[[package]]
-name = "getrandom"
-version = "0.1.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce"
-dependencies = [
- "cfg-if",
- "libc",
- "wasi 0.9.0+wasi-snapshot-preview1",
-]
-
-[[package]]
-name = "getrandom"
-version = "0.2.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427"
-dependencies = [
- "cfg-if",
- "js-sys",
- "libc",
- "wasi 0.11.0+wasi-snapshot-preview1",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "ghash"
-version = "0.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d930750de5717d2dd0b8c0d42c076c0e884c81a73e6cab859bbd2339c71e3e40"
-dependencies = [
- "opaque-debug",
- "polyval",
-]
-
-[[package]]
-name = "gimli"
-version = "0.27.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e"
-
-[[package]]
-name = "gio"
-version = "0.15.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "68fdbc90312d462781a395f7a16d96a2b379bb6ef8cd6310a2df272771c4283b"
-dependencies = [
- "bitflags 1.3.2",
- "futures-channel",
- "futures-core",
- "futures-io",
- "gio-sys",
- "glib",
- "libc",
- "once_cell",
- "thiserror",
-]
-
-[[package]]
-name = "gio-sys"
-version = "0.15.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "32157a475271e2c4a023382e9cab31c4584ee30a97da41d3c4e9fdd605abcf8d"
-dependencies = [
- "glib-sys",
- "gobject-sys",
- "libc",
- "system-deps 6.1.1",
- "winapi",
-]
-
-[[package]]
-name = "glib"
-version = "0.15.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "edb0306fbad0ab5428b0ca674a23893db909a98582969c9b537be4ced78c505d"
-dependencies = [
- "bitflags 1.3.2",
- "futures-channel",
- "futures-core",
- "futures-executor",
- "futures-task",
- "glib-macros",
- "glib-sys",
- "gobject-sys",
- "libc",
- "once_cell",
- "smallvec",
- "thiserror",
-]
-
-[[package]]
-name = "glib-macros"
-version = "0.15.13"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "10c6ae9f6fa26f4fb2ac16b528d138d971ead56141de489f8111e259b9df3c4a"
-dependencies = [
- "anyhow",
- "heck 0.4.1",
- "proc-macro-crate 1.3.1",
- "proc-macro-error",
- "proc-macro2",
- "quote",
- "syn 1.0.109",
-]
-
-[[package]]
-name = "glib-sys"
-version = "0.15.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ef4b192f8e65e9cf76cbf4ea71fa8e3be4a0e18ffe3d68b8da6836974cc5bad4"
-dependencies = [
- "libc",
- "system-deps 6.1.1",
-]
-
-[[package]]
-name = "glob"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b"
-
-[[package]]
-name = "globset"
-version = "0.4.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "029d74589adefde59de1a0c4f4732695c32805624aec7b68d91503d4dba79afc"
-dependencies = [
- "aho-corasick 0.7.20",
- "bstr",
- "fnv",
- "log",
- "regex",
-]
-
-[[package]]
-name = "globwalk"
-version = "0.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "93e3af942408868f6934a7b85134a3230832b9977cf66125df2f9edcfce4ddcc"
-dependencies = [
- "bitflags 1.3.2",
- "ignore",
- "walkdir",
-]
-
-[[package]]
-name = "gloo-utils"
-version = "0.1.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "037fcb07216cb3a30f7292bd0176b050b7b9a052ba830ef7d5d65f6dc64ba58e"
-dependencies = [
- "js-sys",
- "serde",
- "serde_json",
- "wasm-bindgen",
- "web-sys",
-]
-
-[[package]]
-name = "gobject-sys"
-version = "0.15.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0d57ce44246becd17153bd035ab4d32cfee096a657fc01f2231c9278378d1e0a"
-dependencies = [
- "glib-sys",
- "libc",
- "system-deps 6.1.1",
-]
-
-[[package]]
-name = "gotrue"
-version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ea131f0baab67defe7591067357eced490072372#ea131f0baab67defe7591067357eced490072372"
-dependencies = [
- "anyhow",
- "futures-util",
- "getrandom 0.2.10",
- "gotrue-entity",
- "infra",
- "reqwest",
- "serde",
- "serde_json",
- "tokio",
- "tracing",
-]
-
-[[package]]
-name = "gotrue-entity"
-version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ea131f0baab67defe7591067357eced490072372#ea131f0baab67defe7591067357eced490072372"
-dependencies = [
- "anyhow",
- "app-error",
- "chrono",
- "jsonwebtoken",
- "lazy_static",
- "serde",
- "serde_json",
-]
-
-[[package]]
-name = "gtk"
-version = "0.15.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "92e3004a2d5d6d8b5057d2b57b3712c9529b62e82c77f25c1fecde1fd5c23bd0"
-dependencies = [
- "atk",
- "bitflags 1.3.2",
- "cairo-rs",
- "field-offset",
- "futures-channel",
- "gdk",
- "gdk-pixbuf",
- "gio",
- "glib",
- "gtk-sys",
- "gtk3-macros",
- "libc",
- "once_cell",
- "pango",
- "pkg-config",
-]
-
-[[package]]
-name = "gtk-sys"
-version = "0.15.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d5bc2f0587cba247f60246a0ca11fe25fb733eabc3de12d1965fc07efab87c84"
-dependencies = [
- "atk-sys",
- "cairo-sys-rs",
- "gdk-pixbuf-sys",
- "gdk-sys",
- "gio-sys",
- "glib-sys",
- "gobject-sys",
- "libc",
- "pango-sys",
- "system-deps 6.1.1",
-]
-
-[[package]]
-name = "gtk3-macros"
-version = "0.15.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "684c0456c086e8e7e9af73ec5b84e35938df394712054550e81558d21c44ab0d"
-dependencies = [
- "anyhow",
- "proc-macro-crate 1.3.1",
- "proc-macro-error",
- "proc-macro2",
- "quote",
- "syn 1.0.109",
-]
-
-[[package]]
-name = "h2"
-version = "0.3.20"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "97ec8491ebaf99c8eaa73058b045fe58073cd6be7f596ac993ced0b0a0c01049"
-dependencies = [
- "bytes",
- "fnv",
- "futures-core",
- "futures-sink",
- "futures-util",
- "http",
- "indexmap 1.9.3",
- "slab",
- "tokio",
- "tokio-util",
- "tracing",
-]
-
-[[package]]
-name = "hashbrown"
-version = "0.12.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
-dependencies = [
- "ahash 0.7.6",
-]
-
-[[package]]
-name = "hashbrown"
-version = "0.14.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604"
-dependencies = [
- "ahash 0.8.6",
- "allocator-api2",
-]
-
-[[package]]
-name = "heck"
-version = "0.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c"
-dependencies = [
- "unicode-segmentation",
-]
-
-[[package]]
-name = "heck"
-version = "0.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"
-
-[[package]]
-name = "hermit-abi"
-version = "0.2.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "hex"
-version = "0.4.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
-
-[[package]]
-name = "hmac"
-version = "0.12.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e"
-dependencies = [
- "digest",
-]
-
-[[package]]
-name = "html5ever"
-version = "0.25.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e5c13fb08e5d4dfc151ee5e88bae63f7773d61852f3bdc73c9f4b9e1bde03148"
-dependencies = [
- "log",
- "mac",
- "markup5ever 0.10.1",
- "proc-macro2",
- "quote",
- "syn 1.0.109",
-]
-
-[[package]]
-name = "html5ever"
-version = "0.26.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bea68cab48b8459f17cf1c944c67ddc572d272d9f2b274140f223ecb1da4a3b7"
-dependencies = [
- "log",
- "mac",
- "markup5ever 0.11.0",
- "proc-macro2",
- "quote",
- "syn 1.0.109",
-]
-
-[[package]]
-name = "htmlescape"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e9025058dae765dee5070ec375f591e2ba14638c63feff74f13805a72e523163"
-
-[[package]]
-name = "http"
-version = "0.2.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482"
-dependencies = [
- "bytes",
- "fnv",
- "itoa 1.0.6",
-]
-
-[[package]]
-name = "http-body"
-version = "0.4.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1"
-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.8.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904"
-
-[[package]]
-name = "httpdate"
-version = "1.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421"
-
-[[package]]
-name = "humansize"
-version = "2.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6cb51c9a029ddc91b07a787f1d86b53ccfa49b0e86688c946ebe8d3555685dd7"
-dependencies = [
- "libm",
-]
-
-[[package]]
-name = "hyper"
-version = "0.14.27"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468"
-dependencies = [
- "bytes",
- "futures-channel",
- "futures-core",
- "futures-util",
- "h2",
- "http",
- "http-body",
- "httparse",
- "httpdate",
- "itoa 1.0.6",
- "pin-project-lite",
- "socket2 0.4.9",
- "tokio",
- "tower-service",
- "tracing",
- "want",
-]
-
-[[package]]
-name = "hyper-rustls"
-version = "0.24.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0646026eb1b3eea4cd9ba47912ea5ce9cc07713d105b1a14698f4e6433d348b7"
-dependencies = [
- "http",
- "hyper",
- "rustls",
- "tokio",
- "tokio-rustls",
-]
-
-[[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.61"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220"
-dependencies = [
- "android_system_properties",
- "core-foundation-sys",
- "iana-time-zone-haiku",
- "js-sys",
- "wasm-bindgen",
- "windows-core",
-]
-
-[[package]]
-name = "iana-time-zone-haiku"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f"
-dependencies = [
- "cc",
-]
-
-[[package]]
-name = "ico"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e3804960be0bb5e4edb1e1ad67afd321a9ecfd875c3e65c099468fd2717d7cae"
-dependencies = [
- "byteorder",
- "png",
-]
-
-[[package]]
-name = "icu_collections"
-version = "1.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526"
-dependencies = [
- "displaydoc",
- "yoke",
- "zerofrom",
- "zerovec",
-]
-
-[[package]]
-name = "icu_locid"
-version = "1.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637"
-dependencies = [
- "displaydoc",
- "litemap",
- "tinystr",
- "writeable",
- "zerovec",
-]
-
-[[package]]
-name = "icu_locid_transform"
-version = "1.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e"
-dependencies = [
- "displaydoc",
- "icu_locid",
- "icu_locid_transform_data",
- "icu_provider",
- "tinystr",
- "zerovec",
-]
-
-[[package]]
-name = "icu_locid_transform_data"
-version = "1.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e"
-
-[[package]]
-name = "icu_normalizer"
-version = "1.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f"
-dependencies = [
- "displaydoc",
- "icu_collections",
- "icu_normalizer_data",
- "icu_properties",
- "icu_provider",
- "smallvec",
- "utf16_iter",
- "utf8_iter",
- "write16",
- "zerovec",
-]
-
-[[package]]
-name = "icu_normalizer_data"
-version = "1.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516"
-
-[[package]]
-name = "icu_properties"
-version = "1.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5"
-dependencies = [
- "displaydoc",
- "icu_collections",
- "icu_locid_transform",
- "icu_properties_data",
- "icu_provider",
- "tinystr",
- "zerovec",
-]
-
-[[package]]
-name = "icu_properties_data"
-version = "1.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569"
-
-[[package]]
-name = "icu_provider"
-version = "1.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9"
-dependencies = [
- "displaydoc",
- "icu_locid",
- "icu_provider_macros",
- "stable_deref_trait",
- "tinystr",
- "writeable",
- "yoke",
- "zerofrom",
- "zerovec",
-]
-
-[[package]]
-name = "icu_provider_macros"
-version = "1.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.47",
-]
-
-[[package]]
-name = "ident_case"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
-
-[[package]]
-name = "idna"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6"
-dependencies = [
- "unicode-bidi",
- "unicode-normalization",
-]
-
-[[package]]
-name = "idna"
-version = "0.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6"
-dependencies = [
- "unicode-bidi",
- "unicode-normalization",
-]
-
-[[package]]
-name = "idna"
-version = "1.0.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e"
-dependencies = [
- "idna_adapter",
- "smallvec",
- "utf8_iter",
-]
-
-[[package]]
-name = "idna_adapter"
-version = "1.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71"
-dependencies = [
- "icu_normalizer",
- "icu_properties",
-]
-
-[[package]]
-name = "ignore"
-version = "0.4.20"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dbe7873dab538a9a44ad79ede1faf5f30d49f9a5c883ddbab48bce81b64b7492"
-dependencies = [
- "globset",
- "lazy_static",
- "log",
- "memchr",
- "regex",
- "same-file",
- "thread_local",
- "walkdir",
- "winapi-util",
-]
-
-[[package]]
-name = "image"
-version = "0.24.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "527909aa81e20ac3a44803521443a765550f09b5130c2c2fa1ea59c2f8f50a3a"
-dependencies = [
- "bytemuck",
- "byteorder",
- "color_quant",
- "num-rational",
- "num-traits",
-]
-
-[[package]]
-name = "indexed_db_futures"
-version = "0.4.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0704b71f13f81b5933d791abf2de26b33c40935143985220299a357721166706"
-dependencies = [
- "accessory",
- "cfg-if",
- "delegate-display",
- "fancy_constructor",
- "js-sys",
- "uuid",
- "wasm-bindgen",
- "wasm-bindgen-futures",
- "web-sys",
-]
-
-[[package]]
-name = "indexmap"
-version = "1.9.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99"
-dependencies = [
- "autocfg",
- "hashbrown 0.12.3",
- "serde",
-]
-
-[[package]]
-name = "indexmap"
-version = "2.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f"
-dependencies = [
- "equivalent",
- "hashbrown 0.14.3",
- "serde",
-]
-
-[[package]]
-name = "infer"
-version = "0.13.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f551f8c3a39f68f986517db0d1759de85881894fdc7db798bd2a9df9cb04b7fc"
-dependencies = [
- "cfb",
-]
-
-[[package]]
-name = "infra"
-version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ea131f0baab67defe7591067357eced490072372#ea131f0baab67defe7591067357eced490072372"
-dependencies = [
- "anyhow",
- "bytes",
- "futures",
- "pin-project",
- "reqwest",
- "serde",
- "serde_json",
- "tokio",
- "tracing",
- "validator 0.19.0",
-]
-
-[[package]]
-name = "inotify"
-version = "0.9.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f8069d3ec154eb856955c1c0fbffefbf5f3c40a104ec912d4797314c1801abff"
-dependencies = [
- "bitflags 1.3.2",
- "inotify-sys",
- "libc",
-]
-
-[[package]]
-name = "inotify-sys"
-version = "0.1.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e05c02b5e89bff3b946cedeca278abc628fe811e604f027c45a8aa3cf793d0eb"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "inout"
-version = "0.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5"
-dependencies = [
- "generic-array",
-]
-
-[[package]]
-name = "instant"
-version = "0.1.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c"
-dependencies = [
- "cfg-if",
- "js-sys",
- "wasm-bindgen",
- "web-sys",
-]
-
-[[package]]
-name = "interprocess"
-version = "1.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "81f2533f3be42fffe3b5e63b71aeca416c1c3bc33e4e27be018521e76b1f38fb"
-dependencies = [
- "cfg-if",
- "libc",
- "rustc_version",
- "to_method",
- "winapi",
-]
-
-[[package]]
-name = "ipnet"
-version = "2.8.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6"
-
-[[package]]
-name = "itertools"
-version = "0.10.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473"
-dependencies = [
- "either",
-]
-
-[[package]]
-name = "itertools"
-version = "0.12.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569"
-dependencies = [
- "either",
-]
-
-[[package]]
-name = "itoa"
-version = "0.4.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4"
-
-[[package]]
-name = "itoa"
-version = "1.0.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6"
-
-[[package]]
-name = "javascriptcore-rs"
-version = "0.16.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bf053e7843f2812ff03ef5afe34bb9c06ffee120385caad4f6b9967fcd37d41c"
-dependencies = [
- "bitflags 1.3.2",
- "glib",
- "javascriptcore-rs-sys",
-]
-
-[[package]]
-name = "javascriptcore-rs-sys"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "905fbb87419c5cde6e3269537e4ea7d46431f3008c5d057e915ef3f115e7793c"
-dependencies = [
- "glib-sys",
- "gobject-sys",
- "libc",
- "system-deps 5.0.0",
-]
-
-[[package]]
-name = "jni"
-version = "0.20.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "039022cdf4d7b1cf548d31f60ae783138e5fd42013f6271049d7df7afadef96c"
-dependencies = [
- "cesu8",
- "combine",
- "jni-sys",
- "log",
- "thiserror",
- "walkdir",
-]
-
-[[package]]
-name = "jni-sys"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130"
-
-[[package]]
-name = "jobserver"
-version = "0.1.26"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "js-sys"
-version = "0.3.67"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1"
-dependencies = [
- "wasm-bindgen",
-]
-
-[[package]]
-name = "json-patch"
-version = "1.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "55ff1e1486799e3f64129f8ccad108b38290df9cd7015cd31bed17239f0789d6"
-dependencies = [
- "serde",
- "serde_json",
- "thiserror",
- "treediff",
-]
-
-[[package]]
-name = "jsonwebtoken"
-version = "8.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6971da4d9c3aa03c3d8f3ff0f4155b534aad021292003895a469716b2a230378"
-dependencies = [
- "base64 0.21.5",
- "pem",
- "ring",
- "serde",
- "serde_json",
- "simple_asn1",
-]
-
-[[package]]
-name = "kqueue"
-version = "1.0.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7447f1ca1b7b563588a205fe93dea8df60fd981423a768bc1c0ded35ed147d0c"
-dependencies = [
- "kqueue-sys",
- "libc",
-]
-
-[[package]]
-name = "kqueue-sys"
-version = "1.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ed9625ffda8729b85e45cf04090035ac368927b8cebc34898e7c120f52e4838b"
-dependencies = [
- "bitflags 1.3.2",
- "libc",
-]
-
-[[package]]
-name = "kuchiki"
-version = "0.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1ea8e9c6e031377cff82ee3001dc8026cdf431ed4e2e6b51f98ab8c73484a358"
-dependencies = [
- "cssparser 0.27.2",
- "html5ever 0.25.2",
- "matches",
- "selectors 0.22.0",
-]
-
-[[package]]
-name = "kuchikiki"
-version = "0.8.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f29e4755b7b995046f510a7520c42b2fed58b77bd94d5a87a8eb43d2fd126da8"
-dependencies = [
- "cssparser 0.27.2",
- "html5ever 0.26.0",
- "indexmap 1.9.3",
- "matches",
- "selectors 0.22.0",
-]
-
-[[package]]
-name = "lazy_static"
-version = "1.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
-
-[[package]]
-name = "lazycell"
-version = "1.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
-
-[[package]]
-name = "levenshtein_automata"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0c2cdeb66e45e9f36bfad5bbdb4d2384e70936afbee843c6f6543f0c551ebb25"
-
-[[package]]
-name = "lib-dispatch"
-version = "0.1.0"
-dependencies = [
- "bincode",
- "bytes",
- "derivative",
- "dyn-clone",
- "futures",
- "futures-channel",
- "futures-core",
- "futures-util",
- "getrandom 0.2.10",
- "nanoid",
- "pin-project",
- "protobuf",
- "serde",
- "serde_json",
- "serde_repr",
- "thread-id",
- "tokio",
- "tracing",
- "validator 0.18.1",
- "wasm-bindgen",
- "wasm-bindgen-futures",
-]
-
-[[package]]
-name = "lib-infra"
-version = "0.1.0"
-dependencies = [
- "allo-isolate",
- "anyhow",
- "async-trait",
- "atomic_refcell",
- "bytes",
- "cfg-if",
- "chrono",
- "futures",
- "futures-core",
- "futures-util",
- "md5",
- "pin-project",
- "tempfile",
- "tokio",
- "tracing",
- "validator 0.18.1",
- "walkdir",
- "zip 2.2.0",
-]
-
-[[package]]
-name = "lib-log"
-version = "0.1.0"
-dependencies = [
- "chrono",
- "lazy_static",
- "lib-infra",
- "serde",
- "serde_json",
- "tracing",
- "tracing-appender",
- "tracing-bunyan-formatter",
- "tracing-core",
- "tracing-subscriber",
-]
-
-[[package]]
-name = "libc"
-version = "0.2.152"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7"
-
-[[package]]
-name = "libloading"
-version = "0.7.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f"
-dependencies = [
- "cfg-if",
- "winapi",
-]
-
-[[package]]
-name = "libm"
-version = "0.2.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4"
-
-[[package]]
-name = "librocksdb-sys"
-version = "0.16.0+8.10.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ce3d60bc059831dc1c83903fb45c103f75db65c5a7bf22272764d9cc683e348c"
-dependencies = [
- "bindgen",
- "bzip2-sys",
- "cc",
- "glob",
- "libc",
- "libz-sys",
- "zstd-sys",
-]
-
-[[package]]
-name = "libsqlite3-sys"
-version = "0.27.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cf4e226dcd58b4be396f7bd3c20da8fdee2911400705297ba7d2d7cc2c30f716"
-dependencies = [
- "cc",
- "pkg-config",
- "vcpkg",
-]
-
-[[package]]
-name = "libz-sys"
-version = "1.1.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "56ee889ecc9568871456d42f603d6a0ce59ff328d291063a45cbdf0036baf6db"
-dependencies = [
- "cc",
- "pkg-config",
- "vcpkg",
-]
-
-[[package]]
-name = "line-wrap"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f30344350a2a51da54c1d53be93fade8a237e545dbcc4bdbe635413f2117cab9"
-dependencies = [
- "safemem",
-]
-
-[[package]]
-name = "linux-raw-sys"
-version = "0.4.13"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c"
-
-[[package]]
-name = "litemap"
-version = "0.7.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104"
-
-[[package]]
-name = "lock_api"
-version = "0.4.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16"
-dependencies = [
- "autocfg",
- "scopeguard",
-]
-
-[[package]]
-name = "lockfree-object-pool"
-version = "0.1.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9374ef4228402d4b7e403e5838cb880d9ee663314b0a900d5a6aabf0c213552e"
-
-[[package]]
-name = "log"
-version = "0.4.21"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c"
-
-[[package]]
-name = "loom"
-version = "0.5.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ff50ecb28bb86013e935fb6683ab1f6d3a20016f123c76fd4c27470076ac30f5"
-dependencies = [
- "cfg-if",
- "generator",
- "pin-utils",
- "scoped-tls",
- "serde",
- "serde_json",
- "tracing",
- "tracing-subscriber",
-]
-
-[[package]]
-name = "lru"
-version = "0.12.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc"
-dependencies = [
- "hashbrown 0.14.3",
-]
-
-[[package]]
-name = "lz4_flex"
-version = "0.11.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "912b45c753ff5f7f5208307e8ace7d2a2e30d024e26d3509f3dce546c044ce15"
-
-[[package]]
-name = "lzma-rs"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "297e814c836ae64db86b36cf2a557ba54368d03f6afcd7d947c266692f71115e"
-dependencies = [
- "byteorder",
- "crc",
-]
-
-[[package]]
-name = "lzma-sys"
-version = "0.1.20"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5fda04ab3764e6cde78b9974eec4f779acaba7c4e84b36eca3cf77c581b85d27"
-dependencies = [
- "cc",
- "libc",
- "pkg-config",
-]
-
-[[package]]
-name = "mac"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4"
-
-[[package]]
-name = "macroific"
-version = "1.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f05c00ac596022625d01047c421a0d97d7f09a18e429187b341c201cb631b9dd"
-dependencies = [
- "macroific_attr_parse",
- "macroific_core",
- "macroific_macro",
-]
-
-[[package]]
-name = "macroific_attr_parse"
-version = "1.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fd94d5da95b30ae6e10621ad02340909346ad91661f3f8c0f2b62345e46a2f67"
-dependencies = [
- "cfg-if",
- "proc-macro2",
- "quote",
- "syn 2.0.47",
-]
-
-[[package]]
-name = "macroific_core"
-version = "1.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "13198c120864097a565ccb3ff947672d969932b7975ebd4085732c9f09435e55"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.47",
-]
-
-[[package]]
-name = "macroific_macro"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b0c9853143cbed7f1e41dc39fee95f9b361bec65c8dc2a01bf609be01b61f5ae"
-dependencies = [
- "macroific_attr_parse",
- "macroific_core",
- "proc-macro2",
- "quote",
- "syn 2.0.47",
-]
-
-[[package]]
-name = "malloc_buf"
-version = "0.0.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "markdown"
-version = "1.0.0-alpha.21"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a6491e6c702bf7e3b24e769d800746d5f2c06a6c6a2db7992612e0f429029e81"
-dependencies = [
- "unicode-id",
-]
-
-[[package]]
-name = "markup5ever"
-version = "0.10.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a24f40fb03852d1cdd84330cddcaf98e9ec08a7b7768e952fad3b4cf048ec8fd"
-dependencies = [
- "log",
- "phf 0.8.0",
- "phf_codegen 0.8.0",
- "string_cache",
- "string_cache_codegen",
- "tendril",
-]
-
-[[package]]
-name = "markup5ever"
-version = "0.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7a2629bb1404f3d34c2e921f21fd34ba00b206124c81f65c50b43b6aaefeb016"
-dependencies = [
- "log",
- "phf 0.10.1",
- "phf_codegen 0.10.0",
- "string_cache",
- "string_cache_codegen",
- "tendril",
-]
-
-[[package]]
-name = "matchers"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558"
-dependencies = [
- "regex-automata 0.1.10",
-]
-
-[[package]]
-name = "matches"
-version = "0.1.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5"
-
-[[package]]
-name = "md5"
-version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771"
-
-[[package]]
-name = "measure_time"
-version = "0.8.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "56220900f1a0923789ecd6bf25fbae8af3b2f1ff3e9e297fc9b6b8674dd4d852"
-dependencies = [
- "instant",
- "log",
-]
-
-[[package]]
-name = "memchr"
-version = "2.7.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
-
-[[package]]
-name = "memmap2"
-version = "0.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fe751422e4a8caa417e13c3ea66452215d7d63e19e604f4980461212f3ae1322"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "memoffset"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c"
-dependencies = [
- "autocfg",
-]
-
-[[package]]
-name = "migrations_internals"
-version = "2.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0f23f71580015254b020e856feac3df5878c2c7a8812297edd6c0a485ac9dada"
-dependencies = [
- "serde",
- "toml 0.7.5",
-]
-
-[[package]]
-name = "migrations_macros"
-version = "2.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cce3325ac70e67bbab5bd837a31cae01f1a6db64e0e744a33cb03a543469ef08"
-dependencies = [
- "migrations_internals",
- "proc-macro2",
- "quote",
-]
-
-[[package]]
-name = "mime"
-version = "0.3.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a"
-
-[[package]]
-name = "mime_guess"
-version = "2.0.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e"
-dependencies = [
- "mime",
- "unicase",
-]
-
-[[package]]
-name = "minimal-lexical"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
-
-[[package]]
-name = "miniz_oxide"
-version = "0.6.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa"
-dependencies = [
- "adler",
-]
-
-[[package]]
-name = "miniz_oxide"
-version = "0.7.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7"
-dependencies = [
- "adler",
- "simd-adler32",
-]
-
-[[package]]
-name = "mio"
-version = "0.8.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0"
-dependencies = [
- "libc",
- "log",
- "wasi 0.11.0+wasi-snapshot-preview1",
- "windows-sys 0.48.0",
-]
-
-[[package]]
-name = "moka"
-version = "0.12.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "32cf62eb4dd975d2dde76432fb1075c49e3ee2331cf36f1f8fd4b66550d32b6f"
-dependencies = [
- "async-lock",
- "async-trait",
- "crossbeam-channel",
- "crossbeam-epoch",
- "crossbeam-utils",
- "event-listener",
- "futures-util",
- "once_cell",
- "parking_lot 0.12.1",
- "quanta",
- "rustc_version",
- "smallvec",
- "tagptr",
- "thiserror",
- "triomphe",
- "uuid",
-]
-
-[[package]]
-name = "multimap"
-version = "0.8.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a"
-
-[[package]]
-name = "murmurhash32"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d9380db4c04d219ac5c51d14996bbf2c2e9a15229771b53f8671eb6c83cf44df"
-
-[[package]]
-name = "nanoid"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3ffa00dec017b5b1a8b7cf5e2c008bfda1aa7e0697ac1508b491fdf2622fb4d8"
-dependencies = [
- "rand 0.8.5",
-]
-
-[[package]]
-name = "native-tls"
-version = "0.2.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e"
-dependencies = [
- "lazy_static",
- "libc",
- "log",
- "openssl",
- "openssl-probe",
- "openssl-sys",
- "schannel",
- "security-framework",
- "security-framework-sys",
- "tempfile",
-]
-
-[[package]]
-name = "ndk"
-version = "0.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2032c77e030ddee34a6787a64166008da93f6a352b629261d0fee232b8742dd4"
-dependencies = [
- "bitflags 1.3.2",
- "jni-sys",
- "ndk-sys",
- "num_enum",
- "thiserror",
-]
-
-[[package]]
-name = "ndk-context"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b"
-
-[[package]]
-name = "ndk-sys"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6e5a6ae77c8ee183dcbbba6150e2e6b9f3f4196a7666c02a715a95692ec1fa97"
-dependencies = [
- "jni-sys",
-]
-
-[[package]]
-name = "new_debug_unreachable"
-version = "1.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54"
-
-[[package]]
-name = "nodrop"
-version = "0.1.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb"
-
-[[package]]
-name = "nom"
-version = "7.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a"
-dependencies = [
- "memchr",
- "minimal-lexical",
-]
-
-[[package]]
-name = "notify"
-version = "6.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6205bd8bb1e454ad2e27422015fb5e4f2bcc7e08fa8f27058670d208324a4d2d"
-dependencies = [
- "bitflags 2.4.0",
- "crossbeam-channel",
- "filetime",
- "fsevent-sys",
- "inotify",
- "kqueue",
- "libc",
- "log",
- "mio",
- "walkdir",
- "windows-sys 0.48.0",
-]
-
-[[package]]
-name = "ntapi"
-version = "0.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e8a3895c6391c39d7fe7ebc444a87eb2991b2a0bc718fdabd071eec617fc68e4"
-dependencies = [
- "winapi",
-]
-
-[[package]]
-name = "nu-ansi-term"
-version = "0.46.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84"
-dependencies = [
- "overload",
- "winapi",
-]
-
-[[package]]
-name = "num-bigint"
-version = "0.4.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f"
-dependencies = [
- "autocfg",
- "num-integer",
- "num-traits",
-]
-
-[[package]]
-name = "num-conv"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9"
-
-[[package]]
-name = "num-integer"
-version = "0.1.45"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9"
-dependencies = [
- "autocfg",
- "num-traits",
-]
-
-[[package]]
-name = "num-rational"
-version = "0.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0"
-dependencies = [
- "autocfg",
- "num-integer",
- "num-traits",
-]
-
-[[package]]
-name = "num-traits"
-version = "0.2.15"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd"
-dependencies = [
- "autocfg",
- "libm",
-]
-
-[[package]]
-name = "num_cpus"
-version = "1.15.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b"
-dependencies = [
- "hermit-abi",
- "libc",
-]
-
-[[package]]
-name = "num_enum"
-version = "0.5.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9"
-dependencies = [
- "num_enum_derive",
-]
-
-[[package]]
-name = "num_enum_derive"
-version = "0.5.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799"
-dependencies = [
- "proc-macro-crate 1.3.1",
- "proc-macro2",
- "quote",
- "syn 1.0.109",
-]
-
-[[package]]
-name = "objc"
-version = "0.2.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1"
-dependencies = [
- "malloc_buf",
- "objc_exception",
-]
-
-[[package]]
-name = "objc-foundation"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1add1b659e36c9607c7aab864a76c7a4c2760cd0cd2e120f3fb8b952c7e22bf9"
-dependencies = [
- "block",
- "objc",
- "objc_id",
-]
-
-[[package]]
-name = "objc-sys"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c7c71324e4180d0899963fc83d9d241ac39e699609fc1025a850aadac8257459"
-
-[[package]]
-name = "objc2"
-version = "0.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "559c5a40fdd30eb5e344fbceacf7595a81e242529fb4e21cf5f43fb4f11ff98d"
-dependencies = [
- "objc-sys",
- "objc2-encode",
-]
-
-[[package]]
-name = "objc2-encode"
-version = "3.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d079845b37af429bfe5dfa76e6d087d788031045b25cfc6fd898486fd9847666"
-
-[[package]]
-name = "objc_exception"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ad970fb455818ad6cba4c122ad012fae53ae8b4795f86378bce65e4f6bab2ca4"
-dependencies = [
- "cc",
-]
-
-[[package]]
-name = "objc_id"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c92d4ddb4bd7b50d730c215ff871754d0da6b2178849f8a2a2ab69712d0c073b"
-dependencies = [
- "objc",
-]
-
-[[package]]
-name = "object"
-version = "0.30.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "03b4680b86d9cfafba8fc491dc9b6df26b68cf40e9e6cd73909194759a63c385"
-dependencies = [
- "memchr",
-]
-
-[[package]]
-name = "once_cell"
-version = "1.19.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
-
-[[package]]
-name = "oneshot"
-version = "0.1.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6f6640c6bda7731b1fdbab747981a0f896dd1fedaf9f4a53fa237a04a84431f4"
-dependencies = [
- "loom",
-]
-
-[[package]]
-name = "opaque-debug"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
-
-[[package]]
-name = "open"
-version = "3.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2078c0039e6a54a0c42c28faa984e115fb4c2d5bf2208f77d1961002df8576f8"
-dependencies = [
- "pathdiff",
- "windows-sys 0.42.0",
-]
-
-[[package]]
-name = "openssl"
-version = "0.10.55"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "345df152bc43501c5eb9e4654ff05f794effb78d4efe3d53abc158baddc0703d"
-dependencies = [
- "bitflags 1.3.2",
- "cfg-if",
- "foreign-types",
- "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.47",
-]
-
-[[package]]
-name = "openssl-probe"
-version = "0.1.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf"
-
-[[package]]
-name = "openssl-src"
-version = "111.27.0+1.1.1v"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "06e8f197c82d7511c5b014030c9b1efeda40d7d5f99d23b4ceed3524a5e63f02"
-dependencies = [
- "cc",
-]
-
-[[package]]
-name = "openssl-sys"
-version = "0.9.90"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "374533b0e45f3a7ced10fcaeccca020e66656bc03dac384f852e4e5a7a8104a6"
-dependencies = [
- "cc",
- "libc",
- "openssl-src",
- "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_pipe"
-version = "0.9.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fb233f06c2307e1f5ce2ecad9f8121cffbbee2c95428f44ea85222e460d0d213"
-dependencies = [
- "libc",
- "winapi",
-]
-
-[[package]]
-name = "overload"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39"
-
-[[package]]
-name = "ownedbytes"
-version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c3a059efb063b8f425b948e042e6b9bd85edfe60e913630ed727b23e2dfcc558"
-dependencies = [
- "stable_deref_trait",
-]
-
-[[package]]
-name = "pango"
-version = "0.15.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "22e4045548659aee5313bde6c582b0d83a627b7904dd20dc2d9ef0895d414e4f"
-dependencies = [
- "bitflags 1.3.2",
- "glib",
- "libc",
- "once_cell",
- "pango-sys",
-]
-
-[[package]]
-name = "pango-sys"
-version = "0.15.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d2a00081cde4661982ed91d80ef437c20eacaf6aa1a5962c0279ae194662c3aa"
-dependencies = [
- "glib-sys",
- "gobject-sys",
- "libc",
- "system-deps 6.1.1",
-]
-
-[[package]]
-name = "parking"
-version = "2.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae"
-
-[[package]]
-name = "parking_lot"
-version = "0.11.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99"
-dependencies = [
- "instant",
- "lock_api",
- "parking_lot_core 0.8.6",
-]
-
-[[package]]
-name = "parking_lot"
-version = "0.12.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f"
-dependencies = [
- "lock_api",
- "parking_lot_core 0.9.8",
-]
-
-[[package]]
-name = "parking_lot_core"
-version = "0.8.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc"
-dependencies = [
- "cfg-if",
- "instant",
- "libc",
- "redox_syscall 0.2.16",
- "smallvec",
- "winapi",
-]
-
-[[package]]
-name = "parking_lot_core"
-version = "0.9.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447"
-dependencies = [
- "cfg-if",
- "libc",
- "redox_syscall 0.3.5",
- "smallvec",
- "windows-targets 0.48.0",
-]
-
-[[package]]
-name = "parse-zoneinfo"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c705f256449c60da65e11ff6626e0c16a0a0b96aaa348de61376b249bc340f41"
-dependencies = [
- "regex",
-]
-
-[[package]]
-name = "password-hash"
-version = "0.4.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700"
-dependencies = [
- "base64ct",
- "rand_core 0.6.4",
- "subtle",
-]
-
-[[package]]
-name = "pathdiff"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd"
-
-[[package]]
-name = "pbkdf2"
-version = "0.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917"
-dependencies = [
- "digest",
- "hmac",
- "password-hash",
- "sha2",
-]
-
-[[package]]
-name = "pbkdf2"
-version = "0.12.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2"
-dependencies = [
- "digest",
- "hmac",
-]
-
-[[package]]
-name = "pem"
-version = "1.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a8835c273a76a90455d7344889b0964598e3316e2a79ede8e36f16bdcf2228b8"
-dependencies = [
- "base64 0.13.1",
-]
-
-[[package]]
-name = "percent-encoding"
-version = "2.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e"
-
-[[package]]
-name = "pest"
-version = "2.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f73935e4d55e2abf7f130186537b19e7a4abc886a0252380b59248af473a3fc9"
-dependencies = [
- "thiserror",
- "ucd-trie",
-]
-
-[[package]]
-name = "pest_derive"
-version = "2.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "aef623c9bbfa0eedf5a0efba11a5ee83209c326653ca31ff019bec3a95bfff2b"
-dependencies = [
- "pest",
- "pest_generator",
-]
-
-[[package]]
-name = "pest_generator"
-version = "2.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b3e8cba4ec22bada7fc55ffe51e2deb6a0e0db2d0b7ab0b103acc80d2510c190"
-dependencies = [
- "pest",
- "pest_meta",
- "proc-macro2",
- "quote",
- "syn 2.0.47",
-]
-
-[[package]]
-name = "pest_meta"
-version = "2.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a01f71cb40bd8bb94232df14b946909e14660e33fc05db3e50ae2a82d7ea0ca0"
-dependencies = [
- "once_cell",
- "pest",
- "sha2",
-]
-
-[[package]]
-name = "petgraph"
-version = "0.6.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9"
-dependencies = [
- "fixedbitset",
- "indexmap 2.1.0",
-]
-
-[[package]]
-name = "phf"
-version = "0.8.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3dfb61232e34fcb633f43d12c58f83c1df82962dcdfa565a4e866ffc17dafe12"
-dependencies = [
- "phf_macros 0.8.0",
- "phf_shared 0.8.0",
- "proc-macro-hack",
-]
-
-[[package]]
-name = "phf"
-version = "0.10.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fabbf1ead8a5bcbc20f5f8b939ee3f5b0f6f281b6ad3468b84656b658b455259"
-dependencies = [
- "phf_shared 0.10.0",
-]
-
-[[package]]
-name = "phf"
-version = "0.11.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc"
-dependencies = [
- "phf_macros 0.11.2",
- "phf_shared 0.11.2",
-]
-
-[[package]]
-name = "phf_codegen"
-version = "0.8.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cbffee61585b0411840d3ece935cce9cb6321f01c45477d30066498cd5e1a815"
-dependencies = [
- "phf_generator 0.8.0",
- "phf_shared 0.8.0",
-]
-
-[[package]]
-name = "phf_codegen"
-version = "0.10.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4fb1c3a8bc4dd4e5cfce29b44ffc14bedd2ee294559a294e2a4d4c9e9a6a13cd"
-dependencies = [
- "phf_generator 0.10.0",
- "phf_shared 0.10.0",
-]
-
-[[package]]
-name = "phf_codegen"
-version = "0.11.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e8d39688d359e6b34654d328e262234662d16cc0f60ec8dcbe5e718709342a5a"
-dependencies = [
- "phf_generator 0.11.2",
- "phf_shared 0.11.2",
-]
-
-[[package]]
-name = "phf_generator"
-version = "0.8.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "17367f0cc86f2d25802b2c26ee58a7b23faeccf78a396094c13dced0d0182526"
-dependencies = [
- "phf_shared 0.8.0",
- "rand 0.7.3",
-]
-
-[[package]]
-name = "phf_generator"
-version = "0.10.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6"
-dependencies = [
- "phf_shared 0.10.0",
- "rand 0.8.5",
-]
-
-[[package]]
-name = "phf_generator"
-version = "0.11.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0"
-dependencies = [
- "phf_shared 0.11.2",
- "rand 0.8.5",
-]
-
-[[package]]
-name = "phf_macros"
-version = "0.8.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7f6fde18ff429ffc8fe78e2bf7f8b7a5a5a6e2a8b58bc5a9ac69198bbda9189c"
-dependencies = [
- "phf_generator 0.8.0",
- "phf_shared 0.8.0",
- "proc-macro-hack",
- "proc-macro2",
- "quote",
- "syn 1.0.109",
-]
-
-[[package]]
-name = "phf_macros"
-version = "0.11.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b"
-dependencies = [
- "phf_generator 0.11.2",
- "phf_shared 0.11.2",
- "proc-macro2",
- "quote",
- "syn 2.0.47",
-]
-
-[[package]]
-name = "phf_shared"
-version = "0.8.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c00cf8b9eafe68dde5e9eaa2cef8ee84a9336a47d566ec55ca16589633b65af7"
-dependencies = [
- "siphasher",
-]
-
-[[package]]
-name = "phf_shared"
-version = "0.10.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096"
-dependencies = [
- "siphasher",
- "uncased",
-]
-
-[[package]]
-name = "phf_shared"
-version = "0.11.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b"
-dependencies = [
- "siphasher",
-]
-
-[[package]]
-name = "pin-project"
-version = "1.1.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "be57f64e946e500c8ee36ef6331845d40a93055567ec57e8fae13efd33759b95"
-dependencies = [
- "pin-project-internal",
-]
-
-[[package]]
-name = "pin-project-internal"
-version = "1.1.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.47",
-]
-
-[[package]]
-name = "pin-project-lite"
-version = "0.2.13"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58"
-
-[[package]]
-name = "pin-utils"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
-
-[[package]]
-name = "pkg-config"
-version = "0.3.27"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964"
-
-[[package]]
-name = "plist"
-version = "1.4.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9bd9647b268a3d3e14ff09c23201133a62589c658db02bb7388c7246aafe0590"
-dependencies = [
- "base64 0.21.5",
- "indexmap 1.9.3",
- "line-wrap",
- "quick-xml",
- "serde",
- "time",
-]
-
-[[package]]
-name = "png"
-version = "0.17.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "59871cc5b6cce7eaccca5a802b4173377a1c2ba90654246789a8fa2334426d11"
-dependencies = [
- "bitflags 1.3.2",
- "crc32fast",
- "fdeflate",
- "flate2",
- "miniz_oxide 0.7.1",
-]
-
-[[package]]
-name = "polyval"
-version = "0.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d52cff9d1d4dee5fe6d03729099f4a310a41179e0a10dbf542039873f2e826fb"
-dependencies = [
- "cfg-if",
- "cpufeatures",
- "opaque-debug",
- "universal-hash",
-]
-
-[[package]]
-name = "postgrest"
-version = "1.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e66400cb23a379592bc8c8bdc9adda652eef4a969b74ab78454a8e8c11330c2b"
-dependencies = [
- "reqwest",
-]
-
-[[package]]
-name = "powerfmt"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391"
-
-[[package]]
-name = "ppv-lite86"
-version = "0.2.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de"
-
-[[package]]
-name = "precomputed-hash"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c"
-
-[[package]]
-name = "prettyplease"
-version = "0.2.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9825a04601d60621feed79c4e6b56d65db77cdca55cef43b46b0de1096d1c282"
-dependencies = [
- "proc-macro2",
- "syn 2.0.47",
-]
-
-[[package]]
-name = "proc-macro-crate"
-version = "1.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919"
-dependencies = [
- "once_cell",
- "toml_edit 0.19.11",
-]
-
-[[package]]
-name = "proc-macro-crate"
-version = "2.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b00f26d3400549137f92511a46ac1cd8ce37cb5598a96d382381458b992a5d24"
-dependencies = [
- "toml_datetime",
- "toml_edit 0.20.2",
-]
-
-[[package]]
-name = "proc-macro-error"
-version = "1.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c"
-dependencies = [
- "proc-macro-error-attr",
- "proc-macro2",
- "quote",
- "syn 1.0.109",
- "version_check",
-]
-
-[[package]]
-name = "proc-macro-error-attr"
-version = "1.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869"
-dependencies = [
- "proc-macro2",
- "quote",
- "version_check",
-]
-
-[[package]]
-name = "proc-macro-error-attr2"
-version = "2.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5"
-dependencies = [
- "proc-macro2",
- "quote",
-]
-
-[[package]]
-name = "proc-macro-error2"
-version = "2.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802"
-dependencies = [
- "proc-macro-error-attr2",
- "proc-macro2",
- "quote",
- "syn 2.0.47",
-]
-
-[[package]]
-name = "proc-macro-hack"
-version = "0.5.20+deprecated"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068"
-
-[[package]]
-name = "proc-macro2"
-version = "1.0.75"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "907a61bd0f64c2f29cd1cf1dc34d05176426a3f504a78010f08416ddb7b13708"
-dependencies = [
- "unicode-ident",
-]
-
-[[package]]
-name = "prost"
-version = "0.12.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "146c289cda302b98a28d40c8b3b90498d6e526dd24ac2ecea73e4e491685b94a"
-dependencies = [
- "bytes",
- "prost-derive 0.12.3",
-]
-
-[[package]]
-name = "prost"
-version = "0.13.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7b0487d90e047de87f984913713b85c601c05609aad5b0df4b4573fbf69aa13f"
-dependencies = [
- "bytes",
- "prost-derive 0.13.3",
-]
-
-[[package]]
-name = "prost-build"
-version = "0.12.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c55e02e35260070b6f716a2423c2ff1c3bb1642ddca6f99e1f26d06268a0e2d2"
-dependencies = [
- "bytes",
- "heck 0.4.1",
- "itertools 0.10.5",
- "log",
- "multimap",
- "once_cell",
- "petgraph",
- "prettyplease",
- "prost 0.12.3",
- "prost-types",
- "regex",
- "syn 2.0.47",
- "tempfile",
- "which",
-]
-
-[[package]]
-name = "prost-derive"
-version = "0.12.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "efb6c9a1dd1def8e2124d17e83a20af56f1570d6c2d2bd9e266ccb768df3840e"
-dependencies = [
- "anyhow",
- "itertools 0.10.5",
- "proc-macro2",
- "quote",
- "syn 2.0.47",
-]
-
-[[package]]
-name = "prost-derive"
-version = "0.13.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e9552f850d5f0964a4e4d0bf306459ac29323ddfbae05e35a7c0d35cb0803cc5"
-dependencies = [
- "anyhow",
- "itertools 0.12.1",
- "proc-macro2",
- "quote",
- "syn 2.0.47",
-]
-
-[[package]]
-name = "prost-types"
-version = "0.12.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "193898f59edcf43c26227dcd4c8427f00d99d61e95dcde58dabd49fa291d470e"
-dependencies = [
- "prost 0.12.3",
-]
-
-[[package]]
-name = "protobuf"
-version = "2.28.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94"
-
-[[package]]
-name = "protobuf-codegen"
-version = "2.28.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "033460afb75cf755fcfc16dfaed20b86468082a2ea24e05ac35ab4a099a017d6"
-dependencies = [
- "protobuf",
-]
-
-[[package]]
-name = "protoc"
-version = "2.28.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a0218039c514f9e14a5060742ecd50427f8ac4f85a6dc58f2ddb806e318c55ee"
-dependencies = [
- "log",
- "which",
-]
-
-[[package]]
-name = "protoc-bin-vendored"
-version = "3.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "005ca8623e5633e298ad1f917d8be0a44bcf406bf3cde3b80e63003e49a3f27d"
-dependencies = [
- "protoc-bin-vendored-linux-aarch_64",
- "protoc-bin-vendored-linux-ppcle_64",
- "protoc-bin-vendored-linux-x86_32",
- "protoc-bin-vendored-linux-x86_64",
- "protoc-bin-vendored-macos-x86_64",
- "protoc-bin-vendored-win32",
-]
-
-[[package]]
-name = "protoc-bin-vendored-linux-aarch_64"
-version = "3.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8fb9fc9cce84c8694b6ea01cc6296617b288b703719b725b8c9c65f7c5874435"
-
-[[package]]
-name = "protoc-bin-vendored-linux-ppcle_64"
-version = "3.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "02d2a07dcf7173a04d49974930ccbfb7fd4d74df30ecfc8762cf2f895a094516"
-
-[[package]]
-name = "protoc-bin-vendored-linux-x86_32"
-version = "3.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d54fef0b04fcacba64d1d80eed74a20356d96847da8497a59b0a0a436c9165b0"
-
-[[package]]
-name = "protoc-bin-vendored-linux-x86_64"
-version = "3.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b8782f2ce7d43a9a5c74ea4936f001e9e8442205c244f7a3d4286bd4c37bc924"
-
-[[package]]
-name = "protoc-bin-vendored-macos-x86_64"
-version = "3.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b5de656c7ee83f08e0ae5b81792ccfdc1d04e7876b1d9a38e6876a9e09e02537"
-
-[[package]]
-name = "protoc-bin-vendored-win32"
-version = "3.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9653c3ed92974e34c5a6e0a510864dab979760481714c172e0a34e437cb98804"
-
-[[package]]
-name = "protoc-rust"
-version = "2.28.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "22f8a182bb17c485f20bdc4274a8c39000a61024cfe461c799b50fec77267838"
-dependencies = [
- "protobuf",
- "protobuf-codegen",
- "protoc",
- "tempfile",
-]
-
-[[package]]
-name = "psl-types"
-version = "2.0.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "33cb294fe86a74cbcf50d4445b37da762029549ebeea341421c7c70370f86cac"
-
-[[package]]
-name = "ptr_meta"
-version = "0.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1"
-dependencies = [
- "ptr_meta_derive",
-]
-
-[[package]]
-name = "ptr_meta_derive"
-version = "0.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 1.0.109",
-]
-
-[[package]]
-name = "publicsuffix"
-version = "2.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "96a8c1bda5ae1af7f99a2962e49df150414a43d62404644d98dd5c3a93d07457"
-dependencies = [
- "idna 0.3.0",
- "psl-types",
-]
-
-[[package]]
-name = "quanta"
-version = "0.12.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8e5167a477619228a0b284fac2674e3c388cba90631d7b7de620e6f1fcd08da5"
-dependencies = [
- "crossbeam-utils",
- "libc",
- "once_cell",
- "raw-cpuid",
- "wasi 0.11.0+wasi-snapshot-preview1",
- "web-sys",
- "winapi",
-]
-
-[[package]]
-name = "quick-xml"
-version = "0.28.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0ce5e73202a820a31f8a0ee32ada5e21029c81fd9e3ebf668a40832e4219d9d1"
-dependencies = [
- "memchr",
-]
-
-[[package]]
-name = "quote"
-version = "1.0.35"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef"
-dependencies = [
- "proc-macro2",
-]
-
-[[package]]
-name = "r2d2"
-version = "0.8.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "51de85fb3fb6524929c8a2eb85e6b6d363de4e8c48f9e2c2eac4944abc181c93"
-dependencies = [
- "log",
- "parking_lot 0.12.1",
- "scheduled-thread-pool",
-]
-
-[[package]]
-name = "radium"
-version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09"
-
-[[package]]
-name = "rand"
-version = "0.7.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03"
-dependencies = [
- "getrandom 0.1.16",
- "libc",
- "rand_chacha 0.2.2",
- "rand_core 0.5.1",
- "rand_hc",
- "rand_pcg",
-]
-
-[[package]]
-name = "rand"
-version = "0.8.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
-dependencies = [
- "libc",
- "rand_chacha 0.3.1",
- "rand_core 0.6.4",
-]
-
-[[package]]
-name = "rand_chacha"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402"
-dependencies = [
- "ppv-lite86",
- "rand_core 0.5.1",
-]
-
-[[package]]
-name = "rand_chacha"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
-dependencies = [
- "ppv-lite86",
- "rand_core 0.6.4",
-]
-
-[[package]]
-name = "rand_core"
-version = "0.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19"
-dependencies = [
- "getrandom 0.1.16",
-]
-
-[[package]]
-name = "rand_core"
-version = "0.6.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
-dependencies = [
- "getrandom 0.2.10",
-]
-
-[[package]]
-name = "rand_distr"
-version = "0.4.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "32cb0b9bc82b0a0876c2dd994a7e7a2683d3e7390ca40e6886785ef0c7e3ee31"
-dependencies = [
- "num-traits",
- "rand 0.8.5",
-]
-
-[[package]]
-name = "rand_hc"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c"
-dependencies = [
- "rand_core 0.5.1",
-]
-
-[[package]]
-name = "rand_pcg"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "16abd0c1b639e9eb4d7c50c0b8100b0d0f849be2349829c740fe8e6eb4816429"
-dependencies = [
- "rand_core 0.5.1",
-]
-
-[[package]]
-name = "raw-cpuid"
-version = "11.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cb9ee317cfe3fbd54b36a511efc1edd42e216903c9cd575e686dd68a2ba90d8d"
-dependencies = [
- "bitflags 2.4.0",
-]
-
-[[package]]
-name = "raw-window-handle"
-version = "0.5.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f2ff9a1f06a88b01621b7ae906ef0211290d1c8a168a15542486a8f61c0833b9"
-
-[[package]]
-name = "rayon"
-version = "1.10.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa"
-dependencies = [
- "either",
- "rayon-core",
-]
-
-[[package]]
-name = "rayon-core"
-version = "1.12.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2"
-dependencies = [
- "crossbeam-deque",
- "crossbeam-utils",
-]
-
-[[package]]
-name = "redox_syscall"
-version = "0.1.57"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce"
-
-[[package]]
-name = "redox_syscall"
-version = "0.2.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a"
-dependencies = [
- "bitflags 1.3.2",
-]
-
-[[package]]
-name = "redox_syscall"
-version = "0.3.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29"
-dependencies = [
- "bitflags 1.3.2",
-]
-
-[[package]]
-name = "redox_syscall"
-version = "0.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa"
-dependencies = [
- "bitflags 1.3.2",
-]
-
-[[package]]
-name = "redox_users"
-version = "0.4.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b"
-dependencies = [
- "getrandom 0.2.10",
- "redox_syscall 0.2.16",
- "thiserror",
-]
-
-[[package]]
-name = "regex"
-version = "1.10.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f"
-dependencies = [
- "aho-corasick 1.0.2",
- "memchr",
- "regex-automata 0.4.7",
- "regex-syntax 0.8.4",
-]
-
-[[package]]
-name = "regex-automata"
-version = "0.1.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132"
-dependencies = [
- "regex-syntax 0.6.29",
-]
-
-[[package]]
-name = "regex-automata"
-version = "0.4.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df"
-dependencies = [
- "aho-corasick 1.0.2",
- "memchr",
- "regex-syntax 0.8.4",
-]
-
-[[package]]
-name = "regex-syntax"
-version = "0.6.29"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1"
-
-[[package]]
-name = "regex-syntax"
-version = "0.8.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b"
-
-[[package]]
-name = "rend"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "581008d2099240d37fb08d77ad713bcaec2c4d89d50b5b21a8bb1996bbab68ab"
-dependencies = [
- "bytecheck",
-]
-
-[[package]]
-name = "reqwest"
-version = "0.11.27"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62"
-dependencies = [
- "base64 0.21.5",
- "bytes",
- "cookie",
- "cookie_store",
- "encoding_rs",
- "futures-core",
- "futures-util",
- "h2",
- "http",
- "http-body",
- "hyper",
- "hyper-rustls",
- "hyper-tls",
- "ipnet",
- "js-sys",
- "log",
- "mime",
- "mime_guess",
- "native-tls",
- "once_cell",
- "percent-encoding",
- "pin-project-lite",
- "rustls",
- "rustls-pemfile",
- "serde",
- "serde_json",
- "serde_urlencoded",
- "sync_wrapper",
- "system-configuration",
- "tokio",
- "tokio-native-tls",
- "tokio-rustls",
- "tokio-util",
- "tower-service",
- "url",
- "wasm-bindgen",
- "wasm-bindgen-futures",
- "wasm-streams",
- "web-sys",
- "webpki-roots",
- "winreg 0.50.0",
-]
-
-[[package]]
-name = "rfd"
-version = "0.10.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0149778bd99b6959285b0933288206090c50e2327f47a9c463bfdbf45c8823ea"
-dependencies = [
- "block",
- "dispatch",
- "glib-sys",
- "gobject-sys",
- "gtk-sys",
- "js-sys",
- "lazy_static",
- "log",
- "objc",
- "objc-foundation",
- "objc_id",
- "raw-window-handle",
- "wasm-bindgen",
- "wasm-bindgen-futures",
- "web-sys",
- "windows 0.37.0",
-]
-
-[[package]]
-name = "ring"
-version = "0.16.20"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc"
-dependencies = [
- "cc",
- "libc",
- "once_cell",
- "spin",
- "untrusted",
- "web-sys",
- "winapi",
-]
-
-[[package]]
-name = "rkyv"
-version = "0.7.42"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0200c8230b013893c0b2d6213d6ec64ed2b9be2e0e016682b7224ff82cff5c58"
-dependencies = [
- "bitvec",
- "bytecheck",
- "hashbrown 0.12.3",
- "ptr_meta",
- "rend",
- "rkyv_derive",
- "seahash",
- "tinyvec",
- "uuid",
-]
-
-[[package]]
-name = "rkyv_derive"
-version = "0.7.42"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b2e06b915b5c230a17d7a736d1e2e63ee753c256a8614ef3f5147b13a4f5541d"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 1.0.109",
-]
-
-[[package]]
-name = "rocksdb"
-version = "0.22.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6bd13e55d6d7b8cd0ea569161127567cd587676c99f4472f779a0279aa60a7a7"
-dependencies = [
- "libc",
- "librocksdb-sys",
-]
-
-[[package]]
-name = "rust-stemmers"
-version = "1.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e46a2036019fdb888131db7a4c847a1063a7493f971ed94ea82c67eada63ca54"
-dependencies = [
- "serde",
- "serde_derive",
-]
-
-[[package]]
-name = "rust_decimal"
-version = "1.36.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b082d80e3e3cc52b2ed634388d436fe1f4de6af5786cc2de9ba9737527bdf555"
-dependencies = [
- "arrayvec",
- "borsh",
- "bytes",
- "num-traits",
- "rand 0.8.5",
- "rkyv",
- "serde",
- "serde_json",
-]
-
-[[package]]
-name = "rust_decimal_macros"
-version = "1.30.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7ca5c398d85f83b9a44de754a2048625a8c5eafcf070da7b8f116b685e2f6608"
-dependencies = [
- "quote",
- "rust_decimal",
-]
-
-[[package]]
-name = "rustc-demangle"
-version = "0.1.23"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76"
-
-[[package]]
-name = "rustc-hash"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
-
-[[package]]
-name = "rustc_version"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366"
-dependencies = [
- "semver",
-]
-
-[[package]]
-name = "rustix"
-version = "0.38.30"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca"
-dependencies = [
- "bitflags 2.4.0",
- "errno",
- "libc",
- "linux-raw-sys",
- "windows-sys 0.52.0",
-]
-
-[[package]]
-name = "rustls"
-version = "0.21.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8"
-dependencies = [
- "log",
- "ring",
- "rustls-webpki",
- "sct",
-]
-
-[[package]]
-name = "rustls-pemfile"
-version = "1.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b"
-dependencies = [
- "base64 0.21.5",
-]
-
-[[package]]
-name = "rustls-webpki"
-version = "0.101.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7d93931baf2d282fff8d3a532bbfd7653f734643161b87e3e01e59a04439bf0d"
-dependencies = [
- "ring",
- "untrusted",
-]
-
-[[package]]
-name = "rustversion"
-version = "1.0.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4f3208ce4d8448b3f3e7d168a73f5e0c43a61e32930de3bceeccedb388b6bf06"
-
-[[package]]
-name = "rusty-money"
-version = "0.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5b28f881005eac7ad8d46b6f075da5f322bd7f4f83a38720fc069694ddadd683"
-dependencies = [
- "rust_decimal",
- "rust_decimal_macros",
-]
-
-[[package]]
-name = "ryu"
-version = "1.0.13"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041"
-
-[[package]]
-name = "safemem"
-version = "0.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072"
-
-[[package]]
-name = "same-file"
-version = "1.0.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502"
-dependencies = [
- "winapi-util",
-]
-
-[[package]]
-name = "sanitize-filename"
-version = "0.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2ed72fbaf78e6f2d41744923916966c4fbe3d7c74e3037a8ee482f1115572603"
-dependencies = [
- "lazy_static",
- "regex",
-]
-
-[[package]]
-name = "schannel"
-version = "0.1.21"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3"
-dependencies = [
- "windows-sys 0.42.0",
-]
-
-[[package]]
-name = "scheduled-thread-pool"
-version = "0.2.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3cbc66816425a074528352f5789333ecff06ca41b36b0b0efdfbb29edc391a19"
-dependencies = [
- "parking_lot 0.12.1",
-]
-
-[[package]]
-name = "scoped-tls"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294"
-
-[[package]]
-name = "scopeguard"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
-
-[[package]]
-name = "scraper"
-version = "0.17.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c95a930e03325234c18c7071fd2b60118307e025d6fff3e12745ffbf63a3d29c"
-dependencies = [
- "ahash 0.8.6",
- "cssparser 0.31.2",
- "ego-tree",
- "getopts",
- "html5ever 0.26.0",
- "once_cell",
- "selectors 0.25.0",
- "smallvec",
- "tendril",
-]
-
-[[package]]
-name = "scraper"
-version = "0.18.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "585480e3719b311b78a573db1c9d9c4c1f8010c2dee4cc59c2efe58ea4dbc3e1"
-dependencies = [
- "ahash 0.8.6",
- "cssparser 0.31.2",
- "ego-tree",
- "getopts",
- "html5ever 0.26.0",
- "once_cell",
- "selectors 0.25.0",
- "tendril",
-]
-
-[[package]]
-name = "sct"
-version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4"
-dependencies = [
- "ring",
- "untrusted",
-]
-
-[[package]]
-name = "seahash"
-version = "4.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b"
-
-[[package]]
-name = "security-framework"
-version = "2.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1fc758eb7bffce5b308734e9b0c1468893cae9ff70ebf13e7090be8dcbcc83a8"
-dependencies = [
- "bitflags 1.3.2",
- "core-foundation",
- "core-foundation-sys",
- "libc",
- "security-framework-sys",
-]
-
-[[package]]
-name = "security-framework-sys"
-version = "2.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f51d0c0d83bec45f16480d0ce0058397a69e48fcdc52d1dc8855fb68acbd31a7"
-dependencies = [
- "core-foundation-sys",
- "libc",
-]
-
-[[package]]
-name = "selectors"
-version = "0.22.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "df320f1889ac4ba6bc0cdc9c9af7af4bd64bb927bccdf32d81140dc1f9be12fe"
-dependencies = [
- "bitflags 1.3.2",
- "cssparser 0.27.2",
- "derive_more",
- "fxhash",
- "log",
- "matches",
- "phf 0.8.0",
- "phf_codegen 0.8.0",
- "precomputed-hash",
- "servo_arc 0.1.1",
- "smallvec",
- "thin-slice",
-]
-
-[[package]]
-name = "selectors"
-version = "0.25.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4eb30575f3638fc8f6815f448d50cb1a2e255b0897985c8c59f4d37b72a07b06"
-dependencies = [
- "bitflags 2.4.0",
- "cssparser 0.31.2",
- "derive_more",
- "fxhash",
- "log",
- "new_debug_unreachable",
- "phf 0.10.1",
- "phf_codegen 0.10.0",
- "precomputed-hash",
- "servo_arc 0.3.0",
- "smallvec",
-]
-
-[[package]]
-name = "semver"
-version = "1.0.23"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b"
-dependencies = [
- "serde",
-]
-
-[[package]]
-name = "serde"
-version = "1.0.210"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a"
-dependencies = [
- "serde_derive",
-]
-
-[[package]]
-name = "serde_derive"
-version = "1.0.210"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.47",
-]
-
-[[package]]
-name = "serde_derive_internals"
-version = "0.28.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e578a843d40b4189a4d66bba51d7684f57da5bd7c304c64e14bd63efbef49509"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.47",
-]
-
-[[package]]
-name = "serde_json"
-version = "1.0.128"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8"
-dependencies = [
- "itoa 1.0.6",
- "memchr",
- "ryu",
- "serde",
-]
-
-[[package]]
-name = "serde_repr"
-version = "0.1.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.47",
-]
-
-[[package]]
-name = "serde_spanned"
-version = "0.6.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "96426c9936fd7a0124915f9185ea1d20aa9445cc9821142f0a73bc9207a2e186"
-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.6",
- "ryu",
- "serde",
-]
-
-[[package]]
-name = "serde_with"
-version = "3.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9f02d8aa6e3c385bf084924f660ce2a3a6bd333ba55b35e8590b321f35d88513"
-dependencies = [
- "base64 0.21.5",
- "chrono",
- "hex",
- "indexmap 1.9.3",
- "serde",
- "serde_json",
- "serde_with_macros",
- "time",
-]
-
-[[package]]
-name = "serde_with_macros"
-version = "3.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "edc7d5d3932fb12ce722ee5e64dd38c504efba37567f0c402f6ca728c3b8b070"
-dependencies = [
- "darling",
- "proc-macro2",
- "quote",
- "syn 2.0.47",
-]
-
-[[package]]
-name = "serialize-to-javascript"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c9823f2d3b6a81d98228151fdeaf848206a7855a7a042bbf9bf870449a66cafb"
-dependencies = [
- "serde",
- "serde_json",
- "serialize-to-javascript-impl",
-]
-
-[[package]]
-name = "serialize-to-javascript-impl"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "74064874e9f6a15f04c1f3cb627902d0e6b410abbf36668afa873c61889f1763"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 1.0.109",
-]
-
-[[package]]
-name = "servo_arc"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d98238b800e0d1576d8b6e3de32827c2d74bee68bb97748dcf5071fb53965432"
-dependencies = [
- "nodrop",
- "stable_deref_trait",
-]
-
-[[package]]
-name = "servo_arc"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d036d71a959e00c77a63538b90a6c2390969f9772b096ea837205c6bd0491a44"
-dependencies = [
- "stable_deref_trait",
-]
-
-[[package]]
-name = "sha1"
-version = "0.10.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba"
-dependencies = [
- "cfg-if",
- "cpufeatures",
- "digest",
-]
-
-[[package]]
-name = "sha1_smol"
-version = "1.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012"
-
-[[package]]
-name = "sha2"
-version = "0.10.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8"
-dependencies = [
- "cfg-if",
- "cpufeatures",
- "digest",
-]
-
-[[package]]
-name = "sharded-slab"
-version = "0.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31"
-dependencies = [
- "lazy_static",
-]
-
-[[package]]
-name = "shared-entity"
-version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=ea131f0baab67defe7591067357eced490072372#ea131f0baab67defe7591067357eced490072372"
-dependencies = [
- "anyhow",
- "app-error",
- "appflowy-ai-client",
- "bytes",
- "chrono",
- "collab-entity",
- "database-entity",
- "futures",
- "gotrue-entity",
- "infra",
- "log",
- "pin-project",
- "reqwest",
- "serde",
- "serde_json",
- "serde_repr",
- "thiserror",
- "tracing",
- "uuid",
- "validator 0.19.0",
-]
-
-[[package]]
-name = "shlex"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3"
-
-[[package]]
-name = "signal-hook-registry"
-version = "1.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "simd-adler32"
-version = "0.3.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe"
-
-[[package]]
-name = "simdutf8"
-version = "0.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a"
-
-[[package]]
-name = "similar"
-version = "1.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1ad1d488a557b235fc46dae55512ffbfc429d2482b08b4d9435ab07384ca8aec"
-
-[[package]]
-name = "similar"
-version = "2.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "420acb44afdae038210c99e69aae24109f32f15500aa708e81d46c9f29d55fcf"
-
-[[package]]
-name = "simple_asn1"
-version = "0.6.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "adc4e5204eb1910f40f9cfa375f6f05b68c3abac4b6fd879c8ff5e7ae8a0a085"
-dependencies = [
- "num-bigint",
- "num-traits",
- "thiserror",
- "time",
-]
-
-[[package]]
-name = "siphasher"
-version = "0.3.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de"
-
-[[package]]
-name = "sketches-ddsketch"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "85636c14b73d81f541e525f585c0a2109e6744e1565b5c1668e31c70c10ed65c"
-dependencies = [
- "serde",
-]
-
-[[package]]
-name = "slab"
-version = "0.4.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d"
-dependencies = [
- "autocfg",
-]
-
-[[package]]
-name = "slug"
-version = "0.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b3bc762e6a4b6c6fcaade73e77f9ebc6991b676f88bb2358bddb56560f073373"
-dependencies = [
- "deunicode",
-]
-
-[[package]]
-name = "smallstr"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "63b1aefdf380735ff8ded0b15f31aab05daf1f70216c01c02a12926badd1df9d"
-dependencies = [
- "smallvec",
-]
-
-[[package]]
-name = "smallvec"
-version = "1.13.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67"
-
-[[package]]
-name = "socket2"
-version = "0.4.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662"
-dependencies = [
- "libc",
- "winapi",
-]
-
-[[package]]
-name = "socket2"
-version = "0.5.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9"
-dependencies = [
- "libc",
- "windows-sys 0.48.0",
-]
-
-[[package]]
-name = "soup2"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b2b4d76501d8ba387cf0fefbe055c3e0a59891d09f0f995ae4e4b16f6b60f3c0"
-dependencies = [
- "bitflags 1.3.2",
- "gio",
- "glib",
- "libc",
- "once_cell",
- "soup2-sys",
-]
-
-[[package]]
-name = "soup2-sys"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "009ef427103fcb17f802871647a7fa6c60cbb654b4c4e4c0ac60a31c5f6dc9cf"
-dependencies = [
- "bitflags 1.3.2",
- "gio-sys",
- "glib-sys",
- "gobject-sys",
- "libc",
- "system-deps 5.0.0",
-]
-
-[[package]]
-name = "spin"
-version = "0.5.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d"
-
-[[package]]
-name = "stable_deref_trait"
-version = "1.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
-
-[[package]]
-name = "state"
-version = "0.5.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dbe866e1e51e8260c9eed836a042a5e7f6726bb2b411dffeaa712e19c388f23b"
-dependencies = [
- "loom",
-]
-
-[[package]]
-name = "string_cache"
-version = "0.8.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b"
-dependencies = [
- "new_debug_unreachable",
- "once_cell",
- "parking_lot 0.12.1",
- "phf_shared 0.10.0",
- "precomputed-hash",
- "serde",
-]
-
-[[package]]
-name = "string_cache_codegen"
-version = "0.5.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6bb30289b722be4ff74a408c3cc27edeaad656e06cb1fe8fa9231fa59c728988"
-dependencies = [
- "phf_generator 0.10.0",
- "phf_shared 0.10.0",
- "proc-macro2",
- "quote",
-]
-
-[[package]]
-name = "strsim"
-version = "0.10.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
-
-[[package]]
-name = "strsim"
-version = "0.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01"
-
-[[package]]
-name = "strum"
-version = "0.25.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125"
-
-[[package]]
-name = "strum_macros"
-version = "0.21.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d06aaeeee809dbc59eb4556183dd927df67db1540de5be8d3ec0b6636358a5ec"
-dependencies = [
- "heck 0.3.3",
- "proc-macro2",
- "quote",
- "syn 1.0.109",
-]
-
-[[package]]
-name = "strum_macros"
-version = "0.25.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ad8d03b598d3d0fff69bf533ee3ef19b8eeb342729596df84bcc7e1f96ec4059"
-dependencies = [
- "heck 0.4.1",
- "proc-macro2",
- "quote",
- "rustversion",
- "syn 2.0.47",
-]
-
-[[package]]
-name = "strum_macros"
-version = "0.26.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7a3417fc93d76740d974a01654a09777cb500428cc874ca9f45edfe0c4d4cd18"
-dependencies = [
- "heck 0.4.1",
- "proc-macro2",
- "quote",
- "rustversion",
- "syn 2.0.47",
-]
-
-[[package]]
-name = "subtle"
-version = "2.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc"
-
-[[package]]
-name = "syn"
-version = "1.0.109"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
-dependencies = [
- "proc-macro2",
- "quote",
- "unicode-ident",
-]
-
-[[package]]
-name = "syn"
-version = "2.0.47"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1726efe18f42ae774cc644f330953a5e7b3c3003d3edcecf18850fe9d4dd9afb"
-dependencies = [
- "proc-macro2",
- "quote",
- "unicode-ident",
-]
-
-[[package]]
-name = "syn_derive"
-version = "0.1.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1329189c02ff984e9736652b1631330da25eaa6bc639089ed4915d25446cbe7b"
-dependencies = [
- "proc-macro-error",
- "proc-macro2",
- "quote",
- "syn 2.0.47",
-]
-
-[[package]]
-name = "sync_wrapper"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160"
-
-[[package]]
-name = "synstructure"
-version = "0.13.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.47",
-]
-
-[[package]]
-name = "sysinfo"
-version = "0.30.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1fb4f3438c8f6389c864e61221cbc97e9bca98b4daf39a5beb7bea660f528bb2"
-dependencies = [
- "cfg-if",
- "core-foundation-sys",
- "libc",
- "ntapi",
- "once_cell",
- "rayon",
- "windows 0.52.0",
-]
-
-[[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",
- "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"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "18db855554db7bd0e73e06cf7ba3df39f97812cb11d3f75e71c39bf45171797e"
-dependencies = [
- "cfg-expr 0.9.1",
- "heck 0.3.3",
- "pkg-config",
- "toml 0.5.11",
- "version-compare 0.0.11",
-]
-
-[[package]]
-name = "system-deps"
-version = "6.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "30c2de8a4d8f4b823d634affc9cd2a74ec98c53a756f317e529a48046cbf71f3"
-dependencies = [
- "cfg-expr 0.15.3",
- "heck 0.4.1",
- "pkg-config",
- "toml 0.7.5",
- "version-compare 0.1.1",
-]
-
-[[package]]
-name = "tagptr"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417"
-
-[[package]]
-name = "tantivy"
-version = "0.22.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f8d0582f186c0a6d55655d24543f15e43607299425c5ad8352c242b914b31856"
-dependencies = [
- "aho-corasick 1.0.2",
- "arc-swap",
- "base64 0.22.1",
- "bitpacking",
- "byteorder",
- "census",
- "crc32fast",
- "crossbeam-channel",
- "downcast-rs",
- "fastdivide",
- "fnv",
- "fs4",
- "htmlescape",
- "itertools 0.12.1",
- "levenshtein_automata",
- "log",
- "lru",
- "lz4_flex",
- "measure_time",
- "memmap2",
- "num_cpus",
- "once_cell",
- "oneshot",
- "rayon",
- "regex",
- "rust-stemmers",
- "rustc-hash",
- "serde",
- "serde_json",
- "sketches-ddsketch",
- "smallvec",
- "tantivy-bitpacker",
- "tantivy-columnar",
- "tantivy-common",
- "tantivy-fst",
- "tantivy-query-grammar",
- "tantivy-stacker",
- "tantivy-tokenizer-api",
- "tempfile",
- "thiserror",
- "time",
- "uuid",
- "winapi",
-]
-
-[[package]]
-name = "tantivy-bitpacker"
-version = "0.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "284899c2325d6832203ac6ff5891b297fc5239c3dc754c5bc1977855b23c10df"
-dependencies = [
- "bitpacking",
-]
-
-[[package]]
-name = "tantivy-columnar"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "12722224ffbe346c7fec3275c699e508fd0d4710e629e933d5736ec524a1f44e"
-dependencies = [
- "downcast-rs",
- "fastdivide",
- "itertools 0.12.1",
- "serde",
- "tantivy-bitpacker",
- "tantivy-common",
- "tantivy-sstable",
- "tantivy-stacker",
-]
-
-[[package]]
-name = "tantivy-common"
-version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8019e3cabcfd20a1380b491e13ff42f57bb38bf97c3d5fa5c07e50816e0621f4"
-dependencies = [
- "async-trait",
- "byteorder",
- "ownedbytes",
- "serde",
- "time",
-]
-
-[[package]]
-name = "tantivy-fst"
-version = "0.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d60769b80ad7953d8a7b2c70cdfe722bbcdcac6bccc8ac934c40c034d866fc18"
-dependencies = [
- "byteorder",
- "regex-syntax 0.8.4",
- "utf8-ranges",
-]
-
-[[package]]
-name = "tantivy-query-grammar"
-version = "0.22.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "847434d4af57b32e309f4ab1b4f1707a6c566656264caa427ff4285c4d9d0b82"
-dependencies = [
- "nom",
-]
-
-[[package]]
-name = "tantivy-sstable"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c69578242e8e9fc989119f522ba5b49a38ac20f576fc778035b96cc94f41f98e"
-dependencies = [
- "tantivy-bitpacker",
- "tantivy-common",
- "tantivy-fst",
- "zstd 0.13.2",
-]
-
-[[package]]
-name = "tantivy-stacker"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c56d6ff5591fc332739b3ce7035b57995a3ce29a93ffd6012660e0949c956ea8"
-dependencies = [
- "murmurhash32",
- "rand_distr",
- "tantivy-common",
-]
-
-[[package]]
-name = "tantivy-tokenizer-api"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2a0dcade25819a89cfe6f17d932c9cedff11989936bf6dd4f336d50392053b04"
-dependencies = [
- "serde",
-]
-
-[[package]]
-name = "tao"
-version = "0.16.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6a6d198e01085564cea63e976ad1566c1ba2c2e4cc79578e35d9f05521505e31"
-dependencies = [
- "bitflags 1.3.2",
- "cairo-rs",
- "cc",
- "cocoa",
- "core-foundation",
- "core-graphics",
- "crossbeam-channel",
- "dispatch",
- "gdk",
- "gdk-pixbuf",
- "gdk-sys",
- "gdkwayland-sys",
- "gdkx11-sys",
- "gio",
- "glib",
- "glib-sys",
- "gtk",
- "image",
- "instant",
- "jni",
- "lazy_static",
- "libc",
- "log",
- "ndk",
- "ndk-context",
- "ndk-sys",
- "objc",
- "once_cell",
- "parking_lot 0.12.1",
- "png",
- "raw-window-handle",
- "scopeguard",
- "serde",
- "tao-macros",
- "unicode-segmentation",
- "uuid",
- "windows 0.39.0",
- "windows-implement",
- "x11-dl",
-]
-
-[[package]]
-name = "tao-macros"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3b27a4bcc5eb524658234589bdffc7e7bfb996dbae6ce9393bfd39cb4159b445"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 1.0.109",
-]
-
-[[package]]
-name = "tap"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369"
-
-[[package]]
-name = "tar"
-version = "0.4.38"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4b55807c0344e1e6c04d7c965f5289c39a8d94ae23ed5c0b57aabac549f871c6"
-dependencies = [
- "filetime",
- "libc",
- "xattr 0.2.3",
-]
-
-[[package]]
-name = "target-lexicon"
-version = "0.12.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1b1c7f239eb94671427157bd93b3694320f3668d4e1eff08c7285366fd777fac"
-
-[[package]]
-name = "tauri"
-version = "1.5.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9bfe673cf125ef364d6f56b15e8ce7537d9ca7e4dae1cf6fbbdeed2e024db3d9"
-dependencies = [
- "anyhow",
- "cocoa",
- "dirs-next",
- "embed_plist",
- "encoding_rs",
- "flate2",
- "futures-util",
- "glib",
- "glob",
- "gtk",
- "heck 0.4.1",
- "http",
- "ignore",
- "objc",
- "once_cell",
- "open",
- "percent-encoding",
- "rand 0.8.5",
- "raw-window-handle",
- "regex",
- "rfd",
- "semver",
- "serde",
- "serde_json",
- "serde_repr",
- "serialize-to-javascript",
- "state",
- "tar",
- "tauri-macros",
- "tauri-runtime",
- "tauri-runtime-wry",
- "tauri-utils",
- "tempfile",
- "thiserror",
- "tokio",
- "url",
- "uuid",
- "webkit2gtk",
- "webview2-com",
- "windows 0.39.0",
-]
-
-[[package]]
-name = "tauri-build"
-version = "1.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "defbfc551bd38ab997e5f8e458f87396d2559d05ce32095076ad6c30f7fc5f9c"
-dependencies = [
- "anyhow",
- "cargo_toml",
- "dirs-next",
- "heck 0.4.1",
- "json-patch",
- "semver",
- "serde",
- "serde_json",
- "tauri-utils",
- "tauri-winres",
- "walkdir",
-]
-
-[[package]]
-name = "tauri-codegen"
-version = "1.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7b3475e55acec0b4a50fb96435f19631fb58cbcd31923e1a213de5c382536bbb"
-dependencies = [
- "base64 0.21.5",
- "brotli",
- "ico",
- "json-patch",
- "plist",
- "png",
- "proc-macro2",
- "quote",
- "regex",
- "semver",
- "serde",
- "serde_json",
- "sha2",
- "tauri-utils",
- "thiserror",
- "time",
- "uuid",
- "walkdir",
-]
-
-[[package]]
-name = "tauri-macros"
-version = "1.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "613740228de92d9196b795ac455091d3a5fbdac2654abb8bb07d010b62ab43af"
-dependencies = [
- "heck 0.4.1",
- "proc-macro2",
- "quote",
- "syn 1.0.109",
- "tauri-codegen",
- "tauri-utils",
-]
-
-[[package]]
-name = "tauri-plugin-deep-link"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4536f5f6602e8fdfaa7b3b185076c2a0704f8eb7015f4e58461eb483ec3ed1f8"
-dependencies = [
- "dirs",
- "interprocess",
- "log",
- "objc2",
- "once_cell",
- "tauri-utils",
- "windows-sys 0.48.0",
- "winreg 0.50.0",
-]
-
-[[package]]
-name = "tauri-runtime"
-version = "0.14.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "07f8e9e53e00e9f41212c115749e87d5cd2a9eebccafca77a19722eeecd56d43"
-dependencies = [
- "gtk",
- "http",
- "http-range",
- "rand 0.8.5",
- "raw-window-handle",
- "serde",
- "serde_json",
- "tauri-utils",
- "thiserror",
- "url",
- "uuid",
- "webview2-com",
- "windows 0.39.0",
-]
-
-[[package]]
-name = "tauri-runtime-wry"
-version = "0.14.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8141d72b6b65f2008911e9ef5b98a68d1e3413b7a1464e8f85eb3673bb19a895"
-dependencies = [
- "cocoa",
- "gtk",
- "percent-encoding",
- "rand 0.8.5",
- "raw-window-handle",
- "tauri-runtime",
- "tauri-utils",
- "uuid",
- "webkit2gtk",
- "webview2-com",
- "windows 0.39.0",
- "wry",
-]
-
-[[package]]
-name = "tauri-utils"
-version = "1.5.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ece74810b1d3d44f29f732a7ae09a63183d63949bbdd59c61f8ed2a1b70150db"
-dependencies = [
- "brotli",
- "ctor",
- "dunce",
- "glob",
- "heck 0.4.1",
- "html5ever 0.26.0",
- "infer",
- "json-patch",
- "kuchikiki",
- "log",
- "memchr",
- "phf 0.11.2",
- "proc-macro2",
- "quote",
- "semver",
- "serde",
- "serde_json",
- "serde_with",
- "thiserror",
- "url",
- "walkdir",
- "windows-version",
-]
-
-[[package]]
-name = "tauri-winres"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5993dc129e544393574288923d1ec447c857f3f644187f4fbf7d9a875fbfc4fb"
-dependencies = [
- "embed-resource",
- "toml 0.7.5",
-]
-
-[[package]]
-name = "tempfile"
-version = "3.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa"
-dependencies = [
- "cfg-if",
- "fastrand",
- "redox_syscall 0.4.1",
- "rustix",
- "windows-sys 0.52.0",
-]
-
-[[package]]
-name = "tendril"
-version = "0.4.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d24a120c5fc464a3458240ee02c299ebcb9d67b5249c8848b09d639dca8d7bb0"
-dependencies = [
- "futf",
- "mac",
- "utf-8",
-]
-
-[[package]]
-name = "tera"
-version = "1.19.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a5ab29bb4f3e256ae6ad5c3e2775aa1f8829f2c0c101fc407bfd3a6df15c60c5"
-dependencies = [
- "chrono",
- "chrono-tz 0.6.1",
- "globwalk",
- "humansize",
- "lazy_static",
- "percent-encoding",
- "pest",
- "pest_derive",
- "rand 0.8.5",
- "regex",
- "serde",
- "serde_json",
- "slug",
- "thread_local",
- "unic-segment",
-]
-
-[[package]]
-name = "terminal_size"
-version = "0.1.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "633c1a546cee861a1a6d0dc69ebeca693bf4296661ba7852b9d21d159e0506df"
-dependencies = [
- "libc",
- "winapi",
-]
-
-[[package]]
-name = "thin-slice"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8eaa81235c7058867fa8c0e7314f33dcce9c215f535d1913822a2b3f5e289f3c"
-
-[[package]]
-name = "thiserror"
-version = "1.0.64"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84"
-dependencies = [
- "thiserror-impl",
-]
-
-[[package]]
-name = "thiserror-impl"
-version = "1.0.64"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.47",
-]
-
-[[package]]
-name = "thread-id"
-version = "3.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c7fbf4c9d56b320106cd64fd024dadfa0be7cb4706725fc44a7d7ce952d820c1"
-dependencies = [
- "libc",
- "redox_syscall 0.1.57",
- "winapi",
-]
-
-[[package]]
-name = "thread_local"
-version = "1.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180"
-dependencies = [
- "once_cell",
-]
-
-[[package]]
-name = "time"
-version = "0.3.36"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885"
-dependencies = [
- "deranged",
- "itoa 1.0.6",
- "num-conv",
- "powerfmt",
- "serde",
- "time-core",
- "time-macros",
-]
-
-[[package]]
-name = "time-core"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3"
-
-[[package]]
-name = "time-macros"
-version = "0.2.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf"
-dependencies = [
- "num-conv",
- "time-core",
-]
-
-[[package]]
-name = "tinystr"
-version = "0.7.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f"
-dependencies = [
- "displaydoc",
- "zerovec",
-]
-
-[[package]]
-name = "tinyvec"
-version = "1.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50"
-dependencies = [
- "tinyvec_macros",
-]
-
-[[package]]
-name = "tinyvec_macros"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
-
-[[package]]
-name = "to_method"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c7c4ceeeca15c8384bbc3e011dbd8fccb7f068a440b752b7d9b32ceb0ca0e2e8"
-
-[[package]]
-name = "tokio"
-version = "1.38.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a"
-dependencies = [
- "backtrace",
- "bytes",
- "libc",
- "mio",
- "num_cpus",
- "parking_lot 0.12.1",
- "pin-project-lite",
- "signal-hook-registry",
- "socket2 0.5.5",
- "tokio-macros",
- "tracing",
- "windows-sys 0.48.0",
-]
-
-[[package]]
-name = "tokio-macros"
-version = "2.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.47",
-]
-
-[[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-retry"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7f57eb36ecbe0fc510036adff84824dd3c24bb781e21bfa67b69d556aa85214f"
-dependencies = [
- "pin-project",
- "rand 0.8.5",
- "tokio",
-]
-
-[[package]]
-name = "tokio-rustls"
-version = "0.24.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081"
-dependencies = [
- "rustls",
- "tokio",
-]
-
-[[package]]
-name = "tokio-stream"
-version = "0.1.15"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af"
-dependencies = [
- "futures-core",
- "pin-project-lite",
- "tokio",
- "tokio-util",
-]
-
-[[package]]
-name = "tokio-tungstenite"
-version = "0.20.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c"
-dependencies = [
- "futures-util",
- "log",
- "native-tls",
- "tokio",
- "tokio-native-tls",
- "tungstenite",
-]
-
-[[package]]
-name = "tokio-util"
-version = "0.7.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1"
-dependencies = [
- "bytes",
- "futures-core",
- "futures-io",
- "futures-sink",
- "futures-util",
- "hashbrown 0.14.3",
- "pin-project-lite",
- "slab",
- "tokio",
-]
-
-[[package]]
-name = "toml"
-version = "0.5.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234"
-dependencies = [
- "serde",
-]
-
-[[package]]
-name = "toml"
-version = "0.7.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1ebafdf5ad1220cb59e7d17cf4d2c72015297b75b19a10472f99b89225089240"
-dependencies = [
- "serde",
- "serde_spanned",
- "toml_datetime",
- "toml_edit 0.19.11",
-]
-
-[[package]]
-name = "toml_datetime"
-version = "0.6.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b"
-dependencies = [
- "serde",
-]
-
-[[package]]
-name = "toml_edit"
-version = "0.19.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "266f016b7f039eec8a1a80dfe6156b633d208b9fccca5e4db1d6775b0c4e34a7"
-dependencies = [
- "indexmap 2.1.0",
- "serde",
- "serde_spanned",
- "toml_datetime",
- "winnow 0.4.7",
-]
-
-[[package]]
-name = "toml_edit"
-version = "0.20.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338"
-dependencies = [
- "indexmap 2.1.0",
- "toml_datetime",
- "winnow 0.5.40",
-]
-
-[[package]]
-name = "tower-service"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52"
-
-[[package]]
-name = "tracing"
-version = "0.1.41"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0"
-dependencies = [
- "log",
- "pin-project-lite",
- "tracing-attributes",
- "tracing-core",
-]
-
-[[package]]
-name = "tracing-appender"
-version = "0.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3566e8ce28cc0a3fe42519fc80e6b4c943cc4c8cef275620eb8dac2d3d4e06cf"
-dependencies = [
- "crossbeam-channel",
- "thiserror",
- "time",
- "tracing-subscriber",
-]
-
-[[package]]
-name = "tracing-attributes"
-version = "0.1.28"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.47",
-]
-
-[[package]]
-name = "tracing-bunyan-formatter"
-version = "0.3.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2d637245a0d8774bd48df6482e086c59a8b5348a910c3b0579354045a9d82411"
-dependencies = [
- "ahash 0.8.6",
- "gethostname",
- "log",
- "serde",
- "serde_json",
- "time",
- "tracing",
- "tracing-core",
- "tracing-log 0.1.3",
- "tracing-subscriber",
-]
-
-[[package]]
-name = "tracing-core"
-version = "0.1.33"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c"
-dependencies = [
- "once_cell",
- "valuable",
-]
-
-[[package]]
-name = "tracing-log"
-version = "0.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922"
-dependencies = [
- "lazy_static",
- "log",
- "tracing-core",
-]
-
-[[package]]
-name = "tracing-log"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3"
-dependencies = [
- "log",
- "once_cell",
- "tracing-core",
-]
-
-[[package]]
-name = "tracing-serde"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "704b1aeb7be0d0a84fc9828cae51dab5970fee5088f83d1dd7ee6f6246fc6ff1"
-dependencies = [
- "serde",
- "tracing-core",
-]
-
-[[package]]
-name = "tracing-subscriber"
-version = "0.3.19"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008"
-dependencies = [
- "matchers",
- "nu-ansi-term",
- "once_cell",
- "regex",
- "serde",
- "serde_json",
- "sharded-slab",
- "smallvec",
- "thread_local",
- "tracing",
- "tracing-core",
- "tracing-log 0.2.0",
- "tracing-serde",
-]
-
-[[package]]
-name = "tracing-wasm"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4575c663a174420fa2d78f4108ff68f65bf2fbb7dd89f33749b6e826b3626e07"
-dependencies = [
- "tracing",
- "tracing-subscriber",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "treediff"
-version = "4.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "52984d277bdf2a751072b5df30ec0377febdb02f7696d64c2d7d54630bac4303"
-dependencies = [
- "serde_json",
-]
-
-[[package]]
-name = "triomphe"
-version = "0.1.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "859eb650cfee7434994602c3a68b25d77ad9e68c8a6cd491616ef86661382eb3"
-
-[[package]]
-name = "try-lock"
-version = "0.2.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed"
-
-[[package]]
-name = "tsify"
-version = "0.4.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d6b26cf145f2f3b9ff84e182c448eaf05468e247f148cf3d2a7d67d78ff023a0"
-dependencies = [
- "gloo-utils",
- "serde",
- "serde_json",
- "tsify-macros",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "tsify-macros"
-version = "0.4.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7a94b0f0954b3e59bfc2c246b4c8574390d94a4ad4ad246aaf2fb07d7dfd3b47"
-dependencies = [
- "proc-macro2",
- "quote",
- "serde_derive_internals",
- "syn 2.0.47",
-]
-
-[[package]]
-name = "tungstenite"
-version = "0.20.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9e3dac10fd62eaf6617d3a904ae222845979aec67c615d1c842b4002c7666fb9"
-dependencies = [
- "byteorder",
- "bytes",
- "data-encoding",
- "http",
- "httparse",
- "log",
- "native-tls",
- "rand 0.8.5",
- "sha1",
- "thiserror",
- "url",
- "utf-8",
-]
-
-[[package]]
-name = "typenum"
-version = "1.16.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba"
-
-[[package]]
-name = "ucd-trie"
-version = "0.1.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81"
-
-[[package]]
-name = "uncased"
-version = "0.9.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9b9bc53168a4be7402ab86c3aad243a84dd7381d09be0eddc81280c1da95ca68"
-dependencies = [
- "version_check",
-]
-
-[[package]]
-name = "unic-char-property"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a8c57a407d9b6fa02b4795eb81c5b6652060a15a7903ea981f3d723e6c0be221"
-dependencies = [
- "unic-char-range",
-]
-
-[[package]]
-name = "unic-char-range"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0398022d5f700414f6b899e10b8348231abf9173fa93144cbc1a43b9793c1fbc"
-
-[[package]]
-name = "unic-common"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "80d7ff825a6a654ee85a63e80f92f054f904f21e7d12da4e22f9834a4aaa35bc"
-
-[[package]]
-name = "unic-segment"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e4ed5d26be57f84f176157270c112ef57b86debac9cd21daaabbe56db0f88f23"
-dependencies = [
- "unic-ucd-segment",
-]
-
-[[package]]
-name = "unic-ucd-segment"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2079c122a62205b421f499da10f3ee0f7697f012f55b675e002483c73ea34700"
-dependencies = [
- "unic-char-property",
- "unic-char-range",
- "unic-ucd-version",
-]
-
-[[package]]
-name = "unic-ucd-version"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "96bd2f2237fe450fcd0a1d2f5f4e91711124f7857ba2e964247776ebeeb7b0c4"
-dependencies = [
- "unic-common",
-]
-
-[[package]]
-name = "unicase"
-version = "2.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89"
-dependencies = [
- "version_check",
-]
-
-[[package]]
-name = "unicode-bidi"
-version = "0.3.13"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460"
-
-[[package]]
-name = "unicode-id"
-version = "0.3.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b1b6def86329695390197b82c1e244a54a131ceb66c996f2088a3876e2ae083f"
-
-[[package]]
-name = "unicode-ident"
-version = "1.0.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0"
-
-[[package]]
-name = "unicode-normalization"
-version = "0.1.22"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921"
-dependencies = [
- "tinyvec",
-]
-
-[[package]]
-name = "unicode-segmentation"
-version = "1.10.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36"
-
-[[package]]
-name = "unicode-width"
-version = "0.1.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b"
-
-[[package]]
-name = "universal-hash"
-version = "0.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea"
-dependencies = [
- "crypto-common",
- "subtle",
-]
-
-[[package]]
-name = "untrusted"
-version = "0.7.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a"
-
-[[package]]
-name = "url"
-version = "2.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633"
-dependencies = [
- "form_urlencoded",
- "idna 0.5.0",
- "percent-encoding",
- "serde",
-]
-
-[[package]]
-name = "utf-8"
-version = "0.7.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9"
-
-[[package]]
-name = "utf16_iter"
-version = "1.0.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246"
-
-[[package]]
-name = "utf8-ranges"
-version = "1.0.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7fcfc827f90e53a02eaef5e535ee14266c1d569214c6aa70133a624d8a3164ba"
-
-[[package]]
-name = "utf8_iter"
-version = "1.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be"
-
-[[package]]
-name = "uuid"
-version = "1.10.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314"
-dependencies = [
- "getrandom 0.2.10",
- "serde",
- "sha1_smol",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "validator"
-version = "0.18.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "db79c75af171630a3148bd3e6d7c4f42b6a9a014c2945bc5ed0020cbb8d9478e"
-dependencies = [
- "idna 0.5.0",
- "once_cell",
- "regex",
- "serde",
- "serde_derive",
- "serde_json",
- "url",
- "validator_derive 0.18.2",
-]
-
-[[package]]
-name = "validator"
-version = "0.19.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d0b4a29d8709210980a09379f27ee31549b73292c87ab9899beee1c0d3be6303"
-dependencies = [
- "idna 1.0.3",
- "once_cell",
- "regex",
- "serde",
- "serde_derive",
- "serde_json",
- "url",
- "validator_derive 0.19.0",
-]
-
-[[package]]
-name = "validator_derive"
-version = "0.18.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "df0bcf92720c40105ac4b2dda2a4ea3aa717d4d6a862cc217da653a4bd5c6b10"
-dependencies = [
- "darling",
- "once_cell",
- "proc-macro-error",
- "proc-macro2",
- "quote",
- "syn 2.0.47",
-]
-
-[[package]]
-name = "validator_derive"
-version = "0.19.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bac855a2ce6f843beb229757e6e570a42e837bcb15e5f449dd48d5747d41bf77"
-dependencies = [
- "darling",
- "once_cell",
- "proc-macro-error2",
- "proc-macro2",
- "quote",
- "syn 2.0.47",
-]
-
-[[package]]
-name = "valuable"
-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"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1c18c859eead79d8b95d09e4678566e8d70105c4e7b251f707a03df32442661b"
-
-[[package]]
-name = "version-compare"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "579a42fc0b8e0c63b76519a339be31bed574929511fa53c1a3acae26eb258f29"
-
-[[package]]
-name = "version_check"
-version = "0.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
-
-[[package]]
-name = "vswhom"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "be979b7f07507105799e854203b470ff7c78a1639e330a58f183b5fea574608b"
-dependencies = [
- "libc",
- "vswhom-sys",
-]
-
-[[package]]
-name = "vswhom-sys"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d3b17ae1f6c8a2b28506cd96d412eebf83b4a0ff2cbefeeb952f2f9dfa44ba18"
-dependencies = [
- "cc",
- "libc",
-]
-
-[[package]]
-name = "walkdir"
-version = "2.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b"
-dependencies = [
- "same-file",
- "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"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519"
-
-[[package]]
-name = "wasi"
-version = "0.11.0+wasi-snapshot-preview1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
-
-[[package]]
-name = "wasm-bindgen"
-version = "0.2.90"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406"
-dependencies = [
- "cfg-if",
- "wasm-bindgen-macro",
-]
-
-[[package]]
-name = "wasm-bindgen-backend"
-version = "0.2.90"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd"
-dependencies = [
- "bumpalo",
- "log",
- "once_cell",
- "proc-macro2",
- "quote",
- "syn 2.0.47",
- "wasm-bindgen-shared",
-]
-
-[[package]]
-name = "wasm-bindgen-futures"
-version = "0.4.40"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461"
-dependencies = [
- "cfg-if",
- "js-sys",
- "wasm-bindgen",
- "web-sys",
-]
-
-[[package]]
-name = "wasm-bindgen-macro"
-version = "0.2.90"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999"
-dependencies = [
- "quote",
- "wasm-bindgen-macro-support",
-]
-
-[[package]]
-name = "wasm-bindgen-macro-support"
-version = "0.2.90"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.47",
- "wasm-bindgen-backend",
- "wasm-bindgen-shared",
-]
-
-[[package]]
-name = "wasm-bindgen-shared"
-version = "0.2.90"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b"
-
-[[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 = "wasm-timer"
-version = "0.2.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f"
-dependencies = [
- "futures",
- "js-sys",
- "parking_lot 0.11.2",
- "pin-utils",
- "wasm-bindgen",
- "wasm-bindgen-futures",
- "web-sys",
-]
-
-[[package]]
-name = "web-sys"
-version = "0.3.64"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b"
-dependencies = [
- "js-sys",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "webkit2gtk"
-version = "0.18.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b8f859735e4a452aeb28c6c56a852967a8a76c8eb1cc32dbf931ad28a13d6370"
-dependencies = [
- "bitflags 1.3.2",
- "cairo-rs",
- "gdk",
- "gdk-sys",
- "gio",
- "gio-sys",
- "glib",
- "glib-sys",
- "gobject-sys",
- "gtk",
- "gtk-sys",
- "javascriptcore-rs",
- "libc",
- "once_cell",
- "soup2",
- "webkit2gtk-sys",
-]
-
-[[package]]
-name = "webkit2gtk-sys"
-version = "0.18.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4d76ca6ecc47aeba01ec61e480139dda143796abcae6f83bcddf50d6b5b1dcf3"
-dependencies = [
- "atk-sys",
- "bitflags 1.3.2",
- "cairo-sys-rs",
- "gdk-pixbuf-sys",
- "gdk-sys",
- "gio-sys",
- "glib-sys",
- "gobject-sys",
- "gtk-sys",
- "javascriptcore-rs-sys",
- "libc",
- "pango-sys",
- "pkg-config",
- "soup2-sys",
- "system-deps 6.1.1",
-]
-
-[[package]]
-name = "webpki-roots"
-version = "0.25.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc"
-
-[[package]]
-name = "webview2-com"
-version = "0.19.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b4a769c9f1a64a8734bde70caafac2b96cada12cd4aefa49196b3a386b8b4178"
-dependencies = [
- "webview2-com-macros",
- "webview2-com-sys",
- "windows 0.39.0",
- "windows-implement",
-]
-
-[[package]]
-name = "webview2-com-macros"
-version = "0.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eaebe196c01691db62e9e4ca52c5ef1e4fd837dcae27dae3ada599b5a8fd05ac"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 1.0.109",
-]
-
-[[package]]
-name = "webview2-com-sys"
-version = "0.19.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "aac48ef20ddf657755fdcda8dfed2a7b4fc7e4581acce6fe9b88c3d64f29dee7"
-dependencies = [
- "regex",
- "serde",
- "serde_json",
- "thiserror",
- "windows 0.39.0",
- "windows-bindgen",
- "windows-metadata",
-]
-
-[[package]]
-name = "which"
-version = "4.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269"
-dependencies = [
- "either",
- "libc",
- "once_cell",
-]
-
-[[package]]
-name = "winapi"
-version = "0.3.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
-dependencies = [
- "winapi-i686-pc-windows-gnu",
- "winapi-x86_64-pc-windows-gnu",
-]
-
-[[package]]
-name = "winapi-i686-pc-windows-gnu"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
-
-[[package]]
-name = "winapi-util"
-version = "0.1.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
-dependencies = [
- "winapi",
-]
-
-[[package]]
-name = "winapi-x86_64-pc-windows-gnu"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
-
-[[package]]
-name = "windows"
-version = "0.37.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "57b543186b344cc61c85b5aab0d2e3adf4e0f99bc076eff9aa5927bcc0b8a647"
-dependencies = [
- "windows_aarch64_msvc 0.37.0",
- "windows_i686_gnu 0.37.0",
- "windows_i686_msvc 0.37.0",
- "windows_x86_64_gnu 0.37.0",
- "windows_x86_64_msvc 0.37.0",
-]
-
-[[package]]
-name = "windows"
-version = "0.39.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f1c4bd0a50ac6020f65184721f758dba47bb9fbc2133df715ec74a237b26794a"
-dependencies = [
- "windows-implement",
- "windows_aarch64_msvc 0.39.0",
- "windows_i686_gnu 0.39.0",
- "windows_i686_msvc 0.39.0",
- "windows_x86_64_gnu 0.39.0",
- "windows_x86_64_msvc 0.39.0",
-]
-
-[[package]]
-name = "windows"
-version = "0.48.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f"
-dependencies = [
- "windows-targets 0.48.0",
-]
-
-[[package]]
-name = "windows"
-version = "0.52.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be"
-dependencies = [
- "windows-core",
- "windows-targets 0.52.0",
-]
-
-[[package]]
-name = "windows-bindgen"
-version = "0.39.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "68003dbd0e38abc0fb85b939240f4bce37c43a5981d3df37ccbaaa981b47cb41"
-dependencies = [
- "windows-metadata",
- "windows-tokens",
-]
-
-[[package]]
-name = "windows-core"
-version = "0.52.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9"
-dependencies = [
- "windows-targets 0.52.0",
-]
-
-[[package]]
-name = "windows-implement"
-version = "0.39.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ba01f98f509cb5dc05f4e5fc95e535f78260f15fea8fe1a8abdd08f774f1cee7"
-dependencies = [
- "syn 1.0.109",
- "windows-tokens",
-]
-
-[[package]]
-name = "windows-metadata"
-version = "0.39.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9ee5e275231f07c6e240d14f34e1b635bf1faa1c76c57cfd59a5cdb9848e4278"
-
-[[package]]
-name = "windows-sys"
-version = "0.42.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7"
-dependencies = [
- "windows_aarch64_gnullvm 0.42.2",
- "windows_aarch64_msvc 0.42.2",
- "windows_i686_gnu 0.42.2",
- "windows_i686_msvc 0.42.2",
- "windows_x86_64_gnu 0.42.2",
- "windows_x86_64_gnullvm 0.42.2",
- "windows_x86_64_msvc 0.42.2",
-]
-
-[[package]]
-name = "windows-sys"
-version = "0.48.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"
-dependencies = [
- "windows-targets 0.48.0",
-]
-
-[[package]]
-name = "windows-sys"
-version = "0.52.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
-dependencies = [
- "windows-targets 0.52.0",
-]
-
-[[package]]
-name = "windows-targets"
-version = "0.48.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5"
-dependencies = [
- "windows_aarch64_gnullvm 0.48.0",
- "windows_aarch64_msvc 0.48.0",
- "windows_i686_gnu 0.48.0",
- "windows_i686_msvc 0.48.0",
- "windows_x86_64_gnu 0.48.0",
- "windows_x86_64_gnullvm 0.48.0",
- "windows_x86_64_msvc 0.48.0",
-]
-
-[[package]]
-name = "windows-targets"
-version = "0.52.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd"
-dependencies = [
- "windows_aarch64_gnullvm 0.52.0",
- "windows_aarch64_msvc 0.52.0",
- "windows_i686_gnu 0.52.0",
- "windows_i686_msvc 0.52.0",
- "windows_x86_64_gnu 0.52.0",
- "windows_x86_64_gnullvm 0.52.0",
- "windows_x86_64_msvc 0.52.0",
-]
-
-[[package]]
-name = "windows-tokens"
-version = "0.39.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f838de2fe15fe6bac988e74b798f26499a8b21a9d97edec321e79b28d1d7f597"
-
-[[package]]
-name = "windows-version"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "75aa004c988e080ad34aff5739c39d0312f4684699d6d71fc8a198d057b8b9b4"
-dependencies = [
- "windows-targets 0.52.0",
-]
-
-[[package]]
-name = "windows_aarch64_gnullvm"
-version = "0.42.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8"
-
-[[package]]
-name = "windows_aarch64_gnullvm"
-version = "0.48.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc"
-
-[[package]]
-name = "windows_aarch64_gnullvm"
-version = "0.52.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea"
-
-[[package]]
-name = "windows_aarch64_msvc"
-version = "0.37.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2623277cb2d1c216ba3b578c0f3cf9cdebeddb6e66b1b218bb33596ea7769c3a"
-
-[[package]]
-name = "windows_aarch64_msvc"
-version = "0.39.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ec7711666096bd4096ffa835238905bb33fb87267910e154b18b44eaabb340f2"
-
-[[package]]
-name = "windows_aarch64_msvc"
-version = "0.42.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43"
-
-[[package]]
-name = "windows_aarch64_msvc"
-version = "0.48.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3"
-
-[[package]]
-name = "windows_aarch64_msvc"
-version = "0.52.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef"
-
-[[package]]
-name = "windows_i686_gnu"
-version = "0.37.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d3925fd0b0b804730d44d4b6278c50f9699703ec49bcd628020f46f4ba07d9e1"
-
-[[package]]
-name = "windows_i686_gnu"
-version = "0.39.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "763fc57100a5f7042e3057e7e8d9bdd7860d330070251a73d003563a3bb49e1b"
-
-[[package]]
-name = "windows_i686_gnu"
-version = "0.42.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f"
-
-[[package]]
-name = "windows_i686_gnu"
-version = "0.48.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241"
-
-[[package]]
-name = "windows_i686_gnu"
-version = "0.52.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313"
-
-[[package]]
-name = "windows_i686_msvc"
-version = "0.37.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ce907ac74fe331b524c1298683efbf598bb031bc84d5e274db2083696d07c57c"
-
-[[package]]
-name = "windows_i686_msvc"
-version = "0.39.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7bc7cbfe58828921e10a9f446fcaaf649204dcfe6c1ddd712c5eebae6bda1106"
-
-[[package]]
-name = "windows_i686_msvc"
-version = "0.42.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060"
-
-[[package]]
-name = "windows_i686_msvc"
-version = "0.48.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00"
-
-[[package]]
-name = "windows_i686_msvc"
-version = "0.52.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a"
-
-[[package]]
-name = "windows_x86_64_gnu"
-version = "0.37.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2babfba0828f2e6b32457d5341427dcbb577ceef556273229959ac23a10af33d"
-
-[[package]]
-name = "windows_x86_64_gnu"
-version = "0.39.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6868c165637d653ae1e8dc4d82c25d4f97dd6605eaa8d784b5c6e0ab2a252b65"
-
-[[package]]
-name = "windows_x86_64_gnu"
-version = "0.42.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36"
-
-[[package]]
-name = "windows_x86_64_gnu"
-version = "0.48.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1"
-
-[[package]]
-name = "windows_x86_64_gnu"
-version = "0.52.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd"
-
-[[package]]
-name = "windows_x86_64_gnullvm"
-version = "0.42.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3"
-
-[[package]]
-name = "windows_x86_64_gnullvm"
-version = "0.48.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953"
-
-[[package]]
-name = "windows_x86_64_gnullvm"
-version = "0.52.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e"
-
-[[package]]
-name = "windows_x86_64_msvc"
-version = "0.37.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f4dd6dc7df2d84cf7b33822ed5b86318fb1781948e9663bacd047fc9dd52259d"
-
-[[package]]
-name = "windows_x86_64_msvc"
-version = "0.39.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5e4d40883ae9cae962787ca76ba76390ffa29214667a111db9e0a1ad8377e809"
-
-[[package]]
-name = "windows_x86_64_msvc"
-version = "0.42.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0"
-
-[[package]]
-name = "windows_x86_64_msvc"
-version = "0.48.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a"
-
-[[package]]
-name = "windows_x86_64_msvc"
-version = "0.52.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04"
-
-[[package]]
-name = "winnow"
-version = "0.4.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ca0ace3845f0d96209f0375e6d367e3eb87eb65d27d445bdc9f1843a26f39448"
-dependencies = [
- "memchr",
-]
-
-[[package]]
-name = "winnow"
-version = "0.5.40"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876"
-dependencies = [
- "memchr",
-]
-
-[[package]]
-name = "winreg"
-version = "0.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "76a1a57ff50e9b408431e8f97d5456f2807f8eb2a2cd79b06068fc87f8ecf189"
-dependencies = [
- "cfg-if",
- "winapi",
-]
-
-[[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 = "write16"
-version = "1.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936"
-
-[[package]]
-name = "writeable"
-version = "0.5.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51"
-
-[[package]]
-name = "wry"
-version = "0.24.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "64a70547e8f9d85da0f5af609143f7bde3ac7457a6e1073104d9b73d6c5ac744"
-dependencies = [
- "base64 0.13.1",
- "block",
- "cocoa",
- "core-graphics",
- "crossbeam-channel",
- "dunce",
- "gdk",
- "gio",
- "glib",
- "gtk",
- "html5ever 0.25.2",
- "http",
- "kuchiki",
- "libc",
- "log",
- "objc",
- "objc_id",
- "once_cell",
- "serde",
- "serde_json",
- "sha2",
- "soup2",
- "tao",
- "thiserror",
- "url",
- "webkit2gtk",
- "webkit2gtk-sys",
- "webview2-com",
- "windows 0.39.0",
- "windows-implement",
-]
-
-[[package]]
-name = "wyz"
-version = "0.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed"
-dependencies = [
- "tap",
-]
-
-[[package]]
-name = "x11"
-version = "2.21.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "502da5464ccd04011667b11c435cb992822c2c0dbde1770c988480d312a0db2e"
-dependencies = [
- "libc",
- "pkg-config",
-]
-
-[[package]]
-name = "x11-dl"
-version = "2.21.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "38735924fedd5314a6e548792904ed8c6de6636285cb9fec04d5b1db85c1516f"
-dependencies = [
- "libc",
- "once_cell",
- "pkg-config",
-]
-
-[[package]]
-name = "xattr"
-version = "0.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6d1526bbe5aaeb5eb06885f4d987bcdfa5e23187055de9b83fe00156a821fabc"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "xattr"
-version = "1.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f"
-dependencies = [
- "libc",
- "linux-raw-sys",
- "rustix",
-]
-
-[[package]]
-name = "xz2"
-version = "0.1.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "388c44dc09d76f1536602ead6d325eb532f5c122f17782bd57fb47baeeb767e2"
-dependencies = [
- "lzma-sys",
-]
-
-[[package]]
-name = "yoke"
-version = "0.7.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40"
-dependencies = [
- "serde",
- "stable_deref_trait",
- "yoke-derive",
- "zerofrom",
-]
-
-[[package]]
-name = "yoke-derive"
-version = "0.7.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.47",
- "synstructure",
-]
-
-[[package]]
-name = "yrs"
-version = "0.21.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "81de5913bca29f43a1d12ca92a7b39a2945e9420e01602a7563917c7bfc60f70"
-dependencies = [
- "arc-swap",
- "async-lock",
- "async-trait",
- "dashmap 6.0.1",
- "fastrand",
- "serde",
- "serde_json",
- "smallstr",
- "smallvec",
- "thiserror",
-]
-
-[[package]]
-name = "zerocopy"
-version = "0.7.26"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0"
-dependencies = [
- "zerocopy-derive",
-]
-
-[[package]]
-name = "zerocopy-derive"
-version = "0.7.26"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.47",
-]
-
-[[package]]
-name = "zerofrom"
-version = "0.1.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e"
-dependencies = [
- "zerofrom-derive",
-]
-
-[[package]]
-name = "zerofrom-derive"
-version = "0.1.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.47",
- "synstructure",
-]
-
-[[package]]
-name = "zeroize"
-version = "1.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde"
-dependencies = [
- "zeroize_derive",
-]
-
-[[package]]
-name = "zeroize_derive"
-version = "1.4.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.47",
-]
-
-[[package]]
-name = "zerovec"
-version = "0.10.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079"
-dependencies = [
- "yoke",
- "zerofrom",
- "zerovec-derive",
-]
-
-[[package]]
-name = "zerovec-derive"
-version = "0.10.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.47",
-]
-
-[[package]]
-name = "zip"
-version = "0.6.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261"
-dependencies = [
- "aes",
- "byteorder",
- "bzip2",
- "constant_time_eq 0.1.5",
- "crc32fast",
- "crossbeam-utils",
- "flate2",
- "hmac",
- "pbkdf2 0.11.0",
- "sha1",
- "time",
- "zstd 0.11.2+zstd.1.5.2",
-]
-
-[[package]]
-name = "zip"
-version = "2.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dc5e4288ea4057ae23afc69a4472434a87a2495cafce6632fd1c4ec9f5cf3494"
-dependencies = [
- "aes",
- "arbitrary",
- "bzip2",
- "constant_time_eq 0.3.0",
- "crc32fast",
- "crossbeam-utils",
- "deflate64",
- "displaydoc",
- "flate2",
- "hmac",
- "indexmap 2.1.0",
- "lzma-rs",
- "memchr",
- "pbkdf2 0.12.2",
- "rand 0.8.5",
- "sha1",
- "thiserror",
- "time",
- "zeroize",
- "zopfli",
- "zstd 0.13.2",
-]
-
-[[package]]
-name = "zip-extensions"
-version = "0.8.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eb0a99499b3497d765525c5d05e3ade9ca4a731c184365c19472c3fd6ba86341"
-dependencies = [
- "zip 2.2.0",
-]
-
-[[package]]
-name = "zopfli"
-version = "0.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e5019f391bac5cf252e93bbcc53d039ffd62c7bfb7c150414d61369afe57e946"
-dependencies = [
- "bumpalo",
- "crc32fast",
- "lockfree-object-pool",
- "log",
- "once_cell",
- "simd-adler32",
-]
-
-[[package]]
-name = "zstd"
-version = "0.11.2+zstd.1.5.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4"
-dependencies = [
- "zstd-safe 5.0.2+zstd.1.5.2",
-]
-
-[[package]]
-name = "zstd"
-version = "0.13.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fcf2b778a664581e31e389454a7072dab1647606d44f7feea22cd5abb9c9f3f9"
-dependencies = [
- "zstd-safe 7.2.0",
-]
-
-[[package]]
-name = "zstd-safe"
-version = "5.0.2+zstd.1.5.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db"
-dependencies = [
- "libc",
- "zstd-sys",
-]
-
-[[package]]
-name = "zstd-safe"
-version = "7.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fa556e971e7b568dc775c136fc9de8c779b1c2fc3a63defaafadffdbd3181afa"
-dependencies = [
- "zstd-sys",
-]
-
-[[package]]
-name = "zstd-sys"
-version = "2.0.12+zstd.1.5.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0a4e40c320c3cb459d9a9ff6de98cff88f4751ee9275d140e2be94a2b74e4c13"
-dependencies = [
- "cc",
- "pkg-config",
-]
diff --git a/frontend/appflowy_tauri/src-tauri/Cargo.toml b/frontend/appflowy_tauri/src-tauri/Cargo.toml
deleted file mode 100644
index f85e7c9151..0000000000
--- a/frontend/appflowy_tauri/src-tauri/Cargo.toml
+++ /dev/null
@@ -1,137 +0,0 @@
-[package]
-name = "appflowy_tauri"
-version = "0.0.0"
-description = "A Tauri App"
-authors = ["you"]
-license = ""
-repository = ""
-edition = "2021"
-rust-version = "1.57"
-
-# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
-
-[build-dependencies]
-tauri-build = { version = "1.5", features = [] }
-
-[workspace.dependencies]
-anyhow = "1.0"
-tracing = "0.1.40"
-bytes = "1.5.0"
-serde = "1.0"
-serde_json = "1.0.108"
-protobuf.workspace = true
-
-diesel = { version = "2.1.0", features = [
- "sqlite",
- "chrono",
- "r2d2",
- "serde_json",
-] }
-uuid = { version = "1.5.0", features = ["serde", "v4"] }
-serde_repr = "0.1"
-parking_lot = "0.12"
-futures = "0.3.29"
-tokio = "1.34.0"
-tokio-stream = "0.1.14"
-async-trait = "0.1.74"
-chrono = { version = "0.4.31", default-features = false, features = ["clock"] }
-zip = "2.2.0"
-yrs = "0.19.1"
-# Please use the following script to update collab.
-# Working directory: frontend
-#
-# To update the commit ID, run:
-# scripts/tool/update_collab_rev.sh new_rev_id
-#
-# To switch to the local path, run:
-# scripts/tool/update_collab_source.sh
-# ⚠️⚠️⚠️️
-collab = { version = "0.2" }
-collab-entity = { version = "0.2" }
-collab-folder = { version = "0.2" }
-collab-document = { version = "0.2" }
-collab-database = { version = "0.2" }
-collab-plugins = { version = "0.2" }
-collab-user = { version = "0.2" }
-collab-importer = { version = "0.1" }
-
-# Please using the following command to update the revision id
-# Current directory: frontend
-# Run the script:
-# scripts/tool/update_client_api_rev.sh new_rev_id
-# ⚠️⚠️⚠️️
-client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "ea131f0baab67defe7591067357eced490072372" }
-
-[dependencies]
-serde_json.workspace = true
-serde.workspace = true
-tauri = { version = "1.5", features = [
- "dialog-all",
- "clipboard-all",
- "fs-all",
- "shell-open",
-] }
-tauri-utils = "1.5.2"
-bytes.workspace = true
-tracing.workspace = true
-lib-dispatch = { path = "../../rust-lib/lib-dispatch", features = [
- "use_serde",
-] }
-flowy-core = { path = "../../rust-lib/flowy-core", features = ["ts"] }
-flowy-user = { path = "../../rust-lib/flowy-user", features = ["tauri_ts"] }
-flowy-date = { path = "../../rust-lib/flowy-date", features = ["tauri_ts"] }
-flowy-ai = { path = "../../rust-lib/flowy-ai", features = ["tauri_ts"] }
-flowy-error = { path = "../../rust-lib/flowy-error", features = [
- "impl_from_sqlite",
- "impl_from_dispatch_error",
- "impl_from_appflowy_cloud",
- "impl_from_reqwest",
- "impl_from_serde",
- "tauri_ts",
-] }
-flowy-search = { path = "../../rust-lib/flowy-search", features = ["tauri_ts"] }
-flowy-document = { path = "../../rust-lib/flowy-document", features = [
- "tauri_ts",
-] }
-flowy-notification = { path = "../../rust-lib/flowy-notification", features = [
- "tauri_ts",
-] }
-
-uuid = "1.5.0"
-tauri-plugin-deep-link = "0.1.2"
-dotenv = "0.15.0"
-semver = "1.0.23"
-
-[features]
-# by default Tauri runs in production mode
-# when `tauri dev` runs it is executed with `cargo run --no-default-features` if `devPath` is an URL
-default = ["custom-protocol"]
-# this feature is used used for production builds where `devPath` points to the filesystem
-# DO NOT remove this
-custom-protocol = ["tauri/custom-protocol"]
-
-[patch.crates-io]
-# Please use the following script to update collab.
-# Working directory: frontend
-#
-# To update the commit ID, run:
-# scripts/tool/update_collab_rev.sh new_rev_id
-#
-# To switch to the local path, run:
-# scripts/tool/update_collab_source.sh
-# ⚠️⚠️⚠️️
-collab = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "67b31e4bcc64d81332c37efecb0a8618681f1db9" }
-collab-entity = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "67b31e4bcc64d81332c37efecb0a8618681f1db9" }
-collab-folder = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "67b31e4bcc64d81332c37efecb0a8618681f1db9" }
-collab-document = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "67b31e4bcc64d81332c37efecb0a8618681f1db9" }
-collab-database = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "67b31e4bcc64d81332c37efecb0a8618681f1db9" }
-collab-plugins = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "67b31e4bcc64d81332c37efecb0a8618681f1db9" }
-collab-user = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "67b31e4bcc64d81332c37efecb0a8618681f1db9" }
-collab-importer = { version = "0.1", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "67b31e4bcc64d81332c37efecb0a8618681f1db9" }
-
-# Working directory: frontend
-# To update the commit ID, run:
-# scripts/tool/update_local_ai_rev.sh new_rev_id
-# ⚠️⚠️⚠️️
-appflowy-local-ai = { version = "0.1", git = "https://github.com/AppFlowy-IO/AppFlowy-LocalAI", rev = "6f064efe232268f8d396edbb4b84d57fbb640f13" }
-appflowy-plugin = { version = "0.1", git = "https://github.com/AppFlowy-IO/AppFlowy-LocalAI", rev = "6f064efe232268f8d396edbb4b84d57fbb640f13" }
diff --git a/frontend/appflowy_tauri/src-tauri/Info.plist b/frontend/appflowy_tauri/src-tauri/Info.plist
deleted file mode 100644
index 25b430c049..0000000000
--- a/frontend/appflowy_tauri/src-tauri/Info.plist
+++ /dev/null
@@ -1,19 +0,0 @@
-<!-- Add this file next to your tauri.conf.json file -->
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
- <dict>
- <key>CFBundleURLTypes</key>
- <array>
- <dict>
- <key>CFBundleURLName</key>
- <!-- Obviously needs to be replaced with your app's bundle identifier -->
- <string>appflowy-flutter</string>
- <key>CFBundleURLSchemes</key>
- <array>
- <string>appflowy-flutter</string>
- </array>
- </dict>
- </array>
- </dict>
-</plist>
\ No newline at end of file
diff --git a/frontend/appflowy_tauri/src-tauri/build.rs b/frontend/appflowy_tauri/src-tauri/build.rs
deleted file mode 100644
index d860e1e6a7..0000000000
--- a/frontend/appflowy_tauri/src-tauri/build.rs
+++ /dev/null
@@ -1,3 +0,0 @@
-fn main() {
- tauri_build::build()
-}
diff --git a/frontend/appflowy_tauri/src-tauri/env.development b/frontend/appflowy_tauri/src-tauri/env.development
deleted file mode 100644
index 188835e3d0..0000000000
--- a/frontend/appflowy_tauri/src-tauri/env.development
+++ /dev/null
@@ -1,4 +0,0 @@
-APPFLOWY_CLOUD_ENV_APPFLOWY_CLOUD_BASE_URL=https://test.appflowy.cloud
-APPFLOWY_CLOUD_ENV_APPFLOWY_CLOUD_WS_BASE_URL=wss://test.appflowy.cloud/ws/v1
-APPFLOWY_CLOUD_ENV_APPFLOWY_CLOUD_GOTRUE_URL=https://test.appflowy.cloud/gotrue
-APPFLOWY_CLOUD_ENV_CLOUD_TYPE=2
diff --git a/frontend/appflowy_tauri/src-tauri/env.production b/frontend/appflowy_tauri/src-tauri/env.production
deleted file mode 100644
index b03c328b84..0000000000
--- a/frontend/appflowy_tauri/src-tauri/env.production
+++ /dev/null
@@ -1,4 +0,0 @@
-APPFLOWY_CLOUD_ENV_APPFLOWY_CLOUD_BASE_URL=https://beta.appflowy.cloud
-APPFLOWY_CLOUD_ENV_APPFLOWY_CLOUD_WS_BASE_URL=wss://beta.appflowy.cloud/ws/v1
-APPFLOWY_CLOUD_ENV_APPFLOWY_CLOUD_GOTRUE_URL=https://beta.appflowy.cloud/gotrue
-APPFLOWY_CLOUD_ENV_CLOUD_TYPE=2
diff --git a/frontend/appflowy_tauri/src-tauri/icons/128x128.png b/frontend/appflowy_tauri/src-tauri/icons/128x128.png
deleted file mode 100644
index 3a51041313..0000000000
Binary files a/frontend/appflowy_tauri/src-tauri/icons/128x128.png and /dev/null differ
diff --git a/frontend/appflowy_tauri/src-tauri/icons/[email protected] b/frontend/appflowy_tauri/src-tauri/icons/[email protected]
deleted file mode 100644
index 9076de3a4b..0000000000
Binary files a/frontend/appflowy_tauri/src-tauri/icons/[email protected] and /dev/null differ
diff --git a/frontend/appflowy_tauri/src-tauri/icons/32x32.png b/frontend/appflowy_tauri/src-tauri/icons/32x32.png
deleted file mode 100644
index 6ae6683fef..0000000000
Binary files a/frontend/appflowy_tauri/src-tauri/icons/32x32.png and /dev/null differ
diff --git a/frontend/appflowy_tauri/src-tauri/icons/Square107x107Logo.png b/frontend/appflowy_tauri/src-tauri/icons/Square107x107Logo.png
deleted file mode 100644
index b08dcf7d21..0000000000
Binary files a/frontend/appflowy_tauri/src-tauri/icons/Square107x107Logo.png and /dev/null differ
diff --git a/frontend/appflowy_tauri/src-tauri/icons/Square142x142Logo.png b/frontend/appflowy_tauri/src-tauri/icons/Square142x142Logo.png
deleted file mode 100644
index f3e437b76e..0000000000
Binary files a/frontend/appflowy_tauri/src-tauri/icons/Square142x142Logo.png and /dev/null differ
diff --git a/frontend/appflowy_tauri/src-tauri/icons/Square150x150Logo.png b/frontend/appflowy_tauri/src-tauri/icons/Square150x150Logo.png
deleted file mode 100644
index 6a1dc04864..0000000000
Binary files a/frontend/appflowy_tauri/src-tauri/icons/Square150x150Logo.png and /dev/null differ
diff --git a/frontend/appflowy_tauri/src-tauri/icons/Square284x284Logo.png b/frontend/appflowy_tauri/src-tauri/icons/Square284x284Logo.png
deleted file mode 100644
index 2f2d9d6fe6..0000000000
Binary files a/frontend/appflowy_tauri/src-tauri/icons/Square284x284Logo.png and /dev/null differ
diff --git a/frontend/appflowy_tauri/src-tauri/icons/Square30x30Logo.png b/frontend/appflowy_tauri/src-tauri/icons/Square30x30Logo.png
deleted file mode 100644
index 46e3802c0b..0000000000
Binary files a/frontend/appflowy_tauri/src-tauri/icons/Square30x30Logo.png and /dev/null differ
diff --git a/frontend/appflowy_tauri/src-tauri/icons/Square310x310Logo.png b/frontend/appflowy_tauri/src-tauri/icons/Square310x310Logo.png
deleted file mode 100644
index 230b1abe58..0000000000
Binary files a/frontend/appflowy_tauri/src-tauri/icons/Square310x310Logo.png and /dev/null differ
diff --git a/frontend/appflowy_tauri/src-tauri/icons/Square44x44Logo.png b/frontend/appflowy_tauri/src-tauri/icons/Square44x44Logo.png
deleted file mode 100644
index ad188037a3..0000000000
Binary files a/frontend/appflowy_tauri/src-tauri/icons/Square44x44Logo.png and /dev/null differ
diff --git a/frontend/appflowy_tauri/src-tauri/icons/Square71x71Logo.png b/frontend/appflowy_tauri/src-tauri/icons/Square71x71Logo.png
deleted file mode 100644
index ceae9ad1bb..0000000000
Binary files a/frontend/appflowy_tauri/src-tauri/icons/Square71x71Logo.png and /dev/null differ
diff --git a/frontend/appflowy_tauri/src-tauri/icons/Square89x89Logo.png b/frontend/appflowy_tauri/src-tauri/icons/Square89x89Logo.png
deleted file mode 100644
index 123dcea650..0000000000
Binary files a/frontend/appflowy_tauri/src-tauri/icons/Square89x89Logo.png and /dev/null differ
diff --git a/frontend/appflowy_tauri/src-tauri/icons/StoreLogo.png b/frontend/appflowy_tauri/src-tauri/icons/StoreLogo.png
deleted file mode 100644
index d7906c3c03..0000000000
Binary files a/frontend/appflowy_tauri/src-tauri/icons/StoreLogo.png and /dev/null differ
diff --git a/frontend/appflowy_tauri/src-tauri/icons/icon.icns b/frontend/appflowy_tauri/src-tauri/icons/icon.icns
deleted file mode 100644
index 74b585f25d..0000000000
Binary files a/frontend/appflowy_tauri/src-tauri/icons/icon.icns and /dev/null differ
diff --git a/frontend/appflowy_tauri/src-tauri/icons/icon.ico b/frontend/appflowy_tauri/src-tauri/icons/icon.ico
deleted file mode 100644
index cd9ad402d1..0000000000
Binary files a/frontend/appflowy_tauri/src-tauri/icons/icon.ico and /dev/null differ
diff --git a/frontend/appflowy_tauri/src-tauri/icons/icon.png b/frontend/appflowy_tauri/src-tauri/icons/icon.png
deleted file mode 100644
index 7cc3853d67..0000000000
Binary files a/frontend/appflowy_tauri/src-tauri/icons/icon.png and /dev/null differ
diff --git a/frontend/appflowy_tauri/src-tauri/rust-toolchain.toml b/frontend/appflowy_tauri/src-tauri/rust-toolchain.toml
deleted file mode 100644
index 6f14058b2e..0000000000
--- a/frontend/appflowy_tauri/src-tauri/rust-toolchain.toml
+++ /dev/null
@@ -1,2 +0,0 @@
-[toolchain]
-channel = "1.77.2"
diff --git a/frontend/appflowy_tauri/src-tauri/rustfmt.toml b/frontend/appflowy_tauri/src-tauri/rustfmt.toml
deleted file mode 100644
index 5cb0d67ee5..0000000000
--- a/frontend/appflowy_tauri/src-tauri/rustfmt.toml
+++ /dev/null
@@ -1,12 +0,0 @@
-# https://rust-lang.github.io/rustfmt/?version=master&search=
-max_width = 100
-tab_spaces = 2
-newline_style = "Auto"
-match_block_trailing_comma = true
-use_field_init_shorthand = true
-use_try_shorthand = true
-reorder_imports = true
-reorder_modules = true
-remove_nested_parens = true
-merge_derives = true
-edition = "2021"
\ No newline at end of file
diff --git a/frontend/appflowy_tauri/src-tauri/src/init.rs b/frontend/appflowy_tauri/src-tauri/src/init.rs
deleted file mode 100644
index 4903e1fe34..0000000000
--- a/frontend/appflowy_tauri/src-tauri/src/init.rs
+++ /dev/null
@@ -1,78 +0,0 @@
-use dotenv::dotenv;
-use flowy_core::config::AppFlowyCoreConfig;
-use flowy_core::{AppFlowyCore, DEFAULT_NAME};
-use lib_dispatch::runtime::AFPluginRuntime;
-use std::sync::Mutex;
-
-pub fn read_env() {
- dotenv().ok();
-
- let env = if cfg!(debug_assertions) {
- include_str!("../env.development")
- } else {
- include_str!("../env.production")
- };
-
- for line in env.lines() {
- if let Some((key, value)) = line.split_once('=') {
- // Check if the environment variable is not already set in the system
- let current_value = std::env::var(key).unwrap_or_default();
- if current_value.is_empty() {
- std::env::set_var(key, value);
- }
- }
- }
-}
-
-pub(crate) fn init_appflowy_core() -> MutexAppFlowyCore {
- let config_json = include_str!("../tauri.conf.json");
- let config: tauri_utils::config::Config = serde_json::from_str(config_json).unwrap();
-
- let app_version = config
- .package
- .version
- .clone()
- .map(|v| v.to_string())
- .unwrap_or_else(|| "0.5.8".to_string());
- let app_version =
- semver::Version::parse(&app_version).unwrap_or_else(|_| semver::Version::new(0, 5, 8));
- let mut data_path = tauri::api::path::app_local_data_dir(&config).unwrap();
- if cfg!(debug_assertions) {
- data_path.push("data_dev");
- } else {
- data_path.push("data");
- }
-
- let custom_application_path = data_path.to_str().unwrap().to_string();
- let application_path = data_path.to_str().unwrap().to_string();
- let device_id = uuid::Uuid::new_v4().to_string();
-
- read_env();
- std::env::set_var("RUST_LOG", "trace");
-
- let config = AppFlowyCoreConfig::new(
- app_version,
- custom_application_path,
- application_path,
- device_id,
- "tauri".to_string(),
- DEFAULT_NAME.to_string(),
- )
- .log_filter("trace", vec!["appflowy_tauri".to_string()]);
-
- let runtime = Arc::new(AFPluginRuntime::new().unwrap());
- let cloned_runtime = runtime.clone();
- runtime.block_on(async move {
- MutexAppFlowyCore::new(AppFlowyCore::new(config, cloned_runtime, None).await)
- })
-}
-
-pub struct MutexAppFlowyCore(pub Arc<Mutex<AppFlowyCore>>);
-
-impl MutexAppFlowyCore {
- fn new(appflowy_core: AppFlowyCore) -> Self {
- Self(Arc::new(Mutex::new(appflowy_core)))
- }
-}
-unsafe impl Sync for MutexAppFlowyCore {}
-unsafe impl Send for MutexAppFlowyCore {}
diff --git a/frontend/appflowy_tauri/src-tauri/src/main.rs b/frontend/appflowy_tauri/src-tauri/src/main.rs
deleted file mode 100644
index 5f12d1be81..0000000000
--- a/frontend/appflowy_tauri/src-tauri/src/main.rs
+++ /dev/null
@@ -1,72 +0,0 @@
-#![cfg_attr(
- all(not(debug_assertions), target_os = "windows"),
- windows_subsystem = "windows"
-)]
-
-#[allow(dead_code)]
-pub const DEEP_LINK_SCHEME: &str = "appflowy-flutter";
-pub const OPEN_DEEP_LINK: &str = "open_deep_link";
-
-mod init;
-mod notification;
-mod request;
-
-use crate::init::init_appflowy_core;
-use crate::request::invoke_request;
-use flowy_notification::{register_notification_sender, unregister_all_notification_sender};
-use notification::*;
-use tauri::Manager;
-
-extern crate dotenv;
-
-fn main() {
- tauri_plugin_deep_link::prepare(DEEP_LINK_SCHEME);
-
- let flowy_core = init_appflowy_core();
- tauri::Builder::default()
- .invoke_handler(tauri::generate_handler![invoke_request])
- .manage(flowy_core)
- .on_window_event(|_window_event| {})
- .on_menu_event(|_menu| {})
- .on_page_load(|window, _payload| {
- let app_handler = window.app_handle();
- // Make sure hot reload won't register the notification sender twice
- unregister_all_notification_sender();
- register_notification_sender(TSNotificationSender::new(app_handler.clone()));
- // tauri::async_runtime::spawn(async move {});
-
- window.listen_global(AF_EVENT, move |event| {
- on_event(app_handler.clone(), event);
- });
- })
- .setup(|_app| {
- let splashscreen_window = _app.get_window("splashscreen").unwrap();
- let window = _app.get_window("main").unwrap();
- let handle = _app.handle();
-
- // we perform the initialization code on a new task so the app doesn't freeze
- tauri::async_runtime::spawn(async move {
- // initialize your app here instead of sleeping :)
- std::thread::sleep(std::time::Duration::from_secs(2));
-
- // After it's done, close the splashscreen and display the main window
- splashscreen_window.close().unwrap();
- window.show().unwrap();
- // If you need macOS support this must be called in .setup() !
- // Otherwise this could be called right after prepare() but then you don't have access to tauri APIs
- // On macOS You still have to install a .app bundle you got from tauri build --debug for this to work!
- tauri_plugin_deep_link::register(
- DEEP_LINK_SCHEME,
- move |request| {
- dbg!(&request);
- handle.emit_all(OPEN_DEEP_LINK, request).unwrap();
- },
- )
- .unwrap(/* If listening to the scheme is optional for your app, you don't want to unwrap here. */);
- });
-
- Ok(())
- })
- .run(tauri::generate_context!())
- .expect("error while running tauri application");
-}
diff --git a/frontend/appflowy_tauri/src-tauri/src/notification.rs b/frontend/appflowy_tauri/src-tauri/src/notification.rs
deleted file mode 100644
index b42541edec..0000000000
--- a/frontend/appflowy_tauri/src-tauri/src/notification.rs
+++ /dev/null
@@ -1,35 +0,0 @@
-use flowy_notification::entities::SubscribeObject;
-use flowy_notification::NotificationSender;
-use serde::Serialize;
-use tauri::{AppHandle, Event, Manager, Wry};
-
-#[allow(dead_code)]
-pub const AF_EVENT: &str = "af-event";
-pub const AF_NOTIFICATION: &str = "af-notification";
-
-#[tracing::instrument(level = "trace")]
-pub fn on_event(app_handler: AppHandle<Wry>, event: Event) {}
-
-#[allow(dead_code)]
-pub fn send_notification<P: Serialize + Clone>(app_handler: AppHandle<Wry>, payload: P) {
- app_handler.emit_all(AF_NOTIFICATION, payload).unwrap();
-}
-
-pub struct TSNotificationSender {
- handler: AppHandle<Wry>,
-}
-
-impl TSNotificationSender {
- pub fn new(handler: AppHandle<Wry>) -> Self {
- Self { handler }
- }
-}
-
-impl NotificationSender for TSNotificationSender {
- fn send_subject(&self, subject: SubscribeObject) -> Result<(), String> {
- self
- .handler
- .emit_all(AF_NOTIFICATION, subject)
- .map_err(|e| format!("{:?}", e))
- }
-}
diff --git a/frontend/appflowy_tauri/src-tauri/src/request.rs b/frontend/appflowy_tauri/src-tauri/src/request.rs
deleted file mode 100644
index ff69a438c9..0000000000
--- a/frontend/appflowy_tauri/src-tauri/src/request.rs
+++ /dev/null
@@ -1,45 +0,0 @@
-use crate::init::MutexAppFlowyCore;
-use lib_dispatch::prelude::{
- AFPluginDispatcher, AFPluginEventResponse, AFPluginRequest, StatusCode,
-};
-use tauri::{AppHandle, Manager, State, Wry};
-
-#[derive(Clone, Debug, serde::Deserialize)]
-pub struct AFTauriRequest {
- ty: String,
- payload: Vec<u8>,
-}
-
-impl std::convert::From<AFTauriRequest> for AFPluginRequest {
- fn from(event: AFTauriRequest) -> Self {
- AFPluginRequest::new(event.ty).payload(event.payload)
- }
-}
-
-#[derive(Clone, serde::Serialize)]
-pub struct AFTauriResponse {
- code: StatusCode,
- payload: Vec<u8>,
-}
-
-impl std::convert::From<AFPluginEventResponse> for AFTauriResponse {
- fn from(response: AFPluginEventResponse) -> Self {
- Self {
- code: response.status_code,
- payload: response.payload.to_vec(),
- }
- }
-}
-
-// Learn more about Tauri commands at https://tauri.app/v1/guides/features/command
-#[tauri::command]
-pub async fn invoke_request(
- request: AFTauriRequest,
- app_handler: AppHandle<Wry>,
-) -> AFTauriResponse {
- let request: AFPluginRequest = request.into();
- let state: State<MutexAppFlowyCore> = app_handler.state();
- let dispatcher = state.0.lock().unwrap().dispatcher();
- let response = AFPluginDispatcher::sync_send(dispatcher, request);
- response.into()
-}
diff --git a/frontend/appflowy_tauri/src-tauri/tauri.conf.json b/frontend/appflowy_tauri/src-tauri/tauri.conf.json
deleted file mode 100644
index 11dd7c206c..0000000000
--- a/frontend/appflowy_tauri/src-tauri/tauri.conf.json
+++ /dev/null
@@ -1,113 +0,0 @@
-{
- "build": {
- "beforeDevCommand": "npm run dev",
- "beforeBuildCommand": "pnpm run build",
- "devPath": "http://localhost:1420",
- "distDir": "../dist",
- "withGlobalTauri": false
- },
- "package": {
- "productName": "AppFlowy",
- "version": "0.0.1"
- },
- "tauri": {
- "allowlist": {
- "all": false,
- "shell": {
- "all": false,
- "open": true
- },
- "fs": {
- "all": true,
- "scope": [
- "$APPLOCALDATA/**"
- ],
- "readFile": true,
- "writeFile": true,
- "readDir": true,
- "copyFile": true,
- "createDir": true,
- "removeDir": true,
- "removeFile": true,
- "renameFile": true,
- "exists": true
- },
- "clipboard": {
- "all": true,
- "writeText": true,
- "readText": true
- },
- "dialog": {
- "all": true,
- "ask": true,
- "confirm": true,
- "message": true,
- "open": true,
- "save": true
- }
- },
- "bundle": {
- "active": true,
- "category": "DeveloperTool",
- "copyright": "",
- "deb": {
- "depends": []
- },
- "externalBin": [],
- "icon": [
- "icons/32x32.png",
- "icons/128x128.png",
- "icons/icon.icns",
- "icons/icon.ico"
- ],
- "identifier": "com.appflowy.tauri",
- "longDescription": "",
- "macOS": {
- "entitlements": null,
- "exceptionDomain": "",
- "frameworks": [],
- "providerShortName": null,
- "signingIdentity": null,
- "minimumSystemVersion": "10.15.0"
- },
- "resources": [],
- "shortDescription": "",
- "targets": "all",
- "windows": {
- "certificateThumbprint": null,
- "digestAlgorithm": "sha256",
- "timestampUrl": ""
- }
- },
- "security": {
- "csp": null
- },
- "updater": {
- "active": false
- },
- "windows": [
- {
- "fileDropEnabled": false,
- "fullscreen": false,
- "height": 800,
- "resizable": true,
- "title": "AppFlowy",
- "width": 1200,
- "minWidth": 800,
- "minHeight": 600,
- "visible": false,
- "label": "main"
- },
- {
- "height": 300,
- "width": 549,
- "decorations": false,
- "url": "launch_splash.jpg",
- "label": "splashscreen",
- "center": true,
- "visible": true
- }
- ]
- }
-}
\ No newline at end of file
diff --git a/frontend/appflowy_tauri/src/appflowy_app/@types/i18next.d.ts b/frontend/appflowy_tauri/src/appflowy_app/@types/i18next.d.ts
deleted file mode 100644
index 6adbb4a512..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/@types/i18next.d.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-import resources from './resources';
-
-declare module 'i18next' {
- interface CustomTypeOptions {
- defaultNS: 'translation';
- resources: typeof resources;
- }
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/@types/resources.ts b/frontend/appflowy_tauri/src/appflowy_app/@types/resources.ts
deleted file mode 100644
index 479f05f013..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/@types/resources.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import translation from '$app/i18n/translations/en.json';
-
-const resources = {
- translation,
-} as const;
-
-export default resources;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/App.tsx b/frontend/appflowy_tauri/src/appflowy_app/App.tsx
deleted file mode 100644
index 9381737341..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/App.tsx
+++ /dev/null
@@ -1,25 +0,0 @@
-import { BrowserRouter } from 'react-router-dom';
-
-import { Provider } from 'react-redux';
-import { store } from './stores/store';
-
-import { ErrorHandlerPage } from './components/error/ErrorHandlerPage';
-import '$app/i18n/config';
-
-import { ErrorBoundary } from 'react-error-boundary';
-
-import AppMain from '$app/AppMain';
-
-const App = () => {
- return (
- <BrowserRouter>
- <Provider store={store}>
- <ErrorBoundary FallbackComponent={ErrorHandlerPage}>
- <AppMain />
- </ErrorBoundary>
- </Provider>
- </BrowserRouter>
- );
-};
-
-export default App;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/AppMain.hooks.ts b/frontend/appflowy_tauri/src/appflowy_app/AppMain.hooks.ts
deleted file mode 100644
index 9c46b8ab38..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/AppMain.hooks.ts
+++ /dev/null
@@ -1,69 +0,0 @@
-import { useAppDispatch, useAppSelector } from '$app/stores/store';
-import { useEffect, useMemo } from 'react';
-import { currentUserActions, LoginState } from '$app_reducers/current-user/slice';
-import { Theme as ThemeType, ThemeMode } from '$app/stores/reducers/current-user/slice';
-import { createTheme } from '@mui/material/styles';
-import { getDesignTokens } from '$app/utils/mui';
-import { useTranslation } from 'react-i18next';
-import { UserService } from '$app/application/user/user.service';
-
-export function useUserSetting() {
- const dispatch = useAppDispatch();
- const { i18n } = useTranslation();
- const loginState = useAppSelector((state) => state.currentUser.loginState);
-
- const { themeMode = ThemeMode.System, theme: themeType = ThemeType.Default } = useAppSelector((state) => {
- return {
- themeMode: state.currentUser.userSetting.themeMode,
- theme: state.currentUser.userSetting.theme,
- };
- });
-
- const isDark =
- themeMode === ThemeMode.Dark ||
- (themeMode === ThemeMode.System && window.matchMedia('(prefers-color-scheme: dark)').matches);
-
- useEffect(() => {
- if (loginState !== LoginState.Success && loginState !== undefined) return;
- void (async () => {
- const settings = await UserService.getAppearanceSetting();
-
- if (!settings) return;
- dispatch(currentUserActions.setUserSetting(settings));
- await i18n.changeLanguage(settings.language);
- })();
- }, [dispatch, i18n, loginState]);
-
- useEffect(() => {
- const html = document.documentElement;
-
- html?.setAttribute('data-dark-mode', String(isDark));
- }, [isDark]);
-
- useEffect(() => {
- const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');
-
- const handleSystemThemeChange = () => {
- if (themeMode !== ThemeMode.System) return;
- dispatch(
- currentUserActions.setUserSetting({
- isDark: mediaQuery.matches,
- })
- );
- };
-
- mediaQuery.addEventListener('change', handleSystemThemeChange);
-
- return () => {
- mediaQuery.removeEventListener('change', handleSystemThemeChange);
- };
- }, [dispatch, themeMode]);
-
- const muiTheme = useMemo(() => createTheme(getDesignTokens(isDark)), [isDark]);
-
- return {
- muiTheme,
- themeMode,
- themeType,
- };
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/AppMain.tsx b/frontend/appflowy_tauri/src/appflowy_app/AppMain.tsx
deleted file mode 100644
index 76bdb167b0..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/AppMain.tsx
+++ /dev/null
@@ -1,31 +0,0 @@
-import React from 'react';
-import { Route, Routes } from 'react-router-dom';
-import { ProtectedRoutes } from '$app/components/auth/ProtectedRoutes';
-import { DatabasePage } from '$app/views/DatabasePage';
-
-import { ThemeProvider } from '@mui/material';
-import { useUserSetting } from '$app/AppMain.hooks';
-import TrashPage from '$app/views/TrashPage';
-import DocumentPage from '$app/views/DocumentPage';
-import { Toaster } from 'react-hot-toast';
-import AppFlowyDevTool from '$app/components/_shared/devtool/AppFlowyDevTool';
-
-function AppMain() {
- const { muiTheme } = useUserSetting();
-
- return (
- <ThemeProvider theme={muiTheme}>
- <Routes>
- <Route path={'/'} element={<ProtectedRoutes />}>
- <Route path={'/page/document/:id'} element={<DocumentPage />} />
- <Route path={'/page/grid/:id'} element={<DatabasePage />} />
- <Route path={'/trash'} id={'trash'} element={<TrashPage />} />
- </Route>
- </Routes>
- <Toaster />
- {process.env.NODE_ENV === 'development' && <AppFlowyDevTool />}
- </ThemeProvider>
- );
-}
-
-export default AppMain;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/application/database/cell/cell_listeners.ts b/frontend/appflowy_tauri/src/appflowy_app/application/database/cell/cell_listeners.ts
deleted file mode 100644
index c5c94daebc..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/application/database/cell/cell_listeners.ts
+++ /dev/null
@@ -1,48 +0,0 @@
-import { Database } from '$app/application/database';
-import { getCell } from './cell_service';
-
-export function didDeleteCells({ database, rowId, fieldId }: { database: Database; rowId?: string; fieldId?: string }) {
- const ids = Object.keys(database.cells);
-
- ids.forEach((id) => {
- const cell = database.cells[id];
-
- if (rowId && cell.rowId !== rowId) return;
- if (fieldId && cell.fieldId !== fieldId) return;
-
- delete database.cells[id];
- });
-}
-
-export async function didUpdateCells({
- viewId,
- database,
- rowId,
- fieldId,
-}: {
- viewId: string;
- database: Database;
- rowId?: string;
- fieldId?: string;
-}) {
- const field = database.fields.find((field) => field.id === fieldId);
-
- if (!field) {
- delete database.cells[`${rowId}:${fieldId}`];
- return;
- }
-
- const ids = Object.keys(database.cells);
-
- ids.forEach((id) => {
- const cell = database.cells[id];
-
- if (rowId && cell.rowId !== rowId) return;
- if (fieldId && cell.fieldId !== fieldId) return;
-
- void getCell(viewId, cell.rowId, cell.fieldId, field.type).then((data) => {
- // cache cell
- database.cells[id] = data;
- });
- });
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/application/database/cell/cell_service.ts b/frontend/appflowy_tauri/src/appflowy_app/application/database/cell/cell_service.ts
deleted file mode 100644
index 950f5becb3..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/application/database/cell/cell_service.ts
+++ /dev/null
@@ -1,140 +0,0 @@
-import {
- CellIdPB,
- CellChangesetPB,
- SelectOptionCellChangesetPB,
- ChecklistCellDataChangesetPB,
- DateCellChangesetPB,
- FieldType,
-} from '../../../../services/backend';
-import {
- DatabaseEventGetCell,
- DatabaseEventUpdateCell,
- DatabaseEventUpdateSelectOptionCell,
- DatabaseEventUpdateChecklistCell,
- DatabaseEventUpdateDateCell,
-} from '@/services/backend/events/flowy-database2';
-import { SelectOption } from '../field';
-import { Cell, pbToCell } from './cell_types';
-
-export async function getCell(viewId: string, rowId: string, fieldId: string, fieldType?: FieldType): Promise<Cell> {
- const payload = CellIdPB.fromObject({
- view_id: viewId,
- row_id: rowId,
- field_id: fieldId,
- });
-
- const result = await DatabaseEventGetCell(payload);
-
- if (result.ok === false) {
- return Promise.reject(result.val);
- }
-
- const value = result.val;
-
- return pbToCell(value, fieldType);
-}
-
-export async function updateCell(viewId: string, rowId: string, fieldId: string, changeset: string): Promise<void> {
- const payload = CellChangesetPB.fromObject({
- view_id: viewId,
- row_id: rowId,
- field_id: fieldId,
- cell_changeset: changeset,
- });
-
- const result = await DatabaseEventUpdateCell(payload);
-
- return result.unwrap();
-}
-
-export async function updateSelectCell(
- viewId: string,
- rowId: string,
- fieldId: string,
- data: {
- insertOptionIds?: string[];
- deleteOptionIds?: string[];
- }
-): Promise<void> {
- const payload = SelectOptionCellChangesetPB.fromObject({
- cell_identifier: {
- view_id: viewId,
- row_id: rowId,
- field_id: fieldId,
- },
- insert_option_ids: data.insertOptionIds,
- delete_option_ids: data.deleteOptionIds,
- });
-
- const result = await DatabaseEventUpdateSelectOptionCell(payload);
-
- return result.unwrap();
-}
-
-export async function updateChecklistCell(
- viewId: string,
- rowId: string,
- fieldId: string,
- data: {
- insertOptions?: string[];
- selectedOptionIds?: string[];
- deleteOptionIds?: string[];
- updateOptions?: Partial<SelectOption>[];
- }
-): Promise<void> {
- const payload = ChecklistCellDataChangesetPB.fromObject({
- view_id: viewId,
- row_id: rowId,
- field_id: fieldId,
- insert_options: data.insertOptions,
- selected_option_ids: data.selectedOptionIds,
- delete_option_ids: data.deleteOptionIds,
- update_options: data.updateOptions,
- });
-
- const result = await DatabaseEventUpdateChecklistCell(payload);
-
- return result.unwrap();
-}
-
-export async function updateDateCell(
- viewId: string,
- rowId: string,
- fieldId: string,
- data: {
- // 10-digit timestamp
- date?: number;
- // time string in format HH:mm
- time?: string;
- // 10-digit timestamp
- endDate?: number;
- // time string in format HH:mm
- endTime?: string;
- includeTime?: boolean;
- clearFlag?: boolean;
- isRange?: boolean;
- }
-): Promise<void> {
- const payload = DateCellChangesetPB.fromObject({
- cell_id: {
- view_id: viewId,
- row_id: rowId,
- field_id: fieldId,
- },
- date: data.date,
- time: data.time,
- include_time: data.includeTime,
- clear_flag: data.clearFlag,
- end_date: data.endDate,
- end_time: data.endTime,
- is_range: data.isRange,
- });
-
- const result = await DatabaseEventUpdateDateCell(payload);
-
- if (!result.ok) {
- return Promise.reject(typeof result.val.msg === 'string' ? result.val.msg : 'Unknown error');
- }
-
- return result.val;
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/application/database/cell/cell_types.ts b/frontend/appflowy_tauri/src/appflowy_app/application/database/cell/cell_types.ts
deleted file mode 100644
index f36f68ad8b..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/application/database/cell/cell_types.ts
+++ /dev/null
@@ -1,163 +0,0 @@
-import {
- CellPB,
- CheckboxCellDataPB,
- ChecklistCellDataPB,
- DateCellDataPB,
- FieldType,
- SelectOptionCellDataPB,
- TimestampCellDataPB,
- URLCellDataPB,
-} from '../../../../services/backend';
-import { SelectOption, pbToSelectOption } from '../field/select_option/select_option_types';
-
-export interface Cell {
- rowId: string;
- fieldId: string;
- fieldType: FieldType;
- data: unknown;
-}
-
-export interface TextCell extends Cell {
- fieldType: FieldType.RichText;
- data: string;
-}
-
-export interface NumberCell extends Cell {
- fieldType: FieldType.Number;
- data: string;
-}
-
-export interface CheckboxCell extends Cell {
- fieldType: FieldType.Checkbox;
- data: boolean;
-}
-
-export interface UrlCell extends Cell {
- fieldType: FieldType.URL;
- data: string;
-}
-
-export interface SelectCell extends Cell {
- fieldType: FieldType.SingleSelect | FieldType.MultiSelect;
- data: SelectCellData;
-}
-
-export interface SelectCellData {
- selectedOptionIds?: string[];
-}
-
-export interface DateTimeCell extends Cell {
- fieldType: FieldType.DateTime;
- data: DateTimeCellData;
-}
-
-export interface TimeStampCell extends Cell {
- fieldType: FieldType.LastEditedTime | FieldType.CreatedTime;
- data: TimestampCellData;
-}
-
-export interface DateTimeCellData {
- date?: string;
- time?: string;
- timestamp?: number;
- includeTime?: boolean;
- endDate?: string;
- endTime?: string;
- endTimestamp?: number;
- isRange?: boolean;
-}
-
-export interface TimestampCellData {
- dataTime?: string;
- timestamp?: number;
-}
-
-export interface ChecklistCell extends Cell {
- fieldType: FieldType.Checklist;
- data: ChecklistCellData;
-}
-
-export interface ChecklistCellData {
- /**
- * link to [SelectOption's id property]{@link SelectOption#id}.
- */
- selectedOptions?: string[];
- percentage?: number;
- options?: SelectOption[];
-}
-
-export type UndeterminedCell =
- | TextCell
- | NumberCell
- | DateTimeCell
- | SelectCell
- | CheckboxCell
- | UrlCell
- | ChecklistCell;
-
-const pbToCheckboxCellData = (pb: CheckboxCellDataPB): boolean => (
- pb.is_checked
-);
-
-const pbToDateTimeCellData = (pb: DateCellDataPB): DateTimeCellData => ({
- date: pb.date,
- time: pb.time,
- timestamp: pb.timestamp,
- includeTime: pb.include_time,
- endDate: pb.end_date,
- endTime: pb.end_time,
- endTimestamp: pb.end_timestamp,
- isRange: pb.is_range,
-});
-
-const pbToTimestampCellData = (pb: TimestampCellDataPB): TimestampCellData => ({
- dataTime: pb.date_time,
- timestamp: pb.timestamp,
-});
-
-export const pbToSelectCellData = (pb: SelectOptionCellDataPB): SelectCellData => {
- return {
- selectedOptionIds: pb.select_options.map((option) => option.id),
- };
-};
-
-const pbToURLCellData = (pb: URLCellDataPB): string => (
- pb.content
-);
-
-export const pbToChecklistCellData = (pb: ChecklistCellDataPB): ChecklistCellData => ({
- selectedOptions: pb.selected_options.map(({ id }) => id),
- percentage: pb.percentage,
- options: pb.options.map(pbToSelectOption),
-});
-
-function bytesToCellData(bytes: Uint8Array, fieldType: FieldType) {
- switch (fieldType) {
- case FieldType.RichText:
- case FieldType.Number:
- return new TextDecoder().decode(bytes);
- case FieldType.Checkbox:
- return pbToCheckboxCellData(CheckboxCellDataPB.deserialize(bytes));
- case FieldType.DateTime:
- return pbToDateTimeCellData(DateCellDataPB.deserialize(bytes));
- case FieldType.LastEditedTime:
- case FieldType.CreatedTime:
- return pbToTimestampCellData(TimestampCellDataPB.deserialize(bytes));
- case FieldType.SingleSelect:
- case FieldType.MultiSelect:
- return pbToSelectCellData(SelectOptionCellDataPB.deserialize(bytes));
- case FieldType.URL:
- return pbToURLCellData(URLCellDataPB.deserialize(bytes));
- case FieldType.Checklist:
- return pbToChecklistCellData(ChecklistCellDataPB.deserialize(bytes));
- }
-}
-
-export const pbToCell = (pb: CellPB, fieldType: FieldType = pb.field_type): Cell => {
- return {
- rowId: pb.row_id,
- fieldId: pb.field_id,
- fieldType: fieldType,
- data: bytesToCellData(pb.data, fieldType),
- };
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/application/database/cell/index.ts b/frontend/appflowy_tauri/src/appflowy_app/application/database/cell/index.ts
deleted file mode 100644
index bc6bdc4417..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/application/database/cell/index.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export * from './cell_types';
-export * as cellService from './cell_service';
-export * as cellListeners from './cell_listeners';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/application/database/database/database_service.ts b/frontend/appflowy_tauri/src/appflowy_app/application/database/database/database_service.ts
deleted file mode 100644
index 74ebfb1df0..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/application/database/database/database_service.ts
+++ /dev/null
@@ -1,84 +0,0 @@
-import { DatabaseViewIdPB } from '@/services/backend';
-import {
- DatabaseEventGetDatabase,
- DatabaseEventGetDatabaseId,
- DatabaseEventGetDatabaseSetting,
-} from '@/services/backend/events/flowy-database2';
-import { fieldService } from '../field';
-import { pbToFilter } from '../filter';
-import { groupService, pbToGroupSetting } from '../group';
-import { pbToRowMeta } from '../row';
-import { pbToSort } from '../sort';
-import { Database } from './database_types';
-
-export async function getDatabaseId(viewId: string): Promise<string> {
- const payload = DatabaseViewIdPB.fromObject({ value: viewId });
-
- const result = await DatabaseEventGetDatabaseId(payload);
-
- return result.map((value) => value.value).unwrap();
-}
-
-export async function getDatabase(viewId: string) {
- const payload = DatabaseViewIdPB.fromObject({
- value: viewId,
- });
-
- const result = await DatabaseEventGetDatabase(payload);
-
- if (!result.ok) return Promise.reject('Failed to get database');
-
- return result
- .map((value) => {
- return {
- id: value.id,
- isLinked: value.is_linked,
- layoutType: value.layout_type,
- fieldIds: value.fields.map((field) => field.field_id),
- rowMetas: value.rows.map(pbToRowMeta),
- };
- })
- .unwrap();
-}
-
-export async function getDatabaseSetting(viewId: string) {
- const payload = DatabaseViewIdPB.fromObject({
- value: viewId,
- });
-
- const result = await DatabaseEventGetDatabaseSetting(payload);
-
- return result
- .map((value) => {
- return {
- filters: value.filters.items.map(pbToFilter),
- sorts: value.sorts.items.map(pbToSort),
- groupSettings: value.group_settings.items.map(pbToGroupSetting),
- };
- })
- .unwrap();
-}
-
-export async function openDatabase(viewId: string): Promise<Database> {
- const { id, isLinked, layoutType, fieldIds, rowMetas } = await getDatabase(viewId);
-
- const { filters, sorts, groupSettings } = await getDatabaseSetting(viewId);
-
- const { fields, typeOptions } = await fieldService.getFields(viewId, fieldIds);
-
- const groups = await groupService.getGroups(viewId);
-
- return {
- id,
- isLinked,
- layoutType,
- fields,
- rowMetas,
- filters,
- sorts,
- groups,
- groupSettings,
- typeOptions,
- cells: {},
- };
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/application/database/database/database_types.ts b/frontend/appflowy_tauri/src/appflowy_app/application/database/database/database_types.ts
deleted file mode 100644
index 627cd94013..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/application/database/database/database_types.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import { DatabaseLayoutPB } from '@/services/backend';
-import { Field, UndeterminedTypeOptionData } from '../field';
-import { Filter } from '../filter';
-import { GroupSetting, Group } from '../group';
-import { RowMeta } from '../row';
-import { Sort } from '../sort';
-import { Cell } from '../cell';
-
-export interface Database {
- id: string;
- isLinked: boolean;
- layoutType: DatabaseLayoutPB;
- fields: Field[];
- rowMetas: RowMeta[];
- filters: Filter[];
- sorts: Sort[];
- groupSettings: GroupSetting[];
- groups: Group[];
- typeOptions: Record<string, UndeterminedTypeOptionData>;
- cells: Record<string, Cell>;
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/application/database/database/index.ts b/frontend/appflowy_tauri/src/appflowy_app/application/database/database/index.ts
deleted file mode 100644
index e656d98287..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/application/database/database/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export * from './database_types';
-export * as databaseService from './database_service';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/application/database/database_view/database_view_service.ts b/frontend/appflowy_tauri/src/appflowy_app/application/database/database_view/database_view_service.ts
deleted file mode 100644
index 87d99d9b75..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/application/database/database_view/database_view_service.ts
+++ /dev/null
@@ -1,75 +0,0 @@
-import { CreateViewPayloadPB, RepeatedViewIdPB, UpdateViewPayloadPB, ViewIdPB, ViewLayoutPB } from '@/services/backend';
-import {
- FolderEventCreateView,
- FolderEventDeleteView,
- FolderEventGetView,
- FolderEventUpdateView,
-} from '@/services/backend/events/flowy-folder';
-import { databaseService } from '../database';
-import { Page, parserViewPBToPage } from '$app_reducers/pages/slice';
-
-export async function getDatabaseViews(viewId: string): Promise<Page[]> {
- const payload = ViewIdPB.fromObject({ value: viewId });
-
- const result = await FolderEventGetView(payload);
-
- if (result.ok) {
- return [parserViewPBToPage(result.val), ...result.val.child_views.map(parserViewPBToPage)];
- }
-
- return Promise.reject(result.val);
-}
-
-export async function createDatabaseView(
- viewId: string,
- layout: ViewLayoutPB,
- name: string,
- databaseId?: string
-): Promise<Page> {
- const payload = CreateViewPayloadPB.fromObject({
- parent_view_id: viewId,
- name,
- layout,
- meta: {
- database_id: databaseId || (await databaseService.getDatabaseId(viewId)),
- },
- });
-
- const result = await FolderEventCreateView(payload);
-
- if (result.ok) {
- return parserViewPBToPage(result.val);
- }
-
- return Promise.reject(result.err);
-}
-
-export async function updateView(viewId: string, view: { name?: string; layout?: ViewLayoutPB }): Promise<Page> {
- const payload = UpdateViewPayloadPB.fromObject({
- view_id: viewId,
- name: view.name,
- layout: view.layout,
- });
-
- const result = await FolderEventUpdateView(payload);
-
- if (result.ok) {
- return parserViewPBToPage(result.val);
- }
-
- return Promise.reject(result.err);
-}
-
-export async function deleteView(viewId: string): Promise<void> {
- const payload = RepeatedViewIdPB.fromObject({
- items: [viewId],
- });
-
- const result = await FolderEventDeleteView(payload);
-
- if (result.ok) {
- return;
- }
-
- return Promise.reject(result.err);
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/application/database/database_view/index.ts b/frontend/appflowy_tauri/src/appflowy_app/application/database/database_view/index.ts
deleted file mode 100644
index b2a6e1a5f1..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/application/database/database_view/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * as databaseViewService from './database_view_service';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/application/database/field/field_listeners.ts b/frontend/appflowy_tauri/src/appflowy_app/application/database/field/field_listeners.ts
deleted file mode 100644
index ef36daa20c..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/application/database/field/field_listeners.ts
+++ /dev/null
@@ -1,40 +0,0 @@
-import { DatabaseFieldChangesetPB, FieldSettingsPB, FieldVisibility } from '@/services/backend';
-import { Database, fieldService } from '$app/application/database';
-import { didDeleteCells, didUpdateCells } from '$app/application/database/cell/cell_listeners';
-
-export function didUpdateFieldSettings(database: Database, settings: FieldSettingsPB) {
- const { field_id: fieldId, visibility, width } = settings;
- const field = database.fields.find((field) => field.id === fieldId);
-
- if (!field) return;
- field.visibility = visibility;
- field.width = width;
- // delete cells if field is hidden
- if (visibility === FieldVisibility.AlwaysHidden) {
- didDeleteCells({ database, fieldId });
- }
-}
-
-export async function didUpdateFields(viewId: string, database: Database, changeset: DatabaseFieldChangesetPB) {
- const { fields, typeOptions } = await fieldService.getFields(viewId);
-
- database.fields = fields;
- const deletedFieldIds = Object.keys(changeset.deleted_fields);
- const updatedFieldIds = changeset.updated_fields.map((field) => field.id);
-
- Object.assign(database.typeOptions, typeOptions);
- deletedFieldIds.forEach(
- (fieldId) => {
- // delete cache cells
- didDeleteCells({ database, fieldId });
- // delete cache type options
- delete database.typeOptions[fieldId];
- },
- [database.typeOptions]
- );
-
- updatedFieldIds.forEach((fieldId) => {
- // delete cache cells
- void didUpdateCells({ viewId, database, fieldId });
- });
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/application/database/field/field_service.ts b/frontend/appflowy_tauri/src/appflowy_app/application/database/field/field_service.ts
deleted file mode 100644
index 219aeb3ea5..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/application/database/field/field_service.ts
+++ /dev/null
@@ -1,215 +0,0 @@
-import {
- CreateFieldPayloadPB,
- DeleteFieldPayloadPB,
- DuplicateFieldPayloadPB,
- FieldChangesetPB,
- FieldType,
- GetFieldPayloadPB,
- MoveFieldPayloadPB,
- RepeatedFieldIdPB,
- UpdateFieldTypePayloadPB,
- FieldSettingsChangesetPB,
- FieldVisibility,
- DatabaseViewIdPB,
- OrderObjectPositionTypePB,
-} from '@/services/backend';
-import {
- DatabaseEventDuplicateField,
- DatabaseEventUpdateField,
- DatabaseEventUpdateFieldType,
- DatabaseEventMoveField,
- DatabaseEventGetFields,
- DatabaseEventDeleteField,
- DatabaseEventCreateField,
- DatabaseEventUpdateFieldSettings,
- DatabaseEventGetAllFieldSettings,
-} from '@/services/backend/events/flowy-database2';
-import { Field, pbToField } from './field_types';
-import { bytesToTypeOption } from './type_option';
-import { Database } from '$app/application/database';
-
-export async function getFields(
- viewId: string,
- fieldIds?: string[]
-): Promise<{
- fields: Field[];
- typeOptions: Database['typeOptions'];
-}> {
- const payload = GetFieldPayloadPB.fromObject({
- view_id: viewId,
- field_ids: fieldIds
- ? RepeatedFieldIdPB.fromObject({
- items: fieldIds.map((fieldId) => ({ field_id: fieldId })),
- })
- : undefined,
- });
-
- const result = await DatabaseEventGetFields(payload);
-
- const getSettingsPayload = DatabaseViewIdPB.fromObject({
- value: viewId,
- });
-
- const settings = await DatabaseEventGetAllFieldSettings(getSettingsPayload);
-
- if (settings.ok === false || result.ok === false) {
- return Promise.reject('Failed to get fields');
- }
-
- const typeOptions: Database['typeOptions'] = {};
-
- const fields = await Promise.all(
- result.val.items.map(async (item) => {
- const setting = settings.val.items.find((setting) => setting.field_id === item.id);
-
- const field = pbToField(item);
-
- const typeOption = bytesToTypeOption(item.type_option_data, item.field_type);
-
- if (typeOption) {
- typeOptions[item.id] = typeOption;
- }
-
- return {
- ...field,
- visibility: setting?.visibility,
- width: setting?.width,
- };
- })
- );
-
- return { fields, typeOptions };
-}
-
-export async function createField({
- viewId,
- targetFieldId,
- fieldPosition,
- fieldType,
- data,
-}: {
- viewId: string;
- targetFieldId?: string;
- fieldPosition?: OrderObjectPositionTypePB;
- fieldType?: FieldType;
- data?: Uint8Array;
-}): Promise<Field> {
- const payload = CreateFieldPayloadPB.fromObject({
- view_id: viewId,
- field_type: fieldType,
- type_option_data: data,
- field_position: {
- position: fieldPosition,
- object_id: targetFieldId,
- },
- });
-
- const result = await DatabaseEventCreateField(payload);
-
- if (result.ok === false) {
- return Promise.reject('Failed to create field');
- }
-
- return pbToField(result.val);
-}
-
-export async function duplicateField(viewId: string, fieldId: string): Promise<void> {
- const payload = DuplicateFieldPayloadPB.fromObject({
- view_id: viewId,
- field_id: fieldId,
- });
-
- const result = await DatabaseEventDuplicateField(payload);
-
- if (result.ok === false) {
- return Promise.reject('Failed to duplicate field');
- }
-
- return result.val;
-}
-
-export async function updateField(
- viewId: string,
- fieldId: string,
- data: {
- name?: string;
- desc?: string;
- }
-): Promise<void> {
- const payload = FieldChangesetPB.fromObject({
- view_id: viewId,
- field_id: fieldId,
- ...data,
- });
-
- const result = await DatabaseEventUpdateField(payload);
-
- return result.unwrap();
-}
-
-export async function updateFieldType(viewId: string, fieldId: string, fieldType: FieldType): Promise<void> {
- const payload = UpdateFieldTypePayloadPB.fromObject({
- view_id: viewId,
- field_id: fieldId,
- field_type: fieldType,
- });
-
- const result = await DatabaseEventUpdateFieldType(payload);
-
- return result.unwrap();
-}
-
-export async function moveField(viewId: string, fromFieldId: string, toFieldId: string): Promise<void> {
- const payload = MoveFieldPayloadPB.fromObject({
- view_id: viewId,
- from_field_id: fromFieldId,
- to_field_id: toFieldId,
- });
-
- const result = await DatabaseEventMoveField(payload);
-
- return result.unwrap();
-}
-
-export async function deleteField(viewId: string, fieldId: string): Promise<void> {
- const payload = DeleteFieldPayloadPB.fromObject({
- view_id: viewId,
- field_id: fieldId,
- });
-
- const result = await DatabaseEventDeleteField(payload);
-
- return result.unwrap();
-}
-
-export async function updateFieldSetting(
- viewId: string,
- fieldId: string,
- settings: {
- visibility?: FieldVisibility;
- width?: number;
- }
-): Promise<void> {
- const payload = FieldSettingsChangesetPB.fromObject({
- view_id: viewId,
- field_id: fieldId,
- ...settings,
- });
-
- const result = await DatabaseEventUpdateFieldSettings(payload);
-
- if (result.ok === false) {
- return Promise.reject('Failed to update field settings');
- }
-
- return result.val;
-}
-
-export const reorderFields = (list: Field[], startIndex: number, endIndex: number) => {
- const result = Array.from(list);
- const [removed] = result.splice(startIndex, 1);
-
- result.splice(endIndex, 0, removed);
-
- return result;
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/application/database/field/field_types.ts b/frontend/appflowy_tauri/src/appflowy_app/application/database/field/field_types.ts
deleted file mode 100644
index 00e7e02d4e..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/application/database/field/field_types.ts
+++ /dev/null
@@ -1,51 +0,0 @@
-import { FieldPB, FieldType, FieldVisibility } from '@/services/backend';
-
-export interface Field {
- id: string;
- name: string;
- type: FieldType;
- visibility?: FieldVisibility;
- width?: number;
- isPrimary: boolean;
-}
-
-export interface NumberField extends Field {
- type: FieldType.Number;
-}
-
-export interface DateTimeField extends Field {
- type: FieldType.DateTime;
-}
-
-export interface LastEditedTimeField extends Field {
- type: FieldType.LastEditedTime;
-}
-
-export interface CreatedTimeField extends Field {
- type: FieldType.CreatedTime;
-}
-
-export type UndeterminedDateField = DateTimeField | CreatedTimeField | LastEditedTimeField;
-
-export interface SelectField extends Field {
- type: FieldType.SingleSelect | FieldType.MultiSelect;
-}
-
-export interface ChecklistField extends Field {
- type: FieldType.Checklist;
-}
-
-export interface DateTimeField extends Field {
- type: FieldType.DateTime;
-}
-
-export type UndeterminedField = NumberField | DateTimeField | SelectField | Field;
-
-export const pbToField = (pb: FieldPB): Field => {
- return {
- id: pb.id,
- name: pb.name,
- type: pb.field_type,
- isPrimary: pb.is_primary,
- };
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/application/database/field/index.ts b/frontend/appflowy_tauri/src/appflowy_app/application/database/field/index.ts
deleted file mode 100644
index fa993023e1..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/application/database/field/index.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-export * from './select_option';
-export * from './type_option';
-export * from './field_types';
-export * as fieldService from './field_service';
-export * as fieldListeners from './field_listeners';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/application/database/field/select_option/index.ts b/frontend/appflowy_tauri/src/appflowy_app/application/database/field/select_option/index.ts
deleted file mode 100644
index f0b9e58852..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/application/database/field/select_option/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export * from './select_option_types';
-export * as selectOptionService from './select_option_service';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/application/database/field/select_option/select_option_service.ts b/frontend/appflowy_tauri/src/appflowy_app/application/database/field/select_option/select_option_service.ts
deleted file mode 100644
index 5757b8185d..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/application/database/field/select_option/select_option_service.ts
+++ /dev/null
@@ -1,58 +0,0 @@
-import { CreateSelectOptionPayloadPB, RepeatedSelectOptionPayload } from '@/services/backend';
-import {
- DatabaseEventCreateSelectOption,
- DatabaseEventInsertOrUpdateSelectOption,
- DatabaseEventDeleteSelectOption,
-} from '@/services/backend/events/flowy-database2';
-import { pbToSelectOption, SelectOption } from './select_option_types';
-
-export async function createSelectOption(viewId: string, fieldId: string, optionName: string): Promise<SelectOption> {
- const payload = CreateSelectOptionPayloadPB.fromObject({
- view_id: viewId,
- field_id: fieldId,
- option_name: optionName,
- });
-
- const result = await DatabaseEventCreateSelectOption(payload);
-
- return result.map(pbToSelectOption).unwrap();
-}
-
-/**
- * @param [rowId] If pass the rowId, the cell will select this option after insert or update.
- */
-export async function insertOrUpdateSelectOption(
- viewId: string,
- fieldId: string,
- items: Partial<SelectOption>[],
- rowId?: string
-): Promise<void> {
- const payload = RepeatedSelectOptionPayload.fromObject({
- view_id: viewId,
- field_id: fieldId,
- row_id: rowId,
- items: items,
- });
-
- const result = await DatabaseEventInsertOrUpdateSelectOption(payload);
-
- return result.unwrap();
-}
-
-export async function deleteSelectOption(
- viewId: string,
- fieldId: string,
- items: Partial<SelectOption>[],
- rowId?: string
-): Promise<void> {
- const payload = RepeatedSelectOptionPayload.fromObject({
- view_id: viewId,
- field_id: fieldId,
- row_id: rowId,
- items,
- });
-
- const result = await DatabaseEventDeleteSelectOption(payload);
-
- return result.unwrap();
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/application/database/field/select_option/select_option_types.ts b/frontend/appflowy_tauri/src/appflowy_app/application/database/field/select_option/select_option_types.ts
deleted file mode 100644
index ec36639a7c..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/application/database/field/select_option/select_option_types.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import { SelectOptionColorPB, SelectOptionPB } from '@/services/backend';
-
-export interface SelectOption {
- id: string;
- name: string;
- color: SelectOptionColorPB;
-}
-
-export function pbToSelectOption(pb: SelectOptionPB): SelectOption {
- return {
- id: pb.id,
- name: pb.name,
- color: pb.color,
- };
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/application/database/field/type_option/index.ts b/frontend/appflowy_tauri/src/appflowy_app/application/database/field/type_option/index.ts
deleted file mode 100644
index d0b9122d90..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/application/database/field/type_option/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export * from './type_option_types';
-export * from './type_option_service';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/application/database/field/type_option/type_option_service.ts b/frontend/appflowy_tauri/src/appflowy_app/application/database/field/type_option/type_option_service.ts
deleted file mode 100644
index 90a0dd3106..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/application/database/field/type_option/type_option_service.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-import { FieldType, TypeOptionChangesetPB } from '@/services/backend';
-import {
- DatabaseEventUpdateFieldTypeOption,
-} from '@/services/backend/events/flowy-database2';
-import { UndeterminedTypeOptionData, typeOptionDataToPB } from './type_option_types';
-
-export async function updateTypeOption(
- viewId: string,
- fieldId: string,
- fieldType: FieldType,
- data: UndeterminedTypeOptionData
-) {
- const payload = TypeOptionChangesetPB.fromObject({
- view_id: viewId,
- field_id: fieldId,
- type_option_data: typeOptionDataToPB(data, fieldType)?.serialize(),
- });
-
- const result = await DatabaseEventUpdateFieldTypeOption(payload);
-
- if (!result.ok) {
- return Promise.reject(result.val);
- }
-
- return;
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/application/database/field/type_option/type_option_types.ts b/frontend/appflowy_tauri/src/appflowy_app/application/database/field/type_option/type_option_types.ts
deleted file mode 100644
index 57de7b828c..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/application/database/field/type_option/type_option_types.ts
+++ /dev/null
@@ -1,148 +0,0 @@
-import {
- CheckboxTypeOptionPB,
- DateFormatPB,
- FieldType,
- MultiSelectTypeOptionPB,
- NumberFormatPB,
- NumberTypeOptionPB,
- RichTextTypeOptionPB,
- SingleSelectTypeOptionPB,
- TimeFormatPB,
- ChecklistTypeOptionPB,
- DateTypeOptionPB,
- TimestampTypeOptionPB,
-} from '@/services/backend';
-import { pbToSelectOption, SelectOption } from '../select_option';
-
-export interface TextTypeOption {
- data?: string;
-}
-
-export interface NumberTypeOption {
- format?: NumberFormatPB;
- scale?: number;
- symbol?: string;
- name?: string;
-}
-
-export interface DateTimeTypeOption {
- dateFormat?: DateFormatPB;
- timeFormat?: TimeFormatPB;
- timezoneId?: string;
-}
-export interface TimeStampTypeOption extends DateTimeTypeOption {
- includeTime?: boolean;
- fieldType?: FieldType;
-}
-
-export interface SelectTypeOption {
- options?: SelectOption[];
- disableColor?: boolean;
-}
-
-export interface CheckboxTypeOption {
- isSelected?: boolean;
-}
-
-export interface ChecklistTypeOption {
- config?: string;
-}
-
-export type UndeterminedTypeOptionData =
- | TextTypeOption
- | NumberTypeOption
- | SelectTypeOption
- | CheckboxTypeOption
- | ChecklistTypeOption
- | DateTimeTypeOption
- | TimeStampTypeOption;
-
-export function typeOptionDataToPB(data: UndeterminedTypeOptionData, fieldType: FieldType) {
- switch (fieldType) {
- case FieldType.Number:
- return NumberTypeOptionPB.fromObject(data as NumberTypeOption);
- case FieldType.DateTime:
- return dateTimeTypeOptionToPB(data as DateTimeTypeOption);
- case FieldType.CreatedTime:
- case FieldType.LastEditedTime:
- return timestampTypeOptionToPB(data as TimeStampTypeOption);
-
- default:
- return null;
- }
-}
-
-function dateTimeTypeOptionToPB(data: DateTimeTypeOption): DateTypeOptionPB {
- return DateTypeOptionPB.fromObject({
- time_format: data.timeFormat,
- date_format: data.dateFormat,
- timezone_id: data.timezoneId,
- });
-}
-
-function timestampTypeOptionToPB(data: TimeStampTypeOption): TimestampTypeOptionPB {
- return TimestampTypeOptionPB.fromObject({
- include_time: data.includeTime,
- date_format: data.dateFormat,
- time_format: data.timeFormat,
- field_type: data.fieldType,
- });
-}
-
-function pbToSelectTypeOption(pb: SingleSelectTypeOptionPB | MultiSelectTypeOptionPB): SelectTypeOption {
- return {
- options: pb.options?.map(pbToSelectOption),
- disableColor: pb.disable_color,
- };
-}
-
-function pbToCheckboxTypeOption(pb: CheckboxTypeOptionPB): CheckboxTypeOption {
- return {
- isSelected: pb.dummy_field,
- };
-}
-
-function pbToChecklistTypeOption(pb: ChecklistTypeOptionPB): ChecklistTypeOption {
- return {
- config: pb.config,
- };
-}
-
-function pbToDateTypeOption(pb: DateTypeOptionPB): DateTimeTypeOption {
- return {
- dateFormat: pb.date_format,
- timezoneId: pb.timezone_id,
- timeFormat: pb.time_format,
- };
-}
-
-function pbToTimeStampTypeOption(pb: TimestampTypeOptionPB): TimeStampTypeOption {
- return {
- includeTime: pb.include_time,
- dateFormat: pb.date_format,
- timeFormat: pb.time_format,
- fieldType: pb.field_type,
- };
-}
-
-export function bytesToTypeOption(data: Uint8Array, fieldType: FieldType) {
- switch (fieldType) {
- case FieldType.RichText:
- return RichTextTypeOptionPB.deserialize(data).toObject() as TextTypeOption;
- case FieldType.Number:
- return NumberTypeOptionPB.deserialize(data).toObject() as NumberTypeOption;
- case FieldType.SingleSelect:
- return pbToSelectTypeOption(SingleSelectTypeOptionPB.deserialize(data));
- case FieldType.MultiSelect:
- return pbToSelectTypeOption(MultiSelectTypeOptionPB.deserialize(data));
- case FieldType.Checkbox:
- return pbToCheckboxTypeOption(CheckboxTypeOptionPB.deserialize(data));
- case FieldType.Checklist:
- return pbToChecklistTypeOption(ChecklistTypeOptionPB.deserialize(data));
- case FieldType.DateTime:
- return pbToDateTypeOption(DateTypeOptionPB.deserialize(data));
- case FieldType.CreatedTime:
- case FieldType.LastEditedTime:
- return pbToTimeStampTypeOption(TimestampTypeOptionPB.deserialize(data));
- }
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/application/database/filter/filter_data.ts b/frontend/appflowy_tauri/src/appflowy_app/application/database/filter/filter_data.ts
deleted file mode 100644
index 72526b577f..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/application/database/filter/filter_data.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-import {
- CheckboxFilterConditionPB,
- ChecklistFilterConditionPB,
- FieldType,
- NumberFilterConditionPB,
- SelectOptionFilterConditionPB,
- TextFilterConditionPB,
-} from '@/services/backend';
-import { UndeterminedFilter } from '$app/application/database';
-
-export function getDefaultFilter(fieldType: FieldType): UndeterminedFilter['data'] | undefined {
- switch (fieldType) {
- case FieldType.RichText:
- case FieldType.URL:
- return {
- condition: TextFilterConditionPB.TextContains,
- content: '',
- };
- case FieldType.Number:
- return {
- condition: NumberFilterConditionPB.NumberIsNotEmpty,
- };
- case FieldType.Checkbox:
- return {
- condition: CheckboxFilterConditionPB.IsUnChecked,
- };
- case FieldType.Checklist:
- return {
- condition: ChecklistFilterConditionPB.IsIncomplete,
- };
- case FieldType.SingleSelect:
- return {
- condition: SelectOptionFilterConditionPB.OptionIs,
- };
- case FieldType.MultiSelect:
- return {
- condition: SelectOptionFilterConditionPB.OptionContains,
- };
- default:
- return;
- }
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/application/database/filter/filter_listeners.ts b/frontend/appflowy_tauri/src/appflowy_app/application/database/filter/filter_listeners.ts
deleted file mode 100644
index 323f8dac82..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/application/database/filter/filter_listeners.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-import { Database, pbToFilter } from '$app/application/database';
-import { FilterChangesetNotificationPB } from '@/services/backend';
-
-export const didUpdateFilter = (database: Database, changeset: FilterChangesetNotificationPB) => {
- const filters = changeset.filters.items.map((pb) => pbToFilter(pb));
-
- database.filters = filters;
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/application/database/filter/filter_service.ts b/frontend/appflowy_tauri/src/appflowy_app/application/database/filter/filter_service.ts
deleted file mode 100644
index 6283763d28..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/application/database/filter/filter_service.ts
+++ /dev/null
@@ -1,88 +0,0 @@
-import {
- DatabaseEventGetAllFilters,
- DatabaseEventUpdateDatabaseSetting,
- DatabaseSettingChangesetPB,
- DatabaseViewIdPB,
- FieldType,
- FilterPB,
-} from '@/services/backend/events/flowy-database2';
-import { Filter, filterDataToPB, UndeterminedFilter } from './filter_types';
-
-export async function getAllFilters(viewId: string): Promise<FilterPB[]> {
- const payload = DatabaseViewIdPB.fromObject({ value: viewId });
-
- const result = await DatabaseEventGetAllFilters(payload);
-
- return result.map((value) => value.items).unwrap();
-}
-
-export async function insertFilter({
- viewId,
- fieldId,
- fieldType,
- data,
-}: {
- viewId: string;
- fieldId: string;
- fieldType: FieldType;
- data?: UndeterminedFilter['data'];
-}): Promise<void> {
- const payload = DatabaseSettingChangesetPB.fromObject({
- view_id: viewId,
- insert_filter: {
- data: {
- field_id: fieldId,
- field_type: fieldType,
- data: data ? filterDataToPB(data, fieldType)?.serialize() : undefined,
- },
- },
- });
-
- const result = await DatabaseEventUpdateDatabaseSetting(payload);
-
- if (!result.ok) {
- return Promise.reject(result.val);
- }
-
- return result.val;
-}
-
-export async function updateFilter(viewId: string, filter: UndeterminedFilter): Promise<void> {
- const payload = DatabaseSettingChangesetPB.fromObject({
- view_id: viewId,
- update_filter_data: {
- filter_id: filter.id,
- data: {
- field_id: filter.fieldId,
- field_type: filter.fieldType,
- data: filterDataToPB(filter.data, filter.fieldType)?.serialize(),
- },
- },
- });
-
- const result = await DatabaseEventUpdateDatabaseSetting(payload);
-
- if (!result.ok) {
- return Promise.reject(result.val);
- }
-
- return result.val;
-}
-
-export async function deleteFilter(viewId: string, filter: Omit<Filter, 'data'>): Promise<void> {
- const payload = DatabaseSettingChangesetPB.fromObject({
- view_id: viewId,
- delete_filter: {
- filter_id: filter.id,
- field_id: filter.fieldId,
- },
- });
-
- const result = await DatabaseEventUpdateDatabaseSetting(payload);
-
- if (!result.ok) {
- return Promise.reject(result.val);
- }
-
- return result.val;
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/application/database/filter/filter_types.ts b/frontend/appflowy_tauri/src/appflowy_app/application/database/filter/filter_types.ts
deleted file mode 100644
index f9f80985e5..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/application/database/filter/filter_types.ts
+++ /dev/null
@@ -1,202 +0,0 @@
-import {
- CheckboxFilterConditionPB,
- CheckboxFilterPB,
- FieldType,
- FilterPB,
- NumberFilterConditionPB,
- NumberFilterPB,
- SelectOptionFilterConditionPB,
- SelectOptionFilterPB,
- TextFilterConditionPB,
- TextFilterPB,
- ChecklistFilterConditionPB,
- ChecklistFilterPB,
- DateFilterConditionPB,
- DateFilterPB,
-} from '@/services/backend';
-
-export interface Filter {
- id: string;
- fieldId: string;
- fieldType: FieldType;
- data: unknown;
-}
-
-export interface TextFilter extends Filter {
- fieldType: FieldType.RichText;
- data: TextFilterData;
-}
-
-export interface TextFilterData {
- condition: TextFilterConditionPB;
- content?: string;
-}
-
-export interface SelectFilter extends Filter {
- fieldType: FieldType.SingleSelect | FieldType.MultiSelect;
- data: SelectFilterData;
-}
-
-export interface NumberFilter extends Filter {
- fieldType: FieldType.Number;
- data: NumberFilterData;
-}
-
-export interface CheckboxFilter extends Filter {
- fieldType: FieldType.Checkbox;
- data: CheckboxFilterData;
-}
-
-export interface CheckboxFilterData {
- condition?: CheckboxFilterConditionPB;
-}
-
-export interface ChecklistFilter extends Filter {
- fieldType: FieldType.Checklist;
- data: ChecklistFilterData;
-}
-
-export interface DateFilter extends Filter {
- fieldType: FieldType.DateTime | FieldType.CreatedTime | FieldType.LastEditedTime;
- data: DateFilterData;
-}
-
-export interface ChecklistFilterData {
- condition?: ChecklistFilterConditionPB;
-}
-
-export interface SelectFilterData {
- condition?: SelectOptionFilterConditionPB;
- optionIds?: string[];
-}
-
-export interface NumberFilterData {
- condition: NumberFilterConditionPB;
- content?: string;
-}
-
-export interface DateFilterData {
- condition: DateFilterConditionPB;
- start?: number;
- end?: number;
- timestamp?: number;
-}
-
-export type UndeterminedFilter =
- | TextFilter
- | SelectFilter
- | NumberFilter
- | CheckboxFilter
- | ChecklistFilter
- | DateFilter;
-
-export function filterDataToPB(data: UndeterminedFilter['data'], fieldType: FieldType) {
- switch (fieldType) {
- case FieldType.RichText:
- case FieldType.URL:
- return TextFilterPB.fromObject({
- condition: (data as TextFilterData).condition,
- content: (data as TextFilterData).content,
- });
- case FieldType.SingleSelect:
- case FieldType.MultiSelect:
- return SelectOptionFilterPB.fromObject({
- condition: (data as SelectFilterData).condition,
- option_ids: (data as SelectFilterData).optionIds,
- });
- case FieldType.Number:
- return NumberFilterPB.fromObject({
- condition: (data as NumberFilterData).condition,
- content: (data as NumberFilterData).content,
- });
- case FieldType.Checkbox:
- return CheckboxFilterPB.fromObject({
- condition: (data as CheckboxFilterData).condition,
- });
- case FieldType.Checklist:
- return ChecklistFilterPB.fromObject({
- condition: (data as ChecklistFilterData).condition,
- });
- case FieldType.DateTime:
- case FieldType.CreatedTime:
- case FieldType.LastEditedTime:
- return DateFilterPB.fromObject({
- condition: (data as DateFilterData).condition,
- start: (data as DateFilterData).start,
- end: (data as DateFilterData).end,
- timestamp: (data as DateFilterData).timestamp,
- });
- }
-}
-
-export function pbToTextFilterData(pb: TextFilterPB): TextFilterData {
- return {
- condition: pb.condition,
- content: pb.content,
- };
-}
-
-export function pbToSelectFilterData(pb: SelectOptionFilterPB): SelectFilterData {
- return {
- condition: pb.condition,
- optionIds: pb.option_ids,
- };
-}
-
-export function pbToNumberFilterData(pb: NumberFilterPB): NumberFilterData {
- return {
- condition: pb.condition,
- content: pb.content,
- };
-}
-
-export function pbToCheckboxFilterData(pb: CheckboxFilterPB): CheckboxFilterData {
- return {
- condition: pb.condition,
- };
-}
-
-export function pbToChecklistFilterData(pb: ChecklistFilterPB): ChecklistFilterData {
- return {
- condition: pb.condition,
- };
-}
-
-export function pbToDateFilterData(pb: DateFilterPB): DateFilterData {
- return {
- condition: pb.condition,
- start: pb.start,
- end: pb.end,
- timestamp: pb.timestamp,
- };
-}
-
-export function bytesToFilterData(bytes: Uint8Array, fieldType: FieldType) {
- switch (fieldType) {
- case FieldType.RichText:
- case FieldType.URL:
- return pbToTextFilterData(TextFilterPB.deserialize(bytes));
- case FieldType.SingleSelect:
- case FieldType.MultiSelect:
- return pbToSelectFilterData(SelectOptionFilterPB.deserialize(bytes));
- case FieldType.Number:
- return pbToNumberFilterData(NumberFilterPB.deserialize(bytes));
- case FieldType.Checkbox:
- return pbToCheckboxFilterData(CheckboxFilterPB.deserialize(bytes));
- case FieldType.Checklist:
- return pbToChecklistFilterData(ChecklistFilterPB.deserialize(bytes));
- case FieldType.DateTime:
- case FieldType.CreatedTime:
- case FieldType.LastEditedTime:
- return pbToDateFilterData(DateFilterPB.deserialize(bytes));
- }
-}
-
-export function pbToFilter(pb: FilterPB): Filter {
- return {
- id: pb.id,
- fieldId: pb.data.field_id,
- fieldType: pb.data.field_type,
- data: bytesToFilterData(pb.data.data, pb.data.field_type),
- };
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/application/database/filter/index.ts b/frontend/appflowy_tauri/src/appflowy_app/application/database/filter/index.ts
deleted file mode 100644
index ac10d27d0a..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/application/database/filter/index.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export * from './filter_types';
-export * as filterService from './filter_service';
-export * as filterListeners from './filter_listeners';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/application/database/group/group_service.ts b/frontend/appflowy_tauri/src/appflowy_app/application/database/group/group_service.ts
deleted file mode 100644
index 24f24d65ec..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/application/database/group/group_service.ts
+++ /dev/null
@@ -1,64 +0,0 @@
-import {
- DatabaseViewIdPB,
- GroupByFieldPayloadPB,
- MoveGroupPayloadPB,
- UpdateGroupPB,
-} from '@/services/backend';
-import {
- DatabaseEventGetGroups,
- DatabaseEventMoveGroup,
- DatabaseEventSetGroupByField,
- DatabaseEventUpdateGroup,
-} from '@/services/backend/events/flowy-database2';
-import { Group, pbToGroup } from './group_types';
-
-export async function getGroups(viewId: string): Promise<Group[]> {
- const payload = DatabaseViewIdPB.fromObject({ value: viewId });
-
- const result = await DatabaseEventGetGroups(payload);
-
- return result.map(value => value.items.map(pbToGroup)).unwrap();
-}
-
-export async function setGroupByField(viewId: string, fieldId: string): Promise<void> {
- const payload = GroupByFieldPayloadPB.fromObject({
- view_id: viewId,
- field_id: fieldId,
- });
-
- const result = await DatabaseEventSetGroupByField(payload);
-
- return result.unwrap();
-}
-
-export async function updateGroup(
- viewId: string,
- group: {
- id: string,
- name?: string,
- visible?: boolean,
- },
-): Promise<void> {
- const payload = UpdateGroupPB.fromObject({
- view_id: viewId,
- group_id: group.id,
- name: group.name,
- visible: group.visible,
- });
-
- const result = await DatabaseEventUpdateGroup(payload);
-
- return result.unwrap();
-}
-
-export async function moveGroup(viewId: string, fromGroupId: string, toGroupId: string): Promise<void> {
- const payload = MoveGroupPayloadPB.fromObject({
- view_id: viewId,
- from_group_id: fromGroupId,
- to_group_id: toGroupId,
- });
-
- const result = await DatabaseEventMoveGroup(payload);
-
- return result.unwrap();
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/application/database/group/group_types.ts b/frontend/appflowy_tauri/src/appflowy_app/application/database/group/group_types.ts
deleted file mode 100644
index b75ecc0bd4..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/application/database/group/group_types.ts
+++ /dev/null
@@ -1,32 +0,0 @@
-import { GroupPB, GroupSettingPB } from '@/services/backend';
-import { pbToRowMeta, RowMeta } from '../row';
-
-export interface GroupSetting {
- id: string;
- fieldId: string;
-}
-
-export interface Group {
- id: string;
- isDefault: boolean;
- isVisible: boolean;
- fieldId: string;
- rows: RowMeta[];
-}
-
-export function pbToGroup(pb: GroupPB): Group {
- return {
- id: pb.group_id,
- isDefault: pb.is_default,
- isVisible: pb.is_visible,
- fieldId: pb.field_id,
- rows: pb.rows.map(pbToRowMeta),
- };
-}
-
-export function pbToGroupSetting(pb: GroupSettingPB): GroupSetting {
- return {
- id: pb.id,
- fieldId: pb.field_id,
- };
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/application/database/group/index.ts b/frontend/appflowy_tauri/src/appflowy_app/application/database/group/index.ts
deleted file mode 100644
index bb872d6677..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/application/database/group/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export * from './group_types';
-export * as groupService from './group_service';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/application/database/index.ts b/frontend/appflowy_tauri/src/appflowy_app/application/database/index.ts
deleted file mode 100644
index f44da5b857..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/application/database/index.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-export * from './cell';
-export * from './database';
-export * from './database_view';
-export * from './field';
-export * from './filter';
-export * from './group';
-export * from './row';
-export * from './sort';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/application/database/row/index.ts b/frontend/appflowy_tauri/src/appflowy_app/application/database/row/index.ts
deleted file mode 100644
index 69260223ef..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/application/database/row/index.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export * from './row_types';
-export * as rowService from './row_service';
-export * as rowListeners from './row_listeners';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/application/database/row/row_listeners.ts b/frontend/appflowy_tauri/src/appflowy_app/application/database/row/row_listeners.ts
deleted file mode 100644
index e8a638403e..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/application/database/row/row_listeners.ts
+++ /dev/null
@@ -1,95 +0,0 @@
-import { ReorderAllRowsPB, ReorderSingleRowPB, RowsChangePB, RowsVisibilityChangePB } from '@/services/backend';
-import { Database } from '../database';
-import { pbToRowMeta, RowMeta } from './row_types';
-import { didDeleteCells } from '$app/application/database/cell/cell_listeners';
-import { getDatabase } from '$app/application/database/database/database_service';
-
-const deleteRowsFromChangeset = (database: Database, changeset: RowsChangePB) => {
- changeset.deleted_rows.forEach((rowId) => {
- const index = database.rowMetas.findIndex((row) => row.id === rowId);
-
- if (index !== -1) {
- database.rowMetas.splice(index, 1);
- // delete cells
- didDeleteCells({ database, rowId });
- }
- });
-};
-
-const updateRowsFromChangeset = (database: Database, changeset: RowsChangePB) => {
- changeset.updated_rows.forEach(({ row_id: rowId, row_meta: rowMetaPB }) => {
- const found = database.rowMetas.find((rowMeta) => rowMeta.id === rowId);
-
- if (found) {
- Object.assign(found, rowMetaPB ? pbToRowMeta(rowMetaPB) : {});
- }
- });
-};
-
-export const didUpdateViewRows = async (viewId: string, database: Database, changeset: RowsChangePB) => {
- if (changeset.inserted_rows.length > 0) {
- const { rowMetas } = await getDatabase(viewId);
-
- database.rowMetas = rowMetas;
- return;
- }
-
- deleteRowsFromChangeset(database, changeset);
- updateRowsFromChangeset(database, changeset);
-};
-
-export const didReorderRows = (database: Database, changeset: ReorderAllRowsPB) => {
- const rowById = database.rowMetas.reduce<Record<string, RowMeta>>((prev, cur) => {
- prev[cur.id] = cur;
- return prev;
- }, {});
-
- database.rowMetas = changeset.row_orders.map((rowId) => rowById[rowId]);
-};
-
-export const didReorderSingleRow = (database: Database, changeset: ReorderSingleRowPB) => {
- const { row_id: rowId, new_index: newIndex } = changeset;
-
- const oldIndex = database.rowMetas.findIndex((rowMeta) => rowMeta.id === rowId);
-
- if (oldIndex !== -1) {
- database.rowMetas.splice(newIndex, 0, database.rowMetas.splice(oldIndex, 1)[0]);
- }
-};
-
-export const didUpdateViewRowsVisibility = async (
- viewId: string,
- database: Database,
- changeset: RowsVisibilityChangePB
-) => {
- const { invisible_rows, visible_rows } = changeset;
-
- let reFetchRows = false;
-
- for (const rowId of invisible_rows) {
- const rowMeta = database.rowMetas.find((rowMeta) => rowMeta.id === rowId);
-
- if (rowMeta) {
- rowMeta.isHidden = true;
- }
- }
-
- for (const insertedRow of visible_rows) {
- const rowMeta = database.rowMetas.find((rowMeta) => rowMeta.id === insertedRow.row_meta.id);
-
- if (rowMeta) {
- rowMeta.isHidden = false;
- } else {
- reFetchRows = true;
- break;
- }
- }
-
- if (reFetchRows) {
- const { rowMetas } = await getDatabase(viewId);
-
- database.rowMetas = rowMetas;
-
- await didUpdateViewRowsVisibility(viewId, database, changeset);
- }
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/application/database/row/row_service.ts b/frontend/appflowy_tauri/src/appflowy_app/application/database/row/row_service.ts
deleted file mode 100644
index 7993f709b7..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/application/database/row/row_service.ts
+++ /dev/null
@@ -1,129 +0,0 @@
-import {
- CreateRowPayloadPB,
- MoveGroupRowPayloadPB,
- MoveRowPayloadPB,
- OrderObjectPositionTypePB,
- RepeatedRowIdPB,
- RowIdPB,
- UpdateRowMetaChangesetPB,
-} from '@/services/backend';
-import {
- DatabaseEventCreateRow,
- DatabaseEventDeleteRows,
- DatabaseEventDuplicateRow,
- DatabaseEventGetRowMeta,
- DatabaseEventMoveGroupRow,
- DatabaseEventMoveRow,
- DatabaseEventUpdateRowMeta,
-} from '@/services/backend/events/flowy-database2';
-import { pbToRowMeta, RowMeta } from './row_types';
-
-export async function createRow(viewId: string, params?: {
- position?: OrderObjectPositionTypePB;
- rowId?: string;
- groupId?: string;
- data?: Record<string, string>;
-}): Promise<RowMeta> {
- const payload = CreateRowPayloadPB.fromObject({
- view_id: viewId,
- row_position: {
- position: params?.position,
- object_id: params?.rowId,
- },
- group_id: params?.groupId,
- data: params?.data,
- });
-
- const result = await DatabaseEventCreateRow(payload);
-
- return result.map(pbToRowMeta).unwrap();
-}
-
-export async function duplicateRow(viewId: string, rowId: string, groupId?: string): Promise<void> {
- const payload = RowIdPB.fromObject({
- view_id: viewId,
- row_id: rowId,
- group_id: groupId,
- });
-
- const result = await DatabaseEventDuplicateRow(payload);
-
- return result.unwrap();
-}
-
-export async function deleteRow(viewId: string, rowId: string, groupId?: string): Promise<void> {
- const payload = RepeatedRowIdPB.fromObject({
- view_id: viewId,
- row_ids: [rowId],
- });
-
- const result = await DatabaseEventDeleteRows(payload);
-
- return result.unwrap();
-}
-
-export async function moveRow(viewId: string, fromRowId: string, toRowId: string): Promise<void> {
- const payload = MoveRowPayloadPB.fromObject({
- view_id: viewId,
- from_row_id: fromRowId,
- to_row_id: toRowId,
- });
-
- const result = await DatabaseEventMoveRow(payload);
-
- return result.unwrap();
-}
-
-/**
- * Move the row from one group to another group
- *
- * @param fromRowId
- * @param toGroupId
- * @param toRowId used to locate the moving row location.
- * @returns
- */
-export async function moveGroupRow(viewId: string, fromRowId: string, toGroupId: string, toRowId?: string): Promise<void> {
- const payload = MoveGroupRowPayloadPB.fromObject({
- view_id: viewId,
- from_row_id: fromRowId,
- to_group_id: toGroupId,
- to_row_id: toRowId,
- });
-
- const result = await DatabaseEventMoveGroupRow(payload);
-
- return result.unwrap();
-}
-
-
-export async function getRowMeta(viewId: string, rowId: string, groupId?: string): Promise<RowMeta> {
- const payload = RowIdPB.fromObject({
- view_id: viewId,
- row_id: rowId,
- group_id: groupId,
- });
-
- const result = await DatabaseEventGetRowMeta(payload);
-
- return result.map(pbToRowMeta).unwrap();
-}
-
-export async function updateRowMeta(
- viewId: string,
- rowId: string,
- meta: {
- iconUrl?: string;
- coverUrl?: string;
- },
-): Promise<void> {
- const payload = UpdateRowMetaChangesetPB.fromObject({
- view_id: viewId,
- id: rowId,
- icon_url: meta.iconUrl,
- cover_url: meta.coverUrl,
- });
-
- const result = await DatabaseEventUpdateRowMeta(payload);
-
- return result.unwrap();
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/application/database/row/row_types.ts b/frontend/appflowy_tauri/src/appflowy_app/application/database/row/row_types.ts
deleted file mode 100644
index 1b964a6bb5..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/application/database/row/row_types.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-import { RowMetaPB } from '@/services/backend';
-
-export interface RowMeta {
- id: string;
- documentId?: string;
- icon?: string;
- cover?: string;
- isHidden?: boolean;
-}
-
-export function pbToRowMeta(pb: RowMetaPB): RowMeta {
- const rowMeta: RowMeta = {
- id: pb.id,
- };
-
- if (pb.document_id) {
- rowMeta.documentId = pb.document_id;
- }
-
- if (pb.icon) {
- rowMeta.icon = pb.icon;
- }
-
- if (pb.cover) {
- rowMeta.cover = pb.cover;
- }
-
- return rowMeta;
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/application/database/sort/index.ts b/frontend/appflowy_tauri/src/appflowy_app/application/database/sort/index.ts
deleted file mode 100644
index 6c7d4bd60a..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/application/database/sort/index.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export * from './sort_types';
-export * as sortService from './sort_service';
-export * as sortListeners from './sort_listeners';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/application/database/sort/sort_listeners.ts b/frontend/appflowy_tauri/src/appflowy_app/application/database/sort/sort_listeners.ts
deleted file mode 100644
index 808c62e0d2..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/application/database/sort/sort_listeners.ts
+++ /dev/null
@@ -1,35 +0,0 @@
-import { SortChangesetNotificationPB } from '@/services/backend';
-import { Database } from '../database';
-import { pbToSort } from './sort_types';
-
-const deleteSortsFromChange = (database: Database, changeset: SortChangesetNotificationPB) => {
- const deleteIds = changeset.delete_sorts.map(sort => sort.id);
-
- if (deleteIds.length) {
- database.sorts = database.sorts.filter(sort => !deleteIds.includes(sort.id));
- }
-};
-
-const insertSortsFromChange = (database: Database, changeset: SortChangesetNotificationPB) => {
- changeset.insert_sorts.forEach(sortPB => {
- database.sorts.push(pbToSort(sortPB.sort));
- });
-};
-
-const updateSortsFromChange = (database: Database, changeset: SortChangesetNotificationPB) => {
- changeset.update_sorts.forEach(sortPB => {
- const found = database.sorts.find(sort => sort.id === sortPB.id);
-
- if (found) {
- const newSort = pbToSort(sortPB);
-
- Object.assign(found, newSort);
- }
- });
-};
-
-export const didUpdateSort = (database: Database, changeset: SortChangesetNotificationPB) => {
- deleteSortsFromChange(database, changeset);
- insertSortsFromChange(database, changeset);
- updateSortsFromChange(database, changeset);
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/application/database/sort/sort_service.ts b/frontend/appflowy_tauri/src/appflowy_app/application/database/sort/sort_service.ts
deleted file mode 100644
index 2546ec780c..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/application/database/sort/sort_service.ts
+++ /dev/null
@@ -1,73 +0,0 @@
-import {
- DatabaseViewIdPB,
- DatabaseSettingChangesetPB,
-} from '@/services/backend';
-import {
- DatabaseEventDeleteAllSorts,
- DatabaseEventGetAllSorts, DatabaseEventUpdateDatabaseSetting,
-} from '@/services/backend/events/flowy-database2';
-import { pbToSort, Sort } from './sort_types';
-
-export async function getAllSorts(viewId: string): Promise<Sort[]> {
- const payload = DatabaseViewIdPB.fromObject({
- value: viewId,
- });
-
- const result = await DatabaseEventGetAllSorts(payload);
-
- return result.map(value => value.items.map(pbToSort)).unwrap();
-}
-
-export async function insertSort(viewId: string, sort: Omit<Sort, 'id'>): Promise<void> {
- const payload = DatabaseSettingChangesetPB.fromObject({
- view_id: viewId,
- update_sort: {
- view_id: viewId,
- field_id: sort.fieldId,
- condition: sort.condition,
- },
- });
-
- const result = await DatabaseEventUpdateDatabaseSetting(payload);
-
- return result.unwrap();
-}
-
-export async function updateSort(viewId: string, sort: Sort): Promise<void> {
- const payload = DatabaseSettingChangesetPB.fromObject({
- view_id: viewId,
- update_sort: {
- view_id: viewId,
- sort_id: sort.id,
- field_id: sort.fieldId,
- condition: sort.condition,
- },
- });
-
- const result = await DatabaseEventUpdateDatabaseSetting(payload);
-
- return result.unwrap();
-}
-
-export async function deleteSort(viewId: string, sort: Sort): Promise<void> {
- const payload = DatabaseSettingChangesetPB.fromObject({
- view_id: viewId,
- delete_sort: {
- view_id: viewId,
- sort_id: sort.id,
- },
- });
-
- const result = await DatabaseEventUpdateDatabaseSetting(payload);
-
- return result.unwrap();
-}
-
-export async function deleteAllSorts(viewId: string): Promise<void> {
- const payload = DatabaseViewIdPB.fromObject({
- value: viewId,
- });
- const result = await DatabaseEventDeleteAllSorts(payload);
-
- return result.unwrap();
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/application/database/sort/sort_types.ts b/frontend/appflowy_tauri/src/appflowy_app/application/database/sort/sort_types.ts
deleted file mode 100644
index a8089878d1..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/application/database/sort/sort_types.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import { SortConditionPB, SortPB } from '@/services/backend';
-
-export interface Sort {
- id: string;
- fieldId: string;
- condition: SortConditionPB;
-}
-
-export function pbToSort(pb: SortPB): Sort {
- return {
- id: pb.id,
- fieldId: pb.field_id,
- condition: pb.condition,
- };
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/application/document/document.service.ts b/frontend/appflowy_tauri/src/appflowy_app/application/document/document.service.ts
deleted file mode 100644
index 0db128ec7a..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/application/document/document.service.ts
+++ /dev/null
@@ -1,284 +0,0 @@
-import {
- ApplyActionPayloadPB,
- BlockActionPB,
- BlockPB,
- CloseDocumentPayloadPB,
- ConvertDataToJsonPayloadPB,
- ConvertDocumentPayloadPB,
- InputType,
- OpenDocumentPayloadPB,
- TextDeltaPayloadPB,
-} from '@/services/backend';
-import {
- DocumentEventApplyAction,
- DocumentEventApplyTextDeltaEvent,
- DocumentEventCloseDocument,
- DocumentEventConvertDataToJSON,
- DocumentEventConvertDocument,
- DocumentEventOpenDocument,
-} from '@/services/backend/events/flowy-document';
-import get from 'lodash-es/get';
-import { EditorData, EditorNodeType } from '$app/application/document/document.types';
-import { Log } from '$app/utils/log';
-import { Op } from 'quill-delta';
-import { Element, Text } from 'slate';
-import { generateId, getInlinesWithDelta } from '$app/components/editor/provider/utils/convert';
-import { CustomEditor } from '$app/components/editor/command';
-import { LIST_TYPES } from '$app/components/editor/command/tab';
-
-export function blockPB2Node(block: BlockPB) {
- let data = {};
-
- try {
- data = JSON.parse(block.data);
- } catch {
- Log.error('[Document Open] json parse error', block.data);
- }
-
- return {
- id: block.id,
- type: block.ty as EditorNodeType,
- parent: block.parent_id,
- children: block.children_id,
- data,
- externalId: block.external_id,
- externalType: block.external_type,
- };
-}
-
-export const BLOCK_MAP_NAME = 'blocks';
-export const META_NAME = 'meta';
-export const CHILDREN_MAP_NAME = 'children_map';
-
-export const TEXT_MAP_NAME = 'text_map';
-export async function openDocument(docId: string): Promise<EditorData> {
- const payload = OpenDocumentPayloadPB.fromObject({
- document_id: docId,
- });
-
- const result = await DocumentEventOpenDocument(payload);
-
- if (!result.ok) {
- return Promise.reject(result.val);
- }
-
- const documentDataPB = result.val;
-
- if (!documentDataPB) {
- return Promise.reject('documentDataPB is null');
- }
-
- const data: EditorData = {
- viewId: docId,
- rootId: documentDataPB.page_id,
- nodeMap: {},
- childrenMap: {},
- relativeMap: {},
- deltaMap: {},
- externalIdMap: {},
- };
-
- get(documentDataPB, BLOCK_MAP_NAME).forEach((block) => {
- Object.assign(data.nodeMap, {
- [block.id]: blockPB2Node(block),
- });
- data.relativeMap[block.children_id] = block.id;
- if (block.external_id) {
- data.externalIdMap[block.external_id] = block.id;
- }
- });
-
- get(documentDataPB, [META_NAME, CHILDREN_MAP_NAME]).forEach((child, key) => {
- const blockId = data.relativeMap[key];
-
- data.childrenMap[blockId] = child.children;
- });
-
- get(documentDataPB, [META_NAME, TEXT_MAP_NAME]).forEach((delta, key) => {
- const blockId = data.externalIdMap[key];
-
- data.deltaMap[blockId] = delta ? JSON.parse(delta) : [];
- });
-
- return data;
-}
-
-export async function closeDocument(docId: string) {
- const payload = CloseDocumentPayloadPB.fromObject({
- document_id: docId,
- });
-
- const result = await DocumentEventCloseDocument(payload);
-
- if (!result.ok) {
- return Promise.reject(result.val);
- }
-
- return result.val;
-}
-
-export async function applyActions(docId: string, actions: ReturnType<typeof BlockActionPB.prototype.toObject>[]) {
- if (actions.length === 0) return;
- const payload = ApplyActionPayloadPB.fromObject({
- document_id: docId,
- actions: actions,
- });
-
- const result = await DocumentEventApplyAction(payload);
-
- if (!result.ok) {
- return Promise.reject(result.val);
- }
-
- return result.val;
-}
-
-export async function applyText(docId: string, textId: string, delta: string) {
- const payload = TextDeltaPayloadPB.fromObject({
- document_id: docId,
- text_id: textId,
- delta: delta,
- });
-
- const res = await DocumentEventApplyTextDeltaEvent(payload);
-
- if (!res.ok) {
- return Promise.reject(res.val);
- }
-
- return res.val;
-}
-
-export async function getClipboardData(
- docId: string,
- range: {
- start: {
- blockId: string;
- index: number;
- length: number;
- };
- end?: {
- blockId: string;
- index: number;
- length: number;
- };
- }
-) {
- const payload = ConvertDocumentPayloadPB.fromObject({
- range: {
- start: {
- block_id: range.start.blockId,
- index: range.start.index,
- length: range.start.length,
- },
- end: range.end
- ? {
- block_id: range.end.blockId,
- index: range.end.index,
- length: range.end.length,
- }
- : undefined,
- },
- document_id: docId,
- parse_types: {
- json: true,
- html: true,
- text: true,
- },
- });
-
- const result = await DocumentEventConvertDocument(payload);
-
- if (!result.ok) {
- return Promise.reject(result.val);
- }
-
- return {
- html: result.val.html,
- text: result.val.text,
- json: result.val.json,
- };
-}
-
-export async function convertBlockToJson(data: string, type: InputType) {
- const payload = ConvertDataToJsonPayloadPB.fromObject({
- data,
- input_type: type,
- });
-
- const result = await DocumentEventConvertDataToJSON(payload);
-
- if (!result.ok) {
- return Promise.reject(result.val);
- }
-
- try {
- const block = JSON.parse(result.val.json);
-
- return flattenBlockJson(block);
- } catch (e) {
- return Promise.reject(e);
- }
-}
-
-interface BlockJSON {
- type: string;
- children: BlockJSON[];
- data: {
- [key: string]: boolean | string | number | undefined;
- } & {
- delta?: Op[];
- };
-}
-
-function flattenBlockJson(block: BlockJSON) {
- const traverse = (block: BlockJSON) => {
- const { delta, ...data } = block.data;
-
- const slateNode: Element = {
- type: block.type,
- data: data,
- children: [],
- blockId: generateId(),
- };
- const isEmbed = CustomEditor.isEmbedNode(slateNode);
-
- const textNode: {
- type: EditorNodeType.Text;
- children: (Text | Element)[];
- textId: string;
- } | null = !isEmbed
- ? {
- type: EditorNodeType.Text,
- children: [{ text: '' }],
- textId: generateId(),
- }
- : null;
-
- if (delta && textNode) {
- textNode.children = getInlinesWithDelta(delta);
- }
-
- slateNode.children = block.children.map((child) => traverse(child));
-
- if (textNode) {
- const texts = CustomEditor.getNodeTextContent(textNode);
-
- if (texts && !LIST_TYPES.includes(block.type as EditorNodeType) && slateNode.type !== EditorNodeType.Page) {
- slateNode.children.unshift(textNode);
- } else if (texts) {
- slateNode.children.unshift({
- type: EditorNodeType.Paragraph,
- children: [textNode],
- blockId: generateId(),
- });
- }
- }
-
- return slateNode;
- };
-
- const root = traverse(block);
-
- return root.children;
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/application/document/document.types.ts b/frontend/appflowy_tauri/src/appflowy_app/application/document/document.types.ts
deleted file mode 100644
index e6eb1d6923..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/application/document/document.types.ts
+++ /dev/null
@@ -1,242 +0,0 @@
-import { Op } from 'quill-delta';
-import { HTMLAttributes } from 'react';
-import { Element } from 'slate';
-import { ViewIconTypePB, ViewLayoutPB } from '@/services/backend';
-import { PageCover } from '$app_reducers/pages/slice';
-import * as Y from 'yjs';
-
-export interface EditorNode {
- id: string;
- type: EditorNodeType;
- parent?: string | null;
- data?: BlockData;
- children?: string;
- externalId?: string;
- externalType?: string;
-}
-
-export interface TextNode extends Element {
- type: EditorNodeType.Text;
- textId: string;
- blockId: string;
-}
-
-export interface PageNode extends Element {
- type: EditorNodeType.Page;
-}
-export interface ParagraphNode extends Element {
- type: EditorNodeType.Paragraph;
-}
-
-export type BlockData = {
- [key: string]: string | boolean | number | undefined;
- font_color?: string;
- bg_color?: string;
-};
-
-export interface HeadingNode extends Element {
- blockId: string;
- type: EditorNodeType.HeadingBlock;
- data: {
- level: number;
- } & BlockData;
-}
-
-export interface GridNode extends Element {
- blockId: string;
- type: EditorNodeType.GridBlock;
- data: {
- viewId?: string;
- } & BlockData;
-}
-
-export interface TodoListNode extends Element {
- blockId: string;
- type: EditorNodeType.TodoListBlock;
- data: {
- checked: boolean;
- } & BlockData;
-}
-
-export interface CodeNode extends Element {
- blockId: string;
- type: EditorNodeType.CodeBlock;
- data: {
- language: string;
- } & BlockData;
-}
-
-export interface QuoteNode extends Element {
- blockId: string;
- type: EditorNodeType.QuoteBlock;
-}
-
-export interface NumberedListNode extends Element {
- type: EditorNodeType.NumberedListBlock;
- blockId: string;
- data: {
- number?: number;
- } & BlockData;
-}
-
-export interface BulletedListNode extends Element {
- type: EditorNodeType.BulletedListBlock;
- blockId: string;
-}
-
-export interface ToggleListNode extends Element {
- type: EditorNodeType.ToggleListBlock;
- blockId: string;
- data: {
- collapsed: boolean;
- } & BlockData;
-}
-
-export interface DividerNode extends Element {
- type: EditorNodeType.DividerBlock;
- blockId: string;
-}
-
-export interface CalloutNode extends Element {
- type: EditorNodeType.CalloutBlock;
- blockId: string;
- data: {
- icon: string;
- } & BlockData;
-}
-
-export interface MathEquationNode extends Element {
- type: EditorNodeType.EquationBlock;
- blockId: string;
- data: {
- formula?: string;
- } & BlockData;
-}
-
-export enum ImageType {
- Local = 0,
- Internal = 1,
- External = 2,
-}
-
-export interface ImageNode extends Element {
- type: EditorNodeType.ImageBlock;
- blockId: string;
- data: {
- url?: string;
- width?: number;
- image_type?: ImageType;
- height?: number;
- } & BlockData;
-}
-
-export interface FormulaNode extends Element {
- type: EditorInlineNodeType.Formula;
- data: string;
-}
-
-export interface MentionNode extends Element {
- type: EditorInlineNodeType.Mention;
- data: Mention;
-}
-
-export interface EditorData {
- viewId: string;
- rootId: string;
- // key: block's id, value: block
- nodeMap: Record<string, EditorNode>;
- // key: block's children id, value: block's id
- childrenMap: Record<string, string[]>;
- // key: block's children id, value: block's id
- relativeMap: Record<string, string>;
- // key: block's externalId, value: delta
- deltaMap: Record<string, Op[]>;
- // key: block's externalId, value: block's id
- externalIdMap: Record<string, string>;
-}
-
-export interface MentionPage {
- id: string;
- name: string;
- layout: ViewLayoutPB;
- parentId: string;
- icon?: {
- ty: ViewIconTypePB;
- value: string;
- };
-}
-
-export interface EditorProps {
- title?: string;
- cover?: PageCover;
- onTitleChange?: (title: string) => void;
- onCoverChange?: (cover?: PageCover) => void;
- showTitle?: boolean;
- id: string;
- disableFocus?: boolean;
-}
-
-export interface LocalEditorProps {
- disableFocus?: boolean;
- sharedType: Y.XmlText;
- id: string;
- caretColor?: string;
-}
-
-export enum EditorNodeType {
- Text = 'text',
- Paragraph = 'paragraph',
- Page = 'page',
- HeadingBlock = 'heading',
- TodoListBlock = 'todo_list',
- BulletedListBlock = 'bulleted_list',
- NumberedListBlock = 'numbered_list',
- ToggleListBlock = 'toggle_list',
- CodeBlock = 'code',
- EquationBlock = 'math_equation',
- QuoteBlock = 'quote',
- CalloutBlock = 'callout',
- DividerBlock = 'divider',
- ImageBlock = 'image',
- GridBlock = 'grid',
-}
-
-export enum EditorInlineNodeType {
- Mention = 'mention',
- Formula = 'formula',
-}
-
-export const inlineNodeTypes: (string | EditorInlineNodeType)[] = [
- EditorInlineNodeType.Mention,
- EditorInlineNodeType.Formula,
-];
-
-export interface EditorElementProps<T = Element> extends HTMLAttributes<HTMLDivElement> {
- node: T;
-}
-
-export enum EditorMarkFormat {
- Bold = 'bold',
- Italic = 'italic',
- Underline = 'underline',
- StrikeThrough = 'strikethrough',
- Code = 'code',
- Href = 'href',
- FontColor = 'font_color',
- BgColor = 'bg_color',
- Align = 'align',
-}
-
-export enum MentionType {
- PageRef = 'page',
- Date = 'date',
-}
-
-export interface Mention {
- // inline page ref id
- page_id?: string;
- // reminder date ref id
- date?: string;
-
- type: MentionType;
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/application/folder/page.service.ts b/frontend/appflowy_tauri/src/appflowy_app/application/folder/page.service.ts
deleted file mode 100644
index 7d988b9866..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/application/folder/page.service.ts
+++ /dev/null
@@ -1,166 +0,0 @@
-import { Page, PageIcon, parserViewPBToPage } from '$app_reducers/pages/slice';
-import {
- CreateOrphanViewPayloadPB,
- CreateViewPayloadPB,
- MoveNestedViewPayloadPB,
- RepeatedViewIdPB,
- UpdateViewIconPayloadPB,
- UpdateViewPayloadPB,
- ViewIconPB,
- ViewIdPB,
- ViewPB,
-} from '@/services/backend';
-import {
- FolderEventCreateOrphanView,
- FolderEventCreateView,
- FolderEventDeleteView,
- FolderEventDuplicateView,
- FolderEventGetView,
- FolderEventMoveNestedView,
- FolderEventUpdateView,
- FolderEventUpdateViewIcon,
- FolderEventSetLatestView,
-} from '@/services/backend/events/flowy-folder';
-
-export async function getPage(id: string) {
- const payload = new ViewIdPB({
- value: id,
- });
-
- const result = await FolderEventGetView(payload);
-
- if (result.ok) {
- return parserViewPBToPage(result.val);
- }
-
- return Promise.reject(result.val);
-}
-
-export const createOrphanPage = async (
- params: ReturnType<typeof CreateOrphanViewPayloadPB.prototype.toObject>
-): Promise<Page> => {
- const payload = CreateOrphanViewPayloadPB.fromObject(params);
-
- const result = await FolderEventCreateOrphanView(payload);
-
- if (result.ok) {
- return parserViewPBToPage(result.val);
- }
-
- return Promise.reject(result.val);
-};
-
-export const duplicatePage = async (page: Page) => {
- const payload = ViewPB.fromObject(page);
-
- const result = await FolderEventDuplicateView(payload);
-
- if (result.ok) {
- return result.val;
- }
-
- return Promise.reject(result.err);
-};
-
-export const deletePage = async (id: string) => {
- const payload = new RepeatedViewIdPB({
- items: [id],
- });
-
- const result = await FolderEventDeleteView(payload);
-
- if (result.ok) {
- return result.val;
- }
-
- return Promise.reject(result.err);
-};
-
-export const createPage = async (params: ReturnType<typeof CreateViewPayloadPB.prototype.toObject>): Promise<string> => {
- const payload = CreateViewPayloadPB.fromObject(params);
-
- const result = await FolderEventCreateView(payload);
-
- if (result.ok) {
- return result.val.id;
- }
-
- return Promise.reject(result.err);
-};
-
-export const movePage = async (params: ReturnType<typeof MoveNestedViewPayloadPB.prototype.toObject>) => {
- const payload = new MoveNestedViewPayloadPB(params);
-
- const result = await FolderEventMoveNestedView(payload);
-
- if (result.ok) {
- return result.val;
- }
-
- return Promise.reject(result.err);
-};
-
-export const getChildPages = async (id: string): Promise<Page[]> => {
- const payload = new ViewIdPB({
- value: id,
- });
-
- const result = await FolderEventGetView(payload);
-
- if (result.ok) {
- return result.val.child_views.map(parserViewPBToPage);
- }
-
- return [];
-};
-
-export const updatePage = async (page: { id: string } & Partial<Page>) => {
- const payload = new UpdateViewPayloadPB();
-
- payload.view_id = page.id;
- if (page.name !== undefined) {
- payload.name = page.name;
- }
-
- const result = await FolderEventUpdateView(payload);
-
- if (result.ok) {
- return result.val.toObject();
- }
-
- return Promise.reject(result.err);
-};
-
-export const updatePageIcon = async (viewId: string, icon?: PageIcon) => {
- const payload = new UpdateViewIconPayloadPB({
- view_id: viewId,
- icon: icon
- ? new ViewIconPB({
- ty: icon.ty,
- value: icon.value,
- })
- : undefined,
- });
-
- const result = await FolderEventUpdateViewIcon(payload);
-
- if (result.ok) {
- return result.val;
- }
-
- return Promise.reject(result.err);
-};
-
-export async function setLatestOpenedPage(id: string) {
- const payload = new ViewIdPB({
- value: id,
- });
-
- const res = await FolderEventSetLatestView(payload);
-
- if (res.ok) {
- return res.val;
- }
-
- return Promise.reject(res.err);
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/application/folder/trash.service.ts b/frontend/appflowy_tauri/src/appflowy_app/application/folder/trash.service.ts
deleted file mode 100644
index dfbe742ca0..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/application/folder/trash.service.ts
+++ /dev/null
@@ -1,68 +0,0 @@
-import {
- FolderEventListTrashItems,
- FolderEventPermanentlyDeleteAllTrashItem,
- FolderEventPermanentlyDeleteTrashItem,
- FolderEventRecoverAllTrashItems,
- FolderEventRestoreTrashItem,
- RepeatedTrashIdPB,
- TrashIdPB,
-} from '@/services/backend/events/flowy-folder';
-
-export const getTrash = async () => {
- const res = await FolderEventListTrashItems();
-
- if (res.ok) {
- return res.val.items;
- }
-
- return [];
-};
-
-export const putback = async (id: string) => {
- const payload = new TrashIdPB({
- id,
- });
-
- const res = await FolderEventRestoreTrashItem(payload);
-
- if (res.ok) {
- return res.val;
- }
-
- return Promise.reject(res.err);
-};
-
-export const deleteTrashItem = async (ids: string[]) => {
- const items = ids.map((id) => new TrashIdPB({ id }));
- const payload = new RepeatedTrashIdPB({
- items,
- });
-
- const res = await FolderEventPermanentlyDeleteTrashItem(payload);
-
- if (res.ok) {
- return res.val;
- }
-
- return Promise.reject(res.err);
-};
-
-export const deleteAll = async () => {
- const res = await FolderEventPermanentlyDeleteAllTrashItem();
-
- if (res.ok) {
- return res.val;
- }
-
- return Promise.reject(res.err);
-};
-
-export const restoreAll = async () => {
- const res = await FolderEventRecoverAllTrashItems();
-
- if (res.ok) {
- return res.val;
- }
-
- return Promise.reject(res.err);
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/application/folder/workspace.service.ts b/frontend/appflowy_tauri/src/appflowy_app/application/folder/workspace.service.ts
deleted file mode 100644
index fe066b7377..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/application/folder/workspace.service.ts
+++ /dev/null
@@ -1,141 +0,0 @@
-import { parserViewPBToPage } from '$app_reducers/pages/slice';
-import {
- ChangeWorkspaceIconPB,
- CreateViewPayloadPB,
- GetWorkspaceViewPB,
- RenameWorkspacePB,
- UserWorkspaceIdPB,
- WorkspaceIdPB,
-} from '@/services/backend';
-import {
- FolderEventCreateView,
- FolderEventDeleteWorkspace,
- FolderEventGetCurrentWorkspaceSetting,
- FolderEventReadCurrentWorkspace,
- FolderEventReadWorkspaceViews,
-} from '@/services/backend/events/flowy-folder';
-import {
- UserEventChangeWorkspaceIcon,
- UserEventGetAllWorkspace,
- UserEventOpenWorkspace,
- UserEventRenameWorkspace,
-} from '@/services/backend/events/flowy-user';
-
-export async function openWorkspace(id: string) {
- const payload = new UserWorkspaceIdPB({
- workspace_id: id,
- });
-
- const result = await UserEventOpenWorkspace(payload);
-
- if (result.ok) {
- return result.val;
- }
-
- return Promise.reject(result.err);
-}
-
-export async function deleteWorkspace(id: string) {
- const payload = new WorkspaceIdPB({
- value: id,
- });
-
- const result = await FolderEventDeleteWorkspace(payload);
-
- if (result.ok) {
- return result.val;
- }
-
- return Promise.reject(result.err);
-}
-
-export async function getWorkspaceChildViews(id: string) {
- const payload = new GetWorkspaceViewPB({
- value: id,
- });
-
- const result = await FolderEventReadWorkspaceViews(payload);
-
- if (result.ok) {
- return result.val.items.map(parserViewPBToPage);
- }
-
- return [];
-}
-
-export async function getWorkspaces() {
- const result = await UserEventGetAllWorkspace();
-
- if (result.ok) {
- return result.val.items.map((workspace) => ({
- id: workspace.workspace_id,
- name: workspace.name,
- }));
- }
-
- return [];
-}
-
-export async function getCurrentWorkspaceSetting() {
- const res = await FolderEventGetCurrentWorkspaceSetting();
-
- if (res.ok) {
- return res.val;
- }
-
- return;
-}
-
-export async function getCurrentWorkspace() {
- const result = await FolderEventReadCurrentWorkspace();
-
- if (result.ok) {
- return result.val.id;
- }
-
- return null;
-}
-
-export async function createCurrentWorkspaceChildView(
- params: ReturnType<typeof CreateViewPayloadPB.prototype.toObject>
-) {
- const payload = CreateViewPayloadPB.fromObject(params);
-
- const result = await FolderEventCreateView(payload);
-
- if (result.ok) {
- return result.val;
- }
-
- return Promise.reject(result.err);
-}
-
-export async function renameWorkspace(id: string, name: string) {
- const payload = new RenameWorkspacePB({
- workspace_id: id,
- new_name: name,
- });
-
- const result = await UserEventRenameWorkspace(payload);
-
- if (result.ok) {
- return result.val;
- }
-
- return Promise.reject(result.err);
-}
-
-export async function changeWorkspaceIcon(id: string, icon: string) {
- const payload = new ChangeWorkspaceIconPB({
- workspace_id: id,
- new_icon: icon,
- });
-
- const result = await UserEventChangeWorkspaceIcon(payload);
-
- if (result.ok) {
- return result.val;
- }
-
- return Promise.reject(result.err);
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/application/notification.ts b/frontend/appflowy_tauri/src/appflowy_app/application/notification.ts
deleted file mode 100644
index c63a5d9823..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/application/notification.ts
+++ /dev/null
@@ -1,157 +0,0 @@
-import { listen } from '@tauri-apps/api/event';
-import { SubscribeObject } from '@/services/backend/models/flowy-notification';
-import {
- DatabaseFieldChangesetPB,
- DatabaseNotification,
- DocEventPB,
- DocumentNotification,
- FieldPB,
- FieldSettingsPB,
- FilterChangesetNotificationPB,
- GroupChangesPB,
- GroupRowsNotificationPB,
- ReorderAllRowsPB,
- ReorderSingleRowPB,
- RowsChangePB,
- RowsVisibilityChangePB,
- SortChangesetNotificationPB,
- UserNotification,
- UserProfilePB,
- FolderNotification,
- RepeatedViewPB,
- ViewPB,
- RepeatedTrashPB,
- ChildViewUpdatePB,
- WorkspacePB,
-} from '@/services/backend';
-import { AsyncQueue } from '$app/utils/async_queue';
-
-const Notification = {
- [DatabaseNotification.DidUpdateViewRowsVisibility]: RowsVisibilityChangePB,
- [DatabaseNotification.DidUpdateViewRows]: RowsChangePB,
- [DatabaseNotification.DidReorderRows]: ReorderAllRowsPB,
- [DatabaseNotification.DidReorderSingleRow]: ReorderSingleRowPB,
- [DatabaseNotification.DidUpdateFields]: DatabaseFieldChangesetPB,
- [DatabaseNotification.DidGroupByField]: GroupChangesPB,
- [DatabaseNotification.DidUpdateNumOfGroups]: GroupChangesPB,
- [DatabaseNotification.DidUpdateGroupRow]: GroupRowsNotificationPB,
- [DatabaseNotification.DidUpdateField]: FieldPB,
- [DatabaseNotification.DidUpdateCell]: null,
- [DatabaseNotification.DidUpdateSort]: SortChangesetNotificationPB,
- [DatabaseNotification.DidUpdateFieldSettings]: FieldSettingsPB,
- [DatabaseNotification.DidUpdateFilter]: FilterChangesetNotificationPB,
- [DocumentNotification.DidReceiveUpdate]: DocEventPB,
- [FolderNotification.DidUpdateWorkspace]: WorkspacePB,
- [FolderNotification.DidUpdateWorkspaceViews]: RepeatedViewPB,
- [FolderNotification.DidUpdateView]: ViewPB,
- [FolderNotification.DidUpdateChildViews]: ChildViewUpdatePB,
- [FolderNotification.DidUpdateTrash]: RepeatedTrashPB,
- [UserNotification.DidUpdateUserProfile]: UserProfilePB,
-};
-
-type NotificationMap = typeof Notification;
-export type NotificationEnum = keyof NotificationMap;
-// eslint-disable-next-line @typescript-eslint/no-explicit-any
-type NullableInstanceType<K extends (abstract new (...args: any) => any) | null> = K extends abstract new (
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- ...args: any
-) => // eslint-disable-next-line @typescript-eslint/no-explicit-any
-any
- ? InstanceType<K>
- : void;
-export type NotificationHandler<K extends NotificationEnum> = (
- result: NullableInstanceType<NotificationMap[K]>
-) => void | Promise<void>;
-
-/**
- * Subscribes to a set of notifications.
- *
- * This function subscribes to notifications defined by the `NotificationEnum` and
- * calls the appropriate `NotificationHandler` when each type of notification is received.
- *
- * @param {Object} callbacks - An object containing handlers for various notification types.
- * Each key is a `NotificationEnum` value, and the corresponding value is a `NotificationHandler` function.
- *
- * @param {Object} [options] - Optional settings for the subscription.
- * @param {string} [options.id] - An optional ID. If provided, only notifications with a matching ID will be processed.
- *
- * @returns {Promise<() => void>} A Promise that resolves to an unsubscribe function.
- *
- * @example
- * subscribeNotifications({
- * [DatabaseNotification.DidUpdateField]: (result) => {
- * if (result.err) {
- * // process error
- * return;
- * }
- *
- * console.log(result.val); // result.val is FieldPB
- * },
- * [DatabaseNotification.DidReorderRows]: (result) => {
- * if (result.err) {
- * // process error
- * return;
- * }
- *
- * console.log(result.val); // result.val is ReorderAllRowsPB
- * },
- * }, { id: '123' })
- * .then(unsubscribe => {
- * // Do something
- * // ...
- * // To unsubscribe, call `unsubscribe()`
- * });
- *
- * @throws {Error} Throws an error if unable to subscribe.
- */
-export function subscribeNotifications(
- callbacks: {
- [K in NotificationEnum]?: NotificationHandler<K>;
- },
- options?: { id?: string | number }
-): Promise<() => void> {
- const handler = async (subject: SubscribeObject) => {
- const { id, ty } = subject;
-
- if (options?.id !== undefined && id !== options.id) {
- return;
- }
-
- const notification = ty as NotificationEnum;
- const pb = Notification[notification];
- const callback = callbacks[notification] as NotificationHandler<NotificationEnum>;
-
- if (pb === undefined || !callback) {
- return;
- }
-
- if (subject.has_error) {
- // const error = FlowyError.deserialize(subject.error);
- return;
- } else {
- const { payload } = subject;
-
- if (pb) {
- await callback(pb.deserialize(payload));
- } else {
- await callback();
- }
- }
- };
-
- const queue = new AsyncQueue(handler);
-
- return listen<ReturnType<typeof SubscribeObject.prototype.toObject>>('af-notification', (event) => {
- const subject = SubscribeObject.fromObject(event.payload);
-
- queue.enqueue(subject);
- });
-}
-
-export function subscribeNotification<K extends NotificationEnum>(
- notification: K,
- callback: NotificationHandler<K>,
- options?: { id?: string }
-): Promise<() => void> {
- return subscribeNotifications({ [notification]: callback }, options);
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/application/user/auth.service.ts b/frontend/appflowy_tauri/src/appflowy_app/application/user/auth.service.ts
deleted file mode 100644
index ec258abc87..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/application/user/auth.service.ts
+++ /dev/null
@@ -1,92 +0,0 @@
-import {
- SignUpPayloadPB,
- OauthProviderPB,
- ProviderTypePB,
- OauthSignInPB,
- AuthenticatorPB,
- SignInPayloadPB,
-} from '@/services/backend';
-import {
- UserEventSignOut,
- UserEventSignUp,
- UserEventGetOauthURLWithProvider,
- UserEventOauthSignIn,
- UserEventSignInWithEmailPassword,
-} from '@/services/backend/events/flowy-user';
-import { Log } from '$app/utils/log';
-
-export const AuthService = {
- getOAuthURL: async (provider: ProviderTypePB) => {
- const providerDataRes = await UserEventGetOauthURLWithProvider(
- OauthProviderPB.fromObject({
- provider,
- })
- );
-
- if (!providerDataRes.ok) {
- Log.error(providerDataRes.val.msg);
- throw new Error(providerDataRes.val.msg);
- }
-
- const providerData = providerDataRes.val;
-
- return providerData.oauth_url;
- },
-
- signInWithOAuth: async ({ uri, deviceId }: { uri: string; deviceId: string }) => {
- const payload = OauthSignInPB.fromObject({
- authenticator: AuthenticatorPB.AppFlowyCloud,
- map: {
- sign_in_url: uri,
- device_id: deviceId,
- },
- });
-
- const res = await UserEventOauthSignIn(payload);
-
- if (!res.ok) {
- Log.error(res.val.msg);
- throw new Error(res.val.msg);
- }
-
- return res.val;
- },
-
- signUp: async (params: { deviceId: string; name: string; email: string; password: string }) => {
- const payload = SignUpPayloadPB.fromObject({
- name: params.name,
- email: params.email,
- password: params.password,
- device_id: params.deviceId,
- });
-
- const res = await UserEventSignUp(payload);
-
- if (!res.ok) {
- Log.error(res.val.msg);
- throw new Error(res.val.msg);
- }
-
- return res.val;
- },
-
- signOut: () => {
- return UserEventSignOut();
- },
-
- signIn: async (email: string, password: string) => {
- const payload = SignInPayloadPB.fromObject({
- email,
- password,
- });
-
- const res = await UserEventSignInWithEmailPassword(payload);
-
- if (!res.ok) {
- Log.error(res.val.msg);
- throw new Error(res.val.msg);
- }
-
- return res.val;
- },
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/application/user/user.service.ts b/frontend/appflowy_tauri/src/appflowy_app/application/user/user.service.ts
deleted file mode 100644
index ec64fb810c..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/application/user/user.service.ts
+++ /dev/null
@@ -1,68 +0,0 @@
-import { Theme, ThemeMode, UserSetting } from '$app_reducers/current-user/slice';
-import { AppearanceSettingsPB, UpdateUserProfilePayloadPB } from '@/services/backend';
-import {
- UserEventGetAppearanceSetting,
- UserEventGetUserProfile,
- UserEventSetAppearanceSetting,
- UserEventUpdateUserProfile,
-} from '@/services/backend/events/flowy-user';
-
-export const UserService = {
- getAppearanceSetting: async (): Promise<Partial<UserSetting> | undefined> => {
- const appearanceSetting = await UserEventGetAppearanceSetting();
-
- if (appearanceSetting.ok) {
- const res = appearanceSetting.val;
- const { locale, theme = Theme.Default, theme_mode = ThemeMode.Light } = res;
- let language = 'en';
-
- if (locale.language_code && locale.country_code) {
- language = `${locale.language_code}-${locale.country_code}`;
- } else if (locale.language_code) {
- language = locale.language_code;
- }
-
- return {
- themeMode: theme_mode,
- theme: theme as Theme,
- language: language,
- };
- }
-
- return;
- },
-
- setAppearanceSetting: async (params: ReturnType<typeof AppearanceSettingsPB.prototype.toObject>) => {
- const payload = AppearanceSettingsPB.fromObject(params);
-
- const res = await UserEventSetAppearanceSetting(payload);
-
- if (res.ok) {
- return res.val;
- }
-
- return Promise.reject(res.err);
- },
-
- getUserProfile: async () => {
- const res = await UserEventGetUserProfile();
-
- if (res.ok) {
- return res.val;
- }
-
- return;
- },
-
- updateUserProfile: async (params: ReturnType<typeof UpdateUserProfilePayloadPB.prototype.toObject>) => {
- const payload = UpdateUserProfilePayloadPB.fromObject(params);
-
- const res = await UserEventUpdateUserProfile(payload);
-
- if (res.ok) {
- return res.val;
- }
-
- return Promise.reject(res.err);
- },
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/add.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/add.svg
deleted file mode 100644
index 049be05cec..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/add.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M8 4C7.72386 4 7.5 4.22386 7.5 4.5V7.5H4.5C4.22386 7.5 4 7.72386 4 8C4 8.27614 4.22386 8.5 4.5 8.5H7.5V11.5C7.5 11.7761 7.72386 12 8 12C8.27614 12 8.5 11.7761 8.5 11.5V8.5H11.5C11.7761 8.5 12 8.27614 12 8C12 7.72386 11.7761 7.5 11.5 7.5H8.5V4.5C8.5 4.22386 8.27614 4 8 4Z" fill="#333333"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/align-center.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/align-center.svg
deleted file mode 100644
index f4f4999514..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/align-center.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M4 4L12 4" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
-<path d="M5 8H11" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
-<path d="M4 12L12 12" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/align-left.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/align-left.svg
deleted file mode 100644
index 23957285c7..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/align-left.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M4 4L12 4" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
-<path d="M4 8H10" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
-<path d="M4 12L12 12" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/align-right.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/align-right.svg
deleted file mode 100644
index bca2d14fc7..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/align-right.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M4 4L12 4" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
-<path d="M6 8H12" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
-<path d="M4 12L12 12" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/arrow-left.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/arrow-left.svg
deleted file mode 100644
index e4ab9068be..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/arrow-left.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M10 4L6 8L10 12" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/arrow-right.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/arrow-right.svg
deleted file mode 100644
index dc40ae52a6..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/arrow-right.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M6 4L10 8L6 12" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/board.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/board.svg
deleted file mode 100644
index 0bb0e3fabe..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/board.svg
+++ /dev/null
@@ -1,16 +0,0 @@
-<svg width='100%' height='100%' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'>
- <path
- d='M12.8 2H3.2C2.53726 2 2 2.55964 2 3.25V5.75C2 6.44036 2.53726 7 3.2 7H12.8C13.4627 7 14 6.44036 14 5.75V3.25C14 2.55964 13.4627 2 12.8 2Z'
- stroke='currentColor'
- stroke-linecap='round'
- stroke-linejoin='round'
- />
- <path
- d='M12.8 9H3.2C2.53726 9 2 9.55964 2 10.25V12.75C2 13.4404 2.53726 14 3.2 14H12.8C13.4627 14 14 13.4404 14 12.75V10.25C14 9.55964 13.4627 9 12.8 9Z'
- stroke='currentColor'
- stroke-linecap='round'
- stroke-linejoin='round'
- />
- <circle cx='4.5' cy='4.5' r='0.5' fill='currentColor' />
- <circle cx='4.5' cy='11.5' r='0.5' fill='currentColor' />
-</svg>
\ No newline at end of file
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/bold.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/bold.svg
deleted file mode 100644
index 878b6329b3..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/bold.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M9 8C9.66667 8 11 8.4 11 10C11 11.6 9.66667 12 9 12H6V8M9 8H6M9 8C9.5 8 10.5171 6.97616 10.5 6C10.4806 4.8956 9.5 4 8.5 4H6V8" stroke="#333333" stroke-width="1.5"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/close.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/close.svg
deleted file mode 100644
index b519b419c0..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/close.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
-<rect x="15.7124" y="7.22656" width="1.5" height="12" rx="0.75" transform="rotate(45 15.7124 7.22656)" fill="#333333"/>
-<rect x="16.7729" y="15.7109" width="1.5" height="12" rx="0.75" transform="rotate(135 16.7729 15.7109)" fill="#333333"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/copy.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/copy.svg
deleted file mode 100644
index e21e6cb082..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/copy.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M11.9743 6.33203H7.35889C6.79245 6.33203 6.33325 6.79123 6.33325 7.35767V11.9731C6.33325 12.5395 6.79245 12.9987 7.35889 12.9987H11.9743C12.5407 12.9987 12.9999 12.5395 12.9999 11.9731V7.35767C12.9999 6.79123 12.5407 6.33203 11.9743 6.33203Z" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
-<path d="M4.53846 9.66667H4.02564C3.75362 9.66667 3.49275 9.55861 3.3004 9.36626C3.10806 9.17392 3 8.91304 3 8.64103V4.02564C3 3.75362 3.10806 3.49275 3.3004 3.3004C3.49275 3.10806 3.75362 3 4.02564 3H8.64103C8.91304 3 9.17392 3.10806 9.36626 3.3004C9.55861 3.49275 9.66667 3.75362 9.66667 4.02564V4.53846" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/dark-logo.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/dark-logo.svg
deleted file mode 100644
index 80d8c4132e..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/dark-logo.svg
+++ /dev/null
@@ -1,73 +0,0 @@
-<svg width='103' height='24' viewBox='0 0 103 24' fill='none' xmlns='http://www.w3.org/2000/svg'>
- <g clip-path='url(#clip0_175_6957)'>
- <path
- d='M34.7324 7.84144H36.892V8.63601C37.4179 8.08166 38.4132 7.63818 39.5212 7.63818C41.8498 7.63818 43.3709 9.4121 43.3709 11.8882C43.3709 14.4197 41.6057 16.3969 38.8827 16.3969C38.1315 16.3969 37.3991 16.2675 36.9108 15.9904V19.9078H34.7512V7.84144H34.7324ZM36.9108 10.5393V13.9208C37.493 14.2904 37.9812 14.4012 38.6949 14.4012C40.1972 14.4012 41.0611 13.3295 41.0611 11.9436C41.0611 10.6132 40.2723 9.65231 38.8451 9.65231C38.1127 9.63384 37.4366 9.96644 36.9108 10.5393Z'
- fill='white'
- />
- <path
- d='M29.3802 7.6748C26.6572 7.6748 24.892 9.6335 24.892 12.1835C24.892 14.6596 26.3943 16.4335 28.7417 16.4335C29.8309 16.4335 30.8262 15.99 31.3708 15.4357V16.2302H33.5305V9.22698C31.9154 8.02589 30.1314 7.6748 29.3802 7.6748ZM31.3521 13.5324C30.8262 14.1052 30.1502 14.4378 29.4178 14.4378C27.9906 14.4378 27.2018 13.477 27.2018 12.1465C27.2018 10.7607 28.0657 9.67046 29.568 9.67046C30.2816 9.67046 30.7699 9.78133 31.3521 10.1509V13.5324Z'
- fill='white'
- />
- <path
- d='M44.291 7.84144H46.4506V8.63601C46.9765 8.08166 47.9718 7.63818 49.0797 7.63818C51.4084 7.63818 52.9295 9.4121 52.9295 11.8882C52.9295 14.4197 51.1642 16.3969 48.4412 16.3969C47.6901 16.3969 46.9577 16.2675 46.4694 15.9904V19.9078H44.3098V7.84144H44.291ZM46.4694 10.5393V13.9208C47.0516 14.2904 47.5398 14.4012 48.2535 14.4012C49.7558 14.4012 50.6196 13.3295 50.6196 11.9436C50.6196 10.6132 49.8309 9.65231 48.4037 9.65231C47.6713 9.63384 46.9952 9.96644 46.4694 10.5393Z'
- fill='white'
- />
- <path
- d='M59.2019 5.43925C58.8826 5.21751 58.3756 4.99577 57.8685 4.99577C56.892 4.99577 56.3849 5.49469 56.3849 6.64034V7.82295H57.9061V9.83708H56.3849V16.1751H54.2065V6.49251C54.2065 4.18273 55.3333 3.00012 57.23 3.00012C58.0939 3.00012 58.8826 3.20338 59.446 3.55447H61.3615V13.0153C61.3615 13.9577 61.6056 14.3643 62.0939 14.3643C62.4507 14.3643 62.7324 14.2164 62.9953 14.0316L63.446 15.6577C62.9577 16.0458 62.2253 16.3599 61.2112 16.3599C59.9155 16.3599 59.2019 15.5838 59.2019 13.8838V5.43925Z'
- fill='white'
- />
- <path
- d='M68.0846 7.63818C70.9015 7.63818 72.7043 9.50449 72.7043 12.0175C72.7043 14.5121 70.9015 16.3969 68.0846 16.3969C65.2677 16.3969 63.4648 14.5306 63.4648 12.0175C63.4648 9.50449 65.2864 7.63818 68.0846 7.63818ZM68.0846 14.4012C69.4179 14.4012 70.3944 13.4588 70.3944 12.0175C70.3944 10.6132 69.3991 9.65231 68.0846 9.65231C66.8076 9.65231 65.7935 10.5762 65.7935 12.0175C65.7935 13.4034 66.77 14.4012 68.0846 14.4012Z'
- fill='white'
- />
- <path
- d='M83.4274 16.2308H81.4931L79.6903 11.5928C79.5588 11.2786 79.5025 10.9275 79.4086 10.6134C79.3335 10.983 79.2396 11.2971 79.1081 11.6297L77.3053 16.2308H75.4649L72.7043 7.84167H75.0142L76.3663 12.3873C76.4978 12.7938 76.5353 13.108 76.6105 13.496C76.7043 13.1449 76.7607 12.8493 76.9297 12.3873L78.5072 7.84167H80.4227L82.0565 12.3688C82.1879 12.7384 82.2818 13.1265 82.3757 13.5145C82.4508 13.1265 82.5447 12.7199 82.6386 12.3134L83.8781 7.84167H86.0565L83.4274 16.2308Z'
- fill='white'
- />
- <path
- d='M90.6573 16.1936C89.4178 19.187 88.6291 19.9077 87.3709 19.9077C86.6009 19.9077 86.0375 19.612 85.5493 19.2609L86.2441 17.6533C86.4695 17.7827 86.7887 17.949 87.1267 17.949C87.6713 17.949 88.0657 17.524 88.4225 16.6555L88.6103 16.212L84.6854 7.85986H87.2958L89.2676 12.424C89.4366 12.8305 89.5493 13.2186 89.6807 13.6251C89.7558 13.237 89.831 12.8305 89.9812 12.4055L91.5023 7.85986H93.9624L90.6573 16.1936Z'
- fill='white'
- />
- <path
- d='M19.0141 13.4033C18.5258 16.0088 16.385 18.2816 13.9249 19.5566C13.6244 19.7229 13.2676 19.8153 12.9296 19.8338H18.1502C18.6573 19.8338 19.0141 19.4642 19.0141 19.0022V13.4033Z'
- fill='#F7931E'
- />
- <path
- d='M8.57282 8.37731C8.49771 8.43274 8.42259 8.48817 8.34747 8.54361C7.07048 9.43057 3.20193 12.2762 2.3193 11.0382C1.45545 9.83709 2.37564 6.43709 4.5916 4.79252C4.62916 4.75557 4.6855 4.73709 4.72306 4.70013C7.14559 3.01861 8.94841 3.25883 9.83104 4.47839C10.6573 5.62404 9.73714 7.43491 8.57282 8.37731Z'
- fill='#8427E0'
- />
- <path
- d='M18.0376 11.0204C16.8357 11.852 14.9578 10.8911 14.0188 9.69C13.9812 9.63456 13.9437 9.59761 13.9061 9.54217C13.0047 8.28565 10.1127 4.47913 11.3521 3.62913C12.5916 2.76065 16.1784 3.70304 17.8122 5.99434C17.8498 6.04978 17.8873 6.08674 17.9249 6.14217C19.5024 8.45195 19.2582 10.1704 18.0376 11.0204Z'
- fill='#00B5FF'
- />
- <path
- d='M16.4226 18.5219C16.385 18.5589 16.3475 18.5773 16.2911 18.6143C13.8686 20.2958 12.0658 20.0556 11.1832 18.836C10.3569 17.6904 11.277 15.8795 12.4414 14.9371C12.5165 14.8817 12.5916 14.8263 12.6667 14.7708C13.9437 13.9023 17.8123 11.0382 18.6761 12.2763C19.5587 13.4773 18.6573 16.8773 16.4226 18.5219Z'
- fill='#FFBD00'
- />
- <path
- d='M9.66194 19.6861C8.4225 20.5545 4.85443 19.6121 3.22063 17.3208C3.18307 17.2839 3.14551 17.2285 3.12673 17.1915C1.53049 14.8817 1.7934 13.1448 3.01405 12.3132C4.21593 11.4817 6.09387 12.4426 7.03283 13.6437C7.07039 13.6991 7.10795 13.7361 7.14551 13.7915C8.02814 15.0295 10.9202 18.8361 9.66194 19.6861Z'
- fill='#E3006D'
- />
- <path
- d='M8.57283 8.37731C6.84513 9.13491 3.16438 10.6871 2.61978 9.43057C2.1503 8.37731 3.01415 6.23383 4.59161 4.79252C4.62917 4.75557 4.68551 4.73709 4.72307 4.70013C7.1456 3.01861 8.94842 3.25883 9.83105 4.47839C10.6573 5.62404 9.73715 7.43491 8.57283 8.37731Z'
- fill='#9327FF'
- />
- <path
- d='M18.0375 11.0196C16.8357 11.8511 14.9577 10.8902 14.0188 9.68912C13.2488 7.93368 11.7652 4.47825 13.0047 3.96086C14.1314 3.48042 16.4601 4.44129 17.9436 6.14129C19.5023 8.45107 19.2582 10.1696 18.0375 11.0196Z'
- fill='#00C8FF'
- />
- <path
- d='M16.4226 18.5218C16.385 18.5587 16.3475 18.5772 16.2911 18.6142C13.8686 20.2957 12.0658 20.0555 11.1832 18.8359C10.3569 17.6903 11.277 15.8794 12.4414 14.937C14.1691 14.1794 17.8498 12.6272 18.3944 13.8837C18.8827 14.937 18.0188 17.0805 16.4226 18.5218Z'
- fill='#F7CF46'
- />
- <path
- d='M8.04692 19.3535C6.92016 19.8339 4.59152 18.8915 3.12673 17.1915C1.53049 14.8817 1.7934 13.1448 3.01405 12.3132C4.21593 11.4817 6.09387 12.4426 7.03283 13.6437C7.80279 15.3806 9.28635 18.8361 8.04692 19.3535Z'
- fill='#FB006D'
- />
- </g>
- <defs>
- <clipPath id='clip0_175_6957'>
- <rect width='92' height='17' fill='white' transform='translate(2 3)' />
- </clipPath>
- </defs>
-</svg>
\ No newline at end of file
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/database/checkbox-check.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/database/checkbox-check.svg
deleted file mode 100644
index 15632e4ea6..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/database/checkbox-check.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
-<rect x="2" y="2" width="12" height="12" rx="4" fill="currentColor"/>
-<path d="M6 8L7.61538 9.5L10.5 6.5" stroke="white" stroke-linecap="round" stroke-linejoin="round"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/database/checkbox-uncheck.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/database/checkbox-uncheck.svg
deleted file mode 100644
index 6c487795c6..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/database/checkbox-uncheck.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
-<rect x="2.5" y="2.5" width="11" height="11" rx="3.5" stroke="#BDBDBD"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/database/field-type-attach.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/database/field-type-attach.svg
deleted file mode 100644
index f00f5c7aa2..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/database/field-type-attach.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M13 7.688L8.27223 12.1469C7.69304 12.6931 6.90749 13 6.0884 13C5.26931 13 4.48376 12.6931 3.90457 12.1469C3.32538 11.6006 3 10.8598 3 10.0873C3 9.31474 3.32538 8.57387 3.90457 8.02763L8.63234 3.56875C9.01847 3.20459 9.54216 3 10.0882 3C10.6343 3 11.158 3.20459 11.5441 3.56875C11.9302 3.93291 12.1472 4.42683 12.1472 4.94183C12.1472 5.45684 11.9302 5.95075 11.5441 6.31491L6.8112 10.7738C6.61814 10.9559 6.35629 11.0582 6.08326 11.0582C5.81022 11.0582 5.54838 10.9559 5.35531 10.7738C5.16225 10.5917 5.05379 10.3448 5.05379 10.0873C5.05379 9.82975 5.16225 9.58279 5.35531 9.40071L9.72297 5.28632" stroke="#333333" stroke-width="0.9989" stroke-linecap="round" stroke-linejoin="round"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/database/field-type-checkbox.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/database/field-type-checkbox.svg
deleted file mode 100644
index 37f52c47ed..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/database/field-type-checkbox.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M6.5 8L8.11538 9.5L13.5 4.5" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
-<path d="M13 8.5V11.8889C13 12.1836 12.8829 12.4662 12.6746 12.6746C12.4662 12.8829 12.1836 13 11.8889 13H4.11111C3.81643 13 3.53381 12.8829 3.32544 12.6746C3.11706 12.4662 3 12.1836 3 11.8889V4.11111C3 3.81643 3.11706 3.53381 3.32544 3.32544C3.53381 3.11706 3.81643 3 4.11111 3H10.2222" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/database/field-type-checklist.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/database/field-type-checklist.svg
deleted file mode 100644
index 3a88d236a1..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/database/field-type-checklist.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M6.5 8L8.11538 9.5L13.5 4.5" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
-<path d="M13.5 8C13.5 11.0376 11.0376 13.5 8 13.5C4.96243 13.5 2.5 11.0376 2.5 8C2.5 4.96243 4.96243 2.5 8 2.5C8.81896 2.5 9.59612 2.679 10.2945 3" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/database/field-type-date.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/database/field-type-date.svg
deleted file mode 100644
index 78243f1e75..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/database/field-type-date.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M11.8889 3.5H4.11111C3.49746 3.5 3 3.94772 3 4.5V11.5C3 12.0523 3.49746 12.5 4.11111 12.5H11.8889C12.5025 12.5 13 12.0523 13 11.5V4.5C13 3.94772 12.5025 3.5 11.8889 3.5Z" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
-<path d="M10 2.5V4.58181" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
-<path d="M6 2.5V4.58181" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
-<path d="M3 6.5H13" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/database/field-type-last-edited-time.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/database/field-type-last-edited-time.svg
deleted file mode 100644
index 634af3e361..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/database/field-type-last-edited-time.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M8 13C10.7614 13 13 10.7614 13 8C13 5.23858 10.7614 3 8 3C5.23858 3 3 5.23858 3 8C3 10.7614 5.23858 13 8 13Z" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
-<path d="M8 5V8L10 9" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/database/field-type-multi-select.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/database/field-type-multi-select.svg
deleted file mode 100644
index 97a2e9c434..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/database/field-type-multi-select.svg
+++ /dev/null
@@ -1,8 +0,0 @@
-<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M6.5 4L12.5 4" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
-<path d="M6.5 8H12.5" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
-<path d="M6.5 12H12.5" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
-<circle cx="4" cy="4" r="0.5" fill="#333333"/>
-<circle cx="4" cy="8" r="0.5" fill="#333333"/>
-<circle cx="4" cy="12" r="0.5" fill="#333333"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/database/field-type-number.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/database/field-type-number.svg
deleted file mode 100644
index 9d8b98d10d..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/database/field-type-number.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M2.201 6.4H3.001V12H2.081V7.384L0.953 7.704L0.729 6.92L2.201 6.4ZM3.91156 12V11.1L6.35156 8.61C6.9449 8.01667 7.24156 7.50333 7.24156 7.07C7.24156 6.73 7.13823 6.46667 6.93156 6.28C6.73156 6.08667 6.4749 5.99 6.16156 5.99C5.5749 5.99 5.14156 6.28 4.86156 6.86L3.89156 6.29C4.11156 5.82333 4.42156 5.47 4.82156 5.23C5.22156 4.99 5.6649 4.87 6.15156 4.87C6.7649 4.87 7.29156 5.06333 7.73156 5.45C8.17156 5.83667 8.39156 6.36333 8.39156 7.03C8.39156 7.74333 7.9949 8.50333 7.20156 9.31L5.62156 10.89H8.52156V12H3.91156ZM12.9025 7.032C13.5105 7.176 14.0025 7.46 14.3785 7.884C14.7625 8.3 14.9545 8.824 14.9545 9.456C14.9545 10.296 14.6705 10.956 14.1025 11.436C13.5345 11.916 12.8385 12.156 12.0145 12.156C11.3745 12.156 10.7985 12.008 10.2865 11.712C9.78253 11.416 9.41853 10.984 9.19453 10.416L10.3705 9.732C10.6185 10.452 11.1665 10.812 12.0145 10.812C12.4945 10.812 12.8745 10.692 13.1545 10.452C13.4345 10.204 13.5745 9.872 13.5745 9.456C13.5745 9.04 13.4345 8.712 13.1545 8.472C12.8745 8.232 12.4945 8.112 12.0145 8.112H11.7025L11.1505 7.284L12.9625 4.896H9.44653V3.6H14.6065V4.776L12.9025 7.032Z" fill="#333333"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/database/field-type-person.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/database/field-type-person.svg
deleted file mode 100644
index 2fc04be065..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/database/field-type-person.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
-<circle cx="8" cy="5" r="2.5" stroke="#333333"/>
-<path d="M3 13C3 10.2386 5.23858 8 8 8C10.7614 8 13 10.2386 13 13" stroke="#333333" stroke-linecap="round"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/database/field-type-relation.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/database/field-type-relation.svg
deleted file mode 100644
index f82a41d226..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/database/field-type-relation.svg
+++ /dev/null
@@ -1,8 +0,0 @@
-<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
-<circle cx="11.8274" cy="5.82739" r="1.5" stroke="#333333"/>
-<path d="M10.5008 5.38471L6.24097 4.78992" stroke="#333333"/>
-<path d="M4.86475 6.24121L6.02777 10.1009" stroke="#333333"/>
-<circle cx="7" cy="11" r="1.5" stroke="#333333"/>
-<circle cx="5" cy="5" r="1.5" stroke="#333333"/>
-<path d="M10.9011 7.14258L8.1484 10.0447" stroke="#333333"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/database/field-type-single-select.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/database/field-type-single-select.svg
deleted file mode 100644
index 8ccbc9a2e3..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/database/field-type-single-select.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M7.78787 8.78787L6.51213 7.51213C6.32314 7.32314 6.45699 7 6.72426 7H9.27574C9.54301 7 9.67686 7.32314 9.48787 7.51213L8.21213 8.78787C8.09497 8.90503 7.90503 8.90503 7.78787 8.78787Z" fill="#333333"/>
-<path d="M8 13C10.7614 13 13 10.7614 13 8C13 5.23858 10.7614 3 8 3C5.23858 3 3 5.23858 3 8C3 10.7614 5.23858 13 8 13Z" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/database/field-type-text.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/database/field-type-text.svg
deleted file mode 100644
index 7befa5080f..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/database/field-type-text.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M7.15625 11.8359L6.43768 9.85414H2.46662L1.74805 11.8359H0.5L3.7903 3H5.11399L8.4043 11.8359H7.15625ZM2.87003 8.75596H6.03427L4.44584 4.40112L2.87003 8.75596Z" fill="#333333"/>
-<path d="M14.4032 5.52454H15.5V11.8359H14.4032V10.7504C13.8569 11.5835 13.0627 12 12.0206 12C11.1381 12 10.386 11.6802 9.76403 11.0407C9.14211 10.3927 8.83114 9.60589 8.83114 8.68022C8.83114 7.75456 9.14211 6.97195 9.76403 6.3324C10.386 5.68443 11.1381 5.36045 12.0206 5.36045C13.0627 5.36045 13.8569 5.777 14.4032 6.6101V5.52454ZM12.1593 10.9397C12.798 10.9397 13.3317 10.7251 13.7603 10.2959C14.1889 9.85835 14.4032 9.31978 14.4032 8.68022C14.4032 8.04067 14.1889 7.50631 13.7603 7.07714C13.3317 6.63955 12.798 6.42076 12.1593 6.42076C11.5289 6.42076 10.9995 6.63955 10.5708 7.07714C10.1422 7.50631 9.92791 8.04067 9.92791 8.68022C9.92791 9.31978 10.1422 9.85835 10.5708 10.2959C10.9995 10.7251 11.5289 10.9397 12.1593 10.9397Z" fill="#333333"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/database/field-type-url.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/database/field-type-url.svg
deleted file mode 100644
index f00f5c7aa2..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/database/field-type-url.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M13 7.688L8.27223 12.1469C7.69304 12.6931 6.90749 13 6.0884 13C5.26931 13 4.48376 12.6931 3.90457 12.1469C3.32538 11.6006 3 10.8598 3 10.0873C3 9.31474 3.32538 8.57387 3.90457 8.02763L8.63234 3.56875C9.01847 3.20459 9.54216 3 10.0882 3C10.6343 3 11.158 3.20459 11.5441 3.56875C11.9302 3.93291 12.1472 4.42683 12.1472 4.94183C12.1472 5.45684 11.9302 5.95075 11.5441 6.31491L6.8112 10.7738C6.61814 10.9559 6.35629 11.0582 6.08326 11.0582C5.81022 11.0582 5.54838 10.9559 5.35531 10.7738C5.16225 10.5917 5.05379 10.3448 5.05379 10.0873C5.05379 9.82975 5.16225 9.58279 5.35531 9.40071L9.72297 5.28632" stroke="#333333" stroke-width="0.9989" stroke-linecap="round" stroke-linejoin="round"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/date.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/date.svg
deleted file mode 100644
index 78243f1e75..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/date.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M11.8889 3.5H4.11111C3.49746 3.5 3 3.94772 3 4.5V11.5C3 12.0523 3.49746 12.5 4.11111 12.5H11.8889C12.5025 12.5 13 12.0523 13 11.5V4.5C13 3.94772 12.5025 3.5 11.8889 3.5Z" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
-<path d="M10 2.5V4.58181" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
-<path d="M6 2.5V4.58181" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
-<path d="M3 6.5H13" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/delete.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/delete.svg
deleted file mode 100644
index 9e51636798..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/delete.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M3 4.40039H4.11111H13" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
-<path d="M5.77775 4.4V3.2C5.77775 2.88174 5.89481 2.57652 6.10319 2.35147C6.31156 2.12643 6.59418 2 6.88886 2H9.11108C9.40577 2 9.68838 2.12643 9.89676 2.35147C10.1051 2.57652 10.2222 2.88174 10.2222 3.2V4.4M11.8889 4.4V12.8C11.8889 13.1183 11.7718 13.4235 11.5634 13.6485C11.3551 13.8736 11.0724 14 10.7778 14H5.2222C4.92751 14 4.64489 13.8736 4.43652 13.6485C4.22815 13.4235 4.11108 13.1183 4.11108 12.8V4.4H11.8889Z" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
-<path d="M6.88892 7.40039V11.0004" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
-<path d="M9.11108 7.40039V11.0004" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/details.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/details.svg
deleted file mode 100644
index 22c6830916..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/details.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M5 8C5 8.55228 4.55228 9 4 9C3.44772 9 3 8.55228 3 8C3 7.44772 3.44772 7 4 7C4.55228 7 5 7.44772 5 8Z" fill="currentColor"/>
-<path d="M9 8C9 8.55228 8.55229 9 8 9C7.44772 9 7 8.55228 7 8C7 7.44772 7.44772 7 8 7C8.55229 7 9 7.44772 9 8Z" fill="currentColor"/>
-<path d="M12 9C12.5523 9 13 8.55228 13 8C13 7.44772 12.5523 7 12 7C11.4477 7 11 7.44772 11 8C11 8.55228 11.4477 9 12 9Z" fill="currentColor"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/document.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/document.svg
deleted file mode 100644
index b00e1cfb38..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/document.svg
+++ /dev/null
@@ -1,14 +0,0 @@
-<svg width='100%' height='100%' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'>
- <path
- d='M10.5 3H11.5C11.8315 3 12.1495 3.12877 12.3839 3.35798C12.6183 3.58719 12.75 3.89807 12.75 4.22222V12.7778C12.75 13.1019 12.6183 13.4128 12.3839 13.642C12.1495 13.8712 11.8315 14 11.5 14H4.5C4.16848 14 3.85054 13.8712 3.61612 13.642C3.3817 13.4128 3.25 13.1019 3.25 12.7778V4.22222C3.25 3.89807 3.3817 3.58719 3.61612 3.35798C3.85054 3.12877 4.16848 3 4.5 3H5.5'
- stroke='currentColor'
- stroke-linecap='round'
- stroke-linejoin='round'
- />
- <path
- d='M9.5 2H6.5C6.22386 2 6 2.22386 6 2.5V3.5C6 3.77614 6.22386 4 6.5 4H9.5C9.77614 4 10 3.77614 10 3.5V2.5C10 2.22386 9.77614 2 9.5 2Z'
- stroke='currentColor'
- stroke-linecap='round'
- stroke-linejoin='round'
- />
-</svg>
\ No newline at end of file
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/drag.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/drag.svg
deleted file mode 100644
index 627c959f9f..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/drag.svg
+++ /dev/null
@@ -1,8 +0,0 @@
-<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
-<rect x="9" y="3" width="2" height="2" rx="0.5" fill="#333333"/>
-<rect x="5" y="3" width="2" height="2" rx="0.5" fill="#333333"/>
-<rect x="9" y="7" width="2" height="2" rx="0.5" fill="#333333"/>
-<rect x="5" y="7" width="2" height="2" rx="0.5" fill="#333333"/>
-<rect x="9" y="11" width="2" height="2" rx="0.5" fill="#333333"/>
-<rect x="5" y="11" width="2" height="2" rx="0.5" fill="#333333"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/dropdown.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/dropdown.svg
deleted file mode 100644
index 95e4964b53..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/dropdown.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-<svg width='100%' height='100%' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'>
- <path
- d='M11.5757 14.5757L8.52426 11.5243C8.14629 11.1463 8.41399 10.5 8.94853 10.5H15.0515C15.586 10.5 15.8537 11.1463 15.4757 11.5243L12.4243 14.5757C12.1899 14.8101 11.8101 14.8101 11.5757 14.5757Z'
- fill='currentColor'
- />
-</svg>
\ No newline at end of file
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/edit.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/edit.svg
deleted file mode 100644
index ae93287114..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/edit.svg
+++ /dev/null
@@ -1,9 +0,0 @@
-<svg width='100%' height='100%' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'>
- <path d='M8 13H14' stroke='currentColor' strokeLinecap='round' stroke-linejoin='round' />
- <path
- d='M10.8849 3.36289C11.1173 3.13054 11.4324 3 11.761 3C11.9237 3 12.0848 3.03205 12.2351 3.09431C12.3855 3.15658 12.5221 3.24784 12.6371 3.36289C12.7522 3.47794 12.8434 3.61453 12.9057 3.76485C12.968 3.91517 13 4.07629 13 4.23899C13 4.4017 12.968 4.56281 12.9057 4.71314C12.8434 4.86346 12.7522 5.00004 12.6371 5.11509L5.33627 12.4159L3 13L3.58407 10.6637L10.8849 3.36289Z'
- stroke='currentColor'
- stroke-linecap='round'
- stroke-linejoin='round'
- />
-</svg>
\ No newline at end of file
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/eye_close.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/eye_close.svg
deleted file mode 100644
index 116c715ca8..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/eye_close.svg
+++ /dev/null
@@ -1,9 +0,0 @@
-<svg width='100%' height='100%' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'>
- <path
- fill-rule='evenodd'
- clip-rule='evenodd'
- d='M7.68372 17.3771C8.88359 18.1747 10.3278 18.75 12.0001 18.75C15.7261 18.75 18.32 15.8941 19.6011 14.0863C20.4933 12.8272 20.4933 11.1728 19.6011 9.91375C19.1009 9.208 18.4007 8.34252 17.5112 7.54957L16.4489 8.61191C17.236 9.30133 17.8836 10.0844 18.3772 10.781C18.9013 11.5205 18.9013 12.4795 18.3772 13.219C17.1411 14.9633 14.9396 17.25 12.0001 17.25C10.794 17.25 9.71218 16.865 8.77028 16.2905L7.68372 17.3771ZM7.55137 15.3881L6.48903 16.4504C5.5995 15.6575 4.8993 14.792 4.39916 14.0863C3.50692 12.8272 3.50692 11.1728 4.39916 9.91375C5.68028 8.10595 8.27417 5.25 12.0001 5.25C13.6724 5.25 15.1167 5.82531 16.3165 6.62294L15.23 7.7095C14.2881 7.13497 13.2062 6.75 12.0001 6.75C9.06064 6.75 6.85914 9.03672 5.62301 10.781C5.09897 11.5205 5.09897 12.4795 5.62301 13.219C6.11667 13.9156 6.76428 14.6987 7.55137 15.3881ZM10.4887 14.572C10.9279 14.8431 11.4439 15 12.0002 15C13.641 15 14.932 13.6349 14.932 12C14.932 11.4625 14.7925 10.9542 14.5468 10.5139L13.3964 11.6644C13.4197 11.7717 13.432 11.884 13.432 12C13.432 12.8503 12.7694 13.5 12.0002 13.5C11.868 13.5 11.739 13.4808 11.616 13.4448L10.4887 14.572ZM10.6039 12.3355L9.45347 13.486C9.20788 13.0458 9.06836 12.5375 9.06836 12C9.06836 10.3651 10.3594 9 12.0002 9C12.5564 9 13.0724 9.15686 13.5115 9.42792L12.3842 10.5552C12.2612 10.5192 12.1323 10.5 12.0002 10.5C11.231 10.5 10.5684 11.1497 10.5684 12C10.5684 12.116 10.5807 12.2282 10.6039 12.3355Z'
- fill='currentColor'
- />
- <path d='M17.5 5L5 17.5' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' />
-</svg>
\ No newline at end of file
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/eye_open.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/eye_open.svg
deleted file mode 100644
index fa3017c04d..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/eye_open.svg
+++ /dev/null
@@ -1,16 +0,0 @@
-<svg width='100%' height='100%' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'>
- <path
- d='M5.01097 13.6526C4.30282 12.6533 4.30282 11.3467 5.01097 10.3474C6.26959 8.57133 8.66728 6 12 6C15.3327 6 17.7304 8.57133 18.989 10.3474C19.6972 11.3467 19.6972 12.6533 18.989 13.6526C17.7304 15.4287 15.3327 18 12 18C8.66728 18 6.26959 15.4287 5.01097 13.6526Z'
- stroke='currentColor'
- stroke-width='1.5'
- stroke-linecap='round'
- stroke-linejoin='round'
- />
- <path
- d='M11.9999 14.25C13.2049 14.25 14.1818 13.2426 14.1818 12C14.1818 10.7574 13.2049 9.75 11.9999 9.75C10.7949 9.75 9.81812 10.7574 9.81812 12C9.81812 13.2426 10.7949 14.25 11.9999 14.25Z'
- stroke='currentColor'
- stroke-width='1.5'
- stroke-linecap='round'
- stroke-linejoin='round'
- />
-</svg>
\ No newline at end of file
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/grid.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/grid.svg
deleted file mode 100644
index c397af8130..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/grid.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M5.25 1.75H2.625C2.14175 1.75 1.75 2.14175 1.75 2.625V5.25C1.75 5.73325 2.14175 6.125 2.625 6.125H5.25C5.73325 6.125 6.125 5.73325 6.125 5.25V2.625C6.125 2.14175 5.73325 1.75 5.25 1.75Z" stroke="#333333" stroke-width="0.875" stroke-linecap="round" stroke-linejoin="round"/>
-<path d="M11.375 1.75H8.75C8.26675 1.75 7.875 2.14175 7.875 2.625V5.25C7.875 5.73325 8.26675 6.125 8.75 6.125H11.375C11.8582 6.125 12.25 5.73325 12.25 5.25V2.625C12.25 2.14175 11.8582 1.75 11.375 1.75Z" stroke="#333333" stroke-width="0.875" stroke-linecap="round" stroke-linejoin="round"/>
-<path d="M11.375 7.875H8.75C8.26675 7.875 7.875 8.26675 7.875 8.75V11.375C7.875 11.8582 8.26675 12.25 8.75 12.25H11.375C11.8582 12.25 12.25 11.8582 12.25 11.375V8.75C12.25 8.26675 11.8582 7.875 11.375 7.875Z" stroke="#333333" stroke-width="0.875" stroke-linecap="round" stroke-linejoin="round"/>
-<path d="M5.25 7.875H2.625C2.14175 7.875 1.75 8.26675 1.75 8.75V11.375C1.75 11.8582 2.14175 12.25 2.625 12.25H5.25C5.73325 12.25 6.125 11.8582 6.125 11.375V8.75C6.125 8.26675 5.73325 7.875 5.25 7.875Z" stroke="#333333" stroke-width="0.875" stroke-linecap="round" stroke-linejoin="round"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/h1.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/h1.svg
deleted file mode 100644
index b33bd52135..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/h1.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M8.25368 3.6001H9.63368V12.0001H8.25368V8.3641H4.65368V12.0001H3.27368V3.6001H4.65368V7.0441H8.25368V3.6001Z" fill="#333333"/>
-<path d="M12.0327 6.4001H12.9927V12.0001H11.8887V7.5681L10.8327 7.8641L10.5607 6.9201L12.0327 6.4001Z" fill="#333333"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/h2.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/h2.svg
deleted file mode 100644
index 7449c57391..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/h2.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M7.67531 3.6001H9.05531V12.0001H7.67531V8.3641H4.07531V12.0001H2.69531V3.6001H4.07531V7.0441H7.67531V3.6001Z" fill="#333333"/>
-<path d="M10.1104 12.0001V11.1761L12.0224 9.2081C12.449 8.7601 12.6624 8.38676 12.6624 8.0881C12.6624 7.86943 12.593 7.69343 12.4544 7.5601C12.321 7.42676 12.1477 7.3601 11.9344 7.3601C11.513 7.3601 11.201 7.57876 10.9984 8.0161L10.0704 7.4721C10.2464 7.0881 10.4997 6.79476 10.8304 6.5921C11.161 6.38943 11.5237 6.2881 11.9184 6.2881C12.425 6.2881 12.8597 6.4481 13.2224 6.7681C13.585 7.08276 13.7664 7.50943 13.7664 8.0481C13.7664 8.62943 13.4597 9.22677 12.8464 9.8401L11.7504 10.9361H13.8544V12.0001H10.1104Z" fill="#333333"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/h3.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/h3.svg
deleted file mode 100644
index 0976945974..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/h3.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M7.62063 3.6001H9.00063V12.0001H7.62063V8.3641H4.02062V12.0001H2.64062V3.6001H4.02062V7.0441H7.62063V3.6001Z" fill="#333333"/>
-<path d="M12.6637 8.6721C13.0424 8.7841 13.349 8.98143 13.5837 9.2641C13.8237 9.54143 13.9437 9.87743 13.9437 10.2721C13.9437 10.8481 13.749 11.2988 13.3597 11.6241C12.9757 11.9494 12.5037 12.1121 11.9437 12.1121C11.5064 12.1121 11.1144 12.0134 10.7677 11.8161C10.4264 11.6134 10.1784 11.3174 10.0237 10.9281L10.9677 10.3841C11.1064 10.8161 11.4317 11.0321 11.9437 11.0321C12.2264 11.0321 12.445 10.9654 12.5997 10.8321C12.7597 10.6934 12.8397 10.5068 12.8397 10.2721C12.8397 10.0428 12.7597 9.85876 12.5997 9.7201C12.445 9.58143 12.2264 9.5121 11.9437 9.5121H11.7037L11.2797 8.8721L12.3837 7.4321H10.1917V6.4001H13.7117V7.3121L12.6637 8.6721Z" fill="#333333"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/hide-menu.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/hide-menu.svg
deleted file mode 100644
index ce88af8ea7..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/hide-menu.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M6 5L3 8L6 11" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
-<rect width="4" height="1" rx="0.5" transform="matrix(-1 0 0 1 13 5)" fill="#333333"/>
-<rect width="6" height="1" rx="0.5" transform="matrix(-1 0 0 1 13 7.5)" fill="#333333"/>
-<rect width="4" height="1" rx="0.5" transform="matrix(-1 0 0 1 13 10)" fill="#333333"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/hide.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/hide.svg
deleted file mode 100644
index 22001ef65d..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/hide.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path fill-rule="evenodd" clip-rule="evenodd" d="M5.1224 11.5847C5.92231 12.1165 6.88514 12.5 8 12.5C10.484 12.5 12.2132 10.596 13.0673 9.39083C13.6621 8.55146 13.6621 7.44854 13.0673 6.60917C12.7339 6.13867 12.2671 5.56168 11.6741 5.03305L10.9658 5.74127C11.4906 6.20089 11.9223 6.72296 12.2514 7.18736C12.6008 7.68035 12.6008 8.31965 12.2514 8.81264C11.4273 9.97552 9.95966 11.5 8 11.5C7.19594 11.5 6.47471 11.2434 5.84677 10.8603L5.1224 11.5847ZM5.03417 10.2587L4.32594 10.967C3.73292 10.4383 3.26612 9.86133 2.93269 9.39083C2.33787 8.55146 2.33787 7.44854 2.93269 6.60917C3.78677 5.40397 5.51603 3.5 8 3.5C9.11486 3.5 10.0777 3.88354 10.8776 4.4153L10.1532 5.13966C9.52529 4.75665 8.80406 4.5 8 4.5C6.04034 4.5 4.57268 6.02448 3.74859 7.18736C3.39923 7.68035 3.39923 8.31965 3.74859 8.81264C4.0777 9.27704 4.50944 9.79911 5.03417 10.2587ZM6.99245 9.71466C7.28524 9.8954 7.62928 10 8.00012 10C9.09398 10 9.95466 9.08996 9.95466 8C9.95466 7.64165 9.86163 7.30275 9.69786 7.00924L8.93093 7.77618C8.94644 7.84779 8.95466 7.92265 8.95466 8C8.95466 8.5669 8.51291 9 8.00012 9C7.912 9 7.82599 8.98721 7.74395 8.96316L6.99245 9.71466ZM7.06926 8.22363L6.30229 8.99061C6.13857 8.69713 6.04557 8.35829 6.04557 8C6.04557 6.91005 6.90626 6 8.00012 6C8.3709 6 8.71489 6.10456 9.00764 6.28525L8.2561 7.03679C8.17412 7.01277 8.08817 7 8.00012 7C7.48733 7 7.04557 7.4331 7.04557 8C7.04557 8.07728 7.05378 8.15208 7.06926 8.22363Z" fill="#333333"/>
-<path d="M11.6667 3.33398L3.33341 11.6673" stroke="#333333" stroke-linecap="round"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/image.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/image.svg
deleted file mode 100644
index 0739605066..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/image.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
- <rect x="1.5" y="3" width="13" height="10" rx="1.5" stroke="#333333"/>
- <circle cx="5.5" cy="6.5" r="1" stroke="#333333"/>
- <path d="M5 13L10.112 8.45603C10.4211 8.18126 10.8674 8.12513 11.235 8.31482L14.5 10" stroke="#333333"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/images/default_cover.jpg b/frontend/appflowy_tauri/src/appflowy_app/assets/images/default_cover.jpg
deleted file mode 100644
index aeaa6a0f29..0000000000
Binary files a/frontend/appflowy_tauri/src/appflowy_app/assets/images/default_cover.jpg and /dev/null differ
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/information.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/information.svg
deleted file mode 100644
index 37ca4d5837..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/information.svg
+++ /dev/null
@@ -1,10 +0,0 @@
-<svg width='100%' height='100%' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'>
- <path
- d='M8 14.0039C11.3137 14.0039 14 11.3176 14 8.00391C14 4.6902 11.3137 2.00391 8 2.00391C4.68629 2.00391 2 4.6902 2 8.00391C2 11.3176 4.68629 14.0039 8 14.0039Z'
- stroke='currentColor'
- stroke-linecap="round"
- stroke-linejoin="round"
- />
- <rect x='7.5' y='7.00391' width='1' height='4' rx='0.5' fill='currentColor' />
- <rect x='7.5' y='5.00391' width='1' height='1' rx='0.5' fill='currentColor' />
-</svg>
\ No newline at end of file
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/inline-code.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/inline-code.svg
deleted file mode 100644
index 3585603096..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/inline-code.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M10 4L14 8L10 12" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
-<path d="M6 4L2 8L6 12" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/italic.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/italic.svg
deleted file mode 100644
index b295c230f0..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/italic.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M8.7 4L7.3 12M8.7 4H11.5M8.7 4H5.9M7.3 12H10.1M7.3 12H4.5" stroke="#333333" stroke-width="1.2"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/left.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/left.svg
deleted file mode 100644
index 0f771a3858..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/left.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M3 11.7778L3 4" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
-<path d="M9.5 4.5L6 8L9.5 11.5" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
-<path d="M6 8L13 8" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/light-logo.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/light-logo.svg
deleted file mode 100644
index f5cd761ba7..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/light-logo.svg
+++ /dev/null
@@ -1,51 +0,0 @@
-<svg width='103' height='24' viewBox='0 0 103 24' fill='none' xmlns='http://www.w3.org/2000/svg'>
- <g clip-path='url(#clip0_159_6088)'>
- <path
- fill-rule='evenodd'
- clip-rule='evenodd'
- d='M59.2019 5.43913C58.8826 5.21739 58.3756 4.99565 57.8685 4.99565C56.892 4.99565 56.3849 5.49457 56.3849 6.64022V7.82283H57.9061V9.83696H56.3849V16.175H54.2065V6.49239C54.2065 4.18261 55.3333 3 57.23 3C58.0939 3 58.8826 3.20326 59.446 3.55435H61.3615V13.0152C61.3615 13.9576 61.6056 14.3641 62.0939 14.3641C62.4507 14.3641 62.7324 14.2163 62.9953 14.0315L63.446 15.6576C62.9577 16.0457 62.2253 16.3598 61.2112 16.3598C59.9155 16.3598 59.2019 15.5837 59.2019 13.8837V5.43913ZM34.7512 7.84144H36.892V8.63601C37.4179 8.08166 38.4132 7.63818 39.5212 7.63818C41.8498 7.63818 43.3709 9.4121 43.3709 11.8882C43.3709 14.4197 41.6057 16.3969 38.8827 16.3969C38.1315 16.3969 37.3991 16.2675 36.9108 15.9904V19.9077H34.7512V7.84144ZM36.9108 10.5393V13.9208C37.493 14.2904 37.9812 14.4012 38.6949 14.4012C40.1972 14.4012 41.0611 13.3295 41.0611 11.9436C41.0611 10.6132 40.2723 9.65231 38.8451 9.65231C38.1127 9.63384 37.4366 9.96644 36.9108 10.5393ZM29.3804 7.6748C26.6573 7.6748 24.8921 9.6335 24.8921 12.1835C24.8921 14.6596 26.3944 16.4335 28.7419 16.4335C29.8311 16.4335 30.8264 15.99 31.371 15.4357V16.2302H33.5306V9.22698C31.9156 8.02589 30.1315 7.6748 29.3804 7.6748ZM31.3522 13.5324C30.8264 14.1052 30.1503 14.4378 29.4179 14.4378C27.9907 14.4378 27.2019 13.477 27.2019 12.1465C27.2019 10.7607 28.0658 9.67046 29.5681 9.67046C30.2818 9.67046 30.77 9.78133 31.3522 10.1509V13.5324ZM46.4506 7.84144H44.3098V19.9077H46.4694V15.9904C46.9577 16.2675 47.6901 16.3969 48.4412 16.3969C51.1642 16.3969 52.9295 14.4197 52.9295 11.8882C52.9295 9.4121 51.4084 7.63818 49.0797 7.63818C47.9718 7.63818 46.9765 8.08166 46.4506 8.63601V7.84144ZM46.4694 13.9208V10.5393C46.9952 9.96644 47.6713 9.63384 48.4037 9.65231C49.8309 9.65231 50.6196 10.6132 50.6196 11.9436C50.6196 13.3295 49.7558 14.4012 48.2535 14.4012C47.5398 14.4012 47.0516 14.2904 46.4694 13.9208ZM72.7043 12.0175C72.7043 9.50449 70.9015 7.63818 68.0846 7.63818C65.2864 7.63818 63.4648 9.50449 63.4648 12.0175C63.4648 14.5306 65.2677 16.3969 68.0846 16.3969C70.9015 16.3969 72.7043 14.5121 72.7043 12.0175ZM70.3944 12.0175C70.3944 13.4588 69.4179 14.4012 68.0846 14.4012C66.77 14.4012 65.7935 13.4034 65.7935 12.0175C65.7935 10.5762 66.8076 9.65231 68.0846 9.65231C69.3991 9.65231 70.3944 10.6132 70.3944 12.0175ZM83.4274 16.2307H81.4931L79.6903 11.5926C79.6057 11.3905 79.5522 11.173 79.4998 10.96C79.4708 10.842 79.4421 10.7253 79.4086 10.6133C79.3335 10.9829 79.2396 11.297 79.1081 11.6296L77.3053 16.2307H75.4649L72.7043 7.84155H75.0142L76.3663 12.3872C76.4663 12.6964 76.512 12.9521 76.5611 13.2276L76.5612 13.228C76.5767 13.3146 76.5925 13.4031 76.6105 13.4959C76.6339 13.4081 76.655 13.3239 76.6762 13.2396C76.7396 12.9866 76.8029 12.7337 76.9297 12.3872L78.5072 7.84155H80.4227L82.0565 12.3687C82.1879 12.7383 82.2818 13.1263 82.3757 13.5144C82.4508 13.1263 82.5447 12.7198 82.6386 12.3133L83.8781 7.84155H86.0565L86.0507 7.85986H87.2959L89.2677 12.424C89.4023 12.7476 89.5011 13.0596 89.6021 13.3784C89.628 13.4601 89.654 13.5422 89.6808 13.6251L89.6916 13.5696C89.7633 13.1984 89.8382 12.8103 89.9813 12.4055L91.5024 7.85986H93.9625L90.6574 16.1936C89.4179 19.187 88.6292 19.9077 87.371 19.9077C86.601 19.9077 86.0377 19.612 85.5494 19.2609L86.2442 17.6533C86.4696 17.7827 86.7888 17.949 87.1269 17.949C87.6715 17.949 88.0658 17.524 88.4226 16.6555L88.6104 16.212L85.5045 9.60269L83.4274 16.2307Z'
- fill='black'
- />
- <path
- d='M19.0142 13.4033C18.5259 16.0088 16.3851 18.2816 13.925 19.5566C13.6245 19.7229 13.2677 19.8153 12.9297 19.8338H18.1503C18.6574 19.8338 19.0142 19.4642 19.0142 19.0022V13.4033Z'
- fill='#F7931E'
- />
- <path
- d='M8.57282 8.3773C8.49771 8.43274 8.42259 8.48817 8.34747 8.54361C7.07048 9.43057 3.20193 12.2762 2.3193 11.0382C1.45545 9.83709 2.37564 6.43709 4.5916 4.79252C4.62916 4.75557 4.6855 4.73709 4.72306 4.70013C7.14559 3.01861 8.94841 3.25883 9.83104 4.47839C10.6573 5.62404 9.73714 7.43491 8.57282 8.3773Z'
- fill='#8427E0'
- />
- <path
- d='M18.0376 11.0204C16.8357 11.852 14.9578 10.8911 14.0188 9.69C13.9812 9.63456 13.9437 9.59761 13.9061 9.54217C13.0047 8.28565 10.1127 4.47913 11.3521 3.62913C12.5916 2.76065 16.1784 3.70304 17.8122 5.99434C17.8498 6.04978 17.8873 6.08674 17.9249 6.14217C19.5024 8.45195 19.2582 10.1704 18.0376 11.0204Z'
- fill='#00B5FF'
- />
- <path
- d='M16.4226 18.5219C16.385 18.5589 16.3475 18.5773 16.2911 18.6143C13.8686 20.2958 12.0658 20.0556 11.1832 18.836C10.3569 17.6904 11.277 15.8795 12.4414 14.9371C12.5165 14.8817 12.5916 14.8263 12.6667 14.7708C13.9437 13.9023 17.8123 11.0382 18.6761 12.2763C19.5587 13.4773 18.6573 16.8773 16.4226 18.5219Z'
- fill='#FFBD00'
- />
- <path
- d='M9.66206 19.6861C8.42263 20.5545 4.85455 19.6121 3.22075 17.3208C3.18319 17.2839 3.14563 17.2285 3.12685 17.1915C1.53061 14.8817 1.79352 13.1448 3.01418 12.3132C4.21605 11.4817 6.09399 12.4426 7.03296 13.6437C7.07051 13.6991 7.10807 13.7361 7.14563 13.7915C8.02826 15.0295 10.9203 18.8361 9.66206 19.6861Z'
- fill='#E3006D'
- />
- <path
- d='M8.57283 8.37731C6.84513 9.13491 3.16438 10.6871 2.61978 9.43057C2.1503 8.37731 3.01415 6.23383 4.59161 4.79252C4.62917 4.75557 4.68551 4.73709 4.72307 4.70013C7.1456 3.01861 8.94842 3.25883 9.83105 4.47839C10.6573 5.62404 9.73715 7.43491 8.57283 8.37731Z'
- fill='#9327FF'
- />
- <path
- d='M18.0377 11.0196C16.8358 11.8511 14.9578 10.8902 14.0189 9.68912C13.2489 7.93368 11.7654 4.47825 13.0048 3.96086C14.1316 3.48042 16.4602 4.44129 17.9438 6.14129C19.5024 8.45107 19.2583 10.1696 18.0377 11.0196Z'
- fill='#00C8FF'
- />
- <path
- d='M16.4226 18.5218C16.385 18.5587 16.3475 18.5772 16.2911 18.6142C13.8686 20.2957 12.0658 20.0555 11.1832 18.8359C10.3569 17.6903 11.277 15.8794 12.4414 14.937C14.1691 14.1794 17.8498 12.6272 18.3944 13.8837C18.8827 14.937 18.0188 17.0805 16.4226 18.5218Z'
- fill='#FFCE00'
- />
- <path
- d='M8.04704 19.3535C6.92028 19.8339 4.59164 18.8915 3.12685 17.1915C1.53061 14.8817 1.79352 13.1448 3.01418 12.3132C4.21605 11.4817 6.09399 12.4426 7.03296 13.6437C7.80291 15.3806 9.28648 18.8361 8.04704 19.3535Z'
- fill='#FB006D'
- />
- </g>
- <defs>
- <clipPath id='clip0_159_6088'>
- <rect width='92' height='17' fill='white' transform='translate(2 3)' />
- </clipPath>
- </defs>
-</svg>
\ No newline at end of file
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/link.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/link.svg
deleted file mode 100644
index 5fbcc8d787..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/link.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M7 8.91521C7.21574 9.22582 7.49099 9.48283 7.80707 9.66881C8.12315 9.85479 8.47268 9.96538 8.83194 9.99309C9.1912 10.0208 9.5518 9.96497 9.88926 9.8294C10.2267 9.69383 10.5332 9.48169 10.7878 9.20736L12.2949 7.58431C12.7525 7.07413 13.0056 6.39083 12.9999 5.68156C12.9942 4.9723 12.73 4.29384 12.2643 3.7923C11.7986 3.29075 11.1686 3.00627 10.51 3.0001C9.85142 2.99394 9.21693 3.26659 8.7432 3.75935L7.87913 4.68448" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
-<path d="M9 7.08479C8.78426 6.77418 8.50901 6.51717 8.19293 6.33119C7.87685 6.14521 7.52732 6.03462 7.16806 6.00691C6.8088 5.9792 6.4482 6.03503 6.11074 6.1706C5.77327 6.30617 5.46683 6.51831 5.21218 6.79264L3.7051 8.41569C3.24755 8.92587 2.99437 9.60918 3.00009 10.3184C3.00582 11.0277 3.26998 11.7062 3.73569 12.2077C4.2014 12.7092 4.8314 12.9937 5.48999 12.9999C6.14858 13.0061 6.78307 12.7334 7.2568 12.2407L8.11584 11.3155" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/list-dropdown.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/list-dropdown.svg
deleted file mode 100644
index 4a8424c5f8..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/list-dropdown.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M8.28284 4.28284L10.3172 6.31716C10.5691 6.56914 10.3907 7 10.0343 7H5.96569C5.60932 7 5.43086 6.56914 5.68284 6.31716L7.71716 4.28284C7.87337 4.12663 8.12663 4.12663 8.28284 4.28284Z" fill="#00BCF0"/>
-<path d="M8.28284 11.7172L10.3172 9.68284C10.5691 9.43086 10.3907 9 10.0343 9H5.96569C5.60932 9 5.43086 9.43086 5.68284 9.68284L7.71716 11.7172C7.87337 11.8734 8.12663 11.8734 8.28284 11.7172Z" fill="#00BCF0"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/list.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/list.svg
deleted file mode 100644
index 97a2e9c434..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/list.svg
+++ /dev/null
@@ -1,8 +0,0 @@
-<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M6.5 4L12.5 4" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
-<path d="M6.5 8H12.5" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
-<path d="M6.5 12H12.5" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
-<circle cx="4" cy="4" r="0.5" fill="#333333"/>
-<circle cx="4" cy="8" r="0.5" fill="#333333"/>
-<circle cx="4" cy="12" r="0.5" fill="#333333"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/logo.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/logo.svg
deleted file mode 100644
index b1ac8d66fb..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/logo.svg
+++ /dev/null
@@ -1,38 +0,0 @@
-<svg width='100%' height='100%' viewBox='0 0 41 40' fill='none' xmlns='http://www.w3.org/2000/svg'>
- <path
- d='M39.9564 24.0195C38.8098 30.1683 33.7828 35.5321 28.0061 38.5411C27.3005 38.9336 26.4627 39.1516 25.6689 39.1952H37.9279C39.1185 39.1952 39.9564 38.323 39.9564 37.2328V24.0195Z'
- fill='#F7931E'
- />
- <path
- d='M15.4381 12.1576C15.2617 12.2884 15.0853 12.4192 14.9089 12.55C11.9103 14.6432 2.82634 21.3589 0.753788 18.4371C-1.27467 15.6026 0.886079 7.57868 6.08952 3.69755C6.17771 3.61033 6.31 3.56672 6.3982 3.4795C12.0867 -0.48885 16.32 0.078058 18.3926 2.95621C20.3328 5.65992 18.1721 9.93353 15.4381 12.1576Z'
- fill='#8427E0'
- />
- <path
- d='M33.8715 36.098C33.7833 36.1852 33.6951 36.2288 33.5628 36.316C27.8743 40.2844 23.641 39.7175 21.5684 36.8393C19.6282 34.1356 21.7889 29.862 24.5229 27.638C24.6993 27.5072 24.8757 27.3763 25.0521 27.2455C28.0507 25.1959 37.1347 18.4366 39.1631 21.3584C41.2357 24.1929 39.119 32.2169 33.8715 36.098Z'
- fill='#FFBD00'
- />
- <path
- d='M17.9954 38.8459C15.085 40.8955 6.70658 38.6715 2.87014 33.264C2.78195 33.1768 2.69376 33.046 2.64966 32.9588C-1.09858 27.5078 -0.481224 23.4086 2.38508 21.4462C5.20728 19.4838 9.61698 21.7515 11.8218 24.586C11.91 24.7168 11.9982 24.804 12.0864 24.9349C14.159 27.8566 20.9499 36.8399 17.9954 38.8459Z'
- fill='#E3006D'
- />
- <path
- d='M15.4385 12.1576C11.3816 13.9455 2.73857 17.6086 1.45976 14.6432C0.357338 12.1576 2.3858 7.09899 6.08994 3.69755C6.17814 3.61033 6.31043 3.56672 6.39862 3.4795C12.0871 -0.48885 16.3204 0.078058 18.393 2.95621C20.3333 5.65992 18.1725 9.93353 15.4385 12.1576Z'
- fill='#9327FF'
- />
- <path
- d='M37.6624 18.3955C34.8402 20.3579 30.4305 18.0903 28.2257 15.2557C28.1375 15.1249 28.0493 15.0377 27.9611 14.9069C25.8444 11.9415 19.0535 2.95819 21.9639 0.952211C24.8743 -1.09738 33.2968 1.12664 37.1333 6.53407C37.2215 6.6649 37.3096 6.75211 37.3978 6.88294C41.102 12.334 40.5287 16.3895 37.6624 18.3955Z'
- fill='#00B5FF'
- />
- <path
- d='M37.6628 18.3934C34.8406 20.3557 30.4309 18.0881 28.2261 15.2536C26.4181 11.1108 22.9344 2.95603 25.8448 1.73499C28.4906 0.601179 33.9587 2.86881 37.4423 6.88077C41.1024 12.3318 40.5291 16.3874 37.6628 18.3934Z'
- fill='#00C8FF'
- />
- <path
- d='M33.8715 36.0986C33.7833 36.1858 33.6951 36.2294 33.5628 36.3166C27.8743 40.285 23.641 39.7181 21.5684 36.8399C19.6282 34.1362 21.7889 29.8626 24.5229 27.6386C28.5799 25.8506 37.2229 22.1875 38.5017 25.1529C39.6482 27.6386 37.6197 32.6971 33.8715 36.0986Z'
- fill='#FFCE00'
- />
- <path
- d='M14.2031 38.061C11.5572 39.1948 6.08922 36.9708 2.64966 32.9588C-1.09858 27.5078 -0.481224 23.4086 2.38508 21.4462C5.20728 19.4838 9.61698 21.7515 11.8218 24.586C13.6298 28.6852 17.1135 36.8399 14.2031 38.061Z'
- fill='#FB006D'
- />
-</svg>
\ No newline at end of file
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/mention.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/mention.svg
deleted file mode 100644
index b98318132c..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/mention.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M13.9914 7.65008C13.9385 8.74585 13.6333 9.61691 13.0758 10.2632C12.5231 10.9053 11.7782 11.2263 10.8411 11.2263C10.4277 11.2263 10.0697 11.1471 9.76692 10.9888C9.36107 10.7731 8.75554 10.7179 8.35072 10.9355C8.01401 11.1166 7.63301 11.2071 7.20774 11.2071C6.50606 11.2071 5.96299 10.9438 5.57851 10.4173C5.19403 9.89085 5.04986 9.19529 5.14597 8.33066C5.23248 7.6244 5.43193 6.99732 5.74432 6.44944C6.06151 5.89727 6.46041 5.47352 6.941 5.17817C7.4216 4.88283 7.94065 4.73515 8.49814 4.73515C9.18539 4.73515 9.77172 4.8764 10.2571 5.15891C10.5347 5.32765 10.6909 5.64063 10.6589 5.9639L10.3436 9.14607C10.2956 9.48422 10.3364 9.74318 10.4662 9.92295C10.6008 10.1027 10.8122 10.1926 11.1006 10.1926C11.5427 10.1926 11.9128 9.96362 12.2108 9.50562C12.5087 9.04334 12.6721 8.43981 12.701 7.69502C12.7827 6.20118 12.4438 5.05404 11.6845 4.25361C10.93 3.4489 9.81017 3.04655 8.32512 3.04655C7.39757 3.04655 6.57095 3.25629 5.84524 3.67576C5.11954 4.09524 4.54763 4.69235 4.12951 5.46709C3.71139 6.23756 3.4759 7.12146 3.42303 8.11878C3.34614 9.63403 3.68736 10.8047 4.44671 11.6308C5.20605 12.4612 6.34266 12.8764 7.85654 12.8764C8.25544 12.8764 8.67356 12.8357 9.1109 12.7544C9.30727 12.7198 9.49152 12.6796 9.66367 12.6338C9.97711 12.5504 10.3193 12.7162 10.4059 13.0288C10.4712 13.2644 10.3702 13.5177 10.1426 13.607C9.91108 13.6978 9.63927 13.7753 9.32717 13.8395C8.83215 13.9465 8.33233 14 7.82771 14C6.55893 14 5.47759 13.771 4.58368 13.313C3.68977 12.8593 3.02174 12.1873 2.57959 11.297C2.14224 10.4109 1.95241 9.35153 2.01008 8.11878C2.06775 6.9374 2.37053 5.87801 2.91841 4.94061C3.46629 4.00321 4.21121 3.27983 5.15318 2.77047C6.09996 2.25682 7.16689 2 8.35396 2C9.56026 2 10.5983 2.23114 11.4682 2.69342C12.3381 3.15142 12.9893 3.80845 13.4219 4.66453C13.8544 5.5206 14.0442 6.51578 13.9914 7.65008ZM6.74636 8.33066C6.6935 8.89567 6.74877 9.32584 6.91217 9.62119C7.07557 9.91225 7.3399 10.0578 7.70515 10.0578C7.94065 10.0578 8.16412 9.96576 8.37559 9.7817C8.49637 9.67658 8.60539 9.54492 8.70265 9.38673C8.85844 9.13336 8.91682 8.83533 8.94633 8.53936L9.1466 6.53052C9.18027 6.19282 8.96727 5.86517 8.6279 5.86517C8.07521 5.86517 7.64508 6.07491 7.3375 6.49438C7.03472 6.91386 6.83768 7.52595 6.74636 8.33066Z" fill="#333333"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/more.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/more.svg
deleted file mode 100644
index b191e64a10..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/more.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M9.39568 7.6963L6.91032 5.56599C6.65085 5.34358 6.25 5.52795 6.25 5.86969L6.25 10.1303C6.25 10.4721 6.65085 10.6564 6.91032 10.434L9.39568 8.3037C9.58192 8.14406 9.58192 7.85594 9.39568 7.6963Z" fill="#333333"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/numbers.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/numbers.svg
deleted file mode 100644
index 9d8b98d10d..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/numbers.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M2.201 6.4H3.001V12H2.081V7.384L0.953 7.704L0.729 6.92L2.201 6.4ZM3.91156 12V11.1L6.35156 8.61C6.9449 8.01667 7.24156 7.50333 7.24156 7.07C7.24156 6.73 7.13823 6.46667 6.93156 6.28C6.73156 6.08667 6.4749 5.99 6.16156 5.99C5.5749 5.99 5.14156 6.28 4.86156 6.86L3.89156 6.29C4.11156 5.82333 4.42156 5.47 4.82156 5.23C5.22156 4.99 5.6649 4.87 6.15156 4.87C6.7649 4.87 7.29156 5.06333 7.73156 5.45C8.17156 5.83667 8.39156 6.36333 8.39156 7.03C8.39156 7.74333 7.9949 8.50333 7.20156 9.31L5.62156 10.89H8.52156V12H3.91156ZM12.9025 7.032C13.5105 7.176 14.0025 7.46 14.3785 7.884C14.7625 8.3 14.9545 8.824 14.9545 9.456C14.9545 10.296 14.6705 10.956 14.1025 11.436C13.5345 11.916 12.8385 12.156 12.0145 12.156C11.3745 12.156 10.7985 12.008 10.2865 11.712C9.78253 11.416 9.41853 10.984 9.19453 10.416L10.3705 9.732C10.6185 10.452 11.1665 10.812 12.0145 10.812C12.4945 10.812 12.8745 10.692 13.1545 10.452C13.4345 10.204 13.5745 9.872 13.5745 9.456C13.5745 9.04 13.4345 8.712 13.1545 8.472C12.8745 8.232 12.4945 8.112 12.0145 8.112H11.7025L11.1505 7.284L12.9625 4.896H9.44653V3.6H14.6065V4.776L12.9025 7.032Z" fill="#333333"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/open.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/open.svg
deleted file mode 100644
index b443c8b993..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/open.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M4 11H1V8" stroke="#828282" stroke-linecap="round" stroke-linejoin="round"/>
-<path d="M8 1H11V4" stroke="#828282" stroke-linecap="round" stroke-linejoin="round"/>
-<path d="M1 11L5 7" stroke="#828282" stroke-linecap="round" stroke-linejoin="round"/>
-<path d="M11 1L7 5" stroke="#828282" stroke-linecap="round" stroke-linejoin="round"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/quote.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/quote.svg
deleted file mode 100644
index 57839231ff..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/quote.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path fill-rule="evenodd" clip-rule="evenodd" d="M12.4742 9.35161C12.8007 8.99566 13 8.52111 13 8C13 6.89543 12.1046 6 11 6C9.89543 6 9 6.89543 9 8C9 9.04413 9.80011 9.90137 10.8207 9.99207L10.0124 11.1682L10.8365 11.7346L12.4742 9.35161Z" fill="#333333"/>
-<path fill-rule="evenodd" clip-rule="evenodd" d="M6.47395 7.35186C6.80061 6.99588 7 6.52123 7 6C7 4.89543 6.10457 4 5 4C3.89543 4 3 4.89543 3 6C3 7.04411 3.80008 7.90134 4.82061 7.99206L4.01231 9.16823L4.83645 9.73461L6.47395 7.35186Z" fill="#333333"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/react.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/react.svg
deleted file mode 100644
index 6c87de9bb3..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/react.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="35.93" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 228"><path fill="#00D8FF" d="M210.483 73.824a171.49 171.49 0 0 0-8.24-2.597c.465-1.9.893-3.777 1.273-5.621c6.238-30.281 2.16-54.676-11.769-62.708c-13.355-7.7-35.196.329-57.254 19.526a171.23 171.23 0 0 0-6.375 5.848a155.866 155.866 0 0 0-4.241-3.917C100.759 3.829 77.587-4.822 63.673 3.233C50.33 10.957 46.379 33.89 51.995 62.588a170.974 170.974 0 0 0 1.892 8.48c-3.28.932-6.445 1.924-9.474 2.98C17.309 83.498 0 98.307 0 113.668c0 15.865 18.582 31.778 46.812 41.427a145.52 145.52 0 0 0 6.921 2.165a167.467 167.467 0 0 0-2.01 9.138c-5.354 28.2-1.173 50.591 12.134 58.266c13.744 7.926 36.812-.22 59.273-19.855a145.567 145.567 0 0 0 5.342-4.923a168.064 168.064 0 0 0 6.92 6.314c21.758 18.722 43.246 26.282 56.54 18.586c13.731-7.949 18.194-32.003 12.4-61.268a145.016 145.016 0 0 0-1.535-6.842c1.62-.48 3.21-.974 4.76-1.488c29.348-9.723 48.443-25.443 48.443-41.52c0-15.417-17.868-30.326-45.517-39.844Zm-6.365 70.984c-1.4.463-2.836.91-4.3 1.345c-3.24-10.257-7.612-21.163-12.963-32.432c5.106-11 9.31-21.767 12.459-31.957c2.619.758 5.16 1.557 7.61 2.4c23.69 8.156 38.14 20.213 38.14 29.504c0 9.896-15.606 22.743-40.946 31.14Zm-10.514 20.834c2.562 12.94 2.927 24.64 1.23 33.787c-1.524 8.219-4.59 13.698-8.382 15.893c-8.067 4.67-25.32-1.4-43.927-17.412a156.726 156.726 0 0 1-6.437-5.87c7.214-7.889 14.423-17.06 21.459-27.246c12.376-1.098 24.068-2.894 34.671-5.345a134.17 134.17 0 0 1 1.386 6.193ZM87.276 214.515c-7.882 2.783-14.16 2.863-17.955.675c-8.075-4.657-11.432-22.636-6.853-46.752a156.923 156.923 0 0 1 1.869-8.499c10.486 2.32 22.093 3.988 34.498 4.994c7.084 9.967 14.501 19.128 21.976 27.15a134.668 134.668 0 0 1-4.877 4.492c-9.933 8.682-19.886 14.842-28.658 17.94ZM50.35 144.747c-12.483-4.267-22.792-9.812-29.858-15.863c-6.35-5.437-9.555-10.836-9.555-15.216c0-9.322 13.897-21.212 37.076-29.293c2.813-.98 5.757-1.905 8.812-2.773c3.204 10.42 7.406 21.315 12.477 32.332c-5.137 11.18-9.399 22.249-12.634 32.792a134.718 134.718 0 0 1-6.318-1.979Zm12.378-84.26c-4.811-24.587-1.616-43.134 6.425-47.789c8.564-4.958 27.502 2.111 47.463 19.835a144.318 144.318 0 0 1 3.841 3.545c-7.438 7.987-14.787 17.08-21.808 26.988c-12.04 1.116-23.565 2.908-34.161 5.309a160.342 160.342 0 0 1-1.76-7.887Zm110.427 27.268a347.8 347.8 0 0 0-7.785-12.803c8.168 1.033 15.994 2.404 23.343 4.08c-2.206 7.072-4.956 14.465-8.193 22.045a381.151 381.151 0 0 0-7.365-13.322Zm-45.032-43.861c5.044 5.465 10.096 11.566 15.065 18.186a322.04 322.04 0 0 0-30.257-.006c4.974-6.559 10.069-12.652 15.192-18.18ZM82.802 87.83a323.167 323.167 0 0 0-7.227 13.238c-3.184-7.553-5.909-14.98-8.134-22.152c7.304-1.634 15.093-2.97 23.209-3.984a321.524 321.524 0 0 0-7.848 12.897Zm8.081 65.352c-8.385-.936-16.291-2.203-23.593-3.793c2.26-7.3 5.045-14.885 8.298-22.6a321.187 321.187 0 0 0 7.257 13.246c2.594 4.48 5.28 8.868 8.038 13.147Zm37.542 31.03c-5.184-5.592-10.354-11.779-15.403-18.433c4.902.192 9.899.29 14.978.29c5.218 0 10.376-.117 15.453-.343c-4.985 6.774-10.018 12.97-15.028 18.486Zm52.198-57.817c3.422 7.8 6.306 15.345 8.596 22.52c-7.422 1.694-15.436 3.058-23.88 4.071a382.417 382.417 0 0 0 7.859-13.026a347.403 347.403 0 0 0 7.425-13.565Zm-16.898 8.101a358.557 358.557 0 0 1-12.281 19.815a329.4 329.4 0 0 1-23.444.823c-7.967 0-15.716-.248-23.178-.732a310.202 310.202 0 0 1-12.513-19.846h.001a307.41 307.41 0 0 1-10.923-20.627a310.278 310.278 0 0 1 10.89-20.637l-.001.001a307.318 307.318 0 0 1 12.413-19.761c7.613-.576 15.42-.876 23.31-.876H128c7.926 0 15.743.303 23.354.883a329.357 329.357 0 0 1 12.335 19.695a358.489 358.489 0 0 1 11.036 20.54a329.472 329.472 0 0 1-11 20.722Zm22.56-122.124c8.572 4.944 11.906 24.881 6.52 51.026c-.344 1.668-.73 3.367-1.15 5.09c-10.622-2.452-22.155-4.275-34.23-5.408c-7.034-10.017-14.323-19.124-21.64-27.008a160.789 160.789 0 0 1 5.888-5.4c18.9-16.447 36.564-22.941 44.612-18.3ZM128 90.808c12.625 0 22.86 10.235 22.86 22.86s-10.235 22.86-22.86 22.86s-22.86-10.235-22.86-22.86s10.235-22.86 22.86-22.86Z"></path></svg>
\ No newline at end of file
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/right.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/right.svg
deleted file mode 100644
index 7d738f4e69..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/right.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M13 11.7778L13 4" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
-<path d="M6.5 4.5L10 8L6.5 11.5" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
-<path d="M10 8L3 8" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/search.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/search.svg
deleted file mode 100644
index a8a92df509..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/search.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
-<circle cx="7.5" cy="7.5" r="5" stroke="#4F4F4F"/>
-<path d="M12.6464 13.354C12.8416 13.5493 13.1582 13.5493 13.3535 13.3541C13.5488 13.1588 13.5488 12.8422 13.3536 12.647L12.6464 13.354ZM10.6464 11.3535L12.6464 13.354L13.3536 12.647L11.3536 10.6465L10.6464 11.3535Z" fill="#4F4F4F"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/select-check.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/select-check.svg
deleted file mode 100644
index 05caec861a..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/select-check.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M5 8.2L6.84615 10L13 4" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/settings.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/settings.svg
deleted file mode 100644
index 92140a3c23..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/settings.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-<svg width="16" height="17" viewBox="0 0 16 17" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M7.01471 2.15012C7.62441 1.7981 8.37559 1.7981 8.98529 2.15012L12.5769 4.22372C13.1866 4.57573 13.5622 5.22628 13.5622 5.9303V10.0775C13.5622 10.7815 13.1866 11.4321 12.5769 11.7841L8.98529 13.8577C8.37559 14.2097 7.62441 14.2097 7.01471 13.8577L3.42312 11.7841C2.81341 11.4321 2.43782 10.7815 2.43782 10.0775V5.9303C2.43782 5.22628 2.81341 4.57573 3.42312 4.22372L7.01471 2.15012Z" stroke="#333333"/>
-<circle cx="8" cy="8.00391" r="2.5" stroke="#333333"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/settings/account.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/settings/account.svg
deleted file mode 100644
index fddfca7575..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/settings/account.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
- <path d="M11.9978 1.95316C9.2364 1.95316 6.9978 4.19176 6.9978 6.95315C6.9978 9.71455 9.2364 11.9532 11.9978 11.9532C14.7592 11.9532 16.9978 9.71455 16.9978 6.95315C16.9978 4.19176 14.7592 1.95316 11.9978 1.95316ZM11.9978 3.95316C13.6547 3.95316 14.9978 5.29625 14.9978 6.95315C14.9978 8.61005 13.6547 9.95315 11.9978 9.95315C10.3409 9.95315 8.9978 8.61005 8.9978 6.95315C8.9978 5.29625 10.3409 3.95316 11.9978 3.95316ZM8.4666 13.2657C5.8523 13.9802 3.9978 16.2534 3.9978 18.9532V20.9532C3.9978 21.5055 4.4455 21.9532 4.9978 21.9532H18.9978C19.5501 21.9532 19.9978 21.5055 19.9978 20.9532V18.9532C19.9978 16.2534 18.1433 13.9802 15.529 13.2657C15.3049 13.2044 15.0847 13.2327 14.8728 13.3282C13.9573 13.7408 12.9827 13.9532 11.9978 13.9532C11.0129 13.9532 10.0383 13.7408 9.1228 13.3282C8.9109 13.2327 8.6907 13.2044 8.4666 13.2657ZM8.8728 15.2657C9.8826 15.6476 10.9175 15.9532 11.9978 15.9532C13.0781 15.9532 14.113 15.6476 15.1228 15.2657C16.8262 15.7817 17.9978 17.2196 17.9978 18.9532V19.9532H5.9978V18.9532C5.9978 17.2196 7.1694 15.7817 8.8728 15.2657Z" fill="currentColor"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/settings/check_circle.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/settings/check_circle.svg
deleted file mode 100644
index c6fa56067b..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/settings/check_circle.svg
+++ /dev/null
@@ -1,8 +0,0 @@
-<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
-<mask id="mask0_83_2591" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="16" height="16">
-<rect width="16" height="16" fill="#66CF80"/>
-</mask>
-<g mask="url(#mask0_83_2591)">
-<path d="M7.06607 11.0666L11.7661 6.36659L10.8327 5.43325L7.06607 9.19992L5.16607 7.29992L4.23273 8.23325L7.06607 11.0666ZM7.9994 14.6666C7.07718 14.6666 6.21051 14.4916 5.3994 14.1416C4.58829 13.7916 3.88273 13.3166 3.28273 12.7166C2.68273 12.1166 2.20773 11.411 1.85773 10.5999C1.50773 9.78881 1.33273 8.92214 1.33273 7.99992C1.33273 7.0777 1.50773 6.21103 1.85773 5.39992C2.20773 4.58881 2.68273 3.88325 3.28273 3.28325C3.88273 2.68325 4.58829 2.20825 5.3994 1.85825C6.21051 1.50825 7.07718 1.33325 7.9994 1.33325C8.92162 1.33325 9.78829 1.50825 10.5994 1.85825C11.4105 2.20825 12.1161 2.68325 12.7161 3.28325C13.3161 3.88325 13.7911 4.58881 14.1411 5.39992C14.4911 6.21103 14.6661 7.0777 14.6661 7.99992C14.6661 8.92214 14.4911 9.78881 14.1411 10.5999C13.7911 11.411 13.3161 12.1166 12.7161 12.7166C12.1161 13.3166 11.4105 13.7916 10.5994 14.1416C9.78829 14.4916 8.92162 14.6666 7.9994 14.6666Z" fill="#66CF80"/>
-</g>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/settings/dark.png b/frontend/appflowy_tauri/src/appflowy_app/assets/settings/dark.png
deleted file mode 100644
index 15a2db5eb8..0000000000
Binary files a/frontend/appflowy_tauri/src/appflowy_app/assets/settings/dark.png and /dev/null differ
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/settings/discord.png b/frontend/appflowy_tauri/src/appflowy_app/assets/settings/discord.png
deleted file mode 100644
index f71e68c6ed..0000000000
Binary files a/frontend/appflowy_tauri/src/appflowy_app/assets/settings/discord.png and /dev/null differ
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/settings/github.png b/frontend/appflowy_tauri/src/appflowy_app/assets/settings/github.png
deleted file mode 100644
index 597883b7a3..0000000000
Binary files a/frontend/appflowy_tauri/src/appflowy_app/assets/settings/github.png and /dev/null differ
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/settings/google.png b/frontend/appflowy_tauri/src/appflowy_app/assets/settings/google.png
deleted file mode 100644
index 60032628a8..0000000000
Binary files a/frontend/appflowy_tauri/src/appflowy_app/assets/settings/google.png and /dev/null differ
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/settings/light.png b/frontend/appflowy_tauri/src/appflowy_app/assets/settings/light.png
deleted file mode 100644
index 09b2d9c475..0000000000
Binary files a/frontend/appflowy_tauri/src/appflowy_app/assets/settings/light.png and /dev/null differ
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/settings/workplace.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/settings/workplace.svg
deleted file mode 100644
index 2076ea3e2c..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/settings/workplace.svg
+++ /dev/null
@@ -1,10 +0,0 @@
-<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
- <mask id="mask0_899_4965" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="24" height="24">
- <rect width="24" height="24" fill="#D9D9D9"/>
- </mask>
- <g mask="url(#mask0_899_4965)">
- <path d="M5 21C4.45 21 3.97917 20.8042 3.5875 20.4125C3.19583 20.0208 3 19.55 3 19V5C3 4.45 3.19583 3.97917 3.5875 3.5875C3.97917 3.19583 4.45 3 5 3H19C19.55 3 20.0208 3.19583 20.4125 3.5875C20.8042 3.97917 21 4.45 21 5V19C21 19.55 20.8042 20.0208 20.4125 20.4125C20.0208 20.8042 19.55 21 19 21H5ZM5 19H11V5H5V19ZM13 19H19V12H13V19ZM13 10H19V5H13V10Z" fill="currentColor"/>
- </g>
-</svg>
-
-
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/show-menu.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/show-menu.svg
deleted file mode 100644
index 8baf55bffd..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/show-menu.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M10 5L13 8L10 11" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
-<rect x="3" y="5" width="4" height="1" rx="0.5" fill="#333333"/>
-<rect x="3" y="7.5" width="6" height="1" rx="0.5" fill="#333333"/>
-<rect x="3" y="10" width="4" height="1" rx="0.5" fill="#333333"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/sort.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/sort.svg
deleted file mode 100644
index e3b6a49a56..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/sort.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-<svg width='100%' height='100%' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'>
- <rect x='2.5' y='3' width='4' height='10' rx='1' stroke='currentColor' />
- <rect x='9.5' y='7' width='4' height='6' rx='1' stroke='currentColor' />
-</svg>
\ No newline at end of file
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/strikethrough.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/strikethrough.svg
deleted file mode 100644
index c118422a15..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/strikethrough.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path fill-rule="evenodd" clip-rule="evenodd" d="M7.99994 3C6.78324 3 5.57768 3.89295 5.26683 5.05868C5.14348 5.52122 5.16418 6.01807 5.36988 6.5H6.53454C6.50039 6.45893 6.46931 6.41816 6.44111 6.37779C6.18329 6.00862 6.14534 5.64531 6.23306 5.31634C6.4222 4.60706 7.21665 4 7.99994 4C8.69325 4 9.21448 4.21587 9.55371 4.46532C9.7248 4.59113 9.84481 4.72187 9.91824 4.83203C9.98388 4.93049 9.99678 4.98806 9.99929 4.99927C9.99983 5.00168 9.99989 5.00194 9.99989 5H10.9999C10.9999 4.73903 10.8893 4.4858 10.7503 4.27735C10.605 4.05938 10.4 3.84637 10.1461 3.65968C9.63538 3.28413 8.90664 3 7.99994 3ZM10.63 9.5H9.4653C9.49948 9.54108 9.53057 9.58188 9.55877 9.62226C9.8166 9.99142 9.85455 10.3547 9.76683 10.6837C9.57769 11.393 8.78324 12 7.99994 12C7.30664 12 6.78541 11.7842 6.44617 11.5347C6.27508 11.4089 6.15508 11.2781 6.08165 11.168C6.01601 11.0695 6.00311 11.012 6.0006 11.0008C6.00006 10.9983 6 10.9981 6 11H5C5 11.261 5.11062 11.5142 5.24958 11.7227C5.39489 11.9406 5.59988 12.1537 5.85377 12.3403C6.36451 12.7159 7.09325 13 7.99994 13C9.21665 13 10.4222 12.1071 10.7331 10.9414C10.8564 10.4788 10.8357 9.98194 10.63 9.5Z" fill="#333333"/>
-<rect width="8" height="1" transform="matrix(1 0 0 -1 4 8.5)" fill="#333333"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/text.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/text.svg
deleted file mode 100644
index 7befa5080f..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/text.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M7.15625 11.8359L6.43768 9.85414H2.46662L1.74805 11.8359H0.5L3.7903 3H5.11399L8.4043 11.8359H7.15625ZM2.87003 8.75596H6.03427L4.44584 4.40112L2.87003 8.75596Z" fill="#333333"/>
-<path d="M14.4032 5.52454H15.5V11.8359H14.4032V10.7504C13.8569 11.5835 13.0627 12 12.0206 12C11.1381 12 10.386 11.6802 9.76403 11.0407C9.14211 10.3927 8.83114 9.60589 8.83114 8.68022C8.83114 7.75456 9.14211 6.97195 9.76403 6.3324C10.386 5.68443 11.1381 5.36045 12.0206 5.36045C13.0627 5.36045 13.8569 5.777 14.4032 6.6101V5.52454ZM12.1593 10.9397C12.798 10.9397 13.3317 10.7251 13.7603 10.2959C14.1889 9.85835 14.4032 9.31978 14.4032 8.68022C14.4032 8.04067 14.1889 7.50631 13.7603 7.07714C13.3317 6.63955 12.798 6.42076 12.1593 6.42076C11.5289 6.42076 10.9995 6.63955 10.5708 7.07714C10.1422 7.50631 9.92791 8.04067 9.92791 8.68022C9.92791 9.31978 10.1422 9.85835 10.5708 10.2959C10.9995 10.7251 11.5289 10.9397 12.1593 10.9397Z" fill="#333333"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/todo-list.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/todo-list.svg
deleted file mode 100644
index 37f52c47ed..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/todo-list.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M6.5 8L8.11538 9.5L13.5 4.5" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
-<path d="M13 8.5V11.8889C13 12.1836 12.8829 12.4662 12.6746 12.6746C12.4662 12.8829 12.1836 13 11.8889 13H4.11111C3.81643 13 3.53381 12.8829 3.32544 12.6746C3.11706 12.4662 3 12.1836 3 11.8889V4.11111C3 3.81643 3.11706 3.53381 3.32544 3.32544C3.53381 3.11706 3.81643 3 4.11111 3H10.2222" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/underline.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/underline.svg
deleted file mode 100644
index f5d53f0ec2..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/underline.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
-<rect x="4" y="12" width="8" height="1" fill="currentColor"/>
-<path d="M10.1623 10.2595C9.60377 10.7532 8.88302 11 8 11C7.11698 11 6.39623 10.7532 5.83774 10.2595C5.27925 9.7583 5 9.08883 5 8.25105V3H6.30189V8.17251C6.30189 8.65124 6.44151 9.03273 6.72075 9.31697C7.00755 9.60122 7.43396 9.74334 8 9.74334C8.56604 9.74334 8.98868 9.60122 9.26792 9.31697C9.55472 9.03273 9.69811 8.65124 9.69811 8.17251V3H11V8.25105C11 9.08883 10.7208 9.7583 10.1623 10.2595Z" fill="currentColor"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/assets/up.svg b/frontend/appflowy_tauri/src/appflowy_app/assets/up.svg
deleted file mode 100644
index bd8f3067d3..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/assets/up.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-<svg width="16" height="17" viewBox="0 0 16 17" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M11 7L8 4.5M8 4.5L5 7M8 4.5V12.5" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
-</svg>
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/avatar/ProfileAvatar.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/_shared/avatar/ProfileAvatar.tsx
deleted file mode 100644
index 1248882238..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/avatar/ProfileAvatar.tsx
+++ /dev/null
@@ -1,33 +0,0 @@
-import { stringToColor, stringToShortName } from '$app/utils/avatar';
-import { Avatar } from '@mui/material';
-import { useAppSelector } from '$app/stores/store';
-
-export const ProfileAvatar = ({
- onClick,
- className,
- width,
- height,
-}: {
- onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
- width?: number;
- height?: number;
- className?: string;
-}) => {
- const { displayName = 'Me', iconUrl } = useAppSelector((state) => state.currentUser);
-
- return (
- <Avatar
- onClick={onClick}
- className={className}
- sx={{
- bgcolor: iconUrl ? 'transparent' : stringToColor(displayName),
- width,
- height,
- fontSize: iconUrl ? undefined : width ? width / 2.5 : 20,
- color: iconUrl ? undefined : 'white',
- }}
- >
- {iconUrl ? iconUrl : stringToShortName(displayName)}
- </Avatar>
- );
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/avatar/WorkplaceAvatar.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/_shared/avatar/WorkplaceAvatar.tsx
deleted file mode 100644
index 079342b528..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/avatar/WorkplaceAvatar.tsx
+++ /dev/null
@@ -1,34 +0,0 @@
-import { Avatar } from '@mui/material';
-import { stringToColor, stringToShortName } from '$app/utils/avatar';
-
-export const WorkplaceAvatar = ({
- workplaceName,
- icon,
- onClick,
- width,
- height,
- className,
-}: {
- workplaceName: string;
- width: number;
- height: number;
- className?: string;
- icon?: string;
- onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
-}) => {
- return (
- <Avatar
- onClick={onClick}
- className={className}
- variant={'rounded'}
- sx={{
- bgcolor: icon ? 'transparent' : stringToColor(workplaceName),
- width,
- height,
- color: icon ? undefined : 'white',
- }}
- >
- {icon ? icon : stringToShortName(workplaceName)}
- </Avatar>
- );
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/avatar/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/_shared/avatar/index.ts
deleted file mode 100644
index 772056737a..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/avatar/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export * from './WorkplaceAvatar';
-export * from './ProfileAvatar';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/confirm_dialog/DeleteConfirmDialog.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/_shared/confirm_dialog/DeleteConfirmDialog.tsx
deleted file mode 100644
index 058335d30c..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/confirm_dialog/DeleteConfirmDialog.tsx
+++ /dev/null
@@ -1,77 +0,0 @@
-import React, { useCallback } from 'react';
-import DialogContent from '@mui/material/DialogContent';
-import { Button, DialogProps } from '@mui/material';
-import Dialog from '@mui/material/Dialog';
-import { useTranslation } from 'react-i18next';
-import { Log } from '$app/utils/log';
-
-interface Props extends DialogProps {
- open: boolean;
- title: string;
- subtitle?: string;
- onOk?: () => Promise<void>;
- onClose: () => void;
- onCancel?: () => void;
- okText?: string;
- cancelText?: string;
- container?: HTMLElement | null;
-}
-
-function DeleteConfirmDialog({ open, title, onOk, onCancel, onClose, okText, cancelText, container, ...props }: Props) {
- const { t } = useTranslation();
-
- const onDone = useCallback(async () => {
- try {
- await onOk?.();
- onClose();
- } catch (e) {
- Log.error(e);
- }
- }, [onClose, onOk]);
-
- return (
- <Dialog
- container={container}
- keepMounted={false}
- onKeyDown={(e) => {
- if (e.key === 'Escape') {
- e.preventDefault();
- e.stopPropagation();
- onClose();
- }
-
- if (e.key === 'Enter') {
- e.preventDefault();
- e.stopPropagation();
- void onDone();
- }
- }}
- onMouseDown={(e) => e.stopPropagation()}
- open={open}
- onClose={onClose}
- {...props}
- >
- <DialogContent className={'w-[320px]'}>
- {title}
- <div className={'flex w-full flex-col gap-2 pb-2 pt-4'}>
- <Button className={'w-full'} variant={'outlined'} color={'error'} onClick={onDone}>
- {okText ?? t('button.delete')}
- </Button>
- <Button
- className={'w-full'}
- variant={'outlined'}
- color={'inherit'}
- onClick={() => {
- onCancel?.();
- onClose();
- }}
- >
- {cancelText ?? t('button.cancel')}
- </Button>
- </div>
- </DialogContent>
- </Dialog>
- );
-}
-
-export default DeleteConfirmDialog;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/confirm_dialog/RenameDialog.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/_shared/confirm_dialog/RenameDialog.tsx
deleted file mode 100644
index cb8b7a80ed..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/confirm_dialog/RenameDialog.tsx
+++ /dev/null
@@ -1,81 +0,0 @@
-import React, { useCallback, useEffect, useState } from 'react';
-import DialogTitle from '@mui/material/DialogTitle';
-import DialogContent from '@mui/material/DialogContent';
-import Dialog from '@mui/material/Dialog';
-import { useTranslation } from 'react-i18next';
-import TextField from '@mui/material/TextField';
-import { Button, DialogActions, Divider } from '@mui/material';
-
-function RenameDialog({
- defaultValue,
- open,
- onClose,
- onOk,
-}: {
- defaultValue: string;
- open: boolean;
- onClose: () => void;
- onOk: (val: string) => Promise<void>;
-}) {
- const { t } = useTranslation();
- const [value, setValue] = useState(defaultValue);
- const [error, setError] = useState(false);
-
- useEffect(() => {
- setValue(defaultValue);
- setError(false);
- }, [defaultValue]);
-
- const onDone = useCallback(async () => {
- try {
- await onOk(value);
- onClose();
- } catch (e) {
- setError(true);
- }
- }, [onClose, onOk, value]);
-
- return (
- <Dialog keepMounted={false} onMouseDown={(e) => e.stopPropagation()} open={open} onClose={onClose}>
- <DialogTitle className={'pb-2'}>{t('menuAppHeader.renameDialog')}</DialogTitle>
- <DialogContent className={'flex'}>
- <TextField
- error={error}
- autoFocus
- spellCheck={false}
- value={value}
- placeholder={t('dialogCreatePageNameHint')}
- onKeyDown={(e) => {
- e.stopPropagation();
- if (e.key === 'Enter') {
- e.preventDefault();
- void onDone();
- }
-
- if (e.key === 'Escape') {
- e.preventDefault();
- onClose();
- }
- }}
- onChange={(e) => {
- setValue(e.target.value);
- }}
- margin='dense'
- fullWidth
- variant='standard'
- />
- </DialogContent>
- <Divider className={'mb-1'} />
- <DialogActions className={'mb-1 px-4'}>
- <Button color={'inherit'} variant={'outlined'} onClick={onClose}>
- {t('button.cancel')}
- </Button>
- <Button variant={'contained'} onClick={onDone}>
- {t('button.ok')}
- </Button>
- </DialogActions>
- </Dialog>
- );
-}
-
-export default RenameDialog;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/devtool/AppFlowyDevTool.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/_shared/devtool/AppFlowyDevTool.tsx
deleted file mode 100644
index 5d3ed1e3de..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/devtool/AppFlowyDevTool.tsx
+++ /dev/null
@@ -1,61 +0,0 @@
-import * as React from 'react';
-import SpeedDial from '@mui/material/SpeedDial';
-import SpeedDialIcon from '@mui/material/SpeedDialIcon';
-import SpeedDialAction from '@mui/material/SpeedDialAction';
-import { useMemo } from 'react';
-import { CloseOutlined, BuildOutlined, LoginOutlined, VisibilityOff } from '@mui/icons-material';
-import ManualSignInDialog from '$app/components/_shared/devtool/ManualSignInDialog';
-import { Portal } from '@mui/material';
-
-function AppFlowyDevTool() {
- const [openManualSignIn, setOpenManualSignIn] = React.useState(false);
- const [hidden, setHidden] = React.useState(false);
- const actions = useMemo(
- () => [
- {
- icon: <LoginOutlined />,
- name: 'Manual SignIn',
- onClick: () => {
- setOpenManualSignIn(true);
- },
- },
- {
- icon: <VisibilityOff />,
- name: 'Hide Dev Tool',
- onClick: () => {
- setHidden(true);
- },
- },
- ],
- []
- );
-
- return (
- <Portal>
- <SpeedDial
- hidden={hidden}
- direction={'left'}
- draggable={true}
- title={'AppFlowy Dev Tool'}
- ariaLabel='SpeedDial basic example'
- sx={{ position: 'absolute', zIndex: 1500, top: 64, right: 16 }}
- icon={<SpeedDialIcon className={'text-content-on-fill'} openIcon={<CloseOutlined />} icon={<BuildOutlined />} />}
- >
- {actions.map((action) => (
- <SpeedDialAction onClick={action.onClick} key={action.name} icon={action.icon} tooltipTitle={action.name} />
- ))}
-
- {openManualSignIn && (
- <ManualSignInDialog
- open={openManualSignIn}
- onClose={() => {
- setOpenManualSignIn(false);
- }}
- />
- )}
- </SpeedDial>
- </Portal>
- );
-}
-
-export default AppFlowyDevTool;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/devtool/ManualSignInDialog.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/_shared/devtool/ManualSignInDialog.tsx
deleted file mode 100644
index 364b334a07..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/devtool/ManualSignInDialog.tsx
+++ /dev/null
@@ -1,114 +0,0 @@
-import React from 'react';
-import { CircularProgress, DialogActions, DialogProps, Tab, Tabs, TextareaAutosize } from '@mui/material';
-import Dialog from '@mui/material/Dialog';
-import DialogContent from '@mui/material/DialogContent';
-import Button from '@mui/material/Button';
-import { useAuth } from '$app/components/auth/auth.hooks';
-import TextField from '@mui/material/TextField';
-
-function ManualSignInDialog(props: DialogProps) {
- const [uri, setUri] = React.useState('');
- const [loading, setLoading] = React.useState(false);
- const { signInWithOAuth, signInWithEmailPassword } = useAuth();
- const [tab, setTab] = React.useState(0);
- const [email, setEmail] = React.useState('');
- const [password, setPassword] = React.useState('');
- const [domain, setDomain] = React.useState('');
- const handleSignIn = async () => {
- setLoading(true);
- try {
- if (tab === 1) {
- if (!email || !password) return;
- await signInWithEmailPassword(email, password, domain);
- } else {
- await signInWithOAuth(uri);
- }
- } finally {
- setLoading(false);
- }
-
- props?.onClose?.({}, 'backdropClick');
- };
-
- return (
- <Dialog
- {...props}
- sx={{
- zIndex: 1500,
- }}
- onKeyDown={(e) => {
- if (e.key === 'Enter') {
- e.preventDefault();
- void handleSignIn();
- }
- }}
- >
- <DialogContent className={'pt-3'}>
- <Tabs
- className={'mb-4'}
- defaultValue={0}
- value={tab}
- onChange={(_, value) => {
- setTab(value);
- }}
- >
- <Tab value={0} label={'OAuth URI'} />
- <Tab value={1} label={'Email & Password'} />
- </Tabs>
- {tab === 1 ? (
- <div className={'flex flex-col gap-3'}>
- <TextField
- label={'Email'}
- size={'small'}
- required={true}
- placeholder={'[email protected]'}
- type={'email'}
- onChange={(e) => setEmail(e.target.value)}
- />
- <TextField
- size={'small'}
- required={true}
- label={'Password'}
- placeholder={'Password'}
- type={'password'}
- onChange={(e) => setPassword(e.target.value)}
- />
- <TextField
- size={'small'}
- label={'Domain(Optional)'}
- placeholder={'test.appflowy.cloud'}
- onChange={(e) => setDomain(e.target.value)}
- />
- </div>
- ) : (
- <TextareaAutosize
- value={uri}
- autoFocus
- className={'max-h-[300px] w-[400px] overflow-hidden rounded-md border border-line-border p-2 text-xs'}
- placeholder={'Paste the OAuth URI here'}
- minRows={3}
- spellCheck={false}
- onChange={(e) => {
- setUri(e.target.value);
- }}
- />
- )}
- </DialogContent>
- <DialogActions className={'mb-4 w-full px-6'}>
- <Button
- size={'small'}
- variant={'outlined'}
- color={'inherit'}
- onClick={() => props?.onClose?.({}, 'backdropClick')}
- >
- Cancel
- </Button>
- <Button disabled={loading} size={'small'} className={'w-auto'} variant={'outlined'} onClick={handleSignIn}>
- {loading ? <CircularProgress size={14} /> : 'Sign In'}
- </Button>
- </DialogActions>
- </Dialog>
- );
-}
-
-export default ManualSignInDialog;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/drag_block/drag.hooks.ts b/frontend/appflowy_tauri/src/appflowy_app/components/_shared/drag_block/drag.hooks.ts
deleted file mode 100644
index 85f0507fff..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/drag_block/drag.hooks.ts
+++ /dev/null
@@ -1,87 +0,0 @@
-import React from 'react';
-
-interface Props {
- dragId?: string;
- onEnd?: (result: { dragId: string; position: 'before' | 'after' | 'inside' }) => void;
-}
-
-function calcPosition(targetRect: DOMRect, clientY: number) {
- const top = targetRect.top + targetRect.height / 3;
- const bottom = targetRect.bottom - targetRect.height / 3;
-
- if (clientY < top) return 'before';
- if (clientY > bottom) return 'after';
- return 'inside';
-}
-
-export function useDrag(props: Props) {
- const { dragId, onEnd } = props;
- const [isDraggingOver, setIsDraggingOver] = React.useState(false);
- const [isDragging, setIsDragging] = React.useState(false);
- const [dropPosition, setDropPosition] = React.useState<'before' | 'after' | 'inside'>();
- const onDrop = (e: React.DragEvent<HTMLDivElement>) => {
- e.stopPropagation();
- setIsDraggingOver(false);
- setIsDragging(false);
- setDropPosition(undefined);
- const currentTarget = e.currentTarget;
-
- if (currentTarget.parentElement?.closest(`[data-drop-enabled="false"]`)) return;
- if (currentTarget.closest(`[data-dragging="true"]`)) return;
- const dragId = e.dataTransfer.getData('dragId');
- const targetRect = currentTarget.getBoundingClientRect();
- const { clientY } = e;
-
- const position = calcPosition(targetRect, clientY);
-
- onEnd && onEnd({ dragId, position });
- };
-
- const onDragOver = (e: React.DragEvent<HTMLDivElement>) => {
- e.stopPropagation();
- e.preventDefault();
- if (isDragging) return;
- const currentTarget = e.currentTarget;
-
- if (currentTarget.parentElement?.closest(`[data-drop-enabled="false"]`)) return;
- if (currentTarget.closest(`[data-dragging="true"]`)) return;
- setIsDraggingOver(true);
- const targetRect = currentTarget.getBoundingClientRect();
- const { clientY } = e;
- const position = calcPosition(targetRect, clientY);
-
- setDropPosition(position);
- };
-
- const onDragLeave = (e: React.DragEvent<HTMLDivElement>) => {
- e.stopPropagation();
- setIsDraggingOver(false);
- setDropPosition(undefined);
- };
-
- const onDragStart = (e: React.DragEvent<HTMLDivElement>) => {
- if (!dragId) return;
- e.stopPropagation();
- e.dataTransfer.setData('dragId', dragId);
- e.dataTransfer.effectAllowed = 'move';
- setIsDragging(true);
- };
-
- const onDragEnd = (e: React.DragEvent<HTMLDivElement>) => {
- e.stopPropagation();
- setIsDragging(false);
- setIsDraggingOver(false);
- setDropPosition(undefined);
- };
-
- return {
- onDrop,
- onDragOver,
- onDragLeave,
- onDragStart,
- isDraggingOver,
- isDragging,
- onDragEnd,
- dropPosition,
- };
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/drag_block/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/_shared/drag_block/index.ts
deleted file mode 100644
index e0cb540f75..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/drag_block/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './drag.hooks';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/emoji_picker/EmojiPicker.hooks.ts b/frontend/appflowy_tauri/src/appflowy_app/components/_shared/emoji_picker/EmojiPicker.hooks.ts
deleted file mode 100644
index af82c82df5..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/emoji_picker/EmojiPicker.hooks.ts
+++ /dev/null
@@ -1,165 +0,0 @@
-import React, { useCallback, useEffect, useState } from 'react';
-import emojiData, { EmojiMartData } from '@emoji-mart/data';
-import { init, FrequentlyUsed, getEmojiDataFromNative, Store } from 'emoji-mart';
-
-import { PopoverProps } from '@mui/material/Popover';
-import { PopoverOrigin } from '@mui/material/Popover/Popover';
-import chunk from 'lodash-es/chunk';
-
-export const EMOJI_SIZE = 32;
-
-export const PER_ROW_EMOJI_COUNT = 13;
-
-export const MAX_FREQUENTLY_ROW_COUNT = 2;
-
-export interface EmojiCategory {
- id: string;
- emojis: Emoji[];
-}
-
-interface Emoji {
- id: string;
- name: string;
- native: string;
-}
-
-export function useLoadEmojiData({ onEmojiSelect }: { onEmojiSelect: (emoji: string) => void }) {
- const [searchValue, setSearchValue] = useState('');
- const [emojiCategories, setEmojiCategories] = useState<EmojiCategory[]>([]);
- const [skin, setSkin] = useState<number>(() => {
- return Number(Store.get('skin')) || 0;
- });
-
- const onSkinChange = useCallback((val: number) => {
- setSkin(val);
- Store.set('skin', String(val));
- }, []);
-
- const loadEmojiData = useCallback(
- async (searchVal?: string) => {
- const { emojis, categories } = emojiData as EmojiMartData;
-
- const filteredCategories = categories
- .map((category) => {
- const { id, emojis: categoryEmojis } = category;
-
- return {
- id,
- emojis: categoryEmojis
- .filter((emojiId) => {
- const emoji = emojis[emojiId];
-
- if (!searchVal) return true;
- return filterSearchValue(emoji, searchVal);
- })
- .map((emojiId) => {
- const emoji = emojis[emojiId];
- const { name, skins } = emoji;
-
- return {
- id: emojiId,
- name,
- native: skins[skin] ? skins[skin].native : skins[0].native,
- };
- }),
- };
- })
- .filter((category) => category.emojis.length > 0);
-
- setEmojiCategories(filteredCategories);
- },
- [skin]
- );
-
- useEffect(() => {
- void (async () => {
- await init({ data: emojiData, maxFrequentRows: MAX_FREQUENTLY_ROW_COUNT, perLine: PER_ROW_EMOJI_COUNT });
- await loadEmojiData();
- })();
- }, [loadEmojiData]);
-
- useEffect(() => {
- void loadEmojiData(searchValue);
- }, [loadEmojiData, searchValue]);
-
- const onSelect = useCallback(
- async (native: string) => {
- onEmojiSelect(native);
- if (!native) {
- return;
- }
-
- const data = await getEmojiDataFromNative(native);
-
- FrequentlyUsed.add(data);
- },
- [onEmojiSelect]
- );
-
- return {
- emojiCategories,
- setSearchValue,
- searchValue,
- onSelect,
- onSkinChange,
- skin,
- };
-}
-
-export function useSelectSkinPopoverProps(): PopoverProps & {
- onOpen: (event: React.MouseEvent<HTMLButtonElement>) => void;
- onClose: () => void;
-} {
- const [anchorEl, setAnchorEl] = useState<HTMLButtonElement | undefined>(undefined);
- const onOpen = useCallback((event: React.MouseEvent<HTMLButtonElement>) => {
- setAnchorEl(event.currentTarget);
- }, []);
- const onClose = useCallback(() => {
- setAnchorEl(undefined);
- }, []);
- const open = Boolean(anchorEl);
- const anchorOrigin = { vertical: 'bottom', horizontal: 'center' } as PopoverOrigin;
- const transformOrigin = { vertical: 'top', horizontal: 'center' } as PopoverOrigin;
-
- return {
- anchorEl,
- onOpen,
- onClose,
- open,
- anchorOrigin,
- transformOrigin,
- };
-}
-
-function filterSearchValue(emoji: emojiData.Emoji, searchValue: string) {
- const { name, keywords } = emoji;
- const searchValueLowerCase = searchValue.toLowerCase();
-
- return (
- name.toLowerCase().includes(searchValueLowerCase) ||
- (keywords && keywords.some((keyword) => keyword.toLowerCase().includes(searchValueLowerCase)))
- );
-}
-
-export function getRowsWithCategories(emojiCategories: EmojiCategory[], rowSize: number) {
- const rows: {
- id: string;
- type: 'category' | 'emojis';
- emojis?: Emoji[];
- }[] = [];
-
- emojiCategories.forEach((category) => {
- rows.push({
- id: category.id,
- type: 'category',
- });
- chunk(category.emojis, rowSize).forEach((chunk, index) => {
- rows.push({
- type: 'emojis',
- emojis: chunk,
- id: `${category.id}-${index}`,
- });
- });
- });
- return rows;
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/emoji_picker/EmojiPicker.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/_shared/emoji_picker/EmojiPicker.tsx
deleted file mode 100644
index b8dcb3f6c7..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/emoji_picker/EmojiPicker.tsx
+++ /dev/null
@@ -1,35 +0,0 @@
-import React from 'react';
-
-import { useLoadEmojiData } from './EmojiPicker.hooks';
-import EmojiPickerHeader from './EmojiPickerHeader';
-import EmojiPickerCategories from './EmojiPickerCategories';
-
-interface Props {
- onEmojiSelect: (emoji: string) => void;
- onEscape?: () => void;
- defaultEmoji?: string;
-}
-
-function EmojiPicker({ defaultEmoji, onEscape, ...props }: Props) {
- const { skin, onSkinChange, emojiCategories, setSearchValue, searchValue, onSelect } = useLoadEmojiData(props);
-
- return (
- <div tabIndex={0} className={'emoji-picker flex h-[360px] max-h-[70vh] flex-col p-4 pt-2'}>
- <EmojiPickerHeader
- onEmojiSelect={onSelect}
- skin={skin}
- onSkinSelect={onSkinChange}
- searchValue={searchValue}
- onSearchChange={setSearchValue}
- />
- <EmojiPickerCategories
- defaultEmoji={defaultEmoji}
- onEscape={onEscape}
- onEmojiSelect={onSelect}
- emojiCategories={emojiCategories}
- />
- </div>
- );
-}
-
-export default EmojiPicker;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/emoji_picker/EmojiPickerCategories.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/_shared/emoji_picker/EmojiPickerCategories.tsx
deleted file mode 100644
index eefea8db11..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/emoji_picker/EmojiPickerCategories.tsx
+++ /dev/null
@@ -1,354 +0,0 @@
-import React, { useCallback, useEffect, useMemo, useRef } from 'react';
-import {
- EMOJI_SIZE,
- EmojiCategory,
- getRowsWithCategories,
- PER_ROW_EMOJI_COUNT,
-} from '$app/components/_shared/emoji_picker/EmojiPicker.hooks';
-import { FixedSizeList } from 'react-window';
-import { useTranslation } from 'react-i18next';
-import AutoSizer from 'react-virtualized-auto-sizer';
-import { getDistanceEdge, inView } from '$app/components/_shared/keyboard_navigation/utils';
-
-function EmojiPickerCategories({
- emojiCategories,
- onEmojiSelect,
- onEscape,
- defaultEmoji,
-}: {
- emojiCategories: EmojiCategory[];
- onEmojiSelect: (emoji: string) => void;
- onEscape?: () => void;
- defaultEmoji?: string;
-}) {
- const scrollRef = React.useRef<HTMLDivElement>(null);
- const { t } = useTranslation();
- const [selectCell, setSelectCell] = React.useState({
- row: 1,
- column: 0,
- });
- const rows = useMemo(() => {
- return getRowsWithCategories(emojiCategories, PER_ROW_EMOJI_COUNT);
- }, [emojiCategories]);
- const mouseY = useRef<number | null>(null);
- const mouseX = useRef<number | null>(null);
-
- const ref = React.useRef<HTMLDivElement>(null);
-
- const getCategoryName = useCallback(
- (id: string) => {
- const i18nName: Record<string, string> = {
- frequent: t('emoji.categories.frequentlyUsed'),
- people: t('emoji.categories.people'),
- nature: t('emoji.categories.nature'),
- foods: t('emoji.categories.food'),
- activity: t('emoji.categories.activities'),
- places: t('emoji.categories.places'),
- objects: t('emoji.categories.objects'),
- symbols: t('emoji.categories.symbols'),
- flags: t('emoji.categories.flags'),
- };
-
- return i18nName[id];
- },
- [t]
- );
-
- useEffect(() => {
- scrollRef.current?.scrollTo({
- top: 0,
- });
-
- setSelectCell({
- row: 1,
- column: 0,
- });
- // eslint-disable-next-line react-hooks/exhaustive-deps
- }, [rows]);
-
- const renderRow = useCallback(
- ({ index, style }: { index: number; style: React.CSSProperties }) => {
- const item = rows[index];
-
- return (
- <div style={style} data-index={index}>
- {item.type === 'category' ? (
- <div className={'pt-2 text-xs font-medium text-text-caption'}>{getCategoryName(item.id)}</div>
- ) : null}
- <div className={'flex'}>
- {item.emojis?.map((emoji, columnIndex) => {
- const isSelected = selectCell.row === index && selectCell.column === columnIndex;
-
- const isDefaultEmoji = defaultEmoji === emoji.native;
-
- return (
- <div
- key={emoji.id}
- data-key={emoji.id}
- style={{
- width: EMOJI_SIZE,
- height: EMOJI_SIZE,
- }}
- onClick={() => {
- onEmojiSelect(emoji.native);
- }}
- onMouseMove={(e) => {
- mouseY.current = e.clientY;
- mouseX.current = e.clientX;
- }}
- onMouseEnter={(e) => {
- if (mouseY.current === null || mouseY.current !== e.clientY || mouseX.current !== e.clientX) {
- setSelectCell({
- row: index,
- column: columnIndex,
- });
- }
-
- mouseX.current = e.clientX;
- mouseY.current = e.clientY;
- }}
- className={`flex cursor-pointer items-center justify-center rounded hover:bg-fill-list-hover ${
- isSelected ? 'bg-fill-list-hover' : 'hover:bg-transparent'
- } ${isDefaultEmoji ? 'bg-fill-list-active' : ''}`}
- >
- {emoji.native}
- </div>
- );
- })}
- </div>
- </div>
- );
- },
- [defaultEmoji, getCategoryName, onEmojiSelect, rows, selectCell.column, selectCell.row]
- );
-
- const getNewColumnIndex = useCallback(
- (rowIndex: number, columnIndex: number): number => {
- const row = rows[rowIndex];
- const length = row.emojis?.length;
- let newColumnIndex = columnIndex;
-
- if (length && length <= columnIndex) {
- newColumnIndex = length - 1 || 0;
- }
-
- return newColumnIndex;
- },
- [rows]
- );
-
- const findNextRow = useCallback(
- (rowIndex: number, columnIndex: number): { row: number; column: number } => {
- const rowLength = rows.length;
- let nextRowIndex = rowIndex + 1;
-
- if (nextRowIndex >= rowLength - 1) {
- nextRowIndex = rowLength - 1;
- } else if (rows[nextRowIndex].type === 'category') {
- nextRowIndex = findNextRow(nextRowIndex, columnIndex).row;
- }
-
- const newColumnIndex = getNewColumnIndex(nextRowIndex, columnIndex);
-
- return {
- row: nextRowIndex,
- column: newColumnIndex,
- };
- },
- [getNewColumnIndex, rows]
- );
-
- const findPrevRow = useCallback(
- (rowIndex: number, columnIndex: number): { row: number; column: number } => {
- let prevRowIndex = rowIndex - 1;
-
- if (prevRowIndex < 1) {
- prevRowIndex = 1;
- } else if (rows[prevRowIndex].type === 'category') {
- prevRowIndex = findPrevRow(prevRowIndex, columnIndex).row;
- }
-
- const newColumnIndex = getNewColumnIndex(prevRowIndex, columnIndex);
-
- return {
- row: prevRowIndex,
- column: newColumnIndex,
- };
- },
- [getNewColumnIndex, rows]
- );
-
- const findPrevCell = useCallback(
- (row: number, column: number): { row: number; column: number } => {
- const prevColumn = column - 1;
-
- if (prevColumn < 0) {
- const prevRow = findPrevRow(row, column).row;
-
- if (prevRow === row) return { row, column };
- const length = rows[prevRow].emojis?.length || 0;
-
- return {
- row: prevRow,
- column: length > 0 ? length - 1 : 0,
- };
- }
-
- return {
- row,
- column: prevColumn,
- };
- },
- [findPrevRow, rows]
- );
-
- const findNextCell = useCallback(
- (row: number, column: number): { row: number; column: number } => {
- const nextColumn = column + 1;
-
- const rowLength = rows[row].emojis?.length || 0;
-
- if (nextColumn >= rowLength) {
- const nextRow = findNextRow(row, column).row;
-
- if (nextRow === row) return { row, column };
- return {
- row: nextRow,
- column: 0,
- };
- }
-
- return {
- row,
- column: nextColumn,
- };
- },
- [findNextRow, rows]
- );
-
- useEffect(() => {
- if (!selectCell || !scrollRef.current) return;
- const emojiKey = rows[selectCell.row]?.emojis?.[selectCell.column]?.id;
- const emojiDom = document.querySelector(`[data-key="${emojiKey}"]`);
-
- if (emojiDom && !inView(emojiDom as HTMLElement, scrollRef.current as HTMLElement)) {
- const distance = getDistanceEdge(emojiDom as HTMLElement, scrollRef.current as HTMLElement);
-
- scrollRef.current?.scrollTo({
- top: scrollRef.current?.scrollTop + distance,
- });
- }
- }, [selectCell, rows]);
-
- const handleKeyDown = useCallback(
- (e: KeyboardEvent) => {
- e.stopPropagation();
-
- switch (e.key) {
- case 'Escape':
- e.preventDefault();
- onEscape?.();
- break;
- case 'ArrowUp': {
- e.preventDefault();
-
- setSelectCell(findPrevRow(selectCell.row, selectCell.column));
-
- break;
- }
-
- case 'ArrowDown': {
- e.preventDefault();
-
- setSelectCell(findNextRow(selectCell.row, selectCell.column));
-
- break;
- }
-
- case 'ArrowLeft': {
- e.preventDefault();
-
- const prevCell = findPrevCell(selectCell.row, selectCell.column);
-
- setSelectCell(prevCell);
- break;
- }
-
- case 'ArrowRight': {
- e.preventDefault();
-
- const nextCell = findNextCell(selectCell.row, selectCell.column);
-
- setSelectCell(nextCell);
- break;
- }
-
- case 'Enter': {
- e.preventDefault();
- const currentRow = rows[selectCell.row];
- const emoji = currentRow.emojis?.[selectCell.column];
-
- if (emoji) {
- onEmojiSelect(emoji.native);
- }
-
- break;
- }
-
- default:
- break;
- }
- },
- [
- findNextCell,
- findPrevCell,
- findPrevRow,
- findNextRow,
- onEmojiSelect,
- onEscape,
- rows,
- selectCell.column,
- selectCell.row,
- ]
- );
-
- useEffect(() => {
- const focusElement = document.querySelector('.emoji-picker .search-emoji-input') as HTMLInputElement;
-
- const parentElement = ref.current?.parentElement;
-
- focusElement?.addEventListener('keydown', handleKeyDown);
- parentElement?.addEventListener('keydown', handleKeyDown);
- return () => {
- focusElement?.removeEventListener('keydown', handleKeyDown);
- parentElement?.removeEventListener('keydown', handleKeyDown);
- };
- }, [handleKeyDown]);
-
- return (
- <div
- ref={ref}
- className={`mt-2 w-[${
- EMOJI_SIZE * PER_ROW_EMOJI_COUNT
- }px] flex-1 transform items-center justify-center overflow-y-auto overflow-x-hidden`}
- >
- <AutoSizer>
- {({ height, width }: { height: number; width: number }) => (
- <FixedSizeList
- overscanCount={10}
- height={height}
- width={width}
- outerRef={scrollRef}
- itemCount={rows.length}
- itemSize={EMOJI_SIZE}
- itemData={rows}
- >
- {renderRow}
- </FixedSizeList>
- )}
- </AutoSizer>
- </div>
- );
-}
-
-export default EmojiPickerCategories;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/emoji_picker/EmojiPickerHeader.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/_shared/emoji_picker/EmojiPickerHeader.tsx
deleted file mode 100644
index 177ac2e7a0..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/emoji_picker/EmojiPickerHeader.tsx
+++ /dev/null
@@ -1,134 +0,0 @@
-import React from 'react';
-import { Box, IconButton } from '@mui/material';
-import { Circle, DeleteOutlineRounded, SearchOutlined } from '@mui/icons-material';
-import TextField from '@mui/material/TextField';
-import Tooltip from '@mui/material/Tooltip';
-import { randomEmoji } from '$app/utils/emoji';
-import ShuffleIcon from '@mui/icons-material/Shuffle';
-import Popover from '@mui/material/Popover';
-import { useSelectSkinPopoverProps } from '$app/components/_shared/emoji_picker/EmojiPicker.hooks';
-import { useTranslation } from 'react-i18next';
-
-const skinTones = [
- {
- value: 0,
- color: '#ffc93a',
- },
- {
- color: '#ffdab7',
- value: 1,
- },
- {
- color: '#e7b98f',
- value: 2,
- },
- {
- color: '#c88c61',
- value: 3,
- },
- {
- color: '#a46134',
- value: 4,
- },
- {
- color: '#5d4437',
- value: 5,
- },
-];
-
-interface Props {
- onEmojiSelect: (emoji: string) => void;
- skin: number;
- onSkinSelect: (skin: number) => void;
- searchValue: string;
- onSearchChange: (value: string) => void;
-}
-
-function EmojiPickerHeader({ onEmojiSelect, onSkinSelect, searchValue, onSearchChange, skin }: Props) {
- const { onOpen, ...popoverProps } = useSelectSkinPopoverProps();
- const { t } = useTranslation();
-
- return (
- <div className={'px-0.5 py-2'}>
- <div className={'search-input flex items-end'}>
- <Box sx={{ display: 'flex', alignItems: 'flex-end', marginRight: 2 }}>
- <SearchOutlined sx={{ color: 'action.active', mr: 1, my: 0.5 }} />
- <TextField
- value={searchValue}
- onChange={(e) => {
- onSearchChange(e.target.value);
- }}
- autoFocus={true}
- autoCorrect={'off'}
- autoComplete={'off'}
- spellCheck={false}
- className={'search-emoji-input'}
- placeholder={t('search.label')}
- variant='standard'
- />
- </Box>
- <Tooltip title={t('emoji.random')}>
- <div className={'random-emoji-btn mr-2 rounded border border-line-divider'}>
- <IconButton
- onClick={() => {
- const emoji = randomEmoji();
-
- onEmojiSelect(emoji);
- }}
- >
- <ShuffleIcon />
- </IconButton>
- </div>
- </Tooltip>
- <Tooltip title={t('emoji.selectSkinTone')}>
- <div className={'random-emoji-btn mr-2 rounded border border-line-divider'}>
- <IconButton size={'small'} className={'h-[25px] w-[25px]'} onClick={onOpen}>
- <Circle
- style={{
- fill: skinTones[skin].color,
- }}
- />
- </IconButton>
- </div>
- </Tooltip>
- <Tooltip title={t('emoji.remove')}>
- <div className={'random-emoji-btn rounded border border-line-divider'}>
- <IconButton
- onClick={() => {
- onEmojiSelect('');
- }}
- >
- <DeleteOutlineRounded />
- </IconButton>
- </div>
- </Tooltip>
- </div>
- <Popover {...popoverProps}>
- <div className={'flex items-center p-2'}>
- {skinTones.map((skinTone) => (
- <div className={'mx-0.5'} key={skinTone.value}>
- <IconButton
- style={{
- backgroundColor: skinTone.value === skin ? 'var(--fill-list-hover)' : undefined,
- }}
- size={'small'}
- onClick={() => {
- onSkinSelect(skinTone.value);
- popoverProps.onClose?.();
- }}
- >
- <Circle
- style={{
- fill: skinTone.color,
- }}
- />
- </IconButton>
- </div>
- ))}
- </div>
- </Popover>
- </div>
- );
-}
-
-export default EmojiPickerHeader;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/error_boundary/withError.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/_shared/error_boundary/withError.tsx
deleted file mode 100644
index 9b9ba159fb..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/error_boundary/withError.tsx
+++ /dev/null
@@ -1,16 +0,0 @@
-import { ErrorBoundary } from 'react-error-boundary';
-import { Log } from '$app/utils/log';
-import { Alert } from '@mui/material';
-
-export default function withErrorBoundary<T extends object>(WrappedComponent: React.ComponentType<T>) {
- return (props: T) => (
- <ErrorBoundary
- onError={(e) => {
- Log.error(e);
- }}
- fallback={<Alert color={'error'}>Something went wrong</Alert>}
- >
- <WrappedComponent {...props} />
- </ErrorBoundary>
- );
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/image_upload/EmbedLink.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/_shared/image_upload/EmbedLink.tsx
deleted file mode 100644
index 34a99007ad..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/image_upload/EmbedLink.tsx
+++ /dev/null
@@ -1,70 +0,0 @@
-import React, { useCallback, useState } from 'react';
-import TextField from '@mui/material/TextField';
-import { useTranslation } from 'react-i18next';
-import Button from '@mui/material/Button';
-
-const urlPattern = /^(https?:\/\/)([^\s(["<,>/]*)(\/)[^\s[",><]*(.png|.jpg|.gif|.webm|.webp|.svg)(\?[^\s[",><]*)?$/;
-
-export function EmbedLink({
- onDone,
- onEscape,
- defaultLink,
-}: {
- defaultLink?: string;
- onDone?: (value: string) => void;
- onEscape?: () => void;
-}) {
- const { t } = useTranslation();
-
- const [value, setValue] = useState(defaultLink ?? '');
- const [error, setError] = useState(false);
-
- const handleChange = useCallback(
- (e: React.ChangeEvent<HTMLInputElement>) => {
- const value = e.target.value;
-
- setValue(value);
- setError(!urlPattern.test(value));
- },
- [setValue, setError]
- );
-
- const handleKeyDown = useCallback(
- (e: React.KeyboardEvent) => {
- if (e.key === 'Enter' && !error && value) {
- e.preventDefault();
- e.stopPropagation();
- onDone?.(value);
- }
-
- if (e.key === 'Escape') {
- e.preventDefault();
- e.stopPropagation();
- onEscape?.();
- }
- },
- [error, onDone, onEscape, value]
- );
-
- return (
- <div tabIndex={0} onKeyDown={handleKeyDown} className={'flex flex-col items-center gap-4 px-4 pb-4'}>
- <TextField
- error={error}
- autoFocus
- onKeyDown={handleKeyDown}
- size={'small'}
- spellCheck={false}
- onChange={handleChange}
- helperText={error ? t('editor.incorrectLink') : ''}
- value={value}
- placeholder={t('document.imageBlock.embedLink.placeholder')}
- fullWidth
- />
- <Button variant={'contained'} className={'w-3/5'} onClick={() => onDone?.(value)} disabled={error || !value}>
- {t('document.imageBlock.embedLink.label')}
- </Button>
- </div>
- );
-}
-
-export default EmbedLink;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/image_upload/LocalImage.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/_shared/image_upload/LocalImage.tsx
deleted file mode 100644
index d94e5f2889..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/image_upload/LocalImage.tsx
+++ /dev/null
@@ -1,62 +0,0 @@
-import React, { forwardRef, useCallback, useEffect, useRef, useState } from 'react';
-import { CircularProgress } from '@mui/material';
-import { useTranslation } from 'react-i18next';
-import { ErrorOutline } from '@mui/icons-material';
-
-export const LocalImage = forwardRef<
- HTMLImageElement,
- {
- renderErrorNode?: () => React.ReactElement | null;
- } & React.ImgHTMLAttributes<HTMLImageElement>
->((localImageProps, ref) => {
- const { src, renderErrorNode, ...props } = localImageProps;
- const imageRef = useRef<HTMLImageElement>(null);
- const { t } = useTranslation();
- const [imageURL, setImageURL] = useState<string>('');
- const [loading, setLoading] = useState<boolean>(true);
- const [isError, setIsError] = useState<boolean>(false);
- const loadLocalImage = useCallback(async () => {
- if (!src) return;
- setLoading(true);
- setIsError(false);
- const { readBinaryFile, BaseDirectory } = await import('@tauri-apps/api/fs');
-
- try {
- const svg = src.endsWith('.svg');
-
- const buffer = await readBinaryFile(src, { dir: BaseDirectory.AppLocalData });
- const blob = new Blob([buffer], { type: svg ? 'image/svg+xml' : 'image' });
-
- setImageURL(URL.createObjectURL(blob));
- } catch (e) {
- setIsError(true);
- }
-
- setLoading(false);
- }, [src]);
-
- useEffect(() => {
- void loadLocalImage();
- }, [loadLocalImage]);
-
- if (loading) {
- return (
- <div className={`flex h-full w-full items-center justify-center gap-2`}>
- <CircularProgress size={16} />
- {t('editor.loading')}...
- </div>
- );
- }
-
- if (isError) {
- if (renderErrorNode) return renderErrorNode();
- return (
- <div className={'flex h-full w-full items-center justify-center gap-2 bg-red-50'}>
- <ErrorOutline className={'text-function-error'} />
- <div className={'text-function-error'}>{t('editor.imageLoadFailed')}</div>
- </div>
- );
- }
-
- return <img ref={ref ?? imageRef} draggable={false} loading={'lazy'} alt={'local image'} {...props} src={imageURL} />;
-});
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/image_upload/Unsplash.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/_shared/image_upload/Unsplash.tsx
deleted file mode 100644
index 01da8323b9..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/image_upload/Unsplash.tsx
+++ /dev/null
@@ -1,154 +0,0 @@
-import React, { useCallback, useEffect, useMemo, useState } from 'react';
-import { createApi } from 'unsplash-js';
-import TextField from '@mui/material/TextField';
-import { useTranslation } from 'react-i18next';
-import Typography from '@mui/material/Typography';
-import debounce from 'lodash-es/debounce';
-import { CircularProgress } from '@mui/material';
-import { open } from '@tauri-apps/api/shell';
-
-const unsplash = createApi({
- accessKey: '1WxD1JpMOUX86lZKKob4Ca0LMZPyO2rUmAgjpWm9Ids',
-});
-
-const SEARCH_DEBOUNCE_TIME = 500;
-
-export function Unsplash({ onDone, onEscape }: { onDone?: (value: string) => void; onEscape?: () => void }) {
- const { t } = useTranslation();
-
- const [loading, setLoading] = useState(true);
- const [error, setError] = useState<string>('');
- const [photos, setPhotos] = useState<
- {
- thumb: string;
- regular: string;
- alt: string | null;
- id: string;
- user: {
- name: string;
- link: string;
- };
- }[]
- >([]);
- const [searchValue, setSearchValue] = useState('');
-
- const handleChange = useCallback((e: React.ChangeEvent<HTMLInputElement>) => {
- const value = e.target.value;
-
- setSearchValue(value);
- }, []);
-
- const handleKeyDown = useCallback(
- (e: React.KeyboardEvent) => {
- if (e.key === 'Escape') {
- e.preventDefault();
- e.stopPropagation();
- onEscape?.();
- }
- },
- [onEscape]
- );
-
- const debounceSearchPhotos = useMemo(() => {
- return debounce(async (searchValue: string) => {
- const request = searchValue
- ? unsplash.search.getPhotos({ query: searchValue ?? undefined, perPage: 32 })
- : unsplash.photos.list({ perPage: 32 });
-
- setError('');
- setLoading(true);
- await request.then((result) => {
- if (result.errors) {
- setError(result.errors[0]);
- } else {
- setPhotos(
- result.response.results.map((photo) => ({
- id: photo.id,
- thumb: photo.urls.thumb,
- regular: photo.urls.regular,
- alt: photo.alt_description,
- user: {
- name: photo.user.name,
- link: photo.user.links.html,
- },
- }))
- );
- }
-
- setLoading(false);
- });
- }, SEARCH_DEBOUNCE_TIME);
- }, []);
-
- useEffect(() => {
- void debounceSearchPhotos(searchValue);
- return () => {
- debounceSearchPhotos.cancel();
- };
- }, [debounceSearchPhotos, searchValue]);
-
- return (
- <div tabIndex={0} onKeyDown={handleKeyDown} className={'flex min-h-[200px] flex-col gap-4 px-4 pb-4'}>
- <TextField
- autoFocus
- onKeyDown={handleKeyDown}
- size={'small'}
- spellCheck={false}
- onChange={handleChange}
- value={searchValue}
- placeholder={t('document.imageBlock.searchForAnImage')}
- fullWidth
- />
-
- {loading ? (
- <div className={'flex h-[120px] w-full items-center justify-center gap-2 text-xs'}>
- <CircularProgress size={24} />
- <div className={'text-xs text-text-caption'}>{t('editor.loading')}</div>
- </div>
- ) : error ? (
- <Typography className={'flex h-[120px] w-full items-center justify-center gap-2 text-xs text-function-error'}>
- {error}
- </Typography>
- ) : (
- <div className={'flex flex-col gap-4'}>
- {photos.length > 0 ? (
- <>
- <div className={'flex w-full flex-1 flex-wrap gap-2'}>
- {photos.map((photo) => (
- <div key={photo.id} className={'flex cursor-pointer flex-col gap-2'}>
- <img
- onClick={() => {
- onDone?.(photo.regular);
- }}
- src={photo.thumb}
- alt={photo.alt ?? ''}
- className={'h-20 w-32 rounded object-cover hover:opacity-80'}
- />
- <div className={'w-32 truncate text-xs text-text-caption'}>
- by{' '}
- <span
- onClick={() => {
- void open(photo.user.link);
- }}
- className={'underline hover:text-function-info'}
- >
- {photo.user.name}
- </span>
- </div>
- </div>
- ))}
- </div>
- <Typography className={'w-full text-center text-xs text-text-caption'}>
- {t('findAndReplace.searchMore')}
- </Typography>
- </>
- ) : (
- <Typography className={'flex h-[120px] w-full items-center justify-center gap-2 text-xs text-text-caption'}>
- {t('findAndReplace.noResult')}
- </Typography>
- )}
- </div>
- )}
- </div>
- );
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/image_upload/UploadImage.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/_shared/image_upload/UploadImage.tsx
deleted file mode 100644
index d39da68caf..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/image_upload/UploadImage.tsx
+++ /dev/null
@@ -1,93 +0,0 @@
-import React, { useCallback } from 'react';
-import Button from '@mui/material/Button';
-import { useTranslation } from 'react-i18next';
-import CloudUploadIcon from '@mui/icons-material/CloudUploadOutlined';
-import { notify } from '$app/components/_shared/notify';
-import { isTauri } from '$app/utils/env';
-import { getFileName, IMAGE_DIR, ALLOWED_IMAGE_EXTENSIONS, MAX_IMAGE_SIZE } from '$app/utils/upload_image';
-
-export function UploadImage({ onDone }: { onDone?: (url: string) => void }) {
- const { t } = useTranslation();
-
- const checkTauriFile = useCallback(
- async (url: string) => {
- // const { readBinaryFile } = await import('@tauri-apps/api/fs');
- // const buffer = await readBinaryFile(url);
- // const blob = new Blob([buffer]);
- // if (blob.size > MAX_IMAGE_SIZE) {
- // notify.error(t('document.imageBlock.error.invalidImageSize'));
- // return false;
- // }
-
- return true;
- },
- [t]
- );
-
- const uploadTauriLocalImage = useCallback(
- async (url: string) => {
- const { copyFile, BaseDirectory, exists, createDir } = await import('@tauri-apps/api/fs');
-
- const checked = await checkTauriFile(url);
-
- if (!checked) return;
-
- try {
- const existDir = await exists(IMAGE_DIR, { dir: BaseDirectory.AppLocalData });
-
- if (!existDir) {
- await createDir(IMAGE_DIR, { dir: BaseDirectory.AppLocalData });
- }
-
- const filename = getFileName(url);
-
- await copyFile(url, `${IMAGE_DIR}/${filename}`, { dir: BaseDirectory.AppLocalData });
- const newUrl = `${IMAGE_DIR}/${filename}`;
-
- onDone?.(newUrl);
- } catch (e) {
- notify.error(t('document.plugins.image.imageUploadFailed'));
- }
- },
- [checkTauriFile, onDone, t]
- );
-
- const handleClickUpload = useCallback(async () => {
- if (!isTauri()) return;
- const { open } = await import('@tauri-apps/api/dialog');
-
- const url = await open({
- multiple: false,
- directory: false,
- filters: [
- {
- name: 'Image',
- extensions: ALLOWED_IMAGE_EXTENSIONS,
- },
- ],
- });
-
- if (!url || typeof url !== 'string') return;
-
- await uploadTauriLocalImage(url);
- }, [uploadTauriLocalImage]);
-
- return (
- <div className={'w-full px-4 pb-4'}>
- <Button
- component='label'
- role={undefined}
- tabIndex={-1}
- variant={'outlined'}
- startIcon={<CloudUploadIcon />}
- className={'w-full'}
- color={'inherit'}
- onClick={handleClickUpload}
- >
- {t('document.imageBlock.upload.placeholder')}
- </Button>
- </div>
- );
-}
-
-export default UploadImage;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/image_upload/UploadTabs.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/_shared/image_upload/UploadTabs.tsx
deleted file mode 100644
index fb65c709ce..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/image_upload/UploadTabs.tsx
+++ /dev/null
@@ -1,128 +0,0 @@
-import React, { SyntheticEvent, useCallback, useState } from 'react';
-import Popover, { PopoverProps } from '@mui/material/Popover';
-import { TabPanel, ViewTab, ViewTabs } from '$app/components/database/components/tab_bar/ViewTabs';
-import SwipeableViews from 'react-swipeable-views';
-import { PopoverCommonProps } from '$app/components/editor/components/tools/popover';
-
-export enum TAB_KEY {
- Colors = 'colors',
- UPLOAD = 'upload',
- EMBED_LINK = 'embed_link',
- UNSPLASH = 'unsplash',
-}
-
-export type TabOption = {
- key: TAB_KEY;
- label: string;
- Component: React.ComponentType<{
- onDone?: (value: string) => void;
- onEscape?: () => void;
- }>;
- onDone?: (value: string) => void;
-};
-
-export function UploadTabs({
- tabOptions,
- popoverProps,
- containerStyle,
- extra,
-}: {
- containerStyle?: React.CSSProperties;
- tabOptions: TabOption[];
- popoverProps?: PopoverProps;
- extra?: React.ReactNode;
-}) {
- const [tabValue, setTabValue] = useState<TAB_KEY>(() => {
- return tabOptions[0].key;
- });
-
- const handleTabChange = useCallback((_: SyntheticEvent, newValue: string) => {
- setTabValue(newValue as TAB_KEY);
- }, []);
-
- const selectedIndex = tabOptions.findIndex((tab) => tab.key === tabValue);
-
- const onKeyDown = useCallback(
- (e: React.KeyboardEvent) => {
- e.stopPropagation();
-
- if (e.key === 'Escape') {
- e.preventDefault();
- e.stopPropagation();
- popoverProps?.onClose?.({}, 'escapeKeyDown');
- }
-
- if (e.key === 'Tab') {
- e.preventDefault();
- e.stopPropagation();
- setTabValue((prev) => {
- const currentIndex = tabOptions.findIndex((tab) => tab.key === prev);
- let nextIndex = currentIndex + 1;
-
- if (e.shiftKey) {
- nextIndex = currentIndex - 1;
- }
-
- return tabOptions[nextIndex % tabOptions.length]?.key ?? tabOptions[0].key;
- });
- }
- },
- [popoverProps, tabOptions]
- );
-
- return (
- <Popover
- {...popoverProps}
- {...PopoverCommonProps}
- open={popoverProps?.open ?? false}
- disableAutoFocus={false}
- onKeyDown={onKeyDown}
- PaperProps={{
- style: {
- padding: 0,
- },
- }}
- >
- <div style={containerStyle} className={'flex flex-col gap-4 overflow-hidden'}>
- <div className={'flex w-full items-center justify-between gap-2 border-b border-line-divider'}>
- <ViewTabs
- value={tabValue}
- onChange={handleTabChange}
- scrollButtons={false}
- variant='scrollable'
- allowScrollButtonsMobile
- className={'min-h-[38px] px-2'}
- >
- {tabOptions.map((tab) => {
- const { key, label } = tab;
-
- return <ViewTab key={key} iconPosition='start' color='inherit' label={label} value={key} />;
- })}
- </ViewTabs>
- {extra}
- </div>
-
- <div className={'h-full w-full flex-1 overflow-y-auto overflow-x-hidden'}>
- <SwipeableViews
- slideStyle={{
- overflow: 'hidden',
- height: '100%',
- }}
- axis={'x'}
- index={selectedIndex}
- >
- {tabOptions.map((tab, index) => {
- const { key, Component, onDone } = tab;
-
- return (
- <TabPanel className={'flex h-full w-full flex-col'} key={key} index={index} value={selectedIndex}>
- <Component onDone={onDone} onEscape={() => popoverProps?.onClose?.({}, 'escapeKeyDown')} />
- </TabPanel>
- );
- })}
- </SwipeableViews>
- </div>
- </div>
- </Popover>
- );
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/image_upload/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/_shared/image_upload/index.ts
deleted file mode 100644
index 28673cae5f..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/image_upload/index.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-export * from './Unsplash';
-export * from './UploadImage';
-export * from './EmbedLink';
-export * from './UploadTabs';
-export * from './LocalImage';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/katex_math/KatexMath.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/_shared/katex_math/KatexMath.tsx
deleted file mode 100644
index e6c7cac5ed..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/katex_math/KatexMath.tsx
+++ /dev/null
@@ -1,24 +0,0 @@
-import React from 'react';
-import 'katex/dist/katex.min.css';
-import { BlockMath, InlineMath } from 'react-katex';
-import './index.css';
-
-function KatexMath({ latex, isInline = false }: { latex: string; isInline?: boolean }) {
- return isInline ? (
- <InlineMath math={latex} />
- ) : (
- <BlockMath
- renderError={(error) => {
- return (
- <div className='flex h-[51px] items-center justify-center'>
- {error.name}: {error.message}
- </div>
- );
- }}
- >
- {latex}
- </BlockMath>
- );
-}
-
-export default KatexMath;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/katex_math/index.css b/frontend/appflowy_tauri/src/appflowy_app/components/_shared/katex_math/index.css
deleted file mode 100644
index d127dc343b..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/katex_math/index.css
+++ /dev/null
@@ -1,4 +0,0 @@
-
-.katex-html {
- white-space: normal;
-}
\ No newline at end of file
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/keyboard_navigation/KeyboardNavigation.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/_shared/keyboard_navigation/KeyboardNavigation.tsx
deleted file mode 100644
index 7db90c4e8f..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/keyboard_navigation/KeyboardNavigation.tsx
+++ /dev/null
@@ -1,317 +0,0 @@
-import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
-import { MenuItem, Typography } from '@mui/material';
-import { scrollIntoView } from '$app/components/_shared/keyboard_navigation/utils';
-import { useTranslation } from 'react-i18next';
-
-/**
- * The option of the keyboard navigation
- * the options will be flattened
- * - key: the key of the option
- * - content: the content of the option
- * - children: the children of the option
- */
-export interface KeyboardNavigationOption<T = string> {
- key: T;
- content?: React.ReactNode;
- children?: KeyboardNavigationOption<T>[];
- disabled?: boolean;
-}
-
-/**
- * - scrollRef: the scrollable element
- * - focusRef: the element to focus when the keyboard navigation is disabled
- * - options: the options to navigate
- * - onSelected: called when an option is selected(hovered)
- * - onConfirm: called when an option is confirmed
- * - onEscape: called when the escape key is pressed
- * - onPressRight: called when the right arrow is pressed
- * - onPressLeft: called when the left arrow key is pressed
- * - disableFocus: disable the focus on the keyboard navigation
- * - disableSelect: disable selecting an option when the options are initialized
- * - onKeyDown: called when a key is pressed
- * - defaultFocusedKey: the default focused key
- * - onFocus: called when the keyboard navigation is focused
- * - onBlur: called when the keyboard navigation is blurred
- */
-export interface KeyboardNavigationProps<T> {
- scrollRef?: React.RefObject<HTMLDivElement>;
- focusRef?: React.RefObject<HTMLElement>;
- options: KeyboardNavigationOption<T>[];
- onSelected?: (optionKey: T) => void;
- onConfirm?: (optionKey: T) => void;
- onEscape?: () => void;
- onPressRight?: (optionKey: T) => void;
- onPressLeft?: (optionKey: T) => void;
- disableFocus?: boolean;
- disableSelect?: boolean;
- onKeyDown?: (e: KeyboardEvent) => void;
- defaultFocusedKey?: T;
- onFocus?: () => void;
- onBlur?: () => void;
- itemClassName?: string;
- itemStyle?: React.CSSProperties;
- renderNoResult?: () => React.ReactNode;
-}
-
-function KeyboardNavigation<T>({
- defaultFocusedKey,
- onPressRight,
- onPressLeft,
- onEscape,
- onConfirm,
- scrollRef,
- options,
- onSelected,
- focusRef,
- disableFocus = false,
- onKeyDown: onPropsKeyDown,
- disableSelect = false,
- onBlur,
- onFocus,
- itemClassName,
- itemStyle,
- renderNoResult,
-}: KeyboardNavigationProps<T>) {
- const { t } = useTranslation();
- const ref = useRef<HTMLDivElement>(null);
- const mouseY = useRef<number | null>(null);
- const defaultKeyRef = useRef<T | undefined>(defaultFocusedKey);
- // flatten the options
- const flattenOptions = useMemo(() => {
- return options.flatMap((group) => {
- if (group.children) {
- return group.children;
- }
-
- return [group];
- });
- }, [options]);
-
- const [focusedKey, setFocusedKey] = useState<T>();
-
- const firstOptionKey = useMemo(() => {
- if (disableSelect) return;
- const firstOption = flattenOptions.find((option) => !option.disabled);
-
- return firstOption?.key;
- }, [flattenOptions, disableSelect]);
-
- // set the default focused key when the options are initialized
- useEffect(() => {
- if (defaultKeyRef.current) {
- setFocusedKey(defaultKeyRef.current);
- defaultKeyRef.current = undefined;
- return;
- }
-
- setFocusedKey(firstOptionKey);
- }, [firstOptionKey]);
-
- // call the onSelected callback when the focused key is changed
- useEffect(() => {
- if (focusedKey === undefined) return;
- onSelected?.(focusedKey);
-
- const scrollElement = scrollRef?.current;
-
- if (!scrollElement) return;
-
- const dom = ref.current?.querySelector(`[data-key="${focusedKey}"]`);
-
- if (!dom) return;
- // scroll the focused option into view
- requestAnimationFrame(() => {
- scrollIntoView(dom as HTMLDivElement, scrollElement);
- });
- }, [focusedKey, onSelected, scrollRef]);
-
- const onKeyDown = useCallback(
- (e: KeyboardEvent) => {
- onPropsKeyDown?.(e);
- e.stopPropagation();
- const key = e.key;
-
- if (key === 'Tab') {
- e.preventDefault();
- return;
- }
-
- if (key === 'Escape') {
- e.preventDefault();
- onEscape?.();
- return;
- }
-
- if (focusedKey === undefined) return;
- const focusedIndex = flattenOptions.findIndex((option) => option?.key === focusedKey);
- const nextIndex = (focusedIndex + 1) % flattenOptions.length;
- const prevIndex = (focusedIndex - 1 + flattenOptions.length) % flattenOptions.length;
-
- switch (key) {
- // move the focus to the previous option
- case 'ArrowUp': {
- e.preventDefault();
-
- const prevKey = flattenOptions[prevIndex]?.key;
-
- setFocusedKey(prevKey);
-
- break;
- }
-
- // move the focus to the next option
- case 'ArrowDown': {
- e.preventDefault();
- const nextKey = flattenOptions[nextIndex]?.key;
-
- setFocusedKey(nextKey);
- break;
- }
-
- case 'ArrowRight':
- if (onPressRight) {
- e.preventDefault();
- onPressRight(focusedKey);
- }
-
- break;
- case 'ArrowLeft':
- if (onPressLeft) {
- e.preventDefault();
- onPressLeft(focusedKey);
- }
-
- break;
- // confirm the focused option
- case 'Enter': {
- e.preventDefault();
- const disabled = flattenOptions[focusedIndex]?.disabled;
-
- if (!disabled) {
- onConfirm?.(focusedKey);
- }
-
- break;
- }
-
- default:
- break;
- }
- },
- [flattenOptions, focusedKey, onConfirm, onEscape, onPressLeft, onPressRight, onPropsKeyDown]
- );
-
- const renderOption = useCallback(
- (option: KeyboardNavigationOption<T>, index: number) => {
- const hasChildren = option.children;
-
- const isFocused = focusedKey === option.key;
-
- return (
- <div className={'flex flex-col gap-1'} key={option.key as string}>
- {hasChildren ? (
- // render the group name
- option.content && <div className={'text-text-caption'}>{option.content}</div>
- ) : (
- // render the option
- <MenuItem
- disabled={option.disabled}
- data-key={option.key}
- // prevent the focused option is changed when the mouse is not moved but the mouse is entered when scrolling into view
- onMouseMove={(e) => {
- mouseY.current = e.clientY;
- }}
- onMouseEnter={(e) => {
- onFocus?.();
- if (mouseY.current === null || mouseY.current !== e.clientY) {
- setFocusedKey(option.key);
- }
-
- mouseY.current = e.clientY;
- }}
- onClick={() => {
- setFocusedKey(option.key);
- if (!option.disabled) {
- onConfirm?.(option.key);
- }
- }}
- selected={isFocused}
- style={itemStyle}
- className={`ml-0 flex w-full items-center justify-start rounded-none px-2 py-1 text-xs ${
- !isFocused ? 'hover:bg-transparent' : ''
- } ${itemClassName ?? ''}`}
- >
- {option.content}
- </MenuItem>
- )}
-
- {option.children?.map((child, childIndex) => {
- return renderOption(child, index + childIndex);
- })}
- </div>
- );
- },
- [itemClassName, focusedKey, onConfirm, onFocus, itemStyle]
- );
-
- useEffect(() => {
- const element = ref.current;
-
- if (!disableFocus && element) {
- element.focus();
- element.addEventListener('keydown', onKeyDown);
-
- return () => {
- element.removeEventListener('keydown', onKeyDown);
- };
- } else {
- let element: HTMLElement | null | undefined = focusRef?.current;
-
- if (!element) {
- element = document.activeElement as HTMLElement;
- }
-
- element?.addEventListener('keydown', onKeyDown);
- return () => {
- element?.removeEventListener('keydown', onKeyDown);
- };
- }
- }, [disableFocus, onKeyDown, focusRef]);
-
- return (
- <div
- tabIndex={0}
- onFocus={(e) => {
- e.stopPropagation();
-
- onFocus?.();
- }}
- onBlur={(e) => {
- e.stopPropagation();
-
- const target = e.relatedTarget as HTMLElement;
-
- if (target?.closest('.keyboard-navigation')) {
- return;
- }
-
- onBlur?.();
- }}
- autoFocus={!disableFocus}
- className={'keyboard-navigation flex w-full flex-col gap-1 outline-none'}
- ref={ref}
- >
- {options.length > 0 ? (
- options.map(renderOption)
- ) : renderNoResult ? (
- renderNoResult()
- ) : (
- <Typography variant='body1' className={'p-3 text-xs text-text-caption'}>
- {t('findAndReplace.noResult')}
- </Typography>
- )}
- </div>
- );
-}
-
-export default KeyboardNavigation;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/keyboard_navigation/utils.ts b/frontend/appflowy_tauri/src/appflowy_app/components/_shared/keyboard_navigation/utils.ts
deleted file mode 100644
index 621143869b..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/keyboard_navigation/utils.ts
+++ /dev/null
@@ -1,32 +0,0 @@
-export function inView(dom: HTMLElement, container: HTMLElement) {
- const domRect = dom.getBoundingClientRect();
- const containerRect = container.getBoundingClientRect();
-
- if (!domRect || !containerRect) return true;
-
- return domRect?.bottom <= containerRect?.bottom && domRect?.top >= containerRect?.top;
-}
-
-export function getDistanceEdge(dom: HTMLElement, container: HTMLElement) {
- const domRect = dom.getBoundingClientRect();
- const containerRect = container.getBoundingClientRect();
-
- if (!domRect || !containerRect) return 0;
-
- const distanceTop = domRect?.top - containerRect?.top;
- const distanceBottom = domRect?.bottom - containerRect?.bottom;
-
- return Math.abs(distanceTop) < Math.abs(distanceBottom) ? distanceTop : distanceBottom;
-}
-
-export function scrollIntoView(dom: HTMLElement, container: HTMLElement) {
- const isDomInView = inView(dom, container);
-
- if (isDomInView) return;
-
- dom.scrollIntoView({
- block: 'nearest',
- inline: 'nearest',
- behavior: 'smooth',
- });
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/notify/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/_shared/notify/index.ts
deleted file mode 100644
index 1086cabdfd..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/notify/index.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-import toast from 'react-hot-toast';
-
-const commonOptions = {
- style: {
- background: 'var(--bg-base)',
- color: 'var(--text-title)',
- shadows: 'var(--shadow)',
- },
-};
-
-export const notify = {
- success: (message: string) => {
- toast.success(message, commonOptions);
- },
- error: (message: string) => {
- toast.error(message, commonOptions);
- },
- loading: (message: string) => {
- toast.loading(message, commonOptions);
- },
- info: (message: string) => {
- toast(message, commonOptions);
- },
- clear: () => {
- toast.dismiss();
- },
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/popover/Popover.hooks.ts b/frontend/appflowy_tauri/src/appflowy_app/components/_shared/popover/Popover.hooks.ts
deleted file mode 100644
index 0fc1b5e61e..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/popover/Popover.hooks.ts
+++ /dev/null
@@ -1,237 +0,0 @@
-import { useState, useEffect, useCallback } from 'react';
-import { PopoverOrigin } from '@mui/material/Popover/Popover';
-
-interface PopoverPosition {
- anchorOrigin: PopoverOrigin;
- transformOrigin: PopoverOrigin;
- paperWidth: number;
- paperHeight: number;
- isEntered: boolean;
- anchorPosition?: { left: number; top: number };
-}
-
-interface UsePopoverAutoPositionProps {
- anchorEl?: HTMLElement | null;
- anchorPosition?: { left: number; top: number; height: number };
- initialAnchorOrigin?: PopoverOrigin;
- initialTransformOrigin?: PopoverOrigin;
- initialPaperWidth: number;
- initialPaperHeight: number;
- marginThreshold?: number;
- open: boolean;
- anchorSize?: { width: number; height: number };
-}
-
-const minPaperWidth = 80;
-const minPaperHeight = 120;
-
-function getOffsetLeft(
- rect: {
- height: number;
- width: number;
- },
- paperWidth: number,
- horizontal: number | 'center' | 'left' | 'right',
- transformHorizontal: number | 'center' | 'left' | 'right'
-) {
- let offset = 0;
-
- if (typeof horizontal === 'number') {
- offset = horizontal;
- } else if (horizontal === 'center') {
- offset = rect.width / 2;
- } else if (horizontal === 'right') {
- offset = rect.width;
- }
-
- if (transformHorizontal === 'center') {
- offset -= paperWidth / 2;
- } else if (transformHorizontal === 'right') {
- offset -= paperWidth;
- }
-
- return offset;
-}
-
-function getOffsetTop(
- rect: {
- height: number;
- width: number;
- },
- papertHeight: number,
- vertical: number | 'center' | 'bottom' | 'top',
- transformVertical: number | 'center' | 'bottom' | 'top'
-) {
- let offset = 0;
-
- if (typeof vertical === 'number') {
- offset = vertical;
- } else if (vertical === 'center') {
- offset = rect.height / 2;
- } else if (vertical === 'bottom') {
- offset = rect.height;
- }
-
- if (transformVertical === 'center') {
- offset -= papertHeight / 2;
- } else if (transformVertical === 'bottom') {
- offset -= papertHeight;
- }
-
- return offset;
-}
-
-const defaultAnchorOrigin: PopoverOrigin = {
- vertical: 'top',
- horizontal: 'left',
-};
-
-const defaultTransformOrigin: PopoverOrigin = {
- vertical: 'top',
- horizontal: 'left',
-};
-
-const usePopoverAutoPosition = ({
- anchorEl,
- anchorPosition,
- initialAnchorOrigin = defaultAnchorOrigin,
- initialTransformOrigin = defaultTransformOrigin,
- initialPaperWidth,
- initialPaperHeight,
- marginThreshold = 16,
- open,
-}: UsePopoverAutoPositionProps): PopoverPosition & {
- calculateAnchorSize: () => void;
-} => {
- const [position, setPosition] = useState<PopoverPosition>({
- anchorOrigin: initialAnchorOrigin,
- transformOrigin: initialTransformOrigin,
- paperWidth: initialPaperWidth,
- paperHeight: initialPaperHeight,
- anchorPosition,
- isEntered: false,
- });
-
- const calculateAnchorSize = useCallback(() => {
- const viewportWidth = window.innerWidth;
- const viewportHeight = window.innerHeight;
-
- const getAnchorOffset = () => {
- if (anchorPosition) {
- return {
- ...anchorPosition,
- width: 0,
- };
- }
-
- return anchorEl ? anchorEl.getBoundingClientRect() : undefined;
- };
-
- const anchorRect = getAnchorOffset();
-
- if (!anchorRect) return;
- let newPaperWidth = initialPaperWidth;
- let newPaperHeight = initialPaperHeight;
- const newAnchorPosition = {
- top: anchorRect.top,
- left: anchorRect.left,
- };
-
- // calculate new paper width
- const newLeft =
- anchorRect.left +
- getOffsetLeft(anchorRect, newPaperWidth, initialAnchorOrigin.horizontal, initialTransformOrigin.horizontal);
- const newTop =
- anchorRect.top +
- getOffsetTop(anchorRect, newPaperHeight, initialAnchorOrigin.vertical, initialTransformOrigin.vertical);
-
- let isExceedViewportRight = false;
- let isExceedViewportBottom = false;
- let isExceedViewportLeft = false;
- let isExceedViewportTop = false;
-
- // Check if exceed viewport right
- if (newLeft + newPaperWidth > viewportWidth - marginThreshold) {
- isExceedViewportRight = true;
- // Check if exceed viewport left
- if (newLeft - newPaperWidth < marginThreshold) {
- isExceedViewportLeft = true;
- newPaperWidth = Math.max(minPaperWidth, Math.min(newPaperWidth, viewportWidth - newLeft - marginThreshold));
- }
- }
-
- // Check if exceed viewport bottom
- if (newTop + newPaperHeight > viewportHeight - marginThreshold) {
- isExceedViewportBottom = true;
- // Check if exceed viewport top
- if (newTop - newPaperHeight < marginThreshold) {
- isExceedViewportTop = true;
- newPaperHeight = Math.max(minPaperHeight, Math.min(newPaperHeight, viewportHeight - newTop - marginThreshold));
- }
- }
-
- const newPosition = {
- anchorOrigin: { ...initialAnchorOrigin },
- transformOrigin: { ...initialTransformOrigin },
- paperWidth: newPaperWidth,
- paperHeight: newPaperHeight,
- anchorPosition: newAnchorPosition,
- };
-
- // If exceed viewport, adjust anchor origin and transform origin
- if (!isExceedViewportRight && !isExceedViewportLeft) {
- if (isExceedViewportBottom && !isExceedViewportTop) {
- newPosition.anchorOrigin.vertical = 'top';
- newPosition.transformOrigin.vertical = 'bottom';
- } else if (!isExceedViewportBottom && isExceedViewportTop) {
- newPosition.anchorOrigin.vertical = 'bottom';
- newPosition.transformOrigin.vertical = 'top';
- }
- } else if (!isExceedViewportBottom && !isExceedViewportTop) {
- if (isExceedViewportRight && !isExceedViewportLeft) {
- newPosition.anchorOrigin.horizontal = 'left';
- newPosition.transformOrigin.horizontal = 'right';
- } else if (!isExceedViewportRight && isExceedViewportLeft) {
- newPosition.anchorOrigin.horizontal = 'right';
- newPosition.transformOrigin.horizontal = 'left';
- }
- }
-
- // anchorPosition is top-left of the anchor element, so we need to adjust it to avoid overlap with the anchor element
- if (newPosition.anchorOrigin.vertical === 'bottom' && newPosition.transformOrigin.vertical === 'top') {
- newPosition.anchorPosition.top += anchorRect.height;
- }
-
- if (
- isExceedViewportTop &&
- isExceedViewportBottom &&
- newPosition.anchorOrigin.vertical === 'top' &&
- newPosition.transformOrigin.vertical === 'bottom'
- ) {
- newPosition.paperHeight = newPaperHeight - anchorRect.height;
- }
-
- // Set new position and set isEntered to true
- setPosition({ ...newPosition, isEntered: true });
- }, [
- initialAnchorOrigin,
- initialTransformOrigin,
- initialPaperWidth,
- initialPaperHeight,
- marginThreshold,
- anchorEl,
- anchorPosition,
- ]);
-
- useEffect(() => {
- if (!open) return;
- calculateAnchorSize();
- }, [open, calculateAnchorSize]);
-
- return {
- ...position,
- calculateAnchorSize,
- };
-};
-
-export default usePopoverAutoPosition;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/popover/utils.ts b/frontend/appflowy_tauri/src/appflowy_app/components/_shared/popover/utils.ts
deleted file mode 100644
index dccaf2f4d4..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/popover/utils.ts
+++ /dev/null
@@ -1,45 +0,0 @@
-import { PopoverOrigin } from '@mui/material/Popover/Popover';
-
-export function getOffsetTop(rect: DOMRect, vertical: number | 'center' | 'bottom' | 'top') {
- let offset = 0;
-
- if (typeof vertical === 'number') {
- offset = vertical;
- } else if (vertical === 'center') {
- offset = rect.height / 2;
- } else if (vertical === 'bottom') {
- offset = rect.height;
- }
-
- return offset;
-}
-
-export function getOffsetLeft(rect: DOMRect, horizontal: number | 'center' | 'left' | 'right') {
- let offset = 0;
-
- if (typeof horizontal === 'number') {
- offset = horizontal;
- } else if (horizontal === 'center') {
- offset = rect.width / 2;
- } else if (horizontal === 'right') {
- offset = rect.width;
- }
-
- return offset;
-}
-
-export function getAnchorOffset(anchorElement: HTMLElement, anchorOrigin: PopoverOrigin) {
- const anchorRect = anchorElement.getBoundingClientRect();
-
- return {
- top: anchorRect.top + getOffsetTop(anchorRect, anchorOrigin.vertical),
- left: anchorRect.left + getOffsetLeft(anchorRect, anchorOrigin.horizontal),
- };
-}
-
-export function getTransformOrigin(elemRect: DOMRect, transformOrigin: PopoverOrigin) {
- return {
- vertical: getOffsetTop(elemRect, transformOrigin.vertical),
- horizontal: getOffsetLeft(elemRect, transformOrigin.horizontal),
- };
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/scroller/AFScroller.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/_shared/scroller/AFScroller.tsx
deleted file mode 100644
index 0527b6cc26..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/scroller/AFScroller.tsx
+++ /dev/null
@@ -1,55 +0,0 @@
-import { Scrollbars } from 'react-custom-scrollbars';
-import React from 'react';
-
-export interface AFScrollerProps {
- children: React.ReactNode;
- overflowXHidden?: boolean;
- overflowYHidden?: boolean;
- className?: string;
- style?: React.CSSProperties;
-}
-export const AFScroller = ({ style, children, overflowXHidden, overflowYHidden, className }: AFScrollerProps) => {
- return (
- <Scrollbars
- autoHide
- renderThumbHorizontal={(props) => <div {...props} className='appflowy-scrollbar-thumb-horizontal' />}
- renderThumbVertical={(props) => <div {...props} className='appflowy-scrollbar-thumb-vertical' />}
- {...(overflowXHidden && {
- renderTrackHorizontal: (props) => (
- <div
- {...props}
- style={{
- display: 'none',
- }}
- />
- ),
- })}
- {...(overflowYHidden && {
- renderTrackVertical: (props) => (
- <div
- {...props}
- style={{
- display: 'none',
- }}
- />
- ),
- })}
- style={style}
- renderView={(props) => (
- <div
- {...props}
- style={{
- ...props.style,
- overflowX: overflowXHidden ? 'hidden' : 'auto',
- overflowY: overflowYHidden ? 'hidden' : 'auto',
- marginRight: 0,
- marginBottom: 0,
- }}
- className={className}
- />
- )}
- >
- {children}
- </Scrollbars>
- );
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/scroller/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/_shared/scroller/index.ts
deleted file mode 100644
index 7a740a5bb0..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/scroller/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './AFScroller';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/view_title/ViewBanner.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/_shared/view_title/ViewBanner.tsx
deleted file mode 100644
index 95e44ae9c2..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/view_title/ViewBanner.tsx
+++ /dev/null
@@ -1,53 +0,0 @@
-import ViewIconGroup from '$app/components/_shared/view_title/ViewIconGroup';
-import { PageCover, PageIcon } from '$app_reducers/pages/slice';
-import ViewIcon from '$app/components/_shared/view_title/ViewIcon';
-import { ViewCover } from '$app/components/_shared/view_title/cover';
-
-function ViewBanner({
- icon,
- hover,
- onUpdateIcon,
- showCover,
- cover,
- onUpdateCover,
-}: {
- icon?: PageIcon;
- hover: boolean;
- onUpdateIcon: (icon: string) => void;
- showCover: boolean;
- cover?: PageCover;
- onUpdateCover?: (cover?: PageCover) => void;
-}) {
- return (
- <div className={'view-banner flex w-full flex-col overflow-hidden'}>
- {showCover && cover && <ViewCover cover={cover} onUpdateCover={onUpdateCover} />}
-
- <div className={`relative min-h-[65px] ${showCover ? 'w-[964px] min-w-0 max-w-full px-16' : ''} pt-12`}>
- <div
- style={{
- display: icon ? 'flex' : 'none',
- position: cover ? 'absolute' : 'relative',
- bottom: cover ? '24px' : 'auto',
- }}
- >
- <ViewIcon onUpdateIcon={onUpdateIcon} icon={icon} />
- </div>
- <div
- style={{
- opacity: hover ? 1 : 0,
- }}
- >
- <ViewIconGroup
- icon={icon}
- onUpdateIcon={onUpdateIcon}
- showCover={showCover}
- cover={cover}
- onUpdateCover={onUpdateCover}
- />
- </div>
- </div>
- </div>
- );
-}
-
-export default ViewBanner;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/view_title/ViewIcon.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/_shared/view_title/ViewIcon.tsx
deleted file mode 100644
index 009548df53..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/view_title/ViewIcon.tsx
+++ /dev/null
@@ -1,62 +0,0 @@
-import React, { useCallback, useState } from 'react';
-import Popover from '@mui/material/Popover';
-import EmojiPicker from '$app/components/_shared/emoji_picker/EmojiPicker';
-import { PageIcon } from '$app_reducers/pages/slice';
-
-function ViewIcon({ icon, onUpdateIcon }: { icon?: PageIcon; onUpdateIcon: (icon: string) => void }) {
- const [anchorPosition, setAnchorPosition] = useState<{
- top: number;
- left: number;
- }>();
-
- const open = Boolean(anchorPosition);
- const onOpen = useCallback((event: React.MouseEvent<HTMLDivElement>) => {
- const rect = event.currentTarget.getBoundingClientRect();
-
- setAnchorPosition({
- top: rect.top + rect.height,
- left: rect.left,
- });
- }, []);
-
- const onEmojiSelect = useCallback(
- (emoji: string) => {
- onUpdateIcon(emoji);
- if (!emoji) {
- setAnchorPosition(undefined);
- }
- },
- [onUpdateIcon]
- );
-
- if (!icon) return null;
- return (
- <>
- <div className={`view-icon -ml-2 flex rounded p-2`}>
- <div onClick={onOpen} className={'h-full w-full cursor-pointer rounded text-6xl'}>
- {icon.value}
- </div>
- </div>
- {open && (
- <Popover
- open={open}
- autoFocus={true}
- disableRestoreFocus={false}
- anchorReference='anchorPosition'
- anchorPosition={anchorPosition}
- onClose={() => setAnchorPosition(undefined)}
- >
- <EmojiPicker
- defaultEmoji={icon.value}
- onEscape={() => {
- setAnchorPosition(undefined);
- }}
- onEmojiSelect={onEmojiSelect}
- />
- </Popover>
- )}
- </>
- );
-}
-
-export default ViewIcon;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/view_title/ViewIconGroup.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/_shared/view_title/ViewIconGroup.tsx
deleted file mode 100644
index 54256f8eb1..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/view_title/ViewIconGroup.tsx
+++ /dev/null
@@ -1,57 +0,0 @@
-import { useTranslation } from 'react-i18next';
-import { CoverType, PageCover, PageIcon } from '$app_reducers/pages/slice';
-import React, { useCallback } from 'react';
-import { randomEmoji } from '$app/utils/emoji';
-import { EmojiEmotionsOutlined } from '@mui/icons-material';
-import Button from '@mui/material/Button';
-import { ReactComponent as ImageIcon } from '$app/assets/image.svg';
-import { ImageType } from '$app/application/document/document.types';
-
-interface Props {
- icon?: PageIcon;
- onUpdateIcon: (icon: string) => void;
- showCover: boolean;
- cover?: PageCover;
- onUpdateCover?: (cover: PageCover) => void;
-}
-
-const defaultCover = {
- cover_selection_type: CoverType.Asset,
- cover_selection: 'app_flowy_abstract_cover_2.jpeg',
- image_type: ImageType.Internal,
-};
-
-function ViewIconGroup({ icon, onUpdateIcon, showCover, cover, onUpdateCover }: Props) {
- const { t } = useTranslation();
-
- const showAddIcon = !icon?.value;
-
- const showAddCover = !cover && showCover;
-
- const onAddIcon = useCallback(() => {
- const emoji = randomEmoji();
-
- onUpdateIcon(emoji);
- }, [onUpdateIcon]);
-
- const onAddCover = useCallback(() => {
- onUpdateCover?.(defaultCover);
- }, [onUpdateCover]);
-
- return (
- <div className={'flex items-center py-1'}>
- {showAddIcon && (
- <Button size={'small'} onClick={onAddIcon} color={'inherit'} startIcon={<EmojiEmotionsOutlined />}>
- {t('document.plugins.cover.addIcon')}
- </Button>
- )}
- {showAddCover && (
- <Button size={'small'} onClick={onAddCover} color={'inherit'} startIcon={<ImageIcon />}>
- {t('document.plugins.cover.addCover')}
- </Button>
- )}
- </div>
- );
-}
-
-export default ViewIconGroup;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/view_title/ViewTitle.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/_shared/view_title/ViewTitle.tsx
deleted file mode 100644
index 8d81b6d4b7..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/view_title/ViewTitle.tsx
+++ /dev/null
@@ -1,69 +0,0 @@
-import React, { useCallback, useEffect, useState } from 'react';
-import ViewBanner from '$app/components/_shared/view_title/ViewBanner';
-import { Page, PageCover, PageIcon } from '$app_reducers/pages/slice';
-import { ViewIconTypePB } from '@/services/backend';
-import ViewTitleInput from '$app/components/_shared/view_title/ViewTitleInput';
-
-interface Props {
- view: Page;
- showTitle?: boolean;
- onTitleChange?: (title: string) => void;
- onUpdateIcon?: (icon: PageIcon) => void;
- forceHover?: boolean;
- showCover?: boolean;
- onUpdateCover?: (cover?: PageCover) => void;
-}
-
-function ViewTitle({
- view,
- forceHover = false,
- onTitleChange,
- showTitle = true,
- onUpdateIcon: onUpdateIconProp,
- showCover = false,
- onUpdateCover,
-}: Props) {
- const [hover, setHover] = useState(false);
- const [icon, setIcon] = useState<PageIcon | undefined>(view.icon);
-
- useEffect(() => {
- setIcon(view.icon);
- }, [view.icon]);
-
- const onUpdateIcon = useCallback(
- (icon: string) => {
- const newIcon = {
- value: icon,
- ty: ViewIconTypePB.Emoji,
- };
-
- setIcon(newIcon);
- onUpdateIconProp?.(newIcon);
- },
- [onUpdateIconProp]
- );
-
- return (
- <div
- className={'flex flex-col justify-end'}
- onMouseEnter={() => setHover(true)}
- onMouseLeave={() => setHover(false)}
- >
- <ViewBanner
- showCover={showCover}
- cover={view.cover}
- icon={icon}
- hover={hover || forceHover}
- onUpdateIcon={onUpdateIcon}
- onUpdateCover={onUpdateCover}
- />
- {showTitle && (
- <div className='relative'>
- <ViewTitleInput value={view.name} onChange={onTitleChange} />
- </div>
- )}
- </div>
- );
-}
-
-export default ViewTitle;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/view_title/ViewTitleInput.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/_shared/view_title/ViewTitleInput.tsx
deleted file mode 100644
index 2c69bb4d76..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/view_title/ViewTitleInput.tsx
+++ /dev/null
@@ -1,31 +0,0 @@
-import React, { FormEventHandler, memo, useCallback, useRef } from 'react';
-import { TextareaAutosize } from '@mui/material';
-import { useTranslation } from 'react-i18next';
-
-function ViewTitleInput({ value, onChange }: { value: string; onChange?: (value: string) => void }) {
- const { t } = useTranslation();
- const textareaRef = useRef<HTMLTextAreaElement>(null);
-
- const onTitleChange: FormEventHandler<HTMLTextAreaElement> = useCallback(
- (e) => {
- const value = e.currentTarget.value;
-
- onChange?.(value);
- },
- [onChange]
- );
-
- return (
- <TextareaAutosize
- ref={textareaRef}
- placeholder={t('document.title.placeholder')}
- autoCorrect='off'
- autoFocus
- value={value}
- onInput={onTitleChange}
- className={`min-h-[40px] resize-none text-5xl font-bold leading-[50px] caret-text-title`}
- />
- );
-}
-
-export default memo(ViewTitleInput);
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/view_title/cover/Colors.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/_shared/view_title/cover/Colors.tsx
deleted file mode 100644
index 78b8bbcc46..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/view_title/cover/Colors.tsx
+++ /dev/null
@@ -1,21 +0,0 @@
-import React from 'react';
-import { colorMap } from '$app/utils/color';
-
-const colors = Object.entries(colorMap);
-
-function Colors({ onDone }: { onDone?: (value: string) => void }) {
- return (
- <div className={'flex flex-wrap justify-center gap-2 p-2 pb-6'}>
- {colors.map(([name, value]) => (
- <div
- key={name}
- className={'h-9 w-9 cursor-pointer rounded rounded-full'}
- style={{ backgroundColor: value }}
- onClick={() => onDone?.(name)}
- />
- ))}
- </div>
- );
-}
-
-export default Colors;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/view_title/cover/CoverPopover.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/_shared/view_title/cover/CoverPopover.tsx
deleted file mode 100644
index bd8c178380..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/view_title/cover/CoverPopover.tsx
+++ /dev/null
@@ -1,112 +0,0 @@
-import React, { useMemo } from 'react';
-import { CoverType, PageCover } from '$app_reducers/pages/slice';
-import { PopoverOrigin } from '@mui/material/Popover';
-import { EmbedLink, Unsplash, UploadTabs, TabOption, TAB_KEY, UploadImage } from '$app/components/_shared/image_upload';
-import { useTranslation } from 'react-i18next';
-import Colors from '$app/components/_shared/view_title/cover/Colors';
-import { ImageType } from '$app/application/document/document.types';
-import Button from '@mui/material/Button';
-
-const initialOrigin: {
- anchorOrigin: PopoverOrigin;
- transformOrigin: PopoverOrigin;
-} = {
- anchorOrigin: {
- vertical: 'bottom',
- horizontal: 'center',
- },
- transformOrigin: {
- vertical: 'top',
- horizontal: 'center',
- },
-};
-
-function CoverPopover({
- anchorEl,
- open,
- onClose,
- onUpdateCover,
- onRemoveCover,
-}: {
- anchorEl: HTMLElement | null;
- open: boolean;
- onClose: () => void;
- onUpdateCover?: (cover?: PageCover) => void;
- onRemoveCover?: () => void;
-}) {
- const { t } = useTranslation();
- const tabOptions: TabOption[] = useMemo(() => {
- return [
- {
- label: t('document.plugins.cover.colors'),
- key: TAB_KEY.Colors,
- Component: Colors,
- onDone: (value: string) => {
- onUpdateCover?.({
- cover_selection_type: CoverType.Color,
- cover_selection: value,
- image_type: ImageType.Internal,
- });
- },
- },
- {
- label: t('button.upload'),
- key: TAB_KEY.UPLOAD,
- Component: UploadImage,
- onDone: (value: string) => {
- onUpdateCover?.({
- cover_selection_type: CoverType.Image,
- cover_selection: value,
- image_type: ImageType.Local,
- });
- onClose();
- },
- },
- {
- label: t('document.imageBlock.embedLink.label'),
- key: TAB_KEY.EMBED_LINK,
- Component: EmbedLink,
- onDone: (value: string) => {
- onUpdateCover?.({
- cover_selection_type: CoverType.Image,
- cover_selection: value,
- image_type: ImageType.External,
- });
- onClose();
- },
- },
- {
- key: TAB_KEY.UNSPLASH,
- label: t('document.imageBlock.unsplash.label'),
- Component: Unsplash,
- onDone: (value: string) => {
- onUpdateCover?.({
- cover_selection_type: CoverType.Image,
- cover_selection: value,
- image_type: ImageType.External,
- });
- },
- },
- ];
- }, [onClose, onUpdateCover, t]);
-
- return (
- <UploadTabs
- popoverProps={{
- anchorEl,
- open,
- onClose,
- ...initialOrigin,
- }}
- containerStyle={{ width: 433, maxHeight: 300 }}
- tabOptions={tabOptions}
- extra={
- <Button color={'inherit'} size={'small'} className={'mr-4'} variant={'text'} onClick={onRemoveCover}>
- {t('button.remove')}
- </Button>
- }
- />
- );
-}
-
-export default CoverPopover;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/view_title/cover/ViewCover.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/_shared/view_title/cover/ViewCover.tsx
deleted file mode 100644
index f207e07886..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/view_title/cover/ViewCover.tsx
+++ /dev/null
@@ -1,80 +0,0 @@
-import React, { useCallback, useMemo, useRef, useState } from 'react';
-import { CoverType, PageCover } from '$app_reducers/pages/slice';
-import { renderColor } from '$app/utils/color';
-import ViewCoverActions from '$app/components/_shared/view_title/cover/ViewCoverActions';
-import CoverPopover from '$app/components/_shared/view_title/cover/CoverPopover';
-import DefaultImage from '$app/assets/images/default_cover.jpg';
-import { ImageType } from '$app/application/document/document.types';
-import { LocalImage } from '$app/components/_shared/image_upload';
-
-export function ViewCover({ cover, onUpdateCover }: { cover: PageCover; onUpdateCover?: (cover?: PageCover) => void }) {
- const {
- cover_selection_type: type,
- cover_selection: value = '',
- image_type: source,
- } = useMemo(() => cover || {}, [cover]);
- const [showAction, setShowAction] = useState(false);
- const actionRef = useRef<HTMLDivElement>(null);
- const [showPopover, setShowPopover] = useState(false);
-
- const renderCoverColor = useCallback((color: string) => {
- return (
- <div
- style={{
- backgroundColor: renderColor(color),
- }}
- className={`h-full w-full`}
- />
- );
- }, []);
-
- const renderCoverImage = useCallback((url: string) => {
- return <img draggable={false} src={url} alt={''} className={'h-full w-full object-cover'} />;
- }, []);
-
- const handleRemoveCover = useCallback(() => {
- onUpdateCover?.(null);
- }, [onUpdateCover]);
-
- const handleClickChange = useCallback(() => {
- setShowPopover(true);
- }, []);
-
- return (
- <div
- onMouseEnter={() => {
- setShowAction(true);
- }}
- onMouseLeave={() => {
- setShowAction(false);
- }}
- className={'relative flex h-[255px] w-full'}
- >
- {source === ImageType.Local ? (
- <LocalImage src={value} className={'h-full w-full object-cover'} />
- ) : (
- <>
- {type === CoverType.Asset ? renderCoverImage(DefaultImage) : null}
- {type === CoverType.Color ? renderCoverColor(value) : null}
- {type === CoverType.Image ? renderCoverImage(value) : null}
- </>
- )}
-
- <ViewCoverActions
- show={showAction}
- ref={actionRef}
- onRemove={handleRemoveCover}
- onClickChange={handleClickChange}
- />
- {showPopover && (
- <CoverPopover
- open={showPopover}
- onClose={() => setShowPopover(false)}
- anchorEl={actionRef.current}
- onUpdateCover={onUpdateCover}
- onRemoveCover={handleRemoveCover}
- />
- )}
- </div>
- );
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/view_title/cover/ViewCoverActions.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/_shared/view_title/cover/ViewCoverActions.tsx
deleted file mode 100644
index fbf8063f44..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/view_title/cover/ViewCoverActions.tsx
+++ /dev/null
@@ -1,44 +0,0 @@
-import React, { forwardRef } from 'react';
-import Button from '@mui/material/Button';
-import { useTranslation } from 'react-i18next';
-import { ReactComponent as DeleteIcon } from '$app/assets/delete.svg';
-
-function ViewCoverActions(
- { show, onRemove, onClickChange }: { show: boolean; onRemove: () => void; onClickChange: () => void },
- ref: React.ForwardedRef<HTMLDivElement>
-) {
- const { t } = useTranslation();
-
- return (
- <div className={'absolute bottom-0 left-1/2 w-[964px] min-w-0 max-w-full -translate-x-1/2 transform'}>
- <div ref={ref} className={`absolute ${show ? 'flex' : 'opacity-0'} bottom-4 right-0 items-center space-x-2 p-2`}>
- <div className={'flex items-center space-x-2'}>
- <Button
- onClick={onClickChange}
- className={'min-w-0 p-1.5'}
- size={'small'}
- variant={'contained'}
- color={'inherit'}
- >
- {t('document.plugins.cover.changeCover')}
- </Button>
- <Button
- variant={'contained'}
- size={'small'}
- className={'min-h-0 min-w-0 p-1.5'}
- sx={{
- '.MuiButton-startIcon': {
- marginRight: '0px',
- },
- }}
- onClick={onRemove}
- color={'inherit'}
- startIcon={<DeleteIcon />}
- />
- </div>
- </div>
- </div>
- );
-}
-
-export default forwardRef(ViewCoverActions);
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/view_title/cover/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/_shared/view_title/cover/index.ts
deleted file mode 100644
index 8df50bb41e..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/view_title/cover/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './ViewCover';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/auth/LoginButtonGroup.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/auth/LoginButtonGroup.tsx
deleted file mode 100644
index 481b80a532..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/auth/LoginButtonGroup.tsx
+++ /dev/null
@@ -1,51 +0,0 @@
-import Button from '@mui/material/Button';
-import GoogleIcon from '$app/assets/settings/google.png';
-import GithubIcon from '$app/assets/settings/github.png';
-import DiscordIcon from '$app/assets/settings/discord.png';
-import { useTranslation } from 'react-i18next';
-import { useAuth } from '$app/components/auth/auth.hooks';
-import { ProviderTypePB } from '@/services/backend';
-
-export const LoginButtonGroup = () => {
- const { t } = useTranslation();
-
- const { signIn } = useAuth();
-
- return (
- <div className={'flex w-full flex-col items-center gap-4'}>
- <Button
- onClick={() => {
- void signIn(ProviderTypePB.Google);
- }}
- className={'w-full rounded-lg border-text-title py-3 text-sm'}
- color={'inherit'}
- variant={'outlined'}
- >
- <img src={GoogleIcon} alt={'Google'} className={'mr-2 h-6 w-6'} />
- {t('button.signInGoogle')}
- </Button>
- <Button
- onClick={() => {
- void signIn(ProviderTypePB.Github);
- }}
- className={'w-full rounded-lg border-text-title py-3 text-sm'}
- color={'inherit'}
- variant={'outlined'}
- >
- <img src={GithubIcon} alt={'Github'} className={'mr-2 h-6 w-6'} />
- {t('button.signInGithub')}
- </Button>
- <Button
- onClick={() => {
- void signIn(ProviderTypePB.Discord);
- }}
- className={'w-full rounded-lg border-text-title py-3 text-sm'}
- color={'inherit'}
- variant={'outlined'}
- >
- <img src={DiscordIcon} alt={'Discord'} className={'mr-2 h-6 w-6'} />
- {t('button.signInDiscord')}
- </Button>
- </div>
- );
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/auth/ProtectedRoutes.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/auth/ProtectedRoutes.tsx
deleted file mode 100644
index 523f0b5188..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/auth/ProtectedRoutes.tsx
+++ /dev/null
@@ -1,127 +0,0 @@
-import { Outlet } from 'react-router-dom';
-import { useAuth } from './auth.hooks';
-import Layout from '$app/components/layout/Layout';
-import { useCallback, useEffect, useState } from 'react';
-import { Welcome } from '$app/components/auth/Welcome';
-import { isTauri } from '$app/utils/env';
-import { notify } from '$app/components/_shared/notify';
-import { currentUserActions, LoginState } from '$app_reducers/current-user/slice';
-import { CircularProgress, Portal } from '@mui/material';
-import { ReactComponent as Logo } from '$app/assets/logo.svg';
-import { useAppDispatch } from '$app/stores/store';
-
-export const ProtectedRoutes = () => {
- const { currentUser, checkUser, subscribeToUser, signInWithOAuth } = useAuth();
- const dispatch = useAppDispatch();
-
- const isLoading = currentUser?.loginState === LoginState.Loading;
-
- const [checked, setChecked] = useState(false);
-
- const checkUserStatus = useCallback(async () => {
- await checkUser();
- setChecked(true);
- }, [checkUser]);
-
- useEffect(() => {
- void checkUserStatus();
- }, [checkUserStatus]);
-
- useEffect(() => {
- if (currentUser.isAuthenticated) {
- return subscribeToUser();
- }
- }, [currentUser.isAuthenticated, subscribeToUser]);
-
- const onDeepLink = useCallback(async () => {
- if (!isTauri()) return;
- const { event } = await import('@tauri-apps/api');
-
- // On macOS You still have to install a .app bundle you got from tauri build --debug for this to work!
- return await event.listen('open_deep_link', async (e) => {
- const payload = e.payload as string;
-
- const [, hash] = payload.split('//#');
- const obj = parseHash(hash);
-
- if (!obj.access_token) {
- notify.error('Failed to sign in, the access token is missing');
- dispatch(currentUserActions.setLoginState(LoginState.Error));
- return;
- }
-
- try {
- await signInWithOAuth(payload);
- } catch (e) {
- notify.error('Failed to sign in, please try again');
- }
- });
- }, [dispatch, signInWithOAuth]);
-
- useEffect(() => {
- void onDeepLink();
- }, [onDeepLink]);
-
- return (
- <div className={'relative h-screen w-screen'}>
- {checked ? (
- <SplashScreen isAuthenticated={currentUser.isAuthenticated} />
- ) : (
- <div className={'flex h-screen w-screen items-center justify-center'}>
- <Logo className={'h-20 w-20'} />
- </div>
- )}
-
- {isLoading && <StartLoading />}
- </div>
- );
-};
-
-const StartLoading = () => {
- const dispatch = useAppDispatch();
-
- useEffect(() => {
- const preventDefault = (e: KeyboardEvent) => {
- if (e.key === 'Escape') {
- e.preventDefault();
- dispatch(currentUserActions.resetLoginState());
- }
- };
-
- document.addEventListener('keydown', preventDefault, true);
-
- return () => {
- document.removeEventListener('keydown', preventDefault, true);
- };
- }, [dispatch]);
- return (
- <Portal>
- <div className={'fixed inset-0 z-[1400] flex h-full w-full items-center justify-center bg-bg-mask bg-opacity-50'}>
- <CircularProgress />
- </div>
- </Portal>
- );
-};
-
-const SplashScreen = ({ isAuthenticated }: { isAuthenticated: boolean }) => {
- if (isAuthenticated) {
- return (
- <Layout>
- <Outlet />
- </Layout>
- );
- } else {
- return <Welcome />;
- }
-};
-
-function parseHash(hash: string) {
- const hashParams = new URLSearchParams(hash);
- const hashObject: Record<string, string> = {};
-
- for (const [key, value] of hashParams) {
- hashObject[key] = value;
- }
-
- return hashObject;
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/auth/Welcome.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/auth/Welcome.tsx
deleted file mode 100644
index eadcf08c21..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/auth/Welcome.tsx
+++ /dev/null
@@ -1,55 +0,0 @@
-import { ReactComponent as AppflowyLogo } from '$app/assets/logo.svg';
-import Button from '@mui/material/Button';
-import { useTranslation } from 'react-i18next';
-import { LoginButtonGroup } from '$app/components/auth/LoginButtonGroup';
-import { useAuth } from '$app/components/auth/auth.hooks';
-import { Log } from '$app/utils/log';
-
-export const Welcome = () => {
- const { signInAsAnonymous } = useAuth();
- const { t } = useTranslation();
-
- return (
- <>
- <form onSubmit={(e) => e.preventDefault()} method='POST'>
- <div className='relative flex h-screen w-screen flex-col items-center justify-center gap-12 bg-bg-body text-center text-text-title'>
- <div className='flex justify-center' id='appflowy'>
- <AppflowyLogo className={'h-16 w-16'} />
- </div>
-
- <div>
- <span className='text-2xl font-semibold leading-9'>
- {t('welcomeTo')} {t('appName')}
- </span>
- </div>
-
- <div id='Get-Started' className='flex w-[340px] flex-col gap-4 ' aria-label='Get-Started'>
- <Button
- size={'large'}
- color={'inherit'}
- className={'border-transparent bg-line-divider py-3'}
- variant={'outlined'}
- onClick={async () => {
- try {
- await signInAsAnonymous();
- } catch (e) {
- Log.error(e);
- }
- }}
- >
- {t('signIn.loginStartWithAnonymous')}
- </Button>
- <div className={'flex w-full items-center justify-center gap-2 text-sm'}>
- <div className={'h-px flex-1 bg-line-divider'} />
- {t('signIn.or')}
- <div className={'h-px flex-1 bg-line-divider'} />
- </div>
- <div className={'w-w-full flex items-center justify-center gap-2 text-sm'}>
- <LoginButtonGroup />
- </div>
- </div>
- </div>
- </form>
- </>
- );
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/auth/auth.hooks.ts b/frontend/appflowy_tauri/src/appflowy_app/components/auth/auth.hooks.ts
deleted file mode 100644
index 89b7388e64..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/auth/auth.hooks.ts
+++ /dev/null
@@ -1,186 +0,0 @@
-import { currentUserActions, LoginState, parseWorkspaceSettingPBToSetting } from '$app_reducers/current-user/slice';
-import { AuthenticatorPB, ProviderTypePB, UserNotification, UserProfilePB } from '@/services/backend/events/flowy-user';
-import { UserService } from '$app/application/user/user.service';
-import { AuthService } from '$app/application/user/auth.service';
-import { useAppDispatch, useAppSelector } from '$app/stores/store';
-import { getCurrentWorkspaceSetting } from '$app/application/folder/workspace.service';
-import { useCallback } from 'react';
-import { subscribeNotifications } from '$app/application/notification';
-import { nanoid } from 'nanoid';
-import { open } from '@tauri-apps/api/shell';
-
-export const useAuth = () => {
- const dispatch = useAppDispatch();
- const currentUser = useAppSelector((state) => state.currentUser);
-
- // Subscribe to user update events
- const subscribeToUser = useCallback(() => {
- const unsubscribePromise = subscribeNotifications({
- [UserNotification.DidUpdateUserProfile]: async (changeset) => {
- dispatch(
- currentUserActions.updateUser({
- email: changeset.email,
- displayName: changeset.name,
- iconUrl: changeset.icon_url,
- })
- );
- },
- });
-
- return () => {
- void unsubscribePromise.then((fn) => fn());
- };
- }, [dispatch]);
-
- const setUser = useCallback(
- async (userProfile?: Partial<UserProfilePB>) => {
- if (!userProfile) return;
-
- const workspaceSetting = await getCurrentWorkspaceSetting();
-
- const isLocal = userProfile.authenticator === AuthenticatorPB.Local;
-
- dispatch(
- currentUserActions.updateUser({
- id: userProfile.id,
- token: userProfile.token,
- email: userProfile.email,
- displayName: userProfile.name,
- iconUrl: userProfile.icon_url,
- isAuthenticated: true,
- workspaceSetting: workspaceSetting ? parseWorkspaceSettingPBToSetting(workspaceSetting) : undefined,
- isLocal,
- })
- );
- },
- [dispatch]
- );
-
- // Check if the user is authenticated
- const checkUser = useCallback(async () => {
- const userProfile = await UserService.getUserProfile();
-
- await setUser(userProfile);
-
- return userProfile;
- }, [setUser]);
-
- const register = useCallback(
- async (email: string, password: string, name: string): Promise<UserProfilePB> => {
- const deviceId = currentUser?.deviceId ?? nanoid(8);
- const userProfile = await AuthService.signUp({ deviceId, email, password, name });
-
- await setUser(userProfile);
-
- return userProfile;
- },
- [setUser, currentUser?.deviceId]
- );
-
- const logout = useCallback(async () => {
- await AuthService.signOut();
- dispatch(currentUserActions.logout());
- }, [dispatch]);
-
- const signInAsAnonymous = useCallback(async () => {
- const fakeEmail = nanoid(8) + '@appflowy.io';
- const fakePassword = 'AppFlowy123@';
- const fakeName = 'Me';
-
- await register(fakeEmail, fakePassword, fakeName);
- }, [register]);
-
- const signIn = useCallback(
- async (provider: ProviderTypePB) => {
- dispatch(currentUserActions.setLoginState(LoginState.Loading));
- try {
- const url = await AuthService.getOAuthURL(provider);
-
- await open(url);
- } catch {
- dispatch(currentUserActions.setLoginState(LoginState.Error));
- }
- },
- [dispatch]
- );
-
- const signInWithOAuth = useCallback(
- async (uri: string) => {
- dispatch(currentUserActions.setLoginState(LoginState.Loading));
- try {
- const deviceId = currentUser?.deviceId ?? nanoid(8);
-
- await AuthService.signInWithOAuth({ uri, deviceId });
- const userProfile = await UserService.getUserProfile();
-
- await setUser(userProfile);
-
- return userProfile;
- } catch (e) {
- dispatch(currentUserActions.setLoginState(LoginState.Error));
- return Promise.reject(e);
- }
- },
- [dispatch, currentUser?.deviceId, setUser]
- );
-
- // Only for development purposes
- const signInWithEmailPassword = useCallback(
- async (email: string, password: string, domain?: string) => {
- dispatch(currentUserActions.setLoginState(LoginState.Loading));
-
- try {
- const response = await fetch(
- `https://${domain ? domain : 'test.appflowy.cloud'}/gotrue/token?grant_type=password`,
- {
- method: 'POST',
- mode: 'cors',
- cache: 'no-cache',
- credentials: 'same-origin',
- headers: {
- 'Content-Type': 'application/json',
- },
- redirect: 'follow',
- referrerPolicy: 'no-referrer',
- body: JSON.stringify({
- email,
- password,
- }),
- }
- );
-
- const data = await response.json();
-
- let uri = `appflowy-flutter://#`;
- const params: string[] = [];
-
- Object.keys(data).forEach((key) => {
- if (typeof data[key] === 'object') {
- return;
- }
-
- params.push(`${key}=${data[key]}`);
- });
- uri += params.join('&');
-
- return signInWithOAuth(uri);
- } catch (e) {
- dispatch(currentUserActions.setLoginState(LoginState.Error));
- return Promise.reject(e);
- }
- },
- [dispatch, signInWithOAuth]
- );
-
- return {
- currentUser,
- checkUser,
- register,
- logout,
- subscribeToUser,
- signInAsAnonymous,
- signIn,
- signInWithOAuth,
- signInWithEmailPassword,
- };
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/Database.hooks.ts b/frontend/appflowy_tauri/src/appflowy_app/components/database/Database.hooks.ts
deleted file mode 100644
index 2597c158a1..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/Database.hooks.ts
+++ /dev/null
@@ -1,204 +0,0 @@
-import { createContext, useCallback, useContext, useEffect, useMemo } from 'react';
-import { useSearchParams } from 'react-router-dom';
-import { proxy, useSnapshot } from 'valtio';
-
-import { DatabaseLayoutPB, DatabaseNotification, FieldVisibility } from '@/services/backend';
-import { subscribeNotifications } from '$app/application/notification';
-import {
- Cell,
- Database,
- databaseService,
- cellListeners,
- fieldListeners,
- rowListeners,
- sortListeners,
- filterListeners,
-} from '$app/application/database';
-
-export function useSelectDatabaseView({ viewId }: { viewId?: string }) {
- const key = 'v';
- const [searchParams, setSearchParams] = useSearchParams();
-
- const selectedViewId = useMemo(() => searchParams.get(key) || viewId, [searchParams, viewId]);
-
- const onChange = useCallback(
- (value: string) => {
- setSearchParams({ [key]: value });
- },
- [setSearchParams]
- );
-
- return {
- selectedViewId,
- onChange,
- };
-}
-
-const DatabaseContext = createContext<Database>({
- id: '',
- isLinked: false,
- layoutType: DatabaseLayoutPB.Grid,
- fields: [],
- rowMetas: [],
- filters: [],
- sorts: [],
- groupSettings: [],
- groups: [],
- typeOptions: {},
- cells: {},
-});
-
-export const DatabaseProvider = DatabaseContext.Provider;
-
-export const useDatabase = () => useSnapshot(useContext(DatabaseContext));
-
-export const useSelectorCell = (rowId: string, fieldId: string) => {
- const database = useContext(DatabaseContext);
- const cells = useSnapshot(database.cells);
-
- return cells[`${rowId}:${fieldId}`];
-};
-
-export const useDispatchCell = () => {
- const database = useContext(DatabaseContext);
-
- const setCell = useCallback(
- (cell: Cell) => {
- const id = `${cell.rowId}:${cell.fieldId}`;
-
- database.cells[id] = cell;
- },
- [database]
- );
-
- const deleteCells = useCallback(
- ({ rowId, fieldId }: { rowId: string; fieldId?: string }) => {
- cellListeners.didDeleteCells({ database, rowId, fieldId });
- },
- [database]
- );
-
- return {
- deleteCells,
- setCell,
- };
-};
-
-export const useDatabaseSorts = () => {
- const context = useContext(DatabaseContext);
-
- return useSnapshot(context.sorts);
-};
-
-export const useSortsCount = () => {
- const { sorts } = useDatabase();
-
- return sorts?.length;
-};
-
-export const useFiltersCount = () => {
- const { filters, fields } = useDatabase();
-
- // filter fields: if the field is deleted, it will not be displayed
- return useMemo(
- () => filters?.map((filter) => fields.find((field) => field.id === filter.fieldId)).filter(Boolean).length,
- [filters, fields]
- );
-};
-
-export function useStaticTypeOption<T>(fieldId: string) {
- const context = useContext(DatabaseContext);
- const typeOptions = context.typeOptions;
-
- return typeOptions[fieldId] as T;
-}
-
-export function useTypeOption<T>(fieldId: string) {
- const context = useContext(DatabaseContext);
- const typeOptions = useSnapshot(context.typeOptions);
-
- return typeOptions[fieldId] as T;
-}
-
-export const useDatabaseVisibilityRows = () => {
- const { rowMetas } = useDatabase();
-
- return useMemo(() => rowMetas.filter((row) => row && !row.isHidden), [rowMetas]);
-};
-
-export const useDatabaseVisibilityFields = () => {
- const database = useDatabase();
-
- return useMemo(
- () => database.fields.filter((field) => field.visibility !== FieldVisibility.AlwaysHidden),
- [database.fields]
- );
-};
-
-export const useConnectDatabase = (viewId: string) => {
- const database = useMemo(() => {
- const proxyDatabase = proxy<Database>({
- id: '',
- isLinked: false,
- layoutType: DatabaseLayoutPB.Grid,
- fields: [],
- rowMetas: [],
- filters: [],
- sorts: [],
- groupSettings: [],
- groups: [],
- typeOptions: {},
- cells: {},
- });
-
- void databaseService.openDatabase(viewId).then((value) => Object.assign(proxyDatabase, value));
-
- return proxyDatabase;
- }, [viewId]);
-
- useEffect(() => {
- const unsubscribePromise = subscribeNotifications(
- {
- [DatabaseNotification.DidUpdateFields]: async (changeset) => {
- await fieldListeners.didUpdateFields(viewId, database, changeset);
- },
- [DatabaseNotification.DidUpdateFieldSettings]: (changeset) => {
- fieldListeners.didUpdateFieldSettings(database, changeset);
- },
- [DatabaseNotification.DidUpdateViewRows]: async (changeset) => {
- await rowListeners.didUpdateViewRows(viewId, database, changeset);
- },
- [DatabaseNotification.DidReorderRows]: (changeset) => {
- rowListeners.didReorderRows(database, changeset);
- },
- [DatabaseNotification.DidReorderSingleRow]: (changeset) => {
- rowListeners.didReorderSingleRow(database, changeset);
- },
-
- [DatabaseNotification.DidUpdateSort]: (changeset) => {
- sortListeners.didUpdateSort(database, changeset);
- },
-
- [DatabaseNotification.DidUpdateFilter]: (changeset) => {
- filterListeners.didUpdateFilter(database, changeset);
- },
- [DatabaseNotification.DidUpdateViewRowsVisibility]: async (changeset) => {
- await rowListeners.didUpdateViewRowsVisibility(viewId, database, changeset);
- },
- },
- { id: viewId }
- );
-
- return () => void unsubscribePromise.then((unsubscribe) => unsubscribe());
- }, [viewId, database]);
-
- return database;
-};
-
-const DatabaseRenderedContext = createContext<(viewId: string) => void>(() => {
- return;
-});
-
-export const DatabaseRenderedProvider = DatabaseRenderedContext.Provider;
-
-export const useDatabaseRendered = () => useContext(DatabaseRenderedContext);
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/Database.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/Database.tsx
deleted file mode 100644
index d5e7bba45b..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/Database.tsx
+++ /dev/null
@@ -1,202 +0,0 @@
-import React, { forwardRef, useCallback, useEffect, useMemo, useRef, useState } from 'react';
-import { useViewId } from '$app/hooks/ViewId.hooks';
-import { databaseViewService } from '$app/application/database';
-import { DatabaseTabBar } from './components';
-import { DatabaseLoader } from './DatabaseLoader';
-import { DatabaseView } from './DatabaseView';
-import { DatabaseCollection } from './components/database_settings';
-import SwipeableViews from 'react-swipeable-views';
-import { TabPanel } from '$app/components/database/components/tab_bar/ViewTabs';
-import DatabaseSettings from '$app/components/database/components/database_settings/DatabaseSettings';
-import { Portal } from '@mui/material';
-import { useTranslation } from 'react-i18next';
-import { ErrorCode, FolderNotification } from '@/services/backend';
-import ExpandRecordModal from '$app/components/database/components/edit_record/ExpandRecordModal';
-import { subscribeNotifications } from '$app/application/notification';
-import { Page } from '$app_reducers/pages/slice';
-import { getPage } from '$app/application/folder/page.service';
-import './database.scss';
-
-interface Props {
- selectedViewId?: string;
- setSelectedViewId?: (viewId: string) => void;
-}
-
-export const Database = forwardRef<HTMLDivElement, Props>(({ selectedViewId, setSelectedViewId }, ref) => {
- const innerRef = useRef<HTMLDivElement>();
- const databaseRef = (ref ?? innerRef) as React.MutableRefObject<HTMLDivElement>;
- const viewId = useViewId();
- const [settingDom, setSettingDom] = useState<HTMLDivElement | null>(null);
-
- const [page, setPage] = useState<Page | null>(null);
- const { t } = useTranslation();
- const [notFound, setNotFound] = useState(false);
- const [childViews, setChildViews] = useState<Page[]>([]);
- const [editRecordRowId, setEditRecordRowId] = useState<string | null>(null);
- const [openCollections, setOpenCollections] = useState<string[]>([]);
-
- const handleResetDatabaseViews = useCallback(async (viewId: string) => {
- await databaseViewService
- .getDatabaseViews(viewId)
- .then((value) => {
- setChildViews(value);
- })
- .catch((err) => {
- if (err.code === ErrorCode.RecordNotFound) {
- setNotFound(true);
- }
- });
- }, []);
-
- const handleGetPage = useCallback(async () => {
- try {
- const page = await getPage(viewId);
-
- setPage(page);
- } catch (e) {
- setNotFound(true);
- }
- }, [viewId]);
-
- const parentId = page?.parentId;
-
- useEffect(() => {
- void handleGetPage();
- void handleResetDatabaseViews(viewId);
- const unsubscribePromise = subscribeNotifications({
- [FolderNotification.DidUpdateView]: (changeset) => {
- if (changeset.parent_view_id !== viewId && changeset.id !== viewId) return;
- setChildViews((prev) => {
- const index = prev.findIndex((view) => view.id === changeset.id);
-
- if (index === -1) {
- return prev;
- }
-
- const newViews = [...prev];
-
- newViews[index] = {
- ...newViews[index],
- name: changeset.name,
- };
-
- return newViews;
- });
- },
- [FolderNotification.DidUpdateChildViews]: (changeset) => {
- if (changeset.parent_view_id !== viewId && changeset.parent_view_id !== parentId) return;
- if (changeset.create_child_views.length === 0 && changeset.delete_child_views.length === 0) {
- return;
- }
-
- void handleResetDatabaseViews(viewId);
- },
- });
-
- return () => void unsubscribePromise.then((unsubscribe) => unsubscribe());
- }, [handleGetPage, handleResetDatabaseViews, viewId, parentId]);
-
- const value = useMemo(() => {
- return Math.max(
- 0,
- childViews.findIndex((view) => view.id === (selectedViewId ?? viewId))
- );
- }, [childViews, selectedViewId, viewId]);
-
- const onToggleCollection = useCallback(
- (id: string, forceOpen?: boolean) => {
- if (forceOpen) {
- setOpenCollections((prev) => {
- if (prev.includes(id)) {
- return prev;
- }
-
- return [...prev, id];
- });
- return;
- }
-
- if (openCollections.includes(id)) {
- setOpenCollections((prev) => prev.filter((item) => item !== id));
- } else {
- setOpenCollections((prev) => [...prev, id]);
- }
- },
- [openCollections, setOpenCollections]
- );
-
- const onEditRecord = useCallback(
- (rowId: string) => {
- setEditRecordRowId(rowId);
- },
- [setEditRecordRowId]
- );
-
- if (notFound) {
- return (
- <div className='mb-2 flex h-full w-full items-center justify-center rounded border border-dashed border-line-divider'>
- <p className={'text-xl text-text-caption'}>{t('deletePagePrompt.text')}</p>
- </div>
- );
- }
-
- return (
- <div
- ref={databaseRef}
- className='appflowy-database relative flex w-full flex-1 select-none flex-col overflow-y-hidden'
- >
- <DatabaseTabBar
- pageId={viewId}
- setSelectedViewId={setSelectedViewId}
- selectedViewId={selectedViewId}
- childViews={childViews}
- ref={setSettingDom}
- />
- <SwipeableViews
- slideStyle={{
- overflow: 'hidden',
- }}
- className={'flex-1 overflow-hidden'}
- axis={'x'}
- index={value}
- >
- {childViews.map((view, index) => (
- <TabPanel
- data-view-id={view.id}
- className={'flex h-full w-full flex-col'}
- key={view.id}
- index={index}
- value={value}
- >
- <DatabaseLoader viewId={view.id}>
- {selectedViewId === view.id && (
- <>
- {settingDom && (
- <Portal container={settingDom}>
- <DatabaseSettings
- onToggleCollection={(forceOpen?: boolean) => onToggleCollection(view.id, forceOpen)}
- />
- </Portal>
- )}
-
- <DatabaseCollection open={openCollections.includes(view.id)} />
- {editRecordRowId && (
- <ExpandRecordModal
- rowId={editRecordRowId}
- open={Boolean(editRecordRowId)}
- onClose={() => {
- setEditRecordRowId(null);
- }}
- />
- )}
- </>
- )}
-
- <DatabaseView onEditRecord={onEditRecord} />
- </DatabaseLoader>
- </TabPanel>
- ))}
- </SwipeableViews>
- </div>
- );
-});
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/DatabaseLoader.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/DatabaseLoader.tsx
deleted file mode 100644
index b0aeab10a2..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/DatabaseLoader.tsx
+++ /dev/null
@@ -1,18 +0,0 @@
-import { FC, PropsWithChildren } from 'react';
-import { ViewIdProvider } from '$app/hooks';
-import { DatabaseProvider, useConnectDatabase } from './Database.hooks';
-
-export interface DatabaseLoaderProps {
- viewId: string;
-}
-
-export const DatabaseLoader: FC<PropsWithChildren<DatabaseLoaderProps>> = ({ viewId, children }) => {
- const database = useConnectDatabase(viewId);
-
- return (
- <DatabaseProvider value={database}>
- {/* Make sure that the viewId is current */}
- <ViewIdProvider value={viewId}>{children}</ViewIdProvider>
- </DatabaseProvider>
- );
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/DatabaseTitle.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/DatabaseTitle.tsx
deleted file mode 100644
index cd94947d8d..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/DatabaseTitle.tsx
+++ /dev/null
@@ -1,32 +0,0 @@
-import { FormEventHandler, useCallback } from 'react';
-import { useViewId } from '$app/hooks';
-import { useAppDispatch, useAppSelector } from '$app/stores/store';
-import { updatePageName } from '$app_reducers/pages/async_actions';
-import { useTranslation } from 'react-i18next';
-
-export const DatabaseTitle = () => {
- const viewId = useViewId();
- const { t } = useTranslation();
- const pageName = useAppSelector((state) => state.pages.pageMap[viewId]?.name || '');
- const dispatch = useAppDispatch();
-
- const handleInput = useCallback<FormEventHandler>(
- (event) => {
- const newTitle = (event.target as HTMLInputElement).value;
-
- void dispatch(updatePageName({ id: viewId, name: newTitle }));
- },
- [viewId, dispatch]
- );
-
- return (
- <div className='mb-6 h-[70px] px-16 pt-8'>
- <input
- className='text-4xl font-semibold'
- value={pageName}
- placeholder={t('grid.title.placeholder')}
- onInput={handleInput}
- />
- </div>
- );
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/DatabaseView.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/DatabaseView.tsx
deleted file mode 100644
index 98b16d5fea..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/DatabaseView.tsx
+++ /dev/null
@@ -1,23 +0,0 @@
-import { DatabaseLayoutPB } from '@/services/backend';
-import { FC } from 'react';
-import { useDatabase } from './Database.hooks';
-import { Grid } from './grid';
-import { Board } from './board';
-import { Calendar } from './calendar';
-
-export const DatabaseView: FC<{
- onEditRecord: (rowId: string) => void;
-}> = (props) => {
- const { layoutType } = useDatabase();
-
- switch (layoutType) {
- case DatabaseLayoutPB.Grid:
- return <Grid {...props} />;
- case DatabaseLayoutPB.Board:
- return <Board />;
- case DatabaseLayoutPB.Calendar:
- return <Calendar />;
- default:
- return null;
- }
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/_shared/CellText.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/_shared/CellText.tsx
deleted file mode 100644
index 01666121cd..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/_shared/CellText.tsx
+++ /dev/null
@@ -1,17 +0,0 @@
-import React, { HTMLAttributes, PropsWithChildren } from 'react';
-
-export interface CellTextProps {
- className?: string;
-}
-
-export const CellText = React.forwardRef<HTMLDivElement, PropsWithChildren<HTMLAttributes<HTMLDivElement>>>(
- function CellText(props, ref) {
- const { children, className, ...other } = props;
-
- return (
- <div ref={ref} className={['flex w-full p-2', className].join(' ')} {...other}>
- <span className='inline-block flex-1 truncate text-sm'>{children}</span>
- </div>
- );
- }
-);
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/_shared/LinearProgressWithLabel.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/_shared/LinearProgressWithLabel.tsx
deleted file mode 100644
index 7d4c0d1811..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/_shared/LinearProgressWithLabel.tsx
+++ /dev/null
@@ -1,47 +0,0 @@
-import React, { useMemo } from 'react';
-
-function LinearProgressWithLabel({
- value,
- count,
- selectedCount,
-}: {
- value: number;
- count: number;
- selectedCount: number;
-}) {
- const result = useMemo(() => `${Math.round(value * 100)}%`, [value]);
-
- const options = useMemo(() => {
- return Array.from({ length: count }, (_, i) => ({
- id: i,
- checked: i < selectedCount,
- }));
- }, [count, selectedCount]);
-
- const isSplit = count < 6;
-
- return (
- <div className={'flex w-full items-center'}>
- <div className={`flex flex-1 items-center justify-between px-1 ${isSplit ? 'gap-0.5' : ''}`}>
- {options.map((option) => (
- <span
- style={{
- width: `${Math.round(100 / count)}%`,
- backgroundColor:
- value < 1
- ? option.checked
- ? 'var(--content-blue-400)'
- : 'var(--content-blue-100)'
- : 'var(--function-success)',
- }}
- className={`h-[4px] ${isSplit ? 'rounded-full' : ''} `}
- key={option.id}
- />
- ))}
- </div>
- <div className={'w-[30px] text-center text-xs text-text-caption'}>{result}</div>
- </div>
- );
-}
-
-export default LinearProgressWithLabel;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/_shared/constants.ts b/frontend/appflowy_tauri/src/appflowy_app/components/database/_shared/constants.ts
deleted file mode 100644
index fd1aab7a37..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/_shared/constants.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-export enum DragType {
- Row = 'row',
- Field = 'field',
-}
-
-export enum DropPosition {
- Before = 0,
- After = 1,
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/_shared/dnd/dnd.context.ts b/frontend/appflowy_tauri/src/appflowy_app/components/database/_shared/dnd/dnd.context.ts
deleted file mode 100644
index 8954dc733a..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/_shared/dnd/dnd.context.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-import { createContext } from 'react';
-import { proxy } from 'valtio';
-
-export interface DragItem<T = Record<string, unknown>> {
- type: string;
- data: T;
-}
-
-export interface DndContextDescriptor {
- dragging: DragItem | null,
-}
-
-const defaultDndContext: DndContextDescriptor = proxy({
- dragging: null,
-});
-
-export const DndContext = createContext<DndContextDescriptor>(defaultDndContext);
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/_shared/dnd/drag.hooks.ts b/frontend/appflowy_tauri/src/appflowy_app/components/database/_shared/dnd/drag.hooks.ts
deleted file mode 100644
index ce8afe6f31..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/_shared/dnd/drag.hooks.ts
+++ /dev/null
@@ -1,114 +0,0 @@
-import { DragEventHandler, useCallback, useContext, useMemo, useRef, useState } from 'react';
-import { DndContext } from './dnd.context';
-import { autoScrollOnEdge, EdgeGap, getScrollParent, ScrollDirection } from './utils';
-
-export interface UseDraggableOptions {
- type: string;
- effectAllowed?: DataTransfer['effectAllowed'];
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- data?: Record<string, any>;
- disabled?: boolean;
- scrollOnEdge?: {
- direction?: ScrollDirection;
- getScrollElement?: () => HTMLElement | null;
- edgeGap?: number | Partial<EdgeGap>;
- };
-}
-
-export const useDraggable = ({
- type,
- effectAllowed = 'copyMove',
- data,
- disabled,
- scrollOnEdge,
-}: UseDraggableOptions) => {
- const scrollDirection = scrollOnEdge?.direction;
- const edgeGap = scrollOnEdge?.edgeGap;
-
- const context = useContext(DndContext);
- const typeRef = useRef(type);
- const dataRef = useRef(data);
- const previewRef = useRef<Element | null>(null);
- const [isDragging, setIsDragging] = useState(false);
-
- typeRef.current = type;
- dataRef.current = data;
-
- const setPreviewRef = useCallback((previewElement: null | Element) => {
- previewRef.current = previewElement;
- }, []);
-
- const attributes: {
- draggable?: boolean;
- } = useMemo(() => {
- if (disabled) {
- return {};
- }
-
- return {
- draggable: true,
- };
- }, [disabled]);
-
- const onDragStart = useCallback<DragEventHandler>(
- (event) => {
- setIsDragging(true);
- context.dragging = {
- type: typeRef.current,
- data: dataRef.current ?? {},
- };
-
- const { dataTransfer } = event;
- const previewNode = previewRef.current;
-
- dataTransfer.effectAllowed = effectAllowed;
-
- if (previewNode) {
- const { clientX, clientY } = event;
- const rect = previewNode.getBoundingClientRect();
-
- dataTransfer.setDragImage(previewNode, clientX - rect.x, clientY - rect.y);
- }
-
- if (scrollDirection === undefined) {
- return;
- }
-
- const scrollParent: HTMLElement | null =
- scrollOnEdge?.getScrollElement?.() ?? getScrollParent(event.target as HTMLElement, scrollDirection);
-
- if (scrollParent) {
- autoScrollOnEdge({
- element: scrollParent,
- direction: scrollDirection,
- edgeGap,
- });
- }
- },
- [context, effectAllowed, scrollDirection, scrollOnEdge, edgeGap]
- );
-
- const onDragEnd = useCallback<DragEventHandler>(() => {
- setIsDragging(false);
- context.dragging = null;
- }, [context]);
-
- const listeners: {
- onDragStart?: DragEventHandler;
- onDragEnd?: DragEventHandler;
- } = useMemo(
- () => ({
- onDragStart,
- onDragEnd,
- }),
- [onDragStart, onDragEnd]
- );
-
- return {
- isDragging,
- previewRef,
- attributes,
- listeners,
- setPreviewRef,
- };
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/_shared/dnd/drop.hooks.ts b/frontend/appflowy_tauri/src/appflowy_app/components/database/_shared/dnd/drop.hooks.ts
deleted file mode 100644
index 7b3d79aeb2..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/_shared/dnd/drop.hooks.ts
+++ /dev/null
@@ -1,88 +0,0 @@
-import { DragEventHandler, useContext, useState, useMemo, useCallback } from 'react';
-import { useSnapshot } from 'valtio';
-import { DragItem, DndContext } from './dnd.context';
-
-interface UseDroppableOptions {
- accept: string;
- dropEffect?: DataTransfer['dropEffect'];
- disabled?: boolean;
- onDragOver?: DragEventHandler,
- onDrop?: (data: DragItem) => void;
-}
-
-export const useDroppable = ({
- accept,
- dropEffect = 'move',
- disabled,
- onDragOver: handleDragOver,
- onDrop: handleDrop,
-}: UseDroppableOptions) => {
- const dndContext = useContext(DndContext);
- const dndSnapshot = useSnapshot(dndContext);
-
- const [ dragOver, setDragOver ] = useState(false);
- const canDrop = useMemo(
- () => !disabled && dndSnapshot.dragging?.type === accept,
- [ disabled, accept, dndSnapshot.dragging?.type ],
- );
- const isOver = useMemo(()=> canDrop && dragOver, [ canDrop, dragOver ]);
-
- const onDragEnter = useCallback<DragEventHandler>((event) => {
- if (!canDrop) {
- return;
- }
-
- event.preventDefault();
- event.dataTransfer.dropEffect = dropEffect;
-
- setDragOver(true);
- }, [ canDrop, dropEffect ]);
-
- const onDragOver = useCallback<DragEventHandler>((event) => {
- if (!canDrop) {
- return;
- }
-
- event.preventDefault();
- event.dataTransfer.dropEffect = dropEffect;
-
- setDragOver(true);
- handleDragOver?.(event);
- }, [ canDrop, dropEffect, handleDragOver ]);
-
- const onDragLeave = useCallback(() => {
- if (!canDrop) {
- return;
- }
-
- setDragOver(false);
- }, [ canDrop ]);
-
- const onDrop = useCallback(() => {
- if (!canDrop) {
- return;
- }
-
- const dragging = dndSnapshot.dragging;
-
- if (!dragging) {
- return;
- }
-
- setDragOver(false);
- handleDrop?.(dragging);
- }, [ canDrop, dndSnapshot.dragging, handleDrop ]);
-
- const listeners = useMemo(() => ({
- onDragEnter,
- onDragOver,
- onDragLeave,
- onDrop,
- }), [ onDragEnter, onDragOver, onDragLeave, onDrop ]);
-
- return {
- isOver,
- canDrop,
- listeners,
- };
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/_shared/dnd/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/database/_shared/dnd/index.ts
deleted file mode 100644
index 8688534359..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/_shared/dnd/index.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-export * from './dnd.context';
-export * from './drag.hooks';
-export * from './drop.hooks';
-export {
- ScrollDirection,
- Edge,
-} from './utils';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/_shared/dnd/utils.ts b/frontend/appflowy_tauri/src/appflowy_app/components/database/_shared/dnd/utils.ts
deleted file mode 100644
index 3aafa6f77c..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/_shared/dnd/utils.ts
+++ /dev/null
@@ -1,170 +0,0 @@
-import { interval } from '$app/utils/tool';
-
-export enum Edge {
- Top = 'top',
- Bottom = 'bottom',
- Left = 'left',
- Right = 'right',
-}
-
-export enum ScrollDirection {
- Horizontal = 'horizontal',
- Vertical = 'vertical',
-}
-
-export interface EdgeGap {
- top: number;
- bottom: number;
- left: number;
- right: number;
-}
-
-export const isReachEdge = (element: Element, edge: Edge) => {
- switch (edge) {
- case Edge.Left:
- return element.scrollLeft === 0;
- case Edge.Right:
- return element.scrollLeft + element.clientWidth === element.scrollWidth;
- case Edge.Top:
- return element.scrollTop === 0;
- case Edge.Bottom:
- return element.scrollTop + element.clientHeight === element.scrollHeight;
- default:
- return true;
- }
-};
-
-export const scrollBy = (element: Element, edge: Edge, offset: number) => {
- let step = offset;
- let prop = edge;
-
- if (edge === Edge.Left || edge === Edge.Top) {
- step = -offset;
- } else if (edge === Edge.Right) {
- prop = Edge.Left;
- } else if (edge === Edge.Bottom) {
- prop = Edge.Top;
- }
-
- element.scrollBy({ [prop]: step });
-};
-
-export const scrollElement = (element: Element, edge: Edge, offset: number) => {
- if (isReachEdge(element, edge)) {
- return;
- }
-
- scrollBy(element, edge, offset);
-};
-
-export const calculateLeaveEdge = (
- { x: mouseX, y: mouseY }: { x: number; y: number },
- rect: DOMRect,
- gaps: EdgeGap,
- direction: ScrollDirection
-) => {
- if (direction === ScrollDirection.Horizontal) {
- if (mouseX - rect.left < gaps.left) {
- return Edge.Left;
- }
-
- if (rect.right - mouseX < gaps.right) {
- return Edge.Right;
- }
- }
-
- if (direction === ScrollDirection.Vertical) {
- if (mouseY - rect.top < gaps.top) {
- return Edge.Top;
- }
-
- if (rect.bottom - mouseY < gaps.bottom) {
- return Edge.Bottom;
- }
- }
-
- return null;
-};
-
-export const getScrollParent = (element: HTMLElement | null, direction: ScrollDirection): HTMLElement | null => {
- if (element === null) {
- return null;
- }
-
- if (direction === ScrollDirection.Horizontal && element.scrollWidth > element.clientWidth) {
- return element;
- }
-
- if (direction === ScrollDirection.Vertical && element.scrollHeight > element.clientHeight) {
- return element;
- }
-
- return getScrollParent(element.parentElement, direction);
-};
-
-export interface AutoScrollOnEdgeOptions {
- element: HTMLElement;
- direction: ScrollDirection;
- edgeGap?: number | Partial<EdgeGap>;
- step?: number;
-}
-
-const defaultEdgeGap = 30;
-
-export const autoScrollOnEdge = ({ element, direction, edgeGap, step = 8 }: AutoScrollOnEdgeOptions) => {
- const gaps =
- typeof edgeGap === 'number'
- ? {
- top: edgeGap,
- bottom: edgeGap,
- left: edgeGap,
- right: edgeGap,
- }
- : {
- top: defaultEdgeGap,
- bottom: defaultEdgeGap,
- left: defaultEdgeGap,
- right: defaultEdgeGap,
- ...edgeGap,
- };
-
- const keepScroll = interval(scrollElement, 8);
-
- let leaveEdge: Edge | null = null;
-
- const onDragOver = (event: DragEvent) => {
- const rect = element.getBoundingClientRect();
-
- leaveEdge = calculateLeaveEdge({ x: event.clientX, y: event.clientY }, rect, gaps, direction);
-
- if (leaveEdge) {
- keepScroll(element, leaveEdge, step);
- } else {
- keepScroll.cancel();
- }
- };
-
- const onDragLeave = () => {
- if (!leaveEdge) {
- return;
- }
-
- keepScroll(element, leaveEdge, step * 2);
- };
-
- const cleanup = () => {
- keepScroll.cancel();
-
- element.removeEventListener('dragover', onDragOver);
- element.removeEventListener('dragleave', onDragLeave);
-
- document.removeEventListener('dragend', cleanup);
- };
-
- element.addEventListener('dragover', onDragOver);
- element.addEventListener('dragleave', onDragLeave);
-
- document.addEventListener('dragend', cleanup);
-
- return cleanup;
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/_shared/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/database/_shared/index.ts
deleted file mode 100644
index 6bfa1f812b..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/_shared/index.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-export * from './constants';
-
-export * from './dnd';
-
-export * from './CellText';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/board/Board.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/board/Board.tsx
deleted file mode 100644
index 790f841701..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/board/Board.tsx
+++ /dev/null
@@ -1,5 +0,0 @@
-import { FC } from 'react';
-
-export const Board: FC = () => {
- return null;
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/board/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/database/board/index.ts
deleted file mode 100644
index 9294d869ce..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/board/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './Board';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/calendar/Calendar.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/calendar/Calendar.tsx
deleted file mode 100644
index b8473fda25..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/calendar/Calendar.tsx
+++ /dev/null
@@ -1,5 +0,0 @@
-import { FC } from 'react';
-
-export const Calendar: FC = () => {
- return null;
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/calendar/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/database/calendar/index.ts
deleted file mode 100644
index a723380592..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/calendar/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './Calendar';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/cell/Cell.hooks.ts b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/cell/Cell.hooks.ts
deleted file mode 100644
index 76bba7b152..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/cell/Cell.hooks.ts
+++ /dev/null
@@ -1,63 +0,0 @@
-import { useCallback, useEffect, useState } from 'react';
-import { DatabaseNotification } from '@/services/backend';
-import { useNotification, useViewId } from '$app/hooks';
-import { cellService, Cell, Field } from '$app/application/database';
-import { useDispatchCell, useSelectorCell } from '$app/components/database';
-
-export const useCell = (rowId: string, field: Field) => {
- const viewId = useViewId();
- const { setCell } = useDispatchCell();
- const [loading, setLoading] = useState(false);
- const cell = useSelectorCell(rowId, field.id);
-
- const fetchCell = useCallback(() => {
- setLoading(true);
- void cellService.getCell(viewId, rowId, field.id, field.type).then((data) => {
- // cache cell
- setCell(data);
- setLoading(false);
- });
- }, [viewId, rowId, field.id, field.type, setCell]);
-
- useEffect(() => {
- // fetch cell if not cached
- if (!cell && !loading) {
- // fetch cell in next tick to avoid blocking
- const timeout = setTimeout(fetchCell, 0);
-
- return () => {
- clearTimeout(timeout);
- };
- }
- }, [fetchCell, cell, loading, rowId, field.id]);
-
- useNotification(DatabaseNotification.DidUpdateCell, fetchCell, { id: `${rowId}:${field.id}` });
-
- return cell;
-};
-
-export const useInputCell = (cell?: Cell) => {
- const [editing, setEditing] = useState(false);
- const [value, setValue] = useState('');
- const viewId = useViewId();
- const updateCell = useCallback(() => {
- if (!cell) return;
- const { rowId, fieldId } = cell;
-
- if (editing) {
- if (value !== cell.data) {
- void cellService.updateCell(viewId, rowId, fieldId, value);
- }
-
- setEditing(false);
- }
- }, [cell, editing, value, viewId]);
-
- return {
- updateCell,
- editing,
- setEditing,
- value,
- setValue,
- };
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/cell/Cell.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/cell/Cell.tsx
deleted file mode 100644
index a092a1d75a..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/cell/Cell.tsx
+++ /dev/null
@@ -1,65 +0,0 @@
-import React, { FC, HTMLAttributes } from 'react';
-import { FieldType } from '@/services/backend';
-
-import { Cell as CellType, Field } from '$app/application/database';
-import { useCell } from './Cell.hooks';
-import { TextCell } from './TextCell';
-import { SelectCell } from './SelectCell';
-import { CheckboxCell } from './CheckboxCell';
-import NumberCell from '$app/components/database/components/cell/NumberCell';
-import URLCell from '$app/components/database/components/cell/URLCell';
-import ChecklistCell from '$app/components/database/components/cell/ChecklistCell';
-import DateTimeCell from '$app/components/database/components/cell/DateTimeCell';
-import TimestampCell from '$app/components/database/components/cell/TimestampCell';
-
-export interface CellProps extends HTMLAttributes<HTMLDivElement> {
- rowId: string;
- field: Field;
- icon?: string;
- placeholder?: string;
-}
-
-export interface CellComponentProps extends CellProps {
- cell: CellType;
-}
-
-const getCellComponent = (fieldType: FieldType) => {
- switch (fieldType) {
- case FieldType.RichText:
- return TextCell as FC<CellComponentProps>;
- case FieldType.SingleSelect:
- case FieldType.MultiSelect:
- return SelectCell as FC<CellComponentProps>;
- case FieldType.Checkbox:
- return CheckboxCell as FC<CellComponentProps>;
- case FieldType.Checklist:
- return ChecklistCell as FC<CellComponentProps>;
- case FieldType.Number:
- return NumberCell as FC<CellComponentProps>;
- case FieldType.URL:
- return URLCell as FC<CellComponentProps>;
- case FieldType.DateTime:
- return DateTimeCell as FC<CellComponentProps>;
- case FieldType.LastEditedTime:
- case FieldType.CreatedTime:
- return TimestampCell as FC<CellComponentProps>;
- default:
- return null;
- }
-};
-
-export const Cell: FC<CellProps> = ({ rowId, field, ...props }) => {
- const cell = useCell(rowId, field);
-
- const Component = getCellComponent(field.type);
-
- if (!cell) {
- return <div className={`h-[36px] w-[${field.width}px]`} />;
- }
-
- if (!Component) {
- return null;
- }
-
- return <Component {...props} rowId={rowId} field={field} cell={cell} />;
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/cell/CheckboxCell.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/cell/CheckboxCell.tsx
deleted file mode 100644
index f6f3dcf0d2..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/cell/CheckboxCell.tsx
+++ /dev/null
@@ -1,26 +0,0 @@
-import React, { FC, useCallback } from 'react';
-import { ReactComponent as CheckboxCheckSvg } from '$app/assets/database/checkbox-check.svg';
-import { ReactComponent as CheckboxUncheckSvg } from '$app/assets/database/checkbox-uncheck.svg';
-import { useViewId } from '$app/hooks';
-import { cellService, CheckboxCell as CheckboxCellType, Field } from '$app/application/database';
-
-export const CheckboxCell: FC<{
- field: Field;
- cell: CheckboxCellType;
-}> = ({ field, cell }) => {
- const viewId = useViewId();
- const checked = cell.data;
-
- const handleClick = useCallback(() => {
- void cellService.updateCell(viewId, cell.rowId, field.id, !checked ? 'Yes' : 'No');
- }, [viewId, cell, field.id, checked]);
-
- return (
- <div
- className='relative flex w-full cursor-pointer items-center px-2 text-lg text-fill-default'
- onClick={handleClick}
- >
- {checked ? <CheckboxCheckSvg /> : <CheckboxUncheckSvg />}
- </div>
- );
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/cell/ChecklistCell.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/cell/ChecklistCell.tsx
deleted file mode 100644
index 5ecac431c4..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/cell/ChecklistCell.tsx
+++ /dev/null
@@ -1,74 +0,0 @@
-import React, { useState, Suspense, useMemo } from 'react';
-import { ChecklistCell as ChecklistCellType, ChecklistField } from '$app/application/database';
-import ChecklistCellActions from '$app/components/database/components/field_types/checklist/ChecklistCellActions';
-import LinearProgressWithLabel from '$app/components/database/_shared/LinearProgressWithLabel';
-import { PopoverOrigin } from '@mui/material/Popover/Popover';
-import usePopoverAutoPosition from '$app/components/_shared/popover/Popover.hooks';
-
-interface Props {
- field: ChecklistField;
- cell: ChecklistCellType;
- placeholder?: string;
-}
-
-const initialAnchorOrigin: PopoverOrigin = {
- vertical: 'bottom',
- horizontal: 'left',
-};
-
-const initialTransformOrigin: PopoverOrigin = {
- vertical: 'top',
- horizontal: 'left',
-};
-
-function ChecklistCell({ cell, placeholder }: Props) {
- const value = cell?.data.percentage ?? 0;
- const options = useMemo(() => cell?.data.options ?? [], [cell?.data.options]);
- const selectedOptions = useMemo(() => cell?.data.selectedOptions ?? [], [cell?.data.selectedOptions]);
- const [anchorEl, setAnchorEl] = useState<HTMLDivElement | undefined>(undefined);
- const open = Boolean(anchorEl);
- const handleClick = (e: React.MouseEvent<HTMLDivElement>) => {
- setAnchorEl(e.currentTarget);
- };
-
- const handleClose = () => {
- setAnchorEl(undefined);
- };
-
- const { paperHeight, paperWidth, transformOrigin, anchorOrigin, isEntered } = usePopoverAutoPosition({
- initialPaperWidth: 369,
- initialPaperHeight: 300,
- anchorEl,
- initialAnchorOrigin,
- initialTransformOrigin,
- open,
- });
-
- return (
- <>
- <div className='flex w-full cursor-pointer items-center px-2' onClick={handleClick}>
- {options.length > 0 ? (
- <LinearProgressWithLabel value={value} count={options.length} selectedCount={selectedOptions.length} />
- ) : (
- <div className={'text-sm text-text-placeholder'}>{placeholder}</div>
- )}
- </div>
- <Suspense>
- {open && (
- <ChecklistCellActions
- transformOrigin={transformOrigin}
- anchorOrigin={anchorOrigin}
- maxHeight={paperHeight}
- maxWidth={paperWidth}
- open={open && isEntered}
- anchorEl={anchorEl}
- onClose={handleClose}
- cell={cell}
- />
- )}
- </Suspense>
- </>
- );
-}
-
-export default ChecklistCell;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/cell/DateTimeCell.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/cell/DateTimeCell.tsx
deleted file mode 100644
index aea4f79849..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/cell/DateTimeCell.tsx
+++ /dev/null
@@ -1,125 +0,0 @@
-import React, { Suspense, useRef, useState, useMemo, useEffect } from 'react';
-import { DateTimeCell as DateTimeCellType, DateTimeField } from '$app/application/database';
-import DateTimeCellActions from '$app/components/database/components/field_types/date/DateTimeCellActions';
-import usePopoverAutoPosition from '$app/components/_shared/popover/Popover.hooks';
-import { PopoverOrigin } from '@mui/material/Popover/Popover';
-
-interface Props {
- field: DateTimeField;
- cell: DateTimeCellType;
- placeholder?: string;
-}
-
-const initialAnchorOrigin: PopoverOrigin = {
- vertical: 'bottom',
- horizontal: 'left',
-};
-
-const initialTransformOrigin: PopoverOrigin = {
- vertical: 'top',
- horizontal: 'left',
-};
-
-function DateTimeCell({ field, cell, placeholder }: Props) {
- const isRange = cell.data.isRange;
- const includeTime = cell.data.includeTime;
- const [open, setOpen] = useState(false);
- const ref = useRef<HTMLDivElement>(null);
-
- const handleClose = () => {
- setOpen(false);
- };
-
- const handleClick = () => {
- setOpen(true);
- };
-
- const content = useMemo(() => {
- const { date, time, endDate, endTime } = cell.data;
-
- if (date) {
- return (
- <>
- {date}
- {includeTime && time ? ' ' + time : ''}
- {isRange && endDate ? ' - ' + endDate : ''}
- {isRange && includeTime && endTime ? ' ' + endTime : ''}
- </>
- );
- }
-
- return <div className={'text-sm text-text-placeholder'}>{placeholder}</div>;
- }, [cell, includeTime, isRange, placeholder]);
-
- const { paperHeight, paperWidth, transformOrigin, anchorOrigin, isEntered, calculateAnchorSize } =
- usePopoverAutoPosition({
- initialPaperWidth: 248,
- initialPaperHeight: 500,
- anchorEl: ref.current,
- initialAnchorOrigin,
- initialTransformOrigin,
- open,
- marginThreshold: 34,
- });
-
- useEffect(() => {
- if (!open) return;
-
- const anchorEl = ref.current;
-
- const parent = anchorEl?.parentElement?.parentElement;
-
- if (!anchorEl || !parent) return;
-
- let timeout: NodeJS.Timeout;
- const handleObserve = () => {
- anchorEl.scrollIntoView({ block: 'nearest' });
-
- timeout = setTimeout(() => {
- calculateAnchorSize();
- }, 200);
- };
-
- const observer = new MutationObserver(handleObserve);
-
- observer.observe(parent, {
- childList: true,
- subtree: true,
- });
- return () => {
- observer.disconnect();
- clearTimeout(timeout);
- };
- }, [calculateAnchorSize, open]);
-
- return (
- <>
- <div
- ref={ref}
- className={`flex h-full min-h-[36px] w-full cursor-pointer items-center overflow-x-hidden truncate px-2 text-xs font-medium ${
- open ? 'bg-fill-list-active' : ''
- }`}
- onClick={handleClick}
- >
- {content}
- </div>
- <Suspense>
- {open && (
- <DateTimeCellActions
- field={field}
- maxWidth={paperWidth}
- maxHeight={paperHeight}
- anchorOrigin={anchorOrigin}
- transformOrigin={transformOrigin}
- onClose={handleClose}
- anchorEl={ref.current}
- cell={cell}
- open={open && isEntered}
- />
- )}
- </Suspense>
- </>
- );
-}
-
-export default DateTimeCell;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/cell/NumberCell.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/cell/NumberCell.tsx
deleted file mode 100644
index 727e78de3f..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/cell/NumberCell.tsx
+++ /dev/null
@@ -1,50 +0,0 @@
-import React, { Suspense, useCallback, useMemo, useRef } from 'react';
-import { Field, NumberCell as NumberCellType } from '$app/application/database';
-import { CellText } from '$app/components/database/_shared';
-import EditNumberCellInput from '$app/components/database/components/field_types/number/EditNumberCellInput';
-import { useInputCell } from '$app/components/database/components/cell/Cell.hooks';
-
-interface Props {
- field: Field;
- cell: NumberCellType;
- placeholder?: string;
-}
-
-function NumberCell({ field, cell, placeholder }: Props) {
- const cellRef = useRef<HTMLDivElement>(null);
- const { value, editing, updateCell, setEditing, setValue } = useInputCell(cell);
- const content = useMemo(() => {
- if (typeof cell.data === 'string' && cell.data) {
- return cell.data;
- }
-
- return <div className={'text-sm text-text-placeholder'}>{placeholder}</div>;
- }, [cell, placeholder]);
-
- const handleClick = useCallback(() => {
- setValue(cell.data);
- setEditing(true);
- }, [cell, setEditing, setValue]);
-
- return (
- <>
- <CellText className={'min-h-[36px]'} ref={cellRef} onClick={handleClick}>
- <div className='flex w-full items-center'>{content}</div>
- </CellText>
- <Suspense>
- {editing && (
- <EditNumberCellInput
- editing={editing}
- anchorEl={cellRef.current}
- width={field?.width}
- onClose={updateCell}
- value={value}
- onChange={setValue}
- />
- )}
- </Suspense>
- </>
- );
-}
-
-export default NumberCell;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/cell/SelectCell.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/cell/SelectCell.tsx
deleted file mode 100644
index a951ddd9e4..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/cell/SelectCell.tsx
+++ /dev/null
@@ -1,108 +0,0 @@
-import { FC, useCallback, useMemo, useState, Suspense, lazy } from 'react';
-import { MenuProps } from '@mui/material';
-import { SelectField, SelectCell as SelectCellType, SelectTypeOption } from '$app/application/database';
-import { Tag } from '../field_types/select/Tag';
-import { useTypeOption } from '$app/components/database';
-import usePopoverAutoPosition from '$app/components/_shared/popover/Popover.hooks';
-import { PopoverOrigin } from '@mui/material/Popover/Popover';
-import Popover from '@mui/material/Popover';
-
-const initialAnchorOrigin: PopoverOrigin = {
- vertical: 'bottom',
- horizontal: 'center',
-};
-
-const initialTransformOrigin: PopoverOrigin = {
- vertical: 'top',
- horizontal: 'center',
-};
-const SelectCellActions = lazy(
- () => import('$app/components/database/components/field_types/select/select_cell_actions/SelectCellActions')
-);
-const menuProps: Partial<MenuProps> = {
- classes: {
- list: 'py-5',
- },
-};
-
-export const SelectCell: FC<{
- field: SelectField;
- cell: SelectCellType;
- placeholder?: string;
-}> = ({ field, cell, placeholder }) => {
- const [anchorEl, setAnchorEl] = useState<HTMLElement | null>(null);
- const selectedIds = useMemo(() => cell.data?.selectedOptionIds ?? [], [cell]);
- const open = Boolean(anchorEl);
- const handleClose = useCallback(() => {
- setAnchorEl(null);
- }, []);
-
- const typeOption = useTypeOption<SelectTypeOption>(field.id);
-
- const renderSelectedOptions = useCallback(
- (selected: string[]) =>
- selected
- .map((id) => typeOption.options?.find((option) => option.id === id))
- .map((option) => option && <Tag key={option.id} size='small' color={option.color} label={option.name} />),
- [typeOption]
- );
-
- const { paperHeight, paperWidth, transformOrigin, anchorOrigin, isEntered } = usePopoverAutoPosition({
- initialPaperWidth: 369,
- initialPaperHeight: 400,
- anchorEl,
- initialAnchorOrigin,
- initialTransformOrigin,
- open,
- });
-
- return (
- <div className={'relative w-full'}>
- <div
- onClick={(e) => {
- setAnchorEl(e.currentTarget);
- }}
- className={'flex h-full w-full cursor-pointer items-center gap-2 overflow-x-hidden px-2 py-1'}
- >
- {selectedIds.length === 0 ? (
- <div className={'text-sm text-text-placeholder'}>{placeholder}</div>
- ) : (
- renderSelectedOptions(selectedIds)
- )}
- </div>
- <Suspense>
- {open ? (
- <Popover
- keepMounted={false}
- disableRestoreFocus={true}
- className='h-full w-full'
- open={open && isEntered}
- anchorEl={anchorEl}
- {...menuProps}
- transformOrigin={transformOrigin}
- anchorOrigin={anchorOrigin}
- onClose={handleClose}
- PaperProps={{
- className: 'flex h-full flex-col py-4 overflow-hidden',
- style: {
- maxHeight: paperHeight,
- maxWidth: paperWidth,
- height: 'auto',
- },
- }}
- onMouseDown={(e) => {
- const isInput = (e.target as Element).closest('input');
-
- if (isInput) return;
-
- e.preventDefault();
- e.stopPropagation();
- }}
- >
- <SelectCellActions onClose={handleClose} field={field} cell={cell} />
- </Popover>
- ) : null}
- </Suspense>
- </div>
- );
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/cell/TextCell.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/cell/TextCell.tsx
deleted file mode 100644
index 38927d744b..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/cell/TextCell.tsx
+++ /dev/null
@@ -1,59 +0,0 @@
-import { FC, FormEventHandler, Suspense, lazy, useCallback, useRef, useMemo } from 'react';
-import { TextCell as TextCellType } from '$app/application/database';
-import { CellText } from '../../_shared';
-import { useInputCell } from '$app/components/database/components/cell/Cell.hooks';
-
-const EditTextCellInput = lazy(() => import('$app/components/database/components/field_types/text/EditTextCellInput'));
-
-interface TextCellProps {
- cell: TextCellType;
- placeholder?: string;
-}
-export const TextCell: FC<TextCellProps> = ({ placeholder, cell }) => {
- const cellRef = useRef<HTMLDivElement>(null);
- const { value, editing, updateCell, setEditing, setValue } = useInputCell(cell);
- const handleClose = () => {
- if (!cell) return;
- updateCell();
- };
-
- const handleClick = useCallback(() => {
- if (!cell) return;
- setValue(cell.data);
- setEditing(true);
- }, [cell, setEditing, setValue]);
-
- const handleInput = useCallback<FormEventHandler<HTMLTextAreaElement>>(
- (event) => {
- setValue((event.target as HTMLTextAreaElement).value);
- },
- [setValue]
- );
-
- const content = useMemo(() => {
- if (cell && typeof cell.data === 'string' && cell.data) {
- return cell.data;
- }
-
- return <div className={'text-text-placeholder'}>{placeholder}</div>;
- }, [cell, placeholder]);
-
- return (
- <>
- <CellText className={`min-h-[36px] w-full cursor-text`} ref={cellRef} onClick={handleClick}>
- {content}
- </CellText>
- <Suspense>
- {editing && (
- <EditTextCellInput
- editing={editing}
- anchorEl={cellRef.current}
- onClose={handleClose}
- text={value}
- onInput={handleInput}
- />
- )}
- </Suspense>
- </>
- );
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/cell/TimestampCell.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/cell/TimestampCell.tsx
deleted file mode 100644
index 5889a13915..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/cell/TimestampCell.tsx
+++ /dev/null
@@ -1,13 +0,0 @@
-import React from 'react';
-import { CreatedTimeField, LastEditedTimeField, TimeStampCell } from '$app/application/database';
-
-interface Props {
- field: LastEditedTimeField | CreatedTimeField;
- cell: TimeStampCell;
-}
-
-function TimestampCell({ cell }: Props) {
- return <div className={'flex h-full w-full items-center p-2 text-xs font-medium'}>{cell.data.dataTime}</div>;
-}
-
-export default TimestampCell;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/cell/URLCell.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/cell/URLCell.tsx
deleted file mode 100644
index 592850ada1..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/cell/URLCell.tsx
+++ /dev/null
@@ -1,81 +0,0 @@
-import React, { FormEventHandler, lazy, Suspense, useCallback, useMemo, useRef } from 'react';
-import { useInputCell } from '$app/components/database/components/cell/Cell.hooks';
-import { Field, UrlCell as URLCellType } from '$app/application/database';
-import { CellText } from '$app/components/database/_shared';
-import { openUrl } from '$app/utils/open_url';
-
-const EditTextCellInput = lazy(() => import('$app/components/database/components/field_types/text/EditTextCellInput'));
-
-interface Props {
- field: Field;
- cell: URLCellType;
- placeholder?: string;
-}
-
-function UrlCell({ field, cell, placeholder }: Props) {
- const cellRef = useRef<HTMLDivElement>(null);
- const { value, editing, updateCell, setEditing, setValue } = useInputCell(cell);
- const handleClick = useCallback(() => {
- setValue(cell.data);
- setEditing(true);
- }, [cell, setEditing, setValue]);
-
- const handleClose = () => {
- updateCell();
- };
-
- const handleInput = useCallback<FormEventHandler<HTMLTextAreaElement>>(
- (event) => {
- setValue((event.target as HTMLTextAreaElement).value);
- },
- [setValue]
- );
-
- const content = useMemo(() => {
- if (cell.data) {
- return (
- <a
- onClick={(e) => {
- e.stopPropagation();
- openUrl(cell.data);
- }}
- target={'_blank'}
- className={'cursor-pointer text-content-blue-400 underline'}
- >
- {cell.data}
- </a>
- );
- }
-
- return <div className={'cursor-text text-sm text-text-placeholder'}>{placeholder}</div>;
- }, [cell, placeholder]);
-
- return (
- <>
- <CellText
- style={{
- width: `${field.width}px`,
- minHeight: 37,
- }}
- className={'cursor-text'}
- ref={cellRef}
- onClick={handleClick}
- >
- {content}
- </CellText>
- <Suspense>
- {editing && (
- <EditTextCellInput
- editing={editing}
- anchorEl={cellRef.current}
- onClose={handleClose}
- text={value}
- onInput={handleInput}
- />
- )}
- </Suspense>
- </>
- );
-}
-
-export default UrlCell;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/cell/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/cell/index.ts
deleted file mode 100644
index 2440976340..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/cell/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './Cell';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/database_settings/DatabaseCollection.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/database_settings/DatabaseCollection.tsx
deleted file mode 100644
index 0fe9fb6d5b..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/database_settings/DatabaseCollection.tsx
+++ /dev/null
@@ -1,18 +0,0 @@
-import { Sorts } from '../sort';
-import Filters from '../filter/Filters';
-import React from 'react';
-
-interface Props {
- open: boolean;
-}
-
-export const DatabaseCollection = ({ open }: Props) => {
- return (
- <div className={`database-collection w-full px-[64px] ${!open ? 'hidden' : 'py-3'}`}>
- <div className={'flex w-full items-center gap-2 overflow-x-auto overflow-y-hidden '}>
- <Sorts />
- <Filters />
- </div>
- </div>
- );
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/database_settings/DatabaseSettings.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/database_settings/DatabaseSettings.tsx
deleted file mode 100644
index ea1378eab8..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/database_settings/DatabaseSettings.tsx
+++ /dev/null
@@ -1,33 +0,0 @@
-import React, { useState } from 'react';
-import { TextButton } from '$app/components/database/components/tab_bar/TextButton';
-import { useTranslation } from 'react-i18next';
-
-import SortSettings from '$app/components/database/components/database_settings/SortSettings';
-import SettingsMenu from '$app/components/database/components/database_settings/SettingsMenu';
-import FilterSettings from '$app/components/database/components/database_settings/FilterSettings';
-
-interface Props {
- onToggleCollection: (forceOpen?: boolean) => void;
-}
-
-function DatabaseSettings(props: Props) {
- const { t } = useTranslation();
- const [settingAnchorEl, setSettingAnchorEl] = useState<null | HTMLElement>(null);
-
- return (
- <div className='flex h-[39px] items-center gap-2 border-b border-line-divider'>
- <FilterSettings {...props} />
- <SortSettings {...props} />
- <TextButton className={'min-w-fit'} color='inherit' onClick={(e) => setSettingAnchorEl(e.currentTarget)}>
- {t('settings.title')}
- </TextButton>
- <SettingsMenu
- open={Boolean(settingAnchorEl)}
- anchorEl={settingAnchorEl}
- onClose={() => setSettingAnchorEl(null)}
- />
- </div>
- );
-}
-
-export default DatabaseSettings;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/database_settings/FilterSettings.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/database_settings/FilterSettings.tsx
deleted file mode 100644
index d0b89208d0..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/database_settings/FilterSettings.tsx
+++ /dev/null
@@ -1,46 +0,0 @@
-import React, { useState } from 'react';
-import { TextButton } from '$app/components/database/components/tab_bar/TextButton';
-import { useTranslation } from 'react-i18next';
-import { useFiltersCount } from '$app/components/database';
-import FilterFieldsMenu from '$app/components/database/components/filter/FilterFieldsMenu';
-
-function FilterSettings({ onToggleCollection }: { onToggleCollection: (forceOpen?: boolean) => void }) {
- const { t } = useTranslation();
- const filtersCount = useFiltersCount();
- const highlight = filtersCount > 0;
- const [filterAnchorEl, setFilterAnchorEl] = useState<null | HTMLElement>(null);
- const open = Boolean(filterAnchorEl);
-
- const handleClick = (e: React.MouseEvent<HTMLElement>) => {
- if (highlight) {
- onToggleCollection();
- return;
- }
-
- setFilterAnchorEl(e.currentTarget);
- };
-
- return (
- <>
- <TextButton className={'min-w-fit'} onClick={handleClick} color={highlight ? 'primary' : 'inherit'}>
- {t('grid.settings.filter')}
- </TextButton>
- <FilterFieldsMenu
- onInserted={() => onToggleCollection(true)}
- open={open}
- anchorEl={filterAnchorEl}
- onClose={() => setFilterAnchorEl(null)}
- transformOrigin={{
- vertical: 'top',
- horizontal: 'right',
- }}
- anchorOrigin={{
- vertical: 'bottom',
- horizontal: 'right',
- }}
- />
- </>
- );
-}
-
-export default FilterSettings;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/database_settings/Properties.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/database_settings/Properties.tsx
deleted file mode 100644
index af2bbce218..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/database_settings/Properties.tsx
+++ /dev/null
@@ -1,113 +0,0 @@
-import React, { useEffect, useState } from 'react';
-import { useDatabase } from '$app/components/database';
-import { Field as FieldType, fieldService } from '$app/application/database';
-import { Property } from '$app/components/database/components/property';
-import { FieldVisibility } from '@/services/backend';
-import { ReactComponent as EyeOpen } from '$app/assets/eye_open.svg';
-import { ReactComponent as EyeClosed } from '$app/assets/eye_close.svg';
-import { IconButton, MenuItem } from '@mui/material';
-import { DragDropContext, Draggable, Droppable, DropResult } from 'react-beautiful-dnd';
-import { useViewId } from '$app/hooks';
-import { ReactComponent as DragSvg } from '$app/assets/drag.svg';
-
-interface PropertiesProps {
- onItemClick: (field: FieldType) => void;
-}
-function Properties({ onItemClick }: PropertiesProps) {
- const { fields } = useDatabase();
- const [state, setState] = useState<FieldType[]>(fields as FieldType[]);
- const viewId = useViewId();
- const [menuPropertyId, setMenuPropertyId] = useState<string | undefined>();
-
- useEffect(() => {
- setState(fields as FieldType[]);
- }, [fields]);
-
- const handleOnDragEnd = async (result: DropResult) => {
- const { destination, draggableId, source } = result;
- const oldIndex = source.index;
- const newIndex = destination?.index;
-
- if (oldIndex === newIndex) {
- return;
- }
-
- if (newIndex === undefined || newIndex === null) {
- return;
- }
-
- const newId = fields[newIndex ?? 0].id;
-
- const newProperties = fieldService.reorderFields(fields as FieldType[], oldIndex, newIndex ?? 0);
-
- setState(newProperties);
-
- await fieldService.moveField(viewId, draggableId, newId ?? '');
- };
-
- return (
- <DragDropContext onDragEnd={handleOnDragEnd}>
- <Droppable droppableId='droppable' type='droppableItem'>
- {(dropProvided) => (
- <div
- ref={dropProvided.innerRef}
- {...dropProvided.droppableProps}
- className={'max-h-[300px] overflow-y-auto py-2'}
- >
- {state.map((field, index) => (
- <Draggable key={field.id} draggableId={field.id} index={index}>
- {(provided) => {
- return (
- <MenuItem
- ref={provided.innerRef}
- {...provided.draggableProps}
- className={
- 'flex w-full items-center justify-between overflow-hidden rounded-none px-1.5 hover:bg-fill-list-hover'
- }
- onClick={() => {
- setMenuPropertyId(field.id);
- }}
- key={field.id}
- >
- <IconButton
- size={'small'}
- {...provided.dragHandleProps}
- className='mx-1 cursor-grab active:cursor-grabbing'
- >
- <DragSvg />
- </IconButton>
- <div className={'w-[100px] overflow-hidden text-ellipsis'}>
- <Property
- onCloseMenu={() => {
- setMenuPropertyId(undefined);
- }}
- menuOpened={menuPropertyId === field.id}
- field={field}
- />
- </div>
-
- <IconButton
- disabled={field.isPrimary}
- size={'small'}
- onClick={(e) => {
- e.stopPropagation();
- onItemClick(field);
- }}
- className={'ml-2'}
- >
- {field.visibility !== FieldVisibility.AlwaysHidden ? <EyeOpen /> : <EyeClosed />}
- </IconButton>
- </MenuItem>
- );
- }}
- </Draggable>
- ))}
- {dropProvided.placeholder}
- </div>
- )}
- </Droppable>
- </DragDropContext>
- );
-}
-
-export default Properties;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/database_settings/SettingsMenu.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/database_settings/SettingsMenu.tsx
deleted file mode 100644
index c6a9d244f0..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/database_settings/SettingsMenu.tsx
+++ /dev/null
@@ -1,98 +0,0 @@
-import React, { useCallback, useMemo, useRef, useState } from 'react';
-import { Menu, MenuProps, Popover } from '@mui/material';
-import { useTranslation } from 'react-i18next';
-import Properties from '$app/components/database/components/database_settings/Properties';
-import { Field } from '$app/application/database';
-import { FieldVisibility } from '@/services/backend';
-import { updateFieldSetting } from '$app/application/database/field/field_service';
-import { useViewId } from '$app/hooks';
-import KeyboardNavigation from '$app/components/_shared/keyboard_navigation/KeyboardNavigation';
-
-type SettingsMenuProps = MenuProps;
-
-function SettingsMenu(props: SettingsMenuProps) {
- const viewId = useViewId();
- const ref = useRef<HTMLDivElement>(null);
- const { t } = useTranslation();
- const [propertiesAnchorElPosition, setPropertiesAnchorElPosition] = useState<
- | undefined
- | {
- top: number;
- left: number;
- }
- >(undefined);
-
- const openProperties = Boolean(propertiesAnchorElPosition);
-
- const togglePropertyVisibility = async (field: Field) => {
- let visibility = field.visibility;
-
- if (visibility === FieldVisibility.AlwaysHidden) {
- visibility = FieldVisibility.AlwaysShown;
- } else {
- visibility = FieldVisibility.AlwaysHidden;
- }
-
- await updateFieldSetting(viewId, field.id, {
- visibility,
- });
- };
-
- const options = useMemo(() => {
- return [{ key: 'properties', content: <div data-key={'properties'}>{t('grid.settings.properties')}</div> }];
- }, [t]);
-
- const onConfirm = useCallback(
- (optionKey: string) => {
- if (optionKey === 'properties') {
- const target = ref.current?.querySelector(`[data-key=${optionKey}]`) as HTMLElement;
- const rect = target.getBoundingClientRect();
-
- setPropertiesAnchorElPosition({
- top: rect.top,
- left: rect.left + rect.width,
- });
- props.onClose?.({}, 'backdropClick');
- }
- },
- [props]
- );
-
- return (
- <>
- <Menu {...props} ref={ref} disableRestoreFocus={true}>
- <KeyboardNavigation
- onConfirm={onConfirm}
- onEscape={() => {
- props.onClose?.({}, 'escapeKeyDown');
- }}
- options={options}
- />
- </Menu>
- <Popover
- keepMounted={false}
- open={openProperties}
- onClose={() => {
- setPropertiesAnchorElPosition(undefined);
- }}
- anchorReference={'anchorPosition'}
- anchorPosition={propertiesAnchorElPosition}
- transformOrigin={{
- vertical: 'top',
- horizontal: 'right',
- }}
- onKeyDown={(e) => {
- if (e.key === 'Escape') {
- e.preventDefault();
- e.stopPropagation();
- props.onClose?.({}, 'escapeKeyDown');
- }
- }}
- >
- <Properties onItemClick={togglePropertyVisibility} />
- </Popover>
- </>
- );
-}
-
-export default SettingsMenu;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/database_settings/SortSettings.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/database_settings/SortSettings.tsx
deleted file mode 100644
index 7f978120df..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/database_settings/SortSettings.tsx
+++ /dev/null
@@ -1,55 +0,0 @@
-import React from 'react';
-import { useTranslation } from 'react-i18next';
-import { useDatabase } from '$app/components/database';
-import { TextButton } from '$app/components/database/components/tab_bar/TextButton';
-import SortFieldsMenu from '$app/components/database/components/sort/SortFieldsMenu';
-
-interface Props {
- onToggleCollection: (forceOpen?: boolean) => void;
-}
-
-function SortSettings({ onToggleCollection }: Props) {
- const { t } = useTranslation();
- const { sorts } = useDatabase();
-
- const highlight = sorts && sorts.length > 0;
-
- const [sortAnchorEl, setSortAnchorEl] = React.useState<null | HTMLElement>(null);
- const open = Boolean(sortAnchorEl);
- const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {
- if (highlight) {
- onToggleCollection();
- return;
- }
-
- setSortAnchorEl(event.currentTarget);
- };
-
- const handleClose = () => {
- setSortAnchorEl(null);
- };
-
- return (
- <>
- <TextButton className={'min-w-fit p-1'} color={highlight ? 'primary' : 'inherit'} onClick={handleClick}>
- {t('grid.settings.sort')}
- </TextButton>
- <SortFieldsMenu
- onInserted={() => onToggleCollection(true)}
- open={open}
- anchorEl={sortAnchorEl}
- onClose={handleClose}
- transformOrigin={{
- vertical: 'top',
- horizontal: 'right',
- }}
- anchorOrigin={{
- vertical: 'bottom',
- horizontal: 'right',
- }}
- />
- </>
- );
-}
-
-export default SortSettings;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/database_settings/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/database_settings/index.ts
deleted file mode 100644
index efb89af437..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/database_settings/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './DatabaseCollection';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/edit_record/EditRecord.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/edit_record/EditRecord.tsx
deleted file mode 100644
index 13f29a7dfc..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/edit_record/EditRecord.tsx
+++ /dev/null
@@ -1,63 +0,0 @@
-import React, { useCallback, useEffect, useMemo, useState } from 'react';
-import RecordDocument from '$app/components/database/components/edit_record/RecordDocument';
-import RecordHeader from '$app/components/database/components/edit_record/RecordHeader';
-import { Page } from '$app_reducers/pages/slice';
-import { ErrorCode, ViewLayoutPB } from '@/services/backend';
-import { Log } from '$app/utils/log';
-import { useDatabase } from '$app/components/database';
-import { createOrphanPage, getPage } from '$app/application/folder/page.service';
-
-interface Props {
- rowId: string;
-}
-
-function EditRecord({ rowId }: Props) {
- const { rowMetas } = useDatabase();
- const row = useMemo(() => {
- return rowMetas.find((row) => row.id === rowId);
- }, [rowMetas, rowId]);
- const [page, setPage] = useState<Page | null>(null);
- const id = row?.documentId;
-
- const loadPage = useCallback(async () => {
- if (!id) return;
-
- try {
- const page = await getPage(id);
-
- setPage(page);
- } catch (e) {
- // Record not found
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
- // @ts-ignore
- if (e.code === ErrorCode.RecordNotFound) {
- try {
- const page = await createOrphanPage({
- view_id: id,
- name: '',
- layout: ViewLayoutPB.Document,
- });
-
- setPage(page);
- } catch (e) {
- Log.error(e);
- }
- }
- }
- }, [id]);
-
- useEffect(() => {
- void loadPage();
- }, [loadPage]);
-
- if (!id || !page) return null;
-
- return (
- <>
- <RecordHeader page={page} row={row} />
- <RecordDocument documentId={id} />
- </>
- );
-}
-
-export default EditRecord;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/edit_record/ExpandRecordModal.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/edit_record/ExpandRecordModal.tsx
deleted file mode 100644
index 7056cd353d..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/edit_record/ExpandRecordModal.tsx
+++ /dev/null
@@ -1,54 +0,0 @@
-import React, { useState } from 'react';
-import { DialogProps, IconButton, Portal } from '@mui/material';
-import Dialog from '@mui/material/Dialog';
-import { ReactComponent as DetailsIcon } from '$app/assets/details.svg';
-import RecordActions from '$app/components/database/components/edit_record/RecordActions';
-import EditRecord from '$app/components/database/components/edit_record/EditRecord';
-import { AFScroller } from '$app/components/_shared/scroller';
-
-interface Props extends DialogProps {
- rowId: string;
-}
-
-function ExpandRecordModal({ open, onClose, rowId }: Props) {
- const [detailAnchorEl, setDetailAnchorEl] = useState<HTMLButtonElement | null>(null);
-
- return (
- <Portal>
- <Dialog
- disableAutoFocus={true}
- keepMounted={false}
- onMouseDown={(e) => e.stopPropagation()}
- open={open}
- onClose={onClose}
- PaperProps={{
- className: 'h-[calc(100%-144px)] w-[80%] max-w-[960px] overflow-visible',
- }}
- >
- <AFScroller overflowXHidden className={'appflowy-scroll-container relative p-0'}>
- <EditRecord rowId={rowId} />
- </AFScroller>
- <IconButton
- aria-label='close'
- className={'absolute right-[8px] top-[8px] text-text-caption'}
- onClick={(e) => {
- setDetailAnchorEl(e.currentTarget);
- }}
- >
- <DetailsIcon />
- </IconButton>
- </Dialog>
- <RecordActions
- anchorEl={detailAnchorEl}
- rowId={rowId}
- open={!!detailAnchorEl}
- onEscape={() => {
- onClose?.({}, 'escapeKeyDown');
- }}
- onClose={() => setDetailAnchorEl(null)}
- />
- </Portal>
- );
-}
-
-export default ExpandRecordModal;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/edit_record/RecordActions.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/edit_record/RecordActions.tsx
deleted file mode 100644
index 412c1a953e..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/edit_record/RecordActions.tsx
+++ /dev/null
@@ -1,63 +0,0 @@
-import React, { useCallback } from 'react';
-import { Icon, Menu, MenuProps } from '@mui/material';
-import { ReactComponent as DelSvg } from '$app/assets/delete.svg';
-import { ReactComponent as CopySvg } from '$app/assets/copy.svg';
-import { useTranslation } from 'react-i18next';
-import { rowService } from '$app/application/database';
-import { useViewId } from '$app/hooks';
-import MenuItem from '@mui/material/MenuItem';
-
-interface Props extends MenuProps {
- rowId: string;
- onEscape?: () => void;
- onClose?: () => void;
-}
-function RecordActions({ anchorEl, open, onEscape, onClose, rowId }: Props) {
- const viewId = useViewId();
- const { t } = useTranslation();
-
- const handleDelRow = useCallback(() => {
- void rowService.deleteRow(viewId, rowId);
- onEscape?.();
- }, [viewId, rowId, onEscape]);
-
- const handleDuplicateRow = useCallback(() => {
- void rowService.duplicateRow(viewId, rowId);
- onEscape?.();
- }, [viewId, rowId, onEscape]);
-
- const menuOptions = [
- {
- label: t('grid.row.duplicate'),
- icon: <CopySvg />,
- onClick: handleDuplicateRow,
- },
-
- {
- label: t('grid.row.delete'),
- icon: <DelSvg />,
- onClick: handleDelRow,
- divider: true,
- },
- ];
-
- return (
- <Menu anchorEl={anchorEl} disableRestoreFocus={true} open={open} onClose={onClose}>
- {menuOptions.map((option) => (
- <MenuItem
- key={option.label}
- onClick={() => {
- option.onClick();
- onClose?.();
- onEscape?.();
- }}
- >
- <Icon className='mr-2'>{option.icon}</Icon>
- {option.label}
- </MenuItem>
- ))}
- </Menu>
- );
-}
-
-export default RecordActions;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/edit_record/RecordDocument.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/edit_record/RecordDocument.tsx
deleted file mode 100644
index 653f3c5944..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/edit_record/RecordDocument.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import React from 'react';
-import Editor from '$app/components/editor/Editor';
-
-interface Props {
- documentId: string;
-}
-
-function RecordDocument({ documentId }: Props) {
- return <Editor disableFocus={true} id={documentId} showTitle={false} />;
-}
-
-export default RecordDocument;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/edit_record/RecordHeader.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/edit_record/RecordHeader.tsx
deleted file mode 100644
index d2381ec165..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/edit_record/RecordHeader.tsx
+++ /dev/null
@@ -1,39 +0,0 @@
-import React, { useEffect, useRef } from 'react';
-import RecordTitle from '$app/components/database/components/edit_record/RecordTitle';
-import RecordProperties from '$app/components/database/components/edit_record/record_properties/RecordProperties';
-import { Divider } from '@mui/material';
-import { RowMeta } from '$app/application/database';
-import { Page } from '$app_reducers/pages/slice';
-
-interface Props {
- page: Page | null;
- row: RowMeta;
-}
-function RecordHeader({ page, row }: Props) {
- const ref = useRef<HTMLDivElement>(null);
-
- useEffect(() => {
- const el = ref.current;
-
- if (!el) return;
-
- const preventSelectionTrigger = (e: MouseEvent) => {
- e.stopPropagation();
- };
-
- el.addEventListener('mousedown', preventSelectionTrigger);
- return () => {
- el.removeEventListener('mousedown', preventSelectionTrigger);
- };
- }, []);
-
- return (
- <div ref={ref} className={'px-16 py-4'}>
- <RecordTitle page={page} row={row} />
- <RecordProperties row={row} />
- <Divider />
- </div>
- );
-}
-
-export default RecordHeader;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/edit_record/RecordTitle.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/edit_record/RecordTitle.tsx
deleted file mode 100644
index c2f195aee2..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/edit_record/RecordTitle.tsx
+++ /dev/null
@@ -1,71 +0,0 @@
-import React, { useCallback, useMemo } from 'react';
-import { Page, PageIcon } from '$app_reducers/pages/slice';
-import ViewTitle from '$app/components/_shared/view_title/ViewTitle';
-import { ViewIconTypePB } from '@/services/backend';
-import { useViewId } from '$app/hooks';
-import { updateRowMeta } from '$app/application/database/row/row_service';
-import { cellService, Field, RowMeta, TextCell } from '$app/application/database';
-import { useDatabase } from '$app/components/database';
-import { useCell } from '$app/components/database/components/cell/Cell.hooks';
-
-interface Props {
- page: Page | null;
- row: RowMeta;
-}
-
-function RecordTitle({ row, page }: Props) {
- const { fields } = useDatabase();
- const field = useMemo(() => {
- return fields.find((field) => field.isPrimary) as Field;
- }, [fields]);
- const rowId = row.id;
- const cell = useCell(rowId, field) as TextCell;
- const title = cell.data;
-
- const viewId = useViewId();
-
- const onTitleChange = useCallback(
- async (title: string) => {
- try {
- await cellService.updateCell(viewId, rowId, field.id, title);
- } catch (e) {
- // toast.error('Failed to update title');
- }
- },
- [field.id, rowId, viewId]
- );
-
- const onUpdateIcon = useCallback(
- async (icon: PageIcon) => {
- try {
- await updateRowMeta(viewId, rowId, { iconUrl: icon.value });
- } catch (e) {
- // toast.error('Failed to update icon');
- }
- },
- [rowId, viewId]
- );
-
- return (
- <div className={'px-1 pb-4 pt-2'}>
- {page && (
- <ViewTitle
- onUpdateIcon={onUpdateIcon}
- onTitleChange={onTitleChange}
- view={{
- ...page,
- name: title,
- icon: row.icon
- ? {
- ty: ViewIconTypePB.Emoji,
- value: row.icon,
- }
- : undefined,
- }}
- />
- )}
- </div>
- );
-}
-
-export default React.memo(RecordTitle);
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/edit_record/record_properties/Property.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/edit_record/record_properties/Property.tsx
deleted file mode 100644
index 279ee13f68..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/edit_record/record_properties/Property.tsx
+++ /dev/null
@@ -1,55 +0,0 @@
-import React, { HTMLAttributes } from 'react';
-import PropertyName from '$app/components/database/components/edit_record/record_properties/PropertyName';
-import PropertyValue from '$app/components/database/components/edit_record/record_properties/PropertyValue';
-import { Field } from '$app/application/database';
-import { IconButton, Tooltip } from '@mui/material';
-import { ReactComponent as DragSvg } from '$app/assets/drag.svg';
-import { useTranslation } from 'react-i18next';
-
-interface Props extends HTMLAttributes<HTMLDivElement> {
- field: Field;
- rowId: string;
- ishovered: boolean;
- onHover: (id: string | null) => void;
- menuOpened?: boolean;
- onOpenMenu?: () => void;
- onCloseMenu?: () => void;
-}
-
-function Property(
- { field, rowId, ishovered, onHover, menuOpened, onCloseMenu, onOpenMenu, ...props }: Props,
- ref: React.ForwardedRef<HTMLDivElement>
-) {
- const { t } = useTranslation();
-
- return (
- <>
- <div
- ref={ref}
- onMouseEnter={() => {
- onHover(field.id);
- }}
- onMouseLeave={() => {
- onHover(null);
- }}
- className={'relative flex items-start gap-6 rounded hover:bg-content-blue-50'}
- key={field.id}
- {...props}
- >
- <PropertyName menuOpened={menuOpened} onCloseMenu={onCloseMenu} onOpenMenu={onOpenMenu} field={field} />
- <PropertyValue rowId={rowId} field={field} />
- {ishovered && (
- <div className={`absolute left-[-30px] flex h-full items-center `}>
- <Tooltip placement='top' title={t('grid.row.dragAndClick')}>
- <IconButton onClick={onOpenMenu} className='mx-1 cursor-grab active:cursor-grabbing'>
- <DragSvg />
- </IconButton>
- </Tooltip>
- </div>
- )}
- </div>
- </>
- );
-}
-
-export default React.forwardRef(Property);
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/edit_record/record_properties/PropertyList.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/edit_record/record_properties/PropertyList.tsx
deleted file mode 100644
index 138c7543fd..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/edit_record/record_properties/PropertyList.tsx
+++ /dev/null
@@ -1,55 +0,0 @@
-import React, { HTMLAttributes, useState } from 'react';
-import { Field } from '$app/application/database';
-import Property from '$app/components/database/components/edit_record/record_properties/Property';
-import { Draggable } from 'react-beautiful-dnd';
-
-interface Props extends HTMLAttributes<HTMLDivElement> {
- properties: Field[];
- rowId: string;
- placeholderNode?: React.ReactNode;
- openMenuPropertyId?: string;
- setOpenMenuPropertyId?: (id?: string) => void;
-}
-
-function PropertyList(
- { properties, rowId, placeholderNode, openMenuPropertyId, setOpenMenuPropertyId, ...props }: Props,
- ref: React.ForwardedRef<HTMLDivElement>
-) {
- const [hoverId, setHoverId] = useState<string | null>(null);
-
- return (
- <div ref={ref} {...props} className={'flex w-full flex-col pb-3 pt-2'}>
- {properties.map((field, index) => {
- return (
- <Draggable key={field.id} draggableId={field.id} index={index}>
- {(provided) => {
- return (
- <Property
- ref={provided.innerRef}
- {...provided.draggableProps}
- {...provided.dragHandleProps}
- onHover={setHoverId}
- ishovered={field.id === hoverId}
- field={field}
- rowId={rowId}
- menuOpened={openMenuPropertyId === field.id}
- onOpenMenu={() => {
- setOpenMenuPropertyId?.(field.id);
- }}
- onCloseMenu={() => {
- if (openMenuPropertyId === field.id) {
- setOpenMenuPropertyId?.(undefined);
- }
- }}
- />
- );
- }}
- </Draggable>
- );
- })}
- {placeholderNode}
- </div>
- );
-}
-
-export default React.forwardRef(PropertyList);
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/edit_record/record_properties/PropertyName.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/edit_record/record_properties/PropertyName.tsx
deleted file mode 100644
index e7de3f1fb0..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/edit_record/record_properties/PropertyName.tsx
+++ /dev/null
@@ -1,32 +0,0 @@
-import React, { useRef } from 'react';
-import { Property } from '$app/components/database/components/property';
-import { Field as FieldType } from '$app/application/database';
-
-interface Props {
- field: FieldType;
- menuOpened?: boolean;
- onOpenMenu?: () => void;
- onCloseMenu?: () => void;
-}
-function PropertyName({ field, menuOpened = false, onOpenMenu, onCloseMenu }: Props) {
- const ref = useRef<HTMLDivElement | null>(null);
-
- return (
- <>
- <div
- ref={ref}
- onContextMenu={(e) => {
- e.stopPropagation();
- e.preventDefault();
- onOpenMenu?.();
- }}
- className={'flex min-h-[36px] w-[200px] cursor-pointer items-center'}
- onClick={onOpenMenu}
- >
- <Property menuOpened={menuOpened} onOpenMenu={onOpenMenu} onCloseMenu={onCloseMenu} field={field} />
- </div>
- </>
- );
-}
-
-export default PropertyName;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/edit_record/record_properties/PropertyValue.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/edit_record/record_properties/PropertyValue.tsx
deleted file mode 100644
index 4bb33e7f05..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/edit_record/record_properties/PropertyValue.tsx
+++ /dev/null
@@ -1,33 +0,0 @@
-import React, { useEffect, useRef, useState } from 'react';
-import { Cell } from '$app/components/database/components';
-import { Field } from '$app/application/database';
-import { useTranslation } from 'react-i18next';
-
-function PropertyValue(props: { rowId: string; field: Field }) {
- const { t } = useTranslation();
- const ref = useRef<HTMLDivElement>(null);
- const [width, setWidth] = useState(props.field.width);
-
- useEffect(() => {
- const el = ref.current;
-
- if (!el) return;
- const width = el.getBoundingClientRect().width;
-
- setWidth(width);
- }, []);
- return (
- <div ref={ref} className={'flex min-h-[36px] flex-1 items-center'}>
- <Cell
- placeholder={t('grid.row.textPlaceholder')}
- {...props}
- field={{
- ...props.field,
- width,
- }}
- />
- </div>
- );
-}
-
-export default React.memo(PropertyValue);
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/edit_record/record_properties/RecordProperties.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/edit_record/record_properties/RecordProperties.tsx
deleted file mode 100644
index 16fc122615..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/edit_record/record_properties/RecordProperties.tsx
+++ /dev/null
@@ -1,97 +0,0 @@
-import React, { useCallback, useEffect, useMemo, useState } from 'react';
-import { Field, fieldService, RowMeta } from '$app/application/database';
-import { useDatabase } from '$app/components/database';
-import { FieldVisibility } from '@/services/backend';
-
-import PropertyList from '$app/components/database/components/edit_record/record_properties/PropertyList';
-import NewProperty from '$app/components/database/components/property/NewProperty';
-import { useViewId } from '$app/hooks';
-import { DragDropContext, Droppable, DropResult, OnDragEndResponder } from 'react-beautiful-dnd';
-import SwitchPropertiesVisible from '$app/components/database/components/edit_record/record_properties/SwitchPropertiesVisible';
-
-interface Props {
- row: RowMeta;
-}
-
-function RecordProperties({ row }: Props) {
- const viewId = useViewId();
- const { fields } = useDatabase();
- const fieldId = useMemo(() => {
- return fields.find((field) => field.isPrimary)?.id;
- }, [fields]);
- const rowId = row.id;
- const [openMenuPropertyId, setOpenMenuPropertyId] = useState<string | undefined>(undefined);
- const [showHiddenFields, setShowHiddenFields] = useState(false);
-
- const properties = useMemo(() => {
- return fields.filter((field) => {
- // exclude the current field, because it's already displayed in the title
- // filter out hidden fields if the user doesn't want to see them
- return field.id !== fieldId && (showHiddenFields || field.visibility !== FieldVisibility.AlwaysHidden);
- });
- }, [fieldId, fields, showHiddenFields]);
-
- const hiddenFieldsCount = useMemo(() => {
- return fields.filter((field) => {
- return field.visibility === FieldVisibility.AlwaysHidden;
- }).length;
- }, [fields]);
-
- const [state, setState] = useState<Field[]>(properties);
-
- useEffect(() => {
- setState(properties);
- }, [properties]);
-
- // move the field in the state
- const handleOnDragEnd: OnDragEndResponder = useCallback(
- async (result: DropResult) => {
- const { destination, draggableId, source } = result;
- const newIndex = destination?.index;
- const oldIndex = source.index;
-
- if (newIndex === undefined || newIndex === null) {
- return;
- }
-
- const newId = properties[newIndex ?? 0].id;
-
- // reorder the properties synchronously to avoid flickering
- const newProperties = fieldService.reorderFields(properties, oldIndex, newIndex ?? 0);
-
- setState(newProperties);
-
- await fieldService.moveField(viewId, draggableId, newId);
- },
- [properties, viewId]
- );
-
- return (
- <div className={'relative flex w-full flex-col pb-4'}>
- <DragDropContext onDragEnd={handleOnDragEnd}>
- <Droppable droppableId='droppable' type='droppableItem'>
- {(dropProvided) => (
- <PropertyList
- {...dropProvided.droppableProps}
- placeholderNode={dropProvided.placeholder}
- ref={dropProvided.innerRef}
- rowId={rowId}
- properties={state}
- openMenuPropertyId={openMenuPropertyId}
- setOpenMenuPropertyId={setOpenMenuPropertyId}
- />
- )}
- </Droppable>
- </DragDropContext>
- <SwitchPropertiesVisible
- hiddenFieldsCount={hiddenFieldsCount}
- showHiddenFields={showHiddenFields}
- setShowHiddenFields={setShowHiddenFields}
- />
-
- <NewProperty onInserted={setOpenMenuPropertyId} />
- </div>
- );
-}
-
-export default RecordProperties;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/edit_record/record_properties/SwitchPropertiesVisible.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/edit_record/record_properties/SwitchPropertiesVisible.tsx
deleted file mode 100644
index f8937bbf21..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/edit_record/record_properties/SwitchPropertiesVisible.tsx
+++ /dev/null
@@ -1,38 +0,0 @@
-import React from 'react';
-import Button from '@mui/material/Button';
-import { useTranslation } from 'react-i18next';
-import { ReactComponent as EyeClosedSvg } from '$app/assets/eye_close.svg';
-import { ReactComponent as EyeOpenSvg } from '$app/assets/eye_open.svg';
-
-function SwitchPropertiesVisible({
- hiddenFieldsCount,
- showHiddenFields,
- setShowHiddenFields,
-}: {
- hiddenFieldsCount: number;
- showHiddenFields: boolean;
- setShowHiddenFields: (showHiddenFields: boolean) => void;
-}) {
- const { t } = useTranslation();
-
- return hiddenFieldsCount > 0 ? (
- <Button
- onClick={() => {
- setShowHiddenFields(!showHiddenFields);
- }}
- className={'w-full justify-start'}
- startIcon={showHiddenFields ? <EyeClosedSvg /> : <EyeOpenSvg />}
- color={'inherit'}
- >
- {showHiddenFields
- ? t('grid.rowPage.hideHiddenFields', {
- count: hiddenFieldsCount,
- })
- : t('grid.rowPage.showHiddenFields', {
- count: hiddenFieldsCount,
- })}
- </Button>
- ) : null;
-}
-
-export default SwitchPropertiesVisible;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/checklist/AddNewOption.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/checklist/AddNewOption.tsx
deleted file mode 100644
index 027936d280..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/checklist/AddNewOption.tsx
+++ /dev/null
@@ -1,63 +0,0 @@
-import React, { useState } from 'react';
-import { updateChecklistCell } from '$app/application/database/cell/cell_service';
-import { useViewId } from '$app/hooks';
-import { Button } from '@mui/material';
-import { useTranslation } from 'react-i18next';
-
-function AddNewOption({
- rowId,
- fieldId,
- onClose,
- onFocus,
-}: {
- rowId: string;
- fieldId: string;
- onClose: () => void;
- onFocus: () => void;
-}) {
- const { t } = useTranslation();
- const [value, setValue] = useState('');
- const viewId = useViewId();
- const createOption = async () => {
- await updateChecklistCell(viewId, rowId, fieldId, {
- insertOptions: [value],
- });
- setValue('');
- };
-
- return (
- <div className={'flex items-center justify-between p-2 px-2 text-sm'}>
- <input
- onFocus={onFocus}
- placeholder={t('grid.checklist.addNew')}
- className={'flex-1 px-2'}
- autoFocus={true}
- onKeyDown={(e) => {
- if (e.key === 'Enter') {
- e.stopPropagation();
- e.preventDefault();
- void createOption();
- return;
- }
-
- if (e.key === 'Escape') {
- e.stopPropagation();
- e.preventDefault();
- onClose();
- return;
- }
- }}
- value={value}
- spellCheck={false}
- onChange={(e) => {
- setValue(e.target.value);
- }}
- />
- <Button variant={'contained'} className={'text-xs'} size={'small'} disabled={!value} onClick={createOption}>
- {t('grid.selectOption.create')}
- </Button>
- </div>
- );
-}
-
-export default AddNewOption;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/checklist/ChecklistCellActions.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/checklist/ChecklistCellActions.tsx
deleted file mode 100644
index 61583c4746..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/checklist/ChecklistCellActions.tsx
+++ /dev/null
@@ -1,76 +0,0 @@
-import React, { useState } from 'react';
-import Popover, { PopoverProps } from '@mui/material/Popover';
-import { Divider } from '@mui/material';
-import { ChecklistCell as ChecklistCellType } from '$app/application/database';
-import ChecklistItem from '$app/components/database/components/field_types/checklist/ChecklistItem';
-import AddNewOption from '$app/components/database/components/field_types/checklist/AddNewOption';
-import LinearProgressWithLabel from '$app/components/database/_shared/LinearProgressWithLabel';
-
-function ChecklistCellActions({
- cell,
- maxHeight,
- maxWidth,
- ...props
-}: PopoverProps & {
- cell: ChecklistCellType;
- maxWidth?: number;
- maxHeight?: number;
-}) {
- const { fieldId, rowId } = cell;
- const { percentage, selectedOptions = [], options = [] } = cell.data;
-
- const [focusedId, setFocusedId] = useState<string | null>(null);
-
- return (
- <Popover {...props} disableRestoreFocus={true}>
- <div
- style={{
- maxHeight: maxHeight,
- maxWidth: maxWidth,
- }}
- className={'flex h-full w-full flex-col overflow-hidden'}
- >
- {options.length > 0 && (
- <>
- <div className={'p-2'}>
- <LinearProgressWithLabel
- value={percentage ?? 0}
- count={options.length}
- selectedCount={selectedOptions.length}
- />
- </div>
- <div className={'flex-1 overflow-y-auto overflow-x-hidden p-1'}>
- {options?.map((option) => {
- return (
- <ChecklistItem
- fieldId={fieldId}
- rowId={rowId}
- isSelected={focusedId === option.id}
- key={option.id}
- option={option}
- onFocus={() => setFocusedId(option.id)}
- onClose={() => props.onClose?.({}, 'escapeKeyDown')}
- checked={selectedOptions?.includes(option.id) || false}
- />
- );
- })}
- </div>
-
- <Divider />
- </>
- )}
-
- <AddNewOption
- onFocus={() => {
- setFocusedId(null);
- }}
- onClose={() => props.onClose?.({}, 'escapeKeyDown')}
- fieldId={fieldId}
- rowId={rowId}
- />
- </div>
- </Popover>
- );
-}
-
-export default ChecklistCellActions;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/checklist/ChecklistItem.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/checklist/ChecklistItem.tsx
deleted file mode 100644
index 5c6a55fa60..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/checklist/ChecklistItem.tsx
+++ /dev/null
@@ -1,117 +0,0 @@
-import React, { useCallback, useMemo, useState } from 'react';
-import { SelectOption } from '$app/application/database';
-import { IconButton } from '@mui/material';
-import { updateChecklistCell } from '$app/application/database/cell/cell_service';
-import { useViewId } from '$app/hooks';
-import { ReactComponent as DeleteIcon } from '$app/assets/delete.svg';
-import { ReactComponent as CheckboxCheckSvg } from '$app/assets/database/checkbox-check.svg';
-import { ReactComponent as CheckboxUncheckSvg } from '$app/assets/database/checkbox-uncheck.svg';
-import isHotkey from 'is-hotkey';
-import debounce from 'lodash-es/debounce';
-import { useTranslation } from 'react-i18next';
-
-const DELAY_CHANGE = 200;
-
-function ChecklistItem({
- checked,
- option,
- rowId,
- fieldId,
- onClose,
- isSelected,
- onFocus,
-}: {
- checked: boolean;
- option: SelectOption;
- rowId: string;
- fieldId: string;
- onClose: () => void;
- isSelected: boolean;
- onFocus: () => void;
-}) {
- const inputRef = React.useRef<HTMLInputElement>(null);
- const { t } = useTranslation();
- const [value, setValue] = useState(option.name);
- const viewId = useViewId();
- const updateText = useCallback(async () => {
- await updateChecklistCell(viewId, rowId, fieldId, {
- updateOptions: [
- {
- ...option,
- name: value,
- },
- ],
- });
- }, [fieldId, option, rowId, value, viewId]);
-
- const onCheckedChange = useMemo(() => {
- return debounce(
- () =>
- updateChecklistCell(viewId, rowId, fieldId, {
- selectedOptionIds: [option.id],
- }),
- DELAY_CHANGE
- );
- }, [fieldId, option.id, rowId, viewId]);
-
- const deleteOption = useCallback(async () => {
- await updateChecklistCell(viewId, rowId, fieldId, {
- deleteOptionIds: [option.id],
- });
- }, [fieldId, option.id, rowId, viewId]);
-
- return (
- <div
- style={{
- backgroundColor: isSelected ? 'var(--fill-list-active)' : undefined,
- }}
- className={`checklist-item ${
- isSelected ? 'selected' : ''
- } flex items-center justify-between gap-2 rounded p-1 text-sm hover:bg-fill-list-hover`}
- >
- <div className={'relative cursor-pointer select-none text-content-blue-400'} onClick={onCheckedChange}>
- {checked ? <CheckboxCheckSvg className={'h-5 w-5'} /> : <CheckboxUncheckSvg className={'h-5 w-5'} />}
- </div>
-
- <input
- className={'flex-1 truncate'}
- ref={inputRef}
- onBlur={updateText}
- value={value}
- onFocus={onFocus}
- placeholder={t('grid.checklist.taskHint')}
- onKeyDown={(e) => {
- if (e.key === 'Escape') {
- e.stopPropagation();
- e.preventDefault();
- void updateText();
- onClose();
- return;
- }
-
- if (e.key === 'Enter') {
- e.stopPropagation();
- e.preventDefault();
- void updateText();
- if (isHotkey('mod+enter', e)) {
- void onCheckedChange();
- }
-
- return;
- }
- }}
- spellCheck={false}
- onChange={(e) => {
- setValue(e.target.value);
- }}
- />
- <div className={'w-10'}>
- <IconButton size={'small'} className={`delete-option-button z-10 mx-2`} onClick={deleteOption}>
- <DeleteIcon />
- </IconButton>
- </div>
- </div>
- );
-}
-
-export default ChecklistItem;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/checklist/LinearProgressWithLabel.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/checklist/LinearProgressWithLabel.tsx
deleted file mode 100644
index e8b9c95a44..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/checklist/LinearProgressWithLabel.tsx
+++ /dev/null
@@ -1,17 +0,0 @@
-import * as React from 'react';
-import LinearProgress, { LinearProgressProps } from '@mui/material/LinearProgress';
-import Typography from '@mui/material/Typography';
-import Box from '@mui/material/Box';
-
-export function LinearProgressWithLabel(props: LinearProgressProps & { value: number }) {
- return (
- <Box sx={{ display: 'flex', alignItems: 'center' }}>
- <Box sx={{ width: '100%', mr: 1 }}>
- <LinearProgress variant='determinate' {...props} value={props.value * 100} />
- </Box>
- <Box sx={{ minWidth: 35 }}>
- <Typography variant='body2' color='text.secondary'>{`${Math.round(props.value * 100)}%`}</Typography>
- </Box>
- </Box>
- );
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/date/CustomCalendar.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/date/CustomCalendar.tsx
deleted file mode 100644
index 4a36498bd2..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/date/CustomCalendar.tsx
+++ /dev/null
@@ -1,117 +0,0 @@
-import React, { useEffect, useState } from 'react';
-import DatePicker, { ReactDatePickerCustomHeaderProps } from 'react-datepicker';
-import 'react-datepicker/dist/react-datepicker.css';
-import dayjs from 'dayjs';
-import { ReactComponent as LeftSvg } from '$app/assets/arrow-left.svg';
-import { ReactComponent as RightSvg } from '$app/assets/arrow-right.svg';
-import { IconButton } from '@mui/material';
-import './calendar.scss';
-
-function CustomCalendar({
- handleChange,
- isRange,
- timestamp,
- endTimestamp,
-}: {
- handleChange: (params: { date?: number; endDate?: number }) => void;
- isRange: boolean;
- timestamp?: number;
- endTimestamp?: number;
-}) {
- const [startDate, setStartDate] = useState<Date | null>(() => {
- if (!timestamp) return null;
- return new Date(timestamp * 1000);
- });
- const [endDate, setEndDate] = useState<Date | null>(() => {
- if (!endTimestamp) return null;
- return new Date(endTimestamp * 1000);
- });
-
- useEffect(() => {
- if (!isRange || !endTimestamp) return;
- setEndDate(new Date(endTimestamp * 1000));
- }, [isRange, endTimestamp]);
-
- useEffect(() => {
- if (!timestamp) return;
- setStartDate(new Date(timestamp * 1000));
- }, [timestamp]);
-
- return (
- <div className={'flex w-full items-center justify-center'}>
- <DatePicker
- calendarClassName={
- 'appflowy-date-picker-calendar select-none bg-bg-body h-full border-none rounded-none flex w-full items-center justify-center'
- }
- renderCustomHeader={(props: ReactDatePickerCustomHeaderProps) => {
- return (
- <div className={'flex w-full justify-between pb-1.5 pt-0'}>
- <div className={'flex-1 px-4 text-left text-sm font-medium text-text-title'}>
- {dayjs(props.date).format('MMMM YYYY')}
- </div>
-
- <div className={'flex items-center gap-[10px] pr-2'}>
- <IconButton size={'small'} onClick={props.decreaseMonth}>
- <LeftSvg />
- </IconButton>
- <IconButton size={'small'} onClick={props.increaseMonth}>
- <RightSvg />
- </IconButton>
- </div>
- </div>
- );
- }}
- selected={startDate}
- onChange={(dates) => {
- if (!dates) return;
- if (isRange && Array.isArray(dates)) {
- let start = dates[0] as Date;
- let end = dates[1] as Date;
-
- if (!end && start && startDate && endDate) {
- const currentTime = start.getTime();
- const startTimeStamp = startDate.getTime();
- const endTimeStamp = endDate.getTime();
- const isGreaterThanStart = currentTime > startTimeStamp;
- const isGreaterThanEnd = currentTime > endTimeStamp;
- const isLessThanStart = currentTime < startTimeStamp;
- const isLessThanEnd = currentTime < endTimeStamp;
- const isEqualsStart = currentTime === startTimeStamp;
- const isEqualsEnd = currentTime === endTimeStamp;
-
- if ((isGreaterThanStart && isLessThanEnd) || isGreaterThanEnd) {
- end = start;
- start = startDate;
- } else if (isEqualsStart || isEqualsEnd) {
- end = start;
- } else if (isLessThanStart) {
- end = endDate;
- }
- }
-
- setStartDate(start);
- setEndDate(end);
- if (!start || !end) return;
- handleChange({
- date: start.getTime() / 1000,
- endDate: end.getTime() / 1000,
- });
- } else {
- const date = dates as Date;
-
- setStartDate(date);
- handleChange({
- date: date.getTime() / 1000,
- });
- }
- }}
- startDate={isRange ? startDate : null}
- endDate={isRange ? endDate : null}
- selectsRange={isRange}
- inline
- />
- </div>
- );
-}
-
-export default CustomCalendar;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/date/DateFormat.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/date/DateFormat.tsx
deleted file mode 100644
index fd5ba57889..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/date/DateFormat.tsx
+++ /dev/null
@@ -1,96 +0,0 @@
-import React, { useCallback, useMemo, useRef, useState } from 'react';
-import { useTranslation } from 'react-i18next';
-import { MenuItem, Menu } from '@mui/material';
-import { ReactComponent as MoreSvg } from '$app/assets/more.svg';
-import { ReactComponent as SelectCheckSvg } from '$app/assets/select-check.svg';
-
-import { DateFormatPB } from '@/services/backend';
-import KeyboardNavigation, {
- KeyboardNavigationOption,
-} from '$app/components/_shared/keyboard_navigation/KeyboardNavigation';
-
-interface Props {
- value: DateFormatPB;
- onChange: (value: DateFormatPB) => void;
-}
-
-function DateFormat({ value, onChange }: Props) {
- const { t } = useTranslation();
- const [open, setOpen] = useState(false);
- const ref = useRef<HTMLLIElement>(null);
-
- const renderOptionContent = useCallback(
- (option: DateFormatPB, title: string) => {
- return (
- <div className={'flex w-full items-center justify-between gap-2'}>
- <div className={'flex-1'}>{title}</div>
- {value === option && <SelectCheckSvg />}
- </div>
- );
- },
- [value]
- );
-
- const options: KeyboardNavigationOption<DateFormatPB>[] = useMemo(() => {
- return [
- {
- key: DateFormatPB.Friendly,
- content: renderOptionContent(DateFormatPB.Friendly, t('grid.field.dateFormatFriendly')),
- },
- {
- key: DateFormatPB.ISO,
- content: renderOptionContent(DateFormatPB.ISO, t('grid.field.dateFormatISO')),
- },
- {
- key: DateFormatPB.US,
- content: renderOptionContent(DateFormatPB.US, t('grid.field.dateFormatUS')),
- },
- {
- key: DateFormatPB.Local,
- content: renderOptionContent(DateFormatPB.Local, t('grid.field.dateFormatLocal')),
- },
- {
- key: DateFormatPB.DayMonthYear,
- content: renderOptionContent(DateFormatPB.DayMonthYear, t('grid.field.dateFormatDayMonthYear')),
- },
- ];
- }, [renderOptionContent, t]);
-
- const handleClick = (option: DateFormatPB) => {
- onChange(option);
- setOpen(false);
- };
-
- return (
- <>
- <MenuItem
- className={'mx-0 flex w-full justify-between text-xs font-medium'}
- ref={ref}
- onClick={() => setOpen(true)}
- >
- {t('grid.field.dateFormat')}
- <MoreSvg className={`transform text-base ${open ? '' : 'rotate-90'}`} />
- </MenuItem>
- <Menu
- anchorOrigin={{
- vertical: 'top',
- horizontal: 'right',
- }}
- open={open}
- anchorEl={ref.current}
- onClose={() => setOpen(false)}
- >
- <KeyboardNavigation
- onEscape={() => {
- setOpen(false);
- }}
- disableFocus={true}
- options={options}
- onConfirm={handleClick}
- />
- </Menu>
- </>
- );
-}
-
-export default DateFormat;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/date/DateTimeCellActions.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/date/DateTimeCellActions.tsx
deleted file mode 100644
index 78e3129d4f..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/date/DateTimeCellActions.tsx
+++ /dev/null
@@ -1,197 +0,0 @@
-import React, { useCallback, useMemo } from 'react';
-import Popover, { PopoverProps } from '@mui/material/Popover';
-import { DateTimeCell, DateTimeField, DateTimeTypeOption } from '$app/application/database';
-import { useViewId } from '$app/hooks';
-import { useTranslation } from 'react-i18next';
-import { updateDateCell } from '$app/application/database/cell/cell_service';
-import { Divider, MenuItem, MenuList } from '@mui/material';
-import dayjs from 'dayjs';
-import RangeSwitch from '$app/components/database/components/field_types/date/RangeSwitch';
-import CustomCalendar from '$app/components/database/components/field_types/date/CustomCalendar';
-import IncludeTimeSwitch from '$app/components/database/components/field_types/date/IncludeTimeSwitch';
-import DateTimeFormatSelect from '$app/components/database/components/field_types/date/DateTimeFormatSelect';
-import DateTimeSet from '$app/components/database/components/field_types/date/DateTimeSet';
-import { useTypeOption } from '$app/components/database';
-import { getDateFormat, getTimeFormat } from '$app/components/database/components/field_types/date/utils';
-import { notify } from '$app/components/_shared/notify';
-
-function DateTimeCellActions({
- cell,
- field,
- maxWidth,
- maxHeight,
- ...props
-}: PopoverProps & {
- field: DateTimeField;
- cell: DateTimeCell;
- maxWidth?: number;
- maxHeight?: number;
-}) {
- const typeOption = useTypeOption<DateTimeTypeOption>(field.id);
-
- const timeFormat = useMemo(() => {
- return getTimeFormat(typeOption.timeFormat);
- }, [typeOption.timeFormat]);
-
- const dateFormat = useMemo(() => {
- return getDateFormat(typeOption.dateFormat);
- }, [typeOption.dateFormat]);
-
- const { includeTime } = cell.data;
-
- const timestamp = useMemo(() => cell.data.timestamp || undefined, [cell.data.timestamp]);
- const endTimestamp = useMemo(() => cell.data.endTimestamp || undefined, [cell.data.endTimestamp]);
- const time = useMemo(() => cell.data.time || undefined, [cell.data.time]);
- const endTime = useMemo(() => cell.data.endTime || undefined, [cell.data.endTime]);
-
- const viewId = useViewId();
- const { t } = useTranslation();
-
- const handleChange = useCallback(
- async (params: {
- includeTime?: boolean;
- date?: number;
- endDate?: number;
- time?: string;
- endTime?: string;
- isRange?: boolean;
- clearFlag?: boolean;
- }) => {
- try {
- const isRange = params.isRange ?? cell.data.isRange;
-
- const data = {
- date: params.date ?? timestamp,
- endDate: isRange ? params.endDate ?? endTimestamp : undefined,
- time: params.time ?? time,
- endTime: isRange ? params.endTime ?? endTime : undefined,
- includeTime: params.includeTime ?? includeTime,
- isRange,
- clearFlag: params.clearFlag,
- };
-
- // if isRange and date is greater than endDate, swap date and endDate
- if (
- data.isRange &&
- data.date &&
- data.endDate &&
- dayjs(dayjs.unix(data.date).format('YYYY/MM/DD ') + data.time).unix() >
- dayjs(dayjs.unix(data.endDate).format('YYYY/MM/DD ') + data.endTime).unix()
- ) {
- if (params.date || params.time) {
- data.endDate = data.date;
- data.endTime = data.time;
- }
-
- if (params.endDate || params.endTime) {
- data.date = data.endDate;
- data.time = data.endTime;
- }
- }
-
- await updateDateCell(viewId, cell.rowId, cell.fieldId, data);
- } catch (e) {
- notify.error(String(e));
- }
- },
- [cell, endTime, endTimestamp, includeTime, time, timestamp, viewId]
- );
-
- const isRange = cell.data.isRange || false;
-
- return (
- <Popover
- keepMounted={false}
- disableRestoreFocus={true}
- {...props}
- PaperProps={{
- ...props.PaperProps,
- className: 'pt-4 transform transition-all',
- }}
- onKeyDown={(e) => {
- if (e.key === 'Escape') {
- e.preventDefault();
- e.stopPropagation();
- props.onClose?.({}, 'escapeKeyDown');
- }
- }}
- >
- <div
- style={{
- maxWidth: maxWidth,
- maxHeight: maxHeight,
- }}
- >
- <DateTimeSet
- date={timestamp}
- endTime={endTime}
- endDate={endTimestamp}
- dateFormat={dateFormat}
- time={time}
- timeFormat={timeFormat}
- onChange={handleChange}
- isRange={isRange}
- includeTime={includeTime}
- />
-
- <CustomCalendar
- isRange={isRange}
- timestamp={timestamp}
- endTimestamp={endTimestamp}
- handleChange={handleChange}
- />
-
- <Divider className={'my-0'} />
- <div className={'flex flex-col gap-1 px-4 py-2'}>
- <RangeSwitch
- onIsRangeChange={(val) => {
- void handleChange({
- isRange: val,
- // reset endTime when isRange is changed
- endTime: time,
- endDate: timestamp,
- });
- }}
- checked={isRange}
- />
- <IncludeTimeSwitch
- disabled={!timestamp}
- onIncludeTimeChange={(val) => {
- void handleChange({
- includeTime: val,
- // reset time when includeTime is changed
- time: val ? dayjs().format(timeFormat) : undefined,
- endTime: val && isRange ? dayjs().format(timeFormat) : undefined,
- });
- }}
- checked={includeTime}
- />
- </div>
-
- <Divider className={'my-0'} />
-
- <MenuList>
- <DateTimeFormatSelect field={field} />
- <MenuItem
- className={'text-xs font-medium'}
- onClick={async () => {
- await handleChange({
- isRange: false,
- includeTime: false,
- });
- await handleChange({
- clearFlag: true,
- });
-
- props.onClose?.({}, 'backdropClick');
- }}
- >
- {t('grid.field.clearDate')}
- </MenuItem>
- </MenuList>
- </div>
- </Popover>
- );
-}
-
-export default DateTimeCellActions;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/date/DateTimeFieldActions.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/date/DateTimeFieldActions.tsx
deleted file mode 100644
index 6c4b41a494..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/date/DateTimeFieldActions.tsx
+++ /dev/null
@@ -1,17 +0,0 @@
-import React from 'react';
-import { UndeterminedDateField } from '$app/application/database';
-import DateTimeFormat from '$app/components/database/components/field_types/date/DateTimeFormat';
-import { Divider } from '@mui/material';
-
-function DateTimeFieldActions({ field }: { field: UndeterminedDateField }) {
- return (
- <>
- <div className={'px-1'}>
- <DateTimeFormat field={field} />
- </div>
- <Divider className={'my-2'} />
- </>
- );
-}
-
-export default DateTimeFieldActions;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/date/DateTimeFormat.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/date/DateTimeFormat.tsx
deleted file mode 100644
index 0107997c24..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/date/DateTimeFormat.tsx
+++ /dev/null
@@ -1,75 +0,0 @@
-import React, { useCallback } from 'react';
-import DateFormat from '$app/components/database/components/field_types/date/DateFormat';
-import TimeFormat from '$app/components/database/components/field_types/date/TimeFormat';
-import { TimeStampTypeOption, UndeterminedDateField, updateTypeOption } from '$app/application/database';
-import { DateFormatPB, FieldType, TimeFormatPB } from '@/services/backend';
-import { useViewId } from '$app/hooks';
-import Typography from '@mui/material/Typography';
-import { useTranslation } from 'react-i18next';
-import IncludeTimeSwitch from '$app/components/database/components/field_types/date/IncludeTimeSwitch';
-import { useTypeOption } from '$app/components/database';
-
-interface Props {
- field: UndeterminedDateField;
- showLabel?: boolean;
-}
-
-function DateTimeFormat({ field, showLabel = true }: Props) {
- const viewId = useViewId();
- const { t } = useTranslation();
- const showIncludeTime = field.type === FieldType.CreatedTime || field.type === FieldType.LastEditedTime;
- const typeOption = useTypeOption<TimeStampTypeOption>(field.id);
- const { timeFormat = TimeFormatPB.TwentyFourHour, dateFormat = DateFormatPB.Friendly, includeTime } = typeOption;
- const handleChange = useCallback(
- async (params: { timeFormat?: TimeFormatPB; dateFormat?: DateFormatPB; includeTime?: boolean }) => {
- try {
- await updateTypeOption(viewId, field.id, field.type, {
- timeFormat: params.timeFormat ?? timeFormat,
- dateFormat: params.dateFormat ?? dateFormat,
- includeTime: params.includeTime ?? includeTime,
- fieldType: field.type,
- });
- } catch (e) {
- // toast.error(e.message);
- }
- },
- [dateFormat, field.id, field.type, includeTime, timeFormat, viewId]
- );
-
- return (
- <div>
- {showLabel && (
- <Typography className={'py-1 pl-3'} color={'text.secondary'}>
- {t('grid.field.format')}
- </Typography>
- )}
-
- <DateFormat
- value={dateFormat}
- onChange={(val) => {
- void handleChange({ dateFormat: val });
- }}
- />
- <TimeFormat
- value={timeFormat}
- onChange={(val) => {
- void handleChange({ timeFormat: val });
- }}
- />
-
- {showIncludeTime && (
- <div className={'px-3 py-1'}>
- <IncludeTimeSwitch
- size={'small'}
- checked={includeTime}
- onIncludeTimeChange={(checked) => {
- void handleChange({ includeTime: checked });
- }}
- />
- </div>
- )}
- </div>
- );
-}
-
-export default DateTimeFormat;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/date/DateTimeFormatSelect.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/date/DateTimeFormatSelect.tsx
deleted file mode 100644
index f0393139b0..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/date/DateTimeFormatSelect.tsx
+++ /dev/null
@@ -1,55 +0,0 @@
-import React, { useState, useRef } from 'react';
-import { Menu, MenuItem } from '@mui/material';
-import { useTranslation } from 'react-i18next';
-import { DateTimeField } from '$app/application/database';
-import DateTimeFormat from '$app/components/database/components/field_types/date/DateTimeFormat';
-import { ReactComponent as MoreSvg } from '$app/assets/more.svg';
-
-interface Props {
- field: DateTimeField;
-}
-
-function DateTimeFormatSelect({ field }: Props) {
- const { t } = useTranslation();
- const [open, setOpen] = useState(false);
- const ref = useRef<HTMLLIElement>(null);
-
- return (
- <>
- <MenuItem ref={ref} onClick={() => setOpen(true)} className={'text-xs font-medium'}>
- <div className={'flex-1'}>
- {t('grid.field.dateFormat')} & {t('grid.field.timeFormat')}
- </div>
- <MoreSvg className={`transform text-base ${open ? '' : 'rotate-90'}`} />
- </MenuItem>
- <Menu
- anchorOrigin={{
- vertical: 'top',
- horizontal: 'right',
- }}
- transformOrigin={{
- vertical: 'top',
- horizontal: 'left',
- }}
- open={open}
- autoFocus={true}
- anchorEl={ref.current}
- onKeyDown={(e) => {
- if (e.key === 'Escape') {
- e.stopPropagation();
- e.preventDefault();
- setOpen(false);
- }
- }}
- onClose={() => setOpen(false)}
- MenuListProps={{
- className: 'px-2',
- }}
- >
- <DateTimeFormat showLabel={false} field={field} />
- </Menu>
- </>
- );
-}
-
-export default DateTimeFormatSelect;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/date/DateTimeInput.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/date/DateTimeInput.tsx
deleted file mode 100644
index 82080b7d25..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/date/DateTimeInput.tsx
+++ /dev/null
@@ -1,86 +0,0 @@
-import React, { useMemo } from 'react';
-import { DateField, TimeField } from '@mui/x-date-pickers-pro';
-import dayjs from 'dayjs';
-import { Divider } from '@mui/material';
-import debounce from 'lodash-es/debounce';
-
-interface Props {
- onChange: (params: { date?: number; time?: string }) => void;
- date?: number;
- time?: string;
- timeFormat: string;
- dateFormat: string;
- includeTime?: boolean;
-}
-
-const sx = {
- '& .MuiOutlinedInput-notchedOutline': {
- border: 'none',
- },
- '& .MuiOutlinedInput-input': {
- padding: '0',
- },
-};
-
-function DateTimeInput({ includeTime, dateFormat, timeFormat, ...props }: Props) {
- const date = useMemo(() => {
- return props.date ? dayjs.unix(props.date) : undefined;
- }, [props.date]);
-
- const time = useMemo(() => {
- return props.time ? dayjs(dayjs().format('YYYY/MM/DD ') + props.time) : undefined;
- }, [props.time]);
-
- const debounceOnChange = useMemo(() => {
- return debounce(props.onChange, 500);
- }, [props.onChange]);
-
- return (
- <div
- className={
- 'flex transform items-center justify-between rounded-lg border border-line-divider px-1 py-2 transition-all'
- }
- >
- <DateField
- value={date}
- onChange={(date) => {
- if (!date) return;
- debounceOnChange({
- date: date.unix(),
- });
- }}
- inputProps={{
- className: 'text-[12px]',
- }}
- format={dateFormat}
- size={'small'}
- sx={sx}
- className={'flex-1 pl-2'}
- />
-
- {includeTime && (
- <>
- <Divider orientation={'vertical'} className={'mx-3'} flexItem />
- <TimeField
- value={time}
- inputProps={{
- className: 'text-[12px]',
- }}
- onChange={(time) => {
- if (!time) return;
- debounceOnChange({
- time: time.format(timeFormat),
- });
- }}
- format={timeFormat}
- size={'small'}
- sx={sx}
- className={'w-[70px] pl-1'}
- />
- </>
- )}
- </div>
- );
-}
-
-export default DateTimeInput;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/date/DateTimeSet.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/date/DateTimeSet.tsx
deleted file mode 100644
index 8e86b952d1..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/date/DateTimeSet.tsx
+++ /dev/null
@@ -1,54 +0,0 @@
-import React from 'react';
-import { LocalizationProvider } from '@mui/x-date-pickers-pro';
-import { AdapterDayjs } from '@mui/x-date-pickers-pro/AdapterDayjs';
-import DateTimeInput from '$app/components/database/components/field_types/date/DateTimeInput';
-
-interface Props {
- onChange: (params: { date?: number; endDate?: number; time?: string; endTime?: string }) => void;
- date?: number;
- endDate?: number;
- time?: string;
- endTime?: string;
- isRange?: boolean;
- timeFormat: string;
- dateFormat: string;
- includeTime?: boolean;
-}
-function DateTimeSet({ onChange, date, endDate, time, endTime, isRange, timeFormat, dateFormat, includeTime }: Props) {
- return (
- <div className={'mx-4 flex w-[216px] transform flex-col gap-2 transition-all'}>
- <LocalizationProvider dateAdapter={AdapterDayjs}>
- <DateTimeInput
- onChange={({ date, time }) => {
- onChange({
- date,
- time,
- });
- }}
- date={date}
- time={time}
- timeFormat={timeFormat}
- dateFormat={dateFormat}
- includeTime={includeTime}
- />
- {isRange && (
- <DateTimeInput
- date={endDate}
- time={endTime}
- onChange={({ date, time }) => {
- onChange({
- endDate: date,
- endTime: time,
- });
- }}
- timeFormat={timeFormat}
- dateFormat={dateFormat}
- includeTime={includeTime}
- />
- )}
- </LocalizationProvider>
- </div>
- );
-}
-
-export default DateTimeSet;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/date/IncludeTimeSwitch.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/date/IncludeTimeSwitch.tsx
deleted file mode 100644
index f40e179ae4..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/date/IncludeTimeSwitch.tsx
+++ /dev/null
@@ -1,30 +0,0 @@
-import React from 'react';
-import { Switch, SwitchProps } from '@mui/material';
-import { ReactComponent as TimeSvg } from '$app/assets/database/field-type-last-edited-time.svg';
-import Typography from '@mui/material/Typography';
-import { useTranslation } from 'react-i18next';
-
-function IncludeTimeSwitch({
- checked,
- onIncludeTimeChange,
- ...props
-}: SwitchProps & {
- onIncludeTimeChange: (checked: boolean) => void;
-}) {
- const { t } = useTranslation();
- const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
- onIncludeTimeChange(event.target.checked);
- };
-
- return (
- <div className={'flex w-full items-center justify-between gap-[20px]'}>
- <div className={'flex flex-1 justify-start gap-1.5'}>
- <TimeSvg />
- <Typography className={'flex-1 text-xs font-medium'}>{t('grid.field.includeTime')}</Typography>
- </div>
- <Switch {...props} size={'small'} checked={checked} onChange={handleChange} />
- </div>
- );
-}
-
-export default IncludeTimeSwitch;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/date/RangeSwitch.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/date/RangeSwitch.tsx
deleted file mode 100644
index 76431af5fa..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/date/RangeSwitch.tsx
+++ /dev/null
@@ -1,30 +0,0 @@
-import React from 'react';
-import { Switch, SwitchProps } from '@mui/material';
-import { useTranslation } from 'react-i18next';
-import Typography from '@mui/material/Typography';
-import { ReactComponent as DateSvg } from '$app/assets/database/field-type-date.svg';
-
-function RangeSwitch({
- checked,
- onIsRangeChange,
- ...props
-}: SwitchProps & {
- onIsRangeChange: (checked: boolean) => void;
-}) {
- const { t } = useTranslation();
- const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
- onIsRangeChange(event.target.checked);
- };
-
- return (
- <div className={'flex w-full items-center justify-between gap-[20px]'}>
- <div className={'flex flex-1 justify-start gap-1.5'}>
- <DateSvg />
- <Typography className={'flex-1 text-xs font-medium'}>{t('grid.field.isRange')}</Typography>
- </div>
- <Switch {...props} size={'small'} checked={checked} onChange={handleChange} />
- </div>
- );
-}
-
-export default RangeSwitch;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/date/TimeFormat.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/date/TimeFormat.tsx
deleted file mode 100644
index 89a9ad1756..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/date/TimeFormat.tsx
+++ /dev/null
@@ -1,82 +0,0 @@
-import React, { useCallback, useMemo, useRef, useState } from 'react';
-import { TimeFormatPB } from '@/services/backend';
-import { useTranslation } from 'react-i18next';
-import { Menu, MenuItem } from '@mui/material';
-import { ReactComponent as MoreSvg } from '$app/assets/more.svg';
-import { ReactComponent as SelectCheckSvg } from '$app/assets/select-check.svg';
-import KeyboardNavigation, {
- KeyboardNavigationOption,
-} from '$app/components/_shared/keyboard_navigation/KeyboardNavigation';
-
-interface Props {
- value: TimeFormatPB;
- onChange: (value: TimeFormatPB) => void;
-}
-function TimeFormat({ value, onChange }: Props) {
- const { t } = useTranslation();
- const [open, setOpen] = useState(false);
- const ref = useRef<HTMLLIElement>(null);
-
- const renderOptionContent = useCallback(
- (option: TimeFormatPB, title: string) => {
- return (
- <div className={'flex w-full items-center justify-between gap-2'}>
- <div className={'flex-1'}>{title}</div>
- {value === option && <SelectCheckSvg className={'text-content-blue-400'} />}
- </div>
- );
- },
- [value]
- );
-
- const options: KeyboardNavigationOption<TimeFormatPB>[] = useMemo(() => {
- return [
- {
- key: TimeFormatPB.TwelveHour,
- content: renderOptionContent(TimeFormatPB.TwelveHour, t('grid.field.timeFormatTwelveHour')),
- },
- {
- key: TimeFormatPB.TwentyFourHour,
- content: renderOptionContent(TimeFormatPB.TwentyFourHour, t('grid.field.timeFormatTwentyFourHour')),
- },
- ];
- }, [renderOptionContent, t]);
-
- const handleClick = (option: TimeFormatPB) => {
- onChange(option);
- setOpen(false);
- };
-
- return (
- <>
- <MenuItem
- className={'mx-0 flex w-full justify-between text-xs font-medium'}
- ref={ref}
- onClick={() => setOpen(true)}
- >
- {t('grid.field.timeFormat')}
- <MoreSvg className={`transform text-base ${open ? '' : 'rotate-90'}`} />
- </MenuItem>
- <Menu
- anchorOrigin={{
- vertical: 'top',
- horizontal: 'right',
- }}
- open={open}
- anchorEl={ref.current}
- onClose={() => setOpen(false)}
- >
- <KeyboardNavigation
- onEscape={() => {
- setOpen(false);
- }}
- disableFocus={true}
- options={options}
- onConfirm={handleClick}
- />
- </Menu>
- </>
- );
-}
-
-export default TimeFormat;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/date/calendar.scss b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/date/calendar.scss
deleted file mode 100644
index 257467ed24..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/date/calendar.scss
+++ /dev/null
@@ -1,82 +0,0 @@
-
-.react-datepicker__month-container {
- width: 100%;
- border-radius: 0;
-}
-.react-datepicker__header {
- border-radius: 0;
- background: transparent;
- border-bottom: 0;
-
-}
-.react-datepicker__day-names {
- border: none;
-}
-.react-datepicker__day-name {
- color: var(--text-caption);
-}
-.react-datepicker__month {
- border: none;
-}
-
-.react-datepicker__day {
- border: none;
- color: var(--text-title);
- border-radius: 100%;
-}
-.react-datepicker__day:hover {
- border-radius: 100%;
- background: var(--fill-default);
- color: var(--content-on-fill);
-}
-.react-datepicker__day--outside-month {
- color: var(--text-caption);
-}
-.react-datepicker__day--in-range {
- background: var(--fill-hover);
- color: var(--content-on-fill);
-}
-
-
-.react-datepicker__day--today {
- border: 1px solid var(--fill-default);
- color: var(--text-title);
- border-radius: 100%;
- background: transparent;
- font-weight: 500;
-
-}
-
-.react-datepicker__day--today:hover{
- background: var(--fill-default);
- color: var(--content-on-fill);
-}
-
-.react-datepicker__day--in-selecting-range, .react-datepicker__day--today.react-datepicker__day--in-range {
- background: var(--fill-hover);
- color: var(--content-on-fill);
- border-color: transparent;
-}
-
-.react-datepicker__day--keyboard-selected {
- background: transparent;
-}
-
-
-.react-datepicker__day--range-start, .react-datepicker__day--range-end, .react-datepicker__day--selected {
- &.react-datepicker__day--today {
- background: var(--fill-default);
- color: var(--content-on-fill);
- }
- background: var(--fill-default) !important;
- color: var(--content-on-fill);
-}
-
-.react-datepicker__day--range-start, .react-datepicker__day--range-end, .react-datepicker__day--selected:hover {
- background: var(--fill-default);
- color: var(--content-on-fill);
-}
-
-.react-swipeable-view-container {
- height: 100%;
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/date/utils.ts b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/date/utils.ts
deleted file mode 100644
index 129e84c4e7..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/date/utils.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-import { DateFormatPB, TimeFormatPB } from '@/services/backend';
-
-export function getTimeFormat(timeFormat?: TimeFormatPB) {
- switch (timeFormat) {
- case TimeFormatPB.TwelveHour:
- return 'h:mm A';
- case TimeFormatPB.TwentyFourHour:
- return 'HH:mm';
- default:
- return 'HH:mm';
- }
-}
-
-export function getDateFormat(dateFormat?: DateFormatPB) {
- switch (dateFormat) {
- case DateFormatPB.Friendly:
- return 'MMM DD, YYYY';
- case DateFormatPB.ISO:
- return 'YYYY-MMM-DD';
- case DateFormatPB.US:
- return 'YYYY/MMM/DD';
- case DateFormatPB.Local:
- return 'MMM/DD/YYYY';
- case DateFormatPB.DayMonthYear:
- return 'DD/MMM/YYYY';
- default:
- return 'YYYY-MMM-DD';
- }
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/number/EditNumberCellInput.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/number/EditNumberCellInput.tsx
deleted file mode 100644
index d2b538a7e1..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/number/EditNumberCellInput.tsx
+++ /dev/null
@@ -1,68 +0,0 @@
-import React, { useCallback } from 'react';
-import { Popover } from '@mui/material';
-import InputBase from '@mui/material/InputBase';
-
-function EditNumberCellInput({
- editing,
- anchorEl,
- width,
- onClose,
- value,
- onChange,
-}: {
- editing: boolean;
- anchorEl: HTMLDivElement | null;
- width: number | undefined;
- onClose: () => void;
- value: string;
- onChange: (value: string) => void;
-}) {
- const handleInput = (e: React.FormEvent<HTMLInputElement>) => {
- const value = (e.target as HTMLInputElement).value;
-
- onChange(value);
- };
-
- const handleKeyDown = useCallback(
- (event: React.KeyboardEvent<HTMLInputElement>) => {
- if (event.key === 'Enter') {
- onClose();
- }
- },
- [onClose]
- );
-
- return (
- <Popover
- disableRestoreFocus={true}
- keepMounted={false}
- open={editing}
- anchorEl={anchorEl}
- PaperProps={{
- className: 'flex p-2 border border-blue-400',
- style: { width, minHeight: anchorEl?.offsetHeight, borderRadius: 0, boxShadow: 'none' },
- }}
- transformOrigin={{
- vertical: 'top',
- horizontal: 'left',
- }}
- transitionDuration={0}
- onClose={onClose}
- >
- <InputBase
- inputProps={{
- sx: {
- padding: 0,
- },
- }}
- spellCheck={false}
- autoFocus={true}
- value={value}
- onInput={handleInput}
- onKeyDown={handleKeyDown}
- />
- </Popover>
- );
-}
-
-export default EditNumberCellInput;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/number/NumberFieldActions.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/number/NumberFieldActions.tsx
deleted file mode 100644
index eceb128804..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/number/NumberFieldActions.tsx
+++ /dev/null
@@ -1,34 +0,0 @@
-import React, { useCallback } from 'react';
-import { NumberField, NumberTypeOption, updateTypeOption } from '$app/application/database';
-import { Divider } from '@mui/material';
-import { useTranslation } from 'react-i18next';
-import NumberFormatSelect from '$app/components/database/components/field_types/number/NumberFormatSelect';
-import { NumberFormatPB } from '@/services/backend';
-import { useViewId } from '$app/hooks';
-import { useTypeOption } from '$app/components/database';
-
-function NumberFieldActions({ field }: { field: NumberField }) {
- const viewId = useViewId();
- const { t } = useTranslation();
- const typeOption = useTypeOption<NumberTypeOption>(field.id);
- const onChange = useCallback(
- async (value: NumberFormatPB) => {
- await updateTypeOption(viewId, field.id, field.type, {
- format: value,
- });
- },
- [field.id, field.type, viewId]
- );
-
- return (
- <>
- <div className={'flex flex-col pt-1'}>
- <div className={'mb-2 px-4 text-sm text-text-caption'}>{t('grid.field.format')}</div>
- <NumberFormatSelect value={typeOption.format || NumberFormatPB.Num} onChange={onChange} />
- </div>
- <Divider className={'my-2'} />
- </>
- );
-}
-
-export default NumberFieldActions;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/number/NumberFormatMenu.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/number/NumberFormatMenu.tsx
deleted file mode 100644
index 0f9be6a21a..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/number/NumberFormatMenu.tsx
+++ /dev/null
@@ -1,64 +0,0 @@
-import React, { useCallback, useMemo, useRef } from 'react';
-import { NumberFormatPB } from '@/services/backend';
-import { Menu, MenuProps } from '@mui/material';
-import { formats, formatText } from '$app/components/database/components/field_types/number/const';
-import { ReactComponent as SelectCheckSvg } from '$app/assets/select-check.svg';
-import KeyboardNavigation, {
- KeyboardNavigationOption,
-} from '$app/components/_shared/keyboard_navigation/KeyboardNavigation';
-
-function NumberFormatMenu({
- value,
- onChangeFormat,
- ...props
-}: MenuProps & {
- value: NumberFormatPB;
- onChangeFormat: (value: NumberFormatPB) => void;
-}) {
- const scrollRef = useRef<HTMLDivElement | null>(null);
- const onConfirm = useCallback(
- (format: NumberFormatPB) => {
- onChangeFormat(format);
- props.onClose?.({}, 'backdropClick');
- },
- [onChangeFormat, props]
- );
-
- const renderContent = useCallback(
- (format: NumberFormatPB) => {
- return (
- <>
- <span className={'flex-1'}>{formatText(format)}</span>
- {value === format && <SelectCheckSvg className={'text-content-blue-400'} />}
- </>
- );
- },
- [value]
- );
-
- const options: KeyboardNavigationOption<NumberFormatPB>[] = useMemo(
- () =>
- formats.map((format) => ({
- key: format.value as NumberFormatPB,
- content: renderContent(format.value as NumberFormatPB),
- })),
- [renderContent]
- );
-
- return (
- <Menu {...props}>
- <div ref={scrollRef} className={'max-h-[360px] overflow-y-auto overflow-x-hidden'}>
- <KeyboardNavigation
- defaultFocusedKey={value}
- scrollRef={scrollRef}
- options={options}
- onConfirm={onConfirm}
- disableFocus={true}
- onEscape={() => props.onClose?.({}, 'escapeKeyDown')}
- />
- </div>
- </Menu>
- );
-}
-
-export default NumberFormatMenu;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/number/NumberFormatSelect.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/number/NumberFormatSelect.tsx
deleted file mode 100644
index 5a02c6759b..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/number/NumberFormatSelect.tsx
+++ /dev/null
@@ -1,49 +0,0 @@
-import React, { useRef, useState } from 'react';
-import { MenuItem } from '@mui/material';
-import { NumberFormatPB } from '@/services/backend';
-import { ReactComponent as MoreSvg } from '$app/assets/more.svg';
-import { formatText } from '$app/components/database/components/field_types/number/const';
-import NumberFormatMenu from '$app/components/database/components/field_types/number/NumberFormatMenu';
-
-function NumberFormatSelect({ value, onChange }: { value: NumberFormatPB; onChange: (value: NumberFormatPB) => void }) {
- const ref = useRef<HTMLLIElement>(null);
- const [expanded, setExpanded] = useState(false);
-
- return (
- <>
- <MenuItem
- ref={ref}
- onClick={() => {
- setExpanded(!expanded);
- }}
- className={'flex w-full justify-between rounded-none'}
- >
- <div className='flex-1 text-xs font-medium'>{formatText(value)}</div>
- <MoreSvg className={`transform text-base ${expanded ? '' : 'rotate-90'}`} />
- </MenuItem>
- <NumberFormatMenu
- keepMounted={false}
- anchorOrigin={{
- vertical: 'top',
- horizontal: 'right',
- }}
- PaperProps={{
- style: {
- maxHeight: 500,
- },
- }}
- transformOrigin={{
- vertical: 'top',
- horizontal: 'left',
- }}
- value={value}
- open={expanded}
- anchorEl={ref.current}
- onClose={() => setExpanded(false)}
- onChangeFormat={onChange}
- />
- </>
- );
-}
-
-export default NumberFormatSelect;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/number/const.ts b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/number/const.ts
deleted file mode 100644
index 38621cb114..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/number/const.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NumberFormatPB } from '@/services/backend';
-
-export const formats = Object.entries(NumberFormatPB)
- .filter(([, value]) => typeof value !== 'string')
- .map(([key, value]) => {
- return {
- key,
- value,
- };
- });
-
-export const formatText = (format: NumberFormatPB) => {
- return formats.find((item) => item.value === format)?.key;
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/select/SelectOptionModifyMenu.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/select/SelectOptionModifyMenu.tsx
deleted file mode 100644
index 6c6cf37aae..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/select/SelectOptionModifyMenu.tsx
+++ /dev/null
@@ -1,165 +0,0 @@
-import { FC, useMemo, useRef, useState } from 'react';
-import { Divider, ListSubheader, MenuItem, MenuList, MenuProps, OutlinedInput } from '@mui/material';
-import { SelectOptionColorPB } from '@/services/backend';
-import { ReactComponent as DeleteSvg } from '$app/assets/delete.svg';
-import { ReactComponent as SelectCheckSvg } from '$app/assets/select-check.svg';
-import { SelectOption } from '$app/application/database';
-import { SelectOptionColorMap, SelectOptionColorTextMap } from './constants';
-import Button from '@mui/material/Button';
-import {
- deleteSelectOption,
- insertOrUpdateSelectOption,
-} from '$app/application/database/field/select_option/select_option_service';
-import { useViewId } from '$app/hooks';
-import Popover from '@mui/material/Popover';
-import debounce from 'lodash-es/debounce';
-import { useTranslation } from 'react-i18next';
-
-interface SelectOptionMenuProps {
- fieldId: string;
- option: SelectOption;
- MenuProps: MenuProps;
-}
-
-const Colors = [
- SelectOptionColorPB.Purple,
- SelectOptionColorPB.Pink,
- SelectOptionColorPB.LightPink,
- SelectOptionColorPB.Orange,
- SelectOptionColorPB.Yellow,
- SelectOptionColorPB.Lime,
- SelectOptionColorPB.Green,
- SelectOptionColorPB.Aqua,
- SelectOptionColorPB.Blue,
-];
-
-export const SelectOptionModifyMenu: FC<SelectOptionMenuProps> = ({ fieldId, option, MenuProps: menuProps }) => {
- const { t } = useTranslation();
- const [tagName, setTagName] = useState(option.name);
- const viewId = useViewId();
- const inputRef = useRef<HTMLInputElement>(null);
- const updateColor = async (color: SelectOptionColorPB) => {
- await insertOrUpdateSelectOption(viewId, fieldId, [
- {
- ...option,
- color,
- },
- ]);
- };
-
- const updateName = useMemo(() => {
- return debounce(async (tagName) => {
- if (tagName === option.name) return;
-
- await insertOrUpdateSelectOption(viewId, fieldId, [
- {
- ...option,
- name: tagName,
- },
- ]);
- }, 500);
- }, [option, viewId, fieldId]);
-
- const onClose = () => {
- menuProps.onClose?.({}, 'backdropClick');
- };
-
- const deleteOption = async () => {
- await deleteSelectOption(viewId, fieldId, [option]);
- onClose();
- };
-
- return (
- <Popover
- keepMounted={false}
- classes={{
- paper: 'w-52',
- }}
- anchorOrigin={{
- vertical: 'top',
- horizontal: 'right',
- }}
- transformOrigin={{
- vertical: 'center',
- horizontal: -32,
- }}
- {...menuProps}
- onClick={(e) => {
- e.stopPropagation();
- }}
- onClose={onClose}
- onMouseDown={(e) => {
- const isInput = inputRef.current?.contains(e.target as Node);
-
- if (isInput) return;
- e.preventDefault();
- e.stopPropagation();
- }}
- >
- <ListSubheader className='my-2 leading-tight'>
- <OutlinedInput
- inputRef={inputRef}
- spellCheck={false}
- autoCorrect={'off'}
- autoCapitalize={'off'}
- value={tagName}
- onChange={(e) => {
- setTagName(e.target.value);
- void updateName(e.target.value);
- }}
- onKeyDown={(e) => {
- if (e.key === 'Escape') {
- e.preventDefault();
- e.stopPropagation();
- void updateName(tagName);
- onClose();
- }
- }}
- onClick={(e) => {
- e.stopPropagation();
- }}
- onMouseDown={(e) => {
- e.stopPropagation();
- }}
- autoFocus={true}
- placeholder={t('grid.selectOption.tagName')}
- size='small'
- />
- </ListSubheader>
- <div className={'mb-2 px-3'}>
- <Button
- className={'flex w-full justify-start'}
- onClick={deleteOption}
- color={'inherit'}
- startIcon={<DeleteSvg />}
- >
- {t('grid.selectOption.deleteTag')}
- </Button>
- </div>
-
- <Divider />
- <MenuItem disabled>{t('grid.selectOption.colorPanelTitle')}</MenuItem>
- <MenuList className={'max-h-[300px] overflow-y-auto overflow-x-hidden px-2'}>
- {Colors.map((color) => (
- <MenuItem
- onMouseDown={(e) => {
- e.preventDefault();
- e.stopPropagation();
- }}
- onClick={(e) => {
- e.preventDefault();
- void updateColor(color);
- }}
- key={color}
- value={color}
- className={'px-1.5'}
- >
- <span className={`mr-2 inline-flex h-4 w-4 rounded-full ${SelectOptionColorMap[color]}`} />
- <span className='flex-1'>{t(`grid.selectOption.${SelectOptionColorTextMap[color]}`)}</span>
- {option.color === color && <SelectCheckSvg className={'text-content-blue-400'} />}
- </MenuItem>
- ))}
- </MenuList>
- </Popover>
- );
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/select/Tag.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/select/Tag.tsx
deleted file mode 100644
index 3e4677d57d..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/select/Tag.tsx
+++ /dev/null
@@ -1,27 +0,0 @@
-import { FC } from 'react';
-import { Chip, ChipProps } from '@mui/material';
-import { SelectOptionColorPB } from '@/services/backend';
-import { SelectOptionColorMap } from './constants';
-
-export interface TagProps extends Omit<ChipProps, 'color'> {
- color?: SelectOptionColorPB | ChipProps['color'];
-}
-
-export const Tag: FC<TagProps> = ({ color, classes, ...props }) => {
-
- return (
- <Chip
- {...props}
- color={typeof color === 'number' ? undefined : color}
- classes={{
- ...classes,
- root: [
- 'rounded-md',
- typeof color === 'number' ? SelectOptionColorMap[color] : '',
- classes?.root,
- ].join(' '),
- label: ['font-medium text-xs', classes?.label].join(' '),
- }}
- />
- )
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/select/constants.ts b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/select/constants.ts
deleted file mode 100644
index 58a42f7dad..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/select/constants.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-import { SelectOptionColorPB } from '@/services/backend';
-
-export const SelectOptionColorMap = {
- [SelectOptionColorPB.Purple]: 'bg-tint-purple',
- [SelectOptionColorPB.Pink]: 'bg-tint-pink',
- [SelectOptionColorPB.LightPink]: 'bg-tint-red',
- [SelectOptionColorPB.Orange]: 'bg-tint-orange',
- [SelectOptionColorPB.Yellow]: 'bg-tint-yellow',
- [SelectOptionColorPB.Lime]: 'bg-tint-lime',
- [SelectOptionColorPB.Green]: 'bg-tint-green',
- [SelectOptionColorPB.Aqua]: 'bg-tint-aqua',
- [SelectOptionColorPB.Blue]: 'bg-tint-blue',
-};
-
-export const SelectOptionColorTextMap = {
- [SelectOptionColorPB.Purple]: 'purpleColor',
- [SelectOptionColorPB.Pink]: 'pinkColor',
- [SelectOptionColorPB.LightPink]: 'lightPinkColor',
- [SelectOptionColorPB.Orange]: 'orangeColor',
- [SelectOptionColorPB.Yellow]: 'yellowColor',
- [SelectOptionColorPB.Lime]: 'limeColor',
- [SelectOptionColorPB.Green]: 'greenColor',
- [SelectOptionColorPB.Aqua]: 'aquaColor',
- [SelectOptionColorPB.Blue]: 'blueColor',
-} as const;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/select/select_cell_actions/SearchInput.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/select/select_cell_actions/SearchInput.tsx
deleted file mode 100644
index 5c8acb4759..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/select/select_cell_actions/SearchInput.tsx
+++ /dev/null
@@ -1,38 +0,0 @@
-import React, { FormEvent, useCallback } from 'react';
-import { OutlinedInput } from '@mui/material';
-import { useTranslation } from 'react-i18next';
-
-function SearchInput({
- setNewOptionName,
- newOptionName,
- inputRef,
-}: {
- newOptionName: string;
- setNewOptionName: (value: string) => void;
- inputRef?: React.RefObject<HTMLInputElement>;
-}) {
- const { t } = useTranslation();
- const handleInput = useCallback(
- (event: FormEvent) => {
- const value = (event.target as HTMLInputElement).value;
-
- setNewOptionName(value);
- },
- [setNewOptionName]
- );
-
- return (
- <OutlinedInput
- size='small'
- className={'mx-4'}
- autoFocus={true}
- inputRef={inputRef}
- value={newOptionName}
- onInput={handleInput}
- spellCheck={false}
- placeholder={t('grid.selectOption.searchOrCreateOption')}
- />
- );
-}
-
-export default SearchInput;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/select/select_cell_actions/SelectCellActions.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/select/select_cell_actions/SelectCellActions.tsx
deleted file mode 100644
index e2cd27019f..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/select/select_cell_actions/SelectCellActions.tsx
+++ /dev/null
@@ -1,162 +0,0 @@
-import React, { useCallback, useMemo, useRef, useState } from 'react';
-import { SelectOptionItem } from '$app/components/database/components/field_types/select/select_cell_actions/SelectOptionItem';
-import { cellService, SelectCell as SelectCellType, SelectField, SelectTypeOption } from '$app/application/database';
-import { useViewId } from '$app/hooks';
-import {
- createSelectOption,
- insertOrUpdateSelectOption,
-} from '$app/application/database/field/select_option/select_option_service';
-import { FieldType } from '@/services/backend';
-import { useTypeOption } from '$app/components/database';
-import SearchInput from './SearchInput';
-import { useTranslation } from 'react-i18next';
-import KeyboardNavigation, {
- KeyboardNavigationOption,
-} from '$app/components/_shared/keyboard_navigation/KeyboardNavigation';
-import { Tag } from '$app/components/database/components/field_types/select/Tag';
-
-const CREATE_OPTION_KEY = 'createOption';
-
-function SelectCellActions({
- field,
- cell,
- onUpdated,
- onClose,
-}: {
- field: SelectField;
- cell: SelectCellType;
- onUpdated?: () => void;
- onClose?: () => void;
-}) {
- const { t } = useTranslation();
- const rowId = cell?.rowId;
- const viewId = useViewId();
- const typeOption = useTypeOption<SelectTypeOption>(field.id);
- const options = useMemo(() => typeOption.options ?? [], [typeOption.options]);
- const scrollRef = useRef<HTMLDivElement>(null);
- const inputRef = useRef<HTMLInputElement>(null);
- const selectedOptionIds = useMemo(() => cell?.data?.selectedOptionIds ?? [], [cell]);
- const [newOptionName, setNewOptionName] = useState('');
-
- const filteredOptions: KeyboardNavigationOption[] = useMemo(() => {
- const result = options
- .filter((option) => {
- return option.name.toLowerCase().includes(newOptionName.toLowerCase());
- })
- .map((option) => ({
- key: option.id,
- content: (
- <SelectOptionItem
- isSelected={selectedOptionIds?.includes(option.id)}
- fieldId={cell?.fieldId || ''}
- option={option}
- />
- ),
- }));
-
- if (result.length === 0 && newOptionName) {
- result.push({
- key: CREATE_OPTION_KEY,
- content: <Tag size='small' label={newOptionName} />,
- });
- }
-
- return result;
- }, [newOptionName, options, selectedOptionIds, cell?.fieldId]);
-
- const shouldCreateOption = filteredOptions.length === 1 && filteredOptions[0].key === 'createOption';
-
- const updateCell = useCallback(
- async (optionIds: string[]) => {
- if (!cell || !rowId) return;
- const deleteOptionIds = selectedOptionIds?.filter((id) => optionIds.find((cur) => cur === id) === undefined);
-
- await cellService.updateSelectCell(viewId, rowId, field.id, {
- insertOptionIds: optionIds,
- deleteOptionIds,
- });
- onUpdated?.();
- },
- [cell, field.id, onUpdated, rowId, selectedOptionIds, viewId]
- );
-
- const createOption = useCallback(async () => {
- const option = await createSelectOption(viewId, field.id, newOptionName);
-
- if (!option) return;
- await insertOrUpdateSelectOption(viewId, field.id, [option]);
- setNewOptionName('');
- return option;
- }, [viewId, field.id, newOptionName]);
-
- const onConfirm = useCallback(
- async (key: string) => {
- let optionId = key;
-
- if (key === CREATE_OPTION_KEY) {
- const option = await createOption();
-
- optionId = option?.id || '';
- }
-
- if (!optionId) return;
-
- if (field.type === FieldType.SingleSelect) {
- const newOptionIds = [optionId];
-
- if (selectedOptionIds?.includes(optionId)) {
- newOptionIds.pop();
- }
-
- void updateCell(newOptionIds);
- return;
- }
-
- let newOptionIds = [];
-
- if (!selectedOptionIds) {
- newOptionIds.push(optionId);
- } else {
- const isSelected = selectedOptionIds.includes(optionId);
-
- if (isSelected) {
- newOptionIds = selectedOptionIds.filter((id) => id !== optionId);
- } else {
- newOptionIds = [...selectedOptionIds, optionId];
- }
- }
-
- void updateCell(newOptionIds);
- },
- [createOption, field.type, selectedOptionIds, updateCell]
- );
-
- return (
- <div className={'flex h-full flex-col overflow-hidden'}>
- <SearchInput inputRef={inputRef} setNewOptionName={setNewOptionName} newOptionName={newOptionName} />
-
- {filteredOptions.length > 0 && (
- <div className='mx-4 mb-2 mt-4 text-xs'>
- {shouldCreateOption ? t('grid.selectOption.createNew') : t('grid.selectOption.orSelectOne')}
- </div>
- )}
-
- <div ref={scrollRef} className={'mx-1 flex-1 overflow-y-auto overflow-x-hidden px-1'}>
- <KeyboardNavigation
- scrollRef={scrollRef}
- focusRef={inputRef}
- options={filteredOptions}
- disableFocus={true}
- onConfirm={onConfirm}
- onEscape={onClose}
- itemStyle={{
- borderRadius: '4px',
- }}
- renderNoResult={() => null}
- />
- </div>
- </div>
- );
-}
-
-export default SelectCellActions;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/select/select_cell_actions/SelectOptionItem.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/select/select_cell_actions/SelectOptionItem.tsx
deleted file mode 100644
index 2a855a4085..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/select/select_cell_actions/SelectOptionItem.tsx
+++ /dev/null
@@ -1,55 +0,0 @@
-import { FC, MouseEventHandler, useCallback, useRef, useState } from 'react';
-import { IconButton } from '@mui/material';
-import { ReactComponent as DetailsSvg } from '$app/assets/details.svg';
-import { SelectOption } from '$app/application/database';
-import { SelectOptionModifyMenu } from '../SelectOptionModifyMenu';
-import { Tag } from '../Tag';
-import { ReactComponent as SelectCheckSvg } from '$app/assets/select-check.svg';
-
-export interface SelectOptionItemProps {
- option: SelectOption;
- fieldId: string;
- isSelected?: boolean;
-}
-
-export const SelectOptionItem: FC<SelectOptionItemProps> = ({ isSelected, fieldId, option }) => {
- const [open, setOpen] = useState(false);
- const anchorEl = useRef<HTMLDivElement | null>(null);
- const [hovered, setHovered] = useState(false);
- const handleClick = useCallback<MouseEventHandler<HTMLButtonElement>>((event) => {
- event.stopPropagation();
- setOpen(true);
- }, []);
-
- return (
- <>
- <div
- ref={anchorEl}
- className={'flex w-full items-center justify-between'}
- onMouseEnter={() => setHovered(true)}
- onMouseLeave={() => setHovered(false)}
- >
- <div className='flex-1'>
- <Tag key={option.id} size='small' color={option.color} label={option.name} />
- </div>
- {isSelected && !hovered && <SelectCheckSvg className={'text-content-blue-400'} />}
- {hovered && (
- <IconButton onClick={handleClick}>
- <DetailsSvg className='text-base' />
- </IconButton>
- )}
- </div>
- {open && (
- <SelectOptionModifyMenu
- fieldId={fieldId}
- option={option}
- MenuProps={{
- open,
- anchorEl: anchorEl.current,
- onClose: () => setOpen(false),
- }}
- />
- )}
- </>
- );
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/select/select_field_actions/AddAnOption.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/select/select_field_actions/AddAnOption.tsx
deleted file mode 100644
index 0fb180bb08..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/select/select_field_actions/AddAnOption.tsx
+++ /dev/null
@@ -1,76 +0,0 @@
-import React, { useMemo, useState } from 'react';
-import Button from '@mui/material/Button';
-import { useTranslation } from 'react-i18next';
-import { ReactComponent as AddSvg } from '$app/assets/add.svg';
-import { OutlinedInput } from '@mui/material';
-import {
- createSelectOption,
- insertOrUpdateSelectOption,
-} from '$app/application/database/field/select_option/select_option_service';
-import { useViewId } from '$app/hooks';
-import { SelectOption } from '$app/application/database';
-import { notify } from '$app/components/_shared/notify';
-
-function AddAnOption({ fieldId, options }: { fieldId: string; options: SelectOption[] }) {
- const viewId = useViewId();
- const { t } = useTranslation();
- const [edit, setEdit] = useState(false);
- const [newOptionName, setNewOptionName] = useState('');
- const exitEdit = () => {
- setNewOptionName('');
- setEdit(false);
- };
-
- const isOptionExist = useMemo(() => {
- return options.some((option) => option.name === newOptionName);
- }, [options, newOptionName]);
-
- const createOption = async () => {
- if (!newOptionName) return;
- if (isOptionExist) {
- notify.error(t('grid.field.optionAlreadyExist'));
- return;
- }
-
- const option = await createSelectOption(viewId, fieldId, newOptionName);
-
- if (!option) return;
- await insertOrUpdateSelectOption(viewId, fieldId, [option]);
- setNewOptionName('');
- };
-
- return edit ? (
- <OutlinedInput
- onBlur={exitEdit}
- autoFocus={true}
- spellCheck={false}
- onChange={(e) => {
- setNewOptionName(e.target.value);
- }}
- value={newOptionName}
- onKeyDown={(e) => {
- if (e.key === 'Enter') {
- e.stopPropagation();
- e.preventDefault();
- void createOption();
- return;
- }
-
- if (e.key === 'Escape') {
- e.stopPropagation();
- e.preventDefault();
- exitEdit();
- }
- }}
- className={'mx-2 mb-1'}
- placeholder={t('grid.selectOption.typeANewOption')}
- size='small'
- />
- ) : (
- <Button onClick={() => setEdit(true)} color={'inherit'} startIcon={<AddSvg />}>
- <div className={'w-full text-left'}>{t('grid.field.addSelectOption')}</div>
- </Button>
- );
-}
-
-export default AddAnOption;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/select/select_field_actions/Option.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/select/select_field_actions/Option.tsx
deleted file mode 100644
index ad363d4a1d..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/select/select_field_actions/Option.tsx
+++ /dev/null
@@ -1,47 +0,0 @@
-import React, { useRef, useState } from 'react';
-import { ReactComponent as MoreIcon } from '$app/assets/more.svg';
-import { SelectOption } from '$app/application/database';
-// import { ReactComponent as DragIcon } from '$app/assets/drag.svg';
-
-import { SelectOptionModifyMenu } from '$app/components/database/components/field_types/select/SelectOptionModifyMenu';
-import Button from '@mui/material/Button';
-import { SelectOptionColorMap } from '$app/components/database/components/field_types/select/constants';
-
-function Option({ option, fieldId }: { option: SelectOption; fieldId: string }) {
- const [expanded, setExpanded] = useState(false);
- const ref = useRef<HTMLButtonElement>(null);
-
- return (
- <>
- <Button
- size={'small'}
- onClick={() => setExpanded(!expanded)}
- color={'inherit'}
- // startIcon={<DragIcon />}
- endIcon={<MoreIcon className={`transform ${expanded ? '' : 'rotate-90'}`} />}
- ref={ref}
- className={'flex w-full items-center justify-between'}
- >
- <div className={`flex flex-1 justify-start`}>
- <div className={`${SelectOptionColorMap[option.color]} rounded-lg px-1.5 py-1`}>{option.name}</div>
- </div>
- </Button>
- <SelectOptionModifyMenu
- fieldId={fieldId}
- MenuProps={{
- anchorEl: ref.current,
- onClose: () => setExpanded(false),
- open: expanded,
- transformOrigin: {
- vertical: 'center',
- horizontal: 'left',
- },
- anchorOrigin: { vertical: 'center', horizontal: 'right' },
- }}
- option={option}
- />
- </>
- );
-}
-
-export default Option;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/select/select_field_actions/Options.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/select/select_field_actions/Options.tsx
deleted file mode 100644
index 4e06236263..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/select/select_field_actions/Options.tsx
+++ /dev/null
@@ -1,19 +0,0 @@
-import React from 'react';
-import { SelectOption } from '$app/application/database';
-import Option from './Option';
-
-interface Props {
- options: SelectOption[];
- fieldId: string;
-}
-function Options({ options, fieldId }: Props) {
- return (
- <div>
- {options.map((option) => {
- return <Option fieldId={fieldId} key={option.id} option={option} />;
- })}
- </div>
- );
-}
-
-export default Options;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/select/select_field_actions/SelectFieldActions.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/select/select_field_actions/SelectFieldActions.tsx
deleted file mode 100644
index a3d51ceb60..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/select/select_field_actions/SelectFieldActions.tsx
+++ /dev/null
@@ -1,26 +0,0 @@
-import React, { useMemo } from 'react';
-import { useTranslation } from 'react-i18next';
-import AddAnOption from '$app/components/database/components/field_types/select/select_field_actions/AddAnOption';
-import Options from '$app/components/database/components/field_types/select/select_field_actions/Options';
-import { SelectField, SelectTypeOption } from '$app/application/database';
-import { Divider } from '@mui/material';
-import { useTypeOption } from '$app/components/database';
-
-function SelectFieldActions({ field }: { field: SelectField }) {
- const typeOption = useTypeOption<SelectTypeOption>(field.id);
- const options = useMemo(() => typeOption.options ?? [], [typeOption.options]);
- const { t } = useTranslation();
-
- return (
- <>
- <div className={'flex flex-col px-3 pt-1'}>
- <div className={'mb-2 px-2 text-sm text-text-caption'}>{t('grid.field.optionTitle')}</div>
- <AddAnOption options={options} fieldId={field.id} />
- <Options fieldId={field.id} options={options} />
- </div>
- <Divider className={'my-2'} />
- </>
- );
-}
-
-export default SelectFieldActions;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/text/EditTextCellInput.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/text/EditTextCellInput.tsx
deleted file mode 100644
index 005d185c8f..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/field_types/text/EditTextCellInput.tsx
+++ /dev/null
@@ -1,69 +0,0 @@
-import React, { useCallback } from 'react';
-import { Popover, TextareaAutosize } from '@mui/material';
-
-interface Props {
- editing: boolean;
- anchorEl: HTMLDivElement | null;
- onClose: () => void;
- text: string;
- onInput: (event: React.FormEvent<HTMLTextAreaElement>) => void;
-}
-
-function EditTextCellInput({ editing, anchorEl, onClose, text, onInput }: Props) {
- const handleEnter = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {
- const shift = e.shiftKey;
-
- // If shift is pressed, allow the user to enter a new line, otherwise close the popover
- if (!shift && e.key === 'Enter') {
- e.preventDefault();
- e.stopPropagation();
- onClose();
- }
- };
-
- const setRef = useCallback((e: HTMLTextAreaElement | null) => {
- if (!e) return;
- const selectionStart = e.value.length;
-
- e.setSelectionRange(selectionStart, selectionStart);
- }, []);
-
- return (
- <Popover
- open={editing}
- anchorEl={anchorEl}
- disableRestoreFocus={true}
- PaperProps={{
- className: 'flex p-2 border border-blue-400',
- style: { width: anchorEl?.offsetWidth, minHeight: anchorEl?.offsetHeight, borderRadius: 0, boxShadow: 'none' },
- }}
- transformOrigin={{
- vertical: 1,
- horizontal: 'left',
- }}
- transitionDuration={0}
- onClose={onClose}
- keepMounted={false}
- onKeyDown={(e) => {
- if (e.key === 'Escape') {
- e.stopPropagation();
- e.preventDefault();
- onClose();
- }
- }}
- >
- <TextareaAutosize
- className='w-full resize-none whitespace-break-spaces break-all text-sm'
- autoFocus
- ref={setRef}
- spellCheck={false}
- autoCorrect='off'
- value={text}
- onInput={onInput}
- onKeyDown={handleEnter}
- />
- </Popover>
- );
-}
-
-export default EditTextCellInput;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/filter/ConditionSelect.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/filter/ConditionSelect.tsx
deleted file mode 100644
index 0ca6c42a86..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/filter/ConditionSelect.tsx
+++ /dev/null
@@ -1,78 +0,0 @@
-import React, { useCallback, useMemo, useState } from 'react';
-import KeyboardNavigation, {
- KeyboardNavigationOption,
-} from '$app/components/_shared/keyboard_navigation/KeyboardNavigation';
-import { ReactComponent as MoreSvg } from '$app/assets/more.svg';
-import Popover from '@mui/material/Popover';
-
-function ConditionSelect({
- conditions,
- value,
- onChange,
-}: {
- conditions: {
- value: number;
- text: string;
- }[];
- value: number;
- onChange: (condition: number) => void;
-}) {
- const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);
- const options: KeyboardNavigationOption<number>[] = useMemo(() => {
- return conditions.map((condition) => {
- return {
- key: condition.value,
- content: condition.text,
- };
- });
- }, [conditions]);
-
- const handleClose = useCallback(() => {
- setAnchorEl(null);
- }, []);
-
- const onConfirm = useCallback(
- (key: number) => {
- onChange(key);
- },
- [onChange]
- );
-
- const valueText = useMemo(() => {
- return conditions.find((condition) => condition.value === value)?.text;
- }, [conditions, value]);
-
- const open = Boolean(anchorEl);
-
- return (
- <div>
- <div
- onClick={(e) => {
- setAnchorEl(e.currentTarget);
- }}
- className={'flex cursor-pointer select-none items-center gap-2 py-2 text-xs'}
- >
- <div className={'flex-1'}>{valueText}</div>
- <MoreSvg className={`h-4 w-4 transform ${open ? 'rotate-90' : ''}`} />
- </div>
- <Popover
- open={open}
- transformOrigin={{
- vertical: 'top',
- horizontal: 'center',
- }}
- anchorOrigin={{
- vertical: 'bottom',
- horizontal: 'center',
- }}
- anchorEl={anchorEl}
- onClose={handleClose}
- keepMounted={false}
- >
- <KeyboardNavigation defaultFocusedKey={value} options={options} onConfirm={onConfirm} onEscape={handleClose} />
- </Popover>
- </div>
- );
-}
-
-export default ConditionSelect;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/filter/Filter.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/filter/Filter.tsx
deleted file mode 100644
index fdd7bccb5b..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/filter/Filter.tsx
+++ /dev/null
@@ -1,200 +0,0 @@
-import React, { FC, useMemo, useState } from 'react';
-import {
- CheckboxFilterData,
- ChecklistFilterData,
- DateFilterData,
- Field as FieldData,
- Filter as FilterType,
- NumberFilterData,
- SelectFilterData,
- TextFilterData,
- UndeterminedFilter,
-} from '$app/application/database';
-import { Chip, Popover } from '@mui/material';
-import { Property } from '$app/components/database/components/property';
-import { ReactComponent as DropDownSvg } from '$app/assets/dropdown.svg';
-import TextFilter from './text_filter/TextFilter';
-import { CheckboxFilterConditionPB, ChecklistFilterConditionPB, FieldType } from '@/services/backend';
-import FilterActions from '$app/components/database/components/filter/FilterActions';
-import { updateFilter } from '$app/application/database/filter/filter_service';
-import { useViewId } from '$app/hooks';
-import SelectFilter from './select_filter/SelectFilter';
-
-import DateFilter from '$app/components/database/components/filter/date_filter/DateFilter';
-import FilterConditionSelect from '$app/components/database/components/filter/FilterConditionSelect';
-import TextFilterValue from '$app/components/database/components/filter/text_filter/TextFilterValue';
-import SelectFilterValue from '$app/components/database/components/filter/select_filter/SelectFilterValue';
-import NumberFilterValue from '$app/components/database/components/filter/number_filter/NumberFilterValue';
-import { useTranslation } from 'react-i18next';
-import DateFilterValue from '$app/components/database/components/filter/date_filter/DateFilterValue';
-
-interface Props {
- filter: FilterType;
- field: FieldData;
-}
-
-interface FilterComponentProps {
- filter: FilterType;
- field: FieldData;
- onChange: (data: UndeterminedFilter['data']) => void;
- onClose?: () => void;
-}
-
-type FilterComponent = FC<FilterComponentProps>;
-const getFilterComponent = (field: FieldData) => {
- switch (field.type) {
- case FieldType.RichText:
- case FieldType.URL:
- case FieldType.Number:
- return TextFilter as FilterComponent;
- case FieldType.SingleSelect:
- case FieldType.MultiSelect:
- return SelectFilter as FilterComponent;
-
- case FieldType.DateTime:
- case FieldType.LastEditedTime:
- case FieldType.CreatedTime:
- return DateFilter as FilterComponent;
- default:
- return null;
- }
-};
-
-function Filter({ filter, field }: Props) {
- const viewId = useViewId();
- const { t } = useTranslation();
- const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);
- const open = Boolean(anchorEl);
- const handleClick = (e: React.MouseEvent<HTMLElement>) => {
- setAnchorEl(e.currentTarget);
- };
-
- const handleClose = () => {
- setAnchorEl(null);
- };
-
- const onDataChange = async (data: UndeterminedFilter['data']) => {
- const newFilter = {
- ...filter,
- data: {
- ...(filter.data || {}),
- ...data,
- },
- } as UndeterminedFilter;
-
- try {
- await updateFilter(viewId, newFilter);
- } catch (e) {
- // toast.error(e.message);
- }
- };
-
- const Component = getFilterComponent(field);
-
- const condition = useMemo(() => {
- switch (field.type) {
- case FieldType.RichText:
- case FieldType.URL:
- return (filter.data as TextFilterData).condition;
- case FieldType.SingleSelect:
- case FieldType.MultiSelect:
- return (filter.data as SelectFilterData).condition;
- case FieldType.Number:
- return (filter.data as NumberFilterData).condition;
- case FieldType.Checkbox:
- return (filter.data as CheckboxFilterData).condition;
- case FieldType.Checklist:
- return (filter.data as ChecklistFilterData).condition;
- case FieldType.DateTime:
- case FieldType.LastEditedTime:
- case FieldType.CreatedTime:
- return (filter.data as DateFilterData).condition;
- default:
- return;
- }
- }, [field, filter]);
-
- const conditionValue = useMemo(() => {
- switch (field.type) {
- case FieldType.RichText:
- case FieldType.URL:
- return <TextFilterValue data={filter.data as TextFilterData} />;
- case FieldType.SingleSelect:
- case FieldType.MultiSelect:
- return <SelectFilterValue data={filter.data as SelectFilterData} fieldId={field.id} />;
- case FieldType.Number:
- return <NumberFilterValue data={filter.data as NumberFilterData} />;
- case FieldType.Checkbox:
- return (filter.data as CheckboxFilterData).condition === CheckboxFilterConditionPB.IsChecked
- ? t('grid.checkboxFilter.isChecked')
- : t('grid.checkboxFilter.isUnchecked');
- case FieldType.Checklist:
- return (filter.data as ChecklistFilterData).condition === ChecklistFilterConditionPB.IsComplete
- ? t('grid.checklistFilter.isComplete')
- : t('grid.checklistFilter.isIncomplted');
- case FieldType.DateTime:
- case FieldType.LastEditedTime:
- case FieldType.CreatedTime:
- return <DateFilterValue data={filter.data as DateFilterData} />;
- default:
- return '';
- }
- }, [field.id, field.type, filter.data, t]);
-
- return (
- <>
- <Chip
- clickable
- variant='outlined'
- label={
- <div className={'flex items-center justify-between gap-1'}>
- <Property className={'flex flex-1 items-center'} field={field} />
- <span className={'max-w-[120px] truncate'}>{conditionValue}</span>
- <DropDownSvg className={'h-6 w-6'} />
- </div>
- }
- onClick={handleClick}
- />
- {condition !== undefined && open && (
- <Popover
- anchorOrigin={{
- vertical: 'bottom',
- horizontal: 'center',
- }}
- transformOrigin={{
- vertical: 'top',
- horizontal: 'center',
- }}
- open={open}
- anchorEl={anchorEl}
- onClose={handleClose}
- keepMounted={false}
- onKeyDown={(e) => {
- if (e.key === 'Escape') {
- e.preventDefault();
- e.stopPropagation();
- handleClose();
- }
- }}
- >
- <div className={'flex items-center justify-between'}>
- <FilterConditionSelect
- name={field.name}
- condition={condition}
- fieldType={field.type}
- onChange={(condition) => {
- void onDataChange({
- condition,
- });
- }}
- />
- <FilterActions filter={filter} />
- </div>
- {Component && <Component onClose={handleClose} filter={filter} field={field} onChange={onDataChange} />}
- </Popover>
- )}
- </>
- );
-}
-
-export default Filter;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/filter/FilterActions.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/filter/FilterActions.tsx
deleted file mode 100644
index ebc9e8982c..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/filter/FilterActions.tsx
+++ /dev/null
@@ -1,84 +0,0 @@
-import React, { useMemo, useState } from 'react';
-import { IconButton, Menu } from '@mui/material';
-import { ReactComponent as MoreSvg } from '$app/assets/details.svg';
-import { Filter } from '$app/application/database';
-import { useTranslation } from 'react-i18next';
-import { deleteFilter } from '$app/application/database/filter/filter_service';
-import { useViewId } from '$app/hooks';
-import KeyboardNavigation, {
- KeyboardNavigationOption,
-} from '$app/components/_shared/keyboard_navigation/KeyboardNavigation';
-
-function FilterActions({ filter }: { filter: Filter }) {
- const viewId = useViewId();
- const { t } = useTranslation();
- const [disableSelect, setDisableSelect] = useState(true);
- const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);
- const open = Boolean(anchorEl);
- const onClose = () => {
- setDisableSelect(true);
- setAnchorEl(null);
- };
-
- const onDelete = async () => {
- try {
- await deleteFilter(viewId, filter);
- } catch (e) {
- // toast.error(e.message);
- }
-
- setDisableSelect(true);
- };
-
- const options: KeyboardNavigationOption[] = useMemo(
- () => [
- {
- key: 'delete',
- content: t('grid.settings.deleteFilter'),
- },
- ],
- [t]
- );
-
- return (
- <>
- <IconButton
- onClick={(e) => {
- setAnchorEl(e.currentTarget);
- }}
- className={'mx-2 my-1.5'}
- >
- <MoreSvg />
- </IconButton>
- {open && (
- <Menu
- onKeyDown={(e) => {
- if (e.key === 'Escape') {
- e.preventDefault();
- e.stopPropagation();
- onClose();
- }
- }}
- keepMounted={false}
- open={open}
- anchorEl={anchorEl}
- onClose={onClose}
- >
- <KeyboardNavigation
- onKeyDown={(e) => {
- if (e.key === 'ArrowDown') {
- setDisableSelect(false);
- }
- }}
- disableSelect={disableSelect}
- options={options}
- onConfirm={onDelete}
- onEscape={onClose}
- />
- </Menu>
- )}
- </>
- );
-}
-
-export default FilterActions;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/filter/FilterConditionSelect.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/filter/FilterConditionSelect.tsx
deleted file mode 100644
index 8b793942da..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/filter/FilterConditionSelect.tsx
+++ /dev/null
@@ -1,224 +0,0 @@
-import React, { useMemo } from 'react';
-import ConditionSelect from './ConditionSelect';
-import {
- CheckboxFilterConditionPB,
- ChecklistFilterConditionPB,
- DateFilterConditionPB,
- FieldType,
- NumberFilterConditionPB,
- SelectOptionFilterConditionPB,
- TextFilterConditionPB,
-} from '@/services/backend';
-
-import { useTranslation } from 'react-i18next';
-
-function FilterConditionSelect({
- name,
- condition,
- fieldType,
- onChange,
-}: {
- name: string;
- condition: number;
- fieldType: FieldType;
- onChange: (condition: number) => void;
-}) {
- const { t } = useTranslation();
- const conditions = useMemo(() => {
- switch (fieldType) {
- case FieldType.RichText:
- case FieldType.URL:
- return [
- {
- value: TextFilterConditionPB.TextContains,
- text: t('grid.textFilter.contains'),
- },
- {
- value: TextFilterConditionPB.TextDoesNotContain,
- text: t('grid.textFilter.doesNotContain'),
- },
- {
- value: TextFilterConditionPB.TextStartsWith,
- text: t('grid.textFilter.startWith'),
- },
- {
- value: TextFilterConditionPB.TextEndsWith,
- text: t('grid.textFilter.endsWith'),
- },
- {
- value: TextFilterConditionPB.TextIs,
- text: t('grid.textFilter.is'),
- },
- {
- value: TextFilterConditionPB.TextIsNot,
- text: t('grid.textFilter.isNot'),
- },
- {
- value: TextFilterConditionPB.TextIsEmpty,
- text: t('grid.textFilter.isEmpty'),
- },
- {
- value: TextFilterConditionPB.TextIsNotEmpty,
- text: t('grid.textFilter.isNotEmpty'),
- },
- ];
- case FieldType.SingleSelect:
- return [
- {
- value: SelectOptionFilterConditionPB.OptionIs,
- text: t('grid.selectOptionFilter.is'),
- },
- {
- value: SelectOptionFilterConditionPB.OptionIsNot,
- text: t('grid.selectOptionFilter.isNot'),
- },
- {
- value: SelectOptionFilterConditionPB.OptionIsEmpty,
- text: t('grid.selectOptionFilter.isEmpty'),
- },
- {
- value: SelectOptionFilterConditionPB.OptionIsNotEmpty,
- text: t('grid.selectOptionFilter.isNotEmpty'),
- },
- ];
- case FieldType.MultiSelect:
- return [
- {
- value: SelectOptionFilterConditionPB.OptionIs,
- text: t('grid.selectOptionFilter.is'),
- },
- {
- value: SelectOptionFilterConditionPB.OptionIsNot,
- text: t('grid.selectOptionFilter.isNot'),
- },
- {
- value: SelectOptionFilterConditionPB.OptionContains,
- text: t('grid.selectOptionFilter.contains'),
- },
- {
- value: SelectOptionFilterConditionPB.OptionDoesNotContain,
- text: t('grid.selectOptionFilter.doesNotContain'),
- },
- {
- value: SelectOptionFilterConditionPB.OptionIsEmpty,
- text: t('grid.selectOptionFilter.isEmpty'),
- },
- {
- value: SelectOptionFilterConditionPB.OptionIsNotEmpty,
- text: t('grid.selectOptionFilter.isNotEmpty'),
- },
- ];
- case FieldType.Number:
- return [
- {
- value: NumberFilterConditionPB.Equal,
- text: '=',
- },
- {
- value: NumberFilterConditionPB.NotEqual,
- text: '!=',
- },
- {
- value: NumberFilterConditionPB.GreaterThan,
- text: '>',
- },
- {
- value: NumberFilterConditionPB.LessThan,
- text: '<',
- },
- {
- value: NumberFilterConditionPB.GreaterThanOrEqualTo,
- text: '>=',
- },
- {
- value: NumberFilterConditionPB.LessThanOrEqualTo,
- text: '<=',
- },
- {
- value: NumberFilterConditionPB.NumberIsEmpty,
- text: t('grid.textFilter.isEmpty'),
- },
- {
- value: NumberFilterConditionPB.NumberIsNotEmpty,
- text: t('grid.textFilter.isNotEmpty'),
- },
- ];
- case FieldType.Checkbox:
- return [
- {
- value: CheckboxFilterConditionPB.IsChecked,
- text: t('grid.checkboxFilter.isChecked'),
- },
- {
- value: CheckboxFilterConditionPB.IsUnChecked,
- text: t('grid.checkboxFilter.isUnchecked'),
- },
- ];
- case FieldType.Checklist:
- return [
- {
- value: ChecklistFilterConditionPB.IsComplete,
- text: t('grid.checklistFilter.isComplete'),
- },
- {
- value: ChecklistFilterConditionPB.IsIncomplete,
- text: t('grid.checklistFilter.isIncomplted'),
- },
- ];
- case FieldType.DateTime:
- case FieldType.LastEditedTime:
- case FieldType.CreatedTime:
- return [
- {
- value: DateFilterConditionPB.DateIs,
- text: t('grid.dateFilter.is'),
- },
- {
- value: DateFilterConditionPB.DateBefore,
- text: t('grid.dateFilter.before'),
- },
- {
- value: DateFilterConditionPB.DateAfter,
- text: t('grid.dateFilter.after'),
- },
- {
- value: DateFilterConditionPB.DateOnOrBefore,
- text: t('grid.dateFilter.onOrBefore'),
- },
- {
- value: DateFilterConditionPB.DateOnOrAfter,
- text: t('grid.dateFilter.onOrAfter'),
- },
- {
- value: DateFilterConditionPB.DateWithIn,
- text: t('grid.dateFilter.between'),
- },
- {
- value: DateFilterConditionPB.DateIsEmpty,
- text: t('grid.dateFilter.empty'),
- },
- {
- value: DateFilterConditionPB.DateIsNotEmpty,
- text: t('grid.dateFilter.notEmpty'),
- },
- ];
- default:
- return [];
- }
- }, [fieldType, t]);
-
- return (
- <div className={'flex items-center justify-between gap-[20px] px-4'}>
- <div className={'flex-1 text-sm text-text-caption'}>{name}</div>
- <ConditionSelect
- conditions={conditions}
- onChange={(e) => {
- onChange(e);
- }}
- value={condition}
- />
- </div>
- );
-}
-
-export default FilterConditionSelect;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/filter/FilterFieldsMenu.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/filter/FilterFieldsMenu.tsx
deleted file mode 100644
index e161badbf8..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/filter/FilterFieldsMenu.tsx
+++ /dev/null
@@ -1,59 +0,0 @@
-import React, { useCallback } from 'react';
-import { MenuProps } from '@mui/material';
-import PropertiesList from '$app/components/database/components/property/PropertiesList';
-import { Field } from '$app/application/database';
-import { useViewId } from '$app/hooks';
-import { useTranslation } from 'react-i18next';
-import { insertFilter } from '$app/application/database/filter/filter_service';
-import { getDefaultFilter } from '$app/application/database/filter/filter_data';
-import Popover from '@mui/material/Popover';
-
-function FilterFieldsMenu({
- onInserted,
- ...props
-}: MenuProps & {
- onInserted?: () => void;
-}) {
- const viewId = useViewId();
- const { t } = useTranslation();
-
- const addFilter = useCallback(
- async (field: Field) => {
- const filterData = getDefaultFilter(field.type);
-
- await insertFilter({
- viewId,
- fieldId: field.id,
- fieldType: field.type,
- data: filterData,
- });
- props.onClose?.({}, 'backdropClick');
- onInserted?.();
- },
- [props, viewId, onInserted]
- );
-
- return (
- <Popover
- onKeyDown={(e) => {
- if (e.key === 'Escape') {
- e.preventDefault();
- e.stopPropagation();
- props.onClose?.({}, 'escapeKeyDown');
- }
- }}
- {...props}
- >
- <PropertiesList
- onClose={() => {
- props.onClose?.({}, 'escapeKeyDown');
- }}
- showSearch
- searchPlaceholder={t('grid.settings.filterBy')}
- onItemClick={addFilter}
- />
- </Popover>
- );
-}
-
-export default FilterFieldsMenu;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/filter/Filters.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/filter/Filters.tsx
deleted file mode 100644
index 860ce9f69f..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/filter/Filters.tsx
+++ /dev/null
@@ -1,51 +0,0 @@
-import React, { useMemo, useState } from 'react';
-import Filter from '$app/components/database/components/filter/Filter';
-import Button from '@mui/material/Button';
-import FilterFieldsMenu from '$app/components/database/components/filter/FilterFieldsMenu';
-import { useTranslation } from 'react-i18next';
-import { ReactComponent as AddSvg } from '$app/assets/add.svg';
-import { useDatabase } from '$app/components/database';
-
-function Filters() {
- const { t } = useTranslation();
- const { filters, fields } = useDatabase();
-
- const options = useMemo(() => {
- return filters.map((filter) => {
- const field = fields.find((field) => field.id === filter.fieldId);
-
- return {
- filter,
- field,
- };
- });
- }, [filters, fields]);
-
- const [filterAnchorEl, setFilterAnchorEl] = useState<null | HTMLElement>(null);
- const openAddFilterMenu = Boolean(filterAnchorEl);
-
- const handleClick = (e: React.MouseEvent<HTMLElement>) => {
- setFilterAnchorEl(e.currentTarget);
- };
-
- return (
- <div className={'flex flex-1 items-center gap-2 text-text-title'}>
- {options.map(({ filter, field }) => (field ? <Filter key={filter.id} filter={filter} field={field} /> : null))}
- <Button size={'small'} className={'min-w-[100px]'} onClick={handleClick} color={'inherit'} startIcon={<AddSvg />}>
- {t('grid.settings.addFilter')}
- </Button>
- <FilterFieldsMenu
- keepMounted={false}
- open={openAddFilterMenu}
- anchorEl={filterAnchorEl}
- onClose={() => setFilterAnchorEl(null)}
- anchorOrigin={{
- vertical: 'bottom',
- horizontal: 'left',
- }}
- />
- </div>
- );
-}
-
-export default Filters;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/filter/date_filter/DateFilter.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/filter/date_filter/DateFilter.tsx
deleted file mode 100644
index 5c96d42b96..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/filter/date_filter/DateFilter.tsx
+++ /dev/null
@@ -1,94 +0,0 @@
-import React, { useMemo } from 'react';
-import {
- DateFilter as DateFilterType,
- DateFilterData,
- DateTimeField,
- DateTimeTypeOption,
-} from '$app/application/database';
-import { DateFilterConditionPB } from '@/services/backend';
-import CustomCalendar from '$app/components/database/components/field_types/date/CustomCalendar';
-import DateTimeSet from '$app/components/database/components/field_types/date/DateTimeSet';
-import { useTypeOption } from '$app/components/database';
-import { getDateFormat, getTimeFormat } from '$app/components/database/components/field_types/date/utils';
-
-interface Props {
- filter: DateFilterType;
- field: DateTimeField;
- onChange: (filterData: DateFilterData) => void;
-}
-
-function DateFilter({ filter, field, onChange }: Props) {
- const typeOption = useTypeOption<DateTimeTypeOption>(field.id);
-
- const showCalendar =
- filter.data.condition !== DateFilterConditionPB.DateIsEmpty &&
- filter.data.condition !== DateFilterConditionPB.DateIsNotEmpty;
-
- const condition = filter.data.condition;
- const isRange = condition === DateFilterConditionPB.DateWithIn;
- const timestamp = useMemo(() => {
- if (isRange) {
- return filter.data.start;
- }
-
- return filter.data.timestamp;
- }, [filter.data.start, filter.data.timestamp, isRange]);
-
- const endTimestamp = useMemo(() => {
- if (isRange) {
- return filter.data.end;
- }
-
- return;
- }, [filter.data.end, isRange]);
-
- const timeFormat = useMemo(() => {
- return getTimeFormat(typeOption.timeFormat);
- }, [typeOption.timeFormat]);
-
- const dateFormat = useMemo(() => {
- return getDateFormat(typeOption.dateFormat);
- }, [typeOption.dateFormat]);
-
- return (
- <div>
- {showCalendar && (
- <>
- <div className={'flex flex-col justify-center'}>
- <DateTimeSet
- onChange={({ date, endDate }) => {
- onChange({
- condition,
- timestamp: date,
- start: endDate ? date : undefined,
- end: endDate,
- });
- }}
- date={timestamp}
- endDate={endTimestamp}
- timeFormat={timeFormat}
- dateFormat={dateFormat}
- includeTime={false}
- isRange={isRange}
- />
- </div>
- <CustomCalendar
- handleChange={({ date, endDate }) => {
- onChange({
- condition,
- timestamp: date,
- start: endDate ? date : undefined,
- end: endDate,
- });
- }}
- isRange={isRange}
- timestamp={timestamp}
- endTimestamp={endTimestamp}
- />
- </>
- )}
- </div>
- );
-}
-
-export default DateFilter;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/filter/date_filter/DateFilterValue.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/filter/date_filter/DateFilterValue.tsx
deleted file mode 100644
index dd75d25852..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/filter/date_filter/DateFilterValue.tsx
+++ /dev/null
@@ -1,52 +0,0 @@
-import React, { useMemo } from 'react';
-import { DateFilterData } from '$app/application/database';
-import { useTranslation } from 'react-i18next';
-import dayjs from 'dayjs';
-import { DateFilterConditionPB } from '@/services/backend';
-
-function DateFilterValue({ data }: { data: DateFilterData }) {
- const { t } = useTranslation();
-
- const value = useMemo(() => {
- if (!data.timestamp) return '';
-
- let startStr = '';
- let endStr = '';
-
- if (data.start) {
- const end = data.end ?? data.start;
- const moreThanOneYear = dayjs.unix(end).diff(dayjs.unix(data.start), 'year') > 1;
- const format = moreThanOneYear ? 'MMM D, YYYY' : 'MMM D';
-
- startStr = dayjs.unix(data.start).format(format);
- endStr = dayjs.unix(end).format(format);
- }
-
- const timestamp = dayjs.unix(data.timestamp).format('MMM D');
-
- switch (data.condition) {
- case DateFilterConditionPB.DateIs:
- return `: ${timestamp}`;
- case DateFilterConditionPB.DateBefore:
- return `: ${t('grid.dateFilter.choicechipPrefix.before')} ${timestamp}`;
- case DateFilterConditionPB.DateAfter:
- return `: ${t('grid.dateFilter.choicechipPrefix.after')} ${timestamp}`;
- case DateFilterConditionPB.DateOnOrBefore:
- return `: ${t('grid.dateFilter.choicechipPrefix.onOrBefore')} ${timestamp}`;
- case DateFilterConditionPB.DateOnOrAfter:
- return `: ${t('grid.dateFilter.choicechipPrefix.onOrAfter')} ${timestamp}`;
- case DateFilterConditionPB.DateWithIn:
- return `: ${startStr} - ${endStr}`;
- case DateFilterConditionPB.DateIsEmpty:
- return `: ${t('grid.dateFilter.choicechipPrefix.isEmpty')}`;
- case DateFilterConditionPB.DateIsNotEmpty:
- return `: ${t('grid.dateFilter.choicechipPrefix.isNotEmpty')}`;
- default:
- return '';
- }
- }, [data, t]);
-
- return <>{value}</>;
-}
-
-export default DateFilterValue;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/filter/number_filter/NumberFilterValue.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/filter/number_filter/NumberFilterValue.tsx
deleted file mode 100644
index 658ef13d69..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/filter/number_filter/NumberFilterValue.tsx
+++ /dev/null
@@ -1,39 +0,0 @@
-import React, { useMemo } from 'react';
-import { NumberFilterData } from '$app/application/database';
-import { NumberFilterConditionPB } from '@/services/backend';
-import { useTranslation } from 'react-i18next';
-
-function NumberFilterValue({ data }: { data: NumberFilterData }) {
- const { t } = useTranslation();
-
- const value = useMemo(() => {
- if (!data.content) {
- return '';
- }
-
- const content = parseInt(data.content);
-
- switch (data.condition) {
- case NumberFilterConditionPB.Equal:
- return `= ${content}`;
- case NumberFilterConditionPB.NotEqual:
- return `!= ${content}`;
- case NumberFilterConditionPB.GreaterThan:
- return `> ${content}`;
- case NumberFilterConditionPB.GreaterThanOrEqualTo:
- return `>= ${content}`;
- case NumberFilterConditionPB.LessThan:
- return `< ${content}`;
- case NumberFilterConditionPB.LessThanOrEqualTo:
- return `<= ${content}`;
- case NumberFilterConditionPB.NumberIsEmpty:
- return t('grid.textFilter.isEmpty');
- case NumberFilterConditionPB.NumberIsNotEmpty:
- return t('grid.textFilter.isNotEmpty');
- }
- }, [data.condition, data.content, t]);
-
- return <>{value}</>;
-}
-
-export default NumberFilterValue;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/filter/select_filter/SelectFilter.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/filter/select_filter/SelectFilter.tsx
deleted file mode 100644
index bd1d1f239a..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/filter/select_filter/SelectFilter.tsx
+++ /dev/null
@@ -1,92 +0,0 @@
-import React, { useMemo, useRef } from 'react';
-import {
- SelectField,
- SelectFilter as SelectFilterType,
- SelectFilterData,
- SelectTypeOption,
-} from '$app/application/database';
-import { Tag } from '$app/components/database/components/field_types/select/Tag';
-import { ReactComponent as SelectCheckSvg } from '$app/assets/select-check.svg';
-import { SelectOptionFilterConditionPB } from '@/services/backend';
-import { useTypeOption } from '$app/components/database';
-import KeyboardNavigation, {
- KeyboardNavigationOption,
-} from '$app/components/_shared/keyboard_navigation/KeyboardNavigation';
-
-interface Props {
- filter: SelectFilterType;
- field: SelectField;
- onChange: (filterData: SelectFilterData) => void;
- onClose?: () => void;
-}
-
-function SelectFilter({ onClose, filter, field, onChange }: Props) {
- const scrollRef = useRef<HTMLDivElement>(null);
- const condition = filter.data.condition;
- const typeOption = useTypeOption<SelectTypeOption>(field.id);
- const options: KeyboardNavigationOption[] = useMemo(() => {
- return (
- typeOption?.options?.map((option) => {
- return {
- key: option.id,
- content: (
- <div className={'flex w-full items-center justify-between px-2'}>
- <Tag size='small' color={option.color} label={option.name} />
- {filter.data.optionIds?.includes(option.id) && <SelectCheckSvg className={'text-content-blue-400'} />}
- </div>
- ),
- };
- }) ?? []
- );
- }, [filter.data.optionIds, typeOption?.options]);
-
- const showOptions =
- options.length > 0 &&
- condition !== SelectOptionFilterConditionPB.OptionIsEmpty &&
- condition !== SelectOptionFilterConditionPB.OptionIsNotEmpty;
-
- const handleChange = ({
- condition,
- optionIds,
- }: {
- condition?: SelectFilterData['condition'];
- optionIds?: SelectFilterData['optionIds'];
- }) => {
- onChange({
- condition: condition ?? filter.data.condition,
- optionIds: optionIds ?? filter.data.optionIds,
- });
- };
-
- const handleSelectOption = (optionId: string) => {
- const prev = filter.data.optionIds;
- let newOptionIds = [];
-
- if (!prev) {
- newOptionIds.push(optionId);
- } else {
- const isSelected = prev.includes(optionId);
-
- if (isSelected) {
- newOptionIds = prev.filter((id) => id !== optionId);
- } else {
- newOptionIds = [...prev, optionId];
- }
- }
-
- handleChange({
- condition,
- optionIds: newOptionIds,
- });
- };
-
- if (!showOptions) return null;
-
- return (
- <div ref={scrollRef}>
- <KeyboardNavigation onEscape={onClose} scrollRef={scrollRef} options={options} onConfirm={handleSelectOption} />
- </div>
- );
-}
-
-export default SelectFilter;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/filter/select_filter/SelectFilterValue.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/filter/select_filter/SelectFilterValue.tsx
deleted file mode 100644
index 72576deae1..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/filter/select_filter/SelectFilterValue.tsx
+++ /dev/null
@@ -1,38 +0,0 @@
-import React, { useMemo } from 'react';
-import { SelectFilterData, SelectTypeOption } from '$app/application/database';
-import { useStaticTypeOption } from '$app/components/database';
-import { useTranslation } from 'react-i18next';
-import { SelectOptionFilterConditionPB } from '@/services/backend';
-
-function SelectFilterValue({ data, fieldId }: { data: SelectFilterData; fieldId: string }) {
- const typeOption = useStaticTypeOption<SelectTypeOption>(fieldId);
- const { t } = useTranslation();
- const value = useMemo(() => {
- if (!data.optionIds?.length) return '';
-
- const options = data.optionIds
- .map((optionId) => {
- const option = typeOption?.options?.find((option) => option.id === optionId);
-
- return option?.name;
- })
- .join(', ');
-
- switch (data.condition) {
- case SelectOptionFilterConditionPB.OptionIs:
- return `: ${options}`;
- case SelectOptionFilterConditionPB.OptionIsNot:
- return `: ${t('grid.textFilter.choicechipPrefix.isNot')} ${options}`;
- case SelectOptionFilterConditionPB.OptionIsEmpty:
- return `: ${t('grid.textFilter.choicechipPrefix.isEmpty')}`;
- case SelectOptionFilterConditionPB.OptionIsNotEmpty:
- return `: ${t('grid.textFilter.choicechipPrefix.isNotEmpty')}`;
- default:
- return '';
- }
- }, [data.condition, data.optionIds, t, typeOption?.options]);
-
- return <>{value}</>;
-}
-
-export default SelectFilterValue;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/filter/text_filter/TextFilter.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/filter/text_filter/TextFilter.tsx
deleted file mode 100644
index 0c7eab6e05..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/filter/text_filter/TextFilter.tsx
+++ /dev/null
@@ -1,50 +0,0 @@
-import React, { useMemo, useState } from 'react';
-import { TextFilter as TextFilterType, TextFilterData } from '$app/application/database';
-import { TextField } from '@mui/material';
-import { useTranslation } from 'react-i18next';
-import { TextFilterConditionPB } from '@/services/backend';
-import debounce from 'lodash-es/debounce';
-
-interface Props {
- filter: TextFilterType;
- onChange: (filterData: TextFilterData) => void;
-}
-
-const DELAY = 500;
-
-function TextFilter({ filter, onChange }: Props) {
- const { t } = useTranslation();
- const [content, setContext] = useState(filter.data.content);
- const condition = filter.data.condition;
- const showField =
- condition !== TextFilterConditionPB.TextIsEmpty && condition !== TextFilterConditionPB.TextIsNotEmpty;
-
- const onConditionChange = useMemo(() => {
- return debounce((content: string) => {
- onChange({
- content,
- condition,
- });
- }, DELAY);
- }, [condition, onChange]);
-
- if (!showField) return null;
- return (
- <TextField
- spellCheck={false}
- className={'p-2 pt-0'}
- inputProps={{
- className: 'text-xs p-1.5',
- }}
- size={'small'}
- value={content}
- placeholder={t('grid.settings.typeAValue')}
- onChange={(e) => {
- setContext(e.target.value);
- onConditionChange(e.target.value ?? '');
- }}
- />
- );
-}
-
-export default TextFilter;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/filter/text_filter/TextFilterValue.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/filter/text_filter/TextFilterValue.tsx
deleted file mode 100644
index 5718a3e2b8..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/filter/text_filter/TextFilterValue.tsx
+++ /dev/null
@@ -1,34 +0,0 @@
-import { useMemo } from 'react';
-import { TextFilterData } from '$app/application/database';
-import { TextFilterConditionPB } from '@/services/backend';
-import { useTranslation } from 'react-i18next';
-
-function TextFilterValue({ data }: { data: TextFilterData }) {
- const { t } = useTranslation();
-
- const value = useMemo(() => {
- if (!data.content) return '';
- switch (data.condition) {
- case TextFilterConditionPB.TextContains:
- case TextFilterConditionPB.TextIs:
- return `: ${data.content}`;
- case TextFilterConditionPB.TextDoesNotContain:
- case TextFilterConditionPB.TextIsNot:
- return `: ${t('grid.textFilter.choicechipPrefix.isNot')} ${data.content}`;
- case TextFilterConditionPB.TextStartsWith:
- return `: ${t('grid.textFilter.choicechipPrefix.startWith')} ${data.content}`;
- case TextFilterConditionPB.TextEndsWith:
- return `: ${t('grid.textFilter.choicechipPrefix.endWith')} ${data.content}`;
- case TextFilterConditionPB.TextIsEmpty:
- return `: ${t('grid.textFilter.choicechipPrefix.isEmpty')}`;
- case TextFilterConditionPB.TextIsNotEmpty:
- return `: ${t('grid.textFilter.choicechipPrefix.isNotEmpty')}`;
- default:
- return '';
- }
- }, [t, data]);
-
- return <>{value}</>;
-}
-
-export default TextFilterValue;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/index.ts
deleted file mode 100644
index 7da8d0eab4..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export * from './tab_bar';
-export * from './cell';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/property/NewProperty.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/property/NewProperty.tsx
deleted file mode 100644
index bb71befa8d..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/property/NewProperty.tsx
+++ /dev/null
@@ -1,41 +0,0 @@
-import React, { useCallback } from 'react';
-import { fieldService } from '$app/application/database';
-import { FieldType } from '@/services/backend';
-import { useTranslation } from 'react-i18next';
-import Button from '@mui/material/Button';
-import { ReactComponent as AddSvg } from '$app/assets/add.svg';
-import { useViewId } from '$app/hooks';
-
-interface NewPropertyProps {
- onInserted?: (id: string) => void;
-}
-function NewProperty({ onInserted }: NewPropertyProps) {
- const viewId = useViewId();
- const { t } = useTranslation();
-
- const handleClick = useCallback(async () => {
- try {
- const field = await fieldService.createField({
- viewId,
- fieldType: FieldType.RichText,
- });
-
- onInserted?.(field.id);
- } catch (e) {
- // toast.error(t('grid.field.newPropertyFail'));
- }
- }, [onInserted, viewId]);
-
- return (
- <Button
- onClick={handleClick}
- className={'h-full w-full justify-start rounded-none'}
- startIcon={<AddSvg />}
- color={'inherit'}
- >
- {t('grid.field.newProperty')}
- </Button>
- );
-}
-
-export default NewProperty;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/property/PropertiesList.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/property/PropertiesList.tsx
deleted file mode 100644
index a9865c467f..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/property/PropertiesList.tsx
+++ /dev/null
@@ -1,92 +0,0 @@
-import React, { useCallback, useMemo, useRef, useState } from 'react';
-import { OutlinedInput } from '@mui/material';
-import { Property } from '$app/components/database/components/property/Property';
-import { Field as FieldType } from '$app/application/database';
-import { useDatabase } from '$app/components/database';
-import KeyboardNavigation from '$app/components/_shared/keyboard_navigation/KeyboardNavigation';
-
-interface FieldListProps {
- searchPlaceholder?: string;
- showSearch?: boolean;
- onItemClick?: (field: FieldType) => void;
- onClose?: () => void;
-}
-
-function PropertiesList({ onClose, showSearch, onItemClick, searchPlaceholder }: FieldListProps) {
- const { fields } = useDatabase();
- const [fieldsResult, setFieldsResult] = useState<FieldType[]>(fields as FieldType[]);
-
- const onInputChange = useCallback(
- (event: React.ChangeEvent<HTMLInputElement>) => {
- const value = event.target.value;
- const result = fields.filter((field) => field.name.toLowerCase().includes(value.toLowerCase()));
-
- setFieldsResult(result);
- },
- [fields]
- );
-
- const inputRef = useRef<HTMLInputElement>(null);
-
- const searchInput = useMemo(() => {
- return showSearch ? (
- <div className={'w-[220px] px-4 pt-2'}>
- <OutlinedInput
- inputRef={inputRef}
- size={'small'}
- autoFocus={true}
- spellCheck={false}
- autoComplete={'off'}
- autoCorrect={'off'}
- inputProps={{
- className: 'text-xs p-1.5',
- }}
- placeholder={searchPlaceholder}
- onChange={onInputChange}
- />
- </div>
- ) : null;
- }, [onInputChange, searchPlaceholder, showSearch]);
-
- const scrollRef = useRef<HTMLDivElement>(null);
-
- const options = useMemo(() => {
- return fieldsResult.map((field) => {
- return {
- key: field.id,
- content: (
- <div className={'truncate'}>
- <Property field={field} />
- </div>
- ),
- };
- });
- }, [fieldsResult]);
-
- const onConfirm = useCallback(
- (key: string) => {
- const field = fields.find((field) => field.id === key);
-
- onItemClick?.(field as FieldType);
- },
- [fields, onItemClick]
- );
-
- return (
- <div className={'pt-2'}>
- {searchInput}
- <div ref={scrollRef} className={'my-2 max-h-[300px] overflow-y-auto overflow-x-hidden'}>
- <KeyboardNavigation
- disableFocus={true}
- scrollRef={scrollRef}
- focusRef={inputRef}
- options={options}
- onConfirm={onConfirm}
- onEscape={onClose}
- />
- </div>
- </div>
- );
-}
-
-export default PropertiesList;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/property/Property.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/property/Property.tsx
deleted file mode 100644
index 3091ba4ea1..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/property/Property.tsx
+++ /dev/null
@@ -1,95 +0,0 @@
-import { FC, useEffect, useRef, useState } from 'react';
-import { Field as FieldType } from '$app/application/database';
-import { ProppertyTypeSvg } from './property_type/ProppertyTypeSvg';
-import { PropertyMenu } from '$app/components/database/components/property/PropertyMenu';
-import usePopoverAutoPosition from '$app/components/_shared/popover/Popover.hooks';
-import { PopoverOrigin } from '@mui/material/Popover/Popover';
-
-export interface FieldProps {
- field: FieldType;
- menuOpened?: boolean;
- onOpenMenu?: (id: string) => void;
- onCloseMenu?: (id: string) => void;
- className?: string;
-}
-
-const initialAnchorOrigin: PopoverOrigin = {
- vertical: 'bottom',
- horizontal: 'right',
-};
-
-const initialTransformOrigin: PopoverOrigin = {
- vertical: 'top',
- horizontal: 'center',
-};
-
-export const Property: FC<FieldProps> = ({ field, onCloseMenu, className, menuOpened }) => {
- const ref = useRef<HTMLDivElement | null>(null);
- const [anchorPosition, setAnchorPosition] = useState<
- | {
- top: number;
- left: number;
- height: number;
- }
- | undefined
- >(undefined);
-
- const open = Boolean(anchorPosition && menuOpened);
-
- useEffect(() => {
- if (menuOpened) {
- const rect = ref.current?.getBoundingClientRect();
-
- if (rect) {
- setAnchorPosition({
- top: rect.top + 28,
- left: rect.left,
- height: rect.height,
- });
- return;
- }
- }
-
- setAnchorPosition(undefined);
- }, [menuOpened]);
-
- const { paperHeight, paperWidth, transformOrigin, anchorOrigin, isEntered } = usePopoverAutoPosition({
- initialPaperWidth: 300,
- initialPaperHeight: 400,
- anchorPosition,
- initialAnchorOrigin,
- initialTransformOrigin,
- open,
- });
-
- return (
- <>
- <div ref={ref} className={className ? className : `flex w-full items-center px-2`}>
- <ProppertyTypeSvg className='mr-1 text-base' type={field.type} />
- <span className='flex-1 truncate text-left text-xs'>{field.name}</span>
- </div>
-
- {open && (
- <PropertyMenu
- field={field}
- open={open && isEntered}
- onClose={() => {
- onCloseMenu?.(field.id);
- }}
- transformOrigin={transformOrigin}
- anchorOrigin={anchorOrigin}
- PaperProps={{
- style: {
- maxHeight: paperHeight,
- width: paperWidth,
- height: 'auto',
- },
- className: 'flex h-full flex-col overflow-hidden',
- }}
- anchorPosition={anchorPosition}
- anchorReference={'anchorPosition'}
- />
- )}
- </>
- );
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/property/PropertyActions.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/property/PropertyActions.tsx
deleted file mode 100644
index b319940996..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/property/PropertyActions.tsx
+++ /dev/null
@@ -1,271 +0,0 @@
-import React, { RefObject, useCallback, useMemo, useState } from 'react';
-
-import { ReactComponent as EditSvg } from '$app/assets/edit.svg';
-import { ReactComponent as HideSvg } from '$app/assets/hide.svg';
-import { ReactComponent as ShowSvg } from '$app/assets/eye_open.svg';
-
-import { ReactComponent as CopySvg } from '$app/assets/copy.svg';
-import { ReactComponent as DeleteSvg } from '$app/assets/delete.svg';
-import { ReactComponent as LeftSvg } from '$app/assets/left.svg';
-import { ReactComponent as RightSvg } from '$app/assets/right.svg';
-import { useViewId } from '$app/hooks';
-import { fieldService } from '$app/application/database';
-import { OrderObjectPositionTypePB, FieldVisibility } from '@/services/backend';
-import DeleteConfirmDialog from '$app/components/_shared/confirm_dialog/DeleteConfirmDialog';
-import { useTranslation } from 'react-i18next';
-import KeyboardNavigation, {
- KeyboardNavigationOption,
-} from '$app/components/_shared/keyboard_navigation/KeyboardNavigation';
-import { notify } from 'src/appflowy_app/components/_shared/notify';
-
-export enum FieldAction {
- EditProperty,
- Hide,
- Show,
- Duplicate,
- Delete,
- InsertLeft,
- InsertRight,
-}
-
-const FieldActionSvgMap = {
- [FieldAction.EditProperty]: EditSvg,
- [FieldAction.Hide]: HideSvg,
- [FieldAction.Show]: ShowSvg,
- [FieldAction.Duplicate]: CopySvg,
- [FieldAction.Delete]: DeleteSvg,
- [FieldAction.InsertLeft]: LeftSvg,
- [FieldAction.InsertRight]: RightSvg,
-};
-
-const defaultActions: FieldAction[] = [
- FieldAction.EditProperty,
- FieldAction.InsertLeft,
- FieldAction.InsertRight,
- FieldAction.Hide,
- FieldAction.Duplicate,
- FieldAction.Delete,
-];
-
-// prevent default actions for primary fields
-const primaryPreventDefaultActions = [FieldAction.Hide, FieldAction.Delete, FieldAction.Duplicate];
-
-interface PropertyActionsProps {
- fieldId: string;
- actions?: FieldAction[];
- isPrimary?: boolean;
- inputRef?: RefObject<HTMLElement>;
- onClose?: () => void;
- onMenuItemClick?: (action: FieldAction, newFieldId?: string) => void;
-}
-
-function PropertyActions({
- onClose,
- inputRef,
- fieldId,
- onMenuItemClick,
- isPrimary,
- actions = defaultActions,
-}: PropertyActionsProps) {
- const viewId = useViewId();
- const { t } = useTranslation();
- const [openConfirm, setOpenConfirm] = useState(false);
- const [focusMenu, setFocusMenu] = useState<boolean>(false);
- const menuTextMap = useMemo(
- () => ({
- [FieldAction.EditProperty]: t('grid.field.editProperty'),
- [FieldAction.Hide]: t('grid.field.hide'),
- [FieldAction.Show]: t('grid.field.show'),
- [FieldAction.Duplicate]: t('grid.field.duplicate'),
- [FieldAction.Delete]: t('grid.field.delete'),
- [FieldAction.InsertLeft]: t('grid.field.insertLeft'),
- [FieldAction.InsertRight]: t('grid.field.insertRight'),
- }),
- [t]
- );
-
- const handleOpenConfirm = () => {
- setOpenConfirm(true);
- };
-
- const handleMenuItemClick = async (action: FieldAction) => {
- const preventDefault = isPrimary && primaryPreventDefaultActions.includes(action);
-
- if (preventDefault) {
- return;
- }
-
- switch (action) {
- case FieldAction.EditProperty:
- break;
- case FieldAction.InsertLeft:
- case FieldAction.InsertRight: {
- const fieldPosition =
- action === FieldAction.InsertLeft ? OrderObjectPositionTypePB.Before : OrderObjectPositionTypePB.After;
-
- const field = await fieldService.createField({
- viewId,
- fieldPosition,
- targetFieldId: fieldId,
- });
-
- onMenuItemClick?.(action, field.id);
- return;
- }
-
- case FieldAction.Hide:
- await fieldService.updateFieldSetting(viewId, fieldId, {
- visibility: FieldVisibility.AlwaysHidden,
- });
- break;
- case FieldAction.Show:
- await fieldService.updateFieldSetting(viewId, fieldId, {
- visibility: FieldVisibility.AlwaysShown,
- });
- break;
- case FieldAction.Duplicate:
- await fieldService.duplicateField(viewId, fieldId);
- break;
- case FieldAction.Delete:
- handleOpenConfirm();
- return;
- }
-
- onMenuItemClick?.(action);
- };
-
- const renderActionContent = useCallback((item: { text: string; Icon: React.FC<React.SVGProps<SVGSVGElement>> }) => {
- const { Icon, text } = item;
-
- return (
- <div className='flex w-full items-center gap-2 px-1'>
- <Icon className={'h-4 w-4'} />
- <div className={'flex-1'}>{text}</div>
- </div>
- );
- }, []);
-
- const options: KeyboardNavigationOption<FieldAction>[] = useMemo(
- () =>
- [
- {
- key: FieldAction.EditProperty,
- content: renderActionContent({
- text: menuTextMap[FieldAction.EditProperty],
- Icon: FieldActionSvgMap[FieldAction.EditProperty],
- }),
- disabled: isPrimary && primaryPreventDefaultActions.includes(FieldAction.EditProperty),
- },
- {
- key: FieldAction.InsertLeft,
- content: renderActionContent({
- text: menuTextMap[FieldAction.InsertLeft],
- Icon: FieldActionSvgMap[FieldAction.InsertLeft],
- }),
- disabled: isPrimary && primaryPreventDefaultActions.includes(FieldAction.InsertLeft),
- },
- {
- key: FieldAction.InsertRight,
- content: renderActionContent({
- text: menuTextMap[FieldAction.InsertRight],
- Icon: FieldActionSvgMap[FieldAction.InsertRight],
- }),
- disabled: isPrimary && primaryPreventDefaultActions.includes(FieldAction.InsertRight),
- },
- {
- key: FieldAction.Hide,
- content: renderActionContent({
- text: menuTextMap[FieldAction.Hide],
- Icon: FieldActionSvgMap[FieldAction.Hide],
- }),
- disabled: isPrimary && primaryPreventDefaultActions.includes(FieldAction.Hide),
- },
- {
- key: FieldAction.Show,
- content: renderActionContent({
- text: menuTextMap[FieldAction.Show],
- Icon: FieldActionSvgMap[FieldAction.Show],
- }),
- },
- {
- key: FieldAction.Duplicate,
- content: renderActionContent({
- text: menuTextMap[FieldAction.Duplicate],
- Icon: FieldActionSvgMap[FieldAction.Duplicate],
- }),
- disabled: isPrimary && primaryPreventDefaultActions.includes(FieldAction.Duplicate),
- },
- {
- key: FieldAction.Delete,
- content: renderActionContent({
- text: menuTextMap[FieldAction.Delete],
- Icon: FieldActionSvgMap[FieldAction.Delete],
- }),
- disabled: isPrimary && primaryPreventDefaultActions.includes(FieldAction.Delete),
- },
- ].filter((option) => actions.includes(option.key)),
- [renderActionContent, menuTextMap, isPrimary, actions]
- );
-
- const handleKeyDown = useCallback(
- (e: KeyboardEvent) => {
- const isTab = e.key === 'Tab';
-
- if (!focusMenu && (e.key === 'ArrowDown' || e.key === 'ArrowUp')) {
- e.stopPropagation();
- notify.clear();
- notify.info(`Press Tab to focus on the menu`);
- return;
- }
-
- if (isTab) {
- e.preventDefault();
- e.stopPropagation();
- if (focusMenu) {
- inputRef?.current?.focus();
- setFocusMenu(false);
- } else {
- inputRef?.current?.blur();
- setFocusMenu(true);
- }
-
- return;
- }
- },
- [focusMenu, inputRef]
- );
-
- return (
- <>
- <KeyboardNavigation
- disableFocus={!focusMenu}
- disableSelect={!focusMenu}
- onEscape={onClose}
- focusRef={inputRef}
- options={options}
- onFocus={() => {
- setFocusMenu(true);
- }}
- onBlur={() => {
- setFocusMenu(false);
- }}
- onKeyDown={handleKeyDown}
- onConfirm={handleMenuItemClick}
- />
- <DeleteConfirmDialog
- open={openConfirm}
- subtitle={''}
- title={t('grid.field.deleteFieldPromptMessage')}
- onOk={async () => {
- await fieldService.deleteField(viewId, fieldId);
- }}
- onClose={() => {
- setOpenConfirm(false);
- onClose?.();
- }}
- />
- </>
- );
-}
-
-export default PropertyActions;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/property/PropertyMenu.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/property/PropertyMenu.tsx
deleted file mode 100644
index 55b314b821..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/property/PropertyMenu.tsx
+++ /dev/null
@@ -1,89 +0,0 @@
-import { Divider } from '@mui/material';
-import { FC, useCallback, useMemo, useRef } from 'react';
-import { useViewId } from '$app/hooks';
-import { Field, fieldService } from '$app/application/database';
-import PropertyTypeMenuExtension from '$app/components/database/components/property/property_type/PropertyTypeMenuExtension';
-import PropertyTypeSelect from '$app/components/database/components/property/property_type/PropertyTypeSelect';
-import { FieldType, FieldVisibility } from '@/services/backend';
-import { Log } from '$app/utils/log';
-import Popover, { PopoverProps } from '@mui/material/Popover';
-import PropertyNameInput from '$app/components/database/components/property/PropertyNameInput';
-import PropertyActions, { FieldAction } from '$app/components/database/components/property/PropertyActions';
-
-export interface GridFieldMenuProps extends PopoverProps {
- field: Field;
-}
-
-export const PropertyMenu: FC<GridFieldMenuProps> = ({ field, ...props }) => {
- const viewId = useViewId();
- const inputRef = useRef<HTMLInputElement>(null);
-
- const isPrimary = field.isPrimary;
- const actions = useMemo(() => {
- const keys = [FieldAction.Duplicate, FieldAction.Delete];
-
- if (field.visibility === FieldVisibility.AlwaysHidden) {
- keys.unshift(FieldAction.Show);
- } else {
- keys.unshift(FieldAction.Hide);
- }
-
- return keys;
- }, [field.visibility]);
-
- const onUpdateFieldType = useCallback(
- async (type: FieldType) => {
- try {
- await fieldService.updateFieldType(viewId, field.id, type);
- } catch (e) {
- // TODO
- Log.error(`change field ${field.id} type from '${field.type}' to ${type} fail`, e);
- }
- },
- [viewId, field]
- );
-
- return (
- <Popover
- keepMounted={false}
- onClick={(e) => e.stopPropagation()}
- onKeyDown={(e) => {
- if (e.key === 'Escape') {
- e.stopPropagation();
- e.preventDefault();
- props.onClose?.({}, 'escapeKeyDown');
- }
- }}
- onMouseDown={(e) => {
- const isInput = inputRef.current?.contains(e.target as Node);
-
- if (isInput) return;
-
- e.stopPropagation();
- e.preventDefault();
- }}
- {...props}
- >
- <PropertyNameInput ref={inputRef} id={field.id} name={field.name} />
- <div className={'flex-1 overflow-y-auto overflow-x-hidden py-1'}>
- {!isPrimary && (
- <div className={'pt-2'}>
- <PropertyTypeSelect field={field} onUpdateFieldType={onUpdateFieldType} />
- <Divider className={'my-2'} />
- </div>
- )}
- <PropertyTypeMenuExtension field={field} />
- <PropertyActions
- inputRef={inputRef}
- onClose={() => props.onClose?.({}, 'backdropClick')}
- isPrimary={isPrimary}
- actions={actions}
- onMenuItemClick={() => {
- props.onClose?.({}, 'backdropClick');
- }}
- fieldId={field.id}
- />
- </div>
- </Popover>
- );
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/property/PropertyNameInput.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/property/PropertyNameInput.tsx
deleted file mode 100644
index 4e20531335..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/property/PropertyNameInput.tsx
+++ /dev/null
@@ -1,49 +0,0 @@
-import React, { ChangeEventHandler, useCallback, useMemo, useState } from 'react';
-import { useViewId } from '$app/hooks';
-import { fieldService } from '$app/application/database';
-import { Log } from '$app/utils/log';
-import TextField from '@mui/material/TextField';
-import debounce from 'lodash-es/debounce';
-
-const PropertyNameInput = React.forwardRef<HTMLInputElement, { id: string; name: string }>(({ id, name }, ref) => {
- const viewId = useViewId();
- const [inputtingName, setInputtingName] = useState(name);
-
- const handleSubmit = useCallback(
- async (newName: string) => {
- if (newName !== name) {
- try {
- await fieldService.updateField(viewId, id, {
- name: newName,
- });
- } catch (e) {
- // TODO
- Log.error(`change field ${id} name from '${name}' to ${newName} fail`, e);
- }
- }
- },
- [viewId, id, name]
- );
-
- const debouncedHandleSubmit = useMemo(() => debounce(handleSubmit, 500), [handleSubmit]);
- const handleInput = useCallback<ChangeEventHandler<HTMLInputElement>>(
- (e) => {
- setInputtingName(e.target.value);
- void debouncedHandleSubmit(e.target.value);
- },
- [debouncedHandleSubmit]
- );
-
- return (
- <TextField
- className='mx-3 mt-3 rounded-[10px]'
- size='small'
- inputRef={ref}
- autoFocus={true}
- value={inputtingName}
- onChange={handleInput}
- />
- );
-});
-
-export default PropertyNameInput;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/property/PropertySelect.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/property/PropertySelect.tsx
deleted file mode 100644
index 0741bbc05b..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/property/PropertySelect.tsx
+++ /dev/null
@@ -1,84 +0,0 @@
-import { FC, useCallback, useMemo, useRef, useState } from 'react';
-import { Field as FieldType } from '$app/application/database';
-import { useDatabase } from '../../Database.hooks';
-import { Property } from './Property';
-import KeyboardNavigation, {
- KeyboardNavigationOption,
-} from '$app/components/_shared/keyboard_navigation/KeyboardNavigation';
-import { ReactComponent as DropDownSvg } from '$app/assets/more.svg';
-import Popover from '@mui/material/Popover';
-
-export interface FieldSelectProps {
- onChange?: (field: FieldType | undefined) => void;
- value?: string;
-}
-
-export const PropertySelect: FC<FieldSelectProps> = ({ value, onChange }) => {
- const { fields } = useDatabase();
-
- const scrollRef = useRef<HTMLDivElement>(null);
- const ref = useRef<HTMLDivElement>(null);
- const [open, setOpen] = useState(false);
- const handleClose = () => {
- setOpen(false);
- };
-
- const options: KeyboardNavigationOption[] = useMemo(
- () =>
- fields.map((field) => {
- return {
- key: field.id,
- content: <Property field={field} />,
- };
- }),
- [fields]
- );
-
- const onConfirm = useCallback(
- (optionKey: string) => {
- onChange?.(fields.find((field) => field.id === optionKey));
- },
- [onChange, fields]
- );
-
- const selectedField = useMemo(() => fields.find((field) => field.id === value), [fields, value]);
-
- return (
- <>
- <div
- ref={ref}
- style={{
- borderColor: open ? 'var(--fill-default)' : undefined,
- }}
- className={
- 'flex w-[150px] cursor-pointer items-center justify-between gap-2 rounded border border-line-border p-2 hover:border-text-title'
- }
- onClick={() => {
- setOpen(true);
- }}
- >
- <div className={'flex-1'}>{selectedField ? <Property field={selectedField} /> : null}</div>
- <DropDownSvg className={'h-4 w-4 rotate-90 transform'} />
- </div>
- {open && (
- <Popover
- open={open}
- anchorEl={ref.current}
- onClose={handleClose}
- anchorOrigin={{ vertical: 'bottom', horizontal: 'left' }}
- transformOrigin={{ vertical: 'top', horizontal: 'left' }}
- >
- <div ref={scrollRef} className={'my-2 max-h-[300px] w-[150px] overflow-y-auto'}>
- <KeyboardNavigation
- defaultFocusedKey={value}
- scrollRef={scrollRef}
- options={options}
- onEscape={handleClose}
- onConfirm={onConfirm}
- />
- </div>
- </Popover>
- )}
- </>
- );
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/property/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/property/index.ts
deleted file mode 100644
index 0b338836d6..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/property/index.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-export * from './Property';
-export * from './PropertySelect';
-export * from './property_type/PropertyTypeText';
-export * from './property_type/ProppertyTypeSvg';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/property/property_type/PropertyTypeMenu.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/property/property_type/PropertyTypeMenu.tsx
deleted file mode 100644
index e3021249ee..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/property/property_type/PropertyTypeMenu.tsx
+++ /dev/null
@@ -1,121 +0,0 @@
-import { Menu, MenuProps } from '@mui/material';
-import { FC, useCallback, useMemo } from 'react';
-import { FieldType } from '@/services/backend';
-import { PropertyTypeText, ProppertyTypeSvg } from '$app/components/database/components/property';
-import { Field } from '$app/application/database';
-import { ReactComponent as SelectCheckSvg } from '$app/assets/select-check.svg';
-import KeyboardNavigation, {
- KeyboardNavigationOption,
-} from '$app/components/_shared/keyboard_navigation/KeyboardNavigation';
-import Typography from '@mui/material/Typography';
-
-export const PropertyTypeMenu: FC<
- MenuProps & {
- field: Field;
- onClickItem?: (type: FieldType) => void;
- }
-> = ({ field, onClickItem, ...props }) => {
- const PopoverClasses = useMemo(
- () => ({
- ...props.PopoverClasses,
- paper: ['w-56', props.PopoverClasses?.paper].join(' '),
- }),
- [props.PopoverClasses]
- );
-
- const renderGroupContent = useCallback((title: string) => {
- return (
- <Typography variant='subtitle2' className='px-2'>
- {title}
- </Typography>
- );
- }, []);
-
- const renderContent = useCallback(
- (type: FieldType) => {
- return (
- <>
- <ProppertyTypeSvg className='mr-2 text-base' type={type} />
- <span className='flex-1 font-medium'>
- <PropertyTypeText type={type} />
- </span>
- {type === field.type && <SelectCheckSvg className={'text-content-blue-400'} />}
- </>
- );
- },
- [field.type]
- );
-
- const options: KeyboardNavigationOption<FieldType>[] = useMemo(() => {
- return [
- {
- key: 100,
- content: renderGroupContent('Basic'),
- children: [
- {
- key: FieldType.RichText,
- content: renderContent(FieldType.RichText),
- },
- {
- key: FieldType.Number,
- content: renderContent(FieldType.Number),
- },
- {
- key: FieldType.SingleSelect,
- content: renderContent(FieldType.SingleSelect),
- },
- {
- key: FieldType.MultiSelect,
- content: renderContent(FieldType.MultiSelect),
- },
- {
- key: FieldType.DateTime,
- content: renderContent(FieldType.DateTime),
- },
- {
- key: FieldType.Checkbox,
- content: renderContent(FieldType.Checkbox),
- },
- {
- key: FieldType.Checklist,
- content: renderContent(FieldType.Checklist),
- },
- {
- key: FieldType.URL,
- content: renderContent(FieldType.URL),
- },
- ],
- },
- {
- key: 101,
- content: <hr className={'h-[1px] w-full bg-line-divider opacity-40'} />,
- children: [],
- },
- {
- key: 102,
- content: renderGroupContent('Advanced'),
- children: [
- {
- key: FieldType.LastEditedTime,
- content: renderContent(FieldType.LastEditedTime),
- },
- {
- key: FieldType.CreatedTime,
- content: renderContent(FieldType.CreatedTime),
- },
- ],
- },
- ];
- }, [renderContent, renderGroupContent]);
-
- return (
- <Menu {...props} PopoverClasses={PopoverClasses}>
- <KeyboardNavigation
- onEscape={() => props?.onClose?.({}, 'escapeKeyDown')}
- options={options}
- disableFocus={true}
- onConfirm={onClickItem}
- />
- </Menu>
- );
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/property/property_type/PropertyTypeMenuExtension.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/property/property_type/PropertyTypeMenuExtension.tsx
deleted file mode 100644
index b45b670757..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/property/property_type/PropertyTypeMenuExtension.tsx
+++ /dev/null
@@ -1,26 +0,0 @@
-import React, { useMemo } from 'react';
-import { FieldType } from '@/services/backend';
-import { DateTimeField, Field, NumberField, SelectField } from '$app/application/database';
-import SelectFieldActions from '$app/components/database/components/field_types/select/select_field_actions/SelectFieldActions';
-import NumberFieldActions from '$app/components/database/components/field_types/number/NumberFieldActions';
-import DateTimeFieldActions from '$app/components/database/components/field_types/date/DateTimeFieldActions';
-
-function PropertyTypeMenuExtension({ field }: { field: Field }) {
- return useMemo(() => {
- switch (field.type) {
- case FieldType.SingleSelect:
- case FieldType.MultiSelect:
- return <SelectFieldActions field={field as SelectField} />;
- case FieldType.Number:
- return <NumberFieldActions field={field as NumberField} />;
- case FieldType.DateTime:
- case FieldType.CreatedTime:
- case FieldType.LastEditedTime:
- return <DateTimeFieldActions field={field as DateTimeField} />;
- default:
- return null;
- }
- }, [field]);
-}
-
-export default PropertyTypeMenuExtension;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/property/property_type/PropertyTypeSelect.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/property/property_type/PropertyTypeSelect.tsx
deleted file mode 100644
index 28d62b82c6..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/property/property_type/PropertyTypeSelect.tsx
+++ /dev/null
@@ -1,59 +0,0 @@
-import React, { useRef, useState } from 'react';
-import { ProppertyTypeSvg } from '$app/components/database/components/property/property_type/ProppertyTypeSvg';
-import { MenuItem } from '@mui/material';
-import { Field } from '$app/application/database';
-import { ReactComponent as MoreSvg } from '$app/assets/more.svg';
-import { PropertyTypeMenu } from '$app/components/database/components/property/property_type/PropertyTypeMenu';
-import { FieldType } from '@/services/backend';
-import { PropertyTypeText } from '$app/components/database/components/property/property_type/PropertyTypeText';
-
-interface Props {
- field: Field;
- onUpdateFieldType: (type: FieldType) => void;
-}
-function PropertyTypeSelect({ field, onUpdateFieldType }: Props) {
- const [expanded, setExpanded] = useState(false);
- const ref = useRef<HTMLLIElement>(null);
-
- return (
- <div>
- <MenuItem
- ref={ref}
- onClick={() => {
- setExpanded(!expanded);
- }}
- className={'mx-0 rounded-none px-0'}
- >
- <div className={'flex w-full items-center px-3'}>
- <ProppertyTypeSvg type={field.type} className='mr-2 text-base' />
- <span className='flex-1 text-xs font-medium'>
- <PropertyTypeText type={field.type} />
- </span>
- <MoreSvg className={`transform text-base ${expanded ? '' : 'rotate-90'}`} />
- </div>
- </MenuItem>
- {expanded && (
- <PropertyTypeMenu
- keepMounted={false}
- field={field}
- onClickItem={onUpdateFieldType}
- open={expanded}
- anchorEl={ref.current}
- transformOrigin={{
- vertical: 'top',
- horizontal: 'left',
- }}
- anchorOrigin={{
- vertical: 'top',
- horizontal: 'right',
- }}
- onClose={() => {
- setExpanded(false);
- }}
- />
- )}
- </div>
- );
-}
-
-export default PropertyTypeSelect;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/property/property_type/PropertyTypeText.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/property/property_type/PropertyTypeText.tsx
deleted file mode 100644
index daae232fde..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/property/property_type/PropertyTypeText.tsx
+++ /dev/null
@@ -1,27 +0,0 @@
-import { FieldType } from '@/services/backend';
-import { useTranslation } from 'react-i18next';
-import { useMemo } from 'react';
-
-export const PropertyTypeText = ({ type }: { type: FieldType }) => {
- const { t } = useTranslation();
-
- const text = useMemo(() => {
- const map = {
- [FieldType.RichText]: t('grid.field.textFieldName'),
- [FieldType.Number]: t('grid.field.numberFieldName'),
- [FieldType.DateTime]: t('grid.field.dateFieldName'),
- [FieldType.SingleSelect]: t('grid.field.singleSelectFieldName'),
- [FieldType.MultiSelect]: t('grid.field.multiSelectFieldName'),
- [FieldType.Checkbox]: t('grid.field.checkboxFieldName'),
- [FieldType.URL]: t('grid.field.urlFieldName'),
- [FieldType.Checklist]: t('grid.field.checklistFieldName'),
- [FieldType.LastEditedTime]: t('grid.field.updatedAtFieldName'),
- [FieldType.CreatedTime]: t('grid.field.createdAtFieldName'),
- [FieldType.Relation]: t('grid.field.relationFieldName'),
- };
-
- return map[type] || 'unknown';
- }, [t, type]);
-
- return <div>{text}</div>;
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/property/property_type/ProppertyTypeSvg.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/property/property_type/ProppertyTypeSvg.tsx
deleted file mode 100644
index 7ee4e6f83d..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/property/property_type/ProppertyTypeSvg.tsx
+++ /dev/null
@@ -1,32 +0,0 @@
-import { FC, memo } from 'react';
-import { FieldType } from '@/services/backend';
-import { ReactComponent as TextSvg } from '$app/assets/database/field-type-text.svg';
-import { ReactComponent as NumberSvg } from '$app/assets/database/field-type-number.svg';
-import { ReactComponent as DateSvg } from '$app/assets/database/field-type-date.svg';
-import { ReactComponent as SingleSelectSvg } from '$app/assets/database/field-type-single-select.svg';
-import { ReactComponent as MultiSelectSvg } from '$app/assets/database/field-type-multi-select.svg';
-import { ReactComponent as ChecklistSvg } from '$app/assets/database/field-type-checklist.svg';
-import { ReactComponent as CheckboxSvg } from '$app/assets/database/field-type-checkbox.svg';
-import { ReactComponent as URLSvg } from '$app/assets/database/field-type-url.svg';
-import { ReactComponent as LastEditedTimeSvg } from '$app/assets/database/field-type-last-edited-time.svg';
-import { ReactComponent as RelationSvg } from '$app/assets/database/field-type-relation.svg';
-
-export const FieldTypeSvgMap: Record<FieldType, FC<React.SVGProps<SVGSVGElement>>> = {
- [FieldType.RichText]: TextSvg,
- [FieldType.Number]: NumberSvg,
- [FieldType.DateTime]: DateSvg,
- [FieldType.SingleSelect]: SingleSelectSvg,
- [FieldType.MultiSelect]: MultiSelectSvg,
- [FieldType.Checkbox]: CheckboxSvg,
- [FieldType.URL]: URLSvg,
- [FieldType.Checklist]: ChecklistSvg,
- [FieldType.LastEditedTime]: LastEditedTimeSvg,
- [FieldType.CreatedTime]: LastEditedTimeSvg,
- [FieldType.Relation]: RelationSvg,
-};
-
-export const ProppertyTypeSvg: FC<{ type: FieldType; className?: string }> = memo(({ type, ...props }) => {
- const Svg = FieldTypeSvgMap[type];
-
- return <Svg {...props} />;
-});
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/sort/SortConditionSelect.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/sort/SortConditionSelect.tsx
deleted file mode 100644
index fdb508cb8f..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/sort/SortConditionSelect.tsx
+++ /dev/null
@@ -1,78 +0,0 @@
-import { FC, useMemo, useRef, useState } from 'react';
-import { SortConditionPB } from '@/services/backend';
-import KeyboardNavigation, {
- KeyboardNavigationOption,
-} from '$app/components/_shared/keyboard_navigation/KeyboardNavigation';
-import { Popover } from '@mui/material';
-import { ReactComponent as DropDownSvg } from '$app/assets/more.svg';
-import { useTranslation } from 'react-i18next';
-
-export const SortConditionSelect: FC<{
- onChange?: (value: SortConditionPB) => void;
- value?: SortConditionPB;
-}> = ({ onChange, value }) => {
- const { t } = useTranslation();
- const ref = useRef<HTMLDivElement>(null);
- const [open, setOpen] = useState(false);
- const handleClose = () => {
- setOpen(false);
- };
-
- const options: KeyboardNavigationOption<SortConditionPB>[] = useMemo(() => {
- return [
- {
- key: SortConditionPB.Ascending,
- content: t('grid.sort.ascending'),
- },
- {
- key: SortConditionPB.Descending,
- content: t('grid.sort.descending'),
- },
- ];
- }, [t]);
-
- const onConfirm = (optionKey: SortConditionPB) => {
- onChange?.(optionKey);
- handleClose();
- };
-
- const selectedField = useMemo(() => options.find((option) => option.key === value), [options, value]);
-
- return (
- <>
- <div
- ref={ref}
- style={{
- borderColor: open ? 'var(--fill-default)' : undefined,
- }}
- className={
- 'flex w-[150px] cursor-pointer items-center justify-between gap-2 rounded border border-line-border p-2 text-xs hover:border-text-title'
- }
- onClick={() => {
- setOpen(true);
- }}
- >
- <div className={'flex-1'}>{selectedField?.content}</div>
- <DropDownSvg className={'h-4 w-4 rotate-90 transform'} />
- </div>
- {open && (
- <Popover
- open={open}
- anchorEl={ref.current}
- onClose={handleClose}
- anchorOrigin={{ vertical: 'bottom', horizontal: 'left' }}
- transformOrigin={{ vertical: 'top', horizontal: 'left' }}
- >
- <div className={'my-2 w-[150px]'}>
- <KeyboardNavigation
- defaultFocusedKey={value}
- options={options}
- onEscape={handleClose}
- onConfirm={onConfirm}
- />
- </div>
- </Popover>
- )}
- </>
- );
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/sort/SortFieldsMenu.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/sort/SortFieldsMenu.tsx
deleted file mode 100644
index 724c28467a..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/sort/SortFieldsMenu.tsx
+++ /dev/null
@@ -1,53 +0,0 @@
-import React, { FC, useCallback } from 'react';
-import { MenuProps } from '@mui/material';
-import PropertiesList from '$app/components/database/components/property/PropertiesList';
-import { Field, sortService } from '$app/application/database';
-import { SortConditionPB } from '@/services/backend';
-import { useTranslation } from 'react-i18next';
-import { useViewId } from '$app/hooks';
-import Popover from '@mui/material/Popover';
-
-const SortFieldsMenu: FC<
- MenuProps & {
- onInserted?: () => void;
- }
-> = ({ onInserted, ...props }) => {
- const { t } = useTranslation();
- const viewId = useViewId();
- const addSort = useCallback(
- async (field: Field) => {
- await sortService.insertSort(viewId, {
- fieldId: field.id,
- condition: SortConditionPB.Ascending,
- });
- props.onClose?.({}, 'backdropClick');
- onInserted?.();
- },
- [props, viewId, onInserted]
- );
-
- return (
- <Popover
- onKeyDown={(e) => {
- if (e.key === 'Escape') {
- e.preventDefault();
- e.stopPropagation();
- props.onClose?.({}, 'escapeKeyDown');
- }
- }}
- keepMounted={false}
- {...props}
- >
- <PropertiesList
- onClose={() => {
- props.onClose?.({}, 'escapeKeyDown');
- }}
- showSearch={true}
- onItemClick={addSort}
- searchPlaceholder={t('grid.settings.sortBy')}
- />
- </Popover>
- );
-};
-
-export default SortFieldsMenu;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/sort/SortItem.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/sort/SortItem.tsx
deleted file mode 100644
index fe1074bbde..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/sort/SortItem.tsx
+++ /dev/null
@@ -1,55 +0,0 @@
-import { IconButton, Stack } from '@mui/material';
-import { FC, useCallback } from 'react';
-import { ReactComponent as CloseSvg } from '$app/assets/close.svg';
-import { Field, Sort, sortService } from '$app/application/database';
-import { PropertySelect } from '../property';
-import { SortConditionSelect } from './SortConditionSelect';
-import { useViewId } from '@/appflowy_app/hooks';
-import { SortConditionPB } from '@/services/backend';
-
-export interface SortItemProps {
- className?: string;
- sort: Sort;
-}
-
-export const SortItem: FC<SortItemProps> = ({ className, sort }) => {
- const viewId = useViewId();
-
- const handleFieldChange = useCallback(
- (field: Field | undefined) => {
- if (field) {
- void sortService.updateSort(viewId, {
- ...sort,
- fieldId: field.id,
- });
- }
- },
- [viewId, sort]
- );
-
- const handleConditionChange = useCallback(
- (value: SortConditionPB) => {
- void sortService.updateSort(viewId, {
- ...sort,
- condition: value,
- });
- },
- [viewId, sort]
- );
-
- const handleClick = useCallback(() => {
- void sortService.deleteSort(viewId, sort);
- }, [viewId, sort]);
-
- return (
- <Stack className={className} direction='row' spacing={1}>
- <PropertySelect value={sort.fieldId} onChange={handleFieldChange} />
- <SortConditionSelect value={sort.condition} onChange={handleConditionChange} />
- <div className={'flex items-center justify-center'}>
- <IconButton size={'small'} onClick={handleClick}>
- <CloseSvg />
- </IconButton>
- </div>
- </Stack>
- );
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/sort/SortMenu.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/sort/SortMenu.tsx
deleted file mode 100644
index 88df70b2e4..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/sort/SortMenu.tsx
+++ /dev/null
@@ -1,90 +0,0 @@
-import { Menu, MenuProps } from '@mui/material';
-import { FC, MouseEventHandler, useCallback, useState } from 'react';
-import { useViewId } from '$app/hooks';
-import { sortService } from '$app/application/database';
-import { useDatabaseSorts } from '../../Database.hooks';
-import { SortItem } from './SortItem';
-
-import { useTranslation } from 'react-i18next';
-import { ReactComponent as AddSvg } from '$app/assets/add.svg';
-import { ReactComponent as DeleteSvg } from '$app/assets/delete.svg';
-import SortFieldsMenu from '$app/components/database/components/sort/SortFieldsMenu';
-import Button from '@mui/material/Button';
-
-export const SortMenu: FC<MenuProps> = (props) => {
- const { onClose } = props;
- const { t } = useTranslation();
- const viewId = useViewId();
- const sorts = useDatabaseSorts();
- const [anchorEl, setAnchorEl] = useState<HTMLElement | null>(null);
- const openFieldListMenu = Boolean(anchorEl);
- const handleClick = useCallback<MouseEventHandler<HTMLElement>>((event) => {
- setAnchorEl(event.currentTarget);
- }, []);
-
- const deleteAllSorts = useCallback(() => {
- void sortService.deleteAllSorts(viewId);
- onClose?.({}, 'backdropClick');
- }, [viewId, onClose]);
-
- return (
- <>
- <Menu
- onKeyDown={(e) => {
- if (e.key === 'Escape') {
- e.preventDefault();
- e.stopPropagation();
- props.onClose?.({}, 'escapeKeyDown');
- }
- }}
- keepMounted={false}
- MenuListProps={{
- className: 'py-1 w-[360px]',
- }}
- {...props}
- onClose={onClose}
- >
- <div className={'flex max-h-[300px] w-full flex-col overflow-y-auto'}>
- <div className={'mb-1 px-1'}>
- {sorts.map((sort) => (
- <SortItem key={sort.id} className='m-2' sort={sort} />
- ))}
- </div>
-
- <div className={'mx-2 flex flex-col'}>
- <Button
- onClick={handleClick}
- className={'justify-start px-1.5'}
- variant={'text'}
- color={'inherit'}
- startIcon={<AddSvg />}
- >
- {t('grid.sort.addSort')}
- </Button>
- <Button
- onClick={deleteAllSorts}
- className={'justify-start px-1.5'}
- variant={'text'}
- color={'inherit'}
- startIcon={<DeleteSvg />}
- >
- {t('grid.sort.deleteAllSorts')}
- </Button>
- </div>
- </div>
- </Menu>
-
- <SortFieldsMenu
- open={openFieldListMenu}
- anchorEl={anchorEl}
- onClose={() => {
- setAnchorEl(null);
- }}
- anchorOrigin={{
- vertical: 'bottom',
- horizontal: 'left',
- }}
- />
- </>
- );
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/sort/Sorts.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/sort/Sorts.tsx
deleted file mode 100644
index 7a4fa57a6f..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/sort/Sorts.tsx
+++ /dev/null
@@ -1,45 +0,0 @@
-import { Chip, Divider } from '@mui/material';
-import React, { MouseEventHandler, useCallback, useEffect, useState } from 'react';
-import { SortMenu } from './SortMenu';
-import { useTranslation } from 'react-i18next';
-import { ReactComponent as SortSvg } from '$app/assets/sort.svg';
-import { ReactComponent as DropDownSvg } from '$app/assets/dropdown.svg';
-import { useDatabase } from '$app/components/database';
-
-export const Sorts = () => {
- const { t } = useTranslation();
- const { sorts } = useDatabase();
-
- const showSorts = sorts && sorts.length > 0;
- const [anchorEl, setAnchorEl] = useState<HTMLElement | null>(null);
-
- const handleClick = useCallback<MouseEventHandler<HTMLElement>>((event) => {
- setAnchorEl(event.currentTarget);
- }, []);
-
- const label = (
- <div className={'flex items-center justify-center gap-1'}>
- <SortSvg className={'h-4 w-4'} />
- {t('grid.settings.sort')}
- <DropDownSvg className={'h-5 w-5'} />
- </div>
- );
-
- const menuOpen = Boolean(anchorEl);
-
- useEffect(() => {
- if (!showSorts) {
- setAnchorEl(null);
- }
- }, [showSorts]);
-
- if (!showSorts) return null;
-
- return (
- <div className={'text-text-title'}>
- <Chip clickable variant='outlined' label={label} onClick={handleClick} />
- <Divider className={'mx-2'} orientation='vertical' flexItem />
- <SortMenu open={menuOpen} anchorEl={anchorEl} onClose={() => setAnchorEl(null)} />
- </div>
- );
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/sort/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/sort/index.ts
deleted file mode 100644
index e64dba3a6e..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/sort/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export * from './SortMenu';
-export * from './Sorts';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/tab_bar/AddViewBtn.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/tab_bar/AddViewBtn.tsx
deleted file mode 100644
index 717bf1eb18..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/tab_bar/AddViewBtn.tsx
+++ /dev/null
@@ -1,29 +0,0 @@
-import React from 'react';
-import { IconButton } from '@mui/material';
-import { ReactComponent as AddSvg } from '$app/assets/add.svg';
-import { useTranslation } from 'react-i18next';
-import { ViewLayoutPB } from '@/services/backend';
-import { createDatabaseView } from '$app/application/database/database_view/database_view_service';
-
-function AddViewBtn({ pageId, onCreated }: { pageId: string; onCreated: (id: string) => void }) {
- const { t } = useTranslation();
- const onClick = async () => {
- try {
- const view = await createDatabaseView(pageId, ViewLayoutPB.Grid, t('editor.table'));
-
- onCreated(view.id);
- } catch (e) {
- console.error(e);
- }
- };
-
- return (
- <div className={'ml-1 flex items-center justify-center border-l border-line-divider px-1'}>
- <IconButton className={'flex items-center justify-center'} onClick={onClick} size='small'>
- <AddSvg />
- </IconButton>
- </div>
- );
-}
-
-export default AddViewBtn;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/tab_bar/DatabaseTabBar.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/tab_bar/DatabaseTabBar.tsx
deleted file mode 100644
index f7375e0c70..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/tab_bar/DatabaseTabBar.tsx
+++ /dev/null
@@ -1,110 +0,0 @@
-import { forwardRef, FunctionComponent, SVGProps, useEffect, useMemo, useState } from 'react';
-import { ViewTabs, ViewTab } from './ViewTabs';
-import { useTranslation } from 'react-i18next';
-import AddViewBtn from '$app/components/database/components/tab_bar/AddViewBtn';
-import { ViewLayoutPB } from '@/services/backend';
-import { ReactComponent as GridSvg } from '$app/assets/grid.svg';
-import { ReactComponent as BoardSvg } from '$app/assets/board.svg';
-import { ReactComponent as DocumentSvg } from '$app/assets/document.svg';
-import ViewActions from '$app/components/database/components/tab_bar/ViewActions';
-import { Page } from '$app_reducers/pages/slice';
-
-export interface DatabaseTabBarProps {
- childViews: Page[];
- selectedViewId?: string;
- setSelectedViewId?: (viewId: string) => void;
- pageId: string;
-}
-
-const DatabaseIcons: {
- [key in ViewLayoutPB]: FunctionComponent<SVGProps<SVGSVGElement> & { title?: string | undefined }>;
-} = {
- [ViewLayoutPB.Document]: DocumentSvg,
- [ViewLayoutPB.Grid]: GridSvg,
- [ViewLayoutPB.Board]: BoardSvg,
- [ViewLayoutPB.Calendar]: GridSvg,
-};
-
-export const DatabaseTabBar = forwardRef<HTMLDivElement, DatabaseTabBarProps>(
- ({ pageId, childViews, selectedViewId, setSelectedViewId }, ref) => {
- const { t } = useTranslation();
- const [contextMenuAnchorEl, setContextMenuAnchorEl] = useState<HTMLElement | null>(null);
- const [contextMenuView, setContextMenuView] = useState<Page | null>(null);
- const open = Boolean(contextMenuAnchorEl);
-
- const handleChange = (_: React.SyntheticEvent, newValue: string) => {
- setSelectedViewId?.(newValue);
- };
-
- useEffect(() => {
- if (selectedViewId === undefined && childViews.length > 0) {
- setSelectedViewId?.(childViews[0].id);
- }
- }, [selectedViewId, setSelectedViewId, childViews]);
-
- const openMenu = (view: Page) => {
- return (e: React.MouseEvent<HTMLElement>) => {
- e.preventDefault();
- e.stopPropagation();
- setContextMenuView(view);
- setContextMenuAnchorEl(e.currentTarget);
- };
- };
-
- const isSelected = useMemo(
- () => childViews.some((view) => view.id === selectedViewId),
- [childViews, selectedViewId]
- );
-
- if (childViews.length === 0) return null;
- return (
- <div ref={ref} className='-mb-px flex w-full items-center overflow-hidden px-16 text-text-title'>
- <div
- style={{
- width: 'calc(100% - 120px)',
- }}
- className='flex items-center border-b border-line-divider'
- >
- <ViewTabs
- scrollButtons={false}
- variant='scrollable'
- allowScrollButtonsMobile
- value={isSelected ? selectedViewId : childViews[0].id}
- onChange={handleChange}
- >
- {childViews.map((view) => {
- const Icon = DatabaseIcons[view.layout];
-
- return (
- <ViewTab
- onContextMenuCapture={openMenu(view)}
- onDoubleClick={openMenu(view)}
- key={view.id}
- icon={<Icon />}
- iconPosition='start'
- color='inherit'
- label={view.name || t('grid.title.placeholder')}
- value={view.id}
- />
- );
- })}
- </ViewTabs>
- <AddViewBtn pageId={pageId} onCreated={(id) => setSelectedViewId?.(id)} />
- </div>
- {open && contextMenuView && (
- <ViewActions
- pageId={pageId}
- view={contextMenuView}
- keepMounted={false}
- open={open}
- anchorEl={contextMenuAnchorEl}
- onClose={() => {
- setContextMenuAnchorEl(null);
- setContextMenuView(null);
- }}
- />
- )}
- </div>
- );
- }
-);
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/tab_bar/TextButton.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/tab_bar/TextButton.tsx
deleted file mode 100644
index 60dfaa2e53..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/tab_bar/TextButton.tsx
+++ /dev/null
@@ -1,9 +0,0 @@
-import { Button, ButtonProps, styled } from '@mui/material';
-
-export const TextButton = styled(Button)<ButtonProps>(() => ({
- padding: '2px 6px',
- fontSize: '0.75rem',
- lineHeight: '1rem',
- fontWeight: 400,
- minWidth: 'unset',
-}));
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/tab_bar/ViewActions.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/tab_bar/ViewActions.tsx
deleted file mode 100644
index be545e51e3..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/tab_bar/ViewActions.tsx
+++ /dev/null
@@ -1,103 +0,0 @@
-import React, { useCallback, useState } from 'react';
-import { useTranslation } from 'react-i18next';
-import { ReactComponent as DeleteSvg } from '$app/assets/delete.svg';
-import { ReactComponent as EditSvg } from '$app/assets/edit.svg';
-import { deleteView } from '$app/application/database/database_view/database_view_service';
-import { MenuProps, Menu } from '@mui/material';
-import RenameDialog from '$app/components/_shared/confirm_dialog/RenameDialog';
-import { Page } from '$app_reducers/pages/slice';
-import { useAppDispatch } from '$app/stores/store';
-import { updatePageName } from '$app_reducers/pages/async_actions';
-import KeyboardNavigation from '$app/components/_shared/keyboard_navigation/KeyboardNavigation';
-
-enum ViewAction {
- Rename,
- Delete,
-}
-
-function ViewActions({ view, pageId, ...props }: { pageId: string; view: Page } & MenuProps) {
- const { t } = useTranslation();
- const viewId = view.id;
- const dispatch = useAppDispatch();
- const [openRenameDialog, setOpenRenameDialog] = useState(false);
- const renderContent = useCallback((title: string, Icon: React.FC<React.SVGProps<SVGSVGElement>>) => {
- return (
- <div className={'flex w-full items-center gap-1'}>
- <Icon className={'h-4 w-4'} />
- <div className={'flex-1'}>{title}</div>
- </div>
- );
- }, []);
-
- const onConfirm = useCallback(
- async (key: ViewAction) => {
- switch (key) {
- case ViewAction.Rename:
- setOpenRenameDialog(true);
- break;
- case ViewAction.Delete:
- try {
- await deleteView(viewId);
- props.onClose?.({}, 'backdropClick');
- } catch (e) {
- // toast.error(t('error.deleteView'));
- }
-
- break;
- default:
- break;
- }
- },
- [viewId, props]
- );
- const options = [
- {
- key: ViewAction.Rename,
- content: renderContent(t('button.rename'), EditSvg),
- },
-
- {
- key: ViewAction.Delete,
- content: renderContent(t('button.delete'), DeleteSvg),
- disabled: viewId === pageId,
- },
- ];
-
- return (
- <>
- <Menu keepMounted={false} disableRestoreFocus={true} {...props}>
- <KeyboardNavigation
- options={options}
- onConfirm={onConfirm}
- onEscape={() => {
- props.onClose?.({}, 'escapeKeyDown');
- }}
- />
- </Menu>
- {openRenameDialog && (
- <RenameDialog
- open={openRenameDialog}
- onClose={() => setOpenRenameDialog(false)}
- onOk={async (val) => {
- try {
- await dispatch(
- updatePageName({
- id: viewId,
- name: val,
- immediate: true,
- })
- );
- setOpenRenameDialog(false);
- props.onClose?.({}, 'backdropClick');
- } catch (e) {
- // toast.error(t('error.renameView'));
- }
- }}
- defaultValue={view.name}
- />
- )}
- </>
- );
-}
-
-export default ViewActions;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/tab_bar/ViewTabs.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/tab_bar/ViewTabs.tsx
deleted file mode 100644
index e2ff336c73..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/tab_bar/ViewTabs.tsx
+++ /dev/null
@@ -1,48 +0,0 @@
-import { styled, Tab, TabProps, Tabs, TabsProps } from '@mui/material';
-import { HTMLAttributes } from 'react';
-
-export const ViewTabs = styled((props: TabsProps) => <Tabs {...props} />)({
- minHeight: '28px',
-
- '& .MuiTabs-scroller': {
- paddingBottom: '2px',
- },
-});
-
-export const ViewTab = styled((props: TabProps) => <Tab disableRipple {...props} />)({
- padding: '6px 12px',
- minHeight: '28px',
- fontSize: '12px',
- lineHeight: '16px',
- minWidth: 'unset',
- margin: '4px 0',
-
- '&.Mui-selected': {
- color: 'inherit',
- },
-});
-
-interface TabPanelProps extends HTMLAttributes<HTMLDivElement> {
- children?: React.ReactNode;
- index: number;
- value: number;
-}
-
-export function TabPanel(props: TabPanelProps) {
- const { children, value, index, ...other } = props;
-
- const isActivated = value === index;
-
- return (
- <div
- role='tabpanel'
- hidden={!isActivated}
- id={`full-width-tabpanel-${index}`}
- aria-labelledby={`full-width-tab-${index}`}
- dir={'ltr'}
- {...other}
- >
- {isActivated ? children : null}
- </div>
- );
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/tab_bar/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/database/components/tab_bar/index.ts
deleted file mode 100644
index fc0c62963e..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/components/tab_bar/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './DatabaseTabBar';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/database.scss b/frontend/appflowy_tauri/src/appflowy_app/components/database/database.scss
deleted file mode 100644
index 492ff2a713..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/database.scss
+++ /dev/null
@@ -1,19 +0,0 @@
-.database-collection {
- ::-webkit-scrollbar {
- width: 0px;
- height: 0px;
- }
-}
-
-.checklist-item {
- @apply my-1;
- .delete-option-button {
- display: none;
- }
- &:hover, &.selected {
- background-color: var(--fill-list-hover);
- .delete-option-button {
- display: block;
- }
- }
-}
\ No newline at end of file
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/Grid.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/Grid.tsx
deleted file mode 100644
index beb90c66dc..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/Grid.tsx
+++ /dev/null
@@ -1,6 +0,0 @@
-import { FC } from 'react';
-import { GridTable, GridTableProps } from './grid_table';
-
-export const Grid: FC<GridTableProps> = (props) => {
- return <GridTable {...props} />;
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/constants.ts b/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/constants.ts
deleted file mode 100644
index eadfadaa89..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/constants.ts
+++ /dev/null
@@ -1,86 +0,0 @@
-import { Field, RowMeta } from '$app/application/database';
-
-export const GridCalculateCountHeight = 40;
-
-export const GRID_ACTIONS_WIDTH = 64;
-
-export const DEFAULT_FIELD_WIDTH = 150;
-
-export enum RenderRowType {
- Fields = 'fields',
- Row = 'row',
- NewRow = 'new-row',
- CalculateRow = 'calculate-row',
-}
-
-export interface CalculateRenderRow {
- type: RenderRowType.CalculateRow;
-}
-
-export interface FieldRenderRow {
- type: RenderRowType.Fields;
-}
-
-export interface CellRenderRow {
- type: RenderRowType.Row;
- data: {
- meta: RowMeta;
- };
-}
-
-export interface NewRenderRow {
- type: RenderRowType.NewRow;
- data: {
- groupId?: string;
- };
-}
-
-export type RenderRow = FieldRenderRow | CellRenderRow | NewRenderRow | CalculateRenderRow;
-
-export const fieldsToColumns = (fields: Field[]): GridColumn[] => {
- return [
- {
- type: GridColumnType.Action,
- width: GRID_ACTIONS_WIDTH,
- },
- ...fields.map<GridColumn>((field) => ({
- field,
- width: field.width || DEFAULT_FIELD_WIDTH,
- type: GridColumnType.Field,
- })),
- {
- type: GridColumnType.NewProperty,
- width: DEFAULT_FIELD_WIDTH,
- },
- ];
-};
-
-export const rowMetasToRenderRow = (rowMetas: RowMeta[]): RenderRow[] => {
- return [
- ...rowMetas.map<RenderRow>((rowMeta) => ({
- type: RenderRowType.Row,
- data: {
- meta: rowMeta,
- },
- })),
- {
- type: RenderRowType.NewRow,
- data: {},
- },
- {
- type: RenderRowType.CalculateRow,
- },
- ];
-};
-
-export enum GridColumnType {
- Action,
- Field,
- NewProperty,
-}
-
-export interface GridColumn {
- field?: Field;
- width: number;
- type: GridColumnType;
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_calculate/GridCalculate.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_calculate/GridCalculate.tsx
deleted file mode 100644
index beed71fca4..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_calculate/GridCalculate.tsx
+++ /dev/null
@@ -1,36 +0,0 @@
-import React from 'react';
-import { useDatabaseVisibilityRows } from '$app/components/database';
-import { Field } from '$app/application/database';
-import { DEFAULT_FIELD_WIDTH, GRID_ACTIONS_WIDTH } from '$app/components/database/grid/constants';
-import { useTranslation } from 'react-i18next';
-
-interface Props {
- field: Field;
- index: number;
- getContainerRef?: () => React.RefObject<HTMLDivElement>;
-}
-
-export function GridCalculate({ field, index }: Props) {
- const rowMetas = useDatabaseVisibilityRows();
- const count = rowMetas.length;
- const width = index === 0 ? GRID_ACTIONS_WIDTH : field.width ?? DEFAULT_FIELD_WIDTH;
- const { t } = useTranslation();
-
- return (
- <div
- style={{
- width,
- }}
- className={'flex justify-end py-2 text-text-title'}
- >
- {field.isPrimary ? (
- <>
- <span className={'mr-2 text-text-caption'}>{t('grid.calculationTypeLabel.count')}</span>
- <span>{count}</span>
- </>
- ) : null}
- </div>
- );
-}
-
-export default GridCalculate;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_calculate/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_calculate/index.ts
deleted file mode 100644
index 2bd3b71b1e..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_calculate/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './GridCalculate';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_cell/GridCell.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_cell/GridCell.tsx
deleted file mode 100644
index 042ba1777d..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_cell/GridCell.tsx
+++ /dev/null
@@ -1,66 +0,0 @@
-import React, { CSSProperties, memo } from 'react';
-import { GridColumn, RenderRow, RenderRowType } from '../constants';
-import GridNewRow from '$app/components/database/grid/grid_new_row/GridNewRow';
-import { GridCalculate } from '$app/components/database/grid/grid_calculate';
-import { areEqual } from 'react-window';
-import { Cell } from '$app/components/database/components';
-import { PrimaryCell } from '$app/components/database/grid/grid_cell';
-
-const getRenderRowKey = (row: RenderRow) => {
- if (row.type === RenderRowType.Row) {
- return `row:${row.data.meta.id}`;
- }
-
- return row.type;
-};
-
-interface GridCellProps {
- row: RenderRow;
- column: GridColumn;
- columnIndex: number;
- style: CSSProperties;
- onEditRecord?: (rowId: string) => void;
- getContainerRef?: () => React.RefObject<HTMLDivElement>;
-}
-
-export const GridCell = memo(({ row, column, columnIndex, style, onEditRecord, getContainerRef }: GridCellProps) => {
- const key = getRenderRowKey(row);
-
- const field = column.field;
-
- if (!field) return <div data-key={key} style={style} />;
-
- switch (row.type) {
- case RenderRowType.Row: {
- const { id: rowId, icon: rowIcon } = row.data.meta;
- const renderRowCell = <Cell rowId={rowId} icon={rowIcon} field={field} />;
-
- return (
- <div data-key={key} style={style} className={'grid-cell flex border-b border-r border-line-divider'}>
- {field.isPrimary ? (
- <PrimaryCell icon={rowIcon} onEditRecord={onEditRecord} getContainerRef={getContainerRef} rowId={rowId}>
- {renderRowCell}
- </PrimaryCell>
- ) : (
- renderRowCell
- )}
- </div>
- );
- }
-
- case RenderRowType.NewRow:
- return (
- <div style={style} className={'flex border-b border-line-divider'}>
- <GridNewRow getContainerRef={getContainerRef} index={columnIndex} groupId={row.data.groupId} />
- </div>
- );
- case RenderRowType.CalculateRow:
- return (
- <div className={'flex'} style={style}>
- <GridCalculate getContainerRef={getContainerRef} field={field} index={columnIndex} />
- </div>
- );
- default:
- return null;
- }
-}, areEqual);
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_cell/PrimaryCell.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_cell/PrimaryCell.tsx
deleted file mode 100644
index b9a734de7b..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_cell/PrimaryCell.tsx
+++ /dev/null
@@ -1,51 +0,0 @@
-import React, { Suspense, useMemo, useRef } from 'react';
-import { ReactComponent as OpenIcon } from '$app/assets/open.svg';
-import { IconButton } from '@mui/material';
-
-import { useGridTableHoverState } from '$app/components/database/grid/grid_row_actions';
-
-export function PrimaryCell({
- onEditRecord,
- icon,
- getContainerRef,
- rowId,
- children,
-}: {
- rowId: string;
- icon?: string;
- onEditRecord?: (rowId: string) => void;
- getContainerRef?: () => React.RefObject<HTMLDivElement>;
- children?: React.ReactNode;
-}) {
- const cellRef = useRef<HTMLDivElement>(null);
-
- const containerRef = getContainerRef?.();
- const { hoverRowId } = useGridTableHoverState(containerRef);
-
- const showExpandIcon = useMemo(() => {
- return hoverRowId === rowId;
- }, [hoverRowId, rowId]);
-
- return (
- <div ref={cellRef} className={'relative flex w-full items-center'}>
- {icon && <div className={'ml-2 mr-1'}>{icon}</div>}
- {children}
- <Suspense>
- {showExpandIcon && (
- <div
- style={{
- transform: 'translateY(-50%) translateZ(0)',
- }}
- className={`absolute right-0 top-1/2 z-10 mr-4 flex items-center justify-center`}
- >
- <IconButton onClick={() => onEditRecord?.(rowId)} className={'h-6 w-6 text-sm'}>
- <OpenIcon />
- </IconButton>
- </div>
- )}
- </Suspense>
- </div>
- );
-}
-
-export default PrimaryCell;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_cell/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_cell/index.ts
deleted file mode 100644
index 949d5054bf..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_cell/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export * from './GridCell';
-export * from './PrimaryCell';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_field/GridField.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_field/GridField.tsx
deleted file mode 100644
index 3c3921abf7..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_field/GridField.tsx
+++ /dev/null
@@ -1,179 +0,0 @@
-import { Button } from '@mui/material';
-import { DragEventHandler, FC, HTMLAttributes, memo, useCallback, useEffect, useMemo, useState } from 'react';
-import { useViewId } from '$app/hooks';
-import { DragItem, DropPosition, DragType, useDraggable, useDroppable, ScrollDirection } from '../../_shared';
-import { fieldService, Field } from '$app/application/database';
-import { Property } from '$app/components/database/components/property';
-import { GridResizer, GridFieldMenu } from '$app/components/database/grid/grid_field';
-import { areEqual } from 'react-window';
-import { useOpenMenu } from '$app/components/database/grid/grid_sticky_header/GridStickyHeader.hooks';
-import throttle from 'lodash-es/throttle';
-
-export interface GridFieldProps extends HTMLAttributes<HTMLDivElement> {
- field: Field;
- onOpenMenu?: (id: string) => void;
- onCloseMenu?: (id: string) => void;
- resizeColumnWidth?: (width: number) => void;
- getScrollElement?: () => HTMLElement | null;
-}
-
-export const GridField: FC<GridFieldProps> = memo(
- ({ getScrollElement, resizeColumnWidth, onOpenMenu, onCloseMenu, field, ...props }) => {
- const menuOpened = useOpenMenu(field.id);
- const viewId = useViewId();
- const [propertyMenuOpened, setPropertyMenuOpened] = useState(false);
- const [dropPosition, setDropPosition] = useState<DropPosition>(DropPosition.Before);
-
- const draggingData = useMemo(
- () => ({
- field,
- }),
- [field]
- );
-
- const { isDragging, attributes, listeners, setPreviewRef, previewRef } = useDraggable({
- type: DragType.Field,
- data: draggingData,
- scrollOnEdge: {
- direction: ScrollDirection.Horizontal,
- getScrollElement,
- edgeGap: 80,
- },
- });
-
- const onDragOver = useMemo<DragEventHandler>(() => {
- return throttle((event) => {
- const element = previewRef.current;
-
- if (!element) {
- return;
- }
-
- const { left, right } = element.getBoundingClientRect();
- const middle = (left + right) / 2;
-
- setDropPosition(event.clientX < middle ? DropPosition.Before : DropPosition.After);
- }, 20);
- }, [previewRef]);
-
- const onDrop = useCallback(
- ({ data }: DragItem) => {
- const dragField = data.field as Field;
-
- if (dragField.id === field.id) {
- return;
- }
-
- void fieldService.moveField(viewId, dragField.id, field.id);
- },
- [viewId, field]
- );
-
- const { isOver, listeners: dropListeners } = useDroppable({
- accept: DragType.Field,
- disabled: isDragging,
- onDragOver,
- onDrop,
- });
-
- const [menuAnchorPosition, setMenuAnchorPosition] = useState<
- | {
- top: number;
- left: number;
- }
- | undefined
- >(undefined);
-
- const open = Boolean(menuAnchorPosition) && menuOpened;
-
- const handleClick = useCallback(() => {
- onOpenMenu?.(field.id);
- }, [onOpenMenu, field.id]);
-
- const handleMenuClose = useCallback(() => {
- onCloseMenu?.(field.id);
- }, [onCloseMenu, field.id]);
-
- useEffect(() => {
- if (!menuOpened) {
- setMenuAnchorPosition(undefined);
- return;
- }
-
- const anchorElement = previewRef.current;
-
- if (!anchorElement) {
- setMenuAnchorPosition(undefined);
- return;
- }
-
- anchorElement.scrollIntoView({ block: 'nearest' });
-
- const rect = anchorElement.getBoundingClientRect();
-
- setMenuAnchorPosition({
- top: rect.top + rect.height,
- left: rect.left,
- });
- }, [menuOpened, previewRef]);
-
- const handlePropertyMenuOpen = useCallback(() => {
- setPropertyMenuOpened(true);
- }, []);
-
- const handlePropertyMenuClose = useCallback(() => {
- setPropertyMenuOpened(false);
- }, []);
-
- return (
- <div className={'flex w-full border-r border-line-divider bg-bg-body'} {...props}>
- <Button
- color={'inherit'}
- ref={setPreviewRef}
- className='relative flex h-full w-full items-center rounded-none px-0'
- disableRipple
- onContextMenu={(event) => {
- if (propertyMenuOpened || menuOpened || open) {
- return;
- }
-
- event.stopPropagation();
- event.preventDefault();
- handleClick();
- }}
- onClick={handleClick}
- {...attributes}
- {...listeners}
- {...dropListeners}
- >
- <Property
- menuOpened={propertyMenuOpened}
- onCloseMenu={handlePropertyMenuClose}
- onOpenMenu={handlePropertyMenuOpen}
- field={field}
- />
- {isOver && (
- <div
- className={`absolute bottom-0 top-0 z-10 w-0.5 bg-blue-500 ${
- dropPosition === DropPosition.Before ? 'left-[-1px]' : 'left-full'
- }`}
- />
- )}
- <GridResizer field={field} onWidthChange={resizeColumnWidth} />
- </Button>
- {open && (
- <GridFieldMenu
- anchorPosition={menuAnchorPosition}
- anchorReference={'anchorPosition'}
- field={field}
- open={open}
- onClose={handleMenuClose}
- onOpenPropertyMenu={handlePropertyMenuOpen}
- onOpenMenu={onOpenMenu}
- />
- )}
- </div>
- );
- },
- areEqual
-);
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_field/GridFieldMenu.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_field/GridFieldMenu.tsx
deleted file mode 100644
index 1407fe30c2..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_field/GridFieldMenu.tsx
+++ /dev/null
@@ -1,59 +0,0 @@
-import React, { useRef } from 'react';
-import Popover, { PopoverProps } from '@mui/material/Popover';
-import { Field } from '$app/application/database';
-import PropertyNameInput from '$app/components/database/components/property/PropertyNameInput';
-import { MenuList } from '@mui/material';
-import PropertyActions, { FieldAction } from '$app/components/database/components/property/PropertyActions';
-
-interface Props extends PopoverProps {
- field: Field;
- onOpenPropertyMenu?: () => void;
- onOpenMenu?: (fieldId: string) => void;
-}
-
-export function GridFieldMenu({ field, onOpenPropertyMenu, onOpenMenu, onClose, ...props }: Props) {
- const inputRef = useRef<HTMLInputElement>(null);
-
- return (
- <Popover
- disableRestoreFocus={true}
- transformOrigin={{
- vertical: 'top',
- horizontal: 'left',
- }}
- onClick={(e) => e.stopPropagation()}
- {...props}
- onClose={onClose}
- keepMounted={false}
- onMouseDown={(e) => {
- const isInput = inputRef.current?.contains(e.target as Node);
-
- if (isInput) return;
-
- e.stopPropagation();
- e.preventDefault();
- }}
- >
- <PropertyNameInput ref={inputRef} id={field.id} name={field.name} />
- <MenuList>
- <PropertyActions
- inputRef={inputRef}
- isPrimary={field.isPrimary}
- onClose={() => onClose?.({}, 'backdropClick')}
- onMenuItemClick={(action, newFieldId?: string) => {
- if (action === FieldAction.EditProperty) {
- onOpenPropertyMenu?.();
- } else if (newFieldId && (action === FieldAction.InsertLeft || action === FieldAction.InsertRight)) {
- onOpenMenu?.(newFieldId);
- }
-
- onClose?.({}, 'backdropClick');
- }}
- fieldId={field.id}
- />
- </MenuList>
- </Popover>
- );
-}
-
-export default GridFieldMenu;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_field/GridNewField.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_field/GridNewField.tsx
deleted file mode 100644
index d0b739298a..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_field/GridNewField.tsx
+++ /dev/null
@@ -1,35 +0,0 @@
-import React, { useCallback } from 'react';
-import { useViewId } from '$app/hooks';
-import { useTranslation } from 'react-i18next';
-import { fieldService } from '$app/application/database';
-import { FieldType } from '@/services/backend';
-import Button from '@mui/material/Button';
-import { ReactComponent as AddSvg } from '$app/assets/add.svg';
-
-export function GridNewField({ onInserted }: { onInserted?: (id: string) => void }) {
- const viewId = useViewId();
- const { t } = useTranslation();
-
- const handleClick = useCallback(async () => {
- try {
- const field = await fieldService.createField({
- viewId,
- fieldType: FieldType.RichText,
- });
-
- onInserted?.(field.id);
- } catch (e) {
- // toast.error(t('grid.field.newPropertyFail'));
- }
- }, [onInserted, viewId]);
-
- return (
- <>
- <Button onClick={handleClick} className={'h-full w-full justify-start'} startIcon={<AddSvg />} color={'inherit'}>
- {t('grid.field.newProperty')}
- </Button>
- </>
- );
-}
-
-export default GridNewField;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_field/GridResizer.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_field/GridResizer.tsx
deleted file mode 100644
index 12aef74996..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_field/GridResizer.tsx
+++ /dev/null
@@ -1,84 +0,0 @@
-import React, { useCallback, useRef, useState } from 'react';
-import { Field, fieldService } from '$app/application/database';
-import { useViewId } from '$app/hooks';
-
-interface GridResizerProps {
- field: Field;
- onWidthChange?: (width: number) => void;
-}
-
-const minWidth = 150;
-
-export function GridResizer({ field, onWidthChange }: GridResizerProps) {
- const viewId = useViewId();
- const fieldId = field.id;
- const width = field.width || 0;
- const [isResizing, setIsResizing] = useState(false);
- const [hover, setHover] = useState(false);
- const startX = useRef(0);
- const newWidthRef = useRef(width);
- const onResize = useCallback(
- (e: MouseEvent) => {
- const diff = e.clientX - startX.current;
- const newWidth = width + diff;
-
- if (newWidth < minWidth) {
- return;
- }
-
- newWidthRef.current = newWidth;
- onWidthChange?.(newWidth);
- },
- [width, onWidthChange]
- );
-
- const onResizeEnd = useCallback(() => {
- setIsResizing(false);
-
- void fieldService.updateFieldSetting(viewId, fieldId, {
- width: newWidthRef.current,
- });
- document.removeEventListener('mousemove', onResize);
- document.removeEventListener('mouseup', onResizeEnd);
- }, [fieldId, onResize, viewId]);
-
- const onResizeStart = useCallback(
- (e: React.MouseEvent) => {
- e.stopPropagation();
- e.preventDefault();
- startX.current = e.clientX;
- setIsResizing(true);
- document.addEventListener('mousemove', onResize);
- document.addEventListener('mouseup', onResizeEnd);
- },
- [onResize, onResizeEnd]
- );
-
- return (
- <div
- onMouseDown={onResizeStart}
- onClick={(e) => {
- e.stopPropagation();
- }}
- onMouseEnter={() => {
- setHover(true);
- }}
- onMouseLeave={() => {
- setHover(false);
- }}
- style={{
- right: `-3px`,
- }}
- className={'absolute top-0 z-10 h-full cursor-col-resize'}
- >
- <div
- className={'h-full w-[6px] select-none bg-transparent'}
- style={{
- backgroundColor: hover || isResizing ? 'var(--content-on-fill-hover)' : 'transparent',
- }}
- ></div>
- </div>
- );
-}
-
-export default GridResizer;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_field/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_field/index.ts
deleted file mode 100644
index 384ee2af3b..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_field/index.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-export * from './GridField';
-export * from './GridFieldMenu';
-export * from './GridNewField';
-export * from './GridResizer';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_new_row/GridNewRow.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_new_row/GridNewRow.tsx
deleted file mode 100644
index 4dc70e21dc..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_new_row/GridNewRow.tsx
+++ /dev/null
@@ -1,68 +0,0 @@
-import React, { useCallback } from 'react';
-import { rowService } from '$app/application/database';
-import { useViewId } from '$app/hooks';
-import { ReactComponent as AddSvg } from '$app/assets/add.svg';
-import { useTranslation } from 'react-i18next';
-
-interface Props {
- index: number;
- groupId?: string;
- getContainerRef?: () => React.RefObject<HTMLDivElement>;
-}
-
-const CSS_HIGHLIGHT_PROPERTY = 'bg-content-blue-50';
-
-function GridNewRow({ index, groupId, getContainerRef }: Props) {
- const viewId = useViewId();
-
- const { t } = useTranslation();
- const handleClick = useCallback(() => {
- void rowService.createRow(viewId, {
- groupId,
- });
- }, [viewId, groupId]);
-
- const toggleCssProperty = useCallback(
- (status: boolean) => {
- const container = getContainerRef?.()?.current;
-
- if (!container) return;
-
- const newRowCells = container.querySelectorAll('.grid-new-row');
-
- newRowCells.forEach((cell) => {
- if (status) {
- cell.classList.add(CSS_HIGHLIGHT_PROPERTY);
- } else {
- cell.classList.remove(CSS_HIGHLIGHT_PROPERTY);
- }
- });
- },
- [getContainerRef]
- );
-
- return (
- <div
- onMouseEnter={() => {
- toggleCssProperty(true);
- }}
- onMouseLeave={() => {
- toggleCssProperty(false);
- }}
- onClick={handleClick}
- className={'grid-new-row flex grow cursor-pointer text-text-title'}
- >
- <span
- style={{
- visibility: index === 1 ? 'visible' : 'hidden',
- }}
- className='sticky left-2 inline-flex items-center'
- >
- <AddSvg className='mr-1 text-base' />
- {t('grid.row.newRow')}
- </span>
- </div>
- );
-}
-
-export default GridNewRow;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_overlay/GridTableOverlay.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_overlay/GridTableOverlay.tsx
deleted file mode 100644
index 07ece5dec2..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_overlay/GridTableOverlay.tsx
+++ /dev/null
@@ -1,75 +0,0 @@
-import React, { useCallback, useEffect, useState } from 'react';
-import {
- GridRowContextMenu,
- GridRowActions,
- useGridTableHoverState,
-} from '$app/components/database/grid/grid_row_actions';
-import DeleteConfirmDialog from '$app/components/_shared/confirm_dialog/DeleteConfirmDialog';
-import { useTranslation } from 'react-i18next';
-
-function GridTableOverlay({
- containerRef,
- getScrollElement,
-}: {
- containerRef: React.MutableRefObject<HTMLDivElement | null>;
- getScrollElement: () => HTMLDivElement | null;
-}) {
- const [hoverRowTop, setHoverRowTop] = useState<string | undefined>();
-
- const { t } = useTranslation();
- const [openConfirm, setOpenConfirm] = useState(false);
- const [confirmModalProps, setConfirmModalProps] = useState<
- | {
- onOk: () => Promise<void>;
- onCancel: () => void;
- }
- | undefined
- >(undefined);
-
- const { hoverRowId } = useGridTableHoverState(containerRef);
-
- const handleOpenConfirm = useCallback((onOk: () => Promise<void>, onCancel: () => void) => {
- setOpenConfirm(true);
- setConfirmModalProps({ onOk, onCancel });
- }, []);
-
- useEffect(() => {
- const container = containerRef.current;
-
- if (!container) return;
-
- const cell = container.querySelector(`[data-key="row:${hoverRowId}"]`);
-
- if (!cell) return;
- const top = (cell as HTMLDivElement).style.top;
-
- setHoverRowTop(top);
- }, [containerRef, hoverRowId]);
-
- return (
- <div className={'absolute left-0 top-0'}>
- <GridRowActions
- onOpenConfirm={handleOpenConfirm}
- getScrollElement={getScrollElement}
- containerRef={containerRef}
- rowId={hoverRowId}
- rowTop={hoverRowTop}
- />
- <GridRowContextMenu onOpenConfirm={handleOpenConfirm} containerRef={containerRef} hoverRowId={hoverRowId} />
- {openConfirm && (
- <DeleteConfirmDialog
- open={openConfirm}
- title={t('grid.sort.removeSorting')}
- okText={t('button.remove')}
- cancelText={t('button.dontRemove')}
- onClose={() => {
- setOpenConfirm(false);
- }}
- {...confirmModalProps}
- />
- )}
- </div>
- );
-}
-
-export default GridTableOverlay;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_row_actions/GridRowActions.hooks.ts b/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_row_actions/GridRowActions.hooks.ts
deleted file mode 100644
index a4251c9ed5..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_row_actions/GridRowActions.hooks.ts
+++ /dev/null
@@ -1,244 +0,0 @@
-import React, { useCallback, useEffect, useRef, useState } from 'react';
-import { useViewId } from '$app/hooks';
-import { rowService } from '$app/application/database';
-import { autoScrollOnEdge, ScrollDirection } from '$app/components/database/_shared/dnd/utils';
-import { useSortsCount } from '$app/components/database';
-import { deleteAllSorts } from '$app/application/database/sort/sort_service';
-
-export function getCellsWithRowId(rowId: string, container: HTMLDivElement) {
- return Array.from(container.querySelectorAll(`[data-key^="row:${rowId}"]`));
-}
-
-const SELECTED_ROW_CSS_PROPERTY = 'bg-content-blue-50';
-
-export function toggleProperty(
- container: HTMLDivElement,
- rowId: string,
- status: boolean,
- property = SELECTED_ROW_CSS_PROPERTY
-) {
- const rowColumns = getCellsWithRowId(rowId, container);
-
- rowColumns.forEach((column, index) => {
- if (index === 0) return;
- if (status) {
- column.classList.add(property);
- } else {
- column.classList.remove(property);
- }
- });
-}
-
-function createVirtualDragElement(rowId: string, container: HTMLDivElement) {
- const cells = getCellsWithRowId(rowId, container);
-
- const cell = cells[0] as HTMLDivElement;
-
- if (!cell) return null;
-
- const row = document.createElement('div');
-
- row.style.display = 'flex';
- row.style.position = 'absolute';
- row.style.top = cell.style.top;
- const left = Number(cell.style.left.split('px')[0]) + 64;
-
- row.style.left = `${left}px`;
- row.style.background = 'var(--content-blue-50)';
- cells.forEach((cell) => {
- const node = cell.cloneNode(true) as HTMLDivElement;
-
- if (!node.classList.contains('grid-cell')) return;
-
- node.style.top = '';
- node.style.position = '';
- node.style.left = '';
- node.style.width = (cell as HTMLDivElement).style.width;
- node.style.height = (cell as HTMLDivElement).style.height;
- node.className = 'flex items-center border-r border-b border-divider-line opacity-50';
- row.appendChild(node);
- });
-
- cell.parentElement?.appendChild(row);
- return row;
-}
-
-export function useDraggableGridRow(
- rowId: string,
- containerRef: React.RefObject<HTMLDivElement>,
- getScrollElement: () => HTMLDivElement | null,
- onOpenConfirm: (onOk: () => Promise<void>, onCancel: () => void) => void
-) {
- const viewId = useViewId();
- const sortsCount = useSortsCount();
-
- const [isDragging, setIsDragging] = useState(false);
- const dropRowIdRef = useRef<string | undefined>(undefined);
- const previewRef = useRef<HTMLDivElement | undefined>();
-
- const onDragStart = useCallback(
- (e: React.DragEvent<HTMLButtonElement>) => {
- e.dataTransfer.effectAllowed = 'move';
- e.dataTransfer.dropEffect = 'move';
- const container = containerRef.current;
-
- if (container) {
- const row = createVirtualDragElement(rowId, container);
-
- if (row) {
- previewRef.current = row;
- e.dataTransfer.setDragImage(row, 0, 0);
- }
- }
-
- const scrollParent = getScrollElement();
-
- if (scrollParent) {
- autoScrollOnEdge({
- element: scrollParent,
- direction: ScrollDirection.Vertical,
- edgeGap: 20,
- });
- }
-
- setIsDragging(true);
- },
- [containerRef, rowId, getScrollElement]
- );
-
- const moveRowTo = useCallback(
- async (toRowId: string) => {
- return rowService.moveRow(viewId, rowId, toRowId);
- },
- [viewId, rowId]
- );
-
- useEffect(() => {
- if (!isDragging) {
- if (previewRef.current) {
- const row = previewRef.current;
-
- previewRef.current = undefined;
- row?.remove();
- }
-
- return;
- }
-
- const container = containerRef.current;
-
- if (!container) {
- return;
- }
-
- const onDragOver = (e: DragEvent) => {
- e.preventDefault();
- const target = e.target as HTMLElement;
- const cell = target.closest('[data-key]');
- const rowId = cell?.getAttribute('data-key')?.split(':')[1];
-
- const oldRowId = dropRowIdRef.current;
-
- if (oldRowId) {
- toggleProperty(container, oldRowId, false);
- }
-
- if (!rowId) return;
-
- const rowColumns = getCellsWithRowId(rowId, container);
-
- dropRowIdRef.current = rowId;
- if (!rowColumns.length) return;
-
- toggleProperty(container, rowId, true);
- };
-
- const onDragEnd = () => {
- const oldRowId = dropRowIdRef.current;
-
- if (oldRowId) {
- toggleProperty(container, oldRowId, false);
- }
-
- dropRowIdRef.current = undefined;
- setIsDragging(false);
- };
-
- const onDrop = async (e: DragEvent) => {
- e.preventDefault();
- e.stopPropagation();
- const dropRowId = dropRowIdRef.current;
-
- toggleProperty(container, rowId, false);
- if (dropRowId) {
- if (sortsCount > 0) {
- onOpenConfirm(
- async () => {
- await deleteAllSorts(viewId);
- await moveRowTo(dropRowId);
- },
- () => {
- void moveRowTo(dropRowId);
- }
- );
- } else {
- void moveRowTo(dropRowId);
- }
-
- toggleProperty(container, dropRowId, false);
- }
-
- setIsDragging(false);
- container.removeEventListener('dragover', onDragOver);
- container.removeEventListener('dragend', onDragEnd);
- container.removeEventListener('drop', onDrop);
- };
-
- container.addEventListener('dragover', onDragOver);
- container.addEventListener('dragend', onDragEnd);
- container.addEventListener('drop', onDrop);
- }, [isDragging, containerRef, moveRowTo, onOpenConfirm, rowId, sortsCount, viewId]);
-
- return {
- isDragging,
- onDragStart,
- };
-}
-
-export function useGridTableHoverState(containerRef?: React.RefObject<HTMLDivElement>) {
- const [hoverRowId, setHoverRowId] = useState<string | undefined>(undefined);
-
- useEffect(() => {
- const container = containerRef?.current;
-
- if (!container) return;
- const onMouseMove = (e: MouseEvent) => {
- const target = e.target as HTMLElement;
- const cell = target.closest('[data-key]');
-
- if (!cell) {
- return;
- }
-
- const hoverRowId = cell.getAttribute('data-key')?.split(':')[1];
-
- setHoverRowId(hoverRowId);
- };
-
- const onMouseLeave = () => {
- setHoverRowId(undefined);
- };
-
- container.addEventListener('mousemove', onMouseMove);
- container.addEventListener('mouseleave', onMouseLeave);
-
- return () => {
- container.removeEventListener('mousemove', onMouseMove);
- container.removeEventListener('mouseleave', onMouseLeave);
- };
- }, [containerRef]);
-
- return {
- hoverRowId,
- };
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_row_actions/GridRowActions.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_row_actions/GridRowActions.tsx
deleted file mode 100644
index f4b39e2561..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_row_actions/GridRowActions.tsx
+++ /dev/null
@@ -1,135 +0,0 @@
-import React, { useCallback, useState } from 'react';
-import { IconButton, Tooltip } from '@mui/material';
-import { ReactComponent as AddSvg } from '$app/assets/add.svg';
-import { GRID_ACTIONS_WIDTH } from '$app/components/database/grid/constants';
-import { rowService } from '$app/application/database';
-import { useViewId } from '$app/hooks';
-import { GridRowDragButton, GridRowMenu, toggleProperty } from '$app/components/database/grid/grid_row_actions';
-import { OrderObjectPositionTypePB } from '@/services/backend';
-import { useSortsCount } from '$app/components/database';
-import { useTranslation } from 'react-i18next';
-import { deleteAllSorts } from '$app/application/database/sort/sort_service';
-
-export function GridRowActions({
- rowId,
- rowTop,
- containerRef,
- getScrollElement,
- onOpenConfirm,
-}: {
- onOpenConfirm: (onOk: () => Promise<void>, onCancel: () => void) => void;
- rowId?: string;
- rowTop?: string;
- containerRef: React.MutableRefObject<HTMLDivElement | null>;
- getScrollElement: () => HTMLDivElement | null;
-}) {
- const { t } = useTranslation();
- const viewId = useViewId();
- const sortsCount = useSortsCount();
- const [menuRowId, setMenuRowId] = useState<string | undefined>(undefined);
- const [menuPosition, setMenuPosition] = useState<
- | {
- top: number;
- left: number;
- }
- | undefined
- >(undefined);
-
- const openMenu = Boolean(menuPosition);
-
- const handleCloseMenu = useCallback(() => {
- setMenuPosition(undefined);
- if (containerRef.current && menuRowId) {
- toggleProperty(containerRef.current, menuRowId, false);
- }
- }, [containerRef, menuRowId]);
-
- const handleInsertRecordBelow = useCallback(
- async (rowId: string) => {
- await rowService.createRow(viewId, {
- position: OrderObjectPositionTypePB.After,
- rowId: rowId,
- });
- handleCloseMenu();
- },
- [viewId, handleCloseMenu]
- );
-
- const handleOpenMenu = (e: React.MouseEvent) => {
- const target = e.target as HTMLButtonElement;
- const rect = target.getBoundingClientRect();
-
- if (containerRef.current && rowId) {
- toggleProperty(containerRef.current, rowId, true);
- }
-
- setMenuRowId(rowId);
- setMenuPosition({
- top: rect.top + rect.height / 2,
- left: rect.left + rect.width,
- });
- };
-
- return (
- <>
- {rowId && rowTop && (
- <div
- style={{
- position: 'absolute',
- top: rowTop,
- left: GRID_ACTIONS_WIDTH,
- transform: 'translateY(4px)',
- }}
- className={'z-10 flex w-full items-center justify-end py-[3px]'}
- >
- <Tooltip placement='top' disableInteractive={true} title={t('grid.row.add')}>
- <IconButton
- size={'small'}
- className={'h-5 w-5'}
- onClick={() => {
- if (sortsCount > 0) {
- onOpenConfirm(
- async () => {
- await deleteAllSorts(viewId);
- void handleInsertRecordBelow(rowId);
- },
- () => {
- void handleInsertRecordBelow(rowId);
- }
- );
- } else {
- void handleInsertRecordBelow(rowId);
- }
- }}
- >
- <AddSvg />
- </IconButton>
- </Tooltip>
- <GridRowDragButton
- getScrollElement={getScrollElement}
- rowId={rowId}
- containerRef={containerRef}
- onClick={handleOpenMenu}
- onOpenConfirm={onOpenConfirm}
- />
- </div>
- )}
- {menuRowId && (
- <GridRowMenu
- open={openMenu}
- onOpenConfirm={onOpenConfirm}
- onClose={handleCloseMenu}
- transformOrigin={{
- vertical: 'center',
- horizontal: 'left',
- }}
- rowId={menuRowId}
- anchorReference={'anchorPosition'}
- anchorPosition={menuPosition}
- />
- )}
- </>
- );
-}
-
-export default GridRowActions;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_row_actions/GridRowContextMenu.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_row_actions/GridRowContextMenu.tsx
deleted file mode 100644
index a93188ddc4..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_row_actions/GridRowContextMenu.tsx
+++ /dev/null
@@ -1,72 +0,0 @@
-import React, { useCallback, useEffect, useMemo, useState } from 'react';
-import GridRowMenu from './GridRowMenu';
-import { toggleProperty } from './GridRowActions.hooks';
-
-export function GridRowContextMenu({
- containerRef,
- hoverRowId,
- onOpenConfirm,
-}: {
- hoverRowId?: string;
- onOpenConfirm: (onOk: () => Promise<void>, onCancel: () => void) => void;
- containerRef: React.MutableRefObject<HTMLDivElement | null>;
-}) {
- const [position, setPosition] = useState<{ left: number; top: number } | undefined>();
-
- const [rowId, setRowId] = useState<string | undefined>();
-
- const isContextMenuOpen = useMemo(() => {
- return !!position;
- }, [position]);
-
- const closeContextMenu = useCallback(() => {
- setPosition(undefined);
- const container = containerRef.current;
-
- if (!container || !rowId) return;
- toggleProperty(container, rowId, false);
- // setRowId(undefined);
- }, [rowId, containerRef]);
-
- const openContextMenu = useCallback(
- (event: MouseEvent) => {
- event.preventDefault();
- event.stopPropagation();
- const container = containerRef.current;
-
- if (!container || !hoverRowId) return;
- toggleProperty(container, hoverRowId, true);
- setRowId(hoverRowId);
- setPosition({
- left: event.clientX,
- top: event.clientY,
- });
- },
- [containerRef, hoverRowId]
- );
-
- useEffect(() => {
- const container = containerRef.current;
-
- if (!container) {
- return;
- }
-
- container.addEventListener('contextmenu', openContextMenu);
- return () => {
- container.removeEventListener('contextmenu', openContextMenu);
- };
- }, [containerRef, openContextMenu]);
-
- return rowId ? (
- <GridRowMenu
- onOpenConfirm={onOpenConfirm}
- open={isContextMenuOpen}
- onClose={closeContextMenu}
- anchorPosition={position}
- rowId={rowId}
- />
- ) : null;
-}
-
-export default GridRowContextMenu;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_row_actions/GridRowDragButton.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_row_actions/GridRowDragButton.tsx
deleted file mode 100644
index 0790e48183..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_row_actions/GridRowDragButton.tsx
+++ /dev/null
@@ -1,59 +0,0 @@
-import React, { useEffect, useState } from 'react';
-import { useDraggableGridRow } from './GridRowActions.hooks';
-import { IconButton, Tooltip } from '@mui/material';
-import { ReactComponent as DragSvg } from '$app/assets/drag.svg';
-import { useTranslation } from 'react-i18next';
-
-export function GridRowDragButton({
- rowId,
- containerRef,
- onClick,
- getScrollElement,
- onOpenConfirm,
-}: {
- onOpenConfirm: (onOk: () => Promise<void>, onCancel: () => void) => void;
- rowId: string;
- onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
- containerRef: React.MutableRefObject<HTMLDivElement | null>;
- getScrollElement: () => HTMLDivElement | null;
-}) {
- const { t } = useTranslation();
-
- const [openTooltip, setOpenTooltip] = useState(false);
- const { onDragStart, isDragging } = useDraggableGridRow(rowId, containerRef, getScrollElement, onOpenConfirm);
-
- useEffect(() => {
- if (isDragging) {
- setOpenTooltip(false);
- }
- }, [isDragging]);
-
- return (
- <>
- <Tooltip
- open={openTooltip}
- onOpen={() => {
- setOpenTooltip(true);
- }}
- onClose={() => {
- setOpenTooltip(false);
- }}
- placement='top'
- disableInteractive={true}
- title={t('grid.row.dragAndClick')}
- >
- <IconButton
- size={'small'}
- onClick={onClick}
- draggable={true}
- onDragStart={onDragStart}
- className='mx-1 h-5 w-5 cursor-grab active:cursor-grabbing'
- >
- <DragSvg className='-mx-1' />
- </IconButton>
- </Tooltip>
- </>
- );
-}
-
-export default GridRowDragButton;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_row_actions/GridRowMenu.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_row_actions/GridRowMenu.tsx
deleted file mode 100644
index 2190e8739b..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_row_actions/GridRowMenu.tsx
+++ /dev/null
@@ -1,160 +0,0 @@
-import React, { useCallback, useMemo } from 'react';
-import { ReactComponent as UpSvg } from '$app/assets/up.svg';
-import { ReactComponent as AddSvg } from '$app/assets/add.svg';
-import { ReactComponent as DelSvg } from '$app/assets/delete.svg';
-import { ReactComponent as CopySvg } from '$app/assets/copy.svg';
-import Popover, { PopoverProps } from '@mui/material/Popover';
-import { useViewId } from '$app/hooks';
-import { useTranslation } from 'react-i18next';
-import { rowService } from '$app/application/database';
-import { OrderObjectPositionTypePB } from '@/services/backend';
-import KeyboardNavigation, {
- KeyboardNavigationOption,
-} from '$app/components/_shared/keyboard_navigation/KeyboardNavigation';
-import { useSortsCount } from '$app/components/database';
-import { deleteAllSorts } from '$app/application/database/sort/sort_service';
-
-enum RowAction {
- InsertAbove,
- InsertBelow,
- Duplicate,
- Delete,
-}
-interface Props extends PopoverProps {
- rowId: string;
- onOpenConfirm?: (onOk: () => Promise<void>, onCancel: () => void) => void;
-}
-
-export function GridRowMenu({ onOpenConfirm, rowId, onClose, ...props }: Props) {
- const viewId = useViewId();
- const sortsCount = useSortsCount();
-
- const { t } = useTranslation();
-
- const handleInsertRecordBelow = useCallback(() => {
- void rowService.createRow(viewId, {
- position: OrderObjectPositionTypePB.After,
- rowId: rowId,
- });
- }, [viewId, rowId]);
-
- const handleInsertRecordAbove = useCallback(() => {
- void rowService.createRow(viewId, {
- position: OrderObjectPositionTypePB.Before,
- rowId: rowId,
- });
- }, [rowId, viewId]);
-
- const handleDelRow = useCallback(() => {
- void rowService.deleteRow(viewId, rowId);
- }, [viewId, rowId]);
-
- const handleDuplicateRow = useCallback(() => {
- void rowService.duplicateRow(viewId, rowId);
- }, [viewId, rowId]);
-
- const renderContent = useCallback((title: string, Icon: React.FC<React.SVGProps<SVGSVGElement>>) => {
- return (
- <div className={'flex w-full items-center gap-1 px-1'}>
- <Icon className={'h-4 w-4'} />
- <div className={'flex-1'}>{title}</div>
- </div>
- );
- }, []);
-
- const handleAction = useCallback(
- (confirmKey?: RowAction) => {
- switch (confirmKey) {
- case RowAction.InsertAbove:
- handleInsertRecordAbove();
- break;
- case RowAction.InsertBelow:
- handleInsertRecordBelow();
- break;
- case RowAction.Duplicate:
- handleDuplicateRow();
- break;
- case RowAction.Delete:
- handleDelRow();
- break;
- default:
- break;
- }
- },
- [handleDelRow, handleDuplicateRow, handleInsertRecordAbove, handleInsertRecordBelow]
- );
-
- const onConfirm = useCallback(
- (key: RowAction) => {
- if (sortsCount > 0) {
- onOpenConfirm?.(
- async () => {
- await deleteAllSorts(viewId);
- handleAction(key);
- },
- () => {
- handleAction(key);
- }
- );
- } else {
- handleAction(key);
- }
-
- onClose?.({}, 'backdropClick');
- },
- [handleAction, onClose, onOpenConfirm, sortsCount, viewId]
- );
-
- const options: KeyboardNavigationOption<RowAction>[] = useMemo(
- () => [
- {
- key: RowAction.InsertAbove,
- content: renderContent(t('grid.row.insertRecordAbove'), UpSvg),
- },
- {
- key: RowAction.InsertBelow,
- content: renderContent(t('grid.row.insertRecordBelow'), AddSvg),
- },
- {
- key: RowAction.Duplicate,
- content: renderContent(t('grid.row.duplicate'), CopySvg),
- },
-
- {
- key: 100,
- content: <hr className={'h-[1px] w-full bg-line-divider opacity-40'} />,
- children: [],
- },
- {
- key: RowAction.Delete,
- content: renderContent(t('grid.row.delete'), DelSvg),
- },
- ],
- [renderContent, t]
- );
-
- return (
- <>
- <Popover
- disableRestoreFocus={true}
- keepMounted={false}
- anchorReference={'anchorPosition'}
- transformOrigin={{ vertical: 'top', horizontal: 'left' }}
- onClose={onClose}
- {...props}
- >
- <div className={'py-2'}>
- <KeyboardNavigation
- options={options}
- onConfirm={onConfirm}
- onEscape={() => {
- onClose?.({}, 'escapeKeyDown');
- }}
- />
- </div>
- </Popover>
- </>
- );
-}
-
-export default GridRowMenu;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_row_actions/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_row_actions/index.ts
deleted file mode 100644
index fb50b6248c..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_row_actions/index.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-export * from './GridRowActions.hooks';
-export * from './GridRowActions';
-export * from './GridRowContextMenu';
-export * from './GridRowDragButton';
-export * from './GridRowMenu';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_sticky_header/GridStickyHeader.hooks.ts b/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_sticky_header/GridStickyHeader.hooks.ts
deleted file mode 100644
index ac5c0688b9..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_sticky_header/GridStickyHeader.hooks.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import { createContext, useContext } from 'react';
-
-export const OpenMenuContext = createContext<string | null>(null);
-
-export const useOpenMenu = (id: string) => {
- const context = useContext(OpenMenuContext);
-
- return context === id;
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_sticky_header/GridStickyHeader.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_sticky_header/GridStickyHeader.tsx
deleted file mode 100644
index e9d01508b1..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_sticky_header/GridStickyHeader.tsx
+++ /dev/null
@@ -1,112 +0,0 @@
-import React, { useCallback, useState } from 'react';
-import { GridChildComponentProps, GridOnScrollProps, VariableSizeGrid as Grid } from 'react-window';
-import AutoSizer from 'react-virtualized-auto-sizer';
-import { useGridColumn } from '$app/components/database/grid/grid_table';
-import { GridField } from 'src/appflowy_app/components/database/grid/grid_field';
-import NewProperty from '$app/components/database/components/property/NewProperty';
-import { GridColumn, GridColumnType, RenderRow } from '$app/components/database/grid/constants';
-import { OpenMenuContext } from '$app/components/database/grid/grid_sticky_header/GridStickyHeader.hooks';
-
-const GridStickyHeader = React.forwardRef<
- Grid<GridColumn[]> | null,
- {
- columns: GridColumn[];
- getScrollElement?: () => HTMLDivElement | null;
- onScroll?: (props: GridOnScrollProps) => void;
- }
->(({ onScroll, columns, getScrollElement }, ref) => {
- const { columnWidth, resizeColumnWidth } = useGridColumn(
- columns,
- ref as React.MutableRefObject<Grid<
- | GridColumn[]
- | {
- columns: GridColumn[];
- renderRows: RenderRow[];
- }
- > | null>
- );
-
- const [openMenuId, setOpenMenuId] = useState<string | null>(null);
-
- const handleOpenMenu = useCallback((id: string) => {
- setOpenMenuId(id);
- }, []);
-
- const handleCloseMenu = useCallback((id: string) => {
- setOpenMenuId((prev) => {
- if (prev === id) {
- return null;
- }
-
- return prev;
- });
- }, []);
-
- const Cell = useCallback(
- ({ columnIndex, style, data }: GridChildComponentProps) => {
- const column = data[columnIndex];
-
- if (!column || column.type === GridColumnType.Action) return <div style={style} />;
- if (column.type === GridColumnType.NewProperty) {
- const width = (style.width || 0) as number;
-
- return (
- <div
- style={{
- ...style,
- width,
- }}
- className={'border-b border-r border-t border-line-divider'}
- >
- <NewProperty onInserted={setOpenMenuId} />
- </div>
- );
- }
-
- const field = column.field;
-
- if (!field) return <div style={style} />;
-
- return (
- <GridField
- className={'border-b border-r border-t border-line-divider'}
- style={style}
- onCloseMenu={handleCloseMenu}
- onOpenMenu={handleOpenMenu}
- resizeColumnWidth={(width: number) => resizeColumnWidth(columnIndex, width)}
- field={field}
- getScrollElement={getScrollElement}
- />
- );
- },
- [handleCloseMenu, handleOpenMenu, resizeColumnWidth, getScrollElement]
- );
-
- return (
- <OpenMenuContext.Provider value={openMenuId}>
- <AutoSizer>
- {({ height, width }: { height: number; width: number }) => {
- return (
- <Grid
- className={'grid-sticky-header w-full text-text-title'}
- height={height}
- width={width}
- rowHeight={() => 36}
- rowCount={1}
- columnCount={columns.length}
- columnWidth={columnWidth}
- ref={ref}
- onScroll={onScroll}
- itemData={columns}
- style={{ overscrollBehavior: 'none' }}
- >
- {Cell}
- </Grid>
- );
- }}
- </AutoSizer>
- </OpenMenuContext.Provider>
- );
-});
-
-export default GridStickyHeader;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_table/GridTable.hooks.ts b/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_table/GridTable.hooks.ts
deleted file mode 100644
index 0d676f3bb2..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_table/GridTable.hooks.ts
+++ /dev/null
@@ -1,67 +0,0 @@
-import React, { useCallback, useEffect, useState } from 'react';
-import { DEFAULT_FIELD_WIDTH, GRID_ACTIONS_WIDTH, GridColumn, RenderRow } from '$app/components/database/grid/constants';
-import { VariableSizeGrid as Grid } from 'react-window';
-
-export function useGridRow() {
- const rowHeight = useCallback(() => {
- return 36;
- }, []);
-
- return {
- rowHeight,
- };
-}
-
-export function useGridColumn(
- columns: GridColumn[],
- ref: React.RefObject<Grid<
- | GridColumn[]
- | {
- columns: GridColumn[];
- renderRows: RenderRow[];
- }
- > | null>
-) {
- const [columnWidths, setColumnWidths] = useState<number[]>([]);
-
- useEffect(() => {
- setColumnWidths(
- columns.map((field, index) => (index === 0 ? GRID_ACTIONS_WIDTH : field.width || DEFAULT_FIELD_WIDTH))
- );
- ref.current?.resetAfterColumnIndex(0);
- }, [columns, ref]);
-
- const resizeColumnWidth = useCallback(
- (index: number, width: number) => {
- setColumnWidths((columnWidths) => {
- if (columnWidths[index] === width) {
- return columnWidths;
- }
-
- const newColumnWidths = [...columnWidths];
-
- newColumnWidths[index] = width;
-
- return newColumnWidths;
- });
-
- if (ref.current) {
- ref.current.resetAfterColumnIndex(index);
- }
- },
- [ref]
- );
-
- const columnWidth = useCallback(
- (index: number) => {
- if (index === 0) return GRID_ACTIONS_WIDTH;
- return columnWidths[index] || DEFAULT_FIELD_WIDTH;
- },
- [columnWidths]
- );
-
- return {
- columnWidth,
- resizeColumnWidth,
- };
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_table/GridTable.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_table/GridTable.tsx
deleted file mode 100644
index 0cd17d6a05..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_table/GridTable.tsx
+++ /dev/null
@@ -1,161 +0,0 @@
-import React, { FC, useCallback, useMemo, useRef } from 'react';
-import { RowMeta } from '$app/application/database';
-import { useDatabaseRendered, useDatabaseVisibilityFields, useDatabaseVisibilityRows } from '../../Database.hooks';
-import { fieldsToColumns, GridColumn, RenderRow, RenderRowType, rowMetasToRenderRow } from '../constants';
-import { CircularProgress } from '@mui/material';
-import { GridChildComponentProps, GridOnScrollProps, VariableSizeGrid as Grid } from 'react-window';
-import AutoSizer from 'react-virtualized-auto-sizer';
-import { GridCell } from 'src/appflowy_app/components/database/grid/grid_cell';
-import { useGridColumn, useGridRow } from './GridTable.hooks';
-import GridStickyHeader from '$app/components/database/grid/grid_sticky_header/GridStickyHeader';
-import GridTableOverlay from '$app/components/database/grid/grid_overlay/GridTableOverlay';
-import ReactDOM from 'react-dom';
-import { useViewId } from '$app/hooks';
-
-export interface GridTableProps {
- onEditRecord: (rowId: string) => void;
-}
-
-export const GridTable: FC<GridTableProps> = React.memo(({ onEditRecord }) => {
- const rowMetas = useDatabaseVisibilityRows();
- const fields = useDatabaseVisibilityFields();
- const renderRows = useMemo<RenderRow[]>(() => rowMetasToRenderRow(rowMetas as RowMeta[]), [rowMetas]);
- const columns = useMemo<GridColumn[]>(() => fieldsToColumns(fields), [fields]);
- const ref = useRef<
- Grid<{
- columns: GridColumn[];
- renderRows: RenderRow[];
- }>
- >(null);
- const { columnWidth } = useGridColumn(
- columns,
- ref as React.MutableRefObject<Grid<GridColumn[] | { columns: GridColumn[]; renderRows: RenderRow[] }> | null>
- );
- const viewId = useViewId();
- const { rowHeight } = useGridRow();
- const onRendered = useDatabaseRendered();
-
- const getItemKey = useCallback(
- ({ columnIndex, rowIndex }: { columnIndex: number; rowIndex: number }) => {
- const row = renderRows[rowIndex];
- const column = columns[columnIndex];
-
- const field = column.field;
-
- if (row.type === RenderRowType.Row) {
- if (field) {
- return `${row.data.meta.id}:${field.id}`;
- }
-
- return `${row.data.meta.id}:${column.type}`;
- }
-
- if (field) {
- return `${row.type}:${field.id}`;
- }
-
- return `${row.type}:${column.type}`;
- },
- [columns, renderRows]
- );
-
- const getContainerRef = useCallback(() => {
- return containerRef;
- }, []);
-
- const Cell = useCallback(
- ({ columnIndex, rowIndex, style, data }: GridChildComponentProps) => {
- const row = data.renderRows[rowIndex];
- const column = data.columns[columnIndex];
-
- return (
- <GridCell
- getContainerRef={getContainerRef}
- onEditRecord={onEditRecord}
- columnIndex={columnIndex}
- style={style}
- row={row}
- column={column}
- />
- );
- },
- [getContainerRef, onEditRecord]
- );
-
- const staticGrid = useRef<Grid<GridColumn[]> | null>(null);
-
- const onScroll = useCallback(({ scrollLeft, scrollUpdateWasRequested }: GridOnScrollProps) => {
- if (!scrollUpdateWasRequested) {
- staticGrid.current?.scrollTo({ scrollLeft, scrollTop: 0 });
- }
- }, []);
-
- const onHeaderScroll = useCallback(({ scrollLeft }: GridOnScrollProps) => {
- ref.current?.scrollTo({ scrollLeft });
- }, []);
-
- const containerRef = useRef<HTMLDivElement | null>(null);
- const scrollElementRef = useRef<HTMLDivElement | null>(null);
-
- const getScrollElement = useCallback(() => {
- return scrollElementRef.current;
- }, []);
-
- return (
- <div className={'flex w-full flex-1 flex-col '}>
- {fields.length === 0 && (
- <div className={'absolute left-0 top-0 z-10 flex h-full w-full items-center justify-center bg-bg-body'}>
- <CircularProgress />
- </div>
- )}
- <div className={'h-[36px]'}>
- <GridStickyHeader
- ref={staticGrid}
- onScroll={onHeaderScroll}
- getScrollElement={getScrollElement}
- columns={columns}
- />
- </div>
-
- <div className={'flex-1'}>
- <AutoSizer>
- {({ height, width }: { height: number; width: number }) => (
- <Grid
- ref={ref}
- onScroll={onScroll}
- columnCount={columns.length}
- columnWidth={columnWidth}
- height={height}
- rowCount={renderRows.length}
- rowHeight={rowHeight}
- width={width}
- itemData={{
- columns,
- renderRows,
- }}
- overscanRowCount={10}
- itemKey={getItemKey}
- style={{
- overscrollBehavior: 'none',
- }}
- className={'grid-scroll-container'}
- outerRef={(el) => {
- scrollElementRef.current = el;
- onRendered(viewId);
- }}
- innerRef={containerRef}
- >
- {Cell}
- </Grid>
- )}
- </AutoSizer>
- {containerRef.current
- ? ReactDOM.createPortal(
- <GridTableOverlay getScrollElement={getScrollElement} containerRef={containerRef} />,
- containerRef.current
- )
- : null}
- </div>
- </div>
- );
-});
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_table/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_table/index.ts
deleted file mode 100644
index dfdb9b7949..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/grid_table/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export * from './GridTable';
-export * from './GridTable.hooks';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/index.ts
deleted file mode 100644
index 762542e7cb..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/grid/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './Grid';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/database/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/database/index.ts
deleted file mode 100644
index 42a6f31592..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/database/index.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export * from './Database.hooks';
-export * from './Database';
-export * from './DatabaseTitle';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/document/Document.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/document/Document.tsx
deleted file mode 100644
index 079a6fd75f..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/document/Document.tsx
+++ /dev/null
@@ -1,53 +0,0 @@
-import React, { useCallback, useEffect, useMemo, useState } from 'react';
-import Editor from '$app/components/editor/Editor';
-import { DocumentHeader } from 'src/appflowy_app/components/document/document_header';
-import { useAppDispatch, useAppSelector } from '$app/stores/store';
-import { updatePageName } from '$app_reducers/pages/async_actions';
-import { PageCover } from '$app_reducers/pages/slice';
-
-export function Document({ id }: { id: string }) {
- const page = useAppSelector((state) => state.pages.pageMap[id]);
-
- const [cover, setCover] = useState<PageCover | undefined>(undefined);
- const dispatch = useAppDispatch();
-
- const onTitleChange = useCallback(
- (newTitle: string) => {
- void dispatch(
- updatePageName({
- id,
- name: newTitle,
- })
- );
- },
- [dispatch, id]
- );
-
- const view = useMemo(() => {
- return {
- ...page,
- cover,
- };
- }, [page, cover]);
-
- useEffect(() => {
- return () => {
- setCover(undefined);
- };
- }, [id]);
-
- if (!page) return null;
-
- return (
- <div className={'relative w-full'}>
- <DocumentHeader onUpdateCover={setCover} page={view} />
- <div className={'flex w-full justify-center'}>
- <div className={'max-w-screen w-[964px] min-w-0'}>
- <Editor id={id} cover={cover} onCoverChange={setCover} onTitleChange={onTitleChange} title={page.name} />
- </div>
- </div>
- </div>
- );
-}
-
-export default Document;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/document/document_header/DocumentHeader.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/document/document_header/DocumentHeader.tsx
deleted file mode 100644
index f6e8736c54..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/document/document_header/DocumentHeader.tsx
+++ /dev/null
@@ -1,60 +0,0 @@
-import React, { memo, useCallback, useEffect, useRef, useState } from 'react';
-import { Page, PageCover, PageIcon } from '$app_reducers/pages/slice';
-import ViewTitle from '$app/components/_shared/view_title/ViewTitle';
-import { updatePageIcon } from '$app/application/folder/page.service';
-
-interface DocumentHeaderProps {
- page: Page;
- onUpdateCover: (cover?: PageCover) => void;
-}
-
-export function DocumentHeader({ page, onUpdateCover }: DocumentHeaderProps) {
- const pageId = page.id;
- const ref = useRef<HTMLDivElement>(null);
-
- const [forceHover, setForceHover] = useState(false);
- const onUpdateIcon = useCallback(
- async (icon: PageIcon) => {
- await updatePageIcon(pageId, icon.value ? icon : undefined);
- },
- [pageId]
- );
-
- useEffect(() => {
- const parent = ref.current?.parentElement;
-
- if (!parent) return;
-
- const documentDom = parent.querySelector('.appflowy-editor') as HTMLElement;
-
- if (!documentDom) return;
-
- const handleMouseMove = (e: MouseEvent) => {
- const isMoveInTitle = Boolean(e.target instanceof HTMLElement && e.target.closest('.document-title'));
- const isMoveInHeader = Boolean(e.target instanceof HTMLElement && e.target.closest('.document-header'));
-
- setForceHover(isMoveInTitle || isMoveInHeader);
- };
-
- documentDom.addEventListener('mousemove', handleMouseMove);
- return () => {
- documentDom.removeEventListener('mousemove', handleMouseMove);
- };
- }, []);
-
- if (!page) return null;
- return (
- <div ref={ref} className={'document-header select-none'}>
- <ViewTitle
- showCover
- showTitle={false}
- forceHover={forceHover}
- onUpdateCover={onUpdateCover}
- onUpdateIcon={onUpdateIcon}
- view={page}
- />
- </div>
- );
-}
-
-export default memo(DocumentHeader);
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/document/document_header/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/document/document_header/index.ts
deleted file mode 100644
index 00f48716bf..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/document/document_header/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './DocumentHeader';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/document/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/document/index.ts
deleted file mode 100644
index a844aa51ad..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/document/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './Document';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/Editor.hooks.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/Editor.hooks.ts
deleted file mode 100644
index 1fc25346d2..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/Editor.hooks.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import { createContext, useContext } from 'react';
-
-export const EditorIdContext = createContext('');
-
-export const EditorIdProvider = EditorIdContext.Provider;
-
-export function useEditorId() {
- return useContext(EditorIdContext);
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/Editor.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/Editor.tsx
deleted file mode 100644
index 879dc5f9c0..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/Editor.tsx
+++ /dev/null
@@ -1,19 +0,0 @@
-import React, { memo } from 'react';
-import { EditorProps } from '../../application/document/document.types';
-
-import { CollaborativeEditor } from '$app/components/editor/components/editor';
-import { EditorIdProvider } from '$app/components/editor/Editor.hooks';
-import './editor.scss';
-import withErrorBoundary from '$app/components/_shared/error_boundary/withError';
-
-export function Editor(props: EditorProps) {
- return (
- <div className={'appflowy-editor relative'}>
- <EditorIdProvider value={props.id}>
- <CollaborativeEditor {...props} />
- </EditorIdProvider>
- </div>
- );
-}
-
-export default withErrorBoundary(memo(Editor));
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/command/formula.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/command/formula.ts
deleted file mode 100644
index 04a2e7c0f1..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/command/formula.ts
+++ /dev/null
@@ -1,95 +0,0 @@
-import { ReactEditor } from 'slate-react';
-import { Editor, Element, Element as SlateElement, NodeEntry, Range, Transforms } from 'slate';
-import { EditorInlineNodeType, FormulaNode } from '$app/application/document/document.types';
-
-export function insertFormula(editor: ReactEditor, formula?: string) {
- if (editor.selection) {
- wrapFormula(editor, formula);
- }
-}
-
-export function updateFormula(editor: ReactEditor, formula: string) {
- if (isFormulaActive(editor)) {
- Transforms.delete(editor);
- wrapFormula(editor, formula);
- }
-}
-
-export function deleteFormula(editor: ReactEditor) {
- if (isFormulaActive(editor)) {
- Transforms.delete(editor);
- }
-}
-
-export function wrapFormula(editor: ReactEditor, formula?: string) {
- if (isFormulaActive(editor)) {
- unwrapFormula(editor);
- }
-
- const { selection } = editor;
-
- if (!selection) return;
- const isCollapsed = selection && Range.isCollapsed(selection);
-
- const data = formula || editor.string(selection);
- const formulaElement = {
- type: EditorInlineNodeType.Formula,
- data,
- children: [
- {
- text: '$',
- },
- ],
- };
-
- if (!isCollapsed) {
- Transforms.delete(editor);
- }
-
- Transforms.insertNodes(editor, formulaElement, {
- select: true,
- });
-
- const path = editor.selection?.anchor.path;
-
- if (path) {
- editor.select(path);
- }
-}
-
-export function unwrapFormula(editor: ReactEditor) {
- const [match] = Editor.nodes(editor, {
- match: (n) => !Editor.isEditor(n) && SlateElement.isElement(n) && n.type === EditorInlineNodeType.Formula,
- });
-
- if (!match) return;
-
- const [node, path] = match as NodeEntry<FormulaNode>;
- const formula = node.data;
- const range = Editor.range(editor, match[1]);
- const beforePoint = Editor.before(editor, path, { unit: 'character' });
-
- Transforms.select(editor, range);
- Transforms.delete(editor);
-
- Transforms.insertText(editor, formula);
-
- if (!beforePoint) return;
- Transforms.select(editor, {
- anchor: beforePoint,
- focus: {
- ...beforePoint,
- offset: beforePoint.offset + formula.length,
- },
- });
-}
-
-export function isFormulaActive(editor: ReactEditor) {
- const [match] = editor.nodes({
- match: (n) => {
- return !Editor.isEditor(n) && Element.isElement(n) && n.type === EditorInlineNodeType.Formula;
- },
- });
-
- return Boolean(match);
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/command/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/command/index.ts
deleted file mode 100644
index 557b91f936..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/command/index.ts
+++ /dev/null
@@ -1,715 +0,0 @@
-import { ReactEditor } from 'slate-react';
-import {
- Editor,
- Element,
- Node,
- NodeEntry,
- Point,
- Range,
- Transforms,
- Location,
- Path,
- EditorBeforeOptions,
- Text,
- addMark,
-} from 'slate';
-import { LIST_TYPES, tabBackward, tabForward } from '$app/components/editor/command/tab';
-import { getAllMarks, isMarkActive, removeMarks, toggleMark } from '$app/components/editor/command/mark';
-import {
- deleteFormula,
- insertFormula,
- isFormulaActive,
- unwrapFormula,
- updateFormula,
-} from '$app/components/editor/command/formula';
-import {
- EditorInlineNodeType,
- EditorNodeType,
- CalloutNode,
- Mention,
- TodoListNode,
- ToggleListNode,
- inlineNodeTypes,
- FormulaNode,
- ImageNode,
- EditorMarkFormat,
-} from '$app/application/document/document.types';
-import cloneDeep from 'lodash-es/cloneDeep';
-import { generateId } from '$app/components/editor/provider/utils/convert';
-import { YjsEditor } from '@slate-yjs/core';
-
-export const EmbedTypes: string[] = [
- EditorNodeType.DividerBlock,
- EditorNodeType.EquationBlock,
- EditorNodeType.GridBlock,
- EditorNodeType.ImageBlock,
-];
-
-export const CustomEditor = {
- getBlock: (editor: ReactEditor, at?: Location): NodeEntry<Element> | undefined => {
- return Editor.above(editor, {
- at,
- match: (n) => !Editor.isEditor(n) && Element.isElement(n) && n.blockId !== undefined,
- });
- },
-
- isInlineNode: (editor: ReactEditor, point: Point): boolean => {
- return Boolean(
- editor.above({
- at: point,
- match: (n) => {
- return !Editor.isEditor(n) && Element.isElement(n) && inlineNodeTypes.includes(n.type as EditorInlineNodeType);
- },
- })
- );
- },
-
- beforeIsInlineNode: (editor: ReactEditor, at: Location, opts?: EditorBeforeOptions): boolean => {
- const beforePoint = Editor.before(editor, at, opts);
-
- if (!beforePoint) return false;
- return CustomEditor.isInlineNode(editor, beforePoint);
- },
-
- afterIsInlineNode: (editor: ReactEditor, at: Location, opts?: EditorBeforeOptions): boolean => {
- const afterPoint = Editor.after(editor, at, opts);
-
- if (!afterPoint) return false;
- return CustomEditor.isInlineNode(editor, afterPoint);
- },
-
- /**
- * judge if the selection is multiple block
- * @param editor
- * @param filterEmptyEndSelection if the filterEmptyEndSelection is true, the function will filter the empty end selection
- */
- isMultipleBlockSelected: (editor: ReactEditor, filterEmptyEndSelection?: boolean): boolean => {
- const { selection } = editor;
-
- if (!selection) return false;
-
- if (Range.isCollapsed(selection)) return false;
- const start = Range.start(selection);
- const end = Range.end(selection);
- const isBackward = Range.isBackward(selection);
- const startBlock = CustomEditor.getBlock(editor, start);
- const endBlock = CustomEditor.getBlock(editor, end);
-
- if (!startBlock || !endBlock) return false;
-
- const [, startPath] = startBlock;
- const [, endPath] = endBlock;
-
- const isSomePath = Path.equals(startPath, endPath);
-
- // if the start and end path is the same, return false
- if (isSomePath) {
- return false;
- }
-
- if (!filterEmptyEndSelection) {
- return true;
- }
-
- // The end point is at the start of the end block
- const focusEndStart = Point.equals(end, editor.start(endPath));
-
- if (!focusEndStart) {
- return true;
- }
-
- // find the previous block
- const previous = editor.previous({
- at: endPath,
- match: (n) => Element.isElement(n) && n.blockId !== undefined,
- });
-
- if (!previous) {
- return true;
- }
-
- // backward selection
- const newEnd = editor.end(editor.range(previous[1]));
-
- editor.select({
- anchor: isBackward ? newEnd : start,
- focus: isBackward ? start : newEnd,
- });
-
- return false;
- },
-
- /**
- * turn the current block to a new block
- * 1. clone the current block to a new block
- * 2. lift the children of the current block if the current block doesn't allow has children
- * 3. remove the old block
- * 4. insert the new block
- * @param editor
- * @param newProperties
- */
- turnToBlock: (editor: ReactEditor, newProperties: Partial<Element>) => {
- const selection = editor.selection;
-
- if (!selection) return;
- const match = CustomEditor.getBlock(editor);
-
- if (!match) return;
-
- const [node, path] = match as NodeEntry<Element>;
-
- const cloneNode = CustomEditor.cloneBlock(editor, node);
-
- Object.assign(cloneNode, newProperties);
- cloneNode.data = {
- ...(node.data || {}),
- ...(newProperties.data || {}),
- };
-
- const isEmbed = editor.isEmbed(cloneNode);
-
- if (isEmbed) {
- editor.splitNodes({
- always: true,
- });
- cloneNode.children = [];
-
- Transforms.removeNodes(editor, {
- at: path,
- });
- Transforms.insertNodes(editor, cloneNode, { at: path });
- return cloneNode;
- }
-
- const isListType = LIST_TYPES.includes(cloneNode.type as EditorNodeType);
-
- // if node doesn't allow has children, lift the children before insert the new node and remove the old node
- if (!isListType) {
- const [textNode, ...children] = cloneNode.children;
-
- const length = children.length;
-
- for (let i = 0; i < length; i++) {
- editor.liftNodes({
- at: [...path, length - i],
- });
- }
-
- cloneNode.children = [textNode];
- }
-
- Transforms.removeNodes(editor, {
- at: path,
- });
-
- Transforms.insertNodes(editor, cloneNode, { at: path });
- if (selection) {
- editor.select(selection);
- }
-
- return cloneNode;
- },
- tabForward,
- tabBackward,
- toggleMark,
- removeMarks,
- isMarkActive,
- isFormulaActive,
- insertFormula,
- updateFormula,
- deleteFormula,
- toggleFormula: (editor: ReactEditor) => {
- if (isFormulaActive(editor)) {
- unwrapFormula(editor);
- } else {
- insertFormula(editor);
- }
- },
-
- isBlockActive(editor: ReactEditor, format?: string) {
- const match = CustomEditor.getBlock(editor);
-
- if (match && format !== undefined) {
- return match[0].type === format;
- }
-
- return !!match;
- },
-
- toggleAlign(editor: ReactEditor, format: string) {
- const isIncludeRoot = CustomEditor.selectionIncludeRoot(editor);
-
- if (isIncludeRoot) return;
-
- const matchNodes = Array.from(
- Editor.nodes(editor, {
- // Note: we need to select the text node instead of the element node, otherwise the parent node will be selected
- match: (n) => Element.isElement(n) && n.type === EditorNodeType.Text,
- })
- );
-
- if (!matchNodes) return;
-
- matchNodes.forEach((match) => {
- const [, textPath] = match as NodeEntry<Element>;
- const [node] = editor.parent(textPath) as NodeEntry<
- Element & {
- data: {
- align?: string;
- };
- }
- >;
- const path = ReactEditor.findPath(editor, node);
-
- const data = (node.data as { align?: string }) || {};
- const newProperties = {
- data: {
- ...data,
- align: data.align === format ? undefined : format,
- },
- } as Partial<Element>;
-
- Transforms.setNodes(editor, newProperties, { at: path });
- });
- },
-
- getAlign(editor: ReactEditor) {
- const match = CustomEditor.getBlock(editor);
-
- if (!match) return undefined;
-
- const [node] = match as NodeEntry<Element>;
-
- return (node.data as { align?: string })?.align;
- },
-
- isInlineActive(editor: ReactEditor) {
- const [match] = editor.nodes({
- match: (n) => {
- return !Editor.isEditor(n) && Element.isElement(n) && inlineNodeTypes.includes(n.type as EditorInlineNodeType);
- },
- });
-
- return !!match;
- },
-
- formulaActiveNode(editor: ReactEditor) {
- const [match] = editor.nodes({
- match: (n) => {
- return !Editor.isEditor(n) && Element.isElement(n) && n.type === EditorInlineNodeType.Formula;
- },
- });
-
- return match ? (match as NodeEntry<FormulaNode>) : undefined;
- },
-
- isMentionActive(editor: ReactEditor) {
- const [match] = editor.nodes({
- match: (n) => {
- return !Editor.isEditor(n) && Element.isElement(n) && n.type === EditorInlineNodeType.Mention;
- },
- });
-
- return Boolean(match);
- },
-
- insertMention(editor: ReactEditor, mention: Mention) {
- const mentionElement = [
- {
- type: EditorInlineNodeType.Mention,
- children: [{ text: '$' }],
- data: {
- ...mention,
- },
- },
- ];
-
- Transforms.insertNodes(editor, mentionElement, {
- select: true,
- });
-
- editor.collapse({
- edge: 'end',
- });
- },
-
- toggleTodo(editor: ReactEditor, at?: Location) {
- const selection = at || editor.selection;
-
- if (!selection) return;
-
- const nodes = Array.from(
- editor.nodes({
- at: selection,
- match: (n) => Element.isElement(n) && n.type === EditorNodeType.TodoListBlock,
- })
- );
-
- const matchUnChecked = nodes.some(([node]) => {
- return !(node as TodoListNode).data.checked;
- });
-
- const checked = Boolean(matchUnChecked);
-
- nodes.forEach(([node, path]) => {
- const data = (node as TodoListNode).data || {};
- const newProperties = {
- data: {
- ...data,
- checked: checked,
- },
- } as Partial<Element>;
-
- Transforms.setNodes(editor, newProperties, { at: path });
- });
- },
-
- toggleToggleList(editor: ReactEditor, node: ToggleListNode) {
- const collapsed = node.data.collapsed;
- const path = ReactEditor.findPath(editor, node);
- const data = node.data || {};
- const newProperties = {
- data: {
- ...data,
- collapsed: !collapsed,
- },
- } as Partial<Element>;
-
- const selectMatch = Editor.above(editor, {
- match: (n) => Element.isElement(n) && n.blockId !== undefined,
- });
-
- Transforms.setNodes(editor, newProperties, { at: path });
-
- if (selectMatch) {
- const [selectNode] = selectMatch;
- const selectNodePath = ReactEditor.findPath(editor, selectNode);
-
- if (Path.isAncestor(path, selectNodePath)) {
- editor.select(path);
- editor.collapse({
- edge: 'start',
- });
- }
- }
- },
-
- setCalloutIcon(editor: ReactEditor, node: CalloutNode, newIcon: string) {
- const path = ReactEditor.findPath(editor, node);
- const data = node.data || {};
- const newProperties = {
- data: {
- ...data,
- icon: newIcon,
- },
- } as Partial<Element>;
-
- Transforms.setNodes(editor, newProperties, { at: path });
- },
-
- setMathEquationBlockFormula(editor: ReactEditor, node: Element, newFormula: string) {
- const path = ReactEditor.findPath(editor, node);
- const data = node.data || {};
- const newProperties = {
- data: {
- ...data,
- formula: newFormula,
- },
- } as Partial<Element>;
-
- Transforms.setNodes(editor, newProperties, { at: path });
- },
-
- setGridBlockViewId(editor: ReactEditor, node: Element, newViewId: string) {
- const path = ReactEditor.findPath(editor, node);
- const data = node.data || {};
- const newProperties = {
- data: {
- ...data,
- viewId: newViewId,
- },
- } as Partial<Element>;
-
- Transforms.setNodes(editor, newProperties, { at: path });
- },
-
- setImageBlockData(editor: ReactEditor, node: Element, newData: ImageNode['data']) {
- const path = ReactEditor.findPath(editor, node);
- const data = node.data || {};
- const newProperties = {
- data: {
- ...data,
- ...newData,
- },
- } as Partial<Element>;
-
- Transforms.setNodes(editor, newProperties, { at: path });
- },
-
- cloneBlock(editor: ReactEditor, block: Element): Element {
- const cloneNode: Element = {
- ...cloneDeep(block),
- blockId: generateId(),
- type: block.type === EditorNodeType.Page ? EditorNodeType.Paragraph : block.type,
- children: [],
- };
- const isEmbed = editor.isEmbed(cloneNode);
-
- if (isEmbed) {
- return cloneNode;
- }
-
- const [firstTextNode, ...children] = block.children as Element[];
-
- const textNode =
- firstTextNode && firstTextNode.type === EditorNodeType.Text
- ? {
- textId: generateId(),
- type: EditorNodeType.Text,
- children: cloneDeep(firstTextNode.children),
- }
- : undefined;
-
- if (textNode) {
- cloneNode.children.push(textNode);
- }
-
- const cloneChildren = children.map((child) => {
- return CustomEditor.cloneBlock(editor, child);
- });
-
- cloneNode.children.push(...cloneChildren);
-
- return cloneNode;
- },
-
- duplicateNode(editor: ReactEditor, node: Element) {
- const cloneNode = CustomEditor.cloneBlock(editor, node);
-
- const path = ReactEditor.findPath(editor, node);
-
- const nextPath = Path.next(path);
-
- Transforms.insertNodes(editor, cloneNode, { at: nextPath });
- return cloneNode;
- },
-
- deleteNode(editor: ReactEditor, node: Node) {
- const path = ReactEditor.findPath(editor, node);
-
- Transforms.removeNodes(editor, {
- at: path,
- });
- editor.collapse({
- edge: 'start',
- });
- },
-
- getBlockType: (editor: ReactEditor) => {
- const match = CustomEditor.getBlock(editor);
-
- if (!match) return null;
-
- const [node] = match as NodeEntry<Element>;
-
- return node.type as EditorNodeType;
- },
-
- selectionIncludeRoot: (editor: ReactEditor) => {
- const [match] = Editor.nodes(editor, {
- match: (n) => Element.isElement(n) && n.blockId !== undefined && n.type === EditorNodeType.Page,
- });
-
- return Boolean(match);
- },
-
- isCodeBlock: (editor: ReactEditor) => {
- return CustomEditor.getBlockType(editor) === EditorNodeType.CodeBlock;
- },
-
- insertEmptyLine: (editor: ReactEditor & YjsEditor, path: Path) => {
- editor.insertNode(
- {
- type: EditorNodeType.Paragraph,
- data: {},
- blockId: generateId(),
- children: [
- {
- type: EditorNodeType.Text,
- textId: generateId(),
- children: [
- {
- text: '',
- },
- ],
- },
- ],
- },
- {
- select: true,
- at: path,
- }
- );
- ReactEditor.focus(editor);
- Transforms.move(editor);
- },
-
- insertEmptyLineAtEnd: (editor: ReactEditor & YjsEditor) => {
- CustomEditor.insertEmptyLine(editor, [editor.children.length]);
- },
-
- focusAtStartOfBlock(editor: ReactEditor) {
- const { selection } = editor;
-
- if (selection && Range.isCollapsed(selection)) {
- const match = CustomEditor.getBlock(editor);
- const [, path] = match as NodeEntry<Element>;
- const start = Editor.start(editor, path);
-
- return match && Point.equals(selection.anchor, start);
- }
-
- return false;
- },
-
- setBlockColor(
- editor: ReactEditor,
- node: Element,
- data: {
- font_color?: string;
- bg_color?: string;
- }
- ) {
- const path = ReactEditor.findPath(editor, node);
-
- const nodeData = node.data || {};
- const newProperties = {
- data: {
- ...nodeData,
- ...data,
- },
- } as Partial<Element>;
-
- Transforms.setNodes(editor, newProperties, { at: path });
- editor.select(path);
- },
-
- deleteAllText(editor: ReactEditor, node: Element) {
- const [textNode] = (node.children || []) as Element[];
- const hasTextNode = textNode && textNode.type === EditorNodeType.Text;
-
- if (!hasTextNode) return;
- const path = ReactEditor.findPath(editor, textNode);
- const textLength = editor.string(path).length;
- const start = Editor.start(editor, path);
-
- for (let i = 0; i < textLength; i++) {
- editor.select(start);
- editor.deleteForward('character');
- }
- },
-
- getNodeText: (editor: ReactEditor, node: Element) => {
- const [textNode] = (node.children || []) as Element[];
- const hasTextNode = textNode && textNode.type === EditorNodeType.Text;
-
- if (!hasTextNode) return '';
-
- const path = ReactEditor.findPath(editor, textNode);
-
- return editor.string(path);
- },
-
- isEmptyText: (editor: ReactEditor, node: Element) => {
- const [textNode] = (node.children || []) as Element[];
- const hasTextNode = textNode && textNode.type === EditorNodeType.Text;
-
- if (!hasTextNode) return false;
-
- return editor.isEmpty(textNode);
- },
-
- includeInlineBlocks: (editor: ReactEditor) => {
- const [match] = Editor.nodes(editor, {
- match: (n) => Element.isElement(n) && editor.isInline(n),
- });
-
- return Boolean(match);
- },
-
- getNodeTextContent(node: Node): string {
- if (Element.isElement(node) && node.type === EditorInlineNodeType.Formula) {
- return (node as FormulaNode).data || '';
- }
-
- if (Text.isText(node)) {
- return node.text || '';
- }
-
- return node.children.map((n) => CustomEditor.getNodeTextContent(n)).join('');
- },
-
- isEmbedNode(node: Element): boolean {
- return EmbedTypes.includes(node.type);
- },
-
- getListLevel(editor: ReactEditor, type: EditorNodeType, path: Path) {
- let level = 0;
- let currentPath = path;
-
- while (currentPath.length > 0) {
- const parent = editor.parent(currentPath);
-
- if (!parent) {
- break;
- }
-
- const [parentNode, parentPath] = parent as NodeEntry<Element>;
-
- if (parentNode.type !== type) {
- break;
- }
-
- level += 1;
- currentPath = parentPath;
- }
-
- return level;
- },
-
- getLinks(editor: ReactEditor): string[] {
- const marks = getAllMarks(editor);
-
- if (!marks) return [];
-
- return Object.entries(marks)
- .filter(([key]) => key === 'href')
- .map(([_, val]) => val as string);
- },
-
- extendLineBackward(editor: ReactEditor) {
- Transforms.move(editor, {
- unit: 'line',
- edge: 'focus',
- reverse: true,
- });
- },
-
- extendLineForward(editor: ReactEditor) {
- Transforms.move(editor, { unit: 'line', edge: 'focus' });
- },
-
- insertPlainText(editor: ReactEditor, text: string) {
- const [appendText, ...lines] = text.split('\n');
-
- editor.insertText(appendText);
- lines.forEach((line) => {
- editor.insertBreak();
- editor.insertText(line);
- });
- },
-
- highlight(editor: ReactEditor) {
- addMark(editor, EditorMarkFormat.BgColor, 'appflowy_them_color_tint5');
- },
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/command/mark.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/command/mark.ts
deleted file mode 100644
index 649eaca564..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/command/mark.ts
+++ /dev/null
@@ -1,137 +0,0 @@
-import { ReactEditor } from 'slate-react';
-import { Editor, Text, Range, Element } from 'slate';
-import { EditorInlineNodeType, EditorMarkFormat } from '$app/application/document/document.types';
-import { CustomEditor } from '$app/components/editor/command/index';
-
-export function toggleMark(
- editor: ReactEditor,
- mark: {
- key: EditorMarkFormat;
- value: string | boolean;
- }
-) {
- if (CustomEditor.selectionIncludeRoot(editor)) {
- return;
- }
-
- const { key, value } = mark;
-
- const isActive = isMarkActive(editor, key);
-
- if (isActive || !value) {
- Editor.removeMark(editor, key as string);
- } else if (value) {
- Editor.addMark(editor, key as string, value);
- }
-}
-
-/**
- * Check if the every text in the selection has the mark.
- * @param editor
- * @param format
- */
-export function isMarkActive(editor: ReactEditor, format: EditorMarkFormat | EditorInlineNodeType) {
- const selection = editor.selection;
-
- if (!selection) return false;
-
- const isExpanded = Range.isExpanded(selection);
-
- if (isExpanded) {
- const texts = getSelectionTexts(editor);
-
- return texts.every((node) => {
- const { text, ...attributes } = node;
-
- if (!text) return true;
- return Boolean((attributes as Record<string, boolean | string>)[format]);
- });
- }
-
- const marks = Editor.marks(editor) as Record<string, string | boolean> | null;
-
- return marks ? !!marks[format] : false;
-}
-
-export function getSelectionTexts(editor: ReactEditor) {
- const selection = editor.selection;
-
- if (!selection) return [];
-
- const texts: Text[] = [];
-
- const isExpanded = Range.isExpanded(selection);
-
- if (isExpanded) {
- let anchor = Range.start(selection);
- const focus = Range.end(selection);
- const isEnd = Editor.isEnd(editor, anchor, anchor.path);
-
- if (isEnd) {
- const after = Editor.after(editor, anchor);
-
- if (after) {
- anchor = after;
- }
- }
-
- Array.from(
- Editor.nodes(editor, {
- at: {
- anchor,
- focus,
- },
- })
- ).forEach((match) => {
- const node = match[0] as Element;
-
- if (Text.isText(node)) {
- texts.push(node);
- } else if (Editor.isInline(editor, node)) {
- texts.push(...(node.children as Text[]));
- }
- });
- }
-
- return texts;
-}
-
-/**
- * Get all marks in the current selection.
- * @param editor
- */
-export function getAllMarks(editor: ReactEditor) {
- const selection = editor.selection;
-
- if (!selection) return null;
-
- const isExpanded = Range.isExpanded(selection);
-
- if (isExpanded) {
- const texts = getSelectionTexts(editor);
-
- const marks: Record<string, string | boolean> = {};
-
- texts.forEach((node) => {
- Object.entries(node).forEach(([key, value]) => {
- if (key !== 'text') {
- marks[key] = value;
- }
- });
- });
-
- return marks;
- }
-
- return Editor.marks(editor) as Record<string, string | boolean> | null;
-}
-
-export function removeMarks(editor: ReactEditor) {
- const marks = getAllMarks(editor);
-
- if (!marks) return;
-
- for (const key in marks) {
- Editor.removeMark(editor, key);
- }
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/command/tab.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/command/tab.ts
deleted file mode 100644
index 819596f92f..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/command/tab.ts
+++ /dev/null
@@ -1,82 +0,0 @@
-import { Path, Element, NodeEntry } from 'slate';
-import { ReactEditor } from 'slate-react';
-import { EditorNodeType } from '$app/application/document/document.types';
-import { CustomEditor } from '$app/components/editor/command/index';
-
-export const LIST_TYPES = [
- EditorNodeType.NumberedListBlock,
- EditorNodeType.BulletedListBlock,
- EditorNodeType.TodoListBlock,
- EditorNodeType.ToggleListBlock,
- EditorNodeType.QuoteBlock,
- EditorNodeType.Paragraph,
-];
-
-/**
- * Indent the current list item
- * Conditions:
- * 1. The current node must be a list item
- * 2. The previous node must be a list
- * 3. The previous node must be the same level as the current node
- * Result:
- * 1. The current node will be the child of the previous node
- * 2. The current node will be indented
- * 3. The children of the current node will be moved to the children of the previous node
- * @param editor
- */
-export function tabForward(editor: ReactEditor) {
- const match = CustomEditor.getBlock(editor);
-
- if (!match) return;
-
- const [node, path] = match as NodeEntry<Element>;
-
- const hasPrevious = Path.hasPrevious(path);
-
- if (!hasPrevious) return;
-
- const previousPath = Path.previous(path);
-
- const previous = editor.node(previousPath);
- const [previousNode] = previous as NodeEntry<Element>;
-
- if (!previousNode) return;
-
- const type = previousNode.type as EditorNodeType;
-
- if (type === EditorNodeType.Page) return;
- // the previous node is not a list
- if (!LIST_TYPES.includes(type)) return;
-
- const toPath = [...previousPath, previousNode.children.length];
-
- editor.moveNodes({
- at: path,
- to: toPath,
- });
-
- const length = node.children.length;
-
- for (let i = length - 1; i > 0; i--) {
- editor.liftNodes({
- at: [...toPath, i],
- });
- }
-}
-
-export function tabBackward(editor: ReactEditor) {
- const match = CustomEditor.getBlock(editor);
-
- if (!match) return;
-
- const [node, path] = match as NodeEntry<Element & { level: number }>;
-
- const depth = path.length;
-
- if (node.type === EditorNodeType.Page) return;
-
- if (depth === 1) return;
- editor.liftNodes({
- at: path,
- });
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/_shared/Placeholder.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/_shared/Placeholder.tsx
deleted file mode 100644
index d9a60f09ad..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/_shared/Placeholder.tsx
+++ /dev/null
@@ -1,13 +0,0 @@
-import React from 'react';
-import { Element } from 'slate';
-import PlaceholderContent from '$app/components/editor/components/blocks/_shared/PlaceholderContent';
-
-function Placeholder({ node, isEmpty }: { node: Element; isEmpty: boolean }) {
- if (!isEmpty) {
- return null;
- }
-
- return <PlaceholderContent node={node} />;
-}
-
-export default React.memo(Placeholder);
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/_shared/PlaceholderContent.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/_shared/PlaceholderContent.tsx
deleted file mode 100644
index 91645e0051..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/_shared/PlaceholderContent.tsx
+++ /dev/null
@@ -1,130 +0,0 @@
-import React, { CSSProperties, useEffect, useMemo, useState } from 'react';
-import { ReactEditor, useSelected, useSlate } from 'slate-react';
-import { Editor, Element, Range } from 'slate';
-import { EditorNodeType, HeadingNode } from '$app/application/document/document.types';
-import { useTranslation } from 'react-i18next';
-
-function PlaceholderContent({ node, ...attributes }: { node: Element; className?: string; style?: CSSProperties }) {
- const { t } = useTranslation();
- const editor = useSlate();
- const selected = useSelected() && !!editor.selection && Range.isCollapsed(editor.selection);
- const [isComposing, setIsComposing] = useState(false);
- const block = useMemo(() => {
- const path = ReactEditor.findPath(editor, node);
- const match = Editor.above(editor, {
- match: (n) => {
- return !Editor.isEditor(n) && Element.isElement(n) && n.blockId !== undefined && n.type !== undefined;
- },
- at: path,
- });
-
- if (!match) return null;
-
- return match[0] as Element;
- }, [editor, node]);
-
- const className = useMemo(() => {
- return `text-placeholder select-none ${attributes.className ?? ''}`;
- }, [attributes.className]);
-
- const unSelectedPlaceholder = useMemo(() => {
- switch (block?.type) {
- case EditorNodeType.Paragraph: {
- if (editor.children.length === 1) {
- return t('editor.slashPlaceHolder');
- }
-
- return '';
- }
-
- case EditorNodeType.ToggleListBlock:
- return t('blockPlaceholders.bulletList');
- case EditorNodeType.QuoteBlock:
- return t('blockPlaceholders.quote');
- case EditorNodeType.TodoListBlock:
- return t('blockPlaceholders.todoList');
- case EditorNodeType.NumberedListBlock:
- return t('blockPlaceholders.numberList');
- case EditorNodeType.BulletedListBlock:
- return t('blockPlaceholders.bulletList');
- case EditorNodeType.HeadingBlock: {
- const level = (block as HeadingNode).data.level;
-
- switch (level) {
- case 1:
- return t('editor.mobileHeading1');
- case 2:
- return t('editor.mobileHeading2');
- case 3:
- return t('editor.mobileHeading3');
- default:
- return '';
- }
- }
-
- case EditorNodeType.Page:
- return t('document.title.placeholder');
- case EditorNodeType.CalloutBlock:
- case EditorNodeType.CodeBlock:
- return t('editor.typeSomething');
- default:
- return '';
- }
- }, [block, t, editor.children.length]);
-
- const selectedPlaceholder = useMemo(() => {
- switch (block?.type) {
- case EditorNodeType.HeadingBlock:
- return unSelectedPlaceholder;
- case EditorNodeType.Page:
- return t('document.title.placeholder');
- case EditorNodeType.GridBlock:
- case EditorNodeType.EquationBlock:
- case EditorNodeType.CodeBlock:
- case EditorNodeType.DividerBlock:
- return '';
-
- default:
- return t('editor.slashPlaceHolder');
- }
- }, [block?.type, t, unSelectedPlaceholder]);
-
- useEffect(() => {
- if (!selected) return;
-
- const handleCompositionStart = () => {
- setIsComposing(true);
- };
-
- const handleCompositionEnd = () => {
- setIsComposing(false);
- };
-
- const editorDom = ReactEditor.toDOMNode(editor, editor);
-
- // placeholder should be hidden when composing
- editorDom.addEventListener('compositionstart', handleCompositionStart);
- editorDom.addEventListener('compositionend', handleCompositionEnd);
- editorDom.addEventListener('compositionupdate', handleCompositionStart);
- return () => {
- editorDom.removeEventListener('compositionstart', handleCompositionStart);
- editorDom.removeEventListener('compositionend', handleCompositionEnd);
- editorDom.removeEventListener('compositionupdate', handleCompositionStart);
- };
- }, [editor, selected]);
-
- if (isComposing) {
- return null;
- }
-
- return (
- <span
- placeholder={selected ? selectedPlaceholder : unSelectedPlaceholder}
- contentEditable={false}
- {...attributes}
- className={className}
- />
- );
-}
-
-export default PlaceholderContent;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/_shared/unSupportBlock.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/_shared/unSupportBlock.tsx
deleted file mode 100644
index 9e9e4fcb38..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/_shared/unSupportBlock.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import React, { forwardRef } from 'react';
-import { Alert } from '@mui/material';
-
-export const UnSupportBlock = forwardRef<HTMLDivElement, void>((_, ref) => {
- return (
- <div ref={ref}>
- <Alert className={'h-[48px] w-full'} title={'Unsupported block'} severity={'error'} />
- </div>
- );
-});
-
-export default UnSupportBlock;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/bulleted_list/BulletedList.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/bulleted_list/BulletedList.tsx
deleted file mode 100644
index 41fce1c9dc..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/bulleted_list/BulletedList.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import React, { forwardRef, memo } from 'react';
-import { EditorElementProps, BulletedListNode } from '$app/application/document/document.types';
-
-export const BulletedList = memo(
- forwardRef<HTMLDivElement, EditorElementProps<BulletedListNode>>(
- ({ node: _, children, className, ...attributes }, ref) => {
- return (
- <div ref={ref} {...attributes} className={`${className}`}>
- {children}
- </div>
- );
- }
- )
-);
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/bulleted_list/BulletedListIcon.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/bulleted_list/BulletedListIcon.tsx
deleted file mode 100644
index ea0de80f55..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/bulleted_list/BulletedListIcon.tsx
+++ /dev/null
@@ -1,51 +0,0 @@
-import React, { useMemo } from 'react';
-import { BulletedListNode } from '$app/application/document/document.types';
-import { ReactEditor, useSlateStatic } from 'slate-react';
-import { CustomEditor } from '$app/components/editor/command';
-
-enum Letter {
- Disc,
- Circle,
- Square,
-}
-
-function BulletedListIcon({ block, className }: { block: BulletedListNode; className: string }) {
- const staticEditor = useSlateStatic();
- const path = ReactEditor.findPath(staticEditor, block);
-
- const letter = useMemo(() => {
- const level = CustomEditor.getListLevel(staticEditor, block.type, path);
-
- if (level % 3 === 0) {
- return Letter.Disc;
- } else if (level % 3 === 1) {
- return Letter.Circle;
- } else {
- return Letter.Square;
- }
- }, [block.type, staticEditor, path]);
-
- const dataLetter = useMemo(() => {
- switch (letter) {
- case Letter.Disc:
- return '•';
- case Letter.Circle:
- return '◦';
- case Letter.Square:
- return '▪';
- }
- }, [letter]);
-
- return (
- <span
- onMouseDown={(e) => {
- e.preventDefault();
- }}
- data-letter={dataLetter}
- contentEditable={false}
- className={`${className} bulleted-icon flex min-w-[24px] justify-center pr-1 font-medium`}
- />
- );
-}
-
-export default BulletedListIcon;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/bulleted_list/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/bulleted_list/index.ts
deleted file mode 100644
index 2095dff308..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/bulleted_list/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './BulletedList';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/callout/Callout.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/callout/Callout.tsx
deleted file mode 100644
index a20300bbc2..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/callout/Callout.tsx
+++ /dev/null
@@ -1,20 +0,0 @@
-import React, { forwardRef, memo } from 'react';
-import { EditorElementProps, CalloutNode } from '$app/application/document/document.types';
-import CalloutIcon from '$app/components/editor/components/blocks/callout/CalloutIcon';
-
-export const Callout = memo(
- forwardRef<HTMLDivElement, EditorElementProps<CalloutNode>>(({ node, children, ...attributes }, ref) => {
- return (
- <>
- <div contentEditable={false} className={'absolute w-full select-none px-2 pt-[15px]'}>
- <CalloutIcon node={node} />
- </div>
- <div ref={ref} className={`${attributes.className ?? ''} w-full bg-bg-body py-2`}>
- <div {...attributes} className={`flex w-full flex-col rounded bg-content-blue-50 py-2 pl-10`}>
- {children}
- </div>
- </div>
- </>
- );
- })
-);
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/callout/CalloutIcon.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/callout/CalloutIcon.tsx
deleted file mode 100644
index e9bba448a7..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/callout/CalloutIcon.tsx
+++ /dev/null
@@ -1,69 +0,0 @@
-import React, { useCallback, useRef, useState } from 'react';
-import { IconButton } from '@mui/material';
-import { CalloutNode } from '$app/application/document/document.types';
-import EmojiPicker from '$app/components/_shared/emoji_picker/EmojiPicker';
-import Popover from '@mui/material/Popover';
-import { PopoverCommonProps } from '$app/components/editor/components/tools/popover';
-import { ReactEditor, useSlateStatic } from 'slate-react';
-import { CustomEditor } from '$app/components/editor/command';
-
-function CalloutIcon({ node }: { node: CalloutNode }) {
- const ref = useRef<HTMLButtonElement>(null);
- const [open, setOpen] = useState(false);
- const editor = useSlateStatic();
-
- const handleClose = useCallback(() => {
- setOpen(false);
- const path = ReactEditor.findPath(editor, node);
-
- ReactEditor.focus(editor);
- editor.select(path);
- editor.collapse({
- edge: 'start',
- });
- }, [editor, node]);
- const handleEmojiSelect = useCallback(
- (emoji: string) => {
- CustomEditor.setCalloutIcon(editor, node, emoji);
- handleClose();
- },
- [editor, node, handleClose]
- );
-
- return (
- <>
- <IconButton
- contentEditable={false}
- ref={ref}
- onClick={() => {
- setOpen(true);
- }}
- className={`h-8 w-8 p-1`}
- >
- {node.data.icon}
- </IconButton>
- {open && (
- <Popover
- {...PopoverCommonProps}
- className={'border-none bg-transparent shadow-none'}
- anchorEl={ref.current}
- disableAutoFocus={true}
- open={open}
- onClose={handleClose}
- anchorOrigin={{
- vertical: 'bottom',
- horizontal: 'right',
- }}
- transformOrigin={{
- vertical: 'top',
- horizontal: 'left',
- }}
- >
- <EmojiPicker onEscape={handleClose} onEmojiSelect={handleEmojiSelect} />
- </Popover>
- )}
- </>
- );
-}
-
-export default React.memo(CalloutIcon);
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/callout/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/callout/index.ts
deleted file mode 100644
index 4ca74e4be8..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/callout/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './Callout';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/code/Code.hooks.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/code/Code.hooks.ts
deleted file mode 100644
index 0b043f4579..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/code/Code.hooks.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-import { useCallback } from 'react';
-import { ReactEditor, useSlateStatic } from 'slate-react';
-import { Element as SlateElement, Transforms } from 'slate';
-import { CodeNode } from '$app/application/document/document.types';
-
-export function useCodeBlock(node: CodeNode) {
- const language = node.data.language;
- const editor = useSlateStatic() as ReactEditor;
- const handleChangeLanguage = useCallback(
- (newLang: string) => {
- const path = ReactEditor.findPath(editor, node);
- const newProperties = {
- data: {
- language: newLang,
- },
- } as Partial<SlateElement>;
-
- Transforms.setNodes(editor, newProperties, { at: path });
- },
- [editor, node]
- );
-
- return {
- language,
- handleChangeLanguage,
- };
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/code/Code.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/code/Code.tsx
deleted file mode 100644
index 7fe7b205f4..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/code/Code.tsx
+++ /dev/null
@@ -1,39 +0,0 @@
-import { forwardRef, memo, useCallback } from 'react';
-import { EditorElementProps, CodeNode } from '$app/application/document/document.types';
-import LanguageSelect from './SelectLanguage';
-
-import { useCodeBlock } from '$app/components/editor/components/blocks/code/Code.hooks';
-import { ReactEditor, useSlateStatic } from 'slate-react';
-
-export const Code = memo(
- forwardRef<HTMLDivElement, EditorElementProps<CodeNode>>(({ node, children, ...attributes }, ref) => {
- const { language, handleChangeLanguage } = useCodeBlock(node);
-
- const editor = useSlateStatic();
- const onBlur = useCallback(() => {
- const path = ReactEditor.findPath(editor, node);
-
- ReactEditor.focus(editor);
- editor.select(path);
- editor.collapse({
- edge: 'start',
- });
- }, [editor, node]);
-
- return (
- <>
- <div contentEditable={false} className={'absolute mt-2 flex h-20 w-full select-none items-center px-6'}>
- <LanguageSelect onBlur={onBlur} language={language} onChangeLanguage={handleChangeLanguage} />
- </div>
- <div {...attributes} ref={ref} className={`${attributes.className ?? ''} flex w-full bg-bg-body py-2`}>
- <pre
- spellCheck={false}
- className={`flex w-full rounded border border-solid border-line-divider bg-content-blue-50 p-5 pt-20`}
- >
- <code>{children}</code>
- </pre>
- </div>
- </>
- );
- })
-);
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/code/SelectLanguage.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/code/SelectLanguage.tsx
deleted file mode 100644
index 4805233e1d..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/code/SelectLanguage.tsx
+++ /dev/null
@@ -1,168 +0,0 @@
-import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
-import { TextField, Popover } from '@mui/material';
-import { useTranslation } from 'react-i18next';
-import { supportLanguage } from './constants';
-import KeyboardNavigation, {
- KeyboardNavigationOption,
-} from '$app/components/_shared/keyboard_navigation/KeyboardNavigation';
-import usePopoverAutoPosition from '$app/components/_shared/popover/Popover.hooks';
-import { PopoverOrigin } from '@mui/material/Popover/Popover';
-
-const initialOrigin: {
- transformOrigin: PopoverOrigin;
- anchorOrigin: PopoverOrigin;
-} = {
- transformOrigin: {
- vertical: 'top',
- horizontal: 'left',
- },
- anchorOrigin: {
- vertical: 'bottom',
- horizontal: 'left',
- },
-};
-
-function SelectLanguage({
- language = 'json',
- onChangeLanguage,
- onBlur,
-}: {
- language: string;
- onChangeLanguage: (language: string) => void;
- onBlur?: () => void;
-}) {
- const { t } = useTranslation();
- const ref = useRef<HTMLDivElement>(null);
- const [open, setOpen] = useState(false);
- const [search, setSearch] = useState('');
-
- const searchRef = useRef<HTMLDivElement>(null);
- const scrollRef = useRef<HTMLDivElement>(null);
- const options: KeyboardNavigationOption[] = useMemo(() => {
- return supportLanguage
- .map((item) => ({
- key: item.id,
- content: item.title,
- }))
- .filter((item) => {
- return item.content?.toLowerCase().includes(search.toLowerCase());
- });
- }, [search]);
-
- const handleClose = useCallback(() => {
- setOpen(false);
- setSearch('');
- }, []);
-
- const handleConfirm = useCallback(
- (key: string) => {
- onChangeLanguage(key);
- handleClose();
- },
- [onChangeLanguage, handleClose]
- );
-
- useEffect(() => {
- const element = ref.current;
-
- if (!element) return;
- const handleKeyDown = (e: KeyboardEvent) => {
- e.stopPropagation();
- e.preventDefault();
-
- if (e.key === 'Enter') {
- setOpen(true);
- return;
- }
-
- onBlur?.();
- };
-
- element.addEventListener('keydown', handleKeyDown);
-
- return () => {
- element.removeEventListener('keydown', handleKeyDown);
- };
- }, [onBlur]);
-
- const { paperHeight, transformOrigin, anchorOrigin, isEntered } = usePopoverAutoPosition({
- initialPaperWidth: 200,
- initialPaperHeight: 220,
- anchorEl: ref.current,
- initialAnchorOrigin: initialOrigin.anchorOrigin,
- initialTransformOrigin: initialOrigin.transformOrigin,
- open,
- });
-
- return (
- <>
- <TextField
- ref={ref}
- size={'small'}
- variant={'standard'}
- sx={{
- '& .MuiInputBase-root, & .MuiInputBase-input': {
- userSelect: 'none',
- },
- }}
- className={'w-[150px]'}
- value={language}
- onClick={() => {
- setOpen(true);
- }}
- InputProps={{
- readOnly: true,
- }}
- placeholder={t('document.codeBlock.language.placeholder')}
- label={t('document.codeBlock.language.label')}
- />
-
- {open && (
- <Popover
- disableAutoFocus={true}
- disableRestoreFocus={true}
- anchorOrigin={anchorOrigin}
- transformOrigin={transformOrigin}
- anchorEl={ref.current}
- keepMounted={false}
- open={open && isEntered}
- onClose={handleClose}
- >
- <div
- style={{
- height: paperHeight,
- }}
- className={'flex max-h-[220px] w-[200px] flex-col overflow-hidden py-2'}
- >
- <TextField
- ref={searchRef}
- value={search}
- autoComplete={'off'}
- spellCheck={false}
- autoCorrect={'off'}
- onChange={(e) => setSearch(e.target.value)}
- size={'small'}
- autoFocus={true}
- variant={'standard'}
- className={'px-2 text-xs'}
- placeholder={t('search.label')}
- />
- <div ref={scrollRef} className={'flex-1 overflow-y-auto overflow-x-hidden'}>
- <KeyboardNavigation
- disableFocus={true}
- focusRef={searchRef}
- onConfirm={handleConfirm}
- defaultFocusedKey={language}
- scrollRef={scrollRef}
- options={options}
- onEscape={handleClose}
- />
- </div>
- </div>
- </Popover>
- )}
- </>
- );
-}
-
-export default SelectLanguage;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/code/constants.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/code/constants.ts
deleted file mode 100644
index dee71624db..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/code/constants.ts
+++ /dev/null
@@ -1,154 +0,0 @@
-export const supportLanguage = [
- {
- id: 'bash',
- title: 'Bash',
- },
- {
- id: 'basic',
- title: 'Basic',
- },
- {
- id: 'c',
- title: 'C',
- },
- {
- id: 'clojure',
- title: 'Clojure',
- },
- {
- id: 'cpp',
- title: 'C++',
- },
- {
- id: 'cs',
- title: 'CS',
- },
- {
- id: 'css',
- title: 'CSS',
- },
- {
- id: 'dart',
- title: 'Dart',
- },
- {
- id: 'elixir',
- title: 'Elixir',
- },
- {
- id: 'elm',
- title: 'Elm',
- },
- {
- id: 'erlang',
- title: 'Erlang',
- },
- {
- id: 'fortran',
- title: 'Fortran',
- },
- {
- id: 'go',
- title: 'Go',
- },
- {
- id: 'graphql',
- title: 'GraphQL',
- },
- {
- id: 'haskell',
- title: 'Haskell',
- },
- {
- id: 'java',
- title: 'Java',
- },
- {
- id: 'javascript',
- title: 'JavaScript',
- },
- {
- id: 'json',
- title: 'JSON',
- },
- {
- id: 'kotlin',
- title: 'Kotlin',
- },
- {
- id: 'lisp',
- title: 'Lisp',
- },
- {
- id: 'lua',
- title: 'Lua',
- },
- {
- id: 'markdown',
- title: 'Markdown',
- },
- {
- id: 'matlab',
- title: 'Matlab',
- },
- {
- id: 'ocaml',
- title: 'OCaml',
- },
- {
- id: 'perl',
- title: 'Perl',
- },
- {
- id: 'php',
- title: 'PHP',
- },
- {
- id: 'powershell',
- title: 'Powershell',
- },
- {
- id: 'python',
- title: 'Python',
- },
- {
- id: 'r',
- title: 'R',
- },
- {
- id: 'ruby',
- title: 'Ruby',
- },
- {
- id: 'rust',
- title: 'Rust',
- },
- {
- id: 'scala',
- title: 'Scala',
- },
- {
- id: 'shell',
- title: 'Shell',
- },
- {
- id: 'sql',
- title: 'SQL',
- },
- {
- id: 'swift',
- title: 'Swift',
- },
- {
- id: 'typescript',
- title: 'TypeScript',
- },
- {
- id: 'xml',
- title: 'XML',
- },
- {
- id: 'yaml',
- title: 'YAML',
- },
-];
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/code/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/code/index.ts
deleted file mode 100644
index c3aa9443d1..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/code/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './Code';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/code/utils.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/code/utils.ts
deleted file mode 100644
index 52eeebc8c4..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/code/utils.ts
+++ /dev/null
@@ -1,132 +0,0 @@
-import Prism from 'prismjs';
-
-import 'prismjs/components/prism-bash';
-import 'prismjs/components/prism-basic';
-import 'prismjs/components/prism-c';
-import 'prismjs/components/prism-clojure';
-import 'prismjs/components/prism-cpp';
-import 'prismjs/components/prism-csp';
-import 'prismjs/components/prism-css';
-import 'prismjs/components/prism-dart';
-import 'prismjs/components/prism-elixir';
-import 'prismjs/components/prism-elm';
-import 'prismjs/components/prism-erlang';
-import 'prismjs/components/prism-fortran';
-import 'prismjs/components/prism-go';
-import 'prismjs/components/prism-graphql';
-import 'prismjs/components/prism-haskell';
-import 'prismjs/components/prism-java';
-import 'prismjs/components/prism-javascript';
-import 'prismjs/components/prism-json';
-import 'prismjs/components/prism-kotlin';
-import 'prismjs/components/prism-lisp';
-import 'prismjs/components/prism-lua';
-import 'prismjs/components/prism-markdown';
-import 'prismjs/components/prism-matlab';
-import 'prismjs/components/prism-ocaml';
-import 'prismjs/components/prism-perl';
-import 'prismjs/components/prism-php';
-import 'prismjs/components/prism-powershell';
-import 'prismjs/components/prism-python';
-import 'prismjs/components/prism-r';
-import 'prismjs/components/prism-ruby';
-import 'prismjs/components/prism-rust';
-import 'prismjs/components/prism-scala';
-import 'prismjs/components/prism-shell-session';
-import 'prismjs/components/prism-sql';
-import 'prismjs/components/prism-swift';
-import 'prismjs/components/prism-typescript';
-import 'prismjs/components/prism-xml-doc';
-import 'prismjs/components/prism-yaml';
-
-import { BaseRange, NodeEntry, Text, Path } from 'slate';
-
-const push_string = (
- token: string | Prism.Token,
- path: Path,
- start: number,
- ranges: BaseRange[],
- token_type = 'text'
-) => {
- let newStart = start;
-
- ranges.push({
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
- // @ts-ignore
- prism_token: token_type,
- anchor: { path, offset: newStart },
- focus: { path, offset: newStart + token.length },
- });
- newStart += token.length;
- return newStart;
-};
-
-// This recurses through the Prism.tokenizes result and creates stylized ranges based on the token type
-const recurseTokenize = (
- token: string | Prism.Token,
- path: Path,
- ranges: BaseRange[],
- start: number,
- parent_tag?: string
-) => {
- // Uses the parent's token type if a Token only has a string as its content
- if (typeof token === 'string') {
- return push_string(token, path, start, ranges, parent_tag);
- }
-
- if ('content' in token) {
- if (token.content instanceof Array) {
- // Calls recurseTokenize on nested Tokens in content
- let newStart = start;
-
- for (const subToken of token.content) {
- newStart = recurseTokenize(subToken, path, ranges, newStart, token.type) || 0;
- }
-
- return newStart;
- }
-
- return push_string(token.content, path, start, ranges, token.type);
- }
-};
-
-function switchCodeTheme(isDark: boolean) {
- const link = document.getElementById('prism-css');
-
- if (link) {
- document.head.removeChild(link);
- }
-
- const newLink = document.createElement('link');
-
- newLink.rel = 'stylesheet';
- newLink.href = isDark
- ? 'https://cdnjs.cloudflare.com/ajax/libs/prism/1.24.1/themes/prism-dark.min.css'
- : 'https://cdnjs.cloudflare.com/ajax/libs/prism/1.24.1/themes/prism.min.css';
- newLink.id = 'prism-css';
- document.head.appendChild(newLink);
-}
-
-export const decorateCode = ([node, path]: NodeEntry, language: string, isDark: boolean) => {
- switchCodeTheme(isDark);
-
- const ranges: BaseRange[] = [];
-
- if (!Text.isText(node)) {
- return ranges;
- }
-
- try {
- const tokens = Prism.tokenize(node.text, Prism.languages[language]);
-
- let start = 0;
-
- for (const token of tokens) {
- start = recurseTokenize(token, path, ranges, start) || 0;
- }
-
- return ranges;
- } catch {
- return ranges;
- }
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/database/DatabaseEmpty.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/database/DatabaseEmpty.tsx
deleted file mode 100644
index a0f50016e1..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/database/DatabaseEmpty.tsx
+++ /dev/null
@@ -1,42 +0,0 @@
-import React, { useCallback, useRef } from 'react';
-import CreateNewFolderIcon from '@mui/icons-material/CreateNewFolder';
-
-import { GridNode } from '$app/application/document/document.types';
-import { useTranslation } from 'react-i18next';
-
-import Drawer from '$app/components/editor/components/blocks/database/Drawer';
-
-function DatabaseEmpty({ node }: { node: GridNode }) {
- const { t } = useTranslation();
- const ref = useRef<HTMLDivElement>(null);
-
- const [open, setOpen] = React.useState(false);
-
- const toggleDrawer = useCallback((open: boolean) => {
- return (e: React.MouseEvent | KeyboardEvent | React.FocusEvent) => {
- e.stopPropagation();
- setOpen(open);
- };
- }, []);
-
- return (
- <div
- ref={ref}
- onClick={toggleDrawer(false)}
- className='relative flex w-full flex-1 flex-col items-center justify-center py-2 text-text-caption'
- >
- <CreateNewFolderIcon className={'h-10 w-10'} />
- <div className={'mb-2 text-base'}>{t('document.plugins.database.noDataSource')}</div>
- <div>
- <span onClick={toggleDrawer(true)} className={'mx-2 cursor-pointer underline'}>
- {t('document.plugins.database.selectADataSource')}
- </span>
- {t('document.plugins.database.toContinue')}
- </div>
-
- <Drawer toggleDrawer={toggleDrawer} open={open} node={node} />
- </div>
- );
-}
-
-export default React.memo(DatabaseEmpty);
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/database/DatabaseList.hooks.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/database/DatabaseList.hooks.ts
deleted file mode 100644
index 543b9900ca..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/database/DatabaseList.hooks.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-import { useAppSelector } from '$app/stores/store';
-import { ViewLayoutPB } from '@/services/backend';
-
-export function useLoadDatabaseList({ searchText, layout }: { searchText: string; layout: ViewLayoutPB }) {
- const list = useAppSelector((state) => {
- const workspaces = state.workspace.workspaces.map((item) => item.id) ?? [];
-
- return Object.values(state.pages.pageMap).filter((page) => {
- if (page.layout !== layout) return false;
- const parentId = page.parentId;
-
- if (!parentId) return false;
-
- const parent = state.pages.pageMap[parentId];
- const parentLayout = parent?.layout;
-
- if (!workspaces.includes(parentId) && parentLayout !== ViewLayoutPB.Document) return false;
-
- return page.name.toLowerCase().includes(searchText.toLowerCase());
- });
- });
-
- return {
- list,
- };
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/database/DatabaseList.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/database/DatabaseList.tsx
deleted file mode 100644
index 5d06a13c06..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/database/DatabaseList.tsx
+++ /dev/null
@@ -1,104 +0,0 @@
-import React, { useCallback, useMemo } from 'react';
-import { useTranslation } from 'react-i18next';
-import { TextField } from '@mui/material';
-import { useLoadDatabaseList } from '$app/components/editor/components/blocks/database/DatabaseList.hooks';
-import { ViewLayoutPB } from '@/services/backend';
-import { ReactComponent as GridSvg } from '$app/assets/grid.svg';
-import { useSlateStatic } from 'slate-react';
-import { CustomEditor } from '$app/components/editor/command';
-import { GridNode } from '$app/application/document/document.types';
-import KeyboardNavigation, {
- KeyboardNavigationOption,
-} from '$app/components/_shared/keyboard_navigation/KeyboardNavigation';
-import { Page } from '$app_reducers/pages/slice';
-
-function DatabaseList({
- node,
- toggleDrawer,
-}: {
- node: GridNode;
- toggleDrawer: (open: boolean) => (e: React.MouseEvent | KeyboardEvent | React.FocusEvent) => void;
-}) {
- const scrollRef = React.useRef<HTMLDivElement>(null);
-
- const inputRef = React.useRef<HTMLElement>(null);
- const editor = useSlateStatic();
- const { t } = useTranslation();
- const [searchText, setSearchText] = React.useState<string>('');
- const { list } = useLoadDatabaseList({
- searchText: searchText || '',
- layout: ViewLayoutPB.Grid,
- });
-
- const renderItem = useCallback(
- (item: Page) => {
- return (
- <div className={'flex items-center text-text-title'}>
- <GridSvg className={'mr-2 h-4 w-4'} />
- <div className={'truncate'}>{item.name.trim() || t('menuAppHeader.defaultNewPageName')}</div>
- </div>
- );
- },
- [t]
- );
-
- const options: KeyboardNavigationOption[] = useMemo(() => {
- return list.map((item) => {
- return {
- key: item.id,
- content: renderItem(item),
- };
- });
- }, [list, renderItem]);
-
- const handleSelected = useCallback(
- (id: string) => {
- CustomEditor.setGridBlockViewId(editor, node, id);
- },
- [editor, node]
- );
-
- const handleKeyDown = useCallback(
- (e: KeyboardEvent) => {
- if (e.key === 'Escape') {
- e.stopPropagation();
- e.preventDefault();
- toggleDrawer(false)(e);
- }
- },
- [toggleDrawer]
- );
-
- return (
- <div className={'relative flex h-full flex-col gap-1.5 p-2'}>
- <TextField
- variant={'standard'}
- autoFocus={true}
- spellCheck={false}
- onBlur={toggleDrawer(false)}
- inputRef={inputRef}
- className={'sticky top-0 z-10 px-2'}
- value={searchText}
- onChange={(e) => {
- setSearchText((e.currentTarget as HTMLInputElement).value);
- }}
- inputProps={{
- className: 'py-2 text-sm',
- }}
- placeholder={t('document.plugins.database.linkToDatabase')}
- />
- <div ref={scrollRef} className={'flex-1 overflow-y-auto overflow-x-hidden'}>
- <KeyboardNavigation
- disableFocus={true}
- onKeyDown={handleKeyDown}
- focusRef={inputRef}
- scrollRef={scrollRef}
- options={options}
- onConfirm={handleSelected}
- />
- </div>
- </div>
- );
-}
-
-export default DatabaseList;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/database/Drawer.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/database/Drawer.tsx
deleted file mode 100644
index 54c0005027..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/database/Drawer.tsx
+++ /dev/null
@@ -1,73 +0,0 @@
-import React, { useCallback } from 'react';
-import { Button, IconButton } from '@mui/material';
-import { useTranslation } from 'react-i18next';
-import { createGrid } from '$app/components/editor/components/blocks/database/utils';
-import { CustomEditor } from '$app/components/editor/command';
-import { useSlateStatic } from 'slate-react';
-import { useEditorId } from '$app/components/editor/Editor.hooks';
-import { GridNode } from '$app/application/document/document.types';
-import { ReactComponent as CloseSvg } from '$app/assets/close.svg';
-import { ReactComponent as AddSvg } from '$app/assets/add.svg';
-import DatabaseList from '$app/components/editor/components/blocks/database/DatabaseList';
-
-function Drawer({
- open,
- toggleDrawer,
- node,
-}: {
- open: boolean;
- toggleDrawer: (open: boolean) => (e: React.MouseEvent | KeyboardEvent | React.FocusEvent) => void;
- node: GridNode;
-}) {
- const editor = useSlateStatic();
- const id = useEditorId();
- const { t } = useTranslation();
- const handleCreateGrid = useCallback(async () => {
- const gridId = await createGrid(id);
-
- CustomEditor.setGridBlockViewId(editor, node, gridId);
- }, [id, editor, node]);
-
- return (
- <div
- onClick={(e) => {
- e.stopPropagation();
- }}
- className={'absolute right-0 top-0 h-full transform overflow-hidden'}
- style={{
- width: open ? '250px' : '0px',
- transition: 'width 0.3s ease-in-out',
- }}
- onMouseDown={(e) => {
- const isInput = (e.target as HTMLElement).closest('input');
-
- if (isInput) return;
- e.stopPropagation();
- e.preventDefault();
- }}
- >
- <div className={'flex h-full w-[250px] flex-col border-l border-line-divider'}>
- <div className={'flex h-[48px] w-full items-center justify-between p-2'}>
- <div className={'px-2 font-medium'}>{t('document.plugins.database.selectDataSource')}</div>
- <IconButton onClick={toggleDrawer(false)}>
- <CloseSvg />
- </IconButton>
- </div>
- <div className={'flex-1 overflow-hidden'}>
- {open && <DatabaseList toggleDrawer={toggleDrawer} node={node} />}
- </div>
-
- <div
- onClick={handleCreateGrid}
- className={'sticky bottom-0 left-0 h-[48px] w-full border-t border-line-divider p-2'}
- >
- <Button color={'inherit'} className={'w-full justify-start'} startIcon={<AddSvg />}>
- {t('document.plugins.database.newDatabase')}
- </Button>
- </div>
- </div>
- </div>
- );
-}
-
-export default Drawer;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/database/GridBlock.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/database/GridBlock.tsx
deleted file mode 100644
index 936da9c2c8..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/database/GridBlock.tsx
+++ /dev/null
@@ -1,31 +0,0 @@
-import React, { forwardRef, memo } from 'react';
-import { EditorElementProps, GridNode } from '$app/application/document/document.types';
-
-import GridView from '$app/components/editor/components/blocks/database/GridView';
-import DatabaseEmpty from '$app/components/editor/components/blocks/database/DatabaseEmpty';
-import { useSelected } from 'slate-react';
-
-export const GridBlock = memo(
- forwardRef<HTMLDivElement, EditorElementProps<GridNode>>(({ node, children, className = '', ...attributes }, ref) => {
- const viewId = node.data.viewId;
- const selected = useSelected();
-
- return (
- <div {...attributes} className={`${className} grid-block relative w-full bg-bg-body`}>
- <div ref={ref} className={'absolute left-0 top-0 h-full w-full caret-transparent'}>
- {children}
- </div>
- <div
- contentEditable={false}
- className={`flex h-[400px] w-full overflow-hidden border-b border-t ${
- selected ? 'border-fill-list-hover' : 'border-line-divider'
- } py-3 caret-text-title`}
- >
- {viewId ? <GridView viewId={viewId} /> : <DatabaseEmpty node={node} />}
- </div>
- </div>
- );
- })
-);
-
-export default GridBlock;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/database/GridView.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/database/GridView.tsx
deleted file mode 100644
index 695482bbd8..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/database/GridView.tsx
+++ /dev/null
@@ -1,71 +0,0 @@
-import React, { useCallback, useEffect, useRef, useState } from 'react';
-import { Database, DatabaseRenderedProvider } from '$app/components/database';
-import { ViewIdProvider } from '$app/hooks';
-
-function GridView({ viewId }: { viewId: string }) {
- const [selectedViewId, onChangeSelectedViewId] = useState(viewId);
-
- const ref = useRef<HTMLDivElement>(null);
-
- const [rendered, setRendered] = useState<{ viewId: string; rendered: boolean } | undefined>(undefined);
-
- // delegate wheel event to layout when grid is scrolled to top or bottom
- useEffect(() => {
- const element = ref.current;
-
- const viewId = rendered?.viewId;
-
- if (!viewId || !element) {
- return;
- }
-
- const gridScroller = element.querySelector(`[data-view-id="${viewId}"] .grid-scroll-container`) as HTMLDivElement;
-
- const scrollLayout = gridScroller?.closest('.appflowy-scroll-container') as HTMLDivElement;
-
- if (!gridScroller || !scrollLayout) {
- return;
- }
-
- const onWheel = (event: WheelEvent) => {
- const deltaY = event.deltaY;
- const deltaX = event.deltaX;
-
- if (Math.abs(deltaX) > 8) {
- return;
- }
-
- const { scrollTop, scrollHeight, clientHeight } = gridScroller;
-
- const atTop = deltaY < 0 && scrollTop === 0;
- const atBottom = deltaY > 0 && scrollTop + clientHeight >= scrollHeight;
-
- // if at top or bottom, prevent default to allow layout to scroll
- if (atTop || atBottom) {
- scrollLayout.scrollTop += deltaY;
- }
- };
-
- gridScroller.addEventListener('wheel', onWheel, { passive: false });
- return () => {
- gridScroller.removeEventListener('wheel', onWheel);
- };
- }, [rendered]);
-
- const onRendered = useCallback((viewId: string) => {
- setRendered({
- viewId,
- rendered: true,
- });
- }, []);
-
- return (
- <ViewIdProvider value={viewId}>
- <DatabaseRenderedProvider value={onRendered}>
- <Database ref={ref} selectedViewId={selectedViewId} setSelectedViewId={onChangeSelectedViewId} />
- </DatabaseRenderedProvider>
- </ViewIdProvider>
- );
-}
-
-export default React.memo(GridView);
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/database/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/database/index.ts
deleted file mode 100644
index 986343f9df..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/database/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './GridBlock';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/database/utils.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/database/utils.ts
deleted file mode 100644
index 032502b415..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/database/utils.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import { ViewLayoutPB } from '@/services/backend';
-import { createPage } from '$app/application/folder/page.service';
-
-export async function createGrid(pageId: string) {
- const newViewId = await createPage({
- layout: ViewLayoutPB.Grid,
- name: '',
- parent_view_id: pageId,
- });
-
- return newViewId;
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/divider/DividerNode.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/divider/DividerNode.tsx
deleted file mode 100644
index d7d475199b..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/divider/DividerNode.tsx
+++ /dev/null
@@ -1,28 +0,0 @@
-import React, { forwardRef, memo, useMemo } from 'react';
-import { EditorElementProps, DividerNode as DividerNodeType } from '$app/application/document/document.types';
-import { useSelected } from 'slate-react';
-
-export const DividerNode = memo(
- forwardRef<HTMLDivElement, EditorElementProps<DividerNodeType>>(
- ({ node: _node, children: children, ...attributes }, ref) => {
- const selected = useSelected();
-
- const className = useMemo(() => {
- return `${attributes.className ?? ''} divider-node relative w-full rounded ${
- selected ? 'bg-content-blue-100' : ''
- }`;
- }, [attributes.className, selected]);
-
- return (
- <div {...attributes} className={className}>
- <div contentEditable={false} className={'w-full px-1 py-2 text-line-divider'}>
- <hr />
- </div>
- <div ref={ref} className={`absolute h-full w-full caret-transparent`}>
- {children}
- </div>
- </div>
- );
- }
- )
-);
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/divider/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/divider/index.ts
deleted file mode 100644
index 8f6141749a..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/divider/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './DividerNode';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/heading/Heading.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/heading/Heading.tsx
deleted file mode 100644
index 4d23069c46..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/heading/Heading.tsx
+++ /dev/null
@@ -1,18 +0,0 @@
-import React, { forwardRef, memo } from 'react';
-import { EditorElementProps, HeadingNode } from '$app/application/document/document.types';
-import { getHeadingCssProperty } from '$app/components/editor/plugins/utils';
-
-export const Heading = memo(
- forwardRef<HTMLDivElement, EditorElementProps<HeadingNode>>(({ node, children, ...attributes }, ref) => {
- const level = node.data.level;
- const fontSizeCssProperty = getHeadingCssProperty(level);
-
- const className = `${attributes.className ?? ''} ${fontSizeCssProperty}`;
-
- return (
- <div {...attributes} ref={ref} className={className}>
- {children}
- </div>
- );
- })
-);
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/heading/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/heading/index.ts
deleted file mode 100644
index 6406e7b07f..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/heading/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './Heading';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/image/ImageActions.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/image/ImageActions.tsx
deleted file mode 100644
index b3d3575af2..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/image/ImageActions.tsx
+++ /dev/null
@@ -1,163 +0,0 @@
-import React, { useMemo, useState } from 'react';
-import { ImageNode } from '$app/application/document/document.types';
-import { ReactComponent as CopyIcon } from '$app/assets/copy.svg';
-import { ReactComponent as AlignLeftIcon } from '$app/assets/align-left.svg';
-import { ReactComponent as AlignCenterIcon } from '$app/assets/align-center.svg';
-import { ReactComponent as AlignRightIcon } from '$app/assets/align-right.svg';
-import { ReactComponent as DeleteIcon } from '$app/assets/delete.svg';
-import { useTranslation } from 'react-i18next';
-import { IconButton } from '@mui/material';
-import { notify } from '$app/components/_shared/notify';
-import { CustomEditor } from '$app/components/editor/command';
-import { useSlateStatic } from 'slate-react';
-import Popover from '@mui/material/Popover';
-import Tooltip from '@mui/material/Tooltip';
-
-enum ImageAction {
- Copy = 'copy',
- AlignLeft = 'left',
- AlignCenter = 'center',
- AlignRight = 'right',
- Delete = 'delete',
-}
-
-function ImageActions({ node }: { node: ImageNode }) {
- const { t } = useTranslation();
- const align = node.data.align;
- const editor = useSlateStatic();
- const [alignAnchorEl, setAlignAnchorEl] = useState<null | HTMLElement>(null);
- const alignOptions = useMemo(() => {
- return [
- {
- key: ImageAction.AlignLeft,
- Icon: AlignLeftIcon,
- onClick: () => {
- CustomEditor.setImageBlockData(editor, node, { align: 'left' });
- setAlignAnchorEl(null);
- },
- },
- {
- key: ImageAction.AlignCenter,
- Icon: AlignCenterIcon,
- onClick: () => {
- CustomEditor.setImageBlockData(editor, node, { align: 'center' });
- setAlignAnchorEl(null);
- },
- },
- {
- key: ImageAction.AlignRight,
- Icon: AlignRightIcon,
- onClick: () => {
- CustomEditor.setImageBlockData(editor, node, { align: 'right' });
- setAlignAnchorEl(null);
- },
- },
- ];
- }, [editor, node]);
- const options = useMemo(() => {
- return [
- {
- key: ImageAction.Copy,
- Icon: CopyIcon,
- tooltip: t('button.copyLink'),
- onClick: () => {
- if (!node.data.url) return;
- void navigator.clipboard.writeText(node.data.url);
- notify.success(t('message.copy.success'));
- },
- },
- (!align || align === 'left') && {
- key: ImageAction.AlignLeft,
- Icon: AlignLeftIcon,
- tooltip: t('button.align'),
- onClick: (e: React.MouseEvent<HTMLButtonElement>) => {
- setAlignAnchorEl(e.currentTarget);
- },
- },
- align === 'center' && {
- key: ImageAction.AlignCenter,
- Icon: AlignCenterIcon,
- tooltip: t('button.align'),
- onClick: (e: React.MouseEvent<HTMLButtonElement>) => {
- setAlignAnchorEl(e.currentTarget);
- },
- },
- align === 'right' && {
- key: ImageAction.AlignRight,
- Icon: AlignRightIcon,
- tooltip: t('button.align'),
- onClick: (e: React.MouseEvent<HTMLButtonElement>) => {
- setAlignAnchorEl(e.currentTarget);
- },
- },
- {
- key: ImageAction.Delete,
- Icon: DeleteIcon,
- tooltip: t('button.delete'),
- onClick: () => {
- CustomEditor.deleteNode(editor, node);
- },
- },
- ].filter(Boolean) as {
- key: ImageAction;
- Icon: React.FC<React.SVGProps<SVGSVGElement>>;
- tooltip: string;
- onClick: (e: React.MouseEvent<HTMLButtonElement>) => void;
- }[];
- }, [align, node, t, editor]);
-
- return (
- <div className={'absolute right-1 top-1 flex items-center justify-between rounded bg-bg-body shadow-lg'}>
- {options.map((option) => {
- const { key, Icon, tooltip, onClick } = option;
-
- return (
- <Tooltip disableInteractive={true} placement={'top'} title={tooltip} key={key}>
- <IconButton
- size={'small'}
- className={'bg-transparent p-2 text-icon-primary hover:text-fill-default'}
- onClick={onClick}
- >
- <Icon />
- </IconButton>
- </Tooltip>
- );
- })}
- {!!alignAnchorEl && (
- <Popover
- anchorOrigin={{
- vertical: 'bottom',
- horizontal: 'left',
- }}
- transformOrigin={{
- vertical: 'top',
- horizontal: 'left',
- }}
- open={!!alignAnchorEl}
- anchorEl={alignAnchorEl}
- onClose={() => setAlignAnchorEl(null)}
- >
- {alignOptions.map((option) => {
- const { key, Icon, onClick } = option;
-
- return (
- <IconButton
- key={key}
- size={'small'}
- style={{
- color: align === key ? 'var(--fill-default)' : undefined,
- }}
- className={'bg-transparent p-2 text-icon-primary hover:text-fill-default'}
- onClick={onClick}
- >
- <Icon />
- </IconButton>
- );
- })}
- </Popover>
- )}
- </div>
- );
-}
-
-export default ImageActions;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/image/ImageBlock.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/image/ImageBlock.tsx
deleted file mode 100644
index 661eb3e3de..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/image/ImageBlock.tsx
+++ /dev/null
@@ -1,49 +0,0 @@
-import React, { forwardRef, memo, useCallback, useMemo, useRef } from 'react';
-import { EditorElementProps, ImageNode } from '$app/application/document/document.types';
-import { ReactEditor, useSelected, useSlateStatic } from 'slate-react';
-import ImageRender from '$app/components/editor/components/blocks/image/ImageRender';
-import ImageEmpty from '$app/components/editor/components/blocks/image/ImageEmpty';
-
-export const ImageBlock = memo(
- forwardRef<HTMLDivElement, EditorElementProps<ImageNode>>(({ node, children, className, ...attributes }, ref) => {
- const selected = useSelected();
- const { url, align } = useMemo(() => node.data || {}, [node.data]);
- const containerRef = useRef<HTMLDivElement>(null);
- const editor = useSlateStatic();
- const onFocusNode = useCallback(() => {
- ReactEditor.focus(editor);
- const path = ReactEditor.findPath(editor, node);
-
- editor.select(path);
- }, [editor, node]);
-
- return (
- <div
- {...attributes}
- ref={containerRef}
- onClick={() => {
- if (!selected) onFocusNode();
- }}
- className={`${className} image-block relative w-full cursor-pointer py-1`}
- >
- <div ref={ref} className={'absolute left-0 top-0 h-full w-full select-none caret-transparent'}>
- {children}
- </div>
- <div
- contentEditable={false}
- className={`flex w-full select-none ${url ? '' : 'rounded border'} ${
- selected ? 'border-fill-list-hover' : 'border-line-divider'
- } ${align === 'center' ? 'justify-center' : align === 'right' ? 'justify-end' : 'justify-start'}`}
- >
- {url ? (
- <ImageRender selected={selected} node={node} />
- ) : (
- <ImageEmpty node={node} onEscape={onFocusNode} containerRef={containerRef} />
- )}
- </div>
- </div>
- );
- })
-);
-
-export default ImageBlock;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/image/ImageEmpty.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/image/ImageEmpty.tsx
deleted file mode 100644
index e0b649939e..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/image/ImageEmpty.tsx
+++ /dev/null
@@ -1,63 +0,0 @@
-import React, { useEffect } from 'react';
-import { ReactComponent as ImageIcon } from '$app/assets/image.svg';
-import { useTranslation } from 'react-i18next';
-import UploadPopover from '$app/components/editor/components/blocks/image/UploadPopover';
-import { EditorNodeType, ImageNode } from '$app/application/document/document.types';
-import { useEditorBlockDispatch, useEditorBlockState } from '$app/components/editor/stores/block';
-
-function ImageEmpty({
- containerRef,
- onEscape,
- node,
-}: {
- containerRef: React.RefObject<HTMLDivElement>;
- onEscape: () => void;
- node: ImageNode;
-}) {
- const { t } = useTranslation();
- const state = useEditorBlockState(EditorNodeType.ImageBlock);
- const open = Boolean(state?.popoverOpen && state?.blockId === node.blockId && containerRef.current);
- const { openPopover, closePopover } = useEditorBlockDispatch();
-
- useEffect(() => {
- const container = containerRef.current;
-
- if (!container) {
- return;
- }
-
- const handleClick = () => {
- openPopover(EditorNodeType.ImageBlock, node.blockId);
- };
-
- container.addEventListener('click', handleClick);
- return () => {
- container.removeEventListener('click', handleClick);
- };
- }, [containerRef, node.blockId, openPopover]);
- return (
- <>
- <div
- className={
- 'container-bg flex h-[48px] w-full cursor-pointer select-none items-center gap-[10px] bg-content-blue-50 px-4 text-text-caption'
- }
- >
- <ImageIcon />
- {t('document.plugins.image.addAnImage')}
- </div>
- {open && (
- <UploadPopover
- anchorEl={containerRef.current}
- open={open}
- node={node}
- onClose={() => {
- closePopover(EditorNodeType.ImageBlock);
- onEscape();
- }}
- />
- )}
- </>
- );
-}
-
-export default ImageEmpty;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/image/ImageRender.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/image/ImageRender.tsx
deleted file mode 100644
index 07310b05be..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/image/ImageRender.tsx
+++ /dev/null
@@ -1,136 +0,0 @@
-import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
-import { ImageNode, ImageType } from '$app/application/document/document.types';
-import { useTranslation } from 'react-i18next';
-import { CircularProgress } from '@mui/material';
-import { ErrorOutline } from '@mui/icons-material';
-import ImageResizer from '$app/components/editor/components/blocks/image/ImageResizer';
-import { CustomEditor } from '$app/components/editor/command';
-import { useSlateStatic } from 'slate-react';
-import ImageActions from '$app/components/editor/components/blocks/image/ImageActions';
-import { LocalImage } from '$app/components/_shared/image_upload';
-import debounce from 'lodash-es/debounce';
-
-const MIN_WIDTH = 100;
-
-const DELAY = 300;
-
-function ImageRender({ selected, node }: { selected: boolean; node: ImageNode }) {
- const [loading, setLoading] = useState(true);
- const [hasError, setHasError] = useState(false);
-
- const imgRef = useRef<HTMLImageElement>(null);
- const editor = useSlateStatic();
- const { url = '', width: imageWidth, image_type: source } = useMemo(() => node.data || {}, [node.data]);
- const { t } = useTranslation();
- const blockId = node.blockId;
-
- const [showActions, setShowActions] = useState(false);
- const [initialWidth, setInitialWidth] = useState<number | null>(null);
- const [newWidth, setNewWidth] = useState<number | null>(imageWidth ?? null);
-
- const debounceSubmitWidth = useMemo(() => {
- return debounce((newWidth: number) => {
- CustomEditor.setImageBlockData(editor, node, {
- width: newWidth,
- });
- }, DELAY);
- }, [editor, node]);
-
- const handleWidthChange = useCallback(
- (newWidth: number) => {
- setNewWidth(newWidth);
- debounceSubmitWidth(newWidth);
- },
- [debounceSubmitWidth]
- );
-
- useEffect(() => {
- if (!loading && !hasError && initialWidth === null && imgRef.current) {
- setInitialWidth(imgRef.current.offsetWidth);
- }
- }, [hasError, initialWidth, loading]);
- const imageProps: React.ImgHTMLAttributes<HTMLImageElement> = useMemo(() => {
- return {
- style: { width: loading || hasError ? '0' : newWidth ?? '100%', opacity: selected ? 0.8 : 1 },
- className: 'object-cover',
- ref: imgRef,
- src: url,
- draggable: false,
- onLoad: () => {
- setHasError(false);
- setLoading(false);
- },
- onError: () => {
- setHasError(true);
- setLoading(false);
- },
- };
- }, [url, newWidth, loading, hasError, selected]);
-
- const renderErrorNode = useCallback(() => {
- return (
- <div
- className={'flex h-full w-full items-center justify-center gap-2 rounded border border-function-error bg-red-50'}
- >
- <ErrorOutline className={'text-function-error'} />
- <div className={'text-function-error'}>{t('editor.imageLoadFailed')}</div>
- </div>
- );
- }, [t]);
-
- if (!url) return null;
-
- return (
- <div
- onMouseEnter={() => {
- setShowActions(true);
- }}
- onMouseLeave={() => {
- setShowActions(false);
- }}
- style={{
- minWidth: MIN_WIDTH,
- width: 'fit-content',
- }}
- className={`image-render relative min-h-[48px] ${
- hasError || (loading && source !== ImageType.Local) ? 'w-full' : ''
- }`}
- >
- {source === ImageType.Local ? (
- <LocalImage
- {...imageProps}
- renderErrorNode={() => {
- setHasError(true);
- return null;
- }}
- loading={'lazy'}
- />
- ) : (
- <img loading={'lazy'} {...imageProps} alt={`image-${blockId}`} />
- )}
-
- {initialWidth && (
- <>
- <ImageResizer
- isLeft
- minWidth={MIN_WIDTH}
- width={imageWidth ?? initialWidth}
- onWidthChange={handleWidthChange}
- />
- <ImageResizer minWidth={MIN_WIDTH} width={imageWidth ?? initialWidth} onWidthChange={handleWidthChange} />
- </>
- )}
- {showActions && <ImageActions node={node} />}
- {hasError ? (
- renderErrorNode()
- ) : loading && source !== ImageType.Local ? (
- <div className={'flex h-full w-full items-center justify-center gap-2 rounded bg-gray-100'}>
- <CircularProgress size={24} />
- <div className={'text-text-caption'}>{t('editor.loading')}</div>
- </div>
- ) : null}
- </div>
- );
-}
-
-export default ImageRender;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/image/ImageResizer.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/image/ImageResizer.tsx
deleted file mode 100644
index e0d272acf3..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/image/ImageResizer.tsx
+++ /dev/null
@@ -1,61 +0,0 @@
-import React, { useCallback, useRef } from 'react';
-
-function ImageResizer({
- minWidth,
- width,
- onWidthChange,
- isLeft,
-}: {
- isLeft?: boolean;
- minWidth: number;
- width: number;
- onWidthChange: (newWidth: number) => void;
-}) {
- const originalWidth = useRef(width);
- const startX = useRef(0);
-
- const onResize = useCallback(
- (e: MouseEvent) => {
- e.preventDefault();
- const diff = isLeft ? startX.current - e.clientX : e.clientX - startX.current;
- const newWidth = originalWidth.current + diff;
-
- if (newWidth < minWidth) {
- return;
- }
-
- onWidthChange(newWidth);
- },
- [isLeft, minWidth, onWidthChange]
- );
-
- const onResizeEnd = useCallback(() => {
- document.removeEventListener('mousemove', onResize);
- document.removeEventListener('mouseup', onResizeEnd);
- }, [onResize]);
-
- const onResizeStart = useCallback(
- (e: React.MouseEvent) => {
- startX.current = e.clientX;
- originalWidth.current = width;
- document.addEventListener('mousemove', onResize);
- document.addEventListener('mouseup', onResizeEnd);
- },
- [onResize, onResizeEnd, width]
- );
-
- return (
- <div
- onMouseDown={onResizeStart}
- style={{
- right: isLeft ? 'auto' : '2px',
- left: isLeft ? '-2px' : 'auto',
- }}
- className={'image-resizer'}
- >
- <div className={'resize-handle'} />
- </div>
- );
-}
-
-export default ImageResizer;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/image/UploadPopover.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/image/UploadPopover.tsx
deleted file mode 100644
index 0aff9fb0cc..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/image/UploadPopover.tsx
+++ /dev/null
@@ -1,112 +0,0 @@
-import React, { useMemo } from 'react';
-import { PopoverOrigin } from '@mui/material/Popover/Popover';
-import usePopoverAutoPosition from '$app/components/_shared/popover/Popover.hooks';
-
-import { useTranslation } from 'react-i18next';
-import { EmbedLink, Unsplash, UploadTabs, TabOption, TAB_KEY, UploadImage } from '$app/components/_shared/image_upload';
-import { CustomEditor } from '$app/components/editor/command';
-import { useSlateStatic } from 'slate-react';
-import { ImageNode, ImageType } from '$app/application/document/document.types';
-
-const initialOrigin: {
- transformOrigin: PopoverOrigin;
- anchorOrigin: PopoverOrigin;
-} = {
- transformOrigin: {
- vertical: 'top',
- horizontal: 'center',
- },
- anchorOrigin: {
- vertical: 'bottom',
- horizontal: 'center',
- },
-};
-
-function UploadPopover({
- open,
- anchorEl,
- onClose,
- node,
-}: {
- open: boolean;
- anchorEl: HTMLDivElement | null;
- onClose: () => void;
- node: ImageNode;
-}) {
- const editor = useSlateStatic();
-
- const { t } = useTranslation();
-
- const { transformOrigin, anchorOrigin, isEntered, paperHeight, paperWidth } = usePopoverAutoPosition({
- initialPaperWidth: 433,
- initialPaperHeight: 300,
- anchorEl,
- initialAnchorOrigin: initialOrigin.anchorOrigin,
- initialTransformOrigin: initialOrigin.transformOrigin,
- open,
- });
-
- const tabOptions: TabOption[] = useMemo(() => {
- return [
- {
- label: t('button.upload'),
- key: TAB_KEY.UPLOAD,
- Component: UploadImage,
- onDone: (link: string) => {
- CustomEditor.setImageBlockData(editor, node, {
- url: link,
- image_type: ImageType.Local,
- });
- onClose();
- },
- },
- {
- label: t('document.imageBlock.embedLink.label'),
- key: TAB_KEY.EMBED_LINK,
- Component: EmbedLink,
- onDone: (link: string) => {
- CustomEditor.setImageBlockData(editor, node, {
- url: link,
- image_type: ImageType.External,
- });
- onClose();
- },
- },
- {
- key: TAB_KEY.UNSPLASH,
- label: t('document.imageBlock.unsplash.label'),
- Component: Unsplash,
- onDone: (link: string) => {
- CustomEditor.setImageBlockData(editor, node, {
- url: link,
- image_type: ImageType.External,
- });
- onClose();
- },
- },
- ];
- }, [editor, node, onClose, t]);
-
- return (
- <UploadTabs
- popoverProps={{
- anchorEl,
- open: open && isEntered,
- onClose,
- transformOrigin,
- anchorOrigin,
- onMouseDown: (e) => {
- e.stopPropagation();
- },
- }}
- containerStyle={{
- maxWidth: paperWidth,
- maxHeight: paperHeight,
- overflow: 'hidden',
- }}
- tabOptions={tabOptions}
- />
- );
-}
-
-export default UploadPopover;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/image/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/image/index.ts
deleted file mode 100644
index 73c3003a92..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/image/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './ImageBlock';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/math_equation/EditPopover.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/math_equation/EditPopover.tsx
deleted file mode 100644
index f44158bdf2..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/math_equation/EditPopover.tsx
+++ /dev/null
@@ -1,165 +0,0 @@
-import React, { useCallback, useEffect, useState } from 'react';
-import Popover from '@mui/material/Popover';
-import { PopoverCommonProps } from '$app/components/editor/components/tools/popover';
-import { TextareaAutosize } from '@mui/material';
-import Button from '@mui/material/Button';
-import { useTranslation } from 'react-i18next';
-import { CustomEditor } from '$app/components/editor/command';
-import { ReactEditor, useSlateStatic } from 'slate-react';
-import { MathEquationNode } from '$app/application/document/document.types';
-import katex from 'katex';
-import { PopoverOrigin } from '@mui/material/Popover/Popover';
-import usePopoverAutoPosition from '$app/components/_shared/popover/Popover.hooks';
-
-const initialOrigin: {
- transformOrigin: PopoverOrigin;
- anchorOrigin: PopoverOrigin;
-} = {
- transformOrigin: {
- vertical: 'top',
- horizontal: 'center',
- },
- anchorOrigin: {
- vertical: 'bottom',
- horizontal: 'center',
- },
-};
-
-function EditPopover({
- open,
- anchorEl,
- onClose,
- node,
-}: {
- open: boolean;
- node: MathEquationNode;
- anchorEl: HTMLDivElement | null;
- onClose: () => void;
-}) {
- const editor = useSlateStatic();
-
- const [error, setError] = useState<{
- name: string;
- message: string;
- } | null>(null);
- const { t } = useTranslation();
- const [value, setValue] = useState<string>(node.data.formula || '');
- const onInput = (event: React.FormEvent<HTMLTextAreaElement>) => {
- setValue(event.currentTarget.value);
- };
-
- const handleClose = useCallback(() => {
- onClose();
- if (!node) return;
- ReactEditor.focus(editor);
- const path = ReactEditor.findPath(editor, node);
-
- editor.select(path);
- }, [onClose, editor, node]);
-
- const handleDone = () => {
- if (!node || error) return;
- if (value !== node.data.formula) {
- CustomEditor.setMathEquationBlockFormula(editor, node, value);
- }
-
- handleClose();
- };
-
- const onKeyDown = (e: React.KeyboardEvent) => {
- e.stopPropagation();
- const shift = e.shiftKey;
-
- // If shift is pressed, allow the user to enter a new line, otherwise close the popover
- if (!shift && e.key === 'Enter') {
- e.preventDefault();
- e.stopPropagation();
- handleDone();
- }
-
- if (e.key === 'Escape') {
- e.preventDefault();
- e.stopPropagation();
- handleClose();
- }
- };
-
- useEffect(() => {
- try {
- katex.render(value, document.createElement('div'));
- setError(null);
- } catch (e) {
- setError(
- e as {
- name: string;
- message: string;
- }
- );
- }
- }, [value]);
-
- const { transformOrigin, anchorOrigin, isEntered } = usePopoverAutoPosition({
- initialPaperWidth: 300,
- initialPaperHeight: 170,
- anchorEl,
- initialAnchorOrigin: initialOrigin.anchorOrigin,
- initialTransformOrigin: initialOrigin.transformOrigin,
- open,
- });
-
- return (
- <Popover
- {...PopoverCommonProps}
- open={open && isEntered}
- anchorEl={anchorEl}
- transformOrigin={transformOrigin}
- anchorOrigin={anchorOrigin}
- onClose={handleClose}
- onMouseDown={(e) => {
- e.stopPropagation();
- }}
- onKeyDown={onKeyDown}
- >
- <div className={'flex flex-col gap-3 p-4'}>
- <TextareaAutosize
- className='w-full resize-none whitespace-break-spaces break-all rounded border p-2 text-sm'
- autoFocus
- autoCorrect='off'
- autoComplete={'off'}
- spellCheck={false}
- value={value}
- minRows={4}
- onInput={onInput}
- onKeyDown={onKeyDown}
- placeholder={`|x| = \\begin{cases}
- x, &\\quad x \\geq 0 \\\\
- -x, &\\quad x < 0
-\\end{cases}`}
- />
-
- {error && (
- <div className={'max-w-[270px] text-xs text-red-500'}>
- {error.name}: {error.message}
- </div>
- )}
-
- <div className={'flex justify-between gap-2'}>
- <Button
- size={'small'}
- color={'inherit'}
- variant={'outlined'}
- onClick={handleClose}
- className={'flex-grow text-text-caption'}
- >
- {t('button.cancel')}
- </Button>
- <Button disabled={!!error} size={'small'} variant={'contained'} onClick={handleDone} className={'flex-grow'}>
- {t('button.done')}
- </Button>
- </div>
- </div>
- </Popover>
- );
-}
-
-export default EditPopover;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/math_equation/MathEquation.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/math_equation/MathEquation.tsx
deleted file mode 100644
index ee441be624..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/math_equation/MathEquation.tsx
+++ /dev/null
@@ -1,88 +0,0 @@
-import { forwardRef, memo, useEffect, useRef } from 'react';
-import { EditorElementProps, EditorNodeType, MathEquationNode } from '$app/application/document/document.types';
-import KatexMath from '$app/components/_shared/katex_math/KatexMath';
-import { useTranslation } from 'react-i18next';
-import { FunctionsOutlined } from '@mui/icons-material';
-import EditPopover from '$app/components/editor/components/blocks/math_equation/EditPopover';
-import { ReactEditor, useSelected, useSlateStatic } from 'slate-react';
-import { useEditorBlockDispatch, useEditorBlockState } from '$app/components/editor/stores/block';
-
-export const MathEquation = memo(
- forwardRef<HTMLDivElement, EditorElementProps<MathEquationNode>>(
- ({ node, children, className, ...attributes }, ref) => {
- const formula = node.data.formula;
- const { t } = useTranslation();
- const containerRef = useRef<HTMLDivElement>(null);
- const { openPopover, closePopover } = useEditorBlockDispatch();
- const state = useEditorBlockState(EditorNodeType.EquationBlock);
- const open = Boolean(state?.popoverOpen && state?.blockId === node.blockId && containerRef.current);
-
- const selected = useSelected();
-
- const editor = useSlateStatic();
-
- useEffect(() => {
- const slateDom = ReactEditor.toDOMNode(editor, editor);
-
- if (!slateDom) return;
- const handleKeyDown = (e: KeyboardEvent) => {
- if (e.key === 'Enter') {
- e.preventDefault();
- e.stopPropagation();
- openPopover(EditorNodeType.EquationBlock, node.blockId);
- }
- };
-
- if (selected) {
- slateDom.addEventListener('keydown', handleKeyDown);
- }
-
- return () => {
- slateDom.removeEventListener('keydown', handleKeyDown);
- };
- }, [editor, node.blockId, openPopover, selected]);
-
- return (
- <>
- <div
- {...attributes}
- ref={containerRef}
- onClick={() => {
- openPopover(EditorNodeType.EquationBlock, node.blockId);
- }}
- className={`${className} math-equation-block relative w-full cursor-pointer py-2`}
- >
- <div
- contentEditable={false}
- className={`container-bg w-full select-none rounded border border-line-divider ${
- selected ? 'border-fill-hover' : ''
- } bg-content-blue-50 px-3`}
- >
- {formula ? (
- <KatexMath latex={formula} />
- ) : (
- <div className={'flex h-[48px] w-full items-center gap-[10px] text-text-caption'}>
- <FunctionsOutlined />
- {t('document.plugins.mathEquation.addMathEquation')}
- </div>
- )}
- </div>
- <div ref={ref} className={'absolute left-0 top-0 h-full w-full caret-transparent'}>
- {children}
- </div>
- </div>
- {open && (
- <EditPopover
- onClose={() => {
- closePopover(EditorNodeType.EquationBlock);
- }}
- node={node}
- open={open}
- anchorEl={containerRef.current}
- />
- )}
- </>
- );
- }
- )
-);
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/math_equation/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/math_equation/index.ts
deleted file mode 100644
index ae6eb70209..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/math_equation/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './MathEquation';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/numbered_list/NumberListIcon.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/numbered_list/NumberListIcon.tsx
deleted file mode 100644
index 888b46c980..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/numbered_list/NumberListIcon.tsx
+++ /dev/null
@@ -1,87 +0,0 @@
-import React, { useMemo } from 'react';
-import { ReactEditor, useSlate, useSlateStatic } from 'slate-react';
-import { Element, Path } from 'slate';
-import { NumberedListNode } from '$app/application/document/document.types';
-import { letterize, romanize } from '$app/utils/list';
-import { CustomEditor } from '$app/components/editor/command';
-
-enum Letter {
- Number = 'number',
- Letter = 'letter',
- Roman = 'roman',
-}
-
-function getLetterNumber(index: number, letter: Letter) {
- if (letter === Letter.Number) {
- return index;
- } else if (letter === Letter.Letter) {
- return letterize(index);
- } else {
- return romanize(index);
- }
-}
-
-function NumberListIcon({ block, className }: { block: NumberedListNode; className: string }) {
- const editor = useSlate();
- const staticEditor = useSlateStatic();
-
- const path = ReactEditor.findPath(editor, block);
- const index = useMemo(() => {
- let index = 1;
-
- let topNode;
- let prevPath = Path.previous(path);
-
- while (prevPath) {
- const prev = editor.node(prevPath);
-
- const prevNode = prev[0] as Element;
-
- if (prevNode.type === block.type) {
- index += 1;
- topNode = prevNode;
- } else {
- break;
- }
-
- prevPath = Path.previous(prevPath);
- }
-
- if (!topNode) {
- return Number(block.data?.number ?? 1);
- }
-
- const startIndex = (topNode as NumberedListNode).data?.number ?? 1;
-
- return index + Number(startIndex) - 1;
- }, [editor, block, path]);
-
- const letter = useMemo(() => {
- const level = CustomEditor.getListLevel(staticEditor, block.type, path);
-
- if (level % 3 === 0) {
- return Letter.Number;
- } else if (level % 3 === 1) {
- return Letter.Letter;
- } else {
- return Letter.Roman;
- }
- }, [block.type, staticEditor, path]);
-
- const dataNumber = useMemo(() => {
- return getLetterNumber(index, letter);
- }, [index, letter]);
-
- return (
- <span
- onMouseDown={(e) => {
- e.preventDefault();
- }}
- contentEditable={false}
- data-number={dataNumber}
- className={`${className} numbered-icon flex w-[24px] min-w-[24px] justify-center pr-1 font-medium`}
- />
- );
-}
-
-export default NumberListIcon;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/numbered_list/NumberedList.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/numbered_list/NumberedList.tsx
deleted file mode 100644
index f3e34e1571..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/numbered_list/NumberedList.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import React, { forwardRef, memo } from 'react';
-import { EditorElementProps, NumberedListNode } from '$app/application/document/document.types';
-
-export const NumberedList = memo(
- forwardRef<HTMLDivElement, EditorElementProps<NumberedListNode>>(
- ({ node: _, children, className, ...attributes }, ref) => {
- return (
- <div ref={ref} {...attributes} className={`${className}`}>
- {children}
- </div>
- );
- }
- )
-);
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/numbered_list/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/numbered_list/index.ts
deleted file mode 100644
index 6e985ae25b..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/numbered_list/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './NumberedList';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/page/Page.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/page/Page.tsx
deleted file mode 100644
index f93cb897ba..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/page/Page.tsx
+++ /dev/null
@@ -1,18 +0,0 @@
-import React, { forwardRef, memo, useMemo } from 'react';
-import { EditorElementProps, PageNode } from '$app/application/document/document.types';
-
-export const Page = memo(
- forwardRef<HTMLDivElement, EditorElementProps<PageNode>>(({ node: _, children, ...attributes }, ref) => {
- const className = useMemo(() => {
- return `${attributes.className ?? ''} document-title pb-3 text-5xl font-bold`;
- }, [attributes.className]);
-
- return (
- <div ref={ref} {...attributes} className={className}>
- {children}
- </div>
- );
- })
-);
-
-export default Page;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/page/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/page/index.ts
deleted file mode 100644
index d9925d7520..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/page/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './Page';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/paragraph/Paragraph.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/paragraph/Paragraph.tsx
deleted file mode 100644
index 96524db239..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/paragraph/Paragraph.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import React, { forwardRef, memo } from 'react';
-import { EditorElementProps, ParagraphNode } from '$app/application/document/document.types';
-
-export const Paragraph = memo(
- forwardRef<HTMLDivElement, EditorElementProps<ParagraphNode>>(({ node: _, children, ...attributes }, ref) => {
- {
- return (
- <div ref={ref} {...attributes} className={`${attributes.className ?? ''}`}>
- {children}
- </div>
- );
- }
- })
-);
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/paragraph/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/paragraph/index.ts
deleted file mode 100644
index 01752c914c..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/paragraph/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './Paragraph';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/quote/Quote.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/quote/Quote.tsx
deleted file mode 100644
index 5afc35289b..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/quote/Quote.tsx
+++ /dev/null
@@ -1,16 +0,0 @@
-import React, { forwardRef, memo, useMemo } from 'react';
-import { EditorElementProps, QuoteNode } from '$app/application/document/document.types';
-
-export const QuoteList = memo(
- forwardRef<HTMLDivElement, EditorElementProps<QuoteNode>>(({ node: _, children, ...attributes }, ref) => {
- const className = useMemo(() => {
- return `flex w-full flex-col ml-3 border-l-[4px] border-fill-default pl-2 ${attributes.className ?? ''}`;
- }, [attributes.className]);
-
- return (
- <div {...attributes} ref={ref} className={className}>
- {children}
- </div>
- );
- })
-);
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/quote/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/quote/index.ts
deleted file mode 100644
index c88e677a53..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/quote/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './Quote';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/text/StartIcon.hooks.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/text/StartIcon.hooks.tsx
deleted file mode 100644
index acf16581f4..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/text/StartIcon.hooks.tsx
+++ /dev/null
@@ -1,46 +0,0 @@
-import React, { FC, useCallback, useMemo } from 'react';
-import { EditorNodeType, TextNode } from '$app/application/document/document.types';
-import { ReactEditor, useSlate } from 'slate-react';
-import { Editor, Element } from 'slate';
-import CheckboxIcon from '$app/components/editor/components/blocks/todo_list/CheckboxIcon';
-import ToggleIcon from '$app/components/editor/components/blocks/toggle_list/ToggleIcon';
-import NumberListIcon from '$app/components/editor/components/blocks/numbered_list/NumberListIcon';
-import BulletedListIcon from '$app/components/editor/components/blocks/bulleted_list/BulletedListIcon';
-
-export function useStartIcon(node: TextNode) {
- const editor = useSlate();
- const path = ReactEditor.findPath(editor, node);
- const block = Editor.parent(editor, path)?.[0] as Element | null;
-
- const Component = useMemo(() => {
- if (!Element.isElement(block)) {
- return null;
- }
-
- switch (block.type) {
- case EditorNodeType.TodoListBlock:
- return CheckboxIcon;
- case EditorNodeType.ToggleListBlock:
- return ToggleIcon;
- case EditorNodeType.NumberedListBlock:
- return NumberListIcon;
- case EditorNodeType.BulletedListBlock:
- return BulletedListIcon;
- default:
- return null;
- }
- }, [block]) as FC<{ block: Element; className: string }> | null;
-
- const renderIcon = useCallback(() => {
- if (!Component || !block) {
- return null;
- }
-
- return <Component className={`text-block-icon relative`} block={block} />;
- }, [Component, block]);
-
- return {
- hasStartIcon: !!Component,
- renderIcon,
- };
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/text/Text.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/text/Text.tsx
deleted file mode 100644
index 768524394e..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/text/Text.tsx
+++ /dev/null
@@ -1,29 +0,0 @@
-import React, { forwardRef, memo } from 'react';
-import Placeholder from '$app/components/editor/components/blocks/_shared/Placeholder';
-import { EditorElementProps, TextNode } from '$app/application/document/document.types';
-import { useSlateStatic } from 'slate-react';
-import { useStartIcon } from '$app/components/editor/components/blocks/text/StartIcon.hooks';
-
-export const Text = memo(
- forwardRef<HTMLDivElement, EditorElementProps<TextNode>>(({ node, children, className, ...attributes }, ref) => {
- const editor = useSlateStatic();
- const { hasStartIcon, renderIcon } = useStartIcon(node);
- const isEmpty = editor.isEmpty(node);
-
- return (
- <span
- ref={ref}
- {...attributes}
- className={`text-element relative my-1 flex w-full whitespace-pre-wrap break-words px-1 ${className ?? ''} ${
- hasStartIcon ? 'has-start-icon' : ''
- }`}
- >
- {renderIcon()}
- <Placeholder isEmpty={isEmpty} node={node} />
- <span className={`text-content ${isEmpty ? 'empty-text' : ''}`}>{children}</span>
- </span>
- );
- })
-);
-
-export default Text;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/text/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/text/index.ts
deleted file mode 100644
index b0c76af0b0..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/text/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './Text';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/todo_list/CheckboxIcon.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/todo_list/CheckboxIcon.tsx
deleted file mode 100644
index d98990c886..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/todo_list/CheckboxIcon.tsx
+++ /dev/null
@@ -1,49 +0,0 @@
-import React, { useCallback } from 'react';
-import { TodoListNode } from '$app/application/document/document.types';
-import { CustomEditor } from '$app/components/editor/command';
-import { ReactEditor, useSlateStatic } from 'slate-react';
-import { Location } from 'slate';
-import { ReactComponent as CheckboxCheckSvg } from '$app/assets/database/checkbox-check.svg';
-import { ReactComponent as CheckboxUncheckSvg } from '$app/assets/database/checkbox-uncheck.svg';
-
-function CheckboxIcon({ block, className }: { block: TodoListNode; className: string }) {
- const editor = useSlateStatic();
- const { checked } = block.data;
-
- const toggleTodo = useCallback(
- (e: React.MouseEvent) => {
- const path = ReactEditor.findPath(editor, block);
- const start = editor.start(path);
- let at: Location = start;
-
- if (e.shiftKey) {
- const end = editor.end(path);
-
- at = {
- anchor: start,
- focus: end,
- };
- }
-
- CustomEditor.toggleTodo(editor, at);
- },
- [editor, block]
- );
-
- return (
- <span
- data-playwright-selected={false}
- contentEditable={false}
- onClick={toggleTodo}
- draggable={false}
- onMouseDown={(e) => {
- e.preventDefault();
- }}
- className={`${className} cursor-pointer pr-1 text-xl text-fill-default`}
- >
- {checked ? <CheckboxCheckSvg /> : <CheckboxUncheckSvg />}
- </span>
- );
-}
-
-export default CheckboxIcon;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/todo_list/TodoList.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/todo_list/TodoList.tsx
deleted file mode 100644
index c662c48153..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/todo_list/TodoList.tsx
+++ /dev/null
@@ -1,19 +0,0 @@
-import React, { forwardRef, memo, useMemo } from 'react';
-import { EditorElementProps, TodoListNode } from '$app/application/document/document.types';
-
-export const TodoList = memo(
- forwardRef<HTMLDivElement, EditorElementProps<TodoListNode>>(({ node, children, ...attributes }, ref) => {
- const { checked = false } = useMemo(() => node.data || {}, [node.data]);
- const className = useMemo(() => {
- return `flex w-full flex-col ${checked ? 'checked' : ''} ${attributes.className ?? ''}`;
- }, [attributes.className, checked]);
-
- return (
- <>
- <div {...attributes} ref={ref} className={className}>
- {children}
- </div>
- </>
- );
- })
-);
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/todo_list/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/todo_list/index.ts
deleted file mode 100644
index f239f43459..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/todo_list/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './TodoList';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/toggle_list/ToggleIcon.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/toggle_list/ToggleIcon.tsx
deleted file mode 100644
index ad27822cb5..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/toggle_list/ToggleIcon.tsx
+++ /dev/null
@@ -1,30 +0,0 @@
-import React, { useCallback } from 'react';
-import { CustomEditor } from '$app/components/editor/command';
-import { useSlateStatic } from 'slate-react';
-import { ToggleListNode } from '$app/application/document/document.types';
-import { ReactComponent as RightSvg } from '$app/assets/more.svg';
-
-function ToggleIcon({ block, className }: { block: ToggleListNode; className: string }) {
- const editor = useSlateStatic();
- const { collapsed } = block.data;
-
- const toggleToggleList = useCallback(() => {
- CustomEditor.toggleToggleList(editor, block);
- }, [editor, block]);
-
- return (
- <span
- data-playwright-selected={false}
- contentEditable={false}
- onClick={toggleToggleList}
- onMouseDown={(e) => {
- e.preventDefault();
- }}
- className={`${className} cursor-pointer pr-1 text-xl hover:text-fill-default`}
- >
- {collapsed ? <RightSvg /> : <RightSvg className={'rotate-90 transform'} />}
- </span>
- );
-}
-
-export default ToggleIcon;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/toggle_list/ToggleList.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/toggle_list/ToggleList.tsx
deleted file mode 100644
index 809f3b750d..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/toggle_list/ToggleList.tsx
+++ /dev/null
@@ -1,17 +0,0 @@
-import React, { forwardRef, memo, useMemo } from 'react';
-import { EditorElementProps, ToggleListNode } from '$app/application/document/document.types';
-
-export const ToggleList = memo(
- forwardRef<HTMLDivElement, EditorElementProps<ToggleListNode>>(({ node, children, ...attributes }, ref) => {
- const { collapsed } = useMemo(() => node.data || {}, [node.data]);
- const className = `${attributes.className ?? ''} flex w-full flex-col ${collapsed ? 'collapsed' : ''}`;
-
- return (
- <>
- <div {...attributes} ref={ref} className={className}>
- {children}
- </div>
- </>
- );
- })
-);
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/toggle_list/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/toggle_list/index.ts
deleted file mode 100644
index 833bdb5210..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/blocks/toggle_list/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './ToggleList';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/editor/CollaborativeEditor.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/editor/CollaborativeEditor.tsx
deleted file mode 100644
index 2526df895e..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/editor/CollaborativeEditor.tsx
+++ /dev/null
@@ -1,93 +0,0 @@
-import { memo, useEffect, useMemo, useState } from 'react';
-
-import Editor from '$app/components/editor/components/editor/Editor';
-import { EditorProps } from '$app/application/document/document.types';
-import { Provider } from '$app/components/editor/provider';
-import { YXmlText } from 'yjs/dist/src/types/YXmlText';
-import { getInsertTarget, getYTarget } from '$app/components/editor/provider/utils/relation';
-import isEqual from 'lodash-es/isEqual';
-
-export const CollaborativeEditor = memo(
- ({ id, title, cover, showTitle = true, onTitleChange, onCoverChange, ...props }: EditorProps) => {
- const [sharedType, setSharedType] = useState<YXmlText | null>(null);
- const provider = useMemo(() => {
- setSharedType(null);
-
- return new Provider(id);
- }, [id]);
-
- const root = useMemo(() => {
- if (!showTitle || !sharedType || !sharedType.doc) return null;
-
- return getYTarget(sharedType?.doc, [0]);
- }, [sharedType, showTitle]);
-
- const rootText = useMemo(() => {
- if (!root) return null;
- return getInsertTarget(root, [0]);
- }, [root]);
-
- useEffect(() => {
- if (!rootText || rootText.toString() === title) return;
-
- if (rootText.length > 0) {
- rootText.delete(0, rootText.length);
- }
-
- rootText.insert(0, title || '');
- }, [title, rootText]);
-
- useEffect(() => {
- if (!root) return;
-
- const originalCover = root.getAttribute('data')?.cover;
-
- if (cover === undefined) return;
- if (isEqual(originalCover, cover)) return;
- root.setAttribute('data', { cover: cover ? cover : undefined });
- }, [cover, root]);
-
- useEffect(() => {
- if (!root) return;
- const rootId = root.getAttribute('blockId');
-
- if (!rootId) return;
-
- const getCover = () => {
- const data = root.getAttribute('data');
-
- onCoverChange?.(data?.cover);
- };
-
- getCover();
- const onChange = () => {
- onTitleChange?.(root.toString());
- getCover();
- };
-
- root.observeDeep(onChange);
- return () => root.unobserveDeep(onChange);
- }, [onTitleChange, root, onCoverChange]);
-
- useEffect(() => {
- provider.connect();
-
- const handleConnected = () => {
- setSharedType(provider.sharedType);
- };
-
- provider.on('ready', handleConnected);
- void provider.initialDocument(showTitle);
- return () => {
- provider.off('ready', handleConnected);
- provider.disconnect();
- };
- }, [provider, showTitle]);
-
- if (!sharedType || id !== provider.id) {
- return null;
- }
-
- return <Editor sharedType={sharedType} id={id} {...props} />;
- }
-);
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/editor/CustomEditable.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/editor/CustomEditable.tsx
deleted file mode 100644
index b0bbe0eb28..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/editor/CustomEditable.tsx
+++ /dev/null
@@ -1,42 +0,0 @@
-import React, { ComponentProps, useCallback } from 'react';
-import { Editable, useSlate } from 'slate-react';
-import Element from './Element';
-import { Leaf } from './Leaf';
-import { useShortcuts } from '$app/components/editor/plugins/shortcuts';
-import { useInlineKeyDown } from '$app/components/editor/components/editor/Editor.hooks';
-
-type CustomEditableProps = Omit<ComponentProps<typeof Editable>, 'renderElement' | 'renderLeaf'> &
- Partial<Pick<ComponentProps<typeof Editable>, 'renderElement' | 'renderLeaf'>> & {
- disableFocus?: boolean;
- };
-
-export function CustomEditable({
- renderElement = Element,
- disableFocus = false,
- renderLeaf = Leaf,
- ...props
-}: CustomEditableProps) {
- const editor = useSlate();
- const { onKeyDown: onShortcutsKeyDown } = useShortcuts(editor);
- const withInlineKeyDown = useInlineKeyDown(editor);
- const onKeyDown = useCallback(
- (event: React.KeyboardEvent<HTMLDivElement>) => {
- withInlineKeyDown(event);
- onShortcutsKeyDown(event);
- },
- [onShortcutsKeyDown, withInlineKeyDown]
- );
-
- return (
- <Editable
- {...props}
- onKeyDown={onKeyDown}
- autoCorrect={'off'}
- autoComplete={'off'}
- autoFocus={!disableFocus}
- spellCheck={false}
- renderElement={renderElement}
- renderLeaf={renderLeaf}
- />
- );
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/editor/Editor.hooks.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/editor/Editor.hooks.ts
deleted file mode 100644
index f2443ba44b..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/editor/Editor.hooks.ts
+++ /dev/null
@@ -1,137 +0,0 @@
-import { KeyboardEvent, useCallback, useEffect, useMemo } from 'react';
-
-import { BaseRange, createEditor, Editor, Element, NodeEntry, Range, Transforms } from 'slate';
-import { ReactEditor, withReact } from 'slate-react';
-import { withBlockPlugins } from '$app/components/editor/plugins/withBlockPlugins';
-import { withInlines } from '$app/components/editor/components/inline_nodes';
-import { withYHistory, withYjs, YjsEditor } from '@slate-yjs/core';
-import * as Y from 'yjs';
-import { CustomEditor } from '$app/components/editor/command';
-import { CodeNode, EditorNodeType } from '$app/application/document/document.types';
-import { decorateCode } from '$app/components/editor/components/blocks/code/utils';
-import { withMarkdown } from '$app/components/editor/plugins/shortcuts';
-import { createHotkey, HOT_KEY_NAME } from '$app/utils/hotkeys';
-
-export function useEditor(sharedType: Y.XmlText) {
- const editor = useMemo(() => {
- if (!sharedType) return null;
- const e = withMarkdown(withBlockPlugins(withInlines(withReact(withYHistory(withYjs(createEditor(), sharedType))))));
-
- // Ensure editor always has at least 1 valid child
- const { normalizeNode } = e;
-
- e.normalizeNode = (entry) => {
- const [node] = entry;
-
- if (!Editor.isEditor(node) || node.children.length > 0) {
- return normalizeNode(entry);
- }
-
- // Ensure editor always has at least 1 valid child
- CustomEditor.insertEmptyLineAtEnd(e as ReactEditor & YjsEditor);
- };
-
- return e;
- }, [sharedType]) as ReactEditor & YjsEditor;
-
- const initialValue = useMemo(() => {
- return [];
- }, []);
-
- // Connect editor in useEffect to comply with concurrent mode requirements.
- useEffect(() => {
- YjsEditor.connect(editor);
- return () => {
- YjsEditor.disconnect(editor);
- };
- }, [editor]);
-
- const handleOnClickEnd = useCallback(() => {
- const path = [editor.children.length - 1];
- const node = Editor.node(editor, path) as NodeEntry<Element>;
- const latestNodeIsEmpty = CustomEditor.isEmptyText(editor, node[0]);
-
- if (latestNodeIsEmpty) {
- ReactEditor.focus(editor);
- editor.select(path);
- editor.collapse({
- edge: 'end',
- });
-
- return;
- }
-
- CustomEditor.insertEmptyLineAtEnd(editor);
- }, [editor]);
-
- return {
- editor,
- initialValue,
- handleOnClickEnd,
- };
-}
-
-export function useDecorateCodeHighlight(editor: ReactEditor) {
- return useCallback(
- (entry: NodeEntry): BaseRange[] => {
- const path = entry[1];
-
- const blockEntry = editor.above({
- at: path,
- match: (n) => !Editor.isEditor(n) && Element.isElement(n) && n.blockId !== undefined,
- });
-
- if (!blockEntry) return [];
-
- const block = blockEntry[0] as CodeNode;
-
- if (block.type === EditorNodeType.CodeBlock) {
- const language = block.data.language;
-
- return decorateCode(entry, language, false);
- }
-
- return [];
- },
- [editor]
- );
-}
-
-export function useInlineKeyDown(editor: ReactEditor) {
- return useCallback(
- (e: KeyboardEvent<HTMLDivElement>) => {
- const selection = editor.selection;
-
- // Default left/right behavior is unit:'character'.
- // This fails to distinguish between two cursor positions, such as
- // <inline>foo<cursor/></inline> vs <inline>foo</inline><cursor/>.
- // Here we modify the behavior to unit:'offset'.
- // This lets the user step into and out of the inline without stepping over characters.
- // You may wish to customize this further to only use unit:'offset' in specific cases.
- if (selection && Range.isCollapsed(selection)) {
- const { nativeEvent } = e;
-
- if (
- createHotkey(HOT_KEY_NAME.LEFT)(nativeEvent) &&
- CustomEditor.beforeIsInlineNode(editor, selection, {
- unit: 'offset',
- })
- ) {
- e.preventDefault();
- Transforms.move(editor, { unit: 'offset', reverse: true });
- return;
- }
-
- if (
- createHotkey(HOT_KEY_NAME.RIGHT)(nativeEvent) &&
- CustomEditor.afterIsInlineNode(editor, selection, { unit: 'offset' })
- ) {
- e.preventDefault();
- Transforms.move(editor, { unit: 'offset' });
- return;
- }
- }
- },
- [editor]
- );
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/editor/Editor.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/editor/Editor.tsx
deleted file mode 100644
index d87dbe3f35..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/editor/Editor.tsx
+++ /dev/null
@@ -1,78 +0,0 @@
-import React, { useCallback } from 'react';
-import { useDecorateCodeHighlight, useEditor } from '$app/components/editor/components/editor/Editor.hooks';
-import { Slate } from 'slate-react';
-import { CustomEditable } from '$app/components/editor/components/editor/CustomEditable';
-import { SelectionToolbar } from '$app/components/editor/components/tools/selection_toolbar';
-import { BlockActionsToolbar } from '$app/components/editor/components/tools/block_actions';
-
-import { CircularProgress } from '@mui/material';
-import { NodeEntry } from 'slate';
-import {
- DecorateStateProvider,
- EditorSelectedBlockProvider,
- useInitialEditorState,
- SlashStateProvider,
- EditorInlineBlockStateProvider,
-} from '$app/components/editor/stores';
-import CommandPanel from '../tools/command_panel/CommandPanel';
-import { EditorBlockStateProvider } from '$app/components/editor/stores/block';
-import { LocalEditorProps } from '$app/application/document/document.types';
-
-function Editor({ sharedType, disableFocus, caretColor = 'var(--text-title)' }: LocalEditorProps) {
- const { editor, initialValue, handleOnClickEnd, ...props } = useEditor(sharedType);
- const decorateCodeHighlight = useDecorateCodeHighlight(editor);
-
- const {
- selectedBlocks,
- decorate: decorateCustomRange,
- decorateState,
- slashState,
- inlineBlockState,
- blockState,
- } = useInitialEditorState(editor);
-
- const decorate = useCallback(
- (entry: NodeEntry) => {
- const codeRanges = decorateCodeHighlight(entry);
- const customRanges = decorateCustomRange(entry);
-
- return [...codeRanges, ...customRanges];
- },
- [decorateCodeHighlight, decorateCustomRange]
- );
-
- if (editor.sharedRoot.length === 0) {
- return <CircularProgress className='m-auto' />;
- }
-
- return (
- <EditorSelectedBlockProvider value={selectedBlocks}>
- <DecorateStateProvider value={decorateState}>
- <EditorBlockStateProvider value={blockState}>
- <EditorInlineBlockStateProvider value={inlineBlockState}>
- <SlashStateProvider value={slashState}>
- <Slate editor={editor} initialValue={initialValue}>
- <BlockActionsToolbar />
- <SelectionToolbar />
-
- <CustomEditable
- {...props}
- disableFocus={disableFocus}
- decorate={decorate}
- style={{
- caretColor,
- }}
- className={`px-16 outline-none focus:outline-none`}
- />
- <CommandPanel />
- <div onClick={handleOnClickEnd} className={'relative bottom-0 left-0 h-10 w-full cursor-text'} />
- </Slate>
- </SlashStateProvider>
- </EditorInlineBlockStateProvider>
- </EditorBlockStateProvider>
- </DecorateStateProvider>
- </EditorSelectedBlockProvider>
- );
-}
-
-export default Editor;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/editor/Element.hooks.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/editor/Element.hooks.ts
deleted file mode 100644
index bf7045705d..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/editor/Element.hooks.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-import { Element } from 'slate';
-import { useContext, useEffect, useMemo } from 'react';
-import { useSnapshot } from 'valtio';
-import { useSelected } from 'slate-react';
-
-import { EditorSelectedBlockContext } from '$app/components/editor/stores/selected';
-
-export function useElementState(element: Element) {
- const blockId = element.blockId;
- const selectedBlockContext = useContext(EditorSelectedBlockContext);
- const selected = useSelected();
-
- useEffect(() => {
- if (!blockId) return;
-
- if (!selected) {
- selectedBlockContext.delete(blockId);
- }
- }, [blockId, selected, selectedBlockContext]);
-
- const selectedBlockIds = useSnapshot(selectedBlockContext);
- const blockSelected = useMemo(() => {
- if (!blockId) return false;
- return selectedBlockIds.has(blockId);
- }, [blockId, selectedBlockIds]);
-
- return {
- blockSelected,
- };
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/editor/Element.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/editor/Element.tsx
deleted file mode 100644
index 1824d8a590..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/editor/Element.tsx
+++ /dev/null
@@ -1,132 +0,0 @@
-import React, { FC, HTMLAttributes, useMemo } from 'react';
-import { RenderElementProps, useSlateStatic } from 'slate-react';
-import {
- BlockData,
- EditorElementProps,
- EditorInlineNodeType,
- EditorNodeType,
- TextNode,
-} from '$app/application/document/document.types';
-import { Paragraph } from '$app/components/editor/components/blocks/paragraph';
-import { Heading } from '$app/components/editor/components/blocks/heading';
-import { TodoList } from '$app/components/editor/components/blocks/todo_list';
-import { Code } from '$app/components/editor/components/blocks/code';
-import { QuoteList } from '$app/components/editor/components/blocks/quote';
-import { NumberedList } from '$app/components/editor/components/blocks/numbered_list';
-import { BulletedList } from '$app/components/editor/components/blocks/bulleted_list';
-import { DividerNode } from '$app/components/editor/components/blocks/divider';
-import { InlineFormula } from '$app/components/editor/components/inline_nodes/inline_formula';
-import { ToggleList } from '$app/components/editor/components/blocks/toggle_list';
-import { Callout } from '$app/components/editor/components/blocks/callout';
-import { Mention } from '$app/components/editor/components/inline_nodes/mention';
-import { GridBlock } from '$app/components/editor/components/blocks/database';
-import { MathEquation } from '$app/components/editor/components/blocks/math_equation';
-import { ImageBlock } from '$app/components/editor/components/blocks/image';
-
-import { Text as TextComponent } from '../blocks/text';
-import { Page } from '../blocks/page';
-import { useElementState } from '$app/components/editor/components/editor/Element.hooks';
-import UnSupportBlock from '$app/components/editor/components/blocks/_shared/unSupportBlock';
-import { renderColor } from '$app/utils/color';
-
-function Element({ element, attributes, children }: RenderElementProps) {
- const node = element;
-
- const InlineComponent = useMemo(() => {
- switch (node.type) {
- case EditorInlineNodeType.Formula:
- return InlineFormula;
- case EditorInlineNodeType.Mention:
- return Mention;
- default:
- return null;
- }
- }, [node.type]) as FC<EditorElementProps>;
-
- const Component = useMemo(() => {
- switch (node.type) {
- case EditorNodeType.Page:
- return Page;
- case EditorNodeType.HeadingBlock:
- return Heading;
- case EditorNodeType.TodoListBlock:
- return TodoList;
- case EditorNodeType.Paragraph:
- return Paragraph;
- case EditorNodeType.CodeBlock:
- return Code;
- case EditorNodeType.QuoteBlock:
- return QuoteList;
- case EditorNodeType.NumberedListBlock:
- return NumberedList;
- case EditorNodeType.BulletedListBlock:
- return BulletedList;
- case EditorNodeType.DividerBlock:
- return DividerNode;
- case EditorNodeType.ToggleListBlock:
- return ToggleList;
- case EditorNodeType.CalloutBlock:
- return Callout;
- case EditorNodeType.GridBlock:
- return GridBlock;
- case EditorNodeType.EquationBlock:
- return MathEquation;
- case EditorNodeType.ImageBlock:
- return ImageBlock;
- default:
- return UnSupportBlock;
- }
- }, [node.type]) as FC<EditorElementProps & HTMLAttributes<HTMLElement>>;
-
- const editor = useSlateStatic();
- const { blockSelected } = useElementState(node);
- const isEmbed = editor.isEmbed(node);
-
- const className = useMemo(() => {
- const align =
- (
- node.data as {
- align: 'left' | 'center' | 'right';
- }
- )?.align || 'left';
-
- return `block-element flex rounded ${align ? `block-align-${align}` : ''} ${
- blockSelected && !isEmbed ? 'bg-content-blue-100' : ''
- }`;
- }, [node.data, blockSelected, isEmbed]);
-
- const style = useMemo(() => {
- const data = (node.data as BlockData) || {};
-
- return {
- backgroundColor: data.bg_color ? renderColor(data.bg_color) : undefined,
- color: data.font_color ? renderColor(data.font_color) : undefined,
- };
- }, [node.data]);
-
- if (InlineComponent) {
- return (
- <InlineComponent {...attributes} node={node}>
- {children}
- </InlineComponent>
- );
- }
-
- if (node.type === EditorNodeType.Text) {
- return (
- <TextComponent {...attributes} node={node as TextNode}>
- {children}
- </TextComponent>
- );
- }
-
- return (
- <div {...attributes} data-block-type={node.type} className={className}>
- <Component style={style} className={`flex w-full flex-col`} node={node}>
- {children}
- </Component>
- </div>
- );
-}
-
-export default Element;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/editor/Leaf.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/editor/Leaf.tsx
deleted file mode 100644
index 188ac33361..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/editor/Leaf.tsx
+++ /dev/null
@@ -1,59 +0,0 @@
-import React, { CSSProperties } from 'react';
-import { RenderLeafProps } from 'slate-react';
-import { Link } from '$app/components/editor/components/inline_nodes/link';
-import { renderColor } from '$app/utils/color';
-
-export function Leaf({ attributes, children, leaf }: RenderLeafProps) {
- let newChildren = children;
-
- const classList = [leaf.prism_token, leaf.prism_token && 'token', leaf.class_name].filter(Boolean);
-
- if (leaf.code) {
- newChildren = (
- <code
- style={{
- fontSize: '0.85em',
- }}
- className={'bg-fill-list-active bg-opacity-50 font-normal tracking-wider text-[#EB5757]'}
- >
- {newChildren}
- </code>
- );
- }
-
- if (leaf.underline) {
- newChildren = <u>{newChildren}</u>;
- }
-
- if (leaf.strikethrough) {
- newChildren = <s>{newChildren}</s>;
- }
-
- if (leaf.italic) {
- newChildren = <em>{newChildren}</em>;
- }
-
- if (leaf.bold) {
- newChildren = <strong>{newChildren}</strong>;
- }
-
- const style: CSSProperties = {};
-
- if (leaf.font_color) {
- style['color'] = renderColor(leaf.font_color);
- }
-
- if (leaf.bg_color) {
- style['backgroundColor'] = renderColor(leaf.bg_color);
- }
-
- if (leaf.href) {
- newChildren = <Link leaf={leaf}>{newChildren}</Link>;
- }
-
- return (
- <span {...attributes} style={style} className={`${classList.join(' ')}`}>
- {newChildren}
- </span>
- );
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/editor/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/editor/index.ts
deleted file mode 100644
index c0c3c728d1..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/editor/index.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export * from './CollaborativeEditor';
-export * from './Editor';
-export { useDecorateCodeHighlight } from '$app/components/editor/components/editor/Editor.hooks';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/editor/utils.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/editor/utils.ts
deleted file mode 100644
index cc6960cdf4..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/editor/utils.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-import { BasePoint, Editor, Transforms } from 'slate';
-import { ReactEditor } from 'slate-react';
-
-export function getNodePath(editor: ReactEditor, target: HTMLElement) {
- const slateNode = ReactEditor.toSlateNode(editor, target);
- const path = ReactEditor.findPath(editor, slateNode);
-
- return path;
-}
-
-export function moveCursorToNodeEnd(editor: ReactEditor, target: HTMLElement) {
- const path = getNodePath(editor, target);
- const afterPath = Editor.after(editor, path);
-
- ReactEditor.focus(editor);
-
- if (afterPath) {
- const afterStart = Editor.start(editor, afterPath);
-
- moveCursorToPoint(editor, afterStart);
- } else {
- const beforeEnd = Editor.end(editor, path);
-
- moveCursorToPoint(editor, beforeEnd);
- }
-}
-
-export function moveCursorToPoint(editor: ReactEditor, point: BasePoint) {
- ReactEditor.focus(editor);
- Transforms.select(editor, point);
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/inline_nodes/InlineChromiumBugfix.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/inline_nodes/InlineChromiumBugfix.tsx
deleted file mode 100644
index fb32eb18a9..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/inline_nodes/InlineChromiumBugfix.tsx
+++ /dev/null
@@ -1,16 +0,0 @@
-import React from 'react';
-
-// Put this at the start and end of an inline component to work around this Chromium bug:
-// https://bugs.chromium.org/p/chromium/issues/detail?id=1249405
-
-export const InlineChromiumBugfix = ({ className }: { className?: string }) => (
- <span
- contentEditable={false}
- className={`absolute caret-transparent ${className ?? ''}`}
- style={{
- fontSize: 0,
- }}
- >
- {String.fromCodePoint(160) /* Non-breaking space */}
- </span>
-);
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/inline_nodes/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/inline_nodes/index.ts
deleted file mode 100644
index 29f27984f7..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/inline_nodes/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export * from './withInline';
-export * from './inline_formula';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/inline_nodes/inline_formula/FormulaEditPopover.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/inline_nodes/inline_formula/FormulaEditPopover.tsx
deleted file mode 100644
index c60d7af40e..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/inline_nodes/inline_formula/FormulaEditPopover.tsx
+++ /dev/null
@@ -1,87 +0,0 @@
-import React, { useState } from 'react';
-
-import Popover from '@mui/material/Popover';
-import { PopoverCommonProps } from '$app/components/editor/components/tools/popover';
-import { useTranslation } from 'react-i18next';
-import TextField from '@mui/material/TextField';
-import { IconButton } from '@mui/material';
-import { ReactComponent as SelectCheck } from '$app/assets/select-check.svg';
-import { ReactComponent as Clear } from '$app/assets/delete.svg';
-import Tooltip from '@mui/material/Tooltip';
-
-function FormulaEditPopover({
- defaultText,
- open,
- anchorEl,
- onClose,
- onDone,
- onClear,
-}: {
- defaultText: string;
- open: boolean;
- anchorEl: HTMLElement | null;
- onClose: () => void;
- onClear: () => void;
- onDone: (formula: string) => void;
-}) {
- const [text, setText] = useState<string>(defaultText);
- const { t } = useTranslation();
-
- return (
- <Popover
- {...PopoverCommonProps}
- open={open}
- anchorEl={anchorEl}
- onClose={onClose}
- anchorOrigin={{
- vertical: 'bottom',
- horizontal: 'center',
- }}
- transformOrigin={{
- vertical: 'top',
- horizontal: 'center',
- }}
- >
- <div className='flex items-center gap-1 p-3'>
- <TextField
- variant={'standard'}
- size={'small'}
- autoFocus={true}
- value={text}
- spellCheck={false}
- placeholder={'E = mc^2'}
- onChange={(e) => setText(e.target.value)}
- fullWidth={true}
- onKeyDown={(e) => {
- e.stopPropagation();
- if (e.key === 'Enter') {
- e.preventDefault();
- onDone(text);
- }
-
- if (e.key === 'Escape') {
- e.preventDefault();
- onClose();
- }
-
- if (e.key === 'Tab') {
- e.preventDefault();
- }
- }}
- />
- <Tooltip placement={'top'} title={t('button.done')}>
- <IconButton className={'h-[20px] w-[20px]'} size={'small'} onClick={() => onDone(text)}>
- <SelectCheck className={'text-content-blue-400'} />
- </IconButton>
- </Tooltip>
- <Tooltip placement={'top'} title={t('button.clear')}>
- <IconButton className={'h-[20px] w-[20px]'} size={'small'} color={'error'} onClick={onClear}>
- <Clear />
- </IconButton>
- </Tooltip>
- </div>
- </Popover>
- );
-}
-
-export default FormulaEditPopover;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/inline_nodes/inline_formula/FormulaLeaf.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/inline_nodes/inline_formula/FormulaLeaf.tsx
deleted file mode 100644
index 324d273ab3..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/inline_nodes/inline_formula/FormulaLeaf.tsx
+++ /dev/null
@@ -1,16 +0,0 @@
-import React from 'react';
-import KatexMath from '$app/components/_shared/katex_math/KatexMath';
-
-function FormulaLeaf({ formula, children }: { formula: string; children: React.ReactNode }) {
- return (
- <span className={'relative'}>
- <span className={'select-none'} contentEditable={false}>
- <KatexMath latex={formula || ''} isInline />
- </span>
-
- <span className={'absolute left-0 right-0 h-0 w-0 opacity-0'}>{children}</span>
- </span>
- );
-}
-
-export default FormulaLeaf;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/inline_nodes/inline_formula/InlineFormula.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/inline_nodes/inline_formula/InlineFormula.tsx
deleted file mode 100644
index 204047304f..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/inline_nodes/inline_formula/InlineFormula.tsx
+++ /dev/null
@@ -1,133 +0,0 @@
-import React, { forwardRef, memo, useCallback, MouseEvent, useRef, useEffect } from 'react';
-import { ReactEditor, useSelected, useSlate } from 'slate-react';
-import { Editor, Range, Transforms } from 'slate';
-import { EditorElementProps, FormulaNode } from '$app/application/document/document.types';
-import FormulaLeaf from '$app/components/editor/components/inline_nodes/inline_formula/FormulaLeaf';
-import FormulaEditPopover from '$app/components/editor/components/inline_nodes/inline_formula/FormulaEditPopover';
-import { getNodePath, moveCursorToNodeEnd } from '$app/components/editor/components/editor/utils';
-import { CustomEditor } from '$app/components/editor/command';
-import { useEditorInlineBlockState } from '$app/components/editor/stores';
-import { InlineChromiumBugfix } from '$app/components/editor/components/inline_nodes/InlineChromiumBugfix';
-
-export const InlineFormula = memo(
- forwardRef<HTMLSpanElement, EditorElementProps<FormulaNode>>(({ node, children, ...attributes }, ref) => {
- const editor = useSlate();
- const formula = node.data;
- const { popoverOpen = false, setRange, openPopover, closePopover } = useEditorInlineBlockState('formula');
- const anchor = useRef<HTMLSpanElement | null>(null);
- const selected = useSelected();
- const open = Boolean(popoverOpen && selected);
-
- const isCollapsed = editor.selection && Range.isCollapsed(editor.selection);
-
- useEffect(() => {
- if (selected && isCollapsed && !open) {
- const afterPoint = editor.selection ? editor.after(editor.selection) : undefined;
-
- const afterStart = afterPoint ? Editor.start(editor, afterPoint) : undefined;
-
- if (afterStart) {
- editor.select(afterStart);
- }
- }
- }, [editor, isCollapsed, selected, open]);
-
- const handleClick = useCallback(
- (e: MouseEvent<HTMLSpanElement>) => {
- const target = e.currentTarget;
- const path = getNodePath(editor, target);
-
- setRange(path);
- openPopover();
- },
- [editor, openPopover, setRange]
- );
-
- const handleEditPopoverClose = useCallback(() => {
- closePopover();
- if (anchor.current === null) {
- return;
- }
-
- moveCursorToNodeEnd(editor, anchor.current);
- }, [closePopover, editor]);
-
- const selectNode = useCallback(() => {
- if (anchor.current === null) {
- return;
- }
-
- const path = getNodePath(editor, anchor.current);
-
- ReactEditor.focus(editor);
- Transforms.select(editor, path);
- }, [editor]);
-
- const onClear = useCallback(() => {
- selectNode();
- CustomEditor.toggleFormula(editor);
- closePopover();
- }, [selectNode, closePopover, editor]);
-
- const onDone = useCallback(
- (newFormula: string) => {
- selectNode();
- if (newFormula === '' && anchor.current) {
- const path = getNodePath(editor, anchor.current);
- const point = editor.before(path);
-
- CustomEditor.deleteFormula(editor);
- closePopover();
- if (point) {
- ReactEditor.focus(editor);
- editor.select(point);
- }
-
- return;
- } else {
- CustomEditor.updateFormula(editor, newFormula);
- handleEditPopoverClose();
- }
- },
- [closePopover, editor, handleEditPopoverClose, selectNode]
- );
-
- return (
- <>
- <span
- {...attributes}
- ref={(el) => {
- anchor.current = el;
- if (ref) {
- if (typeof ref === 'function') {
- ref(el);
- } else {
- ref.current = el;
- }
- }
- }}
- contentEditable={false}
- onDoubleClick={handleClick}
- onClick={handleClick}
- className={`${attributes.className ?? ''} formula-inline relative cursor-pointer rounded px-1 py-0.5 ${
- selected ? 'selected' : ''
- }`}
- >
- <InlineChromiumBugfix className={'left-0'} />
- <FormulaLeaf formula={formula}>{children}</FormulaLeaf>
- <InlineChromiumBugfix className={'right-0'} />
- </span>
- {open && (
- <FormulaEditPopover
- defaultText={formula}
- onClear={onClear}
- onDone={onDone}
- anchorEl={anchor.current}
- open={open}
- onClose={handleEditPopoverClose}
- />
- )}
- </>
- );
- })
-);
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/inline_nodes/inline_formula/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/inline_nodes/inline_formula/index.ts
deleted file mode 100644
index 5643ae8943..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/inline_nodes/inline_formula/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export * from './InlineFormula';
-export * from './FormulaLeaf';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/inline_nodes/link/Link.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/inline_nodes/link/Link.tsx
deleted file mode 100644
index 09095480dc..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/inline_nodes/link/Link.tsx
+++ /dev/null
@@ -1,48 +0,0 @@
-import { memo, useCallback, useRef } from 'react';
-import { ReactEditor, useSlate } from 'slate-react';
-import { getNodePath } from '$app/components/editor/components/editor/utils';
-import { Transforms, Text } from 'slate';
-import { useDecorateDispatch } from '$app/components/editor/stores';
-
-export const Link = memo(({ children }: { leaf: Text; children: React.ReactNode }) => {
- const { add: addDecorate } = useDecorateDispatch();
-
- const editor = useSlate();
-
- const ref = useRef<HTMLSpanElement | null>(null);
-
- const handleClick = useCallback(
- (e: React.MouseEvent) => {
- e.stopPropagation();
- e.preventDefault();
- if (ref.current === null) {
- return;
- }
-
- const path = getNodePath(editor, ref.current);
-
- ReactEditor.focus(editor);
- Transforms.select(editor, path);
-
- if (!editor.selection) return;
- addDecorate({
- range: editor.selection,
- class_name: 'bg-content-blue-100 rounded',
- type: 'link',
- });
- },
- [addDecorate, editor]
- );
-
- return (
- <>
- <span
- ref={ref}
- onMouseDown={handleClick}
- className={`cursor-pointer select-auto px-1 py-0.5 text-fill-default underline`}
- >
- {children}
- </span>
- </>
- );
-});
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/inline_nodes/link/LinkEditContent.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/inline_nodes/link/LinkEditContent.tsx
deleted file mode 100644
index af62a7b28f..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/inline_nodes/link/LinkEditContent.tsx
+++ /dev/null
@@ -1,179 +0,0 @@
-import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
-import Typography from '@mui/material/Typography';
-import { addMark, removeMark } from 'slate';
-import { EditorMarkFormat } from '$app/application/document/document.types';
-import { notify } from 'src/appflowy_app/components/_shared/notify';
-import { CustomEditor } from '$app/components/editor/command';
-import { useTranslation } from 'react-i18next';
-import { useSlateStatic } from 'slate-react';
-import { ReactComponent as RemoveSvg } from '$app/assets/delete.svg';
-import { ReactComponent as LinkSvg } from '$app/assets/link.svg';
-import { ReactComponent as CopySvg } from '$app/assets/copy.svg';
-import KeyboardNavigation, {
- KeyboardNavigationOption,
-} from '$app/components/_shared/keyboard_navigation/KeyboardNavigation';
-import isHotkey from 'is-hotkey';
-import LinkEditInput from '$app/components/editor/components/inline_nodes/link/LinkEditInput';
-import { openUrl, isUrl } from '$app/utils/open_url';
-
-function LinkEditContent({ onClose, defaultHref }: { onClose: () => void; defaultHref: string }) {
- const editor = useSlateStatic();
- const { t } = useTranslation();
- const isActivated = CustomEditor.isMarkActive(editor, EditorMarkFormat.Href);
-
- const [focusMenu, setFocusMenu] = useState<boolean>(false);
- const scrollRef = useRef<HTMLDivElement>(null);
- const inputRef = useRef<HTMLElement>(null);
- const [link, setLink] = useState<string>(defaultHref);
-
- const setNodeMark = useCallback(() => {
- if (link === '') {
- removeMark(editor, EditorMarkFormat.Href);
- } else {
- addMark(editor, EditorMarkFormat.Href, link);
- }
- }, [editor, link]);
-
- const removeNodeMark = useCallback(() => {
- onClose();
- editor.removeMark(EditorMarkFormat.Href);
- }, [editor, onClose]);
-
- useEffect(() => {
- const input = inputRef.current;
-
- if (!input) return;
-
- let isComposing = false;
-
- const handleCompositionUpdate = () => {
- isComposing = true;
- };
-
- const handleCompositionEnd = () => {
- isComposing = false;
- };
-
- const handleKeyDown = (e: KeyboardEvent) => {
- e.stopPropagation();
-
- if (e.key === 'Enter') {
- e.preventDefault();
- if (isUrl(link)) {
- onClose();
- setNodeMark();
- }
-
- return;
- }
-
- if (e.key === 'Escape') {
- e.preventDefault();
- onClose();
- return;
- }
-
- if (e.key === 'Tab') {
- e.preventDefault();
- setFocusMenu(true);
- return;
- }
-
- if (!isComposing && (e.key === 'ArrowDown' || e.key === 'ArrowUp')) {
- notify.clear();
- notify.info(`Press Tab to focus on the menu`);
- return;
- }
- };
-
- input.addEventListener('compositionstart', handleCompositionUpdate);
- input.addEventListener('compositionend', handleCompositionEnd);
- input.addEventListener('compositionupdate', handleCompositionUpdate);
- input.addEventListener('keydown', handleKeyDown);
- return () => {
- input.removeEventListener('keydown', handleKeyDown);
- input.removeEventListener('compositionstart', handleCompositionUpdate);
- input.removeEventListener('compositionend', handleCompositionEnd);
- input.removeEventListener('compositionupdate', handleCompositionUpdate);
- };
- }, [link, onClose, setNodeMark]);
-
- const onConfirm = useCallback(
- (key: string) => {
- if (key === 'open') {
- openUrl(link);
- } else if (key === 'copy') {
- void navigator.clipboard.writeText(link);
- notify.success(t('message.copy.success'));
- } else if (key === 'remove') {
- removeNodeMark();
- }
- },
- [link, removeNodeMark, t]
- );
-
- const renderOption = useCallback((icon: React.ReactNode, label: string) => {
- return (
- <div key={label} className={'flex items-center gap-2'}>
- {icon}
- <div className={'flex-1'}>{label}</div>
- </div>
- );
- }, []);
-
- const editOptions: KeyboardNavigationOption[] = useMemo(() => {
- return [
- {
- key: 'open',
- disabled: !isUrl(link),
- content: renderOption(<LinkSvg className={'h-4 w-4'} />, t('editor.openLink')),
- },
- {
- key: 'copy',
- content: renderOption(<CopySvg className={'h-4 w-4'} />, t('editor.copyLink')),
- },
- {
- key: 'remove',
- content: renderOption(<RemoveSvg className={'h-4 w-4'} />, t('editor.removeLink')),
- },
- ];
- }, [link, renderOption, t]);
-
- return (
- <>
- {!isActivated && (
- <Typography className={'w-full justify-start pb-2 font-medium'}>{t('editor.addYourLink')}</Typography>
- )}
- <LinkEditInput link={link} setLink={setLink} inputRef={inputRef} />
-
- <div ref={scrollRef} className={'mt-1 flex w-full flex-col items-start'}>
- {isActivated && (
- <KeyboardNavigation
- options={editOptions}
- disableFocus={!focusMenu}
- scrollRef={scrollRef}
- onConfirm={onConfirm}
- onFocus={() => {
- setFocusMenu(true);
- }}
- onBlur={() => {
- setFocusMenu(false);
- }}
- disableSelect={!focusMenu}
- onEscape={onClose}
- onKeyDown={(e) => {
- e.stopPropagation();
- if (isHotkey('Tab', e)) {
- e.preventDefault();
- setFocusMenu(false);
- inputRef.current?.focus();
- }
- }}
- />
- )}
- </div>
- </>
- );
-}
-
-export default LinkEditContent;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/inline_nodes/link/LinkEditInput.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/inline_nodes/link/LinkEditInput.tsx
deleted file mode 100644
index 6e9a0bb497..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/inline_nodes/link/LinkEditInput.tsx
+++ /dev/null
@@ -1,47 +0,0 @@
-import React, { useEffect, useState } from 'react';
-import { TextField } from '@mui/material';
-import { useTranslation } from 'react-i18next';
-import { isUrl } from '$app/utils/open_url';
-
-function LinkEditInput({
- link,
- setLink,
- inputRef,
-}: {
- link: string;
- setLink: (link: string) => void;
- inputRef: React.RefObject<HTMLElement>;
-}) {
- const { t } = useTranslation();
- const [error, setError] = useState<string | null>(null);
-
- useEffect(() => {
- if (isUrl(link)) {
- setError(null);
- return;
- }
-
- setError(t('editor.incorrectLink'));
- }, [link, t]);
-
- return (
- <form>
- <TextField
- variant={'outlined'}
- size={'small'}
- error={!!error}
- helperText={error}
- autoFocus={true}
- value={link}
- onChange={(e) => setLink(e.target.value)}
- spellCheck={false}
- inputRef={inputRef}
- className={'my-1 p-0'}
- placeholder={'https://example.com'}
- fullWidth={true}
- />
- </form>
- );
-}
-
-export default LinkEditInput;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/inline_nodes/link/LinkEditPopover.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/inline_nodes/link/LinkEditPopover.tsx
deleted file mode 100644
index 2a5e3630da..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/inline_nodes/link/LinkEditPopover.tsx
+++ /dev/null
@@ -1,69 +0,0 @@
-import React from 'react';
-import Popover from '@mui/material/Popover';
-import { PopoverCommonProps } from '$app/components/editor/components/tools/popover';
-
-import usePopoverAutoPosition from '$app/components/_shared/popover/Popover.hooks';
-import { PopoverOrigin } from '@mui/material/Popover/Popover';
-import LinkEditContent from '$app/components/editor/components/inline_nodes/link/LinkEditContent';
-
-const initialAnchorOrigin: PopoverOrigin = {
- vertical: 'bottom',
- horizontal: 'center',
-};
-
-const initialTransformOrigin: PopoverOrigin = {
- vertical: 'top',
- horizontal: 'center',
-};
-
-export function LinkEditPopover({
- defaultHref,
- open,
- onClose,
- anchorPosition,
- anchorReference,
-}: {
- defaultHref: string;
- open: boolean;
- onClose: () => void;
- anchorPosition?: { top: number; left: number; height: number };
- anchorReference?: 'anchorPosition' | 'anchorEl';
-}) {
- const {
- paperHeight,
- anchorPosition: newAnchorPosition,
- transformOrigin,
- anchorOrigin,
- } = usePopoverAutoPosition({
- anchorPosition,
- open,
- initialAnchorOrigin,
- initialTransformOrigin,
- initialPaperWidth: 340,
- initialPaperHeight: 200,
- });
-
- return (
- <Popover
- {...PopoverCommonProps}
- open={open}
- anchorPosition={newAnchorPosition}
- anchorReference={anchorReference}
- onClose={() => {
- onClose();
- }}
- transformOrigin={transformOrigin}
- anchorOrigin={anchorOrigin}
- onMouseDown={(e) => e.stopPropagation()}
- >
- <div
- style={{
- maxHeight: paperHeight,
- }}
- className='flex select-none flex-col p-4'
- >
- <LinkEditContent defaultHref={defaultHref} onClose={onClose} />
- </div>
- </Popover>
- );
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/inline_nodes/link/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/inline_nodes/link/index.ts
deleted file mode 100644
index 295683a3bc..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/inline_nodes/link/index.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export * from './Link';
-
-export * from './LinkEditPopover';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/inline_nodes/mention/Mention.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/inline_nodes/mention/Mention.tsx
deleted file mode 100644
index 7511147ad0..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/inline_nodes/mention/Mention.tsx
+++ /dev/null
@@ -1,18 +0,0 @@
-import React, { forwardRef, memo } from 'react';
-import { EditorElementProps, MentionNode } from '$app/application/document/document.types';
-
-import MentionLeaf from '$app/components/editor/components/inline_nodes/mention/MentionLeaf';
-import { InlineChromiumBugfix } from '$app/components/editor/components/inline_nodes/InlineChromiumBugfix';
-
-export const Mention = memo(
- forwardRef<HTMLSpanElement, EditorElementProps<MentionNode>>(({ node, children, ...attributes }, ref) => {
- return (
- <span {...attributes} contentEditable={false} className={`relative cursor-pointer`} ref={ref}>
- <InlineChromiumBugfix className={'left-0'} />
- <span className={'absolute right-0 top-0 h-full w-0 opacity-0'}>{children}</span>
- <MentionLeaf mention={node.data} />
- <InlineChromiumBugfix className={'right-0'} />
- </span>
- );
- })
-);
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/inline_nodes/mention/MentionLeaf.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/inline_nodes/mention/MentionLeaf.tsx
deleted file mode 100644
index 10def395c5..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/inline_nodes/mention/MentionLeaf.tsx
+++ /dev/null
@@ -1,141 +0,0 @@
-import React, { useCallback, useEffect, useState } from 'react';
-import { Mention, MentionPage } from '$app/application/document/document.types';
-import { ReactComponent as DocumentSvg } from '$app/assets/document.svg';
-import { useTranslation } from 'react-i18next';
-import { getPage } from '$app/application/folder/page.service';
-import { useSelected, useSlate } from 'slate-react';
-import { ReactComponent as EyeClose } from '$app/assets/eye_close.svg';
-import { notify } from 'src/appflowy_app/components/_shared/notify';
-import { subscribeNotifications } from '$app/application/notification';
-import { FolderNotification } from '@/services/backend';
-import { Editor, Range } from 'slate';
-import { useAppDispatch } from '$app/stores/store';
-import { openPage } from '$app_reducers/pages/async_actions';
-
-export function MentionLeaf({ mention }: { mention: Mention }) {
- const { t } = useTranslation();
- const [page, setPage] = useState<MentionPage | null>(null);
- const [error, setError] = useState<boolean>(false);
- const editor = useSlate();
- const selected = useSelected();
- const isCollapsed = editor.selection && Range.isCollapsed(editor.selection);
- const dispatch = useAppDispatch();
-
- useEffect(() => {
- if (selected && isCollapsed && page) {
- const afterPoint = editor.selection ? editor.after(editor.selection) : undefined;
-
- const afterStart = afterPoint ? Editor.start(editor, afterPoint) : undefined;
-
- if (afterStart) {
- editor.select(afterStart);
- }
- }
- }, [editor, isCollapsed, selected, page]);
-
- const loadPage = useCallback(async () => {
- setError(true);
- // keep old field for backward compatibility
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
- // @ts-expect-error
- const pageId = mention.page_id ?? mention.page;
-
- if (!pageId) return;
- try {
- const page = await getPage(pageId);
-
- setPage(page);
- setError(false);
- } catch {
- setPage(null);
- setError(true);
- }
- }, [mention]);
-
- useEffect(() => {
- void loadPage();
- }, [loadPage]);
-
- const handleOpenPage = useCallback(() => {
- if (!page) {
- notify.error(t('document.mention.deletedContent'));
- return;
- }
-
- void dispatch(openPage(page.id));
- }, [page, dispatch, t]);
-
- useEffect(() => {
- if (!page) return;
- const unsubscribePromise = subscribeNotifications(
- {
- [FolderNotification.DidUpdateView]: (changeset) => {
- setPage((prev) => {
- if (!prev) {
- return prev;
- }
-
- return {
- ...prev,
- name: changeset.name,
- };
- });
- },
- },
- {
- id: page.id,
- }
- );
-
- return () => void unsubscribePromise.then((unsubscribe) => unsubscribe());
- }, [page]);
-
- useEffect(() => {
- const parentId = page?.parentId;
-
- if (!parentId) return;
-
- const unsubscribePromise = subscribeNotifications(
- {
- [FolderNotification.DidUpdateChildViews]: (changeset) => {
- if (changeset.delete_child_views.includes(page.id)) {
- setPage(null);
- setError(true);
- }
- },
- },
- {
- id: parentId,
- }
- );
-
- return () => void unsubscribePromise.then((unsubscribe) => unsubscribe());
- }, [page]);
-
- return (
- <span
- className={`mention-inline mx-1 inline-flex select-none items-center gap-1`}
- onClick={handleOpenPage}
- contentEditable={false}
- style={{
- backgroundColor: selected ? 'var(--content-blue-100)' : undefined,
- }}
- >
- {error ? (
- <>
- <EyeClose />
- <span className={'mr-0.5 text-text-caption underline'}>{t('document.mention.deleted')}</span>
- </>
- ) : (
- page && (
- <>
- {page.icon?.value || <DocumentSvg />}
- <span className={'mr-1 underline'}>{page.name.trim() || t('menuAppHeader.defaultNewPageName')}</span>
- </>
- )
- )}
- </span>
- );
-}
-
-export default MentionLeaf;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/inline_nodes/mention/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/inline_nodes/mention/index.ts
deleted file mode 100644
index d3ee18034d..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/inline_nodes/mention/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './Mention';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/inline_nodes/withInline.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/inline_nodes/withInline.ts
deleted file mode 100644
index 2859c1f0a8..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/inline_nodes/withInline.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-import { ReactEditor } from 'slate-react';
-import { EditorInlineNodeType, inlineNodeTypes } from '$app/application/document/document.types';
-import { Element } from 'slate';
-
-export function withInlines(editor: ReactEditor) {
- const { isInline, isElementReadOnly, isSelectable, isVoid, markableVoid } = editor;
-
- const matchInlineType = (element: Element) => {
- return inlineNodeTypes.includes(element.type as EditorInlineNodeType);
- };
-
- editor.isInline = (element) => {
- return matchInlineType(element) || isInline(element);
- };
-
- editor.isVoid = (element) => {
- return matchInlineType(element) || isVoid(element);
- };
-
- editor.markableVoid = (element) => {
- return matchInlineType(element) || markableVoid(element);
- };
-
- editor.isElementReadOnly = (element) =>
- inlineNodeTypes.includes(element.type as EditorInlineNodeType) || isElementReadOnly(element);
-
- editor.isSelectable = (element) =>
- !inlineNodeTypes.includes(element.type as EditorInlineNodeType) && isSelectable(element);
-
- return editor;
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/_shared/ColorPicker.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/_shared/ColorPicker.tsx
deleted file mode 100644
index 41dea96f1e..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/_shared/ColorPicker.tsx
+++ /dev/null
@@ -1,174 +0,0 @@
-import React, { useCallback, useRef, useMemo } from 'react';
-import Typography from '@mui/material/Typography';
-import KeyboardNavigation, {
- KeyboardNavigationOption,
-} from '$app/components/_shared/keyboard_navigation/KeyboardNavigation';
-import { useTranslation } from 'react-i18next';
-import { TitleOutlined } from '@mui/icons-material';
-import { EditorMarkFormat } from '$app/application/document/document.types';
-import { ColorEnum, renderColor } from '$app/utils/color';
-
-export interface ColorPickerProps {
- onChange?: (format: EditorMarkFormat.FontColor | EditorMarkFormat.BgColor, color: string) => void;
- onEscape?: () => void;
- disableFocus?: boolean;
-}
-export function ColorPicker({ onEscape, onChange, disableFocus }: ColorPickerProps) {
- const { t } = useTranslation();
-
- const ref = useRef<HTMLDivElement>(null);
-
- const handleColorChange = useCallback(
- (key: string) => {
- const [format, , color = ''] = key.split('-');
- const formatKey = format === 'font' ? EditorMarkFormat.FontColor : EditorMarkFormat.BgColor;
-
- onChange?.(formatKey, color);
- },
- [onChange]
- );
-
- const renderColorItem = useCallback(
- (name: string, color: string, backgroundColor?: string) => {
- return (
- <div
- key={name}
- onClick={() => {
- handleColorChange(backgroundColor ? backgroundColor : color);
- }}
- className={'flex w-full cursor-pointer items-center justify-center gap-2'}
- >
- <div
- style={{
- backgroundColor: backgroundColor ? renderColor(backgroundColor) : 'transparent',
- color: color === '' ? 'var(--text-title)' : renderColor(color),
- }}
- className={'flex h-5 w-5 items-center justify-center rounded border border-line-divider'}
- >
- <TitleOutlined className={'h-4 w-4'} />
- </div>
- <div className={'flex-1 text-xs text-text-title'}>{name}</div>
- </div>
- );
- },
- [handleColorChange]
- );
-
- const colors: KeyboardNavigationOption[] = useMemo(() => {
- return [
- {
- key: 'font_color',
- content: (
- <Typography className={'px-3 pb-1 pt-3 text-text-caption'} variant='subtitle2'>
- {t('editor.textColor')}
- </Typography>
- ),
- children: [
- {
- key: 'font-default',
- content: renderColorItem(t('editor.fontColorDefault'), ''),
- },
- {
- key: `font-gray-rgb(120, 119, 116)`,
- content: renderColorItem(t('editor.fontColorGray'), 'rgb(120, 119, 116)'),
- },
- {
- key: 'font-brown-rgb(159, 107, 83)',
- content: renderColorItem(t('editor.fontColorBrown'), 'rgb(159, 107, 83)'),
- },
- {
- key: 'font-orange-rgb(217, 115, 13)',
- content: renderColorItem(t('editor.fontColorOrange'), 'rgb(217, 115, 13)'),
- },
- {
- key: 'font-yellow-rgb(203, 145, 47)',
- content: renderColorItem(t('editor.fontColorYellow'), 'rgb(203, 145, 47)'),
- },
- {
- key: 'font-green-rgb(68, 131, 97)',
- content: renderColorItem(t('editor.fontColorGreen'), 'rgb(68, 131, 97)'),
- },
- {
- key: 'font-blue-rgb(51, 126, 169)',
- content: renderColorItem(t('editor.fontColorBlue'), 'rgb(51, 126, 169)'),
- },
- {
- key: 'font-purple-rgb(144, 101, 176)',
- content: renderColorItem(t('editor.fontColorPurple'), 'rgb(144, 101, 176)'),
- },
- {
- key: 'font-pink-rgb(193, 76, 138)',
- content: renderColorItem(t('editor.fontColorPink'), 'rgb(193, 76, 138)'),
- },
- {
- key: 'font-red-rgb(212, 76, 71)',
- content: renderColorItem(t('editor.fontColorRed'), 'rgb(212, 76, 71)'),
- },
- ],
- },
- {
- key: 'bg_color',
- content: (
- <Typography className={'px-3 pb-1 pt-3 text-text-caption'} variant='subtitle2'>
- {t('editor.backgroundColor')}
- </Typography>
- ),
- children: [
- {
- key: 'bg-default',
- content: renderColorItem(t('editor.backgroundColorDefault'), '', ''),
- },
- {
- key: `bg-lime-${ColorEnum.Lime}`,
- content: renderColorItem(t('editor.backgroundColorLime'), '', ColorEnum.Lime),
- },
- {
- key: `bg-aqua-${ColorEnum.Aqua}`,
- content: renderColorItem(t('editor.backgroundColorAqua'), '', ColorEnum.Aqua),
- },
- {
- key: `bg-orange-${ColorEnum.Orange}`,
- content: renderColorItem(t('editor.backgroundColorOrange'), '', ColorEnum.Orange),
- },
- {
- key: `bg-yellow-${ColorEnum.Yellow}`,
- content: renderColorItem(t('editor.backgroundColorYellow'), '', ColorEnum.Yellow),
- },
- {
- key: `bg-green-${ColorEnum.Green}`,
- content: renderColorItem(t('editor.backgroundColorGreen'), '', ColorEnum.Green),
- },
- {
- key: `bg-blue-${ColorEnum.Blue}`,
- content: renderColorItem(t('editor.backgroundColorBlue'), '', ColorEnum.Blue),
- },
- {
- key: `bg-purple-${ColorEnum.Purple}`,
- content: renderColorItem(t('editor.backgroundColorPurple'), '', ColorEnum.Purple),
- },
- {
- key: `bg-pink-${ColorEnum.Pink}`,
- content: renderColorItem(t('editor.backgroundColorPink'), '', ColorEnum.Pink),
- },
- {
- key: `bg-red-${ColorEnum.LightPink}`,
- content: renderColorItem(t('editor.backgroundColorRed'), '', ColorEnum.LightPink),
- },
- ],
- },
- ];
- }, [renderColorItem, t]);
-
- return (
- <div ref={ref} className={'flex h-full max-h-[420px] w-full flex-col overflow-y-auto'}>
- <KeyboardNavigation
- disableFocus={disableFocus}
- onPressLeft={onEscape}
- scrollRef={ref}
- options={colors}
- onConfirm={handleColorChange}
- onEscape={onEscape}
- />
- </div>
- );
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/_shared/CustomColorPicker.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/_shared/CustomColorPicker.tsx
deleted file mode 100644
index ae463a2ff3..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/_shared/CustomColorPicker.tsx
+++ /dev/null
@@ -1,27 +0,0 @@
-import React, { useState } from 'react';
-import Popover, { PopoverProps } from '@mui/material/Popover';
-import { Color, SketchPicker } from 'react-color';
-
-import { Divider } from '@mui/material';
-
-export function CustomColorPicker({
- onColorChange,
- ...props
-}: {
- onColorChange?: (color: string) => void;
-} & PopoverProps) {
- const [color, setColor] = useState<Color | undefined>();
-
- return (
- <Popover {...props}>
- <SketchPicker
- onChange={(color) => {
- setColor(color.rgb);
- onColorChange?.(color.hex);
- }}
- color={color}
- />
- <Divider />
- </Popover>
- );
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/_shared/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/_shared/index.ts
deleted file mode 100644
index 00e212aa7f..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/_shared/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export * from './CustomColorPicker';
-export * from './ColorPicker';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/block_actions/AddBlockBelow.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/block_actions/AddBlockBelow.tsx
deleted file mode 100644
index eb2675bc71..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/block_actions/AddBlockBelow.tsx
+++ /dev/null
@@ -1,56 +0,0 @@
-import React from 'react';
-import { ReactEditor, useSlate } from 'slate-react';
-import { IconButton, Tooltip } from '@mui/material';
-import { ReactComponent as AddSvg } from '$app/assets/add.svg';
-import { useTranslation } from 'react-i18next';
-import { Element, Path } from 'slate';
-import { CustomEditor } from '$app/components/editor/command';
-import { EditorNodeType } from '$app/application/document/document.types';
-import { YjsEditor } from '@slate-yjs/core';
-import { useSlashState } from '$app/components/editor/stores';
-
-function AddBlockBelow({ node }: { node?: Element }) {
- const { t } = useTranslation();
- const editor = useSlate();
- const { setOpen: setSlashOpen } = useSlashState();
-
- const handleAddBelow = () => {
- if (!node) return;
- ReactEditor.focus(editor);
-
- const nodePath = ReactEditor.findPath(editor, node);
- const nextPath = Path.next(nodePath);
-
- editor.select(nodePath);
-
- if (editor.isSelectable(node)) {
- editor.collapse({
- edge: 'start',
- });
- }
-
- const isEmptyNode = CustomEditor.isEmptyText(editor, node);
-
- // if the node is not a paragraph, or it is not empty, insert a new empty line
- if (node.type !== EditorNodeType.Paragraph || !isEmptyNode) {
- CustomEditor.insertEmptyLine(editor as ReactEditor & YjsEditor, nextPath);
- editor.select(nextPath);
- }
-
- requestAnimationFrame(() => {
- setSlashOpen(true);
- });
- };
-
- return (
- <>
- <Tooltip disableInteractive={true} title={t('blockActions.addBelowTooltip')}>
- <IconButton onClick={handleAddBelow} size={'small'}>
- <AddSvg />
- </IconButton>
- </Tooltip>
- </>
- );
-}
-
-export default AddBlockBelow;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/block_actions/BlockActions.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/block_actions/BlockActions.tsx
deleted file mode 100644
index f5833e538b..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/block_actions/BlockActions.tsx
+++ /dev/null
@@ -1,30 +0,0 @@
-import React from 'react';
-
-import { Element } from 'slate';
-import AddBlockBelow from '$app/components/editor/components/tools/block_actions/AddBlockBelow';
-import { ReactComponent as DragSvg } from '$app/assets/drag.svg';
-import { IconButton, Tooltip } from '@mui/material';
-import { useTranslation } from 'react-i18next';
-
-export function BlockActions({
- node,
- onClickDrag,
-}: {
- node?: Element;
- onClickDrag: (e: React.MouseEvent<HTMLButtonElement>) => void;
-}) {
- const { t } = useTranslation();
-
- return (
- <>
- <AddBlockBelow node={node} />
- <Tooltip disableInteractive={true} title={t('blockActions.openMenuTooltip')}>
- <IconButton onClick={onClickDrag} size={'small'}>
- <DragSvg />
- </IconButton>
- </Tooltip>
- </>
- );
-}
-
-export default BlockActions;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/block_actions/BlockActionsToolbar.hooks.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/block_actions/BlockActionsToolbar.hooks.ts
deleted file mode 100644
index bc1086dde9..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/block_actions/BlockActionsToolbar.hooks.ts
+++ /dev/null
@@ -1,146 +0,0 @@
-import { RefObject, useCallback, useEffect, useState } from 'react';
-import { ReactEditor, useSlate } from 'slate-react';
-import { findEventNode, getBlockActionsPosition } from '$app/components/editor/components/tools/block_actions/utils';
-import { Element, Editor, Range } from 'slate';
-import { EditorNodeType } from '$app/application/document/document.types';
-import { Log } from '$app/utils/log';
-
-export function useBlockActionsToolbar(ref: RefObject<HTMLDivElement>, contextMenuVisible: boolean) {
- const editor = useSlate();
- const [node, setNode] = useState<Element | null>(null);
-
- const recalculatePosition = useCallback(
- (blockElement: HTMLElement) => {
- const { top, left } = getBlockActionsPosition(editor, blockElement);
-
- const slateEditorDom = ReactEditor.toDOMNode(editor, editor);
-
- if (!ref.current) return;
-
- ref.current.style.top = `${top + slateEditorDom.offsetTop}px`;
- ref.current.style.left = `${left + slateEditorDom.offsetLeft - 64}px`;
- },
- [editor, ref]
- );
-
- const close = useCallback(() => {
- const el = ref.current;
-
- if (!el) return;
-
- el.style.opacity = '0';
- el.style.pointerEvents = 'none';
- setNode(null);
- }, [ref]);
-
- useEffect(() => {
- const handleMouseMove = (e: MouseEvent) => {
- const el = ref.current;
-
- if (!el) return;
-
- const target = e.target as HTMLElement;
-
- if (target.closest(`[contenteditable="false"]`)) {
- return;
- }
-
- let range: Range | null = null;
- let node;
-
- try {
- range = ReactEditor.findEventRange(editor, e);
- } catch {
- const editorDom = ReactEditor.toDOMNode(editor, editor);
- const rect = editorDom.getBoundingClientRect();
- const isOverLeftBoundary = e.clientX < rect.left + 64;
- const isOverRightBoundary = e.clientX > rect.right - 64;
- let newX = e.clientX;
-
- if (isOverLeftBoundary) {
- newX = rect.left + 64;
- }
-
- if (isOverRightBoundary) {
- newX = rect.right - 64;
- }
-
- node = findEventNode(editor, {
- x: newX,
- y: e.clientY,
- });
- }
-
- if (!range && !node) {
- Log.warn('No range and node found');
- return;
- } else if (range) {
- const match = editor.above({
- match: (n) => {
- return !Editor.isEditor(n) && Element.isElement(n) && n.blockId !== undefined;
- },
- at: range,
- });
-
- if (!match) {
- close();
- return;
- }
-
- node = match[0] as Element;
- }
-
- if (!node) {
- close();
- return;
- }
-
- if (node.type === EditorNodeType.Page) return;
- const blockElement = ReactEditor.toDOMNode(editor, node);
-
- if (!blockElement) return;
- recalculatePosition(blockElement);
- el.style.opacity = '1';
- el.style.pointerEvents = 'auto';
- const slateNode = ReactEditor.toSlateNode(editor, blockElement) as Element;
-
- setNode(slateNode);
- };
-
- const dom = ReactEditor.toDOMNode(editor, editor);
-
- if (!contextMenuVisible) {
- dom.addEventListener('mousemove', handleMouseMove);
- dom.parentElement?.addEventListener('mouseleave', close);
- }
-
- return () => {
- dom.removeEventListener('mousemove', handleMouseMove);
- dom.parentElement?.removeEventListener('mouseleave', close);
- };
- }, [close, editor, contextMenuVisible, ref, recalculatePosition]);
-
- useEffect(() => {
- let observer: MutationObserver | null = null;
-
- if (node) {
- const dom = ReactEditor.toDOMNode(editor, node);
-
- if (dom.parentElement) {
- observer = new MutationObserver(close);
-
- observer.observe(dom.parentElement, {
- childList: true,
- });
- }
- }
-
- return () => {
- observer?.disconnect();
- };
- }, [close, editor, node]);
-
- return {
- node: node?.type === EditorNodeType.Page ? null : node,
- };
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/block_actions/BlockActionsToolbar.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/block_actions/BlockActionsToolbar.tsx
deleted file mode 100644
index 729b4df144..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/block_actions/BlockActionsToolbar.tsx
+++ /dev/null
@@ -1,141 +0,0 @@
-import React, { useCallback, useContext, useEffect, useRef, useState } from 'react';
-import { useBlockActionsToolbar } from './BlockActionsToolbar.hooks';
-import BlockActions from '$app/components/editor/components/tools/block_actions/BlockActions';
-
-import { getBlockCssProperty } from '$app/components/editor/components/tools/block_actions/utils';
-import BlockOperationMenu from '$app/components/editor/components/tools/block_actions/BlockOperationMenu';
-import { ReactEditor, useSlateStatic } from 'slate-react';
-import { PopoverProps } from '@mui/material/Popover';
-
-import { EditorSelectedBlockContext } from '$app/components/editor/stores/selected';
-import withErrorBoundary from '$app/components/_shared/error_boundary/withError';
-import { CustomEditor } from '$app/components/editor/command';
-import isEqual from 'lodash-es/isEqual';
-import { Range } from 'slate';
-
-const Toolbar = () => {
- const ref = useRef<HTMLDivElement | null>(null);
- const [openContextMenu, setOpenContextMenu] = useState(false);
- const { node } = useBlockActionsToolbar(ref, openContextMenu);
- const cssProperty = node && getBlockCssProperty(node);
- const selectedBlockContext = useContext(EditorSelectedBlockContext);
- const popoverPropsRef = useRef<Partial<PopoverProps> | undefined>(undefined);
- const editor = useSlateStatic();
-
- const handleOpen = useCallback(() => {
- if (!node || !node.blockId) return;
- setOpenContextMenu(true);
- const path = ReactEditor.findPath(editor, node);
-
- editor.select(path);
- selectedBlockContext.clear();
- selectedBlockContext.add(node.blockId);
- }, [editor, node, selectedBlockContext]);
-
- const handleClose = useCallback(() => {
- setOpenContextMenu(false);
- selectedBlockContext.clear();
- }, [selectedBlockContext]);
-
- useEffect(() => {
- if (!node) return;
- const nodeDom = ReactEditor.toDOMNode(editor, node);
- const onContextMenu = (e: MouseEvent) => {
- const { clientX, clientY } = e;
-
- e.stopPropagation();
-
- const { selection } = editor;
-
- const editorRange = ReactEditor.findEventRange(editor, e);
-
- if (!editorRange || !selection) return;
-
- const rangeBlock = CustomEditor.getBlock(editor, editorRange);
- const selectedBlock = CustomEditor.getBlock(editor, selection);
-
- if (
- Range.intersection(selection, editorRange) ||
- (rangeBlock && selectedBlock && isEqual(rangeBlock[1], selectedBlock[1]))
- ) {
- const windowSelection = window.getSelection();
- const range = windowSelection?.rangeCount ? windowSelection?.getRangeAt(0) : null;
- const isCollapsed = windowSelection?.isCollapsed;
-
- if (windowSelection && !isCollapsed) {
- if (range && range.endOffset === 0 && range.startContainer !== range.endContainer) {
- const newRange = range.cloneRange();
-
- newRange.setEnd(range.startContainer, range.startOffset);
- windowSelection.removeAllRanges();
- windowSelection.addRange(newRange);
- }
- }
-
- return;
- }
-
- e.preventDefault();
-
- popoverPropsRef.current = {
- transformOrigin: {
- vertical: 'top',
- horizontal: 'left',
- },
- anchorReference: 'anchorPosition',
- anchorPosition: {
- top: clientY,
- left: clientX,
- },
- };
-
- handleOpen();
- };
-
- nodeDom.addEventListener('contextmenu', onContextMenu);
-
- return () => {
- nodeDom.removeEventListener('contextmenu', onContextMenu);
- };
- }, [editor, handleOpen, node]);
- return (
- <>
- <div
- ref={ref}
- contentEditable={false}
- className={`block-actions absolute z-10 flex w-[64px] flex-grow transform items-center justify-end px-1 opacity-0 ${cssProperty}`}
- >
- {/* Ensure the toolbar in middle */}
- <div className={`invisible`}>$</div>
- {
- <BlockActions
- node={node || undefined}
- onClickDrag={(e: React.MouseEvent<HTMLButtonElement>) => {
- const target = e.currentTarget;
- const rect = target.getBoundingClientRect();
-
- popoverPropsRef.current = {
- transformOrigin: {
- vertical: 'center',
- horizontal: 'right',
- },
- anchorReference: 'anchorPosition',
- anchorPosition: {
- top: rect.top + rect.height / 2,
- left: rect.left,
- },
- };
-
- handleOpen();
- }}
- />
- }
- </div>
- {node && openContextMenu && (
- <BlockOperationMenu node={node} open={openContextMenu} onClose={handleClose} {...popoverPropsRef.current} />
- )}
- </>
- );
-};
-
-export const BlockActionsToolbar = withErrorBoundary(Toolbar);
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/block_actions/BlockOperationMenu.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/block_actions/BlockOperationMenu.tsx
deleted file mode 100644
index ade9817503..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/block_actions/BlockOperationMenu.tsx
+++ /dev/null
@@ -1,209 +0,0 @@
-import React, { useCallback, useMemo } from 'react';
-import Popover, { PopoverProps } from '@mui/material/Popover';
-import { ReactComponent as DeleteSvg } from '$app/assets/delete.svg';
-import { ReactComponent as CopySvg } from '$app/assets/copy.svg';
-import { useTranslation } from 'react-i18next';
-import { Divider } from '@mui/material';
-import { PopoverCommonProps } from '$app/components/editor/components/tools/popover';
-import { Element, Path } from 'slate';
-import { ReactEditor, useSlateStatic } from 'slate-react';
-import { CustomEditor } from '$app/components/editor/command';
-import KeyboardNavigation, {
- KeyboardNavigationOption,
-} from '$app/components/_shared/keyboard_navigation/KeyboardNavigation';
-import { Color } from '$app/components/editor/components/tools/block_actions/color';
-import { getModifier } from '$app/utils/hotkeys';
-
-import isHotkey from 'is-hotkey';
-import { EditorNodeType } from '$app/application/document/document.types';
-import { EditorSelectedBlockContext } from '$app/components/editor/stores/selected';
-
-export const canSetColorBlocks: EditorNodeType[] = [
- EditorNodeType.Paragraph,
- EditorNodeType.HeadingBlock,
- EditorNodeType.TodoListBlock,
- EditorNodeType.BulletedListBlock,
- EditorNodeType.NumberedListBlock,
- EditorNodeType.ToggleListBlock,
- EditorNodeType.QuoteBlock,
- EditorNodeType.CalloutBlock,
-];
-
-export function BlockOperationMenu({
- node,
- ...props
-}: {
- node: Element;
-} & PopoverProps) {
- const editor = useSlateStatic();
- const { t } = useTranslation();
-
- const canSetColor = useMemo(() => {
- return canSetColorBlocks.includes(node.type as EditorNodeType);
- }, [node]);
- const selectedBlockContext = React.useContext(EditorSelectedBlockContext);
- const [openColorMenu, setOpenColorMenu] = React.useState(false);
- const ref = React.useRef<HTMLDivElement>(null);
- const handleClose = useCallback(() => {
- props.onClose?.({}, 'backdropClick');
- ReactEditor.focus(editor);
- try {
- const path = ReactEditor.findPath(editor, node);
-
- editor.select(path);
- } catch (e) {
- // do nothing
- }
-
- editor.collapse({
- edge: 'start',
- });
- }, [editor, node, props]);
-
- const onConfirm = useCallback(
- (optionKey: string) => {
- switch (optionKey) {
- case 'delete': {
- CustomEditor.deleteNode(editor, node);
- break;
- }
-
- case 'duplicate': {
- const path = ReactEditor.findPath(editor, node);
- const newNode = CustomEditor.duplicateNode(editor, node);
-
- handleClose();
-
- const newBlockId = newNode.blockId;
-
- if (!newBlockId) return;
- requestAnimationFrame(() => {
- selectedBlockContext.clear();
- selectedBlockContext.add(newBlockId);
- const nextPath = Path.next(path);
-
- editor.select(nextPath);
- editor.collapse({
- edge: 'start',
- });
- });
- return;
- }
-
- case 'color': {
- setOpenColorMenu(true);
- return;
- }
- }
-
- handleClose();
- },
- [editor, handleClose, node, selectedBlockContext]
- );
-
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
- // @ts-ignore
- const options: KeyboardNavigationOption[] = useMemo(
- () =>
- [
- {
- key: 'block-operation',
- children: [
- {
- key: 'delete',
- content: (
- <div className={'flex w-full items-center justify-between gap-2'}>
- <DeleteSvg className={'h-5 w-5'} />
- <div className={'flex-1'}>{t('button.delete')}</div>
- <div className={'text-right text-text-caption'}>{'Del'}</div>
- </div>
- ),
- },
- {
- key: 'duplicate',
- content: (
- <div className={'flex w-full items-center justify-between gap-2'}>
- <CopySvg className={'h-5 w-5'} />
- <div className={'flex-1'}>{t('button.duplicate')}</div>
- <div className={'text-right text-text-caption'}>{`${getModifier()} + D`}</div>
- </div>
- ),
- },
- ],
- },
- canSetColor && {
- key: 'color',
- content: <Divider />,
- children: [
- {
- key: 'color',
- content: (
- <Color
- node={
- node as {
- data?: {
- font_color?: string;
- bg_color?: string;
- };
- } & Element
- }
- onClosePicker={() => {
- setOpenColorMenu(false);
- }}
- openPicker={openColorMenu}
- onOpenPicker={() => setOpenColorMenu(true)}
- />
- ),
- },
- ],
- },
- ].filter(Boolean),
- [node, canSetColor, openColorMenu, t]
- );
-
- const handleKeyDown = useCallback(
- (e: KeyboardEvent) => {
- e.stopPropagation();
- if (isHotkey('mod+d', e)) {
- e.preventDefault();
- onConfirm('duplicate');
- }
-
- if (isHotkey('del', e) || isHotkey('backspace', e)) {
- e.preventDefault();
- onConfirm('delete');
- }
- },
- [onConfirm]
- );
-
- return (
- <Popover
- {...PopoverCommonProps}
- disableAutoFocus={false}
- onMouseDown={(e) => e.stopPropagation()}
- {...props}
- onClose={handleClose}
- >
- <div className={'max-h-[360px] w-full overflow-y-auto py-1'} ref={ref}>
- <KeyboardNavigation
- onKeyDown={handleKeyDown}
- onPressLeft={handleClose}
- onPressRight={(key) => {
- if (key === 'color') {
- onConfirm(key);
- } else {
- handleClose();
- }
- }}
- options={options}
- scrollRef={ref}
- onEscape={handleClose}
- onConfirm={onConfirm}
- />
- </div>
- </Popover>
- );
-}
-
-export default BlockOperationMenu;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/block_actions/color/Color.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/block_actions/color/Color.tsx
deleted file mode 100644
index 499ab95c76..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/block_actions/color/Color.tsx
+++ /dev/null
@@ -1,90 +0,0 @@
-import React, { useCallback, useRef } from 'react';
-import { Element } from 'slate';
-import { Popover } from '@mui/material';
-import ColorLensOutlinedIcon from '@mui/icons-material/ColorLensOutlined';
-import { useTranslation } from 'react-i18next';
-import { ColorPicker } from '$app/components/editor/components/tools/_shared';
-import { CustomEditor } from '$app/components/editor/command';
-import { ReactComponent as MoreSvg } from '$app/assets/more.svg';
-import { useSlateStatic } from 'slate-react';
-import { PopoverOrigin } from '@mui/material/Popover/Popover';
-
-const initialOrigin: {
- transformOrigin?: PopoverOrigin;
- anchorOrigin?: PopoverOrigin;
-} = {
- anchorOrigin: {
- vertical: 'center',
- horizontal: 'right',
- },
- transformOrigin: {
- vertical: 'center',
- horizontal: 'left',
- },
-};
-
-export function Color({
- node,
- openPicker,
- onOpenPicker,
- onClosePicker,
-}: {
- node: Element & {
- data?: {
- font_color?: string;
- bg_color?: string;
- };
- };
- openPicker?: boolean;
- onOpenPicker?: () => void;
- onClosePicker?: () => void;
-}) {
- const { t } = useTranslation();
-
- const editor = useSlateStatic();
-
- const ref = useRef<HTMLDivElement>(null);
-
- const onColorChange = useCallback(
- (format: 'font_color' | 'bg_color', color: string) => {
- CustomEditor.setBlockColor(editor, node, {
- [format]: color,
- });
- onClosePicker?.();
- },
- [editor, node, onClosePicker]
- );
-
- return (
- <>
- <div ref={ref} onClick={onOpenPicker} className={'flex w-full items-center justify-between gap-2'}>
- <ColorLensOutlinedIcon className={'h-5 w-5'} />
- <div className={'flex-1'}>{t('editor.color')}</div>
- <MoreSvg className={'h-5 w-5'} />
- </div>
- {openPicker && (
- <Popover
- anchorOrigin={initialOrigin.anchorOrigin}
- transformOrigin={initialOrigin.transformOrigin}
- autoFocus={true}
- open={openPicker}
- onKeyDown={(e) => {
- e.stopPropagation();
- e.nativeEvent.stopImmediatePropagation();
- if (e.key === 'Escape' || e.key === 'ArrowLeft') {
- e.preventDefault();
- onClosePicker?.();
- }
- }}
- onClick={(e) => e.stopPropagation()}
- anchorEl={ref.current}
- onClose={onClosePicker}
- >
- <div className={'flex flex-col'}>
- <ColorPicker onEscape={onClosePicker} onChange={onColorChange} />
- </div>
- </Popover>
- )}
- </>
- );
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/block_actions/color/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/block_actions/color/index.ts
deleted file mode 100644
index 0fd619bc86..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/block_actions/color/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './Color';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/block_actions/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/block_actions/index.ts
deleted file mode 100644
index e8b87721c2..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/block_actions/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export * from './BlockActions';
-export * from './BlockActionsToolbar';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/block_actions/utils.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/block_actions/utils.ts
deleted file mode 100644
index b63afe9dc1..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/block_actions/utils.ts
+++ /dev/null
@@ -1,58 +0,0 @@
-import { ReactEditor } from 'slate-react';
-import { getEditorDomNode, getHeadingCssProperty } from '$app/components/editor/plugins/utils';
-import { Element } from 'slate';
-import { EditorNodeType, HeadingNode } from '$app/application/document/document.types';
-
-export function getBlockActionsPosition(editor: ReactEditor, blockElement: HTMLElement) {
- const editorDom = getEditorDomNode(editor);
- const editorDomRect = editorDom.getBoundingClientRect();
- const blockDomRect = blockElement.getBoundingClientRect();
-
- const relativeTop = blockDomRect.top - editorDomRect.top;
- const relativeLeft = blockDomRect.left - editorDomRect.left;
-
- return {
- top: relativeTop,
- left: relativeLeft,
- };
-}
-
-export function getBlockCssProperty(node: Element) {
- switch (node.type) {
- case EditorNodeType.HeadingBlock:
- return `${getHeadingCssProperty((node as HeadingNode).data.level)} mt-1`;
- case EditorNodeType.CodeBlock:
- case EditorNodeType.CalloutBlock:
- case EditorNodeType.EquationBlock:
- case EditorNodeType.GridBlock:
- return 'my-3';
- case EditorNodeType.DividerBlock:
- return 'my-0';
- default:
- return 'mt-1';
- }
-}
-
-/**
- * @param editor
- * @param e
- */
-export function findEventNode(
- editor: ReactEditor,
- {
- x,
- y,
- }: {
- x: number;
- y: number;
- }
-) {
- const element = document.elementFromPoint(x, y);
- const nodeDom = element?.closest('[data-block-type]');
-
- if (nodeDom) {
- return ReactEditor.toSlateNode(editor, nodeDom) as Element;
- }
-
- return null;
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/command_panel/Command.hooks.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/command_panel/Command.hooks.ts
deleted file mode 100644
index 633d09349d..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/command_panel/Command.hooks.ts
+++ /dev/null
@@ -1,259 +0,0 @@
-import { useEffect, useState, useCallback, useRef } from 'react';
-import { getPanelPosition } from '$app/components/editor/components/tools/command_panel/utils';
-import { useSlate } from 'slate-react';
-import { PopoverPreventBlurProps } from '$app/components/editor/components/tools/popover';
-import { PopoverProps } from '@mui/material/Popover';
-
-import { Editor, Point, Range, Transforms } from 'slate';
-import { CustomEditor } from '$app/components/editor/command';
-import { PopoverOrigin } from '@mui/material/Popover/Popover';
-import { useSlashState } from '$app/components/editor/stores';
-
-export enum EditorCommand {
- Mention = '@',
- SlashCommand = '/',
-}
-
-export const PanelPopoverProps: Partial<PopoverProps> = {
- ...PopoverPreventBlurProps,
- anchorReference: 'anchorPosition',
-};
-
-const commands = Object.values(EditorCommand);
-
-export interface PanelProps {
- anchorPosition?: { left: number; top: number; height: number };
- closePanel: (deleteText?: boolean) => void;
- searchText: string;
- openPanel: () => void;
-}
-
-export function useCommandPanel() {
- const editor = useSlate();
- const { open: slashOpen, setOpen: setSlashOpen } = useSlashState();
- const [command, setCommand] = useState<EditorCommand | undefined>(undefined);
- const [anchorPosition, setAnchorPosition] = useState<
- | {
- top: number;
- left: number;
- height: number;
- }
- | undefined
- >(undefined);
- const startPoint = useRef<Point>();
- const endPoint = useRef<Point>();
- const open = Boolean(anchorPosition);
- const [searchText, setSearchText] = useState('');
-
- const closePanel = useCallback(
- (deleteText?: boolean) => {
- if (deleteText && startPoint.current && endPoint.current) {
- const anchor = {
- path: startPoint.current.path,
- offset: startPoint.current.offset > 0 ? startPoint.current.offset - 1 : 0,
- };
- const focus = {
- path: endPoint.current.path,
- offset: endPoint.current.offset,
- };
-
- if (!Point.equals(anchor, focus)) {
- Transforms.delete(editor, {
- at: {
- anchor,
- focus,
- },
- });
- }
- }
-
- setSlashOpen(false);
- setCommand(undefined);
- setAnchorPosition(undefined);
- setSearchText('');
- },
- [editor, setSlashOpen]
- );
-
- const setPosition = useCallback(
- (position?: { left: number; top: number; height: number }) => {
- if (!position) {
- closePanel(false);
- return;
- }
-
- const nodeEntry = CustomEditor.getBlock(editor);
-
- if (!nodeEntry) return;
-
- setAnchorPosition(position);
- },
- [closePanel, editor]
- );
-
- const openPanel = useCallback(() => {
- const position = getPanelPosition(editor);
-
- if (position && editor.selection) {
- startPoint.current = Editor.start(editor, editor.selection);
- endPoint.current = Editor.end(editor, editor.selection);
- setPosition(position);
- } else {
- setPosition(undefined);
- }
- }, [editor, setPosition]);
-
- useEffect(() => {
- if (!slashOpen && command === EditorCommand.SlashCommand) {
- closePanel();
- return;
- }
-
- if (slashOpen && !open) {
- setCommand(EditorCommand.SlashCommand);
- openPanel();
- return;
- }
- }, [slashOpen, closePanel, command, open, openPanel]);
- /**
- * listen to editor insertText and deleteBackward event
- */
- useEffect(() => {
- const { insertText } = editor;
-
- /**
- * insertText: when insert char at after space or at start of element, show the panel
- * open condition:
- * 1. open is false
- * 2. current block is not code block
- * 3. current selection is not include root
- * 4. current selection is collapsed
- * 5. insert char is command char
- * 6. before text is empty or end with space
- * --------- start -----------------
- * | - selection point
- * @ - panel char
- * _ - space
- * - - other text
- * -------- open panel ----------------
- * ---_@|--- => insert text is panel char and before text is end with space, open the panel
- * @|--- => insert text is panel char and before text is empty, open the panel
- */
- editor.insertText = (text, opts) => {
- if (open || CustomEditor.isCodeBlock(editor) || CustomEditor.selectionIncludeRoot(editor)) {
- insertText(text, opts);
- return;
- }
-
- const { selection } = editor;
-
- const command = commands.find((c) => text.endsWith(c));
- const endOfPanelChar = !!command;
-
- if (command === EditorCommand.SlashCommand) {
- setSlashOpen(true);
- }
-
- setCommand(command);
- if (!selection || !endOfPanelChar || !Range.isCollapsed(selection)) {
- insertText(text, opts);
- return;
- }
-
- const block = CustomEditor.getBlock(editor);
- const path = block ? block[1] : [];
- const { anchor } = selection;
- const beforeText = Editor.string(editor, { anchor, focus: Editor.start(editor, path) }) + text.slice(0, -1);
- // show the panel when insert char at after space or at start of element
- const showPanel = !beforeText || beforeText.endsWith(' ');
-
- insertText(text, opts);
-
- if (!showPanel) return;
- openPanel();
- };
-
- return () => {
- editor.insertText = insertText;
- };
- }, [open, editor, openPanel, setSlashOpen]);
-
- /**
- * listen to editor onChange event
- */
- useEffect(() => {
- const { onChange } = editor;
-
- if (!open) return;
-
- /**
- * onChange: when selection change, update the search text or close the panel
- * --------- start -----------------
- * | - selection point
- * @ - panel char
- * __ - search text
- * - - other text
- * -------- close panel ----------------
- * --|@--- => selection is backward to start point, close the panel
- * ---@__-|--- => selection is forward to end point, close the panel
- * -------- update search text ----------------
- * ---@__|---
- * ---@_|_--- => selection is forward to start point and backward to end point, update the search text
- * ---@|__---
- * --------- end -----------------
- */
- editor.onChange = (...args) => {
- if (!editor.selection || !startPoint.current || !endPoint.current) return;
- onChange(...args);
- const isSelectionChange = editor.operations.every((op) => op.type === 'set_selection');
- const currentPoint = Editor.end(editor, editor.selection);
- const isBackward = currentPoint.offset < startPoint.current.offset;
-
- if (isBackward) {
- closePanel(false);
- return;
- }
-
- if (!isSelectionChange) {
- if (currentPoint.offset > endPoint.current?.offset) {
- endPoint.current = currentPoint;
- }
-
- const text = Editor.string(editor, {
- anchor: startPoint.current,
- focus: endPoint.current,
- });
-
- setSearchText(text);
- } else {
- const isForward = currentPoint.offset > endPoint.current.offset;
-
- if (isForward) {
- closePanel(false);
- }
- }
- };
-
- return () => {
- editor.onChange = onChange;
- };
- }, [open, editor, closePanel]);
-
- return {
- anchorPosition,
- closePanel,
- searchText,
- openPanel,
- command,
- };
-}
-
-export const initialTransformOrigin: PopoverOrigin = {
- vertical: 'top',
- horizontal: 'left',
-};
-
-export const initialAnchorOrigin: PopoverOrigin = {
- vertical: 'bottom',
- horizontal: 'right',
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/command_panel/CommandPanel.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/command_panel/CommandPanel.tsx
deleted file mode 100644
index db58e2deca..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/command_panel/CommandPanel.tsx
+++ /dev/null
@@ -1,17 +0,0 @@
-import React from 'react';
-import { SlashCommandPanel } from '$app/components/editor/components/tools/command_panel/slash_command_panel';
-import { MentionPanel } from '$app/components/editor/components/tools/command_panel/mention_panel';
-import { EditorCommand, useCommandPanel } from '$app/components/editor/components/tools/command_panel/Command.hooks';
-import withErrorBoundary from '$app/components/_shared/error_boundary/withError';
-
-function CommandPanel() {
- const { anchorPosition, searchText, openPanel, closePanel, command } = useCommandPanel();
-
- const Component = command === EditorCommand.SlashCommand ? SlashCommandPanel : MentionPanel;
-
- return (
- <Component closePanel={closePanel} searchText={searchText} openPanel={openPanel} anchorPosition={anchorPosition} />
- );
-}
-
-export default withErrorBoundary(CommandPanel);
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/command_panel/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/command_panel/index.ts
deleted file mode 100644
index cf07c7d996..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/command_panel/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export * from './mention_panel';
-export * from './slash_command_panel';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/command_panel/mention_panel/MentionPanel.hooks.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/command_panel/mention_panel/MentionPanel.hooks.tsx
deleted file mode 100644
index 5d83870719..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/command_panel/mention_panel/MentionPanel.hooks.tsx
+++ /dev/null
@@ -1,114 +0,0 @@
-import React, { useCallback, useMemo } from 'react';
-import { useTranslation } from 'react-i18next';
-import { useSlate } from 'slate-react';
-import { MentionPage, MentionType } from '$app/application/document/document.types';
-import { CustomEditor } from '$app/components/editor/command';
-import { KeyboardNavigationOption } from '$app/components/_shared/keyboard_navigation/KeyboardNavigation';
-import { ReactComponent as DocumentSvg } from '$app/assets/document.svg';
-// import dayjs from 'dayjs';
-
-// enum DateKey {
-// Today = 'today',
-// Tomorrow = 'tomorrow',
-// }
-export function useMentionPanel({
- closePanel,
- pages,
-}: {
- pages: MentionPage[];
- closePanel: (deleteText?: boolean) => void;
-}) {
- const { t } = useTranslation();
- const editor = useSlate();
-
- const onConfirm = useCallback(
- (key: string) => {
- const [, id] = key.split(',');
-
- closePanel(true);
- CustomEditor.insertMention(editor, {
- page_id: id,
- type: MentionType.PageRef,
- });
- },
- [closePanel, editor]
- );
-
- const renderPage = useCallback(
- (page: MentionPage) => {
- return {
- key: `${MentionType.PageRef},${page.id}`,
- content: (
- <div className={'flex items-center gap-2'}>
- <div className={'flex h-5 w-5 items-center justify-center'}>{page.icon?.value || <DocumentSvg />}</div>
-
- <div className={'flex-1'}>{page.name.trim() || t('menuAppHeader.defaultNewPageName')}</div>
- </div>
- ),
- };
- },
- [t]
- );
-
- // const renderDate = useCallback(() => {
- // return [
- // {
- // key: DateKey.Today,
- // content: (
- // <div className={'px-3 pb-1 pt-2 text-xs '}>
- // <span className={'text-text-title'}>{t('relativeDates.today')}</span> -{' '}
- // <span className={'text-xs text-text-caption'}>{dayjs().format('MMM D, YYYY')}</span>
- // </div>
- // ),
- //
- // children: [],
- // },
- // {
- // key: DateKey.Tomorrow,
- // content: (
- // <div className={'px-3 pb-1 pt-2 text-xs '}>
- // <span className={'text-text-title'}>{t('relativeDates.tomorrow')}</span>
- // </div>
- // ),
- // children: [],
- // },
- // ];
- // }, [t]);
-
- const options: KeyboardNavigationOption<MentionType | string>[] = useMemo(() => {
- return [
- // {
- // key: MentionType.Date,
- // content: <div className={'px-3 pb-1 pt-2 text-sm'}>{t('editor.date')}</div>,
- // children: renderDate(),
- // },
- {
- key: 'divider',
- content: <div className={'border-t border-line-divider'} />,
- children: [],
- },
-
- {
- key: MentionType.PageRef,
- content: <div className={'px-3 pb-1 pt-2 text-sm'}>{t('document.mention.page.label')}</div>,
- children:
- pages.length > 0
- ? pages.map(renderPage)
- : [
- {
- key: 'noPage',
- content: (
- <div className={'px-3 pb-3 pt-2 text-xs text-text-caption'}>{t('findAndReplace.noResult')}</div>
- ),
- children: [],
- },
- ],
- },
- ];
- }, [pages, renderPage, t]);
-
- return {
- options,
- onConfirm,
- };
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/command_panel/mention_panel/MentionPanel.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/command_panel/mention_panel/MentionPanel.tsx
deleted file mode 100644
index 6ca0225579..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/command_panel/mention_panel/MentionPanel.tsx
+++ /dev/null
@@ -1,81 +0,0 @@
-import React, { useCallback, useEffect, useRef, useState } from 'react';
-import {
- initialAnchorOrigin,
- initialTransformOrigin,
- PanelPopoverProps,
- PanelProps,
-} from '$app/components/editor/components/tools/command_panel/Command.hooks';
-import Popover from '@mui/material/Popover';
-
-import MentionPanelContent from '$app/components/editor/components/tools/command_panel/mention_panel/MentionPanelContent';
-import usePopoverAutoPosition from '$app/components/_shared/popover/Popover.hooks';
-import { useAppSelector } from '$app/stores/store';
-import { MentionPage } from '$app/application/document/document.types';
-
-export function MentionPanel({ anchorPosition, closePanel, searchText }: PanelProps) {
- const ref = useRef<HTMLDivElement>(null);
- const pagesMap = useAppSelector((state) => state.pages.pageMap);
-
- const pagesRef = useRef<MentionPage[]>([]);
- const [recentPages, setPages] = useState<MentionPage[]>([]);
-
- const loadPages = useCallback(async () => {
- const pages = Object.values(pagesMap);
-
- pagesRef.current = pages;
- setPages(pages);
- }, [pagesMap]);
-
- useEffect(() => {
- void loadPages();
- }, [loadPages]);
-
- useEffect(() => {
- if (!searchText) {
- setPages(pagesRef.current);
- return;
- }
-
- const filteredPages = pagesRef.current.filter((page) => {
- return page.name.toLowerCase().includes(searchText.toLowerCase());
- });
-
- setPages(filteredPages);
- }, [searchText]);
- const open = Boolean(anchorPosition);
-
- const {
- paperHeight,
- anchorPosition: newAnchorPosition,
- paperWidth,
- transformOrigin,
- anchorOrigin,
- isEntered,
- } = usePopoverAutoPosition({
- initialPaperWidth: 300,
- initialPaperHeight: 360,
- anchorPosition,
- initialTransformOrigin,
- initialAnchorOrigin,
- open,
- });
-
- return (
- <div ref={ref} className={'mention-panel'}>
- {open && (
- <Popover
- {...PanelPopoverProps}
- open={open && isEntered}
- anchorPosition={newAnchorPosition}
- anchorOrigin={anchorOrigin}
- transformOrigin={transformOrigin}
- onClose={() => closePanel(false)}
- >
- <MentionPanelContent width={paperWidth} maxHeight={paperHeight} closePanel={closePanel} pages={recentPages} />
- </Popover>
- )}
- </div>
- );
-}
-
-export default MentionPanel;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/command_panel/mention_panel/MentionPanelContent.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/command_panel/mention_panel/MentionPanelContent.tsx
deleted file mode 100644
index 36b00ca2b6..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/command_panel/mention_panel/MentionPanelContent.tsx
+++ /dev/null
@@ -1,45 +0,0 @@
-import React, { useRef } from 'react';
-import { useMentionPanel } from '$app/components/editor/components/tools/command_panel/mention_panel/MentionPanel.hooks';
-
-import KeyboardNavigation from '$app/components/_shared/keyboard_navigation/KeyboardNavigation';
-import { MentionPage } from '$app/application/document/document.types';
-
-function MentionPanelContent({
- closePanel,
- pages,
- maxHeight,
- width,
-}: {
- closePanel: (deleteText?: boolean) => void;
- pages: MentionPage[];
- maxHeight: number;
- width: number;
-}) {
- const scrollRef = useRef<HTMLDivElement>(null);
-
- const { options, onConfirm } = useMentionPanel({
- closePanel,
- pages,
- });
-
- return (
- <div
- ref={scrollRef}
- style={{
- maxHeight,
- width,
- }}
- className={' overflow-auto overflow-x-hidden'}
- >
- <KeyboardNavigation
- scrollRef={scrollRef}
- onEscape={closePanel}
- onConfirm={onConfirm}
- options={options}
- disableFocus={true}
- />
- </div>
- );
-}
-
-export default MentionPanelContent;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/command_panel/mention_panel/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/command_panel/mention_panel/index.ts
deleted file mode 100644
index bfca34ef9a..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/command_panel/mention_panel/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export * from './MentionPanel';
-export * from './MentionPanelContent';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/command_panel/slash_command_panel/SlashCommandPanel.hooks.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/command_panel/slash_command_panel/SlashCommandPanel.hooks.tsx
deleted file mode 100644
index c2d9445b56..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/command_panel/slash_command_panel/SlashCommandPanel.hooks.tsx
+++ /dev/null
@@ -1,245 +0,0 @@
-import { EditorNodeType } from '$app/application/document/document.types';
-import { useCallback, useMemo } from 'react';
-import { useTranslation } from 'react-i18next';
-import { ReactEditor, useSlate } from 'slate-react';
-import { Path } from 'slate';
-import { getBlock } from '$app/components/editor/plugins/utils';
-import { ReactComponent as TextIcon } from '$app/assets/text.svg';
-import { ReactComponent as TodoListIcon } from '$app/assets/todo-list.svg';
-import { ReactComponent as Heading1Icon } from '$app/assets/h1.svg';
-import { ReactComponent as Heading2Icon } from '$app/assets/h2.svg';
-import { ReactComponent as Heading3Icon } from '$app/assets/h3.svg';
-import { ReactComponent as BulletedListIcon } from '$app/assets/list.svg';
-import { ReactComponent as NumberedListIcon } from '$app/assets/numbers.svg';
-import { ReactComponent as QuoteIcon } from '$app/assets/quote.svg';
-import { ReactComponent as ToggleListIcon } from '$app/assets/show-menu.svg';
-import { ReactComponent as GridIcon } from '$app/assets/grid.svg';
-import { ReactComponent as ImageIcon } from '$app/assets/image.svg';
-import { DataObjectOutlined, FunctionsOutlined, HorizontalRuleOutlined, MenuBookOutlined } from '@mui/icons-material';
-import { CustomEditor } from '$app/components/editor/command';
-import { KeyboardNavigationOption } from '$app/components/_shared/keyboard_navigation/KeyboardNavigation';
-import { YjsEditor } from '@slate-yjs/core';
-import { useEditorBlockDispatch } from '$app/components/editor/stores/block';
-import {
- headingTypes,
- headingTypeToLevelMap,
- reorderSlashOptions,
- SlashAliases,
- SlashCommandPanelTab,
- slashOptionGroup,
- slashOptionMapToEditorNodeType,
- SlashOptionType,
-} from '$app/components/editor/components/tools/command_panel/slash_command_panel/const';
-
-export function useSlashCommandPanel({
- searchText,
- closePanel,
-}: {
- searchText: string;
- closePanel: (deleteText?: boolean) => void;
-}) {
- const { openPopover } = useEditorBlockDispatch();
- const { t } = useTranslation();
- const editor = useSlate();
- const onConfirm = useCallback(
- (type: SlashOptionType) => {
- const node = getBlock(editor);
-
- if (!node) return;
-
- const nodeType = slashOptionMapToEditorNodeType[type];
-
- if (!nodeType) return;
-
- const data = {};
-
- if (headingTypes.includes(type)) {
- Object.assign(data, {
- level: headingTypeToLevelMap[type],
- });
- }
-
- if (nodeType === EditorNodeType.CalloutBlock) {
- Object.assign(data, {
- icon: '📌',
- });
- }
-
- if (nodeType === EditorNodeType.CodeBlock) {
- Object.assign(data, {
- language: 'json',
- });
- }
-
- if (nodeType === EditorNodeType.ImageBlock) {
- Object.assign(data, {
- url: '',
- });
- }
-
- closePanel(true);
-
- const newNode = getBlock(editor);
- const block = CustomEditor.getBlock(editor);
-
- const path = block ? block[1] : null;
-
- if (!newNode || !path) return;
-
- const isEmpty = CustomEditor.isEmptyText(editor, newNode);
-
- if (!isEmpty) {
- const nextPath = Path.next(path);
-
- CustomEditor.insertEmptyLine(editor as ReactEditor & YjsEditor, nextPath);
- editor.select(nextPath);
- }
-
- const turnIntoBlock = CustomEditor.turnToBlock(editor, {
- type: nodeType,
- data,
- });
-
- setTimeout(() => {
- if (turnIntoBlock && turnIntoBlock.blockId) {
- if (turnIntoBlock.type === EditorNodeType.ImageBlock || turnIntoBlock.type === EditorNodeType.EquationBlock) {
- openPopover(turnIntoBlock.type, turnIntoBlock.blockId);
- }
- }
- }, 0);
- },
- [editor, closePanel, openPopover]
- );
-
- const typeToLabelIconMap = useMemo(() => {
- return {
- [SlashOptionType.Paragraph]: {
- label: t('editor.text'),
- Icon: TextIcon,
- },
- [SlashOptionType.TodoList]: {
- label: t('editor.checkbox'),
- Icon: TodoListIcon,
- },
- [SlashOptionType.Heading1]: {
- label: t('editor.heading1'),
- Icon: Heading1Icon,
- },
- [SlashOptionType.Heading2]: {
- label: t('editor.heading2'),
- Icon: Heading2Icon,
- },
- [SlashOptionType.Heading3]: {
- label: t('editor.heading3'),
- Icon: Heading3Icon,
- },
- [SlashOptionType.BulletedList]: {
- label: t('editor.bulletedList'),
- Icon: BulletedListIcon,
- },
- [SlashOptionType.NumberedList]: {
- label: t('editor.numberedList'),
- Icon: NumberedListIcon,
- },
- [SlashOptionType.Quote]: {
- label: t('editor.quote'),
- Icon: QuoteIcon,
- },
- [SlashOptionType.ToggleList]: {
- label: t('document.plugins.toggleList'),
- Icon: ToggleListIcon,
- },
- [SlashOptionType.Divider]: {
- label: t('editor.divider'),
- Icon: HorizontalRuleOutlined,
- },
- [SlashOptionType.Callout]: {
- label: t('document.plugins.callout'),
- Icon: MenuBookOutlined,
- },
- [SlashOptionType.Code]: {
- label: t('document.selectionMenu.codeBlock'),
- Icon: DataObjectOutlined,
- },
- [SlashOptionType.Grid]: {
- label: t('grid.menuName'),
- Icon: GridIcon,
- },
-
- [SlashOptionType.MathEquation]: {
- label: t('document.plugins.mathEquation.name'),
- Icon: FunctionsOutlined,
- },
- [SlashOptionType.Image]: {
- label: t('editor.image'),
- Icon: ImageIcon,
- },
- };
- }, [t]);
-
- const groupTypeToLabelMap = useMemo(() => {
- return {
- [SlashCommandPanelTab.BASIC]: 'Basic',
- [SlashCommandPanelTab.ADVANCED]: 'Advanced',
- [SlashCommandPanelTab.MEDIA]: 'Media',
- [SlashCommandPanelTab.DATABASE]: 'Database',
- };
- }, []);
-
- const renderOptionContent = useCallback(
- (type: SlashOptionType) => {
- const Icon = typeToLabelIconMap[type].Icon;
-
- return (
- <div className={'flex items-center gap-2'}>
- <div className={'flex h-6 w-6 items-center justify-center'}>
- <Icon className={'h-4 w-4'} />
- </div>
-
- <div className={'flex-1'}>{typeToLabelIconMap[type].label}</div>
- </div>
- );
- },
- [typeToLabelIconMap]
- );
-
- const options: KeyboardNavigationOption<SlashOptionType | SlashCommandPanelTab>[] = useMemo(() => {
- return slashOptionGroup
- .map((group) => {
- return {
- key: group.key,
- content: <div className={'px-3 pb-1 pt-2 text-sm'}>{groupTypeToLabelMap[group.key]}</div>,
- children: group.options
-
- .map((type) => {
- return {
- key: type,
- content: renderOptionContent(type),
- };
- })
- .filter((option) => {
- if (!searchText) return true;
- const label = typeToLabelIconMap[option.key].label;
-
- let newSearchText = searchText;
-
- if (searchText.startsWith('/')) {
- newSearchText = searchText.slice(1);
- }
-
- return (
- label.toLowerCase().includes(newSearchText.toLowerCase()) ||
- SlashAliases[option.key].some((alias) => alias.startsWith(newSearchText.toLowerCase()))
- );
- })
- .sort(reorderSlashOptions(searchText)),
- };
- })
- .filter((group) => group.children.length > 0);
- }, [searchText, groupTypeToLabelMap, typeToLabelIconMap, renderOptionContent]);
-
- return {
- options,
- onConfirm,
- };
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/command_panel/slash_command_panel/SlashCommandPanel.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/command_panel/slash_command_panel/SlashCommandPanel.tsx
deleted file mode 100644
index b09af97b39..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/command_panel/slash_command_panel/SlashCommandPanel.tsx
+++ /dev/null
@@ -1,73 +0,0 @@
-import React, { useCallback, useRef } from 'react';
-import {
- initialAnchorOrigin,
- initialTransformOrigin,
- PanelPopoverProps,
- PanelProps,
-} from '$app/components/editor/components/tools/command_panel/Command.hooks';
-import Popover from '@mui/material/Popover';
-import SlashCommandPanelContent from '$app/components/editor/components/tools/command_panel/slash_command_panel/SlashCommandPanelContent';
-import { useSlate } from 'slate-react';
-import usePopoverAutoPosition from '$app/components/_shared/popover/Popover.hooks';
-
-export function SlashCommandPanel({ anchorPosition, closePanel, searchText }: PanelProps) {
- const ref = useRef<HTMLDivElement>(null);
- const editor = useSlate();
-
- const open = Boolean(anchorPosition);
-
- const handleClose = useCallback(
- (deleteText?: boolean) => {
- closePanel(deleteText);
- },
- [closePanel]
- );
-
- const {
- paperHeight,
- paperWidth,
- anchorPosition: newAnchorPosition,
- transformOrigin,
- anchorOrigin,
- isEntered,
- } = usePopoverAutoPosition({
- initialPaperWidth: 220,
- initialPaperHeight: 360,
- anchorPosition,
- initialTransformOrigin,
- initialAnchorOrigin,
- open,
- });
-
- return (
- <div ref={ref} className={'slash-command-panel'}>
- {open && (
- <Popover
- {...PanelPopoverProps}
- open={open && isEntered}
- anchorPosition={newAnchorPosition}
- anchorOrigin={anchorOrigin}
- transformOrigin={transformOrigin}
- onClose={() => {
- const selection = editor.selection;
-
- handleClose(false);
-
- if (selection) {
- editor.select(selection);
- }
- }}
- >
- <SlashCommandPanelContent
- width={paperWidth}
- maxHeight={paperHeight}
- closePanel={handleClose}
- searchText={searchText}
- />
- </Popover>
- )}
- </div>
- );
-}
-
-export default SlashCommandPanel;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/command_panel/slash_command_panel/SlashCommandPanelContent.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/command_panel/slash_command_panel/SlashCommandPanelContent.tsx
deleted file mode 100644
index 256e82f811..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/command_panel/slash_command_panel/SlashCommandPanelContent.tsx
+++ /dev/null
@@ -1,89 +0,0 @@
-import React, { useEffect, useRef } from 'react';
-import KeyboardNavigation from '$app/components/_shared/keyboard_navigation/KeyboardNavigation';
-import { useSlashCommandPanel } from '$app/components/editor/components/tools/command_panel/slash_command_panel/SlashCommandPanel.hooks';
-import { useSlateStatic } from 'slate-react';
-import { SlashOptionType } from '$app/components/editor/components/tools/command_panel/slash_command_panel/const';
-
-const noResultBuffer = 2;
-
-function SlashCommandPanelContent({
- closePanel,
- searchText,
- maxHeight,
- width,
-}: {
- closePanel: (deleteText?: boolean) => void;
- searchText: string;
- maxHeight: number;
- width: number;
-}) {
- const scrollRef = useRef<HTMLDivElement>(null);
-
- const { options, onConfirm } = useSlashCommandPanel({
- closePanel,
- searchText,
- });
-
- // Used to keep track of how many times the user has typed and not found any result
- const noResultCount = useRef(0);
-
- const editor = useSlateStatic();
-
- useEffect(() => {
- const { insertText, deleteBackward } = editor;
-
- editor.insertText = (text, opts) => {
- // close panel if track of no result is greater than buffer
- if (noResultCount.current >= noResultBuffer) {
- closePanel(false);
- }
-
- if (options.length === 0) {
- noResultCount.current += 1;
- }
-
- insertText(text, opts);
- };
-
- editor.deleteBackward = (unit) => {
- // reset no result count
- if (noResultCount.current > 0) {
- noResultCount.current -= 1;
- }
-
- // close panel if no text
- if (!searchText) {
- closePanel(true);
- return;
- }
-
- deleteBackward(unit);
- };
-
- return () => {
- editor.insertText = insertText;
- editor.deleteBackward = deleteBackward;
- };
- }, [closePanel, editor, searchText, options.length]);
-
- return (
- <div
- ref={scrollRef}
- style={{
- maxHeight,
- width,
- }}
- className={'overflow-auto overflow-x-hidden py-1'}
- >
- <KeyboardNavigation
- scrollRef={scrollRef}
- onEscape={closePanel}
- onConfirm={(key) => onConfirm(key as SlashOptionType)}
- options={options}
- disableFocus={true}
- />
- </div>
- );
-}
-
-export default SlashCommandPanelContent;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/command_panel/slash_command_panel/const.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/command_panel/slash_command_panel/const.ts
deleted file mode 100644
index 7dfaa2b4a0..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/command_panel/slash_command_panel/const.ts
+++ /dev/null
@@ -1,174 +0,0 @@
-import { EditorNodeType } from '$app/application/document/document.types';
-
-export enum SlashCommandPanelTab {
- BASIC = 'basic',
- MEDIA = 'media',
- DATABASE = 'database',
- ADVANCED = 'advanced',
-}
-
-export enum SlashOptionType {
- Paragraph,
- TodoList,
- Heading1,
- Heading2,
- Heading3,
- BulletedList,
- NumberedList,
- Quote,
- ToggleList,
- Divider,
- Callout,
- Code,
- Grid,
- MathEquation,
- Image,
-}
-
-export const slashOptionGroup = [
- {
- key: SlashCommandPanelTab.BASIC,
- options: [
- SlashOptionType.Paragraph,
- SlashOptionType.TodoList,
- SlashOptionType.Heading1,
- SlashOptionType.Heading2,
- SlashOptionType.Heading3,
- SlashOptionType.BulletedList,
- SlashOptionType.NumberedList,
- SlashOptionType.Quote,
- SlashOptionType.ToggleList,
- SlashOptionType.Divider,
- SlashOptionType.Callout,
- ],
- },
- {
- key: SlashCommandPanelTab.MEDIA,
- options: [SlashOptionType.Code, SlashOptionType.Image],
- },
- {
- key: SlashCommandPanelTab.DATABASE,
- options: [SlashOptionType.Grid],
- },
- {
- key: SlashCommandPanelTab.ADVANCED,
- options: [SlashOptionType.MathEquation],
- },
-];
-export const slashOptionMapToEditorNodeType = {
- [SlashOptionType.Paragraph]: EditorNodeType.Paragraph,
- [SlashOptionType.TodoList]: EditorNodeType.TodoListBlock,
- [SlashOptionType.Heading1]: EditorNodeType.HeadingBlock,
- [SlashOptionType.Heading2]: EditorNodeType.HeadingBlock,
- [SlashOptionType.Heading3]: EditorNodeType.HeadingBlock,
- [SlashOptionType.BulletedList]: EditorNodeType.BulletedListBlock,
- [SlashOptionType.NumberedList]: EditorNodeType.NumberedListBlock,
- [SlashOptionType.Quote]: EditorNodeType.QuoteBlock,
- [SlashOptionType.ToggleList]: EditorNodeType.ToggleListBlock,
- [SlashOptionType.Divider]: EditorNodeType.DividerBlock,
- [SlashOptionType.Callout]: EditorNodeType.CalloutBlock,
- [SlashOptionType.Code]: EditorNodeType.CodeBlock,
- [SlashOptionType.Grid]: EditorNodeType.GridBlock,
- [SlashOptionType.MathEquation]: EditorNodeType.EquationBlock,
- [SlashOptionType.Image]: EditorNodeType.ImageBlock,
-};
-export const headingTypeToLevelMap: Record<string, number> = {
- [SlashOptionType.Heading1]: 1,
- [SlashOptionType.Heading2]: 2,
- [SlashOptionType.Heading3]: 3,
-};
-export const headingTypes = [SlashOptionType.Heading1, SlashOptionType.Heading2, SlashOptionType.Heading3];
-
-export const SlashAliases = {
- [SlashOptionType.Paragraph]: ['paragraph', 'text', 'block', 'textblock'],
- [SlashOptionType.TodoList]: [
- 'list',
- 'todo',
- 'todolist',
- 'checkbox',
- 'block',
- 'todoblock',
- 'checkboxblock',
- 'todolistblock',
- ],
- [SlashOptionType.Heading1]: ['h1', 'heading1', 'block', 'headingblock', 'h1block'],
- [SlashOptionType.Heading2]: ['h2', 'heading2', 'block', 'headingblock', 'h2block'],
- [SlashOptionType.Heading3]: ['h3', 'heading3', 'block', 'headingblock', 'h3block'],
- [SlashOptionType.BulletedList]: [
- 'list',
- 'bulleted',
- 'block',
- 'bulletedlist',
- 'bulletedblock',
- 'listblock',
- 'bulletedlistblock',
- 'bulletelist',
- ],
- [SlashOptionType.NumberedList]: [
- 'list',
- 'numbered',
- 'block',
- 'numberedlist',
- 'numberedblock',
- 'listblock',
- 'numberedlistblock',
- 'numberlist',
- ],
- [SlashOptionType.Quote]: ['quote', 'block', 'quoteblock'],
- [SlashOptionType.ToggleList]: ['list', 'toggle', 'block', 'togglelist', 'toggleblock', 'listblock', 'togglelistblock'],
- [SlashOptionType.Divider]: ['divider', 'hr', 'block', 'dividerblock', 'line', 'lineblock'],
- [SlashOptionType.Callout]: ['callout', 'info', 'block', 'calloutblock'],
- [SlashOptionType.Code]: ['code', 'code', 'block', 'codeblock', 'media'],
- [SlashOptionType.Grid]: ['grid', 'table', 'block', 'gridblock', 'database'],
- [SlashOptionType.MathEquation]: [
- 'math',
- 'equation',
- 'block',
- 'mathblock',
- 'mathequation',
- 'mathequationblock',
- 'advanced',
- ],
- [SlashOptionType.Image]: ['img', 'image', 'block', 'imageblock', 'media'],
-};
-
-export const reorderSlashOptions = (searchText: string) => {
- return (
- a: {
- key: SlashOptionType;
- },
- b: {
- key: SlashOptionType;
- }
- ) => {
- const compareIndex = (option: SlashOptionType) => {
- const aliases = SlashAliases[option];
-
- if (aliases) {
- for (const alias of aliases) {
- if (alias.startsWith(searchText)) {
- return -1;
- }
- }
- }
-
- return 0;
- };
-
- const compareLength = (option: SlashOptionType) => {
- const aliases = SlashAliases[option];
-
- if (aliases) {
- for (const alias of aliases) {
- if (alias.length < searchText.length) {
- return -1;
- }
- }
- }
-
- return 0;
- };
-
- return compareIndex(a.key) - compareIndex(b.key) || compareLength(a.key) - compareLength(b.key);
- };
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/command_panel/slash_command_panel/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/command_panel/slash_command_panel/index.ts
deleted file mode 100644
index 688a6ffb7d..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/command_panel/slash_command_panel/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export * from './SlashCommandPanel';
-export * from './SlashCommandPanelContent';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/command_panel/utils.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/command_panel/utils.ts
deleted file mode 100644
index 65a095dc58..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/command_panel/utils.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-import { ReactEditor } from 'slate-react';
-
-export function getPanelPosition(editor: ReactEditor) {
- const { selection } = editor;
-
- const isFocused = ReactEditor.isFocused(editor);
-
- if (!selection || !isFocused) {
- return null;
- }
-
- const domSelection = window.getSelection();
- const rangeCount = domSelection?.rangeCount;
-
- if (!rangeCount) return null;
-
- const domRange = rangeCount > 0 ? domSelection.getRangeAt(0) : undefined;
-
- const rect = domRange?.getBoundingClientRect();
-
- if (!rect) return null;
- const nodeDom = domSelection.anchorNode?.parentElement?.closest('.text-element');
- const height = (nodeDom?.getBoundingClientRect().height ?? 0) + 8;
-
- return {
- ...rect,
- height,
- top: rect.top,
- left: rect.left,
- };
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/popover.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/popover.ts
deleted file mode 100644
index 2b6a715baa..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/popover.ts
+++ /dev/null
@@ -1,34 +0,0 @@
-import { PopoverProps } from '@mui/material/Popover';
-
-export const PopoverCommonProps: Partial<PopoverProps> = {
- keepMounted: false,
- disableAutoFocus: true,
- disableEnforceFocus: true,
- disableRestoreFocus: true,
-};
-
-export const PopoverPreventBlurProps: Partial<PopoverProps> = {
- ...PopoverCommonProps,
-
- onMouseDown: (e) => {
- // prevent editor blur
- e.preventDefault();
- e.stopPropagation();
- },
-};
-
-export const PopoverNoBackdropProps: Partial<PopoverProps> = {
- ...PopoverCommonProps,
- sx: {
- pointerEvents: 'none',
- },
- PaperProps: {
- style: {
- pointerEvents: 'auto',
- },
- },
- onMouseDown: (e) => {
- // prevent editor blur
- e.stopPropagation();
- },
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/SelectionActions.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/SelectionActions.tsx
deleted file mode 100644
index 9d7c19b999..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/SelectionActions.tsx
+++ /dev/null
@@ -1,73 +0,0 @@
-import React from 'react';
-
-import { Paragraph } from '$app/components/editor/components/tools/selection_toolbar/actions/paragraph';
-import { Heading } from '$app/components/editor/components/tools/selection_toolbar/actions/heading';
-import { Divider } from '@mui/material';
-import { Bold } from '$app/components/editor/components/tools/selection_toolbar/actions/bold';
-import { Italic } from '$app/components/editor/components/tools/selection_toolbar/actions/italic';
-import { Underline } from '$app/components/editor/components/tools/selection_toolbar/actions/underline';
-import { StrikeThrough } from '$app/components/editor/components/tools/selection_toolbar/actions/strikethrough';
-import { InlineCode } from '$app/components/editor/components/tools/selection_toolbar/actions/inline_code';
-import { Formula } from '$app/components/editor/components/tools/selection_toolbar/actions/formula';
-import { TodoList } from '$app/components/editor/components/tools/selection_toolbar/actions/todo_list';
-import { Quote } from '$app/components/editor/components/tools/selection_toolbar/actions/quote';
-import { ToggleList } from '$app/components/editor/components/tools/selection_toolbar/actions/toggle_list';
-import { BulletedList } from '$app/components/editor/components/tools/selection_toolbar/actions/bulleted_list';
-import { NumberedList } from '$app/components/editor/components/tools/selection_toolbar/actions/numbered_list';
-import { Href, LinkActions } from '$app/components/editor/components/tools/selection_toolbar/actions/href';
-import { Align } from '$app/components/editor/components/tools/selection_toolbar/actions/align';
-import { Color } from '$app/components/editor/components/tools/selection_toolbar/actions/color';
-
-function SelectionActions({
- isAcrossBlocks,
- storeSelection,
- restoreSelection,
- isIncludeRoot,
-}: {
- storeSelection: () => void;
- restoreSelection: () => void;
- isAcrossBlocks: boolean;
- visible: boolean;
- isIncludeRoot: boolean;
-}) {
- if (isIncludeRoot) return null;
- return (
- <div className={'flex w-fit flex-grow items-center gap-1'}>
- {!isAcrossBlocks && (
- <>
- <Paragraph />
- <Heading />
- <Divider className={'my-1.5 bg-line-on-toolbar opacity-40'} orientation={'vertical'} flexItem={true} />
- </>
- )}
- <Bold />
- <Italic />
- <Underline />
- <StrikeThrough />
- <InlineCode />
- {!isAcrossBlocks && (
- <>
- <Formula />
- <Divider className={'my-1.5 bg-line-on-toolbar opacity-40'} orientation={'vertical'} flexItem={true} />
- </>
- )}
-
- {!isAcrossBlocks && (
- <>
- <TodoList />
- <Quote />
- <ToggleList />
- <BulletedList />
- <NumberedList />
- <Divider className={'my-1.5 bg-line-on-toolbar opacity-40'} orientation={'vertical'} flexItem={true} />
- </>
- )}
- {!isAcrossBlocks && <Href />}
- <Align />
- <Color onClose={restoreSelection} onOpen={storeSelection} />
- <LinkActions />
- </div>
- );
-}
-
-export default SelectionActions;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/SelectionToolbar.hooks.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/SelectionToolbar.hooks.ts
deleted file mode 100644
index 58834db6d5..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/SelectionToolbar.hooks.ts
+++ /dev/null
@@ -1,239 +0,0 @@
-import { ReactEditor, useFocused, useSlate } from 'slate-react';
-import { MutableRefObject, useCallback, useEffect, useMemo, useRef, useState } from 'react';
-import { getSelectionPosition } from '$app/components/editor/components/tools/selection_toolbar/utils';
-import debounce from 'lodash-es/debounce';
-import { CustomEditor } from '$app/components/editor/command';
-import { BaseRange, Range as SlateRange } from 'slate';
-import { useDecorateDispatch } from '$app/components/editor/stores/decorate';
-
-const DELAY = 300;
-
-export function useSelectionToolbar(ref: MutableRefObject<HTMLDivElement | null>) {
- const editor = useSlate() as ReactEditor;
- const isDraggingRef = useRef(false);
- const [isAcrossBlocks, setIsAcrossBlocks] = useState(false);
- const [visible, setVisible] = useState(false);
- const isFocusedEditor = useFocused();
- const isIncludeRoot = CustomEditor.selectionIncludeRoot(editor);
-
- // paint the selection when the editor is blurred
- const { add: addDecorate, clear: clearDecorate, getStaticState } = useDecorateDispatch();
-
- // Restore selection after the editor is focused
- const restoreSelection = useCallback(() => {
- const decorateState = getStaticState();
-
- if (!decorateState) return;
-
- editor.select({
- ...decorateState.range,
- });
-
- clearDecorate();
- ReactEditor.focus(editor);
- }, [getStaticState, clearDecorate, editor]);
-
- // Store selection when the editor is blurred
- const storeSelection = useCallback(() => {
- addDecorate({
- range: editor.selection as BaseRange,
- class_name: 'bg-content-blue-100',
- });
- }, [addDecorate, editor]);
-
- const closeToolbar = useCallback(() => {
- const el = ref.current;
-
- if (!el) {
- return;
- }
-
- restoreSelection();
-
- setVisible(false);
- el.style.opacity = '0';
- el.style.pointerEvents = 'none';
- }, [ref, restoreSelection]);
-
- const recalculatePosition = useCallback(() => {
- const el = ref.current;
-
- if (!el) {
- return;
- }
-
- const position = getSelectionPosition(editor);
-
- if (!position) {
- closeToolbar();
- return;
- }
-
- const slateEditorDom = ReactEditor.toDOMNode(editor, editor);
-
- setVisible(true);
- el.style.opacity = '1';
-
- // if dragging, disable pointer events
- if (isDraggingRef.current) {
- el.style.pointerEvents = 'none';
- } else {
- el.style.pointerEvents = 'auto';
- }
-
- // If toolbar is out of editor, move it to the top
- el.style.top = `${position.top + slateEditorDom.offsetTop - el.offsetHeight}px`;
-
- const left = position.left + slateEditorDom.offsetLeft;
-
- // If toolbar is out of editor, move it to the left edge of the editor
- if (left < 0) {
- el.style.left = '0';
- return;
- }
-
- const right = left + el.offsetWidth;
-
- // If toolbar is out of editor, move the right edge to the right edge of the editor
- if (right > slateEditorDom.offsetWidth) {
- el.style.left = `${slateEditorDom.offsetWidth - el.offsetWidth}px`;
- return;
- }
-
- el.style.left = `${left}px`;
- }, [closeToolbar, editor, ref]);
-
- const debounceRecalculatePosition = useMemo(() => debounce(recalculatePosition, DELAY), [recalculatePosition]);
-
- // eslint-disable-next-line react-hooks/exhaustive-deps
- useEffect(() => {
- const decorateState = getStaticState();
-
- if (decorateState) {
- setIsAcrossBlocks(false);
- return;
- }
-
- const { selection } = editor;
-
- const close = () => {
- debounceRecalculatePosition.cancel();
- closeToolbar();
- };
-
- if (isIncludeRoot || !isFocusedEditor || !selection || SlateRange.isCollapsed(selection)) {
- close();
- return;
- }
-
- // There has a bug which the text of selection is empty when the selection include inline blocks
- const isEmptyText = !CustomEditor.includeInlineBlocks(editor) && editor.string(selection) === '';
-
- if (isEmptyText) {
- close();
- return;
- }
-
- setIsAcrossBlocks(CustomEditor.isMultipleBlockSelected(editor, true));
- debounceRecalculatePosition();
- });
-
- // Update drag status
- useEffect(() => {
- const el = ReactEditor.toDOMNode(editor, editor);
-
- const toolbar = ref.current;
-
- if (!el || !toolbar) {
- return;
- }
-
- const onMouseDown = () => {
- isDraggingRef.current = true;
- };
-
- const onMouseUp = () => {
- if (visible) {
- toolbar.style.pointerEvents = 'auto';
- }
-
- isDraggingRef.current = false;
- };
-
- el.addEventListener('mousedown', onMouseDown);
- document.addEventListener('mouseup', onMouseUp);
-
- return () => {
- el.removeEventListener('mousedown', onMouseDown);
- document.removeEventListener('mouseup', onMouseUp);
- };
- }, [visible, editor, ref]);
-
- // Close toolbar when press ESC
- useEffect(() => {
- const slateEditorDom = ReactEditor.toDOMNode(editor, editor);
- const onKeyDown = (e: KeyboardEvent) => {
- // Close toolbar when press ESC
- if (e.key === 'Escape') {
- e.preventDefault();
- e.stopPropagation();
- editor.collapse({
- edge: 'end',
- });
- debounceRecalculatePosition.cancel();
- closeToolbar();
- }
- };
-
- if (visible) {
- slateEditorDom.addEventListener('keydown', onKeyDown);
- } else {
- slateEditorDom.removeEventListener('keydown', onKeyDown);
- }
-
- return () => {
- slateEditorDom.removeEventListener('keydown', onKeyDown);
- };
- }, [closeToolbar, debounceRecalculatePosition, editor, visible]);
-
- // Recalculate position when the scroll container is scrolled
- useEffect(() => {
- const slateEditorDom = ReactEditor.toDOMNode(editor, editor);
- const scrollContainer = slateEditorDom.closest('.appflowy-scroll-container');
-
- if (!visible) return;
- if (!scrollContainer) return;
- const handleScroll = () => {
- if (isDraggingRef.current) return;
-
- const domSelection = window.getSelection();
- const rangeCount = domSelection?.rangeCount;
-
- if (!rangeCount) return null;
-
- const domRange = rangeCount > 0 ? domSelection.getRangeAt(0) : undefined;
-
- const rangeRect = domRange?.getBoundingClientRect();
-
- // Stop calculating when the range is out of the window
- if (!rangeRect?.bottom || rangeRect.bottom < 0) {
- return;
- }
-
- recalculatePosition();
- };
-
- scrollContainer.addEventListener('scroll', handleScroll);
- return () => {
- scrollContainer.removeEventListener('scroll', handleScroll);
- };
- }, [visible, editor, recalculatePosition]);
-
- return {
- visible,
- restoreSelection,
- storeSelection,
- isAcrossBlocks,
- isIncludeRoot,
- };
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/SelectionToolbar.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/SelectionToolbar.tsx
deleted file mode 100644
index d4ca9c9de0..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/SelectionToolbar.tsx
+++ /dev/null
@@ -1,33 +0,0 @@
-import React, { memo, useRef } from 'react';
-import { useSelectionToolbar } from '$app/components/editor/components/tools/selection_toolbar/SelectionToolbar.hooks';
-import SelectionActions from '$app/components/editor/components/tools/selection_toolbar/SelectionActions';
-import withErrorBoundary from '$app/components/_shared/error_boundary/withError';
-
-const Toolbar = memo(() => {
- const ref = useRef<HTMLDivElement | null>(null);
-
- const { visible, restoreSelection, storeSelection, isAcrossBlocks, isIncludeRoot } = useSelectionToolbar(ref);
-
- return (
- <div
- ref={ref}
- className={
- 'selection-toolbar pointer-events-none absolute z-[100] flex min-h-[32px] w-fit flex-grow items-center rounded-lg bg-[var(--fill-toolbar)] px-2 opacity-0 shadow-lg'
- }
- onMouseDown={(e) => {
- // prevent toolbar from taking focus away from editor
- e.preventDefault();
- }}
- >
- <SelectionActions
- isIncludeRoot={isIncludeRoot}
- isAcrossBlocks={isAcrossBlocks}
- storeSelection={storeSelection}
- restoreSelection={restoreSelection}
- visible={visible}
- />
- </div>
- );
-});
-
-export const SelectionToolbar = withErrorBoundary(Toolbar);
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/_shared/ActionButton.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/_shared/ActionButton.tsx
deleted file mode 100644
index 3f86d1eab9..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/_shared/ActionButton.tsx
+++ /dev/null
@@ -1,35 +0,0 @@
-import React, { forwardRef } from 'react';
-import IconButton, { IconButtonProps } from '@mui/material/IconButton';
-import { Tooltip } from '@mui/material';
-
-const ActionButton = forwardRef<
- HTMLButtonElement,
- {
- tooltip: string | React.ReactNode;
- onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
- children: React.ReactNode;
- active?: boolean;
- } & IconButtonProps
->(({ tooltip, onClick, disabled, children, active, className, ...props }, ref) => {
- return (
- <Tooltip disableInteractive={true} placement={'top'} title={tooltip}>
- <IconButton
- ref={ref}
- onClick={onClick}
- size={'small'}
- style={{
- color: active ? 'var(--fill-default)' : disabled ? 'var(--line-on-toolbar)' : undefined,
- }}
- disabled={disabled}
- {...props}
- className={`${
- className ?? ''
- } bg-transparent px-1 py-1 text-icon-on-toolbar hover:bg-transparent hover:text-fill-hover`}
- >
- {children}
- </IconButton>
- </Tooltip>
- );
-});
-
-export default ActionButton;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/align/Align.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/align/Align.tsx
deleted file mode 100644
index 23917e146b..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/align/Align.tsx
+++ /dev/null
@@ -1,98 +0,0 @@
-import React, { useCallback, useMemo, useState } from 'react';
-import Tooltip from '@mui/material/Tooltip';
-import { ReactComponent as AlignLeftSvg } from '$app/assets/align-left.svg';
-import { ReactComponent as AlignCenterSvg } from '$app/assets/align-center.svg';
-import { ReactComponent as AlignRightSvg } from '$app/assets/align-right.svg';
-import ActionButton from '$app/components/editor/components/tools/selection_toolbar/actions/_shared/ActionButton';
-import { useTranslation } from 'react-i18next';
-import { CustomEditor } from '$app/components/editor/command';
-import { useSlateStatic } from 'slate-react';
-import { IconButton } from '@mui/material';
-import { ReactComponent as MoreSvg } from '$app/assets/more.svg';
-
-export function Align() {
- const { t } = useTranslation();
- const editor = useSlateStatic();
- const align = CustomEditor.getAlign(editor);
- const [open, setOpen] = useState(false);
-
- const handleClose = useCallback(() => {
- setOpen(false);
- }, []);
-
- const handleOpen = useCallback(() => {
- setOpen(true);
- }, []);
-
- const Icon = useMemo(() => {
- switch (align) {
- case 'left':
- return AlignLeftSvg;
- case 'center':
- return AlignCenterSvg;
- case 'right':
- return AlignRightSvg;
- default:
- return AlignLeftSvg;
- }
- }, [align]);
-
- const toggleAlign = useCallback(
- (align: string) => {
- return () => {
- CustomEditor.toggleAlign(editor, align);
- handleClose();
- };
- },
- [editor, handleClose]
- );
-
- const getAlignIcon = useCallback((key: string) => {
- switch (key) {
- case 'left':
- return <AlignLeftSvg />;
- case 'center':
- return <AlignCenterSvg />;
- case 'right':
- return <AlignRightSvg />;
- default:
- return <AlignLeftSvg />;
- }
- }, []);
-
- return (
- <Tooltip
- placement={'bottom'}
- open={open}
- onClose={handleClose}
- onOpen={handleOpen}
- classes={{ tooltip: 'bg-fill-toolbar' }}
- title={
- <div className={'flex items-center justify-center'}>
- {['left', 'center', 'right'].map((key) => {
- return (
- <IconButton
- key={key}
- className={`text-icon-on-toolbar ${
- align === key ? 'text-fill-hover' : ''
- } hover:bg-transparent hover:text-content-blue-400`}
- onClick={toggleAlign(key)}
- >
- {getAlignIcon(key)}
- </IconButton>
- );
- })}
- </div>
- }
- >
- <ActionButton active={!!align} tooltip={t('document.plugins.optionAction.align')}>
- <div className={'flex items-center'}>
- <Icon />
- <MoreSvg className={'rotate-90 transform'} />
- </div>
- </ActionButton>
- </Tooltip>
- );
-}
-
-export default Align;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/align/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/align/index.ts
deleted file mode 100644
index 6cba19d7bd..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/align/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './Align';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/bold/Bold.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/bold/Bold.tsx
deleted file mode 100644
index 22be9f970a..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/bold/Bold.tsx
+++ /dev/null
@@ -1,39 +0,0 @@
-import React, { useCallback, useMemo } from 'react';
-import ActionButton from '$app/components/editor/components/tools/selection_toolbar/actions/_shared/ActionButton';
-import { useTranslation } from 'react-i18next';
-import { useSlateStatic } from 'slate-react';
-import { CustomEditor } from '$app/components/editor/command';
-import { ReactComponent as BoldSvg } from '$app/assets/bold.svg';
-import { EditorMarkFormat } from '$app/application/document/document.types';
-import { createHotKeyLabel, HOT_KEY_NAME } from '$app/utils/hotkeys';
-
-export function Bold() {
- const { t } = useTranslation();
- const editor = useSlateStatic();
- const isActivated = CustomEditor.isMarkActive(editor, EditorMarkFormat.Bold);
-
- const modifier = useMemo(() => createHotKeyLabel(HOT_KEY_NAME.BOLD), []);
- const onClick = useCallback(() => {
- CustomEditor.toggleMark(editor, {
- key: EditorMarkFormat.Bold,
- value: true,
- });
- }, [editor]);
-
- return (
- <ActionButton
- onClick={onClick}
- active={isActivated}
- tooltip={
- <>
- <div>{t('toolbar.bold')}</div>
- <div className={'text-xs text-text-caption'}>{modifier}</div>
- </>
- }
- >
- <BoldSvg />
- </ActionButton>
- );
-}
-
-export default Bold;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/bold/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/bold/index.ts
deleted file mode 100644
index 6ef457faaa..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/bold/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './Bold';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/bulleted_list/BulletedList.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/bulleted_list/BulletedList.tsx
deleted file mode 100644
index f35f2aeeea..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/bulleted_list/BulletedList.tsx
+++ /dev/null
@@ -1,27 +0,0 @@
-import React, { useCallback } from 'react';
-import { useTranslation } from 'react-i18next';
-import { useSlateStatic } from 'slate-react';
-import { EditorNodeType } from '$app/application/document/document.types';
-import { CustomEditor } from '$app/components/editor/command';
-import ActionButton from '$app/components/editor/components/tools/selection_toolbar/actions/_shared/ActionButton';
-import { ReactComponent as BulletedListSvg } from '$app/assets/list.svg';
-
-export function BulletedList() {
- const { t } = useTranslation();
- const editor = useSlateStatic();
- const isActivated = CustomEditor.isBlockActive(editor, EditorNodeType.BulletedListBlock);
-
- const onClick = useCallback(() => {
- CustomEditor.turnToBlock(editor, {
- type: EditorNodeType.BulletedListBlock,
- });
- }, [editor]);
-
- return (
- <ActionButton active={isActivated} onClick={onClick} tooltip={t('document.plugins.bulletedList')}>
- <BulletedListSvg />
- </ActionButton>
- );
-}
-
-export default BulletedList;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/bulleted_list/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/bulleted_list/index.ts
deleted file mode 100644
index 2095dff308..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/bulleted_list/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './BulletedList';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/color/Color.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/color/Color.tsx
deleted file mode 100644
index 60c44423bd..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/color/Color.tsx
+++ /dev/null
@@ -1,53 +0,0 @@
-import React, { useCallback, useMemo, useRef, useState } from 'react';
-import ActionButton from '$app/components/editor/components/tools/selection_toolbar/actions/_shared/ActionButton';
-import { CustomEditor } from '$app/components/editor/command';
-import { useTranslation } from 'react-i18next';
-import { useSlateStatic } from 'slate-react';
-import ColorLensOutlinedIcon from '@mui/icons-material/ColorLensOutlined';
-import { ReactComponent as MoreSvg } from '$app/assets/more.svg';
-import { EditorMarkFormat } from '$app/application/document/document.types';
-import debounce from 'lodash-es/debounce';
-import ColorPopover from './ColorPopover';
-
-export function Color(_: { onOpen?: () => void; onClose?: () => void }) {
- const { t } = useTranslation();
- const editor = useSlateStatic();
- const [open, setOpen] = useState(false);
- const ref = useRef<HTMLButtonElement>(null);
-
- const isActivated =
- CustomEditor.isMarkActive(editor, EditorMarkFormat.FontColor) ||
- CustomEditor.isMarkActive(editor, EditorMarkFormat.BgColor);
- const debouncedClose = useMemo(
- () =>
- debounce(() => {
- setOpen(false);
- }, 200),
- []
- );
-
- const handleOpen = useCallback(() => {
- debouncedClose.cancel();
- setOpen(true);
- }, [debouncedClose]);
-
- return (
- <>
- <ActionButton
- ref={ref}
- onMouseEnter={handleOpen}
- onMouseLeave={debouncedClose}
- tooltip={t('editor.color')}
- active={isActivated}
- >
- <div className={'flex items-center justify-between'}>
- <ColorLensOutlinedIcon className={'w-[14px]'} />
- <MoreSvg className={'rotate-90 transform'} />
- </div>
- </ActionButton>
- {open && ref.current && (
- <ColorPopover open={open} onOpen={handleOpen} anchorEl={ref.current} debounceClose={debouncedClose} />
- )}
- </>
- );
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/color/ColorPopover.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/color/ColorPopover.tsx
deleted file mode 100644
index 9f007dc7b5..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/color/ColorPopover.tsx
+++ /dev/null
@@ -1,92 +0,0 @@
-import React, { useCallback } from 'react';
-import { PopoverNoBackdropProps } from '$app/components/editor/components/tools/popover';
-import { ColorPicker } from '$app/components/editor/components/tools/_shared';
-import { Popover } from '@mui/material';
-import { PopoverOrigin } from '@mui/material/Popover/Popover';
-import { EditorMarkFormat } from '$app/application/document/document.types';
-import { addMark, removeMark } from 'slate';
-import { useSlateStatic } from 'slate-react';
-import { DebouncedFunc } from 'lodash-es/debounce';
-import usePopoverAutoPosition from '$app/components/_shared/popover/Popover.hooks';
-
-const initialOrigin: {
- transformOrigin?: PopoverOrigin;
- anchorOrigin?: PopoverOrigin;
-} = {
- anchorOrigin: {
- vertical: 'bottom',
- horizontal: 'center',
- },
- transformOrigin: {
- vertical: 'top',
- horizontal: 'center',
- },
-};
-
-function ColorPopover({
- open,
- anchorEl,
- debounceClose,
-}: {
- open: boolean;
- onOpen: () => void;
- anchorEl: HTMLButtonElement | null;
- debounceClose: DebouncedFunc<() => void>;
-}) {
- const editor = useSlateStatic();
- const handleChange = useCallback(
- (format: EditorMarkFormat.FontColor | EditorMarkFormat.BgColor, color: string) => {
- if (color) {
- addMark(editor, format, color);
- } else {
- removeMark(editor, format);
- }
- },
- [editor]
- );
-
- const { paperHeight, transformOrigin, anchorOrigin, isEntered } = usePopoverAutoPosition({
- initialPaperWidth: 200,
- initialPaperHeight: 420,
- anchorEl,
- initialAnchorOrigin: initialOrigin.anchorOrigin,
- initialTransformOrigin: initialOrigin.transformOrigin,
- open,
- });
-
- return (
- <Popover
- {...PopoverNoBackdropProps}
- open={open && isEntered}
- anchorEl={anchorEl}
- onClose={debounceClose}
- PaperProps={{
- ...PopoverNoBackdropProps.PaperProps,
- className: 'w-[200px] overflow-hidden',
- style: {
- ...PopoverNoBackdropProps.PaperProps?.style,
- height: paperHeight,
- },
- }}
- anchorOrigin={anchorOrigin}
- transformOrigin={transformOrigin}
- onKeyDown={(e) => {
- e.stopPropagation();
- if (e.key === 'Escape') {
- debounceClose();
- }
- }}
- onMouseDown={(e) => {
- e.preventDefault();
- }}
- onMouseEnter={() => {
- debounceClose.cancel();
- }}
- onMouseLeave={debounceClose}
- >
- <ColorPicker disableFocus={true} onEscape={debounceClose} onChange={handleChange} />
- </Popover>
- );
-}
-
-export default ColorPopover;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/color/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/color/index.ts
deleted file mode 100644
index 0fd619bc86..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/color/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './Color';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/formula/Formula.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/formula/Formula.tsx
deleted file mode 100644
index c7bfc11352..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/formula/Formula.tsx
+++ /dev/null
@@ -1,51 +0,0 @@
-import React, { useCallback } from 'react';
-import ActionButton from '$app/components/editor/components/tools/selection_toolbar/actions/_shared/ActionButton';
-import { useTranslation } from 'react-i18next';
-import { useSlateStatic } from 'slate-react';
-import { CustomEditor } from '$app/components/editor/command';
-import Functions from '@mui/icons-material/Functions';
-import { useEditorInlineBlockState } from '$app/components/editor/stores';
-
-export function Formula() {
- const { t } = useTranslation();
- const editor = useSlateStatic();
- const isActivatedMention = CustomEditor.isMentionActive(editor);
-
- const formulaMatch = CustomEditor.formulaActiveNode(editor);
- const isActivated = !isActivatedMention && CustomEditor.isFormulaActive(editor);
-
- const { setRange, openPopover } = useEditorInlineBlockState('formula');
- const onClick = useCallback(() => {
- let selection = editor.selection;
-
- if (!selection) return;
- if (formulaMatch) {
- selection = editor.range(formulaMatch[1]);
- editor.select(selection);
- } else {
- CustomEditor.toggleFormula(editor);
- }
-
- requestAnimationFrame(() => {
- const selection = editor.selection;
-
- if (!selection) return;
-
- setRange(selection);
- openPopover();
- });
- }, [editor, formulaMatch, setRange, openPopover]);
-
- return (
- <ActionButton
- disabled={isActivatedMention}
- onClick={onClick}
- active={isActivated}
- tooltip={t('document.plugins.createInlineMathEquation')}
- >
- <Functions className={`w-[14px]`} />
- </ActionButton>
- );
-}
-
-export default Formula;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/formula/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/formula/index.ts
deleted file mode 100644
index dc4ad2cd03..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/formula/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './Formula';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/heading/Heading.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/heading/Heading.tsx
deleted file mode 100644
index 1fc639c41f..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/heading/Heading.tsx
+++ /dev/null
@@ -1,56 +0,0 @@
-import React, { useCallback } from 'react';
-import ActionButton from '$app/components/editor/components/tools/selection_toolbar/actions/_shared/ActionButton';
-import { ReactComponent as Heading1Svg } from '$app/assets/h1.svg';
-import { ReactComponent as Heading2Svg } from '$app/assets/h2.svg';
-import { ReactComponent as Heading3Svg } from '$app/assets/h3.svg';
-import { useTranslation } from 'react-i18next';
-import { CustomEditor } from '$app/components/editor/command';
-import { EditorNodeType, HeadingNode } from '$app/application/document/document.types';
-import { useSlateStatic } from 'slate-react';
-import { getBlock } from '$app/components/editor/plugins/utils';
-
-export function Heading() {
- const { t } = useTranslation();
- const editor = useSlateStatic();
- const toHeading = useCallback(
- (level: number) => {
- return () => {
- CustomEditor.turnToBlock(editor, {
- type: EditorNodeType.HeadingBlock,
- data: {
- level,
- },
- });
- };
- },
- [editor]
- );
-
- const isActivated = useCallback(
- (level: number) => {
- const node = getBlock(editor) as HeadingNode;
-
- if (!node) return false;
- const isBlock = CustomEditor.isBlockActive(editor, EditorNodeType.HeadingBlock);
-
- return isBlock && node.data.level === level;
- },
- [editor]
- );
-
- return (
- <div className={'flex items-center justify-center'}>
- <ActionButton active={isActivated(1)} tooltip={t('editor.heading1')} onClick={toHeading(1)}>
- <Heading1Svg />
- </ActionButton>
- <ActionButton active={isActivated(2)} tooltip={t('editor.heading2')} onClick={toHeading(2)}>
- <Heading2Svg />
- </ActionButton>
- <ActionButton active={isActivated(3)} tooltip={t('editor.heading3')} onClick={toHeading(3)}>
- <Heading3Svg />
- </ActionButton>
- </div>
- );
-}
-
-export default Heading;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/heading/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/heading/index.ts
deleted file mode 100644
index 6406e7b07f..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/heading/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './Heading';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/href/Href.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/href/Href.tsx
deleted file mode 100644
index e7412a909e..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/href/Href.tsx
+++ /dev/null
@@ -1,47 +0,0 @@
-import React, { useCallback, useMemo } from 'react';
-import ActionButton from '$app/components/editor/components/tools/selection_toolbar/actions/_shared/ActionButton';
-import { useTranslation } from 'react-i18next';
-import { useSlateStatic } from 'slate-react';
-import { CustomEditor } from '$app/components/editor/command';
-import { ReactComponent as LinkSvg } from '$app/assets/link.svg';
-import { EditorMarkFormat } from '$app/application/document/document.types';
-import { useDecorateDispatch } from '$app/components/editor/stores';
-import { getModifier } from '$app/utils/hotkeys';
-
-export function Href() {
- const { t } = useTranslation();
- const editor = useSlateStatic();
- const isActivatedInline = CustomEditor.isInlineActive(editor);
- const isActivated = !isActivatedInline && CustomEditor.isMarkActive(editor, EditorMarkFormat.Href);
-
- const { add: addDecorate } = useDecorateDispatch();
- const onClick = useCallback(() => {
- if (!editor.selection) return;
- addDecorate({
- range: editor.selection,
- class_name: 'bg-content-blue-100 rounded',
- type: 'link',
- });
- }, [addDecorate, editor]);
-
- const tooltip = useMemo(() => {
- const modifier = getModifier();
-
- return (
- <>
- <div>{t('editor.link')}</div>
- <div className={'text-xs text-text-caption'}>{`${modifier} + K`}</div>
- </>
- );
- }, [t]);
-
- return (
- <>
- <ActionButton disabled={isActivatedInline} onClick={onClick} active={isActivated} tooltip={tooltip}>
- <LinkSvg />
- </ActionButton>
- </>
- );
-}
-
-export default Href;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/href/LinkActions.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/href/LinkActions.tsx
deleted file mode 100644
index b77a249051..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/href/LinkActions.tsx
+++ /dev/null
@@ -1,59 +0,0 @@
-import React, { useCallback, useMemo } from 'react';
-import { useDecorateDispatch, useDecorateState } from '$app/components/editor/stores';
-import { ReactEditor, useSlateStatic } from 'slate-react';
-import { Editor } from 'slate';
-import { LinkEditPopover } from '$app/components/editor/components/inline_nodes/link';
-
-export function LinkActions() {
- const editor = useSlateStatic();
- const decorateState = useDecorateState('link');
- const openEditPopover = !!decorateState;
- const { clear: clearDecorate } = useDecorateDispatch();
-
- const anchorPosition = useMemo(() => {
- const range = decorateState?.range;
-
- if (!range) return;
-
- const domRange = ReactEditor.toDOMRange(editor, range);
-
- const rect = domRange.getBoundingClientRect();
-
- return {
- top: rect.top,
- left: rect.left,
- height: rect.height,
- };
- }, [decorateState?.range, editor]);
-
- const defaultHref = useMemo(() => {
- const range = decorateState?.range;
-
- if (!range) return '';
-
- const marks = Editor.marks(editor);
-
- return marks?.href || Editor.string(editor, range);
- }, [decorateState?.range, editor]);
-
- const handleEditPopoverClose = useCallback(() => {
- const range = decorateState?.range;
-
- clearDecorate();
- if (range) {
- ReactEditor.focus(editor);
- editor.select(range);
- }
- }, [clearDecorate, decorateState?.range, editor]);
-
- if (!openEditPopover) return null;
- return (
- <LinkEditPopover
- open={openEditPopover}
- anchorPosition={anchorPosition}
- anchorReference={'anchorPosition'}
- onClose={handleEditPopoverClose}
- defaultHref={defaultHref}
- />
- );
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/href/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/href/index.ts
deleted file mode 100644
index 9a7210c140..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/href/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export * from './Href';
-export * from './LinkActions';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/inline_code/InlineCode.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/inline_code/InlineCode.tsx
deleted file mode 100644
index 3cf9c7ed85..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/inline_code/InlineCode.tsx
+++ /dev/null
@@ -1,39 +0,0 @@
-import React, { useCallback, useMemo } from 'react';
-import ActionButton from '$app/components/editor/components/tools/selection_toolbar/actions/_shared/ActionButton';
-import { useTranslation } from 'react-i18next';
-import { useSlateStatic } from 'slate-react';
-import { CustomEditor } from '$app/components/editor/command';
-import { ReactComponent as CodeSvg } from '$app/assets/inline-code.svg';
-import { EditorMarkFormat } from '$app/application/document/document.types';
-import { createHotKeyLabel, HOT_KEY_NAME } from '$app/utils/hotkeys';
-
-export function InlineCode() {
- const { t } = useTranslation();
- const editor = useSlateStatic();
- const isActivated = CustomEditor.isMarkActive(editor, EditorMarkFormat.Code);
- const modifier = useMemo(() => createHotKeyLabel(HOT_KEY_NAME.CODE), []);
-
- const onClick = useCallback(() => {
- CustomEditor.toggleMark(editor, {
- key: EditorMarkFormat.Code,
- value: true,
- });
- }, [editor]);
-
- return (
- <ActionButton
- onClick={onClick}
- active={isActivated}
- tooltip={
- <>
- <div>{t('editor.embedCode')}</div>
- <div className={'text-xs text-text-caption'}>{modifier}</div>
- </>
- }
- >
- <CodeSvg />
- </ActionButton>
- );
-}
-
-export default InlineCode;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/inline_code/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/inline_code/index.ts
deleted file mode 100644
index 9a4c4930c7..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/inline_code/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './InlineCode';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/italic/Italic.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/italic/Italic.tsx
deleted file mode 100644
index 89fff40e6f..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/italic/Italic.tsx
+++ /dev/null
@@ -1,39 +0,0 @@
-import React, { useCallback, useMemo } from 'react';
-import ActionButton from '$app/components/editor/components/tools/selection_toolbar/actions/_shared/ActionButton';
-import { useTranslation } from 'react-i18next';
-import { useSlateStatic } from 'slate-react';
-import { CustomEditor } from '$app/components/editor/command';
-import { ReactComponent as ItalicSvg } from '$app/assets/italic.svg';
-import { EditorMarkFormat } from '$app/application/document/document.types';
-import { createHotKeyLabel, HOT_KEY_NAME } from '$app/utils/hotkeys';
-
-export function Italic() {
- const { t } = useTranslation();
- const editor = useSlateStatic();
- const isActivated = CustomEditor.isMarkActive(editor, EditorMarkFormat.Italic);
- const modifier = useMemo(() => createHotKeyLabel(HOT_KEY_NAME.ITALIC), []);
-
- const onClick = useCallback(() => {
- CustomEditor.toggleMark(editor, {
- key: EditorMarkFormat.Italic,
- value: true,
- });
- }, [editor]);
-
- return (
- <ActionButton
- onClick={onClick}
- active={isActivated}
- tooltip={
- <>
- <div>{t('toolbar.italic')}</div>
- <div className={'text-xs text-text-caption'}>{modifier}</div>
- </>
- }
- >
- <ItalicSvg />
- </ActionButton>
- );
-}
-
-export default Italic;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/italic/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/italic/index.ts
deleted file mode 100644
index 70bb069b60..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/italic/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './Italic';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/numbered_list/NumberedList.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/numbered_list/NumberedList.tsx
deleted file mode 100644
index 006247ca8b..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/numbered_list/NumberedList.tsx
+++ /dev/null
@@ -1,33 +0,0 @@
-import React, { useCallback } from 'react';
-import { useTranslation } from 'react-i18next';
-import { useSlateStatic } from 'slate-react';
-import { EditorNodeType } from '$app/application/document/document.types';
-import { CustomEditor } from '$app/components/editor/command';
-import ActionButton from '$app/components/editor/components/tools/selection_toolbar/actions/_shared/ActionButton';
-import { ReactComponent as NumberedListSvg } from '$app/assets/numbers.svg';
-
-export function NumberedList() {
- const { t } = useTranslation();
- const editor = useSlateStatic();
- const isActivated = CustomEditor.isBlockActive(editor, EditorNodeType.NumberedListBlock);
-
- const onClick = useCallback(() => {
- let type = EditorNodeType.NumberedListBlock;
-
- if (isActivated) {
- type = EditorNodeType.Paragraph;
- }
-
- CustomEditor.turnToBlock(editor, {
- type,
- });
- }, [editor, isActivated]);
-
- return (
- <ActionButton active={isActivated} onClick={onClick} tooltip={t('document.plugins.numberedList')}>
- <NumberedListSvg />
- </ActionButton>
- );
-}
-
-export default NumberedList;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/numbered_list/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/numbered_list/index.ts
deleted file mode 100644
index 6e985ae25b..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/numbered_list/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './NumberedList';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/paragraph/Paragraph.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/paragraph/Paragraph.tsx
deleted file mode 100644
index 1ac5610787..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/paragraph/Paragraph.tsx
+++ /dev/null
@@ -1,33 +0,0 @@
-import React, { useCallback } from 'react';
-import ActionButton from '$app/components/editor/components/tools/selection_toolbar/actions/_shared/ActionButton';
-import { useTranslation } from 'react-i18next';
-import { getBlock } from '$app/components/editor/plugins/utils';
-import { CustomEditor } from '$app/components/editor/command';
-import { EditorNodeType } from '$app/application/document/document.types';
-import { useSlateStatic } from 'slate-react';
-import { ReactComponent as ParagraphSvg } from '$app/assets/text.svg';
-
-export function Paragraph() {
- const { t } = useTranslation();
- const editor = useSlateStatic();
-
- const onClick = useCallback(() => {
- const node = getBlock(editor);
-
- if (!node) return;
-
- CustomEditor.turnToBlock(editor, {
- type: EditorNodeType.Paragraph,
- });
- }, [editor]);
-
- const isActive = CustomEditor.isBlockActive(editor, EditorNodeType.Paragraph);
-
- return (
- <ActionButton active={isActive} onClick={onClick} tooltip={t('editor.text')}>
- <ParagraphSvg />
- </ActionButton>
- );
-}
-
-export default Paragraph;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/paragraph/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/paragraph/index.ts
deleted file mode 100644
index 01752c914c..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/paragraph/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './Paragraph';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/quote/Quote.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/quote/Quote.tsx
deleted file mode 100644
index 29ad0de104..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/quote/Quote.tsx
+++ /dev/null
@@ -1,33 +0,0 @@
-import React, { useCallback } from 'react';
-import { useTranslation } from 'react-i18next';
-import { useSlateStatic } from 'slate-react';
-import { EditorNodeType } from '$app/application/document/document.types';
-import { CustomEditor } from '$app/components/editor/command';
-import ActionButton from '$app/components/editor/components/tools/selection_toolbar/actions/_shared/ActionButton';
-import { ReactComponent as QuoteSvg } from '$app/assets/quote.svg';
-
-export function Quote() {
- const { t } = useTranslation();
- const editor = useSlateStatic();
- const isActivated = CustomEditor.isBlockActive(editor, EditorNodeType.QuoteBlock);
-
- const onClick = useCallback(() => {
- let type = EditorNodeType.QuoteBlock;
-
- if (isActivated) {
- type = EditorNodeType.Paragraph;
- }
-
- CustomEditor.turnToBlock(editor, {
- type,
- });
- }, [editor, isActivated]);
-
- return (
- <ActionButton active={isActivated} onClick={onClick} tooltip={t('editor.quote')}>
- <QuoteSvg />
- </ActionButton>
- );
-}
-
-export default Quote;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/quote/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/quote/index.ts
deleted file mode 100644
index c88e677a53..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/quote/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './Quote';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/strikethrough/StrikeThrough.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/strikethrough/StrikeThrough.tsx
deleted file mode 100644
index 325f6ac55a..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/strikethrough/StrikeThrough.tsx
+++ /dev/null
@@ -1,39 +0,0 @@
-import React, { useCallback, useMemo } from 'react';
-import ActionButton from '$app/components/editor/components/tools/selection_toolbar/actions/_shared/ActionButton';
-import { useTranslation } from 'react-i18next';
-import { useSlateStatic } from 'slate-react';
-import { CustomEditor } from '$app/components/editor/command';
-import { ReactComponent as StrikeThroughSvg } from '$app/assets/strikethrough.svg';
-import { EditorMarkFormat } from '$app/application/document/document.types';
-import { createHotKeyLabel, HOT_KEY_NAME } from '$app/utils/hotkeys';
-
-export function StrikeThrough() {
- const { t } = useTranslation();
- const editor = useSlateStatic();
- const isActivated = CustomEditor.isMarkActive(editor, EditorMarkFormat.StrikeThrough);
- const modifier = useMemo(() => createHotKeyLabel(HOT_KEY_NAME.STRIKETHROUGH), []);
-
- const onClick = useCallback(() => {
- CustomEditor.toggleMark(editor, {
- key: EditorMarkFormat.StrikeThrough,
- value: true,
- });
- }, [editor]);
-
- return (
- <ActionButton
- onClick={onClick}
- active={isActivated}
- tooltip={
- <>
- <div>{t('editor.strikethrough')}</div>
- <div className={'text-xs text-text-caption'}>{modifier}</div>
- </>
- }
- >
- <StrikeThroughSvg />
- </ActionButton>
- );
-}
-
-export default StrikeThrough;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/strikethrough/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/strikethrough/index.ts
deleted file mode 100644
index f8314d16e3..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/strikethrough/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './StrikeThrough';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/todo_list/TodoList.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/todo_list/TodoList.tsx
deleted file mode 100644
index cd576edafa..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/todo_list/TodoList.tsx
+++ /dev/null
@@ -1,37 +0,0 @@
-import React, { useCallback } from 'react';
-import { useSlateStatic } from 'slate-react';
-import { CustomEditor } from '$app/components/editor/command';
-import { EditorNodeType } from '$app/application/document/document.types';
-import { ReactComponent as TodoListSvg } from '$app/assets/todo-list.svg';
-import ActionButton from '$app/components/editor/components/tools/selection_toolbar/actions/_shared/ActionButton';
-import { useTranslation } from 'react-i18next';
-
-export function TodoList() {
- const { t } = useTranslation();
- const editor = useSlateStatic();
-
- const isActivated = CustomEditor.isBlockActive(editor, EditorNodeType.TodoListBlock);
-
- const onClick = useCallback(() => {
- let type = EditorNodeType.TodoListBlock;
-
- if (isActivated) {
- type = EditorNodeType.Paragraph;
- }
-
- CustomEditor.turnToBlock(editor, {
- type,
- data: {
- checked: false,
- },
- });
- }, [editor, isActivated]);
-
- return (
- <ActionButton active={isActivated} onClick={onClick} tooltip={t('document.plugins.todoList')}>
- <TodoListSvg />
- </ActionButton>
- );
-}
-
-export default TodoList;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/todo_list/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/todo_list/index.ts
deleted file mode 100644
index f239f43459..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/todo_list/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './TodoList';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/toggle_list/ToggleList.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/toggle_list/ToggleList.tsx
deleted file mode 100644
index 4d82652988..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/toggle_list/ToggleList.tsx
+++ /dev/null
@@ -1,36 +0,0 @@
-import React, { useCallback } from 'react';
-import { useTranslation } from 'react-i18next';
-import { useSlateStatic } from 'slate-react';
-import { CustomEditor } from '$app/components/editor/command';
-import { EditorNodeType } from '$app/application/document/document.types';
-import ActionButton from '$app/components/editor/components/tools/selection_toolbar/actions/_shared/ActionButton';
-import { ReactComponent as ToggleListSvg } from '$app/assets/show-menu.svg';
-
-export function ToggleList() {
- const { t } = useTranslation();
- const editor = useSlateStatic();
- const isActivated = CustomEditor.isBlockActive(editor, EditorNodeType.ToggleListBlock);
-
- const onClick = useCallback(() => {
- let type = EditorNodeType.ToggleListBlock;
-
- if (isActivated) {
- type = EditorNodeType.Paragraph;
- }
-
- CustomEditor.turnToBlock(editor, {
- type,
- data: {
- collapsed: false,
- },
- });
- }, [editor, isActivated]);
-
- return (
- <ActionButton active={isActivated} onClick={onClick} tooltip={t('document.plugins.toggleList')}>
- <ToggleListSvg />
- </ActionButton>
- );
-}
-
-export default ToggleList;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/toggle_list/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/toggle_list/index.ts
deleted file mode 100644
index 833bdb5210..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/toggle_list/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './ToggleList';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/underline/Underline.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/underline/Underline.tsx
deleted file mode 100644
index b0df70e30e..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/underline/Underline.tsx
+++ /dev/null
@@ -1,39 +0,0 @@
-import React, { useCallback, useMemo } from 'react';
-import ActionButton from '$app/components/editor/components/tools/selection_toolbar/actions/_shared/ActionButton';
-import { useTranslation } from 'react-i18next';
-import { useSlateStatic } from 'slate-react';
-import { CustomEditor } from '$app/components/editor/command';
-import { ReactComponent as UnderlineSvg } from '$app/assets/underline.svg';
-import { EditorMarkFormat } from '$app/application/document/document.types';
-import { createHotKeyLabel, HOT_KEY_NAME } from '$app/utils/hotkeys';
-
-export function Underline() {
- const { t } = useTranslation();
- const editor = useSlateStatic();
- const isActivated = CustomEditor.isMarkActive(editor, EditorMarkFormat.Underline);
- const modifier = useMemo(() => createHotKeyLabel(HOT_KEY_NAME.UNDERLINE), []);
-
- const onClick = useCallback(() => {
- CustomEditor.toggleMark(editor, {
- key: EditorMarkFormat.Underline,
- value: true,
- });
- }, [editor]);
-
- return (
- <ActionButton
- onClick={onClick}
- active={isActivated}
- tooltip={
- <>
- <div>{t('editor.underline')}</div>
- <div className={'text-xs text-text-caption'}>{modifier}</div>
- </>
- }
- >
- <UnderlineSvg />
- </ActionButton>
- );
-}
-
-export default Underline;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/underline/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/underline/index.ts
deleted file mode 100644
index a1d53a4384..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/actions/underline/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './Underline';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/index.ts
deleted file mode 100644
index a6ced3f248..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './SelectionToolbar';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/utils.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/utils.ts
deleted file mode 100644
index 178da73df4..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/components/tools/selection_toolbar/utils.ts
+++ /dev/null
@@ -1,40 +0,0 @@
-import { ReactEditor } from 'slate-react';
-import { getEditorDomNode } from '$app/components/editor/plugins/utils';
-
-export function getSelectionPosition(editor: ReactEditor) {
- const domSelection = window.getSelection();
- const rangeCount = domSelection?.rangeCount;
-
- if (!rangeCount) return null;
-
- const domRange = rangeCount > 0 ? domSelection.getRangeAt(0) : undefined;
-
- const rect = domRange?.getBoundingClientRect();
-
- let newRect;
-
- const domNode = getEditorDomNode(editor);
- const domNodeRect = domNode.getBoundingClientRect();
-
- // the default height of the toolbar is 30px
- const gap = 106;
-
- if (rect) {
- let relativeDomTop = rect.top - domNodeRect.top;
- const relativeDomLeft = rect.left - domNodeRect.left;
-
- // if the range is above the window, move the toolbar to the bottom of range
- if (rect.top < gap) {
- relativeDomTop = -domNodeRect.top + gap;
- }
-
- newRect = {
- top: relativeDomTop,
- left: relativeDomLeft,
- width: rect.width,
- height: rect.height,
- };
- }
-
- return newRect;
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/editor.scss b/frontend/appflowy_tauri/src/appflowy_app/components/editor/editor.scss
deleted file mode 100644
index 271dd36cda..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/editor.scss
+++ /dev/null
@@ -1,231 +0,0 @@
-
-.block-element {
- @apply my-[4px];
-
-}
-
-.block-element .block-element {
- @apply mb-0;
- margin-left: 24px;
-}
-
-.block-element.block-align-left {
- > div > .text-element {
- text-align: left;
- justify-content: flex-start;
- }
-}
-.block-element.block-align-right {
- > div > .text-element {
- text-align: right;
- justify-content: flex-end;
- }
-}
-.block-element.block-align-center {
- > div > .text-element {
- text-align: center;
- justify-content: center;
- }
-
-}
-
-
-.block-element[data-block-type="todo_list"] .checked > .text-element {
- text-decoration: line-through;
- color: var(--text-caption);
-}
-
-.block-element .collapsed .block-element {
- display: none !important;
-}
-
-[role=textbox] {
- .text-element {
- &::selection {
- @apply bg-transparent;
- }
- }
-}
-
-
-
-span[data-slate-placeholder="true"]:not(.inline-block-content) {
- @apply text-text-placeholder;
- opacity: 1 !important;
-}
-
-
-[role="textbox"] {
- ::selection {
- @apply bg-content-blue-100;
- }
- .text-content {
- &::selection {
- @apply bg-transparent;
- }
- &.selected {
- @apply bg-content-blue-100;
- }
- span {
- &::selection {
- @apply bg-content-blue-100;
- }
- }
- }
-}
-
-
-[data-dark-mode="true"] [role="textbox"]{
- ::selection {
- background-color: #1e79a2;
- }
-
- .text-content {
- &::selection {
- @apply bg-transparent;
- }
- &.selected {
- background-color: #1e79a2;
- }
- span {
- &::selection {
- background-color: #1e79a2;
- }
- }
- }
-}
-
-
-.text-content, [data-dark-mode="true"] .text-content {
- @apply min-w-[1px];
- &.empty-text {
- span {
- &::selection {
- @apply bg-transparent;
- }
- }
- }
-}
-
-.text-element:has(.text-placeholder), .divider-node, [data-dark-mode="true"] .text-element:has(.text-placeholder), [data-dark-mode="true"] .divider-node {
- ::selection {
- @apply bg-transparent;
- }
-}
-
-.text-placeholder {
- @apply absolute left-[5px] transform -translate-y-1/2 pointer-events-none select-none whitespace-nowrap;
- &:after {
- @apply text-text-placeholder absolute top-0;
- content: (attr(placeholder));
- }
-}
-
-.block-align-center {
- .text-placeholder {
- @apply left-[calc(50%+1px)];
- &:after {
- @apply left-0;
- }
- }
- .has-start-icon .text-placeholder {
- @apply left-[calc(50%+13px)];
- &:after {
- @apply left-0;
- }
- }
-
-}
-
-.block-align-left {
- .text-placeholder {
- &:after {
- @apply left-0;
- }
- }
- .has-start-icon .text-placeholder {
- &:after {
- @apply left-[24px];
- }
- }
-}
-
-.block-align-right {
-
- .text-placeholder {
-
- @apply relative w-fit h-0 order-2;
- &:after {
- @apply relative w-fit top-1/2 left-[-6px];
- }
- }
- .text-content {
- @apply order-1;
- }
-
- .has-start-icon .text-placeholder {
- &:after {
- @apply left-[-6px];
- }
- }
-}
-
-
-.formula-inline {
- &.selected {
- @apply rounded bg-content-blue-100;
- }
-}
-
-.bulleted-icon {
- &:after {
- content: attr(data-letter);
- }
-}
-
-.numbered-icon {
- &:after {
- content: attr(data-number) ".";
- }
-}
-
-
-.grid-block .grid-scroll-container::-webkit-scrollbar {
- width: 0;
- height: 0;
-}
-
-.image-render {
- .image-resizer {
- @apply absolute w-[10px] top-0 z-10 flex h-full cursor-col-resize items-center justify-end;
- .resize-handle {
- @apply h-1/4 w-1/2 transform transition-all duration-500 select-none rounded-full border border-white opacity-0;
- background: var(--fill-toolbar);
- }
- }
- &:hover {
- .image-resizer{
- .resize-handle {
- @apply opacity-90;
- }
- }
- }
-}
-
-
-.image-block, .math-equation-block, [data-dark-mode="true"] .image-block, [data-dark-mode="true"] .math-equation-block {
- ::selection {
- @apply bg-transparent;
- }
- &:hover {
- .container-bg {
- background: var(--content-blue-100) !important;
- }
- }
-}
-
-.mention-inline {
- &:hover {
- @apply bg-fill-list-active rounded;
- }
-}
\ No newline at end of file
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/index.ts
deleted file mode 100644
index 8b7c4c267a..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './Editor';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/plugins/constants.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/plugins/constants.ts
deleted file mode 100644
index 03e441b1c3..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/plugins/constants.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { EditorNodeType } from '$app/application/document/document.types';
-
-export const SOFT_BREAK_TYPES = [EditorNodeType.CalloutBlock, EditorNodeType.CodeBlock];
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/plugins/copyPasted/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/plugins/copyPasted/index.ts
deleted file mode 100644
index bf2b09a1c3..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/plugins/copyPasted/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export * from './withCopy';
-export * from './withPasted';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/plugins/copyPasted/utils.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/plugins/copyPasted/utils.ts
deleted file mode 100644
index cb377fece4..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/plugins/copyPasted/utils.ts
+++ /dev/null
@@ -1,311 +0,0 @@
-import { ReactEditor } from 'slate-react';
-import { Editor, Node, Location, Range, Path, Element, Text, Transforms, NodeEntry } from 'slate';
-import { EditorNodeType } from '$app/application/document/document.types';
-import { CustomEditor } from '$app/components/editor/command';
-import { LIST_TYPES } from '$app/components/editor/command/tab';
-
-/**
- * Rewrite the insertFragment function to avoid the empty node(doesn't have text node) in the fragment
-
- * @param editor
- * @param fragment
- * @param options
- */
-export function insertFragment(
- editor: ReactEditor,
- fragment: (Text | Element)[],
- options: {
- at?: Location;
- hanging?: boolean;
- voids?: boolean;
- } = {}
-) {
- Editor.withoutNormalizing(editor, () => {
- const { hanging = false, voids = false } = options;
- let { at = getDefaultInsertLocation(editor) } = options;
-
- if (!fragment.length) {
- return;
- }
-
- if (Range.isRange(at)) {
- if (!hanging) {
- at = Editor.unhangRange(editor, at, { voids });
- }
-
- if (Range.isCollapsed(at)) {
- at = at.anchor;
- } else {
- const [, end] = Range.edges(at);
-
- if (!voids && Editor.void(editor, { at: end })) {
- return;
- }
-
- const pointRef = Editor.pointRef(editor, end);
-
- Transforms.delete(editor, { at });
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
- at = pointRef.unref()!;
- }
- } else if (Path.isPath(at)) {
- at = Editor.start(editor, at);
- }
-
- if (!voids && Editor.void(editor, { at })) {
- return;
- }
-
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
- const blockMatch = Editor.above(editor, {
- match: (n) => Element.isElement(n) && Editor.isBlock(editor, n) && n.blockId !== undefined,
- at,
- voids,
- })!;
- const [block, blockPath] = blockMatch as NodeEntry<Element>;
-
- const isEmbedBlock = Element.isElement(block) && editor.isEmbed(block);
- const isPageBlock = Element.isElement(block) && block.type === EditorNodeType.Page;
- const isBlockStart = Editor.isStart(editor, at, blockPath);
- const isBlockEnd = Editor.isEnd(editor, at, blockPath);
- const isBlockEmpty = isBlockStart && isBlockEnd;
-
- if (isEmbedBlock) {
- insertOnEmbedBlock(editor, fragment, blockPath);
- return;
- }
-
- if (isBlockEmpty && !isPageBlock) {
- const node = fragment[0] as Element;
-
- if (block.type !== EditorNodeType.Paragraph) {
- node.type = block.type;
- node.data = {
- ...(node.data || {}),
- ...(block.data || {}),
- };
- }
-
- insertOnEmptyBlock(editor, fragment, blockPath);
- return;
- }
-
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
- // @ts-ignore
- const fragmentRoot: Node = {
- children: fragment,
- };
- const [, firstPath] = Node.first(fragmentRoot, []);
- const [, lastPath] = Node.last(fragmentRoot, []);
- const sameBlock = Path.equals(firstPath.slice(0, -1), lastPath.slice(0, -1));
-
- if (sameBlock) {
- insertTexts(
- editor,
- isPageBlock
- ? ({
- children: [
- {
- text: CustomEditor.getNodeTextContent(fragmentRoot),
- },
- ],
- } as Node)
- : fragmentRoot,
- at
- );
- return;
- }
-
- const isListTypeBlock = LIST_TYPES.includes(block.type as EditorNodeType);
- const [, ...blockChildren] = block.children;
-
- const blockEnd = editor.end([...blockPath, 0]);
- const afterRange: Range = { anchor: at, focus: blockEnd };
-
- const afterTexts = getTexts(editor, {
- children: editor.fragment(afterRange),
- } as Node) as (Text | Element)[];
-
- Transforms.delete(editor, { at: afterRange });
-
- const { startTexts, startChildren, middles } = getFragmentGroup(editor, fragment);
-
- insertNodes(
- editor,
- isPageBlock
- ? [
- {
- text: CustomEditor.getNodeTextContent({
- children: startTexts,
- } as Node),
- },
- ]
- : startTexts,
- {
- at,
- }
- );
-
- if (isPageBlock) {
- insertNodes(editor, [...startChildren, ...middles], {
- at: Path.next(blockPath),
- select: true,
- });
- } else {
- if (blockChildren.length > 0) {
- const path = [...blockPath, 1];
-
- insertNodes(editor, [...startChildren, ...middles], {
- at: path,
- select: true,
- });
- } else {
- const newMiddle = [...middles];
-
- if (isListTypeBlock) {
- const path = [...blockPath, 1];
-
- insertNodes(editor, startChildren, {
- at: path,
- select: newMiddle.length === 0,
- });
- } else {
- newMiddle.unshift(...startChildren);
- }
-
- insertNodes(editor, newMiddle, {
- at: Path.next(blockPath),
- select: true,
- });
- }
- }
-
- const { selection } = editor;
-
- if (!selection) return;
-
- insertNodes(editor, afterTexts, {
- at: selection,
- });
- });
-}
-
-function getFragmentGroup(editor: ReactEditor, fragment: Node[]) {
- const startTexts = [];
- const startChildren = [];
- const middles = [];
-
- const [firstNode, ...otherNodes] = fragment;
- const [firstNodeText, ...firstNodeChildren] = (firstNode as Element).children as Element[];
-
- startTexts.push(...firstNodeText.children);
- startChildren.push(...firstNodeChildren);
-
- for (const node of otherNodes) {
- if (Element.isElement(node) && node.blockId !== undefined) {
- middles.push(node);
- }
- }
-
- return {
- startTexts,
- startChildren,
- middles,
- };
-}
-
-function getTexts(editor: ReactEditor, fragment: Node) {
- const matches = [];
- const matcher = ([n]: NodeEntry) => Text.isText(n) || (Element.isElement(n) && editor.isInline(n));
-
- for (const entry of Node.nodes(fragment, { pass: matcher })) {
- if (matcher(entry)) {
- matches.push(entry[0]);
- }
- }
-
- return matches;
-}
-
-function insertTexts(editor: ReactEditor, fragmentRoot: Node, at: Location) {
- const matches = getTexts(editor, fragmentRoot);
-
- insertNodes(editor, matches, {
- at,
- select: true,
- });
-}
-
-function insertOnEmptyBlock(editor: ReactEditor, fragment: Node[], blockPath: Path) {
- editor.removeNodes({
- at: blockPath,
- });
-
- insertNodes(editor, fragment, {
- at: blockPath,
- select: true,
- });
-}
-
-function insertOnEmbedBlock(editor: ReactEditor, fragment: Node[], blockPath: Path) {
- insertNodes(editor, fragment, {
- at: Path.next(blockPath),
- select: true,
- });
-}
-
-function insertNodes(editor: ReactEditor, nodes: Node[], options: { at?: Location; select?: boolean } = {}) {
- try {
- Transforms.insertNodes(editor, nodes, options);
- } catch (e) {
- try {
- editor.move({
- distance: 1,
- unit: 'line',
- });
- } catch (e) {
- // do nothing
- }
- }
-}
-
-/**
- * Copy Code from slate/src/utils/get-default-insert-location.ts
- * Get the default location to insert content into the editor.
- * By default, use the selection as the target location. But if there is
- * no selection, insert at the end of the document since that is such a
- * common use case when inserting from a non-selected state.
- */
-export const getDefaultInsertLocation = (editor: Editor): Location => {
- if (editor.selection) {
- return editor.selection;
- } else if (editor.children.length > 0) {
- return Editor.end(editor, []);
- } else {
- return [0];
- }
-};
-
-export function transFragment(editor: ReactEditor, fragment: Node[]) {
- // flatten the fragment to avoid the empty node(doesn't have text node) in the fragment
- const flatMap = (node: Node): Node[] => {
- const isInputElement =
- !Editor.isEditor(node) && Element.isElement(node) && node.blockId !== undefined && !editor.isEmbed(node);
-
- if (
- isInputElement &&
- node.children?.length > 0 &&
- Element.isElement(node.children[0]) &&
- node.children[0].type !== EditorNodeType.Text
- ) {
- return node.children.flatMap((child) => flatMap(child));
- }
-
- return [node];
- };
-
- const fragmentFlatMap = fragment?.flatMap(flatMap);
-
- // clone the node to avoid the duplicated block id
- return fragmentFlatMap.map((item) => CustomEditor.cloneBlock(editor, item as Element));
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/plugins/copyPasted/withCopy.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/plugins/copyPasted/withCopy.ts
deleted file mode 100644
index c0daab0a8f..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/plugins/copyPasted/withCopy.ts
+++ /dev/null
@@ -1,40 +0,0 @@
-import { ReactEditor } from 'slate-react';
-import { Editor, Element, Range } from 'slate';
-
-export function withCopy(editor: ReactEditor) {
- const { setFragmentData } = editor;
-
- editor.setFragmentData = (...args) => {
- if (!editor.selection) {
- setFragmentData(...args);
- return;
- }
-
- // selection is collapsed and the node is an embed, we need to set the data manually
- if (Range.isCollapsed(editor.selection)) {
- const match = Editor.above(editor, {
- match: (n) => !Editor.isEditor(n) && Element.isElement(n) && n.blockId !== undefined,
- });
- const node = match ? (match[0] as Element) : undefined;
-
- if (node && editor.isEmbed(node)) {
- const fragment = editor.getFragment();
-
- if (fragment.length > 0) {
- const data = args[0];
- const string = JSON.stringify(fragment);
- const encoded = window.btoa(encodeURIComponent(string));
-
- const dom = ReactEditor.toDOMNode(editor, node);
-
- data.setData(`application/x-slate-fragment`, encoded);
- data.setData(`text/html`, dom.innerHTML);
- }
- }
- }
-
- setFragmentData(...args);
- };
-
- return editor;
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/plugins/copyPasted/withPasted.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/plugins/copyPasted/withPasted.ts
deleted file mode 100644
index 2266ff41c7..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/plugins/copyPasted/withPasted.ts
+++ /dev/null
@@ -1,59 +0,0 @@
-import { ReactEditor } from 'slate-react';
-import { insertFragment, transFragment } from './utils';
-import { convertBlockToJson } from '$app/application/document/document.service';
-import { InputType } from '@/services/backend';
-import { CustomEditor } from '$app/components/editor/command';
-import { Log } from '$app/utils/log';
-
-export function withPasted(editor: ReactEditor) {
- const { insertData } = editor;
-
- editor.insertData = (data) => {
- const fragment = data.getData('application/x-slate-fragment');
-
- if (fragment) {
- insertData(data);
- return;
- }
-
- const html = data.getData('text/html');
- const text = data.getData('text/plain');
-
- if (!html && !text) {
- insertData(data);
- return;
- }
-
- void (async () => {
- try {
- const nodes = await convertBlockToJson(html, InputType.Html);
-
- const htmlTransNoText = nodes.every((node) => {
- return CustomEditor.getNodeTextContent(node).length === 0;
- });
-
- if (!htmlTransNoText) {
- return editor.insertFragment(nodes);
- }
- } catch (e) {
- Log.warn('pasted html error', e);
- // ignore
- }
-
- if (text) {
- const nodes = await convertBlockToJson(text, InputType.PlainText);
-
- editor.insertFragment(nodes);
- return;
- }
- })();
- };
-
- editor.insertFragment = (fragment, options = {}) => {
- const clonedFragment = transFragment(editor, fragment);
-
- insertFragment(editor, clonedFragment, options);
- };
-
- return editor;
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/plugins/shortcuts/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/plugins/shortcuts/index.ts
deleted file mode 100644
index 0292784ba5..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/plugins/shortcuts/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export * from './shortcuts.hooks';
-export * from './withMarkdown';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/plugins/shortcuts/markdown.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/plugins/shortcuts/markdown.ts
deleted file mode 100644
index 59ff0a8593..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/plugins/shortcuts/markdown.ts
+++ /dev/null
@@ -1,172 +0,0 @@
-export type MarkdownRegex = {
- [key in MarkdownShortcuts]: {
- pattern: RegExp;
-
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- data?: Record<string, any>;
- }[];
-};
-
-export type TriggerHotKey = {
- [key in MarkdownShortcuts]: string[];
-};
-
-export enum MarkdownShortcuts {
- Bold,
- Italic,
- StrikeThrough,
- Code,
- Equation,
- /** block */
- Heading,
- BlockQuote,
- CodeBlock,
- Divider,
- /** list */
- BulletedList,
- NumberedList,
- TodoList,
- ToggleList,
-}
-
-const defaultMarkdownRegex: MarkdownRegex = {
- [MarkdownShortcuts.Heading]: [
- {
- pattern: /^#{1,6}$/,
- },
- ],
- [MarkdownShortcuts.Bold]: [
- {
- pattern: /(\*\*|__)(.*?)(\*\*|__)$/,
- },
- ],
- [MarkdownShortcuts.Italic]: [
- {
- pattern: /([*_])(.*?)([*_])$/,
- },
- ],
- [MarkdownShortcuts.StrikeThrough]: [
- {
- pattern: /(~~)(.*?)(~~)$/,
- },
- {
- pattern: /(~)(.*?)(~)$/,
- },
- ],
- [MarkdownShortcuts.Code]: [
- {
- pattern: /(`)(.*?)(`)$/,
- },
- ],
- [MarkdownShortcuts.Equation]: [
- {
- pattern: /(\$)(.*?)(\$)$/,
- data: {
- formula: '',
- },
- },
- ],
- [MarkdownShortcuts.BlockQuote]: [
- {
- pattern: /^([”“"])$/,
- },
- ],
- [MarkdownShortcuts.CodeBlock]: [
- {
- pattern: /^(`{2,})$/,
- data: {
- language: 'json',
- },
- },
- ],
- [MarkdownShortcuts.Divider]: [
- {
- pattern: /^(([-*]){2,})$/,
- },
- ],
-
- [MarkdownShortcuts.BulletedList]: [
- {
- pattern: /^([*\-+])$/,
- },
- ],
- [MarkdownShortcuts.NumberedList]: [
- {
- pattern: /^(\d+)\.$/,
- },
- ],
- [MarkdownShortcuts.TodoList]: [
- {
- pattern: /^(-)?\[ ]$/,
- data: {
- checked: false,
- },
- },
- {
- pattern: /^(-)?\[x]$/,
- data: {
- checked: true,
- },
- },
- {
- pattern: /^(-)?\[]$/,
- data: {
- checked: false,
- },
- },
- ],
- [MarkdownShortcuts.ToggleList]: [
- {
- pattern: /^>$/,
- data: {
- collapsed: false,
- },
- },
- ],
-};
-
-export const defaultTriggerChar: TriggerHotKey = {
- [MarkdownShortcuts.Heading]: [' '],
- [MarkdownShortcuts.Bold]: ['*', '_'],
- [MarkdownShortcuts.Italic]: ['*', '_'],
- [MarkdownShortcuts.StrikeThrough]: ['~'],
- [MarkdownShortcuts.Code]: ['`'],
- [MarkdownShortcuts.BlockQuote]: [' '],
- [MarkdownShortcuts.CodeBlock]: ['`'],
- [MarkdownShortcuts.Divider]: ['-', '*'],
- [MarkdownShortcuts.Equation]: ['$'],
- [MarkdownShortcuts.BulletedList]: [' '],
- [MarkdownShortcuts.NumberedList]: [' '],
- [MarkdownShortcuts.TodoList]: [' '],
- [MarkdownShortcuts.ToggleList]: [' '],
-};
-
-export function isTriggerChar(char: string) {
- return Object.values(defaultTriggerChar).some((trigger) => trigger.includes(char));
-}
-
-export function whatShortcutTrigger(char: string): MarkdownShortcuts[] | null {
- const isTrigger = isTriggerChar(char);
-
- if (!isTrigger) {
- return null;
- }
-
- const shortcuts = Object.keys(defaultTriggerChar).map((key) => Number(key) as MarkdownShortcuts);
-
- return shortcuts.filter((shortcut) => defaultTriggerChar[shortcut].includes(char));
-}
-
-export function getRegex(shortcut: MarkdownShortcuts) {
- return defaultMarkdownRegex[shortcut];
-}
-
-export function whatShortcutsMatch(text: string) {
- const shortcuts = Object.keys(defaultMarkdownRegex).map((key) => Number(key) as MarkdownShortcuts);
-
- return shortcuts.filter((shortcut) => {
- const regexes = defaultMarkdownRegex[shortcut];
-
- return regexes.some((regex) => regex.pattern.test(text));
- });
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/plugins/shortcuts/shortcuts.hooks.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/plugins/shortcuts/shortcuts.hooks.ts
deleted file mode 100644
index 45d61f847c..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/plugins/shortcuts/shortcuts.hooks.ts
+++ /dev/null
@@ -1,349 +0,0 @@
-import { ReactEditor } from 'slate-react';
-import { useCallback, KeyboardEvent } from 'react';
-import { EditorMarkFormat, EditorNodeType, ToggleListNode } from '$app/application/document/document.types';
-import { getBlock } from '$app/components/editor/plugins/utils';
-import { SOFT_BREAK_TYPES } from '$app/components/editor/plugins/constants';
-import { CustomEditor } from '$app/components/editor/command';
-import { createHotkey, HOT_KEY_NAME } from '$app/utils/hotkeys';
-import { openUrl } from '$app/utils/open_url';
-import { Range } from 'slate';
-import { readText } from '@tauri-apps/api/clipboard';
-import { useDecorateDispatch } from '$app/components/editor/stores';
-
-function getScrollContainer(editor: ReactEditor) {
- const editorDom = ReactEditor.toDOMNode(editor, editor);
-
- return editorDom.closest('.appflowy-scroll-container') as HTMLDivElement;
-}
-
-export function useShortcuts(editor: ReactEditor) {
- const { add: addDecorate } = useDecorateDispatch();
-
- const formatLink = useCallback(() => {
- const { selection } = editor;
-
- if (!selection || Range.isCollapsed(selection)) return;
-
- const isIncludeRoot = CustomEditor.selectionIncludeRoot(editor);
-
- if (isIncludeRoot) return;
-
- const isActivatedInline = CustomEditor.isInlineActive(editor);
-
- if (isActivatedInline) return;
-
- addDecorate({
- range: selection,
- class_name: 'bg-content-blue-100 rounded',
- type: 'link',
- });
- }, [addDecorate, editor]);
-
- const onKeyDown = useCallback(
- (e: KeyboardEvent<HTMLDivElement>) => {
- const event = e.nativeEvent;
- const hasEditableTarget = ReactEditor.hasEditableTarget(editor, event.target);
-
- if (!hasEditableTarget) return;
-
- const node = getBlock(editor);
-
- const { selection } = editor;
- const isExpanded = selection && Range.isExpanded(selection);
-
- switch (true) {
- /**
- * Select all: Mod+A
- * Default behavior: Select all text in the editor
- * Special case for select all in code block: Only select all text in code block
- */
- case createHotkey(HOT_KEY_NAME.SELECT_ALL)(event):
- if (node && node.type === EditorNodeType.CodeBlock) {
- e.preventDefault();
- const path = ReactEditor.findPath(editor, node);
-
- editor.select(path);
- }
-
- break;
- /**
- * Escape: Esc
- * Default behavior: Deselect editor
- */
- case createHotkey(HOT_KEY_NAME.ESCAPE)(event):
- editor.deselect();
- break;
- /**
- * Indent block: Tab
- * Default behavior: Indent block
- */
- case createHotkey(HOT_KEY_NAME.INDENT_BLOCK)(event):
- e.preventDefault();
- if (SOFT_BREAK_TYPES.includes(node?.type as EditorNodeType)) {
- editor.insertText('\t');
- break;
- }
-
- CustomEditor.tabForward(editor);
- break;
- /**
- * Outdent block: Shift+Tab
- * Default behavior: Outdent block
- */
- case createHotkey(HOT_KEY_NAME.OUTDENT_BLOCK)(event):
- e.preventDefault();
- CustomEditor.tabBackward(editor);
- break;
- /**
- * Split block: Enter
- * Default behavior: Split block
- * Special case for soft break types: Insert \n
- */
- case createHotkey(HOT_KEY_NAME.SPLIT_BLOCK)(event):
- if (SOFT_BREAK_TYPES.includes(node?.type as EditorNodeType)) {
- e.preventDefault();
- editor.insertText('\n');
- }
-
- break;
- /**
- * Insert soft break: Shift+Enter
- * Default behavior: Insert \n
- * Special case for soft break types: Split block
- */
- case createHotkey(HOT_KEY_NAME.INSERT_SOFT_BREAK)(event):
- e.preventDefault();
- if (node && SOFT_BREAK_TYPES.includes(node.type as EditorNodeType)) {
- editor.splitNodes({
- always: true,
- });
- } else {
- editor.insertText('\n');
- }
-
- break;
- /**
- * Toggle todo: Shift+Enter
- * Default behavior: Toggle todo
- * Special case for toggle list block: Toggle collapse
- */
- case createHotkey(HOT_KEY_NAME.TOGGLE_TODO)(event):
- case createHotkey(HOT_KEY_NAME.TOGGLE_COLLAPSE)(event):
- e.preventDefault();
- if (node && node.type === EditorNodeType.ToggleListBlock) {
- CustomEditor.toggleToggleList(editor, node as ToggleListNode);
- } else {
- CustomEditor.toggleTodo(editor);
- }
-
- break;
- /**
- * Backspace: Backspace / Shift+Backspace
- * Default behavior: Delete backward
- */
- case createHotkey(HOT_KEY_NAME.BACKSPACE)(event):
- e.stopPropagation();
- break;
- /**
- * Open link: Alt + enter
- * Default behavior: Open one link in selection
- */
- case createHotkey(HOT_KEY_NAME.OPEN_LINK)(event): {
- if (!isExpanded) break;
- e.preventDefault();
- const links = CustomEditor.getLinks(editor);
-
- if (links.length === 0) break;
- openUrl(links[0]);
- break;
- }
-
- /**
- * Open links: Alt + Shift + enter
- * Default behavior: Open all links in selection
- */
- case createHotkey(HOT_KEY_NAME.OPEN_LINKS)(event): {
- if (!isExpanded) break;
- e.preventDefault();
- const links = CustomEditor.getLinks(editor);
-
- if (links.length === 0) break;
- links.forEach((link) => openUrl(link));
- break;
- }
-
- /**
- * Extend line backward: Opt + Shift + right
- * Default behavior: Extend line backward
- */
- case createHotkey(HOT_KEY_NAME.EXTEND_LINE_BACKWARD)(event):
- e.preventDefault();
- CustomEditor.extendLineBackward(editor);
- break;
- /**
- * Extend line forward: Opt + Shift + left
- */
- case createHotkey(HOT_KEY_NAME.EXTEND_LINE_FORWARD)(event):
- e.preventDefault();
- CustomEditor.extendLineForward(editor);
- break;
-
- /**
- * Paste: Mod + Shift + V
- * Default behavior: Paste plain text
- */
- case createHotkey(HOT_KEY_NAME.PASTE_PLAIN_TEXT)(event):
- e.preventDefault();
- void (async () => {
- const text = await readText();
-
- if (!text) return;
- CustomEditor.insertPlainText(editor, text);
- })();
-
- break;
- /**
- * Highlight: Mod + Shift + H
- * Default behavior: Highlight selected text
- */
- case createHotkey(HOT_KEY_NAME.HIGH_LIGHT)(event):
- e.preventDefault();
- CustomEditor.highlight(editor);
- break;
- /**
- * Extend document backward: Mod + Shift + Up
- * Don't prevent default behavior
- * Default behavior: Extend document backward
- */
- case createHotkey(HOT_KEY_NAME.EXTEND_DOCUMENT_BACKWARD)(event):
- editor.collapse({ edge: 'start' });
- break;
- /**
- * Extend document forward: Mod + Shift + Down
- * Don't prevent default behavior
- * Default behavior: Extend document forward
- */
- case createHotkey(HOT_KEY_NAME.EXTEND_DOCUMENT_FORWARD)(event):
- editor.collapse({ edge: 'end' });
- break;
-
- /**
- * Scroll to top: Home
- * Default behavior: Scroll to top
- */
- case createHotkey(HOT_KEY_NAME.SCROLL_TO_TOP)(event): {
- const scrollContainer = getScrollContainer(editor);
-
- scrollContainer.scrollTo({
- top: 0,
- });
- break;
- }
-
- /**
- * Scroll to bottom: End
- * Default behavior: Scroll to bottom
- */
- case createHotkey(HOT_KEY_NAME.SCROLL_TO_BOTTOM)(event): {
- const scrollContainer = getScrollContainer(editor);
-
- scrollContainer.scrollTo({
- top: scrollContainer.scrollHeight,
- });
- break;
- }
-
- /**
- * Align left: Control + Shift + L
- * Default behavior: Align left
- */
- case createHotkey(HOT_KEY_NAME.ALIGN_LEFT)(event):
- e.preventDefault();
- CustomEditor.toggleAlign(editor, 'left');
- break;
- /**
- * Align center: Control + Shift + E
- */
- case createHotkey(HOT_KEY_NAME.ALIGN_CENTER)(event):
- e.preventDefault();
- CustomEditor.toggleAlign(editor, 'center');
- break;
- /**
- * Align right: Control + Shift + R
- */
- case createHotkey(HOT_KEY_NAME.ALIGN_RIGHT)(event):
- e.preventDefault();
- CustomEditor.toggleAlign(editor, 'right');
- break;
- /**
- * Bold: Mod + B
- */
- case createHotkey(HOT_KEY_NAME.BOLD)(event):
- e.preventDefault();
- CustomEditor.toggleMark(editor, {
- key: EditorMarkFormat.Bold,
- value: true,
- });
- break;
- /**
- * Italic: Mod + I
- */
- case createHotkey(HOT_KEY_NAME.ITALIC)(event):
- e.preventDefault();
- CustomEditor.toggleMark(editor, {
- key: EditorMarkFormat.Italic,
- value: true,
- });
- break;
- /**
- * Underline: Mod + U
- */
- case createHotkey(HOT_KEY_NAME.UNDERLINE)(event):
- e.preventDefault();
- CustomEditor.toggleMark(editor, {
- key: EditorMarkFormat.Underline,
- value: true,
- });
- break;
- /**
- * Strikethrough: Mod + Shift + S / Mod + Shift + X
- */
- case createHotkey(HOT_KEY_NAME.STRIKETHROUGH)(event):
- e.preventDefault();
- CustomEditor.toggleMark(editor, {
- key: EditorMarkFormat.StrikeThrough,
- value: true,
- });
- break;
- /**
- * Code: Mod + E
- */
- case createHotkey(HOT_KEY_NAME.CODE)(event):
- e.preventDefault();
- CustomEditor.toggleMark(editor, {
- key: EditorMarkFormat.Code,
- value: true,
- });
- break;
- /**
- * Format link: Mod + K
- */
- case createHotkey(HOT_KEY_NAME.FORMAT_LINK)(event):
- formatLink();
- break;
-
- case createHotkey(HOT_KEY_NAME.FIND_REPLACE)(event):
- console.log('find replace');
- break;
-
- default:
- break;
- }
- },
- [formatLink, editor]
- );
-
- return {
- onKeyDown,
- };
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/plugins/shortcuts/withMarkdown.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/plugins/shortcuts/withMarkdown.ts
deleted file mode 100644
index fd7801204c..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/plugins/shortcuts/withMarkdown.ts
+++ /dev/null
@@ -1,239 +0,0 @@
-import { Range, Element, Editor, NodeEntry, Path } from 'slate';
-import { ReactEditor } from 'slate-react';
-import {
- defaultTriggerChar,
- getRegex,
- MarkdownShortcuts,
- whatShortcutsMatch,
- whatShortcutTrigger,
-} from '$app/components/editor/plugins/shortcuts/markdown';
-import { CustomEditor } from '$app/components/editor/command';
-import { EditorMarkFormat, EditorNodeType } from '$app/application/document/document.types';
-import isEqual from 'lodash-es/isEqual';
-
-export const withMarkdown = (editor: ReactEditor) => {
- const { insertText } = editor;
-
- editor.insertText = (char) => {
- const { selection } = editor;
-
- insertText(char);
- if (!selection || !Range.isCollapsed(selection)) {
- return;
- }
-
- const triggerShortcuts = whatShortcutTrigger(char);
-
- if (!triggerShortcuts) {
- return;
- }
-
- const match = CustomEditor.getBlock(editor);
- const [node, path] = match as NodeEntry<Element>;
-
- let prevIsNumberedList = false;
-
- try {
- const prevPath = Path.previous(path);
- const prev = editor.node(prevPath) as NodeEntry<Element>;
-
- prevIsNumberedList = prev && prev[0].type === EditorNodeType.NumberedListBlock;
- } catch (e) {
- // do nothing
- }
-
- const start = Editor.start(editor, path);
- const beforeRange = { anchor: start, focus: selection.anchor };
- const beforeText = Editor.string(editor, beforeRange);
-
- const removeBeforeText = (beforeRange: Range) => {
- editor.deleteBackward('character');
- editor.delete({
- at: beforeRange,
- });
- };
-
- const matchBlockShortcuts = whatShortcutsMatch(beforeText);
-
- for (const shortcut of matchBlockShortcuts) {
- const block = whichBlock(shortcut, beforeText);
-
- // if the block shortcut is matched, remove the before text and turn to the block
- // then return
- if (block && defaultTriggerChar[shortcut].includes(char)) {
- // Don't turn to the block condition
- // 1. Heading should be able to co-exist with number list
- if (block.type === EditorNodeType.NumberedListBlock && node.type === EditorNodeType.HeadingBlock) {
- return;
- }
-
- // 2. If the block is the same type, and data is the same
- if (block.type === node.type && isEqual(block.data || {}, node.data || {})) {
- return;
- }
-
- // 3. If the block is number list, and the previous block is also number list
- if (block.type === EditorNodeType.NumberedListBlock && prevIsNumberedList) {
- return;
- }
-
- removeBeforeText(beforeRange);
- CustomEditor.turnToBlock(editor, block);
-
- return;
- }
- }
-
- // get the range that matches the mark shortcuts
- const markRange = {
- anchor: Editor.start(editor, selection.anchor.path),
- focus: selection.focus,
- };
- const rangeText = Editor.string(editor, markRange) + char;
-
- if (!rangeText) return;
-
- // inputting a character that is start of a mark
- const isStartTyping = rangeText.indexOf(char) === rangeText.lastIndexOf(char);
-
- if (isStartTyping) return;
-
- // if the range text includes a double character mark, and the last one is not finished
- const doubleCharNotFinish =
- ['*', '_', '~'].includes(char) &&
- rangeText.indexOf(`${char}${char}`) > -1 &&
- rangeText.indexOf(`${char}${char}`) === rangeText.lastIndexOf(`${char}${char}`);
-
- if (doubleCharNotFinish) return;
-
- const matchMarkShortcuts = whatShortcutsMatch(rangeText);
-
- for (const shortcut of matchMarkShortcuts) {
- const item = getRegex(shortcut).find((p) => p.pattern.test(rangeText));
- const execArr = item?.pattern?.exec(rangeText);
-
- const removeText = execArr ? execArr[0] : '';
-
- const text = execArr ? execArr[2]?.replaceAll(char, '') : '';
-
- if (text) {
- const index = rangeText.indexOf(removeText);
- const removeRange = {
- anchor: {
- path: markRange.anchor.path,
- offset: markRange.anchor.offset + index,
- },
- focus: {
- path: markRange.anchor.path,
- offset: markRange.anchor.offset + index + removeText.length,
- },
- };
-
- removeBeforeText(removeRange);
- insertMark(editor, shortcut, text);
- return;
- }
- }
- };
-
- return editor;
-};
-
-function whichBlock(shortcut: MarkdownShortcuts, beforeText: string) {
- switch (shortcut) {
- case MarkdownShortcuts.Heading:
- return {
- type: EditorNodeType.HeadingBlock,
- data: {
- level: beforeText.length,
- },
- };
- case MarkdownShortcuts.CodeBlock:
- return {
- type: EditorNodeType.CodeBlock,
- data: {
- language: 'json',
- },
- };
- case MarkdownShortcuts.BulletedList:
- return {
- type: EditorNodeType.BulletedListBlock,
- data: {},
- };
- case MarkdownShortcuts.NumberedList:
- return {
- type: EditorNodeType.NumberedListBlock,
- data: {
- number: Number(beforeText.split('.')[0]) ?? 1,
- },
- };
- case MarkdownShortcuts.TodoList:
- return {
- type: EditorNodeType.TodoListBlock,
- data: {
- checked: beforeText.includes('[x]'),
- },
- };
- case MarkdownShortcuts.BlockQuote:
- return {
- type: EditorNodeType.QuoteBlock,
- data: {},
- };
- case MarkdownShortcuts.Divider:
- return {
- type: EditorNodeType.DividerBlock,
- data: {},
- };
-
- case MarkdownShortcuts.ToggleList:
- return {
- type: EditorNodeType.ToggleListBlock,
- data: {
- collapsed: false,
- },
- };
-
- default:
- return null;
- }
-}
-
-function insertMark(editor: ReactEditor, shortcut: MarkdownShortcuts, text: string) {
- switch (shortcut) {
- case MarkdownShortcuts.Bold:
- case MarkdownShortcuts.Italic:
- case MarkdownShortcuts.StrikeThrough:
- case MarkdownShortcuts.Code: {
- const textNode = {
- text,
- };
- const attributes = {
- [MarkdownShortcuts.Bold]: {
- [EditorMarkFormat.Bold]: true,
- },
- [MarkdownShortcuts.Italic]: {
- [EditorMarkFormat.Italic]: true,
- },
- [MarkdownShortcuts.StrikeThrough]: {
- [EditorMarkFormat.StrikeThrough]: true,
- },
- [MarkdownShortcuts.Code]: {
- [EditorMarkFormat.Code]: true,
- },
- };
-
- Object.assign(textNode, attributes[shortcut]);
-
- editor.insertNodes(textNode);
- return;
- }
-
- case MarkdownShortcuts.Equation: {
- CustomEditor.insertFormula(editor, text);
- return;
- }
-
- default:
- return null;
- }
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/plugins/utils.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/plugins/utils.ts
deleted file mode 100644
index 62e3ad945a..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/plugins/utils.ts
+++ /dev/null
@@ -1,38 +0,0 @@
-import { Element, NodeEntry } from 'slate';
-import { ReactEditor } from 'slate-react';
-import { CustomEditor } from '$app/components/editor/command';
-
-export function getHeadingCssProperty(level: number) {
- switch (level) {
- case 1:
- return 'text-3xl pt-[10px] pb-[8px] font-bold';
- case 2:
- return 'text-2xl pt-[8px] pb-[6px] font-bold';
- case 3:
- return 'text-xl pt-[4px] font-bold';
- case 4:
- return 'text-lg pt-[4px] font-bold';
- case 5:
- return 'text-base pt-[4px] font-bold';
- case 6:
- return 'text-sm pt-[4px] font-bold';
- default:
- return '';
- }
-}
-
-export function getBlock(editor: ReactEditor) {
- const match = CustomEditor.getBlock(editor);
-
- if (match) {
- const [node] = match as NodeEntry<Element>;
-
- return node;
- }
-
- return;
-}
-
-export function getEditorDomNode(editor: ReactEditor) {
- return ReactEditor.toDOMNode(editor, editor);
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/plugins/withBlockDelete.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/plugins/withBlockDelete.ts
deleted file mode 100644
index 0bcd0965a9..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/plugins/withBlockDelete.ts
+++ /dev/null
@@ -1,228 +0,0 @@
-import { ReactEditor } from 'slate-react';
-import { Editor, Element, NodeEntry, Path, Range } from 'slate';
-import { EditorNodeType } from '$app/application/document/document.types';
-import { CustomEditor } from '$app/components/editor/command';
-
-/**
- * Delete backward.
- * | -> cursor
- *
- * ------------------- delete backward to its previous sibling lift all children
- * 1 1|2
- * |2 3
- * 3 => delete backward => 4
- * 4 5
- * 5
- * ------------------- delete backward to its parent and lift all children
- * 1 1|2
- * |2 3
- * 3 => delete backward => 4
- * 4 5
- * 5
- * ------------------- outdent the node if the node has no children
- * 1 1
- * 2 2
- * |3 |3
- * 4 => delete backward => 4
- * @param editor
- */
-export function withBlockDelete(editor: ReactEditor) {
- const { deleteBackward, deleteFragment, mergeNodes } = editor;
-
- editor.deleteBackward = (unit) => {
- const match = CustomEditor.getBlock(editor);
-
- if (!match || !CustomEditor.focusAtStartOfBlock(editor)) {
- deleteBackward(unit);
- return;
- }
-
- const [node, path] = match;
-
- const isEmbed = editor.isEmbed(node);
-
- if (isEmbed) {
- CustomEditor.deleteNode(editor, node);
- return;
- }
-
- const previous = editor.previous({
- at: path,
- match: (n) => !Editor.isEditor(n) && Element.isElement(n) && n.blockId !== undefined,
- });
- const [previousNode] = previous || [undefined, undefined];
-
- const previousIsPage = previousNode && Element.isElement(previousNode) && previousNode.type === EditorNodeType.Page;
-
- // merge to document title
- if (previousIsPage) {
- const textNodePath = [...path, 0];
- const [textNode] = editor.node(textNodePath);
- const text = CustomEditor.getNodeTextContent(textNode);
-
- // clear all attributes
- editor.select(textNodePath);
- CustomEditor.removeMarks(editor);
- editor.insertText(text);
-
- editor.move({
- distance: text.length,
- reverse: true,
- });
- }
-
- // if the current node is not a paragraph, convert it to a paragraph(except code block and callout block)
- if (
- ![EditorNodeType.Paragraph, EditorNodeType.CalloutBlock, EditorNodeType.CodeBlock].includes(
- node.type as EditorNodeType
- ) &&
- node.type !== EditorNodeType.Page
- ) {
- CustomEditor.turnToBlock(editor, { type: EditorNodeType.Paragraph });
- return;
- }
-
- const next = editor.next({
- at: path,
- });
-
- if (!next && path.length > 1) {
- CustomEditor.tabBackward(editor);
- return;
- }
-
- const length = node.children.length;
-
- for (let i = length - 1; i > 0; i--) {
- editor.liftNodes({
- at: [...path, i],
- });
- }
-
- // if previous node is an embed, merge the current node to another node which is not an embed
- if (Element.isElement(previousNode) && editor.isEmbed(previousNode)) {
- const previousTextMatch = editor.previous({
- at: path,
- match: (n) => !Editor.isEditor(n) && Element.isElement(n) && n.textId !== undefined,
- });
-
- if (!previousTextMatch) {
- deleteBackward(unit);
- return;
- }
-
- const previousTextPath = previousTextMatch[1];
- const textNode = node.children[0] as Element;
-
- const at = Editor.end(editor, previousTextPath);
-
- editor.select(at);
- editor.insertNodes(textNode.children, {
- at,
- });
-
- editor.removeNodes({
- at: path,
- });
- return;
- }
-
- deleteBackward(unit);
- };
-
- editor.deleteFragment = (...args) => {
- beforeDeleteToDocumentTitle(editor);
-
- deleteFragment(...args);
- };
-
- editor.mergeNodes = (options) => {
- mergeNodes(options);
- if (!editor.selection || !options?.at) return;
- const nextPath = findNextPath(editor, editor.selection.anchor.path);
-
- const [nextNode] = editor.node(nextPath);
-
- if (Element.isElement(nextNode) && nextNode.blockId !== undefined && nextNode.children.length === 0) {
- editor.removeNodes({
- at: nextPath,
- });
- }
-
- return;
- };
-
- return editor;
-}
-
-function beforeDeleteToDocumentTitle(editor: ReactEditor) {
- if (!editor.selection) return;
- if (Range.isCollapsed(editor.selection)) return;
- const start = Range.start(editor.selection);
- const end = Range.end(editor.selection);
- const startNode = editor.above({
- at: start,
- match: (n) => !Editor.isEditor(n) && Element.isElement(n) && n.type === EditorNodeType.Page,
- });
-
- const endNode = editor.above({
- at: end,
- match: (n) => !Editor.isEditor(n) && Element.isElement(n) && n.blockId !== undefined,
- });
-
- const startNodeIsPage = !!startNode;
-
- if (!startNodeIsPage || !endNode) return;
- const [node, path] = endNode as NodeEntry<Element>;
- const selectedText = editor.string({
- anchor: {
- path,
- offset: 0,
- },
- focus: end,
- });
-
- const nodeChildren = node.children;
- const nodeChildrenLength = nodeChildren.length;
-
- for (let i = nodeChildrenLength - 1; i > 0; i--) {
- editor.liftNodes({
- at: [...path, i],
- });
- }
-
- const textNodePath = [...path, 0];
- const [textNode] = editor.node(textNodePath);
- const text = CustomEditor.getNodeTextContent(textNode);
-
- // clear all attributes
- editor.select([...path, 0]);
- CustomEditor.removeMarks(editor);
- editor.insertText(text);
- editor.move({
- distance: text.length - selectedText.length,
- reverse: true,
- });
- editor.select({
- anchor: start,
- focus: editor.selection.focus,
- });
-}
-
-function findNextPath(editor: ReactEditor, path: Path): Path {
- if (path.length === 0) return path;
- const parentPath = Path.parent(path);
-
- try {
- const nextPath = Path.next(path);
- const [nextNode] = Editor.node(editor, nextPath);
-
- if (Element.isElement(nextNode) && nextNode.blockId !== undefined) {
- return nextPath;
- }
- } catch (e) {
- // ignore
- }
-
- return findNextPath(editor, parentPath);
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/plugins/withBlockInsertBreak.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/plugins/withBlockInsertBreak.ts
deleted file mode 100644
index b6f8da0e56..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/plugins/withBlockInsertBreak.ts
+++ /dev/null
@@ -1,94 +0,0 @@
-import { ReactEditor } from 'slate-react';
-import { EditorNodeType } from '$app/application/document/document.types';
-import { CustomEditor } from '$app/components/editor/command';
-import { Path, Transforms } from 'slate';
-import { YjsEditor } from '@slate-yjs/core';
-import { generateId } from '$app/components/editor/provider/utils/convert';
-
-export function withBlockInsertBreak(editor: ReactEditor) {
- const { insertBreak } = editor;
-
- editor.insertBreak = (...args) => {
- const block = CustomEditor.getBlock(editor);
-
- if (!block) return insertBreak(...args);
-
- const [node, path] = block;
-
- const isEmbed = editor.isEmbed(node);
-
- const nextPath = Path.next(path);
-
- if (isEmbed) {
- CustomEditor.insertEmptyLine(editor as ReactEditor & YjsEditor, nextPath);
- editor.select(nextPath);
- return;
- }
-
- const type = node.type as EditorNodeType;
-
- const isBeginning = CustomEditor.focusAtStartOfBlock(editor);
-
- const isEmpty = CustomEditor.isEmptyText(editor, node);
-
- if (isEmpty) {
- const depth = path.length;
- let hasNextNode = false;
-
- try {
- hasNextNode = Boolean(editor.node(nextPath));
- } catch (e) {
- // do nothing
- }
-
- // if the node is empty and the depth is greater than 1, tab backward
- if (depth > 1 && !hasNextNode) {
- CustomEditor.tabBackward(editor);
- return;
- }
-
- // if the node is empty, convert it to a paragraph
- if (type !== EditorNodeType.Paragraph && type !== EditorNodeType.Page) {
- CustomEditor.turnToBlock(editor, { type: EditorNodeType.Paragraph });
- return;
- }
- } else if (isBeginning) {
- // insert line below the current block
- const newNodeType = [
- EditorNodeType.TodoListBlock,
- EditorNodeType.BulletedListBlock,
- EditorNodeType.NumberedListBlock,
- ].includes(type)
- ? type
- : EditorNodeType.Paragraph;
-
- Transforms.insertNodes(
- editor,
- {
- type: newNodeType,
- data: node.data ?? {},
- blockId: generateId(),
- children: [
- {
- type: EditorNodeType.Text,
- textId: generateId(),
- children: [
- {
- text: '',
- },
- ],
- },
- ],
- },
- {
- at: path,
- }
- );
- return;
- }
-
- insertBreak(...args);
- };
-
- return editor;
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/plugins/withBlockMove.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/plugins/withBlockMove.ts
deleted file mode 100644
index 814c6e7333..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/plugins/withBlockMove.ts
+++ /dev/null
@@ -1,134 +0,0 @@
-import { ReactEditor } from 'slate-react';
-import { generateId } from '$app/components/editor/provider/utils/convert';
-import { Editor, Element, Location, NodeEntry, Path, Node, Transforms } from 'slate';
-import { EditorNodeType } from '$app/application/document/document.types';
-
-const matchPath = (editor: Editor, path: Path): ((node: Node) => boolean) => {
- const [node] = Editor.node(editor, path);
-
- return (n) => {
- return n === node;
- };
-};
-
-export function withBlockMove(editor: ReactEditor) {
- const { moveNodes } = editor;
-
- editor.moveNodes = (args) => {
- const { to } = args;
-
- moveNodes(args);
-
- replaceId(editor, to);
- };
-
- editor.liftNodes = (args = {}) => {
- Editor.withoutNormalizing(editor, () => {
- const { at = editor.selection, mode = 'lowest', voids = false } = args;
- let { match } = args;
-
- if (!match) {
- match = Path.isPath(at)
- ? matchPath(editor, at)
- : (n) => Element.isElement(n) && Editor.isBlock(editor, n) && n.blockId !== undefined;
- }
-
- if (!at) {
- return;
- }
-
- const matches = Editor.nodes(editor, { at, match, mode, voids });
-
- const pathRefs = Array.from(matches, ([, p]) => {
- return Editor.pathRef(editor, p);
- });
-
- for (const pathRef of pathRefs) {
- const path = pathRef.unref();
-
- if (!path) return;
- if (path.length < 2) {
- throw new Error(`Cannot lift node at a path [${path}] because it has a depth of less than \`2\`.`);
- }
-
- const parentNodeEntry = Editor.node(editor, Path.parent(path));
- const [parent, parentPath] = parentNodeEntry as NodeEntry<Element>;
- const index = path[path.length - 1];
- const { length } = parent.children;
-
- if (length === 1) {
- const toPath = Path.next(parentPath);
-
- Transforms.moveNodes(editor, { at: path, to: toPath, voids });
- Transforms.removeNodes(editor, { at: parentPath, voids });
- } else if (index === 0) {
- Transforms.moveNodes(editor, { at: path, to: parentPath, voids });
- } else if (index === length - 1) {
- const toPath = Path.next(parentPath);
-
- Transforms.moveNodes(editor, { at: path, to: toPath, voids });
- } else {
- const toPath = Path.next(parentPath);
-
- const node = parent.children[index] as Element;
- const nodeChildrenLength = node.children.length;
-
- for (let i = length - 1; i > index; i--) {
- Transforms.moveNodes(editor, {
- at: [...parentPath, i],
- to: [...path, nodeChildrenLength],
- mode: 'all',
- });
- }
-
- Transforms.moveNodes(editor, { at: path, to: toPath, voids });
- }
- }
- });
- };
-
- return editor;
-}
-
-function replaceId(editor: Editor, at?: Location) {
- const newBlockId = generateId();
- const newTextId = generateId();
-
- const selection = editor.selection;
-
- const location = at || selection;
-
- if (!location) return;
-
- const [node, path] = editor.node(location) as NodeEntry<Element>;
-
- if (node.blockId === undefined) {
- return;
- }
-
- const [textNode, ...children] = node.children as Element[];
-
- editor.setNodes(
- {
- blockId: newBlockId,
- },
- {
- at,
- }
- );
-
- if (textNode && textNode.type === EditorNodeType.Text) {
- editor.setNodes(
- {
- textId: newTextId,
- },
- {
- at: [...path, 0],
- }
- );
- }
-
- children.forEach((_, index) => {
- replaceId(editor, [...path, index + 1]);
- });
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/plugins/withBlockPlugins.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/plugins/withBlockPlugins.ts
deleted file mode 100644
index 1e9fc7f105..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/plugins/withBlockPlugins.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-import { ReactEditor } from 'slate-react';
-
-import { withBlockDelete } from '$app/components/editor/plugins/withBlockDelete';
-import { withBlockInsertBreak } from '$app/components/editor/plugins/withBlockInsertBreak';
-import { withSplitNodes } from '$app/components/editor/plugins/withSplitNodes';
-import { withPasted, withCopy } from '$app/components/editor/plugins/copyPasted';
-import { withBlockMove } from '$app/components/editor/plugins/withBlockMove';
-import { CustomEditor } from '$app/components/editor/command';
-
-export function withBlockPlugins(editor: ReactEditor) {
- const { isElementReadOnly, isEmpty, isSelectable } = editor;
-
- editor.isElementReadOnly = (element) => {
- return CustomEditor.isEmbedNode(element) || isElementReadOnly(element);
- };
-
- editor.isEmbed = (element) => {
- return CustomEditor.isEmbedNode(element);
- };
-
- editor.isSelectable = (element) => {
- return !CustomEditor.isEmbedNode(element) && isSelectable(element);
- };
-
- editor.isEmpty = (element) => {
- return !CustomEditor.isEmbedNode(element) && isEmpty(element);
- };
-
- return withPasted(withBlockMove(withSplitNodes(withBlockInsertBreak(withBlockDelete(withCopy(editor))))));
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/plugins/withSplitNodes.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/plugins/withSplitNodes.ts
deleted file mode 100644
index eee7dd92d0..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/plugins/withSplitNodes.ts
+++ /dev/null
@@ -1,139 +0,0 @@
-import { ReactEditor } from 'slate-react';
-import { Transforms, Editor, Element, NodeEntry, Path, Range } from 'slate';
-import { EditorNodeType, ToggleListNode } from '$app/application/document/document.types';
-import { CustomEditor } from '$app/components/editor/command';
-import { generateId } from '$app/components/editor/provider/utils/convert';
-import cloneDeep from 'lodash-es/cloneDeep';
-import { SOFT_BREAK_TYPES } from '$app/components/editor/plugins/constants';
-
-/**
- * Split nodes.
- * split text node into two text nodes, and wrap the second text node with a new block node.
- *
- * Split to the first child condition:
- * 1. block type is toggle list block, and the block is not collapsed.
- *
- * Split to the next sibling condition:
- * 1. block type is toggle list block, and the block is collapsed.
- * 2. block type is other block type.
- *
- * Split to a paragraph node: (otherwise split to the same block type)
- * 1. block type is heading block.
- * 2. block type is quote block.
- * 3. block type is page.
- * 4. block type is code block and callout block.
- * 5. block type is paragraph.
- *
- * @param editor
- */
-export function withSplitNodes(editor: ReactEditor) {
- const { splitNodes } = editor;
-
- editor.splitNodes = (...args) => {
- const isInsertBreak = args.length === 1 && JSON.stringify(args[0]) === JSON.stringify({ always: true });
-
- if (!isInsertBreak) {
- splitNodes(...args);
- return;
- }
-
- const selection = editor.selection;
-
- const isCollapsed = selection && Range.isCollapsed(selection);
-
- if (!isCollapsed) {
- editor.deleteFragment({ direction: 'backward' });
- }
-
- const match = CustomEditor.getBlock(editor);
-
- if (!match) {
- splitNodes(...args);
- return;
- }
-
- const [node, path] = match;
- const nodeType = node.type as EditorNodeType;
-
- const newBlockId = generateId();
- const newTextId = generateId();
-
- splitNodes(...args);
-
- const matchTextNode = editor.above({
- match: (n) => !Editor.isEditor(n) && Element.isElement(n) && n.type === EditorNodeType.Text,
- });
-
- if (!matchTextNode) return;
- const [textNode, textNodePath] = matchTextNode as NodeEntry<Element>;
-
- editor.removeNodes({
- at: textNodePath,
- });
-
- const newNodeType = [
- EditorNodeType.HeadingBlock,
- EditorNodeType.QuoteBlock,
- EditorNodeType.Page,
- ...SOFT_BREAK_TYPES,
- ].includes(node.type as EditorNodeType)
- ? EditorNodeType.Paragraph
- : node.type;
-
- const newNode: Element = {
- type: newNodeType,
- data: {},
- blockId: newBlockId,
- children: [
- {
- ...cloneDeep(textNode),
- textId: newTextId,
- },
- ],
- };
- let newNodePath;
-
- if (nodeType === EditorNodeType.ToggleListBlock) {
- const collapsed = (node as ToggleListNode).data.collapsed;
-
- if (!collapsed) {
- newNode.type = EditorNodeType.Paragraph;
- newNodePath = textNodePath;
- } else {
- newNode.type = EditorNodeType.ToggleListBlock;
- newNodePath = Path.next(path);
- }
-
- Transforms.insertNodes(editor, newNode, {
- at: newNodePath,
- });
-
- editor.select(newNodePath);
-
- CustomEditor.removeMarks(editor);
- editor.collapse({
- edge: 'start',
- });
- return;
- }
-
- newNodePath = textNodePath;
-
- Transforms.insertNodes(editor, newNode, {
- at: newNodePath,
- });
-
- editor.select(newNodePath);
- editor.collapse({
- edge: 'start',
- });
-
- editor.liftNodes({
- at: newNodePath,
- });
-
- CustomEditor.removeMarks(editor);
- };
-
- return editor;
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/provider/__tests__/action.test.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/provider/__tests__/action.test.ts
deleted file mode 100644
index 026ee57222..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/provider/__tests__/action.test.ts
+++ /dev/null
@@ -1,124 +0,0 @@
-import { applyActions } from './utils/mockBackendService';
-import { generateId } from '$app/components/editor/provider/utils/convert';
-import { Provider } from '$app/components/editor/provider';
-import * as Y from 'yjs';
-import { BlockActionTypePB } from '@/services/backend';
-import {
- generateFormulaInsertTextOp,
- generateInsertTextOp,
- genersteMentionInsertTextOp,
-} from '$app/components/editor/provider/__tests__/utils/convert';
-
-describe('Transform events to actions', () => {
- let provider: Provider;
- beforeEach(() => {
- provider = new Provider(generateId());
- provider.initialDocument(true);
- provider.connect();
- applyActions.mockClear();
- });
-
- afterEach(() => {
- provider.disconnect();
- });
-
- test('should transform insert event to insert action', () => {
- const sharedType = provider.sharedType;
-
- const insertTextOp = generateInsertTextOp('insert text');
-
- sharedType?.applyDelta([{ retain: 2 }, insertTextOp]);
-
- const actions = applyActions.mock.calls[0][1];
- expect(actions).toHaveLength(2);
- const textId = actions[0].payload.text_id;
- expect(actions[0].action).toBe(BlockActionTypePB.InsertText);
- expect(actions[0].payload.delta).toBe('[{"insert":"insert text"}]');
- expect(actions[1].action).toBe(BlockActionTypePB.Insert);
- expect(actions[1].payload.block.ty).toBe('paragraph');
- expect(actions[1].payload.block.parent_id).toBe('3EzeCrtxlh');
- expect(actions[1].payload.block.children_id).not.toBeNull();
- expect(actions[1].payload.block.external_id).toBe(textId);
- expect(actions[1].payload.parent_id).toBe('3EzeCrtxlh');
- expect(actions[1].payload.prev_id).toBe('2qonPRrNTO');
- });
-
- test('should transform delete event to delete action', () => {
- const sharedType = provider.sharedType;
-
- sharedType?.doc?.transact(() => {
- sharedType?.applyDelta([{ retain: 4 }, { delete: 1 }]);
- });
-
- const actions = applyActions.mock.calls[0][1];
- expect(actions).toHaveLength(1);
- expect(actions[0].action).toBe(BlockActionTypePB.Delete);
- expect(actions[0].payload.block.id).toBe('Fn4KACkt1i');
- });
-
- test('should transform update event to update action', () => {
- const sharedType = provider.sharedType;
-
- const yText = sharedType?.toDelta()[4].insert as Y.XmlText;
- sharedType?.doc?.transact(() => {
- yText.setAttribute('data', {
- checked: true,
- });
- });
-
- const actions = applyActions.mock.calls[0][1];
- expect(actions).toHaveLength(1);
- expect(actions[0].action).toBe(BlockActionTypePB.Update);
- expect(actions[0].payload.block.id).toBe('Fn4KACkt1i');
- expect(actions[0].payload.block.data).toBe('{"checked":true}');
- });
-
- test('should transform apply delta event to apply delta action (insert text)', () => {
- const sharedType = provider.sharedType;
-
- const blockYText = sharedType?.toDelta()[4].insert as Y.XmlText;
- const textYText = blockYText.toDelta()[0].insert as Y.XmlText;
- sharedType?.doc?.transact(() => {
- textYText.applyDelta([{ retain: 1 }, { insert: 'apply delta' }]);
- });
- const textId = textYText.getAttribute('textId');
-
- const actions = applyActions.mock.calls[0][1];
- expect(actions).toHaveLength(1);
- expect(actions[0].action).toBe(BlockActionTypePB.ApplyTextDelta);
- expect(actions[0].payload.text_id).toBe(textId);
- expect(actions[0].payload.delta).toBe('[{"retain":1},{"insert":"apply delta"}]');
- });
-
- test('should transform apply delta event to apply delta action: insert mention', () => {
- const sharedType = provider.sharedType;
-
- const blockYText = sharedType?.toDelta()[4].insert as Y.XmlText;
- const yText = blockYText.toDelta()[0].insert as Y.XmlText;
- sharedType?.doc?.transact(() => {
- yText.applyDelta([{ retain: 1 }, genersteMentionInsertTextOp()]);
- });
-
- const actions = applyActions.mock.calls[0][1];
- expect(actions).toHaveLength(1);
- expect(actions[0].action).toBe(BlockActionTypePB.ApplyTextDelta);
- expect(actions[0].payload.delta).toBe('[{"retain":1},{"insert":"@","attributes":{"mention":{"page":"page_id"}}}]');
- });
-
- test('should transform apply delta event to apply delta action: insert formula', () => {
- const sharedType = provider.sharedType;
-
- const blockYText = sharedType?.toDelta()[4].insert as Y.XmlText;
- const yText = blockYText.toDelta()[0].insert as Y.XmlText;
- sharedType?.doc?.transact(() => {
- yText.applyDelta([{ retain: 1 }, generateFormulaInsertTextOp()]);
- });
-
- const actions = applyActions.mock.calls[0][1];
- expect(actions).toHaveLength(1);
- expect(actions[0].action).toBe(BlockActionTypePB.ApplyTextDelta);
- expect(actions[0].payload.delta).toBe('[{"retain":1},{"insert":"= 1 + 1","attributes":{"formula":true}}]');
- });
-});
-
-export {};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/provider/__tests__/observe.test.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/provider/__tests__/observe.test.ts
deleted file mode 100644
index 0937d265ed..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/provider/__tests__/observe.test.ts
+++ /dev/null
@@ -1,43 +0,0 @@
-import { applyActions } from './utils/mockBackendService';
-
-import { Provider } from '$app/components/editor/provider';
-import { generateId } from '$app/components/editor/provider/utils/convert';
-import { generateInsertTextOp } from '$app/components/editor/provider/__tests__/utils/convert';
-
-export {};
-
-describe('Provider connected', () => {
- let provider: Provider;
-
- beforeEach(() => {
- provider = new Provider(generateId());
- provider.initialDocument(true);
- provider.connect();
- applyActions.mockClear();
- });
-
- afterEach(() => {
- provider.disconnect();
- });
-
- test('should initial document', () => {
- const sharedType = provider.sharedType;
- expect(sharedType).not.toBeNull();
- expect(sharedType?.length).toBe(25);
- expect(sharedType?.getAttribute('blockId')).toBe('3EzeCrtxlh');
- });
-
- test('should send actions when the local changed', () => {
- const sharedType = provider.sharedType;
-
- const parentId = sharedType?.getAttribute('blockId') as string;
- const insertTextOp = generateInsertTextOp('');
-
- sharedType?.applyDelta([{ retain: 2 }, insertTextOp]);
-
- expect(sharedType?.length).toBe(26);
- expect(applyActions).toBeCalledTimes(1);
- });
-});
-
-export {};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/provider/__tests__/read_me.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/provider/__tests__/read_me.ts
deleted file mode 100644
index adb85f2bfd..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/provider/__tests__/read_me.ts
+++ /dev/null
@@ -1,437 +0,0 @@
-export default {
- viewId: '04acbc17-2265-4e4d-ac80-392bdc81379f',
- rootId: '3EzeCrtxlh',
- nodeMap: {
- '692ooXzoV-': {
- id: '692ooXzoV-',
- type: 'todo_list',
- parent: '3EzeCrtxlh',
- children: '4yIcpjxFTQ',
- data: { checked: false },
- externalId: '9L10h3UZ7J',
- externalType: 'text',
- },
- gCjs671FiD: {
- id: 'gCjs671FiD',
- type: 'paragraph',
- parent: '3EzeCrtxlh',
- children: 'Bj4M6midh3',
- data: {},
- externalId: 'uGR_eATq2B',
- externalType: 'text',
- },
- whGVOpFJzA: {
- id: 'whGVOpFJzA',
- type: 'code',
- parent: '3EzeCrtxlh',
- children: 'eYqZSaUSrF',
- data: { language: 'rust' },
- externalId: '2H8dnFhOsJ',
- externalType: 'text',
- },
- PeUTr8lpaW: {
- id: 'PeUTr8lpaW',
- type: 'divider',
- parent: '3EzeCrtxlh',
- children: '7gXZ4anHxc',
- data: {},
- externalId: '',
- externalType: '',
- },
- aRUJ8rTJR9: {
- id: 'aRUJ8rTJR9',
- type: 'quote',
- parent: '3EzeCrtxlh',
- children: '877leNxAdX',
- data: {},
- externalId: 'Qdn9CIuCJb',
- externalType: 'text',
- },
- '5OZNiernqA': {
- id: '5OZNiernqA',
- type: 'paragraph',
- parent: '3EzeCrtxlh',
- children: 'rnWU0OMG2D',
- data: {},
- externalId: '7szeShePbX',
- externalType: 'text',
- },
- '6okS7LcJz6': {
- id: '6okS7LcJz6',
- type: 'paragraph',
- parent: '3EzeCrtxlh',
- children: 'o2VwjuyMqD',
- data: {},
- externalId: 'T7KYfpQzkC',
- externalType: 'text',
- },
- '2qonPRrNTO': {
- id: '2qonPRrNTO',
- type: 'heading',
- parent: '3EzeCrtxlh',
- children: 'EwyNm_pVG3',
- data: { level: 1 },
- externalId: 'zatA8Lta9U',
- externalType: 'text',
- },
- G6SPYNOXyd: {
- id: 'G6SPYNOXyd',
- type: 'heading',
- parent: '3EzeCrtxlh',
- children: 'dMAT_mdB3t',
- data: { level: 2 },
- externalId: 'EZJU9Ks-XL',
- externalType: 'text',
- },
- 'i-7TRjZWn4': {
- id: 'i-7TRjZWn4',
- type: 'todo_list',
- parent: '3EzeCrtxlh',
- children: '3NsAmPWBLT',
- data: { checked: true },
- externalId: 'rG9KOmfyQc',
- externalType: 'text',
- },
- mAce5pJ5iN: {
- id: 'mAce5pJ5iN',
- type: 'paragraph',
- parent: '3EzeCrtxlh',
- children: 'PavtRGeb_I',
- data: {},
- externalId: 'UUBk3lnHDj',
- externalType: 'text',
- },
- ViWXVLgaux: {
- id: 'ViWXVLgaux',
- type: 'numbered_list',
- parent: '3EzeCrtxlh',
- children: 'osPbZZroOQ',
- data: {},
- externalId: 'OkO9CIoWYX',
- externalType: 'text',
- },
- VrW0GWtvmq: {
- id: 'VrW0GWtvmq',
- type: 'todo_list',
- parent: '3EzeCrtxlh',
- children: 'hFX8bE3MQ6',
- data: { checked: false },
- externalId: 'wBzhBx7bcM',
- externalType: 'text',
- },
- YzM4q9vJgy: {
- id: 'YzM4q9vJgy',
- type: 'paragraph',
- parent: '3EzeCrtxlh',
- children: 'mlDk334eJ5',
- data: {},
- externalId: 'wIXo3cMKpn',
- externalType: 'text',
- },
- okBQecghDx: {
- id: 'okBQecghDx',
- type: 'todo_list',
- parent: '3EzeCrtxlh',
- children: 'r7U-ocUQEj',
- data: { checked: false },
- externalId: '8T-1vemF9G',
- externalType: 'text',
- },
- qJcR2SnePa: {
- id: 'qJcR2SnePa',
- type: 'callout',
- parent: '3EzeCrtxlh',
- children: 'X8-C5rdFkI',
- data: { icon: '🥰' },
- externalId: 'o3mqcqjEvX',
- externalType: 'text',
- },
- q8trFTc21J: {
- id: 'q8trFTc21J',
- type: 'numbered_list',
- parent: '3EzeCrtxlh',
- children: 'Ye_KrA1Zqb',
- data: {},
- externalId: 'E-XQYK1KGP',
- externalType: 'text',
- },
- '-7trMtJMEt': {
- id: '-7trMtJMEt',
- type: 'numbered_list',
- parent: '3EzeCrtxlh',
- children: '5-RQuN9654',
- data: {},
- externalId: 'meKXZh3E_1',
- externalType: 'text',
- },
- Fn4KACkt1i: {
- id: 'Fn4KACkt1i',
- type: 'todo_list',
- parent: '3EzeCrtxlh',
- children: 'MM6vCgc7RC',
- data: { checked: false },
- externalId: 'v0XWYu0w3F',
- externalType: 'text',
- },
- TTU0eUzM4G: {
- id: 'TTU0eUzM4G',
- type: 'paragraph',
- parent: '3EzeCrtxlh',
- children: 'Jo1ix-lCgZ',
- data: {},
- externalId: 'IRpzcwVaU4',
- externalType: 'text',
- },
- '6QZZccBfnT': {
- id: '6QZZccBfnT',
- type: 'heading',
- parent: '3EzeCrtxlh',
- children: 'bdI2gAQB-G',
- data: { level: 2 },
- externalId: 'J-oMw2g2_D',
- externalType: 'text',
- },
- sZT5qbJvLX: {
- id: 'sZT5qbJvLX',
- type: 'paragraph',
- parent: '3EzeCrtxlh',
- children: 'yR1_d6lPtR',
- data: {},
- externalId: 'anA255zYMV',
- externalType: 'text',
- },
- '3EzeCrtxlh': {
- id: '3EzeCrtxlh',
- type: 'page',
- parent: '',
- children: 'ChrjyUcqp5',
- data: {},
- externalId: 'bGaty5Tv88',
- externalType: 'text',
- },
- 'b3G76VM-nh': {
- id: 'b3G76VM-nh',
- type: 'heading',
- parent: '3EzeCrtxlh',
- children: '7PDV2Ev8pz',
- data: { level: 2 },
- externalId: 'baM4S6ohnQ',
- externalType: 'text',
- },
- CxPil0324P: {
- id: 'CxPil0324P',
- type: 'todo_list',
- parent: '3EzeCrtxlh',
- children: 'qJkq_FYLux',
- data: { checked: false },
- externalId: 'LGUrob79hg',
- externalType: 'text',
- },
- },
- childrenMap: {
- '-7trMtJMEt': [],
- okBQecghDx: [],
- PeUTr8lpaW: [],
- '6QZZccBfnT': [],
- aRUJ8rTJR9: [],
- G6SPYNOXyd: [],
- VrW0GWtvmq: [],
- 'i-7TRjZWn4': [],
- '6okS7LcJz6': [],
- Fn4KACkt1i: [],
- qJcR2SnePa: [],
- sZT5qbJvLX: [],
- '2qonPRrNTO': [],
- CxPil0324P: [],
- YzM4q9vJgy: [],
- mAce5pJ5iN: [],
- gCjs671FiD: [],
- q8trFTc21J: [],
- whGVOpFJzA: [],
- '5OZNiernqA': [],
- 'b3G76VM-nh': [],
- TTU0eUzM4G: [],
- '3EzeCrtxlh': [
- '2qonPRrNTO',
- 'b3G76VM-nh',
- 'CxPil0324P',
- 'Fn4KACkt1i',
- 'okBQecghDx',
- 'VrW0GWtvmq',
- 'i-7TRjZWn4',
- '692ooXzoV-',
- 'sZT5qbJvLX',
- 'PeUTr8lpaW',
- 'YzM4q9vJgy',
- 'G6SPYNOXyd',
- '-7trMtJMEt',
- 'q8trFTc21J',
- 'ViWXVLgaux',
- 'whGVOpFJzA',
- 'mAce5pJ5iN',
- '6QZZccBfnT',
- 'aRUJ8rTJR9',
- 'gCjs671FiD',
- 'qJcR2SnePa',
- '5OZNiernqA',
- 'TTU0eUzM4G',
- '6okS7LcJz6',
- ],
- ViWXVLgaux: [],
- '692ooXzoV-': [],
- },
- relativeMap: {
- '4yIcpjxFTQ': '692ooXzoV-',
- Bj4M6midh3: 'gCjs671FiD',
- eYqZSaUSrF: 'whGVOpFJzA',
- '7gXZ4anHxc': 'PeUTr8lpaW',
- '877leNxAdX': 'aRUJ8rTJR9',
- rnWU0OMG2D: '5OZNiernqA',
- o2VwjuyMqD: '6okS7LcJz6',
- EwyNm_pVG3: '2qonPRrNTO',
- dMAT_mdB3t: 'G6SPYNOXyd',
- '3NsAmPWBLT': 'i-7TRjZWn4',
- PavtRGeb_I: 'mAce5pJ5iN',
- osPbZZroOQ: 'ViWXVLgaux',
- hFX8bE3MQ6: 'VrW0GWtvmq',
- mlDk334eJ5: 'YzM4q9vJgy',
- 'r7U-ocUQEj': 'okBQecghDx',
- 'X8-C5rdFkI': 'qJcR2SnePa',
- Ye_KrA1Zqb: 'q8trFTc21J',
- '5-RQuN9654': '-7trMtJMEt',
- MM6vCgc7RC: 'Fn4KACkt1i',
- 'Jo1ix-lCgZ': 'TTU0eUzM4G',
- 'bdI2gAQB-G': '6QZZccBfnT',
- yR1_d6lPtR: 'sZT5qbJvLX',
- ChrjyUcqp5: '3EzeCrtxlh',
- '7PDV2Ev8pz': 'b3G76VM-nh',
- qJkq_FYLux: 'CxPil0324P',
- },
- deltaMap: {
- gCjs671FiD: [],
- G6SPYNOXyd: [{ insert: 'Keyboard shortcuts, markdown, and code block' }],
- VrW0GWtvmq: [
- { insert: 'Type ' },
- { insert: '/', attributes: { code: true } },
- { insert: ' followed by ' },
- { insert: '/bullet', attributes: { code: true } },
- { insert: ' or ' },
- { insert: '/num', attributes: { code: true } },
- { insert: ' to create a list.', attributes: { code: false } },
- ],
- '-7trMtJMEt': [
- { insert: 'Keyboard shortcuts ' },
- {
- insert: 'guide',
- attributes: { href: 'https://appflowy.gitbook.io/docs/essential-documentation/shortcuts' },
- },
- ],
- okBQecghDx: [
- { insert: 'As soon as you type ' },
- { insert: '/', attributes: { font_color: '0xff00b5ff', code: true } },
- { insert: ' a menu will pop up. Select ' },
- { insert: 'different types', attributes: { bg_color: '0x4d9c27b0' } },
- { insert: ' of content blocks you can add.' },
- ],
- qJcR2SnePa: [
- { insert: '\nLike AppFlowy? Follow us:\n' },
- { insert: 'GitHub', attributes: { href: 'https://github.com/AppFlowy-IO/AppFlowy' } },
- { insert: '\n' },
- { insert: 'Twitter', attributes: { href: 'https://twitter.com/appflowy' } },
- { insert: ': @appflowy\n' },
- { insert: 'Newsletter', attributes: { href: 'https://blog-appflowy.ghost.io/' } },
- { insert: '\n' },
- ],
- whGVOpFJzA: [
- {
- insert:
- '// This is the main function.\nfn main() {\n // Print text to the console.\n println!("Hello World!");\n}',
- },
- ],
- YzM4q9vJgy: [],
- '692ooXzoV-': [
- { insert: 'Click ' },
- { insert: '+', attributes: { code: true } },
- { insert: ' next to any page title in the sidebar to ' },
- { insert: 'quickly', attributes: { font_color: '0xff8427e0' } },
- { insert: ' add a new subpage, ' },
- { insert: 'Document', attributes: { code: true } },
- { insert: ', ', attributes: { code: false } },
- { insert: 'Grid', attributes: { code: true } },
- { insert: ', or ', attributes: { code: false } },
- { insert: 'Kanban Board', attributes: { code: true } },
- { insert: '.', attributes: { code: false } },
- ],
- q8trFTc21J: [
- { insert: 'Markdown ' },
- {
- insert: 'reference',
- attributes: { href: 'https://appflowy.gitbook.io/docs/essential-documentation/markdown' },
- },
- ],
- ViWXVLgaux: [
- { insert: 'Type ' },
- { insert: '/code', attributes: { code: true } },
- { insert: ' to insert a code block', attributes: { code: false } },
- ],
- sZT5qbJvLX: [],
- '6QZZccBfnT': [{ insert: 'Have a question❓' }],
- '5OZNiernqA': [],
- '6okS7LcJz6': [],
- mAce5pJ5iN: [],
- aRUJ8rTJR9: [
- { insert: 'Click ' },
- { insert: '?', attributes: { code: true } },
- { insert: ' at the bottom right for help and support.' },
- ],
- Fn4KACkt1i: [
- { insert: 'Highlight ', attributes: { bg_color: '0x4dffeb3b' } },
- { insert: 'any text, and use the editing menu to ' },
- { insert: 'style', attributes: { italic: true } },
- { insert: ' ' },
- { insert: 'your', attributes: { bold: true } },
- { insert: ' ' },
- { insert: 'writing', attributes: { underline: true } },
- { insert: ' ' },
- { insert: 'however', attributes: { code: true } },
- { insert: ' you ' },
- { insert: 'like.', attributes: { strikethrough: true } },
- ],
- '3EzeCrtxlh': [],
- '2qonPRrNTO': [{ insert: 'Welcome to AppFlowy!' }],
- 'b3G76VM-nh': [{ insert: 'Here are the basics' }],
- TTU0eUzM4G: [],
- CxPil0324P: [{ insert: 'Click anywhere and just start typing.' }],
- 'i-7TRjZWn4': [
- { insert: 'Click ' },
- { insert: '+ New Page ', attributes: { code: true } },
- { insert: 'button at the bottom of your sidebar to add a new page.' },
- ],
- },
- externalIdMap: {
- '9L10h3UZ7J': '692ooXzoV-',
- uGR_eATq2B: 'gCjs671FiD',
- '2H8dnFhOsJ': 'whGVOpFJzA',
- Qdn9CIuCJb: 'aRUJ8rTJR9',
- '7szeShePbX': '5OZNiernqA',
- T7KYfpQzkC: '6okS7LcJz6',
- zatA8Lta9U: '2qonPRrNTO',
- 'EZJU9Ks-XL': 'G6SPYNOXyd',
- rG9KOmfyQc: 'i-7TRjZWn4',
- UUBk3lnHDj: 'mAce5pJ5iN',
- OkO9CIoWYX: 'ViWXVLgaux',
- wBzhBx7bcM: 'VrW0GWtvmq',
- wIXo3cMKpn: 'YzM4q9vJgy',
- '8T-1vemF9G': 'okBQecghDx',
- o3mqcqjEvX: 'qJcR2SnePa',
- 'E-XQYK1KGP': 'q8trFTc21J',
- meKXZh3E_1: '-7trMtJMEt',
- v0XWYu0w3F: 'Fn4KACkt1i',
- IRpzcwVaU4: 'TTU0eUzM4G',
- 'J-oMw2g2_D': '6QZZccBfnT',
- anA255zYMV: 'sZT5qbJvLX',
- bGaty5Tv88: '3EzeCrtxlh',
- baM4S6ohnQ: 'b3G76VM-nh',
- LGUrob79hg: 'CxPil0324P',
- },
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/provider/__tests__/utils/convert.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/provider/__tests__/utils/convert.ts
deleted file mode 100644
index 028fff7419..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/provider/__tests__/utils/convert.ts
+++ /dev/null
@@ -1,76 +0,0 @@
-/**
- * @jest-environment jsdom
- */
-import { slateNodesToInsertDelta } from '@slate-yjs/core';
-import * as Y from 'yjs';
-import { generateId } from '$app/components/editor/provider/utils/convert';
-
-export function slateElementToYText({
- children,
- ...attributes
-}: {
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- children: any;
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- [key: string]: any;
-}) {
- const yElement = new Y.XmlText();
-
- Object.entries(attributes).forEach(([key, value]) => {
- yElement.setAttribute(key, value);
- });
- yElement.applyDelta(slateNodesToInsertDelta(children), {
- sanitize: false,
- });
- return yElement;
-}
-
-// eslint-disable-next-line @typescript-eslint/no-explicit-any
-export function generateInsertTextOp(text: string) {
- const insertYText = slateElementToYText({
- children: [
- {
- type: 'text',
- textId: generateId(),
- children: [
- {
- text,
- },
- ],
- },
- ],
- type: 'paragraph',
- data: {},
- blockId: generateId(),
- });
-
- return {
- insert: insertYText,
- };
-}
-
-export function genersteMentionInsertTextOp() {
- const mentionYText = slateElementToYText({
- children: [{ text: '@' }],
- type: 'mention',
- data: {
- page: 'page_id',
- },
- });
-
- return {
- insert: mentionYText,
- };
-}
-
-export function generateFormulaInsertTextOp() {
- const formulaYText = slateElementToYText({
- children: [{ text: '= 1 + 1' }],
- type: 'formula',
- data: true,
- });
-
- return {
- insert: formulaYText,
- };
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/provider/__tests__/utils/mockBackendService.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/provider/__tests__/utils/mockBackendService.ts
deleted file mode 100644
index 3bd7646268..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/provider/__tests__/utils/mockBackendService.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import read_me from '$app/components/editor/provider/__tests__/read_me';
-
-const applyActions = jest.fn().mockReturnValue(Promise.resolve());
-
-jest.mock('$app/application/notification', () => {
- return {
- subscribeNotification: jest.fn().mockReturnValue(Promise.resolve(() => ({}))),
- };
-});
-
-jest.mock('nanoid', () => ({ nanoid: jest.fn().mockReturnValue(String(Math.random())) }));
-
-jest.mock('$app/application/document/document.service', () => {
- return {
- openDocument: jest.fn().mockReturnValue(Promise.resolve(read_me)),
- applyActions,
- closeDocument: jest.fn().mockReturnValue(Promise.resolve()),
- };
-});
-
-export { applyActions };
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/provider/data_client.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/provider/data_client.ts
deleted file mode 100644
index bf0ea2c2a7..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/provider/data_client.ts
+++ /dev/null
@@ -1,74 +0,0 @@
-import { applyActions, closeDocument, openDocument } from '$app/application/document/document.service';
-import { slateNodesToInsertDelta } from '@slate-yjs/core';
-import { convertToSlateValue } from '$app/components/editor/provider/utils/convert';
-import { EventEmitter } from 'events';
-import { BlockActionPB, DocEventPB, DocumentNotification } from '@/services/backend';
-import { AsyncQueue } from '$app/utils/async_queue';
-import { subscribeNotification } from '$app/application/notification';
-import { YDelta } from '$app/components/editor/provider/types/y_event';
-import { DocEvent2YDelta } from '$app/components/editor/provider/utils/delta';
-
-export class DataClient extends EventEmitter {
- private queue: AsyncQueue<ReturnType<typeof BlockActionPB.prototype.toObject>[]>;
- private unsubscribe: Promise<() => void>;
- public rootId?: string;
-
- constructor(private id: string) {
- super();
- this.queue = new AsyncQueue(this.sendActions);
- this.unsubscribe = subscribeNotification(DocumentNotification.DidReceiveUpdate, this.sendMessage);
-
- this.on('update', this.handleReceiveMessage);
- }
-
- public disconnect() {
- this.off('update', this.handleReceiveMessage);
- void closeDocument(this.id);
- void this.unsubscribe.then((unsubscribe) => unsubscribe());
- }
-
- public async getInsertDelta(includeRoot = true) {
- const data = await openDocument(this.id);
-
- this.rootId = data.rootId;
-
- const slateValue = convertToSlateValue(data, includeRoot);
-
- return slateNodesToInsertDelta(slateValue);
- }
-
- public on(event: 'change', listener: (events: YDelta) => void): this;
- public on(event: 'update', listener: (actions: ReturnType<typeof BlockActionPB.prototype.toObject>[]) => void): this;
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- public on(event: string, listener: (...args: any[]) => void): this {
- return super.on(event, listener);
- }
-
- public off(event: 'change', listener: (events: YDelta) => void): this;
- public off(event: 'update', listener: (actions: ReturnType<typeof BlockActionPB.prototype.toObject>[]) => void): this;
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- public off(event: string, listener: (...args: any[]) => void): this {
- return super.off(event, listener);
- }
-
- public emit(event: 'change', events: YDelta): boolean;
- public emit(event: 'update', actions: ReturnType<typeof BlockActionPB.prototype.toObject>[]): boolean;
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- public emit(event: string, ...args: any[]): boolean {
- return super.emit(event, ...args);
- }
-
- private sendMessage = (docEvent: DocEventPB) => {
- // transform events to ops
- this.emit('change', DocEvent2YDelta(docEvent));
- };
-
- private handleReceiveMessage = (actions: ReturnType<typeof BlockActionPB.prototype.toObject>[]) => {
- this.queue.enqueue(actions);
- };
-
- private sendActions = async (actions: ReturnType<typeof BlockActionPB.prototype.toObject>[]) => {
- if (!actions.length) return;
- await applyActions(this.id, actions);
- };
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/provider/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/provider/index.ts
deleted file mode 100644
index 03be03e588..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/provider/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './provider';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/provider/provider.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/provider/provider.ts
deleted file mode 100644
index 727b33ec69..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/provider/provider.ts
+++ /dev/null
@@ -1,74 +0,0 @@
-import * as Y from 'yjs';
-
-import { DataClient } from '$app/components/editor/provider/data_client';
-import { YDelta } from '$app/components/editor/provider/types/y_event';
-import { YEvents2BlockActions } from '$app/components/editor/provider/utils/action';
-import { EventEmitter } from 'events';
-
-const REMOTE_ORIGIN = 'remote';
-
-export class Provider extends EventEmitter {
- document: Y.Doc = new Y.Doc();
- sharedType: Y.XmlText | null = null;
- dataClient: DataClient;
- // get origin data after document updated
- backupDoc: Y.Doc = new Y.Doc();
- constructor(public id: string) {
- super();
- this.dataClient = new DataClient(id);
- this.document.on('update', this.documentUpdate);
- }
-
- initialDocument = async (includeRoot = true) => {
- const sharedType = this.document.get('sharedType', Y.XmlText) as Y.XmlText;
- // Load the initial value into the yjs document
- const delta = await this.dataClient.getInsertDelta(includeRoot);
-
- sharedType.applyDelta(delta);
-
- const rootId = this.dataClient.rootId as string;
- const root = delta[0].insert as Y.XmlText;
- const data = root.getAttribute('data');
-
- sharedType.setAttribute('blockId', rootId);
- sharedType.setAttribute('data', data);
-
- this.sharedType = sharedType;
- this.sharedType?.observeDeep(this.onChange);
- this.emit('ready');
- };
-
- connect() {
- this.dataClient.on('change', this.onRemoteChange);
- return;
- }
-
- disconnect() {
- this.dataClient.off('change', this.onRemoteChange);
- this.dataClient.disconnect();
- this.sharedType?.unobserveDeep(this.onChange);
- this.sharedType = null;
- }
-
- onChange = (events: Y.YEvent<Y.XmlText>[], transaction: Y.Transaction) => {
- if (transaction.origin === REMOTE_ORIGIN) {
- return;
- }
-
- if (!this.sharedType || !events.length) return;
- // transform events to actions
- this.dataClient.emit('update', YEvents2BlockActions(this.backupDoc, events));
- };
-
- onRemoteChange = (delta: YDelta) => {
- if (!delta.length) return;
-
- this.document.transact(() => {
- this.sharedType?.applyDelta(delta);
- }, REMOTE_ORIGIN);
- };
-
- documentUpdate = (update: Uint8Array) => {
- Y.applyUpdate(this.backupDoc, update);
- };
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/provider/types/y_event.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/provider/types/y_event.ts
deleted file mode 100644
index 36ec97aa39..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/provider/types/y_event.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import { YXmlText } from 'yjs/dist/src/types/YXmlText';
-
-export interface YOp {
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- insert?: string | object | any[] | YXmlText | undefined;
- retain?: number | undefined;
- delete?: number | undefined;
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- attributes?: { [p: string]: any } | undefined;
-}
-
-export type YDelta = YOp[];
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/provider/utils/action.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/provider/utils/action.ts
deleted file mode 100644
index 447a8f95f9..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/provider/utils/action.ts
+++ /dev/null
@@ -1,301 +0,0 @@
-import * as Y from 'yjs';
-import { BlockActionPB, BlockActionTypePB } from '@/services/backend';
-import { generateId } from '$app/components/editor/provider/utils/convert';
-import { YDelta2Delta } from '$app/components/editor/provider/utils/delta';
-import { YDelta } from '$app/components/editor/provider/types/y_event';
-import { getInsertTarget, getYTarget } from '$app/components/editor/provider/utils/relation';
-import { EditorInlineNodeType, EditorNodeType } from '$app/application/document/document.types';
-import { Log } from '$app/utils/log';
-
-export function YEvents2BlockActions(
- backupDoc: Readonly<Y.Doc>,
- events: Y.YEvent<Y.XmlText>[]
-): ReturnType<typeof BlockActionPB.prototype.toObject>[] {
- const actions: ReturnType<typeof BlockActionPB.prototype.toObject>[] = [];
-
- events.forEach((event) => {
- const eventActions = YEvent2BlockActions(backupDoc, event);
-
- if (eventActions.length === 0) return;
-
- actions.push(...eventActions);
- });
-
- return actions;
-}
-
-export function YEvent2BlockActions(
- backupDoc: Readonly<Y.Doc>,
- event: Y.YEvent<Y.XmlText>
-): ReturnType<typeof BlockActionPB.prototype.toObject>[] {
- const { target: yXmlText, keys, delta, path } = event;
- const isBlockEvent = !!yXmlText.getAttribute('blockId');
- const sharedType = backupDoc.get('sharedType', Y.XmlText) as Readonly<Y.XmlText>;
- const rootId = sharedType.getAttribute('blockId');
-
- const backupTarget = getYTarget(backupDoc, path) as Readonly<Y.XmlText>;
- const actions = [];
-
- if ([EditorInlineNodeType.Formula, EditorInlineNodeType.Mention].includes(yXmlText.getAttribute('type'))) {
- const parentYXmlText = yXmlText.parent as Y.XmlText;
- const parentDelta = parentYXmlText.toDelta() as YDelta;
- const index = parentDelta.findIndex((op) => op.insert === yXmlText);
- const ops = YDelta2Delta(parentDelta);
-
- const retainIndex = ops.reduce((acc, op, currentIndex) => {
- if (currentIndex < index) {
- return acc + (op.insert as string).length ?? 0;
- }
-
- return acc;
- }, 0);
-
- const newDelta = [
- {
- retain: retainIndex,
- },
- ...delta,
- ];
-
- actions.push(...generateApplyTextActions(parentYXmlText, newDelta));
- }
-
- if (yXmlText.getAttribute('type') === 'text') {
- actions.push(...textOps2BlockActions(rootId, yXmlText, delta));
- }
-
- if (keys.size > 0) {
- actions.push(...dataOps2BlockActions(yXmlText, keys));
- }
-
- if (isBlockEvent) {
- actions.push(...blockOps2BlockActions(backupTarget, delta));
- }
-
- return actions;
-}
-
-function textOps2BlockActions(
- rootId: string,
- yXmlText: Y.XmlText,
- ops: YDelta
-): ReturnType<typeof BlockActionPB.prototype.toObject>[] {
- if (ops.length === 0) return [];
- const blockYXmlText = yXmlText.parent as Y.XmlText;
- const blockId = blockYXmlText.getAttribute('blockId');
-
- if (blockId === rootId) {
- return [];
- }
-
- return generateApplyTextActions(yXmlText, ops);
-}
-
-function dataOps2BlockActions(
- yXmlText: Y.XmlText,
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- keys: Map<string, { action: 'update' | 'add' | 'delete'; oldValue: any; newValue: any }>
-) {
- const dataUpdated = keys.has('data');
-
- if (!dataUpdated) return [];
- const data = yXmlText.getAttribute('data');
-
- return generateUpdateActions(yXmlText, {
- data,
- });
-}
-
-function blockOps2BlockActions(
- blockYXmlText: Readonly<Y.XmlText>,
- ops: YDelta
-): ReturnType<typeof BlockActionPB.prototype.toObject>[] {
- const actions: ReturnType<typeof BlockActionPB.prototype.toObject>[] = [];
-
- let index = 0;
-
- ops.forEach((op) => {
- if (op.insert) {
- if (op.insert instanceof Y.XmlText) {
- const insertYXmlText = op.insert;
- const blockId = insertYXmlText.getAttribute('blockId');
- const textId = insertYXmlText.getAttribute('textId');
-
- if (!blockId && !textId) {
- throw new Error('blockId and textId is not exist');
- }
-
- if (blockId) {
- actions.push(...generateInsertBlockActions(insertYXmlText));
- index += 1;
- }
-
- if (textId) {
- const target = getInsertTarget(blockYXmlText, [0]);
-
- if (target) {
- const length = target.length;
-
- const delta = [{ delete: length }, ...insertYXmlText.toDelta()];
-
- // restore textId
- insertYXmlText.setAttribute('textId', target.getAttribute('textId'));
- actions.push(...generateApplyTextActions(target, delta));
- }
- }
- }
- } else if (op.retain) {
- index += op.retain;
- } else if (op.delete) {
- let i = 0;
-
- for (; i < op.delete; i++) {
- const target = getInsertTarget(blockYXmlText, [i + index]);
-
- if (target && target !== blockYXmlText) {
- const deletedId = target.getAttribute('blockId') as string;
-
- if (deletedId) {
- actions.push(
- ...generateDeleteBlockActions({
- ids: [deletedId],
- })
- );
- } else {
- Log.error('blockOps2BlockActions', 'deletedId is not exist');
- }
- }
- }
-
- index += i;
- }
- });
-
- return actions;
-}
-
-export function generateUpdateActions(
- yXmlText: Y.XmlText,
- {
- data,
- }: {
- data?: Record<string, string | boolean>;
- external_id?: string;
- }
-) {
- const id = yXmlText.getAttribute('blockId');
- const parentId = yXmlText.getAttribute('parentId');
-
- return [
- {
- action: BlockActionTypePB.Update,
- payload: {
- block: {
- id,
- data: JSON.stringify(data),
- },
- parent_id: parentId,
- },
- },
- ];
-}
-
-export function generateApplyTextActions(yXmlText: Y.XmlText, delta: YDelta) {
- const externalId = yXmlText.getAttribute('textId');
-
- if (!externalId) return [];
-
- const deltaString = JSON.stringify(YDelta2Delta(delta));
-
- return [
- {
- action: BlockActionTypePB.ApplyTextDelta,
- payload: {
- text_id: externalId,
- delta: deltaString,
- },
- },
- ];
-}
-
-export function generateDeleteBlockActions({ ids }: { ids: string[] }) {
- return ids.map((id) => ({
- action: BlockActionTypePB.Delete,
- payload: {
- block: {
- id,
- },
- parent_id: '',
- },
- }));
-}
-
-export function generateInsertTextActions(insertYXmlText: Y.XmlText) {
- const textId = insertYXmlText.getAttribute('textId');
- const delta = YDelta2Delta(insertYXmlText.toDelta());
-
- return [
- {
- action: BlockActionTypePB.InsertText,
- payload: {
- text_id: textId,
- delta: JSON.stringify(delta),
- },
- },
- ];
-}
-
-export function generateInsertBlockActions(
- insertYXmlText: Y.XmlText
-): ReturnType<typeof BlockActionPB.prototype.toObject>[] {
- const childrenId = generateId();
-
- const [textInsert, ...childrenInserts] = (insertYXmlText.toDelta() as YDelta).map((op) => op.insert);
- const textInsertActions = textInsert instanceof Y.XmlText ? generateInsertTextActions(textInsert) : [];
- const externalId = textInsertActions[0]?.payload.text_id;
- const prev = insertYXmlText.prevSibling;
- const prevId = prev ? prev.getAttribute('blockId') : null;
- const parentId = (insertYXmlText.parent as Y.XmlText).getAttribute('blockId');
-
- const data = insertYXmlText.getAttribute('data');
- const type = insertYXmlText.getAttribute('type');
- const id = insertYXmlText.getAttribute('blockId');
-
- if (!id) {
- Log.error('generateInsertBlockActions', 'id is not exist');
- return [];
- }
-
- if (!type || type === 'text' || Object.values(EditorNodeType).indexOf(type) === -1) {
- Log.error('generateInsertBlockActions', 'type is error: ' + type);
- return [];
- }
-
- const actions: ReturnType<typeof BlockActionPB.prototype.toObject>[] = [
- ...textInsertActions,
- {
- action: BlockActionTypePB.Insert,
- payload: {
- block: {
- id,
- data: JSON.stringify(data),
- ty: type,
- parent_id: parentId,
- children_id: childrenId,
- external_id: externalId,
- external_type: externalId ? 'text' : undefined,
- },
- prev_id: prevId,
- parent_id: parentId,
- },
- },
- ];
-
- childrenInserts.forEach((insert) => {
- if (insert instanceof Y.XmlText) {
- actions.push(...generateInsertBlockActions(insert));
- }
- });
-
- return actions;
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/provider/utils/convert.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/provider/utils/convert.ts
deleted file mode 100644
index b4da4b3ca7..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/provider/utils/convert.ts
+++ /dev/null
@@ -1,154 +0,0 @@
-import { nanoid } from 'nanoid';
-import { EditorData, EditorInlineNodeType, Mention } from '$app/application/document/document.types';
-import { Element, Text } from 'slate';
-import { Op } from 'quill-delta';
-
-export function generateId() {
- return nanoid(10);
-}
-
-export function transformToInlineElement(op: Op): Element[] {
- const attributes = op.attributes;
-
- if (!attributes) return [];
- const { formula, mention, ...attrs } = attributes;
-
- if (formula) {
- const texts = (op.insert as string).split('');
-
- return texts.map((text) => {
- return {
- type: EditorInlineNodeType.Formula,
- data: formula,
- children: [
- {
- text,
- ...attrs,
- },
- ],
- };
- });
- }
-
- if (mention) {
- const texts = (op.insert as string).split('');
-
- return texts.map((text) => {
- return {
- type: EditorInlineNodeType.Mention,
- children: [
- {
- text,
- ...attrs,
- },
- ],
- data: {
- ...(mention as Mention),
- },
- };
- });
- }
-
- return [];
-}
-
-export function getInlinesWithDelta(delta?: Op[]): (Text | Element)[] {
- const newDelta: (Text | Element)[] = [];
-
- if (!delta || !delta.length)
- return [
- {
- text: '',
- },
- ];
-
- delta.forEach((op) => {
- const matchInlines = transformToInlineElement(op);
-
- if (matchInlines.length > 0) {
- newDelta.push(...matchInlines);
- return;
- }
-
- if (op.attributes) {
- if ('font_color' in op.attributes && op.attributes['font_color'] === '') {
- delete op.attributes['font_color'];
- }
-
- if ('bg_color' in op.attributes && op.attributes['bg_color'] === '') {
- delete op.attributes['bg_color'];
- }
-
- if ('code' in op.attributes && !op.attributes['code']) {
- delete op.attributes['code'];
- }
- }
-
- newDelta.push({
- text: op.insert as string,
- ...op.attributes,
- });
- });
-
- return newDelta;
-}
-
-export function convertToSlateValue(data: EditorData, includeRoot: boolean): Element[] {
- const traverse = (id: string, isRoot = false) => {
- const node = data.nodeMap[id];
- const delta = data.deltaMap[id];
-
- const slateNode: Element = {
- type: node.type,
- data: node.data,
- children: [],
- blockId: id,
- };
-
- const textNode: Element | null =
- !isRoot && node.externalId
- ? {
- type: 'text',
- children: [],
- textId: node.externalId,
- }
- : null;
-
- const inlineNodes = getInlinesWithDelta(delta);
-
- textNode?.children.push(...inlineNodes);
-
- const children = data.childrenMap[id];
-
- slateNode.children = children.map((childId) => traverse(childId));
- if (textNode) {
- slateNode.children.unshift(textNode);
- }
-
- return slateNode;
- };
-
- const rootId = data.rootId;
-
- const root = traverse(rootId, true);
-
- const nodes = root.children as Element[];
-
- if (includeRoot) {
- nodes.unshift({
- ...root,
- children: [
- {
- type: 'text',
- children: [
- {
- text: '',
- },
- ],
- },
- ],
- });
- }
-
- return nodes;
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/provider/utils/delta.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/provider/utils/delta.ts
deleted file mode 100644
index 630b6fbdf5..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/provider/utils/delta.ts
+++ /dev/null
@@ -1,54 +0,0 @@
-import { YDelta, YOp } from '$app/components/editor/provider/types/y_event';
-import { Op } from 'quill-delta';
-import * as Y from 'yjs';
-import { inlineNodeTypes } from '$app/application/document/document.types';
-import { DocEventPB } from '@/services/backend';
-
-export function YDelta2Delta(yDelta: YDelta): Op[] {
- const ops: Op[] = [];
-
- yDelta.forEach((op) => {
- if (op.insert instanceof Y.XmlText) {
- const type = op.insert.getAttribute('type');
-
- if (inlineNodeTypes.includes(type)) {
- ops.push(...YInlineOp2Op(op));
- return;
- }
- }
-
- ops.push(op as Op);
- });
- return ops;
-}
-
-export function YInlineOp2Op(yOp: YOp): Op[] {
- if (!(yOp.insert instanceof Y.XmlText)) {
- return [
- {
- insert: yOp.insert as string,
- attributes: yOp.attributes,
- },
- ];
- }
-
- const type = yOp.insert.getAttribute('type');
- const data = yOp.insert.getAttribute('data');
-
- const delta = yOp.insert.toDelta() as Op[];
-
- return delta.map((op) => ({
- insert: op.insert,
-
- attributes: {
- [type]: data,
- ...op.attributes,
- },
- }));
-}
-
-export function DocEvent2YDelta(events: DocEventPB): YDelta {
- if (!events.is_remote) return [];
-
- return [];
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/provider/utils/relation.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/provider/utils/relation.ts
deleted file mode 100644
index 72b2e126df..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/provider/utils/relation.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-import * as Y from 'yjs';
-
-export function getInsertTarget(root: Y.XmlText, path: (string | number)[]): Y.XmlText {
- const delta = root.toDelta();
- const index = path[0];
-
- const current = delta[index];
-
- if (current && current.insert instanceof Y.XmlText) {
- if (path.length === 1) {
- return current.insert;
- }
-
- return getInsertTarget(current.insert, path.slice(1));
- }
-
- return root;
-}
-
-export function getYTarget(doc: Y.Doc, path: (string | number)[]) {
- const sharedType = doc.get('sharedType', Y.XmlText) as Y.XmlText;
-
- return getInsertTarget(sharedType, path);
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/stores/block.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/stores/block.ts
deleted file mode 100644
index 00992964fb..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/stores/block.ts
+++ /dev/null
@@ -1,70 +0,0 @@
-import { createContext, useCallback, useContext, useMemo } from 'react';
-import { proxy, useSnapshot } from 'valtio';
-import { EditorNodeType } from '$app/application/document/document.types';
-
-export interface EditorBlockState {
- [EditorNodeType.ImageBlock]: {
- popoverOpen: boolean;
- blockId?: string;
- };
- [EditorNodeType.EquationBlock]: {
- popoverOpen: boolean;
- blockId?: string;
- };
-}
-
-const initialState = {
- [EditorNodeType.ImageBlock]: {
- popoverOpen: false,
- blockId: undefined,
- },
- [EditorNodeType.EquationBlock]: {
- popoverOpen: false,
- blockId: undefined,
- },
-};
-
-export const EditorBlockStateContext = createContext<EditorBlockState>(initialState);
-
-export const EditorBlockStateProvider = EditorBlockStateContext.Provider;
-
-export function useEditorInitialBlockState() {
- const state = useMemo(() => {
- return proxy({
- ...initialState,
- });
- }, []);
-
- return state;
-}
-
-export function useEditorBlockState(key: EditorNodeType.ImageBlock | EditorNodeType.EquationBlock) {
- const context = useContext(EditorBlockStateContext);
-
- return useSnapshot(context[key]);
-}
-
-export function useEditorBlockDispatch() {
- const context = useContext(EditorBlockStateContext);
-
- const openPopover = useCallback(
- (key: EditorNodeType.ImageBlock | EditorNodeType.EquationBlock, blockId: string) => {
- context[key].popoverOpen = true;
- context[key].blockId = blockId;
- },
- [context]
- );
-
- const closePopover = useCallback(
- (key: EditorNodeType.ImageBlock | EditorNodeType.EquationBlock) => {
- context[key].popoverOpen = false;
- context[key].blockId = undefined;
- },
- [context]
- );
-
- return {
- openPopover,
- closePopover,
- };
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/stores/decorate.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/stores/decorate.ts
deleted file mode 100644
index 078296aade..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/stores/decorate.ts
+++ /dev/null
@@ -1,89 +0,0 @@
-import { createContext, useCallback, useContext, useMemo } from 'react';
-import { BaseRange, Editor, NodeEntry, Range } from 'slate';
-import { proxySet } from 'valtio/utils';
-import { useSnapshot } from 'valtio';
-import { ReactEditor } from 'slate-react';
-
-export const DecorateStateContext = createContext<
- Set<{
- range: BaseRange;
- class_name: string;
- type?: 'link';
- }>
->(new Set());
-export const DecorateStateProvider = DecorateStateContext.Provider;
-
-export function useInitialDecorateState(editor: ReactEditor) {
- const decorateState = useMemo(
- () =>
- proxySet<{
- range: BaseRange;
- class_name: string;
- }>([]),
- []
- );
-
- const ranges = useSnapshot(decorateState);
-
- const decorate = useCallback(
- ([, path]: NodeEntry): BaseRange[] => {
- const highlightRanges: (Range & {
- class_name: string;
- })[] = [];
-
- ranges.forEach((state) => {
- const intersection = Range.intersection(state.range, Editor.range(editor, path));
-
- if (intersection) {
- highlightRanges.push({
- ...intersection,
- class_name: state.class_name,
- });
- }
- });
-
- return highlightRanges;
- },
- [editor, ranges]
- );
-
- return {
- decorate,
- decorateState,
- };
-}
-
-export function useDecorateState(type?: 'link') {
- const context = useContext(DecorateStateContext);
-
- const state = useSnapshot(context);
-
- return useMemo(() => {
- return Array.from(state).find((s) => !type || s.type === type);
- }, [state, type]);
-}
-
-export function useDecorateDispatch() {
- const context = useContext(DecorateStateContext);
-
- const getStaticState = useCallback(() => {
- return Array.from(context)[0];
- }, [context]);
-
- const add = useCallback(
- (state: { range: BaseRange; class_name: string; type?: 'link' }) => {
- context.add(state);
- },
- [context]
- );
-
- const clear = useCallback(() => {
- context.clear();
- }, [context]);
-
- return {
- add,
- clear,
- getStaticState,
- };
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/stores/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/stores/index.ts
deleted file mode 100644
index 22f0bb81be..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/stores/index.ts
+++ /dev/null
@@ -1,28 +0,0 @@
-import { ReactEditor } from 'slate-react';
-import { useInitialDecorateState } from '$app/components/editor/stores/decorate';
-import { useInitialSelectedBlocks } from '$app/components/editor/stores/selected';
-import { useInitialSlashState } from '$app/components/editor/stores/slash';
-import { useInitialEditorInlineBlockState } from '$app/components/editor/stores/inline_node';
-import { useEditorInitialBlockState } from '$app/components/editor/stores/block';
-
-export * from './decorate';
-export * from './selected';
-export * from './slash';
-export * from './inline_node';
-
-export function useInitialEditorState(editor: ReactEditor) {
- const { decorate, decorateState } = useInitialDecorateState(editor);
- const selectedBlocks = useInitialSelectedBlocks(editor);
- const slashState = useInitialSlashState();
- const inlineBlockState = useInitialEditorInlineBlockState();
- const blockState = useEditorInitialBlockState();
-
- return {
- selectedBlocks,
- decorate,
- decorateState,
- slashState,
- inlineBlockState,
- blockState,
- };
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/stores/inline_node.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/stores/inline_node.ts
deleted file mode 100644
index 6607a546d8..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/stores/inline_node.ts
+++ /dev/null
@@ -1,60 +0,0 @@
-import { createContext, useCallback, useContext, useMemo } from 'react';
-import { BaseRange, Path } from 'slate';
-import { proxy, useSnapshot } from 'valtio';
-
-export interface EditorInlineBlockState {
- formula: {
- popoverOpen: boolean;
- range?: BaseRange;
- };
-}
-const initialState = {
- formula: {
- popoverOpen: false,
- range: undefined,
- },
-};
-
-export const EditorInlineBlockStateContext = createContext<EditorInlineBlockState>(initialState);
-
-export const EditorInlineBlockStateProvider = EditorInlineBlockStateContext.Provider;
-
-export function useInitialEditorInlineBlockState() {
- const state = useMemo(() => {
- return proxy({
- ...initialState,
- });
- }, []);
-
- return state;
-}
-
-export function useEditorInlineBlockState(key: 'formula') {
- const context = useContext(EditorInlineBlockStateContext);
-
- const state = useSnapshot(context[key]);
-
- const openPopover = useCallback(() => {
- context[key].popoverOpen = true;
- }, [context, key]);
-
- const closePopover = useCallback(() => {
- context[key].popoverOpen = false;
- }, [context, key]);
-
- const setRange = useCallback(
- (at: BaseRange | Path) => {
- const range = Path.isPath(at) ? { anchor: at, focus: at } : at;
-
- context[key].range = range as BaseRange;
- },
- [context, key]
- );
-
- return {
- ...state,
- openPopover,
- closePopover,
- setRange,
- };
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/stores/selected.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/stores/selected.ts
deleted file mode 100644
index 803f474723..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/stores/selected.ts
+++ /dev/null
@@ -1,58 +0,0 @@
-import { createContext, useEffect, useMemo, useState } from 'react';
-import { proxySet, subscribeKey } from 'valtio/utils';
-import { ReactEditor } from 'slate-react';
-import { Element } from 'slate';
-
-export function useInitialSelectedBlocks(editor: ReactEditor) {
- const selectedBlocks = useMemo(() => proxySet([]), []);
- const [selectedLength, setSelectedLength] = useState(0);
-
- subscribeKey(selectedBlocks, 'size', (v) => setSelectedLength(v));
-
- useEffect(() => {
- const { onChange } = editor;
-
- const onKeydown = (e: KeyboardEvent) => {
- if (!ReactEditor.isFocused(editor) && selectedLength > 0) {
- e.preventDefault();
- e.stopPropagation();
- const selectedBlockId = selectedBlocks.values().next().value;
- const [selectedBlock] = editor.nodes({
- at: [],
- match: (n) => Element.isElement(n) && n.blockId === selectedBlockId,
- });
- const [, path] = selectedBlock;
-
- editor.select(path);
- ReactEditor.focus(editor);
- }
- };
-
- if (selectedLength > 0) {
- editor.onChange = (...args) => {
- const isSelectionChange = editor.operations.every((arg) => arg.type === 'set_selection');
-
- if (isSelectionChange) {
- selectedBlocks.clear();
- }
-
- onChange(...args);
- };
-
- document.addEventListener('keydown', onKeydown);
- } else {
- editor.onChange = onChange;
- document.removeEventListener('keydown', onKeydown);
- }
-
- return () => {
- editor.onChange = onChange;
- document.removeEventListener('keydown', onKeydown);
- };
- }, [editor, selectedBlocks, selectedLength]);
-
- return selectedBlocks;
-}
-
-export const EditorSelectedBlockContext = createContext<Set<string>>(new Set());
-export const EditorSelectedBlockProvider = EditorSelectedBlockContext.Provider;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/editor/stores/slash.ts b/frontend/appflowy_tauri/src/appflowy_app/components/editor/stores/slash.ts
deleted file mode 100644
index 13e9447d0c..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/editor/stores/slash.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-import { createContext, useCallback, useContext, useMemo } from 'react';
-import { proxyMap } from 'valtio/utils';
-import { useSnapshot } from 'valtio';
-
-export const SlashStateContext = createContext<Map<string, boolean>>(new Map());
-export const SlashStateProvider = SlashStateContext.Provider;
-
-export function useInitialSlashState() {
- const state = useMemo(() => proxyMap([['open', false]]), []);
-
- return state;
-}
-
-export function useSlashState() {
- const context = useContext(SlashStateContext);
- const state = useSnapshot(context);
- const open = state.get('open');
-
- const setOpen = useCallback(
- (open: boolean) => {
- context.set('open', open);
- },
- [context]
- );
-
- return {
- open,
- setOpen,
- };
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/error/Error.hooks.ts b/frontend/appflowy_tauri/src/appflowy_app/components/error/Error.hooks.ts
deleted file mode 100644
index ceaa5a51a0..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/error/Error.hooks.ts
+++ /dev/null
@@ -1,39 +0,0 @@
-import { useAppDispatch, useAppSelector } from '$app/stores/store';
-import { errorActions } from '$app_reducers/error/slice';
-import { useCallback, useEffect, useState } from 'react';
-
-export const useError = (e: Error) => {
- const dispatch = useAppDispatch();
- const error = useAppSelector((state) => state.error);
- const [errorMessage, setErrorMessage] = useState('');
- const [displayError, setDisplayError] = useState(false);
-
- useEffect(() => {
- setDisplayError(error.display);
- setErrorMessage(error.message);
- }, [error]);
-
- const showError = useCallback(
- (msg: string) => {
- dispatch(errorActions.showError(msg));
- },
- [dispatch]
- );
-
- useEffect(() => {
- if (e) {
- showError(e.message);
- }
- }, [e, showError]);
-
- const hideError = () => {
- dispatch(errorActions.hideError());
- };
-
- return {
- showError,
- hideError,
- errorMessage,
- displayError,
- };
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/error/ErrorHandlerPage.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/error/ErrorHandlerPage.tsx
deleted file mode 100644
index 1bb15f2ca3..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/error/ErrorHandlerPage.tsx
+++ /dev/null
@@ -1,8 +0,0 @@
-import { useError } from './Error.hooks';
-import { ErrorModal } from './ErrorModal';
-
-export const ErrorHandlerPage = ({ error }: { error: Error }) => {
- const { hideError, errorMessage, displayError } = useError(error);
-
- return displayError ? <ErrorModal message={errorMessage} onClose={hideError}></ErrorModal> : <></>;
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/error/ErrorModal.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/error/ErrorModal.tsx
deleted file mode 100644
index 6da2ee96d0..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/error/ErrorModal.tsx
+++ /dev/null
@@ -1,26 +0,0 @@
-import { ReactComponent as InformationSvg } from '$app/assets/information.svg';
-import { ReactComponent as CloseSvg } from '$app/assets/close.svg';
-
-export const ErrorModal = ({ message, onClose }: { message: string; onClose: () => void }) => {
- return (
- <div className={'fixed inset-0 z-10 flex items-center justify-center bg-white/30 backdrop-blur-sm'}>
- <div
- className={
- 'border-shade-5 relative flex flex-col items-center gap-8 rounded-xl border bg-white px-16 py-8 shadow-md'
- }
- >
- <button
- onClick={() => onClose()}
- className={'absolute right-0 top-0 z-10 px-2 py-2 text-text-caption hover:text-text-title'}
- >
- <CloseSvg className={'h-8 w-8'} />
- </button>
- <div className={'text-main-alert'}>
- <InformationSvg className={'h-24 w-24'} />
- </div>
- <h1 className={'text-xl'}>Oops.. something went wrong</h1>
- <h2>{message}</h2>
- </div>
- </div>
- );
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/index.ts
deleted file mode 100644
index cb0ff5c3b5..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export {};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/layout/FooterPanel.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/layout/FooterPanel.tsx
deleted file mode 100644
index 4f468f5461..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/layout/FooterPanel.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-export const FooterPanel = () => {
- return (
- <div className={'flex h-[48px] items-center justify-between px-2 py-2'}>
- <div className={'text-xs text-text-caption'}>
- &copy; 2024 AppFlowy. <a href={'https://github.com/AppFlowy-IO/AppFlowy'}>GitHub</a>
- </div>
- {/*<div>*/}
- {/* <button className={'h-8 w-8 rounded bg-content-blue-50 text-text-title hover:bg-content-blue-100'}>?</button>*/}
- {/*</div>*/}
- </div>
- );
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/layout/Layout.hooks.ts b/frontend/appflowy_tauri/src/appflowy_app/components/layout/Layout.hooks.ts
deleted file mode 100644
index 807c1e6811..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/layout/Layout.hooks.ts
+++ /dev/null
@@ -1,54 +0,0 @@
-import { useCallback } from 'react';
-import { createHotkey, HOT_KEY_NAME } from '$app/utils/hotkeys';
-import { useAppDispatch, useAppSelector } from '$app/stores/store';
-import { currentUserActions, ThemeMode } from '$app_reducers/current-user/slice';
-import { UserService } from '$app/application/user/user.service';
-import { sidebarActions } from '$app_reducers/sidebar/slice';
-
-export function useShortcuts() {
- const dispatch = useAppDispatch();
- const userSettingState = useAppSelector((state) => state.currentUser.userSetting);
- const { isDark } = userSettingState;
-
- const switchThemeMode = useCallback(() => {
- const newSetting = {
- themeMode: isDark ? ThemeMode.Light : ThemeMode.Dark,
- isDark: !isDark,
- };
-
- dispatch(currentUserActions.setUserSetting(newSetting));
- void UserService.setAppearanceSetting({
- theme_mode: newSetting.themeMode,
- });
- }, [dispatch, isDark]);
-
- const toggleSidebar = useCallback(() => {
- dispatch(sidebarActions.toggleCollapse());
- }, [dispatch]);
-
- return useCallback(
- (e: KeyboardEvent) => {
- switch (true) {
- /**
- * Toggle theme: Mod+L
- * Switch between light and dark theme
- */
- case createHotkey(HOT_KEY_NAME.TOGGLE_THEME)(e):
- switchThemeMode();
- break;
- /**
- * Toggle sidebar: Mod+. (period)
- * Prevent the default behavior of the browser (Exit full screen)
- * Collapse or expand the sidebar
- */
- case createHotkey(HOT_KEY_NAME.TOGGLE_SIDEBAR)(e):
- e.preventDefault();
- toggleSidebar();
- break;
- default:
- break;
- }
- },
- [toggleSidebar, switchThemeMode]
- );
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/layout/Layout.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/layout/Layout.tsx
deleted file mode 100644
index 509aa388cf..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/layout/Layout.tsx
+++ /dev/null
@@ -1,66 +0,0 @@
-import React, { ReactNode, useEffect, useMemo } from 'react';
-import SideBar from '$app/components/layout/side_bar/SideBar';
-import TopBar from '$app/components/layout/top_bar/TopBar';
-import { useAppSelector } from '$app/stores/store';
-import './layout.scss';
-import { AFScroller } from '../_shared/scroller';
-import { useNavigate } from 'react-router-dom';
-import { pageTypeMap } from '$app_reducers/pages/slice';
-import { useShortcuts } from '$app/components/layout/Layout.hooks';
-
-function Layout({ children }: { children: ReactNode }) {
- const { isCollapsed, width } = useAppSelector((state) => state.sidebar);
- const currentUser = useAppSelector((state) => state.currentUser);
- const navigate = useNavigate();
- const { id: latestOpenViewId, layout } = useMemo(
- () =>
- currentUser?.workspaceSetting?.latestView || {
- id: undefined,
- layout: undefined,
- },
- [currentUser?.workspaceSetting?.latestView]
- );
-
- const onKeyDown = useShortcuts();
-
- useEffect(() => {
- window.addEventListener('keydown', onKeyDown);
- return () => {
- window.removeEventListener('keydown', onKeyDown);
- };
- }, [onKeyDown]);
-
- useEffect(() => {
- if (latestOpenViewId) {
- const pageType = pageTypeMap[layout];
-
- navigate(`/page/${pageType}/${latestOpenViewId}`);
- }
- }, [latestOpenViewId, navigate, layout]);
- return (
- <>
- <div className='flex h-screen w-[100%] select-none text-sm text-text-title'>
- <SideBar />
- <div
- className='flex flex-1 select-none flex-col bg-bg-body'
- style={{
- width: isCollapsed ? '100%' : `calc(100% - ${width}px)`,
- }}
- >
- <TopBar />
- <AFScroller
- overflowXHidden
- style={{
- height: 'calc(100vh - 64px)',
- }}
- className={'appflowy-layout appflowy-scroll-container select-none'}
- >
- {children}
- </AFScroller>
- </div>
- </div>
- </>
- );
-}
-
-export default Layout;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/layout/bread_crumb/BreadCrumb.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/layout/bread_crumb/BreadCrumb.tsx
deleted file mode 100644
index ec9e990cdb..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/layout/bread_crumb/BreadCrumb.tsx
+++ /dev/null
@@ -1,64 +0,0 @@
-import React, { useCallback } from 'react';
-import { useLoadExpandedPages } from '$app/components/layout/bread_crumb/Breadcrumb.hooks';
-import Breadcrumbs from '@mui/material/Breadcrumbs';
-import Link from '@mui/material/Link';
-import Typography from '@mui/material/Typography';
-import { Page } from '$app_reducers/pages/slice';
-import { useTranslation } from 'react-i18next';
-import { getPageIcon } from '$app/hooks/page.hooks';
-import { useAppDispatch } from '$app/stores/store';
-import { openPage } from '$app_reducers/pages/async_actions';
-
-function Breadcrumb() {
- const { t } = useTranslation();
- const { isTrash, pagePath, currentPage } = useLoadExpandedPages();
- const dispatch = useAppDispatch();
-
- const navigateToPage = useCallback(
- (page: Page) => {
- void dispatch(openPage(page.id));
- },
- [dispatch]
- );
-
- if (!currentPage) {
- if (isTrash) {
- return <Typography className={'text-text-title'}>{t('trash.text')}</Typography>;
- }
-
- return null;
- }
-
- return (
- <Breadcrumbs aria-label='breadcrumb'>
- {pagePath?.map((page: Page, index) => {
- if (index === pagePath.length - 1) {
- return (
- <div key={page.id} className={'flex cursor-default select-none gap-1 text-text-title'}>
- <div>{getPageIcon(page)}</div>
- {page.name.trim() || t('menuAppHeader.defaultNewPageName')}
- </div>
- );
- }
-
- return (
- <Link
- key={page.id}
- className={'flex cursor-pointer select-none gap-1'}
- underline='hover'
- color='inherit'
- onClick={() => {
- navigateToPage(page);
- }}
- >
- <div>{getPageIcon(page)}</div>
-
- {page.name.trim() || t('menuAppHeader.defaultNewPageName')}
- </Link>
- );
- })}
- </Breadcrumbs>
- );
-}
-
-export default Breadcrumb;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/layout/bread_crumb/Breadcrumb.hooks.ts b/frontend/appflowy_tauri/src/appflowy_app/components/layout/bread_crumb/Breadcrumb.hooks.ts
deleted file mode 100644
index f2bec915d9..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/layout/bread_crumb/Breadcrumb.hooks.ts
+++ /dev/null
@@ -1,38 +0,0 @@
-import { useAppSelector } from '$app/stores/store';
-import { useMemo } from 'react';
-import { useParams, useLocation } from 'react-router-dom';
-import { Page } from '$app_reducers/pages/slice';
-
-export function useLoadExpandedPages() {
- const params = useParams();
- const location = useLocation();
- const isTrash = useMemo(() => location.pathname.includes('trash'), [location.pathname]);
- const currentPageId = params.id;
- const currentPage = useAppSelector((state) => (currentPageId ? state.pages.pageMap[currentPageId] : undefined));
-
- const pagePath = useAppSelector((state) => {
- const result: Page[] = [];
-
- if (!currentPage) return result;
-
- const findParent = (page: Page) => {
- if (!page.parentId) return;
- const parent = state.pages.pageMap[page.parentId];
-
- if (parent) {
- result.unshift(parent);
- findParent(parent);
- }
- };
-
- findParent(currentPage);
- result.push(currentPage);
- return result;
- });
-
- return {
- pagePath,
- currentPage,
- isTrash,
- };
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/layout/collapse_menu_button/CollapseMenuButton.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/layout/collapse_menu_button/CollapseMenuButton.tsx
deleted file mode 100644
index 87662a99bb..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/layout/collapse_menu_button/CollapseMenuButton.tsx
+++ /dev/null
@@ -1,37 +0,0 @@
-import React, { useCallback, useMemo } from 'react';
-import { IconButton, Tooltip } from '@mui/material';
-
-import { useAppDispatch, useAppSelector } from '$app/stores/store';
-import { sidebarActions } from '$app_reducers/sidebar/slice';
-import { ReactComponent as ShowMenuIcon } from '$app/assets/show-menu.svg';
-import { useTranslation } from 'react-i18next';
-import { createHotKeyLabel, HOT_KEY_NAME } from '$app/utils/hotkeys';
-
-function CollapseMenuButton() {
- const isCollapsed = useAppSelector((state) => state.sidebar.isCollapsed);
- const dispatch = useAppDispatch();
- const handleClick = useCallback(() => {
- dispatch(sidebarActions.toggleCollapse());
- }, [dispatch]);
-
- const { t } = useTranslation();
-
- const title = useMemo(() => {
- return (
- <div className={'flex flex-col gap-1 text-xs'}>
- <div>{isCollapsed ? t('sideBar.openSidebar') : t('sideBar.closeSidebar')}</div>
- <div>{createHotKeyLabel(HOT_KEY_NAME.TOGGLE_SIDEBAR)}</div>
- </div>
- );
- }, [isCollapsed, t]);
-
- return (
- <Tooltip title={title}>
- <IconButton size={'small'} className={'h-[20px] w-[20px] font-bold text-text-title'} onClick={handleClick}>
- <ShowMenuIcon className={`transform ${isCollapsed ? '' : 'rotate-180'}`} />
- </IconButton>
- </Tooltip>
- );
-}
-
-export default CollapseMenuButton;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/layout/layout.scss b/frontend/appflowy_tauri/src/appflowy_app/components/layout/layout.scss
deleted file mode 100644
index 43f4f55892..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/layout/layout.scss
+++ /dev/null
@@ -1,81 +0,0 @@
-
-
-.sketch-picker {
- background-color: var(--bg-body) !important;
- border-color: transparent !important;
- box-shadow: none !important;
-}
-.sketch-picker .flexbox-fix {
- border-color: var(--line-divider) !important;
-}
-.sketch-picker [id^='rc-editable-input'] {
- background-color: var(--bg-body) !important;
- border-color: var(--line-divider) !important;
- color: var(--text-title) !important;
- box-shadow: var(--line-border) 0px 0px 0px 1px inset !important;
-}
-
-.appflowy-date-picker-calendar {
- width: 100%;
-
-}
-
-.grid-sticky-header::-webkit-scrollbar {
- width: 0;
- height: 0;
-}
-.grid-scroll-container::-webkit-scrollbar {
- width: 0;
- height: 0;
-}
-
-
-.appflowy-scroll-container {
- &::-webkit-scrollbar {
- width: 0;
- }
-}
-
-.appflowy-scrollbar-thumb-horizontal, .appflowy-scrollbar-thumb-vertical {
- background-color: var(--scrollbar-thumb);
- border-radius: 4px;
- opacity: 60%;
-}
-
-.workspaces {
- ::-webkit-scrollbar {
- width: 0px;
- }
-}
-
-
-
-.MuiPopover-root, .MuiPaper-root {
- ::-webkit-scrollbar {
- width: 0;
- height: 0;
- }
-}
-
-.view-icon {
- &:hover {
- background-color: rgba(156, 156, 156, 0.20);
- }
-}
-
-.theme-mode-item {
- @apply relative flex h-[72px] w-[88px] cursor-pointer items-end justify-end rounded border hover:shadow;
- background: linear-gradient(150.74deg, rgba(231, 231, 231, 0) 17.95%, #C5C5C5 95.51%);
-}
-
-[data-dark-mode="true"] {
- .theme-mode-item {
- background: linear-gradient(150.74deg, rgba(128, 125, 125, 0) 17.95%, #4d4d4d 95.51%);
- }
-}
-
-.document-header {
- .view-banner {
- @apply items-center;
- }
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/layout/nested_page/AddButton.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/layout/nested_page/AddButton.tsx
deleted file mode 100644
index 1387f16f4d..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/layout/nested_page/AddButton.tsx
+++ /dev/null
@@ -1,65 +0,0 @@
-import React, { useCallback, useMemo } from 'react';
-import { ReactComponent as AddSvg } from '$app/assets/add.svg';
-import { useTranslation } from 'react-i18next';
-import { ReactComponent as DocumentSvg } from '$app/assets/document.svg';
-import { ReactComponent as GridSvg } from '$app/assets/grid.svg';
-import { ViewLayoutPB } from '@/services/backend';
-import OperationMenu from '$app/components/layout/nested_page/OperationMenu';
-
-function AddButton({
- isHovering,
- setHovering,
- onAddPage,
-}: {
- isHovering: boolean;
- setHovering: (hovering: boolean) => void;
- onAddPage: (layout: ViewLayoutPB) => void;
-}) {
- const { t } = useTranslation();
-
- const onConfirm = useCallback(
- (key: string) => {
- switch (key) {
- case 'document':
- onAddPage(ViewLayoutPB.Document);
- break;
- case 'grid':
- onAddPage(ViewLayoutPB.Grid);
- break;
- default:
- break;
- }
- },
- [onAddPage]
- );
-
- const options = useMemo(
- () => [
- {
- key: 'document',
- title: t('document.menuName'),
- icon: <DocumentSvg className={'h-4 w-4'} />,
- },
- {
- key: 'grid',
- title: t('grid.menuName'),
- icon: <GridSvg className={'h-4 w-4'} />,
- },
- ],
- [t]
- );
-
- return (
- <OperationMenu
- tooltip={t('menuAppHeader.addPageTooltip')}
- isHovering={isHovering}
- onConfirm={onConfirm}
- setHovering={setHovering}
- options={options}
- >
- <AddSvg />
- </OperationMenu>
- );
-}
-
-export default AddButton;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/layout/nested_page/DeleteDialog.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/layout/nested_page/DeleteDialog.tsx
deleted file mode 100644
index 4af8a2f2f1..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/layout/nested_page/DeleteDialog.tsx
+++ /dev/null
@@ -1,41 +0,0 @@
-import React from 'react';
-import { useTranslation } from 'react-i18next';
-import { ViewLayoutPB } from '@/services/backend';
-import DeleteConfirmDialog from '$app/components/_shared/confirm_dialog/DeleteConfirmDialog';
-
-function DeleteDialog({
- layout,
- open,
- onClose,
- onOk,
-}: {
- layout: ViewLayoutPB;
- open: boolean;
- onClose: () => void;
- onOk: () => Promise<void>;
-}) {
- const { t } = useTranslation();
-
- const pageType = {
- [ViewLayoutPB.Document]: t('document.menuName'),
- [ViewLayoutPB.Grid]: t('grid.menuName'),
- [ViewLayoutPB.Board]: t('board.menuName'),
- [ViewLayoutPB.Calendar]: t('calendar.menuName'),
- }[layout];
-
- return (
- <DeleteConfirmDialog
- open={open}
- title={t('views.deleteContentTitle', {
- pageType,
- })}
- subtitle={t('views.deleteContentCaption', {
- pageType,
- })}
- onOk={onOk}
- onClose={onClose}
- />
- );
-}
-
-export default DeleteDialog;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/layout/nested_page/MoreButton.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/layout/nested_page/MoreButton.tsx
deleted file mode 100644
index 94a86655ac..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/layout/nested_page/MoreButton.tsx
+++ /dev/null
@@ -1,130 +0,0 @@
-import React, { useCallback, useMemo, useState } from 'react';
-import { useTranslation } from 'react-i18next';
-
-import { ReactComponent as DetailsSvg } from '$app/assets/details.svg';
-import { ReactComponent as EditSvg } from '$app/assets/edit.svg';
-import { ReactComponent as CopySvg } from '$app/assets/copy.svg';
-import { ReactComponent as TrashSvg } from '$app/assets/delete.svg';
-
-import RenameDialog from '../../_shared/confirm_dialog/RenameDialog';
-import { Page } from '$app_reducers/pages/slice';
-import DeleteDialog from '$app/components/layout/nested_page/DeleteDialog';
-import OperationMenu from '$app/components/layout/nested_page/OperationMenu';
-import { getModifier } from '$app/utils/hotkeys';
-import isHotkey from 'is-hotkey';
-
-function MoreButton({
- onDelete,
- onDuplicate,
- onRename,
- page,
- isHovering,
- setHovering,
-}: {
- isHovering: boolean;
- setHovering: (hovering: boolean) => void;
- onDelete: () => Promise<void>;
- onDuplicate: () => Promise<void>;
- onRename: (newName: string) => Promise<void>;
- page: Page;
-}) {
- const [renameDialogOpen, setRenameDialogOpen] = useState(false);
- const [deleteDialogOpen, setDeleteDialogOpen] = useState(false);
-
- const { t } = useTranslation();
-
- const onConfirm = useCallback(
- (key: string) => {
- switch (key) {
- case 'rename':
- setRenameDialogOpen(true);
- break;
- case 'delete':
- setDeleteDialogOpen(true);
- break;
- case 'duplicate':
- void onDuplicate();
-
- break;
- default:
- break;
- }
- },
- [onDuplicate]
- );
-
- const options = useMemo(
- () => [
- {
- title: t('button.rename'),
- icon: <EditSvg className={'h-4 w-4'} />,
- key: 'rename',
- },
- {
- key: 'delete',
- title: t('button.delete'),
- icon: <TrashSvg className={'h-4 w-4'} />,
- caption: 'Del',
- },
- {
- key: 'duplicate',
- title: t('button.duplicate'),
- icon: <CopySvg className={'h-4 w-4'} />,
- caption: `${getModifier()}+D`,
- },
- ],
- [t]
- );
-
- const onKeyDown = useCallback(
- (e: KeyboardEvent) => {
- if (isHotkey('del', e) || isHotkey('backspace', e)) {
- e.preventDefault();
- e.stopPropagation();
- onConfirm('delete');
- return;
- }
-
- if (isHotkey('mod+d', e)) {
- e.stopPropagation();
- onConfirm('duplicate');
- return;
- }
- },
- [onConfirm]
- );
-
- return (
- <>
- <OperationMenu
- tooltip={t('menuAppHeader.moreButtonToolTip')}
- isHovering={isHovering}
- setHovering={setHovering}
- onConfirm={onConfirm}
- options={options}
- onKeyDown={onKeyDown}
- >
- <DetailsSvg />
- </OperationMenu>
-
- <DeleteDialog
- layout={page.layout}
- open={deleteDialogOpen}
- onClose={() => {
- setDeleteDialogOpen(false);
- }}
- onOk={onDelete}
- />
- {renameDialogOpen && (
- <RenameDialog
- defaultValue={page.name}
- open={renameDialogOpen}
- onClose={() => setRenameDialogOpen(false)}
- onOk={onRename}
- />
- )}
- </>
- );
-}
-
-export default MoreButton;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/layout/nested_page/NestedPage.hooks.ts b/frontend/appflowy_tauri/src/appflowy_app/components/layout/nested_page/NestedPage.hooks.ts
deleted file mode 100644
index d43499e801..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/layout/nested_page/NestedPage.hooks.ts
+++ /dev/null
@@ -1,147 +0,0 @@
-import { useCallback, useEffect } from 'react';
-import { pagesActions, parserViewPBToPage } from '$app_reducers/pages/slice';
-import { useAppDispatch, useAppSelector } from '$app/stores/store';
-import { FolderNotification, ViewLayoutPB } from '@/services/backend';
-import { useParams } from 'react-router-dom';
-import { openPage, updatePageName } from '$app_reducers/pages/async_actions';
-import { createPage, deletePage, duplicatePage, getChildPages } from '$app/application/folder/page.service';
-import { subscribeNotifications } from '$app/application/notification';
-
-export function useLoadChildPages(pageId: string) {
- const dispatch = useAppDispatch();
- const childPages = useAppSelector((state) => state.pages.relationMap[pageId]);
- const collapsed = useAppSelector((state) => !state.pages.expandedIdMap[pageId]);
- const toggleCollapsed = useCallback(() => {
- if (collapsed) {
- dispatch(pagesActions.expandPage(pageId));
- } else {
- dispatch(pagesActions.collapsePage(pageId));
- }
- }, [dispatch, pageId, collapsed]);
-
- const loadPageChildren = useCallback(
- async (pageId: string) => {
- const childPages = await getChildPages(pageId);
-
- dispatch(
- pagesActions.addChildPages({
- id: pageId,
- childPages,
- })
- );
- },
- [dispatch]
- );
-
- useEffect(() => {
- void loadPageChildren(pageId);
- }, [loadPageChildren, pageId]);
-
- useEffect(() => {
- const unsubscribePromise = subscribeNotifications(
- {
- [FolderNotification.DidUpdateView]: async (payload) => {
- const childViews = payload.child_views;
-
- if (childViews.length === 0) {
- return;
- }
-
- dispatch(
- pagesActions.addChildPages({
- id: pageId,
- childPages: childViews.map(parserViewPBToPage),
- })
- );
- },
- [FolderNotification.DidUpdateChildViews]: async (payload) => {
- if (payload.delete_child_views.length === 0 && payload.create_child_views.length === 0) {
- return;
- }
-
- void loadPageChildren(pageId);
- },
- },
- {
- id: pageId,
- }
- );
-
- return () => void unsubscribePromise.then((unsubscribe) => unsubscribe());
- }, [pageId, loadPageChildren, dispatch]);
-
- return {
- toggleCollapsed,
- collapsed,
- childPages,
- };
-}
-
-export function usePageActions(pageId: string) {
- const page = useAppSelector((state) => state.pages.pageMap[pageId]);
- const dispatch = useAppDispatch();
- const params = useParams();
- const currentPageId = params.id;
-
- const onPageClick = useCallback(() => {
- void dispatch(openPage(pageId));
- }, [dispatch, pageId]);
-
- const onAddPage = useCallback(
- async (layout: ViewLayoutPB) => {
- const newViewId = await createPage({
- layout,
- name: '',
- parent_view_id: pageId,
- });
-
- dispatch(
- pagesActions.addPage({
- page: {
- id: newViewId,
- parentId: pageId,
- layout,
- name: '',
- },
- isLast: true,
- })
- );
-
- dispatch(pagesActions.expandPage(pageId));
- await dispatch(openPage(newViewId));
- },
- [dispatch, pageId]
- );
-
- const onDeletePage = useCallback(async () => {
- if (currentPageId === pageId) {
- dispatch(pagesActions.setTrashSnackbar(true));
- }
-
- await deletePage(pageId);
- dispatch(pagesActions.deletePages([pageId]));
- }, [dispatch, pageId, currentPageId]);
-
- const onDuplicatePage = useCallback(async () => {
- await duplicatePage(page);
- }, [page]);
-
- const onRenamePage = useCallback(
- async (name: string) => {
- await dispatch(updatePageName({ id: pageId, name }));
- },
- [dispatch, pageId]
- );
-
- return {
- onAddPage,
- onPageClick,
- onRenamePage,
- onDeletePage,
- onDuplicatePage,
- };
-}
-
-export function useSelectedPage(pageId: string) {
- return useParams().id === pageId;
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/layout/nested_page/NestedPage.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/layout/nested_page/NestedPage.tsx
deleted file mode 100644
index e423f05517..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/layout/nested_page/NestedPage.tsx
+++ /dev/null
@@ -1,126 +0,0 @@
-import React, { useCallback, useMemo } from 'react';
-import Collapse from '@mui/material/Collapse';
-import { TransitionGroup } from 'react-transition-group';
-import NestedPageTitle from '$app/components/layout/nested_page/NestedPageTitle';
-import { useLoadChildPages, usePageActions } from '$app/components/layout/nested_page/NestedPage.hooks';
-import { useDrag } from 'src/appflowy_app/components/_shared/drag_block';
-import { useAppDispatch, useAppSelector } from '$app/stores/store';
-import { movePageThunk } from '$app_reducers/pages/async_actions';
-import { ViewLayoutPB } from '@/services/backend';
-
-function NestedPage({ pageId }: { pageId: string }) {
- const { toggleCollapsed, collapsed, childPages } = useLoadChildPages(pageId);
- const { onAddPage, onPageClick, onDeletePage, onDuplicatePage, onRenamePage } = usePageActions(pageId);
- const dispatch = useAppDispatch();
- const { page, parentLayout } = useAppSelector((state) => {
- const page = state.pages.pageMap[pageId];
- const parent = state.pages.pageMap[page?.parentId || ''];
-
- return {
- page,
- parentLayout: parent?.layout,
- };
- });
-
- const disableChildren = useAppSelector((state) => {
- if (!page) return true;
- const layout = state.pages.pageMap[page.parentId]?.layout;
-
- return !(layout === undefined || layout === ViewLayoutPB.Document);
- });
- const children = useMemo(() => {
- if (disableChildren) {
- return [];
- }
-
- return collapsed ? [] : childPages;
- }, [collapsed, childPages, disableChildren]);
-
- const onDragFinished = useCallback(
- (result: { dragId: string; position: 'before' | 'after' | 'inside' }) => {
- const { dragId, position } = result;
-
- if (dragId === pageId) return;
- if (position === 'inside' && page?.layout !== ViewLayoutPB.Document) return;
- void dispatch(
- movePageThunk({
- sourceId: dragId,
- targetId: pageId,
- insertType: position,
- })
- );
- },
- [dispatch, page?.layout, pageId]
- );
-
- const { onDrop, dropPosition, onDragOver, onDragLeave, onDragStart, onDragEnd, isDraggingOver, isDragging } = useDrag({
- onEnd: onDragFinished,
- dragId: pageId,
- });
-
- const className = useMemo(() => {
- const defaultClassName = 'relative flex-1 select-none flex flex-col w-full';
-
- if (isDragging) {
- return `${defaultClassName} opacity-40`;
- }
-
- if (isDraggingOver && dropPosition === 'inside' && page?.layout === ViewLayoutPB.Document) {
- if (dropPosition === 'inside') {
- return `${defaultClassName} bg-content-blue-100`;
- }
- } else {
- return defaultClassName;
- }
- }, [dropPosition, isDragging, isDraggingOver, page?.layout]);
-
- // Only allow dragging if the parent layout is undefined or a document
- const draggable = parentLayout === undefined || parentLayout === ViewLayoutPB.Document;
-
- return (
- <div
- className={className}
- onDragLeave={onDragLeave}
- onDragStart={onDragStart}
- onDragOver={onDragOver}
- onDragEnd={onDragEnd}
- onDrop={onDrop}
- draggable={draggable}
- data-drop-enabled={page?.layout === ViewLayoutPB.Document}
- data-dragging={isDragging}
- data-page-id={pageId}
- >
- <div
- style={{
- height: dropPosition === 'before' || dropPosition === 'after' ? '2px' : '0px',
- top: dropPosition === 'before' ? '-2px' : 'auto',
- bottom: dropPosition === 'after' ? '-2px' : 'auto',
- }}
- className={'pointer-events-none absolute left-0 z-10 w-full bg-content-blue-300'}
- />
- <NestedPageTitle
- onClick={() => {
- onPageClick();
- }}
- onAddPage={onAddPage}
- onDuplicate={onDuplicatePage}
- onDelete={onDeletePage}
- onRename={onRenamePage}
- collapsed={collapsed}
- toggleCollapsed={toggleCollapsed}
- pageId={pageId}
- />
- <div className={'pl-4 pt-[2px]'}>
- <TransitionGroup>
- {children?.map((pageId) => (
- <Collapse key={pageId}>
- <NestedPage key={pageId} pageId={pageId} />
- </Collapse>
- ))}
- </TransitionGroup>
- </div>
- </div>
- );
-}
-
-export default React.memo(NestedPage);
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/layout/nested_page/NestedPageTitle.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/layout/nested_page/NestedPageTitle.tsx
deleted file mode 100644
index 948aedcae2..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/layout/nested_page/NestedPageTitle.tsx
+++ /dev/null
@@ -1,102 +0,0 @@
-import React, { useMemo, useState } from 'react';
-import { useAppSelector } from '$app/stores/store';
-import AddButton from './AddButton';
-import MoreButton from './MoreButton';
-import { ViewLayoutPB } from '@/services/backend';
-import { useSelectedPage } from '$app/components/layout/nested_page/NestedPage.hooks';
-import { useTranslation } from 'react-i18next';
-import { ReactComponent as MoreIcon } from '$app/assets/more.svg';
-import { IconButton } from '@mui/material';
-import { Page } from '$app_reducers/pages/slice';
-import { getPageIcon } from '$app/hooks/page.hooks';
-
-function NestedPageTitle({
- pageId,
- collapsed,
- toggleCollapsed,
- onAddPage,
- onClick,
- onDelete,
- onDuplicate,
- onRename,
-}: {
- pageId: string;
- collapsed: boolean;
- toggleCollapsed: () => void;
- onAddPage: (layout: ViewLayoutPB) => void;
- onClick: () => void;
- onDelete: () => Promise<void>;
- onDuplicate: () => Promise<void>;
- onRename: (newName: string) => Promise<void>;
-}) {
- const { t } = useTranslation();
- const page = useAppSelector((state) => {
- return state.pages.pageMap[pageId] as Page | undefined;
- });
- const disableChildren = useAppSelector((state) => {
- if (!page) return true;
- const layout = state.pages.pageMap[page.parentId]?.layout;
-
- return !(layout === undefined || layout === ViewLayoutPB.Document);
- });
-
- const [isHovering, setIsHovering] = useState(false);
- const isSelected = useSelectedPage(pageId);
-
- const pageIcon = useMemo(() => (page ? getPageIcon(page) : null), [page]);
-
- return (
- <div
- className={`my-0.5 cursor-pointer rounded-lg bg-opacity-40 p-0.5 ${isHovering ? 'bg-fill-list-hover' : ''} ${
- isSelected ? 'bg-fill-list-active' : ''
- }`}
- onClick={onClick}
- onMouseMove={() => setIsHovering(true)}
- onMouseLeave={() => setIsHovering(false)}
- >
- <div className={'flex h-6 w-[100%] items-center justify-between'}>
- <div className={'flex flex-1 items-center justify-start gap-1 overflow-hidden'}>
- {disableChildren ? (
- <div className={'mx-2 h-1 w-1 rounded-full bg-text-title'} />
- ) : (
- <IconButton
- size={'small'}
- onClick={(e) => {
- e.stopPropagation();
- toggleCollapsed();
- }}
- style={{
- transform: collapsed ? 'rotate(0deg)' : 'rotate(90deg)',
- }}
- >
- <MoreIcon className={'h-4 w-4 text-text-title'} />
- </IconButton>
- )}
-
- {pageIcon}
-
- <div className={'flex-1 overflow-hidden text-ellipsis whitespace-nowrap'}>
- {page?.name.trim() || t('menuAppHeader.defaultNewPageName')}
- </div>
- </div>
- <div onClick={(e) => e.stopPropagation()} className={'min:w-14 flex items-center justify-end px-2'}>
- {page?.layout === ViewLayoutPB.Document && (
- <AddButton setHovering={setIsHovering} isHovering={isHovering} onAddPage={onAddPage} />
- )}
- {page && (
- <MoreButton
- setHovering={setIsHovering}
- isHovering={isHovering}
- page={page}
- onDelete={onDelete}
- onDuplicate={onDuplicate}
- onRename={onRename}
- />
- )}
- </div>
- </div>
- </div>
- );
-}
-
-export default NestedPageTitle;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/layout/nested_page/OperationMenu.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/layout/nested_page/OperationMenu.tsx
deleted file mode 100644
index cef1d3307c..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/layout/nested_page/OperationMenu.tsx
+++ /dev/null
@@ -1,103 +0,0 @@
-import React, { ReactNode, useCallback, useMemo, useState } from 'react';
-import { IconButton } from '@mui/material';
-import Popover from '@mui/material/Popover';
-import KeyboardNavigation from '$app/components/_shared/keyboard_navigation/KeyboardNavigation';
-import Tooltip from '@mui/material/Tooltip';
-
-function OperationMenu({
- options,
- onConfirm,
- isHovering,
- setHovering,
- children,
- tooltip,
- onKeyDown,
-}: {
- isHovering: boolean;
- setHovering: (hovering: boolean) => void;
- options: {
- key: string;
- title: string;
- icon: React.ReactNode;
- caption?: string;
- }[];
- children: React.ReactNode;
- onConfirm: (key: string) => void;
- tooltip: string;
- onKeyDown?: (e: KeyboardEvent) => void;
-}) {
- const [anchorEl, setAnchorEl] = useState<HTMLButtonElement | null>(null);
- const renderItem = useCallback((title: string, icon: ReactNode, caption?: string) => {
- return (
- <div className={'flex w-full items-center justify-between gap-2 px-1 font-medium'}>
- {icon}
- <div className={'flex-1'}>{title}</div>
- <div className={'text-right text-text-caption'}>{caption || ''}</div>
- </div>
- );
- }, []);
-
- const handleClose = useCallback(() => {
- setAnchorEl(null);
- setHovering(false);
- }, [setHovering]);
-
- const optionList = useMemo(() => {
- return options.map((option) => {
- return {
- key: option.key,
- content: renderItem(option.title, option.icon, option.caption),
- };
- });
- }, [options, renderItem]);
-
- const open = Boolean(anchorEl);
-
- const handleConfirm = useCallback(
- (key: string) => {
- onConfirm(key);
- handleClose();
- },
- [handleClose, onConfirm]
- );
-
- return (
- <>
- <Tooltip disableInteractive={true} title={tooltip}>
- <IconButton
- size={'small'}
- onClick={(e) => {
- setAnchorEl(e.currentTarget);
- }}
- className={`${!isHovering ? 'invisible' : ''} text-icon-primary`}
- >
- {children}
- </IconButton>
- </Tooltip>
-
- <Popover
- onClose={handleClose}
- open={open}
- anchorEl={anchorEl}
- disableRestoreFocus={true}
- keepMounted={false}
- PaperProps={{
- className: 'py-2',
- }}
- anchorOrigin={{
- vertical: 'bottom',
- horizontal: 'left',
- }}
- >
- <KeyboardNavigation
- onKeyDown={onKeyDown}
- onEscape={handleClose}
- options={optionList}
- onConfirm={handleConfirm}
- />
- </Popover>
- </>
- );
-}
-
-export default OperationMenu;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/layout/share/Share.hooks.ts b/frontend/appflowy_tauri/src/appflowy_app/components/layout/share/Share.hooks.ts
deleted file mode 100644
index b281706848..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/layout/share/Share.hooks.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import { useParams } from 'react-router-dom';
-
-export function useShareConfig() {
- const params = useParams();
- const id = params.id;
-
- const showShareButton = !!id;
-
- return {
- showShareButton,
- };
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/layout/share/Share.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/layout/share/Share.tsx
deleted file mode 100644
index 1a10cb08e6..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/layout/share/Share.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import React from 'react';
-import { useTranslation } from 'react-i18next';
-import Button from '@mui/material/Button';
-import { useShareConfig } from '$app/components/layout/share/Share.hooks';
-
-function ShareButton() {
- const { showShareButton } = useShareConfig();
- const { t } = useTranslation();
-
- if (!showShareButton) return null;
- return <Button variant={'contained'}>{t('shareAction.buttonText')}</Button>;
-}
-
-export default ShareButton;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/layout/side_bar/Resizer.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/layout/side_bar/Resizer.tsx
deleted file mode 100644
index 639d5283e0..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/layout/side_bar/Resizer.tsx
+++ /dev/null
@@ -1,55 +0,0 @@
-import React, { useCallback, useRef } from 'react';
-import { useAppDispatch, useAppSelector } from '$app/stores/store';
-import { sidebarActions } from '$app_reducers/sidebar/slice';
-
-const minSidebarWidth = 200;
-
-function Resizer() {
- const dispatch = useAppDispatch();
- const width = useAppSelector((state) => state.sidebar.width);
- const startX = useRef(0);
- const onResize = useCallback(
- (e: MouseEvent) => {
- e.preventDefault();
- const diff = e.clientX - startX.current;
- const newWidth = width + diff;
-
- if (newWidth < minSidebarWidth) {
- return;
- }
-
- dispatch(sidebarActions.changeWidth(newWidth));
- },
- [dispatch, width]
- );
-
- const onResizeEnd = useCallback(() => {
- dispatch(sidebarActions.stopResizing());
- document.removeEventListener('mousemove', onResize);
- document.removeEventListener('mouseup', onResizeEnd);
- }, [onResize, dispatch]);
-
- const onResizeStart = useCallback(
- (e: React.MouseEvent) => {
- startX.current = e.clientX;
- dispatch(sidebarActions.startResizing());
- document.addEventListener('mousemove', onResize);
- document.addEventListener('mouseup', onResizeEnd);
- },
- [onResize, onResizeEnd, dispatch]
- );
-
- return (
- <div
- onMouseDown={onResizeStart}
- style={{
- left: `${width - 4}px`,
- }}
- className={'fixed top-0 z-10 h-screen cursor-col-resize'}
- >
- <div className={'h-full w-2 select-none bg-transparent'}></div>
- </div>
- );
-}
-
-export default React.memo(Resizer);
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/layout/side_bar/SideBar.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/layout/side_bar/SideBar.tsx
deleted file mode 100644
index 5cdbfb125b..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/layout/side_bar/SideBar.tsx
+++ /dev/null
@@ -1,73 +0,0 @@
-import React, { useEffect, useRef } from 'react';
-import { useAppDispatch, useAppSelector } from '$app/stores/store';
-import { ReactComponent as AppflowyLogoDark } from '$app/assets/dark-logo.svg';
-import { ReactComponent as AppflowyLogoLight } from '$app/assets/light-logo.svg';
-import CollapseMenuButton from '$app/components/layout/collapse_menu_button/CollapseMenuButton';
-import Resizer from '$app/components/layout/side_bar/Resizer';
-import UserInfo from '$app/components/layout/side_bar/UserInfo';
-import WorkspaceManager from '$app/components/layout/workspace_manager/WorkspaceManager';
-import { ThemeMode } from '$app_reducers/current-user/slice';
-import { sidebarActions } from '$app_reducers/sidebar/slice';
-
-function SideBar() {
- const { isCollapsed, width, isResizing } = useAppSelector((state) => state.sidebar);
- const dispatch = useAppDispatch();
-
- const themeMode = useAppSelector((state) => state.currentUser?.userSetting?.themeMode);
- const isDark =
- themeMode === ThemeMode.Dark ||
- (themeMode === ThemeMode.System && window.matchMedia('(prefers-color-scheme: dark)').matches);
-
- const lastCollapsedRef = useRef(isCollapsed);
-
- useEffect(() => {
- const handleResize = () => {
- const width = window.innerWidth;
-
- if (width <= 800 && !isCollapsed) {
- lastCollapsedRef.current = false;
- dispatch(sidebarActions.setCollapse(true));
- } else if (width > 800 && !lastCollapsedRef.current) {
- lastCollapsedRef.current = true;
- dispatch(sidebarActions.setCollapse(false));
- }
- };
-
- window.addEventListener('resize', handleResize);
-
- return () => {
- window.removeEventListener('resize', handleResize);
- };
- }, [dispatch, isCollapsed]);
- return (
- <>
- <div
- style={{
- width: isCollapsed ? 0 : width,
- transition: isResizing ? 'none' : 'width 350ms ease',
- }}
- className={'relative h-screen overflow-hidden'}
- >
- <div className={'flex h-[100vh] flex-col overflow-hidden border-r border-line-divider bg-bg-base'}>
- <div className={'flex h-[64px] justify-between px-4 py-5'}>
- {isDark ? (
- <AppflowyLogoDark className={'h-6 w-[103px]'} />
- ) : (
- <AppflowyLogoLight className={'h-6 w-[103px]'} />
- )}
- <CollapseMenuButton />
- </div>
- <div className={'flex h-[36px] items-center'}>
- <UserInfo />
- </div>
- <div className={'flex-1 overflow-hidden'}>
- <WorkspaceManager />
- </div>
- </div>
- </div>
- <Resizer />
- </>
- );
-}
-
-export default SideBar;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/layout/side_bar/UserInfo.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/layout/side_bar/UserInfo.tsx
deleted file mode 100644
index 62763c670e..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/layout/side_bar/UserInfo.tsx
+++ /dev/null
@@ -1,41 +0,0 @@
-import React, { useState } from 'react';
-import { useAppSelector } from '$app/stores/store';
-import { IconButton } from '@mui/material';
-import { ReactComponent as SettingIcon } from '$app/assets/settings.svg';
-import Tooltip from '@mui/material/Tooltip';
-import { useTranslation } from 'react-i18next';
-import { SettingsDialog } from '$app/components/settings/SettingsDialog';
-import { ProfileAvatar } from '$app/components/_shared/avatar';
-
-function UserInfo() {
- const currentUser = useAppSelector((state) => state.currentUser);
- const [showUserSetting, setShowUserSetting] = useState(false);
-
- const { t } = useTranslation();
-
- return (
- <>
- <div className={'flex w-full cursor-pointer select-none items-center justify-between px-4 text-text-title'}>
- <div className={'flex w-full flex-1 items-center gap-2'}>
- <ProfileAvatar width={26} height={26} />
- <span className={'flex-1 text-xs font-semibold'}>{currentUser.displayName}</span>
- </div>
-
- <Tooltip disableInteractive={true} title={t('settings.menu.open')}>
- <IconButton
- size={'small'}
- onClick={() => {
- setShowUserSetting(!showUserSetting);
- }}
- >
- <SettingIcon className={'text-text-title'} />
- </IconButton>
- </Tooltip>
- </div>
-
- {showUserSetting && <SettingsDialog open={showUserSetting} onClose={() => setShowUserSetting(false)} />}
- </>
- );
-}
-
-export default UserInfo;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/layout/top_bar/DeletePageSnackbar.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/layout/top_bar/DeletePageSnackbar.tsx
deleted file mode 100644
index f5638362b9..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/layout/top_bar/DeletePageSnackbar.tsx
+++ /dev/null
@@ -1,104 +0,0 @@
-import React, { useEffect } from 'react';
-import { Alert, Snackbar } from '@mui/material';
-import { useAppDispatch, useAppSelector } from '$app/stores/store';
-import { useParams } from 'react-router-dom';
-import { pagesActions } from '$app_reducers/pages/slice';
-import Slide, { SlideProps } from '@mui/material/Slide';
-import { useTranslation } from 'react-i18next';
-import Button from '@mui/material/Button';
-import { useTrashActions } from '$app/components/trash/Trash.hooks';
-import { openPage } from '$app_reducers/pages/async_actions';
-
-function SlideTransition(props: SlideProps) {
- return <Slide {...props} direction='down' />;
-}
-
-function DeletePageSnackbar() {
- const firstViewId = useAppSelector((state) => {
- const workspaceId = state.workspace.currentWorkspaceId;
- const children = workspaceId ? state.pages.relationMap[workspaceId] : undefined;
-
- if (!children) return null;
-
- return children[0];
- });
-
- const showTrashSnackbar = useAppSelector((state) => state.pages.showTrashSnackbar);
- const dispatch = useAppDispatch();
- const { onPutback, onDelete } = useTrashActions();
- const { id } = useParams();
-
- const { t } = useTranslation();
-
- useEffect(() => {
- dispatch(pagesActions.setTrashSnackbar(false));
- // eslint-disable-next-line react-hooks/exhaustive-deps
- }, [id]);
-
- const handleBack = () => {
- if (firstViewId) {
- void dispatch(openPage(firstViewId));
- }
- };
-
- const handleClose = (toBack = true) => {
- dispatch(pagesActions.setTrashSnackbar(false));
- if (toBack) {
- handleBack();
- }
- };
-
- const handleRestore = () => {
- if (!id) return;
- void onPutback(id);
- handleClose(false);
- };
-
- const handleDelete = () => {
- if (!id) return;
- void onDelete([id]);
-
- if (!firstViewId) {
- handleClose(false);
- return;
- }
-
- handleBack();
- };
-
- return (
- <Snackbar
- anchorOrigin={{
- vertical: 'top',
- horizontal: 'center',
- }}
- open={showTrashSnackbar}
- TransitionComponent={SlideTransition}
- >
- <Alert
- className={'flex items-center'}
- onClose={() => handleClose()}
- severity='info'
- variant='standard'
- sx={{
- width: '100%',
- '.MuiAlert-action': {
- padding: 0,
- },
- }}
- >
- <div className={'flex h-full w-full items-center justify-center gap-3'}>
- <span>{t('deletePagePrompt.text')}</span>
- <Button onClick={handleRestore} size={'small'} color={'primary'} variant={'text'}>
- {t('deletePagePrompt.restore')}
- </Button>
- <Button onClick={handleDelete} size={'small'} color={'error'} variant={'text'}>
- {t('deletePagePrompt.deletePermanent')}
- </Button>
- </div>
- </Alert>
- </Snackbar>
- );
-}
-
-export default DeletePageSnackbar;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/layout/top_bar/FontSizeConfig.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/layout/top_bar/FontSizeConfig.tsx
deleted file mode 100644
index 4b439cc3fb..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/layout/top_bar/FontSizeConfig.tsx
+++ /dev/null
@@ -1,26 +0,0 @@
-import React from 'react';
-import { useTranslation } from 'react-i18next';
-import { ButtonGroup, Divider } from '@mui/material';
-import Button from '@mui/material/Button';
-
-function FontSizeConfig() {
- const { t } = useTranslation();
-
- return (
- <>
- <div className={'flex flex-col justify-center p-4'}>
- <div className={'py-2 text-sm text-text-caption'}>{t('moreAction.fontSize')}</div>
- <div className={'flex items-center justify-around pt-2'}>
- <ButtonGroup variant='text' color={'inherit'}>
- <Button>{t('moreAction.small')}</Button>
- <Button color={'primary'}>{t('moreAction.medium')}</Button>
- <Button>{t('moreAction.large')}</Button>
- </ButtonGroup>
- </div>
- </div>
- <Divider />
- </>
- );
-}
-
-export default FontSizeConfig;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/layout/top_bar/MoreButton.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/layout/top_bar/MoreButton.tsx
deleted file mode 100644
index d37d1bf060..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/layout/top_bar/MoreButton.tsx
+++ /dev/null
@@ -1,32 +0,0 @@
-import React, { useCallback } from 'react';
-import { useTranslation } from 'react-i18next';
-import { Drawer, IconButton } from '@mui/material';
-import { ReactComponent as Details2Svg } from '$app/assets/details.svg';
-import Tooltip from '@mui/material/Tooltip';
-import MoreOptions from '$app/components/layout/top_bar/MoreOptions';
-import { useMoreOptionsConfig } from '$app/components/layout/top_bar/MoreOptions.hooks';
-
-function MoreButton() {
- const { t } = useTranslation();
- const [open, setOpen] = React.useState(false);
- const toggleDrawer = useCallback((open: boolean) => {
- setOpen(open);
- }, []);
- const { showMoreButton } = useMoreOptionsConfig();
-
- if (!showMoreButton) return null;
- return (
- <>
- <Tooltip placement={'bottom-end'} title={t('moreAction.moreOptions')}>
- <IconButton onClick={() => toggleDrawer(true)} className={'text-icon-primary'}>
- <Details2Svg className={'h-8 w-8'} />
- </IconButton>
- </Tooltip>
- <Drawer anchor={'right'} open={open} onClose={() => toggleDrawer(false)}>
- <MoreOptions />
- </Drawer>
- </>
- );
-}
-
-export default MoreButton;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/layout/top_bar/MoreOptions.hooks.ts b/frontend/appflowy_tauri/src/appflowy_app/components/layout/top_bar/MoreOptions.hooks.ts
deleted file mode 100644
index 63f1173885..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/layout/top_bar/MoreOptions.hooks.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-import { useLocation } from 'react-router-dom';
-import { useMemo } from 'react';
-
-export function useMoreOptionsConfig() {
- const location = useLocation();
-
- const { type, pageType } = useMemo(() => {
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
- const [_, type, pageType, id] = location.pathname.split('/');
-
- return {
- type,
- pageType,
- id,
- };
- }, [location.pathname]);
-
- const showMoreButton = useMemo(() => {
- return type === 'page';
- }, [type]);
-
- const showStyleOptions = useMemo(() => {
- return type === 'page' && pageType === 'document';
- }, [pageType, type]);
-
- return {
- showMoreButton,
- showStyleOptions,
- };
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/layout/top_bar/MoreOptions.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/layout/top_bar/MoreOptions.tsx
deleted file mode 100644
index 7f77259212..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/layout/top_bar/MoreOptions.tsx
+++ /dev/null
@@ -1,11 +0,0 @@
-import React from 'react';
-import FontSizeConfig from '$app/components/layout/top_bar/FontSizeConfig';
-import { useMoreOptionsConfig } from '$app/components/layout/top_bar/MoreOptions.hooks';
-
-function MoreOptions() {
- const { showStyleOptions } = useMoreOptionsConfig();
-
- return <div className={'flex w-[220px] flex-col'}>{showStyleOptions && <FontSizeConfig />}</div>;
-}
-
-export default MoreOptions;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/layout/top_bar/TopBar.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/layout/top_bar/TopBar.tsx
deleted file mode 100644
index 173bf86cab..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/layout/top_bar/TopBar.tsx
+++ /dev/null
@@ -1,27 +0,0 @@
-import React from 'react';
-import CollapseMenuButton from '$app/components/layout/collapse_menu_button/CollapseMenuButton';
-import { useAppSelector } from '$app/stores/store';
-import Breadcrumb from '$app/components/layout/bread_crumb/BreadCrumb';
-import DeletePageSnackbar from '$app/components/layout/top_bar/DeletePageSnackbar';
-
-function TopBar() {
- const sidebarIsCollapsed = useAppSelector((state) => state.sidebar.isCollapsed);
-
- return (
- <div className={'appflowy-top-bar flex h-[64px] select-none border-b border-line-divider p-4'}>
- {sidebarIsCollapsed && (
- <div className={'mr-2 pt-[3px]'}>
- <CollapseMenuButton />
- </div>
- )}
- <div className={'flex flex-1 items-center justify-between'}>
- <div className={'flex-1'}>
- <Breadcrumb />
- </div>
- </div>
- <DeletePageSnackbar />
- </div>
- );
-}
-
-export default TopBar;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/layout/workspace_manager/NestedPages.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/layout/workspace_manager/NestedPages.tsx
deleted file mode 100644
index ec3335b6b3..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/layout/workspace_manager/NestedPages.tsx
+++ /dev/null
@@ -1,19 +0,0 @@
-import React from 'react';
-import { useAppSelector } from '$app/stores/store';
-import NestedPage from '$app/components/layout/nested_page/NestedPage';
-
-function WorkspaceNestedPages({ workspaceId }: { workspaceId: string }) {
- const pageIds = useAppSelector((state) => {
- return state.pages.relationMap[workspaceId];
- });
-
- return (
- <div className={'h-full w-full overflow-x-hidden p-4 text-xs'}>
- {pageIds?.map((pageId) => (
- <NestedPage key={pageId} pageId={pageId} />
- ))}
- </div>
- );
-}
-
-export default WorkspaceNestedPages;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/layout/workspace_manager/NewPageButton.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/layout/workspace_manager/NewPageButton.tsx
deleted file mode 100644
index 537b7d2d9a..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/layout/workspace_manager/NewPageButton.tsx
+++ /dev/null
@@ -1,31 +0,0 @@
-import React from 'react';
-import { useTranslation } from 'react-i18next';
-import { useWorkspaceActions } from '$app/components/layout/workspace_manager/Workspace.hooks';
-import Button from '@mui/material/Button';
-import { ReactComponent as AddSvg } from '$app/assets/add.svg';
-
-function NewPageButton({ workspaceId }: { workspaceId: string }) {
- const { t } = useTranslation();
- const { newPage } = useWorkspaceActions(workspaceId);
-
- return (
- <div className={'flex h-[60px] w-full items-center border-t border-line-divider px-5 py-5'}>
- <Button
- color={'inherit'}
- onClick={newPage}
- startIcon={
- <div className={'rounded-full bg-fill-default'}>
- <div className={'flex h-[18px] w-[18px] items-center justify-center px-0 text-lg text-content-on-fill'}>
- <AddSvg />
- </div>
- </div>
- }
- className={'flex w-full items-center justify-start text-xs hover:bg-transparent hover:text-fill-default'}
- >
- {t('newPageText')}
- </Button>
- </div>
- );
-}
-
-export default NewPageButton;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/layout/workspace_manager/TrashButton.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/layout/workspace_manager/TrashButton.tsx
deleted file mode 100644
index 984ed6f67f..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/layout/workspace_manager/TrashButton.tsx
+++ /dev/null
@@ -1,43 +0,0 @@
-import React, { useCallback } from 'react';
-import { ReactComponent as TrashSvg } from '$app/assets/delete.svg';
-import { useTranslation } from 'react-i18next';
-import { useLocation, useNavigate } from 'react-router-dom';
-import { useDrag } from 'src/appflowy_app/components/_shared/drag_block';
-import { deletePage } from '$app/application/folder/page.service';
-
-function TrashButton() {
- const { t } = useTranslation();
- const navigate = useNavigate();
- const currentPathType = useLocation().pathname.split('/')[1];
- const navigateToTrash = () => {
- navigate('/trash');
- };
-
- const selected = currentPathType === 'trash';
-
- const onEnd = useCallback((result: { dragId: string; position: 'before' | 'after' | 'inside' }) => {
- void deletePage(result.dragId);
- }, []);
-
- const { onDrop, onDragOver, onDragLeave, isDraggingOver } = useDrag({
- onEnd,
- });
-
- return (
- <div
- onDrop={onDrop}
- onDragOver={onDragOver}
- onDragLeave={onDragLeave}
- data-page-id={'trash'}
- onClick={navigateToTrash}
- className={`my-3 flex h-[32px] w-[100%] cursor-pointer items-center gap-2 rounded-lg p-3.5 text-xs font-medium hover:bg-fill-list-hover ${
- selected ? 'bg-fill-list-active' : ''
- } ${isDraggingOver ? 'bg-fill-list-hover' : ''}`}
- >
- <TrashSvg className='h-5 w-5' />
- <span>{t('trash.text')}</span>
- </div>
- );
-}
-
-export default TrashButton;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/layout/workspace_manager/Workspace.hooks.ts b/frontend/appflowy_tauri/src/appflowy_app/components/layout/workspace_manager/Workspace.hooks.ts
deleted file mode 100644
index 86bca45ada..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/layout/workspace_manager/Workspace.hooks.ts
+++ /dev/null
@@ -1,136 +0,0 @@
-import { useCallback, useEffect, useMemo } from 'react';
-import { useAppDispatch, useAppSelector } from '$app/stores/store';
-import { workspaceActions, WorkspaceItem } from '$app_reducers/workspace/slice';
-import { Page, pagesActions, parserViewPBToPage } from '$app_reducers/pages/slice';
-import { subscribeNotifications } from '$app/application/notification';
-import { FolderNotification, ViewLayoutPB } from '@/services/backend';
-import * as workspaceService from '$app/application/folder/workspace.service';
-import { createCurrentWorkspaceChildView } from '$app/application/folder/workspace.service';
-import { openPage } from '$app_reducers/pages/async_actions';
-
-export function useLoadWorkspaces() {
- const dispatch = useAppDispatch();
- const { workspaces, currentWorkspaceId } = useAppSelector((state) => state.workspace);
-
- const currentWorkspace = useMemo(() => {
- return workspaces.find((workspace) => workspace.id === currentWorkspaceId);
- }, [workspaces, currentWorkspaceId]);
-
- const initializeWorkspaces = useCallback(async () => {
- const workspaces = await workspaceService.getWorkspaces();
-
- const currentWorkspaceId = await workspaceService.getCurrentWorkspace();
-
- dispatch(
- workspaceActions.initWorkspaces({
- workspaces,
- currentWorkspaceId,
- })
- );
- }, [dispatch]);
-
- return {
- workspaces,
- currentWorkspace,
- initializeWorkspaces,
- };
-}
-
-export function useLoadWorkspace(workspace: WorkspaceItem) {
- const { id } = workspace;
- const dispatch = useAppDispatch();
-
- const openWorkspace = useCallback(async () => {
- await workspaceService.openWorkspace(id);
- }, [id]);
-
- const deleteWorkspace = useCallback(async () => {
- await workspaceService.deleteWorkspace(id);
- }, [id]);
-
- const onChildPagesChanged = useCallback(
- (childPages: Page[]) => {
- dispatch(
- pagesActions.addChildPages({
- id,
- childPages,
- })
- );
- },
- [dispatch, id]
- );
-
- const initializeWorkspace = useCallback(async () => {
- const childPages = await workspaceService.getWorkspaceChildViews(id);
-
- dispatch(
- pagesActions.addChildPages({
- id,
- childPages,
- })
- );
- }, [dispatch, id]);
-
- useEffect(() => {
- void (async () => {
- await initializeWorkspace();
- })();
- }, [initializeWorkspace]);
-
- useEffect(() => {
- const unsubscribePromise = subscribeNotifications(
- {
- [FolderNotification.DidUpdateWorkspace]: async (changeset) => {
- dispatch(
- workspaceActions.updateWorkspace({
- id: String(changeset.id),
- name: changeset.name,
- icon: changeset.icon_url,
- })
- );
- },
- [FolderNotification.DidUpdateWorkspaceViews]: async (changeset) => {
- const res = changeset.items;
-
- onChildPagesChanged(res.map(parserViewPBToPage));
- },
- },
- { id }
- );
-
- return () => void unsubscribePromise.then((unsubscribe) => unsubscribe());
- }, [dispatch, id, onChildPagesChanged]);
-
- return {
- openWorkspace,
- deleteWorkspace,
- };
-}
-
-export function useWorkspaceActions(workspaceId: string) {
- const dispatch = useAppDispatch();
- const newPage = useCallback(async () => {
- const { id } = await createCurrentWorkspaceChildView({
- name: '',
- layout: ViewLayoutPB.Document,
- parent_view_id: workspaceId,
- });
-
- dispatch(
- pagesActions.addPage({
- page: {
- id: id,
- parentId: workspaceId,
- layout: ViewLayoutPB.Document,
- name: '',
- },
- isLast: true,
- })
- );
- void dispatch(openPage(id));
- }, [dispatch, workspaceId]);
-
- return {
- newPage,
- };
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/layout/workspace_manager/Workspace.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/layout/workspace_manager/Workspace.tsx
deleted file mode 100644
index 24fc7be91e..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/layout/workspace_manager/Workspace.tsx
+++ /dev/null
@@ -1,85 +0,0 @@
-import React, { useState } from 'react';
-import { WorkspaceItem } from '$app_reducers/workspace/slice';
-import NestedViews from '$app/components/layout/workspace_manager/NestedPages';
-import { useLoadWorkspace, useWorkspaceActions } from '$app/components/layout/workspace_manager/Workspace.hooks';
-import { useTranslation } from 'react-i18next';
-import { ReactComponent as AddIcon } from '$app/assets/add.svg';
-import { IconButton } from '@mui/material';
-import Tooltip from '@mui/material/Tooltip';
-import { WorkplaceAvatar } from '$app/components/_shared/avatar';
-
-function Workspace({ workspace, opened }: { workspace: WorkspaceItem; opened: boolean }) {
- useLoadWorkspace(workspace);
- const { t } = useTranslation();
- const { newPage } = useWorkspaceActions(workspace.id);
- const [showPages, setShowPages] = useState(true);
- const [showAdd, setShowAdd] = useState(false);
-
- return (
- <>
- <div
- className={'w-full'}
- style={{
- height: opened ? '100%' : 0,
- overflow: 'hidden',
- transition: 'height 0.2s ease-in-out',
- }}
- >
- <div
- onClick={(e) => {
- e.stopPropagation();
- e.preventDefault();
- setShowPages((prev) => {
- return !prev;
- });
- }}
- onMouseEnter={() => {
- setShowAdd(true);
- }}
- onMouseLeave={() => {
- setShowAdd(false);
- }}
- className={'mt-2 flex h-[22px] w-full cursor-pointer select-none items-center justify-between px-4'}
- >
- <Tooltip disableInteractive={true} placement={'top-start'} title={t('sideBar.clickToHidePersonal')}>
- <div className={'flex items-center gap-2 rounded px-2 py-1 text-xs font-medium hover:bg-fill-list-active'}>
- {!workspace.name ? (
- t('sideBar.personal')
- ) : (
- <>
- <WorkplaceAvatar
- icon={workspace.icon}
- workplaceName={workspace.name}
- width={18}
- height={18}
- className={'text-[70%]'}
- />
- {workspace.name}
- </>
- )}
- </div>
- </Tooltip>
- {showAdd && (
- <Tooltip disableInteractive={true} title={t('sideBar.addAPage')}>
- <IconButton
- onClick={(e) => {
- e.stopPropagation();
- void newPage();
- }}
- size={'small'}
- >
- <AddIcon />
- </IconButton>
- </Tooltip>
- )}
- </div>
-
- <div className={`${showPages ? '' : 'hidden'}`}>
- <NestedViews workspaceId={workspace.id} />
- </div>
- </div>
- </>
- );
-}
-
-export default Workspace;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/layout/workspace_manager/WorkspaceManager.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/layout/workspace_manager/WorkspaceManager.tsx
deleted file mode 100644
index 083dd61ec3..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/layout/workspace_manager/WorkspaceManager.tsx
+++ /dev/null
@@ -1,38 +0,0 @@
-import React, { useEffect } from 'react';
-import NewPageButton from '$app/components/layout/workspace_manager/NewPageButton';
-import { useLoadWorkspaces } from '$app/components/layout/workspace_manager/Workspace.hooks';
-import Workspace from './Workspace';
-import TrashButton from '$app/components/layout/workspace_manager/TrashButton';
-import { useAppSelector } from '@/appflowy_app/stores/store';
-import { LoginState } from '$app_reducers/current-user/slice';
-import { AFScroller } from '$app/components/_shared/scroller';
-
-function WorkspaceManager() {
- const { workspaces, currentWorkspace, initializeWorkspaces } = useLoadWorkspaces();
-
- const loginState = useAppSelector((state) => state.currentUser.loginState);
-
- useEffect(() => {
- if (loginState === LoginState.Success || loginState === undefined) {
- void initializeWorkspaces();
- }
- }, [initializeWorkspaces, loginState]);
-
- return (
- <div className={'workspaces flex h-full select-none flex-col justify-between'}>
- <AFScroller overflowXHidden className={'mt-4 flex w-full flex-1 select-none flex-col'}>
- <div className={'flex-1'}>
- {workspaces.map((workspace) => (
- <Workspace opened={currentWorkspace?.id === workspace.id} key={workspace.id} workspace={workspace} />
- ))}
- </div>
- </AFScroller>
- <div className={'flex w-[100%] items-center px-2'}>
- <TrashButton />
- </div>
- {currentWorkspace && <NewPageButton workspaceId={currentWorkspace.id} />}
- </div>
- );
-}
-
-export default WorkspaceManager;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/settings/Login.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/settings/Login.tsx
deleted file mode 100644
index d5ecc4bc0c..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/settings/Login.tsx
+++ /dev/null
@@ -1,22 +0,0 @@
-import Typography from '@mui/material/Typography';
-import { useTranslation } from 'react-i18next';
-import Button from '@mui/material/Button';
-import { LoginButtonGroup } from '$app/components/auth/LoginButtonGroup';
-
-export const Login = ({ onBack }: { onBack?: () => void }) => {
- const { t } = useTranslation();
-
- return (
- <div className={'flex flex-col items-center justify-center gap-4'}>
- <Typography variant={'h4'} className={'mb-3 font-medium'}>
- {t('button.login')}
- </Typography>
- <div className={'flex w-[70%] flex-col items-center gap-4'}>
- <LoginButtonGroup />
- <Button className={'w-full rounded-lg py-3 text-sm'} onClick={onBack} color={'inherit'} variant={'text'}>
- {t('button.cancel')}
- </Button>
- </div>
- </div>
- );
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/settings/Settings.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/settings/Settings.tsx
deleted file mode 100644
index 1d9f3c0cd9..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/settings/Settings.tsx
+++ /dev/null
@@ -1,92 +0,0 @@
-import { useMemo, useState } from 'react';
-import { Box, Tab, Tabs } from '@mui/material';
-import { useTranslation } from 'react-i18next';
-import { MyAccount } from '$app/components/settings/my_account';
-import { ReactComponent as AccountIcon } from '$app/assets/settings/account.svg';
-import { ReactComponent as WorkplaceIcon } from '$app/assets/settings/workplace.svg';
-import { Workplace } from '$app/components/settings/workplace';
-import { SettingsRoutes } from '$app/components/settings/workplace/const';
-
-interface TabPanelProps {
- children?: React.ReactNode;
- index: number;
- value: number;
-}
-
-function TabPanel(props: TabPanelProps) {
- const { children, value, index, ...other } = props;
-
- return (
- <div
- role='tabpanel'
- className={'h-full overflow-y-auto overflow-x-hidden'}
- hidden={value !== index}
- id={`vertical-tabpanel-${index}`}
- aria-labelledby={`vertical-tab-${index}`}
- {...other}
- >
- {value === index && <Box sx={{ p: 3 }}>{children}</Box>}
- </div>
- );
-}
-
-export const Settings = ({ onForward }: { onForward: (route: SettingsRoutes) => void }) => {
- const { t } = useTranslation();
- const [activeTab, setActiveTab] = useState(0);
-
- const tabOptions = useMemo(() => {
- return [
- {
- label: t('newSettings.myAccount.title'),
- Icon: AccountIcon,
- Component: MyAccount,
- },
- {
- label: t('newSettings.workplace.name'),
- Icon: WorkplaceIcon,
- Component: Workplace,
- },
- ];
- }, [t]);
-
- const handleChangeTab = (event: React.SyntheticEvent, newValue: number) => {
- setActiveTab(newValue);
- };
-
- return (
- <Box sx={{ flexGrow: 1, bgcolor: 'background.paper', display: 'flex', height: 224 }}>
- <Tabs
- orientation='vertical'
- variant='scrollable'
- value={activeTab}
- onChange={handleChangeTab}
- className={'w-[212px] min-w-[212px] bg-bg-base px-2 py-4'}
- sx={{
- '& .MuiTabs-indicator': {
- display: 'none',
- },
- }}
- >
- {tabOptions.map((tab, index) => (
- <Tab
- key={index}
- className={'my-1 min-h-[44px] items-start px-4 text-text-title'}
- label={
- <div className={'flex items-center gap-2'}>
- <tab.Icon className={'h-5 w-5'} />
- {tab.label}
- </div>
- }
- onClick={() => setActiveTab(index)}
- sx={{ '&.Mui-selected': { borderColor: 'transparent', backgroundColor: 'var(--fill-list-active)' } }}
- />
- ))}
- </Tabs>
- {tabOptions.map((tab, index) => (
- <TabPanel key={index} value={activeTab} index={index}>
- <tab.Component onForward={onForward} />
- </TabPanel>
- ))}
- </Box>
- );
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/settings/SettingsDialog.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/settings/SettingsDialog.tsx
deleted file mode 100644
index b53f8a6002..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/settings/SettingsDialog.tsx
+++ /dev/null
@@ -1,108 +0,0 @@
-/**
- * @figmaUrl https://www.figma.com/file/MF5CWlOzBRuGHp45zAXyUH/Appflowy%3A-Desktop-Settings?type=design&node-id=100%3A2119&mode=design&t=4Wb0Zg5NOFO36kOf-1
- */
-
-import Dialog, { DialogProps } from '@mui/material/Dialog';
-import { Settings } from '$app/components/settings/Settings';
-import { useCallback, useEffect, useRef, useState } from 'react';
-import DialogTitle from '@mui/material/DialogTitle';
-import { IconButton } from '@mui/material';
-import { ReactComponent as CloseIcon } from '$app/assets/close.svg';
-import { useTranslation } from 'react-i18next';
-import { ReactComponent as UpIcon } from '$app/assets/up.svg';
-import { SettingsRoutes } from '$app/components/settings/workplace/const';
-import DialogContent from '@mui/material/DialogContent';
-import { Login } from '$app/components/settings/Login';
-import SwipeableViews from 'react-swipeable-views';
-import { useAppDispatch, useAppSelector } from '$app/stores/store';
-import { currentUserActions, LoginState } from '$app_reducers/current-user/slice';
-
-export const SettingsDialog = (props: DialogProps) => {
- const dispatch = useAppDispatch();
- const [routes, setRoutes] = useState<SettingsRoutes[]>([]);
- const loginState = useAppSelector((state) => state.currentUser.loginState);
- const lastLoginStateRef = useRef(loginState);
- const { t } = useTranslation();
- const handleForward = useCallback((route: SettingsRoutes) => {
- setRoutes((prev) => {
- return [...prev, route];
- });
- }, []);
-
- const handleBack = useCallback(() => {
- setRoutes((prevState) => {
- return prevState.slice(0, -1);
- });
- dispatch(currentUserActions.resetLoginState());
- }, [dispatch]);
-
- const handleClose = useCallback(() => {
- dispatch(currentUserActions.resetLoginState());
- props?.onClose?.({}, 'backdropClick');
- }, [dispatch, props]);
-
- const currentRoute = routes[routes.length - 1];
-
- useEffect(() => {
- if (lastLoginStateRef.current === LoginState.Loading && loginState === LoginState.Success) {
- handleClose();
- return;
- }
-
- lastLoginStateRef.current = loginState;
- }, [loginState, handleClose]);
-
- return (
- <Dialog
- {...props}
- PaperProps={{
- style:
- currentRoute === SettingsRoutes.LOGIN
- ? {
- width: '600px',
- height: '461px',
- }
- : {
- width: '90%',
- maxWidth: '729px',
- height: '85%',
- },
- }}
- onKeyDown={(e) => {
- if (e.key === 'Escape') {
- e.preventDefault();
- }
- }}
- scroll={'paper'}
- >
- <SwipeableViews
- slideStyle={{
- overflow: 'hidden',
- }}
- className={'h-full overflow-hidden'}
- axis={'x'}
- index={routes.length === 0 ? 0 : 1}
- >
- <div className={'flex h-full w-full flex-col'} dir={'ltr'} hidden={routes.length > 0}>
- {routes.length === 0 && <Settings onForward={handleForward} />}
- </div>
- <div className={'relative flex h-full w-full flex-col'} dir={'ltr'} hidden={routes.length === 0}>
- {routes.length > 0 && (
- <>
- <DialogTitle className={'flex items-center gap-2'}>
- <UpIcon className={'h-8 w-8 -rotate-90 transform cursor-pointer'} onClick={handleBack} />
- {t('button.back')}
- </DialogTitle>
- <IconButton onClick={handleClose} className={'absolute right-2 top-2'}>
- <CloseIcon className={'h-8 w-8'} />
- </IconButton>
- <DialogContent>
- {currentRoute === SettingsRoutes.LOGIN ? <Login onBack={handleBack} /> : null}
- </DialogContent>
- </>
- )}
- </div>
- </SwipeableViews>
- </Dialog>
- );
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/settings/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/settings/index.ts
deleted file mode 100644
index 0f0a2c23f4..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/settings/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './my_account';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/settings/my_account/AccountLogin.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/settings/my_account/AccountLogin.tsx
deleted file mode 100644
index 05b375c920..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/settings/my_account/AccountLogin.tsx
+++ /dev/null
@@ -1,39 +0,0 @@
-import { useTranslation } from 'react-i18next';
-import Typography from '@mui/material/Typography';
-import Button from '@mui/material/Button';
-import { Divider } from '@mui/material';
-import { DeleteAccount } from '$app/components/settings/my_account/DeleteAccount';
-import { SettingsRoutes } from '$app/components/settings/workplace/const';
-import { useAuth } from '$app/components/auth/auth.hooks';
-
-export const AccountLogin = ({ onForward }: { onForward?: (route: SettingsRoutes) => void }) => {
- const { t } = useTranslation();
- const { currentUser, logout } = useAuth();
-
- const isLocal = currentUser.isLocal;
-
- return (
- <>
- <div className={'w-full'}>
- <Typography className={'mb-4 font-semibold'} variant={'subtitle1'}>
- {t('newSettings.myAccount.accountLogin')}
- </Typography>
- <Button
- onClick={async () => {
- if (isLocal) {
- onForward?.(SettingsRoutes.LOGIN);
- return;
- }
-
- await logout();
- }}
- variant={'contained'}
- >
- {!isLocal ? t('button.logout') : t('button.login')}
- </Button>
- <Divider className={'my-4'} />
- <DeleteAccount />
- </div>
- </>
- );
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/settings/my_account/DeleteAccount.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/settings/my_account/DeleteAccount.tsx
deleted file mode 100644
index 82a909180e..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/settings/my_account/DeleteAccount.tsx
+++ /dev/null
@@ -1,43 +0,0 @@
-import { useTranslation } from 'react-i18next';
-import { useState } from 'react';
-import Typography from '@mui/material/Typography';
-import Button from '@mui/material/Button';
-import { DeleteAccountDialog } from '$app/components/settings/my_account/DeleteAccountDialog';
-
-export const DeleteAccount = () => {
- const { t } = useTranslation();
-
- const [openDialog, setOpenDialog] = useState(false);
-
- return (
- <div className={'flex w-full items-end'}>
- <div className={'flex flex-1 flex-col gap-2'}>
- <Typography className={'text-text-title'} variant={'subtitle2'}>
- {t('newSettings.myAccount.deleteAccount.title')}
- </Typography>
- <Typography className={'text-text-caption'} variant={'body2'}>
- {t('newSettings.myAccount.deleteAccount.subtitle')}
- </Typography>
- </div>
- <div className={'flex flex-1 items-center justify-end'}>
- <Button
- onClick={() => {
- setOpenDialog(true);
- }}
- disabled
- size={'small'}
- variant={'outlined'}
- color={'error'}
- >
- {t('newSettings.myAccount.deleteAccount.deleteMyAccount')}
- </Button>
- </div>
- <DeleteAccountDialog
- open={openDialog}
- onClose={() => {
- setOpenDialog(false);
- }}
- />
- </div>
- );
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/settings/my_account/DeleteAccountDialog.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/settings/my_account/DeleteAccountDialog.tsx
deleted file mode 100644
index 2f8cc37258..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/settings/my_account/DeleteAccountDialog.tsx
+++ /dev/null
@@ -1,50 +0,0 @@
-import Dialog, { DialogProps } from '@mui/material/Dialog';
-import { useTranslation } from 'react-i18next';
-import DialogTitle from '@mui/material/DialogTitle';
-import { DialogActions, DialogContentText, IconButton } from '@mui/material';
-import Button from '@mui/material/Button';
-import DialogContent from '@mui/material/DialogContent';
-import { ReactComponent as CloseIcon } from '$app/assets/close.svg';
-
-export const DeleteAccountDialog = (props: DialogProps) => {
- const { t } = useTranslation();
-
- const handleClose = () => {
- props?.onClose?.({}, 'backdropClick');
- };
-
- const handleOk = () => {
- //123
- };
-
- return (
- <Dialog
- {...props}
- PaperProps={{
- className: 'py-8 min-w-[300px] max-w-[500px]',
- }}
- keepMounted={false}
- >
- <DialogTitle className={'text-center'}>{t('newSettings.myAccount.deleteAccount.dialogTitle')}</DialogTitle>
- <DialogContent className={'flex flex-col gap-2 px-16 text-center'}>
- <DialogContentText>{t('newSettings.myAccount.deleteAccount.dialogContent1')}</DialogContentText>
- <DialogContentText>{t('newSettings.myAccount.deleteAccount.dialogContent2')}</DialogContentText>
- </DialogContent>
- <DialogActions className={'flex items-center justify-center'}>
- <div className={'flex flex-1 justify-end'}>
- <Button color={'inherit'} variant={'outlined'} onClick={handleClose}>
- {t('button.cancel')}
- </Button>
- </div>
- <div className={'flex flex-1 justify-start'}>
- <Button color={'error'} variant={'contained'} onClick={handleOk}>
- {t('button.deleteAccount')}
- </Button>
- </div>
- </DialogActions>
- <IconButton onClick={handleClose} className={'absolute right-2 top-2'}>
- <CloseIcon />
- </IconButton>
- </Dialog>
- );
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/settings/my_account/MyAccount.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/settings/my_account/MyAccount.tsx
deleted file mode 100644
index b3a315994b..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/settings/my_account/MyAccount.tsx
+++ /dev/null
@@ -1,24 +0,0 @@
-import { useTranslation } from 'react-i18next';
-import Typography from '@mui/material/Typography';
-import { Profile } from './Profile';
-import { AccountLogin } from './AccountLogin';
-import { Divider } from '@mui/material';
-import { SettingsRoutes } from '$app/components/settings/workplace/const';
-
-export const MyAccount = ({ onForward }: { onForward?: (route: SettingsRoutes) => void }) => {
- const { t } = useTranslation();
-
- return (
- <div className={'flex flex-col'}>
- <Typography variant={'h5'} className={'mb-3 font-bold'}>
- {t('newSettings.myAccount.title')}
- </Typography>
- <Typography variant={'body2'} className={'mb-3 text-text-caption'}>
- {t('newSettings.myAccount.subtitle')}
- </Typography>
- <Profile />
- <Divider className={'my-3'} />
- <AccountLogin onForward={onForward} />
- </div>
- );
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/settings/my_account/Profile.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/settings/my_account/Profile.tsx
deleted file mode 100644
index 2ac672b0e5..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/settings/my_account/Profile.tsx
+++ /dev/null
@@ -1,180 +0,0 @@
-import Typography from '@mui/material/Typography';
-import { useTranslation } from 'react-i18next';
-import { IconButton, InputAdornment, OutlinedInput } from '@mui/material';
-import { useAppSelector } from '$app/stores/store';
-import React, { useState } from 'react';
-import { ReactComponent as CheckIcon } from '$app/assets/select-check.svg';
-import { ReactComponent as CloseIcon } from '$app/assets/close.svg';
-import { ReactComponent as EditIcon } from '$app/assets/edit.svg';
-
-import Tooltip from '@mui/material/Tooltip';
-import { UserService } from '$app/application/user/user.service';
-import { notify } from '$app/components/_shared/notify';
-import { ProfileAvatar } from '$app/components/_shared/avatar';
-import Popover from '@mui/material/Popover';
-import { PopoverCommonProps } from '$app/components/editor/components/tools/popover';
-import EmojiPicker from '$app/components/_shared/emoji_picker/EmojiPicker';
-import Button from '@mui/material/Button';
-
-export const Profile = () => {
- const { displayName, id } = useAppSelector((state) => state.currentUser);
- const { t } = useTranslation();
- const [isEditing, setIsEditing] = useState(false);
- const [newName, setNewName] = useState(displayName ?? 'Me');
- const [error, setError] = useState<boolean>(false);
- const [emojiPickerAnchor, setEmojiPickerAnchor] = useState<HTMLElement | null>(null);
- const openEmojiPicker = Boolean(emojiPickerAnchor);
- const handleSave = async () => {
- setError(false);
- if (!newName) {
- setError(true);
- return;
- }
-
- if (newName === displayName) {
- setIsEditing(false);
- return;
- }
-
- try {
- await UserService.updateUserProfile({
- id,
- name: newName,
- });
- setIsEditing(false);
- } catch {
- setError(true);
- notify.error(t('newSettings.myAccount.updateNameError'));
- }
- };
-
- const handleEmojiSelect = async (emoji: string) => {
- try {
- await UserService.updateUserProfile({
- id,
- icon_url: emoji,
- });
- } catch {
- notify.error(t('newSettings.myAccount.updateIconError'));
- }
- };
-
- const handleCancel = () => {
- setNewName(displayName ?? 'Me');
- setIsEditing(false);
- };
-
- const handleKeyDown = (e: React.KeyboardEvent) => {
- if (e.key === 'Enter') {
- e.stopPropagation();
- e.preventDefault();
- void handleSave();
- }
-
- if (e.key === 'Escape') {
- e.stopPropagation();
- e.preventDefault();
- handleCancel();
- }
- };
-
- return (
- <div className={'mt-2'}>
- <Typography className={'mb-2 font-semibold'} variant={'subtitle1'}>
- {t('newSettings.myAccount.profileLabel')}
- </Typography>
- <div className={'flex w-full items-center gap-2'}>
- <Button
- onClick={(e) => {
- setEmojiPickerAnchor(e.currentTarget);
- }}
- variant={'outlined'}
- color={'inherit'}
- className={'h-12 w-12 min-w-[48px] rounded-full'}
- >
- <ProfileAvatar className={'border border-bg-body'} width={46} height={46} />
- </Button>
-
- <div className={'flex-1'}>
- {isEditing ? (
- <OutlinedInput
- onKeyDown={handleKeyDown}
- error={error}
- size={'small'}
- onChange={(e) => setNewName(e.target.value)}
- spellCheck={false}
- autoFocus={true}
- autoCorrect={'off'}
- autoCapitalize={'off'}
- fullWidth
- endAdornment={
- <InputAdornment position='end'>
- <div className={'flex items-center gap-1'}>
- <Tooltip title={t('button.save')}>
- <IconButton
- color={'primary'}
- disabled={!newName || newName === displayName}
- onClick={handleSave}
- size={'small'}
- >
- <CheckIcon />
- </IconButton>
- </Tooltip>
- <Tooltip title={t('button.cancel')}>
- <IconButton onClick={handleCancel} edge='end' size={'small'}>
- <CloseIcon />
- </IconButton>
- </Tooltip>
- </div>
- </InputAdornment>
- }
- sx={{
- '&.MuiOutlinedInput-root': {
- borderRadius: '8px',
- },
- }}
- placeholder={t('newSettings.myAccount.profileNamePlaceholder')}
- value={newName}
- />
- ) : (
- <Typography className={'font-semibold'} variant={'subtitle2'}>
- {newName}
- <Tooltip title={t('button.edit')} placement={'top'}>
- <IconButton onClick={() => setIsEditing(true)} size={'small'} className={'ml-1'}>
- <EditIcon />
- </IconButton>
- </Tooltip>
- </Typography>
- )}
- </div>
- </div>
- {openEmojiPicker && (
- <Popover
- {...PopoverCommonProps}
- className={'border-none bg-transparent shadow-none'}
- anchorEl={emojiPickerAnchor}
- disableAutoFocus={true}
- open={openEmojiPicker}
- onClose={() => {
- setEmojiPickerAnchor(null);
- }}
- anchorOrigin={{
- vertical: 'bottom',
- horizontal: 'left',
- }}
- transformOrigin={{
- vertical: 'top',
- horizontal: 'left',
- }}
- >
- <EmojiPicker
- onEscape={() => {
- setEmojiPickerAnchor(null);
- }}
- onEmojiSelect={handleEmojiSelect}
- />
- </Popover>
- )}
- </div>
- );
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/settings/my_account/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/settings/my_account/index.ts
deleted file mode 100644
index d923fcefce..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/settings/my_account/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './MyAccount';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/settings/workplace/Appearance.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/settings/workplace/Appearance.tsx
deleted file mode 100644
index 1dc8581dae..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/settings/workplace/Appearance.tsx
+++ /dev/null
@@ -1,20 +0,0 @@
-import { useTranslation } from 'react-i18next';
-import { ThemeModeSwitch } from '$app/components/settings/workplace/appearance/ThemeModeSwitch';
-import Typography from '@mui/material/Typography';
-import { Divider } from '@mui/material';
-import { LanguageSetting } from '$app/components/settings/workplace/appearance/LanguageSetting';
-
-export const Appearance = () => {
- const { t } = useTranslation();
-
- return (
- <>
- <Typography className={'mb-2 font-semibold'} variant={'subtitle1'}>
- {t('newSettings.workplace.appearance.name')}
- </Typography>
- <ThemeModeSwitch />
- <Divider className={'my-3'} />
- <LanguageSetting />
- </>
- );
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/settings/workplace/Workplace.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/settings/workplace/Workplace.tsx
deleted file mode 100644
index 8af69eec51..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/settings/workplace/Workplace.tsx
+++ /dev/null
@@ -1,23 +0,0 @@
-import { useTranslation } from 'react-i18next';
-import Typography from '@mui/material/Typography';
-import { WorkplaceDisplay } from '$app/components/settings/workplace/WorkplaceDisplay';
-import { Divider } from '@mui/material';
-import { Appearance } from '$app/components/settings/workplace/Appearance';
-
-export const Workplace = () => {
- const { t } = useTranslation();
-
- return (
- <div className={'flex flex-col'}>
- <Typography variant={'h5'} className={'mb-3 font-bold'}>
- {t('newSettings.workplace.title')}
- </Typography>
- <Typography variant={'body2'} className={'mb-3 text-text-caption'}>
- {t('newSettings.workplace.subtitle')}
- </Typography>
- <WorkplaceDisplay />
- <Divider className={'my-3'} />
- <Appearance />
- </div>
- );
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/settings/workplace/WorkplaceDisplay.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/settings/workplace/WorkplaceDisplay.tsx
deleted file mode 100644
index 3a71c5f070..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/settings/workplace/WorkplaceDisplay.tsx
+++ /dev/null
@@ -1,155 +0,0 @@
-import { useTranslation } from 'react-i18next';
-import Typography from '@mui/material/Typography';
-import { Divider, OutlinedInput } from '@mui/material';
-import React, { useMemo, useState } from 'react';
-import Button from '@mui/material/Button';
-import { useAppDispatch, useAppSelector } from '$app/stores/store';
-import { changeWorkspaceIcon, renameWorkspace } from '$app/application/folder/workspace.service';
-import { notify } from '$app/components/_shared/notify';
-import { WorkplaceAvatar } from '$app/components/_shared/avatar';
-import Popover from '@mui/material/Popover';
-import { PopoverCommonProps } from '$app/components/editor/components/tools/popover';
-import EmojiPicker from '$app/components/_shared/emoji_picker/EmojiPicker';
-import { workspaceActions } from '$app_reducers/workspace/slice';
-import debounce from 'lodash-es/debounce';
-
-export const WorkplaceDisplay = () => {
- const { t } = useTranslation();
- const isLocal = useAppSelector((state) => state.currentUser.isLocal);
- const { workspaces, currentWorkspaceId } = useAppSelector((state) => state.workspace);
- const workspace = useMemo(
- () => workspaces.find((workspace) => workspace.id === currentWorkspaceId),
- [workspaces, currentWorkspaceId]
- );
- const [name, setName] = useState(workspace?.name ?? '');
- const [emojiPickerAnchor, setEmojiPickerAnchor] = useState<HTMLElement | null>(null);
- const openEmojiPicker = Boolean(emojiPickerAnchor);
- const dispatch = useAppDispatch();
-
- const debounceUpdateWorkspace = useMemo(() => {
- return debounce(async ({ id, name, icon }: { id: string; name?: string; icon?: string }) => {
- if (!id || !name) return;
-
- if (icon) {
- try {
- await changeWorkspaceIcon(id, icon);
- } catch {
- notify.error(t('newSettings.workplace.updateIconError'));
- }
- }
-
- if (name) {
- try {
- await renameWorkspace(id, name);
- } catch {
- notify.error(t('newSettings.workplace.renameError'));
- }
- }
- }, 500);
- }, [t]);
-
- const handleSave = async () => {
- if (!workspace || !name) return;
- dispatch(workspaceActions.updateWorkspace({ id: workspace.id, name }));
-
- await debounceUpdateWorkspace({ id: workspace.id, name });
- };
-
- const handleEmojiSelect = async (icon: string) => {
- if (!workspace) return;
- dispatch(workspaceActions.updateWorkspace({ id: workspace.id, icon }));
-
- await debounceUpdateWorkspace({ id: workspace.id, icon });
- };
-
- const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {
- if (e.key === 'Enter') {
- e.stopPropagation();
- e.preventDefault();
- void handleSave();
- }
- };
-
- return (
- <div className={'mb-1 mt-2'}>
- <Typography className={'mb-2 font-semibold'} variant={'subtitle1'}>
- {t('newSettings.workplace.workplaceName')}
- </Typography>
- <div className={'flex gap-2'}>
- <div className={'flex-1'}>
- <OutlinedInput
- size={'small'}
- spellCheck={false}
- autoCorrect={'off'}
- autoCapitalize={'off'}
- onKeyDown={handleKeyDown}
- fullWidth
- readOnly={isLocal}
- onChange={(e) => setName(e.target.value)}
- sx={{
- '&.MuiOutlinedInput-root': {
- borderRadius: '8px',
- },
- }}
- placeholder={t('newSettings.workplace.workplaceNamePlaceholder')}
- value={name}
- />
- </div>
- <Button onClick={handleSave} disabled={!name || workspace?.name === name} variant={'contained'}>
- {t('button.save')}
- </Button>
- </div>
- <Divider className={'my-3'} />
- <Typography className={'font-semibold'} variant={'subtitle1'}>
- {t('newSettings.workplace.workplaceIcon')}
- </Typography>
- <Typography variant={'body2'} className={'my-2 text-text-caption'}>
- {t('newSettings.workplace.workplaceIconSubtitle')}
- </Typography>
- <Button
- onClick={(e) => {
- setEmojiPickerAnchor(e.currentTarget);
- }}
- variant={'outlined'}
- color={'inherit'}
- className={'h-16 w-16 rounded-lg p-0'}
- disabled={isLocal}
- >
- <WorkplaceAvatar
- workplaceName={name}
- width={62}
- height={62}
- icon={workspace?.icon}
- className={'rounded-lg border border-bg-body p-[2px] hover:opacity-90'}
- />
- </Button>
- {openEmojiPicker && (
- <Popover
- {...PopoverCommonProps}
- className={'border-none bg-transparent shadow-none'}
- anchorEl={emojiPickerAnchor}
- disableAutoFocus={true}
- open={openEmojiPicker}
- onClose={() => {
- setEmojiPickerAnchor(null);
- }}
- anchorOrigin={{
- vertical: 'top',
- horizontal: 'right',
- }}
- transformOrigin={{
- vertical: 'top',
- horizontal: 'left',
- }}
- >
- <EmojiPicker
- onEscape={() => {
- setEmojiPickerAnchor(null);
- }}
- onEmojiSelect={handleEmojiSelect}
- />
- </Popover>
- )}
- </div>
- );
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/settings/workplace/appearance/LanguageSetting.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/settings/workplace/appearance/LanguageSetting.tsx
deleted file mode 100644
index 41a42bd011..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/settings/workplace/appearance/LanguageSetting.tsx
+++ /dev/null
@@ -1,115 +0,0 @@
-import Typography from '@mui/material/Typography';
-import { useTranslation } from 'react-i18next';
-import MenuItem from '@mui/material/MenuItem';
-import Select from '@mui/material/Select';
-import React, { useCallback } from 'react';
-import { useAppDispatch, useAppSelector } from '$app/stores/store';
-import { currentUserActions } from '$app_reducers/current-user/slice';
-import { UserService } from '$app/application/user/user.service';
-
-const languages = [
- {
- key: 'ar-SA',
- title: 'العربية',
- },
- { key: 'ca-ES', title: 'Català' },
- { key: 'de-DE', title: 'Deutsch' },
- { key: 'en', title: 'English' },
- { key: 'es-VE', title: 'Español (Venezuela)' },
- { key: 'eu-ES', title: 'Español' },
- { key: 'fr-FR', title: 'Français' },
- { key: 'hu-HU', title: 'Magyar' },
- { key: 'id-ID', title: 'Bahasa Indonesia' },
- { key: 'it-IT', title: 'Italiano' },
- { key: 'ja-JP', title: '日本語' },
- { key: 'ko-KR', title: '한국어' },
- { key: 'pl-PL', title: 'Polski' },
- { key: 'pt-BR', title: 'Português' },
- { key: 'pt-PT', title: 'Português' },
- { key: 'ru-RU', title: 'Русский' },
- { key: 'sv', title: 'Svenska' },
- { key: 'th-TH', title: 'ไทย' },
- { key: 'tr-TR', title: 'Türkçe' },
- { key: 'zh-CN', title: '简体中文' },
- { key: 'zh-TW', title: '繁體中文' },
-];
-
-export const LanguageSetting = () => {
- const { t, i18n } = useTranslation();
- const userSettingState = useAppSelector((state) => state.currentUser.userSetting);
- const dispatch = useAppDispatch();
- const selectedLanguage = userSettingState.language;
-
- const [hoverKey, setHoverKey] = React.useState<string | null>(null);
-
- const handleChange = useCallback(
- (language: string) => {
- const newSetting = { ...userSettingState, language };
-
- dispatch(currentUserActions.setUserSetting(newSetting));
- const newLanguage = newSetting.language || 'en';
-
- void UserService.setAppearanceSetting({
- theme: newSetting.theme,
- theme_mode: newSetting.themeMode,
- locale: {
- language_code: newLanguage.split('-')[0],
- country_code: newLanguage.split('-')[1],
- },
- });
- },
- [dispatch, userSettingState]
- );
-
- const handleKeyDown = useCallback((e: React.KeyboardEvent<HTMLDivElement>) => {
- if (e.key === 'Escape') {
- e.preventDefault();
- }
- }, []);
-
- return (
- <>
- <Typography className={'mb-2 font-normal'} variant={'subtitle1'}>
- {t('newSettings.workplace.appearance.language')}
- </Typography>
-
- <Select
- variant={'outlined'}
- size={'small'}
- className={'w-[180px] rounded-xl'}
- value={selectedLanguage}
- onOpen={() => {
- setHoverKey(selectedLanguage ?? null);
- }}
- onChange={(e) => {
- const language = e.target.value;
-
- handleChange(language);
- void i18n.changeLanguage(language);
- }}
- MenuProps={{
- onKeyDown: handleKeyDown,
- }}
- >
- {languages.map((option) => (
- <MenuItem
- onFocus={() => {
- setHoverKey(option.key);
- }}
- onMouseEnter={(e) => {
- e.currentTarget.focus();
- }}
- key={option.key}
- style={{
- backgroundColor: option.key === hoverKey ? 'var(--fill-list-active)' : undefined,
- }}
- className={'my-1 w-full rounded-none px-2 py-1 text-xs hover:bg-transparent'}
- value={option.key}
- >
- {option.title}
- </MenuItem>
- ))}
- </Select>
- </>
- );
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/settings/workplace/appearance/ThemeModeSwitch.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/settings/workplace/appearance/ThemeModeSwitch.tsx
deleted file mode 100644
index 34fdb8e598..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/settings/workplace/appearance/ThemeModeSwitch.tsx
+++ /dev/null
@@ -1,93 +0,0 @@
-import { useTranslation } from 'react-i18next';
-import { useAppDispatch, useAppSelector } from '$app/stores/store';
-import { useCallback, useMemo } from 'react';
-import { ThemeModePB } from '@/services/backend';
-import darkSrc from '$app/assets/settings/dark.png';
-import lightSrc from '$app/assets/settings/light.png';
-import { currentUserActions, ThemeMode } from '$app_reducers/current-user/slice';
-import { UserService } from '$app/application/user/user.service';
-import { ReactComponent as CheckCircle } from '$app/assets/settings/check_circle.svg';
-
-export const ThemeModeSwitch = () => {
- const { t } = useTranslation();
- const userSettingState = useAppSelector((state) => state.currentUser.userSetting);
- const dispatch = useAppDispatch();
-
- const selectedMode = userSettingState.themeMode;
- const themeModes = useMemo(() => {
- return [
- {
- name: t('newSettings.workplace.appearance.themeMode.auto'),
- value: ThemeModePB.System,
- img: (
- <div className={'relative h-[67px] overflow-hidden'}>
- <img className={'h-[67px] w-[71px]'} src={darkSrc} />
- <img className={'absolute left-1/2 top-0'} src={lightSrc} />
- </div>
- ),
- },
- {
- name: t('newSettings.workplace.appearance.themeMode.light'),
- value: ThemeModePB.Light,
- img: <img src={lightSrc} className={'h-[67px] w-[71px]'} />,
- },
- {
- name: t('newSettings.workplace.appearance.themeMode.dark'),
- value: ThemeModePB.Dark,
- img: <img src={darkSrc} className={'h-[67px] w-[71px]'} />,
- },
- ];
- }, [t]);
-
- const handleChange = useCallback(
- (newValue: ThemeModePB) => {
- const newSetting = {
- ...userSettingState,
- ...{
- themeMode: newValue,
- isDark:
- newValue === ThemeMode.Dark ||
- (newValue === ThemeMode.System && window.matchMedia('(prefers-color-scheme: dark)').matches),
- },
- };
-
- dispatch(currentUserActions.setUserSetting(newSetting));
-
- void UserService.setAppearanceSetting({
- theme_mode: newSetting.themeMode,
- });
- },
- [dispatch, userSettingState]
- );
-
- const renderThemeModeItem = useCallback(
- (option: { name: string; value: ThemeModePB; img: JSX.Element }) => {
- return (
- <div
- key={option.value}
- onClick={() => handleChange(option.value)}
- className={'flex cursor-pointer flex-col items-center gap-2'}
- >
- <div
- style={{
- borderColor: selectedMode === option.value ? 'var(--text-title)' : 'var(--line-border)',
- }}
- className={'theme-mode-item'}
- >
- {option.img}
- <CheckCircle
- className={'absolute left-0.5 top-0.5 h-4 w-4'}
- style={{
- display: selectedMode === option.value ? 'block' : 'none',
- }}
- />
- </div>
- <div className={'text-sm text-text-title'}>{option.name}</div>
- </div>
- );
- },
- [handleChange, selectedMode]
- );
-
- return <div className={'flex gap-3'}>{themeModes.map((mode) => renderThemeModeItem(mode))}</div>;
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/settings/workplace/const.ts b/frontend/appflowy_tauri/src/appflowy_app/components/settings/workplace/const.ts
deleted file mode 100644
index 075e2744a5..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/settings/workplace/const.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export enum SettingsRoutes {
- LOGIN = 'login',
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/settings/workplace/index.ts b/frontend/appflowy_tauri/src/appflowy_app/components/settings/workplace/index.ts
deleted file mode 100644
index a64592ac8b..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/settings/workplace/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './Workplace';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/trash/Trash.hooks.ts b/frontend/appflowy_tauri/src/appflowy_app/components/trash/Trash.hooks.ts
deleted file mode 100644
index b6748614b8..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/trash/Trash.hooks.ts
+++ /dev/null
@@ -1,79 +0,0 @@
-import { useCallback, useEffect, useState } from 'react';
-import { useAppDispatch, useAppSelector } from '@/appflowy_app/stores/store';
-import { trashActions, trashPBToTrash } from '$app_reducers/trash/slice';
-import { subscribeNotifications } from '$app/application/notification';
-import { FolderNotification } from '@/services/backend';
-import { deleteTrashItem, getTrash, putback, deleteAll, restoreAll } from '$app/application/folder/trash.service';
-
-export function useLoadTrash() {
- const trash = useAppSelector((state) => state.trash.list);
- const dispatch = useAppDispatch();
-
- const initializeTrash = useCallback(async () => {
- const trash = await getTrash();
-
- dispatch(trashActions.initTrash(trash.map(trashPBToTrash)));
- }, [dispatch]);
-
- useEffect(() => {
- void initializeTrash();
- }, [initializeTrash]);
-
- useEffect(() => {
- const unsubscribePromise = subscribeNotifications({
- [FolderNotification.DidUpdateTrash]: async (changeset) => {
- dispatch(trashActions.onTrashChanged(changeset.items.map(trashPBToTrash)));
- },
- });
-
- return () => {
- void unsubscribePromise.then((fn) => fn());
- };
- }, [dispatch]);
-
- return {
- trash,
- };
-}
-
-export function useTrashActions() {
- const [restoreAllDialogOpen, setRestoreAllDialogOpen] = useState(false);
- const [deleteAllDialogOpen, setDeleteAllDialogOpen] = useState(false);
- const [deleteDialogOpen, setDeleteDialogOpen] = useState(false);
-
- const [deleteId, setDeleteId] = useState('');
-
- const onClickRestoreAll = () => {
- setRestoreAllDialogOpen(true);
- };
-
- const onClickDeleteAll = () => {
- setDeleteAllDialogOpen(true);
- };
-
- const closeDialog = () => {
- setRestoreAllDialogOpen(false);
- setDeleteAllDialogOpen(false);
- setDeleteDialogOpen(false);
- };
-
- const onClickDelete = (id: string) => {
- setDeleteId(id);
- setDeleteDialogOpen(true);
- };
-
- return {
- onClickDelete,
- deleteDialogOpen,
- deleteId,
- onPutback: putback,
- onDelete: deleteTrashItem,
- onDeleteAll: deleteAll,
- onRestoreAll: restoreAll,
- onClickRestoreAll,
- onClickDeleteAll,
- restoreAllDialogOpen,
- deleteAllDialogOpen,
- closeDialog,
- };
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/trash/Trash.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/trash/Trash.tsx
deleted file mode 100644
index f10848dc9b..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/trash/Trash.tsx
+++ /dev/null
@@ -1,87 +0,0 @@
-import React, { useState } from 'react';
-import { useTranslation } from 'react-i18next';
-import Button from '@mui/material/Button';
-import { DeleteOutline, RestoreOutlined } from '@mui/icons-material';
-import { useLoadTrash, useTrashActions } from '$app/components/trash/Trash.hooks';
-import { List } from '@mui/material';
-import TrashItem from '$app/components/trash/TrashItem';
-import DeleteConfirmDialog from '$app/components/_shared/confirm_dialog/DeleteConfirmDialog';
-
-function Trash() {
- const { t } = useTranslation();
- const { trash } = useLoadTrash();
- const {
- onPutback,
- onDelete,
- onClickRestoreAll,
- onClickDeleteAll,
- restoreAllDialogOpen,
- deleteAllDialogOpen,
- onRestoreAll,
- onDeleteAll,
- closeDialog,
- deleteDialogOpen,
- deleteId,
- onClickDelete,
- } = useTrashActions();
- const [hoverId, setHoverId] = useState('');
-
- return (
- <div className={'flex flex-col'}>
- <div className={'flex items-center justify-between'}>
- <div className={'px-2 text-lg font-bold'}>{t('trash.text')}</div>
- <div className={'flex items-center justify-end'}>
- <Button color={'inherit'} onClick={() => onClickRestoreAll()}>
- <RestoreOutlined />
- <span className={'ml-1'}>{t('trash.restoreAll')}</span>
- </Button>
- <Button color={'error'} onClick={() => onClickDeleteAll()}>
- <DeleteOutline />
- <span className={'ml-1'}>{t('trash.deleteAll')}</span>
- </Button>
- </div>
- </div>
- <div className={'flex justify-around gap-2 p-6 px-2 text-xs text-text-caption'}>
- <div className={'w-[40%]'}>{t('trash.pageHeader.fileName')}</div>
- <div className={'flex-1'}>{t('trash.pageHeader.lastModified')}</div>
- <div className={'flex-1'}>{t('trash.pageHeader.created')}</div>
- <div className={'w-[64px]'}></div>
- </div>
- <List>
- {trash.map((item) => (
- <TrashItem
- item={item}
- key={item.id}
- onPutback={onPutback}
- onDelete={onClickDelete}
- hoverId={hoverId}
- setHoverId={setHoverId}
- />
- ))}
- </List>
- <DeleteConfirmDialog
- open={restoreAllDialogOpen}
- title={t('trash.confirmRestoreAll.title')}
- subtitle={t('trash.confirmRestoreAll.caption')}
- onOk={onRestoreAll}
- onClose={closeDialog}
- okText={t('trash.restoreAll')}
- />
- <DeleteConfirmDialog
- open={deleteAllDialogOpen}
- title={t('trash.confirmDeleteAll.title')}
- subtitle={t('trash.confirmDeleteAll.caption')}
- onOk={onDeleteAll}
- onClose={closeDialog}
- />
- <DeleteConfirmDialog
- open={deleteDialogOpen}
- title={t('trash.confirmDeleteTitle')}
- onOk={() => onDelete([deleteId])}
- onClose={closeDialog}
- />
- </div>
- );
-}
-
-export default Trash;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/trash/TrashItem.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/trash/TrashItem.tsx
deleted file mode 100644
index d266005612..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/components/trash/TrashItem.tsx
+++ /dev/null
@@ -1,65 +0,0 @@
-import React from 'react';
-import dayjs from 'dayjs';
-import { IconButton, ListItem } from '@mui/material';
-import { DeleteOutline, RestoreOutlined } from '@mui/icons-material';
-import Tooltip from '@mui/material/Tooltip';
-import { useTranslation } from 'react-i18next';
-import { Trash } from '$app_reducers/trash/slice';
-
-function TrashItem({
- item,
- hoverId,
- setHoverId,
- onDelete,
- onPutback,
-}: {
- setHoverId: (id: string) => void;
- item: Trash;
- hoverId: string;
- onPutback: (id: string) => void;
- onDelete: (id: string) => void;
-}) {
- const { t } = useTranslation();
-
- return (
- <ListItem
- onMouseEnter={() => {
- setHoverId(item.id);
- }}
- onMouseLeave={() => {
- setHoverId('');
- }}
- key={item.id}
- style={{
- paddingInline: 0,
- }}
- >
- <div className={'flex w-[100%] items-center justify-around gap-2 rounded-lg p-2 text-xs hover:bg-fill-list-hover'}>
- <div className={'w-[40%] whitespace-break-spaces text-left'}>
- {item.name.trim() || t('menuAppHeader.defaultNewPageName')}
- </div>
- <div className={'flex-1'}>{dayjs.unix(item.modifiedTime).format('MM/DD/YYYY hh:mm A')}</div>
- <div className={'flex-1'}>{dayjs.unix(item.createTime).format('MM/DD/YYYY hh:mm A')}</div>
- <div
- style={{
- visibility: hoverId === item.id ? 'visible' : 'hidden',
- }}
- className={'whitespace-nowrap'}
- >
- <Tooltip placement={'top-start'} title={t('button.putback')}>
- <IconButton size={'small'} onClick={(_) => onPutback(item.id)} className={'mr-2'}>
- <RestoreOutlined />
- </IconButton>
- </Tooltip>
- <Tooltip placement={'top-start'} title={t('button.delete')}>
- <IconButton size={'small'} color={'error'} onClick={(_) => onDelete(item.id)}>
- <DeleteOutline />
- </IconButton>
- </Tooltip>
- </div>
- </div>
- </ListItem>
- );
-}
-
-export default TrashItem;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/hooks/ViewId.hooks.ts b/frontend/appflowy_tauri/src/appflowy_app/hooks/ViewId.hooks.ts
deleted file mode 100644
index 6711ece8c8..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/hooks/ViewId.hooks.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-import { createContext, useContext } from 'react';
-
-const ViewIdContext = createContext('');
-
-export const ViewIdProvider = ViewIdContext.Provider;
-export const useViewId = () => useContext(ViewIdContext);
diff --git a/frontend/appflowy_tauri/src/appflowy_app/hooks/index.ts b/frontend/appflowy_tauri/src/appflowy_app/hooks/index.ts
deleted file mode 100644
index c29ddd04aa..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/hooks/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export * from './notification.hooks';
-export * from './ViewId.hooks';
diff --git a/frontend/appflowy_tauri/src/appflowy_app/hooks/notification.hooks.ts b/frontend/appflowy_tauri/src/appflowy_app/hooks/notification.hooks.ts
deleted file mode 100644
index f8669852d3..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/hooks/notification.hooks.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-/* eslint-disable no-redeclare */
-/* eslint-disable @typescript-eslint/no-explicit-any */
-import { useEffect } from 'react';
-import { NotificationEnum, NotificationHandler, subscribeNotification } from '$app/application/notification';
-
-export function useNotification<K extends NotificationEnum>(
- notification: K,
- callback: NotificationHandler<K>,
- options: { id?: string }
-): void {
- const { id } = options;
-
- useEffect(() => {
- const unsubscribePromise = subscribeNotification(notification, callback, { id });
-
- return () => {
- void unsubscribePromise.then((fn) => fn());
- };
- }, [callback, id, notification]);
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/hooks/page.hooks.tsx b/frontend/appflowy_tauri/src/appflowy_app/hooks/page.hooks.tsx
deleted file mode 100644
index 49e01e75c0..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/hooks/page.hooks.tsx
+++ /dev/null
@@ -1,26 +0,0 @@
-import { ViewLayoutPB } from '@/services/backend';
-import React from 'react';
-import { Page } from '$app_reducers/pages/slice';
-import { ReactComponent as DocumentIcon } from '$app/assets/document.svg';
-import { ReactComponent as GridIcon } from '$app/assets/grid.svg';
-import { ReactComponent as BoardIcon } from '$app/assets/board.svg';
-import { ReactComponent as CalendarIcon } from '$app/assets/date.svg';
-
-export function getPageIcon(page: Page) {
- if (page.icon) {
- return page.icon.value;
- }
-
- switch (page.layout) {
- case ViewLayoutPB.Document:
- return <DocumentIcon className={'h-4 w-4'} />;
- case ViewLayoutPB.Grid:
- return <GridIcon className={'h-4 w-4'} />;
- case ViewLayoutPB.Board:
- return <BoardIcon className={'h-4 w-4'} />;
- case ViewLayoutPB.Calendar:
- return <CalendarIcon className={'h-4 w-4'} />;
- default:
- return null;
- }
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/i18n/config.ts b/frontend/appflowy_tauri/src/appflowy_app/i18n/config.ts
deleted file mode 100644
index d36dba3bb2..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/i18n/config.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import i18next from 'i18next';
-import LanguageDetector from 'i18next-browser-languagedetector';
-import { initReactI18next } from 'react-i18next';
-import resourcesToBackend from 'i18next-resources-to-backend';
-
-void i18next
- .use(resourcesToBackend((language: string) => import(`./translations/${language}.json`)))
- .use(LanguageDetector)
- .use(initReactI18next)
- .init({
- lng: 'en',
- defaultNS: 'translation',
- debug: false,
- fallbackLng: 'en',
- });
diff --git a/frontend/appflowy_tauri/src/appflowy_app/slate-editor.d.ts b/frontend/appflowy_tauri/src/appflowy_app/slate-editor.d.ts
deleted file mode 100644
index 26b713e333..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/slate-editor.d.ts
+++ /dev/null
@@ -1,44 +0,0 @@
-import { ReactEditor } from 'slate-react';
-
-interface EditorInlineAttributes {
- bold?: boolean;
- italic?: boolean;
- underline?: boolean;
- strikethrough?: boolean;
- font_color?: string;
- bg_color?: string;
- href?: string;
- code?: boolean;
- formula?: string;
- prism_token?: string;
- class_name?: string;
- mention?: {
- type: string;
- // inline page ref id
- page?: string;
- // reminder date ref id
- date?: string;
- };
-}
-
-type CustomElement = {
- children: (CustomText | CustomElement)[];
- type: string;
- data?: unknown;
- blockId?: string;
- textId?: string;
-};
-
-type CustomText = { text: string } & EditorInlineAttributes;
-
-declare module 'slate' {
- interface CustomTypes {
- Editor: BaseEditor & ReactEditor;
- Element: CustomElement;
- Text: CustomText;
- }
-
- interface BaseEditor {
- isEmbed: (element: CustomElement) => boolean;
- }
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/stores/reducers/current-user/slice.ts b/frontend/appflowy_tauri/src/appflowy_app/stores/reducers/current-user/slice.ts
deleted file mode 100644
index 464b7428a3..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/stores/reducers/current-user/slice.ts
+++ /dev/null
@@ -1,99 +0,0 @@
-import { createSlice, PayloadAction } from '@reduxjs/toolkit';
-import { WorkspaceSettingPB } from '@/services/backend/models/flowy-folder/workspace';
-import { ThemeModePB as ThemeMode } from '@/services/backend';
-import { Page, parserViewPBToPage } from '$app_reducers/pages/slice';
-
-export { ThemeMode };
-
-export interface UserSetting {
- theme?: Theme;
- themeMode?: ThemeMode;
- language?: string;
- isDark?: boolean;
-}
-
-export enum Theme {
- Default = 'default',
- Dandelion = 'dandelion',
- Lavender = 'lavender',
-}
-
-export enum LoginState {
- Loading = 'loading',
- Success = 'success',
- Error = 'error',
-}
-
-export interface UserWorkspaceSetting {
- workspaceId: string;
- latestView?: Page;
- hasLatestView: boolean;
-}
-
-export function parseWorkspaceSettingPBToSetting(workspaceSetting: WorkspaceSettingPB): UserWorkspaceSetting {
- return {
- workspaceId: workspaceSetting.workspace_id,
- latestView: workspaceSetting.latest_view ? parserViewPBToPage(workspaceSetting.latest_view) : undefined,
- hasLatestView: !!workspaceSetting.latest_view,
- };
-}
-
-export interface ICurrentUser {
- id?: number;
- deviceId?: string;
- displayName?: string;
- email?: string;
- token?: string;
- iconUrl?: string;
- isAuthenticated: boolean;
- workspaceSetting?: UserWorkspaceSetting;
- userSetting: UserSetting;
- isLocal: boolean;
- loginState?: LoginState;
-}
-
-const initialState: ICurrentUser | null = {
- isAuthenticated: false,
- userSetting: {},
- isLocal: true,
-};
-
-export const currentUserSlice = createSlice({
- name: 'currentUser',
- initialState: initialState,
- reducers: {
- updateUser: (state, action: PayloadAction<Partial<ICurrentUser>>) => {
- return {
- ...state,
- ...action.payload,
- loginState: LoginState.Success,
- };
- },
- logout: () => {
- return initialState;
- },
- setUserSetting: (state, action: PayloadAction<Partial<UserSetting>>) => {
- state.userSetting = {
- ...state.userSetting,
- ...action.payload,
- };
- },
-
- setLoginState: (state, action: PayloadAction<LoginState>) => {
- state.loginState = action.payload;
- },
-
- resetLoginState: (state) => {
- state.loginState = undefined;
- },
-
- setLatestView: (state, action: PayloadAction<Page>) => {
- if (state.workspaceSetting) {
- state.workspaceSetting.latestView = action.payload;
- state.workspaceSetting.hasLatestView = true;
- }
- },
- },
-});
-
-export const currentUserActions = currentUserSlice.actions;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/stores/reducers/error/slice.ts b/frontend/appflowy_tauri/src/appflowy_app/stores/reducers/error/slice.ts
deleted file mode 100644
index 9b47df7777..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/stores/reducers/error/slice.ts
+++ /dev/null
@@ -1,32 +0,0 @@
-import { createSlice, PayloadAction } from '@reduxjs/toolkit';
-
-export interface IErrorOptions {
- display: boolean;
- message: string;
-}
-
-const initialState: IErrorOptions = {
- display: false,
- message: '',
-};
-
-export const errorSlice = createSlice({
- name: 'error',
- initialState: initialState,
- reducers: {
- showError(state, action: PayloadAction<string>) {
- return {
- display: true,
- message: action.payload,
- };
- },
- hideError() {
- return {
- display: false,
- message: '',
- };
- },
- },
-});
-
-export const errorActions = errorSlice.actions;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/stores/reducers/pages/async_actions.ts b/frontend/appflowy_tauri/src/appflowy_app/stores/reducers/pages/async_actions.ts
deleted file mode 100644
index 90014c1e7f..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/stores/reducers/pages/async_actions.ts
+++ /dev/null
@@ -1,106 +0,0 @@
-import { createAsyncThunk } from '@reduxjs/toolkit';
-import { RootState } from '$app/stores/store';
-import { pagesActions } from '$app_reducers/pages/slice';
-import { movePage, setLatestOpenedPage, updatePage } from '$app/application/folder/page.service';
-import debounce from 'lodash-es/debounce';
-import { currentUserActions } from '$app_reducers/current-user/slice';
-
-export const movePageThunk = createAsyncThunk(
- 'pages/movePage',
- async (
- payload: {
- sourceId: string;
- targetId: string;
- insertType: 'before' | 'after' | 'inside';
- },
- thunkAPI
- ) => {
- const { sourceId, targetId, insertType } = payload;
- const { getState, dispatch } = thunkAPI;
- const { pageMap, relationMap } = (getState() as RootState).pages;
- const sourcePage = pageMap[sourceId];
- const targetPage = pageMap[targetId];
-
- if (!sourcePage || !targetPage) return;
- const sourceParentId = sourcePage.parentId;
- const targetParentId = targetPage.parentId;
-
- if (!sourceParentId || !targetParentId) return;
-
- const targetParentChildren = relationMap[targetParentId] || [];
- const targetIndex = targetParentChildren.indexOf(targetId);
-
- if (targetIndex < 0) return;
-
- let prevId, parentId;
-
- if (insertType === 'before') {
- const prevIndex = targetIndex - 1;
-
- parentId = targetParentId;
- if (prevIndex >= 0) {
- prevId = targetParentChildren[prevIndex];
- }
- } else if (insertType === 'after') {
- prevId = targetId;
- parentId = targetParentId;
- } else {
- const targetChildren = relationMap[targetId] || [];
-
- parentId = targetId;
- if (targetChildren.length > 0) {
- prevId = targetChildren[targetChildren.length - 1];
- }
- }
-
- dispatch(pagesActions.movePage({ id: sourceId, newParentId: parentId, prevId }));
-
- await movePage({
- view_id: sourceId,
- new_parent_id: parentId,
- prev_view_id: prevId,
- });
- }
-);
-
-const debounceUpdateName = debounce(updatePage, 1000);
-
-export const updatePageName = createAsyncThunk(
- 'pages/updateName',
- async (payload: { id: string; name: string; immediate?: boolean }, thunkAPI) => {
- const { dispatch, getState } = thunkAPI;
- const { pageMap } = (getState() as RootState).pages;
- const { id, name, immediate } = payload;
- const page = pageMap[id];
-
- if (name === page.name) return;
-
- dispatch(
- pagesActions.onPageChanged({
- ...page,
- name,
- })
- );
-
- if (immediate) {
- await updatePage({ id, name });
- } else {
- await debounceUpdateName({
- id,
- name,
- });
- }
- }
-);
-
-export const openPage = createAsyncThunk('pages/openPage', async (id: string, thunkAPI) => {
- const { dispatch, getState } = thunkAPI;
- const { pageMap } = (getState() as RootState).pages;
-
- const page = pageMap[id];
-
- if (!page) return;
-
- dispatch(currentUserActions.setLatestView(page));
- await setLatestOpenedPage(id);
-});
diff --git a/frontend/appflowy_tauri/src/appflowy_app/stores/reducers/pages/slice.ts b/frontend/appflowy_tauri/src/appflowy_app/stores/reducers/pages/slice.ts
deleted file mode 100644
index dbf313ecc1..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/stores/reducers/pages/slice.ts
+++ /dev/null
@@ -1,223 +0,0 @@
-import { ViewIconTypePB, ViewLayoutPB, ViewPB } from '@/services/backend';
-import { createSlice, PayloadAction } from '@reduxjs/toolkit';
-import isEqual from 'lodash-es/isEqual';
-import { ImageType } from '$app/application/document/document.types';
-import { Nullable } from 'unsplash-js/dist/helpers/typescript';
-
-export const pageTypeMap = {
- [ViewLayoutPB.Document]: 'document',
- [ViewLayoutPB.Board]: 'board',
- [ViewLayoutPB.Grid]: 'grid',
- [ViewLayoutPB.Calendar]: 'calendar',
-};
-export interface Page {
- id: string;
- parentId: string;
- name: string;
- layout: ViewLayoutPB;
- icon?: PageIcon;
- cover?: PageCover;
-}
-
-export interface PageIcon {
- ty: ViewIconTypePB;
- value: string;
-}
-
-export enum CoverType {
- Color = 'CoverType.color',
- Image = 'CoverType.file',
- Asset = 'CoverType.asset',
-}
-export type PageCover = Nullable<{
- image_type?: ImageType;
- cover_selection_type?: CoverType;
- cover_selection?: string;
-}>;
-
-export function parserViewPBToPage(view: ViewPB): Page {
- const icon = view.icon;
-
- return {
- id: view.id,
- name: view.name,
- parentId: view.parent_view_id,
- layout: view.layout,
- icon: icon
- ? {
- ty: icon.ty,
- value: icon.value,
- }
- : undefined,
- };
-}
-
-export interface PageState {
- pageMap: Record<string, Page>;
- relationMap: Record<string, string[] | undefined>;
- expandedIdMap: Record<string, boolean>;
- showTrashSnackbar: boolean;
-}
-
-export const initialState: PageState = {
- pageMap: {},
- relationMap: {},
- expandedIdMap: getExpandedPageIds().reduce((acc, id) => {
- acc[id] = true;
- return acc;
- }, {} as Record<string, boolean>),
- showTrashSnackbar: false,
-};
-
-export const pagesSlice = createSlice({
- name: 'pages',
- initialState,
- reducers: {
- addChildPages(
- state,
- action: PayloadAction<{
- childPages: Page[];
- id: string;
- }>
- ) {
- const { childPages, id } = action.payload;
- const pageMap: Record<string, Page> = {};
-
- const children: string[] = [];
-
- childPages.forEach((page) => {
- pageMap[page.id] = page;
- children.push(page.id);
- });
-
- state.pageMap = {
- ...state.pageMap,
- ...pageMap,
- };
- state.relationMap[id] = children;
- },
-
- onPageChanged(state, action: PayloadAction<Page>) {
- const page = action.payload;
-
- if (!isEqual(state.pageMap[page.id], page)) {
- state.pageMap[page.id] = page;
- }
- },
-
- addPage(
- state,
- action: PayloadAction<{
- page: Page;
- isLast?: boolean;
- prevId?: string;
- }>
- ) {
- const { page, prevId, isLast } = action.payload;
-
- state.pageMap[page.id] = page;
- state.relationMap[page.id] = [];
-
- const parentId = page.parentId;
-
- if (isLast) {
- state.relationMap[parentId]?.push(page.id);
- } else {
- const index = prevId ? state.relationMap[parentId]?.indexOf(prevId) ?? -1 : -1;
-
- state.relationMap[parentId]?.splice(index + 1, 0, page.id);
- }
- },
-
- deletePages(state, action: PayloadAction<string[]>) {
- const ids = action.payload;
-
- ids.forEach((id) => {
- const parentId = state.pageMap[id].parentId;
- const parentChildren = state.relationMap[parentId];
-
- state.relationMap[parentId] = parentChildren && parentChildren.filter((childId) => childId !== id);
- delete state.relationMap[id];
- delete state.expandedIdMap[id];
- delete state.pageMap[id];
- });
- },
-
- duplicatePage(
- state,
- action: PayloadAction<{
- id: string;
- newId: string;
- }>
- ) {
- const { id, newId } = action.payload;
- const page = state.pageMap[id];
- const newPage = { ...page, id: newId };
-
- state.pageMap[newPage.id] = newPage;
-
- const index = state.relationMap[page.parentId]?.indexOf(id);
-
- state.relationMap[page.parentId]?.splice(index ?? 0, 0, newId);
- },
-
- movePage(
- state,
- action: PayloadAction<{
- id: string;
- newParentId: string;
- prevId?: string;
- }>
- ) {
- const { id, newParentId, prevId } = action.payload;
- const parentId = state.pageMap[id].parentId;
- const parentChildren = state.relationMap[parentId];
-
- const index = parentChildren?.indexOf(id) ?? -1;
-
- if (index > -1) {
- state.relationMap[parentId]?.splice(index, 1);
- }
-
- state.pageMap[id].parentId = newParentId;
- const newParentChildren = state.relationMap[newParentId] || [];
- const prevIndex = prevId ? newParentChildren.indexOf(prevId) : -1;
-
- state.relationMap[newParentId]?.splice(prevIndex + 1, 0, id);
- },
-
- expandPage(state, action: PayloadAction<string>) {
- const id = action.payload;
-
- state.expandedIdMap[id] = true;
- const ids = Object.keys(state.expandedIdMap).filter((id) => state.expandedIdMap[id]);
-
- storeExpandedPageIds(ids);
- },
-
- collapsePage(state, action: PayloadAction<string>) {
- const id = action.payload;
-
- state.expandedIdMap[id] = false;
- const ids = Object.keys(state.expandedIdMap).filter((id) => state.expandedIdMap[id]);
-
- storeExpandedPageIds(ids);
- },
-
- setTrashSnackbar(state, action: PayloadAction<boolean>) {
- state.showTrashSnackbar = action.payload;
- },
- },
-});
-
-export const pagesActions = pagesSlice.actions;
-
-function storeExpandedPageIds(expandedPageIds: string[]) {
- localStorage.setItem('expandedPageIds', JSON.stringify(expandedPageIds));
-}
-
-function getExpandedPageIds(): string[] {
- const expandedPageIds = localStorage.getItem('expandedPageIds');
-
- return expandedPageIds ? JSON.parse(expandedPageIds) : [];
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/stores/reducers/sidebar/slice.ts b/frontend/appflowy_tauri/src/appflowy_app/stores/reducers/sidebar/slice.ts
deleted file mode 100644
index fae1d59214..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/stores/reducers/sidebar/slice.ts
+++ /dev/null
@@ -1,37 +0,0 @@
-import { createSlice, PayloadAction } from '@reduxjs/toolkit';
-
-interface SidebarState {
- isCollapsed: boolean;
- width: number;
- isResizing: boolean;
-}
-
-const initialState: SidebarState = {
- isCollapsed: false,
- width: 250,
- isResizing: false,
-};
-
-export const sidebarSlice = createSlice({
- name: 'sidebar',
- initialState: initialState,
- reducers: {
- toggleCollapse(state) {
- state.isCollapsed = !state.isCollapsed;
- },
- setCollapse(state, action: PayloadAction<boolean>) {
- state.isCollapsed = action.payload;
- },
- changeWidth(state, action: PayloadAction<number>) {
- state.width = action.payload;
- },
- startResizing(state) {
- state.isResizing = true;
- },
- stopResizing(state) {
- state.isResizing = false;
- },
- },
-});
-
-export const sidebarActions = sidebarSlice.actions;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/stores/reducers/trash/slice.ts b/frontend/appflowy_tauri/src/appflowy_app/stores/reducers/trash/slice.ts
deleted file mode 100644
index 98d850f6fe..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/stores/reducers/trash/slice.ts
+++ /dev/null
@@ -1,41 +0,0 @@
-import { createSlice, PayloadAction } from '@reduxjs/toolkit';
-import { TrashPB } from '@/services/backend';
-
-export interface Trash {
- id: string;
- name: string;
- modifiedTime: number;
- createTime: number;
-}
-
-export function trashPBToTrash(trash: TrashPB) {
- return {
- id: trash.id,
- name: trash.name,
- modifiedTime: trash.modified_time,
- createTime: trash.create_time,
- };
-}
-
-interface TrashState {
- list: Trash[];
-}
-
-const initialState: TrashState = {
- list: [],
-};
-
-export const trashSlice = createSlice({
- name: 'trash',
- initialState,
- reducers: {
- initTrash: (state, action: PayloadAction<Trash[]>) => {
- state.list = action.payload;
- },
- onTrashChanged: (state, action: PayloadAction<Trash[]>) => {
- state.list = action.payload;
- },
- },
-});
-
-export const trashActions = trashSlice.actions;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/stores/reducers/workspace/slice.ts b/frontend/appflowy_tauri/src/appflowy_app/stores/reducers/workspace/slice.ts
deleted file mode 100644
index d071de846e..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/stores/reducers/workspace/slice.ts
+++ /dev/null
@@ -1,46 +0,0 @@
-import { createSlice, PayloadAction } from '@reduxjs/toolkit';
-
-export interface WorkspaceItem {
- id: string;
- name: string;
- icon?: string;
-}
-
-interface WorkspaceState {
- workspaces: WorkspaceItem[];
- currentWorkspaceId: string | null;
-}
-
-const initialState: WorkspaceState = {
- workspaces: [],
- currentWorkspaceId: null,
-};
-
-export const workspaceSlice = createSlice({
- name: 'workspace',
- initialState,
- reducers: {
- initWorkspaces: (
- state,
- action: PayloadAction<{
- workspaces: WorkspaceItem[];
- currentWorkspaceId: string | null;
- }>
- ) => {
- return action.payload;
- },
-
- updateWorkspace: (state, action: PayloadAction<Partial<WorkspaceItem>>) => {
- const index = state.workspaces.findIndex((workspace) => workspace.id === action.payload.id);
-
- if (index !== -1) {
- state.workspaces[index] = {
- ...state.workspaces[index],
- ...action.payload,
- };
- }
- },
- },
-});
-
-export const workspaceActions = workspaceSlice.actions;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/stores/store.ts b/frontend/appflowy_tauri/src/appflowy_app/stores/store.ts
deleted file mode 100644
index 269f46884c..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/stores/store.ts
+++ /dev/null
@@ -1,51 +0,0 @@
-import { TypedUseSelectorHook, useDispatch, useSelector } from 'react-redux';
-import {
- configureStore,
- createListenerMiddleware,
- TypedStartListening,
- TypedAddListener,
- ListenerEffectAPI,
- addListener,
-} from '@reduxjs/toolkit';
-import { pagesSlice } from './reducers/pages/slice';
-import { currentUserSlice } from './reducers/current-user/slice';
-import { workspaceSlice } from './reducers/workspace/slice';
-import { errorSlice } from './reducers/error/slice';
-import { sidebarSlice } from '$app_reducers/sidebar/slice';
-import { trashSlice } from '$app_reducers/trash/slice';
-
-const listenerMiddlewareInstance = createListenerMiddleware({
- onError: () => console.error,
-});
-
-const store = configureStore({
- reducer: {
- [pagesSlice.name]: pagesSlice.reducer,
- [currentUserSlice.name]: currentUserSlice.reducer,
- [workspaceSlice.name]: workspaceSlice.reducer,
- [errorSlice.name]: errorSlice.reducer,
- [sidebarSlice.name]: sidebarSlice.reducer,
- [trashSlice.name]: trashSlice.reducer,
- },
- middleware: (gDM) => gDM({ serializableCheck: false }).prepend(listenerMiddlewareInstance.middleware),
-});
-
-export { store };
-
-// Infer the `RootState` and `AppDispatch` types from the store itself
-export type RootState = ReturnType<typeof store.getState>;
-// @see https://redux-toolkit.js.org/usage/usage-with-typescript#getting-the-dispatch-type
-export type AppDispatch = typeof store.dispatch;
-
-export type AppListenerEffectAPI = ListenerEffectAPI<RootState, AppDispatch>;
-
-// @see https://redux-toolkit.js.org/api/createListenerMiddleware#typescript-usage
-export type AppStartListening = TypedStartListening<RootState, AppDispatch>;
-export type AppAddListener = TypedAddListener<RootState, AppDispatch>;
-
-export const startAppListening = listenerMiddlewareInstance.startListening as AppStartListening;
-export const addAppListener = addListener as AppAddListener;
-
-// Use throughout your app instead of plain `useDispatch` and `useSelector`
-export const useAppDispatch = () => useDispatch<AppDispatch>();
-export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/utils/async_queue.ts b/frontend/appflowy_tauri/src/appflowy_app/utils/async_queue.ts
deleted file mode 100644
index 7e673506de..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/utils/async_queue.ts
+++ /dev/null
@@ -1,51 +0,0 @@
-import { Log } from '$app/utils/log';
-
-export class AsyncQueue<T = unknown> {
- private queue: T[] = [];
- private isProcessing = false;
- private executeFunction: (item: T) => Promise<void>;
-
- constructor(executeFunction: (item: T) => Promise<void>) {
- this.executeFunction = executeFunction;
- }
-
- enqueue(item: T): void {
- this.queue.push(item);
- this.processQueue();
- }
-
- private processQueue(): void {
- if (this.isProcessing || this.queue.length === 0) {
- return;
- }
-
- const item = this.queue.shift();
-
- if (!item) {
- return;
- }
-
- this.isProcessing = true;
-
- const executeFn = async (item: T) => {
- try {
- await this.processItem(item);
- } catch (error) {
- Log.error('queue processing error:', error);
- } finally {
- this.isProcessing = false;
- this.processQueue();
- }
- };
-
- void executeFn(item);
- }
-
- private async processItem(item: T): Promise<void> {
- try {
- await this.executeFunction(item);
- } catch (error) {
- Log.error('queue processing error:', error);
- }
- }
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/utils/avatar.ts b/frontend/appflowy_tauri/src/appflowy_app/utils/avatar.ts
deleted file mode 100644
index a9a752c579..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/utils/avatar.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-export function stringToColor(string: string) {
- let hash = 0;
- let i;
-
- /* eslint-disable no-bitwise */
- for (i = 0; i < string.length; i += 1) {
- hash = string.charCodeAt(i) + ((hash << 5) - hash);
- }
-
- let color = '#';
-
- for (i = 0; i < 3; i += 1) {
- const value = (hash >> (i * 8)) & 0xff;
-
- color += `00${value.toString(16)}`.slice(-2);
- }
- /* eslint-enable no-bitwise */
-
- return color;
-}
-
-export function stringToShortName(string: string) {
- const [firstName, lastName = ''] = string.split(' ');
-
- return `${firstName.charAt(0)}${lastName.charAt(0)}`;
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/utils/change_notifier.ts b/frontend/appflowy_tauri/src/appflowy_app/utils/change_notifier.ts
deleted file mode 100644
index 57d9f2a370..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/utils/change_notifier.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-import { Observable, Subject } from 'rxjs';
-
-export class ChangeNotifier<T> {
- private isUnsubscribe = false;
- private subject = new Subject<T>();
-
- notify(value: T) {
- this.subject.next(value);
- }
-
- get observer(): Observable<T> | null {
- if (this.isUnsubscribe) {
- return null;
- }
-
- return this.subject.asObservable();
- }
-
- // Unsubscribe the subject might cause [UnsubscribedError] error if there is
- // ongoing Observable execution.
- //
- // Maybe you should use the [Subscription] that returned when call subscribe on
- // [Observable] to unsubscribe.
- unsubscribe = () => {
- if (!this.isUnsubscribe) {
- this.isUnsubscribe = true;
- this.subject.unsubscribe();
- }
- };
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/utils/color.ts b/frontend/appflowy_tauri/src/appflowy_app/utils/color.ts
deleted file mode 100644
index 025c8c45ed..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/utils/color.ts
+++ /dev/null
@@ -1,50 +0,0 @@
-export enum ColorEnum {
- Purple = 'appflowy_them_color_tint1',
- Pink = 'appflowy_them_color_tint2',
- LightPink = 'appflowy_them_color_tint3',
- Orange = 'appflowy_them_color_tint4',
- Yellow = 'appflowy_them_color_tint5',
- Lime = 'appflowy_them_color_tint6',
- Green = 'appflowy_them_color_tint7',
- Aqua = 'appflowy_them_color_tint8',
- Blue = 'appflowy_them_color_tint9',
-}
-
-export const colorMap = {
- [ColorEnum.Purple]: 'var(--tint-purple)',
- [ColorEnum.Pink]: 'var(--tint-pink)',
- [ColorEnum.LightPink]: 'var(--tint-red)',
- [ColorEnum.Orange]: 'var(--tint-orange)',
- [ColorEnum.Yellow]: 'var(--tint-yellow)',
- [ColorEnum.Lime]: 'var(--tint-lime)',
- [ColorEnum.Green]: 'var(--tint-green)',
- [ColorEnum.Aqua]: 'var(--tint-aqua)',
- [ColorEnum.Blue]: 'var(--tint-blue)',
-};
-
-// Convert ARGB to RGBA
-// Flutter uses ARGB, but CSS uses RGBA
-function argbToRgba(color: string): string {
- const hex = color.replace(/^#|0x/, '');
-
- const hasAlpha = hex.length === 8;
-
- if (!hasAlpha) {
- return color.replace('0x', '#');
- }
-
- const r = parseInt(hex.slice(2, 4), 16);
- const g = parseInt(hex.slice(4, 6), 16);
- const b = parseInt(hex.slice(6, 8), 16);
- const a = hasAlpha ? parseInt(hex.slice(0, 2), 16) / 255 : 1;
-
- return `rgba(${r}, ${g}, ${b}, ${a})`;
-}
-
-export function renderColor(color: string) {
- if (colorMap[color as ColorEnum]) {
- return colorMap[color as ColorEnum];
- }
-
- return argbToRgba(color);
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/utils/emoji.ts b/frontend/appflowy_tauri/src/appflowy_app/utils/emoji.ts
deleted file mode 100644
index 8d5adb5df6..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/utils/emoji.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import emojiData, { EmojiMartData } from '@emoji-mart/data';
-
-export const randomEmoji = (skin = 0) => {
- const emojis = (emojiData as EmojiMartData).emojis;
- const keys = Object.keys(emojis);
- const randomKey = keys[Math.floor(Math.random() * keys.length)];
-
- return emojis[randomKey].skins[skin].native;
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/utils/env.ts b/frontend/appflowy_tauri/src/appflowy_app/utils/env.ts
deleted file mode 100644
index 064dc042aa..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/utils/env.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-export function isApple() {
- return typeof navigator !== 'undefined' && /Mac OS X/.test(navigator.userAgent);
-}
-
-export function isTauri() {
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
- // @ts-ignore
- const isTauri = window.__TAURI__;
-
- return isTauri;
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/utils/hotkeys.ts b/frontend/appflowy_tauri/src/appflowy_app/utils/hotkeys.ts
deleted file mode 100644
index 20aa05db27..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/utils/hotkeys.ts
+++ /dev/null
@@ -1,134 +0,0 @@
-import isHotkey from 'is-hotkey';
-
-export const isMac = () => {
- return navigator.userAgent.includes('Mac OS X');
-};
-
-const MODIFIERS = {
- control: 'Ctrl',
- meta: '⌘',
-};
-
-export const getModifier = () => {
- return isMac() ? MODIFIERS.meta : MODIFIERS.control;
-};
-
-export enum HOT_KEY_NAME {
- LEFT = 'left',
- RIGHT = 'right',
- SELECT_ALL = 'select-all',
- ESCAPE = 'escape',
- ALIGN_LEFT = 'align-left',
- ALIGN_CENTER = 'align-center',
- ALIGN_RIGHT = 'align-right',
- BOLD = 'bold',
- ITALIC = 'italic',
- UNDERLINE = 'underline',
- STRIKETHROUGH = 'strikethrough',
- CODE = 'code',
- TOGGLE_TODO = 'toggle-todo',
- TOGGLE_COLLAPSE = 'toggle-collapse',
- INDENT_BLOCK = 'indent-block',
- OUTDENT_BLOCK = 'outdent-block',
- INSERT_SOFT_BREAK = 'insert-soft-break',
- SPLIT_BLOCK = 'split-block',
- BACKSPACE = 'backspace',
- OPEN_LINK = 'open-link',
- OPEN_LINKS = 'open-links',
- EXTEND_LINE_BACKWARD = 'extend-line-backward',
- EXTEND_LINE_FORWARD = 'extend-line-forward',
- PASTE = 'paste',
- PASTE_PLAIN_TEXT = 'paste-plain-text',
- HIGH_LIGHT = 'high-light',
- EXTEND_DOCUMENT_BACKWARD = 'extend-document-backward',
- EXTEND_DOCUMENT_FORWARD = 'extend-document-forward',
- SCROLL_TO_TOP = 'scroll-to-top',
- SCROLL_TO_BOTTOM = 'scroll-to-bottom',
- FORMAT_LINK = 'format-link',
- FIND_REPLACE = 'find-replace',
- /**
- * Navigation
- */
- TOGGLE_THEME = 'toggle-theme',
- TOGGLE_SIDEBAR = 'toggle-sidebar',
-}
-
-const defaultHotKeys = {
- [HOT_KEY_NAME.ALIGN_LEFT]: ['control+shift+l'],
- [HOT_KEY_NAME.ALIGN_CENTER]: ['control+shift+e'],
- [HOT_KEY_NAME.ALIGN_RIGHT]: ['control+shift+r'],
- [HOT_KEY_NAME.BOLD]: ['mod+b'],
- [HOT_KEY_NAME.ITALIC]: ['mod+i'],
- [HOT_KEY_NAME.UNDERLINE]: ['mod+u'],
- [HOT_KEY_NAME.STRIKETHROUGH]: ['mod+shift+s', 'mod+shift+x'],
- [HOT_KEY_NAME.CODE]: ['mod+e'],
- [HOT_KEY_NAME.TOGGLE_TODO]: ['mod+enter'],
- [HOT_KEY_NAME.TOGGLE_COLLAPSE]: ['mod+enter'],
- [HOT_KEY_NAME.SELECT_ALL]: ['mod+a'],
- [HOT_KEY_NAME.ESCAPE]: ['esc'],
- [HOT_KEY_NAME.INDENT_BLOCK]: ['tab'],
- [HOT_KEY_NAME.OUTDENT_BLOCK]: ['shift+tab'],
- [HOT_KEY_NAME.SPLIT_BLOCK]: ['enter'],
- [HOT_KEY_NAME.INSERT_SOFT_BREAK]: ['shift+enter'],
- [HOT_KEY_NAME.BACKSPACE]: ['backspace', 'shift+backspace'],
- [HOT_KEY_NAME.OPEN_LINK]: ['opt+enter'],
- [HOT_KEY_NAME.OPEN_LINKS]: ['opt+shift+enter'],
- [HOT_KEY_NAME.EXTEND_LINE_BACKWARD]: ['opt+shift+left'],
- [HOT_KEY_NAME.EXTEND_LINE_FORWARD]: ['opt+shift+right'],
- [HOT_KEY_NAME.PASTE]: ['mod+v'],
- [HOT_KEY_NAME.PASTE_PLAIN_TEXT]: ['mod+shift+v'],
- [HOT_KEY_NAME.HIGH_LIGHT]: ['mod+shift+h'],
- [HOT_KEY_NAME.EXTEND_DOCUMENT_BACKWARD]: ['mod+shift+up'],
- [HOT_KEY_NAME.EXTEND_DOCUMENT_FORWARD]: ['mod+shift+down'],
- [HOT_KEY_NAME.SCROLL_TO_TOP]: ['home'],
- [HOT_KEY_NAME.SCROLL_TO_BOTTOM]: ['end'],
- [HOT_KEY_NAME.TOGGLE_THEME]: ['mod+shift+l'],
- [HOT_KEY_NAME.TOGGLE_SIDEBAR]: ['mod+.'],
- [HOT_KEY_NAME.FORMAT_LINK]: ['mod+k'],
- [HOT_KEY_NAME.LEFT]: ['left'],
- [HOT_KEY_NAME.RIGHT]: ['right'],
- [HOT_KEY_NAME.FIND_REPLACE]: ['mod+f'],
-};
-
-const replaceModifier = (hotkey: string) => {
- return hotkey.replace('mod', getModifier()).replace('control', 'ctrl');
-};
-
-/**
- * Create a hotkey checker.
- * @example trigger strike through when user press "Cmd + Shift + S" or "Cmd + Shift + X"
- * @param hotkeyName
- * @param customHotKeys
- */
-export const createHotkey = (hotkeyName: HOT_KEY_NAME, customHotKeys?: Record<HOT_KEY_NAME, string[]>) => {
- const keys = customHotKeys || defaultHotKeys;
- const hotkeys = keys[hotkeyName];
-
- return (event: KeyboardEvent) => {
- return hotkeys.some((hotkey) => {
- return isHotkey(hotkey, event);
- });
- };
-};
-
-/**
- * Create a hotkey label.
- * eg. "Ctrl + B / ⌘ + B"
- * @param hotkeyName
- * @param customHotKeys
- */
-export const createHotKeyLabel = (hotkeyName: HOT_KEY_NAME, customHotKeys?: Record<HOT_KEY_NAME, string[]>) => {
- const keys = customHotKeys || defaultHotKeys;
- const hotkeys = keys[hotkeyName].map((key) => replaceModifier(key));
-
- return hotkeys
- .map((hotkey) =>
- hotkey
- .split('+')
- .map((key) => {
- return key === ' ' ? 'Space' : key.charAt(0).toUpperCase() + key.slice(1);
- })
- .join(' + ')
- )
- .join(' / ');
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/utils/list.ts b/frontend/appflowy_tauri/src/appflowy_app/utils/list.ts
deleted file mode 100644
index 6e5d22ccda..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/utils/list.ts
+++ /dev/null
@@ -1,45 +0,0 @@
-const romanMap: [number, string][] = [
- [1000, 'M'],
- [900, 'CM'],
- [500, 'D'],
- [400, 'CD'],
- [100, 'C'],
- [90, 'XC'],
- [50, 'L'],
- [40, 'XL'],
- [10, 'X'],
- [9, 'IX'],
- [5, 'V'],
- [4, 'IV'],
- [1, 'I'],
-];
-
-export function romanize(num: number): string {
- let result = '';
- let nextNum = num;
-
- for (const [value, symbol] of romanMap) {
- const count = Math.floor(nextNum / value);
-
- nextNum -= value * count;
- result += symbol.repeat(count);
- if (nextNum === 0) break;
- }
-
- return result;
-}
-
-export function letterize(num: number): string {
- let nextNum = num;
- let letters = '';
-
- while (nextNum > 0) {
- nextNum--;
- const letter = String.fromCharCode((nextNum % 26) + 'a'.charCodeAt(0));
-
- letters = letter + letters;
- nextNum = Math.floor(nextNum / 26);
- }
-
- return letters;
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/utils/log.ts b/frontend/appflowy_tauri/src/appflowy_app/utils/log.ts
deleted file mode 100644
index daccf21d0a..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/utils/log.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-export class Log {
- static error(...msg: unknown[]) {
- console.error(...msg);
- }
- static info(...msg: unknown[]) {
- console.info(...msg);
- }
-
- static debug(...msg: unknown[]) {
- console.debug(...msg);
- }
-
- static trace(...msg: unknown[]) {
- console.trace(...msg);
- }
-
- static warn(...msg: unknown[]) {
- console.warn(...msg);
- }
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/utils/mui.ts b/frontend/appflowy_tauri/src/appflowy_app/utils/mui.ts
deleted file mode 100644
index 94e2cf94d5..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/utils/mui.ts
+++ /dev/null
@@ -1,168 +0,0 @@
-import { ThemeOptions } from '@mui/material';
-
-// eslint-disable-next-line @typescript-eslint/ban-ts-comment
-// @ts-ignore
-export const getDesignTokens = (isDark: boolean): ThemeOptions => {
- return {
- typography: {
- fontFamily: ['Poppins'].join(','),
- fontSize: 12,
- button: {
- textTransform: 'none',
- },
- },
- components: {
- MuiMenuItem: {
- defaultProps: {
- sx: {
- '&.Mui-selected.Mui-focusVisible': {
- backgroundColor: 'var(--fill-list-hover)',
- },
- '&.Mui-focusVisible': {
- backgroundColor: 'unset',
- },
- },
- },
- },
- MuiIconButton: {
- styleOverrides: {
- root: {
- '&:hover': {
- backgroundColor: 'var(--fill-list-hover)',
- },
- borderRadius: '4px',
- padding: '2px',
- },
- },
- },
- MuiButton: {
- styleOverrides: {
- contained: {
- color: 'var(--content-on-fill)',
- boxShadow: 'var(--shadow)',
- },
- containedPrimary: {
- '&:hover': {
- backgroundColor: 'var(--fill-default)',
- },
- },
- containedInherit: {
- color: 'var(--text-title)',
- backgroundColor: isDark ? 'rgba(0, 0, 0, 0.4)' : 'rgba(255, 255, 255, 0.4)',
- '&:hover': {
- backgroundColor: 'var(--bg-body)',
- boxShadow: 'var(--shadow)',
- },
- },
- outlinedInherit: {
- color: 'var(--text-title)',
- borderColor: 'var(--line-border)',
- '&:hover': {
- boxShadow: 'var(--shadow)',
- },
- },
- },
- },
- MuiButtonBase: {
- defaultProps: {
- sx: {
- '&.Mui-selected:hover': {
- backgroundColor: 'var(--fill-list-hover)',
- },
- },
- },
- styleOverrides: {
- root: {
- '&:hover': {
- backgroundColor: 'var(--fill-list-hover)',
- },
- '&:active': {
- backgroundColor: 'var(--fill-list-hover)',
- },
- borderRadius: '4px',
- padding: '2px',
- boxShadow: 'none',
- },
- },
- },
- MuiPaper: {
- styleOverrides: {
- root: {
- backgroundImage: 'none',
- },
- },
- },
- MuiDialog: {
- defaultProps: {
- sx: {
- '& .MuiBackdrop-root': {
- backgroundColor: 'var(--bg-mask)',
- },
- },
- },
- },
-
- MuiTooltip: {
- styleOverrides: {
- arrow: {
- color: 'var(--bg-tips)',
- },
- tooltip: {
- backgroundColor: 'var(--bg-tips)',
- color: 'var(--text-title)',
- fontSize: '0.85rem',
- borderRadius: '8px',
- fontWeight: 400,
- },
- },
- },
- MuiInputBase: {
- styleOverrides: {
- input: {
- backgroundColor: 'transparent !important',
- },
- },
- },
- MuiDivider: {
- styleOverrides: {
- root: {
- borderColor: 'var(--line-divider)',
- },
- },
- },
- },
- palette: {
- mode: isDark ? 'dark' : 'light',
- primary: {
- main: '#00BCF0',
- dark: '#00BCF0',
- },
- error: {
- main: '#FB006D',
- dark: '#D32772',
- },
- warning: {
- main: '#FFC107',
- dark: '#E9B320',
- },
- info: {
- main: '#00BCF0',
- dark: '#2E9DBB',
- },
- success: {
- main: '#66CF80',
- dark: '#3BA856',
- },
- text: {
- primary: isDark ? '#E2E9F2' : '#333333',
- secondary: isDark ? '#7B8A9D' : '#828282',
- disabled: isDark ? '#363D49' : '#F2F2F2',
- },
- divider: isDark ? '#59647A' : '#BDBDBD',
- background: {
- default: isDark ? '#1A202C' : '#FFFFFF',
- paper: isDark ? '#1A202C' : '#FFFFFF',
- },
- },
- };
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/utils/open_url.ts b/frontend/appflowy_tauri/src/appflowy_app/utils/open_url.ts
deleted file mode 100644
index d854be5211..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/utils/open_url.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-import { open as openWindow } from '@tauri-apps/api/shell';
-
-const urlPattern = /^(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})(\S*)*\/?(\?[=&\w.%-]*)?(#[\w.\-!~*'()]*)?$/;
-const ipPattern = /^(https?:\/\/)?(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})(:\d{1,5})?$/;
-
-export function isUrl(str: string) {
- return urlPattern.test(str) || ipPattern.test(str);
-}
-
-export function openUrl(str: string) {
- if (isUrl(str)) {
- const linkPrefix = ['http://', 'https://', 'file://', 'ftp://', 'ftps://', 'mailto:'];
-
- if (linkPrefix.some((prefix) => str.startsWith(prefix))) {
- void openWindow(str);
- } else {
- void openWindow('https://' + str);
- }
- } else {
- // open google search
- void openWindow('https://www.google.com/search?q=' + encodeURIComponent(str));
- }
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/utils/tool.ts b/frontend/appflowy_tauri/src/appflowy_app/utils/tool.ts
deleted file mode 100644
index afcd7a32b4..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/utils/tool.ts
+++ /dev/null
@@ -1,57 +0,0 @@
-/* eslint-disable @typescript-eslint/no-explicit-any */
-
-/**
- * Creates an interval that repeatedly calls the given function with a specified delay.
- *
- * @param {Function} fn - The function to be called repeatedly.
- * @param {number} [delay] - The delay between function calls in milliseconds.
- * @param {Object} [options] - Additional options for the interval.
- * @param {boolean} [options.immediate] - Whether to immediately call the function when the interval is created. Default is true.
- *
- * @return {Function} - The function that runs the interval.
- * @return {Function.cancel} - A method to cancel the interval.
- *
- * @example
- * const log = interval((message) => console.log(message), 1000);
- *
- * log('foo'); // prints 'foo' every second.
- *
- * log('bar'); // change to prints 'bar' every second.
- *
- * log.cancel(); // stops the interval.
- */
-export function interval<T extends (...args: any[]) => any = (...args: any[]) => any>(
- fn: T,
- delay?: number,
- options?: { immediate?: boolean }
-): T & { cancel: () => void } {
- const { immediate = true } = options || {};
- let intervalId: NodeJS.Timer | null = null;
- let parameters: any[] = [];
-
- function run(...args: Parameters<T>) {
- parameters = args;
-
- if (intervalId !== null) {
- return;
- }
-
- immediate && fn.apply(undefined, parameters);
- intervalId = setInterval(() => {
- fn.apply(undefined, parameters);
- }, delay);
- }
-
- function cancel() {
- if (intervalId === null) {
- return;
- }
-
- clearInterval(intervalId);
- intervalId = null;
- parameters = [];
- }
-
- run.cancel = cancel;
- return run as T & { cancel: () => void };
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/utils/upload_image.ts b/frontend/appflowy_tauri/src/appflowy_app/utils/upload_image.ts
deleted file mode 100644
index 22213ac8b3..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/utils/upload_image.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-export const MAX_IMAGE_SIZE = 10 * 1024 * 1024; // 10MB
-export const ALLOWED_IMAGE_EXTENSIONS = ['jpg', 'jpeg', 'png', 'gif', 'svg', 'webp'];
-export const IMAGE_DIR = 'images';
-
-export function getFileName(url: string) {
- const [...parts] = url.split('/');
-
- return parts.pop() ?? url;
-}
diff --git a/frontend/appflowy_tauri/src/appflowy_app/views/DatabasePage.tsx b/frontend/appflowy_tauri/src/appflowy_app/views/DatabasePage.tsx
deleted file mode 100644
index 004fc4355b..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/views/DatabasePage.tsx
+++ /dev/null
@@ -1,24 +0,0 @@
-import { useParams } from 'react-router-dom';
-import { ViewIdProvider } from '$app/hooks';
-import { Database, DatabaseTitle, useSelectDatabaseView } from '../components/database';
-
-export const DatabasePage = () => {
- const viewId = useParams().id;
-
- const { selectedViewId, onChange } = useSelectDatabaseView({
- viewId,
- });
-
- if (!viewId) {
- return null;
- }
-
- return (
- <div className="flex h-full w-full flex-col overflow-hidden caret-text-title">
- <ViewIdProvider value={viewId}>
- <DatabaseTitle/>
- <Database selectedViewId={selectedViewId} setSelectedViewId={onChange}/>
- </ViewIdProvider>
- </div>
- );
-};
diff --git a/frontend/appflowy_tauri/src/appflowy_app/views/DocumentPage.tsx b/frontend/appflowy_tauri/src/appflowy_app/views/DocumentPage.tsx
deleted file mode 100644
index 03ba493c10..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/views/DocumentPage.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import React from 'react';
-import { useParams } from 'react-router-dom';
-import { Document } from '$app/components/document';
-
-function DocumentPage() {
- const params = useParams();
-
- const documentId = params.id;
-
- if (!documentId) return null;
- return <Document id={documentId} />;
-}
-
-export default DocumentPage;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/views/TrashPage.tsx b/frontend/appflowy_tauri/src/appflowy_app/views/TrashPage.tsx
deleted file mode 100644
index 78baa9872d..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/views/TrashPage.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import React from 'react';
-import Trash from '$app/components/trash/Trash';
-
-function TrashPage() {
- return (
- <div className='flex h-full flex-col gap-8 px-8 pt-8'>
- <Trash />
- </div>
- );
-}
-
-export default TrashPage;
diff --git a/frontend/appflowy_tauri/src/appflowy_app/vite-env.d.ts b/frontend/appflowy_tauri/src/appflowy_app/vite-env.d.ts
deleted file mode 100644
index b1f45c7866..0000000000
--- a/frontend/appflowy_tauri/src/appflowy_app/vite-env.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-/// <reference types="vite/client" />
-/// <reference types="vite-plugin-svgr/client" />
diff --git a/frontend/appflowy_tauri/src/main.tsx b/frontend/appflowy_tauri/src/main.tsx
deleted file mode 100644
index e53dc96c43..0000000000
--- a/frontend/appflowy_tauri/src/main.tsx
+++ /dev/null
@@ -1,8 +0,0 @@
-import React from 'react';
-import ReactDOM from 'react-dom/client';
-import App from './appflowy_app/App';
-import './styles/tailwind.css';
-import './styles/font.css';
-import './styles/template.css';
-
-ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(<App />);
diff --git a/frontend/appflowy_tauri/src/services/backend/index.ts b/frontend/appflowy_tauri/src/services/backend/index.ts
deleted file mode 100644
index 3e02ff7183..0000000000
--- a/frontend/appflowy_tauri/src/services/backend/index.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-export * from "./models/flowy-user";
-export * from "./models/flowy-database2";
-export * from "./models/flowy-folder";
-export * from "./models/flowy-document";
-export * from "./models/flowy-error";
-export * from "./models/flowy-config";
-export * from "./models/flowy-date";
-export * from "./models/flowy-search";
-export * from "./models/flowy-storage";
diff --git a/frontend/appflowy_tauri/src/styles/font.css b/frontend/appflowy_tauri/src/styles/font.css
deleted file mode 100644
index 514b5a6e38..0000000000
--- a/frontend/appflowy_tauri/src/styles/font.css
+++ /dev/null
@@ -1,125 +0,0 @@
-@font-face {
- font-family: 'Poppins';
- src: url('/google_fonts/Poppins/Poppins-Thin.ttf') format('truetype');
- font-weight: 100;
- font-style: normal;
-}
-
-@font-face {
- font-family: 'Poppins';
- src: url('/google_fonts/Poppins/Poppins-ThinItalic.ttf') format('truetype');
- font-weight: 100;
- font-style: italic;
-}
-
-@font-face {
- font-family: 'Poppins';
- src: url('/google_fonts/Poppins/Poppins-ExtraLight.ttf') format('truetype');
- font-weight: 200;
- font-style: normal;
-}
-
-@font-face {
- font-family: 'Poppins';
- src: url('/google_fonts/Poppins/Poppins-ExtraLightItalic.ttf') format('truetype');
- font-weight: 200;
- font-style: italic;
-}
-
-@font-face {
- font-family: 'Poppins';
- src: url('/google_fonts/Poppins/Poppins-Light.ttf') format('truetype');
- font-weight: 300;
- font-style: normal;
-}
-
-@font-face {
- font-family: 'Poppins';
- src: url('/google_fonts/Poppins/Poppins-LightItalic.ttf') format('truetype');
- font-weight: 300;
- font-style: italic;
-}
-
-@font-face {
- font-family: 'Poppins';
- src: url('/google_fonts/Poppins/Poppins-Regular.ttf') format('truetype');
- font-weight: 400;
- font-style: normal;
-}
-
-@font-face {
- font-family: 'Poppins';
- src: url('/google_fonts/Poppins/Poppins-Italic.ttf') format('truetype');
- font-weight: 400;
- font-style: italic;
-}
-
-@font-face {
- font-family: 'Poppins';
- src: url('/google_fonts/Poppins/Poppins-Medium.ttf') format('truetype');
- font-weight: 500;
- font-style: normal;
-}
-
-@font-face {
- font-family: 'Poppins';
- src: url('/google_fonts/Poppins/Poppins-MediumItalic.ttf') format('truetype');
- font-weight: 500;
- font-style: italic;
-}
-
-@font-face {
- font-family: 'Poppins';
- src: url('/google_fonts/Poppins/Poppins-SemiBold.ttf') format('truetype');
- font-weight: 600;
- font-style: normal;
-}
-
-@font-face {
- font-family: 'Poppins';
- src: url('/google_fonts/Poppins/Poppins-SemiBoldItalic.ttf') format('truetype');
- font-weight: 600;
- font-style: italic;
-}
-
-@font-face {
- font-family: 'Poppins';
- src: url('/google_fonts/Poppins/Poppins-Bold.ttf') format('truetype');
- font-weight: 700;
- font-style: normal;
-}
-
-@font-face {
- font-family: 'Poppins';
- src: url('/google_fonts/Poppins/Poppins-BoldItalic.ttf') format('truetype');
- font-weight: 700;
- font-style: italic;
-}
-
-@font-face {
- font-family: 'Poppins';
- src: url('/google_fonts/Poppins/Poppins-ExtraBold.ttf') format('truetype');
- font-weight: 800;
- font-style: normal;
-}
-
-@font-face {
- font-family: 'Poppins';
- src: url('/google_fonts/Poppins/Poppins-ExtraBoldItalic.ttf') format('truetype');
- font-weight: 800;
- font-style: italic;
-}
-
-@font-face {
- font-family: 'Poppins';
- src: url('/google_fonts/Poppins/Poppins-Black.ttf') format('truetype');
- font-weight: 900;
- font-style: normal;
-}
-
-@font-face {
- font-family: 'Poppins';
- src: url('/google_fonts/Poppins/Poppins-BlackItalic.ttf') format('truetype');
- font-weight: 900;
- font-style: italic;
-}
diff --git a/frontend/appflowy_tauri/src/styles/tailwind.css b/frontend/appflowy_tauri/src/styles/tailwind.css
deleted file mode 100644
index b5c61c9567..0000000000
--- a/frontend/appflowy_tauri/src/styles/tailwind.css
+++ /dev/null
@@ -1,3 +0,0 @@
-@tailwind base;
-@tailwind components;
-@tailwind utilities;
diff --git a/frontend/appflowy_tauri/src/styles/template.css b/frontend/appflowy_tauri/src/styles/template.css
deleted file mode 100644
index 1bff6bdc76..0000000000
--- a/frontend/appflowy_tauri/src/styles/template.css
+++ /dev/null
@@ -1,60 +0,0 @@
-@import './variables/index.css';
-
-* {
- margin: 0;
- padding: 0;
-}
-
-/* stop body from scrolling */
-html,
-body {
- margin: 0;
- height: 100%;
- overflow: hidden;
-}
-[contenteditable] {
- -webkit-tap-highlight-color: transparent;
-}
-input,
-textarea {
- outline: 0;
- background: transparent;
-}
-
-body {
- font-family: Poppins, serif;
-}
-
-::-webkit-scrollbar {
- width: 8px;
-}
-
-
-
-:root[data-dark-mode=true] body {
- scrollbar-color: #fff var(--bg-body);
-}
-
-body {
- scrollbar-track-color: var(--bg-body);
- scrollbar-shadow-color: var(--bg-body);
-}
-
-
-.btn {
- @apply rounded-xl border border-line-divider px-4 py-3;
-}
-
-.btn-primary {
- @apply bg-fill-default text-text-title hover:bg-fill-list-hover;
-}
-
-.input {
- @apply rounded-xl border border-line-divider px-[18px] py-[14px] text-sm;
-}
-
-
-th {
- @apply text-left font-normal;
-}
-
diff --git a/frontend/appflowy_tauri/src/styles/variables/dark.variables.css b/frontend/appflowy_tauri/src/styles/variables/dark.variables.css
deleted file mode 100644
index ca7544687b..0000000000
--- a/frontend/appflowy_tauri/src/styles/variables/dark.variables.css
+++ /dev/null
@@ -1,121 +0,0 @@
-/**
-* Do not edit directly
-* Generated on Tue, 19 Mar 2024 03:48:58 GMT
-* Generated from $pnpm css:variables
-*/
-
-:root[data-dark-mode=true] {
- --base-light-neutral-50: #f9fafd;
- --base-light-neutral-100: #edeef2;
- --base-light-neutral-200: #e2e4eb;
- --base-light-neutral-300: #f2f2f2;
- --base-light-neutral-400: #e0e0e0;
- --base-light-neutral-500: #bdbdbd;
- --base-light-neutral-600: #828282;
- --base-light-neutral-700: #4f4f4f;
- --base-light-neutral-800: #333333;
- --base-light-neutral-900: #1f2329;
- --base-light-neutral-1000: #000000;
- --base-light-neutral-00: #ffffff;
- --base-light-blue-50: #f2fcff;
- --base-light-blue-100: #e0f8ff;
- --base-light-blue-200: #a6ecff;
- --base-light-blue-300: #52d1f4;
- --base-light-blue-400: #00bcf0;
- --base-light-blue-500: #05ade2;
- --base-light-blue-600: #009fd1;
- --base-light-color-deep-red: #fb006d;
- --base-light-color-deep-yellow: #ffd667;
- --base-light-color-deep-green: #66cf80;
- --base-light-color-deep-blue: #00bcf0;
- --base-light-color-light-purple: #e8e0ff;
- --base-light-color-light-pink: #ffe7ee;
- --base-light-color-light-orange: #ffefe3;
- --base-light-color-light-yellow: #fff2cd;
- --base-light-color-light-lime: #f5ffdc;
- --base-light-color-light-green: #ddffd6;
- --base-light-color-light-aqua: #defff1;
- --base-light-color-light-blue: #e1fbff;
- --base-light-color-light-red: #ffdddd;
- --base-black-neutral-100: #252F41;
- --base-black-neutral-200: #313c51;
- --base-black-neutral-300: #3c4557;
- --base-black-neutral-400: #525A69;
- --base-black-neutral-500: #59647a;
- --base-black-neutral-600: #87A0BF;
- --base-black-neutral-700: #99a6b8;
- --base-black-neutral-800: #e2e9f2;
- --base-black-neutral-900: #eff4fb;
- --base-black-neutral-1000: #ffffff;
- --base-black-neutral-n50: #232b38;
- --base-black-neutral-n00: #1a202c;
- --base-black-blue-50: #232b38;
- --base-black-blue-100: #005174;
- --base-black-blue-200: #a6ecff;
- --base-black-blue-300: #52d1f4;
- --base-black-blue-400: #00bcf0;
- --base-black-blue-500: #05ade2;
- --base-black-blue-600: #009fd1;
- --base-black-color-deep-red: #d32772;
- --base-black-color-deep-yellow: #e9b320;
- --base-black-color-deep-green: #3ba856;
- --base-black-color-deep-blue: #2e9dbb;
- --base-black-color-light-purple: #4D4078;
- --base-black-color-light-blue: #2C3B58;
- --base-black-color-light-green: #3C5133;
- --base-black-color-light-yellow: #695E3E;
- --base-black-color-light-pink: #5E3C5E;
- --base-black-color-light-red: #56363F;
- --base-black-color-light-aqua: #1B3849;
- --base-black-color-light-lime: #394027;
- --base-black-color-light-orange: #5E3C3C;
- --base-else-brand: #2c144b;
- --text-title: #e2e9f2;
- --text-caption: #87A0BF;
- --text-placeholder: #3c4557;
- --text-link-default: #00bcf0;
- --text-link-hover: #52d1f4;
- --text-link-pressed: #009fd1;
- --text-link-disabled: #005174;
- --icon-primary: #e2e9f2;
- --icon-secondary: #59647a;
- --icon-disabled: #525A69;
- --icon-on-toolbar: white;
- --line-border: #59647a;
- --line-divider: #252F41;
- --line-on-toolbar: #99a6b8;
- --fill-default: #00bcf0;
- --fill-hover: #005174;
- --fill-toolbar: #0F111C;
- --fill-selector: #232b38;
- --fill-list-active: #3c4557;
- --fill-list-hover: #005174;
- --content-blue-400: #00bcf0;
- --content-blue-300: #52d1f4;
- --content-blue-600: #009fd1;
- --content-blue-100: #005174;
- --content-on-fill: #1a202c;
- --content-on-tag: #99a6b8;
- --content-blue-50: #232b38;
- --bg-body: #1a202c;
- --bg-base: #232b38;
- --bg-mask: rgba(0,0,0,0.7);
- --bg-tips: #005174;
- --bg-brand: #2c144b;
- --function-error: #d32772;
- --function-warning: #e9b320;
- --function-success: #3ba856;
- --function-info: #2e9dbb;
- --tint-red: #56363F;
- --tint-green: #3C5133;
- --tint-purple: #4D4078;
- --tint-blue: #2C3B58;
- --tint-yellow: #695E3E;
- --tint-pink: #5E3C5E;
- --tint-lime: #394027;
- --tint-aqua: #1B3849;
- --tint-orange: #5E3C3C;
- --shadow: 0px 0px 25px 0px rgba(0,0,0,0.3);
- --scrollbar-track: #252F41;
- --scrollbar-thumb: #3c4557;
-}
\ No newline at end of file
diff --git a/frontend/appflowy_tauri/src/styles/variables/index.css b/frontend/appflowy_tauri/src/styles/variables/index.css
deleted file mode 100644
index 08d6a948f1..0000000000
--- a/frontend/appflowy_tauri/src/styles/variables/index.css
+++ /dev/null
@@ -1,7 +0,0 @@
-@import "./light.variables.css";
-@import "./dark.variables.css";
-
-:root {
- /* resize popover shadow */
- --shadow-resize-popover: 0px 5px 5px -3px rgba(0,0,0,0.2),0px 8px 10px 1px rgba(0,0,0,0.14),0px 3px 14px 2px rgba(0,0,0,0.12);
-}
\ No newline at end of file
diff --git a/frontend/appflowy_tauri/src/styles/variables/light.variables.css b/frontend/appflowy_tauri/src/styles/variables/light.variables.css
deleted file mode 100644
index 26acc76f0a..0000000000
--- a/frontend/appflowy_tauri/src/styles/variables/light.variables.css
+++ /dev/null
@@ -1,124 +0,0 @@
-/**
-* Do not edit directly
-* Generated on Tue, 19 Mar 2024 03:48:58 GMT
-* Generated from $pnpm css:variables
-*/
-
-:root {
- --base-light-neutral-50: #f9fafd;
- --base-light-neutral-100: #edeef2;
- --base-light-neutral-200: #e2e4eb;
- --base-light-neutral-300: #f2f2f2;
- --base-light-neutral-400: #e0e0e0;
- --base-light-neutral-500: #bdbdbd;
- --base-light-neutral-600: #828282;
- --base-light-neutral-700: #4f4f4f;
- --base-light-neutral-800: #333333;
- --base-light-neutral-900: #1f2329;
- --base-light-neutral-1000: #000000;
- --base-light-neutral-00: #ffffff;
- --base-light-blue-50: #f2fcff;
- --base-light-blue-100: #e0f8ff;
- --base-light-blue-200: #a6ecff;
- --base-light-blue-300: #52d1f4;
- --base-light-blue-400: #00bcf0;
- --base-light-blue-500: #05ade2;
- --base-light-blue-600: #009fd1;
- --base-light-color-deep-red: #fb006d;
- --base-light-color-deep-yellow: #ffd667;
- --base-light-color-deep-green: #66cf80;
- --base-light-color-deep-blue: #00bcf0;
- --base-light-color-light-purple: #e8e0ff;
- --base-light-color-light-pink: #ffe7ee;
- --base-light-color-light-orange: #ffefe3;
- --base-light-color-light-yellow: #fff2cd;
- --base-light-color-light-lime: #f5ffdc;
- --base-light-color-light-green: #ddffd6;
- --base-light-color-light-aqua: #defff1;
- --base-light-color-light-blue: #e1fbff;
- --base-light-color-light-red: #ffdddd;
- --base-black-neutral-100: #252F41;
- --base-black-neutral-200: #313c51;
- --base-black-neutral-300: #3c4557;
- --base-black-neutral-400: #525A69;
- --base-black-neutral-500: #59647a;
- --base-black-neutral-600: #87A0BF;
- --base-black-neutral-700: #99a6b8;
- --base-black-neutral-800: #e2e9f2;
- --base-black-neutral-900: #eff4fb;
- --base-black-neutral-1000: #ffffff;
- --base-black-neutral-n50: #232b38;
- --base-black-neutral-n00: #1a202c;
- --base-black-blue-50: #232b38;
- --base-black-blue-100: #005174;
- --base-black-blue-200: #a6ecff;
- --base-black-blue-300: #52d1f4;
- --base-black-blue-400: #00bcf0;
- --base-black-blue-500: #05ade2;
- --base-black-blue-600: #009fd1;
- --base-black-color-deep-red: #d32772;
- --base-black-color-deep-yellow: #e9b320;
- --base-black-color-deep-green: #3ba856;
- --base-black-color-deep-blue: #2e9dbb;
- --base-black-color-light-purple: #4D4078;
- --base-black-color-light-blue: #2C3B58;
- --base-black-color-light-green: #3C5133;
- --base-black-color-light-yellow: #695E3E;
- --base-black-color-light-pink: #5E3C5E;
- --base-black-color-light-red: #56363F;
- --base-black-color-light-aqua: #1B3849;
- --base-black-color-light-lime: #394027;
- --base-black-color-light-orange: #5E3C3C;
- --base-else-brand: #2c144b;
- --text-title: #333333;
- --text-caption: #828282;
- --text-placeholder: #bdbdbd;
- --text-disabled: #e0e0e0;
- --text-link-default: #00bcf0;
- --text-link-hover: #52d1f4;
- --text-link-pressed: #009fd1;
- --text-link-disabled: #e0f8ff;
- --icon-primary: #333333;
- --icon-secondary: #59647a;
- --icon-disabled: #e0e0e0;
- --icon-on-toolbar: #ffffff;
- --line-border: #bdbdbd;
- --line-divider: #edeef2;
- --line-on-toolbar: #4f4f4f;
- --fill-toolbar: #333333;
- --fill-default: #00bcf0;
- --fill-hover: #52d1f4;
- --fill-pressed: #009fd1;
- --fill-active: #e0f8ff;
- --fill-list-hover: #e0f8ff;
- --fill-list-active: #edeef2;
- --content-blue-400: #00bcf0;
- --content-blue-300: #52d1f4;
- --content-blue-600: #009fd1;
- --content-blue-100: #e0f8ff;
- --content-blue-50: #f2fcff;
- --content-on-fill-hover: #00bcf0;
- --content-on-fill: #ffffff;
- --content-on-tag: #4f4f4f;
- --bg-body: #ffffff;
- --bg-base: #f9fafd;
- --bg-mask: rgba(0,0,0,0.55);
- --bg-tips: #e0f8ff;
- --bg-brand: #2c144b;
- --function-error: #fb006d;
- --function-waring: #ffd667;
- --function-success: #66cf80;
- --function-info: #00bcf0;
- --tint-purple: #e8e0ff;
- --tint-pink: #ffe7ee;
- --tint-red: #ffdddd;
- --tint-lime: #f5ffdc;
- --tint-green: #ddffd6;
- --tint-aqua: #defff1;
- --tint-blue: #e1fbff;
- --tint-orange: #ffefe3;
- --tint-yellow: #fff2cd;
- --shadow: 0px 0px 10px 0px rgba(0,0,0,0.1);
- --scrollbar-thumb: #bdbdbd;
- --scrollbar-track: #edeef2;
-}
\ No newline at end of file
diff --git a/frontend/appflowy_tauri/src/tests/helpers/init.ts b/frontend/appflowy_tauri/src/tests/helpers/init.ts
deleted file mode 100644
index cb0ff5c3b5..0000000000
--- a/frontend/appflowy_tauri/src/tests/helpers/init.ts
+++ /dev/null
@@ -1 +0,0 @@
-export {};
diff --git a/frontend/appflowy_tauri/style-dictionary/config.cjs b/frontend/appflowy_tauri/style-dictionary/config.cjs
deleted file mode 100644
index 10d7084060..0000000000
--- a/frontend/appflowy_tauri/style-dictionary/config.cjs
+++ /dev/null
@@ -1,114 +0,0 @@
-const StyleDictionary = require('style-dictionary');
-const fs = require('fs');
-const path = require('path');
-
-// Add comment header to generated files
-StyleDictionary.registerFormat({
- name: 'css/variables',
- formatter: function(dictionary, config) {
- const header = `/**\n` + '* Do not edit directly\n' + `* Generated on ${new Date().toUTCString()}\n` + `* Generated from $pnpm css:variables \n` + `*/\n\n`;
- const allProperties = dictionary.allProperties;
- const properties = allProperties.map(prop => {
- const { name, value } = prop;
- return ` --${name}: ${value};`
- }).join('\n');
- // generate tailwind config
- generateTailwindConfig(allProperties);
- return header + `:root${this.selector} {\n${properties}\n}`
- }
-});
-
-// expand shadow tokens into a single string
-StyleDictionary.registerTransform({
- name: 'shadow/spreadShadow',
- type: 'value',
- matcher: function (prop) {
- return prop.type === 'boxShadow';
- },
- transformer: function (prop) {
- // destructure shadow values from original token value
- const { x, y, blur, spread, color } = prop.original.value;
-
- return `${x}px ${y}px ${blur}px ${spread}px ${color}`;
- },
-});
-
-const transforms = ['attribute/cti', 'name/cti/kebab', 'shadow/spreadShadow'];
-
-// Generate Light CSS variables
-StyleDictionary.extend({
- source: ['./style-dictionary/tokens/base.json', './style-dictionary/tokens/light.json'],
- platforms: {
- css: {
- transformGroup: 'css',
- buildPath: './src/styles/variables/',
- files: [
- {
- format: 'css/variables',
- destination: 'light.variables.css',
- selector: '',
- options: {
- outputReferences: true
- }
- },
- ],
- transforms,
- },
- },
-}).buildAllPlatforms();
-
-// Generate Dark CSS variables
-StyleDictionary.extend({
- source: ['./style-dictionary/tokens/base.json', './style-dictionary/tokens/dark.json'],
- platforms: {
- css: {
- transformGroup: 'css',
- buildPath: './src/styles/variables/',
- files: [
- {
- format: 'css/variables',
- destination: 'dark.variables.css',
- selector: '[data-dark-mode=true]',
- },
- ],
- transforms,
- },
- },
-}).buildAllPlatforms();
-
-
-function set(obj, path, value) {
- const lastKey = path.pop();
- const lastObj = path.reduce((obj, key) =>
- obj[key] = obj[key] || {},
- obj);
- lastObj[lastKey] = value;
-}
-
-function writeFile (file, data) {
- const header = `/**\n` + '* Do not edit directly\n' + `* Generated on ${new Date().toUTCString()}\n` + `* Generated from $pnpm css:variables \n` + `*/\n\n`;
- const exportString = `module.exports = ${JSON.stringify(data, null, 2)}`;
- fs.writeFileSync(path.join(__dirname, file), header + exportString);
-}
-
-function generateTailwindConfig(allProperties) {
- const tailwindColors = {};
- const tailwindBoxShadow = {};
- allProperties.forEach(prop => {
- const { path, type, name, value } = prop;
- if (path[0] === 'Base') {
- return;
- }
- if (type === 'color') {
- if (name.includes('fill')) {
- console.log(prop);
- }
- set(tailwindColors, path, `var(--${name})`);
- }
- if (type === 'boxShadow') {
- set(tailwindBoxShadow, ['md'], `var(--${name})`);
- }
- });
- writeFile('./tailwind/colors.cjs', tailwindColors);
- writeFile('./tailwind/box-shadow.cjs', tailwindBoxShadow);
-}
\ No newline at end of file
diff --git a/frontend/appflowy_tauri/style-dictionary/tailwind/box-shadow.cjs b/frontend/appflowy_tauri/style-dictionary/tailwind/box-shadow.cjs
deleted file mode 100644
index e9d8024320..0000000000
--- a/frontend/appflowy_tauri/style-dictionary/tailwind/box-shadow.cjs
+++ /dev/null
@@ -1,9 +0,0 @@
-/**
-* Do not edit directly
-* Generated on Tue, 19 Mar 2024 03:48:58 GMT
-* Generated from $pnpm css:variables
-*/
-
-module.exports = {
- "md": "var(--shadow)"
-}
\ No newline at end of file
diff --git a/frontend/appflowy_tauri/style-dictionary/tailwind/colors.cjs b/frontend/appflowy_tauri/style-dictionary/tailwind/colors.cjs
deleted file mode 100644
index bfa25fa56f..0000000000
--- a/frontend/appflowy_tauri/style-dictionary/tailwind/colors.cjs
+++ /dev/null
@@ -1,75 +0,0 @@
-/**
-* Do not edit directly
-* Generated on Tue, 19 Mar 2024 03:48:58 GMT
-* Generated from $pnpm css:variables
-*/
-
-module.exports = {
- "text": {
- "title": "var(--text-title)",
- "caption": "var(--text-caption)",
- "placeholder": "var(--text-placeholder)",
- "link-default": "var(--text-link-default)",
- "link-hover": "var(--text-link-hover)",
- "link-pressed": "var(--text-link-pressed)",
- "link-disabled": "var(--text-link-disabled)"
- },
- "icon": {
- "primary": "var(--icon-primary)",
- "secondary": "var(--icon-secondary)",
- "disabled": "var(--icon-disabled)",
- "on-toolbar": "var(--icon-on-toolbar)"
- },
- "line": {
- "border": "var(--line-border)",
- "divider": "var(--line-divider)",
- "on-toolbar": "var(--line-on-toolbar)"
- },
- "fill": {
- "default": "var(--fill-default)",
- "hover": "var(--fill-hover)",
- "toolbar": "var(--fill-toolbar)",
- "selector": "var(--fill-selector)",
- "list": {
- "active": "var(--fill-list-active)",
- "hover": "var(--fill-list-hover)"
- }
- },
- "content": {
- "blue-400": "var(--content-blue-400)",
- "blue-300": "var(--content-blue-300)",
- "blue-600": "var(--content-blue-600)",
- "blue-100": "var(--content-blue-100)",
- "on-fill": "var(--content-on-fill)",
- "on-tag": "var(--content-on-tag)",
- "blue-50": "var(--content-blue-50)"
- },
- "bg": {
- "body": "var(--bg-body)",
- "base": "var(--bg-base)",
- "mask": "var(--bg-mask)",
- "tips": "var(--bg-tips)",
- "brand": "var(--bg-brand)"
- },
- "function": {
- "error": "var(--function-error)",
- "warning": "var(--function-warning)",
- "success": "var(--function-success)",
- "info": "var(--function-info)"
- },
- "tint": {
- "red": "var(--tint-red)",
- "green": "var(--tint-green)",
- "purple": "var(--tint-purple)",
- "blue": "var(--tint-blue)",
- "yellow": "var(--tint-yellow)",
- "pink": "var(--tint-pink)",
- "lime": "var(--tint-lime)",
- "aqua": "var(--tint-aqua)",
- "orange": "var(--tint-orange)"
- },
- "scrollbar": {
- "track": "var(--scrollbar-track)",
- "thumb": "var(--scrollbar-thumb)"
- }
-}
\ No newline at end of file
diff --git a/frontend/appflowy_tauri/style-dictionary/tokens/base.json b/frontend/appflowy_tauri/style-dictionary/tokens/base.json
deleted file mode 100644
index fb58a867b1..0000000000
--- a/frontend/appflowy_tauri/style-dictionary/tokens/base.json
+++ /dev/null
@@ -1,290 +0,0 @@
-{
- "Base": {
- "Light": {
- "neutral": {
- "50": {
- "value": "#f9fafd",
- "type": "color"
- },
- "100": {
- "value": "#dadbdd",
- "type": "color"
- },
- "200": {
- "value": "#e2e4eb",
- "type": "color"
- },
- "300": {
- "value": "#f2f2f2",
- "type": "color"
- },
- "400": {
- "value": "#e0e0e0",
- "type": "color"
- },
- "500": {
- "value": "#bdbdbd",
- "type": "color"
- },
- "600": {
- "value": "#828282",
- "type": "color"
- },
- "700": {
- "value": "#4f4f4f",
- "type": "color"
- },
- "800": {
- "value": "#333333",
- "type": "color"
- },
- "900": {
- "value": "#1f2329",
- "type": "color"
- },
- "1000": {
- "value": "#000000",
- "type": "color"
- },
- "00": {
- "value": "#ffffff",
- "type": "color"
- }
- },
- "blue": {
- "50": {
- "value": "#f2fcff",
- "type": "color"
- },
- "100": {
- "value": "#e0f8ff",
- "type": "color"
- },
- "200": {
- "value": "#a6ecff",
- "type": "color"
- },
- "300": {
- "value": "#52d1f4",
- "type": "color"
- },
- "400": {
- "value": "#00bcf0",
- "type": "color"
- },
- "500": {
- "value": "#05ade2",
- "type": "color"
- },
- "600": {
- "value": "#009fd1",
- "type": "color"
- }
- },
- "color": {
- "deep": {
- "red": {
- "value": "#fb006d",
- "type": "color"
- },
- "yellow": {
- "value": "#ffd667",
- "type": "color"
- },
- "green": {
- "value": "#66cf80",
- "type": "color"
- },
- "blue": {
- "value": "#00bcf0",
- "type": "color"
- }
- },
- "light": {
- "purple": {
- "value": "#e8e0ff",
- "type": "color"
- },
- "pink": {
- "value": "#ffe7ee",
- "type": "color"
- },
- "orange": {
- "value": "#ffefe3",
- "type": "color"
- },
- "yellow": {
- "value": "#fff2cd",
- "type": "color"
- },
- "lime": {
- "value": "#f5ffdc",
- "type": "color"
- },
- "green": {
- "value": "#ddffd6",
- "type": "color"
- },
- "aqua": {
- "value": "#defff1",
- "type": "color"
- },
- "blue": {
- "value": "#e1fbff",
- "type": "color"
- },
- "red": {
- "value": "#ffdddd",
- "type": "color"
- }
- }
- }
- },
- "black": {
- "neutral": {
- "100": {
- "value": "#252F41",
- "type": "color"
- },
- "200": {
- "value": "#313c51",
- "type": "color"
- },
- "300": {
- "value": "#3c4557",
- "type": "color"
- },
- "400": {
- "value": "#525A69",
- "type": "color"
- },
- "500": {
- "value": "#59647a",
- "type": "color"
- },
- "600": {
- "value": "#87A0BF",
- "type": "color"
- },
- "700": {
- "value": "#99a6b8",
- "type": "color"
- },
- "800": {
- "value": "#e2e9f2",
- "type": "color"
- },
- "900": {
- "value": "#eff4fb",
- "type": "color"
- },
- "1000": {
- "value": "#ffffff",
- "type": "color"
- },
- "N50": {
- "value": "#232b38",
- "type": "color"
- },
- "N00": {
- "value": "#1a202c",
- "type": "color"
- }
- },
- "blue": {
- "50": {
- "value": "#232b38",
- "type": "color"
- },
- "100": {
- "value": "#005174",
- "type": "color"
- },
- "200": {
- "value": "#a6ecff",
- "type": "color"
- },
- "300": {
- "value": "#52d1f4",
- "type": "color"
- },
- "400": {
- "value": "#00bcf0",
- "type": "color"
- },
- "500": {
- "value": "#05ade2",
- "type": "color"
- },
- "600": {
- "value": "#009fd1",
- "type": "color"
- }
- },
- "color": {
- "deep": {
- "red": {
- "value": "#d32772",
- "type": "color"
- },
- "yellow": {
- "value": "#e9b320",
- "type": "color"
- },
- "green": {
- "value": "#3ba856",
- "type": "color"
- },
- "blue": {
- "value": "#2e9dbb",
- "type": "color"
- }
- },
- "light": {
- "purple": {
- "value": "#4D4078",
- "type": "color"
- },
- "blue": {
- "value": "#2C3B58",
- "type": "color"
- },
- "green": {
- "value": "#3C5133",
- "type": "color"
- },
- "yellow": {
- "value": "#695E3E",
- "type": "color"
- },
- "pink": {
- "value": "#5E3C5E",
- "type": "color"
- },
- "red": {
- "value": "#56363F",
- "type": "color"
- },
- "aqua": {
- "value": "#1B3849",
- "type": "color"
- },
- "lime": {
- "value": "#394027",
- "type": "color"
- },
- "orange": {
- "value": "#5E3C3C",
- "type": "color"
- }
- }
- }
- },
- "else": {
- "brand": {
- "value": "#2c144b",
- "type": "color"
- }
- }
- }
-}
\ No newline at end of file
diff --git a/frontend/appflowy_tauri/style-dictionary/tokens/dark.json b/frontend/appflowy_tauri/style-dictionary/tokens/dark.json
deleted file mode 100644
index c67af7c9ec..0000000000
--- a/frontend/appflowy_tauri/style-dictionary/tokens/dark.json
+++ /dev/null
@@ -1,221 +0,0 @@
-{
- "text": {
- "title": {
- "value": "{Base.black.neutral.800}",
- "type": "color"
- },
- "caption": {
- "value": "{Base.black.neutral.600}",
- "type": "color"
- },
- "placeholder": {
- "value": "{Base.black.neutral.300}",
- "type": "color"
- },
- "link-default": {
- "value": "{Base.black.blue.400}",
- "type": "color"
- },
- "link-hover": {
- "value": "{Base.black.blue.300}",
- "type": "color"
- },
- "link-pressed": {
- "value": "{Base.black.blue.600}",
- "type": "color"
- },
- "link-disabled": {
- "value": "{Base.black.blue.100}",
- "type": "color"
- }
- },
- "icon": {
- "primary": {
- "value": "{Base.black.neutral.800}",
- "type": "color"
- },
- "secondary": {
- "value": "{Base.black.neutral.500}",
- "type": "color"
- },
- "disabled": {
- "value": "{Base.black.neutral.400}",
- "type": "color"
- },
- "on-toolbar": {
- "value": "white",
- "type": "color"
- }
- },
- "line": {
- "border": {
- "value": "{Base.black.neutral.500}",
- "type": "color"
- },
- "divider": {
- "value": "{Base.black.neutral.100}",
- "type": "color"
- },
- "on-toolbar": {
- "value": "{Base.black.neutral.700}",
- "type": "color"
- }
- },
- "fill": {
- "default": {
- "value": "{Base.black.blue.400}",
- "type": "color"
- },
- "hover": {
- "value": "{Base.black.blue.100}",
- "type": "color"
- },
- "toolbar": {
- "value": "#0F111C",
- "type": "color"
- },
- "selector": {
- "value": "{Base.black.blue.50}",
- "type": "color"
- },
- "list": {
- "active": {
- "value": "{Base.black.neutral.300}",
- "type": "color"
- },
- "hover": {
- "value": "{Base.black.blue.100}",
- "type": "color"
- }
- }
- },
- "content": {
- "blue-400": {
- "value": "{Base.black.blue.400}",
- "type": "color"
- },
- "blue-300": {
- "value": "{Base.black.blue.300}",
- "type": "color"
- },
- "blue-600": {
- "value": "{Base.black.blue.600}",
- "type": "color"
- },
- "blue-100": {
- "value": "{Base.black.blue.100}",
- "type": "color"
- },
- "on-fill": {
- "value": "{Base.black.neutral.N00}",
- "type": "color"
- },
- "on-tag": {
- "value": "{Base.black.neutral.700}",
- "type": "color"
- },
- "blue-50": {
- "value": "{Base.black.blue.50}",
- "type": "color"
- }
- },
- "bg": {
- "body": {
- "value": "{Base.black.neutral.N00}",
- "type": "color"
- },
- "base": {
- "value": "{Base.black.blue.50}",
- "type": "color"
- },
- "mask": {
- "value": "rgba(0,0,0,0.7)",
- "type": "color"
- },
- "tips": {
- "value": "{Base.black.blue.100}",
- "type": "color"
- },
- "brand": {
- "value": "{Base.else.brand}",
- "type": "color"
- }
- },
- "function": {
- "error": {
- "value": "{Base.black.color.deep.red}",
- "type": "color"
- },
- "warning": {
- "value": "{Base.black.color.deep.yellow}",
- "type": "color"
- },
- "success": {
- "value": "#3ba856",
- "type": "color"
- },
- "info": {
- "value": "#2e9dbb",
- "type": "color"
- }
- },
- "tint": {
- "red": {
- "value": "{Base.black.color.light.red}",
- "type": "color"
- },
- "green": {
- "value": "{Base.black.color.light.green}",
- "type": "color"
- },
- "purple": {
- "value": "{Base.black.color.light.purple}",
- "type": "color"
- },
- "blue": {
- "value": "{Base.black.color.light.blue}",
- "type": "color"
- },
- "yellow": {
- "value": "{Base.black.color.light.yellow}",
- "type": "color"
- },
- "pink": {
- "value": "{Base.black.color.light.pink}",
- "type": "color"
- },
- "lime": {
- "value": "{Base.black.color.light.lime}",
- "type": "color"
- },
- "aqua": {
- "value": "{Base.black.color.light.aqua}",
- "type": "color"
- },
- "orange": {
- "value": "{Base.black.color.light.orange}",
- "type": "color"
- }
- },
- "shadow": {
- "value": {
- "x": "0",
- "y": "0",
- "blur": "25",
- "spread": "0",
- "color": "rgba(0,0,0,0.3)",
- "type": "innerShadow"
- },
- "type": "boxShadow"
- },
- "scrollbar": {
- "track": {
- "value": "{Base.black.neutral.100}",
- "type": "color"
- },
- "thumb": {
- "value": "{Base.black.neutral.300}",
- "type": "color"
- }
- }
-}
\ No newline at end of file
diff --git a/frontend/appflowy_tauri/style-dictionary/tokens/light.json b/frontend/appflowy_tauri/style-dictionary/tokens/light.json
deleted file mode 100644
index 173f3d35aa..0000000000
--- a/frontend/appflowy_tauri/style-dictionary/tokens/light.json
+++ /dev/null
@@ -1,233 +0,0 @@
-{
- "text": {
- "title": {
- "value": "{Base.Light.neutral.800}",
- "type": "color"
- },
- "caption": {
- "value": "{Base.Light.neutral.600}",
- "type": "color"
- },
- "placeholder": {
- "value": "{Base.Light.neutral.500}",
- "type": "color"
- },
- "disabled": {
- "value": "{Base.Light.neutral.400}",
- "type": "color"
- },
- "link-default": {
- "value": "{Base.Light.blue.400}",
- "type": "color"
- },
- "link-hover": {
- "value": "{Base.Light.blue.300}",
- "type": "color"
- },
- "link-pressed": {
- "value": "{Base.Light.blue.600}",
- "type": "color"
- },
- "link-disabled": {
- "value": "{Base.Light.blue.100}",
- "type": "color"
- }
- },
- "icon": {
- "primary": {
- "value": "{Base.Light.neutral.800}",
- "type": "color"
- },
- "secondary": {
- "value": "{Base.black.neutral.500}",
- "type": "color"
- },
- "disabled": {
- "value": "{Base.Light.neutral.400}",
- "type": "color"
- },
- "on-toolbar": {
- "value": "{Base.Light.neutral.00}",
- "type": "color"
- }
- },
- "line": {
- "border": {
- "value": "{Base.Light.neutral.500}",
- "type": "color"
- },
- "divider": {
- "value": "{Base.Light.neutral.100}",
- "type": "color"
- },
- "on-toolbar": {
- "value": "{Base.Light.neutral.700}",
- "type": "color"
- }
- },
- "fill": {
- "toolbar": {
- "value": "{Base.Light.neutral.800}",
- "type": "color"
- },
- "default": {
- "value": "{Base.Light.blue.400}",
- "type": "color"
- },
- "hover": {
- "value": "{Base.Light.blue.300}",
- "type": "color"
- },
- "pressed": {
- "value": "{Base.Light.blue.600}",
- "type": "color"
- },
- "active": {
- "value": "{Base.Light.blue.100}",
- "type": "color"
- },
- "list": {
- "hover": {
- "value": "{Base.Light.blue.100}",
- "type": "color"
- },
- "active": {
- "value": "{Base.Light.neutral.100}",
- "type": "color"
- }
- }
- },
- "content": {
- "blue-400": {
- "value": "{Base.Light.blue.400}",
- "type": "color"
- },
- "blue-300": {
- "value": "{Base.Light.blue.300}",
- "type": "color"
- },
- "blue-600": {
- "value": "{Base.Light.blue.600}",
- "type": "color"
- },
- "blue-100": {
- "value": "{Base.Light.blue.100}",
- "type": "color"
- },
- "blue-50": {
- "value": "{Base.Light.blue.50}",
- "type": "color"
- },
- "on-fill-hover": {
- "value": "{Base.Light.blue.400}",
- "type": "color"
- },
- "on-fill": {
- "value": "{Base.Light.neutral.00}",
- "type": "color"
- },
- "on-tag": {
- "value": "{Base.Light.neutral.700}",
- "type": "color"
- }
- },
- "bg": {
- "body": {
- "value": "{Base.Light.neutral.00}",
- "type": "color"
- },
- "base": {
- "value": "{Base.Light.neutral.50}",
- "type": "color"
- },
- "mask": {
- "value": "rgba(0,0,0,0.55)",
- "type": "color"
- },
- "tips": {
- "value": "{Base.Light.blue.100}",
- "type": "color"
- },
- "brand": {
- "value": "{Base.else.brand}",
- "type": "color"
- }
- },
- "function": {
- "error": {
- "value": "{Base.Light.color.deep.red}",
- "type": "color"
- },
- "waring": {
- "value": "{Base.Light.color.deep.yellow}",
- "type": "color"
- },
- "success": {
- "value": "{Base.Light.color.deep.green}",
- "type": "color"
- },
- "info": {
- "value": "{Base.Light.color.deep.blue}",
- "type": "color"
- }
- },
- "tint": {
- "purple": {
- "value": "{Base.Light.color.light.purple}",
- "type": "color"
- },
- "pink": {
- "value": "{Base.Light.color.light.pink}",
- "type": "color"
- },
- "red": {
- "value": "{Base.Light.color.light.red}",
- "type": "color"
- },
- "lime": {
- "value": "{Base.Light.color.light.lime}",
- "type": "color"
- },
- "green": {
- "value": "{Base.Light.color.light.green}",
- "type": "color"
- },
- "aqua": {
- "value": "{Base.Light.color.light.aqua}",
- "type": "color"
- },
- "blue": {
- "value": "{Base.Light.color.light.blue}",
- "type": "color"
- },
- "orange": {
- "value": "{Base.Light.color.light.orange}",
- "type": "color"
- },
- "yellow": {
- "value": "{Base.Light.color.light.yellow}",
- "type": "color"
- }
- },
- "shadow": {
- "value": {
- "x": "0",
- "y": "0",
- "blur": "10",
- "spread": "0",
- "color": "rgba(0,0,0,0.1)",
- "type": "dropShadow"
- },
- "type": "boxShadow"
- },
- "scrollbar": {
- "thumb": {
- "value": "{Base.Light.neutral.500}",
- "type": "color"
- },
- "track": {
- "value": "{Base.Light.neutral.100}",
- "type": "color"
- }
- }
-}
\ No newline at end of file
diff --git a/frontend/appflowy_tauri/tailwind.config.cjs b/frontend/appflowy_tauri/tailwind.config.cjs
deleted file mode 100644
index 06390d938f..0000000000
--- a/frontend/appflowy_tauri/tailwind.config.cjs
+++ /dev/null
@@ -1,20 +0,0 @@
-const colors = require('./style-dictionary/tailwind/colors.cjs');
-const boxShadow = require('./style-dictionary/tailwind/box-shadow.cjs');
-
-/** @type {import('tailwindcss').Config} */
-module.exports = {
- content: [
- './index.html',
- './src/**/*.{js,ts,jsx,tsx}',
- './node_modules/react-tailwindcss-datepicker/dist/index.esm.js',
- ],
- important: '#body',
- darkMode: 'class',
- theme: {
- extend: {
- colors,
- boxShadow,
- },
- },
- plugins: [],
-};
diff --git a/frontend/appflowy_tauri/tsconfig.json b/frontend/appflowy_tauri/tsconfig.json
deleted file mode 100644
index 63b15b6039..0000000000
--- a/frontend/appflowy_tauri/tsconfig.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- "compilerOptions": {
- "target": "ESNext",
- "useDefineForClassFields": true,
- "lib": ["DOM", "DOM.Iterable", "ESNext"],
- "allowJs": false,
- "skipLibCheck": true,
- "esModuleInterop": false,
- "allowSyntheticDefaultImports": true,
- "strict": true,
- "forceConsistentCasingInFileNames": true,
- "module": "ESNext",
- "moduleResolution": "Node",
- "resolveJsonModule": true,
- "isolatedModules": true,
- "noEmit": true,
- "jsx": "react-jsx",
- "types": ["node", "jest"],
- "baseUrl": "./",
- "paths": {
- "@/*": ["src/*"],
- "$app/*": ["src/appflowy_app/*"],
- "$app_reducers/*": ["src/appflowy_app/stores/reducers/*"],
- "src/*": ["src/*"]
- }
- },
- "include": ["src", "vite.config.ts"],
- "exclude": ["node_modules"],
- "references": [{ "path": "./tsconfig.node.json" }]
-}
diff --git a/frontend/appflowy_tauri/tsconfig.node.json b/frontend/appflowy_tauri/tsconfig.node.json
deleted file mode 100644
index 9d31e2aed9..0000000000
--- a/frontend/appflowy_tauri/tsconfig.node.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "compilerOptions": {
- "composite": true,
- "module": "ESNext",
- "moduleResolution": "Node",
- "allowSyntheticDefaultImports": true
- },
- "include": ["vite.config.ts"]
-}
diff --git a/frontend/appflowy_tauri/vite.config.ts b/frontend/appflowy_tauri/vite.config.ts
deleted file mode 100644
index b571cc40de..0000000000
--- a/frontend/appflowy_tauri/vite.config.ts
+++ /dev/null
@@ -1,70 +0,0 @@
-import { defineConfig } from 'vite';
-import react from '@vitejs/plugin-react';
-import svgr from 'vite-plugin-svgr';
-
-// https://vitejs.dev/config/
-export default defineConfig({
- plugins: [
- react(),
- svgr({
- svgrOptions: {
- prettier: false,
- plugins: ['@svgr/plugin-svgo', '@svgr/plugin-jsx'],
- icon: true,
- svgoConfig: {
- multipass: true,
- plugins: [
- {
- name: 'preset-default',
- params: {
- overrides: {
- removeViewBox: false,
- },
- },
- },
- ],
- },
- svgProps: {
- role: 'img',
- },
- replaceAttrValues: {
- '#333': 'currentColor',
- },
- },
- }),
- ],
-
- // Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build`
- // prevent vite from obscuring rust errors
- clearScreen: false,
- // tauri expects a fixed port, fail if that port is not available
- server: {
- port: 1420,
- strictPort: true,
- watch: {
- ignored: ['**/__tests__/**'],
- },
- },
- // to make use of `TAURI_DEBUG` and other env variables
- // https://tauri.studio/v1/api/config#buildconfig.beforedevcommand
- envPrefix: ['VITE_', 'TAURI_'],
- build: {
- // Tauri supports es2021
- target: process.env.TAURI_PLATFORM === 'windows' ? 'chrome105' : 'safari13',
- // don't minify for debug builds
- minify: !process.env.TAURI_DEBUG ? 'esbuild' : false,
- // produce sourcemaps for debug builds
- sourcemap: !!process.env.TAURI_DEBUG,
- },
- resolve: {
- alias: [
- { find: 'src/', replacement: `${__dirname}/src/` },
- { find: '@/', replacement: `${__dirname}/src/` },
- { find: '$app/', replacement: `${__dirname}/src/appflowy_app/` },
- { find: '$app_reducers/', replacement: `${__dirname}/src/appflowy_app/stores/reducers/` },
- ],
- },
- optimizeDeps: {
- include: ['@mui/material/Tooltip'],
- },
-});
diff --git a/frontend/appflowy_tauri/webdriver/selenium/package.json b/frontend/appflowy_tauri/webdriver/selenium/package.json
deleted file mode 100644
index 78bbd20aad..0000000000
--- a/frontend/appflowy_tauri/webdriver/selenium/package.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- "name": "selenium",
- "version": "1.0.0",
- "private": true,
- "scripts": {
- "test": "mocha"
- },
- "dependencies": {
- "chai": "^4.3.4",
- "mocha": "^9.0.3",
- "selenium-webdriver": "^4.0.0-beta.4"
- }
-}
diff --git a/frontend/appflowy_tauri/webdriver/selenium/test/test.cjs b/frontend/appflowy_tauri/webdriver/selenium/test/test.cjs
deleted file mode 100644
index 7a57bdbbaf..0000000000
--- a/frontend/appflowy_tauri/webdriver/selenium/test/test.cjs
+++ /dev/null
@@ -1,76 +0,0 @@
-const os = require("os");
-const path = require("path");
-const { expect } = require("chai");
-const { spawn, spawnSync } = require("child_process");
-const { Builder, By, Capabilities, until } = require("selenium-webdriver");
-const { elementIsVisible, elementLocated } = require("selenium-webdriver/lib/until.js");
-
-// create the path to the expected application binary
-const application = path.resolve(
- __dirname,
- "..",
- "..",
- "..",
- "src-tauri",
- "target",
- "release",
- "appflowy_tauri"
-);
-
-// keep track of the webdriver instance we create
-let driver;
-
-// keep track of the tauri-driver process we start
-let tauriDriver;
-
-before(async function() {
- // set timeout to 2 minutes to allow the program to build if it needs to
- this.timeout(120000);
-
- // ensure the program has been built
- spawnSync("cargo", ["build", "--release"]);
-
- // start tauri-driver
- tauriDriver = spawn(
- path.resolve(os.homedir(), ".cargo", "bin", "tauri-driver"),
- [],
- { stdio: [null, process.stdout, process.stderr] }
- );
-
- const capabilities = new Capabilities();
- capabilities.set("tauri:options", { application });
- capabilities.setBrowserName("wry");
-
- // start the webdriver client
- driver = await new Builder()
- .withCapabilities(capabilities)
- .usingServer("http://localhost:4444/")
- .build();
-});
-
-after(async function() {
- // stop the webdriver session
- await driver.quit();
-
- // kill the tauri-driver process
- tauriDriver.kill();
-});
-
-describe("AppFlowy Unit Test", () => {
- it("should find get started button", async () => {
- // should sign out if already sign in
- const getStartedButton = await driver.wait(until.elementLocated(By.xpath("//*[@id=\"root\"]/form/div/div[3]")));
- getStartedButton.click();
- });
-
- it("should get sign out button", async (done) => {
- // const optionButton = await driver.wait(until.elementLocated(By.css('*[test-id=option-button]')));
- // const optionButton = await driver.wait(until.elementLocated(By.id('option-button')));
- // const optionButton = await driver.wait(until.elementLocated(By.css('[aria-label=option]')));
-
- // Currently, only the find className is work
- const optionButton = await driver.wait(until.elementLocated(By.className("relative h-8 w-8")));
- optionButton.click();
- await new Promise((resolve) => setTimeout(resolve, 4000));
- });
-});
diff --git a/frontend/scripts/makefile/env.toml b/frontend/scripts/makefile/env.toml
index 1bb61f94f7..96a632f8ab 100644
--- a/frontend/scripts/makefile/env.toml
+++ b/frontend/scripts/makefile/env.toml
@@ -1,15 +1,9 @@
[tasks.appflowy-flutter-deps-tools]
run_task = { name = ["install_flutter_prerequests"] }
-[tasks.appflowy-tauri-deps-tools]
-run_task = { name = ["install_tauri_prerequests"] }
-
[tasks.appflowy-flutter-dev-tools]
run_task = { name = ["appflowy-flutter-deps-tools", "install_diesel"] }
-[tasks.appflowy-tauri-dev-tools]
-run_task = { name = ["appflowy-tauri-deps-tools", "install_diesel"] }
-
[tasks.install_windows_deps.windows]
dependencies = ["check_duckscript_installation", "check_vcpkg", "install_vcpkg_sqlite", "install_rust_vcpkg_cli"]
@@ -100,9 +94,6 @@ script = """
rustup target add x86_64-unknown-linux-gnu
"""
-[tasks.install_tauri_prerequests]
-dependencies = ["install_targets", "install_web_protobuf"]
-
[tasks.install_flutter_prerequests]
dependencies = ["install_targets", "install_flutter_protobuf"]
diff --git a/frontend/scripts/makefile/tauri.toml b/frontend/scripts/makefile/tauri.toml
index 4fe6b19fd7..549c7e250e 100644
--- a/frontend/scripts/makefile/tauri.toml
+++ b/frontend/scripts/makefile/tauri.toml
@@ -1,10 +1,3 @@
-[tasks.tauri_build]
-description = "Build the Tauri backend"
-script = ["""
- cd appflowy_tauri/src-tauri
- cargo build
- """]
-script_runner = "@shell"
[tasks.tauri_dev]
env = { RUST_LOG = "debug" }
diff --git a/frontend/scripts/tool/update_client_api_rev.sh b/frontend/scripts/tool/update_client_api_rev.sh
index ea16622f6f..9146e6e2d8 100755
--- a/frontend/scripts/tool/update_client_api_rev.sh
+++ b/frontend/scripts/tool/update_client_api_rev.sh
@@ -8,7 +8,7 @@ fi
NEW_REV="$1"
echo "New revision: $NEW_REV"
-directories=("rust-lib" "appflowy_tauri/src-tauri" "appflowy_web_app/src-tauri")
+directories=("rust-lib")
for dir in "${directories[@]}"; do
echo "Updating $dir"
diff --git a/frontend/scripts/tool/update_collab_rev.sh b/frontend/scripts/tool/update_collab_rev.sh
index edff885cc0..aa228a0eef 100755
--- a/frontend/scripts/tool/update_collab_rev.sh
+++ b/frontend/scripts/tool/update_collab_rev.sh
@@ -8,7 +8,7 @@ fi
NEW_REV="$1"
echo "New revision: $NEW_REV"
-directories=("rust-lib" "appflowy_tauri/src-tauri" "appflowy_web_app/src-tauri")
+directories=("rust-lib")
for dir in "${directories[@]}"; do
echo "Updating $dir"
diff --git a/frontend/scripts/tool/update_collab_source.sh b/frontend/scripts/tool/update_collab_source.sh
index d73c62c033..697d293e31 100755
--- a/frontend/scripts/tool/update_collab_source.sh
+++ b/frontend/scripts/tool/update_collab_source.sh
@@ -5,9 +5,6 @@ REPO_PATH="./AppFlowy-Collab"
CARGO_TOML_1="./rust-lib/Cargo.toml"
REPO_RELATIVE_PATH_1="../AppFlowy-Collab"
-CARGO_TOML_2="./appflowy_tauri/src-tauri/Cargo.toml"
-REPO_RELATIVE_PATH_2="../../AppFlowy-Collab"
-
# Function to switch dependencies in a given Cargo.toml
switch_deps() {
local cargo_toml="$1"
@@ -38,4 +35,3 @@ fi
# Switch dependencies in both Cargo.toml files
switch_deps "$CARGO_TOML_1" "$REPO_RELATIVE_PATH_1"
-switch_deps "$CARGO_TOML_2" "$REPO_RELATIVE_PATH_2"
diff --git a/frontend/scripts/tool/update_local_ai_rev.sh b/frontend/scripts/tool/update_local_ai_rev.sh
index f234ae2920..83c5e67d80 100755
--- a/frontend/scripts/tool/update_local_ai_rev.sh
+++ b/frontend/scripts/tool/update_local_ai_rev.sh
@@ -8,7 +8,7 @@ fi
NEW_REV="$1"
echo "New revision: $NEW_REV"
-directories=("rust-lib" "appflowy_tauri/src-tauri" "appflowy_web_app/src-tauri")
+directories=("rust-lib")
for dir in "${directories[@]}"; do
echo "Updating $dir"