@wordpress/block-library 9.24.0 → 9.26.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 +4 -0
- package/build/avatar/edit.js +84 -39
- package/build/avatar/edit.js.map +1 -1
- package/build/avatar/user-control.js +32 -17
- package/build/avatar/user-control.js.map +1 -1
- package/build/button/edit.js +29 -17
- package/build/button/edit.js.map +1 -1
- package/build/columns/edit.js +18 -22
- package/build/columns/edit.js.map +1 -1
- package/build/comment-author-name/edit.js +41 -12
- package/build/comment-author-name/edit.js.map +1 -1
- package/build/comment-date/edit.js +41 -12
- package/build/comment-date/edit.js.map +1 -1
- package/build/comment-edit-link/edit.js +27 -7
- package/build/comment-edit-link/edit.js.map +1 -1
- package/build/comments/edit/comments-inspector-controls.js +1 -3
- package/build/comments/edit/comments-inspector-controls.js.map +1 -1
- package/build/comments-pagination/edit.js +23 -9
- package/build/comments-pagination/edit.js.map +1 -1
- package/build/comments-title/edit.js +41 -12
- package/build/comments-title/edit.js.map +1 -1
- package/build/details/edit.js +27 -3
- package/build/details/edit.js.map +1 -1
- package/build/embed/edit.js +2 -4
- package/build/embed/edit.js.map +1 -1
- package/build/embed/embed-controls.js +41 -22
- package/build/embed/embed-controls.js.map +1 -1
- package/build/embed/variations.js +0 -10
- package/build/embed/variations.js.map +1 -1
- package/build/file/inspector.js +73 -30
- package/build/file/inspector.js.map +1 -1
- package/build/form/edit.js +67 -38
- package/build/form/edit.js.map +1 -1
- package/build/form/index.js +3 -3
- package/build/form/index.js.map +1 -1
- package/build/form-input/edit.js +47 -18
- package/build/form-input/edit.js.map +1 -1
- package/build/form-input/index.js +2 -1
- package/build/form-input/index.js.map +1 -1
- package/build/form-submission-notification/index.js +2 -1
- package/build/form-submission-notification/index.js.map +1 -1
- package/build/form-submit-button/index.js +2 -1
- package/build/form-submit-button/index.js.map +1 -1
- package/build/image/image.js +1 -0
- package/build/image/image.js.map +1 -1
- package/build/image/view.js +0 -3
- package/build/image/view.js.map +1 -1
- package/build/latest-posts/edit.js +154 -82
- package/build/latest-posts/edit.js.map +1 -1
- package/build/list/ordered-list-settings.js +131 -52
- package/build/list/ordered-list-settings.js.map +1 -1
- package/build/navigation/edit/index.js +93 -51
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/overlay-menu-preview.js +43 -27
- package/build/navigation/edit/overlay-menu-preview.js.map +1 -1
- package/build/navigation-link/edit.js +11 -0
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-link/index.js +3 -0
- package/build/navigation-link/index.js.map +1 -1
- package/build/navigation-link/transforms.js +2 -0
- package/build/navigation-link/transforms.js.map +1 -1
- package/build/navigation-link/update-attributes.js +1 -0
- package/build/navigation-link/update-attributes.js.map +1 -1
- package/build/navigation-submenu/index.js +3 -0
- package/build/navigation-submenu/index.js.map +1 -1
- package/build/post-author/edit.js +75 -18
- package/build/post-author/edit.js.map +1 -1
- package/build/post-comments-count/index.js +3 -1
- package/build/post-comments-count/index.js.map +1 -1
- package/build/post-comments-count/transforms.js +26 -0
- package/build/post-comments-count/transforms.js.map +1 -0
- package/build/post-comments-link/index.js +3 -1
- package/build/post-comments-link/index.js.map +1 -1
- package/build/post-comments-link/transforms.js +26 -0
- package/build/post-comments-link/transforms.js.map +1 -0
- package/build/post-navigation-link/edit.js +72 -33
- package/build/post-navigation-link/edit.js.map +1 -1
- package/build/post-title/edit.js +56 -18
- package/build/post-title/edit.js.map +1 -1
- package/build/query/edit/enhanced-pagination-modal.js +1 -1
- package/build/query/edit/enhanced-pagination-modal.js.map +1 -1
- package/build/query/edit/inspector-controls/enhanced-pagination-control.js +3 -6
- package/build/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
- package/build/rss/edit.js +120 -46
- package/build/rss/edit.js.map +1 -1
- package/build/separator/edit.js +52 -20
- package/build/separator/edit.js.map +1 -1
- package/build/shortcode/index.js +2 -1
- package/build/shortcode/index.js.map +1 -1
- package/build/site-logo/edit.js +53 -19
- package/build/site-logo/edit.js.map +1 -1
- package/build/social-link/edit.js +21 -5
- package/build/social-link/edit.js.map +1 -1
- package/build/social-link/edit.native.js +13 -5
- package/build/social-link/edit.native.js.map +1 -1
- package/build/social-link/social-list.js +17 -25
- package/build/social-link/social-list.js.map +1 -1
- package/build/social-link/variations.js +53 -48
- package/build/social-link/variations.js.map +1 -1
- package/build/social-links/edit.js +38 -45
- package/build/social-links/edit.js.map +1 -1
- package/build/video/tracks-editor.js +63 -21
- package/build/video/tracks-editor.js.map +1 -1
- package/build-module/avatar/edit.js +83 -38
- package/build-module/avatar/edit.js.map +1 -1
- package/build-module/avatar/user-control.js +33 -18
- package/build-module/avatar/user-control.js.map +1 -1
- package/build-module/button/edit.js +30 -18
- package/build-module/button/edit.js.map +1 -1
- package/build-module/columns/edit.js +18 -22
- package/build-module/columns/edit.js.map +1 -1
- package/build-module/comment-author-name/edit.js +42 -13
- package/build-module/comment-author-name/edit.js.map +1 -1
- package/build-module/comment-date/edit.js +42 -13
- package/build-module/comment-date/edit.js.map +1 -1
- package/build-module/comment-edit-link/edit.js +28 -8
- package/build-module/comment-edit-link/edit.js.map +1 -1
- package/build-module/comments/edit/comments-inspector-controls.js +1 -3
- package/build-module/comments/edit/comments-inspector-controls.js.map +1 -1
- package/build-module/comments-pagination/edit.js +24 -10
- package/build-module/comments-pagination/edit.js.map +1 -1
- package/build-module/comments-title/edit.js +42 -13
- package/build-module/comments-title/edit.js.map +1 -1
- package/build-module/details/edit.js +29 -5
- package/build-module/details/edit.js.map +1 -1
- package/build-module/embed/edit.js +2 -4
- package/build-module/embed/edit.js.map +1 -1
- package/build-module/embed/embed-controls.js +42 -23
- package/build-module/embed/embed-controls.js.map +1 -1
- package/build-module/embed/variations.js +0 -10
- package/build-module/embed/variations.js.map +1 -1
- package/build-module/file/inspector.js +74 -31
- package/build-module/file/inspector.js.map +1 -1
- package/build-module/form/edit.js +68 -39
- package/build-module/form/edit.js.map +1 -1
- package/build-module/form/index.js +3 -3
- package/build-module/form/index.js.map +1 -1
- package/build-module/form-input/edit.js +48 -19
- package/build-module/form-input/edit.js.map +1 -1
- package/build-module/form-input/index.js +2 -1
- package/build-module/form-input/index.js.map +1 -1
- package/build-module/form-submission-notification/index.js +2 -1
- package/build-module/form-submission-notification/index.js.map +1 -1
- package/build-module/form-submit-button/index.js +2 -1
- package/build-module/form-submit-button/index.js.map +1 -1
- package/build-module/image/image.js +1 -0
- package/build-module/image/image.js.map +1 -1
- package/build-module/image/view.js +0 -3
- package/build-module/image/view.js.map +1 -1
- package/build-module/latest-posts/edit.js +155 -83
- package/build-module/latest-posts/edit.js.map +1 -1
- package/build-module/list/ordered-list-settings.js +132 -53
- package/build-module/list/ordered-list-settings.js.map +1 -1
- package/build-module/navigation/edit/index.js +94 -52
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/overlay-menu-preview.js +44 -28
- package/build-module/navigation/edit/overlay-menu-preview.js.map +1 -1
- package/build-module/navigation-link/edit.js +11 -0
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-link/index.js +3 -0
- package/build-module/navigation-link/index.js.map +1 -1
- package/build-module/navigation-link/transforms.js +2 -0
- package/build-module/navigation-link/transforms.js.map +1 -1
- package/build-module/navigation-link/update-attributes.js +1 -0
- package/build-module/navigation-link/update-attributes.js.map +1 -1
- package/build-module/navigation-submenu/index.js +3 -0
- package/build-module/navigation-submenu/index.js.map +1 -1
- package/build-module/post-author/edit.js +76 -19
- package/build-module/post-author/edit.js.map +1 -1
- package/build-module/post-comments-count/index.js +3 -1
- package/build-module/post-comments-count/index.js.map +1 -1
- package/build-module/post-comments-count/transforms.js +19 -0
- package/build-module/post-comments-count/transforms.js.map +1 -0
- package/build-module/post-comments-link/index.js +3 -1
- package/build-module/post-comments-link/index.js.map +1 -1
- package/build-module/post-comments-link/transforms.js +19 -0
- package/build-module/post-comments-link/transforms.js.map +1 -0
- package/build-module/post-navigation-link/edit.js +73 -34
- package/build-module/post-navigation-link/edit.js.map +1 -1
- package/build-module/post-title/edit.js +57 -19
- package/build-module/post-title/edit.js.map +1 -1
- package/build-module/query/edit/enhanced-pagination-modal.js +1 -1
- package/build-module/query/edit/enhanced-pagination-modal.js.map +1 -1
- package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js +3 -6
- package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
- package/build-module/rss/edit.js +121 -47
- package/build-module/rss/edit.js.map +1 -1
- package/build-module/separator/edit.js +54 -22
- package/build-module/separator/edit.js.map +1 -1
- package/build-module/shortcode/index.js +2 -1
- package/build-module/shortcode/index.js.map +1 -1
- package/build-module/site-logo/edit.js +54 -20
- package/build-module/site-logo/edit.js.map +1 -1
- package/build-module/social-link/edit.js +24 -8
- package/build-module/social-link/edit.js.map +1 -1
- package/build-module/social-link/edit.native.js +15 -6
- package/build-module/social-link/edit.native.js.map +1 -1
- package/build-module/social-link/social-list.js +16 -21
- package/build-module/social-link/social-list.js.map +1 -1
- package/build-module/social-link/variations.js +53 -48
- package/build-module/social-link/variations.js.map +1 -1
- package/build-module/social-links/edit.js +40 -47
- package/build-module/social-links/edit.js.map +1 -1
- package/build-module/video/tracks-editor.js +65 -23
- package/build-module/video/tracks-editor.js.map +1 -1
- package/build-style/calendar/style-rtl.css +7 -7
- package/build-style/calendar/style.css +7 -7
- package/build-style/comments-pagination/editor-rtl.css +0 -12
- package/build-style/comments-pagination/editor.css +0 -14
- package/build-style/comments-pagination/style-rtl.css +0 -7
- package/build-style/comments-pagination/style.css +0 -9
- package/build-style/editor-rtl.css +9 -21
- package/build-style/editor.css +9 -23
- package/build-style/gallery/style-rtl.css +1 -0
- package/build-style/gallery/style.css +1 -0
- package/build-style/navigation/editor-rtl.css +8 -3
- package/build-style/navigation/editor.css +8 -3
- package/build-style/navigation/style-rtl.css +4 -0
- package/build-style/navigation/style.css +4 -0
- package/build-style/pullquote/editor-rtl.css +1 -1
- package/build-style/pullquote/editor.css +1 -1
- package/build-style/pullquote/style-rtl.css +2 -3
- package/build-style/pullquote/style.css +2 -3
- package/build-style/pullquote/theme-rtl.css +2 -2
- package/build-style/pullquote/theme.css +2 -2
- package/build-style/style-rtl.css +14 -17
- package/build-style/style.css +14 -19
- package/build-style/theme-rtl.css +2 -2
- package/build-style/theme.css +2 -2
- package/package.json +35 -35
- package/src/avatar/edit.js +99 -51
- package/src/avatar/user-control.js +34 -29
- package/src/button/edit.js +44 -29
- package/src/calendar/style.scss +10 -10
- package/src/columns/edit.js +20 -31
- package/src/comment-author-name/edit.js +54 -13
- package/src/comment-date/edit.js +50 -15
- package/src/comment-edit-link/edit.js +39 -11
- package/src/comments/edit/comments-inspector-controls.js +0 -2
- package/src/comments-pagination/edit.js +29 -9
- package/src/comments-pagination/editor.scss +0 -15
- package/src/comments-pagination/style.scss +0 -8
- package/src/comments-title/edit.js +53 -15
- package/src/details/edit.js +36 -4
- package/src/editor.scss +0 -1
- package/src/embed/edit.js +3 -5
- package/src/embed/embed-controls.js +55 -33
- package/src/embed/variations.js +0 -8
- package/src/file/inspector.js +99 -45
- package/src/form/block.json +1 -2
- package/src/form/edit.js +91 -47
- package/src/form/index.js +1 -0
- package/src/form-input/edit.js +56 -18
- package/src/form-input/index.js +1 -0
- package/src/form-submission-notification/index.js +1 -0
- package/src/form-submit-button/index.js +1 -0
- package/src/gallery/style.scss +1 -0
- package/src/image/image.js +1 -0
- package/src/image/index.php +4 -1
- package/src/image/view.js +0 -3
- package/src/latest-posts/edit.js +206 -98
- package/src/list/ordered-list-settings.js +172 -62
- package/src/navigation/edit/index.js +127 -64
- package/src/navigation/edit/overlay-menu-preview.js +43 -26
- package/src/navigation/editor.scss +8 -4
- package/src/navigation/style.scss +8 -0
- package/src/navigation-link/block.json +3 -0
- package/src/navigation-link/edit.js +14 -1
- package/src/navigation-link/index.php +4 -0
- package/src/navigation-link/transforms.js +2 -1
- package/src/navigation-link/update-attributes.js +1 -0
- package/src/navigation-submenu/block.json +3 -0
- package/src/navigation-submenu/index.php +4 -0
- package/src/post-author/edit.js +91 -27
- package/src/post-comments-count/index.js +2 -0
- package/src/post-comments-count/transforms.js +20 -0
- package/src/post-comments-link/index.js +2 -0
- package/src/post-comments-link/transforms.js +20 -0
- package/src/post-navigation-link/edit.js +96 -51
- package/src/post-title/edit.js +76 -24
- package/src/pullquote/editor.scss +1 -1
- package/src/pullquote/style.scss +2 -3
- package/src/pullquote/theme.scss +2 -2
- package/src/query/edit/enhanced-pagination-modal.js +1 -5
- package/src/query/edit/inspector-controls/enhanced-pagination-control.js +3 -13
- package/src/rss/edit.js +141 -55
- package/src/separator/edit.js +66 -21
- package/src/shortcode/block.json +2 -1
- package/src/site-logo/edit.js +69 -26
- package/src/site-title/index.php +1 -1
- package/src/social-link/edit.js +18 -7
- package/src/social-link/edit.native.js +10 -4
- package/src/social-link/index.php +62 -49
- package/src/social-link/social-list.js +15 -20
- package/src/social-link/variations.js +53 -48
- package/src/social-links/edit.js +38 -60
- package/src/video/tracks-editor.js +75 -22
- package/build-style/post-author/editor-rtl.css +0 -140
- package/build-style/post-author/editor.css +0 -140
- package/src/post-author/editor.scss +0 -7
package/CHANGELOG.md
CHANGED
package/build/avatar/edit.js
CHANGED
|
@@ -10,7 +10,8 @@ var _blockEditor = require("@wordpress/block-editor");
|
|
|
10
10
|
var _components = require("@wordpress/components");
|
|
11
11
|
var _i18n = require("@wordpress/i18n");
|
|
12
12
|
var _url = require("@wordpress/url");
|
|
13
|
-
var _hooks = require("
|
|
13
|
+
var _hooks = require("../utils/hooks");
|
|
14
|
+
var _hooks2 = require("./hooks");
|
|
14
15
|
var _userControl = _interopRequireDefault(require("./user-control"));
|
|
15
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
17
|
/**
|
|
@@ -30,44 +31,88 @@ const AvatarInspectorControls = ({
|
|
|
30
31
|
avatar,
|
|
31
32
|
attributes,
|
|
32
33
|
selectUser
|
|
33
|
-
}) =>
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
children:
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
label: (0, _i18n.__)('Image size'),
|
|
40
|
-
onChange: newSize => setAttributes({
|
|
41
|
-
size: newSize
|
|
42
|
-
}),
|
|
43
|
-
min: avatar.minSize,
|
|
44
|
-
max: avatar.maxSize,
|
|
45
|
-
initialPosition: attributes?.size,
|
|
46
|
-
value: attributes?.size
|
|
47
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToggleControl, {
|
|
48
|
-
__nextHasNoMarginBottom: true,
|
|
49
|
-
label: (0, _i18n.__)('Link to user profile'),
|
|
50
|
-
onChange: () => setAttributes({
|
|
51
|
-
isLink: !attributes.isLink
|
|
52
|
-
}),
|
|
53
|
-
checked: attributes.isLink
|
|
54
|
-
}), attributes.isLink && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToggleControl, {
|
|
55
|
-
__nextHasNoMarginBottom: true,
|
|
56
|
-
label: (0, _i18n.__)('Open in new tab'),
|
|
57
|
-
onChange: value => setAttributes({
|
|
58
|
-
linkTarget: value ? '_blank' : '_self'
|
|
59
|
-
}),
|
|
60
|
-
checked: attributes.linkTarget === '_blank'
|
|
61
|
-
}), selectUser && /*#__PURE__*/(0, _jsxRuntime.jsx)(_userControl.default, {
|
|
62
|
-
value: attributes?.userId,
|
|
63
|
-
onChange: value => {
|
|
34
|
+
}) => {
|
|
35
|
+
const dropdownMenuProps = (0, _hooks.useToolsPanelDropdownMenuProps)();
|
|
36
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.InspectorControls, {
|
|
37
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalToolsPanel, {
|
|
38
|
+
label: (0, _i18n.__)('Settings'),
|
|
39
|
+
resetAll: () => {
|
|
64
40
|
setAttributes({
|
|
65
|
-
|
|
41
|
+
size: 96,
|
|
42
|
+
isLink: false,
|
|
43
|
+
linkTarget: '_self',
|
|
44
|
+
userId: undefined
|
|
66
45
|
});
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
46
|
+
},
|
|
47
|
+
dropdownMenuProps: dropdownMenuProps,
|
|
48
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
|
|
49
|
+
label: (0, _i18n.__)('Image size'),
|
|
50
|
+
isShownByDefault: true,
|
|
51
|
+
hasValue: () => attributes?.size !== 96,
|
|
52
|
+
onDeselect: () => setAttributes({
|
|
53
|
+
size: 96
|
|
54
|
+
}),
|
|
55
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.RangeControl, {
|
|
56
|
+
__nextHasNoMarginBottom: true,
|
|
57
|
+
__next40pxDefaultSize: true,
|
|
58
|
+
label: (0, _i18n.__)('Image size'),
|
|
59
|
+
onChange: newSize => setAttributes({
|
|
60
|
+
size: newSize
|
|
61
|
+
}),
|
|
62
|
+
min: avatar.minSize,
|
|
63
|
+
max: avatar.maxSize,
|
|
64
|
+
initialPosition: attributes?.size,
|
|
65
|
+
value: attributes?.size
|
|
66
|
+
})
|
|
67
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
|
|
68
|
+
label: (0, _i18n.__)('Link to user profile'),
|
|
69
|
+
isShownByDefault: true,
|
|
70
|
+
hasValue: () => attributes?.isLink,
|
|
71
|
+
onDeselect: () => setAttributes({
|
|
72
|
+
isLink: false
|
|
73
|
+
}),
|
|
74
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToggleControl, {
|
|
75
|
+
__nextHasNoMarginBottom: true,
|
|
76
|
+
label: (0, _i18n.__)('Link to user profile'),
|
|
77
|
+
onChange: () => setAttributes({
|
|
78
|
+
isLink: !attributes.isLink
|
|
79
|
+
}),
|
|
80
|
+
checked: attributes.isLink
|
|
81
|
+
})
|
|
82
|
+
}), attributes.isLink && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
|
|
83
|
+
label: (0, _i18n.__)('Open in new tab'),
|
|
84
|
+
isShownByDefault: true,
|
|
85
|
+
hasValue: () => attributes?.linkTarget !== '_self',
|
|
86
|
+
onDeselect: () => setAttributes({
|
|
87
|
+
linkTarget: '_self'
|
|
88
|
+
}),
|
|
89
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToggleControl, {
|
|
90
|
+
__nextHasNoMarginBottom: true,
|
|
91
|
+
label: (0, _i18n.__)('Open in new tab'),
|
|
92
|
+
onChange: value => setAttributes({
|
|
93
|
+
linkTarget: value ? '_blank' : '_self'
|
|
94
|
+
}),
|
|
95
|
+
checked: attributes.linkTarget === '_blank'
|
|
96
|
+
})
|
|
97
|
+
}), selectUser && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
|
|
98
|
+
label: (0, _i18n.__)('User'),
|
|
99
|
+
isShownByDefault: true,
|
|
100
|
+
hasValue: () => !!attributes?.userId,
|
|
101
|
+
onDeselect: () => setAttributes({
|
|
102
|
+
userId: undefined
|
|
103
|
+
}),
|
|
104
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_userControl.default, {
|
|
105
|
+
value: attributes?.userId,
|
|
106
|
+
onChange: value => {
|
|
107
|
+
setAttributes({
|
|
108
|
+
userId: value
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
})
|
|
112
|
+
})]
|
|
113
|
+
})
|
|
114
|
+
});
|
|
115
|
+
};
|
|
71
116
|
const ResizableAvatar = ({
|
|
72
117
|
setAttributes,
|
|
73
118
|
attributes,
|
|
@@ -120,7 +165,7 @@ const CommentEdit = ({
|
|
|
120
165
|
commentId
|
|
121
166
|
} = context;
|
|
122
167
|
const blockProps = (0, _blockEditor.useBlockProps)();
|
|
123
|
-
const avatar = (0,
|
|
168
|
+
const avatar = (0, _hooks2.useCommentAvatar)({
|
|
124
169
|
commentId
|
|
125
170
|
});
|
|
126
171
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
@@ -159,7 +204,7 @@ const UserEdit = ({
|
|
|
159
204
|
postId,
|
|
160
205
|
postType
|
|
161
206
|
} = context;
|
|
162
|
-
const avatar = (0,
|
|
207
|
+
const avatar = (0, _hooks2.useUserAvatar)({
|
|
163
208
|
userId: attributes?.userId,
|
|
164
209
|
postId,
|
|
165
210
|
postType
|
package/build/avatar/edit.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_blockEditor","_components","_i18n","_url","_hooks","_userControl","_jsxRuntime","AvatarInspectorControls","setAttributes","avatar","attributes","selectUser","jsx","InspectorControls","children","jsxs","PanelBody","title","__","RangeControl","__nextHasNoMarginBottom","__next40pxDefaultSize","label","onChange","newSize","size","min","minSize","max","maxSize","initialPosition","value","ToggleControl","isLink","checked","linkTarget","default","userId","ResizableAvatar","blockProps","isSelected","borderProps","useBorderProps","doubledSizedSrc","addQueryArgs","removeQueryArgs","src","s","ResizableBox","width","height","showHandle","onResizeStop","event","direction","elt","delta","parseInt","lockAspectRatio","enable","top","right","isRTL","bottom","left","minWidth","maxWidth","alt","className","clsx","style","CommentEdit","context","commentId","useBlockProps","useCommentAvatar","Fragment","href","onClick","preventDefault","UserEdit","postId","postType","useUserAvatar","Edit","props"],"sources":["@wordpress/block-library/src/avatar/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tInspectorControls,\n\tuseBlockProps,\n\t__experimentalUseBorderProps as useBorderProps,\n} from '@wordpress/block-editor';\nimport {\n\tPanelBody,\n\tRangeControl,\n\tResizableBox,\n\tToggleControl,\n} from '@wordpress/components';\nimport { __, isRTL } from '@wordpress/i18n';\nimport { addQueryArgs, removeQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport { useUserAvatar, useCommentAvatar } from './hooks';\nimport UserControl from './user-control';\n\nconst AvatarInspectorControls = ( {\n\tsetAttributes,\n\tavatar,\n\tattributes,\n\tselectUser,\n} ) => (\n\t<InspectorControls>\n\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t<RangeControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tlabel={ __( 'Image size' ) }\n\t\t\t\tonChange={ ( newSize ) =>\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\tsize: newSize,\n\t\t\t\t\t} )\n\t\t\t\t}\n\t\t\t\tmin={ avatar.minSize }\n\t\t\t\tmax={ avatar.maxSize }\n\t\t\t\tinitialPosition={ attributes?.size }\n\t\t\t\tvalue={ attributes?.size }\n\t\t\t/>\n\t\t\t<ToggleControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tlabel={ __( 'Link to user profile' ) }\n\t\t\t\tonChange={ () =>\n\t\t\t\t\tsetAttributes( { isLink: ! attributes.isLink } )\n\t\t\t\t}\n\t\t\t\tchecked={ attributes.isLink }\n\t\t\t/>\n\t\t\t{ attributes.isLink && (\n\t\t\t\t<ToggleControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Open in new tab' ) }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\tlinkTarget: value ? '_blank' : '_self',\n\t\t\t\t\t\t} )\n\t\t\t\t\t}\n\t\t\t\t\tchecked={ attributes.linkTarget === '_blank' }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ selectUser && (\n\t\t\t\t<UserControl\n\t\t\t\t\tvalue={ attributes?.userId }\n\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\tuserId: value,\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</PanelBody>\n\t</InspectorControls>\n);\n\nconst ResizableAvatar = ( {\n\tsetAttributes,\n\tattributes,\n\tavatar,\n\tblockProps,\n\tisSelected,\n} ) => {\n\tconst borderProps = useBorderProps( attributes );\n\tconst doubledSizedSrc = addQueryArgs(\n\t\tremoveQueryArgs( avatar?.src, [ 's' ] ),\n\t\t{\n\t\t\ts: attributes?.size * 2,\n\t\t}\n\t);\n\treturn (\n\t\t<div { ...blockProps }>\n\t\t\t<ResizableBox\n\t\t\t\tsize={ {\n\t\t\t\t\twidth: attributes.size,\n\t\t\t\t\theight: attributes.size,\n\t\t\t\t} }\n\t\t\t\tshowHandle={ isSelected }\n\t\t\t\tonResizeStop={ ( event, direction, elt, delta ) => {\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\tsize: parseInt(\n\t\t\t\t\t\t\tattributes.size + ( delta.height || delta.width ),\n\t\t\t\t\t\t\t10\n\t\t\t\t\t\t),\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t\tlockAspectRatio\n\t\t\t\tenable={ {\n\t\t\t\t\ttop: false,\n\t\t\t\t\tright: ! isRTL(),\n\t\t\t\t\tbottom: true,\n\t\t\t\t\tleft: isRTL(),\n\t\t\t\t} }\n\t\t\t\tminWidth={ avatar.minSize }\n\t\t\t\tmaxWidth={ avatar.maxSize }\n\t\t\t>\n\t\t\t\t<img\n\t\t\t\t\tsrc={ doubledSizedSrc }\n\t\t\t\t\talt={ avatar.alt }\n\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t'avatar',\n\t\t\t\t\t\t'avatar-' + attributes.size,\n\t\t\t\t\t\t'photo',\n\t\t\t\t\t\t'wp-block-avatar__image',\n\t\t\t\t\t\tborderProps.className\n\t\t\t\t\t) }\n\t\t\t\t\tstyle={ borderProps.style }\n\t\t\t\t/>\n\t\t\t</ResizableBox>\n\t\t</div>\n\t);\n};\nconst CommentEdit = ( { attributes, context, setAttributes, isSelected } ) => {\n\tconst { commentId } = context;\n\tconst blockProps = useBlockProps();\n\tconst avatar = useCommentAvatar( { commentId } );\n\treturn (\n\t\t<>\n\t\t\t<AvatarInspectorControls\n\t\t\t\tavatar={ avatar }\n\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\tattributes={ attributes }\n\t\t\t\tselectUser={ false }\n\t\t\t/>\n\t\t\t{ attributes.isLink ? (\n\t\t\t\t<a\n\t\t\t\t\thref=\"#avatar-pseudo-link\"\n\t\t\t\t\tclassName=\"wp-block-avatar__link\"\n\t\t\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\t\t>\n\t\t\t\t\t<ResizableAvatar\n\t\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\t\tavatar={ avatar }\n\t\t\t\t\t\tblockProps={ blockProps }\n\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t/>\n\t\t\t\t</a>\n\t\t\t) : (\n\t\t\t\t<ResizableAvatar\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tavatar={ avatar }\n\t\t\t\t\tblockProps={ blockProps }\n\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n};\n\nconst UserEdit = ( { attributes, context, setAttributes, isSelected } ) => {\n\tconst { postId, postType } = context;\n\tconst avatar = useUserAvatar( {\n\t\tuserId: attributes?.userId,\n\t\tpostId,\n\t\tpostType,\n\t} );\n\tconst blockProps = useBlockProps();\n\treturn (\n\t\t<>\n\t\t\t<AvatarInspectorControls\n\t\t\t\tselectUser\n\t\t\t\tattributes={ attributes }\n\t\t\t\tavatar={ avatar }\n\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t/>\n\t\t\t{ attributes.isLink ? (\n\t\t\t\t<a\n\t\t\t\t\thref=\"#avatar-pseudo-link\"\n\t\t\t\t\tclassName=\"wp-block-avatar__link\"\n\t\t\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\t\t>\n\t\t\t\t\t<ResizableAvatar\n\t\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\t\tavatar={ avatar }\n\t\t\t\t\t\tblockProps={ blockProps }\n\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t/>\n\t\t\t\t</a>\n\t\t\t) : (\n\t\t\t\t<ResizableAvatar\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tavatar={ avatar }\n\t\t\t\t\tblockProps={ blockProps }\n\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n};\n\nexport default function Edit( props ) {\n\t// Don't show the Comment Edit controls if we have a comment ID set, or if we're in the Site Editor (where it is `null`).\n\tif ( props?.context?.commentId || props?.context?.commentId === null ) {\n\t\treturn <CommentEdit { ...props } />;\n\t}\n\treturn <UserEdit { ...props } />;\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,YAAA,GAAAD,OAAA;AAKA,IAAAE,WAAA,GAAAF,OAAA;AAMA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AAKA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAP,sBAAA,CAAAC,OAAA;AAAyC,IAAAO,WAAA,GAAAP,OAAA;AA1BzC;AACA;AACA;;AAGA;AACA;AACA;;AAeA;AACA;AACA;;AAIA,MAAMQ,uBAAuB,GAAGA,CAAE;EACjCC,aAAa;EACbC,MAAM;EACNC,UAAU;EACVC;AACD,CAAC,kBACA,IAAAL,WAAA,CAAAM,GAAA,EAACZ,YAAA,CAAAa,iBAAiB;EAAAC,QAAA,eACjB,IAAAR,WAAA,CAAAS,IAAA,EAACd,WAAA,CAAAe,SAAS;IAACC,KAAK,EAAG,IAAAC,QAAE,EAAE,UAAW,CAAG;IAAAJ,QAAA,gBACpC,IAAAR,WAAA,CAAAM,GAAA,EAACX,WAAA,CAAAkB,YAAY;MACZC,u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EAAGA,MAAQ;MACjB8B,UAAU,EAAGA,UAAY;MACzBC,UAAU,EAAGA,UAAY;MACzBhC,aAAa,EAAGA;IAAe,CAC/B,CACD;EAAA,CACA,CAAC;AAEL,CAAC;AAEc,SAAS4E,IAAIA,CAAEC,KAAK,EAAG;EACrC;EACA,IAAKA,KAAK,EAAEb,OAAO,EAAEC,SAAS,IAAIY,KAAK,EAAEb,OAAO,EAAEC,SAAS,KAAK,IAAI,EAAG;IACtE,oBAAO,IAAAnE,WAAA,CAAAM,GAAA,EAAC2D,WAAW;MAAA,GAAMc;IAAK,CAAI,CAAC;EACpC;EACA,oBAAO,IAAA/E,WAAA,CAAAM,GAAA,EAACoE,QAAQ;IAAA,GAAMK;EAAK,CAAI,CAAC;AACjC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_blockEditor","_components","_i18n","_url","_hooks","_hooks2","_userControl","_jsxRuntime","AvatarInspectorControls","setAttributes","avatar","attributes","selectUser","dropdownMenuProps","useToolsPanelDropdownMenuProps","jsx","InspectorControls","children","jsxs","__experimentalToolsPanel","label","__","resetAll","size","isLink","linkTarget","userId","undefined","__experimentalToolsPanelItem","isShownByDefault","hasValue","onDeselect","RangeControl","__nextHasNoMarginBottom","__next40pxDefaultSize","onChange","newSize","min","minSize","max","maxSize","initialPosition","value","ToggleControl","checked","default","ResizableAvatar","blockProps","isSelected","borderProps","useBorderProps","doubledSizedSrc","addQueryArgs","removeQueryArgs","src","s","ResizableBox","width","height","showHandle","onResizeStop","event","direction","elt","delta","parseInt","lockAspectRatio","enable","top","right","isRTL","bottom","left","minWidth","maxWidth","alt","className","clsx","style","CommentEdit","context","commentId","useBlockProps","useCommentAvatar","Fragment","href","onClick","preventDefault","UserEdit","postId","postType","useUserAvatar","Edit","props"],"sources":["@wordpress/block-library/src/avatar/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tInspectorControls,\n\tuseBlockProps,\n\t__experimentalUseBorderProps as useBorderProps,\n} from '@wordpress/block-editor';\nimport {\n\tRangeControl,\n\tResizableBox,\n\tToggleControl,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { __, isRTL } from '@wordpress/i18n';\nimport { addQueryArgs, removeQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\nimport { useCommentAvatar, useUserAvatar } from './hooks';\nimport UserControl from './user-control';\n\nconst AvatarInspectorControls = ( {\n\tsetAttributes,\n\tavatar,\n\tattributes,\n\tselectUser,\n} ) => {\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\treturn (\n\t\t<InspectorControls>\n\t\t\t<ToolsPanel\n\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\tresetAll={ () => {\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\tsize: 96,\n\t\t\t\t\t\tisLink: false,\n\t\t\t\t\t\tlinkTarget: '_self',\n\t\t\t\t\t\tuserId: undefined,\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t>\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\tlabel={ __( 'Image size' ) }\n\t\t\t\t\tisShownByDefault\n\t\t\t\t\thasValue={ () => attributes?.size !== 96 }\n\t\t\t\t\tonDeselect={ () => setAttributes( { size: 96 } ) }\n\t\t\t\t>\n\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tlabel={ __( 'Image size' ) }\n\t\t\t\t\t\tonChange={ ( newSize ) =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tsize: newSize,\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmin={ avatar.minSize }\n\t\t\t\t\t\tmax={ avatar.maxSize }\n\t\t\t\t\t\tinitialPosition={ attributes?.size }\n\t\t\t\t\t\tvalue={ attributes?.size }\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\tlabel={ __( 'Link to user profile' ) }\n\t\t\t\t\tisShownByDefault\n\t\t\t\t\thasValue={ () => attributes?.isLink }\n\t\t\t\t\tonDeselect={ () => setAttributes( { isLink: false } ) }\n\t\t\t\t>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Link to user profile' ) }\n\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\tsetAttributes( { isLink: ! attributes.isLink } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tchecked={ attributes.isLink }\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t\t{ attributes.isLink && (\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Open in new tab' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => attributes?.linkTarget !== '_self' }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( { linkTarget: '_self' } )\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Open in new tab' ) }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tlinkTarget: value ? '_blank' : '_self',\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tchecked={ attributes.linkTarget === '_blank' }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t) }\n\t\t\t\t{ selectUser && (\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'User' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => !! attributes?.userId }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( { userId: undefined } )\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<UserControl\n\t\t\t\t\t\t\tvalue={ attributes?.userId }\n\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tuserId: value,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t) }\n\t\t\t</ToolsPanel>\n\t\t</InspectorControls>\n\t);\n};\n\nconst ResizableAvatar = ( {\n\tsetAttributes,\n\tattributes,\n\tavatar,\n\tblockProps,\n\tisSelected,\n} ) => {\n\tconst borderProps = useBorderProps( attributes );\n\tconst doubledSizedSrc = addQueryArgs(\n\t\tremoveQueryArgs( avatar?.src, [ 's' ] ),\n\t\t{\n\t\t\ts: attributes?.size * 2,\n\t\t}\n\t);\n\treturn (\n\t\t<div { ...blockProps }>\n\t\t\t<ResizableBox\n\t\t\t\tsize={ {\n\t\t\t\t\twidth: attributes.size,\n\t\t\t\t\theight: attributes.size,\n\t\t\t\t} }\n\t\t\t\tshowHandle={ isSelected }\n\t\t\t\tonResizeStop={ ( event, direction, elt, delta ) => {\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\tsize: parseInt(\n\t\t\t\t\t\t\tattributes.size + ( delta.height || delta.width ),\n\t\t\t\t\t\t\t10\n\t\t\t\t\t\t),\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t\tlockAspectRatio\n\t\t\t\tenable={ {\n\t\t\t\t\ttop: false,\n\t\t\t\t\tright: ! isRTL(),\n\t\t\t\t\tbottom: true,\n\t\t\t\t\tleft: isRTL(),\n\t\t\t\t} }\n\t\t\t\tminWidth={ avatar.minSize }\n\t\t\t\tmaxWidth={ avatar.maxSize }\n\t\t\t>\n\t\t\t\t<img\n\t\t\t\t\tsrc={ doubledSizedSrc }\n\t\t\t\t\talt={ avatar.alt }\n\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t'avatar',\n\t\t\t\t\t\t'avatar-' + attributes.size,\n\t\t\t\t\t\t'photo',\n\t\t\t\t\t\t'wp-block-avatar__image',\n\t\t\t\t\t\tborderProps.className\n\t\t\t\t\t) }\n\t\t\t\t\tstyle={ borderProps.style }\n\t\t\t\t/>\n\t\t\t</ResizableBox>\n\t\t</div>\n\t);\n};\nconst CommentEdit = ( { attributes, context, setAttributes, isSelected } ) => {\n\tconst { commentId } = context;\n\tconst blockProps = useBlockProps();\n\tconst avatar = useCommentAvatar( { commentId } );\n\treturn (\n\t\t<>\n\t\t\t<AvatarInspectorControls\n\t\t\t\tavatar={ avatar }\n\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\tattributes={ attributes }\n\t\t\t\tselectUser={ false }\n\t\t\t/>\n\t\t\t{ attributes.isLink ? (\n\t\t\t\t<a\n\t\t\t\t\thref=\"#avatar-pseudo-link\"\n\t\t\t\t\tclassName=\"wp-block-avatar__link\"\n\t\t\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\t\t>\n\t\t\t\t\t<ResizableAvatar\n\t\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\t\tavatar={ avatar }\n\t\t\t\t\t\tblockProps={ blockProps }\n\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t/>\n\t\t\t\t</a>\n\t\t\t) : (\n\t\t\t\t<ResizableAvatar\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tavatar={ avatar }\n\t\t\t\t\tblockProps={ blockProps }\n\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n};\n\nconst UserEdit = ( { attributes, context, setAttributes, isSelected } ) => {\n\tconst { postId, postType } = context;\n\tconst avatar = useUserAvatar( {\n\t\tuserId: attributes?.userId,\n\t\tpostId,\n\t\tpostType,\n\t} );\n\tconst blockProps = useBlockProps();\n\treturn (\n\t\t<>\n\t\t\t<AvatarInspectorControls\n\t\t\t\tselectUser\n\t\t\t\tattributes={ attributes }\n\t\t\t\tavatar={ avatar }\n\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t/>\n\t\t\t{ attributes.isLink ? (\n\t\t\t\t<a\n\t\t\t\t\thref=\"#avatar-pseudo-link\"\n\t\t\t\t\tclassName=\"wp-block-avatar__link\"\n\t\t\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\t\t>\n\t\t\t\t\t<ResizableAvatar\n\t\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\t\tavatar={ avatar }\n\t\t\t\t\t\tblockProps={ blockProps }\n\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t/>\n\t\t\t\t</a>\n\t\t\t) : (\n\t\t\t\t<ResizableAvatar\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tavatar={ avatar }\n\t\t\t\t\tblockProps={ blockProps }\n\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n};\n\nexport default function Edit( props ) {\n\t// Don't show the Comment Edit controls if we have a comment ID set, or if we're in the Site Editor (where it is `null`).\n\tif ( props?.context?.commentId || props?.context?.commentId === null ) {\n\t\treturn <CommentEdit { ...props } />;\n\t}\n\treturn <UserEdit { ...props } />;\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,YAAA,GAAAD,OAAA;AAKA,I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AAA,CAAAQ,GAAA,EAACgE,WAAW;MAAA,GAAMc;IAAK,CAAI,CAAC;EACpC;EACA,oBAAO,IAAAtF,WAAA,CAAAQ,GAAA,EAACyE,QAAQ;IAAA,GAAMK;EAAK,CAAI,CAAC;AACjC","ignoreList":[]}
|
|
@@ -3,12 +3,14 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default =
|
|
6
|
+
exports.default = UserControl;
|
|
7
7
|
var _i18n = require("@wordpress/i18n");
|
|
8
8
|
var _components = require("@wordpress/components");
|
|
9
9
|
var _data = require("@wordpress/data");
|
|
10
10
|
var _coreData = require("@wordpress/core-data");
|
|
11
11
|
var _element = require("@wordpress/element");
|
|
12
|
+
var _compose = require("@wordpress/compose");
|
|
13
|
+
var _htmlEntities = require("@wordpress/html-entities");
|
|
12
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
15
|
/**
|
|
14
16
|
* WordPress dependencies
|
|
@@ -16,7 +18,7 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
16
18
|
|
|
17
19
|
const AUTHORS_QUERY = {
|
|
18
20
|
who: 'authors',
|
|
19
|
-
per_page:
|
|
21
|
+
per_page: 100,
|
|
20
22
|
_fields: 'id,name',
|
|
21
23
|
context: 'view'
|
|
22
24
|
};
|
|
@@ -24,22 +26,35 @@ function UserControl({
|
|
|
24
26
|
value,
|
|
25
27
|
onChange
|
|
26
28
|
}) {
|
|
27
|
-
const [
|
|
28
|
-
const
|
|
29
|
+
const [filterValue, setFilterValue] = (0, _element.useState)('');
|
|
30
|
+
const {
|
|
31
|
+
authors,
|
|
32
|
+
isLoading
|
|
33
|
+
} = (0, _data.useSelect)(select => {
|
|
29
34
|
const {
|
|
30
|
-
getUsers
|
|
35
|
+
getUsers,
|
|
36
|
+
isResolving
|
|
31
37
|
} = select(_coreData.store);
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
+
const query = {
|
|
39
|
+
...AUTHORS_QUERY
|
|
40
|
+
};
|
|
41
|
+
if (filterValue) {
|
|
42
|
+
query.search = filterValue;
|
|
43
|
+
query.search_columns = ['name'];
|
|
44
|
+
}
|
|
38
45
|
return {
|
|
39
|
-
|
|
40
|
-
|
|
46
|
+
authors: getUsers(query),
|
|
47
|
+
isLoading: isResolving('getUsers', [query])
|
|
41
48
|
};
|
|
42
|
-
});
|
|
49
|
+
}, [filterValue]);
|
|
50
|
+
const options = (0, _element.useMemo)(() => {
|
|
51
|
+
return (authors !== null && authors !== void 0 ? authors : []).map(author => {
|
|
52
|
+
return {
|
|
53
|
+
value: author.id,
|
|
54
|
+
label: (0, _htmlEntities.decodeEntities)(author.name)
|
|
55
|
+
};
|
|
56
|
+
});
|
|
57
|
+
}, [authors]);
|
|
43
58
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ComboboxControl, {
|
|
44
59
|
__next40pxDefaultSize: true,
|
|
45
60
|
__nextHasNoMarginBottom: true,
|
|
@@ -47,9 +62,9 @@ function UserControl({
|
|
|
47
62
|
help: (0, _i18n.__)('Select the avatar user to display, if it is blank it will use the post/page author.'),
|
|
48
63
|
value: value,
|
|
49
64
|
onChange: onChange,
|
|
50
|
-
options:
|
|
51
|
-
onFilterValueChange:
|
|
65
|
+
options: options,
|
|
66
|
+
onFilterValueChange: (0, _compose.debounce)(setFilterValue, 300),
|
|
67
|
+
isLoading: isLoading
|
|
52
68
|
});
|
|
53
69
|
}
|
|
54
|
-
var _default = exports.default = UserControl;
|
|
55
70
|
//# sourceMappingURL=user-control.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_components","_data","_coreData","_element","_jsxRuntime","AUTHORS_QUERY","who","per_page","_fields","context","UserControl","value","onChange","
|
|
1
|
+
{"version":3,"names":["_i18n","require","_components","_data","_coreData","_element","_compose","_htmlEntities","_jsxRuntime","AUTHORS_QUERY","who","per_page","_fields","context","UserControl","value","onChange","filterValue","setFilterValue","useState","authors","isLoading","useSelect","select","getUsers","isResolving","coreStore","query","search","search_columns","options","useMemo","map","author","id","label","decodeEntities","name","jsx","ComboboxControl","__next40pxDefaultSize","__nextHasNoMarginBottom","__","help","onFilterValueChange","debounce"],"sources":["@wordpress/block-library/src/avatar/user-control.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { ComboboxControl } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useMemo, useState } from '@wordpress/element';\nimport { debounce } from '@wordpress/compose';\nimport { decodeEntities } from '@wordpress/html-entities';\n\nconst AUTHORS_QUERY = {\n\twho: 'authors',\n\tper_page: 100,\n\t_fields: 'id,name',\n\tcontext: 'view',\n};\n\nexport default function UserControl( { value, onChange } ) {\n\tconst [ filterValue, setFilterValue ] = useState( '' );\n\tconst { authors, isLoading } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getUsers, isResolving } = select( coreStore );\n\n\t\t\tconst query = { ...AUTHORS_QUERY };\n\t\t\tif ( filterValue ) {\n\t\t\t\tquery.search = filterValue;\n\t\t\t\tquery.search_columns = [ 'name' ];\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tauthors: getUsers( query ),\n\t\t\t\tisLoading: isResolving( 'getUsers', [ query ] ),\n\t\t\t};\n\t\t},\n\t\t[ filterValue ]\n\t);\n\n\tconst options = useMemo( () => {\n\t\treturn ( authors ?? [] ).map( ( author ) => {\n\t\t\treturn {\n\t\t\t\tvalue: author.id,\n\t\t\t\tlabel: decodeEntities( author.name ),\n\t\t\t};\n\t\t} );\n\t}, [ authors ] );\n\n\treturn (\n\t\t<ComboboxControl\n\t\t\t__next40pxDefaultSize\n\t\t\t__nextHasNoMarginBottom\n\t\t\tlabel={ __( 'User' ) }\n\t\t\thelp={ __(\n\t\t\t\t'Select the avatar user to display, if it is blank it will use the post/page author.'\n\t\t\t) }\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t\toptions={ options }\n\t\t\tonFilterValueChange={ debounce( setFilterValue, 300 ) }\n\t\t\tisLoading={ isLoading }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,aAAA,GAAAN,OAAA;AAA0D,IAAAO,WAAA,GAAAP,OAAA;AAT1D;AACA;AACA;;AASA,MAAMQ,aAAa,GAAG;EACrBC,GAAG,EAAE,SAAS;EACdC,QAAQ,EAAE,GAAG;EACbC,OAAO,EAAE,SAAS;EAClBC,OAAO,EAAE;AACV,CAAC;AAEc,SAASC,WAAWA,CAAE;EAAEC,KAAK;EAAEC;AAAS,CAAC,EAAG;EAC1D,MAAM,CAAEC,WAAW,EAAEC,cAAc,CAAE,GAAG,IAAAC,iBAAQ,EAAE,EAAG,CAAC;EACtD,MAAM;IAAEC,OAAO;IAAEC;EAAU,CAAC,GAAG,IAAAC,eAAS,EACrCC,MAAM,IAAM;IACb,MAAM;MAAEC,QAAQ;MAAEC;IAAY,CAAC,GAAGF,MAAM,CAAEG,eAAU,CAAC;IAErD,MAAMC,KAAK,GAAG;MAAE,GAAGlB;IAAc,CAAC;IAClC,IAAKQ,WAAW,EAAG;MAClBU,KAAK,CAACC,MAAM,GAAGX,WAAW;MAC1BU,KAAK,CAACE,cAAc,GAAG,CAAE,MAAM,CAAE;IAClC;IAEA,OAAO;MACNT,OAAO,EAAEI,QAAQ,CAAEG,KAAM,CAAC;MAC1BN,SAAS,EAAEI,WAAW,CAAE,UAAU,EAAE,CAAEE,KAAK,CAAG;IAC/C,CAAC;EACF,CAAC,EACD,CAAEV,WAAW,CACd,CAAC;EAED,MAAMa,OAAO,GAAG,IAAAC,gBAAO,EAAE,MAAM;IAC9B,OAAO,CAAEX,OAAO,aAAPA,OAAO,cAAPA,OAAO,GAAI,EAAE,EAAGY,GAAG,CAAIC,MAAM,IAAM;MAC3C,OAAO;QACNlB,KAAK,EAAEkB,MAAM,CAACC,EAAE;QAChBC,KAAK,EAAE,IAAAC,4BAAc,EAAEH,MAAM,CAACI,IAAK;MACpC,CAAC;IACF,CAAE,CAAC;EACJ,CAAC,EAAE,CAAEjB,OAAO,CAAG,CAAC;EAEhB,oBACC,IAAAZ,WAAA,CAAA8B,GAAA,EAACpC,WAAA,CAAAqC,eAAe;IACfC,qBAAqB;IACrBC,uBAAuB;IACvBN,KAAK,EAAG,IAAAO,QAAE,EAAE,MAAO,CAAG;IACtBC,IAAI,EAAG,IAAAD,QAAE,EACR,qFACD,CAAG;IACH3B,KAAK,EAAGA,KAAO;IACfC,QAAQ,EAAGA,QAAU;IACrBc,OAAO,EAAGA,OAAS;IACnBc,mBAAmB,EAAG,IAAAC,iBAAQ,EAAE3B,cAAc,EAAE,GAAI,CAAG;IACvDG,SAAS,EAAGA;EAAW,CACvB,CAAC;AAEJ","ignoreList":[]}
|
package/build/button/edit.js
CHANGED
|
@@ -10,6 +10,7 @@ var _constants = require("./constants");
|
|
|
10
10
|
var _getUpdatedLinkAttributes = require("./get-updated-link-attributes");
|
|
11
11
|
var _removeAnchorTag = _interopRequireDefault(require("../utils/remove-anchor-tag"));
|
|
12
12
|
var _hooks = require("../utils/hooks");
|
|
13
|
+
var _lockUnlock = require("../lock-unlock");
|
|
13
14
|
var _i18n = require("@wordpress/i18n");
|
|
14
15
|
var _element = require("@wordpress/element");
|
|
15
16
|
var _components = require("@wordpress/components");
|
|
@@ -32,6 +33,9 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
32
33
|
* WordPress dependencies
|
|
33
34
|
*/
|
|
34
35
|
|
|
36
|
+
const {
|
|
37
|
+
HTMLElementControl
|
|
38
|
+
} = (0, _lockUnlock.unlock)(_blockEditor.privateApis);
|
|
35
39
|
const LINK_SETTINGS = [..._blockEditor.LinkControl.DEFAULT_LINK_SETTINGS, {
|
|
36
40
|
id: 'nofollow',
|
|
37
41
|
title: (0, _i18n.__)('Mark as nofollow')
|
|
@@ -253,6 +257,8 @@ function ButtonEdit(props) {
|
|
|
253
257
|
wideSize: layout?.wideSize
|
|
254
258
|
}
|
|
255
259
|
});
|
|
260
|
+
const hasNonContentControls = blockEditingMode === 'default';
|
|
261
|
+
const hasBlockControls = hasNonContentControls || isLinkTag && !lockUrlControls;
|
|
256
262
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
257
263
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
258
264
|
...blockProps,
|
|
@@ -287,28 +293,22 @@ function ButtonEdit(props) {
|
|
|
287
293
|
onMerge: mergeBlocks,
|
|
288
294
|
identifier: "text"
|
|
289
295
|
})
|
|
290
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_blockEditor.BlockControls, {
|
|
296
|
+
}), hasBlockControls && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_blockEditor.BlockControls, {
|
|
291
297
|
group: "block",
|
|
292
|
-
children: [
|
|
298
|
+
children: [hasNonContentControls && /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.AlignmentControl, {
|
|
293
299
|
value: textAlign,
|
|
294
300
|
onChange: nextAlign => {
|
|
295
301
|
setAttributes({
|
|
296
302
|
textAlign: nextAlign
|
|
297
303
|
});
|
|
298
304
|
}
|
|
299
|
-
}),
|
|
305
|
+
}), isLinkTag && !lockUrlControls && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToolbarButton, {
|
|
300
306
|
name: "link",
|
|
301
|
-
icon: _icons.link,
|
|
302
|
-
title: (0, _i18n.__)('Link'),
|
|
303
|
-
shortcut: _keycodes.displayShortcut.primary('k'),
|
|
304
|
-
onClick: startEditing
|
|
305
|
-
|
|
306
|
-
name: "link",
|
|
307
|
-
icon: _icons.linkOff,
|
|
308
|
-
title: (0, _i18n.__)('Unlink'),
|
|
309
|
-
shortcut: _keycodes.displayShortcut.primaryShift('k'),
|
|
310
|
-
onClick: unlink,
|
|
311
|
-
isActive: true
|
|
307
|
+
icon: !isURLSet ? _icons.link : _icons.linkOff,
|
|
308
|
+
title: !isURLSet ? (0, _i18n.__)('Link') : (0, _i18n.__)('Unlink'),
|
|
309
|
+
shortcut: !isURLSet ? _keycodes.displayShortcut.primary('k') : _keycodes.displayShortcut.primaryShift('k'),
|
|
310
|
+
onClick: !isURLSet ? startEditing : unlink,
|
|
311
|
+
isActive: isURLSet
|
|
312
312
|
})]
|
|
313
313
|
}), isLinkTag && isSelected && (isEditingURL || isURLSet) && !lockUrlControls && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Popover, {
|
|
314
314
|
placement: "bottom",
|
|
@@ -347,9 +347,21 @@ function ButtonEdit(props) {
|
|
|
347
347
|
selectedWidth: width,
|
|
348
348
|
setAttributes: setAttributes
|
|
349
349
|
})
|
|
350
|
-
}), /*#__PURE__*/(0, _jsxRuntime.
|
|
350
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_blockEditor.InspectorControls, {
|
|
351
351
|
group: "advanced",
|
|
352
|
-
children:
|
|
352
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(HTMLElementControl, {
|
|
353
|
+
tagName: tagName,
|
|
354
|
+
onChange: value => setAttributes({
|
|
355
|
+
tagName: value
|
|
356
|
+
}),
|
|
357
|
+
options: [{
|
|
358
|
+
label: (0, _i18n.__)('Default (<a>)'),
|
|
359
|
+
value: 'a'
|
|
360
|
+
}, {
|
|
361
|
+
label: '<button>',
|
|
362
|
+
value: 'button'
|
|
363
|
+
}]
|
|
364
|
+
}), isLinkTag && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.TextControl, {
|
|
353
365
|
__next40pxDefaultSize: true,
|
|
354
366
|
__nextHasNoMarginBottom: true,
|
|
355
367
|
label: (0, _i18n.__)('Link rel'),
|
|
@@ -357,7 +369,7 @@ function ButtonEdit(props) {
|
|
|
357
369
|
onChange: newRel => setAttributes({
|
|
358
370
|
rel: newRel
|
|
359
371
|
})
|
|
360
|
-
})
|
|
372
|
+
})]
|
|
361
373
|
})]
|
|
362
374
|
});
|
|
363
375
|
}
|
package/build/button/edit.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_constants","_getUpdatedLinkAttributes","_removeAnchorTag","_hooks","_i18n","_element","_components","_blockEditor","_keycodes","_icons","_blocks","_compose","_data","_jsxRuntime","LINK_SETTINGS","LinkControl","DEFAULT_LINK_SETTINGS","id","title","__","useEnter","props","replaceBlocks","selectionChange","useDispatch","blockEditorStore","getBlock","getBlockRootClientId","getBlockIndex","useSelect","propsRef","useRef","current","useRefEffect","element","onKeyDown","event","defaultPrevented","keyCode","ENTER","content","clientId","length","preventDefault","topParentListBlock","blockIndex","head","cloneBlock","innerBlocks","slice","middle","createBlock","getDefaultBlockName","after","tail","addEventListener","removeEventListener","WidthPanel","selectedWidth","setAttributes","dropdownMenuProps","useToolsPanelDropdownMenuProps","jsx","__experimentalToolsPanel","label","resetAll","width","undefined","children","__experimentalToolsPanelItem","isShownByDefault","hasValue","onDeselect","__nextHasNoMarginBottom","__experimentalToggleGroupControl","value","onChange","newWidth","isBlock","__next40pxDefaultSize","map","widthValue","__experimentalToggleGroupControlOption","sprintf","ButtonEdit","attributes","className","isSelected","onReplace","mergeBlocks","context","tagName","textAlign","linkTarget","placeholder","rel","style","text","url","metadata","TagName","isKeyboardEvent","primary","startEditing","primaryShift","unlink","richTextRef","focus","popoverAnchor","setPopoverAnchor","useState","borderProps","useBorderProps","colorProps","useColorProps","spacingProps","useSpacingProps","shadowProps","useShadowProps","ref","blockProps","useBlockProps","useMergeRefs","blockEditingMode","useBlockEditingMode","isEditingURL","setIsEditingURL","isURLSet","opensInNewTab","NEW_TAB_TARGET","nofollow","includes","NOFOLLOW_REL","isLinkTag","createPageEntity","userCanCreatePages","lockUrlControls","select","_settings","getSettings","blockBindingsSource","getBlockBindingsSource","bindings","source","__experimentalCreatePageEntity","__experimentalUserCanCreatePages","canUserEditValue","args","handleCreate","pageTitle","page","status","type","rendered","link","kind","createButtonText","searchTerm","createInterpolateElement","mark","useEffect","linkValue","useMemo","useEnterRef","mergedRef","fluidTypographySettings","layout","useSettings","typographyProps","useTypographyProps","typography","fluid","wideSize","jsxs","Fragment","clsx","RichText","removeAnchorTag","withoutInteractiveFormatting","border","radius","fontSize","__experimentalGetElementClassName","writingMode","onMerge","identifier","BlockControls","group","AlignmentControl","nextAlign","ToolbarButton","name","icon","shortcut","displayShortcut","onClick","linkOff","isActive","Popover","placement","onClose","anchor","focusOnMount","__unstableSlotName","shift","newURL","newOpensInNewTab","newNofollow","getUpdatedLinkAttributes","onRemove","forceIsEditingLink","settings","createSuggestion","withCreateSuggestion","createSuggestionButtonText","InspectorControls","TextControl","newRel","_default","exports","default"],"sources":["@wordpress/block-library/src/button/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * Internal dependencies\n */\nimport { NEW_TAB_TARGET, NOFOLLOW_REL } from './constants';\nimport { getUpdatedLinkAttributes } from './get-updated-link-attributes';\nimport removeAnchorTag from '../utils/remove-anchor-tag';\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tuseEffect,\n\tuseState,\n\tuseRef,\n\tuseMemo,\n\tcreateInterpolateElement,\n} from '@wordpress/element';\nimport {\n\tTextControl,\n\tToolbarButton,\n\tPopover,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n} from '@wordpress/components';\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tInspectorControls,\n\tRichText,\n\tuseBlockProps,\n\tLinkControl,\n\t__experimentalUseBorderProps as useBorderProps,\n\t__experimentalUseColorProps as useColorProps,\n\t__experimentalGetSpacingClassesAndStyles as useSpacingProps,\n\t__experimentalGetShadowClassesAndStyles as useShadowProps,\n\t__experimentalGetElementClassName,\n\tstore as blockEditorStore,\n\tuseBlockEditingMode,\n\tgetTypographyClassesAndStyles as useTypographyProps,\n\tuseSettings,\n} from '@wordpress/block-editor';\nimport { displayShortcut, isKeyboardEvent, ENTER } from '@wordpress/keycodes';\nimport { link, linkOff } from '@wordpress/icons';\nimport {\n\tcreateBlock,\n\tcloneBlock,\n\tgetDefaultBlockName,\n\tgetBlockBindingsSource,\n} from '@wordpress/blocks';\nimport { useMergeRefs, useRefEffect } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\n\nconst LINK_SETTINGS = [\n\t...LinkControl.DEFAULT_LINK_SETTINGS,\n\t{\n\t\tid: 'nofollow',\n\t\ttitle: __( 'Mark as nofollow' ),\n\t},\n];\n\nfunction useEnter( props ) {\n\tconst { replaceBlocks, selectionChange } = useDispatch( blockEditorStore );\n\tconst { getBlock, getBlockRootClientId, getBlockIndex } =\n\t\tuseSelect( blockEditorStore );\n\tconst propsRef = useRef( props );\n\tpropsRef.current = props;\n\treturn useRefEffect( ( element ) => {\n\t\tfunction onKeyDown( event ) {\n\t\t\tif ( event.defaultPrevented || event.keyCode !== ENTER ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst { content, clientId } = propsRef.current;\n\t\t\tif ( content.length ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tevent.preventDefault();\n\t\t\tconst topParentListBlock = getBlock(\n\t\t\t\tgetBlockRootClientId( clientId )\n\t\t\t);\n\t\t\tconst blockIndex = getBlockIndex( clientId );\n\t\t\tconst head = cloneBlock( {\n\t\t\t\t...topParentListBlock,\n\t\t\t\tinnerBlocks: topParentListBlock.innerBlocks.slice(\n\t\t\t\t\t0,\n\t\t\t\t\tblockIndex\n\t\t\t\t),\n\t\t\t} );\n\t\t\tconst middle = createBlock( getDefaultBlockName() );\n\t\t\tconst after = topParentListBlock.innerBlocks.slice(\n\t\t\t\tblockIndex + 1\n\t\t\t);\n\t\t\tconst tail = after.length\n\t\t\t\t? [\n\t\t\t\t\t\tcloneBlock( {\n\t\t\t\t\t\t\t...topParentListBlock,\n\t\t\t\t\t\t\tinnerBlocks: after,\n\t\t\t\t\t\t} ),\n\t\t\t\t ]\n\t\t\t\t: [];\n\t\t\treplaceBlocks(\n\t\t\t\ttopParentListBlock.clientId,\n\t\t\t\t[ head, middle, ...tail ],\n\t\t\t\t1\n\t\t\t);\n\t\t\t// We manually change the selection here because we are replacing\n\t\t\t// a different block than the selected one.\n\t\t\tselectionChange( middle.clientId );\n\t\t}\n\n\t\telement.addEventListener( 'keydown', onKeyDown );\n\t\treturn () => {\n\t\t\telement.removeEventListener( 'keydown', onKeyDown );\n\t\t};\n\t}, [] );\n}\n\nfunction WidthPanel( { selectedWidth, setAttributes } ) {\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\treturn (\n\t\t<ToolsPanel\n\t\t\tlabel={ __( 'Settings' ) }\n\t\t\tresetAll={ () => setAttributes( { width: undefined } ) }\n\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t>\n\t\t\t<ToolsPanelItem\n\t\t\t\tlabel={ __( 'Width' ) }\n\t\t\t\tisShownByDefault\n\t\t\t\thasValue={ () => !! selectedWidth }\n\t\t\t\tonDeselect={ () => setAttributes( { width: undefined } ) }\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t>\n\t\t\t\t<ToggleGroupControl\n\t\t\t\t\tlabel={ __( 'Width' ) }\n\t\t\t\t\tvalue={ selectedWidth }\n\t\t\t\t\tonChange={ ( newWidth ) =>\n\t\t\t\t\t\tsetAttributes( { width: newWidth } )\n\t\t\t\t\t}\n\t\t\t\t\tisBlock\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t>\n\t\t\t\t\t{ [ 25, 50, 75, 100 ].map( ( widthValue ) => {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\t\tkey={ widthValue }\n\t\t\t\t\t\t\t\tvalue={ widthValue }\n\t\t\t\t\t\t\t\tlabel={ sprintf(\n\t\t\t\t\t\t\t\t\t/* translators: Percentage value. */\n\t\t\t\t\t\t\t\t\t__( '%d%%' ),\n\t\t\t\t\t\t\t\t\twidthValue\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t);\n\t\t\t\t\t} ) }\n\t\t\t\t</ToggleGroupControl>\n\t\t\t</ToolsPanelItem>\n\t\t</ToolsPanel>\n\t);\n}\n\nfunction ButtonEdit( props ) {\n\tconst {\n\t\tattributes,\n\t\tsetAttributes,\n\t\tclassName,\n\t\tisSelected,\n\t\tonReplace,\n\t\tmergeBlocks,\n\t\tclientId,\n\t\tcontext,\n\t} = props;\n\tconst {\n\t\ttagName,\n\t\ttextAlign,\n\t\tlinkTarget,\n\t\tplaceholder,\n\t\trel,\n\t\tstyle,\n\t\ttext,\n\t\turl,\n\t\twidth,\n\t\tmetadata,\n\t} = attributes;\n\n\tconst TagName = tagName || 'a';\n\n\tfunction onKeyDown( event ) {\n\t\tif ( isKeyboardEvent.primary( event, 'k' ) ) {\n\t\t\tstartEditing( event );\n\t\t} else if ( isKeyboardEvent.primaryShift( event, 'k' ) ) {\n\t\t\tunlink();\n\t\t\trichTextRef.current?.focus();\n\t\t}\n\t}\n\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\n\tconst borderProps = useBorderProps( attributes );\n\tconst colorProps = useColorProps( attributes );\n\tconst spacingProps = useSpacingProps( attributes );\n\tconst shadowProps = useShadowProps( attributes );\n\tconst ref = useRef();\n\tconst richTextRef = useRef();\n\tconst blockProps = useBlockProps( {\n\t\tref: useMergeRefs( [ setPopoverAnchor, ref ] ),\n\t\tonKeyDown,\n\t} );\n\tconst blockEditingMode = useBlockEditingMode();\n\n\tconst [ isEditingURL, setIsEditingURL ] = useState( false );\n\tconst isURLSet = !! url;\n\tconst opensInNewTab = linkTarget === NEW_TAB_TARGET;\n\tconst nofollow = !! rel?.includes( NOFOLLOW_REL );\n\tconst isLinkTag = 'a' === TagName;\n\n\tconst {\n\t\tcreatePageEntity,\n\t\tuserCanCreatePages,\n\t\tlockUrlControls = false,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! isSelected ) {\n\t\t\t\treturn {};\n\t\t\t}\n\n\t\t\tconst _settings = select( blockEditorStore ).getSettings();\n\n\t\t\tconst blockBindingsSource = getBlockBindingsSource(\n\t\t\t\tmetadata?.bindings?.url?.source\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\tcreatePageEntity: _settings.__experimentalCreatePageEntity,\n\t\t\t\tuserCanCreatePages: _settings.__experimentalUserCanCreatePages,\n\t\t\t\tlockUrlControls:\n\t\t\t\t\t!! metadata?.bindings?.url &&\n\t\t\t\t\t! blockBindingsSource?.canUserEditValue?.( {\n\t\t\t\t\t\tselect,\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t\targs: metadata?.bindings?.url?.args,\n\t\t\t\t\t} ),\n\t\t\t};\n\t\t},\n\t\t[ context, isSelected, metadata?.bindings?.url ]\n\t);\n\n\tasync function handleCreate( pageTitle ) {\n\t\tconst page = await createPageEntity( {\n\t\t\ttitle: pageTitle,\n\t\t\tstatus: 'draft',\n\t\t} );\n\n\t\treturn {\n\t\t\tid: page.id,\n\t\t\ttype: page.type,\n\t\t\ttitle: page.title.rendered,\n\t\t\turl: page.link,\n\t\t\tkind: 'post-type',\n\t\t};\n\t}\n\n\tfunction createButtonText( searchTerm ) {\n\t\treturn createInterpolateElement(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: search term. */\n\t\t\t\t__( 'Create page: <mark>%s</mark>' ),\n\t\t\t\tsearchTerm\n\t\t\t),\n\t\t\t{ mark: <mark /> }\n\t\t);\n\t}\n\n\tfunction startEditing( event ) {\n\t\tevent.preventDefault();\n\t\tsetIsEditingURL( true );\n\t}\n\n\tfunction unlink() {\n\t\tsetAttributes( {\n\t\t\turl: undefined,\n\t\t\tlinkTarget: undefined,\n\t\t\trel: undefined,\n\t\t} );\n\t\tsetIsEditingURL( false );\n\t}\n\n\tuseEffect( () => {\n\t\tif ( ! isSelected ) {\n\t\t\tsetIsEditingURL( false );\n\t\t}\n\t}, [ isSelected ] );\n\n\t// Memoize link value to avoid overriding the LinkControl's internal state.\n\t// This is a temporary fix. See https://github.com/WordPress/gutenberg/issues/51256.\n\tconst linkValue = useMemo(\n\t\t() => ( { url, opensInNewTab, nofollow } ),\n\t\t[ url, opensInNewTab, nofollow ]\n\t);\n\n\tconst useEnterRef = useEnter( { content: text, clientId } );\n\tconst mergedRef = useMergeRefs( [ useEnterRef, richTextRef ] );\n\n\tconst [ fluidTypographySettings, layout ] = useSettings(\n\t\t'typography.fluid',\n\t\t'layout'\n\t);\n\tconst typographyProps = useTypographyProps( attributes, {\n\t\ttypography: {\n\t\t\tfluid: fluidTypographySettings,\n\t\t},\n\t\tlayout: {\n\t\t\twideSize: layout?.wideSize,\n\t\t},\n\t} );\n\n\treturn (\n\t\t<>\n\t\t\t<div\n\t\t\t\t{ ...blockProps }\n\t\t\t\tclassName={ clsx( blockProps.className, {\n\t\t\t\t\t[ `has-custom-width wp-block-button__width-${ width }` ]:\n\t\t\t\t\t\twidth,\n\t\t\t\t} ) }\n\t\t\t>\n\t\t\t\t<RichText\n\t\t\t\t\tref={ mergedRef }\n\t\t\t\t\taria-label={ __( 'Button text' ) }\n\t\t\t\t\tplaceholder={ placeholder || __( 'Add text…' ) }\n\t\t\t\t\tvalue={ text }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\ttext: removeAnchorTag( value ),\n\t\t\t\t\t\t} )\n\t\t\t\t\t}\n\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t\t'wp-block-button__link',\n\t\t\t\t\t\tcolorProps.className,\n\t\t\t\t\t\tborderProps.className,\n\t\t\t\t\t\ttypographyProps.className,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t\t\t\t\t\t// For backwards compatibility add style that isn't\n\t\t\t\t\t\t\t// provided via block support.\n\t\t\t\t\t\t\t'no-border-radius': style?.border?.radius === 0,\n\t\t\t\t\t\t\t[ `has-custom-font-size` ]:\n\t\t\t\t\t\t\t\tblockProps.style.fontSize,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t__experimentalGetElementClassName( 'button' )\n\t\t\t\t\t) }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t...borderProps.style,\n\t\t\t\t\t\t...colorProps.style,\n\t\t\t\t\t\t...spacingProps.style,\n\t\t\t\t\t\t...shadowProps.style,\n\t\t\t\t\t\t...typographyProps.style,\n\t\t\t\t\t\twritingMode: undefined,\n\t\t\t\t\t} }\n\t\t\t\t\tonReplace={ onReplace }\n\t\t\t\t\tonMerge={ mergeBlocks }\n\t\t\t\t\tidentifier=\"text\"\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t{ blockEditingMode === 'default' && (\n\t\t\t\t\t<AlignmentControl\n\t\t\t\t\t\tvalue={ textAlign }\n\t\t\t\t\t\tonChange={ ( nextAlign ) => {\n\t\t\t\t\t\t\tsetAttributes( { textAlign: nextAlign } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ ! isURLSet && isLinkTag && ! lockUrlControls && (\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\tname=\"link\"\n\t\t\t\t\t\ticon={ link }\n\t\t\t\t\t\ttitle={ __( 'Link' ) }\n\t\t\t\t\t\tshortcut={ displayShortcut.primary( 'k' ) }\n\t\t\t\t\t\tonClick={ startEditing }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ isURLSet && isLinkTag && ! lockUrlControls && (\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\tname=\"link\"\n\t\t\t\t\t\ticon={ linkOff }\n\t\t\t\t\t\ttitle={ __( 'Unlink' ) }\n\t\t\t\t\t\tshortcut={ displayShortcut.primaryShift( 'k' ) }\n\t\t\t\t\t\tonClick={ unlink }\n\t\t\t\t\t\tisActive\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</BlockControls>\n\t\t\t{ isLinkTag &&\n\t\t\t\tisSelected &&\n\t\t\t\t( isEditingURL || isURLSet ) &&\n\t\t\t\t! lockUrlControls && (\n\t\t\t\t\t<Popover\n\t\t\t\t\t\tplacement=\"bottom\"\n\t\t\t\t\t\tonClose={ () => {\n\t\t\t\t\t\t\tsetIsEditingURL( false );\n\t\t\t\t\t\t\trichTextRef.current?.focus();\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tanchor={ popoverAnchor }\n\t\t\t\t\t\tfocusOnMount={ isEditingURL ? 'firstElement' : false }\n\t\t\t\t\t\t__unstableSlotName=\"__unstable-block-tools-after\"\n\t\t\t\t\t\tshift\n\t\t\t\t\t>\n\t\t\t\t\t\t<LinkControl\n\t\t\t\t\t\t\tvalue={ linkValue }\n\t\t\t\t\t\t\tonChange={ ( {\n\t\t\t\t\t\t\t\turl: newURL,\n\t\t\t\t\t\t\t\topensInNewTab: newOpensInNewTab,\n\t\t\t\t\t\t\t\tnofollow: newNofollow,\n\t\t\t\t\t\t\t} ) =>\n\t\t\t\t\t\t\t\tsetAttributes(\n\t\t\t\t\t\t\t\t\tgetUpdatedLinkAttributes( {\n\t\t\t\t\t\t\t\t\t\trel,\n\t\t\t\t\t\t\t\t\t\turl: newURL,\n\t\t\t\t\t\t\t\t\t\topensInNewTab: newOpensInNewTab,\n\t\t\t\t\t\t\t\t\t\tnofollow: newNofollow,\n\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonRemove={ () => {\n\t\t\t\t\t\t\t\tunlink();\n\t\t\t\t\t\t\t\trichTextRef.current?.focus();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tforceIsEditingLink={ isEditingURL }\n\t\t\t\t\t\t\tsettings={ LINK_SETTINGS }\n\t\t\t\t\t\t\tcreateSuggestion={\n\t\t\t\t\t\t\t\tcreatePageEntity && handleCreate\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\twithCreateSuggestion={ userCanCreatePages }\n\t\t\t\t\t\t\tcreateSuggestionButtonText={ createButtonText }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</Popover>\n\t\t\t\t) }\n\t\t\t<InspectorControls>\n\t\t\t\t<WidthPanel\n\t\t\t\t\tselectedWidth={ width }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t{ isLinkTag && (\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Link rel' ) }\n\t\t\t\t\t\tvalue={ rel || '' }\n\t\t\t\t\t\tonChange={ ( newRel ) =>\n\t\t\t\t\t\t\tsetAttributes( { rel: newRel } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</InspectorControls>\n\t\t</>\n\t);\n}\n\nexport default ButtonEdit;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAA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AC7B,CAAG;QACHuG,kBAAkB,EAAGrF,YAAc;QACnCsF,QAAQ,EAAGrM,aAAe;QAC1BsM,gBAAgB,EACf9E,gBAAgB,IAAIc,YACpB;QACDiE,oBAAoB,EAAG9E,kBAAoB;QAC3C+E,0BAA0B,EAAG1D;MAAkB,CAC/C;IAAC,CACM,CACT,eACF,IAAA/I,WAAA,CAAAiD,GAAA,EAACvD,YAAA,CAAAgN,iBAAiB;MAAAnJ,QAAA,eACjB,IAAAvD,WAAA,CAAAiD,GAAA,EAACL,UAAU;QACVC,aAAa,EAAGQ,KAAO;QACvBP,aAAa,EAAGA;MAAe,CAC/B;IAAC,CACgB,CAAC,eACpB,IAAA9C,WAAA,CAAAiD,GAAA,EAACvD,YAAA,CAAAgN,iBAAiB;MAAC5B,KAAK,EAAC,UAAU;MAAAvH,QAAA,EAChCiE,SAAS,iBACV,IAAAxH,WAAA,CAAAiD,GAAA,EAACxD,WAAA,CAAAkN,WAAW;QACXzI,qBAAqB;QACrBN,uBAAuB;QACvBT,KAAK,EAAG,IAAA7C,QAAE,EAAE,UAAW,CAAG;QAC1BwD,KAAK,EAAGoB,GAAG,IAAI,EAAI;QACnBnB,QAAQ,EAAK6I,MAAM,IAClB9J,aAAa,CAAE;UAAEoC,GAAG,EAAE0H;QAAO,CAAE;MAC/B,CACD;IACD,CACiB,CAAC;EAAA,CACnB,CAAC;AAEL;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcxI,UAAU","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_constants","_getUpdatedLinkAttributes","_removeAnchorTag","_hooks","_lockUnlock","_i18n","_element","_components","_blockEditor","_keycodes","_icons","_blocks","_compose","_data","_jsxRuntime","HTMLElementControl","unlock","blockEditorPrivateApis","LINK_SETTINGS","LinkControl","DEFAULT_LINK_SETTINGS","id","title","__","useEnter","props","replaceBlocks","selectionChange","useDispatch","blockEditorStore","getBlock","getBlockRootClientId","getBlockIndex","useSelect","propsRef","useRef","current","useRefEffect","element","onKeyDown","event","defaultPrevented","keyCode","ENTER","content","clientId","length","preventDefault","topParentListBlock","blockIndex","head","cloneBlock","innerBlocks","slice","middle","createBlock","getDefaultBlockName","after","tail","addEventListener","removeEventListener","WidthPanel","selectedWidth","setAttributes","dropdownMenuProps","useToolsPanelDropdownMenuProps","jsx","__experimentalToolsPanel","label","resetAll","width","undefined","children","__experimentalToolsPanelItem","isShownByDefault","hasValue","onDeselect","__nextHasNoMarginBottom","__experimentalToggleGroupControl","value","onChange","newWidth","isBlock","__next40pxDefaultSize","map","widthValue","__experimentalToggleGroupControlOption","sprintf","ButtonEdit","attributes","className","isSelected","onReplace","mergeBlocks","context","tagName","textAlign","linkTarget","placeholder","rel","style","text","url","metadata","TagName","isKeyboardEvent","primary","startEditing","primaryShift","unlink","richTextRef","focus","popoverAnchor","setPopoverAnchor","useState","borderProps","useBorderProps","colorProps","useColorProps","spacingProps","useSpacingProps","shadowProps","useShadowProps","ref","blockProps","useBlockProps","useMergeRefs","blockEditingMode","useBlockEditingMode","isEditingURL","setIsEditingURL","isURLSet","opensInNewTab","NEW_TAB_TARGET","nofollow","includes","NOFOLLOW_REL","isLinkTag","createPageEntity","userCanCreatePages","lockUrlControls","select","_settings","getSettings","blockBindingsSource","getBlockBindingsSource","bindings","source","__experimentalCreatePageEntity","__experimentalUserCanCreatePages","canUserEditValue","args","handleCreate","pageTitle","page","status","type","rendered","link","kind","createButtonText","searchTerm","createInterpolateElement","mark","useEffect","linkValue","useMemo","useEnterRef","mergedRef","fluidTypographySettings","layout","useSettings","typographyProps","useTypographyProps","typography","fluid","wideSize","hasNonContentControls","hasBlockControls","jsxs","Fragment","clsx","RichText","removeAnchorTag","withoutInteractiveFormatting","border","radius","fontSize","__experimentalGetElementClassName","writingMode","onMerge","identifier","BlockControls","group","AlignmentControl","nextAlign","ToolbarButton","name","icon","linkOff","shortcut","displayShortcut","onClick","isActive","Popover","placement","onClose","anchor","focusOnMount","__unstableSlotName","shift","newURL","newOpensInNewTab","newNofollow","getUpdatedLinkAttributes","onRemove","forceIsEditingLink","settings","createSuggestion","withCreateSuggestion","createSuggestionButtonText","InspectorControls","options","TextControl","newRel","_default","exports","default"],"sources":["@wordpress/block-library/src/button/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * Internal dependencies\n */\nimport { NEW_TAB_TARGET, NOFOLLOW_REL } from './constants';\nimport { getUpdatedLinkAttributes } from './get-updated-link-attributes';\nimport removeAnchorTag from '../utils/remove-anchor-tag';\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\nimport { unlock } from '../lock-unlock';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tuseEffect,\n\tuseState,\n\tuseRef,\n\tuseMemo,\n\tcreateInterpolateElement,\n} from '@wordpress/element';\nimport {\n\tTextControl,\n\tToolbarButton,\n\tPopover,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n} from '@wordpress/components';\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tInspectorControls,\n\tRichText,\n\tuseBlockProps,\n\tLinkControl,\n\t__experimentalUseBorderProps as useBorderProps,\n\t__experimentalUseColorProps as useColorProps,\n\t__experimentalGetSpacingClassesAndStyles as useSpacingProps,\n\t__experimentalGetShadowClassesAndStyles as useShadowProps,\n\t__experimentalGetElementClassName,\n\tstore as blockEditorStore,\n\tuseBlockEditingMode,\n\tgetTypographyClassesAndStyles as useTypographyProps,\n\tuseSettings,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { displayShortcut, isKeyboardEvent, ENTER } from '@wordpress/keycodes';\nimport { link, linkOff } from '@wordpress/icons';\nimport {\n\tcreateBlock,\n\tcloneBlock,\n\tgetDefaultBlockName,\n\tgetBlockBindingsSource,\n} from '@wordpress/blocks';\nimport { useMergeRefs, useRefEffect } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\n\nconst { HTMLElementControl } = unlock( blockEditorPrivateApis );\n\nconst LINK_SETTINGS = [\n\t...LinkControl.DEFAULT_LINK_SETTINGS,\n\t{\n\t\tid: 'nofollow',\n\t\ttitle: __( 'Mark as nofollow' ),\n\t},\n];\n\nfunction useEnter( props ) {\n\tconst { replaceBlocks, selectionChange } = useDispatch( blockEditorStore );\n\tconst { getBlock, getBlockRootClientId, getBlockIndex } =\n\t\tuseSelect( blockEditorStore );\n\tconst propsRef = useRef( props );\n\tpropsRef.current = props;\n\treturn useRefEffect( ( element ) => {\n\t\tfunction onKeyDown( event ) {\n\t\t\tif ( event.defaultPrevented || event.keyCode !== ENTER ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst { content, clientId } = propsRef.current;\n\t\t\tif ( content.length ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tevent.preventDefault();\n\t\t\tconst topParentListBlock = getBlock(\n\t\t\t\tgetBlockRootClientId( clientId )\n\t\t\t);\n\t\t\tconst blockIndex = getBlockIndex( clientId );\n\t\t\tconst head = cloneBlock( {\n\t\t\t\t...topParentListBlock,\n\t\t\t\tinnerBlocks: topParentListBlock.innerBlocks.slice(\n\t\t\t\t\t0,\n\t\t\t\t\tblockIndex\n\t\t\t\t),\n\t\t\t} );\n\t\t\tconst middle = createBlock( getDefaultBlockName() );\n\t\t\tconst after = topParentListBlock.innerBlocks.slice(\n\t\t\t\tblockIndex + 1\n\t\t\t);\n\t\t\tconst tail = after.length\n\t\t\t\t? [\n\t\t\t\t\t\tcloneBlock( {\n\t\t\t\t\t\t\t...topParentListBlock,\n\t\t\t\t\t\t\tinnerBlocks: after,\n\t\t\t\t\t\t} ),\n\t\t\t\t ]\n\t\t\t\t: [];\n\t\t\treplaceBlocks(\n\t\t\t\ttopParentListBlock.clientId,\n\t\t\t\t[ head, middle, ...tail ],\n\t\t\t\t1\n\t\t\t);\n\t\t\t// We manually change the selection here because we are replacing\n\t\t\t// a different block than the selected one.\n\t\t\tselectionChange( middle.clientId );\n\t\t}\n\n\t\telement.addEventListener( 'keydown', onKeyDown );\n\t\treturn () => {\n\t\t\telement.removeEventListener( 'keydown', onKeyDown );\n\t\t};\n\t}, [] );\n}\n\nfunction WidthPanel( { selectedWidth, setAttributes } ) {\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\treturn (\n\t\t<ToolsPanel\n\t\t\tlabel={ __( 'Settings' ) }\n\t\t\tresetAll={ () => setAttributes( { width: undefined } ) }\n\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t>\n\t\t\t<ToolsPanelItem\n\t\t\t\tlabel={ __( 'Width' ) }\n\t\t\t\tisShownByDefault\n\t\t\t\thasValue={ () => !! selectedWidth }\n\t\t\t\tonDeselect={ () => setAttributes( { width: undefined } ) }\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t>\n\t\t\t\t<ToggleGroupControl\n\t\t\t\t\tlabel={ __( 'Width' ) }\n\t\t\t\t\tvalue={ selectedWidth }\n\t\t\t\t\tonChange={ ( newWidth ) =>\n\t\t\t\t\t\tsetAttributes( { width: newWidth } )\n\t\t\t\t\t}\n\t\t\t\t\tisBlock\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t>\n\t\t\t\t\t{ [ 25, 50, 75, 100 ].map( ( widthValue ) => {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\t\tkey={ widthValue }\n\t\t\t\t\t\t\t\tvalue={ widthValue }\n\t\t\t\t\t\t\t\tlabel={ sprintf(\n\t\t\t\t\t\t\t\t\t/* translators: Percentage value. */\n\t\t\t\t\t\t\t\t\t__( '%d%%' ),\n\t\t\t\t\t\t\t\t\twidthValue\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t);\n\t\t\t\t\t} ) }\n\t\t\t\t</ToggleGroupControl>\n\t\t\t</ToolsPanelItem>\n\t\t</ToolsPanel>\n\t);\n}\n\nfunction ButtonEdit( props ) {\n\tconst {\n\t\tattributes,\n\t\tsetAttributes,\n\t\tclassName,\n\t\tisSelected,\n\t\tonReplace,\n\t\tmergeBlocks,\n\t\tclientId,\n\t\tcontext,\n\t} = props;\n\tconst {\n\t\ttagName,\n\t\ttextAlign,\n\t\tlinkTarget,\n\t\tplaceholder,\n\t\trel,\n\t\tstyle,\n\t\ttext,\n\t\turl,\n\t\twidth,\n\t\tmetadata,\n\t} = attributes;\n\n\tconst TagName = tagName || 'a';\n\n\tfunction onKeyDown( event ) {\n\t\tif ( isKeyboardEvent.primary( event, 'k' ) ) {\n\t\t\tstartEditing( event );\n\t\t} else if ( isKeyboardEvent.primaryShift( event, 'k' ) ) {\n\t\t\tunlink();\n\t\t\trichTextRef.current?.focus();\n\t\t}\n\t}\n\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\n\tconst borderProps = useBorderProps( attributes );\n\tconst colorProps = useColorProps( attributes );\n\tconst spacingProps = useSpacingProps( attributes );\n\tconst shadowProps = useShadowProps( attributes );\n\tconst ref = useRef();\n\tconst richTextRef = useRef();\n\tconst blockProps = useBlockProps( {\n\t\tref: useMergeRefs( [ setPopoverAnchor, ref ] ),\n\t\tonKeyDown,\n\t} );\n\tconst blockEditingMode = useBlockEditingMode();\n\n\tconst [ isEditingURL, setIsEditingURL ] = useState( false );\n\tconst isURLSet = !! url;\n\tconst opensInNewTab = linkTarget === NEW_TAB_TARGET;\n\tconst nofollow = !! rel?.includes( NOFOLLOW_REL );\n\tconst isLinkTag = 'a' === TagName;\n\n\tconst {\n\t\tcreatePageEntity,\n\t\tuserCanCreatePages,\n\t\tlockUrlControls = false,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! isSelected ) {\n\t\t\t\treturn {};\n\t\t\t}\n\n\t\t\tconst _settings = select( blockEditorStore ).getSettings();\n\n\t\t\tconst blockBindingsSource = getBlockBindingsSource(\n\t\t\t\tmetadata?.bindings?.url?.source\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\tcreatePageEntity: _settings.__experimentalCreatePageEntity,\n\t\t\t\tuserCanCreatePages: _settings.__experimentalUserCanCreatePages,\n\t\t\t\tlockUrlControls:\n\t\t\t\t\t!! metadata?.bindings?.url &&\n\t\t\t\t\t! blockBindingsSource?.canUserEditValue?.( {\n\t\t\t\t\t\tselect,\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t\targs: metadata?.bindings?.url?.args,\n\t\t\t\t\t} ),\n\t\t\t};\n\t\t},\n\t\t[ context, isSelected, metadata?.bindings?.url ]\n\t);\n\n\tasync function handleCreate( pageTitle ) {\n\t\tconst page = await createPageEntity( {\n\t\t\ttitle: pageTitle,\n\t\t\tstatus: 'draft',\n\t\t} );\n\n\t\treturn {\n\t\t\tid: page.id,\n\t\t\ttype: page.type,\n\t\t\ttitle: page.title.rendered,\n\t\t\turl: page.link,\n\t\t\tkind: 'post-type',\n\t\t};\n\t}\n\n\tfunction createButtonText( searchTerm ) {\n\t\treturn createInterpolateElement(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: search term. */\n\t\t\t\t__( 'Create page: <mark>%s</mark>' ),\n\t\t\t\tsearchTerm\n\t\t\t),\n\t\t\t{ mark: <mark /> }\n\t\t);\n\t}\n\n\tfunction startEditing( event ) {\n\t\tevent.preventDefault();\n\t\tsetIsEditingURL( true );\n\t}\n\n\tfunction unlink() {\n\t\tsetAttributes( {\n\t\t\turl: undefined,\n\t\t\tlinkTarget: undefined,\n\t\t\trel: undefined,\n\t\t} );\n\t\tsetIsEditingURL( false );\n\t}\n\n\tuseEffect( () => {\n\t\tif ( ! isSelected ) {\n\t\t\tsetIsEditingURL( false );\n\t\t}\n\t}, [ isSelected ] );\n\n\t// Memoize link value to avoid overriding the LinkControl's internal state.\n\t// This is a temporary fix. See https://github.com/WordPress/gutenberg/issues/51256.\n\tconst linkValue = useMemo(\n\t\t() => ( { url, opensInNewTab, nofollow } ),\n\t\t[ url, opensInNewTab, nofollow ]\n\t);\n\n\tconst useEnterRef = useEnter( { content: text, clientId } );\n\tconst mergedRef = useMergeRefs( [ useEnterRef, richTextRef ] );\n\n\tconst [ fluidTypographySettings, layout ] = useSettings(\n\t\t'typography.fluid',\n\t\t'layout'\n\t);\n\tconst typographyProps = useTypographyProps( attributes, {\n\t\ttypography: {\n\t\t\tfluid: fluidTypographySettings,\n\t\t},\n\t\tlayout: {\n\t\t\twideSize: layout?.wideSize,\n\t\t},\n\t} );\n\n\tconst hasNonContentControls = blockEditingMode === 'default';\n\tconst hasBlockControls =\n\t\thasNonContentControls || ( isLinkTag && ! lockUrlControls );\n\n\treturn (\n\t\t<>\n\t\t\t<div\n\t\t\t\t{ ...blockProps }\n\t\t\t\tclassName={ clsx( blockProps.className, {\n\t\t\t\t\t[ `has-custom-width wp-block-button__width-${ width }` ]:\n\t\t\t\t\t\twidth,\n\t\t\t\t} ) }\n\t\t\t>\n\t\t\t\t<RichText\n\t\t\t\t\tref={ mergedRef }\n\t\t\t\t\taria-label={ __( 'Button text' ) }\n\t\t\t\t\tplaceholder={ placeholder || __( 'Add text…' ) }\n\t\t\t\t\tvalue={ text }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\ttext: removeAnchorTag( value ),\n\t\t\t\t\t\t} )\n\t\t\t\t\t}\n\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t\t'wp-block-button__link',\n\t\t\t\t\t\tcolorProps.className,\n\t\t\t\t\t\tborderProps.className,\n\t\t\t\t\t\ttypographyProps.className,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t\t\t\t\t\t// For backwards compatibility add style that isn't\n\t\t\t\t\t\t\t// provided via block support.\n\t\t\t\t\t\t\t'no-border-radius': style?.border?.radius === 0,\n\t\t\t\t\t\t\t[ `has-custom-font-size` ]:\n\t\t\t\t\t\t\t\tblockProps.style.fontSize,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t__experimentalGetElementClassName( 'button' )\n\t\t\t\t\t) }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t...borderProps.style,\n\t\t\t\t\t\t...colorProps.style,\n\t\t\t\t\t\t...spacingProps.style,\n\t\t\t\t\t\t...shadowProps.style,\n\t\t\t\t\t\t...typographyProps.style,\n\t\t\t\t\t\twritingMode: undefined,\n\t\t\t\t\t} }\n\t\t\t\t\tonReplace={ onReplace }\n\t\t\t\t\tonMerge={ mergeBlocks }\n\t\t\t\t\tidentifier=\"text\"\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t{ hasBlockControls && (\n\t\t\t\t<BlockControls group=\"block\">\n\t\t\t\t\t{ hasNonContentControls && (\n\t\t\t\t\t\t<AlignmentControl\n\t\t\t\t\t\t\tvalue={ textAlign }\n\t\t\t\t\t\t\tonChange={ ( nextAlign ) => {\n\t\t\t\t\t\t\t\tsetAttributes( { textAlign: nextAlign } );\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\t{ isLinkTag && ! lockUrlControls && (\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\tname=\"link\"\n\t\t\t\t\t\t\ticon={ ! isURLSet ? link : linkOff }\n\t\t\t\t\t\t\ttitle={ ! isURLSet ? __( 'Link' ) : __( 'Unlink' ) }\n\t\t\t\t\t\t\tshortcut={\n\t\t\t\t\t\t\t\t! isURLSet\n\t\t\t\t\t\t\t\t\t? displayShortcut.primary( 'k' )\n\t\t\t\t\t\t\t\t\t: displayShortcut.primaryShift( 'k' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonClick={ ! isURLSet ? startEditing : unlink }\n\t\t\t\t\t\t\tisActive={ isURLSet }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</BlockControls>\n\t\t\t) }\n\t\t\t{ isLinkTag &&\n\t\t\t\tisSelected &&\n\t\t\t\t( isEditingURL || isURLSet ) &&\n\t\t\t\t! lockUrlControls && (\n\t\t\t\t\t<Popover\n\t\t\t\t\t\tplacement=\"bottom\"\n\t\t\t\t\t\tonClose={ () => {\n\t\t\t\t\t\t\tsetIsEditingURL( false );\n\t\t\t\t\t\t\trichTextRef.current?.focus();\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tanchor={ popoverAnchor }\n\t\t\t\t\t\tfocusOnMount={ isEditingURL ? 'firstElement' : false }\n\t\t\t\t\t\t__unstableSlotName=\"__unstable-block-tools-after\"\n\t\t\t\t\t\tshift\n\t\t\t\t\t>\n\t\t\t\t\t\t<LinkControl\n\t\t\t\t\t\t\tvalue={ linkValue }\n\t\t\t\t\t\t\tonChange={ ( {\n\t\t\t\t\t\t\t\turl: newURL,\n\t\t\t\t\t\t\t\topensInNewTab: newOpensInNewTab,\n\t\t\t\t\t\t\t\tnofollow: newNofollow,\n\t\t\t\t\t\t\t} ) =>\n\t\t\t\t\t\t\t\tsetAttributes(\n\t\t\t\t\t\t\t\t\tgetUpdatedLinkAttributes( {\n\t\t\t\t\t\t\t\t\t\trel,\n\t\t\t\t\t\t\t\t\t\turl: newURL,\n\t\t\t\t\t\t\t\t\t\topensInNewTab: newOpensInNewTab,\n\t\t\t\t\t\t\t\t\t\tnofollow: newNofollow,\n\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonRemove={ () => {\n\t\t\t\t\t\t\t\tunlink();\n\t\t\t\t\t\t\t\trichTextRef.current?.focus();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tforceIsEditingLink={ isEditingURL }\n\t\t\t\t\t\t\tsettings={ LINK_SETTINGS }\n\t\t\t\t\t\t\tcreateSuggestion={\n\t\t\t\t\t\t\t\tcreatePageEntity && handleCreate\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\twithCreateSuggestion={ userCanCreatePages }\n\t\t\t\t\t\t\tcreateSuggestionButtonText={ createButtonText }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</Popover>\n\t\t\t\t) }\n\t\t\t<InspectorControls>\n\t\t\t\t<WidthPanel\n\t\t\t\t\tselectedWidth={ width }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t<HTMLElementControl\n\t\t\t\t\ttagName={ tagName }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { tagName: value } )\n\t\t\t\t\t}\n\t\t\t\t\toptions={ [\n\t\t\t\t\t\t{ label: __( 'Default (<a>)' ), value: 'a' },\n\t\t\t\t\t\t{ label: '<button>', value: 'button' },\n\t\t\t\t\t] }\n\t\t\t\t/>\n\t\t\t\t{ isLinkTag && (\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Link rel' ) }\n\t\t\t\t\t\tvalue={ rel || '' }\n\t\t\t\t\t\tonChange={ ( newRel ) =>\n\t\t\t\t\t\t\tsetAttributes( { rel: newRel } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</InspectorControls>\n\t\t</>\n\t);\n}\n\nexport default ButtonEdit;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,yBAAA,GAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,MA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