Skip to content

feat: File previewWidth prop defaults to undefined #1664

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 3 commits into from
May 9, 2025
Merged
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
3 changes: 2 additions & 1 deletion examples/06-custom-schema/04-pdf-file-block/PDF.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ export const PDF = createReactBlockSpec(
default: true,
},
previewWidth: {
default: 512,
default: undefined,
type: "number",
},
},
content: "none",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,6 @@ exports[`Test insertBlocks > Insert multiple blocks after 2`] = `
"backgroundColor": "default",
"caption": "",
"name": "",
"previewWidth": 512,
"showPreview": true,
"textAlignment": "left",
"url": "https://via.placeholder.com/150",
Expand Down Expand Up @@ -1012,7 +1011,6 @@ exports[`Test insertBlocks > Insert multiple blocks before 2`] = `
"backgroundColor": "default",
"caption": "",
"name": "",
"previewWidth": 512,
"showPreview": true,
"textAlignment": "left",
"url": "https://via.placeholder.com/150",
Expand Down Expand Up @@ -1606,7 +1604,6 @@ exports[`Test insertBlocks > Insert single basic block after 2`] = `
"backgroundColor": "default",
"caption": "",
"name": "",
"previewWidth": 512,
"showPreview": true,
"textAlignment": "left",
"url": "https://via.placeholder.com/150",
Expand Down Expand Up @@ -2212,7 +2209,6 @@ exports[`Test insertBlocks > Insert single basic block before (without type) 2`]
"backgroundColor": "default",
"caption": "",
"name": "",
"previewWidth": 512,
"showPreview": true,
"textAlignment": "left",
"url": "https://via.placeholder.com/150",
Expand Down Expand Up @@ -2806,7 +2802,6 @@ exports[`Test insertBlocks > Insert single basic block before 2`] = `
"backgroundColor": "default",
"caption": "",
"name": "",
"previewWidth": 512,
"showPreview": true,
"textAlignment": "left",
"url": "https://via.placeholder.com/150",
Expand Down Expand Up @@ -3514,7 +3509,6 @@ exports[`Test insertBlocks > Insert single complex block after 2`] = `
"backgroundColor": "default",
"caption": "",
"name": "",
"previewWidth": 512,
"showPreview": true,
"textAlignment": "left",
"url": "https://via.placeholder.com/150",
Expand Down Expand Up @@ -4222,7 +4216,6 @@ exports[`Test insertBlocks > Insert single complex block before 2`] = `
"backgroundColor": "default",
"caption": "",
"name": "",
"previewWidth": 512,
"showPreview": true,
"textAlignment": "left",
"url": "https://via.placeholder.com/150",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ exports[`Test mergeBlocks > Basic 1`] = `
"backgroundColor": "default",
"caption": "",
"name": "",
"previewWidth": 512,
"showPreview": true,
"textAlignment": "left",
"url": "https://via.placeholder.com/150",
Expand Down Expand Up @@ -764,7 +763,6 @@ exports[`Test mergeBlocks > Blocks have different types 1`] = `
"backgroundColor": "default",
"caption": "",
"name": "",
"previewWidth": 512,
"showPreview": true,
"textAlignment": "left",
"url": "https://via.placeholder.com/150",
Expand Down Expand Up @@ -1314,7 +1312,6 @@ exports[`Test mergeBlocks > First block has children 1`] = `
"backgroundColor": "default",
"caption": "",
"name": "",
"previewWidth": 512,
"showPreview": true,
"textAlignment": "left",
"url": "https://via.placeholder.com/150",
Expand Down Expand Up @@ -1863,7 +1860,6 @@ exports[`Test mergeBlocks > Second block has children 1`] = `
"backgroundColor": "default",
"caption": "",
"name": "",
"previewWidth": 512,
"showPreview": true,
"textAlignment": "left",
"url": "https://via.placeholder.com/150",
Expand Down Expand Up @@ -2430,7 +2426,6 @@ exports[`Test mergeBlocks > Second block is empty 1`] = `
"backgroundColor": "default",
"caption": "",
"name": "",
"previewWidth": 512,
"showPreview": true,
"textAlignment": "left",
"url": "https://via.placeholder.com/150",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,6 @@ exports[`Test moveBlocksDown > Basic 1`] = `
"backgroundColor": "default",
"caption": "",
"name": "",
"previewWidth": 512,
"showPreview": true,
"textAlignment": "left",
"url": "https://via.placeholder.com/150",
Expand Down Expand Up @@ -798,7 +797,6 @@ exports[`Test moveBlocksDown > Into children 1`] = `
"backgroundColor": "default",
"caption": "",
"name": "",
"previewWidth": 512,
"showPreview": true,
"textAlignment": "left",
"url": "https://via.placeholder.com/150",
Expand Down Expand Up @@ -1365,7 +1363,6 @@ exports[`Test moveBlocksDown > Last block 1`] = `
"backgroundColor": "default",
"caption": "",
"name": "",
"previewWidth": 512,
"showPreview": true,
"textAlignment": "left",
"url": "https://via.placeholder.com/150",
Expand Down Expand Up @@ -1932,7 +1929,6 @@ exports[`Test moveBlocksDown > Multiple blocks 1`] = `
"backgroundColor": "default",
"caption": "",
"name": "",
"previewWidth": 512,
"showPreview": true,
"textAlignment": "left",
"url": "https://via.placeholder.com/150",
Expand Down Expand Up @@ -2499,7 +2495,6 @@ exports[`Test moveBlocksDown > Multiple blocks ending in block with children 1`]
"backgroundColor": "default",
"caption": "",
"name": "",
"previewWidth": 512,
"showPreview": true,
"textAlignment": "left",
"url": "https://via.placeholder.com/150",
Expand Down Expand Up @@ -3066,7 +3061,6 @@ exports[`Test moveBlocksDown > Multiple blocks ending in nested block 1`] = `
"backgroundColor": "default",
"caption": "",
"name": "",
"previewWidth": 512,
"showPreview": true,
"textAlignment": "left",
"url": "https://via.placeholder.com/150",
Expand Down Expand Up @@ -3643,7 +3637,6 @@ exports[`Test moveBlocksDown > Multiple blocks starting and ending in nested blo
"backgroundColor": "default",
"caption": "",
"name": "",
"previewWidth": 512,
"showPreview": true,
"textAlignment": "left",
"url": "https://via.placeholder.com/150",
Expand Down Expand Up @@ -4210,7 +4203,6 @@ exports[`Test moveBlocksDown > Multiple blocks starting in block with children 1
"backgroundColor": "default",
"caption": "",
"name": "",
"previewWidth": 512,
"showPreview": true,
"textAlignment": "left",
"url": "https://via.placeholder.com/150",
Expand Down Expand Up @@ -4776,7 +4768,6 @@ exports[`Test moveBlocksDown > Multiple blocks starting in nested block 1`] = `
"backgroundColor": "default",
"caption": "",
"name": "",
"previewWidth": 512,
"showPreview": true,
"textAlignment": "left",
"url": "https://via.placeholder.com/150",
Expand Down Expand Up @@ -5343,7 +5334,6 @@ exports[`Test moveBlocksDown > Out of children 1`] = `
"backgroundColor": "default",
"caption": "",
"name": "",
"previewWidth": 512,
"showPreview": true,
"textAlignment": "left",
"url": "https://via.placeholder.com/150",
Expand Down Expand Up @@ -5909,7 +5899,6 @@ exports[`Test moveBlocksUp > Basic 1`] = `
"backgroundColor": "default",
"caption": "",
"name": "",
"previewWidth": 512,
"showPreview": true,
"textAlignment": "left",
"url": "https://via.placeholder.com/150",
Expand Down Expand Up @@ -6476,7 +6465,6 @@ exports[`Test moveBlocksUp > First block 1`] = `
"backgroundColor": "default",
"caption": "",
"name": "",
"previewWidth": 512,
"showPreview": true,
"textAlignment": "left",
"url": "https://via.placeholder.com/150",
Expand Down Expand Up @@ -7043,7 +7031,6 @@ exports[`Test moveBlocksUp > Into children 1`] = `
"backgroundColor": "default",
"caption": "",
"name": "",
"previewWidth": 512,
"showPreview": true,
"textAlignment": "left",
"url": "https://via.placeholder.com/150",
Expand Down Expand Up @@ -7610,7 +7597,6 @@ exports[`Test moveBlocksUp > Multiple blocks 1`] = `
"backgroundColor": "default",
"caption": "",
"name": "",
"previewWidth": 512,
"showPreview": true,
"textAlignment": "left",
"url": "https://via.placeholder.com/150",
Expand Down Expand Up @@ -8177,7 +8163,6 @@ exports[`Test moveBlocksUp > Multiple blocks ending in block with children 1`] =
"backgroundColor": "default",
"caption": "",
"name": "",
"previewWidth": 512,
"showPreview": true,
"textAlignment": "left",
"url": "https://via.placeholder.com/150",
Expand Down Expand Up @@ -8744,7 +8729,6 @@ exports[`Test moveBlocksUp > Multiple blocks ending in nested block 1`] = `
"backgroundColor": "default",
"caption": "",
"name": "",
"previewWidth": 512,
"showPreview": true,
"textAlignment": "left",
"url": "https://via.placeholder.com/150",
Expand Down Expand Up @@ -9293,7 +9277,6 @@ exports[`Test moveBlocksUp > Multiple blocks starting and ending in nested block
"backgroundColor": "default",
"caption": "",
"name": "",
"previewWidth": 512,
"showPreview": true,
"textAlignment": "left",
"url": "https://via.placeholder.com/150",
Expand Down Expand Up @@ -9877,7 +9860,6 @@ exports[`Test moveBlocksUp > Multiple blocks starting in block with children 1`]
"backgroundColor": "default",
"caption": "",
"name": "",
"previewWidth": 512,
"showPreview": true,
"textAlignment": "left",
"url": "https://via.placeholder.com/150",
Expand Down Expand Up @@ -10443,7 +10425,6 @@ exports[`Test moveBlocksUp > Multiple blocks starting in nested block 1`] = `
"backgroundColor": "default",
"caption": "",
"name": "",
"previewWidth": 512,
"showPreview": true,
"textAlignment": "left",
"url": "https://via.placeholder.com/150",
Expand Down Expand Up @@ -11010,7 +10991,6 @@ exports[`Test moveBlocksUp > Out of children 1`] = `
"backgroundColor": "default",
"caption": "",
"name": "",
"previewWidth": 512,
"showPreview": true,
"textAlignment": "left",
"url": "https://via.placeholder.com/150",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ exports[`Test replaceBlocks > Remove multiple consecutive blocks 1`] = `
"backgroundColor": "default",
"caption": "",
"name": "",
"previewWidth": 512,
"showPreview": true,
"textAlignment": "left",
"url": "https://via.placeholder.com/150",
Expand Down Expand Up @@ -694,7 +693,6 @@ exports[`Test replaceBlocks > Remove multiple non-consecutive blocks 1`] = `
"backgroundColor": "default",
"caption": "",
"name": "",
"previewWidth": 512,
"showPreview": true,
"textAlignment": "left",
"url": "https://via.placeholder.com/150",
Expand Down Expand Up @@ -991,7 +989,6 @@ exports[`Test replaceBlocks > Remove single block 1`] = `
"backgroundColor": "default",
"caption": "",
"name": "",
"previewWidth": 512,
"showPreview": true,
"textAlignment": "left",
"url": "https://via.placeholder.com/150",
Expand Down Expand Up @@ -1522,7 +1519,6 @@ exports[`Test replaceBlocks > Replace multiple consecutive blocks with multiple
"backgroundColor": "default",
"caption": "",
"name": "",
"previewWidth": 512,
"showPreview": true,
"textAlignment": "left",
"url": "https://via.placeholder.com/150",
Expand Down Expand Up @@ -2013,7 +2009,6 @@ exports[`Test replaceBlocks > Replace multiple consecutive blocks with single ba
"backgroundColor": "default",
"caption": "",
"name": "",
"previewWidth": 512,
"showPreview": true,
"textAlignment": "left",
"url": "https://via.placeholder.com/150",
Expand Down Expand Up @@ -2561,7 +2556,6 @@ exports[`Test replaceBlocks > Replace multiple consecutive blocks with single co
"backgroundColor": "default",
"caption": "",
"name": "",
"previewWidth": 512,
"showPreview": true,
"textAlignment": "left",
"url": "https://via.placeholder.com/150",
Expand Down Expand Up @@ -3162,7 +3156,6 @@ exports[`Test replaceBlocks > Replace multiple non-consecutive blocks with multi
"backgroundColor": "default",
"caption": "",
"name": "",
"previewWidth": 512,
"showPreview": true,
"textAlignment": "left",
"url": "https://via.placeholder.com/150",
Expand Down Expand Up @@ -3470,7 +3463,6 @@ exports[`Test replaceBlocks > Replace multiple non-consecutive blocks with singl
"backgroundColor": "default",
"caption": "",
"name": "",
"previewWidth": 512,
"showPreview": true,
"textAlignment": "left",
"url": "https://via.placeholder.com/150",
Expand Down Expand Up @@ -3835,7 +3827,6 @@ exports[`Test replaceBlocks > Replace multiple non-consecutive blocks with singl
"backgroundColor": "default",
"caption": "",
"name": "",
"previewWidth": 512,
"showPreview": true,
"textAlignment": "left",
"url": "https://via.placeholder.com/150",
Expand Down Expand Up @@ -4183,7 +4174,6 @@ exports[`Test replaceBlocks > Replace single block with multiple 1`] = `
"backgroundColor": "default",
"caption": "",
"name": "",
"previewWidth": 512,
"showPreview": true,
"textAlignment": "left",
"url": "https://via.placeholder.com/150",
Expand Down Expand Up @@ -4744,7 +4734,6 @@ exports[`Test replaceBlocks > Replace single block with single basic 1`] = `
"backgroundColor": "default",
"caption": "",
"name": "",
"previewWidth": 512,
"showPreview": true,
"textAlignment": "left",
"url": "https://via.placeholder.com/150",
Expand Down Expand Up @@ -5362,7 +5351,6 @@ exports[`Test replaceBlocks > Replace single block with single complex 1`] = `
"backgroundColor": "default",
"caption": "",
"name": "",
"previewWidth": 512,
"showPreview": true,
"textAlignment": "left",
"url": "https://via.placeholder.com/150",
Expand Down
Loading
Loading