@wordpress/block-editor 12.12.0 → 12.13.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 +12 -10
- package/README.md +35 -3
- package/build/components/block-alignment-control/use-available-alignments.js +30 -28
- package/build/components/block-alignment-control/use-available-alignments.js.map +1 -1
- package/build/components/block-list/block.native.js +4 -4
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-list/layout.js +2 -3
- package/build/components/block-list/layout.js.map +1 -1
- package/build/components/border-radius-control/index.js +3 -2
- package/build/components/border-radius-control/index.js.map +1 -1
- package/build/components/color-palette/with-color-context.js +6 -6
- package/build/components/color-palette/with-color-context.js.map +1 -1
- package/build/components/colors/with-colors.js +2 -8
- package/build/components/colors/with-colors.js.map +1 -1
- package/build/components/colors-gradients/control.js +6 -7
- package/build/components/colors-gradients/control.js.map +1 -1
- package/build/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +5 -13
- package/build/components/colors-gradients/use-multiple-origin-colors-and-gradients.js.map +1 -1
- package/build/components/font-family/index.js +2 -3
- package/build/components/font-family/index.js.map +1 -1
- package/build/components/font-sizes/font-size-picker.js +3 -5
- package/build/components/font-sizes/font-size-picker.js.map +1 -1
- package/build/components/font-sizes/with-font-sizes.js +3 -4
- package/build/components/font-sizes/with-font-sizes.js.map +1 -1
- package/build/components/global-styles/filters-panel.js +7 -8
- package/build/components/global-styles/filters-panel.js.map +1 -1
- package/build/components/global-styles/image-settings-panel.js +2 -2
- package/build/components/global-styles/image-settings-panel.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +1 -1
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/gradients/use-gradient.js +2 -5
- package/build/components/gradients/use-gradient.js.map +1 -1
- package/build/components/height-control/index.js +3 -3
- package/build/components/height-control/index.js.map +1 -1
- package/build/components/index.js +9 -2
- package/build/components/index.js.map +1 -1
- package/build/components/index.native.js +9 -2
- package/build/components/index.native.js.map +1 -1
- package/build/components/inner-blocks/index.js +2 -2
- package/build/components/inner-blocks/index.js.map +1 -1
- package/build/components/letter-spacing-control/index.js +3 -3
- package/build/components/letter-spacing-control/index.js.map +1 -1
- package/build/components/link-control/search-item.js +11 -0
- package/build/components/link-control/search-item.js.map +1 -1
- package/build/components/link-control/search-results.js +2 -1
- package/build/components/link-control/search-results.js.map +1 -1
- package/build/components/link-control/use-search-handler.js +10 -5
- package/build/components/link-control/use-search-handler.js.map +1 -1
- package/build/components/resizable-box-popover/index.js +1 -1
- package/build/components/resizable-box-popover/index.js.map +1 -1
- package/build/components/rich-text/index.js +1 -1
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/spacing-sizes-control/hooks/use-spacing-sizes.js +6 -3
- package/build/components/spacing-sizes-control/hooks/use-spacing-sizes.js.map +1 -1
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +3 -3
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build/components/unit-control/index.js +3 -3
- package/build/components/unit-control/index.js.map +1 -1
- package/build/components/use-block-commands/index.js +6 -1
- package/build/components/use-block-commands/index.js.map +1 -1
- package/build/components/use-settings/index.js +212 -0
- package/build/components/use-settings/index.js.map +1 -0
- package/build/hooks/align.js +51 -35
- package/build/hooks/align.js.map +1 -1
- package/build/hooks/anchor.js +37 -32
- package/build/hooks/anchor.js.map +1 -1
- package/build/hooks/background.js +4 -4
- package/build/hooks/background.js.map +1 -1
- package/build/hooks/color.js +2 -4
- package/build/hooks/color.js.map +1 -1
- package/build/hooks/duotone.js +10 -9
- package/build/hooks/duotone.js.map +1 -1
- package/build/hooks/font-size.js +4 -4
- package/build/hooks/font-size.js.map +1 -1
- package/build/hooks/layout.js +10 -11
- package/build/hooks/layout.js.map +1 -1
- package/build/hooks/line-height.js +3 -3
- package/build/hooks/line-height.js.map +1 -1
- package/build/hooks/position.js +2 -3
- package/build/hooks/position.js.map +1 -1
- package/build/hooks/use-color-props.js +3 -11
- package/build/hooks/use-color-props.js.map +1 -1
- package/build/hooks/utils.js +1 -42
- package/build/hooks/utils.js.map +1 -1
- package/build/layouts/constrained.js +3 -3
- package/build/layouts/constrained.js.map +1 -1
- package/build/utils/object.js +4 -1
- package/build/utils/object.js.map +1 -1
- package/build/utils/transform-styles/index.js +19 -24
- package/build/utils/transform-styles/index.js.map +1 -1
- package/build-module/components/block-alignment-control/use-available-alignments.js +30 -28
- package/build-module/components/block-alignment-control/use-available-alignments.js.map +1 -1
- package/build-module/components/block-list/block.native.js +4 -4
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-list/layout.js +2 -2
- package/build-module/components/block-list/layout.js.map +1 -1
- package/build-module/components/border-radius-control/index.js +3 -2
- package/build-module/components/border-radius-control/index.js.map +1 -1
- package/build-module/components/color-palette/with-color-context.js +6 -5
- package/build-module/components/color-palette/with-color-context.js.map +1 -1
- package/build-module/components/colors/with-colors.js +2 -7
- package/build-module/components/colors/with-colors.js.map +1 -1
- package/build-module/components/colors-gradients/control.js +6 -7
- package/build-module/components/colors-gradients/control.js.map +1 -1
- package/build-module/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +5 -12
- package/build-module/components/colors-gradients/use-multiple-origin-colors-and-gradients.js.map +1 -1
- package/build-module/components/font-family/index.js +2 -2
- package/build-module/components/font-family/index.js.map +1 -1
- package/build-module/components/font-sizes/font-size-picker.js +3 -4
- package/build-module/components/font-sizes/font-size-picker.js.map +1 -1
- package/build-module/components/font-sizes/with-font-sizes.js +3 -3
- package/build-module/components/font-sizes/with-font-sizes.js.map +1 -1
- package/build-module/components/global-styles/filters-panel.js +7 -8
- package/build-module/components/global-styles/filters-panel.js.map +1 -1
- package/build-module/components/global-styles/image-settings-panel.js +2 -2
- package/build-module/components/global-styles/image-settings-panel.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +1 -1
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/gradients/use-gradient.js +2 -4
- package/build-module/components/gradients/use-gradient.js.map +1 -1
- package/build-module/components/height-control/index.js +3 -2
- package/build-module/components/height-control/index.js.map +1 -1
- package/build-module/components/index.js +1 -1
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/index.native.js +1 -1
- package/build-module/components/index.native.js.map +1 -1
- package/build-module/components/inner-blocks/index.js +2 -2
- package/build-module/components/inner-blocks/index.js.map +1 -1
- package/build-module/components/letter-spacing-control/index.js +3 -2
- package/build-module/components/letter-spacing-control/index.js.map +1 -1
- package/build-module/components/link-control/search-item.js +12 -1
- package/build-module/components/link-control/search-item.js.map +1 -1
- package/build-module/components/link-control/search-results.js +2 -1
- package/build-module/components/link-control/search-results.js.map +1 -1
- package/build-module/components/link-control/use-search-handler.js +10 -5
- package/build-module/components/link-control/use-search-handler.js.map +1 -1
- package/build-module/components/resizable-box-popover/index.js +1 -1
- package/build-module/components/resizable-box-popover/index.js.map +1 -1
- package/build-module/components/rich-text/index.js +1 -1
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/spacing-sizes-control/hooks/use-spacing-sizes.js +6 -2
- package/build-module/components/spacing-sizes-control/hooks/use-spacing-sizes.js.map +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +3 -2
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build-module/components/unit-control/index.js +3 -2
- package/build-module/components/unit-control/index.js.map +1 -1
- package/build-module/components/use-block-commands/index.js +5 -1
- package/build-module/components/use-block-commands/index.js.map +1 -1
- package/build-module/components/use-settings/index.js +203 -0
- package/build-module/components/use-settings/index.js.map +1 -0
- package/build-module/hooks/align.js +51 -35
- package/build-module/hooks/align.js.map +1 -1
- package/build-module/hooks/anchor.js +37 -32
- package/build-module/hooks/anchor.js.map +1 -1
- package/build-module/hooks/background.js +4 -4
- package/build-module/hooks/background.js.map +1 -1
- package/build-module/hooks/color.js +2 -4
- package/build-module/hooks/color.js.map +1 -1
- package/build-module/hooks/duotone.js +11 -10
- package/build-module/hooks/duotone.js.map +1 -1
- package/build-module/hooks/font-size.js +4 -4
- package/build-module/hooks/font-size.js.map +1 -1
- package/build-module/hooks/layout.js +10 -11
- package/build-module/hooks/layout.js.map +1 -1
- package/build-module/hooks/line-height.js +3 -3
- package/build-module/hooks/line-height.js.map +1 -1
- package/build-module/hooks/position.js +2 -3
- package/build-module/hooks/position.js.map +1 -1
- package/build-module/hooks/use-color-props.js +3 -11
- package/build-module/hooks/use-color-props.js.map +1 -1
- package/build-module/hooks/utils.js +2 -43
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/layouts/constrained.js +3 -2
- package/build-module/layouts/constrained.js.map +1 -1
- package/build-module/utils/object.js +3 -1
- package/build-module/utils/object.js.map +1 -1
- package/build-module/utils/transform-styles/index.js +20 -24
- package/build-module/utils/transform-styles/index.js.map +1 -1
- package/build-style/style-rtl.css +13 -6
- package/build-style/style.css +13 -6
- package/package.json +36 -34
- package/src/components/block-alignment-control/use-available-alignments.js +49 -34
- package/src/components/block-list/block.native.js +4 -4
- package/src/components/block-list/layout.js +2 -2
- package/src/components/block-styles/style.scss +1 -1
- package/src/components/border-radius-control/index.js +3 -2
- package/src/components/color-palette/with-color-context.js +9 -9
- package/src/components/colors/with-colors.js +6 -7
- package/src/components/colors-gradients/control.js +10 -7
- package/src/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +29 -15
- package/src/components/font-family/index.js +2 -2
- package/src/components/font-sizes/font-size-picker.js +6 -4
- package/src/components/font-sizes/with-font-sizes.js +3 -5
- package/src/components/global-styles/filters-panel.js +9 -15
- package/src/components/global-styles/image-settings-panel.js +2 -2
- package/src/components/global-styles/typography-panel.js +1 -1
- package/src/components/gradients/use-gradient.js +10 -4
- package/src/components/height-control/index.js +3 -2
- package/src/components/index.js +1 -1
- package/src/components/index.native.js +1 -1
- package/src/components/inner-blocks/index.js +2 -2
- package/src/components/inserter/style.scss +9 -1
- package/src/components/letter-spacing-control/index.js +3 -2
- package/src/components/link-control/search-item.js +14 -0
- package/src/components/link-control/search-results.js +1 -0
- package/src/components/link-control/use-search-handler.js +22 -15
- package/src/components/resizable-box-popover/index.js +1 -1
- package/src/components/rich-text/index.js +1 -1
- package/src/components/spacing-sizes-control/hooks/use-spacing-sizes.js +7 -5
- package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +3 -2
- package/src/components/unit-control/index.js +3 -8
- package/src/components/use-block-commands/index.js +2 -1
- package/src/components/{use-setting → use-settings}/README.md +9 -10
- package/src/components/use-settings/index.js +272 -0
- package/src/components/{use-setting → use-settings}/test/index.js +47 -5
- package/src/hooks/align.js +79 -54
- package/src/hooks/anchor.js +75 -65
- package/src/hooks/background.js +7 -9
- package/src/hooks/color.js +7 -4
- package/src/hooks/duotone.js +24 -19
- package/src/hooks/font-size.js +4 -4
- package/src/hooks/layout.js +11 -11
- package/src/hooks/line-height.js +3 -3
- package/src/hooks/position.js +5 -3
- package/src/hooks/use-color-props.js +21 -14
- package/src/hooks/utils.js +88 -43
- package/src/layouts/constrained.js +3 -8
- package/src/utils/object.js +4 -1
- package/src/utils/test/__snapshots__/transform-styles.js.snap +103 -0
- package/src/utils/test/transform-styles.js +217 -0
- package/src/utils/transform-styles/index.js +25 -25
- package/build/components/use-setting/index.js +0 -161
- package/build/components/use-setting/index.js.map +0 -1
- package/build/utils/transform-styles/ast/index.js +0 -21
- package/build/utils/transform-styles/ast/index.js.map +0 -1
- package/build/utils/transform-styles/ast/parse.js +0 -660
- package/build/utils/transform-styles/ast/parse.js.map +0 -1
- package/build/utils/transform-styles/ast/stringify/compiler.js +0 -52
- package/build/utils/transform-styles/ast/stringify/compiler.js.map +0 -1
- package/build/utils/transform-styles/ast/stringify/compress.js +0 -178
- package/build/utils/transform-styles/ast/stringify/compress.js.map +0 -1
- package/build/utils/transform-styles/ast/stringify/identity.js +0 -207
- package/build/utils/transform-styles/ast/stringify/identity.js.map +0 -1
- package/build/utils/transform-styles/ast/stringify/index.js +0 -36
- package/build/utils/transform-styles/ast/stringify/index.js.map +0 -1
- package/build/utils/transform-styles/transforms/url-rewrite.js +0 -130
- package/build/utils/transform-styles/transforms/url-rewrite.js.map +0 -1
- package/build/utils/transform-styles/transforms/wrap.js +0 -59
- package/build/utils/transform-styles/transforms/wrap.js.map +0 -1
- package/build/utils/transform-styles/traverse.js +0 -37
- package/build/utils/transform-styles/traverse.js.map +0 -1
- package/build-module/components/use-setting/index.js +0 -154
- package/build-module/components/use-setting/index.js.map +0 -1
- package/build-module/utils/transform-styles/ast/index.js +0 -6
- package/build-module/utils/transform-styles/ast/index.js.map +0 -1
- package/build-module/utils/transform-styles/ast/parse.js +0 -654
- package/build-module/utils/transform-styles/ast/parse.js.map +0 -1
- package/build-module/utils/transform-styles/ast/stringify/compiler.js +0 -49
- package/build-module/utils/transform-styles/ast/stringify/compiler.js.map +0 -1
- package/build-module/utils/transform-styles/ast/stringify/compress.js +0 -176
- package/build-module/utils/transform-styles/ast/stringify/compress.js.map +0 -1
- package/build-module/utils/transform-styles/ast/stringify/identity.js +0 -206
- package/build-module/utils/transform-styles/ast/stringify/identity.js.map +0 -1
- package/build-module/utils/transform-styles/ast/stringify/index.js +0 -29
- package/build-module/utils/transform-styles/ast/stringify/index.js.map +0 -1
- package/build-module/utils/transform-styles/transforms/url-rewrite.js +0 -123
- package/build-module/utils/transform-styles/transforms/url-rewrite.js.map +0 -1
- package/build-module/utils/transform-styles/transforms/wrap.js +0 -52
- package/build-module/utils/transform-styles/transforms/wrap.js.map +0 -1
- package/build-module/utils/transform-styles/traverse.js +0 -28
- package/build-module/utils/transform-styles/traverse.js.map +0 -1
- package/src/components/use-setting/index.js +0 -218
- package/src/utils/transform-styles/ast/index.js +0 -5
- package/src/utils/transform-styles/ast/parse.js +0 -732
- package/src/utils/transform-styles/ast/stringify/compiler.js +0 -50
- package/src/utils/transform-styles/ast/stringify/compress.js +0 -238
- package/src/utils/transform-styles/ast/stringify/identity.js +0 -286
- package/src/utils/transform-styles/ast/stringify/index.js +0 -32
- package/src/utils/transform-styles/test/__snapshots__/traverse.js.snap +0 -7
- package/src/utils/transform-styles/test/traverse.js +0 -24
- package/src/utils/transform-styles/transforms/test/__snapshots__/url-rewrite.js.snap +0 -25
- package/src/utils/transform-styles/transforms/test/__snapshots__/wrap.js.snap +0 -64
- package/src/utils/transform-styles/transforms/test/url-rewrite.js +0 -39
- package/src/utils/transform-styles/transforms/test/wrap.js +0 -95
- package/src/utils/transform-styles/transforms/url-rewrite.js +0 -139
- package/src/utils/transform-styles/transforms/wrap.js +0 -56
- package/src/utils/transform-styles/traverse.js +0 -32
package/CHANGELOG.md
CHANGED
|
@@ -2,23 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 12.13.0 (2023-11-02)
|
|
6
|
+
|
|
7
|
+
- Deprecated the `useSetting` function in favor of new `useSettings` one that can retrieve multiple settings at once ([#55337](https://github.com/WordPress/gutenberg/pull/55337)).
|
|
8
|
+
|
|
5
9
|
## 12.12.0 (2023-10-18)
|
|
6
10
|
|
|
7
11
|
## 12.11.0 (2023-10-05)
|
|
8
12
|
|
|
9
|
-
-
|
|
13
|
+
- Deprecated `CopyHandler`, absorbed into `WritingFlow`.
|
|
10
14
|
|
|
11
15
|
## 12.10.0 (2023-09-20)
|
|
12
16
|
|
|
13
|
-
-
|
|
14
|
-
|
|
15
|
-
|
|
17
|
+
- The Deprecated multiline prop on RichText will now fall back to using multiple
|
|
18
|
+
rich text instances instead of a single multiline instance. The prop remains
|
|
19
|
+
deprecated.
|
|
16
20
|
|
|
17
21
|
## 12.9.0 (2023-08-31)
|
|
18
22
|
|
|
19
23
|
### Enhancements
|
|
20
24
|
|
|
21
|
-
-
|
|
25
|
+
- Embed the `ObserveTyping` behavior within the `BlockList` component making to simplify instanciations of third-party block editors.
|
|
22
26
|
|
|
23
27
|
## 12.8.0 (2023-08-16)
|
|
24
28
|
|
|
@@ -32,13 +36,12 @@
|
|
|
32
36
|
|
|
33
37
|
### Enhancements
|
|
34
38
|
|
|
35
|
-
-
|
|
39
|
+
- Add `HeadingLevelDropdown` component for selecting H1-H6 and paragraph HTML tags from the block toolbar.
|
|
36
40
|
|
|
37
41
|
### Bug Fix
|
|
38
42
|
|
|
39
43
|
- Fluid typography: custom font-sizes should use max viewport width ([#51516](https://github.com/WordPress/gutenberg/pull/51516)).
|
|
40
44
|
|
|
41
|
-
|
|
42
45
|
## 12.3.0 (2023-06-07)
|
|
43
46
|
|
|
44
47
|
## 12.2.0 (2023-05-24)
|
|
@@ -51,11 +54,10 @@
|
|
|
51
54
|
|
|
52
55
|
### Breaking Changes
|
|
53
56
|
|
|
54
|
-
-
|
|
57
|
+
- Renamed utility function `immutableSet` to `setImmutably` ([#50040](https://github.com/WordPress/gutenberg/pull/50040)).
|
|
55
58
|
|
|
56
59
|
## 11.8.0 (2023-04-12)
|
|
57
60
|
|
|
58
|
-
|
|
59
61
|
## 11.7.0 (2023-03-29)
|
|
60
62
|
|
|
61
63
|
- `ImageSizeControl`: Update image size label ([#49112](https://github.com/WordPress/gutenberg/pull/49112)).
|
|
@@ -102,7 +104,7 @@
|
|
|
102
104
|
### Bug Fix
|
|
103
105
|
|
|
104
106
|
- `SpacingSizesControl`: Change ARIA role from `region` to `group` to avoid unwanted ARIA landmark regions ([#46530](https://github.com/WordPress/gutenberg/pull/46530)).
|
|
105
|
-
- `FocalPointPicker`:
|
|
107
|
+
- `FocalPointPicker`: Fix layout misalignment when placed in the `BlockInspector` ([#46631](https://github.com/WordPress/gutenberg/pull/46631)).
|
|
106
108
|
|
|
107
109
|
## 10.5.0 (2022-11-16)
|
|
108
110
|
|
package/README.md
CHANGED
|
@@ -789,13 +789,23 @@ Applies a series of CSS rule transforms to wrap selectors inside a given class a
|
|
|
789
789
|
|
|
790
790
|
_Parameters_
|
|
791
791
|
|
|
792
|
-
- _styles_ `
|
|
793
|
-
-
|
|
792
|
+
- _styles_ `EditorStyle[]`: CSS rules.
|
|
793
|
+
- _wrapperSelector_ `string`: Wrapper selector.
|
|
794
794
|
|
|
795
795
|
_Returns_
|
|
796
796
|
|
|
797
797
|
- `Array`: converted rules.
|
|
798
798
|
|
|
799
|
+
_Type Definition_
|
|
800
|
+
|
|
801
|
+
- _EditorStyle_ `Object`
|
|
802
|
+
|
|
803
|
+
_Properties_
|
|
804
|
+
|
|
805
|
+
- _css_ `string`: the CSS block(s), as a single string.
|
|
806
|
+
- _baseURL_ `?string`: the base URL to be used as the reference when rewritting urls.
|
|
807
|
+
- _ignoredSelectors_ `?string[]`: the selectors not to wrap.
|
|
808
|
+
|
|
799
809
|
### Typewriter
|
|
800
810
|
|
|
801
811
|
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.
|
|
@@ -944,9 +954,11 @@ _Parameters_
|
|
|
944
954
|
|
|
945
955
|
### useSetting
|
|
946
956
|
|
|
957
|
+
> **Deprecated** 6.4.0 Use useSettings instead.
|
|
958
|
+
|
|
947
959
|
Hook that retrieves the given setting for the block instance in use.
|
|
948
960
|
|
|
949
|
-
It looks up the
|
|
961
|
+
It looks up the setting first in the block instance hierarchy. If none is found, it'll look it up in the block editor settings.
|
|
950
962
|
|
|
951
963
|
_Usage_
|
|
952
964
|
|
|
@@ -962,6 +974,26 @@ _Returns_
|
|
|
962
974
|
|
|
963
975
|
- `any`: Returns the value defined for the setting.
|
|
964
976
|
|
|
977
|
+
### useSettings
|
|
978
|
+
|
|
979
|
+
Hook that retrieves the given settings for the block instance in use.
|
|
980
|
+
|
|
981
|
+
It looks up the settings first in the block instance hierarchy. If none are found, it'll look them up in the block editor settings.
|
|
982
|
+
|
|
983
|
+
_Usage_
|
|
984
|
+
|
|
985
|
+
```js
|
|
986
|
+
const [ fixed, sticky ] = useSettings( 'position.fixed', 'position.sticky' );
|
|
987
|
+
```
|
|
988
|
+
|
|
989
|
+
_Parameters_
|
|
990
|
+
|
|
991
|
+
- _paths_ `string[]`: The paths to the settings.
|
|
992
|
+
|
|
993
|
+
_Returns_
|
|
994
|
+
|
|
995
|
+
- `any[]`: Returns the values defined for the settings.
|
|
996
|
+
|
|
965
997
|
### Warning
|
|
966
998
|
|
|
967
999
|
_Related_
|
|
@@ -24,28 +24,27 @@ function useAvailableAlignments(controls = DEFAULT_CONTROLS) {
|
|
|
24
24
|
if (!controls.includes('none')) {
|
|
25
25
|
controls = ['none', ...controls];
|
|
26
26
|
}
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
};
|
|
41
|
-
}, []);
|
|
27
|
+
const isNoneOnly = controls.length === 1 && controls[0] === 'none';
|
|
28
|
+
const [wideControlsEnabled, themeSupportsLayout, isBlockBasedTheme] = (0, _data.useSelect)(select => {
|
|
29
|
+
var _settings$alignWide;
|
|
30
|
+
// If `isNoneOnly` is true, we'll be returning early because there is
|
|
31
|
+
// nothing to filter on an empty array. We won't need the info from
|
|
32
|
+
// the `useSelect` but we must call it anyway because Rules of Hooks.
|
|
33
|
+
// So the callback returns early to avoid block editor subscription.
|
|
34
|
+
if (isNoneOnly) {
|
|
35
|
+
return [false, false, false];
|
|
36
|
+
}
|
|
37
|
+
const settings = select(_store.store).getSettings();
|
|
38
|
+
return [(_settings$alignWide = settings.alignWide) !== null && _settings$alignWide !== void 0 ? _settings$alignWide : false, settings.supportsLayout, settings.__unstableIsBlockBasedTheme];
|
|
39
|
+
}, [isNoneOnly]);
|
|
42
40
|
const layout = (0, _layout.useLayout)();
|
|
41
|
+
if (isNoneOnly) {
|
|
42
|
+
return EMPTY_ARRAY;
|
|
43
|
+
}
|
|
43
44
|
const layoutType = (0, _layouts.getLayoutType)(layout?.type);
|
|
44
|
-
const layoutAlignments = layoutType.getAlignments(layout, isBlockBasedTheme);
|
|
45
45
|
if (themeSupportsLayout) {
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
}) => controls.includes(alignmentName));
|
|
46
|
+
const layoutAlignments = layoutType.getAlignments(layout, isBlockBasedTheme);
|
|
47
|
+
const alignments = layoutAlignments.filter(alignment => controls.includes(alignment.name));
|
|
49
48
|
// While we treat `none` as an alignment, we shouldn't return it if no
|
|
50
49
|
// other alignments exist.
|
|
51
50
|
if (alignments.length === 1 && alignments[0].name === 'none') {
|
|
@@ -58,20 +57,23 @@ function useAvailableAlignments(controls = DEFAULT_CONTROLS) {
|
|
|
58
57
|
if (layoutType.name !== 'default' && layoutType.name !== 'constrained') {
|
|
59
58
|
return EMPTY_ARRAY;
|
|
60
59
|
}
|
|
61
|
-
const {
|
|
62
|
-
alignments
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
60
|
+
const alignments = controls.filter(control => {
|
|
61
|
+
if (layout.alignments) {
|
|
62
|
+
return layout.alignments.includes(control);
|
|
63
|
+
}
|
|
64
|
+
if (!wideControlsEnabled && WIDE_CONTROLS.includes(control)) {
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
return DEFAULT_CONTROLS.includes(control);
|
|
68
|
+
}).map(name => ({
|
|
69
|
+
name
|
|
68
70
|
}));
|
|
69
71
|
|
|
70
72
|
// While we treat `none` as an alignment, we shouldn't return it if no
|
|
71
73
|
// other alignments exist.
|
|
72
|
-
if (
|
|
74
|
+
if (alignments.length === 1 && alignments[0].name === 'none') {
|
|
73
75
|
return EMPTY_ARRAY;
|
|
74
76
|
}
|
|
75
|
-
return
|
|
77
|
+
return alignments;
|
|
76
78
|
}
|
|
77
79
|
//# sourceMappingURL=use-available-alignments.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_layout","_store","_layouts","EMPTY_ARRAY","DEFAULT_CONTROLS","WIDE_CONTROLS","useAvailableAlignments","controls","includes","wideControlsEnabled","themeSupportsLayout","isBlockBasedTheme","useSelect","select","
|
|
1
|
+
{"version":3,"names":["_data","require","_layout","_store","_layouts","EMPTY_ARRAY","DEFAULT_CONTROLS","WIDE_CONTROLS","useAvailableAlignments","controls","includes","isNoneOnly","length","wideControlsEnabled","themeSupportsLayout","isBlockBasedTheme","useSelect","select","_settings$alignWide","settings","blockEditorStore","getSettings","alignWide","supportsLayout","__unstableIsBlockBasedTheme","layout","useLayout","layoutType","getLayoutType","type","layoutAlignments","getAlignments","alignments","filter","alignment","name","control","map"],"sources":["@wordpress/block-editor/src/components/block-alignment-control/use-available-alignments.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { useLayout } from '../block-list/layout';\nimport { store as blockEditorStore } from '../../store';\nimport { getLayoutType } from '../../layouts';\n\nconst EMPTY_ARRAY = [];\nconst DEFAULT_CONTROLS = [ 'none', 'left', 'center', 'right', 'wide', 'full' ];\nconst WIDE_CONTROLS = [ 'wide', 'full' ];\n\nexport default function useAvailableAlignments( controls = DEFAULT_CONTROLS ) {\n\t// Always add the `none` option if not exists.\n\tif ( ! controls.includes( 'none' ) ) {\n\t\tcontrols = [ 'none', ...controls ];\n\t}\n\tconst isNoneOnly = controls.length === 1 && controls[ 0 ] === 'none';\n\n\tconst [ wideControlsEnabled, themeSupportsLayout, isBlockBasedTheme ] =\n\t\tuseSelect(\n\t\t\t( select ) => {\n\t\t\t\t// If `isNoneOnly` is true, we'll be returning early because there is\n\t\t\t\t// nothing to filter on an empty array. We won't need the info from\n\t\t\t\t// the `useSelect` but we must call it anyway because Rules of Hooks.\n\t\t\t\t// So the callback returns early to avoid block editor subscription.\n\t\t\t\tif ( isNoneOnly ) {\n\t\t\t\t\treturn [ false, false, false ];\n\t\t\t\t}\n\n\t\t\t\tconst settings = select( blockEditorStore ).getSettings();\n\t\t\t\treturn [\n\t\t\t\t\tsettings.alignWide ?? false,\n\t\t\t\t\tsettings.supportsLayout,\n\t\t\t\t\tsettings.__unstableIsBlockBasedTheme,\n\t\t\t\t];\n\t\t\t},\n\t\t\t[ isNoneOnly ]\n\t\t);\n\tconst layout = useLayout();\n\n\tif ( isNoneOnly ) {\n\t\treturn EMPTY_ARRAY;\n\t}\n\n\tconst layoutType = getLayoutType( layout?.type );\n\n\tif ( themeSupportsLayout ) {\n\t\tconst layoutAlignments = layoutType.getAlignments(\n\t\t\tlayout,\n\t\t\tisBlockBasedTheme\n\t\t);\n\t\tconst alignments = layoutAlignments.filter( ( alignment ) =>\n\t\t\tcontrols.includes( alignment.name )\n\t\t);\n\t\t// While we treat `none` as an alignment, we shouldn't return it if no\n\t\t// other alignments exist.\n\t\tif ( alignments.length === 1 && alignments[ 0 ].name === 'none' ) {\n\t\t\treturn EMPTY_ARRAY;\n\t\t}\n\t\treturn alignments;\n\t}\n\n\t// Starting here, it's the fallback for themes not supporting the layout config.\n\tif ( layoutType.name !== 'default' && layoutType.name !== 'constrained' ) {\n\t\treturn EMPTY_ARRAY;\n\t}\n\n\tconst alignments = controls\n\t\t.filter( ( control ) => {\n\t\t\tif ( layout.alignments ) {\n\t\t\t\treturn layout.alignments.includes( control );\n\t\t\t}\n\n\t\t\tif ( ! wideControlsEnabled && WIDE_CONTROLS.includes( control ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn DEFAULT_CONTROLS.includes( control );\n\t\t} )\n\t\t.map( ( name ) => ( { name } ) );\n\n\t// While we treat `none` as an alignment, we shouldn't return it if no\n\t// other alignments exist.\n\tif ( alignments.length === 1 && alignments[ 0 ].name === 'none' ) {\n\t\treturn EMPTY_ARRAY;\n\t}\n\n\treturn alignments;\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAVA;AACA;AACA;;AAGA;AACA;AACA;;AAKA,MAAMI,WAAW,GAAG,EAAE;AACtB,MAAMC,gBAAgB,GAAG,CAAE,MAAM,EAAE,MAAM,E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G,MAAM,CAAIC,SAAS,IACtDzB,QAAQ,CAACC,QAAQ,CAAEwB,SAAS,CAACC,IAAK,CACnC,CAAC;IACD;IACA;IACA,IAAKH,UAAU,CAACpB,MAAM,KAAK,CAAC,IAAIoB,UAAU,CAAE,CAAC,CAAE,CAACG,IAAI,KAAK,MAAM,EAAG;MACjE,OAAO9B,WAAW;IACnB;IACA,OAAO2B,UAAU;EAClB;;EAEA;EACA,IAAKL,UAAU,CAACQ,IAAI,KAAK,SAAS,IAAIR,UAAU,CAACQ,IAAI,KAAK,aAAa,EAAG;IACzE,OAAO9B,WAAW;EACnB;EAEA,MAAM2B,UAAU,GAAGvB,QAAQ,CACzBwB,MAAM,CAAIG,OAAO,IAAM;IACvB,IAAKX,MAAM,CAACO,UAAU,EAAG;MACxB,OAAOP,MAAM,CAACO,UAAU,CAACtB,QAAQ,CAAE0B,OAAQ,CAAC;IAC7C;IAEA,IAAK,CAAEvB,mBAAmB,IAAIN,aAAa,CAACG,QAAQ,CAAE0B,OAAQ,CAAC,EAAG;MACjE,OAAO,KAAK;IACb;IAEA,OAAO9B,gBAAgB,CAACI,QAAQ,CAAE0B,OAAQ,CAAC;EAC5C,CAAE,CAAC,CACFC,GAAG,CAAIF,IAAI,KAAQ;IAAEA;EAAK,CAAC,CAAG,CAAC;;EAEjC;EACA;EACA,IAAKH,UAAU,CAACpB,MAAM,KAAK,CAAC,IAAIoB,UAAU,CAAE,CAAC,CAAE,CAACG,IAAI,KAAK,MAAM,EAAG;IACjE,OAAO9B,WAAW;EACnB;EAEA,OAAO2B,UAAU;AAClB"}
|
|
@@ -18,7 +18,7 @@ var _blockInvalidWarning = _interopRequireDefault(require("./block-invalid-warni
|
|
|
18
18
|
var _blockOutline = _interopRequireDefault(require("./block-outline"));
|
|
19
19
|
var _store = require("../../store");
|
|
20
20
|
var _layout = require("./layout");
|
|
21
|
-
var
|
|
21
|
+
var _useSettings = require("../use-settings");
|
|
22
22
|
/**
|
|
23
23
|
* External dependencies
|
|
24
24
|
*/
|
|
@@ -31,7 +31,7 @@ var _useSetting = _interopRequireDefault(require("../use-setting"));
|
|
|
31
31
|
* Internal dependencies
|
|
32
32
|
*/
|
|
33
33
|
|
|
34
|
-
const
|
|
34
|
+
const EMPTY_ARRAY = [];
|
|
35
35
|
|
|
36
36
|
// Helper function to memoize the wrapperProps since getEditWrapperProps always returns a new reference.
|
|
37
37
|
const wrapperPropsCache = new WeakMap();
|
|
@@ -181,7 +181,7 @@ function BlockListBlock({
|
|
|
181
181
|
const parentLayout = (0, _layout.useLayout)() || {};
|
|
182
182
|
const defaultColors = (0, _components.useMobileGlobalStylesColors)();
|
|
183
183
|
const globalStyle = (0, _components.useGlobalStyles)();
|
|
184
|
-
const fontSizes = (0,
|
|
184
|
+
const [fontSizes] = (0, _useSettings.useSettings)('typography.fontSizes');
|
|
185
185
|
const onRemove = (0, _element.useCallback)(() => removeBlock(clientId), [clientId, removeBlock]);
|
|
186
186
|
const onFocus = (0, _element.useCallback)(() => {
|
|
187
187
|
if (!isSelected) {
|
|
@@ -205,7 +205,7 @@ function BlockListBlock({
|
|
|
205
205
|
|
|
206
206
|
// Inherited styles merged with block level styles.
|
|
207
207
|
const mergedStyle = (0, _element.useMemo)(() => {
|
|
208
|
-
return (0, _components.getMergedGlobalStyles)(baseGlobalStyles, globalStyle, wrapperProps.style, attributes, defaultColors, name, fontSizes);
|
|
208
|
+
return (0, _components.getMergedGlobalStyles)(baseGlobalStyles, globalStyle, wrapperProps.style, attributes, defaultColors, name, fontSizes || EMPTY_ARRAY);
|
|
209
209
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
210
210
|
}, [
|
|
211
211
|
// It is crucial to keep the dependencies array minimal to prevent unnecessary calls that could negatively impact performance.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_element","_components","_blocks","_data","_compose","_blockEdit","_interopRequireDefault","_blockDraggable","_blockInvalidWarning","_blockOutline","_store","_layout","_useSetting","emptyArray","wrapperPropsCache","WeakMap","emptyObj","getWrapperProps","value","getWrapperPropsFunction","cachedValue","get","wrapperProps","set","BlockWrapper","accessibilityLabel","blockCategory","children","clientId","draggingClientId","draggingEnabled","hasInnerBlocks","isDescendentBlockSelected","isRootList","isSelected","isTouchable","marginHorizontal","marginVertical","name","onFocus","blockWrapperStyles","flex","blockWrapperStyle","accessible","_react","createElement","Pressable","accessibilityRole","disabled","onPress","style","default","enabled","testID","BlockListBlock","attributes","blockWidth","blockWrapperWidth","canRemove","contentStyle","isLocked","isSelectionEnabled","isStackedHorizontally","isValid","onDeleteBlock","onInsertBlocksAfter","onMerge","onReplace","parentBlockAlignment","parentWidth","rootClientId","setAttributes","toggleSelection","baseGlobalStyles","blockType","isDescendantOfParentSelected","isParentSelected","order","useSelect","select","getBlockCount","getBlockHierarchyRootClientId","getBlockIndex","getBlockParents","getSelectedBlockClientId","getSettings","hasSelectedInnerBlock","blockEditorStore","currentBlockType","getBlockType","currentBlockCategory","category","blockOrder","descendentBlockSelected","selectedBlockClientId","parents","parentSelected","selectedParents","descendantOfParentSelected","includes","blockHasInnerBlocks","isDraggingEnabled","currentDraggingClientId","globalStylesBaseStyles","__experimentalGlobalStylesBaseStyles","removeBlock","selectBlock","useDispatch","initialBlockWidth","setBlockWidth","useState","parentLayout","useLayout","defaultColors","useMobileGlobalStylesColors","globalStyle","useGlobalStyles","fontSizes","useSetting","onRemove","useCallback","onLayout","nativeEvent","layoutWidth","Math","floor","layout","width","getEditWrapperProps","mergedStyle","useMemo","getMergedGlobalStyles","JSON","stringify","Object","fromEntries","entries","filter","key","GlobalStylesContext","BLOCK_STYLE_ATTRIBUTES","isFocused","getAccessibleBlockLabel","Provider","insertBlocksAfter","undefined","mergeBlocks","__unstableParentLayout","keys","length","View","applyWithSelect","withSelect","isBlockSelected","getBlockMode","getTemplateLock","__unstableGetBlockWithoutInnerBlocks","canRemoveBlock","canMoveBlock","block","templateLock","canMove","mode","applyWithDispatch","withDispatch","dispatch","ownProps","registry","updateBlockAttributes","insertBlocks","replaceBlocks","__unstableMarkLastChangeAsPersistent","moveBlocksToPosition","newAttributes","getMultiSelectedBlockClientIds","multiSelectedBlockClientIds","clientIds","onInsertBlocks","blocks","index","forward","getPreviousBlockClientId","getNextBlockClientId","getBlock","getBlockAttributes","getBlockName","getBlockOrder","getBlockRootClientId","canInsertBlockType","moveFirstItemUp","_clientId","changeSelection","targetRootClientId","firstClientId","isUnmodifiedBlock","batch","replacement","switchToBlockType","getDefaultBlockName","nextRootClientId","rootAttributes","previousRootAttributes","every","nextBlockClientId","previousBlockClientId","previousRootClientId","indexToSelect","initialPosition","isUnmodifiedDefaultBlock","selectionEnabled","_default","compose","pure","ifCondition","exports"],"sources":["@wordpress/block-editor/src/components/block-list/block.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { Pressable, View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { useCallback, useMemo, useState } from '@wordpress/element';\nimport {\n\tGlobalStylesContext,\n\tgetMergedGlobalStyles,\n\tuseMobileGlobalStylesColors,\n\tuseGlobalStyles,\n} from '@wordpress/components';\nimport {\n\t__experimentalGetAccessibleBlockLabel as getAccessibleBlockLabel,\n\tgetBlockType,\n\tgetDefaultBlockName,\n\tisUnmodifiedBlock,\n\tisUnmodifiedDefaultBlock,\n\tswitchToBlockType,\n} from '@wordpress/blocks';\nimport {\n\tuseDispatch,\n\tuseSelect,\n\twithDispatch,\n\twithSelect,\n} from '@wordpress/data';\nimport { compose, ifCondition, pure } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BlockEdit from '../block-edit';\nimport BlockDraggable from '../block-draggable';\nimport BlockInvalidWarning from './block-invalid-warning';\nimport BlockOutline from './block-outline';\nimport { store as blockEditorStore } from '../../store';\nimport { useLayout } from './layout';\nimport useSetting from '../use-setting';\n\nconst emptyArray = [];\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\nfunction BlockWrapper( {\n\taccessibilityLabel,\n\tblockCategory,\n\tchildren,\n\tclientId,\n\tdraggingClientId,\n\tdraggingEnabled,\n\thasInnerBlocks,\n\tisDescendentBlockSelected,\n\tisRootList,\n\tisSelected,\n\tisTouchable,\n\tmarginHorizontal,\n\tmarginVertical,\n\tname,\n\tonFocus,\n} ) {\n\tconst blockWrapperStyles = { flex: 1 };\n\tconst blockWrapperStyle = [\n\t\tblockWrapperStyles,\n\t\t{\n\t\t\tmarginVertical,\n\t\t\tmarginHorizontal,\n\t\t},\n\t];\n\tconst accessible = ! ( isSelected || isDescendentBlockSelected );\n\n\treturn (\n\t\t<Pressable\n\t\t\taccessibilityLabel={ accessibilityLabel }\n\t\t\taccessibilityRole=\"button\"\n\t\t\taccessible={ accessible }\n\t\t\tdisabled={ ! isTouchable }\n\t\t\tonPress={ onFocus }\n\t\t\tstyle={ blockWrapperStyle }\n\t\t>\n\t\t\t<BlockOutline\n\t\t\t\tblockCategory={ blockCategory }\n\t\t\t\thasInnerBlocks={ hasInnerBlocks }\n\t\t\t\tisRootList={ isRootList }\n\t\t\t\tisSelected={ isSelected }\n\t\t\t\tname={ name }\n\t\t\t/>\n\t\t\t<BlockDraggable\n\t\t\t\tclientId={ clientId }\n\t\t\t\tdraggingClientId={ draggingClientId }\n\t\t\t\tenabled={ draggingEnabled }\n\t\t\t\ttestID=\"draggable-trigger-content\"\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</BlockDraggable>\n\t\t</Pressable>\n\t);\n}\n\nfunction BlockListBlock( {\n\tattributes,\n\tblockWidth: blockWrapperWidth,\n\tcanRemove,\n\tclientId,\n\tcontentStyle,\n\tisLocked,\n\tisSelected,\n\tisSelectionEnabled,\n\tisStackedHorizontally,\n\tisValid,\n\tmarginHorizontal,\n\tmarginVertical,\n\tname,\n\tonDeleteBlock,\n\tonInsertBlocksAfter,\n\tonMerge,\n\tonReplace,\n\tparentBlockAlignment,\n\tparentWidth,\n\trootClientId,\n\tsetAttributes,\n\ttoggleSelection,\n} ) {\n\tconst {\n\t\tbaseGlobalStyles,\n\t\tblockCategory,\n\t\tblockType,\n\t\tdraggingClientId,\n\t\tdraggingEnabled,\n\t\thasInnerBlocks,\n\t\tisDescendantOfParentSelected,\n\t\tisDescendentBlockSelected,\n\t\tisParentSelected,\n\t\torder,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockCount,\n\t\t\t\tgetBlockHierarchyRootClientId,\n\t\t\t\tgetBlockIndex,\n\t\t\t\tgetBlockParents,\n\t\t\t\tgetSelectedBlockClientId,\n\t\t\t\tgetSettings,\n\t\t\t\thasSelectedInnerBlock,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst currentBlockType = getBlockType( name || 'core/missing' );\n\t\t\tconst currentBlockCategory = currentBlockType?.category;\n\t\t\tconst blockOrder = getBlockIndex( clientId );\n\t\t\tconst descendentBlockSelected = hasSelectedInnerBlock(\n\t\t\t\tclientId,\n\t\t\t\ttrue\n\t\t\t);\n\t\t\tconst selectedBlockClientId = getSelectedBlockClientId();\n\n\t\t\tconst parents = getBlockParents( clientId, true );\n\t\t\tconst parentSelected =\n\t\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\t( selectedBlockClientId || false ) &&\n\t\t\t\tselectedBlockClientId === rootClientId;\n\n\t\t\tconst selectedParents = clientId ? parents : [];\n\t\t\tconst descendantOfParentSelected =\n\t\t\t\tselectedParents.includes( rootClientId );\n\t\t\tconst blockHasInnerBlocks = getBlockCount( clientId ) > 0;\n\n\t\t\t// For blocks with inner blocks, we only enable the dragging in the nested\n\t\t\t// blocks if any of them are selected. This way we prevent the long-press\n\t\t\t// gesture from being disabled for elements within the block UI.\n\t\t\tconst isDraggingEnabled =\n\t\t\t\t! blockHasInnerBlocks ||\n\t\t\t\tisSelected ||\n\t\t\t\t! descendentBlockSelected;\n\t\t\t// Dragging nested blocks is not supported yet. For this reason, the block to be dragged\n\t\t\t// will be the top in the hierarchy.\n\t\t\tconst currentDraggingClientId =\n\t\t\t\tgetBlockHierarchyRootClientId( clientId );\n\n\t\t\tconst globalStylesBaseStyles =\n\t\t\t\tgetSettings()?.__experimentalGlobalStylesBaseStyles;\n\n\t\t\treturn {\n\t\t\t\tbaseGlobalStyles: globalStylesBaseStyles,\n\t\t\t\tblockCategory: currentBlockCategory,\n\t\t\t\tblockType: currentBlockType,\n\t\t\t\tdraggingClientId: currentDraggingClientId,\n\t\t\t\tdraggingEnabled: isDraggingEnabled,\n\t\t\t\thasInnerBlocks: blockHasInnerBlocks,\n\t\t\t\tisDescendantOfParentSelected: descendantOfParentSelected,\n\t\t\t\tisDescendentBlockSelected: descendentBlockSelected,\n\t\t\t\tisParentSelected: parentSelected,\n\t\t\t\torder: blockOrder,\n\t\t\t};\n\t\t},\n\t\t[ clientId, isSelected, name, rootClientId ]\n\t);\n\tconst { removeBlock, selectBlock } = useDispatch( blockEditorStore );\n\tconst initialBlockWidth = blockWrapperWidth - 2 * marginHorizontal;\n\tconst [ blockWidth, setBlockWidth ] = useState( initialBlockWidth );\n\tconst parentLayout = useLayout() || {};\n\tconst defaultColors = useMobileGlobalStylesColors();\n\tconst globalStyle = useGlobalStyles();\n\tconst fontSizes = useSetting( 'typography.fontSizes' ) || emptyArray;\n\n\tconst onRemove = useCallback(\n\t\t() => removeBlock( clientId ),\n\t\t[ clientId, removeBlock ]\n\t);\n\tconst onFocus = useCallback( () => {\n\t\tif ( ! isSelected ) {\n\t\t\tselectBlock( clientId );\n\t\t}\n\t}, [ selectBlock, clientId, isSelected ] );\n\n\tconst onLayout = useCallback(\n\t\t( { nativeEvent } ) => {\n\t\t\tconst layoutWidth = Math.floor( nativeEvent.layout.width );\n\n\t\t\tif ( ! blockWidth || ! layoutWidth ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( blockWidth !== layoutWidth ) {\n\t\t\t\tsetBlockWidth( layoutWidth );\n\t\t\t}\n\t\t},\n\t\t[ blockWidth, setBlockWidth ]\n\t);\n\n\t// Block level styles.\n\tconst wrapperProps = getWrapperProps(\n\t\tattributes,\n\t\tblockType.getEditWrapperProps\n\t);\n\n\t// Inherited styles merged with block level styles.\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\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [\n\t\t// It is crucial to keep the dependencies array minimal to prevent unnecessary calls that could negatively impact performance.\n\t\t// JSON.stringify is used for the following purposes:\n\t\t// 1. To create a single, comparable value from the globalStyle, wrapperProps.style, and attributes objects. This allows useMemo to\n\t\t// efficiently determine if a change has occurred in any of these objects.\n\t\t// 2. To filter the attributes object, ensuring that only the relevant attributes (included in\n\t\t// GlobalStylesContext.BLOCK_STYLE_ATTRIBUTES) are considered as dependencies. This reduces the likelihood of\n\t\t// unnecessary useMemo calls when other, unrelated attributes change.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\tJSON.stringify( globalStyle ),\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\tJSON.stringify( wrapperProps.style ),\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\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 isFocused = isSelected || isDescendentBlockSelected;\n\tconst isTouchable =\n\t\tisSelected ||\n\t\tisDescendantOfParentSelected ||\n\t\tisParentSelected ||\n\t\t! rootClientId;\n\n\tconst accessibilityLabel = getAccessibleBlockLabel(\n\t\tblockType,\n\t\tattributes,\n\t\torder + 1\n\t);\n\n\treturn (\n\t\t<BlockWrapper\n\t\t\taccessibilityLabel={ accessibilityLabel }\n\t\t\tblockCategory={ blockCategory }\n\t\t\tclientId={ clientId }\n\t\t\tdraggingClientId={ draggingClientId }\n\t\t\tdraggingEnabled={ draggingEnabled }\n\t\t\thasInnerBlocks={ hasInnerBlocks }\n\t\t\tisDescendentBlockSelected={ isDescendentBlockSelected }\n\t\t\tisFocused={ isFocused }\n\t\t\tisRootList={ ! rootClientId }\n\t\t\tisSelected={ isSelected }\n\t\t\tisStackedHorizontally={ isStackedHorizontally }\n\t\t\tisTouchable={ isTouchable }\n\t\t\tmarginHorizontal={ marginHorizontal }\n\t\t\tmarginVertical={ marginVertical }\n\t\t\tname={ name }\n\t\t\tonFocus={ onFocus }\n\t\t>\n\t\t\t{ () =>\n\t\t\t\t! isValid ? (\n\t\t\t\t\t<BlockInvalidWarning clientId={ clientId } />\n\t\t\t\t) : (\n\t\t\t\t\t<GlobalStylesContext.Provider value={ mergedStyle }>\n\t\t\t\t\t\t<BlockEdit\n\t\t\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\t\t\tblockWidth={ blockWidth }\n\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t\tcontentStyle={ contentStyle }\n\t\t\t\t\t\t\tinsertBlocksAfter={\n\t\t\t\t\t\t\t\tisLocked ? undefined : onInsertBlocksAfter\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\t\tisSelectionEnabled={ isSelectionEnabled }\n\t\t\t\t\t\t\tmergeBlocks={ canRemove ? onMerge : undefined }\n\t\t\t\t\t\t\tname={ name }\n\t\t\t\t\t\t\tonDeleteBlock={ onDeleteBlock }\n\t\t\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\t\t\tonRemove={ canRemove ? onRemove : undefined }\n\t\t\t\t\t\t\tonReplace={ canRemove ? onReplace : undefined }\n\t\t\t\t\t\t\tparentBlockAlignment={ parentBlockAlignment }\n\t\t\t\t\t\t\tparentWidth={ parentWidth }\n\t\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\t\tstyle={ mergedStyle }\n\t\t\t\t\t\t\ttoggleSelection={ toggleSelection }\n\t\t\t\t\t\t\t__unstableParentLayout={\n\t\t\t\t\t\t\t\tObject.keys( parentLayout ).length\n\t\t\t\t\t\t\t\t\t? parentLayout\n\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\twrapperProps={ wrapperProps }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<View onLayout={ onLayout } />\n\t\t\t\t\t</GlobalStylesContext.Provider>\n\t\t\t\t)\n\t\t\t}\n\t\t</BlockWrapper>\n\t);\n}\n\nconst applyWithSelect = withSelect( ( select, { clientId, rootClientId } ) => {\n\tconst {\n\t\tisBlockSelected,\n\t\tgetBlockMode,\n\t\tisSelectionEnabled,\n\t\tgetTemplateLock,\n\t\t__unstableGetBlockWithoutInnerBlocks,\n\t\tcanRemoveBlock,\n\t\tcanMoveBlock,\n\t} = select( blockEditorStore );\n\tconst block = __unstableGetBlockWithoutInnerBlocks( clientId );\n\tconst isSelected = isBlockSelected( clientId );\n\tconst templateLock = getTemplateLock( rootClientId );\n\tconst canRemove = canRemoveBlock( clientId, rootClientId );\n\tconst canMove = canMoveBlock( clientId, rootClientId );\n\n\t// The fallback to `{}` is a temporary fix.\n\t// This function should never be called when a block is not present in\n\t// the state. It happens now because the order in withSelect rendering\n\t// is not correct.\n\tconst { name, attributes, isValid } = block || {};\n\n\t// Do not add new properties here, use `useSelect` instead to avoid\n\t// leaking new props to the public API (editor.BlockListBlock filter).\n\treturn {\n\t\tmode: getBlockMode( clientId ),\n\t\tisSelectionEnabled: isSelectionEnabled(),\n\t\tisLocked: !! templateLock,\n\t\tcanRemove,\n\t\tcanMove,\n\t\t// Users of the editor.BlockListBlock filter used to be able to\n\t\t// access the block prop.\n\t\t// Ideally these blocks would rely on the clientId prop only.\n\t\t// This is kept for backward compatibility reasons.\n\t\tblock,\n\t\tname,\n\t\tattributes,\n\t\tisValid,\n\t\tisSelected,\n\t};\n} );\n\nconst applyWithDispatch = withDispatch( ( dispatch, ownProps, registry ) => {\n\tconst {\n\t\tupdateBlockAttributes,\n\t\tinsertBlocks,\n\t\tmergeBlocks,\n\t\treplaceBlocks,\n\t\ttoggleSelection,\n\t\t__unstableMarkLastChangeAsPersistent,\n\t\tmoveBlocksToPosition,\n\t\tremoveBlock,\n\t} = dispatch( blockEditorStore );\n\n\t// Do not add new properties here, use `useDispatch` instead to avoid\n\t// leaking new props to the public API (editor.BlockListBlock filter).\n\treturn {\n\t\tsetAttributes( newAttributes ) {\n\t\t\tconst { getMultiSelectedBlockClientIds } =\n\t\t\t\tregistry.select( blockEditorStore );\n\t\t\tconst multiSelectedBlockClientIds =\n\t\t\t\tgetMultiSelectedBlockClientIds();\n\t\t\tconst { clientId } = ownProps;\n\t\t\tconst clientIds = multiSelectedBlockClientIds.length\n\t\t\t\t? multiSelectedBlockClientIds\n\t\t\t\t: [ clientId ];\n\n\t\t\tupdateBlockAttributes( clientIds, newAttributes );\n\t\t},\n\t\tonInsertBlocks( blocks, index ) {\n\t\t\tconst { rootClientId } = ownProps;\n\t\t\tinsertBlocks( blocks, index, rootClientId );\n\t\t},\n\t\tonInsertBlocksAfter( blocks ) {\n\t\t\tconst { clientId, rootClientId } = ownProps;\n\t\t\tconst { getBlockIndex } = registry.select( blockEditorStore );\n\t\t\tconst index = getBlockIndex( clientId );\n\t\t\tinsertBlocks( blocks, index + 1, rootClientId );\n\t\t},\n\t\tonMerge( forward ) {\n\t\t\tconst { clientId, rootClientId } = ownProps;\n\t\t\tconst {\n\t\t\t\tgetPreviousBlockClientId,\n\t\t\t\tgetNextBlockClientId,\n\t\t\t\tgetBlock,\n\t\t\t\tgetBlockAttributes,\n\t\t\t\tgetBlockName,\n\t\t\t\tgetBlockOrder,\n\t\t\t\tgetBlockIndex,\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\tcanInsertBlockType,\n\t\t\t} = registry.select( blockEditorStore );\n\n\t\t\t/**\n\t\t\t * Moves the block with clientId up one level. If the block type\n\t\t\t * cannot be inserted at the new location, it will be attempted to\n\t\t\t * convert to the default block type.\n\t\t\t *\n\t\t\t * @param {string} _clientId The block to move.\n\t\t\t * @param {boolean} changeSelection Whether to change the selection\n\t\t\t * to the moved block.\n\t\t\t */\n\t\t\tfunction moveFirstItemUp( _clientId, changeSelection = true ) {\n\t\t\t\tconst targetRootClientId = getBlockRootClientId( _clientId );\n\t\t\t\tconst blockOrder = getBlockOrder( _clientId );\n\t\t\t\tconst [ firstClientId ] = blockOrder;\n\n\t\t\t\tif (\n\t\t\t\t\tblockOrder.length === 1 &&\n\t\t\t\t\tisUnmodifiedBlock( getBlock( firstClientId ) )\n\t\t\t\t) {\n\t\t\t\t\tremoveBlock( _clientId );\n\t\t\t\t} else {\n\t\t\t\t\tregistry.batch( () => {\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\tinsertBlocks(\n\t\t\t\t\t\t\t\t\treplacement,\n\t\t\t\t\t\t\t\t\tgetBlockIndex( _clientId ),\n\t\t\t\t\t\t\t\t\ttargetRootClientId,\n\t\t\t\t\t\t\t\t\tchangeSelection\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tremoveBlock( firstClientId, false );\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\t\t\t}\n\n\t\t\t// For `Delete` or forward merge, we should do the exact same thing\n\t\t\t// as `Backspace`, but from the other block.\n\t\t\tif ( forward ) {\n\t\t\t\tif ( rootClientId ) {\n\t\t\t\t\tconst nextRootClientId =\n\t\t\t\t\t\tgetNextBlockClientId( rootClientId );\n\n\t\t\t\t\tif ( nextRootClientId ) {\n\t\t\t\t\t\t// If there is a block that follows with the same parent\n\t\t\t\t\t\t// block name and the same attributes, merge the inner\n\t\t\t\t\t\t// blocks.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tgetBlockName( rootClientId ) ===\n\t\t\t\t\t\t\tgetBlockName( nextRootClientId )\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( nextRootClientId );\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( nextRootClientId ),\n\t\t\t\t\t\t\t\t\t\tnextRootClientId,\n\t\t\t\t\t\t\t\t\t\trootClientId\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tremoveBlock( nextRootClientId, 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} else {\n\t\t\t\t\t\t\tmergeBlocks( rootClientId, nextRootClientId );\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst nextBlockClientId = getNextBlockClientId( clientId );\n\n\t\t\t\tif ( ! nextBlockClientId ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( getBlockOrder( nextBlockClientId ).length ) {\n\t\t\t\t\tmoveFirstItemUp( nextBlockClientId, false );\n\t\t\t\t} else {\n\t\t\t\t\tmergeBlocks( clientId, nextBlockClientId );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst previousBlockClientId =\n\t\t\t\t\tgetPreviousBlockClientId( clientId );\n\n\t\t\t\tif ( previousBlockClientId ) {\n\t\t\t\t\tmergeBlocks( previousBlockClientId, clientId );\n\t\t\t\t} else if ( rootClientId ) {\n\t\t\t\t\tconst previousRootClientId =\n\t\t\t\t\t\tgetPreviousBlockClientId( rootClientId );\n\n\t\t\t\t\t// If there is a preceding block with the same parent block\n\t\t\t\t\t// name and the same attributes, merge the inner blocks.\n\t\t\t\t\tif (\n\t\t\t\t\t\tpreviousRootClientId &&\n\t\t\t\t\t\tgetBlockName( rootClientId ) ===\n\t\t\t\t\t\t\tgetBlockName( previousRootClientId )\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst rootAttributes =\n\t\t\t\t\t\t\tgetBlockAttributes( rootClientId );\n\t\t\t\t\t\tconst previousRootAttributes =\n\t\t\t\t\t\t\tgetBlockAttributes( previousRootClientId );\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tObject.keys( rootAttributes ).every(\n\t\t\t\t\t\t\t\t( key ) =>\n\t\t\t\t\t\t\t\t\trootAttributes[ key ] ===\n\t\t\t\t\t\t\t\t\tpreviousRootAttributes[ key ]\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tregistry.batch( () => {\n\t\t\t\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\t\t\t\tgetBlockOrder( rootClientId ),\n\t\t\t\t\t\t\t\t\trootClientId,\n\t\t\t\t\t\t\t\t\tpreviousRootClientId\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tremoveBlock( rootClientId, false );\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tmoveFirstItemUp( rootClientId );\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tonReplace( blocks, indexToSelect, initialPosition ) {\n\t\t\tif (\n\t\t\t\tblocks.length &&\n\t\t\t\t! isUnmodifiedDefaultBlock( blocks[ blocks.length - 1 ] )\n\t\t\t) {\n\t\t\t\t__unstableMarkLastChangeAsPersistent();\n\t\t\t}\n\t\t\treplaceBlocks(\n\t\t\t\t[ ownProps.clientId ],\n\t\t\t\tblocks,\n\t\t\t\tindexToSelect,\n\t\t\t\tinitialPosition\n\t\t\t);\n\t\t},\n\t\ttoggleSelection( selectionEnabled ) {\n\t\t\ttoggleSelection( selectionEnabled );\n\t\t},\n\t};\n} );\n\nexport default compose(\n\tpure,\n\tapplyWithSelect,\n\tapplyWithDispatch,\n\t// Block is sometimes not mounted at the right time, causing it be undefined\n\t// see issue for more info\n\t// https://github.com/WordPress/gutenberg/issues/17013\n\tifCondition( ( { block } ) => !! block )\n)( BlockListBlock );\n"],"mappings":";;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAMA,IAAAG,OAAA,GAAAH,OAAA;AAQA,IAAAI,KAAA,GAAAJ,OAAA;AAMA,IAAAK,QAAA,GAAAL,OAAA;AAKA,IAAAM,UAAA,GAAAC,sBAAA,CAAAP,OAAA;AACA,IAAAQ,eAAA,GAAAD,sBAAA,CAAAP,OAAA;AACA,IAAAS,oBAAA,GAAAF,sBAAA,CAAAP,OAAA;AACA,IAAAU,aAAA,GAAAH,sBAAA,CAAAP,OAAA;AACA,IAAAW,MAAA,GAAAX,OAAA;AACA,IAAAY,OAAA,GAAAZ,OAAA;AACA,IAAAa,WAAA,GAAAN,sBAAA,CAAAP,OAAA;AAxCA;AACA;AACA;;AAGA;AACA;AACA;;AAwBA;AACA;AACA;;AASA,MAAMc,UAAU,GAAG,EAAE;;AAErB;AACA,MAAMC,iBAAiB,GAAG,IAAIC,OAAO,CAAC,CAAC;AACvC,MAAMC,QAAQ,GAAG,CAAC,CAAC;AACnB,SAASC,eAAeA,CAAEC,KAAK,EAAEC,uBAAuB,EAAG;EAC1D,IAAK,CAAEA,uBAAuB,EAAG;IAChC,OAAOH,QAAQ;EAChB;EACA,MAAMI,WAAW,GAAGN,iBAAiB,CAACO,GAAG,CAAEH,KAAM,CAAC;EAClD,IAAK,CAAEE,WAAW,EAAG;IACpB,MAAME,YAAY,GAAGH,uBAAuB,CAAED,KAAM,CAAC;IACrDJ,iBAAiB,CAACS,GAAG,CAAEL,KAAK,EAAEI,YAAa,CAAC;IAC5C,OAAOA,YAAY;EACpB;EACA,OAAOF,WAAW;AACnB;AAEA,SAASI,YA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ACJ8D,cAAc,CAAE9D,GAAG,CAAE,KACrB+D,sBAAsB,CAAE/D,GAAG,CAC7B,CAAC,EACA;cACD6B,QAAQ,CAAC4B,KAAK,CAAE,MAAM;gBACrBvB,oBAAoB,CACnBc,aAAa,CAAEpH,YAAa,CAAC,EAC7BA,YAAY,EACZuI,oBACD,CAAC;gBACDpG,WAAW,CAAEnC,YAAY,EAAE,KAAM,CAAC;cACnC,CAAE,CAAC;cACH;YACD;UACD;UAEAuH,eAAe,CAAEvH,YAAa,CAAC;QAChC;MACD;IACD,CAAC;IACDH,SAASA,CAAE+G,MAAM,EAAE4B,aAAa,EAAEC,eAAe,EAAG;MACnD,IACC7B,MAAM,CAAC7B,MAAM,IACb,CAAE,IAAA2D,gCAAwB,EAAE9B,MAAM,CAAEA,MAAM,CAAC7B,MAAM,GAAG,CAAC,CAAG,CAAC,EACxD;QACDsB,oCAAoC,CAAC,CAAC;MACvC;MACAD,aAAa,CACZ,CAAEJ,QAAQ,CAAC1I,QAAQ,CAAE,EACrBsJ,MAAM,EACN4B,aAAa,EACbC,eACD,CAAC;IACF,CAAC;IACDvI,eAAeA,CAAEyI,gBAAgB,EAAG;MACnCzI,eAAe,CAAEyI,gBAAiB,CAAC;IACpC;EACD,CAAC;AACF,CAAE,CAAC;AAAC,IAAAC,QAAA,GAEW,IAAAC,gBAAO,EACrBC,aAAI,EACJ7D,eAAe,EACfY,iBAAiB;AACjB;AACA;AACA;AACA,IAAAkD,oBAAW,EAAE,CAAE;EAAEtD;AAAM,CAAC,KAAM,CAAC,CAAEA,KAAM,CACxC,CAAC,CAAEzG,cAAe,CAAC;AAAAgK,OAAA,CAAAnK,OAAA,GAAA+J,QAAA"}
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_element","_components","_blocks","_data","_compose","_blockEdit","_interopRequireDefault","_blockDraggable","_blockInvalidWarning","_blockOutline","_store","_layout","_useSettings","EMPTY_ARRAY","wrapperPropsCache","WeakMap","emptyObj","getWrapperProps","value","getWrapperPropsFunction","cachedValue","get","wrapperProps","set","BlockWrapper","accessibilityLabel","blockCategory","children","clientId","draggingClientId","draggingEnabled","hasInnerBlocks","isDescendentBlockSelected","isRootList","isSelected","isTouchable","marginHorizontal","marginVertical","name","onFocus","blockWrapperStyles","flex","blockWrapperStyle","accessible","_react","createElement","Pressable","accessibilityRole","disabled","onPress","style","default","enabled","testID","BlockListBlock","attributes","blockWidth","blockWrapperWidth","canRemove","contentStyle","isLocked","isSelectionEnabled","isStackedHorizontally","isValid","onDeleteBlock","onInsertBlocksAfter","onMerge","onReplace","parentBlockAlignment","parentWidth","rootClientId","setAttributes","toggleSelection","baseGlobalStyles","blockType","isDescendantOfParentSelected","isParentSelected","order","useSelect","select","getBlockCount","getBlockHierarchyRootClientId","getBlockIndex","getBlockParents","getSelectedBlockClientId","getSettings","hasSelectedInnerBlock","blockEditorStore","currentBlockType","getBlockType","currentBlockCategory","category","blockOrder","descendentBlockSelected","selectedBlockClientId","parents","parentSelected","selectedParents","descendantOfParentSelected","includes","blockHasInnerBlocks","isDraggingEnabled","currentDraggingClientId","globalStylesBaseStyles","__experimentalGlobalStylesBaseStyles","removeBlock","selectBlock","useDispatch","initialBlockWidth","setBlockWidth","useState","parentLayout","useLayout","defaultColors","useMobileGlobalStylesColors","globalStyle","useGlobalStyles","fontSizes","useSettings","onRemove","useCallback","onLayout","nativeEvent","layoutWidth","Math","floor","layout","width","getEditWrapperProps","mergedStyle","useMemo","getMergedGlobalStyles","JSON","stringify","Object","fromEntries","entries","filter","key","GlobalStylesContext","BLOCK_STYLE_ATTRIBUTES","isFocused","getAccessibleBlockLabel","Provider","insertBlocksAfter","undefined","mergeBlocks","__unstableParentLayout","keys","length","View","applyWithSelect","withSelect","isBlockSelected","getBlockMode","getTemplateLock","__unstableGetBlockWithoutInnerBlocks","canRemoveBlock","canMoveBlock","block","templateLock","canMove","mode","applyWithDispatch","withDispatch","dispatch","ownProps","registry","updateBlockAttributes","insertBlocks","replaceBlocks","__unstableMarkLastChangeAsPersistent","moveBlocksToPosition","newAttributes","getMultiSelectedBlockClientIds","multiSelectedBlockClientIds","clientIds","onInsertBlocks","blocks","index","forward","getPreviousBlockClientId","getNextBlockClientId","getBlock","getBlockAttributes","getBlockName","getBlockOrder","getBlockRootClientId","canInsertBlockType","moveFirstItemUp","_clientId","changeSelection","targetRootClientId","firstClientId","isUnmodifiedBlock","batch","replacement","switchToBlockType","getDefaultBlockName","nextRootClientId","rootAttributes","previousRootAttributes","every","nextBlockClientId","previousBlockClientId","previousRootClientId","indexToSelect","initialPosition","isUnmodifiedDefaultBlock","selectionEnabled","_default","compose","pure","ifCondition","exports"],"sources":["@wordpress/block-editor/src/components/block-list/block.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { Pressable, View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { useCallback, useMemo, useState } from '@wordpress/element';\nimport {\n\tGlobalStylesContext,\n\tgetMergedGlobalStyles,\n\tuseMobileGlobalStylesColors,\n\tuseGlobalStyles,\n} from '@wordpress/components';\nimport {\n\t__experimentalGetAccessibleBlockLabel as getAccessibleBlockLabel,\n\tgetBlockType,\n\tgetDefaultBlockName,\n\tisUnmodifiedBlock,\n\tisUnmodifiedDefaultBlock,\n\tswitchToBlockType,\n} from '@wordpress/blocks';\nimport {\n\tuseDispatch,\n\tuseSelect,\n\twithDispatch,\n\twithSelect,\n} from '@wordpress/data';\nimport { compose, ifCondition, pure } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BlockEdit from '../block-edit';\nimport BlockDraggable from '../block-draggable';\nimport BlockInvalidWarning from './block-invalid-warning';\nimport BlockOutline from './block-outline';\nimport { store as blockEditorStore } from '../../store';\nimport { useLayout } from './layout';\nimport { useSettings } from '../use-settings';\n\nconst EMPTY_ARRAY = [];\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\nfunction BlockWrapper( {\n\taccessibilityLabel,\n\tblockCategory,\n\tchildren,\n\tclientId,\n\tdraggingClientId,\n\tdraggingEnabled,\n\thasInnerBlocks,\n\tisDescendentBlockSelected,\n\tisRootList,\n\tisSelected,\n\tisTouchable,\n\tmarginHorizontal,\n\tmarginVertical,\n\tname,\n\tonFocus,\n} ) {\n\tconst blockWrapperStyles = { flex: 1 };\n\tconst blockWrapperStyle = [\n\t\tblockWrapperStyles,\n\t\t{\n\t\t\tmarginVertical,\n\t\t\tmarginHorizontal,\n\t\t},\n\t];\n\tconst accessible = ! ( isSelected || isDescendentBlockSelected );\n\n\treturn (\n\t\t<Pressable\n\t\t\taccessibilityLabel={ accessibilityLabel }\n\t\t\taccessibilityRole=\"button\"\n\t\t\taccessible={ accessible }\n\t\t\tdisabled={ ! isTouchable }\n\t\t\tonPress={ onFocus }\n\t\t\tstyle={ blockWrapperStyle }\n\t\t>\n\t\t\t<BlockOutline\n\t\t\t\tblockCategory={ blockCategory }\n\t\t\t\thasInnerBlocks={ hasInnerBlocks }\n\t\t\t\tisRootList={ isRootList }\n\t\t\t\tisSelected={ isSelected }\n\t\t\t\tname={ name }\n\t\t\t/>\n\t\t\t<BlockDraggable\n\t\t\t\tclientId={ clientId }\n\t\t\t\tdraggingClientId={ draggingClientId }\n\t\t\t\tenabled={ draggingEnabled }\n\t\t\t\ttestID=\"draggable-trigger-content\"\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</BlockDraggable>\n\t\t</Pressable>\n\t);\n}\n\nfunction BlockListBlock( {\n\tattributes,\n\tblockWidth: blockWrapperWidth,\n\tcanRemove,\n\tclientId,\n\tcontentStyle,\n\tisLocked,\n\tisSelected,\n\tisSelectionEnabled,\n\tisStackedHorizontally,\n\tisValid,\n\tmarginHorizontal,\n\tmarginVertical,\n\tname,\n\tonDeleteBlock,\n\tonInsertBlocksAfter,\n\tonMerge,\n\tonReplace,\n\tparentBlockAlignment,\n\tparentWidth,\n\trootClientId,\n\tsetAttributes,\n\ttoggleSelection,\n} ) {\n\tconst {\n\t\tbaseGlobalStyles,\n\t\tblockCategory,\n\t\tblockType,\n\t\tdraggingClientId,\n\t\tdraggingEnabled,\n\t\thasInnerBlocks,\n\t\tisDescendantOfParentSelected,\n\t\tisDescendentBlockSelected,\n\t\tisParentSelected,\n\t\torder,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockCount,\n\t\t\t\tgetBlockHierarchyRootClientId,\n\t\t\t\tgetBlockIndex,\n\t\t\t\tgetBlockParents,\n\t\t\t\tgetSelectedBlockClientId,\n\t\t\t\tgetSettings,\n\t\t\t\thasSelectedInnerBlock,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst currentBlockType = getBlockType( name || 'core/missing' );\n\t\t\tconst currentBlockCategory = currentBlockType?.category;\n\t\t\tconst blockOrder = getBlockIndex( clientId );\n\t\t\tconst descendentBlockSelected = hasSelectedInnerBlock(\n\t\t\t\tclientId,\n\t\t\t\ttrue\n\t\t\t);\n\t\t\tconst selectedBlockClientId = getSelectedBlockClientId();\n\n\t\t\tconst parents = getBlockParents( clientId, true );\n\t\t\tconst parentSelected =\n\t\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\t( selectedBlockClientId || false ) &&\n\t\t\t\tselectedBlockClientId === rootClientId;\n\n\t\t\tconst selectedParents = clientId ? parents : [];\n\t\t\tconst descendantOfParentSelected =\n\t\t\t\tselectedParents.includes( rootClientId );\n\t\t\tconst blockHasInnerBlocks = getBlockCount( clientId ) > 0;\n\n\t\t\t// For blocks with inner blocks, we only enable the dragging in the nested\n\t\t\t// blocks if any of them are selected. This way we prevent the long-press\n\t\t\t// gesture from being disabled for elements within the block UI.\n\t\t\tconst isDraggingEnabled =\n\t\t\t\t! blockHasInnerBlocks ||\n\t\t\t\tisSelected ||\n\t\t\t\t! descendentBlockSelected;\n\t\t\t// Dragging nested blocks is not supported yet. For this reason, the block to be dragged\n\t\t\t// will be the top in the hierarchy.\n\t\t\tconst currentDraggingClientId =\n\t\t\t\tgetBlockHierarchyRootClientId( clientId );\n\n\t\t\tconst globalStylesBaseStyles =\n\t\t\t\tgetSettings()?.__experimentalGlobalStylesBaseStyles;\n\n\t\t\treturn {\n\t\t\t\tbaseGlobalStyles: globalStylesBaseStyles,\n\t\t\t\tblockCategory: currentBlockCategory,\n\t\t\t\tblockType: currentBlockType,\n\t\t\t\tdraggingClientId: currentDraggingClientId,\n\t\t\t\tdraggingEnabled: isDraggingEnabled,\n\t\t\t\thasInnerBlocks: blockHasInnerBlocks,\n\t\t\t\tisDescendantOfParentSelected: descendantOfParentSelected,\n\t\t\t\tisDescendentBlockSelected: descendentBlockSelected,\n\t\t\t\tisParentSelected: parentSelected,\n\t\t\t\torder: blockOrder,\n\t\t\t};\n\t\t},\n\t\t[ clientId, isSelected, name, rootClientId ]\n\t);\n\tconst { removeBlock, selectBlock } = useDispatch( blockEditorStore );\n\tconst initialBlockWidth = blockWrapperWidth - 2 * marginHorizontal;\n\tconst [ blockWidth, setBlockWidth ] = useState( initialBlockWidth );\n\tconst parentLayout = useLayout() || {};\n\tconst defaultColors = useMobileGlobalStylesColors();\n\tconst globalStyle = useGlobalStyles();\n\tconst [ fontSizes ] = useSettings( 'typography.fontSizes' );\n\n\tconst onRemove = useCallback(\n\t\t() => removeBlock( clientId ),\n\t\t[ clientId, removeBlock ]\n\t);\n\tconst onFocus = useCallback( () => {\n\t\tif ( ! isSelected ) {\n\t\t\tselectBlock( clientId );\n\t\t}\n\t}, [ selectBlock, clientId, isSelected ] );\n\n\tconst onLayout = useCallback(\n\t\t( { nativeEvent } ) => {\n\t\t\tconst layoutWidth = Math.floor( nativeEvent.layout.width );\n\n\t\t\tif ( ! blockWidth || ! layoutWidth ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( blockWidth !== layoutWidth ) {\n\t\t\t\tsetBlockWidth( layoutWidth );\n\t\t\t}\n\t\t},\n\t\t[ blockWidth, setBlockWidth ]\n\t);\n\n\t// Block level styles.\n\tconst wrapperProps = getWrapperProps(\n\t\tattributes,\n\t\tblockType.getEditWrapperProps\n\t);\n\n\t// Inherited styles merged with block level styles.\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 || EMPTY_ARRAY\n\t\t);\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [\n\t\t// It is crucial to keep the dependencies array minimal to prevent unnecessary calls that could negatively impact performance.\n\t\t// JSON.stringify is used for the following purposes:\n\t\t// 1. To create a single, comparable value from the globalStyle, wrapperProps.style, and attributes objects. This allows useMemo to\n\t\t// efficiently determine if a change has occurred in any of these objects.\n\t\t// 2. To filter the attributes object, ensuring that only the relevant attributes (included in\n\t\t// GlobalStylesContext.BLOCK_STYLE_ATTRIBUTES) are considered as dependencies. This reduces the likelihood of\n\t\t// unnecessary useMemo calls when other, unrelated attributes change.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\tJSON.stringify( globalStyle ),\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\tJSON.stringify( wrapperProps.style ),\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\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 isFocused = isSelected || isDescendentBlockSelected;\n\tconst isTouchable =\n\t\tisSelected ||\n\t\tisDescendantOfParentSelected ||\n\t\tisParentSelected ||\n\t\t! rootClientId;\n\n\tconst accessibilityLabel = getAccessibleBlockLabel(\n\t\tblockType,\n\t\tattributes,\n\t\torder + 1\n\t);\n\n\treturn (\n\t\t<BlockWrapper\n\t\t\taccessibilityLabel={ accessibilityLabel }\n\t\t\tblockCategory={ blockCategory }\n\t\t\tclientId={ clientId }\n\t\t\tdraggingClientId={ draggingClientId }\n\t\t\tdraggingEnabled={ draggingEnabled }\n\t\t\thasInnerBlocks={ hasInnerBlocks }\n\t\t\tisDescendentBlockSelected={ isDescendentBlockSelected }\n\t\t\tisFocused={ isFocused }\n\t\t\tisRootList={ ! rootClientId }\n\t\t\tisSelected={ isSelected }\n\t\t\tisStackedHorizontally={ isStackedHorizontally }\n\t\t\tisTouchable={ isTouchable }\n\t\t\tmarginHorizontal={ marginHorizontal }\n\t\t\tmarginVertical={ marginVertical }\n\t\t\tname={ name }\n\t\t\tonFocus={ onFocus }\n\t\t>\n\t\t\t{ () =>\n\t\t\t\t! isValid ? (\n\t\t\t\t\t<BlockInvalidWarning clientId={ clientId } />\n\t\t\t\t) : (\n\t\t\t\t\t<GlobalStylesContext.Provider value={ mergedStyle }>\n\t\t\t\t\t\t<BlockEdit\n\t\t\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\t\t\tblockWidth={ blockWidth }\n\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t\tcontentStyle={ contentStyle }\n\t\t\t\t\t\t\tinsertBlocksAfter={\n\t\t\t\t\t\t\t\tisLocked ? undefined : onInsertBlocksAfter\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\t\tisSelectionEnabled={ isSelectionEnabled }\n\t\t\t\t\t\t\tmergeBlocks={ canRemove ? onMerge : undefined }\n\t\t\t\t\t\t\tname={ name }\n\t\t\t\t\t\t\tonDeleteBlock={ onDeleteBlock }\n\t\t\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\t\t\tonRemove={ canRemove ? onRemove : undefined }\n\t\t\t\t\t\t\tonReplace={ canRemove ? onReplace : undefined }\n\t\t\t\t\t\t\tparentBlockAlignment={ parentBlockAlignment }\n\t\t\t\t\t\t\tparentWidth={ parentWidth }\n\t\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\t\tstyle={ mergedStyle }\n\t\t\t\t\t\t\ttoggleSelection={ toggleSelection }\n\t\t\t\t\t\t\t__unstableParentLayout={\n\t\t\t\t\t\t\t\tObject.keys( parentLayout ).length\n\t\t\t\t\t\t\t\t\t? parentLayout\n\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\twrapperProps={ wrapperProps }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<View onLayout={ onLayout } />\n\t\t\t\t\t</GlobalStylesContext.Provider>\n\t\t\t\t)\n\t\t\t}\n\t\t</BlockWrapper>\n\t);\n}\n\nconst applyWithSelect = withSelect( ( select, { clientId, rootClientId } ) => {\n\tconst {\n\t\tisBlockSelected,\n\t\tgetBlockMode,\n\t\tisSelectionEnabled,\n\t\tgetTemplateLock,\n\t\t__unstableGetBlockWithoutInnerBlocks,\n\t\tcanRemoveBlock,\n\t\tcanMoveBlock,\n\t} = select( blockEditorStore );\n\tconst block = __unstableGetBlockWithoutInnerBlocks( clientId );\n\tconst isSelected = isBlockSelected( clientId );\n\tconst templateLock = getTemplateLock( rootClientId );\n\tconst canRemove = canRemoveBlock( clientId, rootClientId );\n\tconst canMove = canMoveBlock( clientId, rootClientId );\n\n\t// The fallback to `{}` is a temporary fix.\n\t// This function should never be called when a block is not present in\n\t// the state. It happens now because the order in withSelect rendering\n\t// is not correct.\n\tconst { name, attributes, isValid } = block || {};\n\n\t// Do not add new properties here, use `useSelect` instead to avoid\n\t// leaking new props to the public API (editor.BlockListBlock filter).\n\treturn {\n\t\tmode: getBlockMode( clientId ),\n\t\tisSelectionEnabled: isSelectionEnabled(),\n\t\tisLocked: !! templateLock,\n\t\tcanRemove,\n\t\tcanMove,\n\t\t// Users of the editor.BlockListBlock filter used to be able to\n\t\t// access the block prop.\n\t\t// Ideally these blocks would rely on the clientId prop only.\n\t\t// This is kept for backward compatibility reasons.\n\t\tblock,\n\t\tname,\n\t\tattributes,\n\t\tisValid,\n\t\tisSelected,\n\t};\n} );\n\nconst applyWithDispatch = withDispatch( ( dispatch, ownProps, registry ) => {\n\tconst {\n\t\tupdateBlockAttributes,\n\t\tinsertBlocks,\n\t\tmergeBlocks,\n\t\treplaceBlocks,\n\t\ttoggleSelection,\n\t\t__unstableMarkLastChangeAsPersistent,\n\t\tmoveBlocksToPosition,\n\t\tremoveBlock,\n\t} = dispatch( blockEditorStore );\n\n\t// Do not add new properties here, use `useDispatch` instead to avoid\n\t// leaking new props to the public API (editor.BlockListBlock filter).\n\treturn {\n\t\tsetAttributes( newAttributes ) {\n\t\t\tconst { getMultiSelectedBlockClientIds } =\n\t\t\t\tregistry.select( blockEditorStore );\n\t\t\tconst multiSelectedBlockClientIds =\n\t\t\t\tgetMultiSelectedBlockClientIds();\n\t\t\tconst { clientId } = ownProps;\n\t\t\tconst clientIds = multiSelectedBlockClientIds.length\n\t\t\t\t? multiSelectedBlockClientIds\n\t\t\t\t: [ clientId ];\n\n\t\t\tupdateBlockAttributes( clientIds, newAttributes );\n\t\t},\n\t\tonInsertBlocks( blocks, index ) {\n\t\t\tconst { rootClientId } = ownProps;\n\t\t\tinsertBlocks( blocks, index, rootClientId );\n\t\t},\n\t\tonInsertBlocksAfter( blocks ) {\n\t\t\tconst { clientId, rootClientId } = ownProps;\n\t\t\tconst { getBlockIndex } = registry.select( blockEditorStore );\n\t\t\tconst index = getBlockIndex( clientId );\n\t\t\tinsertBlocks( blocks, index + 1, rootClientId );\n\t\t},\n\t\tonMerge( forward ) {\n\t\t\tconst { clientId, rootClientId } = ownProps;\n\t\t\tconst {\n\t\t\t\tgetPreviousBlockClientId,\n\t\t\t\tgetNextBlockClientId,\n\t\t\t\tgetBlock,\n\t\t\t\tgetBlockAttributes,\n\t\t\t\tgetBlockName,\n\t\t\t\tgetBlockOrder,\n\t\t\t\tgetBlockIndex,\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\tcanInsertBlockType,\n\t\t\t} = registry.select( blockEditorStore );\n\n\t\t\t/**\n\t\t\t * Moves the block with clientId up one level. If the block type\n\t\t\t * cannot be inserted at the new location, it will be attempted to\n\t\t\t * convert to the default block type.\n\t\t\t *\n\t\t\t * @param {string} _clientId The block to move.\n\t\t\t * @param {boolean} changeSelection Whether to change the selection\n\t\t\t * to the moved block.\n\t\t\t */\n\t\t\tfunction moveFirstItemUp( _clientId, changeSelection = true ) {\n\t\t\t\tconst targetRootClientId = getBlockRootClientId( _clientId );\n\t\t\t\tconst blockOrder = getBlockOrder( _clientId );\n\t\t\t\tconst [ firstClientId ] = blockOrder;\n\n\t\t\t\tif (\n\t\t\t\t\tblockOrder.length === 1 &&\n\t\t\t\t\tisUnmodifiedBlock( getBlock( firstClientId ) )\n\t\t\t\t) {\n\t\t\t\t\tremoveBlock( _clientId );\n\t\t\t\t} else {\n\t\t\t\t\tregistry.batch( () => {\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\tinsertBlocks(\n\t\t\t\t\t\t\t\t\treplacement,\n\t\t\t\t\t\t\t\t\tgetBlockIndex( _clientId ),\n\t\t\t\t\t\t\t\t\ttargetRootClientId,\n\t\t\t\t\t\t\t\t\tchangeSelection\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tremoveBlock( firstClientId, false );\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\t\t\t}\n\n\t\t\t// For `Delete` or forward merge, we should do the exact same thing\n\t\t\t// as `Backspace`, but from the other block.\n\t\t\tif ( forward ) {\n\t\t\t\tif ( rootClientId ) {\n\t\t\t\t\tconst nextRootClientId =\n\t\t\t\t\t\tgetNextBlockClientId( rootClientId );\n\n\t\t\t\t\tif ( nextRootClientId ) {\n\t\t\t\t\t\t// If there is a block that follows with the same parent\n\t\t\t\t\t\t// block name and the same attributes, merge the inner\n\t\t\t\t\t\t// blocks.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tgetBlockName( rootClientId ) ===\n\t\t\t\t\t\t\tgetBlockName( nextRootClientId )\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( nextRootClientId );\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( nextRootClientId ),\n\t\t\t\t\t\t\t\t\t\tnextRootClientId,\n\t\t\t\t\t\t\t\t\t\trootClientId\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tremoveBlock( nextRootClientId, 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} else {\n\t\t\t\t\t\t\tmergeBlocks( rootClientId, nextRootClientId );\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst nextBlockClientId = getNextBlockClientId( clientId );\n\n\t\t\t\tif ( ! nextBlockClientId ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( getBlockOrder( nextBlockClientId ).length ) {\n\t\t\t\t\tmoveFirstItemUp( nextBlockClientId, false );\n\t\t\t\t} else {\n\t\t\t\t\tmergeBlocks( clientId, nextBlockClientId );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst previousBlockClientId =\n\t\t\t\t\tgetPreviousBlockClientId( clientId );\n\n\t\t\t\tif ( previousBlockClientId ) {\n\t\t\t\t\tmergeBlocks( previousBlockClientId, clientId );\n\t\t\t\t} else if ( rootClientId ) {\n\t\t\t\t\tconst previousRootClientId =\n\t\t\t\t\t\tgetPreviousBlockClientId( rootClientId );\n\n\t\t\t\t\t// If there is a preceding block with the same parent block\n\t\t\t\t\t// name and the same attributes, merge the inner blocks.\n\t\t\t\t\tif (\n\t\t\t\t\t\tpreviousRootClientId &&\n\t\t\t\t\t\tgetBlockName( rootClientId ) ===\n\t\t\t\t\t\t\tgetBlockName( previousRootClientId )\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst rootAttributes =\n\t\t\t\t\t\t\tgetBlockAttributes( rootClientId );\n\t\t\t\t\t\tconst previousRootAttributes =\n\t\t\t\t\t\t\tgetBlockAttributes( previousRootClientId );\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tObject.keys( rootAttributes ).every(\n\t\t\t\t\t\t\t\t( key ) =>\n\t\t\t\t\t\t\t\t\trootAttributes[ key ] ===\n\t\t\t\t\t\t\t\t\tpreviousRootAttributes[ key ]\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tregistry.batch( () => {\n\t\t\t\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\t\t\t\tgetBlockOrder( rootClientId ),\n\t\t\t\t\t\t\t\t\trootClientId,\n\t\t\t\t\t\t\t\t\tpreviousRootClientId\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tremoveBlock( rootClientId, false );\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tmoveFirstItemUp( rootClientId );\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tonReplace( blocks, indexToSelect, initialPosition ) {\n\t\t\tif (\n\t\t\t\tblocks.length &&\n\t\t\t\t! isUnmodifiedDefaultBlock( blocks[ blocks.length - 1 ] )\n\t\t\t) {\n\t\t\t\t__unstableMarkLastChangeAsPersistent();\n\t\t\t}\n\t\t\treplaceBlocks(\n\t\t\t\t[ ownProps.clientId ],\n\t\t\t\tblocks,\n\t\t\t\tindexToSelect,\n\t\t\t\tinitialPosition\n\t\t\t);\n\t\t},\n\t\ttoggleSelection( selectionEnabled ) {\n\t\t\ttoggleSelection( selectionEnabled );\n\t\t},\n\t};\n} );\n\nexport default compose(\n\tpure,\n\tapplyWithSelect,\n\tapplyWithDispatch,\n\t// Block is sometimes not mounted at the right time, causing it be undefined\n\t// see issue for more info\n\t// https://github.com/WordPress/gutenberg/issues/17013\n\tifCondition( ( { block } ) => !! block )\n)( BlockListBlock );\n"],"mappings":";;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAMA,IAAAG,OAAA,GAAAH,OAAA;AAQA,IAAAI,KAAA,GAAAJ,OAAA;AAMA,IAAAK,QAAA,GAAAL,OAAA;AAKA,IAAAM,UAAA,GAAAC,sBAAA,CAAAP,OAAA;AACA,IAAAQ,eAAA,GAAAD,sBAAA,CAAAP,OAAA;AACA,IAAAS,oBAAA,GAAAF,sBAAA,CAAAP,OAAA;AACA,IAAAU,aAAA,GAAAH,sBAAA,CAAAP,OAAA;AACA,IAAAW,MAAA,GAAAX,OAAA;AACA,IAAAY,OAAA,GAAAZ,OAAA;AACA,IAAAa,YAAA,GAAAb,OAAA;AAxCA;AACA;AACA;;AAGA;AACA;AACA;;AAwBA;AACA;AACA;;AASA,MAAMc,WAAW,GAAG,EAAE;;AAEtB;AACA,MAAMC,iBAAiB,GAAG,IAAIC,OAAO,CAAC,CAAC;AACvC,MAAMC,QAAQ,GAAG,CAAC,CAAC;AACnB,SAASC,eAAeA,CAAEC,KAAK,EAAEC,uBAAuB,EAAG;EAC1D,IAAK,CAAEA,uBAAuB,EAAG;IAChC,OAAOH,QAAQ;EAChB;EACA,MAAMI,WAAW,GAAGN,iBAAiB,CAACO,GAAG,CAAEH,KAAM,CAAC;EAClD,IAAK,CAAEE,WAAW,EAAG;IACpB,MAAME,YAAY,GAAGH,uBAAuB,CAAED,KAAM,CAAC;IACrDJ,iBAAiB,CAACS,GAAG,CAAEL,KAAK,EAAEI,YAAa,CAAC;IAC5C,OAAOA,YAAY;EACpB;EACA,OAAOF,WAAW;AACnB;AAEA,SAASI,YAAYA,CAAE;EACtBC,kBAAkB;EAClBC,aA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AG,CAAE,KACrB+D,sBAAsB,CAAE/D,GAAG,CAC7B,CAAC,EACA;cACD6B,QAAQ,CAAC4B,KAAK,CAAE,MAAM;gBACrBvB,oBAAoB,CACnBc,aAAa,CAAEpH,YAAa,CAAC,EAC7BA,YAAY,EACZuI,oBACD,CAAC;gBACDpG,WAAW,CAAEnC,YAAY,EAAE,KAAM,CAAC;cACnC,CAAE,CAAC;cACH;YACD;UACD;UAEAuH,eAAe,CAAEvH,YAAa,CAAC;QAChC;MACD;IACD,CAAC;IACDH,SAASA,CAAE+G,MAAM,EAAE4B,aAAa,EAAEC,eAAe,EAAG;MACnD,IACC7B,MAAM,CAAC7B,MAAM,IACb,CAAE,IAAA2D,gCAAwB,EAAE9B,MAAM,CAAEA,MAAM,CAAC7B,MAAM,GAAG,CAAC,CAAG,CAAC,EACxD;QACDsB,oCAAoC,CAAC,CAAC;MACvC;MACAD,aAAa,CACZ,CAAEJ,QAAQ,CAAC1I,QAAQ,CAAE,EACrBsJ,MAAM,EACN4B,aAAa,EACbC,eACD,CAAC;IACF,CAAC;IACDvI,eAAeA,CAAEyI,gBAAgB,EAAG;MACnCzI,eAAe,CAAEyI,gBAAiB,CAAC;IACpC;EACD,CAAC;AACF,CAAE,CAAC;AAAC,IAAAC,QAAA,GAEW,IAAAC,gBAAO,EACrBC,aAAI,EACJ7D,eAAe,EACfY,iBAAiB;AACjB;AACA;AACA;AACA,IAAAkD,oBAAW,EAAE,CAAE;EAAEtD;AAAM,CAAC,KAAM,CAAC,CAAEA,KAAM,CACxC,CAAC,CAAEzG,cAAe,CAAC;AAAAgK,OAAA,CAAAnK,OAAA,GAAA+J,QAAA"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -11,7 +10,7 @@ exports.useLayout = useLayout;
|
|
|
11
10
|
var _react = require("react");
|
|
12
11
|
var _element = require("@wordpress/element");
|
|
13
12
|
var _layouts = require("../../layouts");
|
|
14
|
-
var
|
|
13
|
+
var _useSettings = require("../use-settings");
|
|
15
14
|
/**
|
|
16
15
|
* WordPress dependencies
|
|
17
16
|
*/
|
|
@@ -44,7 +43,7 @@ function LayoutStyle({
|
|
|
44
43
|
...props
|
|
45
44
|
}) {
|
|
46
45
|
const layoutType = (0, _layouts.getLayoutType)(layout.type);
|
|
47
|
-
const blockGapSupport = (0,
|
|
46
|
+
const [blockGapSupport] = (0, _useSettings.useSettings)('spacing.blockGap');
|
|
48
47
|
const hasBlockGapSupport = blockGapSupport !== null;
|
|
49
48
|
if (layoutType) {
|
|
50
49
|
if (css) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_layouts","
|
|
1
|
+
{"version":3,"names":["_element","require","_layouts","_useSettings","defaultLayout","type","exports","Layout","createContext","LayoutProvider","Provider","useLayout","useContext","LayoutStyle","layout","css","props","layoutType","getLayoutType","blockGapSupport","useSettings","hasBlockGapSupport","_react","createElement","layoutStyle","getLayoutStyle"],"sources":["@wordpress/block-editor/src/components/block-list/layout.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createContext, useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { getLayoutType } from '../../layouts';\nimport { useSettings } from '../use-settings';\n\nexport const defaultLayout = { type: 'default' };\n\nconst Layout = createContext( defaultLayout );\n\n/**\n * Allows to define the layout.\n */\nexport const LayoutProvider = Layout.Provider;\n\n/**\n * React hook used to retrieve the layout config.\n */\nexport function useLayout() {\n\treturn useContext( Layout );\n}\n\nexport function LayoutStyle( { layout = {}, css, ...props } ) {\n\tconst layoutType = getLayoutType( layout.type );\n\tconst [ blockGapSupport ] = useSettings( 'spacing.blockGap' );\n\tconst hasBlockGapSupport = blockGapSupport !== null;\n\n\tif ( layoutType ) {\n\t\tif ( css ) {\n\t\t\treturn <style>{ css }</style>;\n\t\t}\n\t\tconst layoutStyle = layoutType.getLayoutStyle?.( {\n\t\t\thasBlockGapSupport,\n\t\t\tlayout,\n\t\t\t...props,\n\t\t} );\n\t\tif ( layoutStyle ) {\n\t\t\treturn <style>{ layoutStyle }</style>;\n\t\t}\n\t}\n\treturn null;\n}\n"],"mappings":";;;;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAGA;AACA;AACA;;AAIO,MAAMG,aAAa,GAAG;EAAEC,IAAI,EAAE;AAAU,CAAC;AAACC,OAAA,CAAAF,aAAA,GAAAA,aAAA;AAEjD,MAAMG,MAAM,GAAG,IAAAC,sBAAa,EAAEJ,aAAc,CAAC;;AAE7C;AACA;AACA;AACO,MAAMK,cAAc,GAAGF,MAAM,CAACG,QAAQ;;AAE7C;AACA;AACA;AAFAJ,OAAA,CAAAG,cAAA,GAAAA,cAAA;AAGO,SAASE,SAASA,CAAA,EAAG;EAC3B,OAAO,IAAAC,mBAAU,EAAEL,MAAO,CAAC;AAC5B;AAEO,SAASM,WAAWA,CAAE;EAAEC,MAAM,GAAG,CAAC,CAAC;EAAEC,GAAG;EAAE,GAAGC;AAAM,CAAC,EAAG;EAC7D,MAAMC,UAAU,GAAG,IAAAC,sBAAa,EAAEJ,MAAM,CAACT,IAAK,CAAC;EAC/C,MAAM,CAAEc,eAAe,CAAE,GAAG,IAAAC,wBAAW,EAAE,kBAAmB,CAAC;EAC7D,MAAMC,kBAAkB,GAAGF,eAAe,KAAK,IAAI;EAEnD,IAAKF,UAAU,EAAG;IACjB,IAAKF,GAAG,EAAG;MACV,OAAO,IAAAO,MAAA,CAAAC,aAAA,iBAASR,GAAY,CAAC;IAC9B;IACA,MAAMS,WAAW,GAAGP,UAAU,CAACQ,cAAc,GAAI;MAChDJ,kBAAkB;MAClBP,MAAM;MACN,GAAGE;IACJ,CAAE,CAAC;IACH,IAAKQ,WAAW,EAAG;MAClB,OAAO,IAAAF,MAAA,CAAAC,aAAA,iBAASC,WAAoB,CAAC;IACtC;EACD;EACA,OAAO,IAAI;AACZ"}
|
|
@@ -12,7 +12,7 @@ var _i18n = require("@wordpress/i18n");
|
|
|
12
12
|
var _allInputControl = _interopRequireDefault(require("./all-input-control"));
|
|
13
13
|
var _inputControls = _interopRequireDefault(require("./input-controls"));
|
|
14
14
|
var _linkedButton = _interopRequireDefault(require("./linked-button"));
|
|
15
|
-
var
|
|
15
|
+
var _useSettings = require("../use-settings");
|
|
16
16
|
var _utils = require("./utils");
|
|
17
17
|
/**
|
|
18
18
|
* WordPress dependencies
|
|
@@ -60,8 +60,9 @@ function BorderRadiusControl({
|
|
|
60
60
|
bottomLeft: (0, _components.__experimentalParseQuantityAndUnitFromRawValue)(values?.bottomLeft)[1],
|
|
61
61
|
bottomRight: (0, _components.__experimentalParseQuantityAndUnitFromRawValue)(values?.bottomRight)[1]
|
|
62
62
|
});
|
|
63
|
+
const [availableUnits] = (0, _useSettings.useSettings)('spacing.units');
|
|
63
64
|
const units = (0, _components.__experimentalUseCustomUnits)({
|
|
64
|
-
availableUnits:
|
|
65
|
+
availableUnits: availableUnits || ['px', 'em', 'rem']
|
|
65
66
|
});
|
|
66
67
|
const unit = (0, _utils.getAllUnit)(selectedUnits);
|
|
67
68
|
const unitConfig = units && units.find(item => item.value === unit);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_element","_i18n","_allInputControl","_interopRequireDefault","_inputControls","_linkedButton","
|
|
1
|
+
{"version":3,"names":["_components","require","_element","_i18n","_allInputControl","_interopRequireDefault","_inputControls","_linkedButton","_useSettings","_utils","DEFAULT_VALUES","topLeft","undefined","topRight","bottomLeft","bottomRight","MIN_BORDER_RADIUS_VALUE","MAX_BORDER_RADIUS_VALUES","px","em","rem","BorderRadiusControl","onChange","values","isLinked","setIsLinked","useState","hasDefinedValues","hasMixedValues","selectedUnits","setSelectedUnits","flat","parseQuantityAndUnitFromRawValue","availableUnits","useSettings","units","useCustomUnits","unit","getAllUnit","unitConfig","find","item","value","step","allValue","getAllValue","toggleLinked","handleSliderChange","next","_react","createElement","className","BaseControl","VisualLabel","as","__","Fragment","default","min","RangeControl","label","hideLabelFromVision","max","initialPosition","withInputField","__nextHasNoMarginBottom","onClick"],"sources":["@wordpress/block-editor/src/components/border-radius-control/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tBaseControl,\n\tRangeControl,\n\t__experimentalParseQuantityAndUnitFromRawValue as parseQuantityAndUnitFromRawValue,\n\t__experimentalUseCustomUnits as useCustomUnits,\n} from '@wordpress/components';\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport AllInputControl from './all-input-control';\nimport InputControls from './input-controls';\nimport LinkedButton from './linked-button';\nimport { useSettings } from '../use-settings';\nimport {\n\tgetAllValue,\n\tgetAllUnit,\n\thasDefinedValues,\n\thasMixedValues,\n} from './utils';\n\nconst DEFAULT_VALUES = {\n\ttopLeft: undefined,\n\ttopRight: undefined,\n\tbottomLeft: undefined,\n\tbottomRight: undefined,\n};\nconst MIN_BORDER_RADIUS_VALUE = 0;\nconst MAX_BORDER_RADIUS_VALUES = {\n\tpx: 100,\n\tem: 20,\n\trem: 20,\n};\n\n/**\n * Control to display border radius options.\n *\n * @param {Object} props Component props.\n * @param {Function} props.onChange Callback to handle onChange.\n * @param {Object} props.values Border radius values.\n *\n * @return {Element} Custom border radius control.\n */\nexport default function BorderRadiusControl( { onChange, values } ) {\n\tconst [ isLinked, setIsLinked ] = useState(\n\t\t! hasDefinedValues( values ) || ! hasMixedValues( values )\n\t);\n\n\t// Tracking selected units via internal state allows filtering of CSS unit\n\t// only values from being saved while maintaining preexisting unit selection\n\t// behaviour. Filtering CSS unit only values prevents invalid style values.\n\tconst [ selectedUnits, setSelectedUnits ] = useState( {\n\t\tflat:\n\t\t\ttypeof values === 'string'\n\t\t\t\t? parseQuantityAndUnitFromRawValue( values )[ 1 ]\n\t\t\t\t: undefined,\n\t\ttopLeft: parseQuantityAndUnitFromRawValue( values?.topLeft )[ 1 ],\n\t\ttopRight: parseQuantityAndUnitFromRawValue( values?.topRight )[ 1 ],\n\t\tbottomLeft: parseQuantityAndUnitFromRawValue( values?.bottomLeft )[ 1 ],\n\t\tbottomRight: parseQuantityAndUnitFromRawValue(\n\t\t\tvalues?.bottomRight\n\t\t)[ 1 ],\n\t} );\n\n\tconst [ availableUnits ] = useSettings( 'spacing.units' );\n\tconst units = useCustomUnits( {\n\t\tavailableUnits: availableUnits || [ 'px', 'em', 'rem' ],\n\t} );\n\n\tconst unit = getAllUnit( selectedUnits );\n\tconst unitConfig = units && units.find( ( item ) => item.value === unit );\n\tconst step = unitConfig?.step || 1;\n\n\tconst [ allValue ] = parseQuantityAndUnitFromRawValue(\n\t\tgetAllValue( values )\n\t);\n\n\tconst toggleLinked = () => setIsLinked( ! isLinked );\n\n\tconst handleSliderChange = ( next ) => {\n\t\tonChange( next !== undefined ? `${ next }${ unit }` : undefined );\n\t};\n\n\treturn (\n\t\t<fieldset className=\"components-border-radius-control\">\n\t\t\t<BaseControl.VisualLabel as=\"legend\">\n\t\t\t\t{ __( 'Radius' ) }\n\t\t\t</BaseControl.VisualLabel>\n\t\t\t<div className=\"components-border-radius-control__wrapper\">\n\t\t\t\t{ isLinked ? (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<AllInputControl\n\t\t\t\t\t\t\tclassName=\"components-border-radius-control__unit-control\"\n\t\t\t\t\t\t\tvalues={ values }\n\t\t\t\t\t\t\tmin={ MIN_BORDER_RADIUS_VALUE }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\tselectedUnits={ selectedUnits }\n\t\t\t\t\t\t\tsetSelectedUnits={ setSelectedUnits }\n\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\tlabel={ __( 'Border radius' ) }\n\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\tclassName=\"components-border-radius-control__range-control\"\n\t\t\t\t\t\t\tvalue={ allValue ?? '' }\n\t\t\t\t\t\t\tmin={ MIN_BORDER_RADIUS_VALUE }\n\t\t\t\t\t\t\tmax={ MAX_BORDER_RADIUS_VALUES[ unit ] }\n\t\t\t\t\t\t\tinitialPosition={ 0 }\n\t\t\t\t\t\t\twithInputField={ false }\n\t\t\t\t\t\t\tonChange={ handleSliderChange }\n\t\t\t\t\t\t\tstep={ step }\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t/>\n\t\t\t\t\t</>\n\t\t\t\t) : (\n\t\t\t\t\t<InputControls\n\t\t\t\t\t\tmin={ MIN_BORDER_RADIUS_VALUE }\n\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\tselectedUnits={ selectedUnits }\n\t\t\t\t\t\tsetSelectedUnits={ setSelectedUnits }\n\t\t\t\t\t\tvalues={ values || DEFAULT_VALUES }\n\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<LinkedButton onClick={ toggleLinked } isLinked={ isLinked } />\n\t\t\t</div>\n\t\t</fieldset>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAMA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAKA,IAAAG,gBAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,cAAA,GAAAD,sBAAA,CAAAJ,OAAA;AACA,IAAAM,aAAA,GAAAF,sBAAA,CAAAJ,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AAnBA;AACA;AACA;;AAUA;AACA;AACA;;AAYA,MAAMS,cAAc,GAAG;EACtBC,OAAO,EAAEC,SAAS;EAClBC,QAAQ,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EAAClD,WAAA,CAAA2D,YAAY;IACZC,KAAK,EAAG,IAAAL,QAAE,EAAE,eAAgB,CAAG;IAC/BM,mBAAmB;IACnBV,SAAS,EAAC,iDAAiD;IAC3DT,KAAK,EAAGE,QAAQ,aAARA,QAAQ,cAARA,QAAQ,GAAI,EAAI;IACxBc,GAAG,EAAG1C,uBAAyB;IAC/B8C,GAAG,EAAG7C,wBAAwB,CAAEoB,IAAI,CAAI;IACxC0B,eAAe,EAAG,CAAG;IACrBC,cAAc,EAAG,KAAO;IACxB1C,QAAQ,EAAGyB,kBAAoB;IAC/BJ,IAAI,EAAGA,IAAM;IACbsB,uBAAuB;EAAA,CACvB,CACA,CAAC,GAEH,IAAAhB,MAAA,CAAAC,aAAA,EAAC5C,cAAA,CAAAmD,OAAa;IACbC,GAAG,EAAG1C,uBAAyB;IAC/BM,QAAQ,EAAGA,QAAU;IACrBO,aAAa,EAAGA,aAAe;IAC/BC,gBAAgB,EAAGA,gBAAkB;IACrCP,MAAM,EAAGA,MAAM,IAAIb,cAAgB;IACnCyB,KAAK,EAAGA;EAAO,CACf,CACD,EACD,IAAAc,MAAA,CAAAC,aAAA,EAAC3C,aAAA,CAAAkD,OAAY;IAACS,OAAO,EAAGpB,YAAc;IAACtB,QAAQ,EAAGA;EAAU,CAAE,CAC1D,CACI,CAAC;AAEb"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.default = void 0;
|
|
8
7
|
var _react = require("react");
|
|
9
8
|
var _compose = require("@wordpress/compose");
|
|
10
|
-
var
|
|
9
|
+
var _useSettings = require("../use-settings");
|
|
11
10
|
/**
|
|
12
11
|
* WordPress dependencies
|
|
13
12
|
*/
|
|
@@ -16,10 +15,11 @@ var _useSetting = _interopRequireDefault(require("../use-setting"));
|
|
|
16
15
|
*/
|
|
17
16
|
var _default = (0, _compose.createHigherOrderComponent)(WrappedComponent => {
|
|
18
17
|
return props => {
|
|
19
|
-
const colorsFeature = (0,
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
const [colorsFeature, enableCustomColors] = (0, _useSettings.useSettings)('color.palette', 'color.custom');
|
|
19
|
+
const {
|
|
20
|
+
colors = colorsFeature,
|
|
21
|
+
disableCustomColors = !enableCustomColors
|
|
22
|
+
} = props;
|
|
23
23
|
const hasColorsToChoose = colors && colors.length > 0 || !disableCustomColors;
|
|
24
24
|
return (0, _react.createElement)(WrappedComponent, {
|
|
25
25
|
...props,
|