@wordpress/block-library 10.1.1-next.v.202607070741.0 → 10.2.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 +9 -0
- package/build/accordion/block.json +1 -0
- package/build/button/edit.cjs +18 -8
- package/build/button/edit.cjs.map +2 -2
- package/build/cover/block.json +11 -0
- package/build/cover/edit/block-controls.cjs +11 -4
- package/build/cover/edit/block-controls.cjs.map +2 -2
- package/build/cover/edit/embed-video-url-input.cjs +5 -3
- package/build/cover/edit/embed-video-url-input.cjs.map +3 -3
- package/build/cover/edit/index.cjs +1 -1
- package/build/cover/edit/index.cjs.map +2 -2
- package/build/cover/embed-video-utils.cjs +17 -7
- package/build/cover/embed-video-utils.cjs.map +2 -2
- package/build/details/transforms.cjs +1 -3
- package/build/details/transforms.cjs.map +2 -2
- package/build/embed/embed-placeholder.cjs +0 -1
- package/build/embed/embed-placeholder.cjs.map +2 -2
- package/build/file/edit.cjs +4 -3
- package/build/file/edit.cjs.map +2 -2
- package/build/file/transforms.cjs +25 -60
- package/build/file/transforms.cjs.map +2 -2
- package/build/gallery/block.json +4 -2
- package/build/gallery/edit.cjs +1 -1
- package/build/gallery/edit.cjs.map +3 -3
- package/build/gallery/gap-styles.cjs +49 -13
- package/build/gallery/gap-styles.cjs.map +3 -3
- package/build/group/transforms.cjs +1 -1
- package/build/group/transforms.cjs.map +2 -2
- package/build/icon/components/custom-inserter/icon-grid.cjs +25 -12
- package/build/icon/components/custom-inserter/icon-grid.cjs.map +2 -2
- package/build/icon/components/custom-inserter/index.cjs +100 -31
- package/build/icon/components/custom-inserter/index.cjs.map +3 -3
- package/build/icon/edit.cjs +11 -12
- package/build/icon/edit.cjs.map +2 -2
- package/build/image/block.json +1 -1
- package/build/image/edit.cjs +0 -34
- package/build/image/edit.cjs.map +2 -2
- package/build/image/image.cjs +4 -23
- package/build/image/image.cjs.map +3 -3
- package/build/image/transforms.cjs +78 -0
- package/build/image/transforms.cjs.map +3 -3
- package/build/index.cjs +18 -8
- package/build/index.cjs.map +2 -2
- package/build/latest-posts/edit.cjs +5 -8
- package/build/latest-posts/edit.cjs.map +2 -2
- package/build/list-item/edit.cjs +1 -1
- package/build/list-item/edit.cjs.map +2 -2
- package/build/list-item/hooks/use-enter.cjs +14 -17
- package/build/list-item/hooks/use-enter.cjs.map +3 -3
- package/build/list-item/hooks/use-space.cjs +3 -2
- package/build/list-item/hooks/use-space.cjs.map +3 -3
- package/build/paragraph/block.json +1 -0
- package/build/paragraph/use-enter.cjs +3 -7
- package/build/paragraph/use-enter.cjs.map +3 -3
- package/build/playlist/block.json +29 -10
- package/build/playlist/edit.cjs +216 -14
- package/build/playlist/edit.cjs.map +3 -3
- package/build/playlist/index.cjs +1 -1
- package/build/playlist/index.cjs.map +2 -2
- package/build/playlist/utils.cjs +19 -5
- package/build/playlist/utils.cjs.map +2 -2
- package/build/playlist/view.cjs +83 -13
- package/build/playlist/view.cjs.map +2 -2
- package/build/playlist-track/block.json +4 -2
- package/build/playlist-track/edit.cjs +94 -64
- package/build/playlist-track/edit.cjs.map +2 -2
- package/build/post-content/block.json +1 -0
- package/build/post-template/block.json +2 -1
- package/build/post-template/edit.cjs +10 -1
- package/build/post-template/edit.cjs.map +2 -2
- package/build/pullquote/block.json +3 -1
- package/build/query/block.json +3 -2
- package/build/query/edit/inspector-controls/index.cjs +38 -4
- package/build/query/edit/inspector-controls/index.cjs.map +2 -2
- package/build/query/edit/inspector-controls/offset-controls.cjs +0 -1
- package/build/query/edit/inspector-controls/offset-controls.cjs.map +2 -2
- package/build/query/edit/inspector-controls/pages-control.cjs +0 -1
- package/build/query/edit/inspector-controls/pages-control.cjs.map +2 -2
- package/build/query/edit/query-content.cjs +10 -3
- package/build/query/edit/query-content.cjs.map +2 -2
- package/build/query/index.cjs +2 -1
- package/build/query/index.cjs.map +2 -2
- package/build/quote/block.json +3 -1
- package/build/quote/transforms.cjs +1 -3
- package/build/quote/transforms.cjs.map +2 -2
- package/build/rss/edit.cjs +0 -1
- package/build/rss/edit.cjs.map +2 -2
- package/build/tab-list/block.json +2 -2
- package/build/tab-list/edit.cjs +65 -11
- package/build/tab-list/edit.cjs.map +3 -3
- package/build/tab-panel/block.json +1 -6
- package/build/tab-panel/edit.cjs +15 -15
- package/build/tab-panel/edit.cjs.map +2 -2
- package/build/tab-panels/block.json +0 -1
- package/build/tabs/block.json +0 -5
- package/build/tabs/edit.cjs +4 -39
- package/build/tabs/edit.cjs.map +3 -3
- package/build/tabs/use-tab-list-items-sync.cjs +19 -1
- package/build/tabs/use-tab-list-items-sync.cjs.map +2 -2
- package/build/term-name/block.json +1 -3
- package/build/term-name/deprecated.cjs +105 -0
- package/build/term-name/deprecated.cjs.map +7 -0
- package/build/term-name/edit.cjs +11 -37
- package/build/term-name/edit.cjs.map +3 -3
- package/build/term-name/index.cjs +3 -1
- package/build/term-name/index.cjs.map +3 -3
- package/build/utils/waveform-player.cjs +138 -22
- package/build/utils/waveform-player.cjs.map +2 -2
- package/build/utils/waveform-utils.cjs +315 -17
- package/build/utils/waveform-utils.cjs.map +2 -2
- package/build/video/edit.cjs +2 -11
- package/build/video/edit.cjs.map +3 -3
- package/build-module/accordion/block.json +1 -0
- package/build-module/button/edit.mjs +19 -14
- package/build-module/button/edit.mjs.map +2 -2
- package/build-module/cover/block.json +11 -0
- package/build-module/cover/edit/block-controls.mjs +11 -4
- package/build-module/cover/edit/block-controls.mjs.map +2 -2
- package/build-module/cover/edit/embed-video-url-input.mjs +5 -4
- package/build-module/cover/edit/embed-video-url-input.mjs.map +2 -2
- package/build-module/cover/edit/index.mjs +1 -1
- package/build-module/cover/edit/index.mjs.map +2 -2
- package/build-module/cover/embed-video-utils.mjs +16 -7
- package/build-module/cover/embed-video-utils.mjs.map +2 -2
- package/build-module/details/transforms.mjs +2 -7
- package/build-module/details/transforms.mjs.map +2 -2
- package/build-module/embed/embed-placeholder.mjs +0 -1
- package/build-module/embed/embed-placeholder.mjs.map +2 -2
- package/build-module/file/edit.mjs +4 -3
- package/build-module/file/edit.mjs.map +2 -2
- package/build-module/file/transforms.mjs +25 -60
- package/build-module/file/transforms.mjs.map +2 -2
- package/build-module/gallery/block.json +4 -2
- package/build-module/gallery/edit.mjs +3 -3
- package/build-module/gallery/edit.mjs.map +2 -2
- package/build-module/gallery/gap-styles.mjs +53 -14
- package/build-module/gallery/gap-styles.mjs.map +2 -2
- package/build-module/group/transforms.mjs +2 -5
- package/build-module/group/transforms.mjs.map +2 -2
- package/build-module/icon/components/custom-inserter/icon-grid.mjs +25 -12
- package/build-module/icon/components/custom-inserter/icon-grid.mjs.map +2 -2
- package/build-module/icon/components/custom-inserter/index.mjs +102 -33
- package/build-module/icon/components/custom-inserter/index.mjs.map +2 -2
- package/build-module/icon/edit.mjs +11 -12
- package/build-module/icon/edit.mjs.map +2 -2
- package/build-module/image/block.json +1 -1
- package/build-module/image/edit.mjs +0 -34
- package/build-module/image/edit.mjs.map +2 -2
- package/build-module/image/image.mjs +4 -13
- package/build-module/image/image.mjs.map +2 -2
- package/build-module/image/transforms.mjs +78 -0
- package/build-module/image/transforms.mjs.map +2 -2
- package/build-module/index.mjs +18 -8
- package/build-module/index.mjs.map +2 -2
- package/build-module/latest-posts/edit.mjs +5 -8
- package/build-module/latest-posts/edit.mjs.map +2 -2
- package/build-module/list-item/edit.mjs +1 -1
- package/build-module/list-item/edit.mjs.map +2 -2
- package/build-module/list-item/hooks/use-enter.mjs +15 -21
- package/build-module/list-item/hooks/use-enter.mjs.map +2 -2
- package/build-module/list-item/hooks/use-space.mjs +4 -6
- package/build-module/list-item/hooks/use-space.mjs.map +2 -2
- package/build-module/paragraph/block.json +1 -0
- package/build-module/paragraph/use-enter.mjs +4 -11
- package/build-module/paragraph/use-enter.mjs.map +2 -2
- package/build-module/playlist/block.json +29 -10
- package/build-module/playlist/edit.mjs +220 -16
- package/build-module/playlist/edit.mjs.map +2 -2
- package/build-module/playlist/index.mjs +1 -1
- package/build-module/playlist/index.mjs.map +2 -2
- package/build-module/playlist/utils.mjs +17 -4
- package/build-module/playlist/utils.mjs.map +2 -2
- package/build-module/playlist/view.mjs +89 -14
- package/build-module/playlist/view.mjs.map +2 -2
- package/build-module/playlist-track/block.json +4 -2
- package/build-module/playlist-track/edit.mjs +96 -65
- package/build-module/playlist-track/edit.mjs.map +2 -2
- package/build-module/post-content/block.json +1 -0
- package/build-module/post-template/block.json +2 -1
- package/build-module/post-template/edit.mjs +10 -1
- package/build-module/post-template/edit.mjs.map +2 -2
- package/build-module/pullquote/block.json +3 -1
- package/build-module/query/block.json +3 -2
- package/build-module/query/edit/inspector-controls/index.mjs +40 -5
- package/build-module/query/edit/inspector-controls/index.mjs.map +2 -2
- package/build-module/query/edit/inspector-controls/offset-controls.mjs +0 -1
- package/build-module/query/edit/inspector-controls/offset-controls.mjs.map +2 -2
- package/build-module/query/edit/inspector-controls/pages-control.mjs +0 -1
- package/build-module/query/edit/inspector-controls/pages-control.mjs.map +2 -2
- package/build-module/query/edit/query-content.mjs +10 -3
- package/build-module/query/edit/query-content.mjs.map +2 -2
- package/build-module/query/index.mjs +2 -1
- package/build-module/query/index.mjs.map +2 -2
- package/build-module/quote/block.json +3 -1
- package/build-module/quote/transforms.mjs +2 -4
- package/build-module/quote/transforms.mjs.map +2 -2
- package/build-module/rss/edit.mjs +0 -1
- package/build-module/rss/edit.mjs.map +2 -2
- package/build-module/tab-list/block.json +2 -2
- package/build-module/tab-list/edit.mjs +72 -13
- package/build-module/tab-list/edit.mjs.map +2 -2
- package/build-module/tab-panel/block.json +1 -6
- package/build-module/tab-panel/edit.mjs +16 -16
- package/build-module/tab-panel/edit.mjs.map +2 -2
- package/build-module/tab-panels/block.json +0 -1
- package/build-module/tabs/block.json +0 -5
- package/build-module/tabs/edit.mjs +5 -45
- package/build-module/tabs/edit.mjs.map +2 -2
- package/build-module/tabs/use-tab-list-items-sync.mjs +19 -1
- package/build-module/tabs/use-tab-list-items-sync.mjs.map +2 -2
- package/build-module/term-name/block.json +1 -3
- package/build-module/term-name/deprecated.mjs +74 -0
- package/build-module/term-name/deprecated.mjs.map +7 -0
- package/build-module/term-name/edit.mjs +11 -28
- package/build-module/term-name/edit.mjs.map +2 -2
- package/build-module/term-name/index.mjs +3 -1
- package/build-module/term-name/index.mjs.map +2 -2
- package/build-module/utils/waveform-player.mjs +144 -23
- package/build-module/utils/waveform-player.mjs.map +2 -2
- package/build-module/utils/waveform-utils.mjs +310 -16
- package/build-module/utils/waveform-utils.mjs.map +2 -2
- package/build-module/video/edit.mjs +2 -11
- package/build-module/video/edit.mjs.map +2 -2
- package/build-style/editor-rtl.css +46 -21
- package/build-style/editor.css +46 -21
- package/build-style/icon/editor-rtl.css +80 -7
- package/build-style/icon/editor.css +80 -7
- package/build-style/more/editor-rtl.css +2 -2
- package/build-style/more/editor.css +2 -2
- package/build-style/navigation/editor-rtl.css +3 -4
- package/build-style/navigation/editor.css +3 -4
- package/build-style/navigation-link/editor-rtl.css +1 -1
- package/build-style/navigation-link/editor.css +1 -1
- package/build-style/nextpage/editor-rtl.css +2 -2
- package/build-style/nextpage/editor.css +2 -2
- package/build-style/playlist/editor-rtl.css +6 -0
- package/build-style/playlist/editor.css +6 -0
- package/build-style/playlist/style-rtl.css +37 -1
- package/build-style/playlist/style.css +37 -1
- package/build-style/playlist-track/style-rtl.css +10 -0
- package/build-style/playlist-track/style.css +10 -0
- package/build-style/style-rtl.css +47 -1
- package/build-style/style.css +47 -1
- package/build-style/video/editor-rtl.css +1 -1
- package/build-style/video/editor.css +1 -1
- package/build-types/table-of-contents/list.d.ts +1 -1
- package/build-types/table-of-contents/list.d.ts.map +1 -1
- package/package.json +46 -44
- package/src/accordion/README.md +1 -0
- package/src/accordion/block.json +1 -0
- package/src/button/edit.js +21 -15
- package/src/cover/README.md +60 -0
- package/src/cover/block.json +11 -0
- package/src/cover/edit/block-controls.js +21 -11
- package/src/cover/edit/embed-video-url-input.js +5 -4
- package/src/cover/edit/index.js +9 -11
- package/src/cover/embed-video-utils.js +38 -13
- package/src/details/transforms.js +2 -7
- package/src/embed/embed-placeholder.js +0 -1
- package/src/file/edit.js +8 -8
- package/src/file/transforms.js +28 -60
- package/src/gallery/README.md +1 -1
- package/src/gallery/block.json +4 -2
- package/src/gallery/edit.js +3 -3
- package/src/gallery/gap-styles.js +79 -20
- package/src/gallery/index.php +103 -43
- package/src/group/transforms.js +2 -5
- package/src/icon/components/custom-inserter/icon-grid.js +40 -11
- package/src/icon/components/custom-inserter/index.js +98 -25
- package/src/icon/edit.js +11 -17
- package/src/icon/editor.scss +33 -8
- package/src/image/README.md +1 -1
- package/src/image/block.json +1 -1
- package/src/image/edit.js +0 -52
- package/src/image/editor.scss +2 -0
- package/src/image/image.js +19 -24
- package/src/image/transforms.js +128 -0
- package/src/index.js +19 -7
- package/src/latest-posts/edit.js +5 -8
- package/src/latest-posts/index.php +46 -16
- package/src/list-item/edit.js +1 -1
- package/src/list-item/hooks/use-enter.js +15 -22
- package/src/list-item/hooks/use-space.js +4 -6
- package/src/media-text/editor.scss +1 -0
- package/src/more/editor.scss +1 -1
- package/src/navigation/editor.scss +1 -2
- package/src/navigation-link/editor.scss +1 -1
- package/src/navigation-link/index.php +6 -3
- package/src/navigation-submenu/index.php +6 -3
- package/src/nextpage/editor.scss +1 -1
- package/src/paragraph/README.md +1 -0
- package/src/paragraph/block.json +1 -0
- package/src/paragraph/use-enter.js +4 -11
- package/src/playlist/README.md +17 -18
- package/src/playlist/block.json +29 -10
- package/src/playlist/edit.js +247 -15
- package/src/playlist/editor.scss +6 -0
- package/src/playlist/index.js +1 -1
- package/src/playlist/index.php +58 -14
- package/src/playlist/style.scss +51 -1
- package/src/playlist/test/edit.js +13 -2
- package/src/playlist/utils.js +25 -7
- package/src/playlist/view.js +97 -16
- package/src/playlist-track/README.md +3 -3
- package/src/playlist-track/block.json +4 -2
- package/src/playlist-track/edit.js +94 -70
- package/src/playlist-track/index.php +20 -6
- package/src/playlist-track/style.scss +10 -0
- package/src/playlist-track/test/edit.js +169 -0
- package/src/post-content/README.md +1 -0
- package/src/post-content/block.json +1 -0
- package/src/post-template/README.md +1 -0
- package/src/post-template/block.json +2 -1
- package/src/post-template/edit.js +9 -0
- package/src/pullquote/README.md +1 -0
- package/src/pullquote/block.json +3 -1
- package/src/query/README.md +2 -1
- package/src/query/block.json +3 -2
- package/src/query/edit/inspector-controls/index.js +43 -3
- package/src/query/edit/inspector-controls/offset-controls.js +0 -1
- package/src/query/edit/inspector-controls/pages-control.js +0 -1
- package/src/query/edit/query-content.js +19 -3
- package/src/query/index.js +1 -0
- package/src/quote/README.md +1 -0
- package/src/quote/block.json +3 -1
- package/src/quote/transforms.js +2 -4
- package/src/rss/edit.js +0 -1
- package/src/rss/index.php +1 -1
- package/src/tab-list/README.md +4 -5
- package/src/tab-list/block.json +2 -2
- package/src/tab-list/edit.js +90 -28
- package/src/tab-list/index.php +9 -4
- package/src/tab-panel/README.md +4 -6
- package/src/tab-panel/block.json +1 -6
- package/src/tab-panel/edit.js +19 -24
- package/src/tab-panels/README.md +5 -3
- package/src/tab-panels/block.json +0 -1
- package/src/tabs/README.md +18 -9
- package/src/tabs/block.json +0 -5
- package/src/tabs/edit.js +7 -64
- package/src/tabs/use-tab-list-items-sync.js +24 -4
- package/src/template-part/index.php +1 -16
- package/src/term-name/README.md +1 -1
- package/src/term-name/block.json +1 -3
- package/src/term-name/deprecated.js +74 -0
- package/src/term-name/edit.js +2 -18
- package/src/term-name/index.js +2 -0
- package/src/utils/media-control.scss +1 -5
- package/src/utils/test/waveform-player.js +297 -34
- package/src/utils/test/waveform-utils.js +410 -5
- package/src/utils/waveform-player.js +189 -59
- package/src/utils/waveform-utils.js +443 -40
- package/src/video/edit.js +0 -8
- package/src/video/editor.scss +1 -1
- package/build/image/animated-gif-convert-control.cjs +0 -105
- package/build/image/animated-gif-convert-control.cjs.map +0 -7
- package/build/utils/gif-conversion-attributes.cjs +0 -40
- package/build/utils/gif-conversion-attributes.cjs.map +0 -7
- package/build/video/gif-restore-control.cjs +0 -73
- package/build/video/gif-restore-control.cjs.map +0 -7
- package/build-module/image/animated-gif-convert-control.mjs +0 -87
- package/build-module/image/animated-gif-convert-control.mjs.map +0 -7
- package/build-module/utils/gif-conversion-attributes.mjs +0 -15
- package/build-module/utils/gif-conversion-attributes.mjs.map +0 -7
- package/build-module/video/gif-restore-control.mjs +0 -55
- package/build-module/video/gif-restore-control.mjs.map +0 -7
- package/src/image/animated-gif-convert-control.js +0 -135
- package/src/image/test/animated-gif-convert-control.js +0 -276
- package/src/utils/gif-conversion-attributes.js +0 -30
- package/src/utils/test/gif-conversion-attributes.js +0 -60
- package/src/video/gif-restore-control.js +0 -92
|
@@ -21,6 +21,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
21
21
|
var embed_video_utils_exports = {};
|
|
22
22
|
__export(embed_video_utils_exports, {
|
|
23
23
|
detectProviderFromSrc: () => detectProviderFromSrc,
|
|
24
|
+
getAllowedVideoProviders: () => getAllowedVideoProviders,
|
|
24
25
|
getBackgroundEmbedHtml: () => getBackgroundEmbedHtml,
|
|
25
26
|
getBackgroundVideoSrc: () => getBackgroundVideoSrc,
|
|
26
27
|
getVideoEmbedProvider: () => getVideoEmbedProvider,
|
|
@@ -30,7 +31,7 @@ module.exports = __toCommonJS(embed_video_utils_exports);
|
|
|
30
31
|
var import_blocks = require("@wordpress/blocks");
|
|
31
32
|
var import_util = require("../embed/util.cjs");
|
|
32
33
|
var DEFAULT_EMBED_BLOCK = "core/embed";
|
|
33
|
-
var
|
|
34
|
+
var DEFAULT_VIDEO_PROVIDERS = [
|
|
34
35
|
"youtube",
|
|
35
36
|
"vimeo",
|
|
36
37
|
"videopress",
|
|
@@ -38,18 +39,26 @@ var VIDEO_PROVIDERS = [
|
|
|
38
39
|
"tiktok",
|
|
39
40
|
"wordpress-tv"
|
|
40
41
|
];
|
|
41
|
-
function
|
|
42
|
+
function getAllowedVideoProviders(allowedVideoProviders) {
|
|
43
|
+
if (!Array.isArray(allowedVideoProviders)) {
|
|
44
|
+
return [];
|
|
45
|
+
}
|
|
46
|
+
return DEFAULT_VIDEO_PROVIDERS.filter(
|
|
47
|
+
(provider) => allowedVideoProviders.includes(provider)
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
function isValidVideoEmbedUrl(url, allowedProviders) {
|
|
42
51
|
if (!url) {
|
|
43
52
|
return false;
|
|
44
53
|
}
|
|
45
|
-
const embedBlock = findVideoEmbedProvider(url);
|
|
54
|
+
const embedBlock = findVideoEmbedProvider(url, allowedProviders);
|
|
46
55
|
return embedBlock !== null;
|
|
47
56
|
}
|
|
48
|
-
function getVideoEmbedProvider(url) {
|
|
49
|
-
const embedBlock = findVideoEmbedProvider(url);
|
|
57
|
+
function getVideoEmbedProvider(url, allowedProviders) {
|
|
58
|
+
const embedBlock = findVideoEmbedProvider(url, allowedProviders);
|
|
50
59
|
return embedBlock ? embedBlock.name : null;
|
|
51
60
|
}
|
|
52
|
-
function findVideoEmbedProvider(url) {
|
|
61
|
+
function findVideoEmbedProvider(url, allowedProviders = DEFAULT_VIDEO_PROVIDERS) {
|
|
53
62
|
const embedVariations = (0, import_blocks.getBlockVariations)(DEFAULT_EMBED_BLOCK);
|
|
54
63
|
if (!embedVariations) {
|
|
55
64
|
return null;
|
|
@@ -57,7 +66,7 @@ function findVideoEmbedProvider(url) {
|
|
|
57
66
|
const matchingVariation = embedVariations.find(
|
|
58
67
|
({ patterns }) => (0, import_util.matchesPatterns)(url, patterns)
|
|
59
68
|
);
|
|
60
|
-
if (!matchingVariation || !
|
|
69
|
+
if (!matchingVariation || !allowedProviders.includes(matchingVariation.name)) {
|
|
61
70
|
return null;
|
|
62
71
|
}
|
|
63
72
|
return matchingVariation;
|
|
@@ -145,6 +154,7 @@ function getBackgroundVideoSrc(src) {
|
|
|
145
154
|
// Annotate the CommonJS export names for ESM import in node:
|
|
146
155
|
0 && (module.exports = {
|
|
147
156
|
detectProviderFromSrc,
|
|
157
|
+
getAllowedVideoProviders,
|
|
148
158
|
getBackgroundEmbedHtml,
|
|
149
159
|
getBackgroundVideoSrc,
|
|
150
160
|
getVideoEmbedProvider,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/cover/embed-video-utils.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { getBlockVariations } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { matchesPatterns } from '../embed/util';\n\nconst DEFAULT_EMBED_BLOCK = 'core/embed';\n\n// List of supported video providers for cover block backgrounds\nconst
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAAmC;AAKnC,kBAAgC;AAEhC,IAAM,sBAAsB;AAG5B,IAAM,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { getBlockVariations } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { matchesPatterns } from '../embed/util';\n\nconst DEFAULT_EMBED_BLOCK = 'core/embed';\n\n// List of supported video providers for cover block backgrounds\nconst DEFAULT_VIDEO_PROVIDERS = [\n\t'youtube',\n\t'vimeo',\n\t'videopress',\n\t'animoto',\n\t'tiktok',\n\t'wordpress-tv',\n];\n\n/**\n * Resolves the list of providers that are actually allowed.\n *\n * @param {string[]} [allowedVideoProviders] The providers configured via the block attribute.\n * @return {string[]} The supported providers that remain allowed.\n */\nexport function getAllowedVideoProviders( allowedVideoProviders ) {\n\tif ( ! Array.isArray( allowedVideoProviders ) ) {\n\t\treturn [];\n\t}\n\n\treturn DEFAULT_VIDEO_PROVIDERS.filter( ( provider ) =>\n\t\tallowedVideoProviders.includes( provider )\n\t);\n}\n\n/**\n * Checks if a URL is a valid video embed URL from allowed providers.\n *\n * @param {string} url The URL to validate.\n * @param {string[]} [allowedProviders] The allowed providers, Defaults to all\n * supported providers.\n * @return {boolean} True if the URL matches an allowed video provider pattern.\n */\nexport function isValidVideoEmbedUrl( url, allowedProviders ) {\n\tif ( ! url ) {\n\t\treturn false;\n\t}\n\n\tconst embedBlock = findVideoEmbedProvider( url, allowedProviders );\n\treturn embedBlock !== null;\n}\n\n/**\n * Finds the embed provider for a given URL if it's an allowed video provider.\n *\n * @param {string} url The URL to check.\n * @param {string[]} [allowedProviders] The allowed providers, Defaults to all\n * supported providers.\n * @return {string|null} The provider name slug (e.g., 'youtube') or null if not found.\n */\nexport function getVideoEmbedProvider( url, allowedProviders ) {\n\tconst embedBlock = findVideoEmbedProvider( url, allowedProviders );\n\treturn embedBlock ? embedBlock.name : null;\n}\n\n/**\n * Finds a matching video embed block variation for the given URL.\n *\n * @param {string} url The URL to match against provider patterns.\n * @param {string[]} [allowedProviders] The allowed providers, Defaults to all\n * supported providers.\n * @return {Object|null} The matching block variation or null if not found.\n */\nfunction findVideoEmbedProvider(\n\turl,\n\tallowedProviders = DEFAULT_VIDEO_PROVIDERS\n) {\n\tconst embedVariations = getBlockVariations( DEFAULT_EMBED_BLOCK );\n\n\tif ( ! embedVariations ) {\n\t\treturn null;\n\t}\n\n\tconst matchingVariation = embedVariations.find( ( { patterns } ) =>\n\t\tmatchesPatterns( url, patterns )\n\t);\n\n\tif (\n\t\t! matchingVariation ||\n\t\t! allowedProviders.includes( matchingVariation.name )\n\t) {\n\t\treturn null;\n\t}\n\n\treturn matchingVariation;\n}\n\n/**\n * Modifies embed HTML to use background video parameters.\n *\n * @param {string} html The original embed HTML.\n * @return {string|null} The modified embed HTML, or null if not possible.\n */\nexport function getBackgroundEmbedHtml( html ) {\n\tconst srcMatch = html?.match( /src=[\"']([^\"']+)[\"']/ );\n\tif ( ! srcMatch ) {\n\t\treturn null;\n\t}\n\n\tconst iframeSrc = srcMatch[ 1 ];\n\tconst backgroundSrc = getBackgroundVideoSrc( iframeSrc );\n\treturn html.replace( iframeSrc, backgroundSrc );\n}\n\n/**\n * Detects the video provider from an iframe src URL.\n *\n * @param {string} src The iframe src URL.\n * @return {string|null} The provider name slug or null if not recognized.\n */\nexport function detectProviderFromSrc( src ) {\n\tif ( ! src ) {\n\t\treturn null;\n\t}\n\n\tconst lowerSrc = src.toLowerCase();\n\n\tif (\n\t\tlowerSrc.includes( 'youtube.com' ) ||\n\t\tlowerSrc.includes( 'youtu.be' )\n\t) {\n\t\treturn 'youtube';\n\t}\n\tif ( lowerSrc.includes( 'vimeo.com' ) ) {\n\t\treturn 'vimeo';\n\t}\n\tif ( lowerSrc.includes( 'videopress.com' ) ) {\n\t\treturn 'videopress';\n\t}\n\tif ( lowerSrc.includes( 'animoto.com' ) ) {\n\t\treturn 'animoto';\n\t}\n\tif ( lowerSrc.includes( 'tiktok.com' ) ) {\n\t\treturn 'tiktok';\n\t}\n\tif ( lowerSrc.includes( 'wordpress.tv' ) ) {\n\t\treturn 'wordpress-tv';\n\t}\n\n\treturn null;\n}\n\n/**\n * Modifies an iframe src URL to add background video parameters.\n * Automatically detects the provider from the URL.\n *\n * @param {string} src The iframe src URL.\n * @return {string} The modified URL.\n */\nexport function getBackgroundVideoSrc( src ) {\n\tif ( ! src ) {\n\t\treturn src;\n\t}\n\n\ttry {\n\t\tconst url = new URL( src );\n\n\t\t// Detect provider from the iframe src URL\n\t\tconst provider = detectProviderFromSrc( src );\n\n\t\t// Add provider-specific parameters for background video behavior\n\t\tswitch ( provider ) {\n\t\t\tcase 'youtube':\n\t\t\t\t// YouTube parameters for background video\n\t\t\t\turl.searchParams.set( 'autoplay', '1' );\n\t\t\t\turl.searchParams.set( 'mute', '1' );\n\t\t\t\turl.searchParams.set( 'loop', '1' );\n\t\t\t\turl.searchParams.set( 'controls', '0' );\n\t\t\t\turl.searchParams.set( 'showinfo', '0' );\n\t\t\t\turl.searchParams.set( 'modestbranding', '1' );\n\t\t\t\turl.searchParams.set( 'playsinline', '1' );\n\t\t\t\turl.searchParams.set( 'rel', '0' );\n\t\t\t\t// For loop to work, we need the playlist parameter\n\t\t\t\tconst videoId = url.pathname.split( '/' ).pop();\n\t\t\t\tif ( videoId ) {\n\t\t\t\t\turl.searchParams.set( 'playlist', videoId );\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 'vimeo':\n\t\t\t\t// Vimeo parameters for background video\n\t\t\t\turl.searchParams.set( 'autoplay', '1' );\n\t\t\t\turl.searchParams.set( 'muted', '1' );\n\t\t\t\turl.searchParams.set( 'loop', '1' );\n\t\t\t\turl.searchParams.set( 'background', '1' );\n\t\t\t\turl.searchParams.set( 'controls', '0' );\n\t\t\t\tbreak;\n\n\t\t\tcase 'videopress':\n\t\t\tcase 'wordpress-tv':\n\t\t\t\t// VideoPress parameters\n\t\t\t\turl.searchParams.set( 'autoplay', '1' );\n\t\t\t\turl.searchParams.set( 'loop', '1' );\n\t\t\t\turl.searchParams.set( 'muted', '1' );\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t// Generic parameters that might work for other providers\n\t\t\t\turl.searchParams.set( 'autoplay', '1' );\n\t\t\t\turl.searchParams.set( 'muted', '1' );\n\t\t\t\turl.searchParams.set( 'loop', '1' );\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn url.toString();\n\t} catch {\n\t\t// If URL parsing fails, return original src\n\t\treturn src;\n\t}\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAAmC;AAKnC,kBAAgC;AAEhC,IAAM,sBAAsB;AAG5B,IAAM,0BAA0B;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AAQO,SAAS,yBAA0B,uBAAwB;AACjE,MAAK,CAAE,MAAM,QAAS,qBAAsB,GAAI;AAC/C,WAAO,CAAC;AAAA,EACT;AAEA,SAAO,wBAAwB;AAAA,IAAQ,CAAE,aACxC,sBAAsB,SAAU,QAAS;AAAA,EAC1C;A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AAEP,WAAO;AAAA,EACR;AACD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -37,9 +37,7 @@ var transforms_default = {
|
|
|
37
37
|
return (0, import_blocks.createBlock)(
|
|
38
38
|
"core/details",
|
|
39
39
|
{},
|
|
40
|
-
blocks.map(
|
|
41
|
-
(block) => (0, import_blocks.__experimentalCloneSanitizedBlock)(block)
|
|
42
|
-
)
|
|
40
|
+
blocks.map((block) => (0, import_blocks.cloneSanitizedBlock)(block))
|
|
43
41
|
);
|
|
44
42
|
}
|
|
45
43
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/details/transforms.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { createBlock, cloneSanitizedBlock } from '@wordpress/blocks';\n\nexport default {\n\tfrom: [\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tisMultiBlock: true,\n\t\t\tblocks: [ '*' ],\n\t\t\tisMatch( {}, blocks ) {\n\t\t\t\treturn ! (\n\t\t\t\t\tblocks.length === 1 && blocks[ 0 ].name === 'core/details'\n\t\t\t\t);\n\t\t\t},\n\t\t\t__experimentalConvert( blocks ) {\n\t\t\t\treturn createBlock(\n\t\t\t\t\t'core/details',\n\t\t\t\t\t{},\n\t\t\t\t\tblocks.map( ( block ) => cloneSanitizedBlock( block ) )\n\t\t\t\t);\n\t\t\t},\n\t\t},\n\t],\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAAiD;AAEjD,IAAO,qBAAQ;AAAA,EACd,MAAM;AAAA,IACL;AAAA,MACC,MAAM;AAAA,MACN,cAAc;AAAA,MACd,QAAQ,CAAE,GAAI;AAAA,MACd,QAAS,CAAC,GAAG,QAAS;AACrB,eAAO,EACN,OAAO,WAAW,KAAK,OAAQ,CAAE,EAAE,SAAS;AAAA,MAE9C;AAAA,MACA,sBAAuB,QAAS;AAC/B,mBAAO;AAAA,UACN;AAAA,UACA,CAAC;AAAA,UACD,OAAO,IAAK,CAAE,cAAW,mCAAqB,KAAM,CAAE;AAAA,QACvD;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/embed/embed-placeholder.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\tButton,\n\tPlaceholder,\n\t__experimentalInputControl as InputControl,\n} from '@wordpress/components';\nimport { BlockIcon } from '@wordpress/block-editor';\nimport { Link, Stack } from '@wordpress/ui';\n\nexport default function EmbedPlaceholder( {\n\ticon,\n\tlabel,\n\tvalue,\n\tonSubmit,\n\tonChange,\n\tcannotEmbed,\n\tfallback,\n\ttryAgain,\n} ) {\n\treturn (\n\t\t<Placeholder\n\t\t\ticon={ <BlockIcon icon={ icon } showColors /> }\n\t\t\tlabel={ label }\n\t\t\tclassName=\"wp-block-embed\"\n\t\t\tinstructions={ __(\n\t\t\t\t'Paste a link to the content you want to display on your site.'\n\t\t\t) }\n\t\t>\n\t\t\t<form onSubmit={ onSubmit }>\n\t\t\t\t<InputControl\n\t\t\t\t\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAuB;AACvB,wBAIO;AACP,0BAA0B;AAC1B,gBAA4B;AAclB;AAZK,SAAR,iBAAmC;AAAA,EACzC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAAI;AACH,SACC;AAAA,IAAC;AAAA;AAAA,MACA,MAAO,4CAAC,iCAAU,MAAc,YAAU,MAAC;AAAA,MAC3C;AAAA,MACA,WAAU;AAAA,MACV,kBAAe;AAAA,QACd;AAAA,MACD;AAAA,MAEA;AAAA,qDAAC,UAAK,UACL;AAAA;AAAA,YAAC,kBAAAA;AAAA,YAAA;AAAA,cACA,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\tButton,\n\tPlaceholder,\n\t__experimentalInputControl as InputControl,\n} from '@wordpress/components';\nimport { BlockIcon } from '@wordpress/block-editor';\nimport { Link, Stack } from '@wordpress/ui';\n\nexport default function EmbedPlaceholder( {\n\ticon,\n\tlabel,\n\tvalue,\n\tonSubmit,\n\tonChange,\n\tcannotEmbed,\n\tfallback,\n\ttryAgain,\n} ) {\n\treturn (\n\t\t<Placeholder\n\t\t\ticon={ <BlockIcon icon={ icon } showColors /> }\n\t\t\tlabel={ label }\n\t\t\tclassName=\"wp-block-embed\"\n\t\t\tinstructions={ __(\n\t\t\t\t'Paste a link to the content you want to display on your site.'\n\t\t\t) }\n\t\t>\n\t\t\t<form onSubmit={ onSubmit }>\n\t\t\t\t<InputControl\n\t\t\t\t\ttype=\"url\"\n\t\t\t\t\tvalue={ value || '' }\n\t\t\t\t\tclassName=\"wp-block-embed__placeholder-input\"\n\t\t\t\t\tlabel={ label }\n\t\t\t\t\thideLabelFromVision\n\t\t\t\t\tplaceholder={ __( 'Enter URL to embed here…' ) }\n\t\t\t\t\tonChange={ onChange }\n\t\t\t\t/>\n\t\t\t\t<Button __next40pxDefaultSize variant=\"primary\" type=\"submit\">\n\t\t\t\t\t{ _x( 'Embed', 'button label' ) }\n\t\t\t\t</Button>\n\t\t\t</form>\n\t\t\t<div className=\"wp-block-embed__learn-more\">\n\t\t\t\t<Link\n\t\t\t\t\topenInNewTab\n\t\t\t\t\thref={ __(\n\t\t\t\t\t\t'https://wordpress.org/documentation/article/embeds/'\n\t\t\t\t\t) }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Learn more about embeds' ) }\n\t\t\t\t</Link>\n\t\t\t</div>\n\t\t\t{ cannotEmbed && (\n\t\t\t\t<Stack\n\t\t\t\t\tdirection=\"column\"\n\t\t\t\t\tgap=\"md\"\n\t\t\t\t\tclassName=\"components-placeholder__error\"\n\t\t\t\t>\n\t\t\t\t\t<div className=\"components-placeholder__instructions\">\n\t\t\t\t\t\t{ __( 'Sorry, this content could not be embedded.' ) }\n\t\t\t\t\t</div>\n\t\t\t\t\t<Stack direction=\"row\" gap=\"md\" justify=\"flex-start\">\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\tonClick={ tryAgain }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ _x( 'Try again', 'button label' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\tonClick={ fallback }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ _x( 'Convert to link', 'button label' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</Stack>\n\t\t\t\t</Stack>\n\t\t\t) }\n\t\t</Placeholder>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAuB;AACvB,wBAIO;AACP,0BAA0B;AAC1B,gBAA4B;AAclB;AAZK,SAAR,iBAAmC;AAAA,EACzC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAAI;AACH,SACC;AAAA,IAAC;AAAA;AAAA,MACA,MAAO,4CAAC,iCAAU,MAAc,YAAU,MAAC;AAAA,MAC3C;AAAA,MACA,WAAU;AAAA,MACV,kBAAe;AAAA,QACd;AAAA,MACD;AAAA,MAEA;AAAA,qDAAC,UAAK,UACL;AAAA;AAAA,YAAC,kBAAAA;AAAA,YAAA;AAAA,cACA,MAAK;AAAA,cACL,OAAQ,SAAS;AAAA,cACjB,WAAU;AAAA,cACV;AAAA,cACA,qBAAmB;AAAA,cACnB,iBAAc,gBAAI,0BAA2B;AAAA,cAC7C;AAAA;AAAA,UACD;AAAA,UACA,4CAAC,4BAAO,uBAAqB,MAAC,SAAQ,WAAU,MAAK,UAClD,8BAAI,SAAS,cAAe,GAC/B;AAAA,WACD;AAAA,QACA,4CAAC,SAAI,WAAU,8BACd;AAAA,UAAC;AAAA;AAAA,YACA,cAAY;AAAA,YACZ,UAAO;AAAA,cACN;AAAA,YACD;AAAA,YAEE,8BAAI,yBAA0B;AAAA;AAAA,QACjC,GACD;AAAA,QACE,eACD;AAAA,UAAC;AAAA;AAAA,YACA,WAAU;AAAA,YACV,KAAI;AAAA,YACJ,WAAU;AAAA,YAEV;AAAA,0DAAC,SAAI,WAAU,wCACZ,8BAAI,4CAA6C,GACpD;AAAA,cACA,6CAAC,mBAAM,WAAU,OAAM,KAAI,MAAK,SAAQ,cACvC;AAAA;AAAA,kBAAC;AAAA;AAAA,oBACA,uBAAqB;AAAA,oBACrB,SAAQ;AAAA,oBACR,SAAU;AAAA,oBAER,8BAAI,aAAa,cAAe;AAAA;AAAA,gBACnC;AAAA,gBACA;AAAA,kBAAC;AAAA;AAAA,oBACA,uBAAqB;AAAA,oBACrB,SAAQ;AAAA,oBACR,SAAU;AAAA,oBAER,8BAAI,mBAAmB,cAAe;AAAA;AAAA,gBACzC;AAAA,iBACD;AAAA;AAAA;AAAA,QACD;AAAA;AAAA;AAAA,EAEF;AAEF;",
|
|
6
6
|
"names": ["InputControl"]
|
|
7
7
|
}
|
package/build/file/edit.cjs
CHANGED
|
@@ -87,11 +87,12 @@ function FileEdit({ attributes, isSelected, setAttributes, clientId }) {
|
|
|
87
87
|
const [temporaryURL, setTemporaryURL] = (0, import_element.useState)(attributes.blob);
|
|
88
88
|
const { media } = (0, import_data.useSelect)(
|
|
89
89
|
(select) => ({
|
|
90
|
-
media: id
|
|
90
|
+
media: !!id ? select(import_core_data.store).getEntityRecord(
|
|
91
91
|
"postType",
|
|
92
92
|
"attachment",
|
|
93
|
-
id
|
|
94
|
-
|
|
93
|
+
id,
|
|
94
|
+
{ context: "view" }
|
|
95
|
+
) : void 0
|
|
95
96
|
}),
|
|
96
97
|
[id]
|
|
97
98
|
);
|
package/build/file/edit.cjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/file/edit.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { isBlobURL } from '@wordpress/blob';\nimport {\n\t__unstableGetAnimateClassName as getAnimateClassName,\n\tResizableBox,\n\tToolbarButton,\n} from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tBlockControls,\n\tBlockIcon,\n\tMediaPlaceholder,\n\tMediaReplaceFlow,\n\tRichText,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n\t__experimentalGetElementClassName,\n} from '@wordpress/block-editor';\nimport { useState } from '@wordpress/element';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport { file as icon } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { getFilename } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport FileBlockInspector from './inspector';\nimport { browserSupportsPdfs } from './utils';\nimport removeAnchorTag from '../utils/remove-anchor-tag';\nimport { useUploadMediaFromBlobURL } from '../utils/hooks';\n\nexport const MIN_PREVIEW_HEIGHT = 200;\nexport const MAX_PREVIEW_HEIGHT = 2000;\n\nfunction ClipboardToolbarButton( { text, disabled } ) {\n\tconst { createNotice } = useDispatch( noticesStore );\n\tconst ref = useCopyToClipboard( text, () => {\n\t\tcreateNotice( 'info', __( 'Copied URL to clipboard.' ), {\n\t\t\tisDismissible: true,\n\t\t\ttype: 'snackbar',\n\t\t} );\n\t} );\n\n\treturn (\n\t\t<ToolbarButton\n\t\t\tclassName=\"components-clipboard-toolbar-button\"\n\t\t\tref={ ref }\n\t\t\tdisabled={ disabled }\n\t\t>\n\t\t\t{ __( 'Copy URL' ) }\n\t\t</ToolbarButton>\n\t);\n}\n\nfunction FileEdit( { attributes, isSelected, setAttributes, clientId } ) {\n\tconst {\n\t\tid,\n\t\tfileName,\n\t\thref,\n\t\ttextLinkHref,\n\t\ttextLinkTarget,\n\t\tshowDownloadButton,\n\t\tdownloadButtonText,\n\t\tdisplayPreview,\n\t\tpreviewHeight,\n\t} = attributes;\n\tconst [ temporaryURL, setTemporaryURL ] = useState( attributes.blob );\n\tconst { media } = useSelect(\n\t\t( select ) => ( {\n\t\t\tmedia
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,kBAA0B;AAC1B,wBAIO;AACP,kBAAuC;AACvC,0BASO;AACP,qBAAyB;AACzB,qBAAmC;AACnC,kBAAmB;AACnB,mBAA6B;AAC7B,uBAAmC;AACnC,qBAAsC;AACtC,iBAA4B;AAK5B,uBAA+B;AAC/B,mBAAoC;AACpC,+BAA4B;AAC5B,mBAA0C;AAexC;AAbK,IAAM,qBAAqB;AAC3B,IAAM,qBAAqB;AAElC,SAAS,uBAAwB,EAAE,MAAM,SAAS,GAAI;AACrD,QAAM,EAAE,aAAa,QAAI,yBAAa,eAAAA,KAAa;AACnD,QAAM,UAAM,mCAAoB,MAAM,MAAM;AAC3C,iBAAc,YAAQ,gBAAI,0BAA2B,GAAG;AAAA,MACvD,eAAe;AAAA,MACf,MAAM;AAAA,IACP,CAAE;AAAA,EACH,CAAE;AAEF,SACC;AAAA,IAAC;AAAA;AAAA,MACA,WAAU;AAAA,MACV;AAAA,MACA;AAAA,MAEE,8BAAI,UAAW;AAAA;AAAA,EAClB;AAEF;AAEA,SAAS,SAAU,EAAE,YAAY,YAAY,eAAe,SAAS,GAAI;AACxE,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,IAAI;AACJ,QAAM,CAAE,cAAc,eAAgB,QAAI,yBAAU,WAAW,IAAK;AACpE,QAAM,EAAE,MAAM,QAAI;AAAA,IACjB,CAAE,YAAc;AAAA,MACf,
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { isBlobURL } from '@wordpress/blob';\nimport {\n\t__unstableGetAnimateClassName as getAnimateClassName,\n\tResizableBox,\n\tToolbarButton,\n} from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tBlockControls,\n\tBlockIcon,\n\tMediaPlaceholder,\n\tMediaReplaceFlow,\n\tRichText,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n\t__experimentalGetElementClassName,\n} from '@wordpress/block-editor';\nimport { useState } from '@wordpress/element';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport { file as icon } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { getFilename } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport FileBlockInspector from './inspector';\nimport { browserSupportsPdfs } from './utils';\nimport removeAnchorTag from '../utils/remove-anchor-tag';\nimport { useUploadMediaFromBlobURL } from '../utils/hooks';\n\nexport const MIN_PREVIEW_HEIGHT = 200;\nexport const MAX_PREVIEW_HEIGHT = 2000;\n\nfunction ClipboardToolbarButton( { text, disabled } ) {\n\tconst { createNotice } = useDispatch( noticesStore );\n\tconst ref = useCopyToClipboard( text, () => {\n\t\tcreateNotice( 'info', __( 'Copied URL to clipboard.' ), {\n\t\t\tisDismissible: true,\n\t\t\ttype: 'snackbar',\n\t\t} );\n\t} );\n\n\treturn (\n\t\t<ToolbarButton\n\t\t\tclassName=\"components-clipboard-toolbar-button\"\n\t\t\tref={ ref }\n\t\t\tdisabled={ disabled }\n\t\t>\n\t\t\t{ __( 'Copy URL' ) }\n\t\t</ToolbarButton>\n\t);\n}\n\nfunction FileEdit( { attributes, isSelected, setAttributes, clientId } ) {\n\tconst {\n\t\tid,\n\t\tfileName,\n\t\thref,\n\t\ttextLinkHref,\n\t\ttextLinkTarget,\n\t\tshowDownloadButton,\n\t\tdownloadButtonText,\n\t\tdisplayPreview,\n\t\tpreviewHeight,\n\t} = attributes;\n\tconst [ temporaryURL, setTemporaryURL ] = useState( attributes.blob );\n\tconst { media } = useSelect(\n\t\t( select ) => ( {\n\t\t\tmedia: !! id\n\t\t\t\t? select( coreStore ).getEntityRecord(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t'attachment',\n\t\t\t\t\t\tid,\n\t\t\t\t\t\t{ context: 'view' }\n\t\t\t\t )\n\t\t\t\t: undefined,\n\t\t} ),\n\t\t[ id ]\n\t);\n\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst { toggleSelection } = useDispatch( blockEditorStore );\n\n\tuseUploadMediaFromBlobURL( {\n\t\turl: temporaryURL,\n\t\tonChange: onSelectFile,\n\t\tonError: onUploadError,\n\t} );\n\n\tfunction onSelectFile( newMedia ) {\n\t\tif ( ! newMedia || ! newMedia.url ) {\n\t\t\t// Reset attributes.\n\t\t\tsetAttributes( {\n\t\t\t\thref: undefined,\n\t\t\t\tfileName: undefined,\n\t\t\t\ttextLinkHref: undefined,\n\t\t\t\tid: undefined,\n\t\t\t\tfileId: undefined,\n\t\t\t\tdisplayPreview: undefined,\n\t\t\t\tpreviewHeight: undefined,\n\t\t\t} );\n\t\t\tsetTemporaryURL();\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isBlobURL( newMedia.url ) ) {\n\t\t\tsetTemporaryURL( newMedia.url );\n\t\t\treturn;\n\t\t}\n\n\t\tconst isPdf =\n\t\t\t// Media Library and REST API use different properties for mime type.\n\t\t\t( newMedia.mime || newMedia.mime_type ) === 'application/pdf' ||\n\t\t\tgetFilename( newMedia.url ).toLowerCase().endsWith( '.pdf' );\n\t\tconst pdfAttributes = {\n\t\t\tdisplayPreview: isPdf\n\t\t\t\t? attributes.displayPreview ?? true\n\t\t\t\t: undefined,\n\t\t\tpreviewHeight: isPdf ? attributes.previewHeight ?? 600 : undefined,\n\t\t};\n\n\t\tsetAttributes( {\n\t\t\thref: newMedia.url,\n\t\t\tfileName: newMedia.title,\n\t\t\ttextLinkHref: newMedia.url,\n\t\t\tid: newMedia.id,\n\t\t\tfileId: `wp-block-file--media-${ clientId }`,\n\t\t\tblob: undefined,\n\t\t\t...pdfAttributes,\n\t\t} );\n\t\tsetTemporaryURL();\n\t}\n\n\tfunction onUploadError( message ) {\n\t\tsetAttributes( { href: undefined } );\n\t\tcreateErrorNotice( message, { type: 'snackbar' } );\n\t}\n\n\tfunction changeLinkDestinationOption( newHref ) {\n\t\t// Choose Media File or Attachment Page (when file is in Media Library).\n\t\tsetAttributes( { textLinkHref: newHref } );\n\t}\n\n\tfunction changeOpenInNewWindow( newValue ) {\n\t\tsetAttributes( {\n\t\t\ttextLinkTarget: newValue ? '_blank' : false,\n\t\t} );\n\t}\n\n\tfunction changeShowDownloadButton( newValue ) {\n\t\tsetAttributes( { showDownloadButton: newValue } );\n\t}\n\n\tfunction changeDisplayPreview( newValue ) {\n\t\tsetAttributes( { displayPreview: newValue } );\n\t}\n\n\tfunction handleOnResizeStop( event, direction, elt, delta ) {\n\t\ttoggleSelection( true );\n\n\t\tconst newHeight = parseInt( previewHeight + delta.height, 10 );\n\t\tsetAttributes( { previewHeight: newHeight } );\n\t}\n\n\tfunction changePreviewHeight( newValue ) {\n\t\tconst newHeight = Math.max(\n\t\t\tparseInt( newValue, 10 ),\n\t\t\tMIN_PREVIEW_HEIGHT\n\t\t);\n\t\tsetAttributes( { previewHeight: newHeight } );\n\t}\n\n\tconst attachmentPage = media && media.link;\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx(\n\t\t\t!! temporaryURL && getAnimateClassName( { type: 'loading' } ),\n\t\t\t{\n\t\t\t\t'is-transient': !! temporaryURL,\n\t\t\t}\n\t\t),\n\t} );\n\n\tconst displayPreviewInEditor = browserSupportsPdfs() && displayPreview;\n\n\tif ( ! href && ! 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\tlabels={ {\n\t\t\t\t\t\ttitle: __( 'File' ),\n\t\t\t\t\t\tinstructions: __(\n\t\t\t\t\t\t\t'Drag and drop a file, upload, or choose from your library.'\n\t\t\t\t\t\t),\n\t\t\t\t\t} }\n\t\t\t\t\tonSelect={ onSelectFile }\n\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\taccept=\"*\"\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<FileBlockInspector\n\t\t\t\threfs={ {\n\t\t\t\t\thref: href || temporaryURL,\n\t\t\t\t\ttextLinkHref,\n\t\t\t\t\tattachmentPage,\n\t\t\t\t} }\n\t\t\t\t{ ...{\n\t\t\t\t\topenInNewWindow: !! textLinkTarget,\n\t\t\t\t\tshowDownloadButton,\n\t\t\t\t\tchangeLinkDestinationOption,\n\t\t\t\t\tchangeOpenInNewWindow,\n\t\t\t\t\tchangeShowDownloadButton,\n\t\t\t\t\tdisplayPreview,\n\t\t\t\t\tchangeDisplayPreview,\n\t\t\t\t\tpreviewHeight,\n\t\t\t\t\tchangePreviewHeight,\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<BlockControls group=\"other\">\n\t\t\t\t<MediaReplaceFlow\n\t\t\t\t\tmediaId={ id }\n\t\t\t\t\tmediaURL={ href }\n\t\t\t\t\taccept=\"*\"\n\t\t\t\t\tonSelect={ onSelectFile }\n\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\tonReset={ () => onSelectFile( undefined ) }\n\t\t\t\t/>\n\t\t\t\t<ClipboardToolbarButton\n\t\t\t\t\ttext={ href }\n\t\t\t\t\tdisabled={ isBlobURL( href ) }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t\t<div { ...blockProps }>\n\t\t\t\t{ displayPreviewInEditor && (\n\t\t\t\t\t<ResizableBox\n\t\t\t\t\t\tsize={ { height: previewHeight, width: '100%' } }\n\t\t\t\t\t\tminHeight={ MIN_PREVIEW_HEIGHT }\n\t\t\t\t\t\tmaxHeight={ MAX_PREVIEW_HEIGHT }\n\t\t\t\t\t\t// The horizontal grid value must be 1 or else the width may snap during a\n\t\t\t\t\t\t// resize even though only vertical resizing is enabled.\n\t\t\t\t\t\tgrid={ [ 1, 10 ] }\n\t\t\t\t\t\tenable={ {\n\t\t\t\t\t\t\ttop: false,\n\t\t\t\t\t\t\tright: false,\n\t\t\t\t\t\t\tbottom: true,\n\t\t\t\t\t\t\tleft: false,\n\t\t\t\t\t\t\ttopRight: false,\n\t\t\t\t\t\t\tbottomRight: false,\n\t\t\t\t\t\t\tbottomLeft: false,\n\t\t\t\t\t\t\ttopLeft: false,\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tonResizeStart={ () => toggleSelection( false ) }\n\t\t\t\t\t\tonResizeStop={ handleOnResizeStop }\n\t\t\t\t\t\tshowHandle={ isSelected }\n\t\t\t\t\t>\n\t\t\t\t\t\t<object\n\t\t\t\t\t\t\tclassName=\"wp-block-file__preview\"\n\t\t\t\t\t\t\tdata={ href }\n\t\t\t\t\t\t\ttype=\"application/pdf\"\n\t\t\t\t\t\t\taria-label={ __(\n\t\t\t\t\t\t\t\t'Embed of the selected PDF file.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ ! isSelected && (\n\t\t\t\t\t\t\t<div className=\"wp-block-file__preview-overlay\" />\n\t\t\t\t\t\t) }\n\t\t\t\t\t</ResizableBox>\n\t\t\t\t) }\n\t\t\t\t<div className=\"wp-block-file__content-wrapper\">\n\t\t\t\t\t<RichText\n\t\t\t\t\t\tidentifier=\"fileName\"\n\t\t\t\t\t\ttagName=\"a\"\n\t\t\t\t\t\tvalue={ fileName }\n\t\t\t\t\t\tplaceholder={ __( 'Write file name…' ) }\n\t\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\t\tonChange={ ( text ) =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tfileName: removeAnchorTag( text ),\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t\thref={ textLinkHref }\n\t\t\t\t\t/>\n\t\t\t\t\t{ showDownloadButton && (\n\t\t\t\t\t\t<div className=\"wp-block-file__button-richtext-wrapper\">\n\t\t\t\t\t\t\t{ /* Using RichText here instead of PlainText so that it can be styled like a button. */ }\n\t\t\t\t\t\t\t<RichText\n\t\t\t\t\t\t\t\tidentifier=\"downloadButtonText\"\n\t\t\t\t\t\t\t\ttagName=\"div\" // Must be block-level or else cursor disappears.\n\t\t\t\t\t\t\t\taria-label={ __( 'Download button text' ) }\n\t\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t\t'wp-block-file__button',\n\t\t\t\t\t\t\t\t\t__experimentalGetElementClassName(\n\t\t\t\t\t\t\t\t\t\t'button'\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tvalue={ downloadButtonText }\n\t\t\t\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\t\t\t\tplaceholder={ __( 'Add text…' ) }\n\t\t\t\t\t\t\t\tonChange={ ( text ) =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;AAAA;AAAA,cAAC;AAAA;AAAA,gBACA,WAAU;AAAA,gBACV,MAAO;AAAA,gBACP,MAAK;AAAA,gBACL,kBAAa;AAAA,kBACZ;AAAA,gBACD;AAAA;AAAA,YACD;AAAA,YACE,CAAE,cACH,4CAAC,SAAI,WAAU,kCAAiC;AAAA;AAAA;AAAA,MAElD;AAAA,MAED,6CAAC,SAAI,WAAU,kCACd;AAAA;AAAA,UAAC;AAAA;AAAA,YACA,YAAW;AAAA,YACX,SAAQ;AAAA,YACR,OAAQ;AAAA,YACR,iBAAc,gBAAI,kBAAmB;AAAA,YACrC,8BAA4B;AAAA,YAC5B,UAAW,CAAE,SACZ,cAAe;AAAA,cACd,cAAU,yBAAAC,SAAiB,IAAK;AAAA,YACjC,CAAE;AAAA,YAEH,MAAO;AAAA;AAAA,QACR;AAAA,QACE,sBACD,4CAAC,SAAI,WAAU,0CAEd;AAAA,UAAC;AAAA;AAAA,YACA,YAAW;AAAA,YACX,SAAQ;AAAA,YACR,kBAAa,gBAAI,sBAAuB;AAAA,YACxC,eAAY,YAAAJ;AAAA,cACX;AAAA,kBACA;AAAA,gBACC;AAAA,cACD;AAAA,YACD;AAAA,YACA,OAAQ;AAAA,YACR,8BAA4B;AAAA,YAC5B,iBAAc,gBAAI,WAAY;AAAA,YAC9B,UAAW,CAAE,SACZ,cAAe;AAAA,cACd,wBACC,yBAAAI,SAAiB,IAAK;AAAA,YACxB,CAAE;AAAA;AAAA,QAEJ,GACD;AAAA,SAEF;AAAA,OACD;AAAA,KACD;AAEF;AAEA,IAAO,eAAQ;",
|
|
6
6
|
"names": ["noticesStore", "coreStore", "blockEditorStore", "clsx", "getAnimateClassName", "icon", "FileBlockInspector", "removeAnchorTag"]
|
|
7
7
|
}
|
|
@@ -30,6 +30,28 @@ var import_core_data = require("@wordpress/core-data");
|
|
|
30
30
|
var import_i18n = require("@wordpress/i18n");
|
|
31
31
|
var import_url = require("@wordpress/url");
|
|
32
32
|
var downloadButtonText = (0, import_i18n._x)("Download", "button label");
|
|
33
|
+
var toMediaTransform = (blockName, mediaType, srcAttribute) => ({
|
|
34
|
+
type: "block",
|
|
35
|
+
blocks: [blockName],
|
|
36
|
+
isMatch: ({ id }) => {
|
|
37
|
+
if (!id) {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
const { getEntityRecord } = (0, import_data.select)(import_core_data.store);
|
|
41
|
+
const media = getEntityRecord("postType", "attachment", id, {
|
|
42
|
+
context: "view"
|
|
43
|
+
});
|
|
44
|
+
return !!media && media.mime_type.includes(mediaType);
|
|
45
|
+
},
|
|
46
|
+
transform: (attributes) => {
|
|
47
|
+
return (0, import_blocks.createBlock)(blockName, {
|
|
48
|
+
[srcAttribute]: attributes.href,
|
|
49
|
+
caption: attributes.fileName,
|
|
50
|
+
id: attributes.id,
|
|
51
|
+
anchor: attributes.anchor
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
});
|
|
33
55
|
var transforms = {
|
|
34
56
|
from: [
|
|
35
57
|
{
|
|
@@ -92,66 +114,9 @@ var transforms = {
|
|
|
92
114
|
}
|
|
93
115
|
],
|
|
94
116
|
to: [
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
isMatch: ({ id }) => {
|
|
99
|
-
if (!id) {
|
|
100
|
-
return false;
|
|
101
|
-
}
|
|
102
|
-
const { getEntityRecord } = (0, import_data.select)(import_core_data.store);
|
|
103
|
-
const media = getEntityRecord("postType", "attachment", id);
|
|
104
|
-
return !!media && media.mime_type.includes("audio");
|
|
105
|
-
},
|
|
106
|
-
transform: (attributes) => {
|
|
107
|
-
return (0, import_blocks.createBlock)("core/audio", {
|
|
108
|
-
src: attributes.href,
|
|
109
|
-
caption: attributes.fileName,
|
|
110
|
-
id: attributes.id,
|
|
111
|
-
anchor: attributes.anchor
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
type: "block",
|
|
117
|
-
blocks: ["core/video"],
|
|
118
|
-
isMatch: ({ id }) => {
|
|
119
|
-
if (!id) {
|
|
120
|
-
return false;
|
|
121
|
-
}
|
|
122
|
-
const { getEntityRecord } = (0, import_data.select)(import_core_data.store);
|
|
123
|
-
const media = getEntityRecord("postType", "attachment", id);
|
|
124
|
-
return !!media && media.mime_type.includes("video");
|
|
125
|
-
},
|
|
126
|
-
transform: (attributes) => {
|
|
127
|
-
return (0, import_blocks.createBlock)("core/video", {
|
|
128
|
-
src: attributes.href,
|
|
129
|
-
caption: attributes.fileName,
|
|
130
|
-
id: attributes.id,
|
|
131
|
-
anchor: attributes.anchor
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
type: "block",
|
|
137
|
-
blocks: ["core/image"],
|
|
138
|
-
isMatch: ({ id }) => {
|
|
139
|
-
if (!id) {
|
|
140
|
-
return false;
|
|
141
|
-
}
|
|
142
|
-
const { getEntityRecord } = (0, import_data.select)(import_core_data.store);
|
|
143
|
-
const media = getEntityRecord("postType", "attachment", id);
|
|
144
|
-
return !!media && media.mime_type.includes("image");
|
|
145
|
-
},
|
|
146
|
-
transform: (attributes) => {
|
|
147
|
-
return (0, import_blocks.createBlock)("core/image", {
|
|
148
|
-
url: attributes.href,
|
|
149
|
-
caption: attributes.fileName,
|
|
150
|
-
id: attributes.id,
|
|
151
|
-
anchor: attributes.anchor
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
}
|
|
117
|
+
toMediaTransform("core/audio", "audio", "src"),
|
|
118
|
+
toMediaTransform("core/video", "video", "src"),
|
|
119
|
+
toMediaTransform("core/image", "image", "url")
|
|
155
120
|
]
|
|
156
121
|
};
|
|
157
122
|
var transforms_default = transforms;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/file/transforms.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { createBlobURL } from '@wordpress/blob';\nimport { createBlock } from '@wordpress/blocks';\nimport { select } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { _x } from '@wordpress/i18n';\nimport { getFilename } from '@wordpress/url';\n\n// Transforms bypass the default variation, so set the localized default here.\nconst downloadButtonText = _x( 'Download', 'button label' );\n\nconst transforms = {\n\tfrom: [\n\t\t{\n\t\t\ttype: 'files',\n\t\t\tisMatch( files ) {\n\t\t\t\treturn files.length > 0;\n\t\t\t},\n\t\t\t// We define a lower priority (higher number) than the default of 10. This\n\t\t\t// ensures that the File block is only created as a fallback.\n\t\t\tpriority: 15,\n\t\t\ttransform: ( files ) => {\n\t\t\t\tconst blocks = [];\n\n\t\t\t\tfiles.forEach( ( file ) => {\n\t\t\t\t\tconst blobURL = createBlobURL( file );\n\n\t\t\t\t\t// File will be uploaded in componentDidMount()\n\t\t\t\t\tif ( file.type.startsWith( 'video/' ) ) {\n\t\t\t\t\t\tblocks.push(\n\t\t\t\t\t\t\tcreateBlock( 'core/video', {\n\t\t\t\t\t\t\t\tblob: createBlobURL( file ),\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t);\n\t\t\t\t\t} else if ( file.type.startsWith( 'image/' ) ) {\n\t\t\t\t\t\tblocks.push(\n\t\t\t\t\t\t\tcreateBlock( 'core/image', {\n\t\t\t\t\t\t\t\tblob: createBlobURL( file ),\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t);\n\t\t\t\t\t} else if ( file.type.startsWith( 'audio/' ) ) {\n\t\t\t\t\t\tblocks.push(\n\t\t\t\t\t\t\tcreateBlock( 'core/audio', {\n\t\t\t\t\t\t\t\tblob: createBlobURL( file ),\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tblocks.push(\n\t\t\t\t\t\t\tcreateBlock( 'core/file', {\n\t\t\t\t\t\t\t\tblob: blobURL,\n\t\t\t\t\t\t\t\tfileName: file.name,\n\t\t\t\t\t\t\t\tdownloadButtonText,\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\n\t\t\t\treturn blocks;\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/audio', 'core/video', 'core/image' ],\n\t\t\ttransform: ( attributes ) => {\n\t\t\t\t// Audio/Video use `src`, Image uses `url`.\n\t\t\t\tconst href = attributes.src ?? attributes.url;\n\t\t\t\treturn createBlock( 'core/file', {\n\t\t\t\t\thref,\n\t\t\t\t\tfileName: attributes.caption || getFilename( href ),\n\t\t\t\t\ttextLinkHref: href,\n\t\t\t\t\tid: attributes.id,\n\t\t\t\t\tanchor: attributes.anchor,\n\t\t\t\t\tdownloadButtonText,\n\t\t\t\t} );\n\t\t\t},\n\t\t},\n\t],\n\tto: [\n\t\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAA8B;AAC9B,oBAA4B;AAC5B,kBAAuB;AACvB,uBAAmC;AACnC,kBAAmB;AACnB,iBAA4B;AAG5B,IAAM,yBAAqB,gBAAI,YAAY,cAAe;
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { createBlobURL } from '@wordpress/blob';\nimport { createBlock } from '@wordpress/blocks';\nimport { select } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { _x } from '@wordpress/i18n';\nimport { getFilename } from '@wordpress/url';\n\n// Transforms bypass the default variation, so set the localized default here.\nconst downloadButtonText = _x( 'Download', 'button label' );\n\n// The File → audio/video/image transforms are identical apart from the target\n// block, its media MIME type, and the src attribute name (image uses `url`).\nconst toMediaTransform = ( blockName, mediaType, srcAttribute ) => ( {\n\ttype: 'block',\n\tblocks: [ blockName ],\n\tisMatch: ( { id } ) => {\n\t\tif ( ! id ) {\n\t\t\treturn false;\n\t\t}\n\t\tconst { getEntityRecord } = select( coreStore );\n\t\tconst media = getEntityRecord( 'postType', 'attachment', id, {\n\t\t\tcontext: 'view',\n\t\t} );\n\t\treturn !! media && media.mime_type.includes( mediaType );\n\t},\n\ttransform: ( attributes ) => {\n\t\treturn createBlock( blockName, {\n\t\t\t[ srcAttribute ]: attributes.href,\n\t\t\tcaption: attributes.fileName,\n\t\t\tid: attributes.id,\n\t\t\tanchor: attributes.anchor,\n\t\t} );\n\t},\n} );\n\nconst transforms = {\n\tfrom: [\n\t\t{\n\t\t\ttype: 'files',\n\t\t\tisMatch( files ) {\n\t\t\t\treturn files.length > 0;\n\t\t\t},\n\t\t\t// We define a lower priority (higher number) than the default of 10. This\n\t\t\t// ensures that the File block is only created as a fallback.\n\t\t\tpriority: 15,\n\t\t\ttransform: ( files ) => {\n\t\t\t\tconst blocks = [];\n\n\t\t\t\tfiles.forEach( ( file ) => {\n\t\t\t\t\tconst blobURL = createBlobURL( file );\n\n\t\t\t\t\t// File will be uploaded in componentDidMount()\n\t\t\t\t\tif ( file.type.startsWith( 'video/' ) ) {\n\t\t\t\t\t\tblocks.push(\n\t\t\t\t\t\t\tcreateBlock( 'core/video', {\n\t\t\t\t\t\t\t\tblob: createBlobURL( file ),\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t);\n\t\t\t\t\t} else if ( file.type.startsWith( 'image/' ) ) {\n\t\t\t\t\t\tblocks.push(\n\t\t\t\t\t\t\tcreateBlock( 'core/image', {\n\t\t\t\t\t\t\t\tblob: createBlobURL( file ),\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t);\n\t\t\t\t\t} else if ( file.type.startsWith( 'audio/' ) ) {\n\t\t\t\t\t\tblocks.push(\n\t\t\t\t\t\t\tcreateBlock( 'core/audio', {\n\t\t\t\t\t\t\t\tblob: createBlobURL( file ),\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tblocks.push(\n\t\t\t\t\t\t\tcreateBlock( 'core/file', {\n\t\t\t\t\t\t\t\tblob: blobURL,\n\t\t\t\t\t\t\t\tfileName: file.name,\n\t\t\t\t\t\t\t\tdownloadButtonText,\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\n\t\t\t\treturn blocks;\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/audio', 'core/video', 'core/image' ],\n\t\t\ttransform: ( attributes ) => {\n\t\t\t\t// Audio/Video use `src`, Image uses `url`.\n\t\t\t\tconst href = attributes.src ?? attributes.url;\n\t\t\t\treturn createBlock( 'core/file', {\n\t\t\t\t\thref,\n\t\t\t\t\tfileName: attributes.caption || getFilename( href ),\n\t\t\t\t\ttextLinkHref: href,\n\t\t\t\t\tid: attributes.id,\n\t\t\t\t\tanchor: attributes.anchor,\n\t\t\t\t\tdownloadButtonText,\n\t\t\t\t} );\n\t\t\t},\n\t\t},\n\t],\n\tto: [\n\t\ttoMediaTransform( 'core/audio', 'audio', 'src' ),\n\t\ttoMediaTransform( 'core/video', 'video', 'src' ),\n\t\ttoMediaTransform( 'core/image', 'image', 'url' ),\n\t],\n};\n\nexport default transforms;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAA8B;AAC9B,oBAA4B;AAC5B,kBAAuB;AACvB,uBAAmC;AACnC,kBAAmB;AACnB,iBAA4B;AAG5B,IAAM,yBAAqB,gBAAI,YAAY,cAAe;AAI1D,IAAM,mBAAmB,CAAE,WAAW,WAAW,kBAAoB;AAAA,EACpE,MAAM;AAAA,EACN,QAAQ,CAAE,SAAU;AAAA,EACpB,SAAS,CAAE,EAAE,GAAG,MAAO;AACtB,QAAK,CAAE,IAAK;AACX,aAAO;AAAA,IACR;AACA,UAAM,EAAE,gBAAgB,QAAI,oBAAQ,iBAAAA,KAAU;AAC9C,UAAM,QAAQ,gBAAiB,YAAY,cAAc,IAAI;AAAA,MAC5D,SAAS;AAAA,IACV,CAA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AAE,cAAc,cAAc,YAAa;AAAA,MACnD,WAAW,CAAE,eAAgB;AAE5B,cAAM,OAAO,WAAW,OAAO,WAAW;AAC1C,mBAAO,2BAAa,aAAa;AAAA,UAChC;AAAA,UACA,UAAU,WAAW,eAAW,wBAAa,IAAK;AAAA,UAClD,cAAc;AAAA,UACd,IAAI,WAAW;AAAA,UACf,QAAQ,WAAW;AAAA,UACnB;AAAA,QACD,CAAE;AAAA,MACH;AAAA,IACD;AAAA,EACD;AAAA,EACA,IAAI;AAAA,IACH,iBAAkB,cAAc,SAAS,KAAM;AAAA,IAC/C,iBAAkB,cAAc,SAAS,KAAM;AAAA,IAC/C,iBAAkB,cAAc,SAAS,KAAM;AAAA,EAChD;AACD;AAEA,IAAO,qBAAQ;",
|
|
6
6
|
"names": ["coreStore"]
|
|
7
7
|
}
|
package/build/gallery/block.json
CHANGED
|
@@ -142,8 +142,10 @@
|
|
|
142
142
|
"spacing": {
|
|
143
143
|
"margin": true,
|
|
144
144
|
"padding": true,
|
|
145
|
-
"blockGap":
|
|
146
|
-
|
|
145
|
+
"blockGap": {
|
|
146
|
+
"sides": [ "horizontal", "vertical" ],
|
|
147
|
+
"__experimentalDefault": "var( --wp--style--gallery-gap-default, var( --gallery-block--gutter-size, var( --wp--style--block-gap, 0.5em ) ) )"
|
|
148
|
+
},
|
|
147
149
|
"__experimentalDefaultControls": {
|
|
148
150
|
"blockGap": true,
|
|
149
151
|
"margin": false,
|
package/build/gallery/edit.cjs
CHANGED