-
Notifications
You must be signed in to change notification settings - Fork 2.5k
[WIKI-400] feat: page navigation pane #7206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 17 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
f434365
init: page navigation pane
aaryan610 40a723b
chore: outline and info tabs
aaryan610 cf463a4
chore: asset download endpoint
aaryan610 aab6c50
chore: realtime document info updates
aaryan610 8b74388
fix: merge conflicts resolved from preview
aaryan610 78a4e38
chore: add support for code splitting
aaryan610 00cd4ab
fix: merge conflicts resolved from preview
aaryan610 aa8ae78
fix: formatting
aaryan610 3a7f84b
refactor: image block id generation
aaryan610 553aa62
chore: implement translation
aaryan610 37bd7d4
refactor: assets list storage logic
aaryan610 6640b57
fix: merge conflicts resolved from preview
aaryan610 ab2e5ff
fix: build errors
aaryan610 cfb5ae6
fix: image extension name
aaryan610 69565b0
Merge branch 'preview' of https://github.com/makeplane/plane into fea…
aaryan610 68f902c
refactor: add support for additional asset items
aaryan610 28b867c
refactor: asset extraction logic
aaryan610 d6fc5cc
chore: add translations
aaryan610 a9979b2
fix: merge conflicts resolved from preview
aaryan610 71b8b30
fix: merge conflicts resolved from preview
aaryan610 2b251b6
chore: remove version history option from the dropdown
aaryan610 68df2a7
fix: merge conflicts resolved from preview
aaryan610 8d0e1e1
chore: query params handling
aaryan610 8b73186
fix: merge conflicts resolved from preview
aaryan610 441f237
chore: remove unnecessary logic
aaryan610 2f6b42d
refactor: empty state components
aaryan610 b5f41eb
fix: empty state asset path
aaryan610 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// helpers | ||
import { TAssetMetaDataRecord } from "@/helpers/assets"; | ||
// local imports | ||
import { ADDITIONAL_EXTENSIONS } from "./extensions"; | ||
|
||
export const ADDITIONAL_ASSETS_META_DATA_RECORD: Partial<Record<ADDITIONAL_EXTENSIONS, TAssetMetaDataRecord>> = {}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export enum ADDITIONAL_EXTENSIONS {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export type TAdditionalEditorAsset = never; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { Node as ProseMirrorNode } from "@tiptap/pm/model"; | ||
// constants | ||
import { CORE_EXTENSIONS } from "@/constants/extension"; | ||
// extensions | ||
import { getImageBlockId } from "@/extensions/custom-image/components/image-block"; | ||
// plane editor imports | ||
import { ADDITIONAL_ASSETS_META_DATA_RECORD } from "@/plane-editor/constants/assets"; | ||
// types | ||
aaryan610 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
import { TEditorAsset } from "@/types"; | ||
|
||
export type TAssetMetaDataRecord = (attrs: ProseMirrorNode["attrs"]) => TEditorAsset | undefined; | ||
|
||
export const CORE_ASSETS_META_DATA_RECORD: Partial<Record<CORE_EXTENSIONS, TAssetMetaDataRecord>> = { | ||
[CORE_EXTENSIONS.IMAGE]: (attrs) => { | ||
if (!attrs?.src) return; | ||
return { | ||
href: `#${getImageBlockId(attrs?.id ?? "")}`, | ||
id: attrs?.id, | ||
name: `image-${attrs?.id}`, | ||
size: 0, | ||
src: attrs?.src, | ||
type: CORE_EXTENSIONS.IMAGE, | ||
}; | ||
}, | ||
[CORE_EXTENSIONS.CUSTOM_IMAGE]: (attrs) => { | ||
if (!attrs?.src) return; | ||
return { | ||
href: `#${getImageBlockId(attrs?.id ?? "")}`, | ||
id: attrs?.id, | ||
name: `image-${attrs?.id}`, | ||
size: 0, | ||
src: attrs?.src, | ||
type: CORE_EXTENSIONS.CUSTOM_IMAGE, | ||
}; | ||
}, | ||
...ADDITIONAL_ASSETS_META_DATA_RECORD, | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import { HocuspocusProvider } from "@hocuspocus/provider"; | ||
import { Editor } from "@tiptap/core"; | ||
import * as Y from "yjs"; | ||
// constants | ||
import { CORE_EXTENSIONS } from "@/constants/extension"; | ||
import { CORE_EDITOR_META } from "@/constants/meta"; | ||
// types | ||
import { EditorReadOnlyRefApi } from "@/types"; | ||
// local imports | ||
import { getParagraphCount } from "./common"; | ||
import { getExtensionStorage } from "./get-extension-storage"; | ||
import { scrollSummary } from "./scroll-to-node"; | ||
|
||
type TArgs = { | ||
editor: Editor | null; | ||
provider: HocuspocusProvider | undefined; | ||
}; | ||
|
||
export const getEditorRefHelpers = (args: TArgs): EditorReadOnlyRefApi => { | ||
const { editor, provider } = args; | ||
|
||
return { | ||
clearEditor: (emitUpdate = false) => { | ||
editor?.chain().setMeta(CORE_EDITOR_META.SKIP_FILE_DELETION, true).clearContent(emitUpdate).run(); | ||
}, | ||
getDocument: () => { | ||
const documentBinary = provider?.document ? Y.encodeStateAsUpdate(provider?.document) : null; | ||
const documentHTML = editor?.getHTML() ?? "<p></p>"; | ||
const documentJSON = editor?.getJSON() ?? null; | ||
|
||
return { | ||
binary: documentBinary, | ||
html: documentHTML, | ||
json: documentJSON, | ||
}; | ||
}, | ||
getDocumentInfo: () => ({ | ||
characters: editor ? getExtensionStorage(editor, CORE_EXTENSIONS.CHARACTER_COUNT)?.characters?.() : 0, | ||
paragraphs: getParagraphCount(editor?.state), | ||
words: editor ? getExtensionStorage(editor, CORE_EXTENSIONS.CHARACTER_COUNT)?.words?.() : 0, | ||
}), | ||
getHeadings: () => (editor ? getExtensionStorage(editor, CORE_EXTENSIONS.HEADINGS_LIST)?.headings : []), | ||
getMarkDown: () => { | ||
const markdownOutput = editor?.storage.markdown.getMarkdown(); | ||
return markdownOutput; | ||
aaryan610 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}, | ||
scrollSummary: (marking) => { | ||
if (!editor) return; | ||
scrollSummary(editor, marking); | ||
}, | ||
setEditorValue: (content, emitUpdate = false) => { | ||
editor?.commands.setContent(content, emitUpdate, { preserveWhitespace: true }); | ||
}, | ||
}; | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.