@wordpress/block-editor 11.7.0 → 11.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/README.md +42 -55
- package/build/components/block-list/block.native.js +4 -3
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-list/index.native.js +11 -21
- package/build/components/block-list/index.native.js.map +1 -1
- package/build/components/block-list/use-in-between-inserter.js +3 -1
- package/build/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build/components/block-popover/inbetween.js +2 -9
- package/build/components/block-popover/inbetween.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js +1 -10
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/caption/index.native.js +0 -1
- package/build/components/caption/index.native.js.map +1 -1
- package/build/components/date-format-picker/index.js +1 -1
- package/build/components/date-format-picker/index.js.map +1 -1
- package/build/components/global-styles/border-panel.js +15 -29
- package/build/components/global-styles/border-panel.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +15 -14
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/effects-panel.js +244 -0
- package/build/components/global-styles/effects-panel.js.map +1 -0
- package/build/components/global-styles/filters-panel.js +151 -0
- package/build/components/global-styles/filters-panel.js.map +1 -0
- package/build/components/global-styles/get-block-css-selector.js +1 -12
- package/build/components/global-styles/get-block-css-selector.js.map +1 -1
- package/build/components/global-styles/hooks.js +7 -0
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/index.js +28 -0
- package/build/components/global-styles/index.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +15 -7
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/iframe/index.js +1 -1
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/image-size-control/use-dimension-handler.js +5 -3
- package/build/components/image-size-control/use-dimension-handler.js.map +1 -1
- package/build/components/index.js +16 -0
- package/build/components/index.js.map +1 -1
- package/build/components/inserter/block-patterns-tab.js +4 -2
- package/build/components/inserter/block-patterns-tab.js.map +1 -1
- package/build/components/inspector-controls-tabs/utils.js +5 -3
- package/build/components/inspector-controls-tabs/utils.js.map +1 -1
- package/build/components/list-view/block.js +1 -0
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/list-view/index.js +22 -4
- package/build/components/list-view/index.js.map +1 -1
- package/build/components/list-view/use-list-view-client-ids.js +7 -3
- package/build/components/list-view/use-list-view-client-ids.js.map +1 -1
- package/build/components/list-view/use-list-view-drop-zone.js +8 -2
- package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
- package/build/components/off-canvas-editor/block-contents.js +6 -1
- package/build/components/off-canvas-editor/block-contents.js.map +1 -1
- package/build/components/off-canvas-editor/index.js +17 -14
- package/build/components/off-canvas-editor/index.js.map +1 -1
- package/build/components/resizable-box-popover/index.js +38 -0
- package/build/components/resizable-box-popover/index.js.map +1 -0
- package/build/components/rich-text/index.js +0 -1
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/index.native.js +7 -11
- package/build/components/rich-text/index.native.js.map +1 -1
- package/build/components/spacing-sizes-control/spacing-input-control.js +8 -0
- package/build/components/spacing-sizes-control/spacing-input-control.js.map +1 -1
- package/build/hooks/anchor.js +1 -1
- package/build/hooks/anchor.js.map +1 -1
- package/build/hooks/border.js +1 -1
- package/build/hooks/border.js.map +1 -1
- package/build/hooks/duotone.js +92 -66
- package/build/hooks/duotone.js.map +1 -1
- package/build/hooks/margin.js +27 -17
- package/build/hooks/margin.js.map +1 -1
- package/build/hooks/padding.js +19 -9
- package/build/hooks/padding.js.map +1 -1
- package/build/hooks/utils.js +7 -4
- package/build/hooks/utils.js.map +1 -1
- package/build/layouts/utils.js +3 -2
- package/build/layouts/utils.js.map +1 -1
- package/build/private-apis.js +4 -1
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js +1 -1
- package/build/store/actions.js.map +1 -1
- package/build/utils/object.js +1 -1
- package/build/utils/object.js.map +1 -1
- package/build-module/components/block-list/block.native.js +4 -3
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-list/index.native.js +11 -19
- package/build-module/components/block-list/index.native.js.map +1 -1
- package/build-module/components/block-list/use-in-between-inserter.js +2 -1
- package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build-module/components/block-popover/inbetween.js +2 -9
- package/build-module/components/block-popover/inbetween.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +1 -9
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/caption/index.native.js +0 -1
- package/build-module/components/caption/index.native.js.map +1 -1
- package/build-module/components/date-format-picker/index.js +1 -1
- package/build-module/components/date-format-picker/index.js.map +1 -1
- package/build-module/components/global-styles/border-panel.js +15 -29
- package/build-module/components/global-styles/border-panel.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +15 -14
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/effects-panel.js +228 -0
- package/build-module/components/global-styles/effects-panel.js.map +1 -0
- package/build-module/components/global-styles/filters-panel.js +139 -0
- package/build-module/components/global-styles/filters-panel.js.map +1 -0
- package/build-module/components/global-styles/get-block-css-selector.js +1 -12
- package/build-module/components/global-styles/get-block-css-selector.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +7 -0
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/index.js +2 -0
- package/build-module/components/global-styles/index.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +16 -8
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/iframe/index.js +1 -1
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/image-size-control/use-dimension-handler.js +5 -3
- package/build-module/components/image-size-control/use-dimension-handler.js.map +1 -1
- package/build-module/components/index.js +1 -0
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab.js +5 -2
- package/build-module/components/inserter/block-patterns-tab.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/utils.js +4 -3
- package/build-module/components/inspector-controls-tabs/utils.js.map +1 -1
- package/build-module/components/list-view/block.js +1 -0
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/list-view/index.js +21 -4
- package/build-module/components/list-view/index.js.map +1 -1
- package/build-module/components/list-view/use-list-view-client-ids.js +7 -3
- package/build-module/components/list-view/use-list-view-client-ids.js.map +1 -1
- package/build-module/components/list-view/use-list-view-drop-zone.js +8 -4
- package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
- package/build-module/components/off-canvas-editor/block-contents.js +5 -1
- package/build-module/components/off-canvas-editor/block-contents.js.map +1 -1
- package/build-module/components/off-canvas-editor/index.js +17 -14
- package/build-module/components/off-canvas-editor/index.js.map +1 -1
- package/build-module/components/resizable-box-popover/index.js +26 -0
- package/build-module/components/resizable-box-popover/index.js.map +1 -0
- package/build-module/components/rich-text/index.js +0 -1
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/index.native.js +7 -10
- package/build-module/components/rich-text/index.native.js.map +1 -1
- package/build-module/components/spacing-sizes-control/spacing-input-control.js +7 -0
- package/build-module/components/spacing-sizes-control/spacing-input-control.js.map +1 -1
- package/build-module/hooks/anchor.js +1 -1
- package/build-module/hooks/anchor.js.map +1 -1
- package/build-module/hooks/border.js +1 -1
- package/build-module/hooks/border.js.map +1 -1
- package/build-module/hooks/duotone.js +90 -66
- package/build-module/hooks/duotone.js.map +1 -1
- package/build-module/hooks/margin.js +29 -18
- package/build-module/hooks/margin.js.map +1 -1
- package/build-module/hooks/padding.js +21 -10
- package/build-module/hooks/padding.js.map +1 -1
- package/build-module/hooks/utils.js +8 -5
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/layouts/utils.js +3 -2
- package/build-module/layouts/utils.js.map +1 -1
- package/build-module/private-apis.js +3 -1
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js +1 -1
- package/build-module/store/actions.js.map +1 -1
- package/build-module/utils/object.js +1 -1
- package/build-module/utils/object.js.map +1 -1
- package/build-style/style-rtl.css +51 -10
- package/build-style/style.css +51 -10
- package/package.json +31 -31
- package/src/components/block-inspector/style.scss +6 -4
- package/src/components/block-list/block.native.js +3 -2
- package/src/components/block-list/index.native.js +19 -38
- package/src/components/block-list/use-in-between-inserter.js +4 -1
- package/src/components/block-popover/inbetween.js +2 -13
- package/src/components/block-settings-menu/block-settings-dropdown.js +2 -12
- package/src/components/caption/index.native.js +0 -1
- package/src/components/date-format-picker/index.js +1 -1
- package/src/components/global-styles/README.md +129 -16
- package/src/components/global-styles/border-panel.js +13 -32
- package/src/components/global-styles/dimensions-panel.js +30 -13
- package/src/components/global-styles/effects-panel.js +228 -0
- package/src/components/global-styles/filters-panel.js +157 -0
- package/src/components/global-styles/get-block-css-selector.js +0 -11
- package/src/components/global-styles/hooks.js +10 -0
- package/src/components/global-styles/index.js +2 -0
- package/src/components/global-styles/style.scss +42 -0
- package/src/components/global-styles/test/use-global-styles-output.js +4 -4
- package/src/components/global-styles/use-global-styles-output.js +27 -11
- package/src/components/iframe/index.js +1 -1
- package/src/components/image-size-control/use-dimension-handler.js +4 -3
- package/src/components/index.js +4 -1
- package/src/components/inserter/block-patterns-tab.js +3 -1
- package/src/components/inspector-controls-tabs/utils.js +4 -3
- package/src/components/list-view/README.md +2 -0
- package/src/components/list-view/block.js +1 -0
- package/src/components/list-view/index.js +18 -2
- package/src/components/list-view/style.scss +3 -1
- package/src/components/list-view/test/use-list-view-drop-zone.js +188 -0
- package/src/components/list-view/use-list-view-client-ids.js +5 -3
- package/src/components/list-view/use-list-view-drop-zone.js +9 -3
- package/src/components/off-canvas-editor/block-contents.js +4 -0
- package/src/components/off-canvas-editor/index.js +15 -11
- package/src/components/resizable-box-popover/index.js +27 -0
- package/src/components/rich-text/index.js +0 -1
- package/src/components/rich-text/index.native.js +2 -5
- package/src/components/spacing-sizes-control/spacing-input-control.js +10 -0
- package/src/components/spacing-sizes-control/style.scss +7 -7
- package/src/hooks/anchor.js +1 -1
- package/src/hooks/border.js +1 -1
- package/src/hooks/duotone.js +116 -74
- package/src/hooks/margin.js +31 -26
- package/src/hooks/padding.js +24 -18
- package/src/hooks/utils.js +4 -4
- package/src/layouts/utils.js +2 -2
- package/src/private-apis.js +2 -0
- package/src/store/actions.js +1 -1
- package/src/style.scss +1 -0
- package/src/utils/object.js +1 -1
- package/src/utils/test/object.js +38 -0
- package/build/components/rich-text/use-native-props.js +0 -11
- package/build/components/rich-text/use-native-props.js.map +0 -1
- package/build/components/rich-text/use-native-props.native.js +0 -24
- package/build/components/rich-text/use-native-props.native.js.map +0 -1
- package/build-module/components/rich-text/use-native-props.js +0 -4
- package/build-module/components/rich-text/use-native-props.js.map +0 -1
- package/build-module/components/rich-text/use-native-props.native.js +0 -15
- package/build-module/components/rich-text/use-native-props.native.js.map +0 -1
- package/src/components/rich-text/use-native-props.js +0 -3
- package/src/components/rich-text/use-native-props.native.js +0 -17
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -233,8 +233,7 @@ Undocumented declaration.
|
|
|
233
233
|
|
|
234
234
|
### BlockTitle
|
|
235
235
|
|
|
236
|
-
Renders the block's configured title as a string, or empty if the title
|
|
237
|
-
cannot be determined.
|
|
236
|
+
Renders the block's configured title as a string, or empty if the title cannot be determined.
|
|
238
237
|
|
|
239
238
|
_Usage_
|
|
240
239
|
|
|
@@ -264,9 +263,7 @@ _Related_
|
|
|
264
263
|
|
|
265
264
|
### BlockTools
|
|
266
265
|
|
|
267
|
-
Renders block tools (the block toolbar, select/navigation mode toolbar, the
|
|
268
|
-
insertion point and a slot for the inline rich text toolbar). Must be wrapped
|
|
269
|
-
around the block content and editor styles wrapper or iframe.
|
|
266
|
+
Renders block tools (the block toolbar, select/navigation mode toolbar, the insertion point and a slot for the inline rich text toolbar). Must be wrapped around the block content and editor styles wrapper or iframe.
|
|
270
267
|
|
|
271
268
|
_Parameters_
|
|
272
269
|
|
|
@@ -320,8 +317,7 @@ _Related_
|
|
|
320
317
|
|
|
321
318
|
### createCustomColorsHOC
|
|
322
319
|
|
|
323
|
-
A higher-order component factory for creating a 'withCustomColors' HOC, which handles color logic
|
|
324
|
-
for class generation color value, retrieval and color attribute setting.
|
|
320
|
+
A higher-order component factory for creating a 'withCustomColors' HOC, which handles color logic for class generation color value, retrieval and color attribute setting.
|
|
325
321
|
|
|
326
322
|
Use this higher-order component to work with a custom set of colors.
|
|
327
323
|
|
|
@@ -373,8 +369,7 @@ _Returns_
|
|
|
373
369
|
|
|
374
370
|
### getColorObjectByAttributeValues
|
|
375
371
|
|
|
376
|
-
Provided an array of color objects as set by the theme or by the editor defaults,
|
|
377
|
-
and the values of the defined color or custom color returns a color object describing the color.
|
|
372
|
+
Provided an array of color objects as set by the theme or by the editor defaults, and the values of the defined color or custom color returns a color object describing the color.
|
|
378
373
|
|
|
379
374
|
_Parameters_
|
|
380
375
|
|
|
@@ -401,12 +396,9 @@ _Returns_
|
|
|
401
396
|
|
|
402
397
|
### getComputedFluidTypographyValue
|
|
403
398
|
|
|
404
|
-
Computes a fluid font-size value that uses clamp(). A minimum and maximum
|
|
405
|
-
font size OR a single font size can be specified.
|
|
399
|
+
Computes a fluid font-size value that uses clamp(). A minimum and maximum font size OR a single font size can be specified.
|
|
406
400
|
|
|
407
|
-
If a single font size is specified, it is scaled up and down by
|
|
408
|
-
minimumFontSizeFactor and maximumFontSizeFactor to arrive at the minimum and
|
|
409
|
-
maximum sizes.
|
|
401
|
+
If a single font size is specified, it is scaled up and down by minimumFontSizeFactor and maximumFontSizeFactor to arrive at the minimum and maximum sizes.
|
|
410
402
|
|
|
411
403
|
_Usage_
|
|
412
404
|
|
|
@@ -440,8 +432,7 @@ _Returns_
|
|
|
440
432
|
|
|
441
433
|
### getFontSize
|
|
442
434
|
|
|
443
|
-
Returns the font size object based on an array of named font sizes and the namedFontSize and customFontSize values.
|
|
444
|
-
If namedFontSize is undefined or not found in fontSizes an object with just the size value based on customFontSize is returned.
|
|
435
|
+
Returns the font size object based on an array of named font sizes and the namedFontSize and customFontSize values. If namedFontSize is undefined or not found in fontSizes an object with just the size value based on customFontSize is returned.
|
|
445
436
|
|
|
446
437
|
_Parameters_
|
|
447
438
|
|
|
@@ -517,10 +508,21 @@ _Returns_
|
|
|
517
508
|
|
|
518
509
|
- `string`: returns the cssUnit value in a simple px format.
|
|
519
510
|
|
|
511
|
+
### getSpacingPresetCssVar
|
|
512
|
+
|
|
513
|
+
Converts a spacing preset into a custom value.
|
|
514
|
+
|
|
515
|
+
_Parameters_
|
|
516
|
+
|
|
517
|
+
- _value_ `string`: Value to convert.
|
|
518
|
+
|
|
519
|
+
_Returns_
|
|
520
|
+
|
|
521
|
+
- `string | undefined`: CSS var string for given spacing preset value.
|
|
522
|
+
|
|
520
523
|
### getTypographyClassesAndStyles
|
|
521
524
|
|
|
522
|
-
Provides the CSS class names and inline styles for a block's typography support
|
|
523
|
-
attributes.
|
|
525
|
+
Provides the CSS class names and inline styles for a block's typography support attributes.
|
|
524
526
|
|
|
525
527
|
_Parameters_
|
|
526
528
|
|
|
@@ -570,6 +572,18 @@ _Related_
|
|
|
570
572
|
|
|
571
573
|
- <https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/inspector-controls/README.md>
|
|
572
574
|
|
|
575
|
+
### isValueSpacingPreset
|
|
576
|
+
|
|
577
|
+
Checks is given value is a spacing preset.
|
|
578
|
+
|
|
579
|
+
_Parameters_
|
|
580
|
+
|
|
581
|
+
- _value_ `string`: Value to check
|
|
582
|
+
|
|
583
|
+
_Returns_
|
|
584
|
+
|
|
585
|
+
- `boolean`: Return true if value is string in format var:preset|spacing|.
|
|
586
|
+
|
|
573
587
|
### JustifyContentControl
|
|
574
588
|
|
|
575
589
|
_Related_
|
|
@@ -616,8 +630,7 @@ _Related_
|
|
|
616
630
|
|
|
617
631
|
> **Deprecated**
|
|
618
632
|
|
|
619
|
-
Scrolls the multi block selection end into view if not in view already. This
|
|
620
|
-
is important to do after selection by keyboard.
|
|
633
|
+
Scrolls the multi block selection end into view if not in view already. This is important to do after selection by keyboard.
|
|
621
634
|
|
|
622
635
|
### NavigableToolbar
|
|
623
636
|
|
|
@@ -731,9 +744,7 @@ _Returns_
|
|
|
731
744
|
|
|
732
745
|
### Typewriter
|
|
733
746
|
|
|
734
|
-
Ensures that the text selection keeps the same vertical distance from the
|
|
735
|
-
viewport during keyboard events within this component. The vertical distance
|
|
736
|
-
can vary. It is the last clicked or scrolled to position.
|
|
747
|
+
Ensures that the text selection keeps the same vertical distance from the viewport during keyboard events within this component. The vertical distance can vary. It is the last clicked or scrolled to position.
|
|
737
748
|
|
|
738
749
|
### URLInput
|
|
739
750
|
|
|
@@ -755,15 +766,9 @@ _Related_
|
|
|
755
766
|
|
|
756
767
|
### useBlockDisplayInformation
|
|
757
768
|
|
|
758
|
-
Hook used to try to find a matching block variation and return
|
|
759
|
-
the appropriate information for display reasons. In order to
|
|
760
|
-
to try to find a match we need to things:
|
|
761
|
-
1\. Block's client id to extract it's current attributes.
|
|
762
|
-
2\. A block variation should have set `isActive` prop to a proper function.
|
|
769
|
+
Hook used to try to find a matching block variation and return the appropriate information for display reasons. In order to to try to find a match we need to things: 1. Block's client id to extract it's current attributes. 2. A block variation should have set `isActive` prop to a proper function.
|
|
763
770
|
|
|
764
|
-
If for any reason a block variation match cannot be found,
|
|
765
|
-
the returned information come from the Block Type.
|
|
766
|
-
If no blockType is found with the provided clientId, returns null.
|
|
771
|
+
If for any reason a block variation match cannot be found, the returned information come from the Block Type. If no blockType is found with the provided clientId, returns null.
|
|
767
772
|
|
|
768
773
|
_Parameters_
|
|
769
774
|
|
|
@@ -775,10 +780,7 @@ _Returns_
|
|
|
775
780
|
|
|
776
781
|
### useBlockEditContext
|
|
777
782
|
|
|
778
|
-
The `useBlockEditContext` hook provides information about the block this hook is being used in.
|
|
779
|
-
It returns an object with the `name`, `isSelected` state, and the `clientId` of the block.
|
|
780
|
-
It is useful if you want to create custom hooks that need access to the current blocks clientId
|
|
781
|
-
but don't want to rely on the data getting passed in as a parameter.
|
|
783
|
+
The `useBlockEditContext` hook provides information about the block this hook is being used in. It returns an object with the `name`, `isSelected` state, and the `clientId` of the block. It is useful if you want to create custom hooks that need access to the current blocks clientId but don't want to rely on the data getting passed in as a parameter.
|
|
782
784
|
|
|
783
785
|
_Returns_
|
|
784
786
|
|
|
@@ -786,13 +788,7 @@ _Returns_
|
|
|
786
788
|
|
|
787
789
|
### useBlockProps
|
|
788
790
|
|
|
789
|
-
This hook is used to lightly mark an element as a block element. The element
|
|
790
|
-
should be the outermost element of a block. Call this hook and pass the
|
|
791
|
-
returned props to the element to mark as a block. If you define a ref for the
|
|
792
|
-
element, it is important to pass the ref to this hook, which the hook in turn
|
|
793
|
-
will pass to the component through the props it returns. Optionally, you can
|
|
794
|
-
also pass any other props through this hook, and they will be merged and
|
|
795
|
-
returned.
|
|
791
|
+
This hook is used to lightly mark an element as a block element. The element should be the outermost element of a block. Call this hook and pass the returned props to the element to mark as a block. If you define a ref for the element, it is important to pass the ref to this hook, which the hook in turn will pass to the component through the props it returns. Optionally, you can also pass any other props through this hook, and they will be merged and returned.
|
|
796
792
|
|
|
797
793
|
_Parameters_
|
|
798
794
|
|
|
@@ -818,13 +814,7 @@ _Returns_
|
|
|
818
814
|
|
|
819
815
|
### useInnerBlocksProps
|
|
820
816
|
|
|
821
|
-
This hook is used to lightly mark an element as an inner blocks wrapper
|
|
822
|
-
element. Call this hook and pass the returned props to the element to mark as
|
|
823
|
-
an inner blocks wrapper, automatically rendering inner blocks as children. If
|
|
824
|
-
you define a ref for the element, it is important to pass the ref to this
|
|
825
|
-
hook, which the hook in turn will pass to the component through the props it
|
|
826
|
-
returns. Optionally, you can also pass any other props through this hook, and
|
|
827
|
-
they will be merged and returned.
|
|
817
|
+
This hook is used to lightly mark an element as an inner blocks wrapper element. Call this hook and pass the returned props to the element to mark as an inner blocks wrapper, automatically rendering inner blocks as children. If you define a ref for the element, it is important to pass the ref to this hook, which the hook in turn will pass to the component through the props it returns. Optionally, you can also pass any other props through this hook, and they will be merged and returned.
|
|
828
818
|
|
|
829
819
|
_Related_
|
|
830
820
|
|
|
@@ -839,8 +829,7 @@ _Parameters_
|
|
|
839
829
|
|
|
840
830
|
Hook that retrieves the given setting for the block instance in use.
|
|
841
831
|
|
|
842
|
-
It looks up the settings first in the block instance hierarchy.
|
|
843
|
-
If none is found, it'll look it up in the block editor store.
|
|
832
|
+
It looks up the settings first in the block instance hierarchy. If none is found, it'll look it up in the block editor store.
|
|
844
833
|
|
|
845
834
|
_Usage_
|
|
846
835
|
|
|
@@ -891,8 +880,7 @@ _Returns_
|
|
|
891
880
|
|
|
892
881
|
### withFontSizes
|
|
893
882
|
|
|
894
|
-
Higher-order component, which handles font size logic for class generation,
|
|
895
|
-
font size value retrieval, and font size change handling.
|
|
883
|
+
Higher-order component, which handles font size logic for class generation, font size value retrieval, and font size change handling.
|
|
896
884
|
|
|
897
885
|
_Parameters_
|
|
898
886
|
|
|
@@ -904,8 +892,7 @@ _Returns_
|
|
|
904
892
|
|
|
905
893
|
### WritingFlow
|
|
906
894
|
|
|
907
|
-
Handles selection and navigation across blocks. This component should be
|
|
908
|
-
wrapped around BlockList.
|
|
895
|
+
Handles selection and navigation across blocks. This component should be wrapped around BlockList.
|
|
909
896
|
|
|
910
897
|
_Parameters_
|
|
911
898
|
|
|
@@ -222,15 +222,16 @@ class BlockListBlock extends _element.Component {
|
|
|
222
222
|
isFullWidth,
|
|
223
223
|
isContainerRelated
|
|
224
224
|
} = _components.alignmentHelpers;
|
|
225
|
-
const
|
|
225
|
+
const isFocused = isSelected || isInnerBlockSelected;
|
|
226
226
|
const screenWidth = Math.floor(_reactNative.Dimensions.get('window').width);
|
|
227
227
|
const isScreenWidthEqual = blockWidth === screenWidth;
|
|
228
228
|
const isScreenWidthWider = blockWidth < screenWidth;
|
|
229
229
|
const isFullWidthToolbar = isFullWidth(align) || isScreenWidthEqual;
|
|
230
230
|
return (0, _element.createElement)(_reactNative.TouchableWithoutFeedback, {
|
|
231
231
|
onPress: this.onFocus,
|
|
232
|
-
accessible:
|
|
233
|
-
accessibilityRole: 'button'
|
|
232
|
+
accessible: !isFocused,
|
|
233
|
+
accessibilityRole: 'button',
|
|
234
|
+
disabled: isFocused
|
|
234
235
|
}, (0, _element.createElement)(_reactNative.View, {
|
|
235
236
|
style: {
|
|
236
237
|
flex: 1
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-editor/src/components/block-list/block.native.js"],"names":["emptyArray","BlockForType","attributes","clientId","contentStyle","getBlockWidth","insertBlocksAfter","isSelected","onMerge","name","onBlockFocus","onChange","onDeleteBlock","onReplace","parentWidth","parentBlockAlignment","wrapperProps","blockWidth","baseGlobalStyles","defaultColors","fontSizes","globalStyle","mergedStyle","style","JSON","stringify","Object","fromEntries","entries","filter","key","GlobalStylesContext","BLOCK_STYLE_ATTRIBUTES","includes","parentLayout","BlockListBlock","Component","constructor","arguments","bind","onFocus","state","props","marginHorizontal","anchorNodeRef","firstToSelectId","onSelect","blocks","onInsertBlocks","order","nativeEvent","layout","layoutWidth","Math","floor","width","setState","getBlockForType","renderBlockTitle","styles","blockTitle","render","blockType","icon","isValid","title","isDimmed","isTouchable","isStackedHorizontally","isParentSelected","getStylesFromColorScheme","marginVertical","isInnerBlockSelected","draggingEnabled","draggingClientId","align","accessibilityLabel","isFullWidth","isContainerRelated","alignmentHelpers","accessible","screenWidth","Dimensions","get","isScreenWidthEqual","isScreenWidthWider","isFullWidthToolbar","flex","dimmed","solidBorder","borderFullWidth","containerBorderFullWidth","solidBorderColor","solidBorderColorDark","dashedBorder","dashedBorderColor","dashedBorderColorDark","neutralToolbar","current","wrapperPropsCache","WeakMap","emptyObj","getWrapperProps","value","getWrapperPropsFunction","cachedValue","set","select","getBlockIndex","getBlockCount","getSettings","isBlockSelected","getBlock","getSelectedBlockClientId","getLowestCommonAncestorWithSelectedBlock","getBlockParents","hasSelectedInnerBlock","getBlockHierarchyRootClientId","blockEditorStore","block","parents","parentId","selectedBlockClientId","commonAncestor","commonAncestorIndex","indexOf","length","selectedParents","isDescendantOfParentSelected","__experimentalGlobalStylesBaseStyles","hasInnerBlocks","getEditWrapperProps","dispatch","ownProps","registry","insertBlocks","mergeBlocks","replaceBlocks","selectBlock","updateBlockAttributes","moveBlocksToPosition","removeBlock","forward","rootClientId","getPreviousBlockClientId","getNextBlockClientId","getBlockAttributes","getBlockName","getBlockOrder","getBlockRootClientId","canInsertBlockType","moveFirstItemUp","_clientId","changeSelection","targetRootClientId","blockOrder","firstClientId","replacement","batch","nextRootClientId","rootAttributes","previousRootAttributes","keys","every","nextBlockClientId","previousBlockClientId","previousRootClientId","index","initialPosition","indexToSelect","withPreferredColorScheme"],"mappings":";;;;;;;;;AAQA;;;;AALA;;AAMA;;AAOA;;AACA;;AACA;;AAOA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AApCA;AACA;AACA;;AAGA;AACA;AACA;;AAoBA;AACA;AACA;AASA,MAAMA,UAAU,GAAG,EAAnB;;AACA,SAASC,YAAT,OAkBI;AAAA,MAlBmB;AACtBC,IAAAA,UADsB;AAEtBC,IAAAA,QAFsB;AAGtBC,IAAAA,YAHsB;AAItBC,IAAAA,aAJsB;AAKtBC,IAAAA,iBALsB;AAMtBC,IAAAA,UANsB;AAOtBC,IAAAA,OAPsB;AAQtBC,IAAAA,IARsB;AAStBC,IAAAA,YATsB;AAUtBC,IAAAA,QAVsB;AAWtBC,IAAAA,aAXsB;AAYtBC,IAAAA,SAZsB;AAatBC,IAAAA,WAbsB;AActBC,IAAAA,oBAdsB;AAetBC,IAAAA,YAfsB;AAgBtBC,IAAAA,UAhBsB;AAiBtBC,IAAAA;AAjBsB,GAkBnB;AACH,QAAMC,aAAa,GAAG,8CAAtB;AACA,QAAMC,SAAS,GAAG,6BAAY,sBAAZ,KAAwCpB,UAA1D;AACA,QAAMqB,WAAW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AqB,CAAEN,QAAQ,CAAClI,QAAX,EAAqBD,UAArB,CAArB;AACA,KAxLK;;AAyLNW,IAAAA,SAAS,CAAEkC,MAAF,EAAU0H,aAAV,EAA0B;AAClChC,MAAAA,aAAa,CAAE,CAAEJ,QAAQ,CAAClI,QAAX,CAAF,EAAyB4C,MAAzB,EAAiC0H,aAAjC,CAAb;AACA;;AA3LK,GAAP;AA6LA,CAxMD,CAzFuB,EAkSvBC,iCAlSuB,CAAT,EAmSVvI,cAnSU,C","sourcesContent":["/**\n * External dependencies\n */\nimport { View, Text, TouchableWithoutFeedback, Dimensions } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { Component, createRef, useMemo } from '@wordpress/element';\nimport {\n\tGlobalStylesContext,\n\tgetMergedGlobalStyles,\n\tuseMobileGlobalStylesColors,\n\talignmentHelpers,\n\tuseGlobalStyles,\n} from '@wordpress/components';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { compose, withPreferredColorScheme } from '@wordpress/compose';\nimport {\n\tgetBlockType,\n\t__experimentalGetAccessibleBlockLabel as getAccessibleBlockLabel,\n\tswitchToBlockType,\n\tgetDefaultBlockName,\n\tisUnmodifiedBlock,\n} from '@wordpress/blocks';\nimport { useSetting } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport styles from './block.scss';\nimport BlockEdit from '../block-edit';\nimport BlockInvalidWarning from './block-invalid-warning';\nimport BlockMobileToolbar from '../block-mobile-toolbar';\nimport { store as blockEditorStore } from '../../store';\nimport BlockDraggable from '../block-draggable';\nimport { useLayout } from './layout';\n\nconst emptyArray = [];\nfunction BlockForType( {\n\tattributes,\n\tclientId,\n\tcontentStyle,\n\tgetBlockWidth,\n\tinsertBlocksAfter,\n\tisSelected,\n\tonMerge,\n\tname,\n\tonBlockFocus,\n\tonChange,\n\tonDeleteBlock,\n\tonReplace,\n\tparentWidth,\n\tparentBlockAlignment,\n\twrapperProps,\n\tblockWidth,\n\tbaseGlobalStyles,\n} ) {\n\tconst defaultColors = useMobileGlobalStylesColors();\n\tconst fontSizes = useSetting( 'typography.fontSizes' ) || emptyArray;\n\tconst globalStyle = useGlobalStyles();\n\tconst mergedStyle = useMemo( () => {\n\t\treturn getMergedGlobalStyles(\n\t\t\tbaseGlobalStyles,\n\t\t\tglobalStyle,\n\t\t\twrapperProps.style,\n\t\t\tattributes,\n\t\t\tdefaultColors,\n\t\t\tname,\n\t\t\tfontSizes\n\t\t);\n\t}, [\n\t\tdefaultColors,\n\t\tglobalStyle,\n\t\t// I couldn't simply use attributes and wrapperProps.styles as a dependency because they are almost always a new reference.\n\t\t// Thanks to the JSON.stringify we check if the value is the same instead of reference.\n\t\tJSON.stringify( wrapperProps.style ),\n\t\tJSON.stringify(\n\t\t\tObject.fromEntries(\n\t\t\t\tObject.entries( attributes ?? {} ).filter( ( [ key ] ) =>\n\t\t\t\t\tGlobalStylesContext.BLOCK_STYLE_ATTRIBUTES.includes( key )\n\t\t\t\t)\n\t\t\t)\n\t\t),\n\t] );\n\n\tconst parentLayout = useLayout();\n\n\treturn (\n\t\t<GlobalStylesContext.Provider value={ mergedStyle }>\n\t\t\t<BlockEdit\n\t\t\t\tname={ name }\n\t\t\t\tisSelected={ isSelected }\n\t\t\t\tattributes={ attributes }\n\t\t\t\tsetAttributes={ onChange }\n\t\t\t\tonFocus={ onBlockFocus }\n\t\t\t\tonReplace={ onReplace }\n\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\tmergeBlocks={ onMerge }\n\t\t\t\t// Block level styles.\n\t\t\t\twrapperProps={ wrapperProps }\n\t\t\t\t// Inherited styles merged with block level styles.\n\t\t\t\tstyle={ mergedStyle }\n\t\t\t\tclientId={ clientId }\n\t\t\t\tparentWidth={ parentWidth }\n\t\t\t\tcontentStyle={ contentStyle }\n\t\t\t\tonDeleteBlock={ onDeleteBlock }\n\t\t\t\tblockWidth={ blockWidth }\n\t\t\t\tparentBlockAlignment={ parentBlockAlignment }\n\t\t\t\t__unstableParentLayout={ parentLayout }\n\t\t\t/>\n\t\t\t<View onLayout={ getBlockWidth } />\n\t\t</GlobalStylesContext.Provider>\n\t);\n}\n\nclass BlockListBlock extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.insertBlocksAfter = this.insertBlocksAfter.bind( this );\n\t\tthis.onFocus = this.onFocus.bind( this );\n\t\tthis.getBlockWidth = this.getBlockWidth.bind( this );\n\n\t\tthis.state = {\n\t\t\tblockWidth: this.props.blockWidth - 2 * this.props.marginHorizontal,\n\t\t};\n\n\t\tthis.anchorNodeRef = createRef();\n\t}\n\n\tonFocus() {\n\t\tconst { firstToSelectId, isSelected, onSelect } = this.props;\n\t\tif ( ! isSelected ) {\n\t\t\tonSelect( firstToSelectId );\n\t\t}\n\t}\n\n\tinsertBlocksAfter( blocks ) {\n\t\tthis.props.onInsertBlocks( blocks, this.props.order + 1 );\n\n\t\tif ( blocks[ 0 ] ) {\n\t\t\t// Focus on the first block inserted.\n\t\t\tthis.props.onSelect( blocks[ 0 ].clientId );\n\t\t}\n\t}\n\n\tgetBlockWidth( { nativeEvent } ) {\n\t\tconst { layout } = nativeEvent;\n\t\tconst { blockWidth } = this.state;\n\t\tconst layoutWidth = Math.floor( layout.width );\n\n\t\tif ( ! blockWidth || ! layoutWidth ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( blockWidth !== layoutWidth ) {\n\t\t\tthis.setState( { blockWidth: layoutWidth } );\n\t\t}\n\t}\n\n\tgetBlockForType() {\n\t\tconst { blockWidth } = this.state;\n\t\treturn (\n\t\t\t<BlockForType\n\t\t\t\t{ ...this.props }\n\t\t\t\tonBlockFocus={ this.onFocus }\n\t\t\t\tinsertBlocksAfter={ this.insertBlocksAfter }\n\t\t\t\tgetBlockWidth={ this.getBlockWidth }\n\t\t\t\tblockWidth={ blockWidth }\n\t\t\t/>\n\t\t);\n\t}\n\n\trenderBlockTitle() {\n\t\treturn (\n\t\t\t<View style={ styles.blockTitle }>\n\t\t\t\t<Text>BlockType: { this.props.name }</Text>\n\t\t\t</View>\n\t\t);\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tattributes,\n\t\t\tblockType,\n\t\t\tclientId,\n\t\t\ticon,\n\t\t\tisSelected,\n\t\t\tisValid,\n\t\t\torder,\n\t\t\ttitle,\n\t\t\tisDimmed,\n\t\t\tisTouchable,\n\t\t\tonDeleteBlock,\n\t\t\tisStackedHorizontally,\n\t\t\tisParentSelected,\n\t\t\tgetStylesFromColorScheme,\n\t\t\tmarginVertical,\n\t\t\tmarginHorizontal,\n\t\t\tisInnerBlockSelected,\n\t\t\tname,\n\t\t\tdraggingEnabled,\n\t\t\tdraggingClientId,\n\t\t} = this.props;\n\n\t\tif ( ! attributes || ! blockType ) {\n\t\t\treturn null;\n\t\t}\n\t\tconst { blockWidth } = this.state;\n\t\tconst { align } = attributes;\n\t\tconst accessibilityLabel = getAccessibleBlockLabel(\n\t\t\tblockType,\n\t\t\tattributes,\n\t\t\torder + 1\n\t\t);\n\t\tconst { isFullWidth, isContainerRelated } = alignmentHelpers;\n\t\tconst accessible = ! ( isSelected || isInnerBlockSelected );\n\t\tconst screenWidth = Math.floor( Dimensions.get( 'window' ).width );\n\t\tconst isScreenWidthEqual = blockWidth === screenWidth;\n\t\tconst isScreenWidthWider = blockWidth < screenWidth;\n\t\tconst isFullWidthToolbar = isFullWidth( align ) || isScreenWidthEqual;\n\n\t\treturn (\n\t\t\t<TouchableWithoutFeedback\n\t\t\t\tonPress={ this.onFocus }\n\t\t\t\taccessible={ accessible }\n\t\t\t\taccessibilityRole={ 'button' }\n\t\t\t>\n\t\t\t\t<View\n\t\t\t\t\tstyle={ { flex: 1 } }\n\t\t\t\t\taccessibilityLabel={ accessibilityLabel }\n\t\t\t\t>\n\t\t\t\t\t<View\n\t\t\t\t\t\tpointerEvents={ isTouchable ? 'auto' : 'box-only' }\n\t\t\t\t\t\taccessibilityLabel={ accessibilityLabel }\n\t\t\t\t\t\tstyle={ [\n\t\t\t\t\t\t\t{ marginVertical, marginHorizontal, flex: 1 },\n\t\t\t\t\t\t\tisDimmed && styles.dimmed,\n\t\t\t\t\t\t] }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ isSelected && (\n\t\t\t\t\t\t\t<View\n\t\t\t\t\t\t\t\tpointerEvents=\"box-none\"\n\t\t\t\t\t\t\t\tstyle={ [\n\t\t\t\t\t\t\t\t\tstyles.solidBorder,\n\t\t\t\t\t\t\t\t\tisFullWidth( align ) &&\n\t\t\t\t\t\t\t\t\t\tisScreenWidthWider &&\n\t\t\t\t\t\t\t\t\t\tstyles.borderFullWidth,\n\t\t\t\t\t\t\t\t\tisFullWidth( align ) &&\n\t\t\t\t\t\t\t\t\t\tisContainerRelated( name ) &&\n\t\t\t\t\t\t\t\t\t\tisScreenWidthWider &&\n\t\t\t\t\t\t\t\t\t\tstyles.containerBorderFullWidth,\n\t\t\t\t\t\t\t\t\tgetStylesFromColorScheme(\n\t\t\t\t\t\t\t\t\t\tstyles.solidBorderColor,\n\t\t\t\t\t\t\t\t\t\tstyles.solidBorderColorDark\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ isParentSelected && (\n\t\t\t\t\t\t\t<View\n\t\t\t\t\t\t\t\tstyle={ [\n\t\t\t\t\t\t\t\t\tstyles.dashedBorder,\n\t\t\t\t\t\t\t\t\tgetStylesFromColorScheme(\n\t\t\t\t\t\t\t\t\t\tstyles.dashedBorderColor,\n\t\t\t\t\t\t\t\t\t\tstyles.dashedBorderColorDark\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<BlockDraggable\n\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t\tdraggingClientId={ draggingClientId }\n\t\t\t\t\t\t\tenabled={ draggingEnabled }\n\t\t\t\t\t\t\ttestID=\"draggable-trigger-content\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ () =>\n\t\t\t\t\t\t\t\tisValid ? (\n\t\t\t\t\t\t\t\t\tthis.getBlockForType()\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<BlockInvalidWarning\n\t\t\t\t\t\t\t\t\t\tblockTitle={ title }\n\t\t\t\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</BlockDraggable>\n\t\t\t\t\t\t<View\n\t\t\t\t\t\t\tstyle={ styles.neutralToolbar }\n\t\t\t\t\t\t\tref={ this.anchorNodeRef }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ isSelected && (\n\t\t\t\t\t\t\t\t<BlockMobileToolbar\n\t\t\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t\t\t\tonDelete={ onDeleteBlock }\n\t\t\t\t\t\t\t\t\tisStackedHorizontally={\n\t\t\t\t\t\t\t\t\t\tisStackedHorizontally\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tblockWidth={ blockWidth }\n\t\t\t\t\t\t\t\t\tanchorNodeRef={ this.anchorNodeRef.current }\n\t\t\t\t\t\t\t\t\tisFullWidth={ isFullWidthToolbar }\n\t\t\t\t\t\t\t\t\tdraggingClientId={ draggingClientId }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</View>\n\t\t\t\t\t</View>\n\t\t\t\t</View>\n\t\t\t</TouchableWithoutFeedback>\n\t\t);\n\t}\n}\n\n// Helper function to memoize the wrapperProps since getEditWrapperProps always returns a new reference.\nconst wrapperPropsCache = new WeakMap();\nconst emptyObj = {};\nfunction getWrapperProps( value, getWrapperPropsFunction ) {\n\tif ( ! getWrapperPropsFunction ) {\n\t\treturn emptyObj;\n\t}\n\tconst cachedValue = wrapperPropsCache.get( value );\n\tif ( ! cachedValue ) {\n\t\tconst wrapperProps = getWrapperPropsFunction( value );\n\t\twrapperPropsCache.set( value, wrapperProps );\n\t\treturn wrapperProps;\n\t}\n\treturn cachedValue;\n}\n\nexport default compose( [\n\twithSelect( ( select, { clientId } ) => {\n\t\tconst {\n\t\t\tgetBlockIndex,\n\t\t\tgetBlockCount,\n\t\t\tgetSettings,\n\t\t\tisBlockSelected,\n\t\t\tgetBlock,\n\t\t\tgetSelectedBlockClientId,\n\t\t\tgetLowestCommonAncestorWithSelectedBlock,\n\t\t\tgetBlockParents,\n\t\t\thasSelectedInnerBlock,\n\t\t\tgetBlockHierarchyRootClientId,\n\t\t} = select( blockEditorStore );\n\n\t\tconst order = getBlockIndex( clientId );\n\t\tconst isSelected = isBlockSelected( clientId );\n\t\tconst isInnerBlockSelected = hasSelectedInnerBlock( clientId );\n\t\tconst block = getBlock( clientId );\n\t\tconst { name, attributes, isValid } = block || {};\n\n\t\tconst blockType = getBlockType( name || 'core/missing' );\n\t\tconst title = blockType?.title;\n\t\tconst icon = blockType?.icon;\n\n\t\tconst parents = getBlockParents( clientId, true );\n\t\tconst parentId = parents[ 0 ] || '';\n\n\t\tconst selectedBlockClientId = getSelectedBlockClientId();\n\n\t\tconst commonAncestor =\n\t\t\tgetLowestCommonAncestorWithSelectedBlock( clientId );\n\t\tconst commonAncestorIndex = parents.indexOf( commonAncestor ) - 1;\n\t\tconst firstToSelectId = commonAncestor\n\t\t\t? parents[ commonAncestorIndex ]\n\t\t\t: parents[ parents.length - 1 ];\n\n\t\tconst isParentSelected =\n\t\t\t// Set false as a default value to prevent re-render when it's changed from null to false.\n\t\t\t( selectedBlockClientId || false ) &&\n\t\t\tselectedBlockClientId === parentId;\n\n\t\tconst selectedParents = selectedBlockClientId\n\t\t\t? getBlockParents( selectedBlockClientId )\n\t\t\t: [];\n\t\tconst isDescendantOfParentSelected =\n\t\t\tselectedParents.includes( parentId );\n\t\tconst isTouchable =\n\t\t\tisSelected ||\n\t\t\tisDescendantOfParentSelected ||\n\t\t\tisParentSelected ||\n\t\t\tparentId === '';\n\t\tconst baseGlobalStyles =\n\t\t\tgetSettings()?.__experimentalGlobalStylesBaseStyles;\n\n\t\tconst hasInnerBlocks = getBlockCount( clientId ) > 0;\n\t\t// For blocks with inner blocks, we only enable the dragging in the nested\n\t\t// blocks if any of them are selected. This way we prevent the long-press\n\t\t// gesture from being disabled for elements within the block UI.\n\t\tconst draggingEnabled =\n\t\t\t! hasInnerBlocks ||\n\t\t\tisSelected ||\n\t\t\t! hasSelectedInnerBlock( clientId, true );\n\t\t// Dragging nested blocks is not supported yet. For this reason, the block to be dragged\n\t\t// will be the top in the hierarchy.\n\t\tconst draggingClientId = getBlockHierarchyRootClientId( clientId );\n\n\t\treturn {\n\t\t\ticon,\n\t\t\tname: name || 'core/missing',\n\t\t\torder,\n\t\t\ttitle,\n\t\t\tattributes,\n\t\t\tblockType,\n\t\t\tdraggingClientId,\n\t\t\tdraggingEnabled,\n\t\t\tisSelected,\n\t\t\tisInnerBlockSelected,\n\t\t\tisValid,\n\t\t\tisParentSelected,\n\t\t\tfirstToSelectId,\n\t\t\tisTouchable,\n\t\t\tbaseGlobalStyles,\n\t\t\twrapperProps: getWrapperProps(\n\t\t\t\tattributes,\n\t\t\t\tblockType.getEditWrapperProps\n\t\t\t),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch, ownProps, registry ) => {\n\t\tconst {\n\t\t\tinsertBlocks,\n\t\t\tmergeBlocks,\n\t\t\treplaceBlocks,\n\t\t\tselectBlock,\n\t\t\tupdateBlockAttributes,\n\t\t\tmoveBlocksToPosition,\n\t\t\tremoveBlock,\n\t\t} = dispatch( blockEditorStore );\n\n\t\treturn {\n\t\t\tonMerge( forward ) {\n\t\t\t\tconst { clientId, rootClientId } = ownProps;\n\t\t\t\tconst {\n\t\t\t\t\tgetPreviousBlockClientId,\n\t\t\t\t\tgetNextBlockClientId,\n\t\t\t\t\tgetBlock,\n\t\t\t\t\tgetBlockAttributes,\n\t\t\t\t\tgetBlockName,\n\t\t\t\t\tgetBlockOrder,\n\t\t\t\t\tgetBlockIndex,\n\t\t\t\t\tgetBlockRootClientId,\n\t\t\t\t\tcanInsertBlockType,\n\t\t\t\t} = registry.select( blockEditorStore );\n\n\t\t\t\t/**\n\t\t\t\t * Moves the block with clientId up one level. If the block type\n\t\t\t\t * cannot be inserted at the new location, it will be attempted to\n\t\t\t\t * convert to the default block type.\n\t\t\t\t *\n\t\t\t\t * @param {string} _clientId The block to move.\n\t\t\t\t * @param {boolean} changeSelection Whether to change the selection\n\t\t\t\t * to the moved block.\n\t\t\t\t */\n\t\t\t\tfunction moveFirstItemUp( _clientId, changeSelection = true ) {\n\t\t\t\t\tconst targetRootClientId =\n\t\t\t\t\t\tgetBlockRootClientId( _clientId );\n\t\t\t\t\tconst blockOrder = getBlockOrder( _clientId );\n\t\t\t\t\tconst [ firstClientId ] = blockOrder;\n\n\t\t\t\t\tif (\n\t\t\t\t\t\tblockOrder.length === 1 &&\n\t\t\t\t\t\tisUnmodifiedBlock( getBlock( firstClientId ) )\n\t\t\t\t\t) {\n\t\t\t\t\t\tremoveBlock( _clientId );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tcanInsertBlockType(\n\t\t\t\t\t\t\t\tgetBlockName( firstClientId ),\n\t\t\t\t\t\t\t\ttargetRootClientId\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\t\t\t[ firstClientId ],\n\t\t\t\t\t\t\t\t_clientId,\n\t\t\t\t\t\t\t\ttargetRootClientId,\n\t\t\t\t\t\t\t\tgetBlockIndex( _clientId )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst replacement = switchToBlockType(\n\t\t\t\t\t\t\t\tgetBlock( firstClientId ),\n\t\t\t\t\t\t\t\tgetDefaultBlockName()\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tif ( replacement && replacement.length ) {\n\t\t\t\t\t\t\t\tregistry.batch( () => {\n\t\t\t\t\t\t\t\t\tinsertBlocks(\n\t\t\t\t\t\t\t\t\t\treplacement,\n\t\t\t\t\t\t\t\t\t\tgetBlockIndex( _clientId ),\n\t\t\t\t\t\t\t\t\t\ttargetRootClientId,\n\t\t\t\t\t\t\t\t\t\tchangeSelection\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tremoveBlock( firstClientId, false );\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t! getBlockOrder( _clientId ).length &&\n\t\t\t\t\t\t\tisUnmodifiedBlock( getBlock( _clientId ) )\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tremoveBlock( _clientId, false );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// For `Delete` or forward merge, we should do the exact same thing\n\t\t\t\t// as `Backspace`, but from the other block.\n\t\t\t\tif ( forward ) {\n\t\t\t\t\tif ( rootClientId ) {\n\t\t\t\t\t\tconst nextRootClientId =\n\t\t\t\t\t\t\tgetNextBlockClientId( rootClientId );\n\n\t\t\t\t\t\tif ( nextRootClientId ) {\n\t\t\t\t\t\t\t// If there is a block that follows with the same parent\n\t\t\t\t\t\t\t// block name and the same attributes, merge the inner\n\t\t\t\t\t\t\t// blocks.\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tgetBlockName( rootClientId ) ===\n\t\t\t\t\t\t\t\tgetBlockName( nextRootClientId )\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tconst rootAttributes =\n\t\t\t\t\t\t\t\t\tgetBlockAttributes( rootClientId );\n\t\t\t\t\t\t\t\tconst previousRootAttributes =\n\t\t\t\t\t\t\t\t\tgetBlockAttributes( nextRootClientId );\n\n\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\tObject.keys( rootAttributes ).every(\n\t\t\t\t\t\t\t\t\t\t( key ) =>\n\t\t\t\t\t\t\t\t\t\t\trootAttributes[ key ] ===\n\t\t\t\t\t\t\t\t\t\t\tpreviousRootAttributes[ key ]\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\tregistry.batch( () => {\n\t\t\t\t\t\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\t\t\t\t\t\tgetBlockOrder( nextRootClientId ),\n\t\t\t\t\t\t\t\t\t\t\tnextRootClientId,\n\t\t\t\t\t\t\t\t\t\t\trootClientId\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\tremoveBlock( nextRootClientId, false );\n\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tmergeBlocks( rootClientId, nextRootClientId );\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tconst nextBlockClientId = getNextBlockClientId( clientId );\n\n\t\t\t\t\tif ( ! nextBlockClientId ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( getBlockOrder( nextBlockClientId ).length ) {\n\t\t\t\t\t\tmoveFirstItemUp( nextBlockClientId, false );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmergeBlocks( clientId, nextBlockClientId );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconst previousBlockClientId =\n\t\t\t\t\t\tgetPreviousBlockClientId( clientId );\n\n\t\t\t\t\tif ( previousBlockClientId ) {\n\t\t\t\t\t\tmergeBlocks( previousBlockClientId, clientId );\n\t\t\t\t\t} else if ( rootClientId ) {\n\t\t\t\t\t\tconst previousRootClientId =\n\t\t\t\t\t\t\tgetPreviousBlockClientId( rootClientId );\n\n\t\t\t\t\t\t// If there is a preceding block with the same parent block\n\t\t\t\t\t\t// name and the same attributes, merge the inner blocks.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tpreviousRootClientId &&\n\t\t\t\t\t\t\tgetBlockName( rootClientId ) ===\n\t\t\t\t\t\t\t\tgetBlockName( previousRootClientId )\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tconst rootAttributes =\n\t\t\t\t\t\t\t\tgetBlockAttributes( rootClientId );\n\t\t\t\t\t\t\tconst previousRootAttributes =\n\t\t\t\t\t\t\t\tgetBlockAttributes( previousRootClientId );\n\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tObject.keys( rootAttributes ).every(\n\t\t\t\t\t\t\t\t\t( key ) =>\n\t\t\t\t\t\t\t\t\t\trootAttributes[ key ] ===\n\t\t\t\t\t\t\t\t\t\tpreviousRootAttributes[ key ]\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tregistry.batch( () => {\n\t\t\t\t\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\t\t\t\t\tgetBlockOrder( rootClientId ),\n\t\t\t\t\t\t\t\t\t\trootClientId,\n\t\t\t\t\t\t\t\t\t\tpreviousRootClientId\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tremoveBlock( rootClientId, false );\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmoveFirstItemUp( rootClientId );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tonInsertBlocks( blocks, index ) {\n\t\t\t\tinsertBlocks( blocks, index, ownProps.rootClientId );\n\t\t\t},\n\t\t\tonSelect( clientId = ownProps.clientId, initialPosition ) {\n\t\t\t\tselectBlock( clientId, initialPosition );\n\t\t\t},\n\t\t\tonChange: ( attributes ) => {\n\t\t\t\tupdateBlockAttributes( ownProps.clientId, attributes );\n\t\t\t},\n\t\t\tonReplace( blocks, indexToSelect ) {\n\t\t\t\treplaceBlocks( [ ownProps.clientId ], blocks, indexToSelect );\n\t\t\t},\n\t\t};\n\t} ),\n\twithPreferredColorScheme,\n] )( BlockListBlock );\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-editor/src/components/block-list/block.native.js"],"names":["emptyArray","BlockForType","attributes","clientId","contentStyle","getBlockWidth","insertBlocksAfter","isSelected","onMerge","name","onBlockFocus","onChange","onDeleteBlock","onReplace","parentWidth","parentBlockAlignment","wrapperProps","blockWidth","baseGlobalStyles","defaultColors","fontSizes","globalStyle","mergedStyle","style","JSON","stringify","Object","fromEntries","entries","filter","key","GlobalStylesContext","BLOCK_STYLE_ATTRIBUTES","includes","parentLayout","BlockListBlock","Component","constructor","arguments","bind","onFocus","state","props","marginHorizontal","anchorNodeRef","firstToSelectId","onSelect","blocks","onInsertBlocks","order","nativeEvent","layout","layoutWidth","Math","floor","width","setState","getBlockForType","renderBlockTitle","styles","blockTitle","render","blockType","icon","isValid","title","isDimmed","isTouchable","isStackedHorizontally","isParentSelected","getStylesFromColorScheme","marginVertical","isInnerBlockSelected","draggingEnabled","draggingClientId","align","accessibilityLabel","isFullWidth","isContainerRelated","alignmentHelpers","isFocused","screenWidth","Dimensions","get","isScreenWidthEqual","isScreenWidthWider","isFullWidthToolbar","flex","dimmed","solidBorder","borderFullWidth","containerBorderFullWidth","solidBorderColor","solidBorderColorDark","dashedBorder","dashedBorderColor","dashedBorderColorDark","neutralToolbar","current","wrapperPropsCache","WeakMap","emptyObj","getWrapperProps","value","getWrapperPropsFunction","cachedValue","set","select","getBlockIndex","getBlockCount","getSettings","isBlockSelected","getBlock","getSelectedBlockClientId","getLowestCommonAncestorWithSelectedBlock","getBlockParents","hasSelectedInnerBlock","getBlockHierarchyRootClientId","blockEditorStore","block","parents","parentId","selectedBlockClientId","commonAncestor","commonAncestorIndex","indexOf","length","selectedParents","isDescendantOfParentSelected","__experimentalGlobalStylesBaseStyles","hasInnerBlocks","getEditWrapperProps","dispatch","ownProps","registry","insertBlocks","mergeBlocks","replaceBlocks","selectBlock","updateBlockAttributes","moveBlocksToPosition","removeBlock","forward","rootClientId","getPreviousBlockClientId","getNextBlockClientId","getBlockAttributes","getBlockName","getBlockOrder","getBlockRootClientId","canInsertBlockType","moveFirstItemUp","_clientId","changeSelection","targetRootClientId","blockOrder","firstClientId","replacement","batch","nextRootClientId","rootAttributes","previousRootAttributes","keys","every","nextBlockClientId","previousBlockClientId","previousRootClientId","index","initialPosition","indexToSelect","withPreferredColorScheme"],"mappings":";;;;;;;;;AAQA;;;;AALA;;AAMA;;AAOA;;AACA;;AACA;;AAOA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AApCA;AACA;AACA;;AAGA;AACA;AACA;;AAoBA;AACA;AACA;AASA,MAAMA,UAAU,GAAG,EAAnB;;AACA,SAASC,YAAT,OAkBI;AAAA,MAlBmB;AACtBC,IAAAA,UADsB;AAEtBC,IAAAA,QAFsB;AAGtBC,IAAAA,YAHsB;AAItBC,IAAAA,aAJsB;AAKtBC,IAAAA,iBALsB;AAMtBC,IAAAA,UANsB;AAOtBC,IAAAA,OAPsB;AAQtBC,IAAAA,IARsB;AAStBC,IAAAA,YATsB;AAUtBC,IAAAA,QAVsB;AAWtBC,IAAAA,aAXsB;AAYtBC,IAAAA,SAZsB;AAatBC,IAAAA,WAbsB;AActBC,IAAAA,oBAdsB;AAetBC,IAAAA,YAfsB;AAgBtBC,IAAAA,UAhBsB;AAiBtBC,IAAAA;AAjBsB,GAkBnB;AACH,QAAMC,aAAa,GAAG,8CAAtB;AACA,QAAMC,SAAS,GAAG,6BAAY,sBAAZ,KAAwCpB,UAA1D;AACA,QAAMqB,WAAW,GAAG,kCAApB;AACA,QAAMC,WAAW,GAAG,sBAAS,MAAM;AAClC,WAAO,uCAC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UAArB,CAArB;AACA,KAxLK;;AAyLNW,IAAAA,SAAS,CAAEkC,MAAF,EAAU0H,aAAV,EAA0B;AAClChC,MAAAA,aAAa,CAAE,CAAEJ,QAAQ,CAAClI,QAAX,CAAF,EAAyB4C,MAAzB,EAAiC0H,aAAjC,CAAb;AACA;;AA3LK,GAAP;AA6LA,CAxMD,CAzFuB,EAkSvBC,iCAlSuB,CAAT,EAmSVvI,cAnSU,C","sourcesContent":["/**\n * External dependencies\n */\nimport { View, Text, TouchableWithoutFeedback, Dimensions } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { Component, createRef, useMemo } from '@wordpress/element';\nimport {\n\tGlobalStylesContext,\n\tgetMergedGlobalStyles,\n\tuseMobileGlobalStylesColors,\n\talignmentHelpers,\n\tuseGlobalStyles,\n} from '@wordpress/components';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { compose, withPreferredColorScheme } from '@wordpress/compose';\nimport {\n\tgetBlockType,\n\t__experimentalGetAccessibleBlockLabel as getAccessibleBlockLabel,\n\tswitchToBlockType,\n\tgetDefaultBlockName,\n\tisUnmodifiedBlock,\n} from '@wordpress/blocks';\nimport { useSetting } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport styles from './block.scss';\nimport BlockEdit from '../block-edit';\nimport BlockInvalidWarning from './block-invalid-warning';\nimport BlockMobileToolbar from '../block-mobile-toolbar';\nimport { store as blockEditorStore } from '../../store';\nimport BlockDraggable from '../block-draggable';\nimport { useLayout } from './layout';\n\nconst emptyArray = [];\nfunction BlockForType( {\n\tattributes,\n\tclientId,\n\tcontentStyle,\n\tgetBlockWidth,\n\tinsertBlocksAfter,\n\tisSelected,\n\tonMerge,\n\tname,\n\tonBlockFocus,\n\tonChange,\n\tonDeleteBlock,\n\tonReplace,\n\tparentWidth,\n\tparentBlockAlignment,\n\twrapperProps,\n\tblockWidth,\n\tbaseGlobalStyles,\n} ) {\n\tconst defaultColors = useMobileGlobalStylesColors();\n\tconst fontSizes = useSetting( 'typography.fontSizes' ) || emptyArray;\n\tconst globalStyle = useGlobalStyles();\n\tconst mergedStyle = useMemo( () => {\n\t\treturn getMergedGlobalStyles(\n\t\t\tbaseGlobalStyles,\n\t\t\tglobalStyle,\n\t\t\twrapperProps.style,\n\t\t\tattributes,\n\t\t\tdefaultColors,\n\t\t\tname,\n\t\t\tfontSizes\n\t\t);\n\t}, [\n\t\tdefaultColors,\n\t\tglobalStyle,\n\t\t// I couldn't simply use attributes and wrapperProps.styles as a dependency because they are almost always a new reference.\n\t\t// Thanks to the JSON.stringify we check if the value is the same instead of reference.\n\t\tJSON.stringify( wrapperProps.style ),\n\t\tJSON.stringify(\n\t\t\tObject.fromEntries(\n\t\t\t\tObject.entries( attributes ?? {} ).filter( ( [ key ] ) =>\n\t\t\t\t\tGlobalStylesContext.BLOCK_STYLE_ATTRIBUTES.includes( key )\n\t\t\t\t)\n\t\t\t)\n\t\t),\n\t] );\n\n\tconst parentLayout = useLayout();\n\n\treturn (\n\t\t<GlobalStylesContext.Provider value={ mergedStyle }>\n\t\t\t<BlockEdit\n\t\t\t\tname={ name }\n\t\t\t\tisSelected={ isSelected }\n\t\t\t\tattributes={ attributes }\n\t\t\t\tsetAttributes={ onChange }\n\t\t\t\tonFocus={ onBlockFocus }\n\t\t\t\tonReplace={ onReplace }\n\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\tmergeBlocks={ onMerge }\n\t\t\t\t// Block level styles.\n\t\t\t\twrapperProps={ wrapperProps }\n\t\t\t\t// Inherited styles merged with block level styles.\n\t\t\t\tstyle={ mergedStyle }\n\t\t\t\tclientId={ clientId }\n\t\t\t\tparentWidth={ parentWidth }\n\t\t\t\tcontentStyle={ contentStyle }\n\t\t\t\tonDeleteBlock={ onDeleteBlock }\n\t\t\t\tblockWidth={ blockWidth }\n\t\t\t\tparentBlockAlignment={ parentBlockAlignment }\n\t\t\t\t__unstableParentLayout={ parentLayout }\n\t\t\t/>\n\t\t\t<View onLayout={ getBlockWidth } />\n\t\t</GlobalStylesContext.Provider>\n\t);\n}\n\nclass BlockListBlock extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.insertBlocksAfter = this.insertBlocksAfter.bind( this );\n\t\tthis.onFocus = this.onFocus.bind( this );\n\t\tthis.getBlockWidth = this.getBlockWidth.bind( this );\n\n\t\tthis.state = {\n\t\t\tblockWidth: this.props.blockWidth - 2 * this.props.marginHorizontal,\n\t\t};\n\n\t\tthis.anchorNodeRef = createRef();\n\t}\n\n\tonFocus() {\n\t\tconst { firstToSelectId, isSelected, onSelect } = this.props;\n\t\tif ( ! isSelected ) {\n\t\t\tonSelect( firstToSelectId );\n\t\t}\n\t}\n\n\tinsertBlocksAfter( blocks ) {\n\t\tthis.props.onInsertBlocks( blocks, this.props.order + 1 );\n\n\t\tif ( blocks[ 0 ] ) {\n\t\t\t// Focus on the first block inserted.\n\t\t\tthis.props.onSelect( blocks[ 0 ].clientId );\n\t\t}\n\t}\n\n\tgetBlockWidth( { nativeEvent } ) {\n\t\tconst { layout } = nativeEvent;\n\t\tconst { blockWidth } = this.state;\n\t\tconst layoutWidth = Math.floor( layout.width );\n\n\t\tif ( ! blockWidth || ! layoutWidth ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( blockWidth !== layoutWidth ) {\n\t\t\tthis.setState( { blockWidth: layoutWidth } );\n\t\t}\n\t}\n\n\tgetBlockForType() {\n\t\tconst { blockWidth } = this.state;\n\t\treturn (\n\t\t\t<BlockForType\n\t\t\t\t{ ...this.props }\n\t\t\t\tonBlockFocus={ this.onFocus }\n\t\t\t\tinsertBlocksAfter={ this.insertBlocksAfter }\n\t\t\t\tgetBlockWidth={ this.getBlockWidth }\n\t\t\t\tblockWidth={ blockWidth }\n\t\t\t/>\n\t\t);\n\t}\n\n\trenderBlockTitle() {\n\t\treturn (\n\t\t\t<View style={ styles.blockTitle }>\n\t\t\t\t<Text>BlockType: { this.props.name }</Text>\n\t\t\t</View>\n\t\t);\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tattributes,\n\t\t\tblockType,\n\t\t\tclientId,\n\t\t\ticon,\n\t\t\tisSelected,\n\t\t\tisValid,\n\t\t\torder,\n\t\t\ttitle,\n\t\t\tisDimmed,\n\t\t\tisTouchable,\n\t\t\tonDeleteBlock,\n\t\t\tisStackedHorizontally,\n\t\t\tisParentSelected,\n\t\t\tgetStylesFromColorScheme,\n\t\t\tmarginVertical,\n\t\t\tmarginHorizontal,\n\t\t\tisInnerBlockSelected,\n\t\t\tname,\n\t\t\tdraggingEnabled,\n\t\t\tdraggingClientId,\n\t\t} = this.props;\n\n\t\tif ( ! attributes || ! blockType ) {\n\t\t\treturn null;\n\t\t}\n\t\tconst { blockWidth } = this.state;\n\t\tconst { align } = attributes;\n\t\tconst accessibilityLabel = getAccessibleBlockLabel(\n\t\t\tblockType,\n\t\t\tattributes,\n\t\t\torder + 1\n\t\t);\n\t\tconst { isFullWidth, isContainerRelated } = alignmentHelpers;\n\t\tconst isFocused = isSelected || isInnerBlockSelected;\n\t\tconst screenWidth = Math.floor( Dimensions.get( 'window' ).width );\n\t\tconst isScreenWidthEqual = blockWidth === screenWidth;\n\t\tconst isScreenWidthWider = blockWidth < screenWidth;\n\t\tconst isFullWidthToolbar = isFullWidth( align ) || isScreenWidthEqual;\n\n\t\treturn (\n\t\t\t<TouchableWithoutFeedback\n\t\t\t\tonPress={ this.onFocus }\n\t\t\t\taccessible={ ! isFocused }\n\t\t\t\taccessibilityRole={ 'button' }\n\t\t\t\tdisabled={ isFocused }\n\t\t\t>\n\t\t\t\t<View\n\t\t\t\t\tstyle={ { flex: 1 } }\n\t\t\t\t\taccessibilityLabel={ accessibilityLabel }\n\t\t\t\t>\n\t\t\t\t\t<View\n\t\t\t\t\t\tpointerEvents={ isTouchable ? 'auto' : 'box-only' }\n\t\t\t\t\t\taccessibilityLabel={ accessibilityLabel }\n\t\t\t\t\t\tstyle={ [\n\t\t\t\t\t\t\t{ marginVertical, marginHorizontal, flex: 1 },\n\t\t\t\t\t\t\tisDimmed && styles.dimmed,\n\t\t\t\t\t\t] }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ isSelected && (\n\t\t\t\t\t\t\t<View\n\t\t\t\t\t\t\t\tpointerEvents=\"box-none\"\n\t\t\t\t\t\t\t\tstyle={ [\n\t\t\t\t\t\t\t\t\tstyles.solidBorder,\n\t\t\t\t\t\t\t\t\tisFullWidth( align ) &&\n\t\t\t\t\t\t\t\t\t\tisScreenWidthWider &&\n\t\t\t\t\t\t\t\t\t\tstyles.borderFullWidth,\n\t\t\t\t\t\t\t\t\tisFullWidth( align ) &&\n\t\t\t\t\t\t\t\t\t\tisContainerRelated( name ) &&\n\t\t\t\t\t\t\t\t\t\tisScreenWidthWider &&\n\t\t\t\t\t\t\t\t\t\tstyles.containerBorderFullWidth,\n\t\t\t\t\t\t\t\t\tgetStylesFromColorScheme(\n\t\t\t\t\t\t\t\t\t\tstyles.solidBorderColor,\n\t\t\t\t\t\t\t\t\t\tstyles.solidBorderColorDark\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ isParentSelected && (\n\t\t\t\t\t\t\t<View\n\t\t\t\t\t\t\t\tstyle={ [\n\t\t\t\t\t\t\t\t\tstyles.dashedBorder,\n\t\t\t\t\t\t\t\t\tgetStylesFromColorScheme(\n\t\t\t\t\t\t\t\t\t\tstyles.dashedBorderColor,\n\t\t\t\t\t\t\t\t\t\tstyles.dashedBorderColorDark\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<BlockDraggable\n\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t\tdraggingClientId={ draggingClientId }\n\t\t\t\t\t\t\tenabled={ draggingEnabled }\n\t\t\t\t\t\t\ttestID=\"draggable-trigger-content\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ () =>\n\t\t\t\t\t\t\t\tisValid ? (\n\t\t\t\t\t\t\t\t\tthis.getBlockForType()\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<BlockInvalidWarning\n\t\t\t\t\t\t\t\t\t\tblockTitle={ title }\n\t\t\t\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</BlockDraggable>\n\t\t\t\t\t\t<View\n\t\t\t\t\t\t\tstyle={ styles.neutralToolbar }\n\t\t\t\t\t\t\tref={ this.anchorNodeRef }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ isSelected && (\n\t\t\t\t\t\t\t\t<BlockMobileToolbar\n\t\t\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t\t\t\tonDelete={ onDeleteBlock }\n\t\t\t\t\t\t\t\t\tisStackedHorizontally={\n\t\t\t\t\t\t\t\t\t\tisStackedHorizontally\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tblockWidth={ blockWidth }\n\t\t\t\t\t\t\t\t\tanchorNodeRef={ this.anchorNodeRef.current }\n\t\t\t\t\t\t\t\t\tisFullWidth={ isFullWidthToolbar }\n\t\t\t\t\t\t\t\t\tdraggingClientId={ draggingClientId }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</View>\n\t\t\t\t\t</View>\n\t\t\t\t</View>\n\t\t\t</TouchableWithoutFeedback>\n\t\t);\n\t}\n}\n\n// Helper function to memoize the wrapperProps since getEditWrapperProps always returns a new reference.\nconst wrapperPropsCache = new WeakMap();\nconst emptyObj = {};\nfunction getWrapperProps( value, getWrapperPropsFunction ) {\n\tif ( ! getWrapperPropsFunction ) {\n\t\treturn emptyObj;\n\t}\n\tconst cachedValue = wrapperPropsCache.get( value );\n\tif ( ! cachedValue ) {\n\t\tconst wrapperProps = getWrapperPropsFunction( value );\n\t\twrapperPropsCache.set( value, wrapperProps );\n\t\treturn wrapperProps;\n\t}\n\treturn cachedValue;\n}\n\nexport default compose( [\n\twithSelect( ( select, { clientId } ) => {\n\t\tconst {\n\t\t\tgetBlockIndex,\n\t\t\tgetBlockCount,\n\t\t\tgetSettings,\n\t\t\tisBlockSelected,\n\t\t\tgetBlock,\n\t\t\tgetSelectedBlockClientId,\n\t\t\tgetLowestCommonAncestorWithSelectedBlock,\n\t\t\tgetBlockParents,\n\t\t\thasSelectedInnerBlock,\n\t\t\tgetBlockHierarchyRootClientId,\n\t\t} = select( blockEditorStore );\n\n\t\tconst order = getBlockIndex( clientId );\n\t\tconst isSelected = isBlockSelected( clientId );\n\t\tconst isInnerBlockSelected = hasSelectedInnerBlock( clientId );\n\t\tconst block = getBlock( clientId );\n\t\tconst { name, attributes, isValid } = block || {};\n\n\t\tconst blockType = getBlockType( name || 'core/missing' );\n\t\tconst title = blockType?.title;\n\t\tconst icon = blockType?.icon;\n\n\t\tconst parents = getBlockParents( clientId, true );\n\t\tconst parentId = parents[ 0 ] || '';\n\n\t\tconst selectedBlockClientId = getSelectedBlockClientId();\n\n\t\tconst commonAncestor =\n\t\t\tgetLowestCommonAncestorWithSelectedBlock( clientId );\n\t\tconst commonAncestorIndex = parents.indexOf( commonAncestor ) - 1;\n\t\tconst firstToSelectId = commonAncestor\n\t\t\t? parents[ commonAncestorIndex ]\n\t\t\t: parents[ parents.length - 1 ];\n\n\t\tconst isParentSelected =\n\t\t\t// Set false as a default value to prevent re-render when it's changed from null to false.\n\t\t\t( selectedBlockClientId || false ) &&\n\t\t\tselectedBlockClientId === parentId;\n\n\t\tconst selectedParents = selectedBlockClientId\n\t\t\t? getBlockParents( selectedBlockClientId )\n\t\t\t: [];\n\t\tconst isDescendantOfParentSelected =\n\t\t\tselectedParents.includes( parentId );\n\t\tconst isTouchable =\n\t\t\tisSelected ||\n\t\t\tisDescendantOfParentSelected ||\n\t\t\tisParentSelected ||\n\t\t\tparentId === '';\n\t\tconst baseGlobalStyles =\n\t\t\tgetSettings()?.__experimentalGlobalStylesBaseStyles;\n\n\t\tconst hasInnerBlocks = getBlockCount( clientId ) > 0;\n\t\t// For blocks with inner blocks, we only enable the dragging in the nested\n\t\t// blocks if any of them are selected. This way we prevent the long-press\n\t\t// gesture from being disabled for elements within the block UI.\n\t\tconst draggingEnabled =\n\t\t\t! hasInnerBlocks ||\n\t\t\tisSelected ||\n\t\t\t! hasSelectedInnerBlock( clientId, true );\n\t\t// Dragging nested blocks is not supported yet. For this reason, the block to be dragged\n\t\t// will be the top in the hierarchy.\n\t\tconst draggingClientId = getBlockHierarchyRootClientId( clientId );\n\n\t\treturn {\n\t\t\ticon,\n\t\t\tname: name || 'core/missing',\n\t\t\torder,\n\t\t\ttitle,\n\t\t\tattributes,\n\t\t\tblockType,\n\t\t\tdraggingClientId,\n\t\t\tdraggingEnabled,\n\t\t\tisSelected,\n\t\t\tisInnerBlockSelected,\n\t\t\tisValid,\n\t\t\tisParentSelected,\n\t\t\tfirstToSelectId,\n\t\t\tisTouchable,\n\t\t\tbaseGlobalStyles,\n\t\t\twrapperProps: getWrapperProps(\n\t\t\t\tattributes,\n\t\t\t\tblockType.getEditWrapperProps\n\t\t\t),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch, ownProps, registry ) => {\n\t\tconst {\n\t\t\tinsertBlocks,\n\t\t\tmergeBlocks,\n\t\t\treplaceBlocks,\n\t\t\tselectBlock,\n\t\t\tupdateBlockAttributes,\n\t\t\tmoveBlocksToPosition,\n\t\t\tremoveBlock,\n\t\t} = dispatch( blockEditorStore );\n\n\t\treturn {\n\t\t\tonMerge( forward ) {\n\t\t\t\tconst { clientId, rootClientId } = ownProps;\n\t\t\t\tconst {\n\t\t\t\t\tgetPreviousBlockClientId,\n\t\t\t\t\tgetNextBlockClientId,\n\t\t\t\t\tgetBlock,\n\t\t\t\t\tgetBlockAttributes,\n\t\t\t\t\tgetBlockName,\n\t\t\t\t\tgetBlockOrder,\n\t\t\t\t\tgetBlockIndex,\n\t\t\t\t\tgetBlockRootClientId,\n\t\t\t\t\tcanInsertBlockType,\n\t\t\t\t} = registry.select( blockEditorStore );\n\n\t\t\t\t/**\n\t\t\t\t * Moves the block with clientId up one level. If the block type\n\t\t\t\t * cannot be inserted at the new location, it will be attempted to\n\t\t\t\t * convert to the default block type.\n\t\t\t\t *\n\t\t\t\t * @param {string} _clientId The block to move.\n\t\t\t\t * @param {boolean} changeSelection Whether to change the selection\n\t\t\t\t * to the moved block.\n\t\t\t\t */\n\t\t\t\tfunction moveFirstItemUp( _clientId, changeSelection = true ) {\n\t\t\t\t\tconst targetRootClientId =\n\t\t\t\t\t\tgetBlockRootClientId( _clientId );\n\t\t\t\t\tconst blockOrder = getBlockOrder( _clientId );\n\t\t\t\t\tconst [ firstClientId ] = blockOrder;\n\n\t\t\t\t\tif (\n\t\t\t\t\t\tblockOrder.length === 1 &&\n\t\t\t\t\t\tisUnmodifiedBlock( getBlock( firstClientId ) )\n\t\t\t\t\t) {\n\t\t\t\t\t\tremoveBlock( _clientId );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tcanInsertBlockType(\n\t\t\t\t\t\t\t\tgetBlockName( firstClientId ),\n\t\t\t\t\t\t\t\ttargetRootClientId\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\t\t\t[ firstClientId ],\n\t\t\t\t\t\t\t\t_clientId,\n\t\t\t\t\t\t\t\ttargetRootClientId,\n\t\t\t\t\t\t\t\tgetBlockIndex( _clientId )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst replacement = switchToBlockType(\n\t\t\t\t\t\t\t\tgetBlock( firstClientId ),\n\t\t\t\t\t\t\t\tgetDefaultBlockName()\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tif ( replacement && replacement.length ) {\n\t\t\t\t\t\t\t\tregistry.batch( () => {\n\t\t\t\t\t\t\t\t\tinsertBlocks(\n\t\t\t\t\t\t\t\t\t\treplacement,\n\t\t\t\t\t\t\t\t\t\tgetBlockIndex( _clientId ),\n\t\t\t\t\t\t\t\t\t\ttargetRootClientId,\n\t\t\t\t\t\t\t\t\t\tchangeSelection\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tremoveBlock( firstClientId, false );\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t! getBlockOrder( _clientId ).length &&\n\t\t\t\t\t\t\tisUnmodifiedBlock( getBlock( _clientId ) )\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tremoveBlock( _clientId, false );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// For `Delete` or forward merge, we should do the exact same thing\n\t\t\t\t// as `Backspace`, but from the other block.\n\t\t\t\tif ( forward ) {\n\t\t\t\t\tif ( rootClientId ) {\n\t\t\t\t\t\tconst nextRootClientId =\n\t\t\t\t\t\t\tgetNextBlockClientId( rootClientId );\n\n\t\t\t\t\t\tif ( nextRootClientId ) {\n\t\t\t\t\t\t\t// If there is a block that follows with the same parent\n\t\t\t\t\t\t\t// block name and the same attributes, merge the inner\n\t\t\t\t\t\t\t// blocks.\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tgetBlockName( rootClientId ) ===\n\t\t\t\t\t\t\t\tgetBlockName( nextRootClientId )\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tconst rootAttributes =\n\t\t\t\t\t\t\t\t\tgetBlockAttributes( rootClientId );\n\t\t\t\t\t\t\t\tconst previousRootAttributes =\n\t\t\t\t\t\t\t\t\tgetBlockAttributes( nextRootClientId );\n\n\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\tObject.keys( rootAttributes ).every(\n\t\t\t\t\t\t\t\t\t\t( key ) =>\n\t\t\t\t\t\t\t\t\t\t\trootAttributes[ key ] ===\n\t\t\t\t\t\t\t\t\t\t\tpreviousRootAttributes[ key ]\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\tregistry.batch( () => {\n\t\t\t\t\t\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\t\t\t\t\t\tgetBlockOrder( nextRootClientId ),\n\t\t\t\t\t\t\t\t\t\t\tnextRootClientId,\n\t\t\t\t\t\t\t\t\t\t\trootClientId\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\tremoveBlock( nextRootClientId, false );\n\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tmergeBlocks( rootClientId, nextRootClientId );\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tconst nextBlockClientId = getNextBlockClientId( clientId );\n\n\t\t\t\t\tif ( ! nextBlockClientId ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( getBlockOrder( nextBlockClientId ).length ) {\n\t\t\t\t\t\tmoveFirstItemUp( nextBlockClientId, false );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmergeBlocks( clientId, nextBlockClientId );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconst previousBlockClientId =\n\t\t\t\t\t\tgetPreviousBlockClientId( clientId );\n\n\t\t\t\t\tif ( previousBlockClientId ) {\n\t\t\t\t\t\tmergeBlocks( previousBlockClientId, clientId );\n\t\t\t\t\t} else if ( rootClientId ) {\n\t\t\t\t\t\tconst previousRootClientId =\n\t\t\t\t\t\t\tgetPreviousBlockClientId( rootClientId );\n\n\t\t\t\t\t\t// If there is a preceding block with the same parent block\n\t\t\t\t\t\t// name and the same attributes, merge the inner blocks.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tpreviousRootClientId &&\n\t\t\t\t\t\t\tgetBlockName( rootClientId ) ===\n\t\t\t\t\t\t\t\tgetBlockName( previousRootClientId )\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tconst rootAttributes =\n\t\t\t\t\t\t\t\tgetBlockAttributes( rootClientId );\n\t\t\t\t\t\t\tconst previousRootAttributes =\n\t\t\t\t\t\t\t\tgetBlockAttributes( previousRootClientId );\n\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tObject.keys( rootAttributes ).every(\n\t\t\t\t\t\t\t\t\t( key ) =>\n\t\t\t\t\t\t\t\t\t\trootAttributes[ key ] ===\n\t\t\t\t\t\t\t\t\t\tpreviousRootAttributes[ key ]\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tregistry.batch( () => {\n\t\t\t\t\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\t\t\t\t\tgetBlockOrder( rootClientId ),\n\t\t\t\t\t\t\t\t\t\trootClientId,\n\t\t\t\t\t\t\t\t\t\tpreviousRootClientId\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tremoveBlock( rootClientId, false );\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmoveFirstItemUp( rootClientId );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tonInsertBlocks( blocks, index ) {\n\t\t\t\tinsertBlocks( blocks, index, ownProps.rootClientId );\n\t\t\t},\n\t\t\tonSelect( clientId = ownProps.clientId, initialPosition ) {\n\t\t\t\tselectBlock( clientId, initialPosition );\n\t\t\t},\n\t\t\tonChange: ( attributes ) => {\n\t\t\t\tupdateBlockAttributes( ownProps.clientId, attributes );\n\t\t\t},\n\t\t\tonReplace( blocks, indexToSelect ) {\n\t\t\t\treplaceBlocks( [ ownProps.clientId ], blocks, indexToSelect );\n\t\t\t},\n\t\t};\n\t} ),\n\twithPreferredColorScheme,\n] )( BlockListBlock );\n"]}
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.default = exports.
|
|
8
|
+
exports.default = exports.BlockList = void 0;
|
|
9
9
|
|
|
10
10
|
var _element = require("@wordpress/element");
|
|
11
11
|
|
|
@@ -48,9 +48,6 @@ var _store = require("../../store");
|
|
|
48
48
|
/**
|
|
49
49
|
* Internal dependencies
|
|
50
50
|
*/
|
|
51
|
-
const OnCaretVerticalPositionChange = (0, _element.createContext)();
|
|
52
|
-
exports.OnCaretVerticalPositionChange = OnCaretVerticalPositionChange;
|
|
53
|
-
|
|
54
51
|
const identity = x => x;
|
|
55
52
|
|
|
56
53
|
const stylesMemo = {};
|
|
@@ -83,7 +80,6 @@ class BlockList extends _element.Component {
|
|
|
83
80
|
};
|
|
84
81
|
this.renderItem = this.renderItem.bind(this);
|
|
85
82
|
this.renderBlockListFooter = this.renderBlockListFooter.bind(this);
|
|
86
|
-
this.onCaretVerticalPositionChange = this.onCaretVerticalPositionChange.bind(this);
|
|
87
83
|
this.scrollViewInnerRef = this.scrollViewInnerRef.bind(this);
|
|
88
84
|
this.addBlockToEndOfPost = this.addBlockToEndOfPost.bind(this);
|
|
89
85
|
this.shouldFlatListPreventAutomaticScroll = this.shouldFlatListPreventAutomaticScroll.bind(this);
|
|
@@ -101,10 +97,6 @@ class BlockList extends _element.Component {
|
|
|
101
97
|
this.props.insertBlock(newBlock, this.props.blockCount);
|
|
102
98
|
}
|
|
103
99
|
|
|
104
|
-
onCaretVerticalPositionChange(targetId, caretY, previousCaretY) {
|
|
105
|
-
_components.KeyboardAwareFlatList.handleCaretVerticalPositionChange(this.scrollViewRef, targetId, caretY, previousCaretY);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
100
|
scrollViewInnerRef(ref) {
|
|
109
101
|
this.scrollViewRef = ref;
|
|
110
102
|
}
|
|
@@ -228,9 +220,7 @@ class BlockList extends _element.Component {
|
|
|
228
220
|
parentScrollRef: scrollRef
|
|
229
221
|
});
|
|
230
222
|
});
|
|
231
|
-
return
|
|
232
|
-
value: this.onCaretVerticalPositionChange
|
|
233
|
-
}, blockList);
|
|
223
|
+
return blockList;
|
|
234
224
|
}
|
|
235
225
|
|
|
236
226
|
renderList() {
|
|
@@ -257,7 +247,6 @@ class BlockList extends _element.Component {
|
|
|
257
247
|
} = extraProps;
|
|
258
248
|
const {
|
|
259
249
|
blockToolbar,
|
|
260
|
-
blockBorder,
|
|
261
250
|
headerToolbar,
|
|
262
251
|
floatingToolbar
|
|
263
252
|
} = _style.default;
|
|
@@ -272,6 +261,10 @@ class BlockList extends _element.Component {
|
|
|
272
261
|
const {
|
|
273
262
|
isWider
|
|
274
263
|
} = _components.alignmentHelpers;
|
|
264
|
+
const extraScrollHeight = headerToolbar.height + blockToolbar.height + (isFloatingToolbarVisible ? floatingToolbar.height : 0);
|
|
265
|
+
const scrollViewStyle = [{
|
|
266
|
+
flex: isRootList ? 1 : 0
|
|
267
|
+
}, !isRootList && _style.default.overflowVisible];
|
|
275
268
|
return (0, _element.createElement)(_reactNative.View, {
|
|
276
269
|
style: containerStyle,
|
|
277
270
|
onAccessibilityEscape: clearSelectedBlock,
|
|
@@ -282,16 +275,12 @@ class BlockList extends _element.Component {
|
|
|
282
275
|
} : {}, {
|
|
283
276
|
// Disable clipping on Android to fix focus losing. See https://github.com/wordpress-mobile/gutenberg-mobile/pull/741#issuecomment-472746541
|
|
284
277
|
accessibilityLabel: "block-list",
|
|
285
|
-
autoScroll: this.props.autoScroll,
|
|
286
278
|
innerRef: ref => {
|
|
287
279
|
this.scrollViewInnerRef(parentScrollRef || ref);
|
|
288
280
|
},
|
|
289
|
-
extraScrollHeight:
|
|
290
|
-
inputAccessoryViewHeight: headerToolbar.height + (isFloatingToolbarVisible ? floatingToolbar.height : 0),
|
|
281
|
+
extraScrollHeight: extraScrollHeight,
|
|
291
282
|
keyboardShouldPersistTaps: "always",
|
|
292
|
-
scrollViewStyle:
|
|
293
|
-
flex: isRootList ? 1 : 0
|
|
294
|
-
}, !isRootList && _style.default.overflowVisible],
|
|
283
|
+
scrollViewStyle: scrollViewStyle,
|
|
295
284
|
extraData: this.getExtraData(),
|
|
296
285
|
scrollEnabled: isRootList,
|
|
297
286
|
contentContainerStyle: [horizontal && _style.default.horizontalContentContainer, isWider(blockWidth, 'medium') && (isContentStretch && isMultiBlocks ? _style.default.horizontalContentContainerStretch : _style.default.horizontalContentContainerCenter)],
|
|
@@ -399,6 +388,7 @@ var _default = (0, _compose.compose)([(0, _data.withSelect)((select, _ref6) => {
|
|
|
399
388
|
} = _ref6;
|
|
400
389
|
const {
|
|
401
390
|
getBlockCount,
|
|
391
|
+
getBlockHierarchyRootClientId,
|
|
402
392
|
getBlockOrder,
|
|
403
393
|
getSelectedBlockClientId,
|
|
404
394
|
isBlockInsertionPointVisible,
|
|
@@ -417,8 +407,8 @@ var _default = (0, _compose.compose)([(0, _data.withSelect)((select, _ref6) => {
|
|
|
417
407
|
} = getSettings();
|
|
418
408
|
const isReadOnly = getSettings().readOnly;
|
|
419
409
|
const blockCount = getBlockCount();
|
|
420
|
-
const
|
|
421
|
-
const isFloatingToolbarVisible = !!selectedBlockClientId &&
|
|
410
|
+
const rootBlockId = getBlockHierarchyRootClientId(selectedBlockClientId);
|
|
411
|
+
const isFloatingToolbarVisible = !!selectedBlockClientId && !!getBlockCount(rootBlockId);
|
|
422
412
|
const isRTL = getSettings().isRTL;
|
|
423
413
|
return {
|
|
424
414
|
blockClientIds,
|