From b8b7a10b339c837040764a25401aff0ddadf99a0 Mon Sep 17 00:00:00 2001 From: "Kilu.He" <108015703+qinluhe@users.noreply.github.com> Date: Wed, 29 May 2024 10:17:50 +0800 Subject: [PATCH] feat: support web layout setting and breadcrumbs (#5425) * fix: some bugs * fix: performance * feat: support system dark mode and different language * feat: support breadcrumb * feat: support breadcrumb * feat: support new doucment title * feat: support new doucment title --- frontend/appflowy_web_app/index.html | 35 +- frontend/appflowy_web_app/package.json | 5 +- frontend/appflowy_web_app/pnpm-lock.yaml | 796 ++++++++++-------- .../scripts/generateTailwindColors.cjs | 61 ++ .../src/application/collab.type.ts | 25 +- .../src/application/database-yjs/context.ts | 19 +- .../src/application/database-yjs/selector.ts | 264 ++++-- .../src/application/folder-yjs/context.ts | 49 +- .../src/application/folder-yjs/folder.type.ts | 8 + .../src/application/folder-yjs/selector.ts | 4 +- .../services/js-services/database.service.ts | 55 +- .../services/js-services/db/index.ts | 9 +- .../services/js-services/storage/collab.ts | 52 +- .../src/application/services/services.type.ts | 1 + .../tauri-services/database.service.ts | 4 + .../application/slate-yjs/plugins/withYjs.ts | 4 +- .../slate-yjs/utils/applySlateOpts.ts | 5 +- .../application/slate-yjs/utils/convert.ts | 26 +- .../context-provider/FolderProvider.tsx | 26 +- .../_shared/not-found/RecordNotFound.tsx | 6 +- .../components/_shared/page/usePageInfo.tsx | 51 +- .../_shared/progress/ComponentLoading.tsx | 12 + .../progress/LinearProgressWithLabel.tsx | 2 +- .../_shared/scroller/AFScroller.tsx | 7 +- .../src/components/_shared/tag/Tag.tsx | 6 +- .../src/components/app/App.tsx | 4 +- .../src/components/app/AppConfig.tsx | 11 +- .../src/components/app/AppTheme.tsx | 3 +- .../src/components/app/useAppLanguage.ts | 21 + .../src/components/app/useAppThemeMode.ts | 25 + .../src/components/auth/ProtectedRoutes.tsx | 18 +- .../src/components/database/Database.tsx | 28 +- .../src/components/database/DatabaseRow.tsx | 60 +- .../src/components/database/DatabaseViews.tsx | 11 +- .../src/components/database/board/Board.tsx | 17 +- .../src/components/database/board/index.ts | 4 +- .../database/calendar/calendar.scss | 6 +- .../src/components/database/calendar/index.ts | 4 +- .../database/components/board/card/Card.tsx | 23 +- .../components/board/column/Column.tsx | 69 +- .../components/board/column/ListItem.tsx | 59 +- .../database/components/board/group/Group.tsx | 34 +- .../components/calendar/event/Event.tsx | 25 +- .../components/calendar/event/EventPaper.tsx | 26 +- .../calendar/event/EventPaperTitle.tsx | 15 + .../components/calendar/toolbar/NoDate.tsx | 2 +- .../components/calendar/toolbar/Toolbar.tsx | 4 +- .../components/cell/checkbox/CheckboxCell.tsx | 3 + .../cell/checklist/ChecklistCell.tsx | 4 +- .../RowCreateModifiedTime.tsx | 6 +- .../components/cell/date/DateTimeCell.tsx | 4 +- .../components/cell/number/NumberCell.tsx | 10 +- .../components/cell/primary/PrimaryCell.tsx | 50 +- .../components/cell/relation/RelationCell.tsx | 4 + .../cell/relation/RelationItems.tsx | 39 +- .../cell/relation/RelationPrimaryValue.tsx | 19 +- .../components/cell/text/TextCell.tsx | 9 +- .../database/components/cell/url/UrlCell.tsx | 3 +- .../components/conditions/DatabaseActions.tsx | 10 +- .../database-row/DatabaseRowSubDocument.tsx | 29 +- .../components/database-row/OpenAction.tsx | 27 + .../database/components/field/CardField.tsx | 6 +- .../grid/grid-column/GridColumn.tsx | 27 +- .../components/grid/grid-table/GridTable.tsx | 1 - .../components/header/DatabaseRowHeader.tsx | 24 +- .../database/components/property/Property.tsx | 9 +- .../components/property/PropertyWrapper.tsx | 2 +- .../property/cheklist/ChecklistProperty.tsx | 2 +- .../database/components/tabs/DatabaseTabs.tsx | 32 +- .../src/components/database/grid/Grid.tsx | 6 +- .../src/components/document/Document.tsx | 70 +- .../document_header/DocumentCover.tsx | 65 +- .../document_header/DocumentHeader.tsx | 39 +- .../document/document_header/useBlockCover.ts | 4 +- .../document/document_header/utils.ts | 28 + .../components/editor/CollaborativeEditor.tsx | 20 +- .../src/components/editor/Editor.tsx | 18 +- .../src/components/editor/EditorContext.tsx | 15 + .../components/blocks/database/BoardBlock.tsx | 7 - .../blocks/database/CalendarBlock.tsx | 7 - .../blocks/database/DatabaseBlock.tsx | 42 +- .../components/blocks/database/GridBlock.tsx | 7 - .../editor/components/blocks/heading/utils.ts | 10 +- .../components/blocks/math-equation/index.ts | 4 +- .../components/blocks/text/Placeholder.tsx | 7 +- .../editor/components/blocks/text/Text.tsx | 14 +- .../components/blocks/todo-list/TodoList.tsx | 2 +- .../editor/components/element/Element.tsx | 19 +- .../components/leaf/mention/MentionPage.tsx | 13 +- .../src/components/editor/editor.scss | 38 +- .../error/ElementFallbackRender.tsx | 11 + .../src/components/folder/ViewItem.tsx | 12 +- .../src/components/layout/Header.tsx | 8 +- .../src/components/layout/Layout.hooks.ts | 96 +++ .../src/components/layout/Layout.tsx | 36 +- .../layout/breadcrumb/Breadcrumb.tsx | 24 + .../src/components/layout/breadcrumb/Item.tsx | 27 + .../src/components/layout/breadcrumb/index.ts | 1 + .../src/components/layout/layout.scss | 52 +- .../appflowy_web_app/src/pages/LoginPage.tsx | 2 +- .../src/pages/ProductPage.tsx | 24 +- .../appflowy_web_app/src/styles/template.css | 9 + .../src/styles/variables/dark.variables.css | 166 ++-- .../src/styles/variables/light.variables.css | 172 ++-- .../appflowy_web_app/src/utils/platform.ts | 1 + .../style-dictionary/config.cjs | 114 --- .../style-dictionary/tokens/base.json | 290 ------- .../style-dictionary/tokens/dark.json | 221 ----- .../style-dictionary/tokens/light.json | 233 ----- frontend/appflowy_web_app/tailwind.config.cjs | 4 +- .../tailwind/box-shadow.cjs | 6 +- .../tailwind/colors.cjs | 40 +- frontend/appflowy_web_app/vite.config.ts | 2 +- 113 files changed, 2139 insertions(+), 2168 deletions(-) create mode 100644 frontend/appflowy_web_app/scripts/generateTailwindColors.cjs create mode 100644 frontend/appflowy_web_app/src/application/folder-yjs/folder.type.ts create mode 100644 frontend/appflowy_web_app/src/components/_shared/progress/ComponentLoading.tsx create mode 100644 frontend/appflowy_web_app/src/components/app/useAppLanguage.ts create mode 100644 frontend/appflowy_web_app/src/components/app/useAppThemeMode.ts create mode 100644 frontend/appflowy_web_app/src/components/database/components/calendar/event/EventPaperTitle.tsx create mode 100644 frontend/appflowy_web_app/src/components/database/components/database-row/OpenAction.tsx create mode 100644 frontend/appflowy_web_app/src/components/document/document_header/utils.ts delete mode 100644 frontend/appflowy_web_app/src/components/editor/components/blocks/database/BoardBlock.tsx delete mode 100644 frontend/appflowy_web_app/src/components/editor/components/blocks/database/CalendarBlock.tsx delete mode 100644 frontend/appflowy_web_app/src/components/editor/components/blocks/database/GridBlock.tsx create mode 100644 frontend/appflowy_web_app/src/components/error/ElementFallbackRender.tsx create mode 100644 frontend/appflowy_web_app/src/components/layout/Layout.hooks.ts create mode 100644 frontend/appflowy_web_app/src/components/layout/breadcrumb/Breadcrumb.tsx create mode 100644 frontend/appflowy_web_app/src/components/layout/breadcrumb/Item.tsx create mode 100644 frontend/appflowy_web_app/src/components/layout/breadcrumb/index.ts delete mode 100644 frontend/appflowy_web_app/style-dictionary/config.cjs delete mode 100644 frontend/appflowy_web_app/style-dictionary/tokens/base.json delete mode 100644 frontend/appflowy_web_app/style-dictionary/tokens/dark.json delete mode 100644 frontend/appflowy_web_app/style-dictionary/tokens/light.json rename frontend/appflowy_web_app/{style-dictionary => }/tailwind/box-shadow.cjs (69%) rename frontend/appflowy_web_app/{style-dictionary => }/tailwind/colors.cjs (73%) diff --git a/frontend/appflowy_web_app/index.html b/frontend/appflowy_web_app/index.html index 5480f37859..3d8bc89cd6 100644 --- a/frontend/appflowy_web_app/index.html +++ b/frontend/appflowy_web_app/index.html @@ -3,15 +3,44 @@
- + +