-
Notifications
You must be signed in to change notification settings - Fork 9
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
feat(tiptap): blocks editor #1656
Conversation
src/layouts/EditPage/EditPage.tsx
Outdated
.focus() | ||
.setLink({ href: selectedMediaPath }) | ||
.run() | ||
<BlocksContextProvider blocks={[DEFAULT_BLOCKS.text]}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation from new context
add new variant
ee91a7d
to
ef30330
Compare
@@ -293,10 +296,11 @@ interface DraggableAccordionItemProps { | |||
// TODO: Should get these props automatically | |||
// rather than having us pass in manually | |||
index: number | |||
draggableId: string | |||
draggableId?: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this means not everything is draggable now?
@@ -40,8 +40,9 @@ const PagePreview = ({ title, chunk, ...rest }) => { | |||
|
|||
return ( | |||
<Box | |||
w="50%" | |||
w="100%" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this 100% now?
@@ -73,7 +73,7 @@ const getDraggableAccordionItemStyle = ({ | |||
interface SidebarHeaderProps { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe can add ss in pr desc + test plan including common steps to test if all working
|
||
const editor = usePreviewEditor() | ||
|
||
if (!editor) return null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why would this happen? is it on the first paint?
> | ||
<IconButton | ||
variant="clear" | ||
isActive={curTab === "content"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if there is a list of tab and ids, can we namespace it like CurTabs.content?
</Editable.Sidebar> | ||
</VStack> | ||
</GridItem> | ||
{/* Preview */} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove?
TableHeader, | ||
TableCell, | ||
Placeholder, | ||
CharacterCount, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So just to check understanding, anything with CharacterCount will be counted towards the char count displayed?
NOTE: We will not be doing block editing the way this PR is done, but rather it will be integrated as part of the editor itself. Simple text editing will be done normally but complex blocks will have a border around them with a different flow for changing their contents. --@dcshzj
Problem
This PR implements a first pass block editor with draggables
Solution
Preview
to aPagePreview
component -> this is because we want to nest the editor inside the previeweditor
-> we choose the prop preferentially over the context's; this is because we need to support multiple editors at present (:sadge:)