Skip to content

Commit 4ff3b02

Browse files
feat(file): previewWidth prop now defaults to undefined (#1664)
1 parent fe06cce commit 4ff3b02

File tree

52 files changed

+59
-124
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+59
-124
lines changed

examples/06-custom-schema/04-pdf-file-block/PDF.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ export const PDF = createReactBlockSpec(
4343
default: true,
4444
},
4545
previewWidth: {
46-
default: 512,
46+
default: undefined,
47+
type: "number",
4748
},
4849
},
4950
content: "none",

packages/core/src/api/blockManipulation/commands/insertBlocks/__snapshots__/insertBlocks.test.ts.snap

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,6 @@ exports[`Test insertBlocks > Insert multiple blocks after 2`] = `
338338
"backgroundColor": "default",
339339
"caption": "",
340340
"name": "",
341-
"previewWidth": 512,
342341
"showPreview": true,
343342
"textAlignment": "left",
344343
"url": "https://via.placeholder.com/150",
@@ -1012,7 +1011,6 @@ exports[`Test insertBlocks > Insert multiple blocks before 2`] = `
10121011
"backgroundColor": "default",
10131012
"caption": "",
10141013
"name": "",
1015-
"previewWidth": 512,
10161014
"showPreview": true,
10171015
"textAlignment": "left",
10181016
"url": "https://via.placeholder.com/150",
@@ -1606,7 +1604,6 @@ exports[`Test insertBlocks > Insert single basic block after 2`] = `
16061604
"backgroundColor": "default",
16071605
"caption": "",
16081606
"name": "",
1609-
"previewWidth": 512,
16101607
"showPreview": true,
16111608
"textAlignment": "left",
16121609
"url": "https://via.placeholder.com/150",
@@ -2212,7 +2209,6 @@ exports[`Test insertBlocks > Insert single basic block before (without type) 2`]
22122209
"backgroundColor": "default",
22132210
"caption": "",
22142211
"name": "",
2215-
"previewWidth": 512,
22162212
"showPreview": true,
22172213
"textAlignment": "left",
22182214
"url": "https://via.placeholder.com/150",
@@ -2806,7 +2802,6 @@ exports[`Test insertBlocks > Insert single basic block before 2`] = `
28062802
"backgroundColor": "default",
28072803
"caption": "",
28082804
"name": "",
2809-
"previewWidth": 512,
28102805
"showPreview": true,
28112806
"textAlignment": "left",
28122807
"url": "https://via.placeholder.com/150",
@@ -3514,7 +3509,6 @@ exports[`Test insertBlocks > Insert single complex block after 2`] = `
35143509
"backgroundColor": "default",
35153510
"caption": "",
35163511
"name": "",
3517-
"previewWidth": 512,
35183512
"showPreview": true,
35193513
"textAlignment": "left",
35203514
"url": "https://via.placeholder.com/150",
@@ -4222,7 +4216,6 @@ exports[`Test insertBlocks > Insert single complex block before 2`] = `
42224216
"backgroundColor": "default",
42234217
"caption": "",
42244218
"name": "",
4225-
"previewWidth": 512,
42264219
"showPreview": true,
42274220
"textAlignment": "left",
42284221
"url": "https://via.placeholder.com/150",

packages/core/src/api/blockManipulation/commands/mergeBlocks/__snapshots__/mergeBlocks.test.ts.snap

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,6 @@ exports[`Test mergeBlocks > Basic 1`] = `
214214
"backgroundColor": "default",
215215
"caption": "",
216216
"name": "",
217-
"previewWidth": 512,
218217
"showPreview": true,
219218
"textAlignment": "left",
220219
"url": "https://via.placeholder.com/150",
@@ -764,7 +763,6 @@ exports[`Test mergeBlocks > Blocks have different types 1`] = `
764763
"backgroundColor": "default",
765764
"caption": "",
766765
"name": "",
767-
"previewWidth": 512,
768766
"showPreview": true,
769767
"textAlignment": "left",
770768
"url": "https://via.placeholder.com/150",
@@ -1314,7 +1312,6 @@ exports[`Test mergeBlocks > First block has children 1`] = `
13141312
"backgroundColor": "default",
13151313
"caption": "",
13161314
"name": "",
1317-
"previewWidth": 512,
13181315
"showPreview": true,
13191316
"textAlignment": "left",
13201317
"url": "https://via.placeholder.com/150",
@@ -1863,7 +1860,6 @@ exports[`Test mergeBlocks > Second block has children 1`] = `
18631860
"backgroundColor": "default",
18641861
"caption": "",
18651862
"name": "",
1866-
"previewWidth": 512,
18671863
"showPreview": true,
18681864
"textAlignment": "left",
18691865
"url": "https://via.placeholder.com/150",
@@ -2430,7 +2426,6 @@ exports[`Test mergeBlocks > Second block is empty 1`] = `
24302426
"backgroundColor": "default",
24312427
"caption": "",
24322428
"name": "",
2433-
"previewWidth": 512,
24342429
"showPreview": true,
24352430
"textAlignment": "left",
24362431
"url": "https://via.placeholder.com/150",

packages/core/src/api/blockManipulation/commands/moveBlocks/__snapshots__/moveBlocks.test.ts.snap

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,6 @@ exports[`Test moveBlocksDown > Basic 1`] = `
231231
"backgroundColor": "default",
232232
"caption": "",
233233
"name": "",
234-
"previewWidth": 512,
235234
"showPreview": true,
236235
"textAlignment": "left",
237236
"url": "https://via.placeholder.com/150",
@@ -798,7 +797,6 @@ exports[`Test moveBlocksDown > Into children 1`] = `
798797
"backgroundColor": "default",
799798
"caption": "",
800799
"name": "",
801-
"previewWidth": 512,
802800
"showPreview": true,
803801
"textAlignment": "left",
804802
"url": "https://via.placeholder.com/150",
@@ -1365,7 +1363,6 @@ exports[`Test moveBlocksDown > Last block 1`] = `
13651363
"backgroundColor": "default",
13661364
"caption": "",
13671365
"name": "",
1368-
"previewWidth": 512,
13691366
"showPreview": true,
13701367
"textAlignment": "left",
13711368
"url": "https://via.placeholder.com/150",
@@ -1932,7 +1929,6 @@ exports[`Test moveBlocksDown > Multiple blocks 1`] = `
19321929
"backgroundColor": "default",
19331930
"caption": "",
19341931
"name": "",
1935-
"previewWidth": 512,
19361932
"showPreview": true,
19371933
"textAlignment": "left",
19381934
"url": "https://via.placeholder.com/150",
@@ -2499,7 +2495,6 @@ exports[`Test moveBlocksDown > Multiple blocks ending in block with children 1`]
24992495
"backgroundColor": "default",
25002496
"caption": "",
25012497
"name": "",
2502-
"previewWidth": 512,
25032498
"showPreview": true,
25042499
"textAlignment": "left",
25052500
"url": "https://via.placeholder.com/150",
@@ -3066,7 +3061,6 @@ exports[`Test moveBlocksDown > Multiple blocks ending in nested block 1`] = `
30663061
"backgroundColor": "default",
30673062
"caption": "",
30683063
"name": "",
3069-
"previewWidth": 512,
30703064
"showPreview": true,
30713065
"textAlignment": "left",
30723066
"url": "https://via.placeholder.com/150",
@@ -3643,7 +3637,6 @@ exports[`Test moveBlocksDown > Multiple blocks starting and ending in nested blo
36433637
"backgroundColor": "default",
36443638
"caption": "",
36453639
"name": "",
3646-
"previewWidth": 512,
36473640
"showPreview": true,
36483641
"textAlignment": "left",
36493642
"url": "https://via.placeholder.com/150",
@@ -4210,7 +4203,6 @@ exports[`Test moveBlocksDown > Multiple blocks starting in block with children 1
42104203
"backgroundColor": "default",
42114204
"caption": "",
42124205
"name": "",
4213-
"previewWidth": 512,
42144206
"showPreview": true,
42154207
"textAlignment": "left",
42164208
"url": "https://via.placeholder.com/150",
@@ -4776,7 +4768,6 @@ exports[`Test moveBlocksDown > Multiple blocks starting in nested block 1`] = `
47764768
"backgroundColor": "default",
47774769
"caption": "",
47784770
"name": "",
4779-
"previewWidth": 512,
47804771
"showPreview": true,
47814772
"textAlignment": "left",
47824773
"url": "https://via.placeholder.com/150",
@@ -5343,7 +5334,6 @@ exports[`Test moveBlocksDown > Out of children 1`] = `
53435334
"backgroundColor": "default",
53445335
"caption": "",
53455336
"name": "",
5346-
"previewWidth": 512,
53475337
"showPreview": true,
53485338
"textAlignment": "left",
53495339
"url": "https://via.placeholder.com/150",
@@ -5909,7 +5899,6 @@ exports[`Test moveBlocksUp > Basic 1`] = `
59095899
"backgroundColor": "default",
59105900
"caption": "",
59115901
"name": "",
5912-
"previewWidth": 512,
59135902
"showPreview": true,
59145903
"textAlignment": "left",
59155904
"url": "https://via.placeholder.com/150",
@@ -6476,7 +6465,6 @@ exports[`Test moveBlocksUp > First block 1`] = `
64766465
"backgroundColor": "default",
64776466
"caption": "",
64786467
"name": "",
6479-
"previewWidth": 512,
64806468
"showPreview": true,
64816469
"textAlignment": "left",
64826470
"url": "https://via.placeholder.com/150",
@@ -7043,7 +7031,6 @@ exports[`Test moveBlocksUp > Into children 1`] = `
70437031
"backgroundColor": "default",
70447032
"caption": "",
70457033
"name": "",
7046-
"previewWidth": 512,
70477034
"showPreview": true,
70487035
"textAlignment": "left",
70497036
"url": "https://via.placeholder.com/150",
@@ -7610,7 +7597,6 @@ exports[`Test moveBlocksUp > Multiple blocks 1`] = `
76107597
"backgroundColor": "default",
76117598
"caption": "",
76127599
"name": "",
7613-
"previewWidth": 512,
76147600
"showPreview": true,
76157601
"textAlignment": "left",
76167602
"url": "https://via.placeholder.com/150",
@@ -8177,7 +8163,6 @@ exports[`Test moveBlocksUp > Multiple blocks ending in block with children 1`] =
81778163
"backgroundColor": "default",
81788164
"caption": "",
81798165
"name": "",
8180-
"previewWidth": 512,
81818166
"showPreview": true,
81828167
"textAlignment": "left",
81838168
"url": "https://via.placeholder.com/150",
@@ -8744,7 +8729,6 @@ exports[`Test moveBlocksUp > Multiple blocks ending in nested block 1`] = `
87448729
"backgroundColor": "default",
87458730
"caption": "",
87468731
"name": "",
8747-
"previewWidth": 512,
87488732
"showPreview": true,
87498733
"textAlignment": "left",
87508734
"url": "https://via.placeholder.com/150",
@@ -9293,7 +9277,6 @@ exports[`Test moveBlocksUp > Multiple blocks starting and ending in nested block
92939277
"backgroundColor": "default",
92949278
"caption": "",
92959279
"name": "",
9296-
"previewWidth": 512,
92979280
"showPreview": true,
92989281
"textAlignment": "left",
92999282
"url": "https://via.placeholder.com/150",
@@ -9877,7 +9860,6 @@ exports[`Test moveBlocksUp > Multiple blocks starting in block with children 1`]
98779860
"backgroundColor": "default",
98789861
"caption": "",
98799862
"name": "",
9880-
"previewWidth": 512,
98819863
"showPreview": true,
98829864
"textAlignment": "left",
98839865
"url": "https://via.placeholder.com/150",
@@ -10443,7 +10425,6 @@ exports[`Test moveBlocksUp > Multiple blocks starting in nested block 1`] = `
1044310425
"backgroundColor": "default",
1044410426
"caption": "",
1044510427
"name": "",
10446-
"previewWidth": 512,
1044710428
"showPreview": true,
1044810429
"textAlignment": "left",
1044910430
"url": "https://via.placeholder.com/150",
@@ -11010,7 +10991,6 @@ exports[`Test moveBlocksUp > Out of children 1`] = `
1101010991
"backgroundColor": "default",
1101110992
"caption": "",
1101210993
"name": "",
11013-
"previewWidth": 512,
1101410994
"showPreview": true,
1101510995
"textAlignment": "left",
1101610996
"url": "https://via.placeholder.com/150",

packages/core/src/api/blockManipulation/commands/replaceBlocks/__snapshots__/replaceBlocks.test.ts.snap

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ exports[`Test replaceBlocks > Remove multiple consecutive blocks 1`] = `
144144
"backgroundColor": "default",
145145
"caption": "",
146146
"name": "",
147-
"previewWidth": 512,
148147
"showPreview": true,
149148
"textAlignment": "left",
150149
"url": "https://via.placeholder.com/150",
@@ -694,7 +693,6 @@ exports[`Test replaceBlocks > Remove multiple non-consecutive blocks 1`] = `
694693
"backgroundColor": "default",
695694
"caption": "",
696695
"name": "",
697-
"previewWidth": 512,
698696
"showPreview": true,
699697
"textAlignment": "left",
700698
"url": "https://via.placeholder.com/150",
@@ -991,7 +989,6 @@ exports[`Test replaceBlocks > Remove single block 1`] = `
991989
"backgroundColor": "default",
992990
"caption": "",
993991
"name": "",
994-
"previewWidth": 512,
995992
"showPreview": true,
996993
"textAlignment": "left",
997994
"url": "https://via.placeholder.com/150",
@@ -1522,7 +1519,6 @@ exports[`Test replaceBlocks > Replace multiple consecutive blocks with multiple
15221519
"backgroundColor": "default",
15231520
"caption": "",
15241521
"name": "",
1525-
"previewWidth": 512,
15261522
"showPreview": true,
15271523
"textAlignment": "left",
15281524
"url": "https://via.placeholder.com/150",
@@ -2013,7 +2009,6 @@ exports[`Test replaceBlocks > Replace multiple consecutive blocks with single ba
20132009
"backgroundColor": "default",
20142010
"caption": "",
20152011
"name": "",
2016-
"previewWidth": 512,
20172012
"showPreview": true,
20182013
"textAlignment": "left",
20192014
"url": "https://via.placeholder.com/150",
@@ -2561,7 +2556,6 @@ exports[`Test replaceBlocks > Replace multiple consecutive blocks with single co
25612556
"backgroundColor": "default",
25622557
"caption": "",
25632558
"name": "",
2564-
"previewWidth": 512,
25652559
"showPreview": true,
25662560
"textAlignment": "left",
25672561
"url": "https://via.placeholder.com/150",
@@ -3162,7 +3156,6 @@ exports[`Test replaceBlocks > Replace multiple non-consecutive blocks with multi
31623156
"backgroundColor": "default",
31633157
"caption": "",
31643158
"name": "",
3165-
"previewWidth": 512,
31663159
"showPreview": true,
31673160
"textAlignment": "left",
31683161
"url": "https://via.placeholder.com/150",
@@ -3470,7 +3463,6 @@ exports[`Test replaceBlocks > Replace multiple non-consecutive blocks with singl
34703463
"backgroundColor": "default",
34713464
"caption": "",
34723465
"name": "",
3473-
"previewWidth": 512,
34743466
"showPreview": true,
34753467
"textAlignment": "left",
34763468
"url": "https://via.placeholder.com/150",
@@ -3835,7 +3827,6 @@ exports[`Test replaceBlocks > Replace multiple non-consecutive blocks with singl
38353827
"backgroundColor": "default",
38363828
"caption": "",
38373829
"name": "",
3838-
"previewWidth": 512,
38393830
"showPreview": true,
38403831
"textAlignment": "left",
38413832
"url": "https://via.placeholder.com/150",
@@ -4183,7 +4174,6 @@ exports[`Test replaceBlocks > Replace single block with multiple 1`] = `
41834174
"backgroundColor": "default",
41844175
"caption": "",
41854176
"name": "",
4186-
"previewWidth": 512,
41874177
"showPreview": true,
41884178
"textAlignment": "left",
41894179
"url": "https://via.placeholder.com/150",
@@ -4744,7 +4734,6 @@ exports[`Test replaceBlocks > Replace single block with single basic 1`] = `
47444734
"backgroundColor": "default",
47454735
"caption": "",
47464736
"name": "",
4747-
"previewWidth": 512,
47484737
"showPreview": true,
47494738
"textAlignment": "left",
47504739
"url": "https://via.placeholder.com/150",
@@ -5362,7 +5351,6 @@ exports[`Test replaceBlocks > Replace single block with single complex 1`] = `
53625351
"backgroundColor": "default",
53635352
"caption": "",
53645353
"name": "",
5365-
"previewWidth": 512,
53665354
"showPreview": true,
53675355
"textAlignment": "left",
53685356
"url": "https://via.placeholder.com/150",

0 commit comments

Comments
 (0)