Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/frontend/apps/e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
"test:ui::chromium": "yarn test:ui --project=chromium"
},
"devDependencies": {
"@playwright/test": "1.55.0",
"@playwright/test": "1.55.1",
"@types/node": "*",
"@types/pdf-parse": "1.1.5",
"eslint-plugin-docs": "*",
"typescript": "*"
},
"dependencies": {
"convert-stream": "1.0.2",
"pdf-parse": "1.1.1"
"pdf-parse": "2.1.7"
},
"packageManager": "yarn@1.22.22"
}
55 changes: 29 additions & 26 deletions src/frontend/apps/impress/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,29 @@
},
"dependencies": {
"@ag-media/react-pdf-table": "2.0.3",
"@blocknote/code-block": "0.37.0",
"@blocknote/core": "0.37.0",
"@blocknote/mantine": "0.37.0",
"@blocknote/react": "0.37.0",
"@blocknote/xl-docx-exporter": "0.37.0",
"@blocknote/xl-multi-column": "0.37.0",
"@blocknote/xl-pdf-exporter": "0.37.0",
"@blocknote/code-block": "0.41.1",
"@blocknote/core": "0.41.1",
"@blocknote/mantine": "0.41.1",
"@blocknote/react": "0.41.1",
"@blocknote/xl-docx-exporter": "0.41.1",
"@blocknote/xl-multi-column": "0.41.1",
"@blocknote/xl-pdf-exporter": "0.41.1",
"@dnd-kit/core": "6.3.1",
"@dnd-kit/modifiers": "9.0.0",
"@emoji-mart/data": "1.2.1",
"@emoji-mart/react": "1.1.1",
"@fontsource-variable/inter": "5.2.8",
"@fontsource/material-icons": "5.2.5",
"@fontsource/material-icons": "5.2.7",
"@gouvfr-lasuite/integration": "1.0.3",
"@gouvfr-lasuite/ui-kit": "0.16.1",
"@gouvfr-lasuite/ui-kit": "0.16.2",
"@hocuspocus/provider": "2.15.2",
"@mantine/core": "8.3.4",
"@mantine/hooks": "8.3.4",
"@openfun/cunningham-react": "3.2.3",
"@react-pdf/renderer": "4.3.0",
"@sentry/nextjs": "10.11.0",
"@tanstack/react-query": "5.87.4",
"@react-pdf/renderer": "4.3.1",
"@sentry/nextjs": "10.17.0",
"@tanstack/react-query": "5.90.2",
"@tiptap/extensions": "3.4.4",
"canvg": "4.0.3",
"clsx": "2.1.1",
"cmdk": "1.1.1",
Expand All @@ -47,17 +50,17 @@
"emoji-datasource-apple": "16.0.0",
"emoji-mart": "5.6.0",
"emoji-regex": "10.5.0",
"i18next": "25.5.2",
"i18next": "25.5.3",
"i18next-browser-languagedetector": "8.2.0",
"idb": "8.0.3",
"lodash": "4.17.21",
"luxon": "3.7.2",
"next": "15.5.3",
"posthog-js": "1.264.2",
"next": "15.5.4",
"posthog-js": "1.271.0",
"react": "*",
"react-aria-components": "1.12.1",
"react-aria-components": "1.13.0",
"react-dom": "*",
"react-i18next": "15.7.3",
"react-i18next": "16.0.0",
"react-intersection-observer": "9.16.0",
"react-select": "5.10.2",
"styled-components": "6.1.19",
Expand All @@ -68,32 +71,32 @@
},
"devDependencies": {
"@svgr/webpack": "8.1.0",
"@tanstack/react-query-devtools": "5.87.4",
"@tanstack/react-query-devtools": "5.90.2",
"@testing-library/dom": "10.4.1",
"@testing-library/jest-dom": "6.8.0",
"@testing-library/jest-dom": "6.9.1",
"@testing-library/react": "16.3.0",
"@testing-library/user-event": "14.6.1",
"@types/lodash": "4.17.20",
"@types/luxon": "3.7.1",
"@types/node": "*",
"@types/react": "*",
"@types/react-dom": "*",
"@vitejs/plugin-react": "5.0.2",
"@vitejs/plugin-react": "5.0.4",
"copy-webpack-plugin": "13.0.1",
"cross-env": "10.0.0",
"dotenv": "17.2.2",
"cross-env": "10.1.0",
"dotenv": "17.2.3",
"eslint-plugin-docs": "*",
"fetch-mock": "9.11.0",
"jsdom": "26.1.0",
"jsdom": "27.0.0",
"node-fetch": "2.7.0",
"prettier": "3.6.2",
"stylelint": "16.24.0",
"stylelint-config-standard": "39.0.0",
"stylelint": "16.25.0",
"stylelint-config-standard": "39.0.1",
"stylelint-prettier": "5.0.3",
"typescript": "*",
"vite-tsconfig-paths": "5.1.4",
"vitest": "3.2.4",
"webpack": "5.101.3",
"webpack": "5.102.0",
"workbox-webpack-plugin": "7.1.0"
},
"packageManager": "yarn@1.22.22"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { codeBlock } from '@blocknote/code-block';
import { codeBlockOptions } from '@blocknote/code-block';
import {
BlockNoteSchema,
createCodeBlockSpec,
defaultBlockSpecs,
defaultInlineContentSpecs,
withPageBreak,
Expand Down Expand Up @@ -53,11 +54,12 @@ const baseBlockNoteSchema = withPageBreak(
BlockNoteSchema.create({
blockSpecs: {
...defaultBlockSpecs,
callout: CalloutBlock,
divider: DividerBlock,
image: AccessibleImageBlock,
pdf: PdfBlock,
uploadLoader: UploadLoaderBlock,
callout: CalloutBlock(),
codeBlock: createCodeBlockSpec(codeBlockOptions),
divider2: DividerBlock(),
image: AccessibleImageBlock(),
pdf: PdfBlock(),
uploadLoader: UploadLoaderBlock(),
},
inlineContentSpecs: {
...defaultInlineContentSpecs,
Expand Down Expand Up @@ -97,7 +99,6 @@ export const BlockNoteEditor = ({ doc, provider }: BlockNoteEditorProps) => {

const editor: DocsBlockNoteEditor = useCreateBlockNote(
{
codeBlock,
collaboration: {
provider,
fragment: provider.document.getXmlFragment('document-store'),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
/**
* We added some custom logic to the original Blocknote FileDownloadButton
* component to handle our file download use case.
*
* Original source:
* https://github.com/TypeCellOS/BlockNote/blob/main/packages/react/src/components/FormattingToolbar/DefaultButtons/FileDownloadButton.tsx
*/

import {
BlockSchema,
InlineContentSchema,
StyleSchema,
checkBlockIsFileBlock,
checkBlockIsFileBlockWithPlaceholder,
blockHasType,
} from '@blocknote/core';
import {
useBlockNoteEditor,
Expand Down Expand Up @@ -41,7 +48,9 @@ export const FileDownloadButton = ({

const block = selectedBlocks[0];

if (checkBlockIsFileBlock(block, editor)) {
if (
blockHasType(block, editor, block.type, { url: 'string', name: 'string' })
) {
return block;
}

Expand All @@ -53,6 +62,7 @@ export const FileDownloadButton = ({
editor.focus();

const url = fileBlock.props.url as string;
const name = fileBlock.props.name as string | undefined;

/**
* If not hosted on our domain, means not a file uploaded by the user,
Expand All @@ -76,16 +86,12 @@ export const FileDownloadButton = ({

if (!url.includes('-unsafe')) {
const blob = (await exportResolveFileUrl(url)) as Blob;
downloadFile(
blob,
fileBlock.props.name || url.split('/').pop() || 'file',
);
downloadFile(blob, name || url.split('/').pop() || 'file');
} else {
const onConfirm = async () => {
const blob = (await exportResolveFileUrl(url)) as Blob;

const baseName =
fileBlock.props.name || url.split('/').pop() || 'file';
const baseName = name || url.split('/').pop() || 'file';

const regFindLastDot = /(\.[^/.]+)$/;
const unsafeName = baseName.includes('.')
Expand All @@ -100,11 +106,7 @@ export const FileDownloadButton = ({
}
}, [editor, fileBlock, open]);

if (
!fileBlock ||
checkBlockIsFileBlockWithPlaceholder(fileBlock, editor) ||
!Components
) {
if (!fileBlock || fileBlock.props.url === '' || !Components) {
return null;
}

Expand Down
Loading
Loading