From e3e37413930eb0a52f1b030f2d04d049152d003f Mon Sep 17 00:00:00 2001 From: DarkSky Date: Fri, 22 Jul 2022 15:49:21 +0800 Subject: [PATCH] init: the first public commit for AFFiNE --- .all-contributorsrc | 125 + .cz-config.js | 66 + .editorconfig | 13 + .env | 4 + .eslintignore | 4 + .eslintrc.json | 287 + .free.env | 1 + .github/CODEOWNERS | 47 + .github/workflows/lint.yml | 62 + .github/workflows/lisa.yml | 59 + .gitignore | 45 + .husky/pre-commit | 8 + .husky/pre-push | 14 + .npmrc | 3 + .prettierignore | 15 + .prettierrc | 6 + .vscode/extensions.json | 11 + .vscode/settings.json | 41 + Caddyfile | 39 + Dockerfile | 21 + LICENSE | 21 + README.md | 109 + apps/.gitkeep | 0 apps/ligo-virgo/.babelrc | 11 + apps/ligo-virgo/.browserslistrc | 16 + apps/ligo-virgo/.eslintrc.json | 18 + apps/ligo-virgo/jest.config.js | 12 + apps/ligo-virgo/package.json | 20 + apps/ligo-virgo/project.json | 75 + apps/ligo-virgo/proxy.conf.json | 13 + apps/ligo-virgo/src/assets/.gitkeep | 0 apps/ligo-virgo/src/assets/images/favicon.ico | Bin 0 -> 23462 bytes apps/ligo-virgo/src/custom-formatter.ts | 60 + .../src/environments/environment.prod.ts | 3 + .../src/environments/environment.ts | 6 + apps/ligo-virgo/src/index.html | 16 + apps/ligo-virgo/src/index.tsx | 28 + apps/ligo-virgo/src/pages/AppContainer.tsx | 36 + apps/ligo-virgo/src/pages/AppRoutes.tsx | 64 + apps/ligo-virgo/src/pages/RoutePrivate.tsx | 37 + .../src/pages/RoutePublicAutoLogin.tsx | 33 + apps/ligo-virgo/src/pages/account/index.ts | 3 + .../src/pages/agenda/calendar/index.tsx | 3 + .../src/pages/agenda/container/index.tsx | 18 + .../src/pages/agenda/home/index.tsx | 3 + apps/ligo-virgo/src/pages/agenda/index.tsx | 20 + .../src/pages/agenda/tasks/index.tsx | 3 + .../src/pages/agenda/today/index.tsx | 3 + apps/ligo-virgo/src/pages/index.ts | 1 + apps/ligo-virgo/src/pages/recent/index.tsx | 3 + apps/ligo-virgo/src/pages/search/index.tsx | 3 + apps/ligo-virgo/src/pages/settings/index.tsx | 3 + apps/ligo-virgo/src/pages/shared/index.tsx | 3 + apps/ligo-virgo/src/pages/starred/index.tsx | 3 + .../src/pages/status/page-not-found.tsx | 7 + .../src/pages/status/workspace-not-found.tsx | 13 + apps/ligo-virgo/src/pages/templates/index.tsx | 98 + .../src/pages/templates/template-data.ts | 125 + apps/ligo-virgo/src/pages/tools/container.tsx | 9 + .../src/pages/tools/icons/Icons.tsx | 85 + apps/ligo-virgo/src/pages/tools/icons/copy.ts | 18 + .../ligo-virgo/src/pages/tools/icons/index.ts | 1 + apps/ligo-virgo/src/pages/tools/index.tsx | 14 + apps/ligo-virgo/src/pages/ui/index.tsx | 9 + .../src/pages/workspace/Container.tsx | 19 + apps/ligo-virgo/src/pages/workspace/Home.tsx | 39 + .../src/pages/workspace/Whiteboard.tsx | 37 + .../workspace/docs/collapsible-page-tree.tsx | 112 + .../src/pages/workspace/docs/index.spec.tsx | 18 + .../src/pages/workspace/docs/index.tsx | 176 + .../workspace/docs/quick-find-portal.tsx | 39 + .../pages/workspace/docs/templates-portal.tsx | 90 + .../pages/workspace/docs/workspace-name.tsx | 168 + apps/ligo-virgo/src/pages/workspace/index.tsx | 41 + .../src/pages/workspace/labels/index.tsx | 3 + .../src/pages/workspace/pages/index.tsx | 3 + .../pages/workspace/whiteboard/index.bak.tsx | 53 + apps/ligo-virgo/src/polyfills.ts | 7 + apps/ligo-virgo/src/styles.css | 285 + apps/ligo-virgo/src/template.html | 11 + apps/ligo-virgo/tsconfig.app.json | 22 + apps/ligo-virgo/tsconfig.json | 25 + apps/ligo-virgo/tsconfig.spec.json | 23 + apps/ligo-virgo/webpack.config.js | 197 + babel.config.json | 3 + docs/CONTRIBUTING.md | 13 + docs/affine-code-guideline.md | 22 + docs/affine-git-guideline.md | 91 + docs/affine-icons-user-guide.md | 7 + docs/how-to-add-ui-component-in-affine.md | 53 + ...to-auto-download-figma-assets-in-affine.md | 13 + docs/how-to-customize-rollup-config.md | 3 + docs/how-to-write-css-in-affine.md | 103 + jest.config.js | 5 + jest.preset.js | 3 + libs/.gitkeep | 0 libs/components/account/.babelrc | 12 + libs/components/account/.eslintrc.json | 18 + libs/components/account/README.md | 7 + libs/components/account/jest.config.js | 9 + libs/components/account/package.json | 12 + libs/components/account/project.json | 44 + libs/components/account/src/error.tsx | 221 + libs/components/account/src/index.ts | 3 + libs/components/account/src/loading.tsx | 23 + libs/components/account/src/login/authing.tsx | 78 + .../components/account/src/login/firebase.tsx | 135 + libs/components/account/src/login/index.tsx | 11 + libs/components/account/tsconfig.json | 25 + libs/components/account/tsconfig.lib.json | 22 + libs/components/account/tsconfig.spec.json | 19 + libs/components/affine-board/.babelrc | 12 + libs/components/affine-board/.eslintrc.json | 18 + libs/components/affine-board/README.md | 7 + libs/components/affine-board/jest.config.ts | 10 + libs/components/affine-board/package.json | 5 + libs/components/affine-board/project.json | 45 + libs/components/affine-board/src/Board.tsx | 136 + .../affine-board/src/hooks/index.ts | 1 + .../affine-board/src/hooks/use-shapes.ts | 73 + libs/components/affine-board/src/index.ts | 1 + libs/components/affine-board/tsconfig.json | 25 + .../components/affine-board/tsconfig.lib.json | 23 + .../affine-board/tsconfig.spec.json | 20 + libs/components/affine-editor/.babelrc | 12 + libs/components/affine-editor/.eslintrc.json | 18 + libs/components/affine-editor/jest.config.js | 9 + libs/components/affine-editor/package.json | 5 + libs/components/affine-editor/project.json | 44 + libs/components/affine-editor/src/Editor.tsx | 63 + .../affine-editor/src/create-editor.ts | 63 + libs/components/affine-editor/src/index.ts | 2 + libs/components/affine-editor/tsconfig.json | 25 + .../affine-editor/tsconfig.lib.json | 22 + .../affine-editor/tsconfig.spec.json | 19 + libs/components/board-commands/.babelrc | 12 + libs/components/board-commands/.eslintrc.json | 18 + libs/components/board-commands/README.md | 7 + libs/components/board-commands/jest.config.ts | 10 + libs/components/board-commands/package.json | 10 + libs/components/board-commands/project.json | 45 + .../board-commands/src/align-shapes.ts | 126 + .../board-commands/src/change-page.ts | 18 + .../board-commands/src/create-page.ts | 71 + .../board-commands/src/create-shapes.ts | 65 + .../board-commands/src/delete-page.ts | 57 + .../board-commands/src/delete-shapes.ts | 66 + .../board-commands/src/distribute-shapes.ts | 187 + .../board-commands/src/duplicate-page.ts | 69 + .../board-commands/src/duplicate-shapes.ts | 206 + .../board-commands/src/flip-shapes.ts | 101 + .../board-commands/src/group-shapes.ts | 254 + libs/components/board-commands/src/index.ts | 24 + .../board-commands/src/move-shapes-to-page.ts | 231 + .../board-commands/src/rename-page.ts | 28 + .../board-commands/src/reorder-shapes.ts | 265 + .../board-commands/src/reset-bounds.ts | 46 + .../board-commands/src/rotate-shapes.ts | 83 + .../board-commands/src/set-shapes-props.ts | 61 + .../src/shared/remove-shapes-from-page.ts | 146 + .../board-commands/src/stretch-shapes.ts | 114 + .../board-commands/src/style-shapes.ts | 100 + .../src/toggle-shapes-decoration.ts | 73 + .../board-commands/src/toggle-shapes-prop.ts | 59 + .../board-commands/src/translate-shapes.ts | 113 + .../board-commands/src/ungroup-shapes.ts | 170 + .../board-commands/src/update-shapes.ts | 43 + libs/components/board-commands/tsconfig.json | 25 + .../board-commands/tsconfig.lib.json | 23 + .../board-commands/tsconfig.spec.json | 20 + libs/components/board-draw/.babelrc | 12 + libs/components/board-draw/.eslintrc.json | 18 + libs/components/board-draw/README.md | 7 + libs/components/board-draw/jest.config.ts | 10 + libs/components/board-draw/package.json | 14 + libs/components/board-draw/project.json | 45 + libs/components/board-draw/src/TlDraw.tsx | 550 + .../command-panel/BorderColorConfig.tsx | 70 + .../components/command-panel/CommandPanel.tsx | 105 + .../command-panel/DeleteOperation.tsx | 24 + .../command-panel/FillColorConfig.tsx | 90 + .../command-panel/FontSizeConfig.tsx | 107 + .../command-panel/GroupOperation.tsx | 38 + .../src/components/command-panel/index.ts | 1 + .../stroke-line-style-config/LineStyle.tsx | 110 + .../StrokeLineStyleConfig.tsx | 71 + .../stroke-line-style-config/index.ts | 1 + .../command-panel/utils/get-anchor.ts | 36 + .../components/command-panel/utils/index.ts | 2 + .../command-panel/utils/use-config.ts | 101 + .../components/context-menu/context-menu.tsx | 5 + .../src/components/context-menu/index.ts | 1 + .../error-fallback/error-fallback.tsx | 112 + .../src/components/error-fallback/index.ts | 1 + .../src/components/loading/index.ts | 1 + .../src/components/loading/loading.tsx | 46 + .../src/components/palette/Palette.tsx | 95 + .../src/components/palette/index.ts | 1 + .../src/components/tools-panel/LineTools.tsx | 86 + .../src/components/tools-panel/ShapeTools.tsx | 122 + .../src/components/tools-panel/ToolsPanel.tsx | 141 + .../src/components/tools-panel/index.ts | 1 + .../components/tools-panel/pen-tools/Pen.tsx | 44 + .../tools-panel/pen-tools/PenTools.tsx | 200 + .../components/tools-panel/pen-tools/index.ts | 1 + .../src/components/zoom-bar/ZoomBar.tsx | 62 + .../src/components/zoom-bar/index.ts | 1 + .../components/zoom-bar/mini-map/MiniMap.tsx | 88 + .../zoom-bar/mini-map/SimplifiedShape.tsx | 35 + .../components/zoom-bar/mini-map/Viewport.tsx | 69 + .../components/zoom-bar/mini-map/bounds.ts | 60 + .../src/components/zoom-bar/mini-map/index.ts | 1 + libs/components/board-draw/src/constants.ts | 97 + libs/components/board-draw/src/hooks/index.ts | 6 + .../src/hooks/use-file-system-handlers.ts | 54 + .../src/hooks/use-keyboard-shortcuts.tsx | 679 + .../board-draw/src/hooks/use-stylesheet.ts | 60 + .../board-draw/src/hooks/use-tldraw-app.ts | 9 + libs/components/board-draw/src/index.ts | 2 + libs/components/board-draw/tsconfig.json | 25 + libs/components/board-draw/tsconfig.lib.json | 23 + libs/components/board-draw/tsconfig.spec.json | 20 + libs/components/board-sessions/.babelrc | 12 + libs/components/board-sessions/.eslintrc.json | 18 + libs/components/board-sessions/README.md | 7 + libs/components/board-sessions/jest.config.ts | 10 + libs/components/board-sessions/package.json | 10 + libs/components/board-sessions/project.json | 45 + .../board-sessions/src/arrow-session.ts | 581 + .../board-sessions/src/base-session.ts | 10 + .../board-sessions/src/brush-session.ts | 149 + .../board-sessions/src/draw-session.ts | 305 + .../board-sessions/src/erase-session.ts | 274 + .../board-sessions/src/grid-session.ts | 270 + .../board-sessions/src/handle-session.ts | 141 + libs/components/board-sessions/src/index.ts | 64 + .../board-sessions/src/laser-session.ts | 106 + .../board-sessions/src/rotate-session.ts | 177 + .../board-sessions/src/transform-session.ts | 384 + .../src/transform-single-session.ts | 310 + .../src/translate-label-session.ts | 122 + .../board-sessions/src/translate-session.ts | 822 + libs/components/board-sessions/tsconfig.json | 25 + .../board-sessions/tsconfig.lib.json | 23 + .../board-sessions/tsconfig.spec.json | 20 + libs/components/board-shapes/.babelrc | 12 + libs/components/board-shapes/.eslintrc.json | 18 + libs/components/board-shapes/README.md | 7 + libs/components/board-shapes/jest.config.ts | 10 + libs/components/board-shapes/package.json | 11 + libs/components/board-shapes/project.json | 45 + .../board-shapes/src/TDShapeUtil.tsx | 251 + .../src/arrow-util/arrow-helpers.ts | 268 + .../src/arrow-util/arrow-util.tsx | 604 + .../src/arrow-util/components/arrow-head.tsx | 35 + .../arrow-util/components/curved-arrow.tsx | 132 + .../arrow-util/components/straight-arrow.tsx | 103 + .../board-shapes/src/arrow-util/index.ts | 1 + .../board-shapes/src/draw-util/DrawUtil.tsx | 376 + .../src/draw-util/draw-helpers.ts | 81 + .../board-shapes/src/draw-util/index.ts | 1 + .../src/editor-util/EditorUtil.tsx | 267 + .../board-shapes/src/editor-util/index.ts | 1 + .../src/ellipse-util/EllipseUtil.tsx | 363 + .../ellipse-util/components/DashedEllipse.tsx | 60 + .../ellipse-util/components/DrawEllipse.tsx | 56 + .../src/ellipse-util/ellipse-helpers.ts | 75 + .../board-shapes/src/ellipse-util/index.ts | 1 + .../src/frame-util/components/draw-frame.tsx | 42 + .../components/frame-binding-indicator.tsx | 19 + .../src/frame-util/frame-util.tsx | 147 + .../board-shapes/src/frame-util/index.ts | 1 + .../src/group-util/group-util.tsx | 144 + .../board-shapes/src/group-util/index.ts | 1 + .../src/hexagon-util/HexagonUtil.tsx | 294 + .../hexagon-util/components/DashedHexagon.tsx | 68 + .../hexagon-util/components/DrawHexagon.tsx | 49 + .../components/HexagonBindingIndicator.tsx | 20 + .../src/hexagon-util/hexagon-helpers.ts | 115 + .../board-shapes/src/hexagon-util/index.ts | 1 + .../src/image-util/image-util.tsx | 227 + .../board-shapes/src/image-util/index.ts | 1 + libs/components/board-shapes/src/index.ts | 60 + .../src/pentagram-util/PentagramUtil.tsx | 294 + .../components/DashedPentagram.tsx | 68 + .../components/DrawPentagram.tsx | 49 + .../components/PentagramBindingIndicator.tsx | 20 + .../board-shapes/src/pentagram-util/index.ts | 1 + .../src/pentagram-util/pentagram-helpers.ts | 135 + .../src/rectangle-util/RectangleUtil.tsx | 168 + .../components/BindingIndicator.tsx | 19 + .../components/DashedRectangle.tsx | 90 + .../components/DrawRectangle.tsx | 51 + .../board-shapes/src/rectangle-util/index.ts | 1 + .../src/rectangle-util/rectangle-helpers.ts | 107 + .../src/shared/get-bounds-rectangle.ts | 25 + .../board-shapes/src/shared/get-text-align.ts | 12 + .../board-shapes/src/shared/get-text-size.ts | 77 + .../src/shared/get-text-svg-element.ts | 67 + .../board-shapes/src/shared/index.ts | 12 + .../board-shapes/src/shared/label-mask.tsx | 50 + .../board-shapes/src/shared/normalize-text.ts | 9 + .../board-shapes/src/shared/polygon-utils.ts | 198 + .../board-shapes/src/shared/shape-styles.ts | 149 + .../src/shared/stop-propagation.ts | 5 + .../src/shared/text-area-utils.ts | 203 + .../board-shapes/src/shared/text-label.tsx | 281 + .../src/shared/transform-rectangle.ts | 47 + .../src/shared/transform-single-rectangle.ts | 16 + .../src/triangle-util/TriangleUtil.tsx | 294 + .../components/DashedTriangle.tsx | 68 + .../triangle-util/components/DrawTriangle.tsx | 49 + .../components/TriangleBindingIndicator.tsx | 20 + .../board-shapes/src/triangle-util/index.ts | 1 + .../src/triangle-util/triangle-helpers.ts | 113 + .../board-shapes/src/video-util/index.ts | 1 + .../src/video-util/video-util.tsx | 272 + .../src/white-arrow-util/WhiteArrowUtil.tsx | 301 + .../components/DashedWhiteArrow.tsx | 68 + .../components/DrawWhiteArrow.tsx | 49 + .../components/WhiteArrowBindingIndicator.tsx | 20 + .../src/white-arrow-util/index.ts | 1 + .../white-arrow-util/white-arrow-helpers.ts | 126 + libs/components/board-shapes/tsconfig.json | 25 + .../components/board-shapes/tsconfig.lib.json | 23 + .../board-shapes/tsconfig.spec.json | 20 + libs/components/board-state/.babelrc | 12 + libs/components/board-state/.eslintrc.json | 18 + libs/components/board-state/README.md | 7 + libs/components/board-state/jest.config.ts | 10 + libs/components/board-state/package.json | 12 + libs/components/board-state/project.json | 45 + .../data/browser-fs-access/directory-open.js | 30 + .../src/data/browser-fs-access/file-open.js | 30 + .../src/data/browser-fs-access/file-save.js | 30 + .../fs-access/directory-open.js | 68 + .../browser-fs-access/fs-access/file-open.js | 58 + .../browser-fs-access/fs-access/file-save.js | 93 + .../src/data/browser-fs-access/index.d.ts | 242 + .../src/data/browser-fs-access/index.js | 24 + .../legacy/directory-open.js | 71 + .../browser-fs-access/legacy/file-open.js | 55 + .../browser-fs-access/legacy/file-save.js | 91 + .../src/data/browser-fs-access/supported.js | 46 + .../board-state/src/data/filesystem.spec.ts | 12 + .../board-state/src/data/filesystem.ts | 169 + libs/components/board-state/src/data/index.ts | 3 + .../board-state/src/data/migrate.spec.ts | 19 + .../board-state/src/data/migrate.ts | 152 + .../board-state/src/idb-clipboard.ts | 17 + libs/components/board-state/src/index.ts | 5 + .../board-state/src/manager/deep-copy.ts | 41 + .../board-state/src/manager/state-manager.ts | 450 + libs/components/board-state/src/tldr.ts | 1425 ++ libs/components/board-state/src/tldraw-app.ts | 4567 ++++ .../board-state/src/types/commands.ts | 105 + libs/components/board-state/src/types/tool.ts | 131 + libs/components/board-state/tsconfig.json | 25 + libs/components/board-state/tsconfig.lib.json | 23 + .../components/board-state/tsconfig.spec.json | 20 + libs/components/board-tools/.babelrc | 12 + libs/components/board-tools/.eslintrc.json | 18 + libs/components/board-tools/README.md | 7 + libs/components/board-tools/jest.config.ts | 10 + libs/components/board-tools/package.json | 10 + libs/components/board-tools/project.json | 45 + .../board-tools/src/arrow-tool/arrow-tool.ts | 45 + .../board-tools/src/arrow-tool/index.ts | 1 + .../board-tools/src/draw-tool/draw-tool.ts | 86 + .../board-tools/src/draw-tool/index.ts | 1 + .../src/editor-tool/editor-tool.ts | 61 + .../board-tools/src/editor-tool/index.ts | 1 + .../src/ellipse-tool/ellipse-tool.ts | 49 + .../board-tools/src/ellipse-tool/index.ts | 1 + .../board-tools/src/erase-tool/erase-tool.ts | 91 + .../board-tools/src/erase-tool/index.ts | 1 + .../board-tools/src/frame-tool/frame-tool.ts | 52 + .../board-tools/src/frame-tool/index.ts | 0 .../src/hand-draw/hand-draw-tool.ts | 51 + .../board-tools/src/hand-draw/index.ts | 1 + .../src/hexagon-tool/hexagon-tool.ts | 49 + .../board-tools/src/hexagon-tool/index.ts | 1 + .../src/highlight-tool/highlight-tool.ts | 95 + .../board-tools/src/highlight-tool/index.ts | 1 + libs/components/board-tools/src/index.ts | 64 + .../board-tools/src/laser-tool/index.ts | 1 + .../board-tools/src/laser-tool/laser-tool.ts | 69 + .../board-tools/src/line-tool/index.ts | 1 + .../board-tools/src/line-tool/line-tool.ts | 47 + .../board-tools/src/pencil-tool/index.ts | 1 + .../src/pencil-tool/pencil-tool.ts | 90 + .../board-tools/src/pentagram-tool/index.ts | 1 + .../src/pentagram-tool/pentagram-tool.ts | 49 + .../board-tools/src/rectangle-tool/index.ts | 1 + .../src/rectangle-tool/rectangle-tool.ts | 49 + .../board-tools/src/select-tool/index.ts | 1 + .../src/select-tool/select-tool.ts | 768 + .../board-tools/src/triangle-tool/index.ts | 1 + .../src/triangle-tool/triangle-tool.ts | 49 + .../board-tools/src/white-arrow-tool/index.ts | 1 + .../src/white-arrow-tool/white-arrow-tool.ts | 49 + libs/components/board-tools/tsconfig.json | 25 + libs/components/board-tools/tsconfig.lib.json | 23 + .../components/board-tools/tsconfig.spec.json | 20 + libs/components/board-types/.babelrc | 12 + libs/components/board-types/.eslintrc.json | 18 + libs/components/board-types/README.md | 7 + libs/components/board-types/jest.config.ts | 10 + libs/components/board-types/package.json | 10 + libs/components/board-types/project.json | 45 + libs/components/board-types/src/constants.ts | 97 + libs/components/board-types/src/index.ts | 3 + libs/components/board-types/src/session.ts | 35 + libs/components/board-types/src/types.ts | 636 + libs/components/board-types/tsconfig.json | 25 + libs/components/board-types/tsconfig.lib.json | 23 + .../components/board-types/tsconfig.spec.json | 20 + libs/components/common/.babelrc | 12 + libs/components/common/.eslintrc.json | 18 + libs/components/common/jest.config.js | 9 + libs/components/common/package.json | 22 + libs/components/common/project.json | 56 + libs/components/common/src/index.ts | 1 + .../common/src/lib/Logo/LogoImg.tsx | 12 + .../common/src/lib/Logo/LogoLink.tsx | 17 + .../common/src/lib/Logo/affine-logo.svg | 8 + libs/components/common/src/lib/Logo/index.ts | 2 + .../src/lib/block-preview/BlockPreview.tsx | 27 + .../lib/block-preview/StyledBlockPreview.tsx | 142 + .../common/src/lib/block-preview/index.ts | 2 + .../common/src/lib/button/index.tsx | 61 + .../src/lib/collapsible-title/index.tsx | 59 + .../common/src/lib/colors/color-src.ts | 517 + .../common/src/lib/colors/colors.ts | 378 + .../components/common/src/lib/colors/index.ts | 1 + .../common/src/lib/icon/Add/Add.svg | 4 + .../common/src/lib/icon/Add/Add.tsx | 11 + .../common/src/lib/icon/Clock/Clock.svg | 1 + .../common/src/lib/icon/Clock/Clock.tsx | 18 + .../common/src/lib/icon/Close/Close.svg | 1 + .../common/src/lib/icon/Close/Close.tsx | 19 + .../icon/CodeBlockInline/CodeBlockInline.svg | 1 + .../icon/CodeBlockInline/CodeBlockInline.tsx | 14 + .../common/src/lib/icon/Document/Document.svg | 1 + .../common/src/lib/icon/Document/Document.tsx | 19 + .../common/src/lib/icon/Filter/Filter.svg | 3 + .../common/src/lib/icon/Filter/Filter.tsx | 10 + .../src/lib/icon/FullScreen/FullScreen.svg | 3 + .../src/lib/icon/FullScreen/FullScreen.tsx | 10 + .../HighlighterDuotone/HighlighterDuotone.svg | 1 + .../HighlighterDuotone/HighlighterDuotone.tsx | 17 + .../common/src/lib/icon/Kanban/Kanban.svg | 6 + .../common/src/lib/icon/Kanban/Kanban.tsx | 13 + .../common/src/lib/icon/List/List.svg | 1 + .../common/src/lib/icon/List/List.tsx | 15 + .../common/src/lib/icon/Newpage/Newpage.svg | 1 + .../common/src/lib/icon/Newpage/Newpage.tsx | 19 + .../common/src/lib/icon/Pages/Pages.svg | 1 + .../common/src/lib/icon/Pages/Pages.tsx | 39 + .../PencilDotDuotone/PencilDotDuotone.svg | 1 + .../PencilDotDuotone/PencilDotDuotone.tsx | 17 + .../lib/icon/PencilDuotone/PencilDuotone.svg | 1 + .../lib/icon/PencilDuotone/PencilDuotone.tsx | 18 + .../common/src/lib/icon/Sorter/Sorter.svg | 5 + .../common/src/lib/icon/Sorter/Sorter.tsx | 12 + .../common/src/lib/icon/Space/Space.svg | 1 + .../common/src/lib/icon/Space/Space.tsx | 34 + .../common/src/lib/icon/Table/Table.svg | 3 + .../common/src/lib/icon/Table/Table.tsx | 10 + .../common/src/lib/icon/TodoList/TodoList.svg | 8 + .../common/src/lib/icon/TodoList/TodoList.tsx | 15 + .../common/src/lib/icon/UnGroup/UnGroup.svg | 4 + .../common/src/lib/icon/UnGroup/UnGroup.tsx | 11 + .../src/lib/icon/ViewSidebar/ViewSidebar.svg | 1 + .../src/lib/icon/ViewSidebar/ViewSidebar.tsx | 18 + libs/components/common/src/lib/icon/index.ts | 21 + libs/components/common/src/lib/index.ts | 51 + libs/components/common/src/lib/list/index.tsx | 202 + .../common/src/lib/text/EditableText.tsx | 940 + .../common/src/lib/text/constants.ts | 192 + .../text/element-leaf/TextWithComments.tsx | 55 + libs/components/common/src/lib/text/index.ts | 8 + .../common/src/lib/text/plugins/date.tsx | 59 + .../common/src/lib/text/plugins/hooks.tsx | 22 + .../common/src/lib/text/plugins/link.tsx | 572 + .../common/src/lib/text/plugins/reflink.tsx | 41 + .../common/src/lib/text/slate-utils.ts | 1089 + libs/components/common/src/lib/text/utils.ts | 76 + .../common/src/lib/toolbar/index.tsx | 70 + libs/components/common/tsconfig.json | 24 + libs/components/common/tsconfig.lib.json | 22 + libs/components/common/tsconfig.spec.json | 19 + libs/components/editor-blocks/.babelrc | 12 + libs/components/editor-blocks/.eslintrc.json | 18 + libs/components/editor-blocks/README.md | 7 + libs/components/editor-blocks/jest.config.js | 9 + libs/components/editor-blocks/package.json | 46 + libs/components/editor-blocks/project.json | 47 + .../src/blocks/bullet/BulletView.tsx | 204 + .../editor-blocks/src/blocks/bullet/data.tsx | 34 + .../editor-blocks/src/blocks/bullet/index.ts | 92 + .../editor-blocks/src/blocks/bullet/types.ts | 18 + .../src/blocks/code/CodeMirror.tsx | 154 + .../src/blocks/code/CodeView.tsx | 220 + .../editor-blocks/src/blocks/code/index.ts | 83 + .../src/blocks/code/use-code-mirror.ts | 252 + .../src/blocks/divider/divider-view.tsx | 37 + .../editor-blocks/src/blocks/divider/index.ts | 39 + .../src/blocks/embed-link/EmbedLinkView.tsx | 58 + .../src/blocks/embed-link/index.ts | 47 + .../src/blocks/figma/FigmaView.tsx | 57 + .../editor-blocks/src/blocks/figma/index.ts | 50 + .../src/blocks/file/FileView.tsx | 124 + .../editor-blocks/src/blocks/file/index.ts | 33 + .../src/blocks/grid-item/GridItem.tsx | 131 + .../src/blocks/grid-item/GridItemRender.tsx | 18 + .../src/blocks/grid-item/index.ts | 25 + .../src/blocks/grid/GirdHandle.tsx | 111 + .../editor-blocks/src/blocks/grid/Grid.tsx | 242 + .../src/blocks/grid/GridRender.tsx | 14 + .../editor-blocks/src/blocks/grid/index.ts | 40 + .../editor-blocks/src/blocks/group/Group.tsx | 37 + .../src/blocks/group/GroupMenu.tsx | 237 + .../src/blocks/group/GroupView.tsx | 120 + .../src/blocks/group/ScenePage.tsx | 7 + .../src/blocks/group/SceneTable.tsx | 70 + .../blocks/group/components/IconButton.tsx | 30 + .../src/blocks/group/components/Line.tsx | 8 + .../src/blocks/group/components/Panel.tsx | 33 + .../src/blocks/group/components/Title.tsx | 16 + .../group/components/filter/Checkbox.tsx | 25 + .../blocks/group/components/filter/Filter.tsx | 61 + .../group/components/filter/FilterGroup.tsx | 136 + .../group/components/filter/HandleGroup.tsx | 62 + .../group/components/filter/IconBtn.tsx | 33 + .../components/filter/MultipleChipInput.tsx | 194 + .../group/components/filter/SelectItem.tsx | 168 + .../group/components/filter/TextInput.tsx | 41 + .../group/components/filter/TextareaGroup.tsx | 68 + .../filter/config/filter-group-config.ts | 67 + .../filter/config/filter-mode-config.ts | 4 + .../filter/context/filter-context.ts | 6 + .../blocks/group/components/filter/helper.ts | 9 + .../blocks/group/components/filter/index.ts | 1 + .../blocks/group/components/filter/types.ts | 55 + .../group/components/group-by/GroupBy.tsx | 88 + .../components/group-panel/GroupPanel.tsx | 10 + .../src/blocks/group/components/helper.ts | 52 + .../components/sorter/GroupBySelector.tsx | 53 + .../group/components/sorter/Introduce.tsx | 18 + .../blocks/group/components/sorter/Sorter.tsx | 41 + .../group/components/sorter/SorterItem.tsx | 91 + .../components/sorter/SorterSelector.tsx | 128 + .../blocks/group/components/sorter/config.ts | 10 + .../blocks/group/components/sorter/helper.ts | 9 + .../blocks/group/components/sorter/index.ts | 1 + .../blocks/group/components/sorter/types.ts | 30 + .../editor-blocks/src/blocks/group/config.ts | 13 + .../src/blocks/group/config/filter-op-rule.ts | 41 + .../src/blocks/group/config/sorter.ts | 10 + .../editor-blocks/src/blocks/group/index.ts | 1 + .../group/scene-kanban/AddGroupButton.tsx | 78 + .../group/scene-kanban/CardContainer.tsx | 202 + .../blocks/group/scene-kanban/CardContext.tsx | 59 + .../blocks/group/scene-kanban/CardItem.tsx | 63 + .../blocks/group/scene-kanban/SceneKanban.tsx | 33 + .../src/blocks/group/scene-kanban/context.ts | 9 + .../dndable/component/Container.tsx | 19 + .../dndable/component/ItemStyle.tsx | 51 + .../drag-overlay/DragOverlayPortal.tsx | 43 + .../renderContainerDragOverlay.tsx | 28 + .../renderSortableItemDragOverlay.tsx | 17 + .../group/scene-kanban/dndable/helper.ts | 87 + .../blocks/group/scene-kanban/dndable/type.ts | 31 + .../dndable/wrapper/CardContainerWrapper.tsx | 77 + .../dndable/wrapper/CardContextWrapper.tsx | 23 + .../dndable/wrapper/CardItemPanelWrapper.tsx | 58 + .../dndable/wrapper/CardItemWrapper.tsx | 56 + .../dndable/wrapper/DroppableContainer.tsx | 47 + .../dndable/wrapper/use-dndable.ts | 294 + .../src/blocks/group/scene-kanban/helper.ts | 140 + .../src/blocks/group/scene-kanban/index.ts | 1 + .../src/blocks/group/scene-kanban/styles.ts | 105 + .../src/blocks/group/scene-kanban/types.ts | 8 + .../editor-blocks/src/blocks/group/types.ts | 50 + .../src/blocks/group/utils/index.ts | 2 + .../src/blocks/group/utils/toAsync.ts | 4 + .../src/blocks/group/utils/weak-sql/index.ts | 1 + .../group/utils/weak-sql/rule-config.ts | 16 + .../src/blocks/group/utils/weak-sql/types.ts | 18 + .../group/utils/weak-sql/weakSql2Sql.ts | 35 + .../group/utils/weak-sql/weakSqlCreator.ts | 66 + .../blocks/groupDvider/groupDividerView.tsx | 6 + .../src/blocks/groupDvider/index.ts | 39 + .../src/blocks/image/ImageView.tsx | 236 + .../editor-blocks/src/blocks/image/index.ts | 54 + .../editor-blocks/src/blocks/image/styles.css | 69 + .../src/blocks/numbered/NumberedView.tsx | 213 + .../editor-blocks/src/blocks/numbered/data.ts | 69 + .../src/blocks/numbered/index.ts | 99 + .../src/blocks/numbered/types.ts | 16 + .../src/blocks/page/PageView.tsx | 120 + .../editor-blocks/src/blocks/page/index.ts | 55 + .../editor-blocks/src/blocks/page/types.ts | 4 + .../src/blocks/ref-link/index.ts | 16 + .../src/blocks/ref-link/ref-link-view.tsx | 21 + .../src/blocks/text/QuoteBlock.tsx | 164 + .../src/blocks/text/TextBlock.tsx | 327 + .../src/blocks/text/TextView.tsx | 251 + .../editor-blocks/src/blocks/text/index.ts | 7 + .../editor-blocks/src/blocks/text/types.ts | 5 + .../editor-blocks/src/blocks/toc/index.ts | 10 + .../editor-blocks/src/blocks/toc/toc-util.ts | 32 + .../editor-blocks/src/blocks/toc/toc-view.tsx | 85 + .../editor-blocks/src/blocks/toc/types.ts | 5 + .../src/blocks/todo/CheckBox.tsx | 84 + .../src/blocks/todo/TodoView.tsx | 164 + .../editor-blocks/src/blocks/todo/index.ts | 99 + .../editor-blocks/src/blocks/todo/types.ts | 19 + .../src/blocks/youtube/YoutubeView.tsx | 49 + .../editor-blocks/src/blocks/youtube/index.ts | 50 + .../BlockContainer/BlockContainer.tsx | 31 + .../src/components/BlockContainer/index.ts | 1 + .../src/components/ImageView/ImageView.tsx | 65 + .../src/components/ImageView/index.ts | 1 + .../IndentWrapper/IndentWrapper.tsx | 17 + .../src/components/IndentWrapper/index.ts | 1 + .../src/components/editable/editable.tsx | 25 + .../src/components/editable/index.ts | 0 .../src/components/editable/types.ts | 13 + .../src/components/select/index.tsx | 35 + .../src/components/source-view/SourceView.tsx | 184 + .../source-view/format-url/affine.ts | 11 + .../source-view/format-url/figma.ts | 12 + .../source-view/format-url/format-url.ts | 17 + .../source-view/format-url/index.ts | 1 + .../source-view/format-url/youtube.ts | 13 + .../src/components/source-view/index.ts | 1 + .../src/components/style-container/index.tsx | 19 + .../src/components/table/basic-table.scss | 6 + .../src/components/table/basic-table.tsx | 198 + .../table/custom-cell/check-box/index.tsx | 19 + .../components/table/custom-cell/index.tsx | 52 + .../table/custom-cell/select/index.tsx | 34 + .../src/components/table/custom-cell/types.ts | 17 + .../src/components/table/index.ts | 4 + .../src/components/table/table.tsx | 16 + .../src/components/text-manage/TextManage.tsx | 515 + .../src/components/text-manage/index.ts | 1 + .../src/components/upload/index.ts | 0 .../src/components/upload/upload.tsx | 257 + libs/components/editor-blocks/src/index.ts | 26 + .../src/utils/WithTreeViewChildren.tsx | 267 + .../editor-blocks/src/utils/indent.ts | 188 + libs/components/editor-blocks/tsconfig.json | 25 + .../editor-blocks/tsconfig.lib.json | 22 + .../editor-blocks/tsconfig.spec.json | 19 + libs/components/editor-core/.babelrc | 12 + libs/components/editor-core/.eslintrc.json | 18 + libs/components/editor-core/README.md | 7 + libs/components/editor-core/jest.config.js | 9 + libs/components/editor-core/package.json | 15 + libs/components/editor-core/project.json | 47 + .../components/editor-core/src/RenderRoot.tsx | 295 + .../BlockContentWrapper.tsx | 21 + .../src/block-content-wrapper/index.ts | 1 + .../src/block-pendant/AddPendantPopover.tsx | 46 + .../block-pendant/BlockPendantProvider.tsx | 61 + .../src/block-pendant/PendantTag.tsx | 317 + .../src/block-pendant/StyledComponent.tsx | 135 + .../editor-core/src/block-pendant/config.ts | 212 + .../editor-core/src/block-pendant/index.ts | 1 + .../PendantHistoryPanel.tsx | 105 + .../pendant-history-panel/index.ts | 1 + .../pendant-modify-panel/Date.tsx | 105 + .../pendant-modify-panel/Email.tsx | 18 + .../pendant-modify-panel/IconInput.tsx | 100 + .../pendant-modify-panel/Information.tsx | 105 + .../pendant-modify-panel/Location.tsx | 18 + .../pendant-modify-panel/Mention.tsx | 70 + .../PendantModifyPanel.tsx | 132 + .../PendantTypeSelect.tsx | 39 + .../pendant-modify-panel/Phone.tsx | 18 + .../pendant-modify-panel/Select.tsx | 270 + .../pendant-modify-panel/Text.tsx | 25 + .../pendant-modify-panel/index.ts | 1 + .../pendant-modify-panel/types.ts | 26 + .../CreatePendantPanel.tsx | 209 + .../UpdatePendantPanel.tsx | 206 + .../pendant-operation-panel/index.ts | 2 + .../pendant-popover/PendantPopover.tsx | 51 + .../block-pendant/pendant-popover/index.ts | 1 + .../pendant-render/PandentRender.tsx | 108 + .../src/block-pendant/pendant-render/index.ts | 1 + .../editor-core/src/block-pendant/types.ts | 54 + .../src/block-pendant/use-pendant.ts | 41 + .../editor-core/src/block-pendant/utils.ts | 206 + libs/components/editor-core/src/contexts.tsx | 37 + .../src/drag-drop-wrapper/DragDropWrapper.tsx | 38 + .../src/drag-drop-wrapper/index.ts | 1 + .../src/editor/block/async-block.ts | 486 + .../src/editor/block/block-helper.ts | 312 + .../src/editor/block/block-provider.ts | 20 + .../editor-core/src/editor/block/index.ts | 2 + .../src/editor/clipboard/browser-clipboard.ts | 417 + .../editor-core/src/editor/clipboard/clip.ts | 23 + .../src/editor/clipboard/clipboard-parse.ts | 209 + .../editor/clipboard/clipboard-populator.ts | 158 + .../src/editor/clipboard/markdown-parse.ts | 1418 ++ .../editor-core/src/editor/clipboard/types.ts | 29 + .../src/editor/commands/block-commands.ts | 172 + .../editor-core/src/editor/commands/index.ts | 21 + .../src/editor/commands/text-commands.ts | 49 + .../editor-core/src/editor/commands/types.ts | 4 + .../src/editor/drag-drop/drag-drop.ts | 290 + .../editor-core/src/editor/drag-drop/index.ts | 2 + .../editor-core/src/editor/drag-drop/types.ts | 12 + .../editor-core/src/editor/editor.ts | 450 + .../editor-core/src/editor/index.ts | 18 + .../src/editor/keyboard/hotkey-map.ts | 69 + .../editor-core/src/editor/keyboard/index.ts | 1 + .../src/editor/keyboard/keyboard.ts | 297 + .../editor-core/src/editor/mouse/index.ts | 1 + .../editor-core/src/editor/mouse/mouse.ts | 146 + .../editor-core/src/editor/plugin/hooks.ts | 200 + .../editor-core/src/editor/plugin/index.ts | 2 + .../editor-core/src/editor/plugin/manager.ts | 88 + .../editor-core/src/editor/plugin/utils.ts | 6 + .../editor-core/src/editor/scroll/index.ts | 1 + .../editor-core/src/editor/scroll/scroll.ts | 245 + .../editor-core/src/editor/selection/index.ts | 4 + .../src/editor/selection/selection.ts | 1046 + .../editor-core/src/editor/selection/types.ts | 83 + .../editor-core/src/editor/selection/utils.ts | 42 + .../editor-core/src/editor/types.ts | 257 + .../editor-core/src/editor/views/base-view.ts | 193 + libs/components/editor-core/src/hooks.ts | 204 + libs/components/editor-core/src/index.ts | 21 + .../editor-core/src/kanban/Context.tsx | 75 + .../components/editor-core/src/kanban/atom.ts | 223 + .../editor-core/src/kanban/group.ts | 103 + .../editor-core/src/kanban/index.ts | 2 + .../editor-core/src/kanban/kanban.ts | 339 + .../editor-core/src/kanban/types.ts | 57 + .../editor-core/src/recast-block/Context.tsx | 74 + .../editor-core/src/recast-block/README.md | 70 + .../editor-core/src/recast-block/Scene.tsx | 45 + .../editor-core/src/recast-block/group.ts | 224 + .../editor-core/src/recast-block/index.ts | 24 + .../editor-core/src/recast-block/property.ts | 393 + .../src/recast-block/types/constant.ts | 9 + .../src/recast-block/types/index.ts | 32 + .../src/recast-block/types/recast-property.ts | 121 + .../src/recast-block/types/recast-value.ts | 61 + .../src/recast-block/types/view.ts | 28 + .../src/render-block/RenderBlock.tsx | 72 + .../src/render-block/RenderBlockChildren.tsx | 17 + .../editor-core/src/render-block/index.ts | 2 + libs/components/editor-core/src/selection.tsx | 267 + libs/components/editor-core/src/utils.ts | 29 + libs/components/editor-core/tsconfig.json | 26 + libs/components/editor-core/tsconfig.lib.json | 22 + .../components/editor-core/tsconfig.spec.json | 19 + libs/components/editor-plugins/.babelrc | 12 + libs/components/editor-plugins/.eslintrc.json | 18 + libs/components/editor-plugins/README.md | 7 + libs/components/editor-plugins/jest.config.js | 9 + libs/components/editor-plugins/package.json | 10 + libs/components/editor-plugins/project.json | 47 + .../editor-plugins/src/base-plugin.ts | 85 + .../src/block-property/index.tsx | 83 + .../src/block-property/view.tsx | 67 + .../editor-plugins/src/comment/AddComment.tsx | 37 + .../src/comment/AddCommentActions.tsx | 142 + .../src/comment/AddCommentInput.tsx | 58 + .../editor-plugins/src/comment/Container.tsx | 70 + .../editor-plugins/src/comment/Plugin.tsx | 40 + .../editor-plugins/src/comment/index.ts | 1 + .../src/comment/use-add-comment.ts | 78 + .../editor-plugins/src/comment/utils.ts | 0 libs/components/editor-plugins/src/index.ts | 27 + .../src/menu/command-menu/Categories.tsx | 91 + .../src/menu/command-menu/CommandMenu.tsx | 34 + .../src/menu/command-menu/Container.tsx | 257 + .../src/menu/command-menu/Menu.tsx | 265 + .../src/menu/command-menu/config.ts | 202 + .../src/menu/command-menu/index.ts | 1 + .../src/menu/group-menu/DragItem.tsx | 50 + .../src/menu/group-menu/GropuMenu.tsx | 189 + .../src/menu/group-menu/Line.tsx | 63 + .../src/menu/group-menu/Menu.tsx | 98 + .../src/menu/group-menu/Plugin.tsx | 41 + .../src/menu/group-menu/index.ts | 1 + .../editor-plugins/src/menu/index.ts | 9 + .../src/menu/inline-menu/Container.tsx | 108 + .../src/menu/inline-menu/Plugin.tsx | 37 + .../src/menu/inline-menu/Toolbar.tsx | 70 + .../src/menu/inline-menu/config.ts | 102 + .../src/menu/inline-menu/index.ts | 1 + .../inline-menu/menu-item/DropdownItem.tsx | 196 + .../menu/inline-menu/menu-item/IconItem.tsx | 70 + .../src/menu/inline-menu/menu-item/index.ts | 2 + .../src/menu/inline-menu/types.ts | 50 + .../src/menu/inline-menu/utils.ts | 833 + .../src/menu/left-menu/LeftMenu.tsx | 101 + .../src/menu/left-menu/LeftMenuDraggable.tsx | 271 + .../src/menu/left-menu/LeftMenuPlugin.tsx | 176 + .../src/menu/left-menu/TurnIntoMenu.tsx | 40 + .../src/menu/left-menu/menu-config.ts | 104 + .../src/menu/reference-menu/ReferenceMenu.tsx | 150 + .../src/menu/reference-menu/container.tsx | 193 + .../src/menu/reference-menu/index.tsx | 33 + .../src/menu/selection-group-menu/MenuApp.tsx | 118 + .../SelectionGroupPlugin.tsx | 36 + .../src/menu/selection-group-menu/index.ts | 1 + .../src/placeholder/Placeholder.tsx | 38 + .../src/placeholder/PlaceholderPanel.tsx | 194 + .../editor-plugins/src/placeholder/index.ts | 1 + .../editor-plugins/src/search/index.tsx | 50 + .../editor-plugins/src/search/search.tsx | 117 + .../editor-plugins/src/template/index.ts | 1 + .../editor-plugins/src/template/readme.md | 6 + .../editor-plugins/src/template/template.ts | 107 + .../editor-plugins/src/utils/index.ts | 1 + .../src/utils/plugin-render-root.ts | 36 + libs/components/editor-plugins/tsconfig.json | 26 + .../editor-plugins/tsconfig.lib.json | 22 + .../editor-plugins/tsconfig.spec.json | 19 + libs/components/icons/.babelrc | 12 + libs/components/icons/.eslintrc.json | 21 + libs/components/icons/README.md | 7 + libs/components/icons/jest.config.ts | 10 + libs/components/icons/package.json | 5 + libs/components/icons/project.json | 57 + .../src/auto-icons/add-view/add-view.svg | 1 + .../src/auto-icons/add-view/add-view.tsx | 21 + .../auto-icons/align-center/align-center.svg | 1 + .../auto-icons/align-center/align-center.tsx | 21 + .../align-justify/align-justify.svg | 1 + .../align-justify/align-justify.tsx | 21 + .../src/auto-icons/align-left/align-left.svg | 1 + .../src/auto-icons/align-left/align-left.tsx | 21 + .../auto-icons/align-right/align-right.svg | 1 + .../auto-icons/align-right/align-right.tsx | 21 + .../arrow-drop-down/arrow-drop-down.svg | 1 + .../arrow-drop-down/arrow-drop-down.tsx | 21 + .../auto-icons/arrow-right/arrow-right.svg | 1 + .../auto-icons/arrow-right/arrow-right.tsx | 21 + .../icons/src/auto-icons/arrow/arrow.svg | 1 + .../icons/src/auto-icons/arrow/arrow.tsx | 21 + .../components/icons/src/auto-icons/at/at.svg | 1 + .../components/icons/src/auto-icons/at/at.tsx | 21 + .../src/auto-icons/backlinks/backlinks.svg | 1 + .../src/auto-icons/backlinks/backlinks.tsx | 21 + .../backward-undo/backward-undo.svg | 1 + .../backward-undo/backward-undo.tsx | 21 + .../icons/src/auto-icons/blocks/blocks.svg | 1 + .../icons/src/auto-icons/blocks/blocks.tsx | 21 + .../src/auto-icons/board-view/board-view.svg | 1 + .../src/auto-icons/board-view/board-view.tsx | 21 + .../border-color-duotone.svg | 1 + .../border-color-duotone.tsx | 22 + .../border-color-none/border-color-none.svg | 1 + .../border-color-none/border-color-none.tsx | 21 + .../icons/src/auto-icons/brush/brush.svg | 1 + .../icons/src/auto-icons/brush/brush.tsx | 21 + .../icons/src/auto-icons/bullet/bullet.svg | 1 + .../icons/src/auto-icons/bullet/bullet.tsx | 21 + .../bulleted-list-1/bulleted-list-1.svg | 1 + .../bulleted-list-1/bulleted-list-1.tsx | 21 + .../bulleted-list-2/bulleted-list-2.svg | 1 + .../bulleted-list-2/bulleted-list-2.tsx | 21 + .../bulleted-list-3/bulleted-list-3.svg | 1 + .../bulleted-list-3/bulleted-list-3.tsx | 21 + .../bulleted-list-4/bulleted-list-4.svg | 1 + .../bulleted-list-4/bulleted-list-4.tsx | 21 + .../icons/src/auto-icons/callout/callout.svg | 1 + .../icons/src/auto-icons/callout/callout.tsx | 21 + .../icons/src/auto-icons/card/card.svg | 1 + .../icons/src/auto-icons/card/card.tsx | 21 + .../check-box-check/check-box-check.svg | 1 + .../check-box-check/check-box-check.tsx | 21 + .../check-box-uncheck/check-box-uncheck.svg | 1 + .../check-box-uncheck/check-box-uncheck.tsx | 21 + .../src/auto-icons/code-block/code-block.svg | 1 + .../src/auto-icons/code-block/code-block.tsx | 21 + .../icons/src/auto-icons/code/code.svg | 1 + .../icons/src/auto-icons/code/code.tsx | 21 + .../auto-icons/collaborator/collaborator.svg | 1 + .../auto-icons/collaborator/collaborator.tsx | 21 + .../icons/src/auto-icons/comment/comment.svg | 1 + .../icons/src/auto-icons/comment/comment.tsx | 21 + .../conector-arrow/conector-arrow.svg | 1 + .../conector-arrow/conector-arrow.tsx | 21 + .../conector-line/conector-line.svg | 1 + .../conector-line/conector-line.tsx | 21 + .../src/auto-icons/connector/connector.svg | 1 + .../src/auto-icons/connector/connector.tsx | 21 + .../src/auto-icons/dash-line/dash-line.svg | 1 + .../src/auto-icons/dash-line/dash-line.tsx | 21 + .../icons/src/auto-icons/date/date.svg | 1 + .../icons/src/auto-icons/date/date.tsx | 21 + .../delete-cash-bin/delete-cash-bin.svg | 1 + .../delete-cash-bin/delete-cash-bin.tsx | 21 + .../delete-small-tag/delete-small-tag.svg | 1 + .../delete-small-tag/delete-small-tag.tsx | 21 + .../icons/src/auto-icons/divider/divider.svg | 1 + .../icons/src/auto-icons/divider/divider.tsx | 21 + .../src/auto-icons/doc-view/doc-view.svg | 1 + .../src/auto-icons/doc-view/doc-view.tsx | 21 + .../icons/src/auto-icons/done/done.svg | 1 + .../icons/src/auto-icons/done/done.tsx | 21 + .../src/auto-icons/duplicate/duplicate.svg | 1 + .../src/auto-icons/duplicate/duplicate.tsx | 21 + .../icons/src/auto-icons/edit/edit.svg | 1 + .../icons/src/auto-icons/edit/edit.tsx | 21 + .../icons/src/auto-icons/ellipse/ellipse.svg | 1 + .../icons/src/auto-icons/ellipse/ellipse.tsx | 21 + .../icons/src/auto-icons/email/email.svg | 1 + .../icons/src/auto-icons/email/email.tsx | 21 + .../icons/src/auto-icons/embed/embed.svg | 1 + .../icons/src/auto-icons/embed/embed.tsx | 21 + .../icons/src/auto-icons/eraser/eraser.svg | 1 + .../icons/src/auto-icons/eraser/eraser.tsx | 21 + .../icons/src/auto-icons/figma/figma.svg | 1 + .../icons/src/auto-icons/figma/figma.tsx | 21 + .../icons/src/auto-icons/file/file.svg | 1 + .../icons/src/auto-icons/file/file.tsx | 21 + .../icons/src/auto-icons/filter/filter.svg | 1 + .../icons/src/auto-icons/filter/filter.tsx | 21 + .../format-background/format-background.svg | 1 + .../format-background/format-background.tsx | 21 + .../format-bold-emphasis.svg | 1 + .../format-bold-emphasis.tsx | 21 + .../auto-icons/format-clear/format-clear.svg | 1 + .../auto-icons/format-clear/format-clear.tsx | 21 + .../format-color-text/format-color-text.svg | 1 + .../format-color-text/format-color-text.tsx | 21 + .../format-italic/format-italic.svg | 1 + .../format-italic/format-italic.tsx | 21 + .../format-strikethrough.svg | 1 + .../format-strikethrough.tsx | 21 + .../auto-icons/forward-redo/forward-redo.svg | 1 + .../auto-icons/forward-redo/forward-redo.tsx | 21 + .../icons/src/auto-icons/frame/frame.svg | 1 + .../icons/src/auto-icons/frame/frame.tsx | 21 + .../auto-icons/full-screen/full-screen.svg | 1 + .../auto-icons/full-screen/full-screen.tsx | 21 + .../src/auto-icons/group-by/group-by.svg | 1 + .../src/auto-icons/group-by/group-by.tsx | 21 + .../icons/src/auto-icons/group/group.svg | 1 + .../icons/src/auto-icons/group/group.tsx | 21 + .../src/auto-icons/hand-tool/hand-tool.svg | 1 + .../src/auto-icons/hand-tool/hand-tool.tsx | 21 + .../auto-icons/handle-child/handle-child.svg | 1 + .../auto-icons/handle-child/handle-child.tsx | 21 + .../handle-parent/handle-parent.svg | 1 + .../handle-parent/handle-parent.tsx | 21 + .../auto-icons/heading-one/heading-one.svg | 1 + .../auto-icons/heading-one/heading-one.tsx | 21 + .../heading-three/heading-three.svg | 1 + .../heading-three/heading-three.tsx | 21 + .../auto-icons/heading-two/heading-two.svg | 1 + .../auto-icons/heading-two/heading-two.tsx | 21 + .../auto-icons/help-center/help-center.svg | 1 + .../auto-icons/help-center/help-center.tsx | 21 + .../highlighter-duotone.svg | 1 + .../highlighter-duotone.tsx | 24 + .../auto-icons/hover-frame/hover-frame.svg | 1 + .../auto-icons/hover-frame/hover-frame.tsx | 21 + .../icons/src/auto-icons/image/image.svg | 1 + .../icons/src/auto-icons/image/image.tsx | 21 + .../auto-icons/indent-right/indent-right.svg | 1 + .../auto-icons/indent-right/indent-right.tsx | 21 + libs/components/icons/src/auto-icons/index.ts | 127 + .../auto-icons/information/information.svg | 1 + .../auto-icons/information/information.tsx | 21 + .../icons/src/auto-icons/kan-ban/kan-ban.svg | 1 + .../icons/src/auto-icons/kan-ban/kan-ban.tsx | 21 + .../laser-pen-duotone/laser-pen-duotone.svg | 1 + .../laser-pen-duotone/laser-pen-duotone.tsx | 24 + .../icons/src/auto-icons/layout/layout.svg | 1 + .../icons/src/auto-icons/layout/layout.tsx | 21 + .../src/auto-icons/line-none/line-none.svg | 1 + .../src/auto-icons/line-none/line-none.tsx | 21 + .../icons/src/auto-icons/link/link.svg | 1 + .../icons/src/auto-icons/link/link.tsx | 21 + .../src/auto-icons/location/location.svg | 1 + .../src/auto-icons/location/location.tsx | 21 + .../icons/src/auto-icons/log-out/log-out.svg | 1 + .../icons/src/auto-icons/log-out/log-out.tsx | 21 + .../icons/src/auto-icons/logo/logo.svg | 1 + .../icons/src/auto-icons/logo/logo.tsx | 21 + .../icons/src/auto-icons/more/more.svg | 1 + .../icons/src/auto-icons/more/more.tsx | 21 + .../icons/src/auto-icons/move-to/move-to.svg | 1 + .../icons/src/auto-icons/move-to/move-to.tsx | 21 + .../auto-icons/multi-select/multi-select.svg | 1 + .../auto-icons/multi-select/multi-select.tsx | 21 + .../icons/src/auto-icons/number/number.svg | 1 + .../icons/src/auto-icons/number/number.tsx | 21 + .../page-duallink/page-duallink.svg | 1 + .../page-duallink/page-duallink.tsx | 21 + .../icons/src/auto-icons/pages/pages.svg | 1 + .../icons/src/auto-icons/pages/pages.tsx | 21 + .../icons/src/auto-icons/pen/pen.svg | 1 + .../icons/src/auto-icons/pen/pen.tsx | 21 + .../pencil-duotone/pencil-duotone.svg | 1 + .../pencil-duotone/pencil-duotone.tsx | 24 + .../icons/src/auto-icons/phone/phone.svg | 1 + .../icons/src/auto-icons/phone/phone.tsx | 21 + .../src/auto-icons/point-line/point-line.svg | 1 + .../src/auto-icons/point-line/point-line.tsx | 21 + .../icons/src/auto-icons/polygon/polygon.svg | 1 + .../icons/src/auto-icons/polygon/polygon.tsx | 21 + .../icons/src/auto-icons/quote/quote.svg | 1 + .../icons/src/auto-icons/quote/quote.tsx | 21 + .../src/auto-icons/reaction/reaction.svg | 1 + .../src/auto-icons/reaction/reaction.tsx | 21 + .../auto-icons/rectangle-93/rectangle-93.svg | 1 + .../auto-icons/rectangle-93/rectangle-93.tsx | 21 + .../src/auto-icons/rectangle/rectangle.svg | 1 + .../src/auto-icons/rectangle/rectangle.tsx | 21 + .../icons/src/auto-icons/search/search.svg | 1 + .../icons/src/auto-icons/search/search.tsx | 21 + .../select-box-select/select-box-select.svg | 1 + .../select-box-select/select-box-select.tsx | 21 + .../select-box-unselect.svg | 1 + .../select-box-unselect.tsx | 21 + .../icons/src/auto-icons/select/select.svg | 1 + .../icons/src/auto-icons/select/select.tsx | 21 + .../src/auto-icons/settings/settings.svg | 1 + .../src/auto-icons/settings/settings.tsx | 21 + .../shape-color-duotone.svg | 1 + .../shape-color-duotone.tsx | 22 + .../shape-color-none/shape-color-none.svg | 1 + .../shape-color-none/shape-color-none.tsx | 21 + .../icons/src/auto-icons/shape/shape.svg | 1 + .../icons/src/auto-icons/shape/shape.tsx | 21 + .../side-bar-view-close.svg | 1 + .../side-bar-view-close.tsx | 21 + .../side-bar-view/side-bar-view.svg | 1 + .../side-bar-view/side-bar-view.tsx | 21 + .../single-select/single-select.svg | 1 + .../single-select/single-select.tsx | 21 + .../src/auto-icons/solid-line/solid-line.svg | 1 + .../src/auto-icons/solid-line/solid-line.tsx | 21 + .../icons/src/auto-icons/sort/sort.svg | 1 + .../icons/src/auto-icons/sort/sort.tsx | 21 + .../icons/src/auto-icons/sql/sql.svg | 1 + .../icons/src/auto-icons/sql/sql.tsx | 21 + .../icons/src/auto-icons/stamp/stamp.svg | 1 + .../icons/src/auto-icons/stamp/stamp.tsx | 21 + .../icons/src/auto-icons/star/star.svg | 1 + .../icons/src/auto-icons/star/star.tsx | 21 + .../icons/src/auto-icons/status/status.svg | 1 + .../icons/src/auto-icons/status/status.tsx | 21 + .../switch-off-duotone/switch-off-duotone.svg | 1 + .../switch-off-duotone/switch-off-duotone.tsx | 25 + .../switch-on-duotone/switch-on-duotone.svg | 1 + .../switch-on-duotone/switch-on-duotone.tsx | 24 + .../icons/src/auto-icons/table/table.svg | 1 + .../icons/src/auto-icons/table/table.tsx | 21 + .../tag-add-duotone/tag-add-duotone.svg | 1 + .../tag-add-duotone/tag-add-duotone.tsx | 24 + .../icons/src/auto-icons/tags/tags.svg | 1 + .../icons/src/auto-icons/tags/tags.tsx | 21 + .../src/auto-icons/text-font/text-font.svg | 1 + .../src/auto-icons/text-font/text-font.tsx | 21 + .../icons/src/auto-icons/text/text.svg | 1 + .../icons/src/auto-icons/text/text.tsx | 21 + .../icons/src/auto-icons/to-do/to-do.svg | 1 + .../icons/src/auto-icons/to-do/to-do.tsx | 21 + .../src/auto-icons/todo-list/todo-list.svg | 1 + .../src/auto-icons/todo-list/todo-list.tsx | 21 + .../src/auto-icons/triangle/triangle.svg | 1 + .../src/auto-icons/triangle/triangle.tsx | 21 + .../src/auto-icons/turn-into/turn-into.svg | 1 + .../src/auto-icons/turn-into/turn-into.tsx | 21 + .../icons/src/auto-icons/ungroup/ungroup.svg | 1 + .../icons/src/auto-icons/ungroup/ungroup.tsx | 21 + .../icons/src/auto-icons/web-app/web-app.svg | 1 + .../icons/src/auto-icons/web-app/web-app.tsx | 21 + .../icons/src/auto-icons/youtube/youtube.svg | 1 + .../icons/src/auto-icons/youtube/youtube.tsx | 21 + libs/components/icons/src/index.ts | 1 + libs/components/icons/tsconfig.json | 25 + libs/components/icons/tsconfig.lib.json | 23 + libs/components/icons/tsconfig.spec.json | 20 + libs/components/layout/.babelrc | 12 + libs/components/layout/.eslintrc.json | 18 + libs/components/layout/README.md | 7 + libs/components/layout/jest.config.js | 9 + libs/components/layout/package.json | 22 + libs/components/layout/project.json | 44 + .../header/EditorBoardSwitcher/StatusIcon.tsx | 35 + .../header/EditorBoardSwitcher/StatusText.tsx | 27 + .../EditorBoardSwitcher/StatusTrack.tsx | 28 + .../header/EditorBoardSwitcher/Switcher.tsx | 63 + .../src/header/EditorBoardSwitcher/index.ts | 1 + .../src/header/EditorBoardSwitcher/type.ts | 6 + libs/components/layout/src/header/Header.tsx | 184 + .../layout/src/header/LayoutHeader.tsx | 81 + .../layout/src/header/PageHistoryPortal.tsx | 6 + .../layout/src/header/PageSettingPortal.tsx | 267 + .../layout/src/header/PageSharePortal.tsx | 146 + libs/components/layout/src/header/Tempnav.tsx | 80 + libs/components/layout/src/header/Title.tsx | 85 + .../src/header/file-exporter/file-exporter.ts | 59 + libs/components/layout/src/header/index.ts | 2 + libs/components/layout/src/header/types.ts | 7 + .../layout/src/header/use-layout-header.ts | 13 + .../header/user-menu-icon/UserMenuIcon.tsx | 34 + .../header/user-menu-icon/UserMenuList.tsx | 66 + .../layout/src/header/user-menu-icon/index.ts | 3 + libs/components/layout/src/index.ts | 3 + .../settings-sidebar/Comments/CommentItem.tsx | 120 + .../settings-sidebar/Comments/Comments.tsx | 36 + .../src/settings-sidebar/Comments/index.ts | 1 + .../Comments/item/CommentContent.tsx | 21 + .../Comments/item/CommentedByUser.tsx | 54 + .../Comments/item/QuotedContent.tsx | 53 + .../Comments/item/ReplyInput.tsx | 45 + .../Comments/item/ReplyItem.tsx | 16 + .../src/settings-sidebar/Comments/type.ts | 10 + .../settings-sidebar/Comments/use-comments.ts | 129 + .../src/settings-sidebar/Comments/utils.ts | 16 + .../ContainerTabs/ContainerTabs.tsx | 140 + .../ContainerTabs/TabItemTitle.tsx | 38 + .../settings-sidebar/ContainerTabs/index.ts | 1 + .../ContainerTabs/use-tabs.ts | 58 + .../Layout/LayoutSettings.tsx | 18 + .../src/settings-sidebar/Layout/index.ts | 1 + .../Settings/SettingsList.tsx | 52 + .../Settings/SettingsPanel.tsx | 23 + .../Settings/footer/Footer.tsx | 20 + .../Settings/footer/LastModified.tsx | 32 + .../Settings/footer/Logout.tsx | 43 + .../settings-sidebar/Settings/footer/index.ts | 1 + .../src/settings-sidebar/Settings/index.ts | 1 + .../Settings/use-setting-flags.ts | 21 + .../settings-sidebar/Settings/use-settings.ts | 140 + .../Settings/util/duplicate-page.ts | 29 + .../Settings/util/file-exporter.ts | 57 + .../Settings/util/get-page-info.ts | 50 + .../Settings/util/handle-export.ts | 42 + .../settings-sidebar/Settings/util/index.ts | 6 + .../Settings/util/inspector-workspace.ts | 32 + .../Settings/util/use-reading-mode.ts | 23 + .../Settings/util/use-workspace-page.ts | 16 + .../src/settings-sidebar/SettingsSidebar.tsx | 33 + .../layout/src/settings-sidebar/index.ts | 1 + .../settings-sidebar/use-settings-sidebar.ts | 5 + .../activities/activities.tsx | 114 + .../src/workspace-sidebar/activities/index.ts | 1 + .../calendar-heatmap/CalendarHeatmap.tsx | 100 + .../calendar-heatmap/HeatedDay.tsx | 48 + .../calendar-heatmap/index.ts | 2 + .../calendar-heatmap/types.ts | 17 + .../calendar-heatmap/use-calendar-heatmap.ts | 99 + .../calendar-heatmap/utils.ts | 125 + .../layout/src/workspace-sidebar/index.ts | 3 + .../workspace-sidebar/page-tree/DndTree.tsx | 142 + .../workspace-sidebar/page-tree/block-page.ts | 170 + .../src/workspace-sidebar/page-tree/index.ts | 6 + .../workspace-sidebar/page-tree/page-tree.tsx | 22 + .../page-tree/tree-item/DndTreeItem.tsx | 47 + .../page-tree/tree-item/MoreActions.tsx | 262 + .../tree-item/NewFromTemplatePortal.tsx | 149 + .../page-tree/tree-item/TreeItem.tsx | 184 + .../page-tree/tree-item/index.ts | 2 + .../page-tree/tree-item/tree-item.module.scss | 182 + .../src/workspace-sidebar/page-tree/types.ts | 25 + .../page-tree/use-page-tree.ts | 215 + .../src/workspace-sidebar/page-tree/utils.ts | 214 + libs/components/layout/tsconfig.json | 26 + libs/components/layout/tsconfig.lib.json | 22 + libs/components/layout/tsconfig.spec.json | 19 + libs/components/ui/.babelrc | 12 + libs/components/ui/.eslintrc.json | 18 + libs/components/ui/README.md | 7 + libs/components/ui/jest.config.ts | 10 + libs/components/ui/package.json | 19 + libs/components/ui/project.json | 43 + libs/components/ui/src/autocomplete/index.tsx | 3 + libs/components/ui/src/button/IconButton.tsx | 98 + libs/components/ui/src/button/base-button.ts | 31 + libs/components/ui/src/button/constants.ts | 6 + libs/components/ui/src/button/index.ts | 3 + libs/components/ui/src/button/list-button.tsx | 60 + libs/components/ui/src/cascader/Cascader.tsx | 187 + libs/components/ui/src/cascader/index.ts | 1 + libs/components/ui/src/checkbox/Checkbox.tsx | 28 + libs/components/ui/src/checkbox/index.tsx | 2 + libs/components/ui/src/classname/index.ts | 10 + .../components/ui/src/clickable/Clickable.tsx | 21 + libs/components/ui/src/clickable/index.ts | 1 + libs/components/ui/src/clsx.ts | 2 + libs/components/ui/src/date/Calendar.tsx | 14 + libs/components/ui/src/date/DateRange.tsx | 20 + libs/components/ui/src/date/index.ts | 11 + libs/components/ui/src/divider/Divider.tsx | 52 + libs/components/ui/src/divider/index.ts | 1 + libs/components/ui/src/event-away/index.ts | 62 + libs/components/ui/src/index.ts | 52 + libs/components/ui/src/input/Input.tsx | 64 + libs/components/ui/src/input/index.tsx | 2 + libs/components/ui/src/list/ListIcon.tsx | 12 + libs/components/ui/src/list/ListItem.tsx | 35 + libs/components/ui/src/list/index.ts | 2 + libs/components/ui/src/message/base.tsx | 48 + libs/components/ui/src/message/index.tsx | 18 + libs/components/ui/src/message/success.tsx | 14 + libs/components/ui/src/message/types.ts | 7 + libs/components/ui/src/model/index.tsx | 44 + libs/components/ui/src/mui.ts | 240 + .../ui/src/patch-elements/index.tsx | 39 + libs/components/ui/src/popover/Popover.tsx | 52 + libs/components/ui/src/popover/container.tsx | 27 + libs/components/ui/src/popover/index.tsx | 3 + libs/components/ui/src/popover/interface.ts | 23 + .../components/ui/src/popper/PopoverArrow.tsx | 92 + libs/components/ui/src/popper/Popper.tsx | 186 + libs/components/ui/src/popper/index.ts | 2 + libs/components/ui/src/popper/interface.ts | 70 + libs/components/ui/src/radio/Radio.tsx | 30 + libs/components/ui/src/radio/index.ts | 2 + libs/components/ui/src/select/OldSelect.tsx | 48 + libs/components/ui/src/select/Option.tsx | 45 + libs/components/ui/src/select/OptionGroup.tsx | 47 + libs/components/ui/src/select/Select.tsx | 129 + libs/components/ui/src/select/index.ts | 4 + libs/components/ui/src/slider/Slider.tsx | 115 + libs/components/ui/src/slider/index.ts | 1 + libs/components/ui/src/styled/index.ts | 73 + libs/components/ui/src/svg-icon/index.ts | 8 + libs/components/ui/src/switch/Switch.tsx | 119 + libs/components/ui/src/switch/index.ts | 2 + libs/components/ui/src/tag/Tag.tsx | 57 + libs/components/ui/src/tag/index.tsx | 2 + libs/components/ui/src/tag/style.ts | 53 + libs/components/ui/src/theme/README.md | 5 + libs/components/ui/src/theme/color.ts | 231 + libs/components/ui/src/theme/index.ts | 7 + libs/components/ui/src/theme/theme.ts | 253 + libs/components/ui/src/theme/utils.tsx | 39 + libs/components/ui/src/tooltip/Tooltip.tsx | 36 + libs/components/ui/src/tooltip/index.tsx | 1 + libs/components/ui/src/tooltip/interface.ts | 3 + libs/components/ui/src/typography/Typo.tsx | 17 + libs/components/ui/src/typography/index.ts | 1 + libs/components/ui/tsconfig.json | 26 + libs/components/ui/tsconfig.lib.json | 23 + libs/components/ui/tsconfig.spec.json | 20 + libs/datasource/commands/.babelrc | 10 + libs/datasource/commands/.eslintrc.json | 18 + libs/datasource/commands/README.md | 11 + libs/datasource/commands/jest.config.ts | 15 + libs/datasource/commands/package.json | 7 + libs/datasource/commands/project.json | 33 + libs/datasource/commands/src/index.ts | 1 + .../src/lib/commands/block-command.ts | 48 + .../commands/src/lib/commands/index.ts | 2 + .../commands/src/lib/commands/text-command.ts | 43 + .../src/lib/datasource-commands.spec.ts | 7 + .../commands/src/lib/datasource-commands.ts | 16 + libs/datasource/commands/tsconfig.json | 23 + libs/datasource/commands/tsconfig.lib.json | 10 + libs/datasource/commands/tsconfig.spec.json | 9 + libs/datasource/db-service/.babelrc | 12 + libs/datasource/db-service/.eslintrc.json | 18 + libs/datasource/db-service/README.md | 7 + libs/datasource/db-service/jest.config.js | 9 + libs/datasource/db-service/package.json | 12 + libs/datasource/db-service/project.json | 44 + libs/datasource/db-service/src/index.ts | 62 + .../db-service/src/protocol/index.ts | 45 + .../db-service/src/services/base.ts | 168 + .../src/services/comment/comment.ts | 315 + .../db-service/src/services/comment/index.ts | 2 + .../db-service/src/services/comment/types.ts | 64 + .../db-service/src/services/database/index.ts | 180 + .../src/services/database/observer.ts | 69 + .../src/services/editor-block/index.ts | 431 + .../editor-block/templates/group-templates.ts | 604 + .../services/editor-block/templates/index.ts | 3 + .../templates/template-factory.ts | 40 + .../services/editor-block/templates/types.ts | 25 + .../src/services/editor-block/types.ts | 75 + .../utils/column/default-config.ts | 192 + .../editor-block/utils/column/index.ts | 117 + .../editor-block/utils/column/types.ts | 204 + .../editor-block/utils/column/utils.ts | 38 + .../src/services/editor-block/utils/common.ts | 58 + .../src/services/editor-block/utils/index.ts | 57 + .../db-service/src/services/file/index.ts | 52 + .../db-service/src/services/index.ts | 108 + .../src/services/workspace/page-tree.ts | 225 + .../src/services/workspace/types.ts | 13 + .../src/services/workspace/user-config.ts | 124 + .../db-service/src/utils/constants.ts | 5 + libs/datasource/db-service/src/utils/index.ts | 1 + libs/datasource/db-service/tsconfig.json | 24 + libs/datasource/db-service/tsconfig.lib.json | 22 + libs/datasource/db-service/tsconfig.spec.json | 19 + libs/datasource/feature-flags/.babelrc | 12 + libs/datasource/feature-flags/.eslintrc.json | 18 + libs/datasource/feature-flags/README.md | 55 + libs/datasource/feature-flags/jest.config.ts | 10 + libs/datasource/feature-flags/package.json | 8 + libs/datasource/feature-flags/project.json | 45 + libs/datasource/feature-flags/src/Context.tsx | 63 + libs/datasource/feature-flags/src/config.ts | 11 + libs/datasource/feature-flags/src/index.ts | 111 + libs/datasource/feature-flags/tsconfig.json | 27 + .../feature-flags/tsconfig.lib.json | 23 + .../feature-flags/tsconfig.spec.json | 20 + libs/datasource/jwt-rpc/.babelrc | 12 + libs/datasource/jwt-rpc/.eslintrc.json | 18 + libs/datasource/jwt-rpc/jest.config.ts | 10 + libs/datasource/jwt-rpc/package.json | 11 + libs/datasource/jwt-rpc/project.json | 45 + libs/datasource/jwt-rpc/src/connector.ts | 347 + libs/datasource/jwt-rpc/src/handler.ts | 82 + libs/datasource/jwt-rpc/src/index.ts | 1 + libs/datasource/jwt-rpc/src/provider.ts | 134 + libs/datasource/jwt-rpc/tsconfig.json | 27 + libs/datasource/jwt-rpc/tsconfig.lib.json | 23 + libs/datasource/jwt-rpc/tsconfig.spec.json | 20 + libs/datasource/jwt/.babelrc | 12 + libs/datasource/jwt/.eslintrc.json | 27 + libs/datasource/jwt/jest.config.js | 9 + libs/datasource/jwt/package.json | 33 + libs/datasource/jwt/project.json | 43 + libs/datasource/jwt/src/adapter/index.ts | 161 + libs/datasource/jwt/src/adapter/yjs/binary.ts | 66 + libs/datasource/jwt/src/adapter/yjs/block.ts | 293 + .../jwt/src/adapter/yjs/gatekeeper.ts | 53 + .../datasource/jwt/src/adapter/yjs/history.ts | 73 + libs/datasource/jwt/src/adapter/yjs/index.ts | 605 + .../jwt/src/adapter/yjs/listener.ts | 96 + .../jwt/src/adapter/yjs/operation.ts | 388 + libs/datasource/jwt/src/block/abstract.ts | 372 + libs/datasource/jwt/src/block/base.ts | 321 + libs/datasource/jwt/src/block/capability.ts | 15 + libs/datasource/jwt/src/block/index.ts | 12 + libs/datasource/jwt/src/block/indexer.ts | 316 + libs/datasource/jwt/src/index.ts | 592 + libs/datasource/jwt/src/types/block.ts | 81 + libs/datasource/jwt/src/types/index.ts | 28 + libs/datasource/jwt/src/types/metadata.ts | 203 + libs/datasource/jwt/src/types/utils.ts | 8 + libs/datasource/jwt/src/types/uuid.ts | 76 + libs/datasource/jwt/src/utils/event-bus.ts | 107 + libs/datasource/jwt/src/utils/index.ts | 57 + libs/datasource/jwt/tsconfig.json | 24 + libs/datasource/jwt/tsconfig.lib.json | 22 + libs/datasource/jwt/tsconfig.spec.json | 19 + libs/datasource/remote-kv/.babelrc | 12 + libs/datasource/remote-kv/.eslintrc.json | 18 + libs/datasource/remote-kv/README.md | 128 + libs/datasource/remote-kv/jest.config.js | 9 + libs/datasource/remote-kv/package.json | 13 + libs/datasource/remote-kv/project.json | 45 + .../remote-kv/src/aws/aws-attachment.ts | 272 + .../remote-kv/src/aws/aws-config.ts | 9 + .../remote-kv/src/constant/message-info.ts | 22 + libs/datasource/remote-kv/src/index.ts | 21 + .../remote-kv/src/utils/to-async.ts | 4 + libs/datasource/remote-kv/tsconfig.json | 27 + libs/datasource/remote-kv/tsconfig.lib.json | 22 + libs/datasource/remote-kv/tsconfig.spec.json | 19 + libs/datasource/state/.babelrc | 12 + libs/datasource/state/.eslintrc.json | 18 + libs/datasource/state/README.md | 3 + libs/datasource/state/jest.config.js | 9 + libs/datasource/state/package.json | 12 + libs/datasource/state/project.json | 44 + libs/datasource/state/src/index.ts | 3 + libs/datasource/state/src/page.ts | 28 + libs/datasource/state/src/ui.ts | 51 + libs/datasource/state/src/user.ts | 83 + libs/datasource/state/tsconfig.json | 26 + libs/datasource/state/tsconfig.lib.json | 22 + libs/datasource/state/tsconfig.spec.json | 19 + libs/framework/virgo/.babelrc | 12 + libs/framework/virgo/.eslintrc.json | 18 + libs/framework/virgo/README.md | 7 + libs/framework/virgo/jest.config.js | 9 + libs/framework/virgo/package.json | 6 + libs/framework/virgo/project.json | 48 + libs/framework/virgo/src/index.ts | 4 + libs/framework/virgo/tsconfig.json | 27 + libs/framework/virgo/tsconfig.lib.json | 22 + libs/framework/virgo/tsconfig.spec.json | 19 + libs/rollup-ts-checker.config.cjs | 32 + libs/rollup.config.cjs | 32 + libs/utils/.babelrc | 12 + libs/utils/.eslintrc.json | 18 + libs/utils/jest.config.js | 9 + libs/utils/package.json | 14 + libs/utils/project.json | 42 + libs/utils/src/constants.ts | 10 + libs/utils/src/copy-to-clipboard.ts | 3 + libs/utils/src/date.ts | 14 + libs/utils/src/di/di.ts | 124 + libs/utils/src/di/index.ts | 6 + libs/utils/src/dom.ts | 112 + libs/utils/src/env.ts | 1 + libs/utils/src/error-boundary.tsx | 177 + libs/utils/src/function.ts | 17 + libs/utils/src/index.ts | 35 + libs/utils/src/keyboard.ts | 20 + libs/utils/src/lodash.ts | 24 + libs/utils/src/logger.ts | 4 + libs/utils/src/rect.ts | 172 + libs/utils/src/types/index.ts | 2 + libs/utils/src/types/tools.ts | 32 + libs/utils/src/types/user-workspace.ts | 8 + libs/utils/src/useragent.ts | 74 + libs/utils/src/utils.ts | 78 + libs/utils/tsconfig.json | 24 + libs/utils/tsconfig.lib.json | 22 + libs/utils/tsconfig.spec.json | 19 + nx.json | 56 + package.json | 153 + pnpm-lock.yaml | 17261 ++++++++++++++++ pnpm-workspace.yaml | 3 + tools/executors/figmaRes/download.js | 45 + tools/executors/figmaRes/executor.json | 9 + tools/executors/figmaRes/figma/api.js | 56 + .../figmaRes/figma/generateReactIcon.js | 126 + tools/executors/figmaRes/figma/index.js | 119 + tools/executors/figmaRes/figma/svgo.js | 44 + tools/executors/figmaRes/figma/util.js | 9 + tools/executors/figmaRes/package.json | 3 + tools/executors/figmaRes/patch-styles.js | 41 + tools/executors/figmaRes/schema.json | 11 + tools/executors/svgOptimize/executor.json | 9 + tools/executors/svgOptimize/package.json | 3 + tools/executors/svgOptimize/schema.json | 11 + tools/executors/svgOptimize/svgo.js | 138 + tools/executors/tsCheck/executor.json | 9 + tools/executors/tsCheck/package.json | 3 + tools/executors/tsCheck/schema.json | 11 + tools/executors/tsCheck/tsCheck.js | 18 + tools/generators/.gitkeep | 0 tools/notify.mjs | 16 + tools/tsconfig.tools.json | 12 + tsconfig.base.json | 98 + workspace.json | 32 + 1451 files changed, 108124 insertions(+) create mode 100644 .all-contributorsrc create mode 100644 .cz-config.js create mode 100644 .editorconfig create mode 100644 .env create mode 100644 .eslintignore create mode 100644 .eslintrc.json create mode 100644 .free.env create mode 100644 .github/CODEOWNERS create mode 100644 .github/workflows/lint.yml create mode 100644 .github/workflows/lisa.yml create mode 100644 .gitignore create mode 100755 .husky/pre-commit create mode 100755 .husky/pre-push create mode 100644 .npmrc create mode 100644 .prettierignore create mode 100644 .prettierrc create mode 100644 .vscode/extensions.json create mode 100644 .vscode/settings.json create mode 100644 Caddyfile create mode 100644 Dockerfile create mode 100644 LICENSE create mode 100644 README.md create mode 100644 apps/.gitkeep create mode 100644 apps/ligo-virgo/.babelrc create mode 100644 apps/ligo-virgo/.browserslistrc create mode 100644 apps/ligo-virgo/.eslintrc.json create mode 100644 apps/ligo-virgo/jest.config.js create mode 100644 apps/ligo-virgo/package.json create mode 100644 apps/ligo-virgo/project.json create mode 100644 apps/ligo-virgo/proxy.conf.json create mode 100644 apps/ligo-virgo/src/assets/.gitkeep create mode 100644 apps/ligo-virgo/src/assets/images/favicon.ico create mode 100644 apps/ligo-virgo/src/custom-formatter.ts create mode 100644 apps/ligo-virgo/src/environments/environment.prod.ts create mode 100644 apps/ligo-virgo/src/environments/environment.ts create mode 100644 apps/ligo-virgo/src/index.html create mode 100644 apps/ligo-virgo/src/index.tsx create mode 100644 apps/ligo-virgo/src/pages/AppContainer.tsx create mode 100644 apps/ligo-virgo/src/pages/AppRoutes.tsx create mode 100644 apps/ligo-virgo/src/pages/RoutePrivate.tsx create mode 100644 apps/ligo-virgo/src/pages/RoutePublicAutoLogin.tsx create mode 100644 apps/ligo-virgo/src/pages/account/index.ts create mode 100644 apps/ligo-virgo/src/pages/agenda/calendar/index.tsx create mode 100644 apps/ligo-virgo/src/pages/agenda/container/index.tsx create mode 100644 apps/ligo-virgo/src/pages/agenda/home/index.tsx create mode 100644 apps/ligo-virgo/src/pages/agenda/index.tsx create mode 100644 apps/ligo-virgo/src/pages/agenda/tasks/index.tsx create mode 100644 apps/ligo-virgo/src/pages/agenda/today/index.tsx create mode 100644 apps/ligo-virgo/src/pages/index.ts create mode 100644 apps/ligo-virgo/src/pages/recent/index.tsx create mode 100644 apps/ligo-virgo/src/pages/search/index.tsx create mode 100644 apps/ligo-virgo/src/pages/settings/index.tsx create mode 100644 apps/ligo-virgo/src/pages/shared/index.tsx create mode 100644 apps/ligo-virgo/src/pages/starred/index.tsx create mode 100644 apps/ligo-virgo/src/pages/status/page-not-found.tsx create mode 100644 apps/ligo-virgo/src/pages/status/workspace-not-found.tsx create mode 100644 apps/ligo-virgo/src/pages/templates/index.tsx create mode 100644 apps/ligo-virgo/src/pages/templates/template-data.ts create mode 100644 apps/ligo-virgo/src/pages/tools/container.tsx create mode 100644 apps/ligo-virgo/src/pages/tools/icons/Icons.tsx create mode 100644 apps/ligo-virgo/src/pages/tools/icons/copy.ts create mode 100644 apps/ligo-virgo/src/pages/tools/icons/index.ts create mode 100644 apps/ligo-virgo/src/pages/tools/index.tsx create mode 100644 apps/ligo-virgo/src/pages/ui/index.tsx create mode 100644 apps/ligo-virgo/src/pages/workspace/Container.tsx create mode 100644 apps/ligo-virgo/src/pages/workspace/Home.tsx create mode 100644 apps/ligo-virgo/src/pages/workspace/Whiteboard.tsx create mode 100644 apps/ligo-virgo/src/pages/workspace/docs/collapsible-page-tree.tsx create mode 100644 apps/ligo-virgo/src/pages/workspace/docs/index.spec.tsx create mode 100644 apps/ligo-virgo/src/pages/workspace/docs/index.tsx create mode 100644 apps/ligo-virgo/src/pages/workspace/docs/quick-find-portal.tsx create mode 100644 apps/ligo-virgo/src/pages/workspace/docs/templates-portal.tsx create mode 100644 apps/ligo-virgo/src/pages/workspace/docs/workspace-name.tsx create mode 100644 apps/ligo-virgo/src/pages/workspace/index.tsx create mode 100644 apps/ligo-virgo/src/pages/workspace/labels/index.tsx create mode 100644 apps/ligo-virgo/src/pages/workspace/pages/index.tsx create mode 100644 apps/ligo-virgo/src/pages/workspace/whiteboard/index.bak.tsx create mode 100644 apps/ligo-virgo/src/polyfills.ts create mode 100644 apps/ligo-virgo/src/styles.css create mode 100644 apps/ligo-virgo/src/template.html create mode 100644 apps/ligo-virgo/tsconfig.app.json create mode 100644 apps/ligo-virgo/tsconfig.json create mode 100644 apps/ligo-virgo/tsconfig.spec.json create mode 100644 apps/ligo-virgo/webpack.config.js create mode 100644 babel.config.json create mode 100644 docs/CONTRIBUTING.md create mode 100644 docs/affine-code-guideline.md create mode 100644 docs/affine-git-guideline.md create mode 100644 docs/affine-icons-user-guide.md create mode 100644 docs/how-to-add-ui-component-in-affine.md create mode 100644 docs/how-to-auto-download-figma-assets-in-affine.md create mode 100644 docs/how-to-customize-rollup-config.md create mode 100644 docs/how-to-write-css-in-affine.md create mode 100644 jest.config.js create mode 100644 jest.preset.js create mode 100644 libs/.gitkeep create mode 100644 libs/components/account/.babelrc create mode 100644 libs/components/account/.eslintrc.json create mode 100644 libs/components/account/README.md create mode 100644 libs/components/account/jest.config.js create mode 100644 libs/components/account/package.json create mode 100644 libs/components/account/project.json create mode 100644 libs/components/account/src/error.tsx create mode 100644 libs/components/account/src/index.ts create mode 100644 libs/components/account/src/loading.tsx create mode 100644 libs/components/account/src/login/authing.tsx create mode 100644 libs/components/account/src/login/firebase.tsx create mode 100644 libs/components/account/src/login/index.tsx create mode 100644 libs/components/account/tsconfig.json create mode 100644 libs/components/account/tsconfig.lib.json create mode 100644 libs/components/account/tsconfig.spec.json create mode 100644 libs/components/affine-board/.babelrc create mode 100644 libs/components/affine-board/.eslintrc.json create mode 100644 libs/components/affine-board/README.md create mode 100644 libs/components/affine-board/jest.config.ts create mode 100644 libs/components/affine-board/package.json create mode 100644 libs/components/affine-board/project.json create mode 100644 libs/components/affine-board/src/Board.tsx create mode 100644 libs/components/affine-board/src/hooks/index.ts create mode 100644 libs/components/affine-board/src/hooks/use-shapes.ts create mode 100644 libs/components/affine-board/src/index.ts create mode 100644 libs/components/affine-board/tsconfig.json create mode 100644 libs/components/affine-board/tsconfig.lib.json create mode 100644 libs/components/affine-board/tsconfig.spec.json create mode 100644 libs/components/affine-editor/.babelrc create mode 100644 libs/components/affine-editor/.eslintrc.json create mode 100644 libs/components/affine-editor/jest.config.js create mode 100644 libs/components/affine-editor/package.json create mode 100644 libs/components/affine-editor/project.json create mode 100644 libs/components/affine-editor/src/Editor.tsx create mode 100644 libs/components/affine-editor/src/create-editor.ts create mode 100644 libs/components/affine-editor/src/index.ts create mode 100644 libs/components/affine-editor/tsconfig.json create mode 100644 libs/components/affine-editor/tsconfig.lib.json create mode 100644 libs/components/affine-editor/tsconfig.spec.json create mode 100644 libs/components/board-commands/.babelrc create mode 100644 libs/components/board-commands/.eslintrc.json create mode 100644 libs/components/board-commands/README.md create mode 100644 libs/components/board-commands/jest.config.ts create mode 100644 libs/components/board-commands/package.json create mode 100644 libs/components/board-commands/project.json create mode 100644 libs/components/board-commands/src/align-shapes.ts create mode 100644 libs/components/board-commands/src/change-page.ts create mode 100644 libs/components/board-commands/src/create-page.ts create mode 100644 libs/components/board-commands/src/create-shapes.ts create mode 100644 libs/components/board-commands/src/delete-page.ts create mode 100644 libs/components/board-commands/src/delete-shapes.ts create mode 100644 libs/components/board-commands/src/distribute-shapes.ts create mode 100644 libs/components/board-commands/src/duplicate-page.ts create mode 100644 libs/components/board-commands/src/duplicate-shapes.ts create mode 100644 libs/components/board-commands/src/flip-shapes.ts create mode 100644 libs/components/board-commands/src/group-shapes.ts create mode 100644 libs/components/board-commands/src/index.ts create mode 100644 libs/components/board-commands/src/move-shapes-to-page.ts create mode 100644 libs/components/board-commands/src/rename-page.ts create mode 100644 libs/components/board-commands/src/reorder-shapes.ts create mode 100644 libs/components/board-commands/src/reset-bounds.ts create mode 100644 libs/components/board-commands/src/rotate-shapes.ts create mode 100644 libs/components/board-commands/src/set-shapes-props.ts create mode 100644 libs/components/board-commands/src/shared/remove-shapes-from-page.ts create mode 100644 libs/components/board-commands/src/stretch-shapes.ts create mode 100644 libs/components/board-commands/src/style-shapes.ts create mode 100644 libs/components/board-commands/src/toggle-shapes-decoration.ts create mode 100644 libs/components/board-commands/src/toggle-shapes-prop.ts create mode 100644 libs/components/board-commands/src/translate-shapes.ts create mode 100644 libs/components/board-commands/src/ungroup-shapes.ts create mode 100644 libs/components/board-commands/src/update-shapes.ts create mode 100644 libs/components/board-commands/tsconfig.json create mode 100644 libs/components/board-commands/tsconfig.lib.json create mode 100644 libs/components/board-commands/tsconfig.spec.json create mode 100644 libs/components/board-draw/.babelrc create mode 100644 libs/components/board-draw/.eslintrc.json create mode 100644 libs/components/board-draw/README.md create mode 100644 libs/components/board-draw/jest.config.ts create mode 100644 libs/components/board-draw/package.json create mode 100644 libs/components/board-draw/project.json create mode 100644 libs/components/board-draw/src/TlDraw.tsx create mode 100644 libs/components/board-draw/src/components/command-panel/BorderColorConfig.tsx create mode 100644 libs/components/board-draw/src/components/command-panel/CommandPanel.tsx create mode 100644 libs/components/board-draw/src/components/command-panel/DeleteOperation.tsx create mode 100644 libs/components/board-draw/src/components/command-panel/FillColorConfig.tsx create mode 100644 libs/components/board-draw/src/components/command-panel/FontSizeConfig.tsx create mode 100644 libs/components/board-draw/src/components/command-panel/GroupOperation.tsx create mode 100644 libs/components/board-draw/src/components/command-panel/index.ts create mode 100644 libs/components/board-draw/src/components/command-panel/stroke-line-style-config/LineStyle.tsx create mode 100644 libs/components/board-draw/src/components/command-panel/stroke-line-style-config/StrokeLineStyleConfig.tsx create mode 100644 libs/components/board-draw/src/components/command-panel/stroke-line-style-config/index.ts create mode 100644 libs/components/board-draw/src/components/command-panel/utils/get-anchor.ts create mode 100644 libs/components/board-draw/src/components/command-panel/utils/index.ts create mode 100644 libs/components/board-draw/src/components/command-panel/utils/use-config.ts create mode 100644 libs/components/board-draw/src/components/context-menu/context-menu.tsx create mode 100644 libs/components/board-draw/src/components/context-menu/index.ts create mode 100644 libs/components/board-draw/src/components/error-fallback/error-fallback.tsx create mode 100644 libs/components/board-draw/src/components/error-fallback/index.ts create mode 100644 libs/components/board-draw/src/components/loading/index.ts create mode 100644 libs/components/board-draw/src/components/loading/loading.tsx create mode 100644 libs/components/board-draw/src/components/palette/Palette.tsx create mode 100644 libs/components/board-draw/src/components/palette/index.ts create mode 100644 libs/components/board-draw/src/components/tools-panel/LineTools.tsx create mode 100644 libs/components/board-draw/src/components/tools-panel/ShapeTools.tsx create mode 100644 libs/components/board-draw/src/components/tools-panel/ToolsPanel.tsx create mode 100644 libs/components/board-draw/src/components/tools-panel/index.ts create mode 100644 libs/components/board-draw/src/components/tools-panel/pen-tools/Pen.tsx create mode 100644 libs/components/board-draw/src/components/tools-panel/pen-tools/PenTools.tsx create mode 100644 libs/components/board-draw/src/components/tools-panel/pen-tools/index.ts create mode 100644 libs/components/board-draw/src/components/zoom-bar/ZoomBar.tsx create mode 100644 libs/components/board-draw/src/components/zoom-bar/index.ts create mode 100644 libs/components/board-draw/src/components/zoom-bar/mini-map/MiniMap.tsx create mode 100644 libs/components/board-draw/src/components/zoom-bar/mini-map/SimplifiedShape.tsx create mode 100644 libs/components/board-draw/src/components/zoom-bar/mini-map/Viewport.tsx create mode 100644 libs/components/board-draw/src/components/zoom-bar/mini-map/bounds.ts create mode 100644 libs/components/board-draw/src/components/zoom-bar/mini-map/index.ts create mode 100644 libs/components/board-draw/src/constants.ts create mode 100644 libs/components/board-draw/src/hooks/index.ts create mode 100644 libs/components/board-draw/src/hooks/use-file-system-handlers.ts create mode 100644 libs/components/board-draw/src/hooks/use-keyboard-shortcuts.tsx create mode 100644 libs/components/board-draw/src/hooks/use-stylesheet.ts create mode 100644 libs/components/board-draw/src/hooks/use-tldraw-app.ts create mode 100644 libs/components/board-draw/src/index.ts create mode 100644 libs/components/board-draw/tsconfig.json create mode 100644 libs/components/board-draw/tsconfig.lib.json create mode 100644 libs/components/board-draw/tsconfig.spec.json create mode 100644 libs/components/board-sessions/.babelrc create mode 100644 libs/components/board-sessions/.eslintrc.json create mode 100644 libs/components/board-sessions/README.md create mode 100644 libs/components/board-sessions/jest.config.ts create mode 100644 libs/components/board-sessions/package.json create mode 100644 libs/components/board-sessions/project.json create mode 100644 libs/components/board-sessions/src/arrow-session.ts create mode 100644 libs/components/board-sessions/src/base-session.ts create mode 100644 libs/components/board-sessions/src/brush-session.ts create mode 100644 libs/components/board-sessions/src/draw-session.ts create mode 100644 libs/components/board-sessions/src/erase-session.ts create mode 100644 libs/components/board-sessions/src/grid-session.ts create mode 100644 libs/components/board-sessions/src/handle-session.ts create mode 100644 libs/components/board-sessions/src/index.ts create mode 100644 libs/components/board-sessions/src/laser-session.ts create mode 100644 libs/components/board-sessions/src/rotate-session.ts create mode 100644 libs/components/board-sessions/src/transform-session.ts create mode 100644 libs/components/board-sessions/src/transform-single-session.ts create mode 100644 libs/components/board-sessions/src/translate-label-session.ts create mode 100644 libs/components/board-sessions/src/translate-session.ts create mode 100644 libs/components/board-sessions/tsconfig.json create mode 100644 libs/components/board-sessions/tsconfig.lib.json create mode 100644 libs/components/board-sessions/tsconfig.spec.json create mode 100644 libs/components/board-shapes/.babelrc create mode 100644 libs/components/board-shapes/.eslintrc.json create mode 100644 libs/components/board-shapes/README.md create mode 100644 libs/components/board-shapes/jest.config.ts create mode 100644 libs/components/board-shapes/package.json create mode 100644 libs/components/board-shapes/project.json create mode 100644 libs/components/board-shapes/src/TDShapeUtil.tsx create mode 100644 libs/components/board-shapes/src/arrow-util/arrow-helpers.ts create mode 100644 libs/components/board-shapes/src/arrow-util/arrow-util.tsx create mode 100644 libs/components/board-shapes/src/arrow-util/components/arrow-head.tsx create mode 100644 libs/components/board-shapes/src/arrow-util/components/curved-arrow.tsx create mode 100644 libs/components/board-shapes/src/arrow-util/components/straight-arrow.tsx create mode 100644 libs/components/board-shapes/src/arrow-util/index.ts create mode 100644 libs/components/board-shapes/src/draw-util/DrawUtil.tsx create mode 100644 libs/components/board-shapes/src/draw-util/draw-helpers.ts create mode 100644 libs/components/board-shapes/src/draw-util/index.ts create mode 100644 libs/components/board-shapes/src/editor-util/EditorUtil.tsx create mode 100644 libs/components/board-shapes/src/editor-util/index.ts create mode 100644 libs/components/board-shapes/src/ellipse-util/EllipseUtil.tsx create mode 100644 libs/components/board-shapes/src/ellipse-util/components/DashedEllipse.tsx create mode 100644 libs/components/board-shapes/src/ellipse-util/components/DrawEllipse.tsx create mode 100644 libs/components/board-shapes/src/ellipse-util/ellipse-helpers.ts create mode 100644 libs/components/board-shapes/src/ellipse-util/index.ts create mode 100644 libs/components/board-shapes/src/frame-util/components/draw-frame.tsx create mode 100644 libs/components/board-shapes/src/frame-util/components/frame-binding-indicator.tsx create mode 100644 libs/components/board-shapes/src/frame-util/frame-util.tsx create mode 100644 libs/components/board-shapes/src/frame-util/index.ts create mode 100644 libs/components/board-shapes/src/group-util/group-util.tsx create mode 100644 libs/components/board-shapes/src/group-util/index.ts create mode 100644 libs/components/board-shapes/src/hexagon-util/HexagonUtil.tsx create mode 100644 libs/components/board-shapes/src/hexagon-util/components/DashedHexagon.tsx create mode 100644 libs/components/board-shapes/src/hexagon-util/components/DrawHexagon.tsx create mode 100644 libs/components/board-shapes/src/hexagon-util/components/HexagonBindingIndicator.tsx create mode 100644 libs/components/board-shapes/src/hexagon-util/hexagon-helpers.ts create mode 100644 libs/components/board-shapes/src/hexagon-util/index.ts create mode 100644 libs/components/board-shapes/src/image-util/image-util.tsx create mode 100644 libs/components/board-shapes/src/image-util/index.ts create mode 100644 libs/components/board-shapes/src/index.ts create mode 100644 libs/components/board-shapes/src/pentagram-util/PentagramUtil.tsx create mode 100644 libs/components/board-shapes/src/pentagram-util/components/DashedPentagram.tsx create mode 100644 libs/components/board-shapes/src/pentagram-util/components/DrawPentagram.tsx create mode 100644 libs/components/board-shapes/src/pentagram-util/components/PentagramBindingIndicator.tsx create mode 100644 libs/components/board-shapes/src/pentagram-util/index.ts create mode 100644 libs/components/board-shapes/src/pentagram-util/pentagram-helpers.ts create mode 100644 libs/components/board-shapes/src/rectangle-util/RectangleUtil.tsx create mode 100644 libs/components/board-shapes/src/rectangle-util/components/BindingIndicator.tsx create mode 100644 libs/components/board-shapes/src/rectangle-util/components/DashedRectangle.tsx create mode 100644 libs/components/board-shapes/src/rectangle-util/components/DrawRectangle.tsx create mode 100644 libs/components/board-shapes/src/rectangle-util/index.ts create mode 100644 libs/components/board-shapes/src/rectangle-util/rectangle-helpers.ts create mode 100644 libs/components/board-shapes/src/shared/get-bounds-rectangle.ts create mode 100644 libs/components/board-shapes/src/shared/get-text-align.ts create mode 100644 libs/components/board-shapes/src/shared/get-text-size.ts create mode 100644 libs/components/board-shapes/src/shared/get-text-svg-element.ts create mode 100644 libs/components/board-shapes/src/shared/index.ts create mode 100644 libs/components/board-shapes/src/shared/label-mask.tsx create mode 100644 libs/components/board-shapes/src/shared/normalize-text.ts create mode 100644 libs/components/board-shapes/src/shared/polygon-utils.ts create mode 100644 libs/components/board-shapes/src/shared/shape-styles.ts create mode 100644 libs/components/board-shapes/src/shared/stop-propagation.ts create mode 100644 libs/components/board-shapes/src/shared/text-area-utils.ts create mode 100644 libs/components/board-shapes/src/shared/text-label.tsx create mode 100644 libs/components/board-shapes/src/shared/transform-rectangle.ts create mode 100644 libs/components/board-shapes/src/shared/transform-single-rectangle.ts create mode 100644 libs/components/board-shapes/src/triangle-util/TriangleUtil.tsx create mode 100644 libs/components/board-shapes/src/triangle-util/components/DashedTriangle.tsx create mode 100644 libs/components/board-shapes/src/triangle-util/components/DrawTriangle.tsx create mode 100644 libs/components/board-shapes/src/triangle-util/components/TriangleBindingIndicator.tsx create mode 100644 libs/components/board-shapes/src/triangle-util/index.ts create mode 100644 libs/components/board-shapes/src/triangle-util/triangle-helpers.ts create mode 100644 libs/components/board-shapes/src/video-util/index.ts create mode 100644 libs/components/board-shapes/src/video-util/video-util.tsx create mode 100644 libs/components/board-shapes/src/white-arrow-util/WhiteArrowUtil.tsx create mode 100644 libs/components/board-shapes/src/white-arrow-util/components/DashedWhiteArrow.tsx create mode 100644 libs/components/board-shapes/src/white-arrow-util/components/DrawWhiteArrow.tsx create mode 100644 libs/components/board-shapes/src/white-arrow-util/components/WhiteArrowBindingIndicator.tsx create mode 100644 libs/components/board-shapes/src/white-arrow-util/index.ts create mode 100644 libs/components/board-shapes/src/white-arrow-util/white-arrow-helpers.ts create mode 100644 libs/components/board-shapes/tsconfig.json create mode 100644 libs/components/board-shapes/tsconfig.lib.json create mode 100644 libs/components/board-shapes/tsconfig.spec.json create mode 100644 libs/components/board-state/.babelrc create mode 100644 libs/components/board-state/.eslintrc.json create mode 100644 libs/components/board-state/README.md create mode 100644 libs/components/board-state/jest.config.ts create mode 100644 libs/components/board-state/package.json create mode 100644 libs/components/board-state/project.json create mode 100644 libs/components/board-state/src/data/browser-fs-access/directory-open.js create mode 100644 libs/components/board-state/src/data/browser-fs-access/file-open.js create mode 100644 libs/components/board-state/src/data/browser-fs-access/file-save.js create mode 100644 libs/components/board-state/src/data/browser-fs-access/fs-access/directory-open.js create mode 100644 libs/components/board-state/src/data/browser-fs-access/fs-access/file-open.js create mode 100644 libs/components/board-state/src/data/browser-fs-access/fs-access/file-save.js create mode 100644 libs/components/board-state/src/data/browser-fs-access/index.d.ts create mode 100644 libs/components/board-state/src/data/browser-fs-access/index.js create mode 100644 libs/components/board-state/src/data/browser-fs-access/legacy/directory-open.js create mode 100644 libs/components/board-state/src/data/browser-fs-access/legacy/file-open.js create mode 100644 libs/components/board-state/src/data/browser-fs-access/legacy/file-save.js create mode 100644 libs/components/board-state/src/data/browser-fs-access/supported.js create mode 100644 libs/components/board-state/src/data/filesystem.spec.ts create mode 100644 libs/components/board-state/src/data/filesystem.ts create mode 100644 libs/components/board-state/src/data/index.ts create mode 100644 libs/components/board-state/src/data/migrate.spec.ts create mode 100644 libs/components/board-state/src/data/migrate.ts create mode 100644 libs/components/board-state/src/idb-clipboard.ts create mode 100644 libs/components/board-state/src/index.ts create mode 100644 libs/components/board-state/src/manager/deep-copy.ts create mode 100644 libs/components/board-state/src/manager/state-manager.ts create mode 100644 libs/components/board-state/src/tldr.ts create mode 100644 libs/components/board-state/src/tldraw-app.ts create mode 100644 libs/components/board-state/src/types/commands.ts create mode 100644 libs/components/board-state/src/types/tool.ts create mode 100644 libs/components/board-state/tsconfig.json create mode 100644 libs/components/board-state/tsconfig.lib.json create mode 100644 libs/components/board-state/tsconfig.spec.json create mode 100644 libs/components/board-tools/.babelrc create mode 100644 libs/components/board-tools/.eslintrc.json create mode 100644 libs/components/board-tools/README.md create mode 100644 libs/components/board-tools/jest.config.ts create mode 100644 libs/components/board-tools/package.json create mode 100644 libs/components/board-tools/project.json create mode 100644 libs/components/board-tools/src/arrow-tool/arrow-tool.ts create mode 100644 libs/components/board-tools/src/arrow-tool/index.ts create mode 100644 libs/components/board-tools/src/draw-tool/draw-tool.ts create mode 100644 libs/components/board-tools/src/draw-tool/index.ts create mode 100644 libs/components/board-tools/src/editor-tool/editor-tool.ts create mode 100644 libs/components/board-tools/src/editor-tool/index.ts create mode 100644 libs/components/board-tools/src/ellipse-tool/ellipse-tool.ts create mode 100644 libs/components/board-tools/src/ellipse-tool/index.ts create mode 100644 libs/components/board-tools/src/erase-tool/erase-tool.ts create mode 100644 libs/components/board-tools/src/erase-tool/index.ts create mode 100644 libs/components/board-tools/src/frame-tool/frame-tool.ts create mode 100644 libs/components/board-tools/src/frame-tool/index.ts create mode 100644 libs/components/board-tools/src/hand-draw/hand-draw-tool.ts create mode 100644 libs/components/board-tools/src/hand-draw/index.ts create mode 100644 libs/components/board-tools/src/hexagon-tool/hexagon-tool.ts create mode 100644 libs/components/board-tools/src/hexagon-tool/index.ts create mode 100644 libs/components/board-tools/src/highlight-tool/highlight-tool.ts create mode 100644 libs/components/board-tools/src/highlight-tool/index.ts create mode 100644 libs/components/board-tools/src/index.ts create mode 100644 libs/components/board-tools/src/laser-tool/index.ts create mode 100644 libs/components/board-tools/src/laser-tool/laser-tool.ts create mode 100644 libs/components/board-tools/src/line-tool/index.ts create mode 100644 libs/components/board-tools/src/line-tool/line-tool.ts create mode 100644 libs/components/board-tools/src/pencil-tool/index.ts create mode 100644 libs/components/board-tools/src/pencil-tool/pencil-tool.ts create mode 100644 libs/components/board-tools/src/pentagram-tool/index.ts create mode 100644 libs/components/board-tools/src/pentagram-tool/pentagram-tool.ts create mode 100644 libs/components/board-tools/src/rectangle-tool/index.ts create mode 100644 libs/components/board-tools/src/rectangle-tool/rectangle-tool.ts create mode 100644 libs/components/board-tools/src/select-tool/index.ts create mode 100644 libs/components/board-tools/src/select-tool/select-tool.ts create mode 100644 libs/components/board-tools/src/triangle-tool/index.ts create mode 100644 libs/components/board-tools/src/triangle-tool/triangle-tool.ts create mode 100644 libs/components/board-tools/src/white-arrow-tool/index.ts create mode 100644 libs/components/board-tools/src/white-arrow-tool/white-arrow-tool.ts create mode 100644 libs/components/board-tools/tsconfig.json create mode 100644 libs/components/board-tools/tsconfig.lib.json create mode 100644 libs/components/board-tools/tsconfig.spec.json create mode 100644 libs/components/board-types/.babelrc create mode 100644 libs/components/board-types/.eslintrc.json create mode 100644 libs/components/board-types/README.md create mode 100644 libs/components/board-types/jest.config.ts create mode 100644 libs/components/board-types/package.json create mode 100644 libs/components/board-types/project.json create mode 100644 libs/components/board-types/src/constants.ts create mode 100644 libs/components/board-types/src/index.ts create mode 100644 libs/components/board-types/src/session.ts create mode 100644 libs/components/board-types/src/types.ts create mode 100644 libs/components/board-types/tsconfig.json create mode 100644 libs/components/board-types/tsconfig.lib.json create mode 100644 libs/components/board-types/tsconfig.spec.json create mode 100644 libs/components/common/.babelrc create mode 100644 libs/components/common/.eslintrc.json create mode 100644 libs/components/common/jest.config.js create mode 100644 libs/components/common/package.json create mode 100644 libs/components/common/project.json create mode 100644 libs/components/common/src/index.ts create mode 100644 libs/components/common/src/lib/Logo/LogoImg.tsx create mode 100644 libs/components/common/src/lib/Logo/LogoLink.tsx create mode 100644 libs/components/common/src/lib/Logo/affine-logo.svg create mode 100644 libs/components/common/src/lib/Logo/index.ts create mode 100644 libs/components/common/src/lib/block-preview/BlockPreview.tsx create mode 100644 libs/components/common/src/lib/block-preview/StyledBlockPreview.tsx create mode 100644 libs/components/common/src/lib/block-preview/index.ts create mode 100644 libs/components/common/src/lib/button/index.tsx create mode 100644 libs/components/common/src/lib/collapsible-title/index.tsx create mode 100644 libs/components/common/src/lib/colors/color-src.ts create mode 100644 libs/components/common/src/lib/colors/colors.ts create mode 100644 libs/components/common/src/lib/colors/index.ts create mode 100644 libs/components/common/src/lib/icon/Add/Add.svg create mode 100644 libs/components/common/src/lib/icon/Add/Add.tsx create mode 100644 libs/components/common/src/lib/icon/Clock/Clock.svg create mode 100644 libs/components/common/src/lib/icon/Clock/Clock.tsx create mode 100644 libs/components/common/src/lib/icon/Close/Close.svg create mode 100644 libs/components/common/src/lib/icon/Close/Close.tsx create mode 100644 libs/components/common/src/lib/icon/CodeBlockInline/CodeBlockInline.svg create mode 100644 libs/components/common/src/lib/icon/CodeBlockInline/CodeBlockInline.tsx create mode 100644 libs/components/common/src/lib/icon/Document/Document.svg create mode 100644 libs/components/common/src/lib/icon/Document/Document.tsx create mode 100644 libs/components/common/src/lib/icon/Filter/Filter.svg create mode 100644 libs/components/common/src/lib/icon/Filter/Filter.tsx create mode 100644 libs/components/common/src/lib/icon/FullScreen/FullScreen.svg create mode 100644 libs/components/common/src/lib/icon/FullScreen/FullScreen.tsx create mode 100644 libs/components/common/src/lib/icon/HighlighterDuotone/HighlighterDuotone.svg create mode 100644 libs/components/common/src/lib/icon/HighlighterDuotone/HighlighterDuotone.tsx create mode 100644 libs/components/common/src/lib/icon/Kanban/Kanban.svg create mode 100644 libs/components/common/src/lib/icon/Kanban/Kanban.tsx create mode 100644 libs/components/common/src/lib/icon/List/List.svg create mode 100644 libs/components/common/src/lib/icon/List/List.tsx create mode 100644 libs/components/common/src/lib/icon/Newpage/Newpage.svg create mode 100644 libs/components/common/src/lib/icon/Newpage/Newpage.tsx create mode 100644 libs/components/common/src/lib/icon/Pages/Pages.svg create mode 100644 libs/components/common/src/lib/icon/Pages/Pages.tsx create mode 100644 libs/components/common/src/lib/icon/PencilDotDuotone/PencilDotDuotone.svg create mode 100644 libs/components/common/src/lib/icon/PencilDotDuotone/PencilDotDuotone.tsx create mode 100644 libs/components/common/src/lib/icon/PencilDuotone/PencilDuotone.svg create mode 100644 libs/components/common/src/lib/icon/PencilDuotone/PencilDuotone.tsx create mode 100644 libs/components/common/src/lib/icon/Sorter/Sorter.svg create mode 100644 libs/components/common/src/lib/icon/Sorter/Sorter.tsx create mode 100644 libs/components/common/src/lib/icon/Space/Space.svg create mode 100644 libs/components/common/src/lib/icon/Space/Space.tsx create mode 100644 libs/components/common/src/lib/icon/Table/Table.svg create mode 100644 libs/components/common/src/lib/icon/Table/Table.tsx create mode 100644 libs/components/common/src/lib/icon/TodoList/TodoList.svg create mode 100644 libs/components/common/src/lib/icon/TodoList/TodoList.tsx create mode 100644 libs/components/common/src/lib/icon/UnGroup/UnGroup.svg create mode 100644 libs/components/common/src/lib/icon/UnGroup/UnGroup.tsx create mode 100644 libs/components/common/src/lib/icon/ViewSidebar/ViewSidebar.svg create mode 100644 libs/components/common/src/lib/icon/ViewSidebar/ViewSidebar.tsx create mode 100644 libs/components/common/src/lib/icon/index.ts create mode 100644 libs/components/common/src/lib/index.ts create mode 100644 libs/components/common/src/lib/list/index.tsx create mode 100644 libs/components/common/src/lib/text/EditableText.tsx create mode 100644 libs/components/common/src/lib/text/constants.ts create mode 100644 libs/components/common/src/lib/text/element-leaf/TextWithComments.tsx create mode 100644 libs/components/common/src/lib/text/index.ts create mode 100644 libs/components/common/src/lib/text/plugins/date.tsx create mode 100644 libs/components/common/src/lib/text/plugins/hooks.tsx create mode 100644 libs/components/common/src/lib/text/plugins/link.tsx create mode 100644 libs/components/common/src/lib/text/plugins/reflink.tsx create mode 100644 libs/components/common/src/lib/text/slate-utils.ts create mode 100644 libs/components/common/src/lib/text/utils.ts create mode 100644 libs/components/common/src/lib/toolbar/index.tsx create mode 100644 libs/components/common/tsconfig.json create mode 100644 libs/components/common/tsconfig.lib.json create mode 100644 libs/components/common/tsconfig.spec.json create mode 100644 libs/components/editor-blocks/.babelrc create mode 100644 libs/components/editor-blocks/.eslintrc.json create mode 100644 libs/components/editor-blocks/README.md create mode 100644 libs/components/editor-blocks/jest.config.js create mode 100644 libs/components/editor-blocks/package.json create mode 100644 libs/components/editor-blocks/project.json create mode 100644 libs/components/editor-blocks/src/blocks/bullet/BulletView.tsx create mode 100644 libs/components/editor-blocks/src/blocks/bullet/data.tsx create mode 100644 libs/components/editor-blocks/src/blocks/bullet/index.ts create mode 100644 libs/components/editor-blocks/src/blocks/bullet/types.ts create mode 100644 libs/components/editor-blocks/src/blocks/code/CodeMirror.tsx create mode 100644 libs/components/editor-blocks/src/blocks/code/CodeView.tsx create mode 100644 libs/components/editor-blocks/src/blocks/code/index.ts create mode 100644 libs/components/editor-blocks/src/blocks/code/use-code-mirror.ts create mode 100644 libs/components/editor-blocks/src/blocks/divider/divider-view.tsx create mode 100644 libs/components/editor-blocks/src/blocks/divider/index.ts create mode 100644 libs/components/editor-blocks/src/blocks/embed-link/EmbedLinkView.tsx create mode 100644 libs/components/editor-blocks/src/blocks/embed-link/index.ts create mode 100644 libs/components/editor-blocks/src/blocks/figma/FigmaView.tsx create mode 100644 libs/components/editor-blocks/src/blocks/figma/index.ts create mode 100644 libs/components/editor-blocks/src/blocks/file/FileView.tsx create mode 100644 libs/components/editor-blocks/src/blocks/file/index.ts create mode 100644 libs/components/editor-blocks/src/blocks/grid-item/GridItem.tsx create mode 100644 libs/components/editor-blocks/src/blocks/grid-item/GridItemRender.tsx create mode 100644 libs/components/editor-blocks/src/blocks/grid-item/index.ts create mode 100644 libs/components/editor-blocks/src/blocks/grid/GirdHandle.tsx create mode 100644 libs/components/editor-blocks/src/blocks/grid/Grid.tsx create mode 100644 libs/components/editor-blocks/src/blocks/grid/GridRender.tsx create mode 100644 libs/components/editor-blocks/src/blocks/grid/index.ts create mode 100644 libs/components/editor-blocks/src/blocks/group/Group.tsx create mode 100644 libs/components/editor-blocks/src/blocks/group/GroupMenu.tsx create mode 100644 libs/components/editor-blocks/src/blocks/group/GroupView.tsx create mode 100644 libs/components/editor-blocks/src/blocks/group/ScenePage.tsx create mode 100644 libs/components/editor-blocks/src/blocks/group/SceneTable.tsx create mode 100644 libs/components/editor-blocks/src/blocks/group/components/IconButton.tsx create mode 100644 libs/components/editor-blocks/src/blocks/group/components/Line.tsx create mode 100644 libs/components/editor-blocks/src/blocks/group/components/Panel.tsx create mode 100644 libs/components/editor-blocks/src/blocks/group/components/Title.tsx create mode 100644 libs/components/editor-blocks/src/blocks/group/components/filter/Checkbox.tsx create mode 100644 libs/components/editor-blocks/src/blocks/group/components/filter/Filter.tsx create mode 100644 libs/components/editor-blocks/src/blocks/group/components/filter/FilterGroup.tsx create mode 100644 libs/components/editor-blocks/src/blocks/group/components/filter/HandleGroup.tsx create mode 100644 libs/components/editor-blocks/src/blocks/group/components/filter/IconBtn.tsx create mode 100644 libs/components/editor-blocks/src/blocks/group/components/filter/MultipleChipInput.tsx create mode 100644 libs/components/editor-blocks/src/blocks/group/components/filter/SelectItem.tsx create mode 100644 libs/components/editor-blocks/src/blocks/group/components/filter/TextInput.tsx create mode 100644 libs/components/editor-blocks/src/blocks/group/components/filter/TextareaGroup.tsx create mode 100644 libs/components/editor-blocks/src/blocks/group/components/filter/config/filter-group-config.ts create mode 100644 libs/components/editor-blocks/src/blocks/group/components/filter/config/filter-mode-config.ts create mode 100644 libs/components/editor-blocks/src/blocks/group/components/filter/context/filter-context.ts create mode 100644 libs/components/editor-blocks/src/blocks/group/components/filter/helper.ts create mode 100644 libs/components/editor-blocks/src/blocks/group/components/filter/index.ts create mode 100644 libs/components/editor-blocks/src/blocks/group/components/filter/types.ts create mode 100644 libs/components/editor-blocks/src/blocks/group/components/group-by/GroupBy.tsx create mode 100644 libs/components/editor-blocks/src/blocks/group/components/group-panel/GroupPanel.tsx create mode 100644 libs/components/editor-blocks/src/blocks/group/components/helper.ts create mode 100644 libs/components/editor-blocks/src/blocks/group/components/sorter/GroupBySelector.tsx create mode 100644 libs/components/editor-blocks/src/blocks/group/components/sorter/Introduce.tsx create mode 100644 libs/components/editor-blocks/src/blocks/group/components/sorter/Sorter.tsx create mode 100644 libs/components/editor-blocks/src/blocks/group/components/sorter/SorterItem.tsx create mode 100644 libs/components/editor-blocks/src/blocks/group/components/sorter/SorterSelector.tsx create mode 100644 libs/components/editor-blocks/src/blocks/group/components/sorter/config.ts create mode 100644 libs/components/editor-blocks/src/blocks/group/components/sorter/helper.ts create mode 100644 libs/components/editor-blocks/src/blocks/group/components/sorter/index.ts create mode 100644 libs/components/editor-blocks/src/blocks/group/components/sorter/types.ts create mode 100644 libs/components/editor-blocks/src/blocks/group/config.ts create mode 100644 libs/components/editor-blocks/src/blocks/group/config/filter-op-rule.ts create mode 100644 libs/components/editor-blocks/src/blocks/group/config/sorter.ts create mode 100644 libs/components/editor-blocks/src/blocks/group/index.ts create mode 100644 libs/components/editor-blocks/src/blocks/group/scene-kanban/AddGroupButton.tsx create mode 100644 libs/components/editor-blocks/src/blocks/group/scene-kanban/CardContainer.tsx create mode 100644 libs/components/editor-blocks/src/blocks/group/scene-kanban/CardContext.tsx create mode 100644 libs/components/editor-blocks/src/blocks/group/scene-kanban/CardItem.tsx create mode 100644 libs/components/editor-blocks/src/blocks/group/scene-kanban/SceneKanban.tsx create mode 100644 libs/components/editor-blocks/src/blocks/group/scene-kanban/context.ts create mode 100644 libs/components/editor-blocks/src/blocks/group/scene-kanban/dndable/component/Container.tsx create mode 100644 libs/components/editor-blocks/src/blocks/group/scene-kanban/dndable/component/ItemStyle.tsx create mode 100644 libs/components/editor-blocks/src/blocks/group/scene-kanban/dndable/drag-overlay/DragOverlayPortal.tsx create mode 100644 libs/components/editor-blocks/src/blocks/group/scene-kanban/dndable/drag-overlay/renderContainerDragOverlay.tsx create mode 100644 libs/components/editor-blocks/src/blocks/group/scene-kanban/dndable/drag-overlay/renderSortableItemDragOverlay.tsx create mode 100644 libs/components/editor-blocks/src/blocks/group/scene-kanban/dndable/helper.ts create mode 100644 libs/components/editor-blocks/src/blocks/group/scene-kanban/dndable/type.ts create mode 100644 libs/components/editor-blocks/src/blocks/group/scene-kanban/dndable/wrapper/CardContainerWrapper.tsx create mode 100644 libs/components/editor-blocks/src/blocks/group/scene-kanban/dndable/wrapper/CardContextWrapper.tsx create mode 100644 libs/components/editor-blocks/src/blocks/group/scene-kanban/dndable/wrapper/CardItemPanelWrapper.tsx create mode 100644 libs/components/editor-blocks/src/blocks/group/scene-kanban/dndable/wrapper/CardItemWrapper.tsx create mode 100644 libs/components/editor-blocks/src/blocks/group/scene-kanban/dndable/wrapper/DroppableContainer.tsx create mode 100644 libs/components/editor-blocks/src/blocks/group/scene-kanban/dndable/wrapper/use-dndable.ts create mode 100644 libs/components/editor-blocks/src/blocks/group/scene-kanban/helper.ts create mode 100644 libs/components/editor-blocks/src/blocks/group/scene-kanban/index.ts create mode 100644 libs/components/editor-blocks/src/blocks/group/scene-kanban/styles.ts create mode 100644 libs/components/editor-blocks/src/blocks/group/scene-kanban/types.ts create mode 100644 libs/components/editor-blocks/src/blocks/group/types.ts create mode 100644 libs/components/editor-blocks/src/blocks/group/utils/index.ts create mode 100644 libs/components/editor-blocks/src/blocks/group/utils/toAsync.ts create mode 100644 libs/components/editor-blocks/src/blocks/group/utils/weak-sql/index.ts create mode 100644 libs/components/editor-blocks/src/blocks/group/utils/weak-sql/rule-config.ts create mode 100644 libs/components/editor-blocks/src/blocks/group/utils/weak-sql/types.ts create mode 100644 libs/components/editor-blocks/src/blocks/group/utils/weak-sql/weakSql2Sql.ts create mode 100644 libs/components/editor-blocks/src/blocks/group/utils/weak-sql/weakSqlCreator.ts create mode 100644 libs/components/editor-blocks/src/blocks/groupDvider/groupDividerView.tsx create mode 100644 libs/components/editor-blocks/src/blocks/groupDvider/index.ts create mode 100644 libs/components/editor-blocks/src/blocks/image/ImageView.tsx create mode 100644 libs/components/editor-blocks/src/blocks/image/index.ts create mode 100644 libs/components/editor-blocks/src/blocks/image/styles.css create mode 100644 libs/components/editor-blocks/src/blocks/numbered/NumberedView.tsx create mode 100644 libs/components/editor-blocks/src/blocks/numbered/data.ts create mode 100644 libs/components/editor-blocks/src/blocks/numbered/index.ts create mode 100644 libs/components/editor-blocks/src/blocks/numbered/types.ts create mode 100644 libs/components/editor-blocks/src/blocks/page/PageView.tsx create mode 100644 libs/components/editor-blocks/src/blocks/page/index.ts create mode 100644 libs/components/editor-blocks/src/blocks/page/types.ts create mode 100644 libs/components/editor-blocks/src/blocks/ref-link/index.ts create mode 100644 libs/components/editor-blocks/src/blocks/ref-link/ref-link-view.tsx create mode 100644 libs/components/editor-blocks/src/blocks/text/QuoteBlock.tsx create mode 100644 libs/components/editor-blocks/src/blocks/text/TextBlock.tsx create mode 100644 libs/components/editor-blocks/src/blocks/text/TextView.tsx create mode 100644 libs/components/editor-blocks/src/blocks/text/index.ts create mode 100644 libs/components/editor-blocks/src/blocks/text/types.ts create mode 100644 libs/components/editor-blocks/src/blocks/toc/index.ts create mode 100644 libs/components/editor-blocks/src/blocks/toc/toc-util.ts create mode 100644 libs/components/editor-blocks/src/blocks/toc/toc-view.tsx create mode 100644 libs/components/editor-blocks/src/blocks/toc/types.ts create mode 100644 libs/components/editor-blocks/src/blocks/todo/CheckBox.tsx create mode 100644 libs/components/editor-blocks/src/blocks/todo/TodoView.tsx create mode 100644 libs/components/editor-blocks/src/blocks/todo/index.ts create mode 100644 libs/components/editor-blocks/src/blocks/todo/types.ts create mode 100644 libs/components/editor-blocks/src/blocks/youtube/YoutubeView.tsx create mode 100644 libs/components/editor-blocks/src/blocks/youtube/index.ts create mode 100644 libs/components/editor-blocks/src/components/BlockContainer/BlockContainer.tsx create mode 100644 libs/components/editor-blocks/src/components/BlockContainer/index.ts create mode 100644 libs/components/editor-blocks/src/components/ImageView/ImageView.tsx create mode 100644 libs/components/editor-blocks/src/components/ImageView/index.ts create mode 100644 libs/components/editor-blocks/src/components/IndentWrapper/IndentWrapper.tsx create mode 100644 libs/components/editor-blocks/src/components/IndentWrapper/index.ts create mode 100644 libs/components/editor-blocks/src/components/editable/editable.tsx create mode 100644 libs/components/editor-blocks/src/components/editable/index.ts create mode 100644 libs/components/editor-blocks/src/components/editable/types.ts create mode 100644 libs/components/editor-blocks/src/components/select/index.tsx create mode 100644 libs/components/editor-blocks/src/components/source-view/SourceView.tsx create mode 100644 libs/components/editor-blocks/src/components/source-view/format-url/affine.ts create mode 100644 libs/components/editor-blocks/src/components/source-view/format-url/figma.ts create mode 100644 libs/components/editor-blocks/src/components/source-view/format-url/format-url.ts create mode 100644 libs/components/editor-blocks/src/components/source-view/format-url/index.ts create mode 100644 libs/components/editor-blocks/src/components/source-view/format-url/youtube.ts create mode 100644 libs/components/editor-blocks/src/components/source-view/index.ts create mode 100644 libs/components/editor-blocks/src/components/style-container/index.tsx create mode 100644 libs/components/editor-blocks/src/components/table/basic-table.scss create mode 100644 libs/components/editor-blocks/src/components/table/basic-table.tsx create mode 100644 libs/components/editor-blocks/src/components/table/custom-cell/check-box/index.tsx create mode 100644 libs/components/editor-blocks/src/components/table/custom-cell/index.tsx create mode 100644 libs/components/editor-blocks/src/components/table/custom-cell/select/index.tsx create mode 100644 libs/components/editor-blocks/src/components/table/custom-cell/types.ts create mode 100644 libs/components/editor-blocks/src/components/table/index.ts create mode 100644 libs/components/editor-blocks/src/components/table/table.tsx create mode 100644 libs/components/editor-blocks/src/components/text-manage/TextManage.tsx create mode 100644 libs/components/editor-blocks/src/components/text-manage/index.ts create mode 100644 libs/components/editor-blocks/src/components/upload/index.ts create mode 100644 libs/components/editor-blocks/src/components/upload/upload.tsx create mode 100644 libs/components/editor-blocks/src/index.ts create mode 100644 libs/components/editor-blocks/src/utils/WithTreeViewChildren.tsx create mode 100644 libs/components/editor-blocks/src/utils/indent.ts create mode 100644 libs/components/editor-blocks/tsconfig.json create mode 100644 libs/components/editor-blocks/tsconfig.lib.json create mode 100644 libs/components/editor-blocks/tsconfig.spec.json create mode 100644 libs/components/editor-core/.babelrc create mode 100644 libs/components/editor-core/.eslintrc.json create mode 100644 libs/components/editor-core/README.md create mode 100644 libs/components/editor-core/jest.config.js create mode 100644 libs/components/editor-core/package.json create mode 100644 libs/components/editor-core/project.json create mode 100644 libs/components/editor-core/src/RenderRoot.tsx create mode 100644 libs/components/editor-core/src/block-content-wrapper/BlockContentWrapper.tsx create mode 100644 libs/components/editor-core/src/block-content-wrapper/index.ts create mode 100644 libs/components/editor-core/src/block-pendant/AddPendantPopover.tsx create mode 100644 libs/components/editor-core/src/block-pendant/BlockPendantProvider.tsx create mode 100644 libs/components/editor-core/src/block-pendant/PendantTag.tsx create mode 100644 libs/components/editor-core/src/block-pendant/StyledComponent.tsx create mode 100644 libs/components/editor-core/src/block-pendant/config.ts create mode 100644 libs/components/editor-core/src/block-pendant/index.ts create mode 100644 libs/components/editor-core/src/block-pendant/pendant-history-panel/PendantHistoryPanel.tsx create mode 100644 libs/components/editor-core/src/block-pendant/pendant-history-panel/index.ts create mode 100644 libs/components/editor-core/src/block-pendant/pendant-modify-panel/Date.tsx create mode 100644 libs/components/editor-core/src/block-pendant/pendant-modify-panel/Email.tsx create mode 100644 libs/components/editor-core/src/block-pendant/pendant-modify-panel/IconInput.tsx create mode 100644 libs/components/editor-core/src/block-pendant/pendant-modify-panel/Information.tsx create mode 100644 libs/components/editor-core/src/block-pendant/pendant-modify-panel/Location.tsx create mode 100644 libs/components/editor-core/src/block-pendant/pendant-modify-panel/Mention.tsx create mode 100644 libs/components/editor-core/src/block-pendant/pendant-modify-panel/PendantModifyPanel.tsx create mode 100644 libs/components/editor-core/src/block-pendant/pendant-modify-panel/PendantTypeSelect.tsx create mode 100644 libs/components/editor-core/src/block-pendant/pendant-modify-panel/Phone.tsx create mode 100644 libs/components/editor-core/src/block-pendant/pendant-modify-panel/Select.tsx create mode 100644 libs/components/editor-core/src/block-pendant/pendant-modify-panel/Text.tsx create mode 100644 libs/components/editor-core/src/block-pendant/pendant-modify-panel/index.ts create mode 100644 libs/components/editor-core/src/block-pendant/pendant-modify-panel/types.ts create mode 100644 libs/components/editor-core/src/block-pendant/pendant-operation-panel/CreatePendantPanel.tsx create mode 100644 libs/components/editor-core/src/block-pendant/pendant-operation-panel/UpdatePendantPanel.tsx create mode 100644 libs/components/editor-core/src/block-pendant/pendant-operation-panel/index.ts create mode 100644 libs/components/editor-core/src/block-pendant/pendant-popover/PendantPopover.tsx create mode 100644 libs/components/editor-core/src/block-pendant/pendant-popover/index.ts create mode 100644 libs/components/editor-core/src/block-pendant/pendant-render/PandentRender.tsx create mode 100644 libs/components/editor-core/src/block-pendant/pendant-render/index.ts create mode 100644 libs/components/editor-core/src/block-pendant/types.ts create mode 100644 libs/components/editor-core/src/block-pendant/use-pendant.ts create mode 100644 libs/components/editor-core/src/block-pendant/utils.ts create mode 100644 libs/components/editor-core/src/contexts.tsx create mode 100644 libs/components/editor-core/src/drag-drop-wrapper/DragDropWrapper.tsx create mode 100644 libs/components/editor-core/src/drag-drop-wrapper/index.ts create mode 100644 libs/components/editor-core/src/editor/block/async-block.ts create mode 100644 libs/components/editor-core/src/editor/block/block-helper.ts create mode 100644 libs/components/editor-core/src/editor/block/block-provider.ts create mode 100644 libs/components/editor-core/src/editor/block/index.ts create mode 100644 libs/components/editor-core/src/editor/clipboard/browser-clipboard.ts create mode 100644 libs/components/editor-core/src/editor/clipboard/clip.ts create mode 100644 libs/components/editor-core/src/editor/clipboard/clipboard-parse.ts create mode 100644 libs/components/editor-core/src/editor/clipboard/clipboard-populator.ts create mode 100644 libs/components/editor-core/src/editor/clipboard/markdown-parse.ts create mode 100644 libs/components/editor-core/src/editor/clipboard/types.ts create mode 100644 libs/components/editor-core/src/editor/commands/block-commands.ts create mode 100644 libs/components/editor-core/src/editor/commands/index.ts create mode 100644 libs/components/editor-core/src/editor/commands/text-commands.ts create mode 100644 libs/components/editor-core/src/editor/commands/types.ts create mode 100644 libs/components/editor-core/src/editor/drag-drop/drag-drop.ts create mode 100644 libs/components/editor-core/src/editor/drag-drop/index.ts create mode 100644 libs/components/editor-core/src/editor/drag-drop/types.ts create mode 100644 libs/components/editor-core/src/editor/editor.ts create mode 100644 libs/components/editor-core/src/editor/index.ts create mode 100644 libs/components/editor-core/src/editor/keyboard/hotkey-map.ts create mode 100644 libs/components/editor-core/src/editor/keyboard/index.ts create mode 100644 libs/components/editor-core/src/editor/keyboard/keyboard.ts create mode 100644 libs/components/editor-core/src/editor/mouse/index.ts create mode 100644 libs/components/editor-core/src/editor/mouse/mouse.ts create mode 100644 libs/components/editor-core/src/editor/plugin/hooks.ts create mode 100644 libs/components/editor-core/src/editor/plugin/index.ts create mode 100644 libs/components/editor-core/src/editor/plugin/manager.ts create mode 100644 libs/components/editor-core/src/editor/plugin/utils.ts create mode 100644 libs/components/editor-core/src/editor/scroll/index.ts create mode 100644 libs/components/editor-core/src/editor/scroll/scroll.ts create mode 100644 libs/components/editor-core/src/editor/selection/index.ts create mode 100644 libs/components/editor-core/src/editor/selection/selection.ts create mode 100644 libs/components/editor-core/src/editor/selection/types.ts create mode 100644 libs/components/editor-core/src/editor/selection/utils.ts create mode 100644 libs/components/editor-core/src/editor/types.ts create mode 100644 libs/components/editor-core/src/editor/views/base-view.ts create mode 100644 libs/components/editor-core/src/hooks.ts create mode 100644 libs/components/editor-core/src/index.ts create mode 100644 libs/components/editor-core/src/kanban/Context.tsx create mode 100644 libs/components/editor-core/src/kanban/atom.ts create mode 100644 libs/components/editor-core/src/kanban/group.ts create mode 100644 libs/components/editor-core/src/kanban/index.ts create mode 100644 libs/components/editor-core/src/kanban/kanban.ts create mode 100644 libs/components/editor-core/src/kanban/types.ts create mode 100644 libs/components/editor-core/src/recast-block/Context.tsx create mode 100644 libs/components/editor-core/src/recast-block/README.md create mode 100644 libs/components/editor-core/src/recast-block/Scene.tsx create mode 100644 libs/components/editor-core/src/recast-block/group.ts create mode 100644 libs/components/editor-core/src/recast-block/index.ts create mode 100644 libs/components/editor-core/src/recast-block/property.ts create mode 100644 libs/components/editor-core/src/recast-block/types/constant.ts create mode 100644 libs/components/editor-core/src/recast-block/types/index.ts create mode 100644 libs/components/editor-core/src/recast-block/types/recast-property.ts create mode 100644 libs/components/editor-core/src/recast-block/types/recast-value.ts create mode 100644 libs/components/editor-core/src/recast-block/types/view.ts create mode 100644 libs/components/editor-core/src/render-block/RenderBlock.tsx create mode 100644 libs/components/editor-core/src/render-block/RenderBlockChildren.tsx create mode 100644 libs/components/editor-core/src/render-block/index.ts create mode 100644 libs/components/editor-core/src/selection.tsx create mode 100644 libs/components/editor-core/src/utils.ts create mode 100644 libs/components/editor-core/tsconfig.json create mode 100644 libs/components/editor-core/tsconfig.lib.json create mode 100644 libs/components/editor-core/tsconfig.spec.json create mode 100644 libs/components/editor-plugins/.babelrc create mode 100644 libs/components/editor-plugins/.eslintrc.json create mode 100644 libs/components/editor-plugins/README.md create mode 100644 libs/components/editor-plugins/jest.config.js create mode 100644 libs/components/editor-plugins/package.json create mode 100644 libs/components/editor-plugins/project.json create mode 100644 libs/components/editor-plugins/src/base-plugin.ts create mode 100644 libs/components/editor-plugins/src/block-property/index.tsx create mode 100644 libs/components/editor-plugins/src/block-property/view.tsx create mode 100644 libs/components/editor-plugins/src/comment/AddComment.tsx create mode 100644 libs/components/editor-plugins/src/comment/AddCommentActions.tsx create mode 100644 libs/components/editor-plugins/src/comment/AddCommentInput.tsx create mode 100644 libs/components/editor-plugins/src/comment/Container.tsx create mode 100644 libs/components/editor-plugins/src/comment/Plugin.tsx create mode 100644 libs/components/editor-plugins/src/comment/index.ts create mode 100644 libs/components/editor-plugins/src/comment/use-add-comment.ts create mode 100644 libs/components/editor-plugins/src/comment/utils.ts create mode 100644 libs/components/editor-plugins/src/index.ts create mode 100644 libs/components/editor-plugins/src/menu/command-menu/Categories.tsx create mode 100644 libs/components/editor-plugins/src/menu/command-menu/CommandMenu.tsx create mode 100644 libs/components/editor-plugins/src/menu/command-menu/Container.tsx create mode 100644 libs/components/editor-plugins/src/menu/command-menu/Menu.tsx create mode 100644 libs/components/editor-plugins/src/menu/command-menu/config.ts create mode 100644 libs/components/editor-plugins/src/menu/command-menu/index.ts create mode 100644 libs/components/editor-plugins/src/menu/group-menu/DragItem.tsx create mode 100644 libs/components/editor-plugins/src/menu/group-menu/GropuMenu.tsx create mode 100644 libs/components/editor-plugins/src/menu/group-menu/Line.tsx create mode 100644 libs/components/editor-plugins/src/menu/group-menu/Menu.tsx create mode 100644 libs/components/editor-plugins/src/menu/group-menu/Plugin.tsx create mode 100644 libs/components/editor-plugins/src/menu/group-menu/index.ts create mode 100644 libs/components/editor-plugins/src/menu/index.ts create mode 100644 libs/components/editor-plugins/src/menu/inline-menu/Container.tsx create mode 100644 libs/components/editor-plugins/src/menu/inline-menu/Plugin.tsx create mode 100644 libs/components/editor-plugins/src/menu/inline-menu/Toolbar.tsx create mode 100644 libs/components/editor-plugins/src/menu/inline-menu/config.ts create mode 100644 libs/components/editor-plugins/src/menu/inline-menu/index.ts create mode 100644 libs/components/editor-plugins/src/menu/inline-menu/menu-item/DropdownItem.tsx create mode 100644 libs/components/editor-plugins/src/menu/inline-menu/menu-item/IconItem.tsx create mode 100644 libs/components/editor-plugins/src/menu/inline-menu/menu-item/index.ts create mode 100644 libs/components/editor-plugins/src/menu/inline-menu/types.ts create mode 100644 libs/components/editor-plugins/src/menu/inline-menu/utils.ts create mode 100644 libs/components/editor-plugins/src/menu/left-menu/LeftMenu.tsx create mode 100644 libs/components/editor-plugins/src/menu/left-menu/LeftMenuDraggable.tsx create mode 100644 libs/components/editor-plugins/src/menu/left-menu/LeftMenuPlugin.tsx create mode 100644 libs/components/editor-plugins/src/menu/left-menu/TurnIntoMenu.tsx create mode 100644 libs/components/editor-plugins/src/menu/left-menu/menu-config.ts create mode 100644 libs/components/editor-plugins/src/menu/reference-menu/ReferenceMenu.tsx create mode 100644 libs/components/editor-plugins/src/menu/reference-menu/container.tsx create mode 100644 libs/components/editor-plugins/src/menu/reference-menu/index.tsx create mode 100644 libs/components/editor-plugins/src/menu/selection-group-menu/MenuApp.tsx create mode 100644 libs/components/editor-plugins/src/menu/selection-group-menu/SelectionGroupPlugin.tsx create mode 100644 libs/components/editor-plugins/src/menu/selection-group-menu/index.ts create mode 100644 libs/components/editor-plugins/src/placeholder/Placeholder.tsx create mode 100644 libs/components/editor-plugins/src/placeholder/PlaceholderPanel.tsx create mode 100644 libs/components/editor-plugins/src/placeholder/index.ts create mode 100644 libs/components/editor-plugins/src/search/index.tsx create mode 100644 libs/components/editor-plugins/src/search/search.tsx create mode 100644 libs/components/editor-plugins/src/template/index.ts create mode 100644 libs/components/editor-plugins/src/template/readme.md create mode 100644 libs/components/editor-plugins/src/template/template.ts create mode 100644 libs/components/editor-plugins/src/utils/index.ts create mode 100644 libs/components/editor-plugins/src/utils/plugin-render-root.ts create mode 100644 libs/components/editor-plugins/tsconfig.json create mode 100644 libs/components/editor-plugins/tsconfig.lib.json create mode 100644 libs/components/editor-plugins/tsconfig.spec.json create mode 100644 libs/components/icons/.babelrc create mode 100644 libs/components/icons/.eslintrc.json create mode 100644 libs/components/icons/README.md create mode 100644 libs/components/icons/jest.config.ts create mode 100644 libs/components/icons/package.json create mode 100644 libs/components/icons/project.json create mode 100644 libs/components/icons/src/auto-icons/add-view/add-view.svg create mode 100644 libs/components/icons/src/auto-icons/add-view/add-view.tsx create mode 100644 libs/components/icons/src/auto-icons/align-center/align-center.svg create mode 100644 libs/components/icons/src/auto-icons/align-center/align-center.tsx create mode 100644 libs/components/icons/src/auto-icons/align-justify/align-justify.svg create mode 100644 libs/components/icons/src/auto-icons/align-justify/align-justify.tsx create mode 100644 libs/components/icons/src/auto-icons/align-left/align-left.svg create mode 100644 libs/components/icons/src/auto-icons/align-left/align-left.tsx create mode 100644 libs/components/icons/src/auto-icons/align-right/align-right.svg create mode 100644 libs/components/icons/src/auto-icons/align-right/align-right.tsx create mode 100644 libs/components/icons/src/auto-icons/arrow-drop-down/arrow-drop-down.svg create mode 100644 libs/components/icons/src/auto-icons/arrow-drop-down/arrow-drop-down.tsx create mode 100644 libs/components/icons/src/auto-icons/arrow-right/arrow-right.svg create mode 100644 libs/components/icons/src/auto-icons/arrow-right/arrow-right.tsx create mode 100644 libs/components/icons/src/auto-icons/arrow/arrow.svg create mode 100644 libs/components/icons/src/auto-icons/arrow/arrow.tsx create mode 100644 libs/components/icons/src/auto-icons/at/at.svg create mode 100644 libs/components/icons/src/auto-icons/at/at.tsx create mode 100644 libs/components/icons/src/auto-icons/backlinks/backlinks.svg create mode 100644 libs/components/icons/src/auto-icons/backlinks/backlinks.tsx create mode 100644 libs/components/icons/src/auto-icons/backward-undo/backward-undo.svg create mode 100644 libs/components/icons/src/auto-icons/backward-undo/backward-undo.tsx create mode 100644 libs/components/icons/src/auto-icons/blocks/blocks.svg create mode 100644 libs/components/icons/src/auto-icons/blocks/blocks.tsx create mode 100644 libs/components/icons/src/auto-icons/board-view/board-view.svg create mode 100644 libs/components/icons/src/auto-icons/board-view/board-view.tsx create mode 100644 libs/components/icons/src/auto-icons/border-color-duotone/border-color-duotone.svg create mode 100644 libs/components/icons/src/auto-icons/border-color-duotone/border-color-duotone.tsx create mode 100644 libs/components/icons/src/auto-icons/border-color-none/border-color-none.svg create mode 100644 libs/components/icons/src/auto-icons/border-color-none/border-color-none.tsx create mode 100644 libs/components/icons/src/auto-icons/brush/brush.svg create mode 100644 libs/components/icons/src/auto-icons/brush/brush.tsx create mode 100644 libs/components/icons/src/auto-icons/bullet/bullet.svg create mode 100644 libs/components/icons/src/auto-icons/bullet/bullet.tsx create mode 100644 libs/components/icons/src/auto-icons/bulleted-list-1/bulleted-list-1.svg create mode 100644 libs/components/icons/src/auto-icons/bulleted-list-1/bulleted-list-1.tsx create mode 100644 libs/components/icons/src/auto-icons/bulleted-list-2/bulleted-list-2.svg create mode 100644 libs/components/icons/src/auto-icons/bulleted-list-2/bulleted-list-2.tsx create mode 100644 libs/components/icons/src/auto-icons/bulleted-list-3/bulleted-list-3.svg create mode 100644 libs/components/icons/src/auto-icons/bulleted-list-3/bulleted-list-3.tsx create mode 100644 libs/components/icons/src/auto-icons/bulleted-list-4/bulleted-list-4.svg create mode 100644 libs/components/icons/src/auto-icons/bulleted-list-4/bulleted-list-4.tsx create mode 100644 libs/components/icons/src/auto-icons/callout/callout.svg create mode 100644 libs/components/icons/src/auto-icons/callout/callout.tsx create mode 100644 libs/components/icons/src/auto-icons/card/card.svg create mode 100644 libs/components/icons/src/auto-icons/card/card.tsx create mode 100644 libs/components/icons/src/auto-icons/check-box-check/check-box-check.svg create mode 100644 libs/components/icons/src/auto-icons/check-box-check/check-box-check.tsx create mode 100644 libs/components/icons/src/auto-icons/check-box-uncheck/check-box-uncheck.svg create mode 100644 libs/components/icons/src/auto-icons/check-box-uncheck/check-box-uncheck.tsx create mode 100644 libs/components/icons/src/auto-icons/code-block/code-block.svg create mode 100644 libs/components/icons/src/auto-icons/code-block/code-block.tsx create mode 100644 libs/components/icons/src/auto-icons/code/code.svg create mode 100644 libs/components/icons/src/auto-icons/code/code.tsx create mode 100644 libs/components/icons/src/auto-icons/collaborator/collaborator.svg create mode 100644 libs/components/icons/src/auto-icons/collaborator/collaborator.tsx create mode 100644 libs/components/icons/src/auto-icons/comment/comment.svg create mode 100644 libs/components/icons/src/auto-icons/comment/comment.tsx create mode 100644 libs/components/icons/src/auto-icons/conector-arrow/conector-arrow.svg create mode 100644 libs/components/icons/src/auto-icons/conector-arrow/conector-arrow.tsx create mode 100644 libs/components/icons/src/auto-icons/conector-line/conector-line.svg create mode 100644 libs/components/icons/src/auto-icons/conector-line/conector-line.tsx create mode 100644 libs/components/icons/src/auto-icons/connector/connector.svg create mode 100644 libs/components/icons/src/auto-icons/connector/connector.tsx create mode 100644 libs/components/icons/src/auto-icons/dash-line/dash-line.svg create mode 100644 libs/components/icons/src/auto-icons/dash-line/dash-line.tsx create mode 100644 libs/components/icons/src/auto-icons/date/date.svg create mode 100644 libs/components/icons/src/auto-icons/date/date.tsx create mode 100644 libs/components/icons/src/auto-icons/delete-cash-bin/delete-cash-bin.svg create mode 100644 libs/components/icons/src/auto-icons/delete-cash-bin/delete-cash-bin.tsx create mode 100644 libs/components/icons/src/auto-icons/delete-small-tag/delete-small-tag.svg create mode 100644 libs/components/icons/src/auto-icons/delete-small-tag/delete-small-tag.tsx create mode 100644 libs/components/icons/src/auto-icons/divider/divider.svg create mode 100644 libs/components/icons/src/auto-icons/divider/divider.tsx create mode 100644 libs/components/icons/src/auto-icons/doc-view/doc-view.svg create mode 100644 libs/components/icons/src/auto-icons/doc-view/doc-view.tsx create mode 100644 libs/components/icons/src/auto-icons/done/done.svg create mode 100644 libs/components/icons/src/auto-icons/done/done.tsx create mode 100644 libs/components/icons/src/auto-icons/duplicate/duplicate.svg create mode 100644 libs/components/icons/src/auto-icons/duplicate/duplicate.tsx create mode 100644 libs/components/icons/src/auto-icons/edit/edit.svg create mode 100644 libs/components/icons/src/auto-icons/edit/edit.tsx create mode 100644 libs/components/icons/src/auto-icons/ellipse/ellipse.svg create mode 100644 libs/components/icons/src/auto-icons/ellipse/ellipse.tsx create mode 100644 libs/components/icons/src/auto-icons/email/email.svg create mode 100644 libs/components/icons/src/auto-icons/email/email.tsx create mode 100644 libs/components/icons/src/auto-icons/embed/embed.svg create mode 100644 libs/components/icons/src/auto-icons/embed/embed.tsx create mode 100644 libs/components/icons/src/auto-icons/eraser/eraser.svg create mode 100644 libs/components/icons/src/auto-icons/eraser/eraser.tsx create mode 100644 libs/components/icons/src/auto-icons/figma/figma.svg create mode 100644 libs/components/icons/src/auto-icons/figma/figma.tsx create mode 100644 libs/components/icons/src/auto-icons/file/file.svg create mode 100644 libs/components/icons/src/auto-icons/file/file.tsx create mode 100644 libs/components/icons/src/auto-icons/filter/filter.svg create mode 100644 libs/components/icons/src/auto-icons/filter/filter.tsx create mode 100644 libs/components/icons/src/auto-icons/format-background/format-background.svg create mode 100644 libs/components/icons/src/auto-icons/format-background/format-background.tsx create mode 100644 libs/components/icons/src/auto-icons/format-bold-emphasis/format-bold-emphasis.svg create mode 100644 libs/components/icons/src/auto-icons/format-bold-emphasis/format-bold-emphasis.tsx create mode 100644 libs/components/icons/src/auto-icons/format-clear/format-clear.svg create mode 100644 libs/components/icons/src/auto-icons/format-clear/format-clear.tsx create mode 100644 libs/components/icons/src/auto-icons/format-color-text/format-color-text.svg create mode 100644 libs/components/icons/src/auto-icons/format-color-text/format-color-text.tsx create mode 100644 libs/components/icons/src/auto-icons/format-italic/format-italic.svg create mode 100644 libs/components/icons/src/auto-icons/format-italic/format-italic.tsx create mode 100644 libs/components/icons/src/auto-icons/format-strikethrough/format-strikethrough.svg create mode 100644 libs/components/icons/src/auto-icons/format-strikethrough/format-strikethrough.tsx create mode 100644 libs/components/icons/src/auto-icons/forward-redo/forward-redo.svg create mode 100644 libs/components/icons/src/auto-icons/forward-redo/forward-redo.tsx create mode 100644 libs/components/icons/src/auto-icons/frame/frame.svg create mode 100644 libs/components/icons/src/auto-icons/frame/frame.tsx create mode 100644 libs/components/icons/src/auto-icons/full-screen/full-screen.svg create mode 100644 libs/components/icons/src/auto-icons/full-screen/full-screen.tsx create mode 100644 libs/components/icons/src/auto-icons/group-by/group-by.svg create mode 100644 libs/components/icons/src/auto-icons/group-by/group-by.tsx create mode 100644 libs/components/icons/src/auto-icons/group/group.svg create mode 100644 libs/components/icons/src/auto-icons/group/group.tsx create mode 100644 libs/components/icons/src/auto-icons/hand-tool/hand-tool.svg create mode 100644 libs/components/icons/src/auto-icons/hand-tool/hand-tool.tsx create mode 100644 libs/components/icons/src/auto-icons/handle-child/handle-child.svg create mode 100644 libs/components/icons/src/auto-icons/handle-child/handle-child.tsx create mode 100644 libs/components/icons/src/auto-icons/handle-parent/handle-parent.svg create mode 100644 libs/components/icons/src/auto-icons/handle-parent/handle-parent.tsx create mode 100644 libs/components/icons/src/auto-icons/heading-one/heading-one.svg create mode 100644 libs/components/icons/src/auto-icons/heading-one/heading-one.tsx create mode 100644 libs/components/icons/src/auto-icons/heading-three/heading-three.svg create mode 100644 libs/components/icons/src/auto-icons/heading-three/heading-three.tsx create mode 100644 libs/components/icons/src/auto-icons/heading-two/heading-two.svg create mode 100644 libs/components/icons/src/auto-icons/heading-two/heading-two.tsx create mode 100644 libs/components/icons/src/auto-icons/help-center/help-center.svg create mode 100644 libs/components/icons/src/auto-icons/help-center/help-center.tsx create mode 100644 libs/components/icons/src/auto-icons/highlighter-duotone/highlighter-duotone.svg create mode 100644 libs/components/icons/src/auto-icons/highlighter-duotone/highlighter-duotone.tsx create mode 100644 libs/components/icons/src/auto-icons/hover-frame/hover-frame.svg create mode 100644 libs/components/icons/src/auto-icons/hover-frame/hover-frame.tsx create mode 100644 libs/components/icons/src/auto-icons/image/image.svg create mode 100644 libs/components/icons/src/auto-icons/image/image.tsx create mode 100644 libs/components/icons/src/auto-icons/indent-right/indent-right.svg create mode 100644 libs/components/icons/src/auto-icons/indent-right/indent-right.tsx create mode 100644 libs/components/icons/src/auto-icons/index.ts create mode 100644 libs/components/icons/src/auto-icons/information/information.svg create mode 100644 libs/components/icons/src/auto-icons/information/information.tsx create mode 100644 libs/components/icons/src/auto-icons/kan-ban/kan-ban.svg create mode 100644 libs/components/icons/src/auto-icons/kan-ban/kan-ban.tsx create mode 100644 libs/components/icons/src/auto-icons/laser-pen-duotone/laser-pen-duotone.svg create mode 100644 libs/components/icons/src/auto-icons/laser-pen-duotone/laser-pen-duotone.tsx create mode 100644 libs/components/icons/src/auto-icons/layout/layout.svg create mode 100644 libs/components/icons/src/auto-icons/layout/layout.tsx create mode 100644 libs/components/icons/src/auto-icons/line-none/line-none.svg create mode 100644 libs/components/icons/src/auto-icons/line-none/line-none.tsx create mode 100644 libs/components/icons/src/auto-icons/link/link.svg create mode 100644 libs/components/icons/src/auto-icons/link/link.tsx create mode 100644 libs/components/icons/src/auto-icons/location/location.svg create mode 100644 libs/components/icons/src/auto-icons/location/location.tsx create mode 100644 libs/components/icons/src/auto-icons/log-out/log-out.svg create mode 100644 libs/components/icons/src/auto-icons/log-out/log-out.tsx create mode 100644 libs/components/icons/src/auto-icons/logo/logo.svg create mode 100644 libs/components/icons/src/auto-icons/logo/logo.tsx create mode 100644 libs/components/icons/src/auto-icons/more/more.svg create mode 100644 libs/components/icons/src/auto-icons/more/more.tsx create mode 100644 libs/components/icons/src/auto-icons/move-to/move-to.svg create mode 100644 libs/components/icons/src/auto-icons/move-to/move-to.tsx create mode 100644 libs/components/icons/src/auto-icons/multi-select/multi-select.svg create mode 100644 libs/components/icons/src/auto-icons/multi-select/multi-select.tsx create mode 100644 libs/components/icons/src/auto-icons/number/number.svg create mode 100644 libs/components/icons/src/auto-icons/number/number.tsx create mode 100644 libs/components/icons/src/auto-icons/page-duallink/page-duallink.svg create mode 100644 libs/components/icons/src/auto-icons/page-duallink/page-duallink.tsx create mode 100644 libs/components/icons/src/auto-icons/pages/pages.svg create mode 100644 libs/components/icons/src/auto-icons/pages/pages.tsx create mode 100644 libs/components/icons/src/auto-icons/pen/pen.svg create mode 100644 libs/components/icons/src/auto-icons/pen/pen.tsx create mode 100644 libs/components/icons/src/auto-icons/pencil-duotone/pencil-duotone.svg create mode 100644 libs/components/icons/src/auto-icons/pencil-duotone/pencil-duotone.tsx create mode 100644 libs/components/icons/src/auto-icons/phone/phone.svg create mode 100644 libs/components/icons/src/auto-icons/phone/phone.tsx create mode 100644 libs/components/icons/src/auto-icons/point-line/point-line.svg create mode 100644 libs/components/icons/src/auto-icons/point-line/point-line.tsx create mode 100644 libs/components/icons/src/auto-icons/polygon/polygon.svg create mode 100644 libs/components/icons/src/auto-icons/polygon/polygon.tsx create mode 100644 libs/components/icons/src/auto-icons/quote/quote.svg create mode 100644 libs/components/icons/src/auto-icons/quote/quote.tsx create mode 100644 libs/components/icons/src/auto-icons/reaction/reaction.svg create mode 100644 libs/components/icons/src/auto-icons/reaction/reaction.tsx create mode 100644 libs/components/icons/src/auto-icons/rectangle-93/rectangle-93.svg create mode 100644 libs/components/icons/src/auto-icons/rectangle-93/rectangle-93.tsx create mode 100644 libs/components/icons/src/auto-icons/rectangle/rectangle.svg create mode 100644 libs/components/icons/src/auto-icons/rectangle/rectangle.tsx create mode 100644 libs/components/icons/src/auto-icons/search/search.svg create mode 100644 libs/components/icons/src/auto-icons/search/search.tsx create mode 100644 libs/components/icons/src/auto-icons/select-box-select/select-box-select.svg create mode 100644 libs/components/icons/src/auto-icons/select-box-select/select-box-select.tsx create mode 100644 libs/components/icons/src/auto-icons/select-box-unselect/select-box-unselect.svg create mode 100644 libs/components/icons/src/auto-icons/select-box-unselect/select-box-unselect.tsx create mode 100644 libs/components/icons/src/auto-icons/select/select.svg create mode 100644 libs/components/icons/src/auto-icons/select/select.tsx create mode 100644 libs/components/icons/src/auto-icons/settings/settings.svg create mode 100644 libs/components/icons/src/auto-icons/settings/settings.tsx create mode 100644 libs/components/icons/src/auto-icons/shape-color-duotone/shape-color-duotone.svg create mode 100644 libs/components/icons/src/auto-icons/shape-color-duotone/shape-color-duotone.tsx create mode 100644 libs/components/icons/src/auto-icons/shape-color-none/shape-color-none.svg create mode 100644 libs/components/icons/src/auto-icons/shape-color-none/shape-color-none.tsx create mode 100644 libs/components/icons/src/auto-icons/shape/shape.svg create mode 100644 libs/components/icons/src/auto-icons/shape/shape.tsx create mode 100644 libs/components/icons/src/auto-icons/side-bar-view-close/side-bar-view-close.svg create mode 100644 libs/components/icons/src/auto-icons/side-bar-view-close/side-bar-view-close.tsx create mode 100644 libs/components/icons/src/auto-icons/side-bar-view/side-bar-view.svg create mode 100644 libs/components/icons/src/auto-icons/side-bar-view/side-bar-view.tsx create mode 100644 libs/components/icons/src/auto-icons/single-select/single-select.svg create mode 100644 libs/components/icons/src/auto-icons/single-select/single-select.tsx create mode 100644 libs/components/icons/src/auto-icons/solid-line/solid-line.svg create mode 100644 libs/components/icons/src/auto-icons/solid-line/solid-line.tsx create mode 100644 libs/components/icons/src/auto-icons/sort/sort.svg create mode 100644 libs/components/icons/src/auto-icons/sort/sort.tsx create mode 100644 libs/components/icons/src/auto-icons/sql/sql.svg create mode 100644 libs/components/icons/src/auto-icons/sql/sql.tsx create mode 100644 libs/components/icons/src/auto-icons/stamp/stamp.svg create mode 100644 libs/components/icons/src/auto-icons/stamp/stamp.tsx create mode 100644 libs/components/icons/src/auto-icons/star/star.svg create mode 100644 libs/components/icons/src/auto-icons/star/star.tsx create mode 100644 libs/components/icons/src/auto-icons/status/status.svg create mode 100644 libs/components/icons/src/auto-icons/status/status.tsx create mode 100644 libs/components/icons/src/auto-icons/switch-off-duotone/switch-off-duotone.svg create mode 100644 libs/components/icons/src/auto-icons/switch-off-duotone/switch-off-duotone.tsx create mode 100644 libs/components/icons/src/auto-icons/switch-on-duotone/switch-on-duotone.svg create mode 100644 libs/components/icons/src/auto-icons/switch-on-duotone/switch-on-duotone.tsx create mode 100644 libs/components/icons/src/auto-icons/table/table.svg create mode 100644 libs/components/icons/src/auto-icons/table/table.tsx create mode 100644 libs/components/icons/src/auto-icons/tag-add-duotone/tag-add-duotone.svg create mode 100644 libs/components/icons/src/auto-icons/tag-add-duotone/tag-add-duotone.tsx create mode 100644 libs/components/icons/src/auto-icons/tags/tags.svg create mode 100644 libs/components/icons/src/auto-icons/tags/tags.tsx create mode 100644 libs/components/icons/src/auto-icons/text-font/text-font.svg create mode 100644 libs/components/icons/src/auto-icons/text-font/text-font.tsx create mode 100644 libs/components/icons/src/auto-icons/text/text.svg create mode 100644 libs/components/icons/src/auto-icons/text/text.tsx create mode 100644 libs/components/icons/src/auto-icons/to-do/to-do.svg create mode 100644 libs/components/icons/src/auto-icons/to-do/to-do.tsx create mode 100644 libs/components/icons/src/auto-icons/todo-list/todo-list.svg create mode 100644 libs/components/icons/src/auto-icons/todo-list/todo-list.tsx create mode 100644 libs/components/icons/src/auto-icons/triangle/triangle.svg create mode 100644 libs/components/icons/src/auto-icons/triangle/triangle.tsx create mode 100644 libs/components/icons/src/auto-icons/turn-into/turn-into.svg create mode 100644 libs/components/icons/src/auto-icons/turn-into/turn-into.tsx create mode 100644 libs/components/icons/src/auto-icons/ungroup/ungroup.svg create mode 100644 libs/components/icons/src/auto-icons/ungroup/ungroup.tsx create mode 100644 libs/components/icons/src/auto-icons/web-app/web-app.svg create mode 100644 libs/components/icons/src/auto-icons/web-app/web-app.tsx create mode 100644 libs/components/icons/src/auto-icons/youtube/youtube.svg create mode 100644 libs/components/icons/src/auto-icons/youtube/youtube.tsx create mode 100644 libs/components/icons/src/index.ts create mode 100644 libs/components/icons/tsconfig.json create mode 100644 libs/components/icons/tsconfig.lib.json create mode 100644 libs/components/icons/tsconfig.spec.json create mode 100644 libs/components/layout/.babelrc create mode 100644 libs/components/layout/.eslintrc.json create mode 100644 libs/components/layout/README.md create mode 100644 libs/components/layout/jest.config.js create mode 100644 libs/components/layout/package.json create mode 100644 libs/components/layout/project.json create mode 100644 libs/components/layout/src/header/EditorBoardSwitcher/StatusIcon.tsx create mode 100644 libs/components/layout/src/header/EditorBoardSwitcher/StatusText.tsx create mode 100644 libs/components/layout/src/header/EditorBoardSwitcher/StatusTrack.tsx create mode 100644 libs/components/layout/src/header/EditorBoardSwitcher/Switcher.tsx create mode 100644 libs/components/layout/src/header/EditorBoardSwitcher/index.ts create mode 100644 libs/components/layout/src/header/EditorBoardSwitcher/type.ts create mode 100644 libs/components/layout/src/header/Header.tsx create mode 100644 libs/components/layout/src/header/LayoutHeader.tsx create mode 100644 libs/components/layout/src/header/PageHistoryPortal.tsx create mode 100644 libs/components/layout/src/header/PageSettingPortal.tsx create mode 100644 libs/components/layout/src/header/PageSharePortal.tsx create mode 100644 libs/components/layout/src/header/Tempnav.tsx create mode 100644 libs/components/layout/src/header/Title.tsx create mode 100644 libs/components/layout/src/header/file-exporter/file-exporter.ts create mode 100644 libs/components/layout/src/header/index.ts create mode 100644 libs/components/layout/src/header/types.ts create mode 100644 libs/components/layout/src/header/use-layout-header.ts create mode 100644 libs/components/layout/src/header/user-menu-icon/UserMenuIcon.tsx create mode 100644 libs/components/layout/src/header/user-menu-icon/UserMenuList.tsx create mode 100644 libs/components/layout/src/header/user-menu-icon/index.ts create mode 100644 libs/components/layout/src/index.ts create mode 100644 libs/components/layout/src/settings-sidebar/Comments/CommentItem.tsx create mode 100644 libs/components/layout/src/settings-sidebar/Comments/Comments.tsx create mode 100644 libs/components/layout/src/settings-sidebar/Comments/index.ts create mode 100644 libs/components/layout/src/settings-sidebar/Comments/item/CommentContent.tsx create mode 100644 libs/components/layout/src/settings-sidebar/Comments/item/CommentedByUser.tsx create mode 100644 libs/components/layout/src/settings-sidebar/Comments/item/QuotedContent.tsx create mode 100644 libs/components/layout/src/settings-sidebar/Comments/item/ReplyInput.tsx create mode 100644 libs/components/layout/src/settings-sidebar/Comments/item/ReplyItem.tsx create mode 100644 libs/components/layout/src/settings-sidebar/Comments/type.ts create mode 100644 libs/components/layout/src/settings-sidebar/Comments/use-comments.ts create mode 100644 libs/components/layout/src/settings-sidebar/Comments/utils.ts create mode 100644 libs/components/layout/src/settings-sidebar/ContainerTabs/ContainerTabs.tsx create mode 100644 libs/components/layout/src/settings-sidebar/ContainerTabs/TabItemTitle.tsx create mode 100644 libs/components/layout/src/settings-sidebar/ContainerTabs/index.ts create mode 100644 libs/components/layout/src/settings-sidebar/ContainerTabs/use-tabs.ts create mode 100644 libs/components/layout/src/settings-sidebar/Layout/LayoutSettings.tsx create mode 100644 libs/components/layout/src/settings-sidebar/Layout/index.ts create mode 100644 libs/components/layout/src/settings-sidebar/Settings/SettingsList.tsx create mode 100644 libs/components/layout/src/settings-sidebar/Settings/SettingsPanel.tsx create mode 100644 libs/components/layout/src/settings-sidebar/Settings/footer/Footer.tsx create mode 100644 libs/components/layout/src/settings-sidebar/Settings/footer/LastModified.tsx create mode 100644 libs/components/layout/src/settings-sidebar/Settings/footer/Logout.tsx create mode 100644 libs/components/layout/src/settings-sidebar/Settings/footer/index.ts create mode 100644 libs/components/layout/src/settings-sidebar/Settings/index.ts create mode 100644 libs/components/layout/src/settings-sidebar/Settings/use-setting-flags.ts create mode 100644 libs/components/layout/src/settings-sidebar/Settings/use-settings.ts create mode 100644 libs/components/layout/src/settings-sidebar/Settings/util/duplicate-page.ts create mode 100644 libs/components/layout/src/settings-sidebar/Settings/util/file-exporter.ts create mode 100644 libs/components/layout/src/settings-sidebar/Settings/util/get-page-info.ts create mode 100644 libs/components/layout/src/settings-sidebar/Settings/util/handle-export.ts create mode 100644 libs/components/layout/src/settings-sidebar/Settings/util/index.ts create mode 100644 libs/components/layout/src/settings-sidebar/Settings/util/inspector-workspace.ts create mode 100644 libs/components/layout/src/settings-sidebar/Settings/util/use-reading-mode.ts create mode 100644 libs/components/layout/src/settings-sidebar/Settings/util/use-workspace-page.ts create mode 100644 libs/components/layout/src/settings-sidebar/SettingsSidebar.tsx create mode 100644 libs/components/layout/src/settings-sidebar/index.ts create mode 100644 libs/components/layout/src/settings-sidebar/use-settings-sidebar.ts create mode 100644 libs/components/layout/src/workspace-sidebar/activities/activities.tsx create mode 100644 libs/components/layout/src/workspace-sidebar/activities/index.ts create mode 100644 libs/components/layout/src/workspace-sidebar/calendar-heatmap/CalendarHeatmap.tsx create mode 100644 libs/components/layout/src/workspace-sidebar/calendar-heatmap/HeatedDay.tsx create mode 100644 libs/components/layout/src/workspace-sidebar/calendar-heatmap/index.ts create mode 100644 libs/components/layout/src/workspace-sidebar/calendar-heatmap/types.ts create mode 100644 libs/components/layout/src/workspace-sidebar/calendar-heatmap/use-calendar-heatmap.ts create mode 100644 libs/components/layout/src/workspace-sidebar/calendar-heatmap/utils.ts create mode 100644 libs/components/layout/src/workspace-sidebar/index.ts create mode 100755 libs/components/layout/src/workspace-sidebar/page-tree/DndTree.tsx create mode 100644 libs/components/layout/src/workspace-sidebar/page-tree/block-page.ts create mode 100644 libs/components/layout/src/workspace-sidebar/page-tree/index.ts create mode 100755 libs/components/layout/src/workspace-sidebar/page-tree/page-tree.tsx create mode 100755 libs/components/layout/src/workspace-sidebar/page-tree/tree-item/DndTreeItem.tsx create mode 100644 libs/components/layout/src/workspace-sidebar/page-tree/tree-item/MoreActions.tsx create mode 100644 libs/components/layout/src/workspace-sidebar/page-tree/tree-item/NewFromTemplatePortal.tsx create mode 100755 libs/components/layout/src/workspace-sidebar/page-tree/tree-item/TreeItem.tsx create mode 100755 libs/components/layout/src/workspace-sidebar/page-tree/tree-item/index.ts create mode 100755 libs/components/layout/src/workspace-sidebar/page-tree/tree-item/tree-item.module.scss create mode 100755 libs/components/layout/src/workspace-sidebar/page-tree/types.ts create mode 100755 libs/components/layout/src/workspace-sidebar/page-tree/use-page-tree.ts create mode 100755 libs/components/layout/src/workspace-sidebar/page-tree/utils.ts create mode 100644 libs/components/layout/tsconfig.json create mode 100644 libs/components/layout/tsconfig.lib.json create mode 100644 libs/components/layout/tsconfig.spec.json create mode 100644 libs/components/ui/.babelrc create mode 100644 libs/components/ui/.eslintrc.json create mode 100644 libs/components/ui/README.md create mode 100644 libs/components/ui/jest.config.ts create mode 100644 libs/components/ui/package.json create mode 100644 libs/components/ui/project.json create mode 100644 libs/components/ui/src/autocomplete/index.tsx create mode 100644 libs/components/ui/src/button/IconButton.tsx create mode 100644 libs/components/ui/src/button/base-button.ts create mode 100644 libs/components/ui/src/button/constants.ts create mode 100644 libs/components/ui/src/button/index.ts create mode 100644 libs/components/ui/src/button/list-button.tsx create mode 100644 libs/components/ui/src/cascader/Cascader.tsx create mode 100644 libs/components/ui/src/cascader/index.ts create mode 100644 libs/components/ui/src/checkbox/Checkbox.tsx create mode 100644 libs/components/ui/src/checkbox/index.tsx create mode 100644 libs/components/ui/src/classname/index.ts create mode 100644 libs/components/ui/src/clickable/Clickable.tsx create mode 100644 libs/components/ui/src/clickable/index.ts create mode 100644 libs/components/ui/src/clsx.ts create mode 100644 libs/components/ui/src/date/Calendar.tsx create mode 100644 libs/components/ui/src/date/DateRange.tsx create mode 100644 libs/components/ui/src/date/index.ts create mode 100644 libs/components/ui/src/divider/Divider.tsx create mode 100644 libs/components/ui/src/divider/index.ts create mode 100644 libs/components/ui/src/event-away/index.ts create mode 100644 libs/components/ui/src/index.ts create mode 100644 libs/components/ui/src/input/Input.tsx create mode 100644 libs/components/ui/src/input/index.tsx create mode 100644 libs/components/ui/src/list/ListIcon.tsx create mode 100644 libs/components/ui/src/list/ListItem.tsx create mode 100644 libs/components/ui/src/list/index.ts create mode 100644 libs/components/ui/src/message/base.tsx create mode 100644 libs/components/ui/src/message/index.tsx create mode 100644 libs/components/ui/src/message/success.tsx create mode 100644 libs/components/ui/src/message/types.ts create mode 100644 libs/components/ui/src/model/index.tsx create mode 100644 libs/components/ui/src/mui.ts create mode 100644 libs/components/ui/src/patch-elements/index.tsx create mode 100644 libs/components/ui/src/popover/Popover.tsx create mode 100644 libs/components/ui/src/popover/container.tsx create mode 100644 libs/components/ui/src/popover/index.tsx create mode 100644 libs/components/ui/src/popover/interface.ts create mode 100644 libs/components/ui/src/popper/PopoverArrow.tsx create mode 100644 libs/components/ui/src/popper/Popper.tsx create mode 100644 libs/components/ui/src/popper/index.ts create mode 100644 libs/components/ui/src/popper/interface.ts create mode 100644 libs/components/ui/src/radio/Radio.tsx create mode 100644 libs/components/ui/src/radio/index.ts create mode 100644 libs/components/ui/src/select/OldSelect.tsx create mode 100644 libs/components/ui/src/select/Option.tsx create mode 100644 libs/components/ui/src/select/OptionGroup.tsx create mode 100644 libs/components/ui/src/select/Select.tsx create mode 100644 libs/components/ui/src/select/index.ts create mode 100644 libs/components/ui/src/slider/Slider.tsx create mode 100644 libs/components/ui/src/slider/index.ts create mode 100644 libs/components/ui/src/styled/index.ts create mode 100644 libs/components/ui/src/svg-icon/index.ts create mode 100644 libs/components/ui/src/switch/Switch.tsx create mode 100644 libs/components/ui/src/switch/index.ts create mode 100644 libs/components/ui/src/tag/Tag.tsx create mode 100644 libs/components/ui/src/tag/index.tsx create mode 100644 libs/components/ui/src/tag/style.ts create mode 100644 libs/components/ui/src/theme/README.md create mode 100644 libs/components/ui/src/theme/color.ts create mode 100644 libs/components/ui/src/theme/index.ts create mode 100644 libs/components/ui/src/theme/theme.ts create mode 100644 libs/components/ui/src/theme/utils.tsx create mode 100644 libs/components/ui/src/tooltip/Tooltip.tsx create mode 100644 libs/components/ui/src/tooltip/index.tsx create mode 100644 libs/components/ui/src/tooltip/interface.ts create mode 100644 libs/components/ui/src/typography/Typo.tsx create mode 100644 libs/components/ui/src/typography/index.ts create mode 100644 libs/components/ui/tsconfig.json create mode 100644 libs/components/ui/tsconfig.lib.json create mode 100644 libs/components/ui/tsconfig.spec.json create mode 100644 libs/datasource/commands/.babelrc create mode 100644 libs/datasource/commands/.eslintrc.json create mode 100644 libs/datasource/commands/README.md create mode 100644 libs/datasource/commands/jest.config.ts create mode 100644 libs/datasource/commands/package.json create mode 100644 libs/datasource/commands/project.json create mode 100644 libs/datasource/commands/src/index.ts create mode 100644 libs/datasource/commands/src/lib/commands/block-command.ts create mode 100644 libs/datasource/commands/src/lib/commands/index.ts create mode 100644 libs/datasource/commands/src/lib/commands/text-command.ts create mode 100644 libs/datasource/commands/src/lib/datasource-commands.spec.ts create mode 100644 libs/datasource/commands/src/lib/datasource-commands.ts create mode 100644 libs/datasource/commands/tsconfig.json create mode 100644 libs/datasource/commands/tsconfig.lib.json create mode 100644 libs/datasource/commands/tsconfig.spec.json create mode 100644 libs/datasource/db-service/.babelrc create mode 100644 libs/datasource/db-service/.eslintrc.json create mode 100644 libs/datasource/db-service/README.md create mode 100644 libs/datasource/db-service/jest.config.js create mode 100644 libs/datasource/db-service/package.json create mode 100644 libs/datasource/db-service/project.json create mode 100644 libs/datasource/db-service/src/index.ts create mode 100644 libs/datasource/db-service/src/protocol/index.ts create mode 100644 libs/datasource/db-service/src/services/base.ts create mode 100644 libs/datasource/db-service/src/services/comment/comment.ts create mode 100644 libs/datasource/db-service/src/services/comment/index.ts create mode 100644 libs/datasource/db-service/src/services/comment/types.ts create mode 100644 libs/datasource/db-service/src/services/database/index.ts create mode 100644 libs/datasource/db-service/src/services/database/observer.ts create mode 100644 libs/datasource/db-service/src/services/editor-block/index.ts create mode 100644 libs/datasource/db-service/src/services/editor-block/templates/group-templates.ts create mode 100644 libs/datasource/db-service/src/services/editor-block/templates/index.ts create mode 100644 libs/datasource/db-service/src/services/editor-block/templates/template-factory.ts create mode 100644 libs/datasource/db-service/src/services/editor-block/templates/types.ts create mode 100644 libs/datasource/db-service/src/services/editor-block/types.ts create mode 100644 libs/datasource/db-service/src/services/editor-block/utils/column/default-config.ts create mode 100644 libs/datasource/db-service/src/services/editor-block/utils/column/index.ts create mode 100644 libs/datasource/db-service/src/services/editor-block/utils/column/types.ts create mode 100644 libs/datasource/db-service/src/services/editor-block/utils/column/utils.ts create mode 100644 libs/datasource/db-service/src/services/editor-block/utils/common.ts create mode 100644 libs/datasource/db-service/src/services/editor-block/utils/index.ts create mode 100644 libs/datasource/db-service/src/services/file/index.ts create mode 100644 libs/datasource/db-service/src/services/index.ts create mode 100644 libs/datasource/db-service/src/services/workspace/page-tree.ts create mode 100644 libs/datasource/db-service/src/services/workspace/types.ts create mode 100644 libs/datasource/db-service/src/services/workspace/user-config.ts create mode 100644 libs/datasource/db-service/src/utils/constants.ts create mode 100644 libs/datasource/db-service/src/utils/index.ts create mode 100644 libs/datasource/db-service/tsconfig.json create mode 100644 libs/datasource/db-service/tsconfig.lib.json create mode 100644 libs/datasource/db-service/tsconfig.spec.json create mode 100644 libs/datasource/feature-flags/.babelrc create mode 100644 libs/datasource/feature-flags/.eslintrc.json create mode 100644 libs/datasource/feature-flags/README.md create mode 100644 libs/datasource/feature-flags/jest.config.ts create mode 100644 libs/datasource/feature-flags/package.json create mode 100644 libs/datasource/feature-flags/project.json create mode 100644 libs/datasource/feature-flags/src/Context.tsx create mode 100644 libs/datasource/feature-flags/src/config.ts create mode 100644 libs/datasource/feature-flags/src/index.ts create mode 100644 libs/datasource/feature-flags/tsconfig.json create mode 100644 libs/datasource/feature-flags/tsconfig.lib.json create mode 100644 libs/datasource/feature-flags/tsconfig.spec.json create mode 100644 libs/datasource/jwt-rpc/.babelrc create mode 100644 libs/datasource/jwt-rpc/.eslintrc.json create mode 100644 libs/datasource/jwt-rpc/jest.config.ts create mode 100644 libs/datasource/jwt-rpc/package.json create mode 100644 libs/datasource/jwt-rpc/project.json create mode 100644 libs/datasource/jwt-rpc/src/connector.ts create mode 100644 libs/datasource/jwt-rpc/src/handler.ts create mode 100644 libs/datasource/jwt-rpc/src/index.ts create mode 100644 libs/datasource/jwt-rpc/src/provider.ts create mode 100644 libs/datasource/jwt-rpc/tsconfig.json create mode 100644 libs/datasource/jwt-rpc/tsconfig.lib.json create mode 100644 libs/datasource/jwt-rpc/tsconfig.spec.json create mode 100644 libs/datasource/jwt/.babelrc create mode 100644 libs/datasource/jwt/.eslintrc.json create mode 100644 libs/datasource/jwt/jest.config.js create mode 100644 libs/datasource/jwt/package.json create mode 100644 libs/datasource/jwt/project.json create mode 100644 libs/datasource/jwt/src/adapter/index.ts create mode 100644 libs/datasource/jwt/src/adapter/yjs/binary.ts create mode 100644 libs/datasource/jwt/src/adapter/yjs/block.ts create mode 100644 libs/datasource/jwt/src/adapter/yjs/gatekeeper.ts create mode 100644 libs/datasource/jwt/src/adapter/yjs/history.ts create mode 100644 libs/datasource/jwt/src/adapter/yjs/index.ts create mode 100644 libs/datasource/jwt/src/adapter/yjs/listener.ts create mode 100644 libs/datasource/jwt/src/adapter/yjs/operation.ts create mode 100644 libs/datasource/jwt/src/block/abstract.ts create mode 100644 libs/datasource/jwt/src/block/base.ts create mode 100644 libs/datasource/jwt/src/block/capability.ts create mode 100644 libs/datasource/jwt/src/block/index.ts create mode 100644 libs/datasource/jwt/src/block/indexer.ts create mode 100644 libs/datasource/jwt/src/index.ts create mode 100644 libs/datasource/jwt/src/types/block.ts create mode 100644 libs/datasource/jwt/src/types/index.ts create mode 100644 libs/datasource/jwt/src/types/metadata.ts create mode 100644 libs/datasource/jwt/src/types/utils.ts create mode 100644 libs/datasource/jwt/src/types/uuid.ts create mode 100644 libs/datasource/jwt/src/utils/event-bus.ts create mode 100644 libs/datasource/jwt/src/utils/index.ts create mode 100644 libs/datasource/jwt/tsconfig.json create mode 100644 libs/datasource/jwt/tsconfig.lib.json create mode 100644 libs/datasource/jwt/tsconfig.spec.json create mode 100644 libs/datasource/remote-kv/.babelrc create mode 100644 libs/datasource/remote-kv/.eslintrc.json create mode 100644 libs/datasource/remote-kv/README.md create mode 100644 libs/datasource/remote-kv/jest.config.js create mode 100644 libs/datasource/remote-kv/package.json create mode 100644 libs/datasource/remote-kv/project.json create mode 100644 libs/datasource/remote-kv/src/aws/aws-attachment.ts create mode 100644 libs/datasource/remote-kv/src/aws/aws-config.ts create mode 100644 libs/datasource/remote-kv/src/constant/message-info.ts create mode 100644 libs/datasource/remote-kv/src/index.ts create mode 100644 libs/datasource/remote-kv/src/utils/to-async.ts create mode 100644 libs/datasource/remote-kv/tsconfig.json create mode 100644 libs/datasource/remote-kv/tsconfig.lib.json create mode 100644 libs/datasource/remote-kv/tsconfig.spec.json create mode 100644 libs/datasource/state/.babelrc create mode 100644 libs/datasource/state/.eslintrc.json create mode 100644 libs/datasource/state/README.md create mode 100644 libs/datasource/state/jest.config.js create mode 100644 libs/datasource/state/package.json create mode 100644 libs/datasource/state/project.json create mode 100644 libs/datasource/state/src/index.ts create mode 100644 libs/datasource/state/src/page.ts create mode 100644 libs/datasource/state/src/ui.ts create mode 100644 libs/datasource/state/src/user.ts create mode 100644 libs/datasource/state/tsconfig.json create mode 100644 libs/datasource/state/tsconfig.lib.json create mode 100644 libs/datasource/state/tsconfig.spec.json create mode 100644 libs/framework/virgo/.babelrc create mode 100644 libs/framework/virgo/.eslintrc.json create mode 100644 libs/framework/virgo/README.md create mode 100644 libs/framework/virgo/jest.config.js create mode 100644 libs/framework/virgo/package.json create mode 100644 libs/framework/virgo/project.json create mode 100644 libs/framework/virgo/src/index.ts create mode 100644 libs/framework/virgo/tsconfig.json create mode 100644 libs/framework/virgo/tsconfig.lib.json create mode 100644 libs/framework/virgo/tsconfig.spec.json create mode 100644 libs/rollup-ts-checker.config.cjs create mode 100644 libs/rollup.config.cjs create mode 100644 libs/utils/.babelrc create mode 100644 libs/utils/.eslintrc.json create mode 100644 libs/utils/jest.config.js create mode 100644 libs/utils/package.json create mode 100644 libs/utils/project.json create mode 100644 libs/utils/src/constants.ts create mode 100644 libs/utils/src/copy-to-clipboard.ts create mode 100644 libs/utils/src/date.ts create mode 100644 libs/utils/src/di/di.ts create mode 100644 libs/utils/src/di/index.ts create mode 100644 libs/utils/src/dom.ts create mode 100644 libs/utils/src/env.ts create mode 100644 libs/utils/src/error-boundary.tsx create mode 100644 libs/utils/src/function.ts create mode 100644 libs/utils/src/index.ts create mode 100644 libs/utils/src/keyboard.ts create mode 100644 libs/utils/src/lodash.ts create mode 100644 libs/utils/src/logger.ts create mode 100644 libs/utils/src/rect.ts create mode 100644 libs/utils/src/types/index.ts create mode 100644 libs/utils/src/types/tools.ts create mode 100644 libs/utils/src/types/user-workspace.ts create mode 100644 libs/utils/src/useragent.ts create mode 100644 libs/utils/src/utils.ts create mode 100644 libs/utils/tsconfig.json create mode 100644 libs/utils/tsconfig.lib.json create mode 100644 libs/utils/tsconfig.spec.json create mode 100644 nx.json create mode 100644 package.json create mode 100644 pnpm-lock.yaml create mode 100644 pnpm-workspace.yaml create mode 100644 tools/executors/figmaRes/download.js create mode 100644 tools/executors/figmaRes/executor.json create mode 100644 tools/executors/figmaRes/figma/api.js create mode 100644 tools/executors/figmaRes/figma/generateReactIcon.js create mode 100644 tools/executors/figmaRes/figma/index.js create mode 100644 tools/executors/figmaRes/figma/svgo.js create mode 100644 tools/executors/figmaRes/figma/util.js create mode 100644 tools/executors/figmaRes/package.json create mode 100644 tools/executors/figmaRes/patch-styles.js create mode 100644 tools/executors/figmaRes/schema.json create mode 100644 tools/executors/svgOptimize/executor.json create mode 100644 tools/executors/svgOptimize/package.json create mode 100644 tools/executors/svgOptimize/schema.json create mode 100644 tools/executors/svgOptimize/svgo.js create mode 100644 tools/executors/tsCheck/executor.json create mode 100644 tools/executors/tsCheck/package.json create mode 100644 tools/executors/tsCheck/schema.json create mode 100644 tools/executors/tsCheck/tsCheck.js create mode 100644 tools/generators/.gitkeep create mode 100644 tools/notify.mjs create mode 100644 tools/tsconfig.tools.json create mode 100644 tsconfig.base.json create mode 100644 workspace.json diff --git a/.all-contributorsrc b/.all-contributorsrc new file mode 100644 index 0000000000..0340f41c92 --- /dev/null +++ b/.all-contributorsrc @@ -0,0 +1,125 @@ +{ + "projectName": "Ligo-Virgo", + "projectOwner": "toeverything", + "repoType": "github", + "repoHost": "https://github.com", + "files": [ + "README.md" + ], + "imageSize": 100, + "commit": false, + "commitConvention": "angular", + "contributorsPerLine": 7, + "contributors": [ + { + "login": "darkskygit", + "name": "DarkSky", + "avatar_url": "https://avatars.githubusercontent.com/u/25152247?v=4", + "profile": "https://darksky.eu.org/", + "contributions": [ + "code", + "doc" + ] + }, + { + "login": "tzhangchi", + "name": "Chi Zhang", + "avatar_url": "https://avatars.githubusercontent.com/u/5910926?v=4", + "profile": "https://zhangchi.blog.csdn.net/", + "contributions": [ + "code", + "doc" + ] + }, + { + "login": "alt1o", + "name": "alt1o", + "avatar_url": "https://avatars.githubusercontent.com/u/21084335?v=4", + "profile": "https://github.com/alt1o", + "contributions": [ + "code", + "doc" + ] + }, + { + "login": "DiamondThree", + "name": "Diamond", + "avatar_url": "https://avatars.githubusercontent.com/u/24630517?v=4", + "profile": "https://github.com/DiamondThree", + "contributions": [ + "code", + "doc" + ] + }, + { + "login": "lawvs", + "name": "Whitewater", + "avatar_url": "https://avatars.githubusercontent.com/u/18554747?v=4", + "profile": "https://lawvs.github.io/profile/", + "contributions": [ + "code", + "doc" + ] + }, + { + "login": "zuoxiaodong0815", + "name": "zuoxiaodong0815", + "avatar_url": "https://avatars.githubusercontent.com/u/53252747?v=4", + "profile": "https://github.com/zuoxiaodong0815", + "contributions": [ + "code", + "doc" + ] + }, + { + "login": "SaikaSakura", + "name": "SaikaSakura", + "avatar_url": "https://avatars.githubusercontent.com/u/11530942?v=4", + "profile": "https://github.com/SaikaSakura", + "contributions": [ + "code", + "doc" + ] + }, + { + "login": "QiShaoXuan", + "name": "Qi", + "avatar_url": "https://avatars.githubusercontent.com/u/22772830?v=4", + "profile": "https://github.com/QiShaoXuan", + "contributions": [ + "code", + "doc" + ] + }, + { + "login": "tuluffy", + "name": "tuluffy", + "avatar_url": "https://avatars.githubusercontent.com/u/26808339?v=4", + "profile": "https://tuluffy.github.io/angular.github.io/", + "contributions": [ + "code", + "doc" + ] + }, + { + "login": "Austaras", + "name": "Austaras", + "avatar_url": "https://avatars.githubusercontent.com/u/15013925?v=4", + "profile": "https://shockwave.me/", + "contributions": [ + "code", + "doc" + ] + }, + { + "login": "uptonking", + "name": "Jin Yao", + "avatar_url": "https://avatars.githubusercontent.com/u/11391549?v=4", + "profile": "https://github.com/uptonking?tab=repositories&type=source", + "contributions": [ + "code", + "doc" + ] + } + ] +} diff --git a/.cz-config.js b/.cz-config.js new file mode 100644 index 0000000000..e282d831ee --- /dev/null +++ b/.cz-config.js @@ -0,0 +1,66 @@ +module.exports = { + types: [ + { value: 'feat', name: 'feat 🍄: add new features' }, + { value: 'fix', name: 'fix 🐛: fix bug' }, + { value: 'docs', name: 'docs 📄: modify documentation, comments' }, + { + value: 'refactor', + name: 'refactor 🎸: code refactoring, pay attention to distinguish it from features and fixes', + }, + { value: 'perf', name: 'perf ⚡: improve performance' }, + { value: 'test', name: 'test 👀: add a test' }, + { + value: 'tool', + name: 'tool 🚗: Development tool changes (build, scaffolding tools, etc.)', + }, + { + value: 'style', + name: 'style ✂: Modifications to code formatting do not affect logic', + }, + { value: 'revert', name: 'revert 🌝: version rollback' }, + { + value: 'editor', + name: 'editor 🔧: editor configuration modification', + }, + { value: 'update', name: 'update ⬆: third-party library upgrade' }, + ], + scopes: [ + { name: 'selection' }, + { name: 'whiteboard' }, + { name: 'point' }, + { name: 'group' }, + { name: 'page' }, + { name: 'component' }, + { name: 'config' }, + { name: 'others' }, + ], + + // it needs to match the value for field type. Eg.: 'fix' + /* +scopeOverrides: { + fix: [ + {name: 'merge'}, + {name: 'style'} + ] + +}, +*/ + // override the messages, de faults are as follows + messages: { + type: 'Choose a type of your submission:', + scope: 'Choose a scope (optional):', + // used if allowCustomScopes is true + customScope: 'Denote the SCOPE of this change:', + subject: 'Brief description:\n', + body: 'Detailed description, use "|" newline (optional):\n', + breaking: 'Incompatibility specification (optional):\n', + footer: 'Associate closed issues, for example: #31, #34 (optional):\n', + confirmCommit: 'Are you sure to commit?', + }, + + allowCustomScopes: true, + allowBreakingChanges: ['Added', 'Repair'], + + // limit subject length + subjectLimit: 100, +}; diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000000..9b7352176a --- /dev/null +++ b/.editorconfig @@ -0,0 +1,13 @@ +# Editor configuration, see http://editorconfig.org +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 4 +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +max_line_length = off +trim_trailing_whitespace = false diff --git a/.env b/.env new file mode 100644 index 0000000000..35f39c15bc --- /dev/null +++ b/.env @@ -0,0 +1,4 @@ +# use for download icon from figma +FIGMA_TOKEN +NODE_ENV +AFFINE_FEATURE_FLAG_TOKEN \ No newline at end of file diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000000..9809316cc9 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,4 @@ +**/webpack.config.js +**/jest.config.js +**/node_modules/** +.github/** \ No newline at end of file diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000000..a277c50dc9 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,287 @@ +{ + "root": true, + "ignorePatterns": ["**/*"], + "plugins": ["@nrwl/nx", "react", "filename-rules", "import", "prettier"], + "parserOptions": { + "project": ["./tsconfig.base.json"] + }, + "overrides": [ + { + "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], + "rules": { + "prettier/prettier": "warn", + "@nrwl/nx/enforce-module-boundaries": [ + "error", + { + "enforceBuildableLibDependency": true, + "allow": [], + "depConstraints": [ + { + "sourceTag": "library:utils", + "onlyDependOnLibsWithTags": ["library:utils"] + }, + { + "sourceTag": "datasource:jwt", + "onlyDependOnLibsWithTags": [ + "library:utils", + "datasource:remote-kv", + "datasource:jwt-rpc" + ] + }, + { + "sourceTag": "datasource:db-services", + "onlyDependOnLibsWithTags": [ + "library:utils", + "datasource:jwt" + ] + }, + { + "sourceTag": "datasource:hooks", + "onlyDependOnLibsWithTags": [ + "library:utils", + "datasource:jwt", + "datasource:db-services" + ] + }, + { + "sourceTag": "datasource:http", + "onlyDependOnLibsWithTags": ["library:utils"] + }, + { + "sourceTag": "datasource:state", + "onlyDependOnLibsWithTags": [ + "library:utils", + "library:feature-flags", + "datasource:http", + "datasource:jwt" + ] + }, + { + "sourceTag": "components:common", + "onlyDependOnLibsWithTags": [ + "library:utils", + "components:icons", + "components:ui" + ] + }, + { + "sourceTag": "components:editor-core", + "onlyDependOnLibsWithTags": [ + "library:utils", + "library:feature-flags", + "datasource:db-services", + "datasource:state", + "datasource:commands", + "datasource:jwt", + "components:ui", + "components:common", + "components:icons" + ] + }, + { + "sourceTag": "components:editor-blocks", + "onlyDependOnLibsWithTags": [ + "library:utils", + "library:feature-flags", + "components:common", + "components:editor-core", + "framework:editor", + "datasource:db-services", + "components:ui", + "components:icons" + ] + }, + { + "sourceTag": "components:editor-plugins", + "onlyDependOnLibsWithTags": [ + "library:utils", + "components:common", + "components:editor-core", + "framework:editor", + "components:editor-blocks", + "datasource:db-services", + "components:ui", + "components:icons", + "library:feature-flags" + ] + }, + { + "sourceTag": "components:ui", + "onlyDependOnLibsWithTags": [ + "components:icons", + "library:utils" + ] + }, + { + "sourceTag": "framework:editor", + "onlyDependOnLibsWithTags": [ + "components:editor-core" + ] + }, + { + "sourceTag": "*", + "onlyDependOnLibsWithTags": ["*"] + } + ], + "allowCircularSelfDependency": false + } + ], + "filename-rules/match": [ + "warn", + { + ".tsx": "PascalCase", + ".ts": "kebab-case", + ".json": "kebab-case", + "": "kebab-case" + } + ], + "no-restricted-imports": [ + "error", + { + "patterns": [ + { + "group": ["lodash"], + "message": "Forbid direct import of lodash, use @toeverything/utils" + }, + { + "group": ["lodash-es"], + "message": "Forbid direct import of lodash-es, use @toeverything/utils" + }, + { + "group": ["@mui/material", "@mui/material/*"], + "message": "Forbid direct import of @mui/material, use @toeverything/components/ui" + } + ] + } + ], + "@typescript-eslint/naming-convention": [ + "warn", + { + "selector": [ + "property", + "parameterProperty", + "accessor", + "enumMember" + ], + "format": ["strictCamelCase"] + }, + { + "selector": ["property", "accessor"], + "modifiers": ["private"], + "format": ["strictCamelCase"], + "leadingUnderscore": "require" + }, + { + "selector": ["method"], + "modifiers": ["public"], + "format": ["strictCamelCase"] + }, + // Private methods + { + "selector": ["method"], + "modifiers": ["private"], + "format": ["strictCamelCase"], + "leadingUnderscore": "require" + }, + { + "selector": ["method"], + "modifiers": ["protected"], + "format": ["strictCamelCase"], + "leadingUnderscore": "require" + }, + // Top Level Methods + // const func: Function + // allow PascalCase for react components + { + "selector": ["variable"], + "modifiers": ["global"], + "types": ["function"], + "format": ["strictCamelCase", "StrictPascalCase"], + "leadingUnderscore": "allow" + }, + // function something() { } + { + "selector": ["function"], + "modifiers": ["global"], + "format": ["strictCamelCase"], + "leadingUnderscore": "require" + }, + // export const func: Function + { + "selector": ["variable"], + "modifiers": ["exported"], + "types": ["function"], + "format": ["strictCamelCase", "StrictPascalCase"], + "leadingUnderscore": "forbid" + }, + // export function something() { } + { + "selector": ["function"], + "modifiers": ["exported"], + "format": ["strictCamelCase", "StrictPascalCase"], + "leadingUnderscore": "forbid" + }, + // Top Level Variables + { + "selector": ["variable"], + "modifiers": ["global", "const"], + "types": ["boolean", "string", "number"], + "format": ["UPPER_CASE"] + }, + { + "selector": ["variable"], + "modifiers": ["global"], + "format": ["strictCamelCase"], + "leadingUnderscore": "require" + }, + { + "selector": ["variable"], + "modifiers": ["exported"], + "format": ["strictCamelCase"] + }, + // types, enums + { + "selector": "typeLike", + "format": ["PascalCase"] + }, + { + "selector": "variableLike", + "format": ["strictCamelCase"] + } + ], + "react/self-closing-comp": "warn", + "no-restricted-syntax": [ + "warn", + { + "selector": ":matches(PropertyDefinition)[accessibility!='private'][accessibility!='protected'][key.name!='constructor']", + "message": "Use private instead, please implement getter or setXxx for external read and write requirements" + } + ] + } + }, + { + "files": ["*.ts", "*.tsx"], + "extends": ["plugin:@nrwl/nx/typescript"], + "rules": { + "prefer-const": "warn", + "no-console": ["warn", { "allow": ["warn", "error"] }], + "@typescript-eslint/ban-ts-comment": "warn", + "@typescript-eslint/no-empty-interface": "warn", + "@typescript-eslint/no-empty-function": "warn", + // https://github.com/nrwl/nx/issues/10445 + "react/jsx-key": "error", + "import/no-default-export": "warn", + "import/no-duplicates": "warn", + "max-lines": [ + "warn", + { "max": 300, "skipComments": true, "skipBlankLines": true } + ] + } + }, + { + "files": ["*.js", "*.jsx"], + "extends": ["plugin:@nrwl/nx/javascript"], + "rules": {} + } + ] +} diff --git a/.free.env b/.free.env new file mode 100644 index 0000000000..24b1b20ec4 --- /dev/null +++ b/.free.env @@ -0,0 +1 @@ +NX_FREE_LOGIN=true diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000000..22f66396d3 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,47 @@ +# About code owners + +# You can use a CODEOWNERS file to define individuals or teams that are responsible for code in a repository. + +# See https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners + + +# ================= +# configs +# ================= + +.* @darkskygit +babel.config.json @darkskygit +nx.json @darkskygit +tsconfig.base.json @darkskygit +**/project.json @darkskygit +**/tsconfig.json @darkskygit +**/tsconfig.*.json @darkskygit +**/.babelrc @darkskygit +**/babel.config.js @darkskygit +**/.* @darkskygit + +# ================= +# components +# ================= + +# editor-core +libs/components/editor-core @lawvs + +# editor-blocks + +# group block +libs/components/editor-blocks/src/blocks/group @lawvs +# todo block +libs/components/editor-blocks/src/blocks/todo @lawvs + +libs/framework/virgo @SaikaSakura + +# ================= +# datasource +# ================= + +# feature flags +libs/datasource/feature-flags @lawvs + +# jwt +libs/datasource/jwt @darkskygit diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000000..8266d460df --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,62 @@ +name: Lint + +on: + push: + branches: [master] + pull_request: + branches: [master] + +# Cancels all previous workflow runs for pull requests that have not completed. +# See https://docs.github.com/en/actions/using-jobs/using-concurrency +concurrency: + # The concurrency group contains the workflow name and the branch name for + # pull requests or the commit hash for any other events. + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} + cancel-in-progress: true + +jobs: + main: + strategy: + matrix: + node-version: [16] + os: [ubuntu-latest] + runs-on: ${{ matrix.os }} + # TODO Remove the next line after cleaning all errors + continue-on-error: true + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Use pnpm + uses: pnpm/action-setup@v2 + with: + version: 7 + + - name: Use Node.js ${{ matrix.node-version }} + # https://github.com/actions/setup-node + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'pnpm' + + - name: Install node modules + run: pnpm install + + - name: Lint + if: always() + run: pnpm run lint:with-cache + + # - name: Check + # if: always() + # run: pnpm run check + + # - name: Format Check + # if: always() + # run: pnpm run format:ci + + # - name: Build + # run: pnpm run build + + # - name: Test + # run: pnpm run test diff --git a/.github/workflows/lisa.yml b/.github/workflows/lisa.yml new file mode 100644 index 0000000000..878fad6274 --- /dev/null +++ b/.github/workflows/lisa.yml @@ -0,0 +1,59 @@ +name: Build Lisa + +on: + push: + branches: [master] + pull_request: + branches: [master] + +# Cancels all previous workflow runs for pull requests that have not completed. +# See https://docs.github.com/en/actions/using-jobs/using-concurrency +concurrency: + # The concurrency group contains the workflow name and the branch name for + # pull requests or the commit hash for any other events. + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} + cancel-in-progress: true + +env: + REGISTRY: ghcr.io + NAMESPACE: toeverything + LISA_IMAGE_NAME: lisa + IMAGE_TAG: canary-${{ github.sha }} + IMAGE_TAG_LATEST: nightly-latest + +jobs: + ligo-virgo: + runs-on: self-hosted + environment: development + permissions: + contents: read + packages: write + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Log in to the Container registry + uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker (lisa) + id: meta_lisa + uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 + with: + images: ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/${{ env.LISA_IMAGE_NAME }} + tags: | + ${{ env.IMAGE_TAG }} + ${{ env.IMAGE_TAG_LATEST }} + + - name: Build and push Docker image (lisa) + uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc + with: + context: . + push: ${{ github.ref == 'refs/heads/master' && true || false }} + tags: ${{ steps.meta_lisa.outputs.tags }} + labels: ${{ steps.meta_lisa.outputs.labels }} + target: lisa diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..7b5e08b2c5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,45 @@ +# See http://help.github.com/ignore-files/ for more about ignoring files. + +# compiled output +*dist +/tmp +/out-tsc + +# dependencies +node_modules + +# IDEs and editors +/.idea +.project +.classpath +.c9/ +*.launch +.settings/ +*.sublime-workspace + +# IDE - VSCode +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json + +# misc +/.sass-cache +/connect.lock +/coverage +/libpeerconnection.log +npm-debug.log +yarn-error.log +testem.log +.pnpm-debug.log +/typings + +# System Files +.DS_Store +Thumbs.db + +# env +*.env.local +*.local.env +.history diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000000..deb953a84e --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,8 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +# npx lint-staged + +pnpm run lint:with-cache +pnpm run check +pnpm run format:ci diff --git a/.husky/pre-push b/.husky/pre-push new file mode 100755 index 0000000000..741e9183e4 --- /dev/null +++ b/.husky/pre-push @@ -0,0 +1,14 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +# Show just the current branch in Git +# See https://stackoverflow.com/questions/1417957/show-just-the-current-branch-in-git/1418022#1418022 +current_branch=$(git rev-parse --abbrev-ref HEAD) + +default_branch="master" + +if test $current_branch != $default_branch; then + exit 0 +fi + +npm run type:check diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000000..c74aa6aa6a --- /dev/null +++ b/.npmrc @@ -0,0 +1,3 @@ +registry=https://registry.npmjs.org +engine-strict=true +auto-install-peers=true \ No newline at end of file diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000000..07db99c705 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,15 @@ +# Add files here to ignore them from prettier formatting + +/dist +/coverage +pnpm-lock.yaml + +# Editoe assets +apps/editoe/src/app/assets/svg + +# Automatically generated from Figma +libs/components/icons/src/auto-icons +libs/components/common/src/lib/icon + +# DevOps +.github/** diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000000..babd1d0f73 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,6 @@ +{ + "singleQuote": true, + "trailingComma": "es5", + "tabWidth": 4, + "arrowParens": "avoid" +} diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000000..1a96379941 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,11 @@ +{ + "recommendations": [ + "mikestead.dotenv", + "esbenp.prettier-vscode", + "visualstudioexptteam.vscodeintellicode", + "nrwl.angular-console", + "firsttris.vscode-jest-runner", + "dbaeumer.vscode-eslint", + "streetsidesoftware.code-spell-checker" + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000000..2c3dd39eb0 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,41 @@ +{ + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.formatOnSave": true, + "editor.formatOnSaveMode": "file", + "prettier.prettierPath": "./node_modules/prettier", + "cSpell.words": [ + "Backlinks", + "blockdb", + "booktitle", + "Cascader", + "clsx", + "cssmodule", + "datasource", + "fflate", + "groq", + "howpublished", + "immer", + "inbook", + "incollection", + "inproceedings", + "Kanban", + "keyval", + "ligo", + "lozad", + "mastersthesis", + "nrwl", + "phdthesis", + "pnpm", + "reindex", + "ROOTNODE", + "techreport", + "tldr", + "tldraw", + "tldtaw", + "toeverything", + "Unstyled", + "unversioned", + "uuidv", + "webm" + ] +} diff --git a/Caddyfile b/Caddyfile new file mode 100644 index 0000000000..172d92f0ae --- /dev/null +++ b/Caddyfile @@ -0,0 +1,39 @@ +:80 { + reverse_proxy /api/* keck:3001 + @websockets { + path /collaboration/* + } + reverse_proxy @websockets keck:3000 + reverse_proxy /* lisa:3001 { + header_up Host lisa:3001 + } +} + +http://lisa:3001 { + root /* ./dist + + file_server { + precompressed br + } + + encode { + zstd + gzip 9 + } + + @notStatic { + not path /*.css + not path /*.js + not path /*.png + not path /*.jpg + not path /*.svg + not path /*.ttf + not path /*.eot + not path /*.woff + not path /*.woff2 + } + + handle @notStatic { + try_files {path} /index.html + } +} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000..f6e2249faf --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +FROM node:16-alpine as builder +WORKDIR /app +COPY . . +RUN apk add g++ make python3 git +RUN npm i -g pnpm@7 && pnpm i --frozen-lockfile --store=node_modules/.pnpm-store && pnpm run build + +FROM node:16-alpine as relocate +WORKDIR /app +COPY --from=builder /app/dist/apps/ligo-virgo ./dist +COPY --from=builder /app/Caddyfile ./ +RUN rm ./dist/*.txt + +# ============= +# lisa image +# ============= +FROM caddy:2.4.6-alpine as lisa +WORKDIR /app +COPY --from=relocate /app . + +EXPOSE 3000 +CMD ["caddy", "run"] \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000..296f81d87a --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Toeverything Technology (Hangzhou) Co., Ltd. and its affiliates. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000000..147ed616eb --- /dev/null +++ b/README.md @@ -0,0 +1,109 @@ +# AFFiNE + + + +[![All Contributors](https://img.shields.io/badge/all_contributors-11-orange.svg?style=flat-square)](#contributors-) + + + +Workspace for AFFiNE + +## Installation + +```sh +# Clone the repo +git clone git@github.com:toeverything/AFFiNE.git +``` + +Once cloned, switch to the master branch and navigate to the folder by typing `cd AFFiNE` and then running the following commands: + +```sh +# Install all project dependencies +npm i -g pnpm +pnpm i + +# Start the project +pnpm start +open http://localhost:4200/ +``` + +This project uses pnpm for package management and is built based on nx. It is recommended to install the [nx console](https://marketplace.visualstudio.com/items?itemName=nrwl.angular-console) plugin to create dependencies + +**If it is development, you can add environment variables in the project directory .env.local file** + +``` +NODE_ENV=development +``` + +## Scripts + +1. Create react dependency library: `pnpm run add:library` +2. Create react components: `pnpm run add:components` +3. Create a data source: `pnpm run add:datasource` +4. Unit testing: `pnpm test` +5. Compile specific components + - `pnpm build/test/lint `project name + - Project name reference workspace.json +6. Create react/node program: use nx console +7. If you need to use the git cz function, please install it globally first commitizen `npm install -g commitizen conventional-changelog conventional-changelog-cli` + +## Examples + +Have a look at [the examples to see AFFiNE in action](https://app.affine.pro/). + +## Contributing + +- Generic functional components (such as ui components) are placed in `libs/components/common` + - components within common are not allowed to reference _components_ except utils and dependencies + - Common components can reference each other +- Business components are placed in `libs/components` +- The data source component is placed in `libs/datasource` - api request code, schema, etc. belong to the data source + Please see [CONTRIBUTING](/docs/CONTRIBUTING.md) + +## Documentation + +- [how-to-write-css-in-affine.md](/docs/how-to-write-css-in-affine.md) +- [how-to-add-ui-component-in-affine.md](/docs/how-to-add-ui-component-in-affine.md) +- [how-to-customize-rollup-config.md](docs/how-to-customize-rollup-config.md) +- [how-to-auto-download-figma-assets-in-affine.md](docs/how-to-auto-download-figma-assets-in-affine.md) +- [affine-icons-user-guide.md](docs/affine-icons-user-guide.md) + +## Community + +For help, discussion about best practices, or any other conversation that would benefit from being searchable: + +[Discuss AFFiNE on GitHub](https://github.com/toeverything/AFFiNE/discussions) + +## Contributors + + + + + + + + + + + + + + + + + + + + +

DarkSky

💻 📖

Chi Zhang

💻 📖

alt1o

💻 📖

Diamond

💻 📖

Whitewater

💻 📖

zuoxiaodong0815

💻 📖

SaikaSakura

💻 📖

Qi

💻 📖

tuluffy

💻 📖

Austaras

💻 📖

Jin Yao

💻 📖
+ + + + + + +## License + +AFFiNE is distributed under the terms of MIT license. + +See LICENSE for details. diff --git a/apps/.gitkeep b/apps/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/apps/ligo-virgo/.babelrc b/apps/ligo-virgo/.babelrc new file mode 100644 index 0000000000..f0aa1cb969 --- /dev/null +++ b/apps/ligo-virgo/.babelrc @@ -0,0 +1,11 @@ +{ + "presets": [ + [ + "@nrwl/react/babel", + { + "runtime": "automatic" + } + ] + ], + "plugins": [] +} diff --git a/apps/ligo-virgo/.browserslistrc b/apps/ligo-virgo/.browserslistrc new file mode 100644 index 0000000000..f1d12df4fa --- /dev/null +++ b/apps/ligo-virgo/.browserslistrc @@ -0,0 +1,16 @@ +# This file is used by: +# 1. autoprefixer to adjust CSS to support the below specified browsers +# 2. babel preset-env to adjust included polyfills +# +# For additional information regarding the format and rule options, please see: +# https://github.com/browserslist/browserslist#queries +# +# If you need to support different browsers in production, you may tweak the list below. + +last 1 Chrome version +last 1 Firefox version +last 2 Edge major versions +last 2 Safari major version +last 2 iOS major versions +Firefox ESR +not IE 9-11 # For IE 9-11 support, remove 'not'. \ No newline at end of file diff --git a/apps/ligo-virgo/.eslintrc.json b/apps/ligo-virgo/.eslintrc.json new file mode 100644 index 0000000000..1f5ec76fbb --- /dev/null +++ b/apps/ligo-virgo/.eslintrc.json @@ -0,0 +1,18 @@ +{ + "extends": ["plugin:@nrwl/nx/react", "../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], + "rules": {} + }, + { + "files": ["*.ts", "*.tsx"], + "rules": {} + }, + { + "files": ["*.js", "*.jsx"], + "rules": {} + } + ] +} diff --git a/apps/ligo-virgo/jest.config.js b/apps/ligo-virgo/jest.config.js new file mode 100644 index 0000000000..5b49bd23dc --- /dev/null +++ b/apps/ligo-virgo/jest.config.js @@ -0,0 +1,12 @@ +module.exports = { + displayName: 'ligo-virgo', + preset: '../../jest.preset.js', + transform: { + 'node_modules\\/.+\\.js$': 'jest-esm-transformer', + '^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nrwl/react/plugins/jest', + '^.+\\.[tj]sx?$': 'babel-jest', + }, + moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'], + coverageDirectory: '../../coverage/apps/ligo-virgo', + transformIgnorePatterns: [], +}; diff --git a/apps/ligo-virgo/package.json b/apps/ligo-virgo/package.json new file mode 100644 index 0000000000..54c68924c5 --- /dev/null +++ b/apps/ligo-virgo/package.json @@ -0,0 +1,20 @@ +{ + "name": "ligo-virgo", + "version": "1.0.0", + "license": "MIT", + "description": "", + "main": "jest.config.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "AFFiNE ", + "dependencies": { + "@mui/icons-material": "^5.8.4" + }, + "devDependencies": { + "firebase": "^9.8.4", + "mini-css-extract-plugin": "^2.6.1", + "webpack": "^5.73.0" + } +} diff --git a/apps/ligo-virgo/project.json b/apps/ligo-virgo/project.json new file mode 100644 index 0000000000..ad3444c4a4 --- /dev/null +++ b/apps/ligo-virgo/project.json @@ -0,0 +1,75 @@ +{ + "sourceRoot": "apps/ligo-virgo/src", + "projectType": "application", + "targets": { + "build": { + "executor": "@nrwl/web:webpack", + "outputs": ["{options.outputPath}"], + "defaultConfiguration": "production", + "options": { + "compiler": "babel", + "outputPath": "dist/apps/ligo-virgo", + "index": "apps/ligo-virgo/src/index.html", + "baseHref": "/", + "main": "apps/ligo-virgo/src/index.tsx", + "polyfills": "apps/ligo-virgo/src/polyfills.ts", + "tsConfig": "apps/ligo-virgo/tsconfig.app.json", + "assets": ["apps/ligo-virgo/src/assets"], + "styles": [], + "scripts": [], + "webpackConfig": "apps/ligo-virgo/webpack.config.js" + }, + "configurations": { + "production": { + "fileReplacements": [ + { + "replace": "apps/ligo-virgo/src/environments/environment.ts", + "with": "apps/ligo-virgo/src/environments/environment.prod.ts" + } + ], + "optimization": true, + "outputHashing": "all", + "sourceMap": false, + "namedChunks": true, + "extractLicenses": false, + "vendorChunk": false, + "generateIndexHtml": false + } + } + }, + "serve": { + "executor": "@nrwl/web:dev-server", + "options": { + "buildTarget": "ligo-virgo:build:development", + "hmr": true, + "proxyConfig": "apps/ligo-virgo/proxy.conf.json", + "open": true + }, + "configurations": { + "production": { + "buildTarget": "ligo-virgo:build:production", + "hmr": false + } + } + }, + "lint": { + "executor": "@nrwl/linter:eslint", + "outputs": ["{options.outputFile}"], + "options": { + "lintFilePatterns": ["apps/ligo-virgo/**/*.{ts,tsx,js,jsx}"] + } + }, + "test": { + "executor": "@nrwl/jest:jest", + "outputs": ["coverage/apps/ligo-virgo"], + "options": { + "jestConfig": "apps/ligo-virgo/jest.config.js", + "passWithNoTests": true + } + }, + "check": { + "executor": "./tools/executors/tsCheck:tsCheck" + } + }, + "tags": ["app:ligo-virgo"] +} diff --git a/apps/ligo-virgo/proxy.conf.json b/apps/ligo-virgo/proxy.conf.json new file mode 100644 index 0000000000..8dc733b877 --- /dev/null +++ b/apps/ligo-virgo/proxy.conf.json @@ -0,0 +1,13 @@ +{ + "/api": { + "target": "https://nightly.affine.pro/", + "secure": false, + "changeOrigin": true + }, + "/collaboration": { + "target": "https://canary.affine.pro", + "ws": true, + "changeOrigin": true, + "secure": false + } +} diff --git a/apps/ligo-virgo/src/assets/.gitkeep b/apps/ligo-virgo/src/assets/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/apps/ligo-virgo/src/assets/images/favicon.ico b/apps/ligo-virgo/src/assets/images/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..b972ff61ccec034fe2aad7e5a847a9840c00ebe0 GIT binary patch literal 23462 zcmeHP4TuzF82(P9tEjI3AA-&hqB1Os5cTGVQ=*WHC@C_`=+~d!nKiMZ;x;NI`jaRz zA}Xk`s6e8mh&rO8h?25XZ-4GCG*N@Ru)0gnot}4hM|aoRxqaW6*}YwEWNzR6=KbF1 zd7t^&Z{GPvrP}as!2*T9)708UN}Z*Yx(F+p)Hk|4b?{sX$XG zkcw;fr!76pT~oIHOd}FZ$F6M$*FG*^_@@SK^OPW*)3NU9h~o&>KfX+w#{|Ka^iA2? z0s&Xb?=uNrWgo=(L476f z9MiUTvtL~9wv1)mBjJ&;wWqmQ5`QPDrhwn?0*-&}NX$N7f?2K4Z%eyQ1&>hymw{?A z!)(VsnJeIi^UruaOdf75aM>u~(;w@)%#9J%XF9GuC*hWk=~qX=DHGRj74fmO$D`m= z8WX%|yv!X3?u}{;xa;04PXM3&0!~{>^9tL>wfPDGCkNx!NXIl7>%Ar6)xW}|@<${~ zDy}~%;e>JH>_`X|gNpAVZ0+HwctNMFY^`iS0tf1df2YF1wB@;I<4T@b$|NexbN%-L!Y}XQ>;{zU>1zdjN zUu~{cev4MHF0COb!;QS6LW*Gej zmzn2)H@g;(eT-QHvITgb2()@nh8AwGl%;>p=5FinN?6db0j&SHc$v6yqXaMPKHz;9 zmplCTOX}QdTVEu=3caQ-)sU_|;6EbB;d(A6J)dIZ;Q1;SCrW>uhaYltz?_FSIGl=g z*}vI133EONCu(1e;TLjqfd9U}iOKemONY^)EckhY6bt@G-tz&QSDP$ z=g&r6Q?JH%y!K)(em7Sysr7q^kyk<&|Dt>FKHA7}Agp~T!7esLSU zO*pS$hu^t^>vOk2|ILloVmy3lEk0`*S5=D*o!E1QFi&rFwRjV$9l5O$90zN>auCiH z%F%NRuXq!!ZNSoI3baaj<$=239B!5M za6Nv6onu_@spN$i+_^#rGppv%t2Rxu3@q>NM4qf#Jnp}LE=^D}R|qjaE{)MFHnd_t zzss)dy3ox}Hdjcy-R<8@pO^<2kT6ZRxs!e7VnCz9Y`Uxk4Kn znQu^R)O9$UGr)pb6uJC8E^IhbF2Lr}hr?2r1u5^l~Z%ZQ`TPt1P%sBY89T!UhZ zYVmQspQ#g$DdW|kTqi<*b#UA5E;gXU3>{^DAE z&BvDUd_D507Y4oe64iO=SI?r*d{ zN^$7@m+^CFzJG*w0ZK7i#isXPLe}cXR?)^Q4``JROD~$U?S;`QZS)>YNLuBnM%F62 zc;$h)F&BrTm96)B#c#DXs(%L63o-6%HC?>&fldzv)at;t3|uVI2EPv*j2j zUmRQOp%u+p7=Wlld&chm{g#76mZ;SNGaEJD(xg~8ddGoo>V<#caYs%X%D;Y zhT{yYPVyO274}d`J2sLJTpe=sv;jixfOH7Z(@qkOa>i7<1A--X+Ywt8?3|kFIA!+K zypMx++D36`d%4|SXiv7~G4ejZA-p4YN5SqbaLu=aFY!KNcNXj+)k8Vw+mUy&Kp$<7sSZ#rw3FRdv~#MxnoSbrxj~dF_7sx3;FDBUZS1mw zPp_ig=V|A6Jsn`!TFo}xzQc+Rr$QXqJ+3`k-F94`F;zrCOSuh6iZOH8^WHWjDf-Zn S;%!3`*C$zGqxEpRm;FCXu}o3` literal 0 HcmV?d00001 diff --git a/apps/ligo-virgo/src/custom-formatter.ts b/apps/ligo-virgo/src/custom-formatter.ts new file mode 100644 index 0000000000..18bb39a229 --- /dev/null +++ b/apps/ligo-virgo/src/custom-formatter.ts @@ -0,0 +1,60 @@ +import { AsyncBlock } from '@toeverything/framework/virgo'; +import { isDev } from '@toeverything/utils'; + +/** + * Ported from https://github.com/vuejs/core/blob/main/packages/runtime-core/src/customFormatter.ts + * See [Custom Object Formatters in Chrome DevTools](https://docs.google.com/document/d/1FTascZXT9cxfetuPRT2eXPQKXui4nWFivUnS_335T3U) + */ + +const isAsyncBlock = (x: unknown): x is AsyncBlock => { + return x instanceof AsyncBlock; +}; + +export function initCustomFormatter() { + if (!isDev || typeof window === 'undefined') { + return; + } + + const bannerStyle = { + style: 'color: #eee; background: #3F6FDB; margin-right: 5px; padding: 2px; border-radius: 4px', + }; + const typeStyle = { + style: 'color: #eee; background: #DB6D56; margin-right: 5px; padding: 2px; border-radius: 4px', + }; + + // custom formatter for Chrome + // https://www.mattzeunert.com/2016/02/19/custom-chrome-devtools-object-formatters.html + const formatter = { + header(obj: unknown, config = { expand: false }) { + if (!isAsyncBlock(obj) || config.expand) { + return null; + } + + return [ + 'div', + {}, + ['span', bannerStyle, 'AsyncBlock'], + ['span', typeStyle, obj.type], + // @ts-expect-error Debug at development environment + `${JSON.stringify(obj.raw_data.properties)}`, + ]; + }, + hasBody(obj: unknown) { + return true; + }, + body(obj: unknown) { + return ['object', { object: obj, config: { expand: true } }]; + }, + }; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + if ((window as any).devtoolsFormatters) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (window as any).devtoolsFormatters.push(formatter); + } else { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (window as any).devtoolsFormatters = [formatter]; + } +} + +initCustomFormatter(); diff --git a/apps/ligo-virgo/src/environments/environment.prod.ts b/apps/ligo-virgo/src/environments/environment.prod.ts new file mode 100644 index 0000000000..da7c84f638 --- /dev/null +++ b/apps/ligo-virgo/src/environments/environment.prod.ts @@ -0,0 +1,3 @@ +export const environment = { + production: true, +}; diff --git a/apps/ligo-virgo/src/environments/environment.ts b/apps/ligo-virgo/src/environments/environment.ts new file mode 100644 index 0000000000..855830c238 --- /dev/null +++ b/apps/ligo-virgo/src/environments/environment.ts @@ -0,0 +1,6 @@ +// This file can be replaced during build by using the `fileReplacements` array. +// When building for production, this file is replaced with `environment.prod.ts`. + +export const environment = { + production: false, +}; diff --git a/apps/ligo-virgo/src/index.html b/apps/ligo-virgo/src/index.html new file mode 100644 index 0000000000..1291a10917 --- /dev/null +++ b/apps/ligo-virgo/src/index.html @@ -0,0 +1,16 @@ + + + + + + + + Affine | Local Dev Environment + + + +
+ + diff --git a/apps/ligo-virgo/src/index.tsx b/apps/ligo-virgo/src/index.tsx new file mode 100644 index 0000000000..9380c370bc --- /dev/null +++ b/apps/ligo-virgo/src/index.tsx @@ -0,0 +1,28 @@ +/* eslint-disable filename-rules/match */ +import { StrictMode } from 'react'; +import { createRoot } from 'react-dom/client'; +import { BrowserRouter } from 'react-router-dom'; + +import { ThemeProvider } from '@toeverything/components/ui'; +import { FeatureFlagsProvider } from '@toeverything/datasource/feature-flags'; + +import './custom-formatter'; +import { LigoVirgoRoutes } from './pages'; +import './styles.css'; + +const container = document.getElementById('root'); +if (!container) { + throw new Error('No root container found'); +} +const root = createRoot(container); +root.render( + + + + + + + + + +); diff --git a/apps/ligo-virgo/src/pages/AppContainer.tsx b/apps/ligo-virgo/src/pages/AppContainer.tsx new file mode 100644 index 0000000000..b554cd0faa --- /dev/null +++ b/apps/ligo-virgo/src/pages/AppContainer.tsx @@ -0,0 +1,36 @@ +import { Outlet } from 'react-router-dom'; + +import { styled } from '@toeverything/components/ui'; +import { SettingsSidebar, LayoutHeader } from '@toeverything/components/layout'; + +export function LigoVirgoRootContainer() { + return ( + + + + + + + + + + ); +} + +const StyledMainContainer = styled('div')({ + flex: 'auto', + display: 'flex', +}); + +const StyledRootContainer = styled('div')({ + display: 'flex', + flexDirection: 'row', + height: '100vh', +}); + +const StyledContentContainer = styled('div')({ + flex: 'auto', + display: 'flex', + flexDirection: 'column', + overflow: 'hidden', +}); diff --git a/apps/ligo-virgo/src/pages/AppRoutes.tsx b/apps/ligo-virgo/src/pages/AppRoutes.tsx new file mode 100644 index 0000000000..8014a86a65 --- /dev/null +++ b/apps/ligo-virgo/src/pages/AppRoutes.tsx @@ -0,0 +1,64 @@ +import { Routes, Route, Navigate } from 'react-router-dom'; + +import Agenda from './agenda'; +import { WorkspaceContainer } from './workspace'; +import Recent from './recent'; +import Search from './search'; +import Settings from './settings'; +import Shared from './shared'; +import Starred from './starred'; +import { Login } from './account'; +import { PageNotFound } from './status/page-not-found'; +import { WorkspaceNotFound } from './status/workspace-not-found'; +import { RoutePrivate } from './RoutePrivate'; +import { RoutePublicAutoLogin } from './RoutePublicAutoLogin'; +import { Tools } from './tools'; +import { Templates } from './templates'; +import { LigoVirgoRootContainer } from './AppContainer'; +import { UIPage } from './ui'; + +export function LigoVirgoRoutes() { + return ( + + }> + } /> + } + /> + + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + + + + } + /> + } /> + + + {/* put public routes here; header and sidebar are disabled here */} + + } /> + + + + } + /> + } /> + + + ); +} diff --git a/apps/ligo-virgo/src/pages/RoutePrivate.tsx b/apps/ligo-virgo/src/pages/RoutePrivate.tsx new file mode 100644 index 0000000000..58dcbe3db5 --- /dev/null +++ b/apps/ligo-virgo/src/pages/RoutePrivate.tsx @@ -0,0 +1,37 @@ +import { Navigate, useLocation } from 'react-router-dom'; + +import { PageLoading, Error } from '@toeverything/components/account'; +import { useUserAndSpaces } from '@toeverything/datasource/state'; + +export type RoutePrivateProps = { + children: JSX.Element; + unauthorizedRedirectTo?: string; +}; + +/** + * A routing component that cannot be accessed without logging in, and can only be accessed after logging in. + */ +export function RoutePrivate({ + children, + unauthorizedRedirectTo = '/login', +}: RoutePrivateProps) { + const { pathname } = useLocation(); + + const { user, loading } = useUserAndSpaces(); + + if (user == null && loading) { + return ; + } + + if (!user) { + return ( + + ); + } + + return children; +} diff --git a/apps/ligo-virgo/src/pages/RoutePublicAutoLogin.tsx b/apps/ligo-virgo/src/pages/RoutePublicAutoLogin.tsx new file mode 100644 index 0000000000..c200455ea7 --- /dev/null +++ b/apps/ligo-virgo/src/pages/RoutePublicAutoLogin.tsx @@ -0,0 +1,33 @@ +import { Navigate, useLocation } from 'react-router-dom'; + +import { PageLoading } from '@toeverything/components/account'; +import { useUserAndSpaces } from '@toeverything/datasource/state'; + +export type RouteUnauthorizedOnlyProps = { + children: JSX.Element; +}; + +/** + * Routing components that are accessible without logging in and inaccessible after logging in will automatically jump to the specified route authorizedRedirectTo + */ +export function RoutePublicAutoLogin({ children }: RouteUnauthorizedOnlyProps) { + const { pathname } = useLocation(); + + const { user, loading, currentSpaceId } = useUserAndSpaces(); + + if (user == null && loading) { + return ; + } + + if (currentSpaceId) { + return ( + + ); + } + + return children; +} diff --git a/apps/ligo-virgo/src/pages/account/index.ts b/apps/ligo-virgo/src/pages/account/index.ts new file mode 100644 index 0000000000..42f6bc2be2 --- /dev/null +++ b/apps/ligo-virgo/src/pages/account/index.ts @@ -0,0 +1,3 @@ +import { Login } from '@toeverything/components/account'; + +export { Login }; diff --git a/apps/ligo-virgo/src/pages/agenda/calendar/index.tsx b/apps/ligo-virgo/src/pages/agenda/calendar/index.tsx new file mode 100644 index 0000000000..e7b3d6f7ab --- /dev/null +++ b/apps/ligo-virgo/src/pages/agenda/calendar/index.tsx @@ -0,0 +1,3 @@ +export default function AgendaCalendar() { + return AgendaCalendar; +} diff --git a/apps/ligo-virgo/src/pages/agenda/container/index.tsx b/apps/ligo-virgo/src/pages/agenda/container/index.tsx new file mode 100644 index 0000000000..02d8378b64 --- /dev/null +++ b/apps/ligo-virgo/src/pages/agenda/container/index.tsx @@ -0,0 +1,18 @@ +import { Outlet } from 'react-router-dom'; +import style9 from 'style9'; + +import { MuiBox as Box } from '@toeverything/components/ui'; + +const styles = style9.create({ + container: { + display: 'flex', + }, +}); + +export default function AgendaRootContainer() { + return ( + + + + ); +} diff --git a/apps/ligo-virgo/src/pages/agenda/home/index.tsx b/apps/ligo-virgo/src/pages/agenda/home/index.tsx new file mode 100644 index 0000000000..62b446f568 --- /dev/null +++ b/apps/ligo-virgo/src/pages/agenda/home/index.tsx @@ -0,0 +1,3 @@ +export default function AgendaHome() { + return AgendaHome; +} diff --git a/apps/ligo-virgo/src/pages/agenda/index.tsx b/apps/ligo-virgo/src/pages/agenda/index.tsx new file mode 100644 index 0000000000..23f478ad5f --- /dev/null +++ b/apps/ligo-virgo/src/pages/agenda/index.tsx @@ -0,0 +1,20 @@ +import { Routes, Route } from 'react-router-dom'; + +import Container from './container'; +import Calendar from './calendar'; +import Tasks from './tasks'; +import Today from './today'; +import Home from './home'; + +export default function AgendaContainer() { + return ( + + }> + } /> + } /> + } /> + } /> + + + ); +} diff --git a/apps/ligo-virgo/src/pages/agenda/tasks/index.tsx b/apps/ligo-virgo/src/pages/agenda/tasks/index.tsx new file mode 100644 index 0000000000..b51d401977 --- /dev/null +++ b/apps/ligo-virgo/src/pages/agenda/tasks/index.tsx @@ -0,0 +1,3 @@ +export default function AgendaTasks() { + return AgendaTasks; +} diff --git a/apps/ligo-virgo/src/pages/agenda/today/index.tsx b/apps/ligo-virgo/src/pages/agenda/today/index.tsx new file mode 100644 index 0000000000..fa0f454e4c --- /dev/null +++ b/apps/ligo-virgo/src/pages/agenda/today/index.tsx @@ -0,0 +1,3 @@ +export default function AgendaToday() { + return AgendaToday; +} diff --git a/apps/ligo-virgo/src/pages/index.ts b/apps/ligo-virgo/src/pages/index.ts new file mode 100644 index 0000000000..c5bf888a85 --- /dev/null +++ b/apps/ligo-virgo/src/pages/index.ts @@ -0,0 +1 @@ +export { LigoVirgoRoutes } from './AppRoutes'; diff --git a/apps/ligo-virgo/src/pages/recent/index.tsx b/apps/ligo-virgo/src/pages/recent/index.tsx new file mode 100644 index 0000000000..9cf390d1ee --- /dev/null +++ b/apps/ligo-virgo/src/pages/recent/index.tsx @@ -0,0 +1,3 @@ +export default function Recent() { + return Recent; +} diff --git a/apps/ligo-virgo/src/pages/search/index.tsx b/apps/ligo-virgo/src/pages/search/index.tsx new file mode 100644 index 0000000000..135fd58187 --- /dev/null +++ b/apps/ligo-virgo/src/pages/search/index.tsx @@ -0,0 +1,3 @@ +export default function Search() { + return Search; +} diff --git a/apps/ligo-virgo/src/pages/settings/index.tsx b/apps/ligo-virgo/src/pages/settings/index.tsx new file mode 100644 index 0000000000..803a6e29c8 --- /dev/null +++ b/apps/ligo-virgo/src/pages/settings/index.tsx @@ -0,0 +1,3 @@ +export default function Settings() { + return Settings; +} diff --git a/apps/ligo-virgo/src/pages/shared/index.tsx b/apps/ligo-virgo/src/pages/shared/index.tsx new file mode 100644 index 0000000000..051e879ca0 --- /dev/null +++ b/apps/ligo-virgo/src/pages/shared/index.tsx @@ -0,0 +1,3 @@ +export default function Shared() { + return Shared; +} diff --git a/apps/ligo-virgo/src/pages/starred/index.tsx b/apps/ligo-virgo/src/pages/starred/index.tsx new file mode 100644 index 0000000000..d2f36fe762 --- /dev/null +++ b/apps/ligo-virgo/src/pages/starred/index.tsx @@ -0,0 +1,3 @@ +export default function Starred() { + return Starred; +} diff --git a/apps/ligo-virgo/src/pages/status/page-not-found.tsx b/apps/ligo-virgo/src/pages/status/page-not-found.tsx new file mode 100644 index 0000000000..9409610702 --- /dev/null +++ b/apps/ligo-virgo/src/pages/status/page-not-found.tsx @@ -0,0 +1,7 @@ +import { Error } from '@toeverything/components/account'; + +export function PageNotFound() { + return ; +} + +export default PageNotFound; diff --git a/apps/ligo-virgo/src/pages/status/workspace-not-found.tsx b/apps/ligo-virgo/src/pages/status/workspace-not-found.tsx new file mode 100644 index 0000000000..b2a8f73344 --- /dev/null +++ b/apps/ligo-virgo/src/pages/status/workspace-not-found.tsx @@ -0,0 +1,13 @@ +import { Error } from '@toeverything/components/account'; + +export function WorkspaceNotFound() { + return ( + + ); +} + +export default WorkspaceNotFound; diff --git a/apps/ligo-virgo/src/pages/templates/index.tsx b/apps/ligo-virgo/src/pages/templates/index.tsx new file mode 100644 index 0000000000..523091c3e2 --- /dev/null +++ b/apps/ligo-virgo/src/pages/templates/index.tsx @@ -0,0 +1,98 @@ +import { styled, ListButton } from '@toeverything/components/ui'; +import { TemplateData } from './template-data'; +import { useParams } from 'react-router-dom'; +import { AffineEditor } from '@toeverything/components/affine-editor'; +const TemplatesContainer = styled('div')({ + display: 'flex', + flexDirection: 'row', + backgroundColor: '#fff', + border: '1px solid #E2E7ED', + borderRadius: '5px', + margin: '0 auto', + '.sidebar': { + width: '240px', + display: 'flex', + borderRight: '1px solid #E2E7ED', + flexDirection: 'column', + color: 'rgba(55, 53, 47, 0.65)', + background: 'rgb(247, 246, 243)', + padding: '12px', + }, + '.preview-template': { + display: 'flex', + }, + '.sidebar-title': { + borderBottom: '1px solid #E2E7ED', + }, + '.sidebar-template-type': { + height: '600px', + overflowY: 'scroll', + ul: {}, + 'ul li': { + paddingLeft: '10px', + height: '32px', + lineHeight: '32px', + listStyle: 'none', + fontWeight: 600, + fontSize: '14px', + cursor: 'pointer', + '&:hover': { + background: '#eee', + }, + }, + }, + '.btn-use-this-template': { + background: '#eee', + color: '#fff', + ':hover': { + background: '#ccc', + }, + }, +}); + +interface ITemplateProps { + handleClickUseThisTemplate?: () => void; +} +function Templates(props: ITemplateProps) { + const handle_click_use_this_template = () => { + props.handleClickUseThisTemplate(); + }; + const { workspace_id, page_id } = useParams(); + return ( + +
+
+ +
+
+ {TemplateData.map((item, index) => { + return ( +
+ {item.name} +
    + {item.subList.map((item, index) => { + return
  • {item.name}
  • ; + })} +
+
+ ); + })} +
+
+
+ {page_id && ( + + )} +
+
+ ); +} + +export { Templates }; diff --git a/apps/ligo-virgo/src/pages/templates/template-data.ts b/apps/ligo-virgo/src/pages/templates/template-data.ts new file mode 100644 index 0000000000..7ca159a026 --- /dev/null +++ b/apps/ligo-virgo/src/pages/templates/template-data.ts @@ -0,0 +1,125 @@ +export const TemplateData = [ + { + name: 'Design', + subList: [ + { name: '🚘 Roadmap' }, + { name: '🔬 User Research Database' }, + { name: '🎒 Design Tasks' }, + { name: '✏️ Meeting Notes' }, + { name: '🖋️ Design System' }, + { name: '🎯 Company goals' }, + ], + }, + { + name: 'Student', + subList: [ + { name: '✏️ Class Notes' }, + { name: '🏗 Job Applications' }, + { name: '⚖️ Grade Calculator' }, + { name: '🏡 Club Homepage' }, + { name: '📚 Reading List' }, + { name: '📜 Thesis Planning' }, + { name: '📍 Cornell Notes System' }, + { name: '📇 Personal CRM' }, + { name: '✌️ Roommate Space' }, + { name: '💸 Simple Budget' }, + { name: '📄 Syllabus' }, + { name: '🏠 Classroom Home' }, + { name: '📋 Lesson Plans' }, + { name: '🗓 Course Schedule' }, + { name: '👋 Class Directory' }, + ], + }, + { + name: 'Engineering', + subList: [ + { name: '🎒 To-Do' }, + { name: '🚘 Roadmap' }, + { name: '📓 Engineering Wiki' }, + { name: '📎 Docs' }, + { name: '✏️ Meeting Notes' }, + { name: '🎯 Company goals' }, + ], + }, + { + name: 'Human resources', + subList: [ + { name: '💼 Job Board' }, + { name: '✏️ Meeting Notes' }, + { name: '🚂 New Hire Onboarding' }, + { name: '📮 Applicant Tracker' }, + { name: '🏠 Company Home' }, + ], + }, + { + name: 'Marketing', + subList: [ + { name: '🎨 Brand Assets' }, + { name: '✏️ Meeting Notes' }, + { name: '🎤 Media List' }, + { name: '📆 Content Calendar' }, + { name: '🎟️ Mood Board' }, + ], + }, + { + name: 'Personal', + subList: [ + { name: '📌 Quick Note' }, + { name: '🏠 Personal Home' }, + { name: '✔️ Task List' }, + { name: '🖊️ Journal' }, + { name: '📚 Reading List' }, + { name: '🏔️ Goals' }, + { name: '✈️ Travel Planner' }, + { name: '✏️ Blog Post' }, + { name: '📔 Simple Notebook' }, + { name: '👟 Habit Tracker' }, + { name: '🧭 Life Wiki' }, + { name: '👔 Resume' }, + { name: '📥 Job Applications' }, + { name: '📕 Weekly Agenda' }, + ], + }, + { + name: 'Other', + subList: [ + { name: '️📝 Meeting Notes' }, + { name: '📄 Docs' }, + { name: '🏠 Team Home' }, + { name: '☑️ Team Tasks' }, + { name: '✔️ Task List' }, + ], + }, + { + name: 'Product management', + subList: [ + { name: '🚘 Roadmap' }, + { name: ' User Research Database' }, + { name: '📎 Docs' }, + { name: '✏️ Meeting Notes' }, + { name: '🏗 Product Wiki' }, + { name: '🎯 Company goals' }, + ], + }, + { + name: 'Sales', + subList: [ + { name: '✏️ Meeting Notes' }, + { name: '👟 Sales CRM' }, + { name: '📕 Sales Wiki' }, + { name: '🎯 Competitive Analysis' }, + { name: '✌️ Sales Assets' }, + ], + }, + { + name: 'Support', + subList: [ + { name: '✌️ Team Directory' }, + { name: '❓ Product FAQs' }, + { name: '✏️ Meeting Notes' }, + { name: '🎒 Task List' }, + { name: '🚨 Help Center' }, + { name: '📎 Process Docs' }, + ], + }, +]; diff --git a/apps/ligo-virgo/src/pages/tools/container.tsx b/apps/ligo-virgo/src/pages/tools/container.tsx new file mode 100644 index 0000000000..11005e9fef --- /dev/null +++ b/apps/ligo-virgo/src/pages/tools/container.tsx @@ -0,0 +1,9 @@ +import { Outlet } from 'react-router-dom'; + +export function Container() { + return ( +
+ +
+ ); +} diff --git a/apps/ligo-virgo/src/pages/tools/icons/Icons.tsx b/apps/ligo-virgo/src/pages/tools/icons/Icons.tsx new file mode 100644 index 0000000000..55b66c5eb7 --- /dev/null +++ b/apps/ligo-virgo/src/pages/tools/icons/Icons.tsx @@ -0,0 +1,85 @@ +import { type FC, useRef } from 'react'; +import * as uiIcons from '@toeverything/components/icons'; +import { message, styled } from '@toeverything/components/ui'; +import { copy } from './copy'; + +const IconBooth: FC<{ name: string; Icon: FC }> = ({ name, Icon }) => { + const on_click = () => { + copy(`<${name} />`); + message.success({ + content: 'Copied.', + }); + }; + return ( + + + {name} + + ); +}; + +const _icons = Object.entries(uiIcons).filter(([key]) => key !== 'timestamp'); + +export const Icons: FC = () => { + const ref = useRef(null); + return ( + +

Example:

+
+ + {`import { TextIcon } from '@toeverything/components/ui'`}; + +
+

{`Total: ${_icons.length}`}

+
Click to copy.
+

{`Last Updated: ${new Date( + uiIcons.timestamp + ).toLocaleString()}`}

+
+ + {_icons.map(([key, icon]) => { + return ; + })} + +
+ ); +}; + +const Container = styled('div')({ + color: '#98ACBD', + padding: '20px', +}); + +const IconName = styled('div')({ + width: '100%', + marginTop: '8px', + wordBreak: 'break-all', +}); + +const IconContainer = styled('div')(({ theme }) => ({ + width: '112px', + borderRadius: '4px', + padding: '4px', + cursor: 'pointer', + textAlign: 'center', + '--color-0': theme.affine.palette.hover, + '--color-1': theme.affine.palette.icons, + + '& svg:first-of-type': { + boxShadow: '0 0 6px #e0e6eb', + }, + + '&:hover': { + backgroundColor: '#F5F7F8', + }, +})); + +const IconsContainer = styled('div')({ + display: 'grid', + gridTemplateColumns: 'repeat(auto-fill,112px)', + justifyContent: 'justify', + alignContent: 'start', + columnGap: '16px', + rowGap: '24px', + marginTop: '24px', +}); diff --git a/apps/ligo-virgo/src/pages/tools/icons/copy.ts b/apps/ligo-virgo/src/pages/tools/icons/copy.ts new file mode 100644 index 0000000000..ed9e1b0b90 --- /dev/null +++ b/apps/ligo-virgo/src/pages/tools/icons/copy.ts @@ -0,0 +1,18 @@ +const create_fake_element = (value: string) => { + const fake_element = document.createElement('textarea'); + fake_element.style.position = 'fixed'; + fake_element.style.top = '0'; + fake_element.style.clipPath = "path('M0,0 L0,0')"; + fake_element.setAttribute('readonly', ''); + fake_element.value = value; + return fake_element; +}; + +export const copy = (value: string) => { + const fake_element = create_fake_element(value); + document.body.appendChild(fake_element); + fake_element.select(); + fake_element.setSelectionRange(0, fake_element.value.length); + document.execCommand('copy'); + fake_element.remove(); +}; diff --git a/apps/ligo-virgo/src/pages/tools/icons/index.ts b/apps/ligo-virgo/src/pages/tools/icons/index.ts new file mode 100644 index 0000000000..9d2a7b7b2b --- /dev/null +++ b/apps/ligo-virgo/src/pages/tools/icons/index.ts @@ -0,0 +1 @@ +export { Icons } from './Icons'; diff --git a/apps/ligo-virgo/src/pages/tools/index.tsx b/apps/ligo-virgo/src/pages/tools/index.tsx new file mode 100644 index 0000000000..984fae407b --- /dev/null +++ b/apps/ligo-virgo/src/pages/tools/index.tsx @@ -0,0 +1,14 @@ +import { Routes, Route } from 'react-router-dom'; + +import { Container } from './container'; +import { Icons } from './icons'; + +export function Tools() { + return ( + + }> + } /> + + + ); +} diff --git a/apps/ligo-virgo/src/pages/ui/index.tsx b/apps/ligo-virgo/src/pages/ui/index.tsx new file mode 100644 index 0000000000..cc8273dbe7 --- /dev/null +++ b/apps/ligo-virgo/src/pages/ui/index.tsx @@ -0,0 +1,9 @@ +import React from 'react'; + +export const UIPage = () => { + return ( +
+ This page is used to show ui components of Affine ~ +
+ ); +}; diff --git a/apps/ligo-virgo/src/pages/workspace/Container.tsx b/apps/ligo-virgo/src/pages/workspace/Container.tsx new file mode 100644 index 0000000000..92afc22483 --- /dev/null +++ b/apps/ligo-virgo/src/pages/workspace/Container.tsx @@ -0,0 +1,19 @@ +import { Outlet } from 'react-router-dom'; +import style9 from 'style9'; + +import { MuiBox as Box } from '@toeverything/components/ui'; + +const styles = style9.create({ + container: { + display: 'flex', + overflow: 'hidden', + }, +}); + +export function WorkspaceRootContainer() { + return ( + + + + ); +} diff --git a/apps/ligo-virgo/src/pages/workspace/Home.tsx b/apps/ligo-virgo/src/pages/workspace/Home.tsx new file mode 100644 index 0000000000..c8ce89b6d4 --- /dev/null +++ b/apps/ligo-virgo/src/pages/workspace/Home.tsx @@ -0,0 +1,39 @@ +import { useEffect } from 'react'; +import { useNavigate, useParams } from 'react-router-dom'; +import { useUserAndSpaces } from '@toeverything/datasource/state'; +import { services, TemplateFactory } from '@toeverything/datasource/db-service'; + +export function WorkspaceHome() { + const navigate = useNavigate(); + const { workspace_id } = useParams(); + const { user } = useUserAndSpaces(); + + useEffect(() => { + const navigate_to_user_initial_page = async () => { + const recent_pages = await services.api.userConfig.getRecentPages( + workspace_id, + user.id + ); + + const user_initial_page_id = + await services.api.userConfig.getUserInitialPage( + workspace_id, + user.id + ); + if (recent_pages.length === 0) { + await services.api.editorBlock.copyTemplateToPage( + workspace_id, + user_initial_page_id, + TemplateFactory.generatePageTemplateByGroupKeys({ + name: null, + groupKeys: ['todolist'], + }) + ); + } + navigate(`/${workspace_id}/${user_initial_page_id}`); + }; + navigate_to_user_initial_page(); + }, [navigate, user.id, workspace_id]); + + return null; +} diff --git a/apps/ligo-virgo/src/pages/workspace/Whiteboard.tsx b/apps/ligo-virgo/src/pages/workspace/Whiteboard.tsx new file mode 100644 index 0000000000..16bdf814fe --- /dev/null +++ b/apps/ligo-virgo/src/pages/workspace/Whiteboard.tsx @@ -0,0 +1,37 @@ +import { memo, useEffect } from 'react'; +import { useParams } from 'react-router'; + +import { AffineBoard } from '@toeverything/components/affine-board'; +import { useUserAndSpaces } from '@toeverything/datasource/state'; +import { services } from '@toeverything/datasource/db-service'; + +const MemoAffineBoard = memo(AffineBoard, (prev, next) => { + return prev.rootBlockId === next.rootBlockId; +}); + +type WhiteboardProps = { + workspace: string; +}; + +export const Whiteboard = (props: WhiteboardProps) => { + const { page_id } = useParams(); + const { user } = useUserAndSpaces(); + + useEffect(() => { + if (!user?.id || !props.workspace) return; + const update_recent_pages = async () => { + // TODO: deal with it temporarily + await services.api.editorBlock.getWorkspaceDbBlock( + props.workspace, + { + userId: user.id, + } + ); + }; + update_recent_pages(); + }, [user, props.workspace]); + + return ( + + ); +}; diff --git a/apps/ligo-virgo/src/pages/workspace/docs/collapsible-page-tree.tsx b/apps/ligo-virgo/src/pages/workspace/docs/collapsible-page-tree.tsx new file mode 100644 index 0000000000..069bc48857 --- /dev/null +++ b/apps/ligo-virgo/src/pages/workspace/docs/collapsible-page-tree.tsx @@ -0,0 +1,112 @@ +import { useCallback, useState } from 'react'; +import { useNavigate, useParams } from 'react-router-dom'; +import clsx from 'clsx'; +import style9 from 'style9'; +import { + MuiBox as Box, + MuiButton as Button, + MuiCollapse as Collapse, + MuiIconButton as IconButton, +} from '@toeverything/components/ui'; +import ArrowDropDownIcon from '@mui/icons-material/ArrowDropDown'; +import ArrowRightIcon from '@mui/icons-material/ArrowRight'; + +import { services } from '@toeverything/datasource/db-service'; +import { NewpageIcon } from '@toeverything/components/common'; +import { + usePageTree, + useCalendarHeatmap, +} from '@toeverything/components/layout'; + +const styles = style9.create({ + ligoButton: { + textTransform: 'none', + }, + newPage: { + color: '#B6C7D3', + width: '26px', + fontSize: '18px', + textAlign: 'center', + cursor: 'pointer', + }, +}); + +export type CollapsiblePageTreeProps = { + title?: string; + initialOpen?: boolean; + children?: React.ReactNode; + className?: string; + style?: React.CSSProperties; +}; + +export function CollapsiblePageTree(props: CollapsiblePageTreeProps) { + const { className, style, children, title, initialOpen = true } = props; + const navigate = useNavigate(); + const { workspace_id, page_id } = useParams(); + + const { handleAddPage } = usePageTree(); + const { addPageToday } = useCalendarHeatmap(); + + const [open, setOpen] = useState(initialOpen); + + const create_page = useCallback(async () => { + if (page_id) { + const newPage = await services.api.editorBlock.create({ + workspace: workspace_id, + type: 'page' as const, + }); + + await handleAddPage(newPage.id); + addPageToday(); + + navigate(`/${workspace_id}/${newPage.id}`); + } + }, [addPageToday, handleAddPage, navigate, page_id, workspace_id]); + + const [newPageBtnVisible, setNewPageBtnVisible] = useState(false); + + return ( + <> + setNewPageBtnVisible(true)} + onMouseLeave={() => setNewPageBtnVisible(false)} + > + + + {newPageBtnVisible && ( +
+ + +
+ )} +
+ {children ? ( + + {children} + + ) : null} + + ); +} + +export default CollapsiblePageTree; diff --git a/apps/ligo-virgo/src/pages/workspace/docs/index.spec.tsx b/apps/ligo-virgo/src/pages/workspace/docs/index.spec.tsx new file mode 100644 index 0000000000..e17c51392b --- /dev/null +++ b/apps/ligo-virgo/src/pages/workspace/docs/index.spec.tsx @@ -0,0 +1,18 @@ +/* eslint-disable filename-rules/match */ +import { render } from '@testing-library/react'; + +import { Page } from './index'; + +describe('App', () => { + it('should render successfully', () => { + const { baseElement } = render(); + + expect(baseElement).toBeTruthy(); + }); + + it('should have a greeting as the title', () => { + const { getByText } = render(); + + expect(getByText(/Welcome ligo-virgo/gi)).toBeTruthy(); + }); +}); diff --git a/apps/ligo-virgo/src/pages/workspace/docs/index.tsx b/apps/ligo-virgo/src/pages/workspace/docs/index.tsx new file mode 100644 index 0000000000..b24816952f --- /dev/null +++ b/apps/ligo-virgo/src/pages/workspace/docs/index.tsx @@ -0,0 +1,176 @@ +/* eslint-disable filename-rules/match */ +import { useEffect } from 'react'; +import { useParams } from 'react-router'; +import { + MuiBox as Box, + MuiCircularProgress as CircularProgress, + MuiDivider as Divider, + styled, +} from '@toeverything/components/ui'; +import { AffineEditor } from '@toeverything/components/affine-editor'; +import { + CalendarHeatmap, + PageTree, + Activities, +} from '@toeverything/components/layout'; +import { CollapsibleTitle } from '@toeverything/components/common'; +import { + useShowSpaceSidebar, + useUserAndSpaces, +} from '@toeverything/datasource/state'; +import { services } from '@toeverything/datasource/db-service'; + +import { WorkspaceName } from './workspace-name'; +import { CollapsiblePageTree } from './collapsible-page-tree'; +import TemplatesPortal from './templates-portal'; +import { useFlag } from '@toeverything/datasource/feature-flags'; + +type PageProps = { + workspace: string; +}; + +export function Page(props: PageProps) { + const { page_id } = useParams(); + const { showSpaceSidebar, fixedDisplay, setSpaceSidebarVisible } = + useShowSpaceSidebar(); + const { user } = useUserAndSpaces(); + const templatesPortalFlag = useFlag('BooleanTemplatesPortal', false); + const dailyNotesFlag = useFlag('BooleanDailyNotes', false); + + useEffect(() => { + if (!user?.id || !page_id) return; + const updateRecentPages = async () => { + // TODO: deal with it temporarily + await services.api.editorBlock.getWorkspaceDbBlock( + props.workspace, + { + userId: user.id, + } + ); + + await services.api.userConfig.addRecentPage( + props.workspace, + user.id, + page_id + ); + await services.api.editorBlock.clearUndoRedo(props.workspace); + }; + update_recent_pages(); + }, [user, props.workspace, page_id]); + + return ( + + + setSpaceSidebarVisible(true)} + onMouseLeave={() => setSpaceSidebarVisible(false)} + > + + + +
+ {templatesPortalFlag && } + {dailyNotesFlag && ( +
+ + + +
+ )} +
+ + + +
+
+ + {page_id ? : null} + +
+
+
+
+
+ + + {page_id ? ( + + ) : ( + + + + )} + + +
+ ); +} + +const LigoApp = styled('div')({ + width: '100vw', + position: 'relative', + display: 'flex', + flex: '1 1 0%', + backgroundColor: 'white', + margin: '10px 0', +}); + +const LigoRightContainer = styled('div')({ + position: 'relative', + width: '100%', + flex: 'auto', +}); + +const LigoEditorOuterContainer = styled('div')({ + position: 'absolute', + height: '100%', + width: '100%', + overflowX: 'hidden', + overflowY: 'hidden', +}); + +const LigoLeftContainer = styled('div')({ + flex: '0 0 auto', +}); + +const WorkspaceSidebar = styled('div')(({ hidden }) => ({ + position: 'absolute', + zIndex: 1, + display: 'flex', + flexDirection: 'column', + width: 300, + minWidth: 300, + height: '100%', + borderRadius: '0px 10px 10px 0px', + boxShadow: '0px 1px 10px rgba(152, 172, 189, 0.6)', + backgroundColor: '#FFFFFF', + transitionProperty: 'left', + transitionDuration: '0.35s', + transitionTimingFunction: 'ease', + padding: '16px 12px', +})); + +const WorkspaceSidebarContent = styled('div')({ + flex: 'auto', + overflow: 'hidden auto', +}); diff --git a/apps/ligo-virgo/src/pages/workspace/docs/quick-find-portal.tsx b/apps/ligo-virgo/src/pages/workspace/docs/quick-find-portal.tsx new file mode 100644 index 0000000000..cb7f85f6d1 --- /dev/null +++ b/apps/ligo-virgo/src/pages/workspace/docs/quick-find-portal.tsx @@ -0,0 +1,39 @@ +import { styled } from '@toeverything/components/ui'; + +import SearchIcon from '@mui/icons-material/Search'; + +const handle_search = () => { + //@ts-ignore + virgo.plugins.plugins['search'].renderSearch(); +}; +const QuickFindPortalContainer = styled('div')({ + position: 'relative', + marginLeft: '10px', + height: '22px', + lineHeight: '22px', + width: '220px', + borderRadius: '8px', + color: '#4c6275', + fontSize: '14px', + paddingLeft: '20px', + cursor: 'pointer', + ':hover': { + backgroundColor: '#ccc', + }, + '.shortcutIcon': { + position: 'absolute', + top: '3px', + left: '0px', + fontSize: '16px!important', + }, +}); + +function QuickFindPortal() { + return ( + + Quick Find + + ); +} + +export default QuickFindPortal; diff --git a/apps/ligo-virgo/src/pages/workspace/docs/templates-portal.tsx b/apps/ligo-virgo/src/pages/workspace/docs/templates-portal.tsx new file mode 100644 index 0000000000..237f477582 --- /dev/null +++ b/apps/ligo-virgo/src/pages/workspace/docs/templates-portal.tsx @@ -0,0 +1,90 @@ +import { + styled, + MuiBox as Box, + MuiModal as Modal, +} from '@toeverything/components/ui'; + +import * as React from 'react'; +import { Templates } from '../../templates'; +import StarIcon from '@mui/icons-material/Star'; +import { useNavigate } from 'react-router'; +import { AsyncBlock } from '@toeverything/framework/virgo'; +import { createEditor } from '@toeverything/components/affine-editor'; +const TemplatePortalContainer = styled('div')({ + position: 'relative', + marginLeft: '10px', + height: '22px', + lineHeight: '22px', + width: '220px', + borderRadius: '8px', + color: '#4c6275', + fontSize: '14px', + paddingLeft: '20px', + cursor: 'pointer', + ':hover': { + backgroundColor: '#ccc', + }, + '.shortcutIcon': { + position: 'absolute', + top: '3px', + left: '0px', + fontSize: '16px!important', + }, +}); + +const style = { + position: 'absolute', + top: '40%', + left: '50%', + transform: 'translate(-50%, -50%)', + width: '80%', + height: '70%', + boxShadow: 0, + p: 0, +}; +const maskStyle = { + background: 'rgba(0,0,0,0.5)', + width: '100%', + height: '100%', + position: 'fixed', +}; +function TemplatesPortal() { + const [open, set_open] = React.useState(false); + const handle_open = () => set_open(true); + const handle_close = () => set_open(false); + const navigate = useNavigate(); + + const get_default_workspace_id = () => { + return window.location.pathname.split('/')[1]; + }; + const handleClickUseThisTemplate = () => { + const block_editor = createEditor(get_default_workspace_id()); + //@ts-ignore + block_editor.plugins + .getPlugin('page-toolbar') + //@ts-ignore 泛型处理 + .addDailyNote() + .then((new_page: AsyncBlock) => { + handle_close(); + const new_state = + `/${get_default_workspace_id()}/` + new_page.id; + navigate(new_state); + }); + }; + return ( + <> + + Templates + + + + + + + + ); +} + +export default TemplatesPortal; diff --git a/apps/ligo-virgo/src/pages/workspace/docs/workspace-name.tsx b/apps/ligo-virgo/src/pages/workspace/docs/workspace-name.tsx new file mode 100644 index 0000000000..dd898a860e --- /dev/null +++ b/apps/ligo-virgo/src/pages/workspace/docs/workspace-name.tsx @@ -0,0 +1,168 @@ +import { + MuiButton as Button, + MuiSwitch as Switch, + styled, + MuiOutlinedInput as OutlinedInput, +} from '@toeverything/components/ui'; +import { LogoIcon } from '@toeverything/components/icons'; +import { + useUserAndSpaces, + useShowSpaceSidebar, +} from '@toeverything/datasource/state'; +import { useCallback, useEffect, useState } from 'react'; +import { services } from '@toeverything/datasource/db-service'; + +const WorkspaceContainer = styled('div')({ + display: 'flex', + alignItems: 'center', + minHeight: 60, + padding: '12px 0px', + color: '#566B7D', +}); +const LeftContainer = styled('div')({ + flex: 'auto', + display: 'flex', +}); + +const LogoContainer = styled('div')({ + display: 'flex', + alignItems: 'center', + justifyContent: 'center', + height: 24, + minWidth: 24, +}); + +const StyledLogoIcon = styled(LogoIcon)(({ theme }) => { + return { + color: theme.affine.palette.primary, + width: '16px !important', + height: '16px !important', + }; +}); + +const WorkspaceNameContainer = styled('div')({ + display: 'flex', + alignItems: 'center', + flex: 'auto', + width: '100px', + marginRight: '10px', + input: { + padding: '5px 10px', + }, + span: { + width: '100%', + overflow: 'hidden', + textOverflow: 'ellipsis', + whiteSpace: 'nowrap', + }, +}); + +const WorkspaceReNameContainer = styled('div')({ + marginRight: '10px', + input: { + padding: '5px 10px', + }, +}); + +const ToggleDisplayContainer = styled('div')({ + display: 'flex', + alignItems: 'center', + fontSize: 12, + color: '#3E6FDB', + padding: 6, + minWidth: 64, +}); + +export const WorkspaceName = () => { + const { currentSpaceId } = useUserAndSpaces(); + const { fixedDisplay, toggleSpaceSidebar } = useShowSpaceSidebar(); + const [inRename, setInRename] = useState(false); + const [workspaceName, setWorkspaceName] = useState(''); + + const fetchWorkspaceName = useCallback(async () => { + if (!currentSpaceId) { + return; + } + + const name = await services.api.userConfig.getWorkspaceName( + currentSpaceId + ); + setWorkspaceName(name); + }, [currentSpaceId]); + + useEffect(() => { + fetchWorkspaceName(); + }, [currentSpaceId]); + + useEffect(() => { + let unobserve: () => void; + const observe = async () => { + unobserve = await services.api.userConfig.observe( + { workspace: currentSpaceId }, + () => { + fetchWorkspaceName(); + } + ); + }; + observe(); + + return () => { + unobserve?.(); + }; + }, [currentSpaceId, fetchWorkspaceName]); + + const handleKeyDown = useCallback( + (e: React.KeyboardEvent) => { + if (e.key === 'Enter') { + e.stopPropagation(); + e.preventDefault(); + setInRename(false); + } + }, + [] + ); + const handleChange = useCallback( + (e: React.ChangeEvent) => { + services.api.userConfig.setWorkspaceName( + currentSpaceId, + e.currentTarget.value + ); + }, + [] + ); + + return ( + + + + + + + {inRename ? ( + + setInRename(false)} + /> + + ) : ( + + setInRename(true)}> + {workspaceName} + + + )} + + + {fixedDisplay ? 'ON' : 'OFF'} + + + + ); +}; diff --git a/apps/ligo-virgo/src/pages/workspace/index.tsx b/apps/ligo-virgo/src/pages/workspace/index.tsx new file mode 100644 index 0000000000..a2e5c92970 --- /dev/null +++ b/apps/ligo-virgo/src/pages/workspace/index.tsx @@ -0,0 +1,41 @@ +/* eslint-disable filename-rules/match */ +import { Routes, Route, useParams, Navigate } from 'react-router'; + +import { useUserAndSpaces } from '@toeverything/datasource/state'; + +import { WorkspaceRootContainer } from './Container'; +import { Page } from './docs'; +import { WorkspaceHome } from './Home'; +import Labels from './labels'; +import Pages from './pages'; +import { Whiteboard } from './Whiteboard'; + +export function WorkspaceContainer() { + const { workspace_id } = useParams(); + const { user, currentSpaceId } = useUserAndSpaces(); + + if ( + user && + ![currentSpaceId, 'affine2vin277tcmafwq'].includes(workspace_id) + ) { + // return ; + } + + return ( + + }> + } /> + } /> + } + /> + } + /> + } /> + + + ); +} diff --git a/apps/ligo-virgo/src/pages/workspace/labels/index.tsx b/apps/ligo-virgo/src/pages/workspace/labels/index.tsx new file mode 100644 index 0000000000..aad88dc3ea --- /dev/null +++ b/apps/ligo-virgo/src/pages/workspace/labels/index.tsx @@ -0,0 +1,3 @@ +export default function WorkspaceLabels() { + return WorkspaceLabels; +} diff --git a/apps/ligo-virgo/src/pages/workspace/pages/index.tsx b/apps/ligo-virgo/src/pages/workspace/pages/index.tsx new file mode 100644 index 0000000000..b1ee12e535 --- /dev/null +++ b/apps/ligo-virgo/src/pages/workspace/pages/index.tsx @@ -0,0 +1,3 @@ +export default function WorkspacePages() { + return WorkspacePages; +} diff --git a/apps/ligo-virgo/src/pages/workspace/whiteboard/index.bak.tsx b/apps/ligo-virgo/src/pages/workspace/whiteboard/index.bak.tsx new file mode 100644 index 0000000000..fed9714482 --- /dev/null +++ b/apps/ligo-virgo/src/pages/workspace/whiteboard/index.bak.tsx @@ -0,0 +1,53 @@ +// import { FC, useMemo, useState } from 'react'; +// import { useParams } from 'react-router-dom'; +// import { TDPage } from '@toeverything/framework/whiteboard'; +// import { +// AffineWhiteboard, +// WhiteboardMeta, +// AffineEditorShape +// } from '@toeverything/components/affine-whiteboard'; + +// interface EditorShapeProps { +// blockIds: string | string[]; +// point: [number, number]; +// } + +// const createEditorShape = (props: EditorShapeProps): AffineEditorShape => { +// const block_ids = Array.isArray(props.blockIds) +// ? props.blockIds +// : [props.blockIds]; +// return { +// id: block_ids.join('_'), +// label: '', +// childIndex: 1, +// name: 'affine_editor', +// parentId: 'page', +// point: props.point, +// rotation: 0, +// size: [400, 200], +// style: { +// color: 'black', +// size: 'small', +// isFilled: false, +// dash: 'draw', +// scale: 1 +// } as any, +// type: 'affineEditor', +// blockIds: block_ids +// }; +// }; + +// const Whiteboard: FC = () => { +// const { workspace_id, page_id } = useParams(); +// const [shapes, set_shapes] = useState({}); +// const meta = useMemo(() => { +// return { +// workspace: workspace_id, +// rootBlockId: page_id +// }; +// }, [workspace_id, page_id]); + +// return page_id ? : null; +// }; + +// export default Whiteboard; diff --git a/apps/ligo-virgo/src/polyfills.ts b/apps/ligo-virgo/src/polyfills.ts new file mode 100644 index 0000000000..2adf3d05b6 --- /dev/null +++ b/apps/ligo-virgo/src/polyfills.ts @@ -0,0 +1,7 @@ +/** + * Polyfill stable language features. These imports will be optimized by `@babel/preset-env`. + * + * See: https://github.com/zloirock/core-js#babel + */ +import 'core-js/stable'; +import 'regenerator-runtime/runtime'; diff --git a/apps/ligo-virgo/src/styles.css b/apps/ligo-virgo/src/styles.css new file mode 100644 index 0000000000..aaf71841aa --- /dev/null +++ b/apps/ligo-virgo/src/styles.css @@ -0,0 +1,285 @@ +/* resset.dev • v5.0.2 */ + +/* # ================================================================= + # Global selectors + # ================================================================= */ + +html { + box-sizing: border-box; + -webkit-text-size-adjust: 100%; /* Prevent adjustments of font size after orientation changes in iOS */ + word-break: normal; + -moz-tab-size: 4; + tab-size: 4; + overflow: hidden; + font-family: -apple-system, BlinkMacSystemFont, Helvetica Neue, Tahoma, + PingFang SC, Microsoft Yahei, Arial, Hiragino Sans GB, sans-serif, + Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji; +} + +*, +::before, +::after { + background-repeat: no-repeat; /* Set `background-repeat: no-repeat` to all elements and pseudo elements */ + box-sizing: inherit; +} + +::before, +::after { + text-decoration: inherit; /* Inherit text-decoration and vertical align to ::before and ::after pseudo elements */ + vertical-align: inherit; +} + +* { + padding: 0; /* Reset `padding` and `margin` of all elements */ + margin: 0; +} + +/* # ================================================================= + # General elements + # ================================================================= */ + +hr { + overflow: visible; /* Show the overflow in Edge and IE */ + height: 0; /* Add the correct box sizing in Firefox */ + color: inherit; /* Correct border color in Firefox. */ +} + +details, +main { + display: block; /* Render the `main` element consistently in IE. */ +} + +summary { + display: list-item; /* Add the correct display in all browsers */ +} + +small { + font-size: 80%; /* Set font-size to 80% in `small` elements */ +} + +[hidden] { + display: none; /* Add the correct display in IE */ +} + +abbr[title] { + border-bottom: none; /* Remove the bottom border in Chrome 57 */ + /* Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari */ + text-decoration: underline; + text-decoration: underline dotted; +} + +a { + background-color: transparent; /* Remove the gray background on active links in IE 10 */ +} + +a:active, +a:hover { + outline-width: 0; /* Remove the outline when hovering in all browsers */ +} + +code, +kbd, +pre, +samp { + font-family: monospace, monospace; /* Specify the font family of code elements */ +} + +pre { + font-size: 1em; /* Correct the odd `em` font sizing in all browsers */ +} + +b, +strong { + font-weight: bolder; /* Add the correct font weight in Chrome, Edge, and Safari */ +} + +/* https://gist.github.com/unruthless/413930 */ +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sub { + bottom: -0.25em; +} + +sup { + top: -0.5em; +} + +table { + border-color: inherit; /* Correct border color in all Chrome, Edge, and Safari. */ + text-indent: 0; /* Remove text indentation in Chrome, Edge, and Safari */ +} + +iframe { + border-style: none; +} + +/* # ================================================================= + # Forms + # ================================================================= */ + +input { + border-radius: 0; +} + +[type='number']::-webkit-inner-spin-button, +[type='number']::-webkit-outer-spin-button { + height: auto; /* Correct the cursor style of increment and decrement buttons in Chrome */ +} + +[type='search'] { + -webkit-appearance: textfield; /* Correct the odd appearance in Chrome and Safari */ + outline-offset: -2px; /* Correct the outline style in Safari */ +} + +[type='search']::-webkit-search-decoration { + -webkit-appearance: none; /* Remove the inner padding in Chrome and Safari on macOS */ +} + +textarea { + overflow: auto; /* Internet Explorer 11+ */ + resize: vertical; /* Specify textarea resizability */ +} + +button, +input, +optgroup, +select, +textarea { + font: inherit; /* Specify font inheritance of form elements */ +} + +optgroup { + font-weight: bold; /* Restore the font weight unset by the previous rule */ +} + +button { + overflow: visible; /* Address `overflow` set to `hidden` in IE 8/9/10/11 */ +} + +button, +select { + text-transform: none; /* Firefox 40+, Internet Explorer 11- */ +} + +/* Apply cursor pointer to button elements */ +button, +[type='button'], +[type='reset'], +[type='submit'], +[role='button'] { + cursor: pointer; +} + +/* Remove inner padding and border in Firefox 4+ */ +button::-moz-focus-inner, +[type='button']::-moz-focus-inner, +[type='reset']::-moz-focus-inner, +[type='submit']::-moz-focus-inner { + border-style: none; + padding: 0; +} + +/* Replace focus style removed in the border reset above */ +button:-moz-focusring, +[type='button']::-moz-focus-inner, +[type='reset']::-moz-focus-inner, +[type='submit']::-moz-focus-inner { + outline: 1px dotted ButtonText; +} + +button, + html [type='button'], /* Prevent a WebKit bug where (2) destroys native `audio` and `video`controls in Android 4 */ + [type='reset'], + [type='submit'] { + -webkit-appearance: button; /* Correct the inability to style clickable types in iOS */ +} + +/* Remove the default button styling in all browsers */ +button, +input, +select, +textarea { + background-color: transparent; + border-style: none; +} + +a:focus, +button:focus, +input:focus, +select:focus, +textarea:focus { + outline-width: 0; +} + +/* Style select like a standard input */ +select { + -moz-appearance: none; /* Firefox 36+ */ + -webkit-appearance: none; /* Chrome 41+ */ +} + +select::-ms-expand { + display: none; /* Internet Explorer 11+ */ +} + +select::-ms-value { + color: currentColor; /* Internet Explorer 11+ */ +} + +legend { + border: 0; /* Correct `color` not being inherited in IE 8/9/10/11 */ + color: inherit; /* Correct the color inheritance from `fieldset` elements in IE */ + display: table; /* Correct the text wrapping in Edge and IE */ + max-width: 100%; /* Correct the text wrapping in Edge and IE */ + white-space: normal; /* Correct the text wrapping in Edge and IE */ + max-width: 100%; /* Correct the text wrapping in Edge 18- and IE */ +} + +::-webkit-file-upload-button { + /* Correct the inability to style clickable types in iOS and Safari */ + -webkit-appearance: button; + color: inherit; + font: inherit; /* Change font properties to `inherit` in Chrome and Safari */ +} + +/* Replace pointer cursor in disabled elements */ +[disabled] { + cursor: default; +} + +/* # ================================================================= + # Specify media element style + # ================================================================= */ + +img { + border-style: none; /* Remove border when inside `a` element in IE 8/9/10 */ +} + +/* Add the correct vertical alignment in Chrome, Firefox, and Opera */ +progress { + vertical-align: baseline; +} + +/* # ================================================================= + # Accessibility + # ================================================================= */ + +/* Specify the progress cursor of updating elements */ +[aria-busy='true'] { + cursor: progress; +} + +/* Specify the pointer cursor of trigger elements */ +[aria-controls] { + cursor: pointer; +} + +/* Specify the unstyled cursor of disabled, not-editable, or otherwise inoperable elements */ +[aria-disabled='true'] { + cursor: default; +} diff --git a/apps/ligo-virgo/src/template.html b/apps/ligo-virgo/src/template.html new file mode 100644 index 0000000000..d0c4a84e0b --- /dev/null +++ b/apps/ligo-virgo/src/template.html @@ -0,0 +1,11 @@ + + + + + + <%= htmlWebpackPlugin.options.title %> + + +
+ + diff --git a/apps/ligo-virgo/tsconfig.app.json b/apps/ligo-virgo/tsconfig.app.json new file mode 100644 index 0000000000..6d3f1cc6ff --- /dev/null +++ b/apps/ligo-virgo/tsconfig.app.json @@ -0,0 +1,22 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "types": ["node"] + }, + "files": [ + "../../node_modules/@nrwl/react/typings/cssmodule.d.ts", + "../../node_modules/@nrwl/react/typings/image.d.ts" + ], + "exclude": [ + "**/*.spec.ts", + "**/*.test.ts", + "**/*.spec.tsx", + "**/*.test.tsx", + "**/*.spec.js", + "**/*.test.js", + "**/*.spec.jsx", + "**/*.test.jsx" + ], + "include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"] +} diff --git a/apps/ligo-virgo/tsconfig.json b/apps/ligo-virgo/tsconfig.json new file mode 100644 index 0000000000..2105d44754 --- /dev/null +++ b/apps/ligo-virgo/tsconfig.json @@ -0,0 +1,25 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "jsx": "react-jsx", + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + // "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "noImplicitAny": false + // "strictNullChecks": true + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.app.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] +} diff --git a/apps/ligo-virgo/tsconfig.spec.json b/apps/ligo-virgo/tsconfig.spec.json new file mode 100644 index 0000000000..c37f7eb08d --- /dev/null +++ b/apps/ligo-virgo/tsconfig.spec.json @@ -0,0 +1,23 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "module": "commonjs", + "types": ["jest", "node"] + }, + "include": [ + "**/*.test.ts", + "**/*.spec.ts", + "**/*.test.tsx", + "**/*.spec.tsx", + "**/*.test.js", + "**/*.spec.js", + "**/*.test.jsx", + "**/*.spec.jsx", + "**/*.d.ts" + ], + "files": [ + "../../node_modules/@nrwl/react/typings/cssmodule.d.ts", + "../../node_modules/@nrwl/react/typings/image.d.ts" + ] +} diff --git a/apps/ligo-virgo/webpack.config.js b/apps/ligo-virgo/webpack.config.js new file mode 100644 index 0000000000..4d7500c60f --- /dev/null +++ b/apps/ligo-virgo/webpack.config.js @@ -0,0 +1,197 @@ +const path = require('path'); +const zlib = require('zlib'); +const webpack = require('webpack'); +const getNxWebpackConfig = require('@nrwl/react/plugins/webpack'); +const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer'); +const HtmlWebpackPlugin = require('html-webpack-plugin'); +const MiniCssExtractPlugin = require('mini-css-extract-plugin'); +const CssMinimizerPlugin = require('css-minimizer-webpack-plugin'); +const CompressionPlugin = require('compression-webpack-plugin'); +const TerserPlugin = require('terser-webpack-plugin'); +const Style9Plugin = require('style9/webpack'); + +const enableBundleAnalyzer = process.env.BUNDLE_ANALYZER; + +module.exports = function (webpackConfig) { + const config = getNxWebpackConfig(webpackConfig); + + const isProd = config.mode === 'production'; + + const style9 = { + test: /\.(tsx|ts|js|mjs|jsx)$/, + use: [ + { + loader: Style9Plugin.loader, + options: { + minifyProperties: isProd, + incrementalClassnames: isProd, + }, + }, + ], + }; + + config.experiments.topLevelAwait = true; + + if (isProd) { + config.module.rules.unshift(style9); + } else { + config.module.rules.push(style9); + } + + if (isProd) { + config.entry = { + main: [...config.entry.main, ...config.entry.polyfills], + }; + config.devtool = false; + config.output = { + ...config.output, + filename: '[name].[contenthash:8].js', + chunkFilename: '[name].[chunkhash:8].js', + hashFunction: undefined, + }; + config.optimization = { + nodeEnv: 'production', + minimize: true, + minimizer: [ + new TerserPlugin({ + terserOptions: { + ecma: 2020, + }, + extractComments: true, + parallel: true, + }), + new CssMinimizerPlugin(), + ], + splitChunks: { + chunks: 'all', + cacheGroups: { + styles: { + name: 'styles', + type: 'css/mini-extract', + chunks: 'all', + enforce: true, + }, + auth: { + test: /[\\/]node_modules[\\/](@authing|@?firebase)/, + name: 'auth', + priority: -5, + chunks: 'all', + }, + whiteboard: { + test: /(libs\/components\/board-|[\\/]node_modules[\\/]@tldraw)/, + name: 'whiteboard', + priority: -7, + chunks: 'all', + }, + editor: { + test: /(libs\/framework\/(ligo|virgo|editor)|[\\/]node_modules[\\/](@codemirror|@lezer|slate))/, + name: 'editor', + priority: -8, + chunks: 'all', + }, + ui: { + test: /[\\/]node_modules[\\/](@mui|@emotion|react|katex)/, + name: 'ui', + priority: -9, + chunks: 'all', + }, + vender: { + test: /([\\/]node_modules[\\/]|polyfills|@nrwl)/, + name: 'vender', + priority: -10, + chunks: 'all', + }, + }, + }, + }; + config.module.rules.unshift({ + test: /\.css$/i, + use: [ + MiniCssExtractPlugin.loader, + { + loader: 'css-loader', + options: { + sourceMap: false, + }, + }, + ], + }); + config.module.rules.unshift({ + test: /\.scss$/i, + use: [ + 'style-loader', + { + loader: 'css-loader', + options: { + sourceMap: false, + }, + }, + { + loader: 'postcss-loader', + }, + ], + }); + config.module.rules.splice(6); + } else { + config.output = { + ...config.output, + publicPath: '/', + }; + + const babelLoader = config.module.rules.find( + rule => + typeof rule !== 'string' && + rule.loader?.toString().includes('babel-loader') + ); + if (babelLoader && typeof babelLoader !== 'string') { + babelLoader.options['plugins'] = [ + ...(babelLoader.options['plugins'] || []), + [require.resolve('babel-plugin-open-source')], + ]; + } + } + + config.plugins = [ + ...config.plugins.filter( + p => !(isProd && p instanceof MiniCssExtractPlugin) + ), + new webpack.DefinePlugin({ + JWT_DEV: !isProd, + global: {}, + }), + isProd && + new HtmlWebpackPlugin({ + title: 'Affine - All In One Workos', + favicon: path.resolve( + __dirname, + './src/assets/images/favicon.ico' + ), //favicon path + template: path.resolve(__dirname, './src/template.html'), + publicPath: '/', + }), + new Style9Plugin(), + isProd && new MiniCssExtractPlugin(), + isProd && + new CompressionPlugin({ + test: /\.(js|css|html|svg|ttf|woff)$/, + algorithm: 'brotliCompress', + filename: '[path][base].br', + compressionOptions: { + params: { + [zlib.constants.BROTLI_PARAM_QUALITY]: 11, + }, + }, + }), + isProd && + enableBundleAnalyzer && + new BundleAnalyzerPlugin({ analyzerMode: 'static' }), + ].filter(Boolean); + + // Workaround for webpack infinite recompile errors + config.watchOptions = { + // followSymlinks: false, + ignored: ['**/*.css'], + }; + + return config; +}; diff --git a/babel.config.json b/babel.config.json new file mode 100644 index 0000000000..af8aa6b9db --- /dev/null +++ b/babel.config.json @@ -0,0 +1,3 @@ +{ + "babelrcRoots": ["*"] +} diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md new file mode 100644 index 0000000000..dbf6928456 --- /dev/null +++ b/docs/CONTRIBUTING.md @@ -0,0 +1,13 @@ +# AFFiNE CONTRIBUTING + +Contributions are **welcome** and will be fully **credited**. + +## **Requirements** + +If the project maintainer has any additional requirements, you will find them listed here. + +- Code Style [AFFiNE Code Guideline](./affine-code-guideline.md) +- Git Rules [AFFiNE Git Guideline ](./affine-git-guideline.md) +- • **One pull request per feature** - If you want to do more than one thing, send multiple pull requests. + +**Happy coding**! diff --git a/docs/affine-code-guideline.md b/docs/affine-code-guideline.md new file mode 100644 index 0000000000..d98ba3cb51 --- /dev/null +++ b/docs/affine-code-guideline.md @@ -0,0 +1,22 @@ +# AFFiNE Code Guideline + +| Item | Specification | Example | +| ----------------------------------------------- | --------------------------------------------------- | ------------------------------------------------------------------------------------- | +| [Packages/Paths]() | aaa-bbb-ccc | ligo-virgo, editor-todo | +| [.tsx]() | PascalCase | AddPage.tsx | +| [.ts]() | kebab-case | file-export.ts | +| [.json]() | kebab-case | file-export.ts | +| [Domain File]() | OpenRules | xx._d.ts_ | _tsconfig.xx_.json | xx.spec .ts | .env.xx | yy-ds.ts | +| [Types]() | UpperCamelCase | WebEvent | +| [Enum variants]() | UpperCamelCase | Status{ Todo,Completed } | +| [Functions]() | lowerCamelCase | | +| [React Funciton Compoment]() | UpperCamelCase | function DocShare(){} | +| [React HOC]() | UpperCamelCase | function BussinessText(){} | +| [Function Parameter]() | lowerCamelCase | function searchByIdOrName(idOrname){ } | +| [Methods for external access]() | lowerCamelCase | public sayHello(){ }; | +| [Externally Accessible Variables (Variables)]() | lowerCamelCase | animal.sleepCount | +| [General constructors]() | constructor or with_more_details | | +| [Local variables]() | lowerCamelCase | const tableCollection = []; | +| [Statics]() | SCREAMING_SNAKE_CASE | GLOBAL_MESSAGES | +| [Constants](b) | SCREAMING_SNAKE_CASE | GLOBAL_CONFIG | +| [Type parameters]() | UpperCamelCase , usually a single capital letter: T | let a: Animal = new Animal() | diff --git a/docs/affine-git-guideline.md b/docs/affine-git-guideline.md new file mode 100644 index 0000000000..adbc3b94c5 --- /dev/null +++ b/docs/affine-git-guideline.md @@ -0,0 +1,91 @@ +# AFFiNE Git Guideline + +# 1. Git Branch Name + +- fix/ +- feat/ + +# 2. **Commit message guidelines** + +Affine uses [semantic-release](https://github.com/semantic-release/semantic-release) for automated version management and package publishing. For that to work, commitmessages need to be in the right format. + +### **Atomic commits** + +If possible, make [atomic commits](https://en.wikipedia.org/wiki/Atomic_commit), which means: + +- a commit should contain exactly one self-contained functional change +- a functional change should be contained in exactly one commit +- a commit should not create an inconsistent state (such as test errors, linting errors, partial fix, feature with documentation etc...) + +A complex feature can be broken down into multiple commits as long as each one keep a consistent state and consist of a self-contained change. + +### **Commit message format** + +Each commit message consists of a **header**, a **body** and a **footer**. The header has a special format that includes a **type**, a **scope** and a **subject**: + +`(): + + + + +