@wordpress/block-library 9.1.0 → 9.3.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 +21 -17
- package/build/audio/edit.js +20 -8
- package/build/audio/edit.js.map +1 -1
- package/build/audio/index.js +4 -0
- package/build/audio/index.js.map +1 -1
- package/build/audio/transforms.js +1 -1
- package/build/audio/transforms.js.map +1 -1
- package/build/block/edit.js +0 -1
- package/build/block/edit.js.map +1 -1
- package/build/block/index.js +5 -1
- package/build/block/index.js.map +1 -1
- package/build/button/index.js +1 -0
- package/build/button/index.js.map +1 -1
- package/build/embed/embed-preview.js +4 -4
- package/build/embed/embed-preview.js.map +1 -1
- package/build/file/edit.js +14 -6
- package/build/file/edit.js.map +1 -1
- package/build/file/index.js +4 -0
- package/build/file/index.js.map +1 -1
- package/build/file/transforms.js +2 -3
- package/build/file/transforms.js.map +1 -1
- package/build/gallery/deprecated.js +6 -54
- package/build/gallery/deprecated.js.map +1 -1
- package/build/gallery/edit.js +9 -8
- package/build/gallery/edit.js.map +1 -1
- package/build/gallery/index.js +2 -2
- package/build/gallery/index.js.map +1 -1
- package/build/gallery/save.js +0 -11
- package/build/gallery/save.js.map +1 -1
- package/build/gallery/shared.js +0 -27
- package/build/gallery/shared.js.map +1 -1
- package/build/gallery/transforms.js +29 -80
- package/build/gallery/transforms.js.map +1 -1
- package/build/group/index.js +1 -0
- package/build/group/index.js.map +1 -1
- package/build/group/placeholder.js +5 -0
- package/build/group/placeholder.js.map +1 -1
- package/build/image/edit.js +13 -21
- package/build/image/edit.js.map +1 -1
- package/build/image/image.js +33 -19
- package/build/image/image.js.map +1 -1
- package/build/image/index.js +4 -0
- package/build/image/index.js.map +1 -1
- package/build/image/transforms.js +1 -1
- package/build/image/transforms.js.map +1 -1
- package/build/list-item/edit.js +1 -1
- package/build/list-item/edit.js.map +1 -1
- package/build/list-item/hooks/use-merge.js +8 -1
- package/build/list-item/hooks/use-merge.js.map +1 -1
- package/build/list-item/index.js +11 -1
- package/build/list-item/index.js.map +1 -1
- package/build/lock-unlock.js +1 -1
- package/build/lock-unlock.js.map +1 -1
- package/build/loginout/index.js +3 -0
- package/build/loginout/index.js.map +1 -1
- package/build/media-text/edit.js +3 -2
- package/build/media-text/edit.js.map +1 -1
- package/build/navigation-submenu/edit.js +1 -1
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/page-list/convert-to-links-modal.js +1 -1
- package/build/page-list/convert-to-links-modal.js.map +1 -1
- package/build/page-list/edit.js +1 -1
- package/build/page-list/edit.js.map +1 -1
- package/build/post-content/index.js +3 -0
- package/build/post-content/index.js.map +1 -1
- package/build/post-date/edit.js +3 -1
- package/build/post-date/edit.js.map +1 -1
- package/build/post-excerpt/index.js +3 -0
- package/build/post-excerpt/index.js.map +1 -1
- package/build/post-title/index.js +3 -0
- package/build/post-title/index.js.map +1 -1
- package/build/query/edit/inspector-controls/index.js +3 -2
- package/build/query/edit/inspector-controls/index.js.map +1 -1
- package/build/query/edit/query-toolbar.js +54 -61
- package/build/query/edit/query-toolbar.js.map +1 -1
- package/build/query/index.js +34 -0
- package/build/query/index.js.map +1 -1
- package/build/quote/edit.js +1 -0
- package/build/quote/edit.js.map +1 -1
- package/build/site-tagline/index.js +1 -0
- package/build/site-tagline/index.js.map +1 -1
- package/build/site-title/index.js +1 -0
- package/build/site-title/index.js.map +1 -1
- package/build/social-link/edit.js +9 -3
- package/build/social-link/edit.js.map +1 -1
- package/build/table/edit.js +8 -17
- package/build/table/edit.js.map +1 -1
- package/build/table-of-contents/index.js +1 -1
- package/build/template-part/edit/title-modal.js +1 -1
- package/build/template-part/edit/title-modal.js.map +1 -1
- package/build/utils/caption.js +2 -1
- package/build/utils/caption.js.map +1 -1
- package/build/utils/hooks.js +12 -0
- package/build/utils/hooks.js.map +1 -1
- package/build/verse/index.js +1 -0
- package/build/verse/index.js.map +1 -1
- package/build/video/deprecated.js +4 -0
- package/build/video/deprecated.js.map +1 -1
- package/build/video/edit.js +17 -7
- package/build/video/edit.js.map +1 -1
- package/build/video/index.js +4 -0
- package/build/video/index.js.map +1 -1
- package/build/video/transforms.js +1 -1
- package/build/video/transforms.js.map +1 -1
- package/build-module/audio/edit.js +20 -8
- package/build-module/audio/edit.js.map +1 -1
- package/build-module/audio/index.js +4 -0
- package/build-module/audio/index.js.map +1 -1
- package/build-module/audio/transforms.js +1 -1
- package/build-module/audio/transforms.js.map +1 -1
- package/build-module/block/edit.js +0 -1
- package/build-module/block/edit.js.map +1 -1
- package/build-module/block/index.js +5 -1
- package/build-module/block/index.js.map +1 -1
- package/build-module/button/index.js +1 -0
- package/build-module/button/index.js.map +1 -1
- package/build-module/embed/embed-preview.js +4 -4
- package/build-module/embed/embed-preview.js.map +1 -1
- package/build-module/file/edit.js +15 -7
- package/build-module/file/edit.js.map +1 -1
- package/build-module/file/index.js +4 -0
- package/build-module/file/index.js.map +1 -1
- package/build-module/file/transforms.js +2 -3
- package/build-module/file/transforms.js.map +1 -1
- package/build-module/gallery/deprecated.js +6 -54
- package/build-module/gallery/deprecated.js.map +1 -1
- package/build-module/gallery/edit.js +10 -9
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/gallery/index.js +1 -1
- package/build-module/gallery/index.js.map +1 -1
- package/build-module/gallery/save.js +0 -11
- package/build-module/gallery/save.js.map +1 -1
- package/build-module/gallery/shared.js +0 -25
- package/build-module/gallery/shared.js.map +1 -1
- package/build-module/gallery/transforms.js +29 -80
- package/build-module/gallery/transforms.js.map +1 -1
- package/build-module/group/index.js +1 -0
- package/build-module/group/index.js.map +1 -1
- package/build-module/group/placeholder.js +5 -0
- package/build-module/group/placeholder.js.map +1 -1
- package/build-module/image/edit.js +12 -20
- package/build-module/image/edit.js.map +1 -1
- package/build-module/image/image.js +28 -14
- package/build-module/image/image.js.map +1 -1
- package/build-module/image/index.js +4 -0
- package/build-module/image/index.js.map +1 -1
- package/build-module/image/transforms.js +1 -1
- package/build-module/image/transforms.js.map +1 -1
- package/build-module/list-item/edit.js +1 -1
- package/build-module/list-item/edit.js.map +1 -1
- package/build-module/list-item/hooks/use-merge.js +8 -1
- package/build-module/list-item/hooks/use-merge.js.map +1 -1
- package/build-module/list-item/index.js +11 -1
- package/build-module/list-item/index.js.map +1 -1
- package/build-module/lock-unlock.js +1 -1
- package/build-module/lock-unlock.js.map +1 -1
- package/build-module/loginout/index.js +3 -0
- package/build-module/loginout/index.js.map +1 -1
- package/build-module/media-text/edit.js +3 -2
- package/build-module/media-text/edit.js.map +1 -1
- package/build-module/navigation-submenu/edit.js +1 -1
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/build-module/page-list/convert-to-links-modal.js +1 -1
- package/build-module/page-list/convert-to-links-modal.js.map +1 -1
- package/build-module/page-list/edit.js +1 -1
- package/build-module/page-list/edit.js.map +1 -1
- package/build-module/post-content/index.js +3 -0
- package/build-module/post-content/index.js.map +1 -1
- package/build-module/post-date/edit.js +4 -2
- package/build-module/post-date/edit.js.map +1 -1
- package/build-module/post-excerpt/index.js +3 -0
- package/build-module/post-excerpt/index.js.map +1 -1
- package/build-module/post-title/index.js +3 -0
- package/build-module/post-title/index.js.map +1 -1
- package/build-module/query/edit/inspector-controls/index.js +3 -2
- package/build-module/query/edit/inspector-controls/index.js.map +1 -1
- package/build-module/query/edit/query-toolbar.js +55 -62
- package/build-module/query/edit/query-toolbar.js.map +1 -1
- package/build-module/query/index.js +34 -0
- package/build-module/query/index.js.map +1 -1
- package/build-module/quote/edit.js +1 -0
- package/build-module/quote/edit.js.map +1 -1
- package/build-module/site-tagline/index.js +1 -0
- package/build-module/site-tagline/index.js.map +1 -1
- package/build-module/site-title/index.js +1 -0
- package/build-module/site-title/index.js.map +1 -1
- package/build-module/social-link/edit.js +9 -3
- package/build-module/social-link/edit.js.map +1 -1
- package/build-module/table/edit.js +9 -18
- package/build-module/table/edit.js.map +1 -1
- package/build-module/table-of-contents/index.js +1 -1
- package/build-module/template-part/edit/title-modal.js +1 -1
- package/build-module/template-part/edit/title-modal.js.map +1 -1
- package/build-module/utils/caption.js +2 -1
- package/build-module/utils/caption.js.map +1 -1
- package/build-module/utils/hooks.js +11 -0
- package/build-module/utils/hooks.js.map +1 -1
- package/build-module/verse/index.js +1 -0
- package/build-module/verse/index.js.map +1 -1
- package/build-module/video/deprecated.js +4 -0
- package/build-module/video/deprecated.js.map +1 -1
- package/build-module/video/edit.js +18 -8
- package/build-module/video/edit.js.map +1 -1
- package/build-module/video/index.js +4 -0
- package/build-module/video/index.js.map +1 -1
- package/build-module/video/transforms.js +1 -1
- package/build-module/video/transforms.js.map +1 -1
- package/build-style/audio/style-rtl.css +1 -1
- package/build-style/audio/style.css +1 -1
- package/build-style/audio/theme-rtl.css +2 -2
- package/build-style/audio/theme.css +2 -2
- package/build-style/common-rtl.css +1 -3
- package/build-style/common.css +1 -3
- package/build-style/editor-rtl.css +3 -12
- package/build-style/editor.css +3 -12
- package/build-style/embed/style-rtl.css +1 -1
- package/build-style/embed/style.css +1 -1
- package/build-style/embed/theme-rtl.css +2 -2
- package/build-style/embed/theme.css +2 -2
- package/build-style/image/editor-rtl.css +0 -12
- package/build-style/image/editor.css +0 -12
- package/build-style/image/style-rtl.css +7 -1
- package/build-style/image/style.css +7 -1
- package/build-style/media-text/style-rtl.css +4 -0
- package/build-style/media-text/style.css +4 -0
- package/build-style/navigation/style-rtl.css +1 -0
- package/build-style/navigation/style.css +1 -0
- package/build-style/post-comments-form/style-rtl.css +11 -10
- package/build-style/post-comments-form/style.css +11 -10
- package/build-style/query/editor-rtl.css +3 -0
- package/build-style/query/editor.css +3 -0
- package/build-style/reset-rtl.css +1 -5
- package/build-style/reset.css +1 -5
- package/build-style/search/style-rtl.css +1 -2
- package/build-style/search/style.css +1 -2
- package/build-style/social-links/style-rtl.css +91 -91
- package/build-style/social-links/style.css +91 -91
- package/build-style/style-rtl.css +119 -110
- package/build-style/style.css +119 -110
- package/build-style/table/theme-rtl.css +2 -2
- package/build-style/table/theme.css +2 -2
- package/build-style/theme-rtl.css +8 -8
- package/build-style/theme.css +8 -8
- package/build-style/video/style-rtl.css +1 -1
- package/build-style/video/style.css +1 -1
- package/build-style/video/theme-rtl.css +2 -2
- package/build-style/video/theme.css +2 -2
- package/package.json +35 -35
- package/src/audio/block.json +4 -0
- package/src/audio/edit.js +19 -7
- package/src/audio/style.scss +1 -1
- package/src/audio/theme.scss +1 -1
- package/src/audio/transforms.js +1 -1
- package/src/block/block.json +5 -1
- package/src/block/edit.js +0 -1
- package/src/button/block.json +1 -0
- package/src/button/index.php +14 -1
- package/src/embed/embed-preview.js +4 -6
- package/src/embed/style.scss +1 -1
- package/src/embed/theme.scss +1 -1
- package/src/file/block.json +4 -0
- package/src/file/edit.js +19 -6
- package/src/file/transforms.js +1 -2
- package/src/gallery/deprecated.js +6 -55
- package/src/gallery/edit.js +13 -10
- package/src/gallery/gallery-styles.native.scss +0 -2
- package/src/gallery/index.js +1 -1
- package/src/gallery/save.js +0 -10
- package/src/gallery/shared.js +0 -28
- package/src/gallery/transforms.js +56 -99
- package/src/group/block.json +1 -0
- package/src/group/placeholder.js +7 -0
- package/src/image/block.json +4 -0
- package/src/image/edit.js +10 -19
- package/src/image/editor.scss +0 -13
- package/src/image/image.js +45 -16
- package/src/image/index.php +26 -5
- package/src/image/style.scss +11 -1
- package/src/image/transforms.js +1 -1
- package/src/list-item/block.json +11 -1
- package/src/list-item/edit.js +1 -1
- package/src/list-item/hooks/use-merge.js +19 -5
- package/src/lock-unlock.js +1 -1
- package/src/loginout/block.json +3 -0
- package/src/media-text/edit.js +3 -2
- package/src/media-text/index.php +68 -18
- package/src/media-text/style.scss +4 -0
- package/src/navigation/index.php +5 -3
- package/src/navigation/style.scss +1 -0
- package/src/navigation-submenu/edit.js +1 -1
- package/src/page-list/convert-to-links-modal.js +1 -1
- package/src/page-list/edit.js +1 -1
- package/src/paragraph/test/__snapshots__/edit.native.js.snap +30 -0
- package/src/paragraph/test/edit.native.js +99 -0
- package/src/post-comments-form/style.scss +15 -12
- package/src/post-content/block.json +3 -0
- package/src/post-date/edit.js +5 -1
- package/src/post-date/index.php +9 -3
- package/src/post-excerpt/block.json +3 -0
- package/src/post-title/block.json +3 -0
- package/src/query/edit/inspector-controls/index.js +3 -2
- package/src/query/edit/query-toolbar.js +60 -72
- package/src/query/editor.scss +4 -0
- package/src/query/index.js +40 -0
- package/src/quote/edit.js +1 -0
- package/src/reset.scss +11 -12
- package/src/site-tagline/block.json +1 -0
- package/src/site-title/block.json +1 -0
- package/src/social-link/edit.js +9 -3
- package/src/social-links/style.scss +2 -2
- package/src/table/edit.js +11 -24
- package/src/table/theme.scss +1 -1
- package/src/table-of-contents/block.json +1 -1
- package/src/template-part/edit/title-modal.js +1 -1
- package/src/template-part/index.php +1 -1
- package/src/utils/caption.js +5 -1
- package/src/utils/hooks.js +14 -1
- package/src/verse/block.json +1 -0
- package/src/video/block.json +4 -0
- package/src/video/edit.js +23 -8
- package/src/video/style.scss +1 -1
- package/src/video/theme.scss +1 -1
- package/src/video/transforms.js +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/build/gallery/edit-wrapper.js +0 -37
- package/build/gallery/edit-wrapper.js.map +0 -1
- package/build/gallery/v1/constants.js +0 -10
- package/build/gallery/v1/constants.js.map +0 -1
- package/build/gallery/v1/edit.js +0 -399
- package/build/gallery/v1/edit.js.map +0 -1
- package/build/gallery/v1/gallery-button.native.js +0 -55
- package/build/gallery/v1/gallery-button.native.js.map +0 -1
- package/build/gallery/v1/gallery-image.js +0 -285
- package/build/gallery/v1/gallery-image.js.map +0 -1
- package/build/gallery/v1/gallery-image.native.js +0 -297
- package/build/gallery/v1/gallery-image.native.js.map +0 -1
- package/build/gallery/v1/gallery.js +0 -112
- package/build/gallery/v1/gallery.js.map +0 -1
- package/build/gallery/v1/gallery.native.js +0 -139
- package/build/gallery/v1/gallery.native.js.map +0 -1
- package/build/gallery/v1/save.js +0 -81
- package/build/gallery/v1/save.js.map +0 -1
- package/build/gallery/v1/shared.js +0 -17
- package/build/gallery/v1/shared.js.map +0 -1
- package/build/gallery/v1/tiles.native.js +0 -83
- package/build/gallery/v1/tiles.native.js.map +0 -1
- package/build/utils/constants.js +0 -15
- package/build/utils/constants.js.map +0 -1
- package/build-module/gallery/edit-wrapper.js +0 -31
- package/build-module/gallery/edit-wrapper.js.map +0 -1
- package/build-module/gallery/v1/constants.js +0 -4
- package/build-module/gallery/v1/constants.js.map +0 -1
- package/build-module/gallery/v1/edit.js +0 -393
- package/build-module/gallery/v1/edit.js.map +0 -1
- package/build-module/gallery/v1/gallery-button.native.js +0 -46
- package/build-module/gallery/v1/gallery-button.native.js.map +0 -1
- package/build-module/gallery/v1/gallery-image.js +0 -279
- package/build-module/gallery/v1/gallery-image.js.map +0 -1
- package/build-module/gallery/v1/gallery-image.native.js +0 -291
- package/build-module/gallery/v1/gallery-image.native.js.map +0 -1
- package/build-module/gallery/v1/gallery.js +0 -104
- package/build-module/gallery/v1/gallery.js.map +0 -1
- package/build-module/gallery/v1/gallery.native.js +0 -131
- package/build-module/gallery/v1/gallery.native.js.map +0 -1
- package/build-module/gallery/v1/save.js +0 -74
- package/build-module/gallery/v1/save.js.map +0 -1
- package/build-module/gallery/v1/shared.js +0 -10
- package/build-module/gallery/v1/shared.js.map +0 -1
- package/build-module/gallery/v1/tiles.native.js +0 -75
- package/build-module/gallery/v1/tiles.native.js.map +0 -1
- package/build-module/utils/constants.js +0 -9
- package/build-module/utils/constants.js.map +0 -1
- package/src/gallery/edit-wrapper.js +0 -27
- package/src/gallery/v1/constants.js +0 -3
- package/src/gallery/v1/edit.js +0 -450
- package/src/gallery/v1/gallery-button.native.js +0 -47
- package/src/gallery/v1/gallery-image-style.native.scss +0 -109
- package/src/gallery/v1/gallery-image.js +0 -293
- package/src/gallery/v1/gallery-image.native.js +0 -348
- package/src/gallery/v1/gallery-styles.native.scss +0 -8
- package/src/gallery/v1/gallery.js +0 -125
- package/src/gallery/v1/gallery.native.js +0 -162
- package/src/gallery/v1/save.js +0 -98
- package/src/gallery/v1/shared.js +0 -19
- package/src/gallery/v1/tiles-styles.native.scss +0 -11
- package/src/gallery/v1/tiles.native.js +0 -79
- package/src/utils/constants.js +0 -8
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 9.3.0 (2024-07-10)
|
|
6
|
+
|
|
7
|
+
## 9.2.0 (2024-06-26)
|
|
8
|
+
|
|
5
9
|
## 9.1.0 (2024-06-15)
|
|
6
10
|
|
|
7
11
|
## 9.0.0 (2024-05-31)
|
|
@@ -45,7 +49,7 @@
|
|
|
45
49
|
|
|
46
50
|
## 8.21.0 (2023-10-18)
|
|
47
51
|
|
|
48
|
-
### Bug
|
|
52
|
+
### Bug Fixes
|
|
49
53
|
|
|
50
54
|
- Fix Image block lightbox missing alt attribute and improve accessibility. ([#54608](https://github.com/WordPress/gutenberg/pull/55010))
|
|
51
55
|
|
|
@@ -107,13 +111,13 @@
|
|
|
107
111
|
|
|
108
112
|
## 7.14.0 (2022-09-13)
|
|
109
113
|
|
|
110
|
-
### New
|
|
114
|
+
### New Features
|
|
111
115
|
|
|
112
116
|
- Made it possible to import individual blocks ([#42258](https://github.com/WordPress/gutenberg/pull/42258)). Check [README](./README.md#loading-individual-blocks) for more information.
|
|
113
117
|
|
|
114
118
|
## 7.13.0 (2022-08-24)
|
|
115
119
|
|
|
116
|
-
### Bug
|
|
120
|
+
### Bug Fixes
|
|
117
121
|
|
|
118
122
|
- Ensure all dependencies allow version ranges ([#43355](https://github.com/WordPress/gutenberg/pull/43355)).
|
|
119
123
|
|
|
@@ -131,7 +135,7 @@
|
|
|
131
135
|
|
|
132
136
|
## 7.6.0 (2022-05-18)
|
|
133
137
|
|
|
134
|
-
###
|
|
138
|
+
### Enhancements
|
|
135
139
|
|
|
136
140
|
- Declare blocks as \_\_experimental in block.json to automate syncing Gutenberg packages to WordPress ([#40655](https://github.com/WordPress/gutenberg/pull/40655)).
|
|
137
141
|
|
|
@@ -143,11 +147,11 @@
|
|
|
143
147
|
|
|
144
148
|
## 7.2.0 (2022-03-23)
|
|
145
149
|
|
|
146
|
-
### Bug
|
|
150
|
+
### Bug Fixes
|
|
147
151
|
|
|
148
152
|
- Table block: Fix deprecation eligibility to prevent loss of named (color palette) background color ([#39445](https://github.com/WordPress/gutenberg/pull/39445)).
|
|
149
153
|
|
|
150
|
-
###
|
|
154
|
+
### Enhancements
|
|
151
155
|
|
|
152
156
|
- Social Icons: Avoid loss of previously selected background color when switching back from "Logos Only" style ([#39276](https://github.com/WordPress/gutenberg/pull/39276)).
|
|
153
157
|
|
|
@@ -155,11 +159,11 @@
|
|
|
155
159
|
|
|
156
160
|
## 7.0.0 (2022-02-10)
|
|
157
161
|
|
|
158
|
-
### Breaking
|
|
162
|
+
### Breaking Changes
|
|
159
163
|
|
|
160
164
|
- The `GUTENBERG_PHASE` environment variable has been renamed to `IS_GUTENBERG_PLUGIN` and is now a boolean ([#38202](https://github.com/WordPress/gutenberg/pull/38202)).
|
|
161
165
|
|
|
162
|
-
### Bug
|
|
166
|
+
### Bug Fixes
|
|
163
167
|
|
|
164
168
|
- Gallery block: disable edit as html support ([#39318](https://github.com/WordPress/gutenberg/pull/39318)).
|
|
165
169
|
- Removed unused `@wordpress/escape-html` and `@wordpress/is-shallow-equal` dependencies ([#38388](https://github.com/WordPress/gutenberg/pull/38388)).
|
|
@@ -170,13 +174,13 @@
|
|
|
170
174
|
|
|
171
175
|
## 6.0.0 (2021-09-09)
|
|
172
176
|
|
|
173
|
-
### Breaking
|
|
177
|
+
### Breaking Changes
|
|
174
178
|
|
|
175
179
|
- Remove the background-colors, foreground-colors, and gradient-colors mixins.
|
|
176
180
|
|
|
177
181
|
## 5.0.0 (2021-07-29)
|
|
178
182
|
|
|
179
|
-
### Breaking
|
|
183
|
+
### Breaking Changes
|
|
180
184
|
|
|
181
185
|
- Upgraded React components to work with v17.0 ([#29118](https://github.com/WordPress/gutenberg/pull/29118)). There are no new features in React v17.0 as explained in the [blog post](https://reactjs.org/blog/2020/10/20/react-v17.html).
|
|
182
186
|
|
|
@@ -223,7 +227,7 @@
|
|
|
223
227
|
|
|
224
228
|
## 2.27.0 (2020-12-17)
|
|
225
229
|
|
|
226
|
-
###
|
|
230
|
+
### Enhancements
|
|
227
231
|
|
|
228
232
|
- File Block: Copy url button is moved to Block toolbar.
|
|
229
233
|
- Code and Preformatted Blocks: delete on backspace from an empty block.
|
|
@@ -235,13 +239,13 @@
|
|
|
235
239
|
([#26569](https://github.com/WordPress/gutenberg/pull/26569)).
|
|
236
240
|
- Fix Image Block, reset image dimensions when replace URL. bug mentioned in ([#26333](https://github.com/WordPress/gutenberg/issues/26333)).
|
|
237
241
|
|
|
238
|
-
###
|
|
242
|
+
### Enhancements
|
|
239
243
|
|
|
240
244
|
- File Block: Copy url button is moved to Block toolbar.
|
|
241
245
|
|
|
242
246
|
## 2.23.0 (2020-09-03)
|
|
243
247
|
|
|
244
|
-
###
|
|
248
|
+
### Enhancements
|
|
245
249
|
|
|
246
250
|
- Site title is now a link.
|
|
247
251
|
|
|
@@ -288,7 +292,7 @@
|
|
|
288
292
|
|
|
289
293
|
## 2.3.0 (2019-03-06)
|
|
290
294
|
|
|
291
|
-
### New
|
|
295
|
+
### New Features
|
|
292
296
|
|
|
293
297
|
- Add background color controls for the table block.
|
|
294
298
|
- Add new `RSS` block ([#7966](https://github.com/WordPress/gutenberg/pull/7966)).
|
|
@@ -320,7 +324,7 @@
|
|
|
320
324
|
|
|
321
325
|
## 2.2.2 (2018-11-12)
|
|
322
326
|
|
|
323
|
-
###
|
|
327
|
+
### Internal
|
|
324
328
|
|
|
325
329
|
- Columns Block: Improve usability while editing columns.
|
|
326
330
|
|
|
@@ -334,7 +338,7 @@
|
|
|
334
338
|
|
|
335
339
|
## 2.1.8 (2018-11-03)
|
|
336
340
|
|
|
337
|
-
###
|
|
341
|
+
### Internal
|
|
338
342
|
|
|
339
343
|
- File Block: Create file blocks when dropping multiple files at once.
|
|
340
344
|
|
|
@@ -368,7 +372,7 @@
|
|
|
368
372
|
|
|
369
373
|
## 2.0.0 (2018-09-05)
|
|
370
374
|
|
|
371
|
-
### Breaking
|
|
375
|
+
### Breaking Changes
|
|
372
376
|
|
|
373
377
|
- Change how required built-ins are polyfilled with Babel 7 ([#9171](https://github.com/WordPress/gutenberg/pull/9171)). If you're using an environment that has limited or no support for ES2015+ such as lower versions of IE then using [core-js](https://github.com/zloirock/core-js) or [@babel/polyfill](https://babeljs.io/docs/en/next/babel-polyfill) will add support for these methods.
|
|
374
378
|
|
package/build/audio/edit.js
CHANGED
|
@@ -13,6 +13,7 @@ var _i18n = require("@wordpress/i18n");
|
|
|
13
13
|
var _data = require("@wordpress/data");
|
|
14
14
|
var _icons = require("@wordpress/icons");
|
|
15
15
|
var _notices = require("@wordpress/notices");
|
|
16
|
+
var _element = require("@wordpress/element");
|
|
16
17
|
var _util = require("../embed/util");
|
|
17
18
|
var _hooks = require("../utils/hooks");
|
|
18
19
|
var _caption = require("../utils/caption");
|
|
@@ -45,9 +46,9 @@ function AudioEdit({
|
|
|
45
46
|
preload,
|
|
46
47
|
src
|
|
47
48
|
} = attributes;
|
|
48
|
-
const
|
|
49
|
+
const [temporaryURL, setTemporaryURL] = (0, _element.useState)(attributes.blob);
|
|
49
50
|
(0, _hooks.useUploadMediaFromBlobURL)({
|
|
50
|
-
url:
|
|
51
|
+
url: temporaryURL,
|
|
51
52
|
allowedTypes: ALLOWED_MEDIA_TYPES,
|
|
52
53
|
onChange: onSelectAudio,
|
|
53
54
|
onError: onUploadError
|
|
@@ -75,8 +76,10 @@ function AudioEdit({
|
|
|
75
76
|
}
|
|
76
77
|
setAttributes({
|
|
77
78
|
src: newSrc,
|
|
78
|
-
id: undefined
|
|
79
|
+
id: undefined,
|
|
80
|
+
blob: undefined
|
|
79
81
|
});
|
|
82
|
+
setTemporaryURL();
|
|
80
83
|
}
|
|
81
84
|
}
|
|
82
85
|
const {
|
|
@@ -97,25 +100,34 @@ function AudioEdit({
|
|
|
97
100
|
setAttributes({
|
|
98
101
|
src: undefined,
|
|
99
102
|
id: undefined,
|
|
100
|
-
caption: undefined
|
|
103
|
+
caption: undefined,
|
|
104
|
+
blob: undefined
|
|
101
105
|
});
|
|
106
|
+
setTemporaryURL();
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
if ((0, _blob.isBlobURL)(media.url)) {
|
|
110
|
+
setTemporaryURL(media.url);
|
|
102
111
|
return;
|
|
103
112
|
}
|
|
113
|
+
|
|
104
114
|
// Sets the block's attribute and updates the edit component from the
|
|
105
115
|
// selected media, then switches off the editing UI.
|
|
106
116
|
setAttributes({
|
|
117
|
+
blob: undefined,
|
|
107
118
|
src: media.url,
|
|
108
119
|
id: media.id,
|
|
109
120
|
caption: media.caption
|
|
110
121
|
});
|
|
122
|
+
setTemporaryURL();
|
|
111
123
|
}
|
|
112
124
|
const classes = (0, _clsx.default)(className, {
|
|
113
|
-
'is-transient':
|
|
125
|
+
'is-transient': !!temporaryURL
|
|
114
126
|
});
|
|
115
127
|
const blockProps = (0, _blockEditor.useBlockProps)({
|
|
116
128
|
className: classes
|
|
117
129
|
});
|
|
118
|
-
if (!src) {
|
|
130
|
+
if (!src && !temporaryURL) {
|
|
119
131
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
120
132
|
...blockProps,
|
|
121
133
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.MediaPlaceholder, {
|
|
@@ -187,9 +199,9 @@ function AudioEdit({
|
|
|
187
199
|
isDisabled: !isSingleSelected,
|
|
188
200
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("audio", {
|
|
189
201
|
controls: "controls",
|
|
190
|
-
src: src
|
|
202
|
+
src: src !== null && src !== void 0 ? src : temporaryURL
|
|
191
203
|
})
|
|
192
|
-
}),
|
|
204
|
+
}), !!temporaryURL && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Spinner, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_caption.Caption, {
|
|
193
205
|
attributes: attributes,
|
|
194
206
|
setAttributes: setAttributes,
|
|
195
207
|
isSelected: isSingleSelected,
|
package/build/audio/edit.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_blob","_components","_blockEditor","_i18n","_data","_icons","_notices","_util","_hooks","_caption","_jsxRuntime","ALLOWED_MEDIA_TYPES","AudioEdit","attributes","className","setAttributes","onReplace","isSelected","isSingleSelected","insertBlocksAfter","id","autoplay","loop","preload","src","isTemporaryAudio","isBlobURL","useUploadMediaFromBlobURL","url","allowedTypes","onChange","onSelectAudio","onError","onUploadError","toggleAttribute","attribute","newValue","onSelectURL","newSrc","embedBlock","createUpgradedEmbedBlock","undefined","createErrorNotice","useDispatch","noticesStore","message","type","getAutoplayHelp","checked","__","media","caption","classes","clsx","blockProps","useBlockProps","jsx","children","MediaPlaceholder","icon","BlockIcon","onSelect","accept","value","jsxs","Fragment","BlockControls","group","MediaReplaceFlow","mediaId","mediaURL","InspectorControls","PanelBody","title","ToggleControl","__nextHasNoMarginBottom","label","help","SelectControl","_x","options","Disabled","isDisabled","controls","Spinner","Caption","showToolbarButton","_default","exports","default"],"sources":["@wordpress/block-library/src/audio/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { isBlobURL } from '@wordpress/blob';\nimport {\n\tDisabled,\n\tPanelBody,\n\tSelectControl,\n\tSpinner,\n\tToggleControl,\n} from '@wordpress/components';\nimport {\n\tBlockControls,\n\tBlockIcon,\n\tInspectorControls,\n\tMediaPlaceholder,\n\tMediaReplaceFlow,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport { __, _x } from '@wordpress/i18n';\nimport { useDispatch } from '@wordpress/data';\nimport { audio as icon } from '@wordpress/icons';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport { createUpgradedEmbedBlock } from '../embed/util';\nimport { useUploadMediaFromBlobURL } from '../utils/hooks';\nimport { Caption } from '../utils/caption';\n\nconst ALLOWED_MEDIA_TYPES = [ 'audio' ];\n\nfunction AudioEdit( {\n\tattributes,\n\tclassName,\n\tsetAttributes,\n\tonReplace,\n\tisSelected: isSingleSelected,\n\tinsertBlocksAfter,\n} ) {\n\tconst { id, autoplay, loop, preload, src } = attributes;\n\tconst isTemporaryAudio = ! id && isBlobURL( src );\n\n\tuseUploadMediaFromBlobURL( {\n\t\turl: src,\n\t\tallowedTypes: ALLOWED_MEDIA_TYPES,\n\t\tonChange: onSelectAudio,\n\t\tonError: onUploadError,\n\t} );\n\n\tfunction toggleAttribute( attribute ) {\n\t\treturn ( newValue ) => {\n\t\t\tsetAttributes( { [ attribute ]: newValue } );\n\t\t};\n\t}\n\n\tfunction onSelectURL( newSrc ) {\n\t\t// Set the block's src from the edit component's state, and switch off\n\t\t// the editing UI.\n\t\tif ( newSrc !== src ) {\n\t\t\t// Check if there's an embed block that handles this URL.\n\t\t\tconst embedBlock = createUpgradedEmbedBlock( {\n\t\t\t\tattributes: { url: newSrc },\n\t\t\t} );\n\t\t\tif ( undefined !== embedBlock && onReplace ) {\n\t\t\t\tonReplace( embedBlock );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetAttributes( { src: newSrc, id: undefined } );\n\t\t}\n\t}\n\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tfunction onUploadError( message ) {\n\t\tcreateErrorNotice( message, { type: 'snackbar' } );\n\t}\n\n\tfunction getAutoplayHelp( checked ) {\n\t\treturn checked\n\t\t\t? __( 'Autoplay may cause usability issues for some users.' )\n\t\t\t: null;\n\t}\n\n\tfunction onSelectAudio( media ) {\n\t\tif ( ! media || ! media.url ) {\n\t\t\t// In this case there was an error and we should continue in the editing state\n\t\t\t// previous attributes should be removed because they may be temporary blob urls.\n\t\t\tsetAttributes( {\n\t\t\t\tsrc: undefined,\n\t\t\t\tid: undefined,\n\t\t\t\tcaption: undefined,\n\t\t\t} );\n\t\t\treturn;\n\t\t}\n\t\t// Sets the block's attribute and updates the edit component from the\n\t\t// selected media, then switches off the editing UI.\n\t\tsetAttributes( {\n\t\t\tsrc: media.url,\n\t\t\tid: media.id,\n\t\t\tcaption: media.caption,\n\t\t} );\n\t}\n\n\tconst classes = clsx( className, {\n\t\t'is-transient': isTemporaryAudio,\n\t} );\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classes,\n\t} );\n\n\tif ( ! src ) {\n\t\treturn (\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<MediaPlaceholder\n\t\t\t\t\ticon={ <BlockIcon icon={ icon } /> }\n\t\t\t\t\tonSelect={ onSelectAudio }\n\t\t\t\t\tonSelectURL={ onSelectURL }\n\t\t\t\t\taccept=\"audio/*\"\n\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\tvalue={ attributes }\n\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ isSingleSelected && (\n\t\t\t\t<BlockControls group=\"other\">\n\t\t\t\t\t<MediaReplaceFlow\n\t\t\t\t\t\tmediaId={ id }\n\t\t\t\t\t\tmediaURL={ src }\n\t\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\t\taccept=\"audio/*\"\n\t\t\t\t\t\tonSelect={ onSelectAudio }\n\t\t\t\t\t\tonSelectURL={ onSelectURL }\n\t\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\t/>\n\t\t\t\t</BlockControls>\n\t\t\t) }\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Autoplay' ) }\n\t\t\t\t\t\tonChange={ toggleAttribute( 'autoplay' ) }\n\t\t\t\t\t\tchecked={ autoplay }\n\t\t\t\t\t\thelp={ getAutoplayHelp }\n\t\t\t\t\t/>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Loop' ) }\n\t\t\t\t\t\tonChange={ toggleAttribute( 'loop' ) }\n\t\t\t\t\t\tchecked={ loop }\n\t\t\t\t\t/>\n\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ _x( 'Preload', 'noun; Audio block parameter' ) }\n\t\t\t\t\t\tvalue={ preload || '' }\n\t\t\t\t\t\t// `undefined` is required for the preload attribute to be unset.\n\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tpreload: value || undefined,\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t\toptions={ [\n\t\t\t\t\t\t\t{ value: '', label: __( 'Browser default' ) },\n\t\t\t\t\t\t\t{ value: 'auto', label: __( 'Auto' ) },\n\t\t\t\t\t\t\t{ value: 'metadata', label: __( 'Metadata' ) },\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvalue: 'none',\n\t\t\t\t\t\t\t\tlabel: _x( 'None', 'Preload value' ),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t] }\n\t\t\t\t\t/>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t<figure { ...blockProps }>\n\t\t\t\t{ /*\n\t\t\t\t\tDisable the audio tag if the block is not selected\n\t\t\t\t\tso the user clicking on it won't play the\n\t\t\t\t\tfile or change the position slider when the controls are enabled.\n\t\t\t\t*/ }\n\t\t\t\t<Disabled isDisabled={ ! isSingleSelected }>\n\t\t\t\t\t<audio controls=\"controls\" src={ src } />\n\t\t\t\t</Disabled>\n\t\t\t\t{ isTemporaryAudio && <Spinner /> }\n\t\t\t\t<Caption\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tisSelected={ isSingleSelected }\n\t\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\t\tlabel={ __( 'Audio caption text' ) }\n\t\t\t\t\tshowToolbarButton={ isSingleSelected }\n\t\t\t\t/>\n\t\t\t</figure>\n\t\t</>\n\t);\n}\n\nexport default AudioEdit;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAOA,IAAAG,YAAA,GAAAH,OAAA;AAQA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AAKA,IAAAQ,KAAA,GAAAR,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AACA,IAAAU,QAAA,GAAAV,OAAA;AAA2C,IAAAW,WAAA,GAAAX,OAAA;AAlC3C;AACA;AACA;;AAGA;AACA;AACA;;AAsBA;AACA;AACA;;AAKA,MAAMY,mBAAmB,GAAG,CAAE,OAAO,CAAE;AAEvC,SAASC,SAASA,CAAE;EACnBC,UAAU;EACVC,SAAS;EACTC,aAAa;EACbC,SAAS;EACTC,UAAU,EAAEC,gBAAgB;EAC5BC;AACD,CAAC,EAAG;EACH,MAAM;IAAEC,EAAE;IAAEC,QAAQ;IAAEC,IAAI;IAAEC,OAAO;IAAEC;EAAI,CAAC,GAAGX,UAAU;EACvD,MAAMY,gBAAgB,GAAG,CAAEL,EAAE,IAAI,IAAAM,eAAS,EAAEF,GAAI,CAAC;EAEjD,IAAAG,gCAAyB,EAAE;IAC1BC,GAAG,EAAEJ,GAAG;IACRK,YAAY,EAAElB,mBAAmB;IACjCmB,QAAQ,EAAEC,aAAa;IACvBC,OAAO,EAAEC;EACV,CAAE,CAAC;EAEH,SAASC,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E,EAAE,MAAM,EAAE,eAAgB;UACpC,CAAC;QACC,CACH,CAAC;MAAA,CACQ;IAAC,CACM,CAAC,eACpB,IAAArE,WAAA,CAAAsD,IAAA;MAAA,GAAaV,UAAU;MAAAG,QAAA,gBAMtB,IAAA/C,WAAA,CAAA8C,GAAA,EAACvD,WAAA,CAAAgF,QAAQ;QAACC,UAAU,EAAG,CAAEhE,gBAAkB;QAAAuC,QAAA,eAC1C,IAAA/C,WAAA,CAAA8C,GAAA;UAAO2B,QAAQ,EAAC,UAAU;UAAC3D,GAAG,EAAGA;QAAK,CAAE;MAAC,CAChC,CAAC,EACTC,gBAAgB,iBAAI,IAAAf,WAAA,CAAA8C,GAAA,EAACvD,WAAA,CAAAmF,OAAO,IAAE,CAAC,eACjC,IAAA1E,WAAA,CAAA8C,GAAA,EAAC/C,QAAA,CAAA4E,OAAO;QACPxE,UAAU,EAAGA,UAAY;QACzBE,aAAa,EAAGA,aAAe;QAC/BE,UAAU,EAAGC,gBAAkB;QAC/BC,iBAAiB,EAAGA,iBAAmB;QACvCyD,KAAK,EAAG,IAAA3B,QAAE,EAAE,oBAAqB,CAAG;QACpCqC,iBAAiB,EAAGpE;MAAkB,CACtC,CAAC;IAAA,CACK,CAAC;EAAA,CACR,CAAC;AAEL;AAAC,IAAAqE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc7E,SAAS","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_blob","_components","_blockEditor","_i18n","_data","_icons","_notices","_element","_util","_hooks","_caption","_jsxRuntime","ALLOWED_MEDIA_TYPES","AudioEdit","attributes","className","setAttributes","onReplace","isSelected","isSingleSelected","insertBlocksAfter","id","autoplay","loop","preload","src","temporaryURL","setTemporaryURL","useState","blob","useUploadMediaFromBlobURL","url","allowedTypes","onChange","onSelectAudio","onError","onUploadError","toggleAttribute","attribute","newValue","onSelectURL","newSrc","embedBlock","createUpgradedEmbedBlock","undefined","createErrorNotice","useDispatch","noticesStore","message","type","getAutoplayHelp","checked","__","media","caption","isBlobURL","classes","clsx","blockProps","useBlockProps","jsx","children","MediaPlaceholder","icon","BlockIcon","onSelect","accept","value","jsxs","Fragment","BlockControls","group","MediaReplaceFlow","mediaId","mediaURL","InspectorControls","PanelBody","title","ToggleControl","__nextHasNoMarginBottom","label","help","SelectControl","_x","options","Disabled","isDisabled","controls","Spinner","Caption","showToolbarButton","_default","exports","default"],"sources":["@wordpress/block-library/src/audio/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { isBlobURL } from '@wordpress/blob';\nimport {\n\tDisabled,\n\tPanelBody,\n\tSelectControl,\n\tSpinner,\n\tToggleControl,\n} from '@wordpress/components';\nimport {\n\tBlockControls,\n\tBlockIcon,\n\tInspectorControls,\n\tMediaPlaceholder,\n\tMediaReplaceFlow,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport { __, _x } from '@wordpress/i18n';\nimport { useDispatch } from '@wordpress/data';\nimport { audio as icon } from '@wordpress/icons';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { createUpgradedEmbedBlock } from '../embed/util';\nimport { useUploadMediaFromBlobURL } from '../utils/hooks';\nimport { Caption } from '../utils/caption';\n\nconst ALLOWED_MEDIA_TYPES = [ 'audio' ];\n\nfunction AudioEdit( {\n\tattributes,\n\tclassName,\n\tsetAttributes,\n\tonReplace,\n\tisSelected: isSingleSelected,\n\tinsertBlocksAfter,\n} ) {\n\tconst { id, autoplay, loop, preload, src } = attributes;\n\tconst [ temporaryURL, setTemporaryURL ] = useState( attributes.blob );\n\n\tuseUploadMediaFromBlobURL( {\n\t\turl: temporaryURL,\n\t\tallowedTypes: ALLOWED_MEDIA_TYPES,\n\t\tonChange: onSelectAudio,\n\t\tonError: onUploadError,\n\t} );\n\n\tfunction toggleAttribute( attribute ) {\n\t\treturn ( newValue ) => {\n\t\t\tsetAttributes( { [ attribute ]: newValue } );\n\t\t};\n\t}\n\n\tfunction onSelectURL( newSrc ) {\n\t\t// Set the block's src from the edit component's state, and switch off\n\t\t// the editing UI.\n\t\tif ( newSrc !== src ) {\n\t\t\t// Check if there's an embed block that handles this URL.\n\t\t\tconst embedBlock = createUpgradedEmbedBlock( {\n\t\t\t\tattributes: { url: newSrc },\n\t\t\t} );\n\t\t\tif ( undefined !== embedBlock && onReplace ) {\n\t\t\t\tonReplace( embedBlock );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetAttributes( { src: newSrc, id: undefined, blob: undefined } );\n\t\t\tsetTemporaryURL();\n\t\t}\n\t}\n\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tfunction onUploadError( message ) {\n\t\tcreateErrorNotice( message, { type: 'snackbar' } );\n\t}\n\n\tfunction getAutoplayHelp( checked ) {\n\t\treturn checked\n\t\t\t? __( 'Autoplay may cause usability issues for some users.' )\n\t\t\t: null;\n\t}\n\n\tfunction onSelectAudio( media ) {\n\t\tif ( ! media || ! media.url ) {\n\t\t\t// In this case there was an error and we should continue in the editing state\n\t\t\t// previous attributes should be removed because they may be temporary blob urls.\n\t\t\tsetAttributes( {\n\t\t\t\tsrc: undefined,\n\t\t\t\tid: undefined,\n\t\t\t\tcaption: undefined,\n\t\t\t\tblob: undefined,\n\t\t\t} );\n\t\t\tsetTemporaryURL();\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isBlobURL( media.url ) ) {\n\t\t\tsetTemporaryURL( media.url );\n\t\t\treturn;\n\t\t}\n\n\t\t// Sets the block's attribute and updates the edit component from the\n\t\t// selected media, then switches off the editing UI.\n\t\tsetAttributes( {\n\t\t\tblob: undefined,\n\t\t\tsrc: media.url,\n\t\t\tid: media.id,\n\t\t\tcaption: media.caption,\n\t\t} );\n\t\tsetTemporaryURL();\n\t}\n\n\tconst classes = clsx( className, {\n\t\t'is-transient': !! temporaryURL,\n\t} );\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classes,\n\t} );\n\n\tif ( ! src && ! temporaryURL ) {\n\t\treturn (\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<MediaPlaceholder\n\t\t\t\t\ticon={ <BlockIcon icon={ icon } /> }\n\t\t\t\t\tonSelect={ onSelectAudio }\n\t\t\t\t\tonSelectURL={ onSelectURL }\n\t\t\t\t\taccept=\"audio/*\"\n\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\tvalue={ attributes }\n\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ isSingleSelected && (\n\t\t\t\t<BlockControls group=\"other\">\n\t\t\t\t\t<MediaReplaceFlow\n\t\t\t\t\t\tmediaId={ id }\n\t\t\t\t\t\tmediaURL={ src }\n\t\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\t\taccept=\"audio/*\"\n\t\t\t\t\t\tonSelect={ onSelectAudio }\n\t\t\t\t\t\tonSelectURL={ onSelectURL }\n\t\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\t/>\n\t\t\t\t</BlockControls>\n\t\t\t) }\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Autoplay' ) }\n\t\t\t\t\t\tonChange={ toggleAttribute( 'autoplay' ) }\n\t\t\t\t\t\tchecked={ autoplay }\n\t\t\t\t\t\thelp={ getAutoplayHelp }\n\t\t\t\t\t/>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Loop' ) }\n\t\t\t\t\t\tonChange={ toggleAttribute( 'loop' ) }\n\t\t\t\t\t\tchecked={ loop }\n\t\t\t\t\t/>\n\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ _x( 'Preload', 'noun; Audio block parameter' ) }\n\t\t\t\t\t\tvalue={ preload || '' }\n\t\t\t\t\t\t// `undefined` is required for the preload attribute to be unset.\n\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tpreload: value || undefined,\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t\toptions={ [\n\t\t\t\t\t\t\t{ value: '', label: __( 'Browser default' ) },\n\t\t\t\t\t\t\t{ value: 'auto', label: __( 'Auto' ) },\n\t\t\t\t\t\t\t{ value: 'metadata', label: __( 'Metadata' ) },\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvalue: 'none',\n\t\t\t\t\t\t\t\tlabel: _x( 'None', 'Preload value' ),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t] }\n\t\t\t\t\t/>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t<figure { ...blockProps }>\n\t\t\t\t{ /*\n\t\t\t\t\tDisable the audio tag if the block is not selected\n\t\t\t\t\tso the user clicking on it won't play the\n\t\t\t\t\tfile or change the position slider when the controls are enabled.\n\t\t\t\t*/ }\n\t\t\t\t<Disabled isDisabled={ ! isSingleSelected }>\n\t\t\t\t\t<audio controls=\"controls\" src={ src ?? temporaryURL } />\n\t\t\t\t</Disabled>\n\t\t\t\t{ !! temporaryURL && <Spinner /> }\n\t\t\t\t<Caption\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tisSelected={ isSingleSelected }\n\t\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\t\tlabel={ __( 'Audio caption text' ) }\n\t\t\t\t\tshowToolbarButton={ isSingleSelected }\n\t\t\t\t/>\n\t\t\t</figure>\n\t\t</>\n\t);\n}\n\nexport default AudioEdit;\n"],"mappings":";;;;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AAU;YAAEa,KAAK,EAAE,IAAA5B,QAAE,EAAE,UAAW;UAAE,CAAC,EAC9C;YACCe,KAAK,EAAE,MAAM;YACba,KAAK,EAAE,IAAAG,QAAE,EAAE,MAAM,EAAE,eAAgB;UACpC,CAAC;QACC,CACH,CAAC;MAAA,CACQ;IAAC,CACM,CAAC,eACpB,IAAAxE,WAAA,CAAAyD,IAAA;MAAA,GAAaV,UAAU;MAAAG,QAAA,gBAMtB,IAAAlD,WAAA,CAAAiD,GAAA,EAAC3D,WAAA,CAAAoF,QAAQ;QAACC,UAAU,EAAG,CAAEnE,gBAAkB;QAAA0C,QAAA,eAC1C,IAAAlD,WAAA,CAAAiD,GAAA;UAAO2B,QAAQ,EAAC,UAAU;UAAC9D,GAAG,EAAGA,GAAG,aAAHA,GAAG,cAAHA,GAAG,GAAIC;QAAc,CAAE;MAAC,CAChD,CAAC,EACT,CAAC,CAAEA,YAAY,iBAAI,IAAAf,WAAA,CAAAiD,GAAA,EAAC3D,WAAA,CAAAuF,OAAO,IAAE,CAAC,eAChC,IAAA7E,WAAA,CAAAiD,GAAA,EAAClD,QAAA,CAAA+E,OAAO;QACP3E,UAAU,EAAGA,UAAY;QACzBE,aAAa,EAAGA,aAAe;QAC/BE,UAAU,EAAGC,gBAAkB;QAC/BC,iBAAiB,EAAGA,iBAAmB;QACvC4D,KAAK,EAAG,IAAA5B,QAAE,EAAE,oBAAqB,CAAG;QACpCsC,iBAAiB,EAAGvE;MAAkB,CACtC,CAAC;IAAA,CACK,CAAC;EAAA,CACR,CAAC;AAEL;AAAC,IAAAwE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEchF,SAAS","ignoreList":[]}
|
package/build/audio/index.js
CHANGED
|
@@ -27,6 +27,10 @@ const metadata = exports.metadata = {
|
|
|
27
27
|
keywords: ["music", "sound", "podcast", "recording"],
|
|
28
28
|
textdomain: "default",
|
|
29
29
|
attributes: {
|
|
30
|
+
blob: {
|
|
31
|
+
type: "string",
|
|
32
|
+
__experimentalRole: "local"
|
|
33
|
+
},
|
|
30
34
|
src: {
|
|
31
35
|
type: "string",
|
|
32
36
|
source: "attribute",
|
package/build/audio/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_icons","require","_initBlock","_interopRequireDefault","_deprecated","_edit","_save","_transforms","metadata","exports","$schema","apiVersion","name","title","category","description","keywords","textdomain","attributes","
|
|
1
|
+
{"version":3,"names":["_icons","require","_initBlock","_interopRequireDefault","_deprecated","_edit","_save","_transforms","metadata","exports","$schema","apiVersion","name","title","category","description","keywords","textdomain","attributes","blob","type","__experimentalRole","src","source","selector","attribute","caption","id","autoplay","loop","preload","supports","anchor","align","spacing","margin","padding","__experimentalDefaultControls","interactivity","clientNavigation","editorStyle","style","settings","icon","example","viewportWidth","transforms","deprecated","edit","save","init","initBlock"],"sources":["@wordpress/block-library/src/audio/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { audio as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tsrc: 'https://upload.wikimedia.org/wikipedia/commons/d/dd/Armstrong_Small_Step.ogg',\n\t\t},\n\t\tviewportWidth: 350,\n\t},\n\ttransforms,\n\tdeprecated,\n\tedit,\n\tsave,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":";;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,WAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,KAAA,GAAAF,sBAAA,CAAAF,OAAA;AAEA,IAAAK,KAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,WAAA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C,IAAI,EAAJA,aAAI;EACJC,IAAI,EAAJA;AACD,CAAC;AAEM,MAAMC,IAAI,GAAGA,CAAA,KAAM,IAAAC,kBAAS,EAAE;EAAEvC,IAAI;EAAEJ,QAAQ;EAAEkC;AAAS,CAAE,CAAC;AAACjC,OAAA,CAAAyC,IAAA,GAAAA,IAAA","ignoreList":[]}
|
|
@@ -22,7 +22,7 @@ const transforms = {
|
|
|
22
22
|
// It's already done as part of the `componentDidMount`
|
|
23
23
|
// in the audio block.
|
|
24
24
|
const block = (0, _blocks.createBlock)('core/audio', {
|
|
25
|
-
|
|
25
|
+
blob: (0, _blob.createBlobURL)(file)
|
|
26
26
|
});
|
|
27
27
|
return block;
|
|
28
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_blob","require","_blocks","transforms","from","type","isMatch","files","length","indexOf","transform","file","block","createBlock","
|
|
1
|
+
{"version":3,"names":["_blob","require","_blocks","transforms","from","type","isMatch","files","length","indexOf","transform","file","block","createBlock","blob","createBlobURL","tag","attributes","src","shortcode","named","mp3","m4a","ogg","wav","wma","loop","autoplay","preload","_default","exports","default"],"sources":["@wordpress/block-library/src/audio/transforms.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createBlobURL } from '@wordpress/blob';\nimport { createBlock } from '@wordpress/blocks';\n\nconst transforms = {\n\tfrom: [\n\t\t{\n\t\t\ttype: 'files',\n\t\t\tisMatch( files ) {\n\t\t\t\treturn (\n\t\t\t\t\tfiles.length === 1 &&\n\t\t\t\t\tfiles[ 0 ].type.indexOf( 'audio/' ) === 0\n\t\t\t\t);\n\t\t\t},\n\t\t\ttransform( files ) {\n\t\t\t\tconst file = files[ 0 ];\n\t\t\t\t// We don't need to upload the media directly here\n\t\t\t\t// It's already done as part of the `componentDidMount`\n\t\t\t\t// in the audio block.\n\t\t\t\tconst block = createBlock( 'core/audio', {\n\t\t\t\t\tblob: createBlobURL( file ),\n\t\t\t\t} );\n\n\t\t\t\treturn block;\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttype: 'shortcode',\n\t\t\ttag: 'audio',\n\t\t\tattributes: {\n\t\t\t\tsrc: {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tshortcode: ( {\n\t\t\t\t\t\tnamed: { src, mp3, m4a, ogg, wav, wma },\n\t\t\t\t\t} ) => {\n\t\t\t\t\t\treturn src || mp3 || m4a || ogg || wav || wma;\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tloop: {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tshortcode: ( { named: { loop } } ) => {\n\t\t\t\t\t\treturn loop;\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tautoplay: {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tshortcode: ( { named: { autoplay } } ) => {\n\t\t\t\t\t\treturn autoplay;\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tpreload: {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tshortcode: ( { named: { preload } } ) => {\n\t\t\t\t\t\treturn preload;\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t],\n};\n\nexport default transforms;\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA,MAAME,UAAU,GAAG;EAClBC,IAAI,EAAE,CACL;IACCC,IAAI,EAAE,OAAO;IACbC,OAAOA,CAAEC,KAAK,EAAG;MAChB,OACCA,KAAK,CAACC,MAAM,KAAK,CAAC,IAClBD,KAAK,CAAE,CAAC,CAAE,CAACF,IAAI,CAACI,OAAO,CAAE,QAAS,CAAC,KAAK,CAAC;IAE3C,CAAC;IACDC,SAASA,CAAEH,KAAK,EAAG;MAClB,MAAMI,IAAI,GAAGJ,KAAK,CAAE,CAAC,CAAE;MACvB;MACA;MACA;MACA,MAAMK,KAAK,GAAG,IAAAC,mBAAW,EAAE,YAAY,EAAE;QACxCC,IAAI,EAAE,IAAAC,mBAAa,EAAEJ,IAAK;MAC3B,CAAE,CAAC;MAEH,OAAOC,KAAK;IACb;EACD,CAAC,EACD;IACCP,IAAI,EAAE,WAAW;IACjBW,GAAG,EAAE,OAAO;IACZC,UAAU,EAAE;MACXC,GAAG,EAAE;QACJb,IAAI,EAAE,QAAQ;QACdc,SAAS,EAAEA,CAAE;UACZC,KAAK,EAAE;YAAEF,GAAG;YAAEG,GAAG;YAAEC,GAAG;YAAEC,GAAG;YAAEC,GAAG;YAAEC;UAAI;QACvC,CAAC,KAAM;UACN,OAAOP,GAAG,IAAIG,GAAG,IAAIC,GAAG,IAAIC,GAAG,IAAIC,GAAG,IAAIC,GAAG;QAC9C;MACD,CAAC;MACDC,IAAI,EAAE;QACLrB,IAAI,EAAE,QAAQ;QACdc,SAAS,EAAEA,CAAE;UAAEC,KAAK,EAAE;YAAEM;UAAK;QAAE,CAAC,KAAM;UACrC,OAAOA,IAAI;QACZ;MACD,CAAC;MACDC,QAAQ,EAAE;QACTtB,IAAI,EAAE,QAAQ;QACdc,SAAS,EAAEA,CAAE;UAAEC,KAAK,EAAE;YAAEO;UAAS;QAAE,CAAC,KAAM;UACzC,OAAOA,QAAQ;QAChB;MACD,CAAC;MACDC,OAAO,EAAE;QACRvB,IAAI,EAAE,QAAQ;QACdc,SAAS,EAAEA,CAAE;UAAEC,KAAK,EAAE;YAAEQ;UAAQ;QAAE,CAAC,KAAM;UACxC,OAAOA,OAAO;QACf;MACD;IACD;EACD,CAAC;AAEH,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEa5B,UAAU","ignoreList":[]}
|
package/build/block/edit.js
CHANGED
package/build/block/edit.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_data","_element","_coreData","_components","_i18n","_blockEditor","_patterns","_blocks","_index","_lockUnlock","_jsxRuntime","useLayoutClasses","unlock","blockEditorPrivateApis","isOverridableBlock","hasOverridableBlocks","patternsPrivateApis","fullAlignments","useInferredLayout","blocks","parentLayout","initialInferredAlignmentRef","useRef","useMemo","length","alignment","current","undefined","isConstrained","type","hasFullAlignment","some","block","includes","attributes","align","layout","setBlockEditMode","setEditMode","mode","forEach","editMode","clientId","innerBlocks","name","patternBlockName","RecursionWarning","blockProps","useBlockProps","jsx","children","Warning","__","NOOP","ReusableBlockEditRecursionWrapper","props","ref","hasAlreadyRendered","useHasRecursion","RecursionProvider","uniqueId","ReusableBlockEdit","content","__unstableParentLayout","patternClientId","setAttributes","record","hasResolved","useEntityRecord","useEntityBlockEditor","id","isMissing","setBlockEditingMode","__unstableMarkLastChangeAsPersistent","useDispatch","blockEditorStore","userCanEdit","onNavigateToEntityRecord","editingMode","hasPatternOverridesSource","useSelect","select","canUser","coreStore","getBlocks","getSettings","getBlockEditingMode","_getBlockEditingMode","getBlockBindingsSource","blocksStore","canEdit","useEffect","canOverrideBlocks","layoutClasses","className","clsx","innerBlocksProps","useInnerBlocksProps","templateLock","value","onInput","onChange","renderAppender","ButtonBlockAppender","handleEditOriginal","postId","postType","resetContent","Placeholder","Spinner","jsxs","Fragment","BlockControls","ToolbarGroup","ToolbarButton","onClick","disabled","__experimentalIsFocusable"],"sources":["@wordpress/block-library/src/block/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useRef, useMemo, useEffect } from '@wordpress/element';\nimport {\n\tuseEntityRecord,\n\tstore as coreStore,\n\tuseEntityBlockEditor,\n} from '@wordpress/core-data';\nimport {\n\tPlaceholder,\n\tSpinner,\n\tToolbarButton,\n\tToolbarGroup,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tuseInnerBlocksProps,\n\tRecursionProvider,\n\tuseHasRecursion,\n\tuseBlockProps,\n\tWarning,\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n\tBlockControls,\n} from '@wordpress/block-editor';\nimport { privateApis as patternsPrivateApis } from '@wordpress/patterns';\nimport { store as blocksStore } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { name as patternBlockName } from './index';\nimport { unlock } from '../lock-unlock';\n\nconst { useLayoutClasses } = unlock( blockEditorPrivateApis );\nconst { isOverridableBlock, hasOverridableBlocks } =\n\tunlock( patternsPrivateApis );\n\nconst fullAlignments = [ 'full', 'wide', 'left', 'right' ];\n\nconst useInferredLayout = ( blocks, parentLayout ) => {\n\tconst initialInferredAlignmentRef = useRef();\n\n\treturn useMemo( () => {\n\t\t// Exit early if the pattern's blocks haven't loaded yet.\n\t\tif ( ! blocks?.length ) {\n\t\t\treturn {};\n\t\t}\n\n\t\tlet alignment = initialInferredAlignmentRef.current;\n\n\t\t// Only track the initial alignment so that temporarily removed\n\t\t// alignments can be reapplied.\n\t\tif ( alignment === undefined ) {\n\t\t\tconst isConstrained = parentLayout?.type === 'constrained';\n\t\t\tconst hasFullAlignment = blocks.some( ( block ) =>\n\t\t\t\tfullAlignments.includes( block.attributes.align )\n\t\t\t);\n\n\t\t\talignment = isConstrained && hasFullAlignment ? 'full' : null;\n\t\t\tinitialInferredAlignmentRef.current = alignment;\n\t\t}\n\n\t\tconst layout = alignment ? parentLayout : undefined;\n\n\t\treturn { alignment, layout };\n\t}, [ blocks, parentLayout ] );\n};\n\nfunction setBlockEditMode( setEditMode, blocks, mode ) {\n\tblocks.forEach( ( block ) => {\n\t\tconst editMode =\n\t\t\tmode ||\n\t\t\t( isOverridableBlock( block ) ? 'contentOnly' : 'disabled' );\n\t\tsetEditMode( block.clientId, editMode );\n\n\t\tsetBlockEditMode(\n\t\t\tsetEditMode,\n\t\t\tblock.innerBlocks,\n\t\t\t// Disable editing for nested patterns.\n\t\t\tblock.name === patternBlockName ? 'disabled' : mode\n\t\t);\n\t} );\n}\n\nfunction RecursionWarning() {\n\tconst blockProps = useBlockProps();\n\treturn (\n\t\t<div { ...blockProps }>\n\t\t\t<Warning>\n\t\t\t\t{ __( 'Block cannot be rendered inside itself.' ) }\n\t\t\t</Warning>\n\t\t</div>\n\t);\n}\n\nconst NOOP = () => {};\n\n// Wrap the main Edit function for the pattern block with a recursion wrapper\n// that allows short-circuiting rendering as early as possible, before any\n// of the other effects in the block edit have run.\nexport default function ReusableBlockEditRecursionWrapper( props ) {\n\tconst { ref } = props.attributes;\n\tconst hasAlreadyRendered = useHasRecursion( ref );\n\n\tif ( hasAlreadyRendered ) {\n\t\treturn <RecursionWarning />;\n\t}\n\n\treturn (\n\t\t<RecursionProvider uniqueId={ ref }>\n\t\t\t<ReusableBlockEdit { ...props } />\n\t\t</RecursionProvider>\n\t);\n}\n\nfunction ReusableBlockEdit( {\n\tname,\n\tattributes: { ref, content },\n\t__unstableParentLayout: parentLayout,\n\tclientId: patternClientId,\n\tsetAttributes,\n} ) {\n\tconst { record, hasResolved } = useEntityRecord(\n\t\t'postType',\n\t\t'wp_block',\n\t\tref\n\t);\n\tconst [ blocks ] = useEntityBlockEditor( 'postType', 'wp_block', {\n\t\tid: ref,\n\t} );\n\tconst isMissing = hasResolved && ! record;\n\n\tconst { setBlockEditingMode, __unstableMarkLastChangeAsPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\n\tconst {\n\t\tinnerBlocks,\n\t\tuserCanEdit,\n\t\tonNavigateToEntityRecord,\n\t\teditingMode,\n\t\thasPatternOverridesSource,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst { canUser } = select( coreStore );\n\t\t\tconst {\n\t\t\t\tgetBlocks,\n\t\t\t\tgetSettings,\n\t\t\t\tgetBlockEditingMode: _getBlockEditingMode,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst { getBlockBindingsSource } = unlock( select( blocksStore ) );\n\t\t\tconst canEdit = canUser( 'update', 'blocks', ref );\n\n\t\t\t// For editing link to the site editor if the theme and user permissions support it.\n\t\t\treturn {\n\t\t\t\tinnerBlocks: getBlocks( patternClientId ),\n\t\t\t\tuserCanEdit: canEdit,\n\t\t\t\tgetBlockEditingMode: _getBlockEditingMode,\n\t\t\t\tonNavigateToEntityRecord:\n\t\t\t\t\tgetSettings().onNavigateToEntityRecord,\n\t\t\t\teditingMode: _getBlockEditingMode( patternClientId ),\n\t\t\t\thasPatternOverridesSource: !! getBlockBindingsSource(\n\t\t\t\t\t'core/pattern-overrides'\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t[ patternClientId, ref ]\n\t);\n\n\t// Sync the editing mode of the pattern block with the inner blocks.\n\tuseEffect( () => {\n\t\tsetBlockEditMode(\n\t\t\tsetBlockEditingMode,\n\t\t\tinnerBlocks,\n\t\t\t// Disable editing if the pattern itself is disabled.\n\t\t\teditingMode === 'disabled' || ! hasPatternOverridesSource\n\t\t\t\t? 'disabled'\n\t\t\t\t: undefined\n\t\t);\n\t}, [\n\t\teditingMode,\n\t\tinnerBlocks,\n\t\tsetBlockEditingMode,\n\t\thasPatternOverridesSource,\n\t] );\n\n\tconst canOverrideBlocks = useMemo(\n\t\t() => hasPatternOverridesSource && hasOverridableBlocks( blocks ),\n\t\t[ hasPatternOverridesSource, blocks ]\n\t);\n\n\tconst { alignment, layout } = useInferredLayout( blocks, parentLayout );\n\tconst layoutClasses = useLayoutClasses( { layout }, name );\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx(\n\t\t\t'block-library-block__reusable-block-container',\n\t\t\tlayout && layoutClasses,\n\t\t\t{ [ `align${ alignment }` ]: alignment }\n\t\t),\n\t} );\n\n\t// Use `blocks` variable until `innerBlocks` is populated, which has the proper clientIds.\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\ttemplateLock: 'all',\n\t\tlayout,\n\t\tvalue: innerBlocks.length > 0 ? innerBlocks : blocks,\n\t\tonInput: NOOP,\n\t\tonChange: NOOP,\n\t\trenderAppender: blocks?.length ? undefined : blocks.ButtonBlockAppender,\n\t} );\n\n\tconst handleEditOriginal = () => {\n\t\tonNavigateToEntityRecord( {\n\t\t\tpostId: ref,\n\t\t\tpostType: 'wp_block',\n\t\t} );\n\t};\n\n\tconst resetContent = () => {\n\t\tif ( content ) {\n\t\t\t// Make sure any previous changes are persisted before resetting.\n\t\t\t__unstableMarkLastChangeAsPersistent();\n\t\t\tsetAttributes( { content: undefined } );\n\t\t}\n\t};\n\n\tlet children = null;\n\n\tif ( isMissing ) {\n\t\tchildren = (\n\t\t\t<Warning>\n\t\t\t\t{ __( 'Block has been deleted or is unavailable.' ) }\n\t\t\t</Warning>\n\t\t);\n\t}\n\n\tif ( ! hasResolved ) {\n\t\tchildren = (\n\t\t\t<Placeholder>\n\t\t\t\t<Spinner />\n\t\t\t</Placeholder>\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ userCanEdit && onNavigateToEntityRecord && (\n\t\t\t\t<BlockControls>\n\t\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t\t<ToolbarButton onClick={ handleEditOriginal }>\n\t\t\t\t\t\t\t{ __( 'Edit original' ) }\n\t\t\t\t\t\t</ToolbarButton>\n\t\t\t\t\t</ToolbarGroup>\n\t\t\t\t</BlockControls>\n\t\t\t) }\n\n\t\t\t{ canOverrideBlocks && (\n\t\t\t\t<BlockControls>\n\t\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\tonClick={ resetContent }\n\t\t\t\t\t\t\tdisabled={ ! content }\n\t\t\t\t\t\t\t__experimentalIsFocusable\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Reset' ) }\n\t\t\t\t\t\t</ToolbarButton>\n\t\t\t\t\t</ToolbarGroup>\n\t\t\t\t</BlockControls>\n\t\t\t) }\n\n\t\t\t{ children === null ? (\n\t\t\t\t<div { ...innerBlocksProps } />\n\t\t\t) : (\n\t\t\t\t<div { ...blockProps }>{ children }</div>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,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AAA9D,QAAA,eACb,IAAAxC,WAAA,CAAAuC,GAAA,EAAC9C,WAAA,CAAA8G,YAAY;QAAA/D,QAAA,eACZ,IAAAxC,WAAA,CAAAuC,GAAA,EAAC9C,WAAA,CAAA+G,aAAa;UAACC,OAAO,EAAGX,kBAAoB;UAAAtD,QAAA,EAC1C,IAAAE,QAAE,EAAE,eAAgB;QAAC,CACT;MAAC,CACH;IAAC,CACD,CACf,EAECwC,iBAAiB,iBAClB,IAAAlF,WAAA,CAAAuC,GAAA,EAAC5C,YAAA,CAAA2G,aAAa;MAAA9D,QAAA,eACb,IAAAxC,WAAA,CAAAuC,GAAA,EAAC9C,WAAA,CAAA8G,YAAY;QAAA/D,QAAA,eACZ,IAAAxC,WAAA,CAAAuC,GAAA,EAAC9C,WAAA,CAAA+G,aAAa;UACbC,OAAO,EAAGR,YAAc;UACxBS,QAAQ,EAAG,CAAEtD,OAAS;UACtBuD,yBAAyB;UAAAnE,QAAA,EAEvB,IAAAE,QAAE,EAAE,OAAQ;QAAC,CACD;MAAC,CACH;IAAC,CACD,CACf,EAECF,QAAQ,KAAK,IAAI,gBAClB,IAAAxC,WAAA,CAAAuC,GAAA;MAAA,GAAU+C;IAAgB,CAAI,CAAC,gBAE/B,IAAAtF,WAAA,CAAAuC,GAAA;MAAA,GAAUF,UAAU;MAAAG,QAAA,EAAKA;IAAQ,CAAO,CACxC;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_data","_element","_coreData","_components","_i18n","_blockEditor","_patterns","_blocks","_index","_lockUnlock","_jsxRuntime","useLayoutClasses","unlock","blockEditorPrivateApis","isOverridableBlock","hasOverridableBlocks","patternsPrivateApis","fullAlignments","useInferredLayout","blocks","parentLayout","initialInferredAlignmentRef","useRef","useMemo","length","alignment","current","undefined","isConstrained","type","hasFullAlignment","some","block","includes","attributes","align","layout","setBlockEditMode","setEditMode","mode","forEach","editMode","clientId","innerBlocks","name","patternBlockName","RecursionWarning","blockProps","useBlockProps","jsx","children","Warning","__","NOOP","ReusableBlockEditRecursionWrapper","props","ref","hasAlreadyRendered","useHasRecursion","RecursionProvider","uniqueId","ReusableBlockEdit","content","__unstableParentLayout","patternClientId","setAttributes","record","hasResolved","useEntityRecord","useEntityBlockEditor","id","isMissing","setBlockEditingMode","__unstableMarkLastChangeAsPersistent","useDispatch","blockEditorStore","userCanEdit","onNavigateToEntityRecord","editingMode","hasPatternOverridesSource","useSelect","select","canUser","coreStore","getBlocks","getSettings","getBlockEditingMode","_getBlockEditingMode","getBlockBindingsSource","blocksStore","canEdit","useEffect","canOverrideBlocks","layoutClasses","className","clsx","innerBlocksProps","useInnerBlocksProps","templateLock","value","onInput","onChange","renderAppender","ButtonBlockAppender","handleEditOriginal","postId","postType","resetContent","Placeholder","Spinner","jsxs","Fragment","BlockControls","ToolbarGroup","ToolbarButton","onClick","disabled"],"sources":["@wordpress/block-library/src/block/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useRef, useMemo, useEffect } from '@wordpress/element';\nimport {\n\tuseEntityRecord,\n\tstore as coreStore,\n\tuseEntityBlockEditor,\n} from '@wordpress/core-data';\nimport {\n\tPlaceholder,\n\tSpinner,\n\tToolbarButton,\n\tToolbarGroup,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tuseInnerBlocksProps,\n\tRecursionProvider,\n\tuseHasRecursion,\n\tuseBlockProps,\n\tWarning,\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n\tBlockControls,\n} from '@wordpress/block-editor';\nimport { privateApis as patternsPrivateApis } from '@wordpress/patterns';\nimport { store as blocksStore } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { name as patternBlockName } from './index';\nimport { unlock } from '../lock-unlock';\n\nconst { useLayoutClasses } = unlock( blockEditorPrivateApis );\nconst { isOverridableBlock, hasOverridableBlocks } =\n\tunlock( patternsPrivateApis );\n\nconst fullAlignments = [ 'full', 'wide', 'left', 'right' ];\n\nconst useInferredLayout = ( blocks, parentLayout ) => {\n\tconst initialInferredAlignmentRef = useRef();\n\n\treturn useMemo( () => {\n\t\t// Exit early if the pattern's blocks haven't loaded yet.\n\t\tif ( ! blocks?.length ) {\n\t\t\treturn {};\n\t\t}\n\n\t\tlet alignment = initialInferredAlignmentRef.current;\n\n\t\t// Only track the initial alignment so that temporarily removed\n\t\t// alignments can be reapplied.\n\t\tif ( alignment === undefined ) {\n\t\t\tconst isConstrained = parentLayout?.type === 'constrained';\n\t\t\tconst hasFullAlignment = blocks.some( ( block ) =>\n\t\t\t\tfullAlignments.includes( block.attributes.align )\n\t\t\t);\n\n\t\t\talignment = isConstrained && hasFullAlignment ? 'full' : null;\n\t\t\tinitialInferredAlignmentRef.current = alignment;\n\t\t}\n\n\t\tconst layout = alignment ? parentLayout : undefined;\n\n\t\treturn { alignment, layout };\n\t}, [ blocks, parentLayout ] );\n};\n\nfunction setBlockEditMode( setEditMode, blocks, mode ) {\n\tblocks.forEach( ( block ) => {\n\t\tconst editMode =\n\t\t\tmode ||\n\t\t\t( isOverridableBlock( block ) ? 'contentOnly' : 'disabled' );\n\t\tsetEditMode( block.clientId, editMode );\n\n\t\tsetBlockEditMode(\n\t\t\tsetEditMode,\n\t\t\tblock.innerBlocks,\n\t\t\t// Disable editing for nested patterns.\n\t\t\tblock.name === patternBlockName ? 'disabled' : mode\n\t\t);\n\t} );\n}\n\nfunction RecursionWarning() {\n\tconst blockProps = useBlockProps();\n\treturn (\n\t\t<div { ...blockProps }>\n\t\t\t<Warning>\n\t\t\t\t{ __( 'Block cannot be rendered inside itself.' ) }\n\t\t\t</Warning>\n\t\t</div>\n\t);\n}\n\nconst NOOP = () => {};\n\n// Wrap the main Edit function for the pattern block with a recursion wrapper\n// that allows short-circuiting rendering as early as possible, before any\n// of the other effects in the block edit have run.\nexport default function ReusableBlockEditRecursionWrapper( props ) {\n\tconst { ref } = props.attributes;\n\tconst hasAlreadyRendered = useHasRecursion( ref );\n\n\tif ( hasAlreadyRendered ) {\n\t\treturn <RecursionWarning />;\n\t}\n\n\treturn (\n\t\t<RecursionProvider uniqueId={ ref }>\n\t\t\t<ReusableBlockEdit { ...props } />\n\t\t</RecursionProvider>\n\t);\n}\n\nfunction ReusableBlockEdit( {\n\tname,\n\tattributes: { ref, content },\n\t__unstableParentLayout: parentLayout,\n\tclientId: patternClientId,\n\tsetAttributes,\n} ) {\n\tconst { record, hasResolved } = useEntityRecord(\n\t\t'postType',\n\t\t'wp_block',\n\t\tref\n\t);\n\tconst [ blocks ] = useEntityBlockEditor( 'postType', 'wp_block', {\n\t\tid: ref,\n\t} );\n\tconst isMissing = hasResolved && ! record;\n\n\tconst { setBlockEditingMode, __unstableMarkLastChangeAsPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\n\tconst {\n\t\tinnerBlocks,\n\t\tuserCanEdit,\n\t\tonNavigateToEntityRecord,\n\t\teditingMode,\n\t\thasPatternOverridesSource,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst { canUser } = select( coreStore );\n\t\t\tconst {\n\t\t\t\tgetBlocks,\n\t\t\t\tgetSettings,\n\t\t\t\tgetBlockEditingMode: _getBlockEditingMode,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst { getBlockBindingsSource } = unlock( select( blocksStore ) );\n\t\t\tconst canEdit = canUser( 'update', 'blocks', ref );\n\n\t\t\t// For editing link to the site editor if the theme and user permissions support it.\n\t\t\treturn {\n\t\t\t\tinnerBlocks: getBlocks( patternClientId ),\n\t\t\t\tuserCanEdit: canEdit,\n\t\t\t\tgetBlockEditingMode: _getBlockEditingMode,\n\t\t\t\tonNavigateToEntityRecord:\n\t\t\t\t\tgetSettings().onNavigateToEntityRecord,\n\t\t\t\teditingMode: _getBlockEditingMode( patternClientId ),\n\t\t\t\thasPatternOverridesSource: !! getBlockBindingsSource(\n\t\t\t\t\t'core/pattern-overrides'\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t[ patternClientId, ref ]\n\t);\n\n\t// Sync the editing mode of the pattern block with the inner blocks.\n\tuseEffect( () => {\n\t\tsetBlockEditMode(\n\t\t\tsetBlockEditingMode,\n\t\t\tinnerBlocks,\n\t\t\t// Disable editing if the pattern itself is disabled.\n\t\t\teditingMode === 'disabled' || ! hasPatternOverridesSource\n\t\t\t\t? 'disabled'\n\t\t\t\t: undefined\n\t\t);\n\t}, [\n\t\teditingMode,\n\t\tinnerBlocks,\n\t\tsetBlockEditingMode,\n\t\thasPatternOverridesSource,\n\t] );\n\n\tconst canOverrideBlocks = useMemo(\n\t\t() => hasPatternOverridesSource && hasOverridableBlocks( blocks ),\n\t\t[ hasPatternOverridesSource, blocks ]\n\t);\n\n\tconst { alignment, layout } = useInferredLayout( blocks, parentLayout );\n\tconst layoutClasses = useLayoutClasses( { layout }, name );\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx(\n\t\t\t'block-library-block__reusable-block-container',\n\t\t\tlayout && layoutClasses,\n\t\t\t{ [ `align${ alignment }` ]: alignment }\n\t\t),\n\t} );\n\n\t// Use `blocks` variable until `innerBlocks` is populated, which has the proper clientIds.\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\ttemplateLock: 'all',\n\t\tlayout,\n\t\tvalue: innerBlocks.length > 0 ? innerBlocks : blocks,\n\t\tonInput: NOOP,\n\t\tonChange: NOOP,\n\t\trenderAppender: blocks?.length ? undefined : blocks.ButtonBlockAppender,\n\t} );\n\n\tconst handleEditOriginal = () => {\n\t\tonNavigateToEntityRecord( {\n\t\t\tpostId: ref,\n\t\t\tpostType: 'wp_block',\n\t\t} );\n\t};\n\n\tconst resetContent = () => {\n\t\tif ( content ) {\n\t\t\t// Make sure any previous changes are persisted before resetting.\n\t\t\t__unstableMarkLastChangeAsPersistent();\n\t\t\tsetAttributes( { content: undefined } );\n\t\t}\n\t};\n\n\tlet children = null;\n\n\tif ( isMissing ) {\n\t\tchildren = (\n\t\t\t<Warning>\n\t\t\t\t{ __( 'Block has been deleted or is unavailable.' ) }\n\t\t\t</Warning>\n\t\t);\n\t}\n\n\tif ( ! hasResolved ) {\n\t\tchildren = (\n\t\t\t<Placeholder>\n\t\t\t\t<Spinner />\n\t\t\t</Placeholder>\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ userCanEdit && onNavigateToEntityRecord && (\n\t\t\t\t<BlockControls>\n\t\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t\t<ToolbarButton onClick={ handleEditOriginal }>\n\t\t\t\t\t\t\t{ __( 'Edit original' ) }\n\t\t\t\t\t\t</ToolbarButton>\n\t\t\t\t\t</ToolbarGroup>\n\t\t\t\t</BlockControls>\n\t\t\t) }\n\n\t\t\t{ canOverrideBlocks && (\n\t\t\t\t<BlockControls>\n\t\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\tonClick={ resetContent }\n\t\t\t\t\t\t\tdisabled={ ! content }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Reset' ) }\n\t\t\t\t\t\t</ToolbarButton>\n\t\t\t\t\t</ToolbarGroup>\n\t\t\t\t</BlockControls>\n\t\t\t) }\n\n\t\t\t{ children === null ? (\n\t\t\t\t<div { ...innerBlocksProps } />\n\t\t\t) : (\n\t\t\t\t<div { ...blockProps }>{ children }</div>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AAKA,IAAAI,WAAA,GAAAJ,OAAA;AAMA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AAUA,IAAAO,SAAA,GAAAP,OAAA;AACA,IA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T;MAAC,CACH;IAAC,CACD,CACf,EAECwC,iBAAiB,iBAClB,IAAAlF,WAAA,CAAAuC,GAAA,EAAC5C,YAAA,CAAA2G,aAAa;MAAA9D,QAAA,eACb,IAAAxC,WAAA,CAAAuC,GAAA,EAAC9C,WAAA,CAAA8G,YAAY;QAAA/D,QAAA,eACZ,IAAAxC,WAAA,CAAAuC,GAAA,EAAC9C,WAAA,CAAA+G,aAAa;UACbC,OAAO,EAAGR,YAAc;UACxBS,QAAQ,EAAG,CAAEtD,OAAS;UAAAZ,QAAA,EAEpB,IAAAE,QAAE,EAAE,OAAQ;QAAC,CACD;MAAC,CACH;IAAC,CACD,CACf,EAECF,QAAQ,KAAK,IAAI,gBAClB,IAAAxC,WAAA,CAAAuC,GAAA;MAAA,GAAU+C;IAAgB,CAAI,CAAC,gBAE/B,IAAAtF,WAAA,CAAAuC,GAAA;MAAA,GAAUF,UAAU;MAAAG,QAAA,EAAKA;IAAQ,CAAO,CACxC;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
|
package/build/block/index.js
CHANGED
|
@@ -32,9 +32,13 @@ const metadata = exports.metadata = {
|
|
|
32
32
|
type: "number"
|
|
33
33
|
},
|
|
34
34
|
content: {
|
|
35
|
-
type: "object"
|
|
35
|
+
type: "object",
|
|
36
|
+
"default": {}
|
|
36
37
|
}
|
|
37
38
|
},
|
|
39
|
+
providesContext: {
|
|
40
|
+
"pattern/overrides": "content"
|
|
41
|
+
},
|
|
38
42
|
supports: {
|
|
39
43
|
customClassName: false,
|
|
40
44
|
html: false,
|
package/build/block/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_icons","require","_coreData","_data","_htmlEntities","_initBlock","_interopRequireDefault","_edit","_deprecated","metadata","exports","$schema","apiVersion","name","title","category","description","keywords","textdomain","attributes","ref","type","content","supports","customClassName","html","inserter","renaming","interactivity","clientNavigation","settings","deprecated","edit","icon","__experimentalLabel","entity","select","coreStore","getEditedEntityRecord","decodeEntities","init","initBlock"],"sources":["@wordpress/block-library/src/block/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { symbol as icon } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { select } from '@wordpress/data';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport deprecated from './deprecated';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\tdeprecated,\n\tedit,\n\ticon,\n\t__experimentalLabel: ( { ref } ) => {\n\t\tif ( ! ref ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst entity = select( coreStore ).getEditedEntityRecord(\n\t\t\t'postType',\n\t\t\t'wp_block',\n\t\t\tref\n\t\t);\n\t\tif ( ! entity?.title ) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn decodeEntities( entity.title );\n\t},\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":";;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AAKA,IAAAI,UAAA,GAAAC,sBAAA,CAAAL,OAAA;AAEA,IAAAM,KAAA,GAAAD,sBAAA,CAAAL,OAAA;AACA,IAAAO,WAAA,GAAAF,sBAAA,CAAAL,OAAA;AAdA;AACA;AACA;AAMA;AACA;AACA;AAFA,MAAAQ,QAAA,GAAAC,OAAA,CAAAD,QAAA;EAAAE,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,WAAA;EAAAC,QAAA;EAAAC,UAAA;EAAAC,UAAA;IAAAC,GAAA;MAAAC,IAAA;IAAA;IAAAC,OAAA;MAAAD,IAAA;IAAA;EAAA;EAAAE,QAAA;IAAAC,eAAA;IAAAC,IAAA;IAAAC,QAAA;IAAAC,QAAA;IAAAC,aAAA;MAAAC,gBAAA;IAAA;EAAA;AAAA;AAQA,MAAM;
|
|
1
|
+
{"version":3,"names":["_icons","require","_coreData","_data","_htmlEntities","_initBlock","_interopRequireDefault","_edit","_deprecated","metadata","exports","$schema","apiVersion","name","title","category","description","keywords","textdomain","attributes","ref","type","content","providesContext","supports","customClassName","html","inserter","renaming","interactivity","clientNavigation","settings","deprecated","edit","icon","__experimentalLabel","entity","select","coreStore","getEditedEntityRecord","decodeEntities","init","initBlock"],"sources":["@wordpress/block-library/src/block/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { symbol as icon } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { select } from '@wordpress/data';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport deprecated from './deprecated';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\tdeprecated,\n\tedit,\n\ticon,\n\t__experimentalLabel: ( { ref } ) => {\n\t\tif ( ! ref ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst entity = select( coreStore ).getEditedEntityRecord(\n\t\t\t'postType',\n\t\t\t'wp_block',\n\t\t\tref\n\t\t);\n\t\tif ( ! entity?.title ) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn decodeEntities( entity.title );\n\t},\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":";;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AAKA,IAAAI,UAAA,GAAAC,sBAAA,CAAAL,OAAA;AAEA,IAAAM,KAAA,GAAAD,sBAAA,CAAAL,OAAA;AACA,IAAAO,WAAA,GAAAF,sBAAA,CAAAL,OAAA;AAdA;AACA;AACA;AAMA;AACA;AACA;AAFA,MAAAQ,QAAA,GAAAC,OAAA,CAAAD,QAAA;EAAAE,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,WAAA;EAAAC,QAAA;EAAAC,UAAA;EAAAC,UAAA;IAAAC,GAAA;MAAAC,IAAA;IAAA;IAAAC,OAAA;MAAAD,IAAA;MAAA;IAAA;EAAA;EAAAE,eAAA;IAAA;EAAA;EAAAC,QAAA;IAAAC,eAAA;IAAAC,IAAA;IAAAC,QAAA;IAAAC,QAAA;IAAAC,aAAA;MAAAC,gBAAA;IAAA;EAAA;AAAA;AAQA,MAAM;EAAEjB;AAAK,CAAC,GAAGJ,QAAQ;AAACC,OAAA,CAAAG,IAAA,GAAAA,IAAA;AAInB,MAAMkB,QAAQ,GAAArB,OAAA,CAAAqB,QAAA,GAAG;EACvBC,UAAU,EAAVA,mBAAU;EACVC,IAAI,EAAJA,aAAI;EACJC,IAAI,EAAJA,aAAI;EACJC,mBAAmB,EAAEA,CAAE;IAAEf;EAAI,CAAC,KAAM;IACnC,IAAK,CAAEA,GAAG,EAAG;MACZ;IACD;IAEA,MAAMgB,MAAM,GAAG,IAAAC,YAAM,EAAEC,eAAU,CAAC,CAACC,qBAAqB,CACvD,UAAU,EACV,UAAU,EACVnB,GACD,CAAC;IACD,IAAK,CAAEgB,MAAM,EAAEtB,KAAK,EAAG;MACtB;IACD;IAEA,OAAO,IAAA0B,4BAAc,EAAEJ,MAAM,CAACtB,KAAM,CAAC;EACtC;AACD,CAAC;AAEM,MAAM2B,IAAI,GAAGA,CAAA,KAAM,IAAAC,kBAAS,EAAE;EAAE7B,IAAI;EAAEJ,QAAQ;EAAEsB;AAAS,CAAE,CAAC;AAACrB,OAAA,CAAA+B,IAAA,GAAAA,IAAA","ignoreList":[]}
|
package/build/button/index.js
CHANGED
|
@@ -112,6 +112,7 @@ const metadata = exports.metadata = {
|
|
|
112
112
|
__experimentalTextTransform: true,
|
|
113
113
|
__experimentalTextDecoration: true,
|
|
114
114
|
__experimentalLetterSpacing: true,
|
|
115
|
+
__experimentalWritingMode: true,
|
|
115
116
|
__experimentalDefaultControls: {
|
|
116
117
|
fontSize: true
|
|
117
118
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_icons","_initBlock","_interopRequireDefault","_deprecated","_edit","_save","metadata","exports","$schema","apiVersion","name","title","category","parent","description","keywords","textdomain","attributes","tagName","type","textAlign","url","source","selector","attribute","__experimentalRole","text","linkTarget","rel","placeholder","backgroundColor","textColor","gradient","width","supports","anchor","splitting","align","alignWide","color","__experimentalSkipSerialization","gradients","__experimentalDefaultControls","background","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","reusable","shadow","spacing","padding","__experimentalBorder","radius","style","__experimentalSelector","interactivity","clientNavigation","styles","label","isDefault","editorStyle","settings","icon","example","className","__","edit","save","deprecated","merge","a","init","initBlock"],"sources":["@wordpress/block-library/src/button/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { button as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tclassName: 'is-style-fill',\n\t\t\ttext: __( 'Call to Action' ),\n\t\t},\n\t},\n\tedit,\n\tsave,\n\tdeprecated,\n\tmerge: ( a, { text = '' } ) => ( {\n\t\t...a,\n\t\ttext: ( a.text || '' ) + text,\n\t} ),\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAKA,IAAAE,UAAA,GAAAC,sBA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IAAAkB,UAAA;MAAAC,QAAA;MAAAC,UAAA;MAAAC,wBAAA;MAAAC,wBAAA;MAAAC,uBAAA;MAAAC,2BAAA;MAAAC,4BAAA;MAAAC,2BAAA;
|
|
1
|
+
{"version":3,"names":["_i18n","require","_icons","_initBlock","_interopRequireDefault","_deprecated","_edit","_save","metadata","exports","$schema","apiVersion","name","title","category","parent","description","keywords","textdomain","attributes","tagName","type","textAlign","url","source","selector","attribute","__experimentalRole","text","linkTarget","rel","placeholder","backgroundColor","textColor","gradient","width","supports","anchor","splitting","align","alignWide","color","__experimentalSkipSerialization","gradients","__experimentalDefaultControls","background","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","__experimentalWritingMode","reusable","shadow","spacing","padding","__experimentalBorder","radius","style","__experimentalSelector","interactivity","clientNavigation","styles","label","isDefault","editorStyle","settings","icon","example","className","__","edit","save","deprecated","merge","a","init","initBlock"],"sources":["@wordpress/block-library/src/button/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { button as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tclassName: 'is-style-fill',\n\t\t\ttext: __( 'Call to Action' ),\n\t\t},\n\t},\n\tedit,\n\tsave,\n\tdeprecated,\n\tmerge: ( a, { text = '' } ) => ( {\n\t\t...a,\n\t\ttext: ( a.text || '' ) + text,\n\t} ),\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAKA,IAAAE,UAAA,GAAAC,sBAAA,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AAMoD,IAAI,GAAGA,CAAA,KAAM,IAAAC,kBAAS,EAAE;EAAErE,IAAI;EAAEJ,QAAQ;EAAE8D;AAAS,CAAE,CAAC;AAAC7D,OAAA,CAAAuE,IAAA,GAAAA,IAAA","ignoreList":[]}
|
|
@@ -12,6 +12,7 @@ var _components = require("@wordpress/components");
|
|
|
12
12
|
var _blockEditor = require("@wordpress/block-editor");
|
|
13
13
|
var _element = require("@wordpress/element");
|
|
14
14
|
var _blocks = require("@wordpress/blocks");
|
|
15
|
+
var _url = require("@wordpress/url");
|
|
15
16
|
var _wpEmbedPreview = _interopRequireDefault(require("./wp-embed-preview"));
|
|
16
17
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
18
|
/**
|
|
@@ -80,11 +81,10 @@ class EmbedPreview extends _element.Component {
|
|
|
80
81
|
interactive
|
|
81
82
|
} = this.state;
|
|
82
83
|
const html = 'photo' === type ? (0, _util.getPhotoHtml)(preview) : preview.html;
|
|
83
|
-
const
|
|
84
|
-
const parsedHostBaseUrl = parsedHost.splice(parsedHost.length - 2, parsedHost.length - 1).join('.');
|
|
84
|
+
const embedSourceUrl = (0, _url.getAuthority)(url);
|
|
85
85
|
const iframeTitle = (0, _i18n.sprintf)(
|
|
86
86
|
// translators: %s: host providing embed content e.g: www.youtube.com
|
|
87
|
-
(0, _i18n.__)('Embedded content from %s'),
|
|
87
|
+
(0, _i18n.__)('Embedded content from %s'), embedSourceUrl);
|
|
88
88
|
const sandboxClassnames = (0, _clsx.default)(type, className, 'wp-block-embed__wrapper');
|
|
89
89
|
|
|
90
90
|
// Disabled because the overlay div doesn't actually have a role or functionality
|
|
@@ -127,7 +127,7 @@ class EmbedPreview extends _element.Component {
|
|
|
127
127
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
128
128
|
className: "components-placeholder__error",
|
|
129
129
|
children: (0, _i18n.sprintf)( /* translators: %s: host providing embed content e.g: www.youtube.com */
|
|
130
|
-
(0, _i18n.__)("Embedded content from %s can't be previewed in the editor."),
|
|
130
|
+
(0, _i18n.__)("Embedded content from %s can't be previewed in the editor."), embedSourceUrl)
|
|
131
131
|
})]
|
|
132
132
|
}), (!_blockEditor.RichText.isEmpty(caption) || isSelected) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.RichText, {
|
|
133
133
|
identifier: "caption",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_util","require","_clsx","_interopRequireDefault","_i18n","_components","_blockEditor","_element","_blocks","_wpEmbedPreview","_jsxRuntime","EmbedPreview","Component","constructor","arguments","hideOverlay","bind","state","interactive","getDerivedStateFromProps","nextProps","isSelected","setState","render","preview","previewable","url","type","caption","onCaptionChange","className","icon","label","insertBlocksAfter","props","scripts","html","getPhotoHtml","
|
|
1
|
+
{"version":3,"names":["_util","require","_clsx","_interopRequireDefault","_i18n","_components","_blockEditor","_element","_blocks","_url","_wpEmbedPreview","_jsxRuntime","EmbedPreview","Component","constructor","arguments","hideOverlay","bind","state","interactive","getDerivedStateFromProps","nextProps","isSelected","setState","render","preview","previewable","url","type","caption","onCaptionChange","className","icon","label","insertBlocksAfter","props","scripts","html","getPhotoHtml","embedSourceUrl","getAuthority","iframeTitle","sprintf","__","sandboxClassnames","clsx","embedWrapper","jsx","default","jsxs","children","SandBox","title","onFocus","onMouseUp","Placeholder","BlockIcon","showColors","href","RichText","isEmpty","identifier","tagName","__experimentalGetElementClassName","placeholder","value","onChange","inlineToolbar","__unstableOnSplitAtEnd","createBlock","getDefaultBlockName","_default","exports"],"sources":["@wordpress/block-library/src/embed/embed-preview.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { getPhotoHtml } from './util';\n\n/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Placeholder, SandBox } from '@wordpress/components';\nimport {\n\tRichText,\n\tBlockIcon,\n\t__experimentalGetElementClassName,\n} from '@wordpress/block-editor';\nimport { Component } from '@wordpress/element';\nimport { createBlock, getDefaultBlockName } from '@wordpress/blocks';\nimport { getAuthority } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport WpEmbedPreview from './wp-embed-preview';\n\nclass EmbedPreview extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\t\tthis.hideOverlay = this.hideOverlay.bind( this );\n\t\tthis.state = {\n\t\t\tinteractive: false,\n\t\t};\n\t}\n\n\tstatic getDerivedStateFromProps( nextProps, state ) {\n\t\tif ( ! nextProps.isSelected && state.interactive ) {\n\t\t\t// We only want to change this when the block is not selected, because changing it when\n\t\t\t// the block becomes selected makes the overlap disappear too early. Hiding the overlay\n\t\t\t// happens on mouseup when the overlay is clicked.\n\t\t\treturn { interactive: false };\n\t\t}\n\n\t\treturn null;\n\t}\n\n\thideOverlay() {\n\t\t// This is called onMouseUp on the overlay. We can't respond to the `isSelected` prop\n\t\t// changing, because that happens on mouse down, and the overlay immediately disappears,\n\t\t// and the mouse event can end up in the preview content. We can't use onClick on\n\t\t// the overlay to hide it either, because then the editor misses the mouseup event, and\n\t\t// thinks we're multi-selecting blocks.\n\t\tthis.setState( { interactive: true } );\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tpreview,\n\t\t\tpreviewable,\n\t\t\turl,\n\t\t\ttype,\n\t\t\tcaption,\n\t\t\tonCaptionChange,\n\t\t\tisSelected,\n\t\t\tclassName,\n\t\t\ticon,\n\t\t\tlabel,\n\t\t\tinsertBlocksAfter,\n\t\t} = this.props;\n\t\tconst { scripts } = preview;\n\t\tconst { interactive } = this.state;\n\n\t\tconst html = 'photo' === type ? getPhotoHtml( preview ) : preview.html;\n\t\tconst embedSourceUrl = getAuthority( url );\n\t\tconst iframeTitle = sprintf(\n\t\t\t// translators: %s: host providing embed content e.g: www.youtube.com\n\t\t\t__( 'Embedded content from %s' ),\n\t\t\tembedSourceUrl\n\t\t);\n\t\tconst sandboxClassnames = clsx(\n\t\t\ttype,\n\t\t\tclassName,\n\t\t\t'wp-block-embed__wrapper'\n\t\t);\n\n\t\t// Disabled because the overlay div doesn't actually have a role or functionality\n\t\t// as far as the user is concerned. We're just catching the first click so that\n\t\t// the block can be selected without interacting with the embed preview that the overlay covers.\n\t\t/* eslint-disable jsx-a11y/no-static-element-interactions */\n\t\tconst embedWrapper =\n\t\t\t'wp-embed' === type ? (\n\t\t\t\t<WpEmbedPreview html={ html } />\n\t\t\t) : (\n\t\t\t\t<div className=\"wp-block-embed__wrapper\">\n\t\t\t\t\t<SandBox\n\t\t\t\t\t\thtml={ html }\n\t\t\t\t\t\tscripts={ scripts }\n\t\t\t\t\t\ttitle={ iframeTitle }\n\t\t\t\t\t\ttype={ sandboxClassnames }\n\t\t\t\t\t\tonFocus={ this.hideOverlay }\n\t\t\t\t\t/>\n\t\t\t\t\t{ ! interactive && (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName=\"block-library-embed__interactive-overlay\"\n\t\t\t\t\t\t\tonMouseUp={ this.hideOverlay }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t);\n\t\t/* eslint-enable jsx-a11y/no-static-element-interactions */\n\n\t\treturn (\n\t\t\t<figure\n\t\t\t\tclassName={ clsx( className, 'wp-block-embed', {\n\t\t\t\t\t'is-type-video': 'video' === type,\n\t\t\t\t} ) }\n\t\t\t>\n\t\t\t\t{ previewable ? (\n\t\t\t\t\tembedWrapper\n\t\t\t\t) : (\n\t\t\t\t\t<Placeholder\n\t\t\t\t\t\ticon={ <BlockIcon icon={ icon } showColors /> }\n\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t>\n\t\t\t\t\t\t<p className=\"components-placeholder__error\">\n\t\t\t\t\t\t\t<a href={ url }>{ url }</a>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t<p className=\"components-placeholder__error\">\n\t\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: host providing embed content e.g: www.youtube.com */\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\"Embedded content from %s can't be previewed in the editor.\"\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tembedSourceUrl\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</Placeholder>\n\t\t\t\t) }\n\t\t\t\t{ ( ! RichText.isEmpty( caption ) || isSelected ) && (\n\t\t\t\t\t<RichText\n\t\t\t\t\t\tidentifier=\"caption\"\n\t\t\t\t\t\ttagName=\"figcaption\"\n\t\t\t\t\t\tclassName={ __experimentalGetElementClassName(\n\t\t\t\t\t\t\t'caption'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tplaceholder={ __( 'Add caption' ) }\n\t\t\t\t\t\tvalue={ caption }\n\t\t\t\t\t\tonChange={ onCaptionChange }\n\t\t\t\t\t\tinlineToolbar\n\t\t\t\t\t\t__unstableOnSplitAtEnd={ () =>\n\t\t\t\t\t\t\tinsertBlocksAfter(\n\t\t\t\t\t\t\t\tcreateBlock( getDefaultBlockName() )\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</figure>\n\t\t);\n\t}\n}\n\nexport default EmbedPreview;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAC,sBAAA,CAAAF,OAAA;AAKA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAKA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AACA,IAAAQ,IAAA,GAAAR,OAAA;AAKA,IAAAS,eAAA,GAAAP,sBAAA,CAAAF,OAAA;AAAgD,IAAAU,WAAA,GAAAV,OAAA;AA3BhD;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAYA;AACA;AACA;;AAGA,MAAMW,YAAY,SAASC,kBAA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