diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000000..f80d334591 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,2 @@ +**/project.json @darkskygit +**/pnpm-lock.yaml @darkskygit diff --git a/packages/app/package.json b/packages/app/package.json index 00b96a7fd1..ab9571a953 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -45,7 +45,7 @@ "@types/react": "18.0.20", "@types/react-dom": "18.0.6", "@types/wicg-file-system-access": "^2020.9.5", - "chalk-next": "^6.1.5", + "chalk": "^4.1.2", "eslint": "8.22.0", "eslint-config-next": "12.3.1", "eslint-config-prettier": "^8.5.0", diff --git a/packages/app/src/components/contact-modal/index.tsx b/packages/app/src/components/contact-modal/index.tsx index 50c1e1b530..921b34ba65 100644 --- a/packages/app/src/components/contact-modal/index.tsx +++ b/packages/app/src/components/contact-modal/index.tsx @@ -57,7 +57,10 @@ type TransitionsModalProps = { onClose: () => void; }; -export const ContactModal = ({ open, onClose }: TransitionsModalProps) => { +export const ContactModal = ({ + open, + onClose, +}: TransitionsModalProps): JSX.Element => { const { t } = useTranslation(); const rightLinkList = [ { diff --git a/packages/app/src/components/header/header-right-items/editor-option-menu.tsx b/packages/app/src/components/header/header-right-items/editor-option-menu.tsx index 738e344d48..cfd2813de5 100644 --- a/packages/app/src/components/header/header-right-items/editor-option-menu.tsx +++ b/packages/app/src/components/header/header-right-items/editor-option-menu.tsx @@ -37,12 +37,12 @@ const PopoverContent = () => { onClick={() => { toggleFavoritePage(id); toast( - !favorite ? t('Removed to Favourites') : t('Added to Favourites') + favorite ? t('Removed from Favourites') : t('Added to Favourites') ); }} icon={favorite ? : } > - {favorite ? t('Remove to favourites') : t('Add to favourites')} + {favorite ? t('Remove from favourites') : t('Add to favourites')} : } diff --git a/packages/app/src/components/page-list/index.tsx b/packages/app/src/components/page-list/index.tsx index a4c7b8dbde..604d71000f 100644 --- a/packages/app/src/components/page-list/index.tsx +++ b/packages/app/src/components/page-list/index.tsx @@ -45,7 +45,7 @@ const FavoriteTag = ({ e.stopPropagation(); toggleFavoritePage(id); toast( - !favorite ? t('Removed to Favourites') : t('Added to Favourites') + favorite ? t('Removed from Favourites') : t('Added to Favourites') ); }} style={{ diff --git a/packages/app/src/components/page-list/operation-cell.tsx b/packages/app/src/components/page-list/operation-cell.tsx index 3052199c4d..1b4ec7434a 100644 --- a/packages/app/src/components/page-list/operation-cell.tsx +++ b/packages/app/src/components/page-list/operation-cell.tsx @@ -27,12 +27,12 @@ export const OperationCell = ({ pageMeta }: { pageMeta: PageMeta }) => { onClick={() => { toggleFavoritePage(id); toast( - !favorite ? t('Removed to Favourites') : t('Added to Favourites') + favorite ? t('Removed from Favourites') : t('Added to Favourites') ); }} icon={favorite ? : } > - {favorite ? t('Remove to favourites') : t('Add to favourites')} + {favorite ? t('Remove from favourites') : t('Add to favourites')} { diff --git a/packages/app/src/components/quick-search/config.ts b/packages/app/src/components/quick-search/config.ts index c5171f06c7..c35636c3cc 100644 --- a/packages/app/src/components/quick-search/config.ts +++ b/packages/app/src/components/quick-search/config.ts @@ -1,6 +1,13 @@ import { AllPagesIcon, FavouritesIcon, TrashIcon } from '@blocksuite/icons'; import { useTranslation } from 'react-i18next'; -export const useSwitchToConfig = (currentWorkspaceId: string) => { + +export const useSwitchToConfig = ( + currentWorkspaceId: string +): { + title: string; + href: string; + icon: React.FC>; +}[] => { const { t } = useTranslation(); const List = [ { diff --git a/packages/app/src/components/shortcuts-modal/config.ts b/packages/app/src/components/shortcuts-modal/config.ts index b5cf587536..7749209fe9 100644 --- a/packages/app/src/components/shortcuts-modal/config.ts +++ b/packages/app/src/components/shortcuts-modal/config.ts @@ -1,5 +1,8 @@ import { useTranslation } from 'react-i18next'; -export const useMacKeyboardShortcuts = () => { +interface ShortcutTip { + [x: string]: string; +} +export const useMacKeyboardShortcuts = (): ShortcutTip => { const { t } = useTranslation(); return { [t('Undo')]: '⌘+Z', @@ -23,7 +26,7 @@ export const useMacKeyboardShortcuts = () => { }; }; -export const useMacMarkdownShortcuts = () => { +export const useMacMarkdownShortcuts = (): ShortcutTip => { const { t } = useTranslation(); return { [t('Bold')]: '**Text** ', @@ -42,7 +45,7 @@ export const useMacMarkdownShortcuts = () => { }; }; -export const useWindowsKeyboardShortcuts = () => { +export const useWindowsKeyboardShortcuts = (): ShortcutTip => { const { t } = useTranslation(); return { [t('Undo')]: 'Ctrl+Z', @@ -65,7 +68,7 @@ export const useWindowsKeyboardShortcuts = () => { [t('Reduce indent')]: 'Shift+Tab', }; }; -export const useWinMarkdownShortcuts = () => { +export const useWinMarkdownShortcuts = (): ShortcutTip => { const { t } = useTranslation(); return { [t('Bold')]: '**Text** ', diff --git a/packages/app/src/libs/i18n/resources/en.json b/packages/app/src/libs/i18n/resources/en.json index 45822ea009..9ce5282e71 100644 --- a/packages/app/src/libs/i18n/resources/en.json +++ b/packages/app/src/libs/i18n/resources/en.json @@ -11,8 +11,8 @@ "Find results": "Find {{number}} results", "Collapse sidebar": "Collapse sidebar", "Expand sidebar": "Expand sidebar", - "Removed to Favourites": "Removed to Favourites", - "Remove to favourites": "Remove to favourites", + "Removed from Favourites": "Removed from Favourites", + "Remove from favourites": "Remove from favourites", "Added to Favourites": "Added to Favourites", "Add to favourites": "Add to favourites", "Paper": "Paper", diff --git a/packages/app/src/templates/Welcome-to-AFFiNE-Alpha-v2.0.md b/packages/app/src/templates/Welcome-to-AFFiNE-Alpha-v2.0.md index 8493d51149..e0fc661340 100644 --- a/packages/app/src/templates/Welcome-to-AFFiNE-Alpha-v2.0.md +++ b/packages/app/src/templates/Welcome-to-AFFiNE-Alpha-v2.0.md @@ -27,7 +27,7 @@ Let us know what you think of this latest version. ### Playground: -[] Try a horiztaonl line: `---` +[] Try a horizontal line: `---` [] What about a code block? ``` diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a3d24e6447..bcebee4da6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -166,7 +166,7 @@ importers: '@types/react': 18.0.20 '@types/react-dom': 18.0.6 '@types/wicg-file-system-access': ^2020.9.5 - chalk-next: ^6.1.5 + chalk: ^4.1.2 cmdk: ^0.1.20 css-spring: ^4.1.0 dayjs: ^1.11.7 @@ -223,7 +223,7 @@ importers: '@types/react': 18.0.20 '@types/react-dom': 18.0.6 '@types/wicg-file-system-access': 2020.9.5 - chalk-next: 6.1.5 + chalk: 4.1.2 eslint: 8.22.0 eslint-config-next: 12.3.1_76twfck5d7crjqrmw4yltga7zm eslint-config-prettier: 8.5.0_eslint@8.22.0 @@ -5298,18 +5298,6 @@ packages: /caniuse-lite/1.0.30001419: resolution: {integrity: sha512-aFO1r+g6R7TW+PNQxKzjITwLOyDhVRLjW0LcwS/HCZGUUKTGNp9+IwLC4xyDSZBygVL/mxaFR3HIV6wEKQuSzw==} - /chalk-next/6.1.5: - resolution: {integrity: sha512-OAx9F3vSk18qpfCohk0849/j3GyaoIpv8eXjmpdbmLZt+5+sWYq8xwt3B5ue25irLcxFcLL2hAbxxHSsBxupbw==} - engines: {node: '>=10'} - dependencies: - ansi-styles: 4.3.0 - axios: 0.21.4 - fs: 0.0.1-security - supports-color: 7.2.0 - transitivePeerDependencies: - - debug - dev: true - /chalk/2.4.2: resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} engines: {node: '>=4'} @@ -7340,16 +7328,6 @@ packages: resolution: {integrity: sha512-W7cHV7Hrwjid6lWmy0IhsWDFQboWSng25U3VVywpHOTJnnAZNPScog67G+cVpeX9f7yDD21ih0WDrMMT+JoaYg==} dev: false - /follow-redirects/1.15.2: - resolution: {integrity: sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - dev: true - /form-data-encoder/2.1.4: resolution: {integrity: sha512-yDYSgNMraqvnxiEXO4hi88+YZxaHC6QKzb5N84iRCTDeRO7ZALpir/lVmf/uXUhnwUr2O4HU8s/n6x+yNjQkHw==} engines: {node: '>= 14.17'} @@ -7414,10 +7392,6 @@ packages: /fs.realpath/1.0.0: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - /fs/0.0.1-security: - resolution: {integrity: sha512-3XY9e1pP0CVEUCdj5BmfIZxRBTSDycnbqhIOGec9QYtmVH2fbLpj86CFWkrNOkt/Fvty4KZG5lTglL9j/gJ87w==} - dev: true - /fsevents/2.3.2: resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0}