diff --git a/.github/workflows/build-branch.yml b/.github/workflows/build-branch.yml index 14480fe44..db65fbc2c 100644 --- a/.github/workflows/build-branch.yml +++ b/.github/workflows/build-branch.yml @@ -67,9 +67,7 @@ jobs: steps: - name: Set Frontend Docker Tag run: | - if [[ ${{ needs.branch_build_setup.outputs.gh_branch_name }} == release-* ]]; then - TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend${{ secrets.DOCKER_REPO_SUFFIX || '' }}-rel:${{ needs.branch_build_setup.outputs.gh_branch_name }} - elif [ "${{ needs.branch_build_setup.outputs.gh_branch_name }}" == "master" ] && [ "${{ github.event_name }}" == "release" ]; then + if [ "${{ needs.branch_build_setup.outputs.gh_branch_name }}" == "master" ] && [ "${{ github.event_name }}" == "release" ]; then TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend${{ secrets.DOCKER_REPO_SUFFIX || '' }}:latest,${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend${{ secrets.DOCKER_REPO_SUFFIX || '' }}:${{ github.event.release.tag_name }} elif [ "${{ needs.branch_build_setup.outputs.gh_branch_name }}" == "master" ]; then TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend${{ secrets.DOCKER_REPO_SUFFIX || '' }}:stable @@ -111,10 +109,6 @@ jobs: steps: - name: Set Space Docker Tag run: | - if [[ ${{ needs.branch_build_setup.outputs.gh_branch_name }} == release-* ]]; then - TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-space${{ secrets.DOCKER_REPO_SUFFIX || '' }}-rel:${{ needs.branch_build_setup.outputs.gh_branch_name }} - elif [[ ${{ needs.branch_build_setup.outputs.gh_branch_name }} == release-* ]]; then - TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-space${{ secrets.DOCKER_REPO_SUFFIX || '' }}-re:${{ needs.branch_build_setup.outputs.gh_branch_name }} if [ "${{ needs.branch_build_setup.outputs.gh_branch_name }}" == "master" ] && [ "${{ github.event_name }}" == "release" ]; then TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-space${{ secrets.DOCKER_REPO_SUFFIX || '' }}:latest,${{ secrets.DOCKERHUB_USERNAME }}/plane-space${{ secrets.DOCKER_REPO_SUFFIX || '' }}:${{ github.event.release.tag_name }} elif [ "${{ needs.branch_build_setup.outputs.gh_branch_name }}" == "master" ]; then @@ -157,10 +151,6 @@ jobs: steps: - name: Set Backend Docker Tag run: | - if [[ ${{ needs.branch_build_setup.outputs.gh_branch_name }} == release-* ]]; then - TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-backend${{ secrets.DOCKER_REPO_SUFFIX || '' }}-rel:${{ needs.branch_build_setup.outputs.gh_branch_name }} - elif [[ ${{ needs.branch_build_setup.outputs.gh_branch_name }} == release-* ]]; then - TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-backend${{ secrets.DOCKER_REPO_SUFFIX || '' }}-re:${{ needs.branch_build_setup.outputs.gh_branch_name }} if [ "${{ needs.branch_build_setup.outputs.gh_branch_name }}" == "master" ] && [ "${{ github.event_name }}" == "release" ]; then TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-backend${{ secrets.DOCKER_REPO_SUFFIX || '' }}:latest,${{ secrets.DOCKERHUB_USERNAME }}/plane-backend${{ secrets.DOCKER_REPO_SUFFIX || '' }}:${{ github.event.release.tag_name }} elif [ "${{ needs.branch_build_setup.outputs.gh_branch_name }}" == "master" ]; then @@ -203,10 +193,6 @@ jobs: steps: - name: Set Proxy Docker Tag run: | - if [[ ${{ needs.branch_build_setup.outputs.gh_branch_name }} == release-* ]]; then - TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy${{ secrets.DOCKER_REPO_SUFFIX || '' }}-rel:${{ needs.branch_build_setup.outputs.gh_branch_name }} - elif [[ ${{ needs.branch_build_setup.outputs.gh_branch_name }} == release-* ]]; then - TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy${{ secrets.DOCKER_REPO_SUFFIX || '' }}-re:${{ needs.branch_build_setup.outputs.gh_branch_name }} if [ "${{ needs.branch_build_setup.outputs.gh_branch_name }}" == "master" ] && [ "${{ github.event_name }}" == "release" ]; then TAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy${{ secrets.DOCKER_REPO_SUFFIX || '' }}:latest,${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy${{ secrets.DOCKER_REPO_SUFFIX || '' }}:${{ github.event.release.tag_name }} elif [ "${{ needs.branch_build_setup.outputs.gh_branch_name }}" == "master" ]; then diff --git a/apiserver/plane/settings/common.py b/apiserver/plane/settings/common.py index 76528176b..971ed5543 100644 --- a/apiserver/plane/settings/common.py +++ b/apiserver/plane/settings/common.py @@ -291,7 +291,9 @@ CELERY_IMPORTS = ( # Sentry Settings # Enable Sentry Settings -if bool(os.environ.get("SENTRY_DSN", False)) and os.environ.get("SENTRY_DSN").startswith("https://"): +if bool(os.environ.get("SENTRY_DSN", False)) and os.environ.get( + "SENTRY_DSN" +).startswith("https://"): sentry_sdk.init( dsn=os.environ.get("SENTRY_DSN", ""), integrations=[ @@ -334,3 +336,5 @@ INSTANCE_KEY = os.environ.get( # Skip environment variable configuration SKIP_ENV_VAR = os.environ.get("SKIP_ENV_VAR", "1") == "1" + +DATA_UPLOAD_MAX_MEMORY_SIZE = int(os.environ.get("FILE_SIZE_LIMIT", 5242880)) diff --git a/packages/editor/core/package.json b/packages/editor/core/package.json index 2f458995c..ef2be61e3 100644 --- a/packages/editor/core/package.json +++ b/packages/editor/core/package.json @@ -28,28 +28,22 @@ "react-dom": "18.2.0" }, "dependencies": { - "@plane/editor-types": "*", - "@tiptap/core": "^2.1.7", + "@tiptap/core": "^2.1.13", "@tiptap/extension-blockquote": "^2.1.13", - "@tiptap/extension-code-block-lowlight": "^2.1.12", - "@tiptap/extension-color": "^2.1.11", - "@tiptap/extension-image": "^2.1.7", - "@tiptap/extension-link": "^2.1.7", - "@tiptap/extension-list-item": "^2.1.12", - "@tiptap/extension-mention": "^2.1.12", - "@tiptap/extension-table": "^2.1.6", - "@tiptap/extension-table-cell": "^2.1.6", - "@tiptap/extension-table-header": "^2.1.6", - "@tiptap/extension-table-row": "^2.1.6", - "@tiptap/extension-task-item": "^2.1.7", - "@tiptap/extension-task-list": "^2.1.7", - "@tiptap/extension-text-style": "^2.1.11", - "@tiptap/extension-underline": "^2.1.7", - "@tiptap/pm": "^2.1.7", - "@tiptap/prosemirror-tables": "^1.1.4", - "@tiptap/react": "^2.1.7", - "@tiptap/starter-kit": "^2.1.10", - "@tiptap/suggestion": "^2.0.4", + "@tiptap/extension-code-block-lowlight": "^2.1.13", + "@tiptap/extension-color": "^2.1.13", + "@tiptap/extension-image": "^2.1.13", + "@tiptap/extension-link": "^2.1.13", + "@tiptap/extension-list-item": "^2.1.13", + "@tiptap/extension-mention": "^2.1.13", + "@tiptap/extension-task-item": "^2.1.13", + "@tiptap/extension-task-list": "^2.1.13", + "@tiptap/extension-text-style": "^2.1.13", + "@tiptap/extension-underline": "^2.1.13", + "@tiptap/pm": "^2.1.13", + "@tiptap/react": "^2.1.13", + "@tiptap/starter-kit": "^2.1.13", + "@tiptap/suggestion": "^2.0.13", "class-variance-authority": "^0.7.0", "clsx": "^1.2.1", "highlight.js": "^11.8.0", diff --git a/packages/editor/core/src/ui/hooks/use-editor.tsx b/packages/editor/core/src/hooks/use-editor.tsx similarity index 86% rename from packages/editor/core/src/ui/hooks/use-editor.tsx rename to packages/editor/core/src/hooks/use-editor.tsx index 149f9b453..c2923c1e9 100644 --- a/packages/editor/core/src/ui/hooks/use-editor.tsx +++ b/packages/editor/core/src/hooks/use-editor.tsx @@ -1,10 +1,13 @@ import { useEditor as useCustomEditor, Editor } from "@tiptap/react"; import { useImperativeHandle, useRef, MutableRefObject } from "react"; -import { CoreEditorProps } from "../props"; -import { CoreEditorExtensions } from "../extensions"; +import { CoreEditorProps } from "src/ui/props"; +import { CoreEditorExtensions } from "src/ui/extensions"; import { EditorProps } from "@tiptap/pm/view"; -import { getTrimmedHTML } from "../../lib/utils"; -import { DeleteImage, IMentionSuggestion, RestoreImage, UploadImage } from "@plane/editor-types"; +import { getTrimmedHTML } from "src/lib/utils"; +import { DeleteImage } from "src/types/delete-image"; +import { IMentionSuggestion } from "src/types/mention-suggestion"; +import { RestoreImage } from "src/types/restore-image"; +import { UploadImage } from "src/types/upload-image"; interface CustomEditorProps { uploadFile: UploadImage; diff --git a/packages/editor/core/src/ui/hooks/use-read-only-editor.tsx b/packages/editor/core/src/hooks/use-read-only-editor.tsx similarity index 88% rename from packages/editor/core/src/ui/hooks/use-read-only-editor.tsx rename to packages/editor/core/src/hooks/use-read-only-editor.tsx index 5c2429108..ecd49255c 100644 --- a/packages/editor/core/src/ui/hooks/use-read-only-editor.tsx +++ b/packages/editor/core/src/hooks/use-read-only-editor.tsx @@ -1,9 +1,9 @@ import { useEditor as useCustomEditor, Editor } from "@tiptap/react"; import { useImperativeHandle, useRef, MutableRefObject } from "react"; -import { CoreReadOnlyEditorExtensions } from "../read-only/extensions"; -import { CoreReadOnlyEditorProps } from "../read-only/props"; +import { CoreReadOnlyEditorExtensions } from "src/ui/read-only/extensions"; +import { CoreReadOnlyEditorProps } from "src/ui/read-only/props"; import { EditorProps } from "@tiptap/pm/view"; -import { IMentionSuggestion } from "@plane/editor-types"; +import { IMentionSuggestion } from "src/types/mention-suggestion"; interface CustomReadOnlyEditorProps { value: string; diff --git a/packages/editor/core/src/index.ts b/packages/editor/core/src/index.ts index bdf533193..c7e39d240 100644 --- a/packages/editor/core/src/index.ts +++ b/packages/editor/core/src/index.ts @@ -1,23 +1,32 @@ // styles // import "./styles/tailwind.css"; -// import "./styles/editor.css"; -import "./styles/github-dark.css"; +import "src/styles/editor.css"; +import "src/styles/table.css"; +import "src/styles/github-dark.css"; -export { isCellSelection } from "./ui/extensions/table/table/utilities/is-cell-selection"; +export { isCellSelection } from "src/ui/extensions/table/table/utilities/is-cell-selection"; // utils -export * from "./lib/utils"; -export * from "./ui/extensions/table/table"; -export { startImageUpload } from "./ui/plugins/upload-image"; +export * from "src/lib/utils"; +export * from "src/ui/extensions/table/table"; +export { startImageUpload } from "src/ui/plugins/upload-image"; // components -export { EditorContainer } from "./ui/components/editor-container"; -export { EditorContentWrapper } from "./ui/components/editor-content"; +export { EditorContainer } from "src/ui/components/editor-container"; +export { EditorContentWrapper } from "src/ui/components/editor-content"; // hooks -export { useEditor } from "./ui/hooks/use-editor"; -export { useReadOnlyEditor } from "./ui/hooks/use-read-only-editor"; +export { useEditor } from "src/hooks/use-editor"; +export { useReadOnlyEditor } from "src/hooks/use-read-only-editor"; // helper items -export * from "./ui/menus/menu-items"; -export * from "./lib/editor-commands"; +export * from "src/ui/menus/menu-items"; +export * from "src/lib/editor-commands"; + +// types +export type { DeleteImage } from "src/types/delete-image"; +export type { UploadImage } from "src/types/upload-image"; +export type { RestoreImage } from "src/types/restore-image"; +export type { IMentionHighlight, IMentionSuggestion } from "src/types/mention-suggestion"; +export type { ISlashCommandItem, CommandProps } from "src/types/slash-commands-suggestion"; +export type { LucideIconType } from "src/types/lucide-icon"; diff --git a/packages/editor/core/src/lib/editor-commands.ts b/packages/editor/core/src/lib/editor-commands.ts index 4a331e7cd..147797e2d 100644 --- a/packages/editor/core/src/lib/editor-commands.ts +++ b/packages/editor/core/src/lib/editor-commands.ts @@ -1,7 +1,7 @@ -import { UploadImage } from "@plane/editor-types"; import { Editor, Range } from "@tiptap/core"; -import { startImageUpload } from "../ui/plugins/upload-image"; -import { findTableAncestor } from "./utils"; +import { startImageUpload } from "src/ui/plugins/upload-image"; +import { findTableAncestor } from "src/lib/utils"; +import { UploadImage } from "src/types/upload-image"; export const toggleHeadingOne = (editor: Editor, range?: Range) => { if (range) editor.chain().focus().deleteRange(range).setNode("heading", { level: 1 }).run(); diff --git a/packages/editor/core/src/styles/editor.css b/packages/editor/core/src/styles/editor.css index 85d881eeb..86822664b 100644 --- a/packages/editor/core/src/styles/editor.css +++ b/packages/editor/core/src/styles/editor.css @@ -6,6 +6,12 @@ height: 0; } +/* block quotes */ +.ProseMirror blockquote p::before, +.ProseMirror blockquote p::after { + display: none; +} + .ProseMirror .is-empty::before { content: attr(data-placeholder); float: left; @@ -15,9 +21,10 @@ } /* Custom image styles */ - .ProseMirror img { transition: filter 0.1s ease-in-out; + margin-top: 0 !important; + margin-bottom: 0 !important; &:hover { cursor: pointer; @@ -53,11 +60,12 @@ ul[data-type="taskList"] li > label input[type="checkbox"] { background-color: rgb(var(--color-background-100)); margin: 0; cursor: pointer; - width: 1.2rem; - height: 1.2rem; + width: 0.8rem; + height: 0.8rem; position: relative; - border: 2px solid rgb(var(--color-text-100)); - margin-right: 0.3rem; + border: 1.5px solid rgb(var(--color-text-100)); + margin-right: 0.2rem; + margin-top: 0.15rem; display: grid; place-content: center; @@ -71,8 +79,8 @@ ul[data-type="taskList"] li > label input[type="checkbox"] { &::before { content: ""; - width: 0.65em; - height: 0.65em; + width: 0.5em; + height: 0.5em; transform: scale(0); transition: 120ms transform ease-in-out; box-shadow: inset 1em 1em; @@ -133,6 +141,8 @@ ul[data-type="taskList"] li[data-checked="true"] > div > p { .img-placeholder { position: relative; width: 35%; + margin-top: 0 !important; + margin-bottom: 0 !important; &:before { content: ""; @@ -159,7 +169,8 @@ ul[data-type="taskList"] li[data-checked="true"] > div > p { table { border-collapse: collapse; table-layout: fixed; - margin: 0; + margin: 0.5em 0 0.5em 0; + border: 1px solid rgb(var(--color-border-200)); width: 100%; @@ -229,3 +240,34 @@ ul[data-type="taskList"] li[data-checked="true"] > div > p { .ProseMirror table * .is-empty::before { opacity: 0; } + +.ProseMirror pre { + background: rgba(var(--color-background-80)); + border-radius: 0.5rem; + color: rgba(var(--color-text-100)); + font-family: "JetBrainsMono", monospace; + padding: 0.75rem 1rem; +} + +.ProseMirror pre code { + background: none; + color: inherit; + font-size: 0.8rem; + padding: 0; +} + +div[data-type="horizontalRule"] { + line-height: 0; + padding: 0.25rem 0; + margin-top: 0; + margin-bottom: 0; + + & > div { + border-bottom: 1px solid rgb(var(--color-text-100)); + } +} + +/* image resizer */ +.moveable-control-box { + z-index: 10 !important; +} diff --git a/space/styles/table.css b/packages/editor/core/src/styles/table.css similarity index 100% rename from space/styles/table.css rename to packages/editor/core/src/styles/table.css diff --git a/packages/editor/types/src/types/delete-image.ts b/packages/editor/core/src/types/delete-image.ts similarity index 100% rename from packages/editor/types/src/types/delete-image.ts rename to packages/editor/core/src/types/delete-image.ts diff --git a/packages/editor/core/src/types/lucide-icon.ts b/packages/editor/core/src/types/lucide-icon.ts new file mode 100644 index 000000000..2211c18e8 --- /dev/null +++ b/packages/editor/core/src/types/lucide-icon.ts @@ -0,0 +1,3 @@ +import { Smile } from "lucide-react"; + +export type LucideIconType = typeof Smile; diff --git a/packages/editor/types/src/types/mention-suggestion.ts b/packages/editor/core/src/types/mention-suggestion.ts similarity index 100% rename from packages/editor/types/src/types/mention-suggestion.ts rename to packages/editor/core/src/types/mention-suggestion.ts diff --git a/packages/editor/types/src/types/restore-image.ts b/packages/editor/core/src/types/restore-image.ts similarity index 100% rename from packages/editor/types/src/types/restore-image.ts rename to packages/editor/core/src/types/restore-image.ts diff --git a/packages/editor/types/src/types/slash-commands-suggestion.ts b/packages/editor/core/src/types/slash-commands-suggestion.ts similarity index 100% rename from packages/editor/types/src/types/slash-commands-suggestion.ts rename to packages/editor/core/src/types/slash-commands-suggestion.ts diff --git a/packages/editor/types/src/types/upload-image.ts b/packages/editor/core/src/types/upload-image.ts similarity index 100% rename from packages/editor/types/src/types/upload-image.ts rename to packages/editor/core/src/types/upload-image.ts diff --git a/packages/editor/core/src/ui/components/editor-content.tsx b/packages/editor/core/src/ui/components/editor-content.tsx index f66edbb12..9c0938788 100644 --- a/packages/editor/core/src/ui/components/editor-content.tsx +++ b/packages/editor/core/src/ui/components/editor-content.tsx @@ -1,6 +1,6 @@ import { Editor, EditorContent } from "@tiptap/react"; import { ReactNode } from "react"; -import { ImageResizer } from "../extensions/image/image-resize"; +import { ImageResizer } from "src/ui/extensions/image/image-resize"; interface EditorContentProps { editor: Editor | null; diff --git a/packages/editor/core/src/ui/extensions/custom-list-keymap/list-helpers/get-next-list-depth.ts b/packages/editor/core/src/ui/extensions/custom-list-keymap/list-helpers/get-next-list-depth.ts index f7583f195..2e4f5fbaa 100644 --- a/packages/editor/core/src/ui/extensions/custom-list-keymap/list-helpers/get-next-list-depth.ts +++ b/packages/editor/core/src/ui/extensions/custom-list-keymap/list-helpers/get-next-list-depth.ts @@ -1,7 +1,7 @@ import { getNodeAtPosition } from "@tiptap/core"; import { EditorState } from "@tiptap/pm/state"; -import { findListItemPos } from "./find-list-item-pos"; +import { findListItemPos } from "src/ui/extensions/custom-list-keymap/list-helpers/find-list-item-pos"; export const getNextListDepth = (typeOrName: string, state: EditorState) => { const listItemPos = findListItemPos(typeOrName, state); diff --git a/packages/editor/core/src/ui/extensions/custom-list-keymap/list-helpers/handle-backspace.ts b/packages/editor/core/src/ui/extensions/custom-list-keymap/list-helpers/handle-backspace.ts index 08906148b..a4f2d5db9 100644 --- a/packages/editor/core/src/ui/extensions/custom-list-keymap/list-helpers/handle-backspace.ts +++ b/packages/editor/core/src/ui/extensions/custom-list-keymap/list-helpers/handle-backspace.ts @@ -1,8 +1,8 @@ import { Editor, isAtStartOfNode, isNodeActive } from "@tiptap/core"; import { Node } from "@tiptap/pm/model"; -import { findListItemPos } from "./find-list-item-pos"; -import { hasListBefore } from "./has-list-before"; +import { findListItemPos } from "src/ui/extensions/custom-list-keymap/list-helpers/find-list-item-pos"; +import { hasListBefore } from "src/ui/extensions/custom-list-keymap/list-helpers/has-list-before"; export const handleBackspace = (editor: Editor, name: string, parentListTypes: string[]) => { // this is required to still handle the undo handling diff --git a/packages/editor/core/src/ui/extensions/custom-list-keymap/list-helpers/handle-delete.ts b/packages/editor/core/src/ui/extensions/custom-list-keymap/list-helpers/handle-delete.ts index 5f47baf9d..9179e0f20 100644 --- a/packages/editor/core/src/ui/extensions/custom-list-keymap/list-helpers/handle-delete.ts +++ b/packages/editor/core/src/ui/extensions/custom-list-keymap/list-helpers/handle-delete.ts @@ -1,7 +1,7 @@ import { Editor, isAtEndOfNode, isNodeActive } from "@tiptap/core"; -import { nextListIsDeeper } from "./next-list-is-deeper"; -import { nextListIsHigher } from "./next-list-is-higher"; +import { nextListIsDeeper } from "src/ui/extensions/custom-list-keymap/list-helpers/next-list-is-deeper"; +import { nextListIsHigher } from "src/ui/extensions/custom-list-keymap/list-helpers/next-list-is-higher"; export const handleDelete = (editor: Editor, name: string) => { // if the cursor is not inside the current node type diff --git a/packages/editor/core/src/ui/extensions/custom-list-keymap/list-helpers/next-list-is-deeper.ts b/packages/editor/core/src/ui/extensions/custom-list-keymap/list-helpers/next-list-is-deeper.ts index 425458b2a..7cd1a63f7 100644 --- a/packages/editor/core/src/ui/extensions/custom-list-keymap/list-helpers/next-list-is-deeper.ts +++ b/packages/editor/core/src/ui/extensions/custom-list-keymap/list-helpers/next-list-is-deeper.ts @@ -1,7 +1,7 @@ import { EditorState } from "@tiptap/pm/state"; -import { findListItemPos } from "./find-list-item-pos"; -import { getNextListDepth } from "./get-next-list-depth"; +import { findListItemPos } from "src/ui/extensions/custom-list-keymap/list-helpers/find-list-item-pos"; +import { getNextListDepth } from "src/ui/extensions/custom-list-keymap/list-helpers/get-next-list-depth"; export const nextListIsDeeper = (typeOrName: string, state: EditorState) => { const listDepth = getNextListDepth(typeOrName, state); diff --git a/packages/editor/core/src/ui/extensions/custom-list-keymap/list-helpers/next-list-is-higher.ts b/packages/editor/core/src/ui/extensions/custom-list-keymap/list-helpers/next-list-is-higher.ts index 8b853b5af..3364c3b87 100644 --- a/packages/editor/core/src/ui/extensions/custom-list-keymap/list-helpers/next-list-is-higher.ts +++ b/packages/editor/core/src/ui/extensions/custom-list-keymap/list-helpers/next-list-is-higher.ts @@ -1,7 +1,7 @@ import { EditorState } from "@tiptap/pm/state"; -import { findListItemPos } from "./find-list-item-pos"; -import { getNextListDepth } from "./get-next-list-depth"; +import { findListItemPos } from "src/ui/extensions/custom-list-keymap/list-helpers/find-list-item-pos"; +import { getNextListDepth } from "src/ui/extensions/custom-list-keymap/list-helpers/get-next-list-depth"; export const nextListIsHigher = (typeOrName: string, state: EditorState) => { const listDepth = getNextListDepth(typeOrName, state); diff --git a/packages/editor/core/src/ui/extensions/custom-list-keymap/list-keymap.ts b/packages/editor/core/src/ui/extensions/custom-list-keymap/list-keymap.ts index b61695973..aabd836d2 100644 --- a/packages/editor/core/src/ui/extensions/custom-list-keymap/list-keymap.ts +++ b/packages/editor/core/src/ui/extensions/custom-list-keymap/list-keymap.ts @@ -1,6 +1,6 @@ import { Extension } from "@tiptap/core"; -import { handleBackspace, handleDelete } from "./list-helpers"; +import { handleBackspace, handleDelete } from "src/ui/extensions/custom-list-keymap/list-helpers"; export type ListKeymapOptions = { listTypes: Array<{ diff --git a/packages/editor/core/src/ui/extensions/horizontal-rule.tsx b/packages/editor/core/src/ui/extensions/horizontal-rule.tsx index a7bbf50e1..cee0ded83 100644 --- a/packages/editor/core/src/ui/extensions/horizontal-rule.tsx +++ b/packages/editor/core/src/ui/extensions/horizontal-rule.tsx @@ -22,7 +22,7 @@ declare module "@tiptap/core" { } } -export default Node.create({ +export const HorizontalRule = Node.create({ name: "horizontalRule", addOptions() { diff --git a/packages/editor/core/src/ui/extensions/image/index.tsx b/packages/editor/core/src/ui/extensions/image/index.tsx index b11bfefce..db8b1c97b 100644 --- a/packages/editor/core/src/ui/extensions/image/index.tsx +++ b/packages/editor/core/src/ui/extensions/image/index.tsx @@ -1,9 +1,10 @@ import { EditorState, Plugin, PluginKey, Transaction } from "@tiptap/pm/state"; import { Node as ProseMirrorNode } from "@tiptap/pm/model"; -import UploadImagesPlugin from "../../plugins/upload-image"; +import { UploadImagesPlugin } from "src/ui/plugins/upload-image"; import ImageExt from "@tiptap/extension-image"; -import { onNodeDeleted, onNodeRestored } from "../../plugins/delete-image"; -import { DeleteImage, RestoreImage } from "@plane/editor-types"; +import { onNodeDeleted, onNodeRestored } from "src/ui/plugins/delete-image"; +import { DeleteImage } from "src/types/delete-image"; +import { RestoreImage } from "src/types/restore-image"; interface ImageNode extends ProseMirrorNode { attrs: { @@ -15,7 +16,7 @@ interface ImageNode extends ProseMirrorNode { const deleteKey = new PluginKey("delete-image"); const IMAGE_NODE_TYPE = "image"; -const ImageExtension = (deleteImage: DeleteImage, restoreFile: RestoreImage, cancelUploadImage?: () => any) => +export const ImageExtension = (deleteImage: DeleteImage, restoreFile: RestoreImage, cancelUploadImage?: () => any) => ImageExt.extend({ addProseMirrorPlugins() { return [ @@ -130,5 +131,3 @@ const ImageExtension = (deleteImage: DeleteImage, restoreFile: RestoreImage, can }; }, }); - -export default ImageExtension; diff --git a/packages/editor/core/src/ui/extensions/image/read-only-image.tsx b/packages/editor/core/src/ui/extensions/image/read-only-image.tsx index 73a763d04..8112eba4e 100644 --- a/packages/editor/core/src/ui/extensions/image/read-only-image.tsx +++ b/packages/editor/core/src/ui/extensions/image/read-only-image.tsx @@ -1,6 +1,6 @@ import Image from "@tiptap/extension-image"; -const ReadOnlyImageExtension = Image.extend({ +export const ReadOnlyImageExtension = Image.extend({ addAttributes() { return { ...this.parent?.(), @@ -13,5 +13,3 @@ const ReadOnlyImageExtension = Image.extend({ }; }, }); - -export default ReadOnlyImageExtension; diff --git a/packages/editor/core/src/ui/extensions/index.tsx b/packages/editor/core/src/ui/extensions/index.tsx index 4ab82f3c8..1406cde67 100644 --- a/packages/editor/core/src/ui/extensions/index.tsx +++ b/packages/editor/core/src/ui/extensions/index.tsx @@ -7,22 +7,25 @@ import TaskItem from "@tiptap/extension-task-item"; import TaskList from "@tiptap/extension-task-list"; import { Markdown } from "tiptap-markdown"; -import TableHeader from "./table/table-header/table-header"; -import Table from "./table/table"; -import TableCell from "./table/table-cell/table-cell"; -import TableRow from "./table/table-row/table-row"; -import HorizontalRule from "./horizontal-rule"; +import { TableHeader } from "src/ui/extensions/table/table-header/table-header"; +import { Table } from "src/ui/extensions/table/table"; +import { TableCell } from "src/ui/extensions/table/table-cell/table-cell"; +import { TableRow } from "src/ui/extensions/table/table-row/table-row"; +import { HorizontalRule } from "src/ui/extensions/horizontal-rule"; -import ImageExtension from "./image"; +import { ImageExtension } from "src/ui/extensions/image"; -import { isValidHttpUrl } from "../../lib/utils"; -import { Mentions } from "../mentions"; +import { isValidHttpUrl } from "src/lib/utils"; +import { Mentions } from "src/ui/mentions"; -import { CustomKeymap } from "./keymap"; -import { CustomCodeBlock } from "./code"; -import { CustomQuoteExtension } from "./quote"; -import { ListKeymap } from "./custom-list-keymap"; -import { IMentionSuggestion, DeleteImage, RestoreImage } from "@plane/editor-types"; +import { CustomKeymap } from "src/ui/extensions/keymap"; +import { CustomCodeBlock } from "src/ui/extensions/code"; +import { CustomQuoteExtension } from "src/ui/extensions/quote"; +import { ListKeymap } from "src/ui/extensions/custom-list-keymap"; + +import { DeleteImage } from "src/types/delete-image"; +import { IMentionSuggestion } from "src/types/mention-suggestion"; +import { RestoreImage } from "src/types/restore-image"; export const CoreEditorExtensions = ( mentionConfig: { diff --git a/packages/editor/core/src/ui/extensions/table/table-cell/index.ts b/packages/editor/core/src/ui/extensions/table/table-cell/index.ts index fb2183381..68a25a9c3 100644 --- a/packages/editor/core/src/ui/extensions/table/table-cell/index.ts +++ b/packages/editor/core/src/ui/extensions/table/table-cell/index.ts @@ -1 +1 @@ -export { default as default } from "./table-cell"; +export { TableCell } from "./table-cell"; diff --git a/packages/editor/core/src/ui/extensions/table/table-cell/table-cell.ts b/packages/editor/core/src/ui/extensions/table/table-cell/table-cell.ts index 1d3e57af9..aedb59411 100644 --- a/packages/editor/core/src/ui/extensions/table/table-cell/table-cell.ts +++ b/packages/editor/core/src/ui/extensions/table/table-cell/table-cell.ts @@ -4,7 +4,7 @@ export interface TableCellOptions { HTMLAttributes: Record; } -export default Node.create({ +export const TableCell = Node.create({ name: "tableCell", addOptions() { diff --git a/packages/editor/core/src/ui/extensions/table/table-header/index.ts b/packages/editor/core/src/ui/extensions/table/table-header/index.ts index cb036c505..290f37d0b 100644 --- a/packages/editor/core/src/ui/extensions/table/table-header/index.ts +++ b/packages/editor/core/src/ui/extensions/table/table-header/index.ts @@ -1 +1 @@ -export { default as default } from "./table-header"; +export { TableHeader } from "./table-header"; diff --git a/packages/editor/core/src/ui/extensions/table/table-header/table-header.ts b/packages/editor/core/src/ui/extensions/table/table-header/table-header.ts index 0148f1a6f..c0decdbf8 100644 --- a/packages/editor/core/src/ui/extensions/table/table-header/table-header.ts +++ b/packages/editor/core/src/ui/extensions/table/table-header/table-header.ts @@ -3,7 +3,8 @@ import { mergeAttributes, Node } from "@tiptap/core"; export interface TableHeaderOptions { HTMLAttributes: Record; } -export default Node.create({ + +export const TableHeader = Node.create({ name: "tableHeader", addOptions() { diff --git a/packages/editor/core/src/ui/extensions/table/table-row/index.ts b/packages/editor/core/src/ui/extensions/table/table-row/index.ts index 8c6eb55aa..24dafb7e0 100644 --- a/packages/editor/core/src/ui/extensions/table/table-row/index.ts +++ b/packages/editor/core/src/ui/extensions/table/table-row/index.ts @@ -1 +1 @@ -export { default as default } from "./table-row"; +export { TableRow } from "./table-row"; diff --git a/packages/editor/core/src/ui/extensions/table/table-row/table-row.ts b/packages/editor/core/src/ui/extensions/table/table-row/table-row.ts index 5df20e6ef..28c9a9a48 100644 --- a/packages/editor/core/src/ui/extensions/table/table-row/table-row.ts +++ b/packages/editor/core/src/ui/extensions/table/table-row/table-row.ts @@ -4,7 +4,7 @@ export interface TableRowOptions { HTMLAttributes: Record; } -export default Node.create({ +export const TableRow = Node.create({ name: "tableRow", addOptions() { diff --git a/packages/editor/core/src/ui/extensions/table/table/icons.ts b/packages/editor/core/src/ui/extensions/table/table/icons.ts index 65e8b8540..c08710ec3 100644 --- a/packages/editor/core/src/ui/extensions/table/table/icons.ts +++ b/packages/editor/core/src/ui/extensions/table/table/icons.ts @@ -1,4 +1,4 @@ -const icons = { +export const icons = { colorPicker: ``, deleteColumn: ``, deleteRow: ``, @@ -47,5 +47,3 @@ const icons = { `, }; - -export default icons; diff --git a/packages/editor/core/src/ui/extensions/table/table/index.ts b/packages/editor/core/src/ui/extensions/table/table/index.ts index ac51d0e2c..8efc43120 100644 --- a/packages/editor/core/src/ui/extensions/table/table/index.ts +++ b/packages/editor/core/src/ui/extensions/table/table/index.ts @@ -1 +1 @@ -export { default as default } from "./table"; +export { Table } from "./table"; diff --git a/packages/editor/core/src/ui/extensions/table/table/table-view.tsx b/packages/editor/core/src/ui/extensions/table/table/table-view.tsx index 5b0622243..bc42b49ff 100644 --- a/packages/editor/core/src/ui/extensions/table/table/table-view.tsx +++ b/packages/editor/core/src/ui/extensions/table/table/table-view.tsx @@ -4,9 +4,9 @@ import { Decoration, NodeView } from "@tiptap/pm/view"; import tippy, { Instance, Props } from "tippy.js"; import { Editor } from "@tiptap/core"; -import { CellSelection, TableMap, updateColumnsOnResize } from "@tiptap/prosemirror-tables"; +import { CellSelection, TableMap, updateColumnsOnResize } from "@tiptap/pm/tables"; -import icons from "./icons"; +import { icons } from "src/ui/extensions/table/table/icons"; export function updateColumns( node: ProseMirrorNode, diff --git a/packages/editor/core/src/ui/extensions/table/table/table.ts b/packages/editor/core/src/ui/extensions/table/table/table.ts index 71c75f616..5600fd82a 100644 --- a/packages/editor/core/src/ui/extensions/table/table/table.ts +++ b/packages/editor/core/src/ui/extensions/table/table/table.ts @@ -19,12 +19,12 @@ import { tableEditing, toggleHeader, toggleHeaderCell, -} from "@tiptap/prosemirror-tables"; +} from "@tiptap/pm/tables"; -import { tableControls } from "./table-controls"; -import { TableView } from "./table-view"; -import { createTable } from "./utilities/create-table"; -import { deleteTableWhenAllCellsSelected } from "./utilities/delete-table-when-all-cells-selected"; +import { tableControls } from "src/ui/extensions/table/table/table-controls"; +import { TableView } from "src/ui/extensions/table/table/table-view"; +import { createTable } from "src/ui/extensions/table/table/utilities/create-table"; +import { deleteTableWhenAllCellsSelected } from "src/ui/extensions/table/table/utilities/delete-table-when-all-cells-selected"; export interface TableOptions { HTMLAttributes: Record; @@ -72,7 +72,7 @@ declare module "@tiptap/core" { } } -export default Node.create({ +export const Table = Node.create({ name: "table", addOptions() { diff --git a/packages/editor/core/src/ui/extensions/table/table/utilities/create-table.ts b/packages/editor/core/src/ui/extensions/table/table/utilities/create-table.ts index 5a2299fb4..7299dd442 100644 --- a/packages/editor/core/src/ui/extensions/table/table/utilities/create-table.ts +++ b/packages/editor/core/src/ui/extensions/table/table/utilities/create-table.ts @@ -1,7 +1,7 @@ import { Fragment, Node as ProsemirrorNode, Schema } from "@tiptap/pm/model"; -import { createCell } from "./create-cell"; -import { getTableNodeTypes } from "./get-table-node-types"; +import { createCell } from "src/ui/extensions/table/table/utilities/create-cell"; +import { getTableNodeTypes } from "src/ui/extensions/table/table/utilities/get-table-node-types"; export function createTable( schema: Schema, diff --git a/packages/editor/core/src/ui/extensions/table/table/utilities/delete-table-when-all-cells-selected.ts b/packages/editor/core/src/ui/extensions/table/table/utilities/delete-table-when-all-cells-selected.ts index 7b5386382..c08228a00 100644 --- a/packages/editor/core/src/ui/extensions/table/table/utilities/delete-table-when-all-cells-selected.ts +++ b/packages/editor/core/src/ui/extensions/table/table/utilities/delete-table-when-all-cells-selected.ts @@ -1,6 +1,6 @@ import { findParentNodeClosestToPos, KeyboardShortcutCommand } from "@tiptap/core"; -import { isCellSelection } from "./is-cell-selection"; +import { isCellSelection } from "src/ui/extensions/table/table/utilities/is-cell-selection"; export const deleteTableWhenAllCellsSelected: KeyboardShortcutCommand = ({ editor }) => { const { selection } = editor.state; diff --git a/packages/editor/core/src/ui/extensions/table/table/utilities/is-cell-selection.ts b/packages/editor/core/src/ui/extensions/table/table/utilities/is-cell-selection.ts index 28917a299..42ea5759c 100644 --- a/packages/editor/core/src/ui/extensions/table/table/utilities/is-cell-selection.ts +++ b/packages/editor/core/src/ui/extensions/table/table/utilities/is-cell-selection.ts @@ -1,4 +1,4 @@ -import { CellSelection } from "@tiptap/prosemirror-tables"; +import { CellSelection } from "@tiptap/pm/tables"; export function isCellSelection(value: unknown): value is CellSelection { return value instanceof CellSelection; diff --git a/packages/editor/core/src/ui/mentions/custom.tsx b/packages/editor/core/src/ui/mentions/custom.tsx index e25da6f47..6a47d79f0 100644 --- a/packages/editor/core/src/ui/mentions/custom.tsx +++ b/packages/editor/core/src/ui/mentions/custom.tsx @@ -1,8 +1,8 @@ import { Mention, MentionOptions } from "@tiptap/extension-mention"; import { mergeAttributes } from "@tiptap/core"; import { ReactNodeViewRenderer } from "@tiptap/react"; -import mentionNodeView from "./mentionNodeView"; -import { IMentionHighlight } from "@plane/editor-types"; +import { MentionNodeView } from "src/ui/mentions/mention-node-view"; +import { IMentionHighlight } from "src/types/mention-suggestion"; export interface CustomMentionOptions extends MentionOptions { mentionHighlights: IMentionHighlight[]; @@ -31,7 +31,7 @@ export const CustomMention = Mention.extend({ }, addNodeView() { - return ReactNodeViewRenderer(mentionNodeView); + return ReactNodeViewRenderer(MentionNodeView); }, parseHTML() { diff --git a/packages/editor/core/src/ui/mentions/index.tsx b/packages/editor/core/src/ui/mentions/index.tsx index b78923f6c..f6d3e5b1f 100644 --- a/packages/editor/core/src/ui/mentions/index.tsx +++ b/packages/editor/core/src/ui/mentions/index.tsx @@ -1,8 +1,8 @@ // @ts-nocheck -import suggestion from "./suggestion"; -import { CustomMention } from "./custom"; -import { IMentionHighlight, IMentionSuggestion } from "@plane/editor-types"; +import { Suggestion } from "src/ui/mentions/suggestion"; +import { CustomMention } from "src/ui/mentions/custom"; +import { IMentionHighlight } from "src/types/mention-suggestion"; export const Mentions = (mentionSuggestions: IMentionSuggestion[], mentionHighlights: IMentionHighlight[], readonly) => CustomMention.configure({ @@ -11,5 +11,5 @@ export const Mentions = (mentionSuggestions: IMentionSuggestion[], mentionHighli }, readonly: readonly, mentionHighlights: mentionHighlights, - suggestion: suggestion(mentionSuggestions), + suggestion: Suggestion(mentionSuggestions), }); diff --git a/packages/editor/core/src/ui/mentions/MentionList.tsx b/packages/editor/core/src/ui/mentions/mention-list.tsx similarity index 91% rename from packages/editor/core/src/ui/mentions/MentionList.tsx rename to packages/editor/core/src/ui/mentions/mention-list.tsx index d103a9e0a..afbf10970 100644 --- a/packages/editor/core/src/ui/mentions/MentionList.tsx +++ b/packages/editor/core/src/ui/mentions/mention-list.tsx @@ -1,6 +1,6 @@ -import { IMentionSuggestion } from "@plane/editor-types"; import { Editor } from "@tiptap/react"; -import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useState } from "react"; +import { forwardRef, useEffect, useImperativeHandle, useState } from "react"; +import { IMentionSuggestion } from "src/types/mention-suggestion"; interface MentionListProps { items: IMentionSuggestion[]; @@ -9,7 +9,7 @@ interface MentionListProps { } // eslint-disable-next-line react/display-name -const MentionList = forwardRef((props: MentionListProps, ref) => { +export const MentionList = forwardRef((props: MentionListProps, ref) => { const [selectedIndex, setSelectedIndex] = useState(0); const selectItem = (index: number) => { @@ -98,5 +98,3 @@ const MentionList = forwardRef((props: MentionListProps, ref) => { }); MentionList.displayName = "MentionList"; - -export default MentionList; diff --git a/packages/editor/core/src/ui/mentions/mentionNodeView.tsx b/packages/editor/core/src/ui/mentions/mention-node-view.tsx similarity index 89% rename from packages/editor/core/src/ui/mentions/mentionNodeView.tsx rename to packages/editor/core/src/ui/mentions/mention-node-view.tsx index 8e9672d9f..1c3755f6c 100644 --- a/packages/editor/core/src/ui/mentions/mentionNodeView.tsx +++ b/packages/editor/core/src/ui/mentions/mention-node-view.tsx @@ -1,12 +1,12 @@ /* eslint-disable react/display-name */ // @ts-nocheck import { NodeViewWrapper } from "@tiptap/react"; -import { cn } from "../../lib/utils"; +import { cn } from "src/lib/utils"; import { useRouter } from "next/router"; -import { IMentionHighlight } from "@plane/editor-types"; +import { IMentionHighlight } from "src/types/mention-suggestion"; // eslint-disable-next-line import/no-anonymous-default-export -export default (props) => { +export const MentionNodeView = (props) => { const router = useRouter(); const highlights = props.extension.options.mentionHighlights as IMentionHighlight[]; diff --git a/packages/editor/core/src/ui/mentions/suggestion.ts b/packages/editor/core/src/ui/mentions/suggestion.ts index 60ba6f4bc..6d706cb79 100644 --- a/packages/editor/core/src/ui/mentions/suggestion.ts +++ b/packages/editor/core/src/ui/mentions/suggestion.ts @@ -2,10 +2,10 @@ import { ReactRenderer } from "@tiptap/react"; import { Editor } from "@tiptap/core"; import tippy from "tippy.js"; -import MentionList from "./MentionList"; -import { IMentionSuggestion } from "@plane/editor-types"; +import { MentionList } from "src/ui/mentions/mention-list"; +import { IMentionSuggestion } from "src/types/mention-suggestion"; -const Suggestion = (suggestions: IMentionSuggestion[]) => ({ +export const Suggestion = (suggestions: IMentionSuggestion[]) => ({ items: ({ query }: { query: string }) => suggestions.filter((suggestion) => suggestion.title.toLowerCase().startsWith(query.toLowerCase())).slice(0, 5), render: () => { @@ -55,5 +55,3 @@ const Suggestion = (suggestions: IMentionSuggestion[]) => ({ }; }, }); - -export default Suggestion; diff --git a/packages/editor/core/src/ui/menus/menu-items/index.tsx b/packages/editor/core/src/ui/menus/menu-items/index.tsx index 98069b694..610d677f8 100644 --- a/packages/editor/core/src/ui/menus/menu-items/index.tsx +++ b/packages/editor/core/src/ui/menus/menu-items/index.tsx @@ -30,14 +30,15 @@ import { toggleStrike, toggleTaskList, toggleUnderline, -} from "../../../lib/editor-commands"; -import { UploadImage } from "@plane/editor-types"; +} from "src/lib/editor-commands"; +import { LucideIconType } from "src/types/lucide-icon"; +import { UploadImage } from "src/types/upload-image"; export interface EditorMenuItem { name: string; isActive: () => boolean; command: () => void; - icon: typeof BoldIcon; + icon: LucideIconType; } export const HeadingOneItem = (editor: Editor): EditorMenuItem => ({ diff --git a/packages/editor/core/src/ui/plugins/delete-image.tsx b/packages/editor/core/src/ui/plugins/delete-image.tsx index 6b772cebf..afe13730a 100644 --- a/packages/editor/core/src/ui/plugins/delete-image.tsx +++ b/packages/editor/core/src/ui/plugins/delete-image.tsx @@ -1,6 +1,7 @@ import { EditorState, Plugin, PluginKey, Transaction } from "@tiptap/pm/state"; import { Node as ProseMirrorNode } from "@tiptap/pm/model"; -import { DeleteImage, RestoreImage } from "@plane/editor-types"; +import { DeleteImage } from "src/types/delete-image"; +import { RestoreImage } from "src/types/restore-image"; const deleteKey = new PluginKey("delete-image"); const IMAGE_NODE_TYPE = "image"; @@ -12,7 +13,7 @@ interface ImageNode extends ProseMirrorNode { }; } -const TrackImageDeletionPlugin = (deleteImage: DeleteImage): Plugin => +export const TrackImageDeletionPlugin = (deleteImage: DeleteImage): Plugin => new Plugin({ key: deleteKey, appendTransaction: (transactions: readonly Transaction[], oldState: EditorState, newState: EditorState) => { @@ -53,8 +54,6 @@ const TrackImageDeletionPlugin = (deleteImage: DeleteImage): Plugin => }, }); -export default TrackImageDeletionPlugin; - export async function onNodeDeleted(src: string, deleteImage: DeleteImage): Promise { try { const assetUrlWithWorkspaceId = new URL(src).pathname.substring(1); diff --git a/packages/editor/core/src/ui/plugins/upload-image.tsx b/packages/editor/core/src/ui/plugins/upload-image.tsx index 4dee70da4..738653d71 100644 --- a/packages/editor/core/src/ui/plugins/upload-image.tsx +++ b/packages/editor/core/src/ui/plugins/upload-image.tsx @@ -1,10 +1,10 @@ -import { UploadImage } from "@plane/editor-types"; import { EditorState, Plugin, PluginKey } from "@tiptap/pm/state"; import { Decoration, DecorationSet, EditorView } from "@tiptap/pm/view"; +import { UploadImage } from "src/types/upload-image"; const uploadKey = new PluginKey("upload-image"); -const UploadImagesPlugin = (cancelUploadImage?: () => any) => +export const UploadImagesPlugin = (cancelUploadImage?: () => any) => new Plugin({ key: uploadKey, state: { @@ -43,7 +43,7 @@ const UploadImagesPlugin = (cancelUploadImage?: () => any) => cancelButton.appendChild(svgElement); placeholder.appendChild(cancelButton); - const deco = Decoration.widget(pos + 1, placeholder, { + const deco = Decoration.widget(pos, placeholder, { id, }); set = set.add(tr.doc, [deco]); @@ -60,8 +60,6 @@ const UploadImagesPlugin = (cancelUploadImage?: () => any) => }, }); -export default UploadImagesPlugin; - function findPlaceholder(state: EditorState, id: {}) { const decos = uploadKey.getState(state); const found = decos.find(undefined, undefined, (spec: { id: number | undefined }) => spec.id == id); @@ -133,7 +131,8 @@ export async function startImageUpload( const imageSrc = typeof src === "object" ? reader.result : src; const node = schema.nodes.image.create({ src: imageSrc }); - const transaction = view.state.tr.replaceWith(pos, pos, node).setMeta(uploadKey, { remove: { id } }); + const transaction = view.state.tr.insert(pos - 1, node).setMeta(uploadKey, { remove: { id } }); + view.dispatch(transaction); } catch (error) { console.error("Upload error: ", error); diff --git a/packages/editor/core/src/ui/props.tsx b/packages/editor/core/src/ui/props.tsx index edd070d7b..2aaeb4264 100644 --- a/packages/editor/core/src/ui/props.tsx +++ b/packages/editor/core/src/ui/props.tsx @@ -1,7 +1,7 @@ -import { UploadImage } from "@plane/editor-types"; import { EditorProps } from "@tiptap/pm/view"; -import { findTableAncestor } from "../lib/utils"; -import { startImageUpload } from "./plugins/upload-image"; +import { findTableAncestor } from "src/lib/utils"; +import { UploadImage } from "src/types/upload-image"; +import { startImageUpload } from "src/ui/plugins/upload-image"; export function CoreEditorProps( uploadFile: UploadImage, diff --git a/packages/editor/core/src/ui/read-only/extensions.tsx b/packages/editor/core/src/ui/read-only/extensions.tsx index cdf7f88e5..5795d6c4a 100644 --- a/packages/editor/core/src/ui/read-only/extensions.tsx +++ b/packages/editor/core/src/ui/read-only/extensions.tsx @@ -8,15 +8,16 @@ import TaskList from "@tiptap/extension-task-list"; import { Markdown } from "tiptap-markdown"; import Gapcursor from "@tiptap/extension-gapcursor"; -import TableHeader from "../extensions/table/table-header/table-header"; -import Table from "../extensions/table/table"; -import TableCell from "../extensions/table/table-cell/table-cell"; -import TableRow from "../extensions/table/table-row/table-row"; +import { TableHeader } from "src/ui/extensions/table/table-header/table-header"; +import { Table } from "src/ui/extensions/table/table"; +import { TableCell } from "src/ui/extensions/table/table-cell/table-cell"; +import { TableRow } from "src/ui/extensions/table/table-row/table-row"; +import { HorizontalRule } from "src/ui/extensions/horizontal-rule"; -import ReadOnlyImageExtension from "../extensions/image/read-only-image"; -import { isValidHttpUrl } from "../../lib/utils"; -import { Mentions } from "../mentions"; -import { IMentionSuggestion } from "@plane/editor-types"; +import { ReadOnlyImageExtension } from "src/ui/extensions/image/read-only-image"; +import { isValidHttpUrl } from "src/lib/utils"; +import { Mentions } from "src/ui/mentions"; +import { IMentionSuggestion } from "src/types/mention-suggestion"; export const CoreReadOnlyEditorExtensions = (mentionConfig: { mentionSuggestions: IMentionSuggestion[]; @@ -71,6 +72,7 @@ export const CoreReadOnlyEditorExtensions = (mentionConfig: { class: "rounded-lg border border-custom-border-300", }, }), + HorizontalRule, TiptapUnderline, TextStyle, Color, diff --git a/packages/editor/core/tsconfig.json b/packages/editor/core/tsconfig.json index 57d0e9a74..c15534037 100644 --- a/packages/editor/core/tsconfig.json +++ b/packages/editor/core/tsconfig.json @@ -1,5 +1,15 @@ { "extends": "tsconfig/react-library.json", - "include": ["src/**/*", "index.d.ts"], - "exclude": ["dist", "build", "node_modules"] + "include": [ + "src/**/*", + "index.d.ts" + ], + "exclude": [ + "dist", + "build", + "node_modules" + ], + "compilerOptions": { + "baseUrl": "." + } } diff --git a/packages/editor/document-editor/package.json b/packages/editor/document-editor/package.json index 737a0eae0..61a075e5f 100644 --- a/packages/editor/document-editor/package.json +++ b/packages/editor/document-editor/package.json @@ -30,12 +30,11 @@ "dependencies": { "@plane/editor-core": "*", "@plane/editor-extensions": "*", - "@plane/editor-types": "*", "@plane/ui": "*", - "@tiptap/core": "^2.1.7", - "@tiptap/extension-placeholder": "^2.1.11", - "@tiptap/pm": "^2.1.12", - "@tiptap/suggestion": "^2.1.12", + "@tiptap/core": "^2.1.13", + "@tiptap/extension-placeholder": "^2.1.13", + "@tiptap/pm": "^2.1.13", + "@tiptap/suggestion": "^2.1.13", "eslint": "8.36.0", "eslint-config-next": "13.2.4", "react-popper": "^2.3.0", diff --git a/packages/editor/document-editor/src/ui/hooks/use-editor-markings.tsx b/packages/editor/document-editor/src/hooks/use-editor-markings.tsx similarity index 93% rename from packages/editor/document-editor/src/ui/hooks/use-editor-markings.tsx rename to packages/editor/document-editor/src/hooks/use-editor-markings.tsx index 9dfef6c39..1eb72eaab 100644 --- a/packages/editor/document-editor/src/ui/hooks/use-editor-markings.tsx +++ b/packages/editor/document-editor/src/hooks/use-editor-markings.tsx @@ -1,6 +1,5 @@ -import { Editor } from "@tiptap/react"; import { useState } from "react"; -import { IMarking } from ".."; +import { IMarking } from "src/types/editor-types"; export const useEditorMarkings = () => { const [markings, setMarkings] = useState([]); diff --git a/packages/editor/document-editor/src/index.ts b/packages/editor/document-editor/src/index.ts index 356e1faf9..c074009f4 100644 --- a/packages/editor/document-editor/src/index.ts +++ b/packages/editor/document-editor/src/index.ts @@ -1,3 +1,3 @@ -export { DocumentEditor, DocumentEditorWithRef } from "./ui"; -export { DocumentReadOnlyEditor, DocumentReadOnlyEditorWithRef } from "./ui/readonly"; -export { FixedMenu } from "./ui/menu/fixed-menu"; +export { DocumentEditor, DocumentEditorWithRef } from "src/ui"; +export { DocumentReadOnlyEditor, DocumentReadOnlyEditorWithRef } from "src/ui/readonly"; +export { FixedMenu } from "src/ui/menu/fixed-menu"; diff --git a/packages/editor/document-editor/src/ui/types/editor-types.ts b/packages/editor/document-editor/src/types/editor-types.ts similarity index 59% rename from packages/editor/document-editor/src/ui/types/editor-types.ts rename to packages/editor/document-editor/src/types/editor-types.ts index 10e9b16b6..5a28daf9e 100644 --- a/packages/editor/document-editor/src/ui/types/editor-types.ts +++ b/packages/editor/document-editor/src/types/editor-types.ts @@ -5,3 +5,9 @@ export interface DocumentDetails { last_updated_by: string; last_updated_at: Date; } +export interface IMarking { + type: "heading"; + level: number; + text: string; + sequence: number; +} diff --git a/packages/editor/document-editor/src/types/mark.ts b/packages/editor/document-editor/src/types/mark.ts new file mode 100644 index 000000000..e69de29bb diff --git a/packages/editor/document-editor/src/ui/types/menu-actions.d.ts b/packages/editor/document-editor/src/types/menu-actions.d.ts similarity index 100% rename from packages/editor/document-editor/src/ui/types/menu-actions.d.ts rename to packages/editor/document-editor/src/types/menu-actions.d.ts diff --git a/packages/editor/document-editor/src/ui/components/alert-label.tsx b/packages/editor/document-editor/src/ui/components/alert-label.tsx index 395ea2317..69b6dd02d 100644 --- a/packages/editor/document-editor/src/ui/components/alert-label.tsx +++ b/packages/editor/document-editor/src/ui/components/alert-label.tsx @@ -1,12 +1,11 @@ -import { Icon } from "lucide-react"; +import { LucideIconType } from "@plane/editor-core"; interface IAlertLabelProps { - Icon?: Icon; + Icon?: LucideIconType; backgroundColor: string; textColor?: string; label: string; } - export const AlertLabel = (props: IAlertLabelProps) => { const { Icon, backgroundColor, textColor, label } = props; diff --git a/packages/editor/document-editor/src/ui/components/content-browser.tsx b/packages/editor/document-editor/src/ui/components/content-browser.tsx index a21ca268f..18a50a5a8 100644 --- a/packages/editor/document-editor/src/ui/components/content-browser.tsx +++ b/packages/editor/document-editor/src/ui/components/content-browser.tsx @@ -1,7 +1,7 @@ -import { HeadingComp, HeadingThreeComp, SubheadingComp } from "./heading-component"; -import { IMarking } from ".."; +import { HeadingComp, HeadingThreeComp, SubheadingComp } from "src/ui/components/heading-component"; +import { IMarking } from "src/types/editor-types"; import { Editor } from "@tiptap/react"; -import { scrollSummary } from "../utils/editor-summary-utils"; +import { scrollSummary } from "src/utils/editor-summary-utils"; interface ContentBrowserProps { editor: Editor; diff --git a/packages/editor/document-editor/src/ui/components/editor-header.tsx b/packages/editor/document-editor/src/ui/components/editor-header.tsx index 7e2167ba0..3501785a7 100644 --- a/packages/editor/document-editor/src/ui/components/editor-header.tsx +++ b/packages/editor/document-editor/src/ui/components/editor-header.tsx @@ -1,13 +1,12 @@ import { Editor } from "@tiptap/react"; import { Archive, RefreshCw, Lock } from "lucide-react"; -import { IMarking } from ".."; -import { FixedMenu } from "../menu"; -import { UploadImage } from "@plane/editor-types"; -import { DocumentDetails } from "../types/editor-types"; -import { AlertLabel } from "./alert-label"; -import { IVerticalDropdownItemProps, VerticalDropdownMenu } from "./vertical-dropdown-menu"; -import { SummaryPopover } from "./summary-popover"; -import { InfoPopover } from "./info-popover"; +import { IMarking, DocumentDetails } from "src/types/editor-types"; +import { FixedMenu } from "src/ui/menu"; +import { UploadImage } from "@plane/editor-core"; +import { AlertLabel } from "src/ui/components/alert-label"; +import { IVerticalDropdownItemProps, VerticalDropdownMenu } from "src/ui/components/vertical-dropdown-menu"; +import { SummaryPopover } from "src/ui/components/summary-popover"; +import { InfoPopover } from "src/ui/components/info-popover"; interface IEditorHeader { editor: Editor; diff --git a/packages/editor/document-editor/src/ui/components/info-popover.tsx b/packages/editor/document-editor/src/ui/components/info-popover.tsx index 0d650667e..f78dd3473 100644 --- a/packages/editor/document-editor/src/ui/components/info-popover.tsx +++ b/packages/editor/document-editor/src/ui/components/info-popover.tsx @@ -2,7 +2,7 @@ import { useState } from "react"; import { usePopper } from "react-popper"; import { Calendar, History, Info } from "lucide-react"; // types -import { DocumentDetails } from "../types/editor-types"; +import { DocumentDetails } from "src/types/editor-types"; type Props = { documentDetails: DocumentDetails; diff --git a/packages/editor/document-editor/src/ui/components/page-renderer.tsx b/packages/editor/document-editor/src/ui/components/page-renderer.tsx index d25e9ca43..c2d001abe 100644 --- a/packages/editor/document-editor/src/ui/components/page-renderer.tsx +++ b/packages/editor/document-editor/src/ui/components/page-renderer.tsx @@ -1,7 +1,7 @@ import { EditorContainer, EditorContentWrapper } from "@plane/editor-core"; import { Editor } from "@tiptap/react"; import { useState } from "react"; -import { DocumentDetails } from "../types/editor-types"; +import { DocumentDetails } from "src/types/editor-types"; type IPageRenderer = { documentDetails: DocumentDetails; diff --git a/packages/editor/document-editor/src/ui/components/summary-popover.tsx b/packages/editor/document-editor/src/ui/components/summary-popover.tsx index 61361c049..d3ec64f1c 100644 --- a/packages/editor/document-editor/src/ui/components/summary-popover.tsx +++ b/packages/editor/document-editor/src/ui/components/summary-popover.tsx @@ -3,9 +3,9 @@ import { Editor } from "@tiptap/react"; import { usePopper } from "react-popper"; import { List } from "lucide-react"; // components -import { ContentBrowser } from "./content-browser"; +import { ContentBrowser } from "src/ui/components/content-browser"; // types -import { IMarking } from ".."; +import { IMarking } from "src/types/editor-types"; type Props = { editor: Editor; diff --git a/packages/editor/document-editor/src/ui/components/summary-side-bar.tsx b/packages/editor/document-editor/src/ui/components/summary-side-bar.tsx index b3bf23464..44ede3e8d 100644 --- a/packages/editor/document-editor/src/ui/components/summary-side-bar.tsx +++ b/packages/editor/document-editor/src/ui/components/summary-side-bar.tsx @@ -1,6 +1,6 @@ import { Editor } from "@tiptap/react"; -import { IMarking } from ".."; -import { ContentBrowser } from "./content-browser"; +import { IMarking } from "src/types/editor-types"; +import { ContentBrowser } from "src/ui/components/content-browser"; interface ISummarySideBarProps { editor: Editor; @@ -8,14 +8,12 @@ interface ISummarySideBarProps { sidePeekVisible: boolean; } -export const SummarySideBar = ({ editor, markings, sidePeekVisible }: ISummarySideBarProps) => { - return ( -
- -
- ); -}; +export const SummarySideBar = ({ editor, markings, sidePeekVisible }: ISummarySideBarProps) => ( +
+ +
+); diff --git a/packages/editor/document-editor/src/ui/components/vertical-dropdown-menu.tsx b/packages/editor/document-editor/src/ui/components/vertical-dropdown-menu.tsx index 93fea4730..43843e507 100644 --- a/packages/editor/document-editor/src/ui/components/vertical-dropdown-menu.tsx +++ b/packages/editor/document-editor/src/ui/components/vertical-dropdown-menu.tsx @@ -1,5 +1,6 @@ -import { Button, CustomMenu } from "@plane/ui"; -import { ChevronUp, Icon, MoreVertical } from "lucide-react"; +import { LucideIconType } from "@plane/editor-core"; +import { CustomMenu } from "@plane/ui"; +import { MoreVertical } from "lucide-react"; type TMenuItems = | "archive_page" @@ -14,7 +15,7 @@ type TMenuItems = export interface IVerticalDropdownItemProps { key: number; type: TMenuItems; - Icon: Icon; + Icon: LucideIconType; label: string; action: () => Promise | void; } @@ -23,27 +24,23 @@ export interface IVerticalDropdownMenuProps { items: IVerticalDropdownItemProps[]; } -const VerticalDropdownItem = ({ Icon, label, action }: IVerticalDropdownItemProps) => { - return ( - - -
{label}
-
- ); -}; +const VerticalDropdownItem = ({ Icon, label, action }: IVerticalDropdownItemProps) => ( + + +
{label}
+
+); -export const VerticalDropdownMenu = ({ items }: IVerticalDropdownMenuProps) => { - return ( - } - > - {items.map((item, index) => ( - - ))} - - ); -}; +export const VerticalDropdownMenu = ({ items }: IVerticalDropdownMenuProps) => ( + } + > + {items.map((item) => ( + + ))} + +); diff --git a/packages/editor/document-editor/src/ui/extensions/index.tsx b/packages/editor/document-editor/src/ui/extensions/index.tsx index 968328a76..155245f9e 100644 --- a/packages/editor/document-editor/src/ui/extensions/index.tsx +++ b/packages/editor/document-editor/src/ui/extensions/index.tsx @@ -1,11 +1,11 @@ import Placeholder from "@tiptap/extension-placeholder"; -import { IssueWidgetExtension } from "./widgets/IssueEmbedWidget"; +import { IssueWidgetExtension } from "src/ui/extensions/widgets/issue-embed-widget"; -import { IIssueEmbedConfig } from "./widgets/IssueEmbedWidget/types"; +import { IIssueEmbedConfig } from "src/ui/extensions/widgets/issue-embed-widget/types"; import { SlashCommand, DragAndDrop } from "@plane/editor-extensions"; -import { ISlashCommandItem, UploadImage } from "@plane/editor-types"; -import { IssueSuggestions } from "./widgets/IssueEmbedSuggestionList"; +import { ISlashCommandItem, UploadImage } from "@plane/editor-core"; +import { IssueSuggestions } from "src/ui/extensions/widgets/issue-embed-suggestion-list"; import { LayersIcon } from "@plane/ui"; export const DocumentEditorExtensions = ( diff --git a/packages/editor/document-editor/src/ui/extensions/widgets/IssueEmbedSuggestionList/issue-suggestion-items.tsx b/packages/editor/document-editor/src/ui/extensions/widgets/IssueEmbedSuggestionList/issue-suggestion-items.tsx deleted file mode 100644 index b1f27ece3..000000000 --- a/packages/editor/document-editor/src/ui/extensions/widgets/IssueEmbedSuggestionList/issue-suggestion-items.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import { IIssueListSuggestion } from "."; - -export const getIssueSuggestionItems = (issueSuggestions: Array) => { - return ({ query }: { query: string }) => { - const search = query.toLowerCase(); - const filteredSuggestions = issueSuggestions.filter((item) => { - return ( - item.title.toLowerCase().includes(search) || - item.identifier.toLowerCase().includes(search) || - item.priority.toLowerCase().includes(search) - ); - }); - - return filteredSuggestions; - }; -}; diff --git a/packages/editor/document-editor/src/ui/extensions/widgets/IssueEmbedSuggestionList/index.tsx b/packages/editor/document-editor/src/ui/extensions/widgets/issue-embed-suggestion-list/index.tsx similarity index 79% rename from packages/editor/document-editor/src/ui/extensions/widgets/IssueEmbedSuggestionList/index.tsx rename to packages/editor/document-editor/src/ui/extensions/widgets/issue-embed-suggestion-list/index.tsx index 07a10031d..acc6213c2 100644 --- a/packages/editor/document-editor/src/ui/extensions/widgets/IssueEmbedSuggestionList/index.tsx +++ b/packages/editor/document-editor/src/ui/extensions/widgets/issue-embed-suggestion-list/index.tsx @@ -1,7 +1,7 @@ import { Editor, Range } from "@tiptap/react"; -import { IssueEmbedSuggestions } from "./issue-suggestion-extension"; -import { getIssueSuggestionItems } from "./issue-suggestion-items"; -import { IssueListRenderer } from "./issue-suggestion-renderer"; +import { IssueEmbedSuggestions } from "src/ui/extensions/widgets/issue-embed-suggestion-list/issue-suggestion-extension"; +import { getIssueSuggestionItems } from "src/ui/extensions/widgets/issue-embed-suggestion-list/issue-suggestion-items"; +import { IssueListRenderer } from "src/ui/extensions/widgets/issue-embed-suggestion-list/issue-suggestion-renderer"; import { v4 as uuidv4 } from "uuid"; export type CommandProps = { @@ -19,7 +19,7 @@ export interface IIssueListSuggestion { export const IssueSuggestions = (suggestions: any[]) => { const mappedSuggestions: IIssueListSuggestion[] = suggestions.map((suggestion): IIssueListSuggestion => { - let transactionId = uuidv4(); + const transactionId = uuidv4(); return { title: suggestion.name, priority: suggestion.priority.toString(), diff --git a/packages/editor/document-editor/src/ui/extensions/widgets/IssueEmbedSuggestionList/issue-suggestion-extension.tsx b/packages/editor/document-editor/src/ui/extensions/widgets/issue-embed-suggestion-list/issue-suggestion-extension.tsx similarity index 100% rename from packages/editor/document-editor/src/ui/extensions/widgets/IssueEmbedSuggestionList/issue-suggestion-extension.tsx rename to packages/editor/document-editor/src/ui/extensions/widgets/issue-embed-suggestion-list/issue-suggestion-extension.tsx diff --git a/packages/editor/document-editor/src/ui/extensions/widgets/issue-embed-suggestion-list/issue-suggestion-items.tsx b/packages/editor/document-editor/src/ui/extensions/widgets/issue-embed-suggestion-list/issue-suggestion-items.tsx new file mode 100644 index 000000000..df468f2ee --- /dev/null +++ b/packages/editor/document-editor/src/ui/extensions/widgets/issue-embed-suggestion-list/issue-suggestion-items.tsx @@ -0,0 +1,15 @@ +import { IIssueListSuggestion } from "src/ui/extensions/widgets/issue-embed-suggestion-list"; + +export const getIssueSuggestionItems = + (issueSuggestions: Array) => + ({ query }: { query: string }) => { + const search = query.toLowerCase(); + const filteredSuggestions = issueSuggestions.filter( + (item) => + item.title.toLowerCase().includes(search) || + item.identifier.toLowerCase().includes(search) || + item.priority.toLowerCase().includes(search) + ); + + return filteredSuggestions; + }; diff --git a/packages/editor/document-editor/src/ui/extensions/widgets/IssueEmbedSuggestionList/issue-suggestion-renderer.tsx b/packages/editor/document-editor/src/ui/extensions/widgets/issue-embed-suggestion-list/issue-suggestion-renderer.tsx similarity index 99% rename from packages/editor/document-editor/src/ui/extensions/widgets/IssueEmbedSuggestionList/issue-suggestion-renderer.tsx rename to packages/editor/document-editor/src/ui/extensions/widgets/issue-embed-suggestion-list/issue-suggestion-renderer.tsx index 487d4f075..0a166c3e3 100644 --- a/packages/editor/document-editor/src/ui/extensions/widgets/IssueEmbedSuggestionList/issue-suggestion-renderer.tsx +++ b/packages/editor/document-editor/src/ui/extensions/widgets/issue-embed-suggestion-list/issue-suggestion-renderer.tsx @@ -171,7 +171,7 @@ const IssueSuggestionList = ({ section === currentSection && index === selectedIndex, } )} - key={index} + key={item.identifier} onClick={() => selectItem(index)} >
{item.identifier}
diff --git a/packages/editor/document-editor/src/ui/extensions/widgets/IssueEmbedWidget/index.tsx b/packages/editor/document-editor/src/ui/extensions/widgets/issue-embed-widget/index.tsx similarity index 55% rename from packages/editor/document-editor/src/ui/extensions/widgets/IssueEmbedWidget/index.tsx rename to packages/editor/document-editor/src/ui/extensions/widgets/issue-embed-widget/index.tsx index fb521efef..9bbb34aa5 100644 --- a/packages/editor/document-editor/src/ui/extensions/widgets/IssueEmbedWidget/index.tsx +++ b/packages/editor/document-editor/src/ui/extensions/widgets/issue-embed-widget/index.tsx @@ -1,5 +1,5 @@ -import { IssueWidget } from "./issue-widget-node"; -import { IIssueEmbedConfig } from "./types"; +import { IssueWidget } from "src/ui/extensions/widgets/issue-embed-widget/issue-widget-node"; +import { IIssueEmbedConfig } from "src/ui/extensions/widgets/issue-embed-widget/types"; interface IssueWidgetExtensionProps { issueEmbedConfig?: IIssueEmbedConfig; diff --git a/packages/editor/document-editor/src/ui/extensions/widgets/IssueEmbedWidget/issue-widget-card.tsx b/packages/editor/document-editor/src/ui/extensions/widgets/issue-embed-widget/issue-widget-card.tsx similarity index 91% rename from packages/editor/document-editor/src/ui/extensions/widgets/IssueEmbedWidget/issue-widget-card.tsx rename to packages/editor/document-editor/src/ui/extensions/widgets/issue-embed-widget/issue-widget-card.tsx index 18dad8cae..78554c26d 100644 --- a/packages/editor/document-editor/src/ui/extensions/widgets/IssueEmbedWidget/issue-widget-card.tsx +++ b/packages/editor/document-editor/src/ui/extensions/widgets/issue-embed-widget/issue-widget-card.tsx @@ -4,7 +4,7 @@ import { NodeViewWrapper } from "@tiptap/react"; import { Avatar, AvatarGroup, Loader, PriorityIcon } from "@plane/ui"; import { Calendar, AlertTriangle } from "lucide-react"; -const IssueWidgetCard = (props) => { +export const IssueWidgetCard = (props) => { const [loading, setLoading] = useState(1); const [issueDetails, setIssueDetails] = useState(); @@ -42,11 +42,9 @@ const IssueWidgetCard = (props) => {
- {issueDetails.assignee_details.map((assignee) => { - return ( - - ); - })} + {issueDetails.assignee_details.map((assignee) => ( + + ))}
{issueDetails.target_date && ( @@ -76,5 +74,3 @@ const IssueWidgetCard = (props) => { ); }; - -export default IssueWidgetCard; diff --git a/packages/editor/document-editor/src/ui/extensions/widgets/IssueEmbedWidget/issue-widget-node.tsx b/packages/editor/document-editor/src/ui/extensions/widgets/issue-embed-widget/issue-widget-node.tsx similarity index 94% rename from packages/editor/document-editor/src/ui/extensions/widgets/IssueEmbedWidget/issue-widget-node.tsx rename to packages/editor/document-editor/src/ui/extensions/widgets/issue-embed-widget/issue-widget-node.tsx index c30fe5e5b..c13637bd9 100644 --- a/packages/editor/document-editor/src/ui/extensions/widgets/IssueEmbedWidget/issue-widget-node.tsx +++ b/packages/editor/document-editor/src/ui/extensions/widgets/issue-embed-widget/issue-widget-node.tsx @@ -1,5 +1,5 @@ import { mergeAttributes, Node } from "@tiptap/core"; -import IssueWidgetCard from "./issue-widget-card"; +import { IssueWidgetCard } from "src/ui/extensions/widgets/issue-embed-widget/issue-widget-card"; import { ReactNodeViewRenderer } from "@tiptap/react"; export const IssueWidget = Node.create({ diff --git a/packages/editor/document-editor/src/ui/extensions/widgets/IssueEmbedWidget/types.ts b/packages/editor/document-editor/src/ui/extensions/widgets/issue-embed-widget/types.ts similarity index 100% rename from packages/editor/document-editor/src/ui/extensions/widgets/IssueEmbedWidget/types.ts rename to packages/editor/document-editor/src/ui/extensions/widgets/issue-embed-widget/types.ts diff --git a/packages/editor/document-editor/src/ui/index.tsx b/packages/editor/document-editor/src/ui/index.tsx index a99d1e6a8..df3554024 100644 --- a/packages/editor/document-editor/src/ui/index.tsx +++ b/packages/editor/document-editor/src/ui/index.tsx @@ -1,17 +1,16 @@ "use client"; import React, { useState } from "react"; -import { getEditorClassNames, useEditor } from "@plane/editor-core"; -import { DocumentEditorExtensions } from "./extensions"; -import { IDuplicationConfig, IPageArchiveConfig, IPageLockConfig } from "./types/menu-actions"; -import { EditorHeader } from "./components/editor-header"; -import { useEditorMarkings } from "./hooks/use-editor-markings"; -import { SummarySideBar } from "./components/summary-side-bar"; -import { DocumentDetails } from "./types/editor-types"; -import { PageRenderer } from "./components/page-renderer"; -import { getMenuOptions } from "./utils/menu-options"; +import { UploadImage, DeleteImage, RestoreImage, getEditorClassNames, useEditor } from "@plane/editor-core"; +import { DocumentEditorExtensions } from "src/ui/extensions"; +import { IDuplicationConfig, IPageArchiveConfig, IPageLockConfig } from "src/types/menu-actions"; +import { EditorHeader } from "src/ui/components/editor-header"; +import { useEditorMarkings } from "src/hooks/use-editor-markings"; +import { SummarySideBar } from "src/ui/components/summary-side-bar"; +import { DocumentDetails } from "src/types/editor-types"; +import { PageRenderer } from "src/ui/components/page-renderer"; +import { getMenuOptions } from "src/utils/menu-options"; import { useRouter } from "next/router"; -import { IEmbedConfig } from "./extensions/widgets/IssueEmbedWidget/types"; -import { UploadImage, DeleteImage, RestoreImage } from "@plane/editor-types"; +import { IEmbedConfig } from "src/ui/extensions/widgets/issue-embed-widget/types"; interface IDocumentEditor { // document info @@ -59,13 +58,6 @@ interface EditorHandle { setEditorValue: (content: string) => void; } -export interface IMarking { - type: "heading"; - level: number; - text: string; - sequence: number; -} - const DocumentEditor = ({ documentDetails, onChange, diff --git a/packages/editor/document-editor/src/ui/menu/fixed-menu.tsx b/packages/editor/document-editor/src/ui/menu/fixed-menu.tsx index f4b205484..cac42e1f9 100644 --- a/packages/editor/document-editor/src/ui/menu/fixed-menu.tsx +++ b/packages/editor/document-editor/src/ui/menu/fixed-menu.tsx @@ -17,8 +17,8 @@ import { HeadingThreeItem, findTableAncestor, EditorMenuItem, + UploadImage, } from "@plane/editor-core"; -import { UploadImage } from "@plane/editor-types"; export type BubbleMenuItem = EditorMenuItem; diff --git a/packages/editor/document-editor/src/ui/readonly/index.tsx b/packages/editor/document-editor/src/ui/readonly/index.tsx index e7897755e..7445bfd6d 100644 --- a/packages/editor/document-editor/src/ui/readonly/index.tsx +++ b/packages/editor/document-editor/src/ui/readonly/index.tsx @@ -1,15 +1,15 @@ import { getEditorClassNames, useReadOnlyEditor } from "@plane/editor-core"; import { useRouter } from "next/router"; import { useState, forwardRef, useEffect } from "react"; -import { EditorHeader } from "../components/editor-header"; -import { PageRenderer } from "../components/page-renderer"; -import { SummarySideBar } from "../components/summary-side-bar"; -import { IssueWidgetExtension } from "../extensions/widgets/IssueEmbedWidget"; -import { IEmbedConfig } from "../extensions/widgets/IssueEmbedWidget/types"; -import { useEditorMarkings } from "../hooks/use-editor-markings"; -import { DocumentDetails } from "../types/editor-types"; -import { IPageArchiveConfig, IPageLockConfig, IDuplicationConfig } from "../types/menu-actions"; -import { getMenuOptions } from "../utils/menu-options"; +import { EditorHeader } from "src/ui/components/editor-header"; +import { PageRenderer } from "src/ui/components/page-renderer"; +import { SummarySideBar } from "src/ui/components/summary-side-bar"; +import { IssueWidgetExtension } from "src/ui/extensions/widgets/issue-embed-widget"; +import { IEmbedConfig } from "src/ui/extensions/widgets/issue-embed-widget/types"; +import { useEditorMarkings } from "src/hooks/use-editor-markings"; +import { DocumentDetails } from "src/types/editor-types"; +import { IPageArchiveConfig, IPageLockConfig, IDuplicationConfig } from "src/types/menu-actions"; +import { getMenuOptions } from "src/utils/menu-options"; interface IDocumentReadOnlyEditor { value: string; diff --git a/packages/editor/document-editor/src/ui/utils/editor-summary-utils.ts b/packages/editor/document-editor/src/utils/editor-summary-utils.ts similarity index 94% rename from packages/editor/document-editor/src/ui/utils/editor-summary-utils.ts rename to packages/editor/document-editor/src/utils/editor-summary-utils.ts index 248f439e3..b5160fddd 100644 --- a/packages/editor/document-editor/src/ui/utils/editor-summary-utils.ts +++ b/packages/editor/document-editor/src/utils/editor-summary-utils.ts @@ -1,5 +1,5 @@ import { Editor } from "@tiptap/react"; -import { IMarking } from ".."; +import { IMarking } from "src/types/editor-types"; function findNthH1(editor: Editor, n: number, level: number): number { let count = 0; diff --git a/packages/editor/document-editor/src/ui/utils/menu-actions.ts b/packages/editor/document-editor/src/utils/menu-actions.ts similarity index 100% rename from packages/editor/document-editor/src/ui/utils/menu-actions.ts rename to packages/editor/document-editor/src/utils/menu-actions.ts diff --git a/packages/editor/document-editor/src/ui/utils/menu-options.ts b/packages/editor/document-editor/src/utils/menu-options.ts similarity index 93% rename from packages/editor/document-editor/src/ui/utils/menu-options.ts rename to packages/editor/document-editor/src/utils/menu-options.ts index 0b4d02476..befed424d 100644 --- a/packages/editor/document-editor/src/ui/utils/menu-options.ts +++ b/packages/editor/document-editor/src/utils/menu-options.ts @@ -1,19 +1,9 @@ import { Editor } from "@tiptap/react"; -import { - Archive, - ArchiveIcon, - ArchiveRestoreIcon, - ClipboardIcon, - Copy, - Link, - Lock, - Unlock, - XCircle, -} from "lucide-react"; +import { Archive, ArchiveRestoreIcon, ClipboardIcon, Copy, Link, Lock, Unlock } from "lucide-react"; import { NextRouter } from "next/router"; -import { IVerticalDropdownItemProps } from "../components/vertical-dropdown-menu"; -import { IDuplicationConfig, IPageArchiveConfig, IPageLockConfig } from "../types/menu-actions"; -import { copyMarkdownToClipboard, CopyPageLink } from "./menu-actions"; +import { IVerticalDropdownItemProps } from "src/ui/components/vertical-dropdown-menu"; +import { IDuplicationConfig, IPageArchiveConfig, IPageLockConfig } from "src/types/menu-actions"; +import { copyMarkdownToClipboard, CopyPageLink } from "src/utils/menu-actions"; export interface MenuOptionsProps { editor: Editor; diff --git a/packages/editor/document-editor/tsconfig.json b/packages/editor/document-editor/tsconfig.json index 57d0e9a74..c15534037 100644 --- a/packages/editor/document-editor/tsconfig.json +++ b/packages/editor/document-editor/tsconfig.json @@ -1,5 +1,15 @@ { "extends": "tsconfig/react-library.json", - "include": ["src/**/*", "index.d.ts"], - "exclude": ["dist", "build", "node_modules"] + "include": [ + "src/**/*", + "index.d.ts" + ], + "exclude": [ + "dist", + "build", + "node_modules" + ], + "compilerOptions": { + "baseUrl": "." + } } diff --git a/packages/editor/extensions/package.json b/packages/editor/extensions/package.json index 48abd7701..dda0e58db 100644 --- a/packages/editor/extensions/package.json +++ b/packages/editor/extensions/package.json @@ -29,11 +29,10 @@ }, "dependencies": { "@plane/editor-core": "*", - "@plane/editor-types": "*", - "@tiptap/core": "^2.1.7", - "@tiptap/pm": "^2.1.7", - "@tiptap/react": "^2.1.7", - "@tiptap/suggestion": "^2.0.4", + "@tiptap/core": "^2.1.13", + "@tiptap/pm": "^2.1.13", + "@tiptap/react": "^2.1.13", + "@tiptap/suggestion": "^2.1.13", "eslint": "8.36.0", "eslint-config-next": "13.2.4", "lucide-react": "^0.294.0", diff --git a/packages/editor/extensions/src/extensions/slash-commands.tsx b/packages/editor/extensions/src/extensions/slash-commands.tsx index 92152b43a..b653ab269 100644 --- a/packages/editor/extensions/src/extensions/slash-commands.tsx +++ b/packages/editor/extensions/src/extensions/slash-commands.tsx @@ -1,9 +1,8 @@ import { useState, useEffect, useCallback, ReactNode, useRef, useLayoutEffect } from "react"; import { Editor, Range, Extension } from "@tiptap/core"; -import Suggestion from "@tiptap/suggestion"; +import Suggestion, { SuggestionOptions } from "@tiptap/suggestion"; import { ReactRenderer } from "@tiptap/react"; import tippy from "tippy.js"; -import type { UploadImage, ISlashCommandItem, CommandProps } from "@plane/editor-types"; import { CaseSensitive, Code2, @@ -19,6 +18,9 @@ import { Table, } from "lucide-react"; import { + UploadImage, + ISlashCommandItem, + CommandProps, cn, insertTableCommand, toggleBlockquote, @@ -38,7 +40,11 @@ interface CommandItemProps { icon: ReactNode; } -const Command = Extension.create({ +export type SlashCommandOptions = { + suggestion: Omit; +}; + +const Command = Extension.create({ name: "slash-command", addOptions() { return { @@ -47,6 +53,10 @@ const Command = Extension.create({ command: ({ editor, range, props }: { editor: Editor; range: Range; props: any }) => { props.command({ editor, range }); }, + allow({ editor }: { editor: Editor }) { + return !editor.isActive("table"); + }, + allowSpaces: true, }, }; }, @@ -54,9 +64,6 @@ const Command = Extension.create({ return [ Suggestion({ editor: this.editor, - allow({ editor }) { - return !editor.isActive("table"); - }, ...this.options.suggestion, }), ]; @@ -173,7 +180,7 @@ const getSuggestionItems = key: "image", title: "Image", description: "Upload an image from your computer.", - searchTerms: ["photo", "picture", "media"], + searchTerms: ["img", "photo", "picture", "media"], icon: , command: ({ editor, range }: CommandProps) => { insertImageCommand(editor, uploadFile, setIsSubmitting, range); diff --git a/packages/editor/extensions/src/index.ts b/packages/editor/extensions/src/index.ts index 76461c2e6..c0532c594 100644 --- a/packages/editor/extensions/src/index.ts +++ b/packages/editor/extensions/src/index.ts @@ -1,2 +1,4 @@ -export { SlashCommand } from "./extensions/slash-commands"; -export { DragAndDrop } from "./extensions/drag-drop"; +import "src/styles/drag-drop.css"; + +export { SlashCommand } from "src/extensions/slash-commands"; +export { DragAndDrop } from "src/extensions/drag-drop"; diff --git a/packages/editor/extensions/src/styles/drag-drop.css b/packages/editor/extensions/src/styles/drag-drop.css new file mode 100644 index 000000000..d95a8654b --- /dev/null +++ b/packages/editor/extensions/src/styles/drag-drop.css @@ -0,0 +1,53 @@ +.drag-handle { + position: fixed; + opacity: 1; + transition: opacity ease-in 0.2s; + height: 18px; + width: 15px; + display: grid; + place-items: center; + z-index: 10; + cursor: grab; + border-radius: 2px; + background-color: rgb(var(--color-background-90)); +} + +.drag-handle:hover { + background-color: rgb(var(--color-background-80)); + transition: background-color 0.2s; +} + +.drag-handle.hidden { + opacity: 0; + pointer-events: none; +} + +@media screen and (max-width: 600px) { + .drag-handle { + display: none; + pointer-events: none; + } +} + +.drag-handle-container { + height: 15px; + width: 15px; + cursor: grab; + display: grid; + place-items: center; +} + +.drag-handle-dots { + height: 100%; + width: 12px; + display: grid; + grid-template-columns: repeat(2, 1fr); + place-items: center; +} + +.drag-handle-dot { + height: 2.75px; + width: 3px; + background-color: rgba(var(--color-text-200)); + border-radius: 50%; +} diff --git a/packages/editor/extensions/tsconfig.json b/packages/editor/extensions/tsconfig.json index 57d0e9a74..c15534037 100644 --- a/packages/editor/extensions/tsconfig.json +++ b/packages/editor/extensions/tsconfig.json @@ -1,5 +1,15 @@ { "extends": "tsconfig/react-library.json", - "include": ["src/**/*", "index.d.ts"], - "exclude": ["dist", "build", "node_modules"] + "include": [ + "src/**/*", + "index.d.ts" + ], + "exclude": [ + "dist", + "build", + "node_modules" + ], + "compilerOptions": { + "baseUrl": "." + } } diff --git a/packages/editor/lite-text-editor/package.json b/packages/editor/lite-text-editor/package.json index bcaa36a02..7882d60ff 100644 --- a/packages/editor/lite-text-editor/package.json +++ b/packages/editor/lite-text-editor/package.json @@ -30,8 +30,7 @@ }, "dependencies": { "@plane/editor-core": "*", - "@plane/ui": "*", - "@plane/editor-types": "*" + "@plane/ui": "*" }, "devDependencies": { "@types/node": "18.15.3", diff --git a/packages/editor/lite-text-editor/src/index.ts b/packages/editor/lite-text-editor/src/index.ts index f09ce54a4..c37d45039 100644 --- a/packages/editor/lite-text-editor/src/index.ts +++ b/packages/editor/lite-text-editor/src/index.ts @@ -1,3 +1,3 @@ -export { LiteTextEditor, LiteTextEditorWithRef } from "./ui"; -export { LiteReadOnlyEditor, LiteReadOnlyEditorWithRef } from "./ui/read-only"; -export type { IMentionSuggestion, IMentionHighlight } from "@plane/editor-types"; +export { LiteTextEditor, LiteTextEditorWithRef } from "src/ui"; +export { LiteReadOnlyEditor, LiteReadOnlyEditorWithRef } from "src/ui/read-only"; +export type { IMentionSuggestion, IMentionHighlight } from "@plane/editor-core"; diff --git a/packages/editor/lite-text-editor/src/ui/extensions/index.tsx b/packages/editor/lite-text-editor/src/ui/extensions/index.tsx index 4531e9516..527fd5674 100644 --- a/packages/editor/lite-text-editor/src/ui/extensions/index.tsx +++ b/packages/editor/lite-text-editor/src/ui/extensions/index.tsx @@ -1,4 +1,4 @@ -import { EnterKeyExtension } from "./enter-key-extension"; +import { EnterKeyExtension } from "src/ui/extensions/enter-key-extension"; export const LiteTextEditorExtensions = (onEnterKeyPress?: () => void) => [ // EnterKeyExtension(onEnterKeyPress), diff --git a/packages/editor/lite-text-editor/src/ui/index.tsx b/packages/editor/lite-text-editor/src/ui/index.tsx index 0eb0e20df..57774ab5d 100644 --- a/packages/editor/lite-text-editor/src/ui/index.tsx +++ b/packages/editor/lite-text-editor/src/ui/index.tsx @@ -1,8 +1,16 @@ import * as React from "react"; -import { EditorContainer, EditorContentWrapper, getEditorClassNames, useEditor } from "@plane/editor-core"; -import { FixedMenu } from "./menus/fixed-menu"; -import { LiteTextEditorExtensions } from "./extensions"; -import { UploadImage, DeleteImage, IMentionSuggestion, RestoreImage } from "@plane/editor-types"; +import { + UploadImage, + DeleteImage, + IMentionSuggestion, + RestoreImage, + EditorContainer, + EditorContentWrapper, + getEditorClassNames, + useEditor, +} from "@plane/editor-core"; +import { FixedMenu } from "src/ui/menus/fixed-menu"; +import { LiteTextEditorExtensions } from "src/ui/extensions"; interface ILiteTextEditor { value: string; diff --git a/packages/editor/lite-text-editor/src/ui/menus/fixed-menu/index.tsx b/packages/editor/lite-text-editor/src/ui/menus/fixed-menu/index.tsx index 95bd8d6dd..71ad4e0e1 100644 --- a/packages/editor/lite-text-editor/src/ui/menus/fixed-menu/index.tsx +++ b/packages/editor/lite-text-editor/src/ui/menus/fixed-menu/index.tsx @@ -9,27 +9,21 @@ import { ImageItem, isCellSelection, ItalicItem, + LucideIconType, NumberedListItem, QuoteItem, StrikeThroughItem, TableItem, UnderLineItem, + UploadImage, } from "@plane/editor-core"; import { Tooltip } from "@plane/ui"; -import type { SVGProps } from "react"; -import { UploadImage } from "@plane/editor-types"; -interface LucideProps extends Partial> { - size?: string | number; - absoluteStrokeWidth?: boolean; -} - -type LucideIcon = (props: LucideProps) => JSX.Element; export interface BubbleMenuItem { name: string; isActive: () => boolean; command: () => void; - icon: LucideIcon; + icon: LucideIconType; } type EditorBubbleMenuProps = { @@ -127,8 +121,8 @@ export const FixedMenu = (props: EditorBubbleMenuProps) => {
- {basicTextFormattingItems.map((item, index) => ( - {item.name}}> + {basicTextFormattingItems.map((item) => ( + {item.name}}>
- {listFormattingItems.map((item, index) => ( - {item.name}}> + {listFormattingItems.map((item) => ( + {item.name}}>
- {userActionItems.map((item, index) => ( - {item.name}}> + {userActionItems.map((item) => ( + {item.name}}>
- {complexItems.map((item, index) => ( - {item.name}}> + {complexItems.map((item) => ( + {item.name}}>
- } - position={position} - renderTarget={({ isOpen: isTooltipOpen, ref: eleReference, ...tooltipProps }) => - React.cloneElement(children, { - ref: eleReference, - ...tooltipProps, - ...children.props, - }) - } - /> - ); -}; diff --git a/packages/editor/lite-text-editor/tsconfig.json b/packages/editor/lite-text-editor/tsconfig.json index 57d0e9a74..c15534037 100644 --- a/packages/editor/lite-text-editor/tsconfig.json +++ b/packages/editor/lite-text-editor/tsconfig.json @@ -1,5 +1,15 @@ { "extends": "tsconfig/react-library.json", - "include": ["src/**/*", "index.d.ts"], - "exclude": ["dist", "build", "node_modules"] + "include": [ + "src/**/*", + "index.d.ts" + ], + "exclude": [ + "dist", + "build", + "node_modules" + ], + "compilerOptions": { + "baseUrl": "." + } } diff --git a/packages/editor/rich-text-editor/package.json b/packages/editor/rich-text-editor/package.json index baac553b8..245248d45 100644 --- a/packages/editor/rich-text-editor/package.json +++ b/packages/editor/rich-text-editor/package.json @@ -31,9 +31,8 @@ "dependencies": { "@plane/editor-core": "*", "@plane/editor-extensions": "*", - "@plane/editor-types": "*", - "@tiptap/core": "^2.1.11", - "@tiptap/extension-placeholder": "^2.1.11", + "@tiptap/core": "^2.1.13", + "@tiptap/extension-placeholder": "^2.1.13", "lucide-react": "^0.294.0" }, "devDependencies": { diff --git a/packages/editor/rich-text-editor/src/index.ts b/packages/editor/rich-text-editor/src/index.ts index 7dc0783d9..eb745c45b 100644 --- a/packages/editor/rich-text-editor/src/index.ts +++ b/packages/editor/rich-text-editor/src/index.ts @@ -1,4 +1,4 @@ -export { RichTextEditor, RichTextEditorWithRef } from "./ui"; -export { RichReadOnlyEditor, RichReadOnlyEditorWithRef } from "./ui/read-only"; -export type { RichTextEditorProps, IRichTextEditor } from "./ui"; -export type { IMentionHighlight, IMentionSuggestion } from "@plane/editor-types"; +export { RichTextEditor, RichTextEditorWithRef } from "src/ui"; +export { RichReadOnlyEditor, RichReadOnlyEditorWithRef } from "src/ui/read-only"; +export type { RichTextEditorProps, IRichTextEditor } from "src/ui"; +export type { IMentionHighlight, IMentionSuggestion } from "@plane/editor-core"; diff --git a/packages/editor/rich-text-editor/src/ui/extensions/index.tsx b/packages/editor/rich-text-editor/src/ui/extensions/index.tsx index 9a9d406b7..1e81c8173 100644 --- a/packages/editor/rich-text-editor/src/ui/extensions/index.tsx +++ b/packages/editor/rich-text-editor/src/ui/extensions/index.tsx @@ -1,7 +1,6 @@ -import { SlashCommand } from "@plane/editor-extensions"; +import { SlashCommand, DragAndDrop } from "@plane/editor-extensions"; import Placeholder from "@tiptap/extension-placeholder"; -import { DragAndDrop } from "@plane/editor-extensions"; -import { UploadImage } from "@plane/editor-types"; +import { UploadImage } from "@plane/editor-core"; export const RichTextEditorExtensions = ( uploadFile: UploadImage, diff --git a/packages/editor/rich-text-editor/src/ui/index.tsx b/packages/editor/rich-text-editor/src/ui/index.tsx index 5d34eb85d..17d701600 100644 --- a/packages/editor/rich-text-editor/src/ui/index.tsx +++ b/packages/editor/rich-text-editor/src/ui/index.tsx @@ -1,9 +1,17 @@ "use client"; import * as React from "react"; -import { EditorContainer, EditorContentWrapper, getEditorClassNames, useEditor } from "@plane/editor-core"; -import { EditorBubbleMenu } from "./menus/bubble-menu"; -import { RichTextEditorExtensions } from "./extensions"; -import { DeleteImage, IMentionSuggestion, RestoreImage, UploadImage } from "@plane/editor-types"; +import { + DeleteImage, + EditorContainer, + EditorContentWrapper, + getEditorClassNames, + IMentionSuggestion, + RestoreImage, + UploadImage, + useEditor, +} from "@plane/editor-core"; +import { EditorBubbleMenu } from "src/ui/menus/bubble-menu"; +import { RichTextEditorExtensions } from "src/ui/extensions"; export type IRichTextEditor = { value: string; diff --git a/packages/editor/rich-text-editor/src/ui/menus/bubble-menu/index.tsx b/packages/editor/rich-text-editor/src/ui/menus/bubble-menu/index.tsx index 7e9c834a7..2e7dd25b8 100644 --- a/packages/editor/rich-text-editor/src/ui/menus/bubble-menu/index.tsx +++ b/packages/editor/rich-text-editor/src/ui/menus/bubble-menu/index.tsx @@ -1,15 +1,15 @@ import { BubbleMenu, BubbleMenuProps, isNodeSelection } from "@tiptap/react"; import { FC, useEffect, useState } from "react"; -import { BoldIcon } from "lucide-react"; -import { NodeSelector } from "./node-selector"; -import { LinkSelector } from "./link-selector"; +import { NodeSelector } from "src/ui/menus/bubble-menu/node-selector"; +import { LinkSelector } from "src/ui/menus/bubble-menu/link-selector"; import { BoldItem, cn, CodeItem, isCellSelection, ItalicItem, + LucideIconType, StrikeThroughItem, UnderLineItem, } from "@plane/editor-core"; @@ -18,7 +18,7 @@ export interface BubbleMenuItem { name: string; isActive: () => boolean; command: () => void; - icon: typeof BoldIcon; + icon: LucideIconType; } type EditorBubbleMenuProps = Omit; @@ -117,9 +117,9 @@ export const EditorBubbleMenu: FC = (props: any) => { }} />
- {items.map((item, index) => ( + {items.map((item) => ( - )} - {comicBox && - isHovered && - (comicBox.direction === "right" ? ( -
+ {primaryButton && ( + + )} + {comicBox && + isHovered && + (comicBox.direction === "right" ? ( +
+
+
+
+
+

+

{comicBox?.title}

+

{comicBox?.description}

+ +
-
-

-

{comicBox?.title}

-

{comicBox?.description}

- + ) : ( +
+
+
+
+
+

+

{comicBox?.title}

+

{comicBox?.description}

+ +
-
- ) : ( -
-
-
-
-
-

-

{comicBox?.title}

-

{comicBox?.description}

- -
-
- ))} + ))} +
diff --git a/web/components/instance/email-form.tsx b/web/components/instance/email-form.tsx index 82da7553e..9d23f398f 100644 --- a/web/components/instance/email-form.tsx +++ b/web/components/instance/email-form.tsx @@ -67,7 +67,7 @@ export const InstanceEmailForm: FC = (props) => { return ( <> -
+

Host

= (props) => { />
-
+

Username

= (props) => {
-
+

From address

= (props) => { )} />

- You will have to verify your email address to being sending emails. + This is the email address your users will see when getting emails from this instance. You will need to + verify this address.

-
+
diff --git a/web/components/instance/setup-form/sign-in-form.tsx b/web/components/instance/setup-form/sign-in-form.tsx index c4fd0dbe0..1f3bf61f7 100644 --- a/web/components/instance/setup-form/sign-in-form.tsx +++ b/web/components/instance/setup-form/sign-in-form.tsx @@ -90,7 +90,7 @@ export const InstanceSetupSignInForm: FC = (props) => { type="email" value={value} onChange={onChange} - placeholder="orville.wright@firstflight.com" + placeholder="orville.wright@frstflt.com" className="h-[46px] w-full border border-onboarding-border-100 pr-12 placeholder:text-onboarding-text-400" /> {value.length > 0 && ( diff --git a/web/components/issues/issue-layouts/kanban/quick-add-issue-form.tsx b/web/components/issues/issue-layouts/kanban/quick-add-issue-form.tsx index 0120e02f6..9c4406f7d 100644 --- a/web/components/issues/issue-layouts/kanban/quick-add-issue-form.tsx +++ b/web/components/issues/issue-layouts/kanban/quick-add-issue-form.tsx @@ -22,7 +22,7 @@ const Inputs = (props: any) => { }, [setFocus]); return ( -
+

{projectDetail?.identifier ?? "..."}

= observer((prop */ const onDiscardClose = () => { - if (formDirtyState !== null) { + if (formDirtyState !== null && formDirtyState.name.trim() !== "") { setShowConfirmDiscard(true); } else { handleClose(); diff --git a/web/components/onboarding/invite-members.tsx b/web/components/onboarding/invite-members.tsx index 38ea28f56..44746cae1 100644 --- a/web/components/onboarding/invite-members.tsx +++ b/web/components/onboarding/invite-members.tsx @@ -70,16 +70,16 @@ const workspaceService = new WorkspaceService(); const emailRegex = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i; const placeholderEmails = [ - "charlie.taylor@frstflit.com", - "octave.chanute@frstflit.com", - "george.spratt@frstflit.com", - "frank.coffyn@frstflit.com", - "amos.root@frstflit.com", - "edward.deeds@frstflit.com", - "charles.m.manly@frstflit.com", - "glenn.curtiss@frstflit.com", - "thomas.selfridge@frstflit.com", - "albert.zahm@frstflit.com", + "charlie.taylor@frstflt.com", + "octave.chanute@frstflt.com", + "george.spratt@frstflt.com", + "frank.coffyn@frstflt.com", + "amos.root@frstflt.com", + "edward.deeds@frstflt.com", + "charles.m.manly@frstflt.com", + "glenn.curtiss@frstflt.com", + "thomas.selfridge@frstflt.com", + "albert.zahm@frstflt.com", ]; const InviteMemberForm: React.FC = (props) => { const { diff --git a/web/components/profile/sidebar.tsx b/web/components/profile/sidebar.tsx index 6c01db9f7..79cc96b5a 100644 --- a/web/components/profile/sidebar.tsx +++ b/web/components/profile/sidebar.tsx @@ -89,8 +89,8 @@ export const ProfileSidebar = () => { className="h-full w-full rounded object-cover" /> ) : ( -
- {userProjectsData.user_data.display_name?.[0]} +
+ {userProjectsData.user_data.first_name?.[0]}
)}
@@ -149,8 +149,8 @@ export const ProfileSidebar = () => { completedIssuePercentage <= 35 ? "bg-red-500/10 text-red-500" : completedIssuePercentage <= 70 - ? "bg-yellow-500/10 text-yellow-500" - : "bg-green-500/10 text-green-500" + ? "bg-yellow-500/10 text-yellow-500" + : "bg-green-500/10 text-green-500" }`} > {completedIssuePercentage}% diff --git a/web/components/project/create-project-modal.tsx b/web/components/project/create-project-modal.tsx index 83c7851b9..2207bb898 100644 --- a/web/components/project/create-project-modal.tsx +++ b/web/components/project/create-project-modal.tsx @@ -182,7 +182,7 @@ export const CreateProjectModal: FC = observer((props) => { setValue( "identifier", e.target.value - .replace(/[^a-zA-Z0-9]/g, "") + .replace(/[^ÇŞĞIİÖÜA-Za-z0-9]/g, "") .toUpperCase() .substring(0, 5) ); @@ -191,7 +191,7 @@ export const CreateProjectModal: FC = observer((props) => { const handleIdentifierChange = (onChange: any) => (e: ChangeEvent) => { const { value } = e.target; - const alphanumericValue = value.replace(/[^a-zA-Z0-9]/g, ""); + const alphanumericValue = value.replace(/[^ÇŞĞIİÖÜA-Za-z0-9]/g, ""); setIsChangeInIdentifierRequired(false); onChange(alphanumericValue.toUpperCase()); }; @@ -301,8 +301,9 @@ export const CreateProjectModal: FC = observer((props) => { name="identifier" rules={{ required: "Identifier is required", + // allow only alphanumeric & non-latin characters validate: (value) => - /^[A-Z0-9]+$/.test(value.toUpperCase()) || "Identifier must be in uppercase.", + /^[ÇŞĞIİÖÜA-Z0-9]+$/.test(value.toUpperCase()) || "Identifier must be in uppercase.", minLength: { value: 1, message: "Identifier must at least be of 1 character", diff --git a/web/components/workspace/send-workspace-invitation-modal.tsx b/web/components/workspace/send-workspace-invitation-modal.tsx index a720e31f5..43609d1c5 100644 --- a/web/components/workspace/send-workspace-invitation-modal.tsx +++ b/web/components/workspace/send-workspace-invitation-modal.tsx @@ -68,6 +68,12 @@ export const SendWorkspaceInvitationModal: React.FC = observer((props) => append({ email: "", role: 15 }); }; + const onSubmitForm = async (data: FormValues) => { + await onSubmit(data)?.then(() => { + reset(defaultValues); + }); + }; + useEffect(() => { if (fields.length === 0) append([{ email: "", role: 15 }]); }, [fields, append]); @@ -100,7 +106,7 @@ export const SendWorkspaceInvitationModal: React.FC = observer((props) => >
{ if (e.code === "Enter") e.preventDefault(); }} diff --git a/web/pages/_app.tsx b/web/pages/_app.tsx index c6fb89772..e8c10812a 100644 --- a/web/pages/_app.tsx +++ b/web/pages/_app.tsx @@ -3,8 +3,6 @@ import Head from "next/head"; import { AppProps } from "next/app"; // styles import "styles/globals.css"; -import "styles/editor.css"; -import "styles/table.css"; import "styles/command-pallette.css"; import "styles/nprogress.css"; import "styles/react-datepicker.css"; diff --git a/web/pages/accounts/password.tsx b/web/pages/accounts/password.tsx index 9ea99f2b3..b5683d210 100644 --- a/web/pages/accounts/password.tsx +++ b/web/pages/accounts/password.tsx @@ -108,7 +108,7 @@ const HomePage: NextPageWithLayout = () => { onChange={onChange} ref={ref} hasError={Boolean(errors.email)} - placeholder="orville.wright@firstflight.com" + placeholder="orville.wright@frstflt.com" className="h-[46px] w-full border border-onboarding-border-100 !bg-onboarding-background-200 pr-12 text-onboarding-text-400" disabled /> diff --git a/web/styles/editor.css b/web/styles/editor.css deleted file mode 100644 index 149896c52..000000000 --- a/web/styles/editor.css +++ /dev/null @@ -1,333 +0,0 @@ -.ProseMirror p.is-editor-empty:first-child::before { - content: attr(data-placeholder); - float: left; - color: rgb(var(--color-text-400)); - pointer-events: none; - height: 0; -} - -/* block quotes */ -.ProseMirror blockquote p::before, -.ProseMirror blockquote p::after { - display: none; -} - -.ProseMirror .is-empty::before { - content: attr(data-placeholder); - float: left; - color: rgb(var(--color-text-400)); - pointer-events: none; - height: 0; -} - -/* Custom image styles */ - -.ProseMirror img { - transition: filter 0.1s ease-in-out; - - &:hover { - cursor: pointer; - filter: brightness(90%); - } - - &.ProseMirror-selectednode { - outline: 3px solid #5abbf7; - filter: brightness(90%); - } -} - -.ProseMirror-gapcursor:after { - border-top: 1px solid rgb(var(--color-text-100)) !important; -} - -/* Custom TODO list checkboxes – shoutout to this awesome tutorial: https://moderncss.dev/pure-css-custom-checkbox-style/ */ - -ul[data-type="taskList"] li > label { - margin-right: 0.2rem; - user-select: none; -} - -@media screen and (max-width: 768px) { - ul[data-type="taskList"] li > label { - margin-right: 0.5rem; - } -} - -ul[data-type="taskList"] li > label input[type="checkbox"] { - -webkit-appearance: none; - appearance: none; - background-color: rgb(var(--color-background-100)); - margin: 0; - cursor: pointer; - width: 0.8rem; - height: 0.8rem; - position: relative; - border: 1.5px solid rgb(var(--color-text-100)); - margin-right: 0.2rem; - margin-top: 0.15rem; - display: grid; - place-content: center; - - &:hover { - background-color: rgb(var(--color-background-80)); - } - - &:active { - background-color: rgb(var(--color-background-90)); - } - - &::before { - content: ""; - width: 0.5em; - height: 0.5em; - transform: scale(0); - transition: 120ms transform ease-in-out; - box-shadow: inset 1em 1em; - transform-origin: center; - clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%); - } - - &:checked::before { - transform: scale(1); - } -} - -ul[data-type="taskList"] li[data-checked="true"] > div > p { - color: rgb(var(--color-text-200)); - text-decoration: line-through; - text-decoration-thickness: 2px; -} - -/* Overwrite tippy-box original max-width */ - -.tippy-box { - max-width: 400px !important; -} - -.ProseMirror { - position: relative; - word-wrap: break-word; - white-space: pre-wrap; - -moz-tab-size: 4; - tab-size: 4; - -webkit-user-select: text; - -moz-user-select: text; - -ms-user-select: text; - user-select: text; - outline: none; - cursor: text; - line-height: 1.2; - font-family: inherit; - font-size: 14px; - color: inherit; - -moz-box-sizing: border-box; - box-sizing: border-box; - appearance: textfield; - -webkit-appearance: textfield; - -moz-appearance: textfield; -} - -.fadeIn { - opacity: 1; - transition: opacity 0.3s ease-in; -} - -.fadeOut { - opacity: 0; - transition: opacity 0.2s ease-out; -} - -.img-placeholder { - position: relative; - width: 35%; - - &:before { - content: ""; - box-sizing: border-box; - position: absolute; - top: 50%; - left: 45%; - width: 20px; - height: 20px; - border-radius: 50%; - border: 3px solid rgba(var(--color-text-200)); - border-top-color: rgba(var(--color-text-800)); - animation: spinning 0.6s linear infinite; - } -} - -@keyframes spinning { - to { - transform: rotate(360deg); - } -} - -#editor-container { - table { - border-collapse: collapse; - table-layout: fixed; - margin: 0; - border: 1px solid rgb(var(--color-border-200)); - width: 100%; - - td, - th { - min-width: 1em; - border: 1px solid rgb(var(--color-border-200)); - padding: 10px 15px; - vertical-align: top; - box-sizing: border-box; - position: relative; - transition: background-color 0.3s ease; - - > * { - margin-bottom: 0; - } - } - - th { - font-weight: bold; - text-align: left; - background-color: rgb(var(--color-primary-100)); - } - - td:hover { - background-color: rgba(var(--color-primary-300), 0.1); - } - - .selectedCell:after { - z-index: 2; - position: absolute; - content: ""; - left: 0; - right: 0; - top: 0; - bottom: 0; - background-color: rgba(var(--color-primary-300), 0.1); - pointer-events: none; - } - - .column-resize-handle { - position: absolute; - right: -2px; - top: 0; - bottom: -2px; - width: 2px; - background-color: rgb(var(--color-primary-400)); - pointer-events: none; - } - } -} - -.tableWrapper { - overflow-x: auto; -} - -.resize-cursor { - cursor: ew-resize; - cursor: col-resize; -} - -.ProseMirror table * p { - padding: 0px 1px; - margin: 6px 2px; -} - -.ProseMirror table * .is-empty::before { - opacity: 0; -} - -.ProseMirror pre { - background: rgba(var(--color-background-80)); - border-radius: 0.5rem; - color: rgba(var(--color-text-100)); - font-family: "JetBrainsMono", monospace; - padding: 0.75rem 1rem; -} - -.ProseMirror pre code { - background: none; - color: inherit; - font-size: 0.8rem; - padding: 0; -} - -/* .ProseMirror:not(.dragging) .ProseMirror-selectednode:not(.node-image):not(pre) { */ -/* outline: none !important; */ -/* border-radius: 0.2rem; */ -/* background-color: rgb(var(--color-background-90)); */ -/* border: 1px solid #5abbf7; */ -/* padding: 4px 2px 4px 2px; */ -/* transition: background-color 0.2s; */ -/* box-shadow: none; */ -/* } */ - -.drag-handle { - position: fixed; - opacity: 1; - transition: opacity ease-in 0.2s; - height: 18px; - width: 15px; - display: grid; - place-items: center; - z-index: 10; - cursor: grab; - border-radius: 2px; - background-color: rgb(var(--color-background-90)); -} - -.drag-handle:hover { - background-color: rgb(var(--color-background-80)); - transition: background-color 0.2s; -} - -.drag-handle.hidden { - opacity: 0; - pointer-events: none; -} - -@media screen and (max-width: 600px) { - .drag-handle { - display: none; - pointer-events: none; - } -} - -.drag-handle-container { - height: 15px; - width: 15px; - cursor: grab; - display: grid; - place-items: center; -} - -.drag-handle-dots { - height: 100%; - width: 12px; - display: grid; - grid-template-columns: repeat(2, 1fr); - place-items: center; -} - -.drag-handle-dot { - height: 2.75px; - width: 3px; - background-color: rgba(var(--color-text-200)); - border-radius: 50%; -} - -div[data-type="horizontalRule"] { - line-height: 0; - padding: 0.25rem 0; - margin-top: 0; - margin-bottom: 0; - - & > div { - border-bottom: 1px solid rgb(var(--color-text-100)); - } -} - -/* image resizer */ -.moveable-control-box { - z-index: 10 !important; -} diff --git a/web/styles/table.css b/web/styles/table.css deleted file mode 100644 index bce7e4683..000000000 --- a/web/styles/table.css +++ /dev/null @@ -1,206 +0,0 @@ -.tableWrapper { - overflow-x: auto; - padding: 2px; - width: fit-content; - max-width: 100%; -} - -.tableWrapper table { - border-collapse: collapse; - table-layout: fixed; - margin: 0; - margin-bottom: 3rem; - border: 1px solid rgba(var(--color-border-200)); - width: 100%; -} - -.tableWrapper table td, -.tableWrapper table th { - min-width: 1em; - border: 1px solid rgba(var(--color-border-200)); - padding: 10px 15px; - vertical-align: top; - box-sizing: border-box; - position: relative; - transition: background-color 0.3s ease; - - > * { - margin-bottom: 0; - } -} - -.tableWrapper table td > *, -.tableWrapper table th > * { - margin: 0 !important; - padding: 0.25rem 0 !important; -} - -.tableWrapper table td.has-focus, -.tableWrapper table th.has-focus { - box-shadow: rgba(var(--color-primary-300), 0.1) 0px 0px 0px 2px inset !important; -} - -.tableWrapper table th { - font-weight: bold; - text-align: left; - background-color: rgba(var(--color-primary-100)); -} - -.tableWrapper table th * { - font-weight: 600; -} - -.tableWrapper table .selectedCell:after { - z-index: 2; - position: absolute; - content: ""; - left: 0; - right: 0; - top: 0; - bottom: 0; - background-color: rgba(var(--color-primary-300), 0.1); - pointer-events: none; -} - -.tableWrapper table .column-resize-handle { - position: absolute; - right: -2px; - top: 0; - bottom: -2px; - width: 4px; - z-index: 99; - background-color: rgba(var(--color-primary-400)); - pointer-events: none; -} - -.tableWrapper .tableControls { - position: absolute; -} - -.tableWrapper .tableControls .columnsControl, -.tableWrapper .tableControls .rowsControl { - transition: opacity ease-in 100ms; - position: absolute; - z-index: 99; - display: flex; - justify-content: center; - align-items: center; -} - -.tableWrapper .tableControls .columnsControl { - height: 20px; - transform: translateY(-50%); -} - -.tableWrapper .tableControls .columnsControl .columnsControlDiv { - color: white; - background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='none' d='M0 0h24v24H0z'/%3E%3Cpath fill='%238F95B2' d='M4.5 10.5c-.825 0-1.5.675-1.5 1.5s.675 1.5 1.5 1.5S6 12.825 6 12s-.675-1.5-1.5-1.5zm15 0c-.825 0-1.5.675-1.5 1.5s.675 1.5 1.5 1.5S21 12.825 21 12s-.675-1.5-1.5-1.5zm-7.5 0c-.825 0-1.5.675-1.5 1.5s.675 1.5 1.5 1.5 1.5-.675 1.5-1.5-.675-1.5-1.5-1.5z'/%3E%3C/svg%3E"); - width: 30px; - height: 15px; -} - -.tableWrapper .tableControls .rowsControl { - width: 20px; - transform: translateX(-50%); -} - -.tableWrapper .tableControls .rowsControl .rowsControlDiv { - color: white; - background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='none' d='M0 0h24v24H0z'/%3E%3Cpath fill='%238F95B2' d='M12 3c-.825 0-1.5.675-1.5 1.5S11.175 6 12 6s1.5-.675 1.5-1.5S12.825 3 12 3zm0 15c-.825 0-1.5.675-1.5 1.5S11.175 21 12 21s1.5-.675 1.5-1.5S12.825 18 12 18zm0-7.5c-.825 0-1.5.675-1.5 1.5s.675 1.5 1.5 1.5 1.5-.675 1.5-1.5-.675-1.5-1.5-1.5z'/%3E%3C/svg%3E"); - height: 30px; - width: 15px; -} - -.tableWrapper .tableControls .rowsControlDiv { - background-color: rgba(var(--color-primary-100)); - border: 1px solid rgba(var(--color-border-200)); - border-radius: 2px; - background-size: 1.25rem; - background-repeat: no-repeat; - background-position: center; - transition: transform ease-out 100ms, background-color ease-out 100ms; - outline: none; - box-shadow: #000 0px 2px 4px; - cursor: pointer; -} - -.tableWrapper .tableControls .columnsControlDiv { - background-color: rgba(var(--color-primary-100)); - border: 1px solid rgba(var(--color-border-200)); - border-radius: 2px; - background-size: 1.25rem; - background-repeat: no-repeat; - background-position: center; - transition: transform ease-out 100ms, background-color ease-out 100ms; - outline: none; - box-shadow: #000 0px 2px 4px; - cursor: pointer; -} -.tableWrapper .tableControls .tableToolbox, -.tableWrapper .tableControls .tableColorPickerToolbox { - border: 1px solid rgba(var(--color-border-300)); - background-color: rgba(var(--color-background-100)); - padding: 0.25rem; - display: flex; - flex-direction: column; - width: 200px; - gap: 0.25rem; -} - -.tableWrapper .tableControls .tableToolbox .toolboxItem, -.tableWrapper .tableControls .tableColorPickerToolbox .toolboxItem { - background-color: rgba(var(--color-background-100)); - display: flex; - align-items: center; - gap: 0.5rem; - border: none; - padding: 0.1rem; - border-radius: 4px; - cursor: pointer; - transition: all 0.2s; -} - -.tableWrapper .tableControls .tableToolbox .toolboxItem:hover, -.tableWrapper .tableControls .tableColorPickerToolbox .toolboxItem:hover { - background-color: rgba(var(--color-background-100), 0.5); -} - -.tableWrapper .tableControls .tableToolbox .toolboxItem .iconContainer, -.tableWrapper .tableControls .tableColorPickerToolbox .toolboxItem .iconContainer, -.tableWrapper .tableControls .tableToolbox .toolboxItem .colorContainer, -.tableWrapper .tableControls .tableColorPickerToolbox .toolboxItem .colorContainer { - border: 1px solid rgba(var(--color-border-300)); - border-radius: 3px; - padding: 4px; - display: flex; - align-items: center; - justify-content: center; - width: 1.75rem; - height: 1.75rem; -} - -.tableWrapper .tableControls .tableToolbox .toolboxItem .iconContainer svg, -.tableWrapper .tableControls .tableColorPickerToolbox .toolboxItem .iconContainer svg, -.tableWrapper .tableControls .tableToolbox .toolboxItem .colorContainer svg, -.tableWrapper .tableControls .tableColorPickerToolbox .toolboxItem .colorContainer svg { - width: 2rem; - height: 2rem; -} - -.tableToolbox { - background-color: rgba(var(--color-background-100)); -} - -.tableWrapper .tableControls .tableToolbox .toolboxItem .label, -.tableWrapper .tableControls .tableColorPickerToolbox .toolboxItem .label { - font-size: 0.85rem; - color: rgba(var(--color-text-300)); -} - -.resize-cursor .tableWrapper .tableControls .rowsControl, -.tableWrapper.controls--disabled .tableControls .rowsControl, -.resize-cursor .tableWrapper .tableControls .columnsControl, -.tableWrapper.controls--disabled .tableControls .columnsControl { - opacity: 0; - pointer-events: none; -} diff --git a/yarn.lock b/yarn.lock index f27dbe5fe..55a94112f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2356,7 +2356,7 @@ lodash.merge "^4.6.2" postcss-selector-parser "6.0.10" -"@tiptap/core@^2.1.11", "@tiptap/core@^2.1.12", "@tiptap/core@^2.1.13", "@tiptap/core@^2.1.7": +"@tiptap/core@^2.1.13": version "2.1.13" resolved "https://registry.yarnpkg.com/@tiptap/core/-/core-2.1.13.tgz#e21f566e81688c826c6f26d2940886734189e193" integrity sha512-cMC8bgTN63dj1Mv82iDeeLl6sa9kY0Pug8LSalxVEptRmyFVsVxGgu2/6Y3T+9aCYScxfS06EkA8SdzFMAwYTQ== @@ -2383,7 +2383,7 @@ resolved "https://registry.yarnpkg.com/@tiptap/extension-bullet-list/-/extension-bullet-list-2.1.13.tgz#0a26731ebf98ddfd268884ff1712f7189be7b63c" integrity sha512-NkWlQ5bLPUlcROj6G/d4oqAxMf3j3wfndGOPp0z8OoXJtVbVoXl/aMSlLbVgE6n8r6CS8MYxKhXNxrb7Ll2foA== -"@tiptap/extension-code-block-lowlight@^2.1.12": +"@tiptap/extension-code-block-lowlight@^2.1.13": version "2.1.13" resolved "https://registry.yarnpkg.com/@tiptap/extension-code-block-lowlight/-/extension-code-block-lowlight-2.1.13.tgz#91110f44d6cc8a12d95ac92aee0c848fdedefb0d" integrity sha512-PlU0lzAEbUGqPykl7fYqlAiY7/zFRtQExsbrpi2kctSIzxC+jgMM4vEpWxLS4jZEXl7jVHvBRH6lRNINDHWmQA== @@ -2398,7 +2398,7 @@ resolved "https://registry.yarnpkg.com/@tiptap/extension-code/-/extension-code-2.1.13.tgz#27a5ca5705e59ca97390fad4d6631bf431690480" integrity sha512-f5fLYlSgliVVa44vd7lQGvo49+peC+Z2H0Fn84TKNCH7tkNZzouoJsHYn0/enLaQ9Sq+24YPfqulfiwlxyiT8w== -"@tiptap/extension-color@^2.1.11": +"@tiptap/extension-color@^2.1.13": version "2.1.13" resolved "https://registry.yarnpkg.com/@tiptap/extension-color/-/extension-color-2.1.13.tgz#f1ea3805db93f308aaf99d8ac80b18fcf13de050" integrity sha512-T3tJXCIfFxzIlGOhvbPVIZa3y36YZRPYIo2TKsgkTz8LiMob6hRXXNFjsrFDp2Fnu3DrBzyvrorsW7767s4eYg== @@ -2445,7 +2445,7 @@ resolved "https://registry.yarnpkg.com/@tiptap/extension-horizontal-rule/-/extension-horizontal-rule-2.1.13.tgz#4884dbf912c8dabbbc69e041ff5529d6337e638e" integrity sha512-7OgjgNqZXvBejgULNdMSma2M1nzv4bbZG+FT5XMFZmEOxR9IB1x/RzChjPdeicff2ZK2sfhMBc4Y9femF5XkUg== -"@tiptap/extension-image@^2.1.7": +"@tiptap/extension-image@^2.1.13": version "2.1.13" resolved "https://registry.yarnpkg.com/@tiptap/extension-image/-/extension-image-2.1.13.tgz#835fc6759b2c1184fb54d3704c538029d523dbf6" integrity sha512-7oVAos+BU4KR/zQsfltrd8hgIxKxyxZ19dhwb1BJI2Nt3Mnx+yFPRlRSehID6RT9dYqgW4UW5d6vh/3HQcYYYw== @@ -2455,19 +2455,19 @@ resolved "https://registry.yarnpkg.com/@tiptap/extension-italic/-/extension-italic-2.1.13.tgz#1e9521dea002c8d6de833d9fd928d4617623eab8" integrity sha512-HyDJfuDn5hzwGKZiANcvgz6wcum6bEgb4wmJnfej8XanTMJatNVv63TVxCJ10dSc9KGpPVcIkg6W8/joNXIEbw== -"@tiptap/extension-link@^2.1.7": +"@tiptap/extension-link@^2.1.13": version "2.1.13" resolved "https://registry.yarnpkg.com/@tiptap/extension-link/-/extension-link-2.1.13.tgz#ae4abd7c43292e3a1841488bfc7a687b2f014249" integrity sha512-wuGMf3zRtMHhMrKm9l6Tft5M2N21Z0UP1dZ5t1IlOAvOeYV2QZ5UynwFryxGKLO0NslCBLF/4b/HAdNXbfXWUA== dependencies: linkifyjs "^4.1.0" -"@tiptap/extension-list-item@^2.1.12", "@tiptap/extension-list-item@^2.1.13": +"@tiptap/extension-list-item@^2.1.13": version "2.1.13" resolved "https://registry.yarnpkg.com/@tiptap/extension-list-item/-/extension-list-item-2.1.13.tgz#3c62127df97974f3196866ec00ee397f4c9acdc4" integrity sha512-6e8iiCWXOiJTl1XOwVW2tc0YG18h70HUtEHFCx2m5HspOGFKsFEaSS3qYxOheM9HxlmQeDt8mTtqftRjEFRxPQ== -"@tiptap/extension-mention@^2.1.12": +"@tiptap/extension-mention@^2.1.13": version "2.1.13" resolved "https://registry.yarnpkg.com/@tiptap/extension-mention/-/extension-mention-2.1.13.tgz#6359c563268c46539660958847fe76c22131f2c8" integrity sha512-OYqaucyBiCN/CmDYjpOVX74RJcIEKmAqiZxUi8Gfaq7ryEO5a8Gk93nK+8uZ0onaqHE+mHpoLFFbcAFbOPgkUQ== @@ -2482,7 +2482,7 @@ resolved "https://registry.yarnpkg.com/@tiptap/extension-paragraph/-/extension-paragraph-2.1.13.tgz#30f8ae3f8833c606b339f3554b9ffdbe1e604463" integrity sha512-cEoZBJrsQn69FPpUMePXG/ltGXtqKISgypj70PEHXt5meKDjpmMVSY4/8cXvFYEYsI9GvIwyAK0OrfAHiSoROA== -"@tiptap/extension-placeholder@^2.1.11": +"@tiptap/extension-placeholder@^2.1.13": version "2.1.13" resolved "https://registry.yarnpkg.com/@tiptap/extension-placeholder/-/extension-placeholder-2.1.13.tgz#b735591f719b9fe89c90dcc6327d2ef2851be510" integrity sha512-vIY7y7UbqsrAW/y8bDE9eRenbQEU16kNHB5Wri8RU1YiUZpkPgdXP/pLqyjIIq95SwP/vdTIHjHoQ77VLRl1hA== @@ -2492,37 +2492,17 @@ resolved "https://registry.yarnpkg.com/@tiptap/extension-strike/-/extension-strike-2.1.13.tgz#6605792fa98f0e36861be4c7ed4d4125de8c77aa" integrity sha512-VN6zlaCNCbyJUCDyBFxavw19XmQ4LkCh8n20M8huNqW77lDGXA2A7UcWLHaNBpqAijBRu9mWI8l4Bftyf2fcAw== -"@tiptap/extension-table-cell@^2.1.6": - version "2.1.13" - resolved "https://registry.yarnpkg.com/@tiptap/extension-table-cell/-/extension-table-cell-2.1.13.tgz#28efbc99480d53346200dcbf50cfb32bade180d1" - integrity sha512-30pyVt2PxGAk8jmsXKxDheql8K/xIRA9FiDo++kS2Kr6Y7I42/kNPQttJ2W+Q1JdRJvedNfQtziQfKWDRLLCNA== - -"@tiptap/extension-table-header@^2.1.6": - version "2.1.13" - resolved "https://registry.yarnpkg.com/@tiptap/extension-table-header/-/extension-table-header-2.1.13.tgz#8d64a0e5a6a5ea128708b866e56a0e04e34d7a5b" - integrity sha512-FwIV5iso5kmpu01QyvrPCjJqZfqxRTjtjMsDyut2uIgx9v5TXk0V5XvMWobx435ANIDJoGTYCMRlIqcgtyqwAQ== - -"@tiptap/extension-table-row@^2.1.6": - version "2.1.13" - resolved "https://registry.yarnpkg.com/@tiptap/extension-table-row/-/extension-table-row-2.1.13.tgz#ef75d6de9c7695bbb90f745aabd72d327f161ac3" - integrity sha512-27Mb9/oYbiLd+/BUFMhQzRIqMd2Z5j1BZMYsktwtDG8vGdYVlaW257UVaoNR9TmiXyIzd3Dh1mOil8G35+HRHg== - -"@tiptap/extension-table@^2.1.6": - version "2.1.13" - resolved "https://registry.yarnpkg.com/@tiptap/extension-table/-/extension-table-2.1.13.tgz#cfe3fc2665d12d2c946fc83b2cce9d1485ff29a0" - integrity sha512-yMWt2LqotOsWJhLwFNo8fyTwJNLPtnk+eCUxKLlMXP23mJ/lpF+jvTihhHVVic5GqV9vLYZFU2Tn+5k/Vd5P1w== - -"@tiptap/extension-task-item@^2.1.7": +"@tiptap/extension-task-item@^2.1.13": version "2.1.13" resolved "https://registry.yarnpkg.com/@tiptap/extension-task-item/-/extension-task-item-2.1.13.tgz#f049b774f8151b9568d7afbbb5b8fbcb30f35755" integrity sha512-0E1woY0BXpv0SBOGPl5Cmo2RuH+Zchn7dYcTILtOsqHu6onJ4eP0N76+jGFLGV3T0PnPf7JDuwsO/B6pC7yMSg== -"@tiptap/extension-task-list@^2.1.7": +"@tiptap/extension-task-list@^2.1.13": version "2.1.13" resolved "https://registry.yarnpkg.com/@tiptap/extension-task-list/-/extension-task-list-2.1.13.tgz#1a1c40f5886111a1a74386637e7bd0c4ca4158d9" integrity sha512-WfTo4KN0PqpmZxx23rak08M7flfBhv9IcPVpuJ4JthZOlexYdOZxaE/Yd4vlqZhq6cibG7CFljp8VzkfTUa1Ew== -"@tiptap/extension-text-style@^2.1.11": +"@tiptap/extension-text-style@^2.1.13": version "2.1.13" resolved "https://registry.yarnpkg.com/@tiptap/extension-text-style/-/extension-text-style-2.1.13.tgz#4ee7c8cc50272f0977a8d2edae22f063f63d1fe5" integrity sha512-K9/pNHxpZKQoc++crxrsppVUSeHv8YevfY2FkJ4YMaekGcX+q4BRrHR0tOfii4izAUPJF2L0/PexLQaWXtAY1w== @@ -2532,12 +2512,12 @@ resolved "https://registry.yarnpkg.com/@tiptap/extension-text/-/extension-text-2.1.13.tgz#ac17a0220aef1bae1bbd646a91491353e57bb5d1" integrity sha512-zzsTTvu5U67a8WjImi6DrmpX2Q/onLSaj+LRWPh36A1Pz2WaxW5asZgaS+xWCnR+UrozlCALWa01r7uv69jq0w== -"@tiptap/extension-underline@^2.1.7": +"@tiptap/extension-underline@^2.1.13": version "2.1.13" resolved "https://registry.yarnpkg.com/@tiptap/extension-underline/-/extension-underline-2.1.13.tgz#170b4e8e3f03b9defbb7de7cafe4b0a066cea679" integrity sha512-z0CNKPjcvU8TrUSTui1voM7owssyXE9WvEGhIZMHzWwlx2ZXY2/L5+Hh33X/LzSKB9OGf/g1HAuHxrPcYxFuAQ== -"@tiptap/pm@^2.1.12", "@tiptap/pm@^2.1.7": +"@tiptap/pm@^2.1.13": version "2.1.13" resolved "https://registry.yarnpkg.com/@tiptap/pm/-/pm-2.1.13.tgz#857753691580be760da13629fab2712c52750741" integrity sha512-zNbA7muWsHuVg12GrTgN/j119rLePPq5M8dZgkKxUwdw8VmU3eUyBp1SihPEXJ2U0MGdZhNhFX7Y74g11u66sg== @@ -2561,12 +2541,7 @@ prosemirror-transform "^1.7.0" prosemirror-view "^1.28.2" -"@tiptap/prosemirror-tables@^1.1.4": - version "1.1.4" - resolved "https://registry.yarnpkg.com/@tiptap/prosemirror-tables/-/prosemirror-tables-1.1.4.tgz#e123978f13c9b5f980066ba660ec5df857755916" - integrity sha512-O2XnDhZV7xTHSFxMMl8Ei3UVeCxuMlbGYZ+J2QG8CzkK8mxDpBa66kFr5DdyAhvdi1ptpcH9u7/GMwItQpN4sA== - -"@tiptap/react@^2.1.7": +"@tiptap/react@^2.1.13": version "2.1.13" resolved "https://registry.yarnpkg.com/@tiptap/react/-/react-2.1.13.tgz#ec5ebaf9babc145f3329030358b3c5e36016b908" integrity sha512-Dq3f8EtJnpImP3iDtJo+7bulnN9SJZRZcVVzxHXccLcC2MxtmDdlPGZjP+wxO800nd8toSIOd5734fPNf/YcfA== @@ -2574,7 +2549,7 @@ "@tiptap/extension-bubble-menu" "^2.1.13" "@tiptap/extension-floating-menu" "^2.1.13" -"@tiptap/starter-kit@^2.1.10": +"@tiptap/starter-kit@^2.1.13": version "2.1.13" resolved "https://registry.yarnpkg.com/@tiptap/starter-kit/-/starter-kit-2.1.13.tgz#ac33a8b4767b83e4daff8819f4a5f0239df1654c" integrity sha512-ph/mUR/OwPtPkZ5rNHINxubpABn8fHnvJSdhXFrY/q6SKoaO11NZXgegRaiG4aL7O6Sz4LsZVw6Sm0Ae+GJmrg== @@ -2599,7 +2574,7 @@ "@tiptap/extension-strike" "^2.1.13" "@tiptap/extension-text" "^2.1.13" -"@tiptap/suggestion@^2.0.4", "@tiptap/suggestion@^2.1.12": +"@tiptap/suggestion@^2.0.13", "@tiptap/suggestion@^2.1.13": version "2.1.13" resolved "https://registry.yarnpkg.com/@tiptap/suggestion/-/suggestion-2.1.13.tgz#0a8317260baed764a523a09099c0889a0e5b507e" integrity sha512-Y05TsiXTFAJ5SrfoV+21MAxig5UNbY0AVa03lQlh/yicTRPpIc6hgZzblB0uxDSYoj6+kaHE4MIZvPvhUD8BJQ== @@ -2776,7 +2751,7 @@ date-fns "^2.0.1" react-popper "^2.2.5" -"@types/react-dom@^18.2.14", "@types/react-dom@^18.2.17": +"@types/react-dom@^18.2.17": version "18.2.17" resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-18.2.17.tgz#375c55fab4ae671bd98448dcfa153268d01d6f64" integrity sha512-rvrT/M7Df5eykWFxn6MYt5Pem/Dbyc1N8Y0S9Mrkw2WFCRiqUgw9P7ul2NpwsXCSM1DVdENzdG9J5SreqfAIWg== @@ -2790,7 +2765,11 @@ dependencies: "@types/react" "*" +<<<<<<< HEAD "@types/react@*", "@types/react@^18.2.39", "@types/react@^18.2.42": +======= +"@types/react@*", "@types/react@18.2.42", "@types/react@^18.2.42": +>>>>>>> 75ca93268 ([refactor] Editor code refactoring (#3194)) version "18.2.42" resolved "https://registry.yarnpkg.com/@types/react/-/react-18.2.42.tgz#6f6b11a904f6d96dda3c2920328a97011a00aba7" integrity sha512-c1zEr96MjakLYus/wPnuWDo1/zErfdU9rNsIGmE+NV71nx88FG9Ttgo5dqorXTu/LImX2f63WBP986gJkMPNbA==