-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Export Notes to PDF/Word Feature Implementation (#8439) #9269
Export Notes to PDF/Word Feature Implementation (#8439) #9269
Conversation
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.
PR Summary
This PR adds PDF and Word export functionality for notes and tasks using BlockNote's export features, with PDF currently enabled and Word export ready for future UI implementation.
- Added new
useExportNoteAction.ts
with PDF/DOCX export functions using BlockNote'sxl-pdf-exporter
andxl-docx-exporter
packages - Upgraded BlockNote packages from v0.15.3 to v0.22.0 and consolidated TipTap dependencies to resolve conflicts
- Added export action to menu configuration in
DefaultSingleRecordActionsConfigV2.ts
withIconFileExport
icon - Updated
CustomAddBlockItem.tsx
to use newer BlockNote API methods likeinsertInlineContent
instead of deprecated ones - Added Buffer polyfill and handling for embedded vs uploaded images in exports (uploaded images omitted while preserving text)
6 file(s) reviewed, 6 comment(s)
Edit PR Review Bot Settings | Greptile
position: 0, | ||
isPinned: true, | ||
Icon: IconFileExport, | ||
availableOn: [ActionAvailableOn.SHOW_PAGE], |
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.
style: export action is only available on show page while similar actions like favorites are available on both index and show pages - consider adding INDEX_PAGE_SINGLE_RECORD_SELECTION if export should work from list views
...on-menu/actions/record-actions/single-record/constants/DefaultSingleRecordActionsConfigV2.ts
Outdated
Show resolved
Hide resolved
...nt/src/modules/action-menu/actions/record-actions/single-record/hooks/useExportNoteAction.ts
Show resolved
Hide resolved
...nt/src/modules/action-menu/actions/record-actions/single-record/hooks/useExportNoteAction.ts
Outdated
Show resolved
Hide resolved
...src/modules/action-menu/actions/record-actions/single-record/types/SingleRecordActionsKey.ts
Show resolved
Hide resolved
const currentBlock = editor.getTextCursorPosition().block; | ||
|
||
editor.insertBlocks([{ type: 'paragraph' }], currentBlock, 'after'); |
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.
logic: currentBlock could be undefined here if getTextCursorPosition().block returns undefined - needs null check
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.
Great work again!
...on-menu/actions/record-actions/single-record/constants/DefaultSingleRecordActionsConfigV2.ts
Outdated
Show resolved
Hide resolved
...nt/src/modules/action-menu/actions/record-actions/single-record/hooks/useExportNoteAction.ts
Outdated
Show resolved
Hide resolved
packages/twenty-front/src/modules/ui/input/editor/components/CustomAddBlockItem.tsx
Show resolved
Hide resolved
...nt/src/modules/action-menu/actions/record-actions/single-record/hooks/useExportNoteAction.ts
Show resolved
Hide resolved
...nt/src/modules/action-menu/actions/record-actions/single-record/hooks/useExportNoteAction.ts
Outdated
Show resolved
Hide resolved
- Comment out unused DOCX export code to fix linting warnings - Remove unused imports (DOCXExporter, docxDefaultSchemaMappings, Packer)
@FelixMalfait I've made all the necessary changes. Thanks for reviewing! |
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.
Great work. You're amongst the best contributions we've ever received (clean code, thoughtful approach)
Log
|
@FelixMalfait, thanks, that means a lot! 😁 |
Closes #8439
Overview
This PR implements functionality to export notes/tasks to PDF and Word formats.
All.-.People.mp4
Testing
Notes