@wordpress/block-library 9.7.1-next.1f6eadc42.0 → 9.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/categories/edit.js +38 -17
- package/build/categories/edit.js.map +1 -1
- package/build/categories/index.js +10 -3
- package/build/categories/index.js.map +1 -1
- package/build/categories/variations.js +43 -0
- package/build/categories/variations.js.map +1 -0
- package/build/embed/edit.js +1 -0
- package/build/embed/edit.js.map +1 -1
- package/build/embed/edit.native.js +1 -0
- package/build/embed/edit.native.js.map +1 -1
- package/build/embed/embed-preview.js +80 -100
- package/build/embed/embed-preview.js.map +1 -1
- package/build/embed/embed-preview.native.js +1 -0
- package/build/embed/embed-preview.native.js.map +1 -1
- package/build/form/view.js +1 -0
- package/build/form/view.js.map +1 -1
- package/build/image/image.js +5 -2
- package/build/image/image.js.map +1 -1
- package/build/index.js +1 -0
- package/build/index.js.map +1 -1
- package/build/navigation-submenu/index.js +13 -0
- package/build/navigation-submenu/index.js.map +1 -1
- package/build/post-template/edit.js +6 -1
- package/build/post-template/edit.js.map +1 -1
- package/build/post-title/index.js +1 -4
- package/build/post-title/index.js.map +1 -1
- package/build/query/edit/inspector-controls/format-controls.js +102 -0
- package/build/query/edit/inspector-controls/format-controls.js.map +1 -0
- package/build/query/edit/inspector-controls/index.js +45 -9
- package/build/query/edit/inspector-controls/index.js.map +1 -1
- package/build/query/edit/query-content.js +26 -10
- package/build/query/edit/query-content.js.map +1 -1
- package/build/query/index.js +3 -1
- package/build/query/index.js.map +1 -1
- package/build/query/utils.js +12 -1
- package/build/query/utils.js.map +1 -1
- package/build/site-title/index.js +1 -4
- package/build/site-title/index.js.map +1 -1
- package/build/social-link/edit.js +13 -11
- package/build/social-link/edit.js.map +1 -1
- package/build-module/categories/edit.js +40 -19
- package/build-module/categories/edit.js.map +1 -1
- package/build-module/categories/index.js +10 -3
- package/build-module/categories/index.js.map +1 -1
- package/build-module/categories/variations.js +36 -0
- package/build-module/categories/variations.js.map +1 -0
- package/build-module/embed/edit.js +1 -0
- package/build-module/embed/edit.js.map +1 -1
- package/build-module/embed/edit.native.js +1 -0
- package/build-module/embed/edit.native.js.map +1 -1
- package/build-module/embed/embed-preview.js +80 -100
- package/build-module/embed/embed-preview.js.map +1 -1
- package/build-module/embed/embed-preview.native.js +1 -0
- package/build-module/embed/embed-preview.native.js.map +1 -1
- package/build-module/form/view.js +1 -0
- package/build-module/form/view.js.map +1 -1
- package/build-module/image/image.js +5 -2
- package/build-module/image/image.js.map +1 -1
- package/build-module/index.js +1 -0
- package/build-module/index.js.map +1 -1
- package/build-module/navigation-submenu/index.js +13 -0
- package/build-module/navigation-submenu/index.js.map +1 -1
- package/build-module/post-template/edit.js +6 -1
- package/build-module/post-template/edit.js.map +1 -1
- package/build-module/post-title/index.js +1 -4
- package/build-module/post-title/index.js.map +1 -1
- package/build-module/query/edit/inspector-controls/format-controls.js +96 -0
- package/build-module/query/edit/inspector-controls/format-controls.js.map +1 -0
- package/build-module/query/edit/inspector-controls/index.js +45 -9
- package/build-module/query/edit/inspector-controls/index.js.map +1 -1
- package/build-module/query/edit/query-content.js +27 -11
- package/build-module/query/edit/query-content.js.map +1 -1
- package/build-module/query/index.js +3 -1
- package/build-module/query/index.js.map +1 -1
- package/build-module/query/utils.js +12 -1
- package/build-module/query/utils.js.map +1 -1
- package/build-module/site-title/index.js +1 -4
- package/build-module/site-title/index.js.map +1 -1
- package/build-module/social-link/edit.js +14 -12
- package/build-module/social-link/edit.js.map +1 -1
- package/build-style/editor-rtl.css +1 -1
- package/build-style/editor.css +1 -1
- package/build-style/gallery/editor-rtl.css +1 -1
- package/build-style/gallery/editor.css +1 -1
- package/build-style/post-title/style-rtl.css +4 -18
- package/build-style/post-title/style.css +4 -18
- package/build-style/site-title/style-rtl.css +4 -18
- package/build-style/site-title/style.css +4 -18
- package/build-style/style-rtl.css +8 -36
- package/build-style/style.css +8 -36
- package/package.json +35 -35
- package/src/categories/block.json +7 -2
- package/src/categories/edit.js +69 -30
- package/src/categories/index.js +2 -0
- package/src/categories/index.php +21 -9
- package/src/categories/variations.js +40 -0
- package/src/comments-pagination-next/index.php +1 -1
- package/src/comments-pagination-previous/index.php +2 -1
- package/src/embed/embed-preview.js +96 -112
- package/src/image/image.js +2 -1
- package/src/navigation-submenu/block.json +13 -0
- package/src/post-template/edit.js +6 -0
- package/src/post-template/index.php +5 -0
- package/src/post-title/block.json +1 -4
- package/src/post-title/style.scss +4 -21
- package/src/query/block.json +3 -1
- package/src/query/edit/inspector-controls/format-controls.js +90 -0
- package/src/query/edit/inspector-controls/index.js +68 -9
- package/src/query/edit/query-content.js +38 -5
- package/src/query/utils.js +16 -1
- package/src/site-title/block.json +1 -4
- package/src/site-title/style.scss +4 -21
- package/src/social-link/edit.js +11 -7
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.default =
|
|
7
|
+
exports.default = EmbedPreview;
|
|
8
8
|
var _util = require("./util");
|
|
9
9
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
10
10
|
var _i18n = require("@wordpress/i18n");
|
|
@@ -31,114 +31,94 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
31
31
|
* Internal dependencies
|
|
32
32
|
*/
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
34
|
+
function EmbedPreview({
|
|
35
|
+
preview,
|
|
36
|
+
previewable,
|
|
37
|
+
url,
|
|
38
|
+
type,
|
|
39
|
+
isSelected,
|
|
40
|
+
className,
|
|
41
|
+
icon,
|
|
42
|
+
label,
|
|
43
|
+
insertBlocksAfter,
|
|
44
|
+
attributes,
|
|
45
|
+
setAttributes
|
|
46
|
+
}) {
|
|
47
|
+
const [interactive, setInteractive] = (0, _element.useState)(false);
|
|
48
|
+
if (!isSelected && interactive) {
|
|
49
|
+
// We only want to change this when the block is not selected, because changing it when
|
|
50
|
+
// the block becomes selected makes the overlap disappear too early. Hiding the overlay
|
|
51
|
+
// happens on mouseup when the overlay is clicked.
|
|
52
|
+
setInteractive(false);
|
|
41
53
|
}
|
|
42
|
-
|
|
43
|
-
if (!nextProps.isSelected && state.interactive) {
|
|
44
|
-
// We only want to change this when the block is not selected, because changing it when
|
|
45
|
-
// the block becomes selected makes the overlap disappear too early. Hiding the overlay
|
|
46
|
-
// happens on mouseup when the overlay is clicked.
|
|
47
|
-
return {
|
|
48
|
-
interactive: false
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
return null;
|
|
52
|
-
}
|
|
53
|
-
hideOverlay() {
|
|
54
|
+
const hideOverlay = () => {
|
|
54
55
|
// This is called onMouseUp on the overlay. We can't respond to the `isSelected` prop
|
|
55
56
|
// changing, because that happens on mouse down, and the overlay immediately disappears,
|
|
56
57
|
// and the mouse event can end up in the preview content. We can't use onClick on
|
|
57
58
|
// the overlay to hide it either, because then the editor misses the mouseup event, and
|
|
58
59
|
// thinks we're multi-selecting blocks.
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
icon,
|
|
71
|
-
label,
|
|
72
|
-
insertBlocksAfter,
|
|
73
|
-
attributes,
|
|
74
|
-
setAttributes,
|
|
75
|
-
isSelected
|
|
76
|
-
} = this.props;
|
|
77
|
-
const {
|
|
78
|
-
scripts
|
|
79
|
-
} = preview;
|
|
80
|
-
const {
|
|
81
|
-
interactive
|
|
82
|
-
} = this.state;
|
|
83
|
-
const html = 'photo' === type ? (0, _util.getPhotoHtml)(preview) : preview.html;
|
|
84
|
-
const embedSourceUrl = (0, _url.getAuthority)(url);
|
|
85
|
-
const iframeTitle = (0, _i18n.sprintf)(
|
|
86
|
-
// translators: %s: host providing embed content e.g: www.youtube.com
|
|
87
|
-
(0, _i18n.__)('Embedded content from %s'), embedSourceUrl);
|
|
88
|
-
const sandboxClassnames = (0, _clsx.default)(type, className, 'wp-block-embed__wrapper');
|
|
60
|
+
setInteractive(true);
|
|
61
|
+
};
|
|
62
|
+
const {
|
|
63
|
+
scripts
|
|
64
|
+
} = preview;
|
|
65
|
+
const html = 'photo' === type ? (0, _util.getPhotoHtml)(preview) : preview.html;
|
|
66
|
+
const embedSourceUrl = (0, _url.getAuthority)(url);
|
|
67
|
+
const iframeTitle = (0, _i18n.sprintf)(
|
|
68
|
+
// translators: %s: host providing embed content e.g: www.youtube.com
|
|
69
|
+
(0, _i18n.__)('Embedded content from %s'), embedSourceUrl);
|
|
70
|
+
const sandboxClassnames = (0, _clsx.default)(type, className, 'wp-block-embed__wrapper');
|
|
89
71
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
72
|
+
// Disabled because the overlay div doesn't actually have a role or functionality
|
|
73
|
+
// as far as the user is concerned. We're just catching the first click so that
|
|
74
|
+
// the block can be selected without interacting with the embed preview that the overlay covers.
|
|
75
|
+
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
|
76
|
+
const embedWrapper = 'wp-embed' === type ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_wpEmbedPreview.default, {
|
|
77
|
+
html: html
|
|
78
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
79
|
+
className: "wp-block-embed__wrapper",
|
|
80
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.SandBox, {
|
|
81
|
+
html: html,
|
|
82
|
+
scripts: scripts,
|
|
83
|
+
title: iframeTitle,
|
|
84
|
+
type: sandboxClassnames,
|
|
85
|
+
onFocus: hideOverlay
|
|
86
|
+
}), !interactive && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
87
|
+
className: "block-library-embed__interactive-overlay",
|
|
88
|
+
onMouseUp: hideOverlay
|
|
89
|
+
})]
|
|
90
|
+
});
|
|
91
|
+
/* eslint-enable jsx-a11y/no-static-element-interactions */
|
|
110
92
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
93
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("figure", {
|
|
94
|
+
className: (0, _clsx.default)(className, 'wp-block-embed', {
|
|
95
|
+
'is-type-video': 'video' === type
|
|
96
|
+
}),
|
|
97
|
+
children: [previewable ? embedWrapper : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.Placeholder, {
|
|
98
|
+
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.BlockIcon, {
|
|
99
|
+
icon: icon,
|
|
100
|
+
showColors: true
|
|
114
101
|
}),
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
})
|
|
127
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
128
|
-
className: "components-placeholder__error",
|
|
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."), embedSourceUrl)
|
|
131
|
-
})]
|
|
132
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_caption.Caption, {
|
|
133
|
-
attributes: attributes,
|
|
134
|
-
setAttributes: setAttributes,
|
|
135
|
-
isSelected: isSelected,
|
|
136
|
-
insertBlocksAfter: insertBlocksAfter,
|
|
137
|
-
label: (0, _i18n.__)('Embed caption text'),
|
|
138
|
-
showToolbarButton: isSelected
|
|
102
|
+
label: label,
|
|
103
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
104
|
+
className: "components-placeholder__error",
|
|
105
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("a", {
|
|
106
|
+
href: url,
|
|
107
|
+
children: url
|
|
108
|
+
})
|
|
109
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
110
|
+
className: "components-placeholder__error",
|
|
111
|
+
children: (0, _i18n.sprintf)( /* translators: %s: host providing embed content e.g: www.youtube.com */
|
|
112
|
+
(0, _i18n.__)("Embedded content from %s can't be previewed in the editor."), embedSourceUrl)
|
|
139
113
|
})]
|
|
140
|
-
})
|
|
141
|
-
|
|
114
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_caption.Caption, {
|
|
115
|
+
attributes: attributes,
|
|
116
|
+
setAttributes: setAttributes,
|
|
117
|
+
isSelected: isSelected,
|
|
118
|
+
insertBlocksAfter: insertBlocksAfter,
|
|
119
|
+
label: (0, _i18n.__)('Embed caption text'),
|
|
120
|
+
showToolbarButton: isSelected
|
|
121
|
+
})]
|
|
122
|
+
});
|
|
142
123
|
}
|
|
143
|
-
var _default = exports.default = EmbedPreview;
|
|
144
124
|
//# sourceMappingURL=embed-preview.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_util","require","_clsx","_interopRequireDefault","_i18n","_components","_blockEditor","_element","_url","_wpEmbedPreview","_caption","_jsxRuntime","EmbedPreview","
|
|
1
|
+
{"version":3,"names":["_util","require","_clsx","_interopRequireDefault","_i18n","_components","_blockEditor","_element","_url","_wpEmbedPreview","_caption","_jsxRuntime","EmbedPreview","preview","previewable","url","type","isSelected","className","icon","label","insertBlocksAfter","attributes","setAttributes","interactive","setInteractive","useState","hideOverlay","scripts","html","getPhotoHtml","embedSourceUrl","getAuthority","iframeTitle","sprintf","__","sandboxClassnames","clsx","embedWrapper","jsx","default","jsxs","children","SandBox","title","onFocus","onMouseUp","Placeholder","BlockIcon","showColors","href","Caption","showToolbarButton"],"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 { BlockIcon } from '@wordpress/block-editor';\nimport { useState } from '@wordpress/element';\nimport { getAuthority } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport WpEmbedPreview from './wp-embed-preview';\nimport { Caption } from '../utils/caption';\n\nexport default function EmbedPreview( {\n\tpreview,\n\tpreviewable,\n\turl,\n\ttype,\n\tisSelected,\n\tclassName,\n\ticon,\n\tlabel,\n\tinsertBlocksAfter,\n\tattributes,\n\tsetAttributes,\n} ) {\n\tconst [ interactive, setInteractive ] = useState( false );\n\n\tif ( ! isSelected && interactive ) {\n\t\t// We only want to change this when the block is not selected, because changing it when\n\t\t// the block becomes selected makes the overlap disappear too early. Hiding the overlay\n\t\t// happens on mouseup when the overlay is clicked.\n\t\tsetInteractive( false );\n\t}\n\n\tconst hideOverlay = () => {\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\tsetInteractive( true );\n\t};\n\n\tconst { scripts } = preview;\n\n\tconst html = 'photo' === type ? getPhotoHtml( preview ) : preview.html;\n\tconst embedSourceUrl = getAuthority( url );\n\tconst iframeTitle = sprintf(\n\t\t// translators: %s: host providing embed content e.g: www.youtube.com\n\t\t__( 'Embedded content from %s' ),\n\t\tembedSourceUrl\n\t);\n\tconst sandboxClassnames = clsx(\n\t\ttype,\n\t\tclassName,\n\t\t'wp-block-embed__wrapper'\n\t);\n\n\t// Disabled because the overlay div doesn't actually have a role or functionality\n\t// as far as the user is concerned. We're just catching the first click so that\n\t// the block can be selected without interacting with the embed preview that the overlay covers.\n\t/* eslint-disable jsx-a11y/no-static-element-interactions */\n\tconst embedWrapper =\n\t\t'wp-embed' === type ? (\n\t\t\t<WpEmbedPreview html={ html } />\n\t\t) : (\n\t\t\t<div className=\"wp-block-embed__wrapper\">\n\t\t\t\t<SandBox\n\t\t\t\t\thtml={ html }\n\t\t\t\t\tscripts={ scripts }\n\t\t\t\t\ttitle={ iframeTitle }\n\t\t\t\t\ttype={ sandboxClassnames }\n\t\t\t\t\tonFocus={ hideOverlay }\n\t\t\t\t/>\n\t\t\t\t{ ! interactive && (\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName=\"block-library-embed__interactive-overlay\"\n\t\t\t\t\t\tonMouseUp={ hideOverlay }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t);\n\t/* eslint-enable jsx-a11y/no-static-element-interactions */\n\n\treturn (\n\t\t<figure\n\t\t\tclassName={ clsx( className, 'wp-block-embed', {\n\t\t\t\t'is-type-video': 'video' === type,\n\t\t\t} ) }\n\t\t>\n\t\t\t{ previewable ? (\n\t\t\t\tembedWrapper\n\t\t\t) : (\n\t\t\t\t<Placeholder\n\t\t\t\t\ticon={ <BlockIcon icon={ icon } showColors /> }\n\t\t\t\t\tlabel={ label }\n\t\t\t\t>\n\t\t\t\t\t<p className=\"components-placeholder__error\">\n\t\t\t\t\t\t<a href={ url }>{ url }</a>\n\t\t\t\t\t</p>\n\t\t\t\t\t<p className=\"components-placeholder__error\">\n\t\t\t\t\t\t{ sprintf(\n\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__(\n\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),\n\t\t\t\t\t\t\tembedSourceUrl\n\t\t\t\t\t\t) }\n\t\t\t\t\t</p>\n\t\t\t\t</Placeholder>\n\t\t\t) }\n\t\t\t<Caption\n\t\t\t\tattributes={ attributes }\n\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\tisSelected={ isSelected }\n\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\tlabel={ __( 'Embed caption text' ) }\n\t\t\t\tshowToolbarButton={ isSelected }\n\t\t\t/>\n\t\t</figure>\n\t);\n}\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;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,IAAA,GAAAP,OAAA;AAKA,IAAAQ,eAAA,GAAAN,sBAAA,CAAAF,OAAA;AACA,IAAAS,QAAA,GAAAT,OAAA;AAA2C,IAAAU,WAAA,GAAAV,OAAA;AAvB3C;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAOA;AACA;AACA;;AAIe,SAASW,YAAYA,CAAE;EACrCC,OAAO;EACPC,WAAW;EACXC,GAAG;EACHC,IAAI;EACJC,UAAU;EACVC,SAAS;EACTC,IAAI;EACJC,KAAK;EACLC,iBAAiB;EACjBC,UAAU;EACVC;AACD,CAAC,EAAG;EACH,MAAM,CAAEC,WAAW,EAAEC,cAAc,CAAE,GAAG,IAAAC,iBAAQ,EAAE,KAAM,CAAC;EAEzD,IAAK,CAAET,UAAU,IAAIO,WAAW,EAAG;IAClC;IACA;IACA;IACAC,cAAc,CAAE,KAAM,CAAC;EACxB;EAEA,MAAME,WAAW,GAAGA,CAAA,KAAM;IACzB;IACA;IACA;IACA;IACA;IACAF,cAAc,CAAE,IAAK,CAAC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EZ,IAAA3B,WAAA,CAAA8B,IAAA,EAACpC,WAAA,CAAA0C,WAAW;MACX5B,IAAI,eAAG,IAAAR,WAAA,CAAA4B,GAAA,EAACjC,YAAA,CAAA0C,SAAS;QAAC7B,IAAI,EAAGA,IAAM;QAAC8B,UAAU;MAAA,CAAE,CAAG;MAC/C7B,KAAK,EAAGA,KAAO;MAAAsB,QAAA,gBAEf,IAAA/B,WAAA,CAAA4B,GAAA;QAAGrB,SAAS,EAAC,+BAA+B;QAAAwB,QAAA,eAC3C,IAAA/B,WAAA,CAAA4B,GAAA;UAAGW,IAAI,EAAGnC,GAAK;UAAA2B,QAAA,EAAG3B;QAAG,CAAK;MAAC,CACzB,CAAC,eACJ,IAAAJ,WAAA,CAAA4B,GAAA;QAAGrB,SAAS,EAAC,+BAA+B;QAAAwB,QAAA,EACzC,IAAAR,aAAO,GACR;QACA,IAAAC,QAAE,EACD,4DACD,CAAC,EACDJ,cACD;MAAC,CACC,CAAC;IAAA,CACQ,CACb,eACD,IAAApB,WAAA,CAAA4B,GAAA,EAAC7B,QAAA,CAAAyC,OAAO;MACP7B,UAAU,EAAGA,UAAY;MACzBC,aAAa,EAAGA,aAAe;MAC/BN,UAAU,EAAGA,UAAY;MACzBI,iBAAiB,EAAGA,iBAAmB;MACvCD,KAAK,EAAG,IAAAe,QAAE,EAAE,oBAAqB,CAAG;MACpCiB,iBAAiB,EAAGnC;IAAY,CAChC,CAAC;EAAA,CACK,CAAC;AAEX","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_clsx","_interopRequireDefault","_primitives","_blockEditor","_i18n","_element","_components","_data","_util","_embedNoPreview","_wpEmbedPreview","_styles","_jsxRuntime","EmbedPreview","align","className","clientId","icon","insertBlocksAfter","isSelected","label","onFocus","preview","previewable","isProviderPreviewable","type","url","isDefaultEmbedInfo","isCaptionSelected","setIsCaptionSelected","useState","locale","useSelect","blockEditorStore","getSettings","wrapperStyle","styles","wrapperAlignStyle","sandboxAlignStyle","accessibilityLabelCreator","caption","RichText","isEmpty","__","sprintf","onEmbedPreviewPress","onFocusCaption","provider_url","providerUrl","html","getPhotoHtml","parsedHost","URL","host","split","parsedHostBaseUrl","splice","length","join","iframeTitle","sandboxClassnames","clsx","PreviewContent","WpEmbedPreview","SandBox","embedWrapper","jsx","Fragment","children","TouchableWithoutFeedback","onPress","View","pointerEvents","style","lang","title","containerStyle","accessible","disabled","jsxs","default","BlockCaption","_default","exports","memo"],"sources":["@wordpress/block-library/src/embed/embed-preview.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { TouchableWithoutFeedback } from 'react-native';\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { View } from '@wordpress/primitives';\nimport {\n\tBlockCaption,\n\tRichText,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { memo, useState } from '@wordpress/element';\nimport { SandBox } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { getPhotoHtml } from './util';\nimport EmbedNoPreview from './embed-no-preview';\nimport WpEmbedPreview from './wp-embed-preview';\nimport styles from './styles.scss';\n\nconst EmbedPreview = ( {\n\talign,\n\tclassName,\n\tclientId,\n\ticon,\n\tinsertBlocksAfter,\n\tisSelected,\n\tlabel,\n\tonFocus,\n\tpreview,\n\tpreviewable,\n\tisProviderPreviewable,\n\ttype,\n\turl,\n\tisDefaultEmbedInfo,\n} ) => {\n\tconst [ isCaptionSelected, setIsCaptionSelected ] = useState( false );\n\tconst { locale } = useSelect( blockEditorStore ).getSettings();\n\n\tconst wrapperStyle = styles[ 'embed-preview__wrapper' ];\n\tconst wrapperAlignStyle =\n\t\tstyles[ `embed-preview__wrapper--align-${ align }` ];\n\tconst sandboxAlignStyle =\n\t\tstyles[ `embed-preview__sandbox--align-${ align }` ];\n\n\tfunction accessibilityLabelCreator( caption ) {\n\t\treturn RichText.isEmpty( caption )\n\t\t\t? /* translators: accessibility text. Empty Embed caption. */\n\t\t\t __( 'Embed caption. Empty' )\n\t\t\t: sprintf(\n\t\t\t\t\t/* translators: accessibility text. %s: Embed caption. */\n\t\t\t\t\t__( 'Embed caption. %s' ),\n\t\t\t\t\tcaption\n\t\t\t );\n\t}\n\n\tfunction onEmbedPreviewPress() {\n\t\tsetIsCaptionSelected( false );\n\t}\n\n\tfunction onFocusCaption() {\n\t\tif ( onFocus ) {\n\t\t\tonFocus();\n\t\t}\n\t\tif ( ! isCaptionSelected ) {\n\t\t\tsetIsCaptionSelected( true );\n\t\t}\n\t}\n\n\tconst { provider_url: providerUrl } = preview;\n\tconst html = 'photo' === type ? getPhotoHtml( preview ) : preview.html;\n\tconst parsedHost = new URL( url ).host.split( '.' );\n\tconst parsedHostBaseUrl = parsedHost\n\t\t.splice( parsedHost.length - 2, parsedHost.length - 1 )\n\t\t.join( '.' );\n\tconst iframeTitle = sprintf(\n\t\t// translators: %s: host providing embed content e.g: www.youtube.com\n\t\t__( 'Embedded content from %s' ),\n\t\tparsedHostBaseUrl\n\t);\n\tconst sandboxClassnames = clsx(\n\t\ttype,\n\t\tclassName,\n\t\t'wp-block-embed__wrapper'\n\t);\n\n\tconst PreviewContent = 'wp-embed' === type ? WpEmbedPreview : SandBox;\n\tconst embedWrapper = (\n\t\t<>\n\t\t\t<TouchableWithoutFeedback\n\t\t\t\tonPress={ () => {\n\t\t\t\t\tif ( onFocus ) {\n\t\t\t\t\t\tonFocus();\n\t\t\t\t\t}\n\t\t\t\t\tif ( isCaptionSelected ) {\n\t\t\t\t\t\tsetIsCaptionSelected( false );\n\t\t\t\t\t}\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<View\n\t\t\t\t\tpointerEvents=\"box-only\"\n\t\t\t\t\tstyle={ [ wrapperStyle, wrapperAlignStyle ] }\n\t\t\t\t>\n\t\t\t\t\t<PreviewContent\n\t\t\t\t\t\thtml={ html }\n\t\t\t\t\t\tlang={ locale }\n\t\t\t\t\t\ttitle={ iframeTitle }\n\t\t\t\t\t\ttype={ sandboxClassnames }\n\t\t\t\t\t\tproviderUrl={ providerUrl }\n\t\t\t\t\t\turl={ url }\n\t\t\t\t\t\tcontainerStyle={ sandboxAlignStyle }\n\t\t\t\t\t/>\n\t\t\t\t</View>\n\t\t\t</TouchableWithoutFeedback>\n\t\t</>\n\t);\n\treturn (\n\t\t<TouchableWithoutFeedback\n\t\t\taccessible={ ! isSelected }\n\t\t\tonPress={ onEmbedPreviewPress }\n\t\t\tdisabled={ ! isSelected }\n\t\t>\n\t\t\t<View>\n\t\t\t\t{ isProviderPreviewable && previewable ? (\n\t\t\t\t\tembedWrapper\n\t\t\t\t) : (\n\t\t\t\t\t<EmbedNoPreview\n\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\tonPress={ () => setIsCaptionSelected( false ) }\n\t\t\t\t\t\tpreviewable={ previewable }\n\t\t\t\t\t\tisDefaultEmbedInfo={ isDefaultEmbedInfo }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<BlockCaption\n\t\t\t\t\taccessibilityLabelCreator={ accessibilityLabelCreator }\n\t\t\t\t\taccessible\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\t\tisSelected={ isCaptionSelected }\n\t\t\t\t\tonFocus={ onFocusCaption }\n\t\t\t\t/>\n\t\t\t</View>\n\t\t</TouchableWithoutFeedback>\n\t);\n};\n\nexport default memo( EmbedPreview );\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_clsx","_interopRequireDefault","_primitives","_blockEditor","_i18n","_element","_components","_data","_util","_embedNoPreview","_wpEmbedPreview","_styles","_jsxRuntime","EmbedPreview","align","className","clientId","icon","insertBlocksAfter","isSelected","label","onFocus","preview","previewable","isProviderPreviewable","type","url","isDefaultEmbedInfo","isCaptionSelected","setIsCaptionSelected","useState","locale","useSelect","blockEditorStore","getSettings","wrapperStyle","styles","wrapperAlignStyle","sandboxAlignStyle","accessibilityLabelCreator","caption","RichText","isEmpty","__","sprintf","onEmbedPreviewPress","onFocusCaption","provider_url","providerUrl","html","getPhotoHtml","parsedHost","URL","host","split","parsedHostBaseUrl","splice","length","join","iframeTitle","sandboxClassnames","clsx","PreviewContent","WpEmbedPreview","SandBox","embedWrapper","jsx","Fragment","children","TouchableWithoutFeedback","onPress","View","pointerEvents","style","lang","title","containerStyle","accessible","disabled","jsxs","default","BlockCaption","_default","exports","memo"],"sources":["@wordpress/block-library/src/embed/embed-preview.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { TouchableWithoutFeedback } from 'react-native';\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { View } from '@wordpress/primitives';\nimport {\n\tBlockCaption,\n\tRichText,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { memo, useState } from '@wordpress/element';\nimport { SandBox } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { getPhotoHtml } from './util';\nimport EmbedNoPreview from './embed-no-preview';\nimport WpEmbedPreview from './wp-embed-preview';\nimport styles from './styles.scss';\n\nconst EmbedPreview = ( {\n\talign,\n\tclassName,\n\tclientId,\n\ticon,\n\tinsertBlocksAfter,\n\tisSelected,\n\tlabel,\n\tonFocus,\n\tpreview,\n\tpreviewable,\n\tisProviderPreviewable,\n\ttype,\n\turl,\n\tisDefaultEmbedInfo,\n} ) => {\n\tconst [ isCaptionSelected, setIsCaptionSelected ] = useState( false );\n\tconst { locale } = useSelect( blockEditorStore ).getSettings();\n\n\tconst wrapperStyle = styles[ 'embed-preview__wrapper' ];\n\tconst wrapperAlignStyle =\n\t\tstyles[ `embed-preview__wrapper--align-${ align }` ];\n\tconst sandboxAlignStyle =\n\t\tstyles[ `embed-preview__sandbox--align-${ align }` ];\n\n\tfunction accessibilityLabelCreator( caption ) {\n\t\treturn RichText.isEmpty( caption )\n\t\t\t? /* translators: accessibility text. Empty Embed caption. */\n\t\t\t __( 'Embed caption. Empty' )\n\t\t\t: sprintf(\n\t\t\t\t\t/* translators: accessibility text. %s: Embed caption. */\n\t\t\t\t\t__( 'Embed caption. %s' ),\n\t\t\t\t\tcaption\n\t\t\t );\n\t}\n\n\tfunction onEmbedPreviewPress() {\n\t\tsetIsCaptionSelected( false );\n\t}\n\n\tfunction onFocusCaption() {\n\t\tif ( onFocus ) {\n\t\t\tonFocus();\n\t\t}\n\t\tif ( ! isCaptionSelected ) {\n\t\t\tsetIsCaptionSelected( true );\n\t\t}\n\t}\n\n\tconst { provider_url: providerUrl } = preview;\n\tconst html = 'photo' === type ? getPhotoHtml( preview ) : preview.html;\n\tconst parsedHost = new URL( url ).host.split( '.' );\n\tconst parsedHostBaseUrl = parsedHost\n\t\t.splice( parsedHost.length - 2, parsedHost.length - 1 )\n\t\t.join( '.' );\n\tconst iframeTitle = sprintf(\n\t\t// translators: %s: host providing embed content e.g: www.youtube.com\n\t\t__( 'Embedded content from %s' ),\n\t\tparsedHostBaseUrl\n\t);\n\tconst sandboxClassnames = clsx(\n\t\ttype,\n\t\tclassName,\n\t\t'wp-block-embed__wrapper'\n\t);\n\n\tconst PreviewContent = 'wp-embed' === type ? WpEmbedPreview : SandBox;\n\tconst embedWrapper = (\n\t\t<>\n\t\t\t<TouchableWithoutFeedback\n\t\t\t\tonPress={ () => {\n\t\t\t\t\tif ( onFocus ) {\n\t\t\t\t\t\tonFocus();\n\t\t\t\t\t}\n\t\t\t\t\tif ( isCaptionSelected ) {\n\t\t\t\t\t\tsetIsCaptionSelected( false );\n\t\t\t\t\t}\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<View\n\t\t\t\t\tpointerEvents=\"box-only\"\n\t\t\t\t\tstyle={ [ wrapperStyle, wrapperAlignStyle ] }\n\t\t\t\t>\n\t\t\t\t\t<PreviewContent\n\t\t\t\t\t\thtml={ html }\n\t\t\t\t\t\tlang={ locale }\n\t\t\t\t\t\ttitle={ iframeTitle }\n\t\t\t\t\t\ttype={ sandboxClassnames }\n\t\t\t\t\t\tproviderUrl={ providerUrl }\n\t\t\t\t\t\turl={ url }\n\t\t\t\t\t\tcontainerStyle={ sandboxAlignStyle }\n\t\t\t\t\t/>\n\t\t\t\t</View>\n\t\t\t</TouchableWithoutFeedback>\n\t\t</>\n\t);\n\treturn (\n\t\t<TouchableWithoutFeedback\n\t\t\taccessible={ ! isSelected }\n\t\t\tonPress={ onEmbedPreviewPress }\n\t\t\tdisabled={ ! isSelected }\n\t\t>\n\t\t\t<View>\n\t\t\t\t{ isProviderPreviewable && previewable ? (\n\t\t\t\t\tembedWrapper\n\t\t\t\t) : (\n\t\t\t\t\t<EmbedNoPreview\n\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\tonPress={ () => setIsCaptionSelected( false ) }\n\t\t\t\t\t\tpreviewable={ previewable }\n\t\t\t\t\t\tisDefaultEmbedInfo={ isDefaultEmbedInfo }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<BlockCaption\n\t\t\t\t\taccessibilityLabelCreator={ accessibilityLabelCreator }\n\t\t\t\t\taccessible\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\t\tisSelected={ isCaptionSelected }\n\t\t\t\t\tonFocus={ onFocusCaption }\n\t\t\t\t/>\n\t\t\t</View>\n\t\t</TouchableWithoutFeedback>\n\t);\n};\n\nexport default memo( EmbedPreview );\n"],"mappings":";;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAC,sBAAA,CAAAF,OAAA;AAKA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAKA,IAAAK,KAAA,GA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EAAGS,iBAAmB;QAChCP,OAAO,EAAGyB;MAAgB,CAC1B,CAAC;IAAA,CACG;EAAC,CACkB,CAAC;AAE7B,CAAC;AAAC,IAAAoC,QAAA,GAAAC,OAAA,CAAAH,OAAA,GAEa,IAAAI,aAAI,EAAEvE,YAAa,CAAC","ignoreList":[]}
|
package/build/form/view.js
CHANGED
package/build/form/view.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["document","querySelectorAll","forEach","form","action","startsWith","redirectNotification","status","urlParams","URLSearchParams","window","location","search","append","toString","addEventListener","event","preventDefault","formData","Object","fromEntries","FormData","entries","formAction","_ajax_nonce","wpBlockFormSettings","nonce","_wp_http_referer","href","response","fetch","ajaxUrl","method","headers","body","ok","error"],"sources":["@wordpress/block-library/src/form/view.js"],"sourcesContent":["// eslint-disable-next-line eslint-comments/disable-enable-pair\n/* eslint-disable no-undef */\ndocument.querySelectorAll( 'form.wp-block-form' ).forEach( function ( form ) {\n\t// Bail If the form is not using the mailto: action.\n\tif ( ! form.action || ! form.action.startsWith( 'mailto:' ) ) {\n\t\treturn;\n\t}\n\n\tconst redirectNotification = ( status ) => {\n\t\tconst urlParams = new URLSearchParams( window.location.search );\n\t\turlParams.append( 'wp-form-result', status );\n\t\twindow.location.search = urlParams.toString();\n\t};\n\n\t// Add an event listener for the form submission.\n\tform.addEventListener( 'submit', async function ( event ) {\n\t\tevent.preventDefault();\n\t\t// Get the form data and merge it with the form action and nonce.\n\t\tconst formData = Object.fromEntries( new FormData( form ).entries() );\n\t\tformData.formAction = form.action;\n\t\tformData._ajax_nonce = wpBlockFormSettings.nonce;\n\t\tformData.action = wpBlockFormSettings.action;\n\t\tformData._wp_http_referer = window.location.href;\n\t\tformData.formAction = form.action;\n\n\t\ttry {\n\t\t\tconst response = await fetch( wpBlockFormSettings.ajaxUrl, {\n\t\t\t\tmethod: 'POST',\n\t\t\t\theaders: {\n\t\t\t\t\t'Content-Type': 'application/x-www-form-urlencoded',\n\t\t\t\t},\n\t\t\t\tbody: new URLSearchParams( formData ).toString(),\n\t\t\t} );\n\t\t\tif ( response.ok ) {\n\t\t\t\tredirectNotification( 'success' );\n\t\t\t} else {\n\t\t\t\tredirectNotification( 'error' );\n\t\t\t}\n\t\t} catch ( error ) {\n\t\t\tredirectNotification( 'error' );\n\t\t}\n\t} );\n} );\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["document","querySelectorAll","forEach","form","action","startsWith","redirectNotification","status","urlParams","URLSearchParams","window","location","search","append","toString","addEventListener","event","preventDefault","formData","Object","fromEntries","FormData","entries","formAction","_ajax_nonce","wpBlockFormSettings","nonce","_wp_http_referer","href","response","fetch","ajaxUrl","method","headers","body","ok","error"],"sources":["@wordpress/block-library/src/form/view.js"],"sourcesContent":["// eslint-disable-next-line eslint-comments/disable-enable-pair\n/* eslint-disable no-undef */\ndocument.querySelectorAll( 'form.wp-block-form' ).forEach( function ( form ) {\n\t// Bail If the form is not using the mailto: action.\n\tif ( ! form.action || ! form.action.startsWith( 'mailto:' ) ) {\n\t\treturn;\n\t}\n\n\tconst redirectNotification = ( status ) => {\n\t\tconst urlParams = new URLSearchParams( window.location.search );\n\t\turlParams.append( 'wp-form-result', status );\n\t\twindow.location.search = urlParams.toString();\n\t};\n\n\t// Add an event listener for the form submission.\n\tform.addEventListener( 'submit', async function ( event ) {\n\t\tevent.preventDefault();\n\t\t// Get the form data and merge it with the form action and nonce.\n\t\tconst formData = Object.fromEntries( new FormData( form ).entries() );\n\t\tformData.formAction = form.action;\n\t\tformData._ajax_nonce = wpBlockFormSettings.nonce;\n\t\tformData.action = wpBlockFormSettings.action;\n\t\tformData._wp_http_referer = window.location.href;\n\t\tformData.formAction = form.action;\n\n\t\ttry {\n\t\t\tconst response = await fetch( wpBlockFormSettings.ajaxUrl, {\n\t\t\t\tmethod: 'POST',\n\t\t\t\theaders: {\n\t\t\t\t\t'Content-Type': 'application/x-www-form-urlencoded',\n\t\t\t\t},\n\t\t\t\tbody: new URLSearchParams( formData ).toString(),\n\t\t\t} );\n\t\t\tif ( response.ok ) {\n\t\t\t\tredirectNotification( 'success' );\n\t\t\t} else {\n\t\t\t\tredirectNotification( 'error' );\n\t\t\t}\n\t\t} catch ( error ) {\n\t\t\tredirectNotification( 'error' );\n\t\t}\n\t} );\n} );\n"],"mappings":";;;AAAA;AACA;AACAA,QAAQ,CAACC,gBAAgB,CAAE,oBAAqB,CAAC,CAACC,OAAO,CAAE,UAAWC,IAAI,EAAG;EAC5E;EACA,IAAK,CAAEA,IAAI,CAACC,MAAM,IAAI,CAAED,IAAI,CAACC,MAAM,CAACC,UAAU,CAAE,SAAU,CAAC,EAAG;IAC7D;EACD;EAEA,MAAMC,oBAAoB,GAAKC,MAAM,IAAM;IAC1C,MAAMC,SAAS,GAAG,IAAIC,eAAe,CAAEC,MAAM,CAACC,QAAQ,CAACC,MAAO,CAAC;IAC/DJ,SAAS,CAACK,MAAM,CAAE,gBAAgB,EAAEN,MAAO,CAAC;IAC5CG,MAAM,CAACC,QAAQ,CAACC,MAAM,GAAGJ,SAAS,CAACM,QAAQ,CAAC,CAAC;EAC9C,CAAC;;EAED;EACAX,IAAI,CAACY,gBAAgB,CAAE,QAAQ,EAAE,gBAAiBC,KAAK,EAAG;IACzDA,KAAK,CAACC,cAAc,CAAC,CAAC;IACtB;IACA,MAAMC,QAAQ,GAAGC,MAAM,CAACC,WAAW,CAAE,IAAIC,QAAQ,CAAElB,IAAK,CAAC,CAACmB,OAAO,CAAC,CAAE,CAAC;IACrEJ,QAAQ,CAACK,UAAU,GAAGpB,IAAI,CAACC,MAAM;IACjCc,QAAQ,CAACM,WAAW,GAAGC,mBAAmB,CAACC,KAAK;IAChDR,QAAQ,CAACd,MAAM,GAAGqB,mBAAmB,CAACrB,MAAM;IAC5Cc,QAAQ,CAACS,gBAAgB,GAAGjB,MAAM,CAACC,QAAQ,CAACiB,IAAI;IAChDV,QAAQ,CAACK,UAAU,GAAGpB,IAAI,CAACC,MAAM;IAEjC,IAAI;MACH,MAAMyB,QAAQ,GAAG,MAAMC,KAAK,CAAEL,mBAAmB,CAACM,OAAO,EAAE;QAC1DC,MAAM,EAAE,MAAM;QACdC,OAAO,EAAE;UACR,cAAc,EAAE;QACjB,CAAC;QACDC,IAAI,EAAE,IAAIzB,eAAe,CAAES,QAAS,CAAC,CAACJ,QAAQ,CAAC;MAChD,CAAE,CAAC;MACH,IAAKe,QAAQ,CAACM,EAAE,EAAG;QAClB7B,oBAAoB,CAAE,SAAU,CAAC;MAClC,CAAC,MAAM;QACNA,oBAAoB,CAAE,OAAQ,CAAC;MAChC;IACD,CAAC,CAAC,OAAQ8B,KAAK,EAAG;MACjB9B,oBAAoB,CAAE,OAAQ,CAAC;IAChC;EACD,CAAE,CAAC;AACJ,CAAE,CAAC","ignoreList":[]}
|
package/build/image/image.js
CHANGED
|
@@ -467,8 +467,11 @@ function Image({
|
|
|
467
467
|
const showUrlInput = isSingleSelected && !isEditingImage && !lockHrefControls && !lockUrlControls;
|
|
468
468
|
const showCoverControls = isSingleSelected && canInsertCover;
|
|
469
469
|
const showBlockControls = showUrlInput || allowCrop || showCoverControls;
|
|
470
|
-
const mediaReplaceFlow = isSingleSelected && !isEditingImage && !lockUrlControls &&
|
|
471
|
-
|
|
470
|
+
const mediaReplaceFlow = isSingleSelected && !isEditingImage && !lockUrlControls &&
|
|
471
|
+
/*#__PURE__*/
|
|
472
|
+
// For contentOnly mode, put this button in its own area so it has borders around it.
|
|
473
|
+
(0, _jsxRuntime.jsx)(_blockEditor.BlockControls, {
|
|
474
|
+
group: isContentOnlyMode ? 'inline' : 'other',
|
|
472
475
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.MediaReplaceFlow, {
|
|
473
476
|
mediaId: id,
|
|
474
477
|
mediaURL: url,
|