@wordpress/block-library 9.30.0 → 9.30.1-next.6870dfe5b.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/build/accordion-content/edit.js +8 -8
- package/build/accordion-content/edit.js.map +1 -1
- package/build/accordion-content/index.js +2 -1
- package/build/accordion-content/index.js.map +1 -1
- package/build/accordion-panel/index.js +2 -1
- package/build/accordion-panel/index.js.map +1 -1
- package/build/navigation/constants.js +5 -1
- package/build/navigation/constants.js.map +1 -1
- package/build/navigation/edit/index.js +45 -1
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/leaf-more-menu.js +0 -1
- package/build/navigation/edit/leaf-more-menu.js.map +1 -1
- package/build/navigation/edit/menu-inspector-controls.js +40 -5
- package/build/navigation/edit/menu-inspector-controls.js.map +1 -1
- package/build/navigation-link/block-inserter.js +69 -0
- package/build/navigation-link/block-inserter.js.map +1 -0
- package/build/navigation-link/dialog-wrapper.js +80 -0
- package/build/navigation-link/dialog-wrapper.js.map +1 -0
- package/build/navigation-link/link-ui.js +80 -120
- package/build/navigation-link/link-ui.js.map +1 -1
- package/build/navigation-link/page-creator.js +137 -0
- package/build/navigation-link/page-creator.js.map +1 -0
- package/build/search/edit.js +22 -14
- package/build/search/edit.js.map +1 -1
- package/build-module/accordion-content/edit.js +8 -8
- package/build-module/accordion-content/edit.js.map +1 -1
- package/build-module/accordion-content/index.js +2 -1
- package/build-module/accordion-content/index.js.map +1 -1
- package/build-module/accordion-panel/index.js +2 -1
- package/build-module/accordion-panel/index.js.map +1 -1
- package/build-module/navigation/constants.js +5 -1
- package/build-module/navigation/constants.js.map +1 -1
- package/build-module/navigation/edit/index.js +50 -4
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/leaf-more-menu.js +0 -1
- package/build-module/navigation/edit/leaf-more-menu.js.map +1 -1
- package/build-module/navigation/edit/menu-inspector-controls.js +40 -5
- package/build-module/navigation/edit/menu-inspector-controls.js.map +1 -1
- package/build-module/navigation-link/block-inserter.js +61 -0
- package/build-module/navigation-link/block-inserter.js.map +1 -0
- package/build-module/navigation-link/dialog-wrapper.js +75 -0
- package/build-module/navigation-link/dialog-wrapper.js.map +1 -0
- package/build-module/navigation-link/link-ui.js +85 -125
- package/build-module/navigation-link/link-ui.js.map +1 -1
- package/build-module/navigation-link/page-creator.js +130 -0
- package/build-module/navigation-link/page-creator.js.map +1 -0
- package/build-module/search/edit.js +22 -14
- package/build-module/search/edit.js.map +1 -1
- package/build-style/accordion/style-rtl.css +5 -6
- package/build-style/accordion/style.css +5 -6
- package/build-style/editor-rtl.css +14 -0
- package/build-style/editor.css +14 -0
- package/build-style/form-input/style-rtl.css +4 -3
- package/build-style/form-input/style.css +4 -3
- package/build-style/navigation-link/editor-rtl.css +14 -0
- package/build-style/navigation-link/editor.css +14 -0
- package/build-style/navigation-link/style-rtl.css +1 -1
- package/build-style/navigation-link/style.css +1 -1
- package/build-style/post-comments-form/style-rtl.css +8 -5
- package/build-style/post-comments-form/style.css +8 -5
- package/build-style/search/style-rtl.css +11 -12
- package/build-style/search/style.css +11 -12
- package/build-style/style-rtl.css +29 -27
- package/build-style/style.css +29 -27
- package/package.json +35 -35
- package/src/accordion/style.scss +6 -6
- package/src/accordion-content/block.json +2 -1
- package/src/accordion-content/edit.js +21 -27
- package/src/accordion-panel/block.json +2 -1
- package/src/cover/test/edit.js +1 -5
- package/src/form-input/style.scss +3 -2
- package/src/navigation/constants.js +4 -0
- package/src/navigation/edit/index.js +50 -1
- package/src/navigation/edit/leaf-more-menu.js +0 -1
- package/src/navigation/edit/menu-inspector-controls.js +40 -5
- package/src/navigation-link/block-inserter.js +65 -0
- package/src/navigation-link/dialog-wrapper.js +74 -0
- package/src/navigation-link/editor.scss +17 -0
- package/src/navigation-link/link-ui.js +108 -164
- package/src/navigation-link/page-creator.js +157 -0
- package/src/navigation-link/style.scss +1 -1
- package/src/post-comments-form/style.scss +11 -11
- package/src/search/edit.js +44 -13
- package/src/search/index.php +16 -2
- package/src/search/style.scss +15 -16
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { Button, TextControl, Notice, CheckboxControl, __experimentalVStack as VStack, __experimentalHStack as HStack } from '@wordpress/components';
|
|
5
|
+
import { __ } from '@wordpress/i18n';
|
|
6
|
+
import { useSelect, useDispatch } from '@wordpress/data';
|
|
7
|
+
import { store as coreStore } from '@wordpress/core-data';
|
|
8
|
+
import { decodeEntities } from '@wordpress/html-entities';
|
|
9
|
+
import { useState } from '@wordpress/element';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Internal dependencies
|
|
13
|
+
*/
|
|
14
|
+
import DialogWrapper from './dialog-wrapper';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Component for creating new pages within the Navigation Link UI.
|
|
18
|
+
*
|
|
19
|
+
* @param {Object} props Component props.
|
|
20
|
+
* @param {string} props.postType The post type to create.
|
|
21
|
+
* @param {Function} props.onBack Callback when user wants to go back.
|
|
22
|
+
* @param {Function} props.onPageCreated Callback when page is successfully created.
|
|
23
|
+
* @param {string} [props.initialTitle] Initial title to pre-fill the form.
|
|
24
|
+
*/
|
|
25
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
26
|
+
export function LinkUIPageCreator({
|
|
27
|
+
postType,
|
|
28
|
+
onBack,
|
|
29
|
+
onPageCreated,
|
|
30
|
+
initialTitle = ''
|
|
31
|
+
}) {
|
|
32
|
+
const [title, setTitle] = useState(initialTitle);
|
|
33
|
+
const [shouldPublish, setShouldPublish] = useState(false);
|
|
34
|
+
|
|
35
|
+
// Check if the title is valid for submission
|
|
36
|
+
const isTitleValid = title.trim().length > 0;
|
|
37
|
+
|
|
38
|
+
// Get the last created entity record (without ID) to track creation state
|
|
39
|
+
const {
|
|
40
|
+
lastError,
|
|
41
|
+
isSaving
|
|
42
|
+
} = useSelect(select => ({
|
|
43
|
+
lastError: select(coreStore).getLastEntitySaveError('postType', postType),
|
|
44
|
+
isSaving: select(coreStore).isSavingEntityRecord('postType', postType)
|
|
45
|
+
}), [postType]);
|
|
46
|
+
const {
|
|
47
|
+
saveEntityRecord
|
|
48
|
+
} = useDispatch(coreStore);
|
|
49
|
+
async function createPage(event) {
|
|
50
|
+
event.preventDefault();
|
|
51
|
+
if (isSaving || !isTitleValid) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
try {
|
|
55
|
+
const savedRecord = await saveEntityRecord('postType', postType, {
|
|
56
|
+
title,
|
|
57
|
+
status: shouldPublish ? 'publish' : 'draft'
|
|
58
|
+
}, {
|
|
59
|
+
throwOnError: true
|
|
60
|
+
});
|
|
61
|
+
if (savedRecord) {
|
|
62
|
+
// Create the page link object from the saved record
|
|
63
|
+
const pageLink = {
|
|
64
|
+
id: savedRecord.id,
|
|
65
|
+
type: postType,
|
|
66
|
+
title: decodeEntities(savedRecord.title.rendered),
|
|
67
|
+
url: savedRecord.link,
|
|
68
|
+
kind: 'post-type'
|
|
69
|
+
};
|
|
70
|
+
onPageCreated(pageLink);
|
|
71
|
+
}
|
|
72
|
+
} catch (error) {
|
|
73
|
+
// Error handling is done via the data store selectors
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
const isSubmitDisabled = isSaving || !isTitleValid;
|
|
77
|
+
return /*#__PURE__*/_jsx(DialogWrapper, {
|
|
78
|
+
className: "link-ui-page-creator",
|
|
79
|
+
title: __('Create page'),
|
|
80
|
+
description: __('Create a new page to add to your Navigation.'),
|
|
81
|
+
onBack: onBack,
|
|
82
|
+
children: /*#__PURE__*/_jsx(VStack, {
|
|
83
|
+
className: "link-ui-page-creator__inner",
|
|
84
|
+
spacing: 4,
|
|
85
|
+
children: /*#__PURE__*/_jsx("form", {
|
|
86
|
+
onSubmit: createPage,
|
|
87
|
+
children: /*#__PURE__*/_jsxs(VStack, {
|
|
88
|
+
spacing: 4,
|
|
89
|
+
children: [/*#__PURE__*/_jsx(TextControl, {
|
|
90
|
+
__next40pxDefaultSize: true,
|
|
91
|
+
__nextHasNoMarginBottom: true,
|
|
92
|
+
label: __('Title'),
|
|
93
|
+
onChange: setTitle,
|
|
94
|
+
placeholder: __('No title'),
|
|
95
|
+
value: title
|
|
96
|
+
}), /*#__PURE__*/_jsx(CheckboxControl, {
|
|
97
|
+
__nextHasNoMarginBottom: true,
|
|
98
|
+
label: __('Publish immediately'),
|
|
99
|
+
help: __('If unchecked, the page will be created as a draft.'),
|
|
100
|
+
checked: shouldPublish,
|
|
101
|
+
onChange: setShouldPublish
|
|
102
|
+
}), lastError && /*#__PURE__*/_jsx(Notice, {
|
|
103
|
+
status: "error",
|
|
104
|
+
isDismissible: false,
|
|
105
|
+
children: lastError.message
|
|
106
|
+
}), /*#__PURE__*/_jsxs(HStack, {
|
|
107
|
+
spacing: 2,
|
|
108
|
+
justify: "flex-end",
|
|
109
|
+
children: [/*#__PURE__*/_jsx(Button, {
|
|
110
|
+
__next40pxDefaultSize: true,
|
|
111
|
+
variant: "tertiary",
|
|
112
|
+
onClick: onBack,
|
|
113
|
+
disabled: isSaving,
|
|
114
|
+
accessibleWhenDisabled: true,
|
|
115
|
+
children: __('Cancel')
|
|
116
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
117
|
+
__next40pxDefaultSize: true,
|
|
118
|
+
variant: "primary",
|
|
119
|
+
type: "submit",
|
|
120
|
+
isBusy: isSaving,
|
|
121
|
+
"aria-disabled": isSubmitDisabled,
|
|
122
|
+
children: __('Create page')
|
|
123
|
+
})]
|
|
124
|
+
})]
|
|
125
|
+
})
|
|
126
|
+
})
|
|
127
|
+
})
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=page-creator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Button","TextControl","Notice","CheckboxControl","__experimentalVStack","VStack","__experimentalHStack","HStack","__","useSelect","useDispatch","store","coreStore","decodeEntities","useState","DialogWrapper","jsx","_jsx","jsxs","_jsxs","LinkUIPageCreator","postType","onBack","onPageCreated","initialTitle","title","setTitle","shouldPublish","setShouldPublish","isTitleValid","trim","length","lastError","isSaving","select","getLastEntitySaveError","isSavingEntityRecord","saveEntityRecord","createPage","event","preventDefault","savedRecord","status","throwOnError","pageLink","id","type","rendered","url","link","kind","error","isSubmitDisabled","className","description","children","spacing","onSubmit","__next40pxDefaultSize","__nextHasNoMarginBottom","label","onChange","placeholder","value","help","checked","isDismissible","message","justify","variant","onClick","disabled","accessibleWhenDisabled","isBusy"],"sources":["@wordpress/block-library/src/navigation-link/page-creator.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\tTextControl,\n\tNotice,\n\tCheckboxControl,\n\t__experimentalVStack as VStack,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport DialogWrapper from './dialog-wrapper';\n\n/**\n * Component for creating new pages within the Navigation Link UI.\n *\n * @param {Object} props Component props.\n * @param {string} props.postType The post type to create.\n * @param {Function} props.onBack Callback when user wants to go back.\n * @param {Function} props.onPageCreated Callback when page is successfully created.\n * @param {string} [props.initialTitle] Initial title to pre-fill the form.\n */\nexport function LinkUIPageCreator( {\n\tpostType,\n\tonBack,\n\tonPageCreated,\n\tinitialTitle = '',\n} ) {\n\tconst [ title, setTitle ] = useState( initialTitle );\n\tconst [ shouldPublish, setShouldPublish ] = useState( false );\n\n\t// Check if the title is valid for submission\n\tconst isTitleValid = title.trim().length > 0;\n\n\t// Get the last created entity record (without ID) to track creation state\n\tconst { lastError, isSaving } = useSelect(\n\t\t( select ) => ( {\n\t\t\tlastError: select( coreStore ).getLastEntitySaveError(\n\t\t\t\t'postType',\n\t\t\t\tpostType\n\t\t\t),\n\t\t\tisSaving: select( coreStore ).isSavingEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType\n\t\t\t),\n\t\t} ),\n\t\t[ postType ]\n\t);\n\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\n\tasync function createPage( event ) {\n\t\tevent.preventDefault();\n\t\tif ( isSaving || ! isTitleValid ) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tconst savedRecord = await saveEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\t{\n\t\t\t\t\ttitle,\n\t\t\t\t\tstatus: shouldPublish ? 'publish' : 'draft',\n\t\t\t\t},\n\t\t\t\t{ throwOnError: true }\n\t\t\t);\n\n\t\t\tif ( savedRecord ) {\n\t\t\t\t// Create the page link object from the saved record\n\t\t\t\tconst pageLink = {\n\t\t\t\t\tid: savedRecord.id,\n\t\t\t\t\ttype: postType,\n\t\t\t\t\ttitle: decodeEntities( savedRecord.title.rendered ),\n\t\t\t\t\turl: savedRecord.link,\n\t\t\t\t\tkind: 'post-type',\n\t\t\t\t};\n\n\t\t\t\tonPageCreated( pageLink );\n\t\t\t}\n\t\t} catch ( error ) {\n\t\t\t// Error handling is done via the data store selectors\n\t\t}\n\t}\n\n\tconst isSubmitDisabled = isSaving || ! isTitleValid;\n\n\treturn (\n\t\t<DialogWrapper\n\t\t\tclassName=\"link-ui-page-creator\"\n\t\t\ttitle={ __( 'Create page' ) }\n\t\t\tdescription={ __( 'Create a new page to add to your Navigation.' ) }\n\t\t\tonBack={ onBack }\n\t\t>\n\t\t\t<VStack className=\"link-ui-page-creator__inner\" spacing={ 4 }>\n\t\t\t\t<form onSubmit={ createPage }>\n\t\t\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Title' ) }\n\t\t\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\t\t\tplaceholder={ __( 'No title' ) }\n\t\t\t\t\t\t\tvalue={ title }\n\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t<CheckboxControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Publish immediately' ) }\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'If unchecked, the page will be created as a draft.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tchecked={ shouldPublish }\n\t\t\t\t\t\t\tonChange={ setShouldPublish }\n\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t{ lastError && (\n\t\t\t\t\t\t\t<Notice status=\"error\" isDismissible={ false }>\n\t\t\t\t\t\t\t\t{ lastError.message }\n\t\t\t\t\t\t\t</Notice>\n\t\t\t\t\t\t) }\n\n\t\t\t\t\t\t<HStack spacing={ 2 } justify=\"flex-end\">\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\t\tonClick={ onBack }\n\t\t\t\t\t\t\t\tdisabled={ isSaving }\n\t\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\t\tisBusy={ isSaving }\n\t\t\t\t\t\t\t\taria-disabled={ isSubmitDisabled }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Create page' ) }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t</VStack>\n\t\t\t\t</form>\n\t\t\t</VStack>\n\t\t</D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qBAAqB;YACrBC,uBAAuB;YACvBC,KAAK,EAAGpD,EAAE,CAAE,OAAQ,CAAG;YACvBqD,QAAQ,EAAGnC,QAAU;YACrBoC,WAAW,EAAGtD,EAAE,CAAE,UAAW,CAAG;YAChCuD,KAAK,EAAGtC;UAAO,CACf,CAAC,eAEFR,IAAA,CAACd,eAAe;YACfwD,uBAAuB;YACvBC,KAAK,EAAGpD,EAAE,CAAE,qBAAsB,CAAG;YACrCwD,IAAI,EAAGxD,EAAE,CACR,oDACD,CAAG;YACHyD,OAAO,EAAGtC,aAAe;YACzBkC,QAAQ,EAAGjC;UAAkB,CAC7B,CAAC,EAEAI,SAAS,iBACVf,IAAA,CAACf,MAAM;YAACwC,MAAM,EAAC,OAAO;YAACwB,aAAa,EAAG,KAAO;YAAAX,QAAA,EAC3CvB,SAAS,CAACmC;UAAO,CACZ,CACR,eAEDhD,KAAA,CAACZ,MAAM;YAACiD,OAAO,EAAG,CAAG;YAACY,OAAO,EAAC,UAAU;YAAAb,QAAA,gBACvCtC,IAAA,CAACjB,MAAM;cACN0D,qBAAqB;cACrBW,OAAO,EAAC,UAAU;cAClBC,OAAO,EAAGhD,MAAQ;cAClBiD,QAAQ,EAAGtC,QAAU;cACrBuC,sBAAsB;cAAAjB,QAAA,EAEpB/C,EAAE,CAAE,QAAS;YAAC,CACT,CAAC,eACTS,IAAA,CAACjB,MAAM;cACN0D,qBAAqB;cACrBW,OAAO,EAAC,SAAS;cACjBvB,IAAI,EAAC,QAAQ;cACb2B,MAAM,EAAGxC,QAAU;cACnB,iBAAgBmB,gBAAkB;cAAAG,QAAA,EAEhC/C,EAAE,CAAE,aAAc;YAAC,CACd,CAAC;UAAA,CACF,CAAC;QAAA,CACF;MAAC,CACJ;IAAC,CACA;EAAC,CACK,CAAC;AAElB","ignoreList":[]}
|
|
@@ -155,7 +155,11 @@ export default function SearchEdit({
|
|
|
155
155
|
const textFieldClasses = clsx('wp-block-search__input', isButtonPositionInside ? undefined : borderProps.className, typographyProps.className);
|
|
156
156
|
const textFieldStyles = {
|
|
157
157
|
...(isButtonPositionInside ? {
|
|
158
|
-
borderRadius
|
|
158
|
+
borderRadius: borderProps.style?.borderRadius,
|
|
159
|
+
borderTopLeftRadius: borderProps.style?.borderTopLeftRadius,
|
|
160
|
+
borderTopRightRadius: borderProps.style?.borderTopRightRadius,
|
|
161
|
+
borderBottomLeftRadius: borderProps.style?.borderBottomLeftRadius,
|
|
162
|
+
borderBottomRightRadius: borderProps.style?.borderBottomRightRadius
|
|
159
163
|
} : borderProps.style),
|
|
160
164
|
...typographyProps.style,
|
|
161
165
|
textDecoration: undefined
|
|
@@ -184,7 +188,11 @@ export default function SearchEdit({
|
|
|
184
188
|
...colorProps.style,
|
|
185
189
|
...typographyProps.style,
|
|
186
190
|
...(isButtonPositionInside ? {
|
|
187
|
-
borderRadius
|
|
191
|
+
borderRadius: borderProps.style?.borderRadius,
|
|
192
|
+
borderTopLeftRadius: borderProps.style?.borderTopLeftRadius,
|
|
193
|
+
borderTopRightRadius: borderProps.style?.borderTopRightRadius,
|
|
194
|
+
borderBottomLeftRadius: borderProps.style?.borderBottomLeftRadius,
|
|
195
|
+
borderBottomRightRadius: borderProps.style?.borderBottomRightRadius
|
|
188
196
|
} : borderProps.style)
|
|
189
197
|
};
|
|
190
198
|
const handleButtonClick = () => {
|
|
@@ -353,7 +361,8 @@ export default function SearchEdit({
|
|
|
353
361
|
})
|
|
354
362
|
})
|
|
355
363
|
});
|
|
356
|
-
const
|
|
364
|
+
const isNonZeroBorderRadius = radius => radius !== undefined && parseInt(radius, 10) !== 0;
|
|
365
|
+
const padBorderRadius = radius => isNonZeroBorderRadius(radius) ? `calc(${radius} + ${DEFAULT_INNER_PADDING})` : undefined;
|
|
357
366
|
const getWrapperStyles = () => {
|
|
358
367
|
const styles = isButtonPositionInside ? borderProps.style : {
|
|
359
368
|
borderRadius: borderProps.style?.borderRadius,
|
|
@@ -362,8 +371,7 @@ export default function SearchEdit({
|
|
|
362
371
|
borderBottomLeftRadius: borderProps.style?.borderBottomLeftRadius,
|
|
363
372
|
borderBottomRightRadius: borderProps.style?.borderBottomRightRadius
|
|
364
373
|
};
|
|
365
|
-
|
|
366
|
-
if (isButtonPositionInside && isNonZeroBorderRadius) {
|
|
374
|
+
if (isButtonPositionInside) {
|
|
367
375
|
// We have button inside wrapper and a border radius value to apply.
|
|
368
376
|
// Add default padding so we don't get "fat" corners.
|
|
369
377
|
//
|
|
@@ -373,17 +381,17 @@ export default function SearchEdit({
|
|
|
373
381
|
if (typeof borderRadius === 'object') {
|
|
374
382
|
// Individual corner border radii present.
|
|
375
383
|
const {
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
} =
|
|
384
|
+
borderTopLeftRadius,
|
|
385
|
+
borderTopRightRadius,
|
|
386
|
+
borderBottomLeftRadius,
|
|
387
|
+
borderBottomRightRadius
|
|
388
|
+
} = borderProps.style;
|
|
381
389
|
return {
|
|
382
390
|
...styles,
|
|
383
|
-
borderTopLeftRadius: padBorderRadius(
|
|
384
|
-
borderTopRightRadius: padBorderRadius(
|
|
385
|
-
borderBottomLeftRadius: padBorderRadius(
|
|
386
|
-
borderBottomRightRadius: padBorderRadius(
|
|
391
|
+
borderTopLeftRadius: padBorderRadius(borderTopLeftRadius),
|
|
392
|
+
borderTopRightRadius: padBorderRadius(borderTopRightRadius),
|
|
393
|
+
borderBottomLeftRadius: padBorderRadius(borderBottomLeftRadius),
|
|
394
|
+
borderBottomRightRadius: padBorderRadius(borderBottomRightRadius)
|
|
387
395
|
};
|
|
388
396
|
}
|
|
389
397
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","useBlockProps","InspectorControls","RichText","__experimentalUseBorderProps","useBorderProps","__experimentalUseColorProps","useColorProps","getTypographyClassesAndStyles","useTypographyProps","store","blockEditorStore","__experimentalGetElementClassName","useSettings","useDispatch","useSelect","useEffect","useRef","SelectControl","ToggleControl","ResizableBox","__experimentalUseCustomUnits","useCustomUnits","__experimentalUnitControl","UnitControl","__experimentalToggleGroupControl","ToggleGroupControl","__experimentalToggleGroupControlOption","ToggleGroupControlOption","__experimentalToolsPanel","ToolsPanel","__experimentalToolsPanelItem","ToolsPanelItem","__experimentalVStack","VStack","useInstanceId","Icon","search","__","sprintf","__unstableStripHTML","stripHTML","PC_WIDTH_DEFAULT","PX_WIDTH_DEFAULT","MIN_WIDTH","isPercentageUnit","useToolsPanelDropdownMenuProps","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","DEFAULT_INNER_PADDING","PERCENTAGE_WIDTHS","SearchEdit","className","attributes","setAttributes","toggleSelection","isSelected","clientId","label","showLabel","placeholder","width","widthUnit","align","buttonText","buttonPosition","buttonUseIcon","isSearchFieldHidden","style","wasJustInsertedIntoNavigationBlock","select","getBlockParentsByBlockName","wasBlockJustInserted","length","__unstableMarkNextChangeAsNotPersistent","borderRadius","border","radius","borderProps","colorProps","fluidTypographySettings","layout","typographyProps","typography","fluid","wideSize","unitControlInstanceId","unitControlInputId","isButtonPositionInside","isButtonPositionOutside","hasNoButton","hasOnlyButton","searchFieldRef","buttonRef","units","availableUnits","defaultValues","px","getBlockClassNames","undefined","buttonPositionControls","value","getResizableSides","right","left","renderTextField","textFieldClasses","textFieldStyles","textDecoration","type","onChange","event","target","ref","renderButton","buttonClasses","buttonStyles","handleButtonClick","children","onClick","icon","identifier","withoutInteractiveFormatting","html","dropdownMenuProps","controls","resetAll","hasValue","onDeselect","isShownByDefault","__nextHasNoMarginBottom","checked","__next40pxDefaultSize","options","id","min","max","step","newWidth","parsedNewWidth","parseInt","onUnitChange","newUnit","__unstableInputWidth","includes","hideLabelFromVision","isBlock","map","widthValue","padBorderRadius","getWrapperStyles","styles","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","isNonZeroBorderRadius","topLeft","topRight","bottomLeft","bottomRight","Number","isInteger","blockProps","labelClassnames","size","height","minWidth","enable","onResizeStart","direction","elt","offsetWidth","onResizeStop","delta","showHandle"],"sources":["@wordpress/block-library/src/search/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseBlockProps,\n\tInspectorControls,\n\tRichText,\n\t__experimentalUseBorderProps as useBorderProps,\n\t__experimentalUseColorProps as useColorProps,\n\tgetTypographyClassesAndStyles as useTypographyProps,\n\tstore as blockEditorStore,\n\t__experimentalGetElementClassName,\n\tuseSettings,\n} from '@wordpress/block-editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useEffect, useRef } from '@wordpress/element';\nimport {\n\tSelectControl,\n\tToggleControl,\n\tResizableBox,\n\t__experimentalUseCustomUnits as useCustomUnits,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport { Icon, search } from '@wordpress/icons';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport {\n\tPC_WIDTH_DEFAULT,\n\tPX_WIDTH_DEFAULT,\n\tMIN_WIDTH,\n\tisPercentageUnit,\n} from './utils.js';\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\n// Used to calculate border radius adjustment to avoid \"fat\" corners when\n// button is placed inside wrapper.\nconst DEFAULT_INNER_PADDING = '4px';\nconst PERCENTAGE_WIDTHS = [ 25, 50, 75, 100 ];\n\nexport default function SearchEdit( {\n\tclassName,\n\tattributes,\n\tsetAttributes,\n\ttoggleSelection,\n\tisSelected,\n\tclientId,\n} ) {\n\tconst {\n\t\tlabel,\n\t\tshowLabel,\n\t\tplaceholder,\n\t\twidth,\n\t\twidthUnit,\n\t\talign,\n\t\tbuttonText,\n\t\tbuttonPosition,\n\t\tbuttonUseIcon,\n\t\tisSearchFieldHidden,\n\t\tstyle,\n\t} = attributes;\n\n\tconst wasJustInsertedIntoNavigationBlock = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockParentsByBlockName, wasBlockJustInserted } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\treturn (\n\t\t\t\t!! getBlockParentsByBlockName( clientId, 'core/navigation' )\n\t\t\t\t\t?.length && wasBlockJustInserted( clientId )\n\t\t\t);\n\t\t},\n\t\t[ clientId ]\n\t);\n\tconst { __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\n\tuseEffect( () => {\n\t\tif ( wasJustInsertedIntoNavigationBlock ) {\n\t\t\t// This side-effect should not create an undo level.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( {\n\t\t\t\tshowLabel: false,\n\t\t\t\tbuttonUseIcon: true,\n\t\t\t\tbuttonPosition: 'button-inside',\n\t\t\t} );\n\t\t}\n\t}, [\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\twasJustInsertedIntoNavigationBlock,\n\t\tsetAttributes,\n\t] );\n\n\tconst borderRadius = style?.border?.radius;\n\tlet borderProps = useBorderProps( attributes );\n\n\t// Check for old deprecated numerical border radius. Done as a separate\n\t// check so that a borderRadius style won't overwrite the longhand\n\t// per-corner styles.\n\tif ( typeof borderRadius === 'number' ) {\n\t\tborderProps = {\n\t\t\t...borderProps,\n\t\t\tstyle: {\n\t\t\t\t...borderProps.style,\n\t\t\t\tborderRadius: `${ borderRadius }px`,\n\t\t\t},\n\t\t};\n\t}\n\n\tconst colorProps = useColorProps( attributes );\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\tconst unitControlInstanceId = useInstanceId( UnitControl );\n\tconst unitControlInputId = `wp-block-search__width-${ unitControlInstanceId }`;\n\tconst isButtonPositionInside = 'button-inside' === buttonPosition;\n\tconst isButtonPositionOutside = 'button-outside' === buttonPosition;\n\tconst hasNoButton = 'no-button' === buttonPosition;\n\tconst hasOnlyButton = 'button-only' === buttonPosition;\n\tconst searchFieldRef = useRef();\n\tconst buttonRef = useRef();\n\n\tconst units = useCustomUnits( {\n\t\tavailableUnits: [ '%', 'px' ],\n\t\tdefaultValues: { '%': PC_WIDTH_DEFAULT, px: PX_WIDTH_DEFAULT },\n\t} );\n\n\tuseEffect( () => {\n\t\tif ( hasOnlyButton && ! isSelected ) {\n\t\t\tsetAttributes( {\n\t\t\t\tisSearchFieldHidden: true,\n\t\t\t} );\n\t\t}\n\t}, [ hasOnlyButton, isSelected, setAttributes ] );\n\n\t// Show the search field when width changes.\n\tuseEffect( () => {\n\t\tif ( ! hasOnlyButton || ! isSelected ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetAttributes( {\n\t\t\tisSearchFieldHidden: false,\n\t\t} );\n\t}, [ hasOnlyButton, isSelected, setAttributes, width ] );\n\n\tconst getBlockClassNames = () => {\n\t\treturn clsx(\n\t\t\tclassName,\n\t\t\tisButtonPositionInside\n\t\t\t\t? 'wp-block-search__button-inside'\n\t\t\t\t: undefined,\n\t\t\tisButtonPositionOutside\n\t\t\t\t? 'wp-block-search__button-outside'\n\t\t\t\t: undefined,\n\t\t\thasNoButton ? 'wp-block-search__no-button' : undefined,\n\t\t\thasOnlyButton ? 'wp-block-search__button-only' : undefined,\n\t\t\t! buttonUseIcon && ! hasNoButton\n\t\t\t\t? 'wp-block-search__text-button'\n\t\t\t\t: undefined,\n\t\t\tbuttonUseIcon && ! hasNoButton\n\t\t\t\t? 'wp-block-search__icon-button'\n\t\t\t\t: undefined,\n\t\t\thasOnlyButton && isSearchFieldHidden\n\t\t\t\t? 'wp-block-search__searchfield-hidden'\n\t\t\t\t: undefined\n\t\t);\n\t};\n\n\tconst buttonPositionControls = [\n\t\t{\n\t\t\tlabel: __( 'Button outside' ),\n\t\t\tvalue: 'button-outside',\n\t\t},\n\t\t{\n\t\t\tlabel: __( 'Button inside' ),\n\t\t\tvalue: 'button-inside',\n\t\t},\n\t\t{\n\t\t\tlabel: __( 'No button' ),\n\t\t\tvalue: 'no-button',\n\t\t},\n\t\t{\n\t\t\tlabel: __( 'Button only' ),\n\t\t\tvalue: 'button-only',\n\t\t},\n\t];\n\n\tconst getResizableSides = () => {\n\t\tif ( hasOnlyButton ) {\n\t\t\treturn {};\n\t\t}\n\n\t\treturn {\n\t\t\tright: align !== 'right',\n\t\t\tleft: align === 'right',\n\t\t};\n\t};\n\n\tconst renderTextField = () => {\n\t\t// If the input is inside the wrapper, the wrapper gets the border color styles/classes, not the input control.\n\t\tconst textFieldClasses = clsx(\n\t\t\t'wp-block-search__input',\n\t\t\tisButtonPositionInside ? undefined : borderProps.className,\n\t\t\ttypographyProps.className\n\t\t);\n\t\tconst textFieldStyles = {\n\t\t\t...( isButtonPositionInside\n\t\t\t\t? { borderRadius }\n\t\t\t\t: borderProps.style ),\n\t\t\t...typographyProps.style,\n\t\t\ttextDecoration: undefined,\n\t\t};\n\n\t\treturn (\n\t\t\t<input\n\t\t\t\ttype=\"search\"\n\t\t\t\tclassName={ textFieldClasses }\n\t\t\t\tstyle={ textFieldStyles }\n\t\t\t\taria-label={ __( 'Optional placeholder text' ) }\n\t\t\t\t// We hide the placeholder field's placeholder when there is a value. This\n\t\t\t\t// stops screen readers from reading the placeholder field's placeholder\n\t\t\t\t// which is confusing.\n\t\t\t\tplaceholder={\n\t\t\t\t\tplaceholder ? undefined : __( 'Optional placeholder…' )\n\t\t\t\t}\n\t\t\t\tvalue={ placeholder }\n\t\t\t\tonChange={ ( event ) =>\n\t\t\t\t\tsetAttributes( { placeholder: event.target.value } )\n\t\t\t\t}\n\t\t\t\tref={ searchFieldRef }\n\t\t\t/>\n\t\t);\n\t};\n\n\tconst renderButton = () => {\n\t\t// If the button is inside the wrapper, the wrapper gets the border color styles/classes, not the button.\n\t\tconst buttonClasses = clsx(\n\t\t\t'wp-block-search__button',\n\t\t\tcolorProps.className,\n\t\t\ttypographyProps.className,\n\t\t\tisButtonPositionInside ? undefined : borderProps.className,\n\t\t\tbuttonUseIcon ? 'has-icon' : undefined,\n\t\t\t__experimentalGetElementClassName( 'button' )\n\t\t);\n\t\tconst buttonStyles = {\n\t\t\t...colorProps.style,\n\t\t\t...typographyProps.style,\n\t\t\t...( isButtonPositionInside\n\t\t\t\t? { borderRadius }\n\t\t\t\t: borderProps.style ),\n\t\t};\n\t\tconst handleButtonClick = () => {\n\t\t\tif ( hasOnlyButton ) {\n\t\t\t\tsetAttributes( {\n\t\t\t\t\tisSearchFieldHidden: ! isSearchFieldHidden,\n\t\t\t\t} );\n\t\t\t}\n\t\t};\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ buttonUseIcon && (\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tclassName={ buttonClasses }\n\t\t\t\t\t\tstyle={ buttonStyles }\n\t\t\t\t\t\taria-label={\n\t\t\t\t\t\t\tbuttonText\n\t\t\t\t\t\t\t\t? stripHTML( buttonText )\n\t\t\t\t\t\t\t\t: __( 'Search' )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonClick={ handleButtonClick }\n\t\t\t\t\t\tref={ buttonRef }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon icon={ search } />\n\t\t\t\t\t</button>\n\t\t\t\t) }\n\n\t\t\t\t{ ! buttonUseIcon && (\n\t\t\t\t\t<RichText\n\t\t\t\t\t\tidentifier=\"buttonText\"\n\t\t\t\t\t\tclassName={ buttonClasses }\n\t\t\t\t\t\tstyle={ buttonStyles }\n\t\t\t\t\t\taria-label={ __( 'Button text' ) }\n\t\t\t\t\t\tplaceholder={ __( 'Add button text…' ) }\n\t\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\t\tvalue={ buttonText }\n\t\t\t\t\t\tonChange={ ( html ) =>\n\t\t\t\t\t\t\tsetAttributes( { buttonText: html } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonClick={ handleButtonClick }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t};\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tconst controls = (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\twidth: undefined,\n\t\t\t\t\t\t\twidthUnit: undefined,\n\t\t\t\t\t\t\tshowLabel: true,\n\t\t\t\t\t\t\tbuttonUseIcon: false,\n\t\t\t\t\t\t\tbuttonPosition: 'button-outside',\n\t\t\t\t\t\t\tisSearchFieldHidden: false,\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => ! showLabel }\n\t\t\t\t\t\tlabel={ __( 'Show label' ) }\n\t\t\t\t\t\tonDeselect={ () => {\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tshowLabel: true,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tisShownByDefault\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\tchecked={ showLabel }\n\t\t\t\t\t\t\tlabel={ __( 'Show label' ) }\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\tshowLabel: 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\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => buttonPosition !== 'button-outside' }\n\t\t\t\t\t\tlabel={ __( 'Button position' ) }\n\t\t\t\t\t\tonDeselect={ () => {\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tbuttonPosition: 'button-outside',\n\t\t\t\t\t\t\t\tisSearchFieldHidden: false,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t>\n\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\tvalue={ buttonPosition }\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Button position' ) }\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\tbuttonPosition: value,\n\t\t\t\t\t\t\t\t\tisSearchFieldHidden:\n\t\t\t\t\t\t\t\t\t\tvalue === 'button-only',\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\toptions={ buttonPositionControls }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t{ buttonPosition !== 'no-button' && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\thasValue={ () => !! buttonUseIcon }\n\t\t\t\t\t\t\tlabel={ __( 'Use button with icon' ) }\n\t\t\t\t\t\t\tonDeselect={ () => {\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tbuttonUseIcon: false,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tchecked={ buttonUseIcon }\n\t\t\t\t\t\t\t\tlabel={ __( 'Use button with icon' ) }\n\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tbuttonUseIcon: value,\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</ToolsPanelItem>\n\t\t\t\t\t) }\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => !! width }\n\t\t\t\t\t\tlabel={ __( 'Width' ) }\n\t\t\t\t\t\tonDeselect={ () => {\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\twidth: undefined,\n\t\t\t\t\t\t\t\twidthUnit: undefined,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t>\n\t\t\t\t\t\t<VStack>\n\t\t\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tlabel={ __( 'Width' ) }\n\t\t\t\t\t\t\t\tid={ unitControlInputId } // Unused, kept for backwards compatibility\n\t\t\t\t\t\t\t\tmin={\n\t\t\t\t\t\t\t\t\tisPercentageUnit( widthUnit )\n\t\t\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t\t\t: MIN_WIDTH\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tmax={\n\t\t\t\t\t\t\t\t\tisPercentageUnit( widthUnit )\n\t\t\t\t\t\t\t\t\t\t? 100\n\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tstep={ 1 }\n\t\t\t\t\t\t\t\tonChange={ ( newWidth ) => {\n\t\t\t\t\t\t\t\t\tconst parsedNewWidth =\n\t\t\t\t\t\t\t\t\t\tnewWidth === ''\n\t\t\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t\t\t: parseInt( newWidth, 10 );\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\twidth: parsedNewWidth,\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\tonUnitChange={ ( newUnit ) => {\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\twidth:\n\t\t\t\t\t\t\t\t\t\t\t'%' === newUnit\n\t\t\t\t\t\t\t\t\t\t\t\t? PC_WIDTH_DEFAULT\n\t\t\t\t\t\t\t\t\t\t\t\t: PX_WIDTH_DEFAULT,\n\t\t\t\t\t\t\t\t\t\twidthUnit: newUnit,\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\t__unstableInputWidth=\"80px\"\n\t\t\t\t\t\t\t\tvalue={ `${ width }${ widthUnit }` }\n\t\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<ToggleGroupControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Percentage Width' ) }\n\t\t\t\t\t\t\t\tvalue={\n\t\t\t\t\t\t\t\t\tPERCENTAGE_WIDTHS.includes( width ) &&\n\t\t\t\t\t\t\t\t\twidthUnit === '%'\n\t\t\t\t\t\t\t\t\t\t? width\n\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\t\tonChange={ ( newWidth ) => {\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\twidth: newWidth,\n\t\t\t\t\t\t\t\t\t\twidthUnit: '%',\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\tisBlock\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ PERCENTAGE_WIDTHS.map( ( widthValue ) => {\n\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\t\t\t\t\tkey={ widthValue }\n\t\t\t\t\t\t\t\t\t\t\tvalue={ widthValue }\n\t\t\t\t\t\t\t\t\t\t\tlabel={ sprintf(\n\t\t\t\t\t\t\t\t\t\t\t\t/* translators: %d: Percentage value. */\n\t\t\t\t\t\t\t\t\t\t\t\t__( '%d%%' ),\n\t\t\t\t\t\t\t\t\t\t\t\twidthValue\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t/>\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</ToggleGroupControl>\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t</ToolsPanel>\n\t\t\t</InspectorControls>\n\t\t</>\n\t);\n\n\tconst padBorderRadius = ( radius ) =>\n\t\tradius ? `calc(${ radius } + ${ DEFAULT_INNER_PADDING })` : undefined;\n\n\tconst getWrapperStyles = () => {\n\t\tconst styles = isButtonPositionInside\n\t\t\t? borderProps.style\n\t\t\t: {\n\t\t\t\t\tborderRadius: borderProps.style?.borderRadius,\n\t\t\t\t\tborderTopLeftRadius: borderProps.style?.borderTopLeftRadius,\n\t\t\t\t\tborderTopRightRadius:\n\t\t\t\t\t\tborderProps.style?.borderTopRightRadius,\n\t\t\t\t\tborderBottomLeftRadius:\n\t\t\t\t\t\tborderProps.style?.borderBottomLeftRadius,\n\t\t\t\t\tborderBottomRightRadius:\n\t\t\t\t\t\tborderProps.style?.borderBottomRightRadius,\n\t\t\t };\n\n\t\tconst isNonZeroBorderRadius =\n\t\t\tborderRadius !== undefined && parseInt( borderRadius, 10 ) !== 0;\n\n\t\tif ( isButtonPositionInside && isNonZeroBorderRadius ) {\n\t\t\t// We have button inside wrapper and a border radius value to apply.\n\t\t\t// Add default padding so we don't get \"fat\" corners.\n\t\t\t//\n\t\t\t// CSS calc() is used here to support non-pixel units. The inline\n\t\t\t// style using calc() will only apply if both values have units.\n\n\t\t\tif ( typeof borderRadius === 'object' ) {\n\t\t\t\t// Individual corner border radii present.\n\t\t\t\tconst { topLeft, topRight, bottomLeft, bottomRight } =\n\t\t\t\t\tborderRadius;\n\n\t\t\t\treturn {\n\t\t\t\t\t...styles,\n\t\t\t\t\tborderTopLeftRadius: padBorderRadius( topLeft ),\n\t\t\t\t\tborderTopRightRadius: padBorderRadius( topRight ),\n\t\t\t\t\tborderBottomLeftRadius: padBorderRadius( bottomLeft ),\n\t\t\t\t\tborderBottomRightRadius: padBorderRadius( bottomRight ),\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t// The inline style using calc() will only apply if both values\n\t\t\t// supplied to calc() have units. Deprecated block's may have\n\t\t\t// unitless integer.\n\t\t\tconst radius = Number.isInteger( borderRadius )\n\t\t\t\t? `${ borderRadius }px`\n\t\t\t\t: borderRadius;\n\n\t\t\tstyles.borderRadius = `calc(${ radius } + ${ DEFAULT_INNER_PADDING })`;\n\t\t}\n\n\t\treturn styles;\n\t};\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: getBlockClassNames(),\n\t\tstyle: {\n\t\t\t...typographyProps.style,\n\t\t\t// Input opts out of text decoration.\n\t\t\ttextDecoration: undefined,\n\t\t},\n\t} );\n\n\tconst labelClassnames = clsx(\n\t\t'wp-block-search__label',\n\t\ttypographyProps.className\n\t);\n\n\treturn (\n\t\t<div { ...blockProps }>\n\t\t\t{ controls }\n\n\t\t\t{ showLabel && (\n\t\t\t\t<RichText\n\t\t\t\t\tidentifier=\"label\"\n\t\t\t\t\tclassName={ labelClassnames }\n\t\t\t\t\taria-label={ __( 'Label text' ) }\n\t\t\t\t\tplaceholder={ __( 'Add label…' ) }\n\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\tvalue={ label }\n\t\t\t\t\tonChange={ ( html ) => setAttributes( { label: html } ) }\n\t\t\t\t\tstyle={ typographyProps.style }\n\t\t\t\t/>\n\t\t\t) }\n\n\t\t\t<ResizableBox\n\t\t\t\tsize={ {\n\t\t\t\t\twidth:\n\t\t\t\t\t\twidth === undefined\n\t\t\t\t\t\t\t? 'auto'\n\t\t\t\t\t\t\t: `${ width }${ widthUnit }`,\n\t\t\t\t\theight: 'auto',\n\t\t\t\t} }\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\t'wp-block-search__inside-wrapper',\n\t\t\t\t\tisButtonPositionInside ? borderProps.className : undefined\n\t\t\t\t) }\n\t\t\t\tstyle={ getWrapperStyles() }\n\t\t\t\tminWidth={ MIN_WIDTH }\n\t\t\t\tenable={ getResizableSides() }\n\t\t\t\tonResizeStart={ ( event, direction, elt ) => {\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\twidth: parseInt( elt.offsetWidth, 10 ),\n\t\t\t\t\t\twidthUnit: 'px',\n\t\t\t\t\t} );\n\t\t\t\t\ttoggleSelection( false );\n\t\t\t\t} }\n\t\t\t\tonResizeStop={ ( event, direction, elt, delta ) => {\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\twidth: parseInt( width + delta.width, 10 ),\n\t\t\t\t\t} );\n\t\t\t\t\ttoggleSelection( true );\n\t\t\t\t} }\n\t\t\t\tshowHandle={ isSelected }\n\t\t\t>\n\t\t\t\t{ ( isButtonPositionInside ||\n\t\t\t\t\tisButtonPositionOutside ||\n\t\t\t\t\thasOnlyButton ) && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ renderTextField() }\n\t\t\t\t\t\t{ renderButton() }\n\t\t\t\t\t</>\n\t\t\t\t) }\n\n\t\t\t\t{ hasNoButton && renderTextField() }\n\t\t\t</ResizableBox>\n\t\t</div>\n\t);\n}\n"],"m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rH,aAAa,CAAE;UACdO,KAAK,EAAE+E,QAAQ,CAAE+B,GAAG,CAACC,WAAW,EAAE,EAAG,CAAC;UACtC9G,SAAS,EAAE;QACZ,CAAE,CAAC;QACHP,eAAe,CAAE,KAAM,CAAC;MACzB,CAAG;MACHsH,YAAY,EAAGA,CAAE9D,KAAK,EAAE2D,SAAS,EAAEC,GAAG,EAAEG,KAAK,KAAM;QAClDxH,aAAa,CAAE;UACdO,KAAK,EAAE+E,QAAQ,CAAE/E,KAAK,GAAGiH,KAAK,CAACjH,KAAK,EAAE,EAAG;QAC1C,CAAE,CAAC;QACHN,eAAe,CAAE,IAAK,CAAC;MACxB,CAAG;MACHwH,UAAU,EAAGvH,UAAY;MAAA8D,QAAA,GAEvB,CAAE9B,sBAAsB,IACzBC,uBAAuB,IACvBE,aAAa,kBACb3C,KAAA,CAAAF,SAAA;QAAAwE,QAAA,GACGb,eAAe,CAAC,CAAC,EACjBS,YAAY,CAAC,CAAC;MAAA,CACf,CACF,EAECxB,WAAW,IAAIe,eAAe,CAAC,CAAC;IAAA,CACrB,CAAC;EAAA,CACX,CAAC;AAER","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["clsx","useBlockProps","InspectorControls","RichText","__experimentalUseBorderProps","useBorderProps","__experimentalUseColorProps","useColorProps","getTypographyClassesAndStyles","useTypographyProps","store","blockEditorStore","__experimentalGetElementClassName","useSettings","useDispatch","useSelect","useEffect","useRef","SelectControl","ToggleControl","ResizableBox","__experimentalUseCustomUnits","useCustomUnits","__experimentalUnitControl","UnitControl","__experimentalToggleGroupControl","ToggleGroupControl","__experimentalToggleGroupControlOption","ToggleGroupControlOption","__experimentalToolsPanel","ToolsPanel","__experimentalToolsPanelItem","ToolsPanelItem","__experimentalVStack","VStack","useInstanceId","Icon","search","__","sprintf","__unstableStripHTML","stripHTML","PC_WIDTH_DEFAULT","PX_WIDTH_DEFAULT","MIN_WIDTH","isPercentageUnit","useToolsPanelDropdownMenuProps","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","DEFAULT_INNER_PADDING","PERCENTAGE_WIDTHS","SearchEdit","className","attributes","setAttributes","toggleSelection","isSelected","clientId","label","showLabel","placeholder","width","widthUnit","align","buttonText","buttonPosition","buttonUseIcon","isSearchFieldHidden","style","wasJustInsertedIntoNavigationBlock","select","getBlockParentsByBlockName","wasBlockJustInserted","length","__unstableMarkNextChangeAsNotPersistent","borderRadius","border","radius","borderProps","colorProps","fluidTypographySettings","layout","typographyProps","typography","fluid","wideSize","unitControlInstanceId","unitControlInputId","isButtonPositionInside","isButtonPositionOutside","hasNoButton","hasOnlyButton","searchFieldRef","buttonRef","units","availableUnits","defaultValues","px","getBlockClassNames","undefined","buttonPositionControls","value","getResizableSides","right","left","renderTextField","textFieldClasses","textFieldStyles","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","textDecoration","type","onChange","event","target","ref","renderButton","buttonClasses","buttonStyles","handleButtonClick","children","onClick","icon","identifier","withoutInteractiveFormatting","html","dropdownMenuProps","controls","resetAll","hasValue","onDeselect","isShownByDefault","__nextHasNoMarginBottom","checked","__next40pxDefaultSize","options","id","min","max","step","newWidth","parsedNewWidth","parseInt","onUnitChange","newUnit","__unstableInputWidth","includes","hideLabelFromVision","isBlock","map","widthValue","isNonZeroBorderRadius","padBorderRadius","getWrapperStyles","styles","Number","isInteger","blockProps","labelClassnames","size","height","minWidth","enable","onResizeStart","direction","elt","offsetWidth","onResizeStop","delta","showHandle"],"sources":["@wordpress/block-library/src/search/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseBlockProps,\n\tInspectorControls,\n\tRichText,\n\t__experimentalUseBorderProps as useBorderProps,\n\t__experimentalUseColorProps as useColorProps,\n\tgetTypographyClassesAndStyles as useTypographyProps,\n\tstore as blockEditorStore,\n\t__experimentalGetElementClassName,\n\tuseSettings,\n} from '@wordpress/block-editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useEffect, useRef } from '@wordpress/element';\nimport {\n\tSelectControl,\n\tToggleControl,\n\tResizableBox,\n\t__experimentalUseCustomUnits as useCustomUnits,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport { Icon, search } from '@wordpress/icons';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport {\n\tPC_WIDTH_DEFAULT,\n\tPX_WIDTH_DEFAULT,\n\tMIN_WIDTH,\n\tisPercentageUnit,\n} from './utils.js';\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\n// Used to calculate border radius adjustment to avoid \"fat\" corners when\n// button is placed inside wrapper.\nconst DEFAULT_INNER_PADDING = '4px';\nconst PERCENTAGE_WIDTHS = [ 25, 50, 75, 100 ];\n\nexport default function SearchEdit( {\n\tclassName,\n\tattributes,\n\tsetAttributes,\n\ttoggleSelection,\n\tisSelected,\n\tclientId,\n} ) {\n\tconst {\n\t\tlabel,\n\t\tshowLabel,\n\t\tplaceholder,\n\t\twidth,\n\t\twidthUnit,\n\t\talign,\n\t\tbuttonText,\n\t\tbuttonPosition,\n\t\tbuttonUseIcon,\n\t\tisSearchFieldHidden,\n\t\tstyle,\n\t} = attributes;\n\n\tconst wasJustInsertedIntoNavigationBlock = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockParentsByBlockName, wasBlockJustInserted } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\treturn (\n\t\t\t\t!! getBlockParentsByBlockName( clientId, 'core/navigation' )\n\t\t\t\t\t?.length && wasBlockJustInserted( clientId )\n\t\t\t);\n\t\t},\n\t\t[ clientId ]\n\t);\n\tconst { __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\n\tuseEffect( () => {\n\t\tif ( wasJustInsertedIntoNavigationBlock ) {\n\t\t\t// This side-effect should not create an undo level.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( {\n\t\t\t\tshowLabel: false,\n\t\t\t\tbuttonUseIcon: true,\n\t\t\t\tbuttonPosition: 'button-inside',\n\t\t\t} );\n\t\t}\n\t}, [\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\twasJustInsertedIntoNavigationBlock,\n\t\tsetAttributes,\n\t] );\n\n\tconst borderRadius = style?.border?.radius;\n\tlet borderProps = useBorderProps( attributes );\n\n\t// Check for old deprecated numerical border radius. Done as a separate\n\t// check so that a borderRadius style won't overwrite the longhand\n\t// per-corner styles.\n\tif ( typeof borderRadius === 'number' ) {\n\t\tborderProps = {\n\t\t\t...borderProps,\n\t\t\tstyle: {\n\t\t\t\t...borderProps.style,\n\t\t\t\tborderRadius: `${ borderRadius }px`,\n\t\t\t},\n\t\t};\n\t}\n\n\tconst colorProps = useColorProps( attributes );\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\tconst unitControlInstanceId = useInstanceId( UnitControl );\n\tconst unitControlInputId = `wp-block-search__width-${ unitControlInstanceId }`;\n\tconst isButtonPositionInside = 'button-inside' === buttonPosition;\n\tconst isButtonPositionOutside = 'button-outside' === buttonPosition;\n\tconst hasNoButton = 'no-button' === buttonPosition;\n\tconst hasOnlyButton = 'button-only' === buttonPosition;\n\tconst searchFieldRef = useRef();\n\tconst buttonRef = useRef();\n\n\tconst units = useCustomUnits( {\n\t\tavailableUnits: [ '%', 'px' ],\n\t\tdefaultValues: { '%': PC_WIDTH_DEFAULT, px: PX_WIDTH_DEFAULT },\n\t} );\n\n\tuseEffect( () => {\n\t\tif ( hasOnlyButton && ! isSelected ) {\n\t\t\tsetAttributes( {\n\t\t\t\tisSearchFieldHidden: true,\n\t\t\t} );\n\t\t}\n\t}, [ hasOnlyButton, isSelected, setAttributes ] );\n\n\t// Show the search field when width changes.\n\tuseEffect( () => {\n\t\tif ( ! hasOnlyButton || ! isSelected ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetAttributes( {\n\t\t\tisSearchFieldHidden: false,\n\t\t} );\n\t}, [ hasOnlyButton, isSelected, setAttributes, width ] );\n\n\tconst getBlockClassNames = () => {\n\t\treturn clsx(\n\t\t\tclassName,\n\t\t\tisButtonPositionInside\n\t\t\t\t? 'wp-block-search__button-inside'\n\t\t\t\t: undefined,\n\t\t\tisButtonPositionOutside\n\t\t\t\t? 'wp-block-search__button-outside'\n\t\t\t\t: undefined,\n\t\t\thasNoButton ? 'wp-block-search__no-button' : undefined,\n\t\t\thasOnlyButton ? 'wp-block-search__button-only' : undefined,\n\t\t\t! buttonUseIcon && ! hasNoButton\n\t\t\t\t? 'wp-block-search__text-button'\n\t\t\t\t: undefined,\n\t\t\tbuttonUseIcon && ! hasNoButton\n\t\t\t\t? 'wp-block-search__icon-button'\n\t\t\t\t: undefined,\n\t\t\thasOnlyButton && isSearchFieldHidden\n\t\t\t\t? 'wp-block-search__searchfield-hidden'\n\t\t\t\t: undefined\n\t\t);\n\t};\n\n\tconst buttonPositionControls = [\n\t\t{\n\t\t\tlabel: __( 'Button outside' ),\n\t\t\tvalue: 'button-outside',\n\t\t},\n\t\t{\n\t\t\tlabel: __( 'Button inside' ),\n\t\t\tvalue: 'button-inside',\n\t\t},\n\t\t{\n\t\t\tlabel: __( 'No button' ),\n\t\t\tvalue: 'no-button',\n\t\t},\n\t\t{\n\t\t\tlabel: __( 'Button only' ),\n\t\t\tvalue: 'button-only',\n\t\t},\n\t];\n\n\tconst getResizableSides = () => {\n\t\tif ( hasOnlyButton ) {\n\t\t\treturn {};\n\t\t}\n\n\t\treturn {\n\t\t\tright: align !== 'right',\n\t\t\tleft: align === 'right',\n\t\t};\n\t};\n\n\tconst renderTextField = () => {\n\t\t// If the input is inside the wrapper, the wrapper gets the border color styles/classes, not the input control.\n\t\tconst textFieldClasses = clsx(\n\t\t\t'wp-block-search__input',\n\t\t\tisButtonPositionInside ? undefined : borderProps.className,\n\t\t\ttypographyProps.className\n\t\t);\n\t\tconst textFieldStyles = {\n\t\t\t...( isButtonPositionInside\n\t\t\t\t? {\n\t\t\t\t\t\tborderRadius: borderProps.style?.borderRadius,\n\t\t\t\t\t\tborderTopLeftRadius:\n\t\t\t\t\t\t\tborderProps.style?.borderTopLeftRadius,\n\t\t\t\t\t\tborderTopRightRadius:\n\t\t\t\t\t\t\tborderProps.style?.borderTopRightRadius,\n\t\t\t\t\t\tborderBottomLeftRadius:\n\t\t\t\t\t\t\tborderProps.style?.borderBottomLeftRadius,\n\t\t\t\t\t\tborderBottomRightRadius:\n\t\t\t\t\t\t\tborderProps.style?.borderBottomRightRadius,\n\t\t\t\t }\n\t\t\t\t: borderProps.style ),\n\t\t\t...typographyProps.style,\n\t\t\ttextDecoration: undefined,\n\t\t};\n\n\t\treturn (\n\t\t\t<input\n\t\t\t\ttype=\"search\"\n\t\t\t\tclassName={ textFieldClasses }\n\t\t\t\tstyle={ textFieldStyles }\n\t\t\t\taria-label={ __( 'Optional placeholder text' ) }\n\t\t\t\t// We hide the placeholder field's placeholder when there is a value. This\n\t\t\t\t// stops screen readers from reading the placeholder field's placeholder\n\t\t\t\t// which is confusing.\n\t\t\t\tplaceholder={\n\t\t\t\t\tplaceholder ? undefined : __( 'Optional placeholder…' )\n\t\t\t\t}\n\t\t\t\tvalue={ placeholder }\n\t\t\t\tonChange={ ( event ) =>\n\t\t\t\t\tsetAttributes( { placeholder: event.target.value } )\n\t\t\t\t}\n\t\t\t\tref={ searchFieldRef }\n\t\t\t/>\n\t\t);\n\t};\n\n\tconst renderButton = () => {\n\t\t// If the button is inside the wrapper, the wrapper gets the border color styles/classes, not the button.\n\t\tconst buttonClasses = clsx(\n\t\t\t'wp-block-search__button',\n\t\t\tcolorProps.className,\n\t\t\ttypographyProps.className,\n\t\t\tisButtonPositionInside ? undefined : borderProps.className,\n\t\t\tbuttonUseIcon ? 'has-icon' : undefined,\n\t\t\t__experimentalGetElementClassName( 'button' )\n\t\t);\n\t\tconst buttonStyles = {\n\t\t\t...colorProps.style,\n\t\t\t...typographyProps.style,\n\t\t\t...( isButtonPositionInside\n\t\t\t\t? {\n\t\t\t\t\t\tborderRadius: borderProps.style?.borderRadius,\n\t\t\t\t\t\tborderTopLeftRadius:\n\t\t\t\t\t\t\tborderProps.style?.borderTopLeftRadius,\n\t\t\t\t\t\tborderTopRightRadius:\n\t\t\t\t\t\t\tborderProps.style?.borderTopRightRadius,\n\t\t\t\t\t\tborderBottomLeftRadius:\n\t\t\t\t\t\t\tborderProps.style?.borderBottomLeftRadius,\n\t\t\t\t\t\tborderBottomRightRadius:\n\t\t\t\t\t\t\tborderProps.style?.borderBottomRightRadius,\n\t\t\t\t }\n\t\t\t\t: borderProps.style ),\n\t\t};\n\t\tconst handleButtonClick = () => {\n\t\t\tif ( hasOnlyButton ) {\n\t\t\t\tsetAttributes( {\n\t\t\t\t\tisSearchFieldHidden: ! isSearchFieldHidden,\n\t\t\t\t} );\n\t\t\t}\n\t\t};\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ buttonUseIcon && (\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tclassName={ buttonClasses }\n\t\t\t\t\t\tstyle={ buttonStyles }\n\t\t\t\t\t\taria-label={\n\t\t\t\t\t\t\tbuttonText\n\t\t\t\t\t\t\t\t? stripHTML( buttonText )\n\t\t\t\t\t\t\t\t: __( 'Search' )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonClick={ handleButtonClick }\n\t\t\t\t\t\tref={ buttonRef }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon icon={ search } />\n\t\t\t\t\t</button>\n\t\t\t\t) }\n\n\t\t\t\t{ ! buttonUseIcon && (\n\t\t\t\t\t<RichText\n\t\t\t\t\t\tidentifier=\"buttonText\"\n\t\t\t\t\t\tclassName={ buttonClasses }\n\t\t\t\t\t\tstyle={ buttonStyles }\n\t\t\t\t\t\taria-label={ __( 'Button text' ) }\n\t\t\t\t\t\tplaceholder={ __( 'Add button text…' ) }\n\t\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\t\tvalue={ buttonText }\n\t\t\t\t\t\tonChange={ ( html ) =>\n\t\t\t\t\t\t\tsetAttributes( { buttonText: html } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonClick={ handleButtonClick }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t};\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tconst controls = (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\twidth: undefined,\n\t\t\t\t\t\t\twidthUnit: undefined,\n\t\t\t\t\t\t\tshowLabel: true,\n\t\t\t\t\t\t\tbuttonUseIcon: false,\n\t\t\t\t\t\t\tbuttonPosition: 'button-outside',\n\t\t\t\t\t\t\tisSearchFieldHidden: false,\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => ! showLabel }\n\t\t\t\t\t\tlabel={ __( 'Show label' ) }\n\t\t\t\t\t\tonDeselect={ () => {\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tshowLabel: true,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tisShownByDefault\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\tchecked={ showLabel }\n\t\t\t\t\t\t\tlabel={ __( 'Show label' ) }\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\tshowLabel: 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\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => buttonPosition !== 'button-outside' }\n\t\t\t\t\t\tlabel={ __( 'Button position' ) }\n\t\t\t\t\t\tonDeselect={ () => {\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tbuttonPosition: 'button-outside',\n\t\t\t\t\t\t\t\tisSearchFieldHidden: false,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t>\n\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\tvalue={ buttonPosition }\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Button position' ) }\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\tbuttonPosition: value,\n\t\t\t\t\t\t\t\t\tisSearchFieldHidden:\n\t\t\t\t\t\t\t\t\t\tvalue === 'button-only',\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\toptions={ buttonPositionControls }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t{ buttonPosition !== 'no-button' && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\thasValue={ () => !! buttonUseIcon }\n\t\t\t\t\t\t\tlabel={ __( 'Use button with icon' ) }\n\t\t\t\t\t\t\tonDeselect={ () => {\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tbuttonUseIcon: false,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tchecked={ buttonUseIcon }\n\t\t\t\t\t\t\t\tlabel={ __( 'Use button with icon' ) }\n\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tbuttonUseIcon: value,\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</ToolsPanelItem>\n\t\t\t\t\t) }\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => !! width }\n\t\t\t\t\t\tlabel={ __( 'Width' ) }\n\t\t\t\t\t\tonDeselect={ () => {\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\twidth: undefined,\n\t\t\t\t\t\t\t\twidthUnit: undefined,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t>\n\t\t\t\t\t\t<VStack>\n\t\t\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tlabel={ __( 'Width' ) }\n\t\t\t\t\t\t\t\tid={ unitControlInputId } // Unused, kept for backwards compatibility\n\t\t\t\t\t\t\t\tmin={\n\t\t\t\t\t\t\t\t\tisPercentageUnit( widthUnit )\n\t\t\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t\t\t: MIN_WIDTH\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tmax={\n\t\t\t\t\t\t\t\t\tisPercentageUnit( widthUnit )\n\t\t\t\t\t\t\t\t\t\t? 100\n\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tstep={ 1 }\n\t\t\t\t\t\t\t\tonChange={ ( newWidth ) => {\n\t\t\t\t\t\t\t\t\tconst parsedNewWidth =\n\t\t\t\t\t\t\t\t\t\tnewWidth === ''\n\t\t\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t\t\t: parseInt( newWidth, 10 );\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\twidth: parsedNewWidth,\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\tonUnitChange={ ( newUnit ) => {\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\twidth:\n\t\t\t\t\t\t\t\t\t\t\t'%' === newUnit\n\t\t\t\t\t\t\t\t\t\t\t\t? PC_WIDTH_DEFAULT\n\t\t\t\t\t\t\t\t\t\t\t\t: PX_WIDTH_DEFAULT,\n\t\t\t\t\t\t\t\t\t\twidthUnit: newUnit,\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\t__unstableInputWidth=\"80px\"\n\t\t\t\t\t\t\t\tvalue={ `${ width }${ widthUnit }` }\n\t\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<ToggleGroupControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Percentage Width' ) }\n\t\t\t\t\t\t\t\tvalue={\n\t\t\t\t\t\t\t\t\tPERCENTAGE_WIDTHS.includes( width ) &&\n\t\t\t\t\t\t\t\t\twidthUnit === '%'\n\t\t\t\t\t\t\t\t\t\t? width\n\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\t\tonChange={ ( newWidth ) => {\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\twidth: newWidth,\n\t\t\t\t\t\t\t\t\t\twidthUnit: '%',\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\tisBlock\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ PERCENTAGE_WIDTHS.map( ( widthValue ) => {\n\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\t\t\t\t\tkey={ widthValue }\n\t\t\t\t\t\t\t\t\t\t\tvalue={ widthValue }\n\t\t\t\t\t\t\t\t\t\t\tlabel={ sprintf(\n\t\t\t\t\t\t\t\t\t\t\t\t/* translators: %d: Percentage value. */\n\t\t\t\t\t\t\t\t\t\t\t\t__( '%d%%' ),\n\t\t\t\t\t\t\t\t\t\t\t\twidthValue\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t/>\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</ToggleGroupControl>\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t</ToolsPanel>\n\t\t\t</InspectorControls>\n\t\t</>\n\t);\n\n\tconst isNonZeroBorderRadius = ( radius ) =>\n\t\tradius !== undefined && parseInt( radius, 10 ) !== 0;\n\n\tconst padBorderRadius = ( radius ) =>\n\t\tisNonZeroBorderRadius( radius )\n\t\t\t? `calc(${ radius } + ${ DEFAULT_INNER_PADDING })`\n\t\t\t: undefined;\n\n\tconst getWrapperStyles = () => {\n\t\tconst styles = isButtonPositionInside\n\t\t\t? borderProps.style\n\t\t\t: {\n\t\t\t\t\tborderRadius: borderProps.style?.borderRadius,\n\t\t\t\t\tborderTopLeftRadius: borderProps.style?.borderTopLeftRadius,\n\t\t\t\t\tborderTopRightRadius:\n\t\t\t\t\t\tborderProps.style?.borderTopRightRadius,\n\t\t\t\t\tborderBottomLeftRadius:\n\t\t\t\t\t\tborderProps.style?.borderBottomLeftRadius,\n\t\t\t\t\tborderBottomRightRadius:\n\t\t\t\t\t\tborderProps.style?.borderBottomRightRadius,\n\t\t\t };\n\n\t\tif ( isButtonPositionInside ) {\n\t\t\t// We have button inside wrapper and a border radius value to apply.\n\t\t\t// Add default padding so we don't get \"fat\" corners.\n\t\t\t//\n\t\t\t// CSS calc() is used here to support non-pixel units. The inline\n\t\t\t// style using calc() will only apply if both values have units.\n\n\t\t\tif ( typeof borderRadius === 'object' ) {\n\t\t\t\t// Individual corner border radii present.\n\t\t\t\tconst {\n\t\t\t\t\tborderTopLeftRadius,\n\t\t\t\t\tborderTopRightRadius,\n\t\t\t\t\tborderBottomLeftRadius,\n\t\t\t\t\tborderBottomRightRadius,\n\t\t\t\t} = borderProps.style;\n\n\t\t\t\treturn {\n\t\t\t\t\t...styles,\n\t\t\t\t\tborderTopLeftRadius: padBorderRadius( borderTopLeftRadius ),\n\t\t\t\t\tborderTopRightRadius:\n\t\t\t\t\t\tpadBorderRadius( borderTopRightRadius ),\n\t\t\t\t\tborderBottomLeftRadius: padBorderRadius(\n\t\t\t\t\t\tborderBottomLeftRadius\n\t\t\t\t\t),\n\t\t\t\t\tborderBottomRightRadius: padBorderRadius(\n\t\t\t\t\t\tborderBottomRightRadius\n\t\t\t\t\t),\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t// The inline style using calc() will only apply if both values\n\t\t\t// supplied to calc() have units. Deprecated block's may have\n\t\t\t// unitless integer.\n\t\t\tconst radius = Number.isInteger( borderRadius )\n\t\t\t\t? `${ borderRadius }px`\n\t\t\t\t: borderRadius;\n\n\t\t\tstyles.borderRadius = `calc(${ radius } + ${ DEFAULT_INNER_PADDING })`;\n\t\t}\n\n\t\treturn styles;\n\t};\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: getBlockClassNames(),\n\t\tstyle: {\n\t\t\t...typographyProps.style,\n\t\t\t// Input opts out of text decoration.\n\t\t\ttextDecoration: undefined,\n\t\t},\n\t} );\n\n\tconst labelClassnames = clsx(\n\t\t'wp-block-search__label',\n\t\ttypographyProps.className\n\t);\n\n\treturn (\n\t\t<div { ...blockProps }>\n\t\t\t{ controls }\n\n\t\t\t{ showLabel && (\n\t\t\t\t<RichText\n\t\t\t\t\tidentifier=\"label\"\n\t\t\t\t\tclassName={ labelClassnames }\n\t\t\t\t\taria-label={ __( 'Label text' ) }\n\t\t\t\t\tplaceholder={ __( 'Add label…' ) }\n\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\tvalue={ label }\n\t\t\t\t\tonChange={ ( html ) => setAttributes( { label: html } ) }\n\t\t\t\t\tstyle={ typographyProps.style }\n\t\t\t\t/>\n\t\t\t) }\n\n\t\t\t<ResizableBox\n\t\t\t\tsize={ {\n\t\t\t\t\twidth:\n\t\t\t\t\t\twidth === undefined\n\t\t\t\t\t\t\t? 'auto'\n\t\t\t\t\t\t\t: `${ width }${ widthUnit }`,\n\t\t\t\t\theight: 'auto',\n\t\t\t\t} }\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\t'wp-block-search__inside-wrapper',\n\t\t\t\t\tisButtonPositionInside ? borderProps.className : undefined\n\t\t\t\t) }\n\t\t\t\tstyle={ getWrapperStyles() }\n\t\t\t\tminWidth={ MIN_WIDTH }\n\t\t\t\tenable={ getResizableSides() }\n\t\t\t\tonResizeStart={ ( event, direction, elt ) => {\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\twidth: parseInt( elt.offsetWidth, 10 ),\n\t\t\t\t\t\twidthUnit: 'px',\n\t\t\t\t\t} );\n\t\t\t\t\ttoggleSelection( false );\n\t\t\t\t} }\n\t\t\t\tonResizeStop={ ( event, direction, elt, delta ) => {\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\twidth: parseInt( width + delta.width, 10 ),\n\t\t\t\t\t} );\n\t\t\t\t\ttoggleSelection( true );\n\t\t\t\t} }\n\t\t\t\tshowHandle={ isSelected }\n\t\t\t>\n\t\t\t\t{ ( isButtonPositionInside ||\n\t\t\t\t\tisButtonPositionOutside ||\n\t\t\t\t\thasOnlyButton ) && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ renderTextField() }\n\t\t\t\t\t\t{ renderButton() }\n\t\t\t\t\t</>\n\t\t\t\t) }\n\n\t\t\t\t{ hasNoButton && renderTextField() }\n\t\t\t</ResizableBox>\n\t\t</div>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,aAAa,EACbC,iBAAiB,EACjBC,QAAQ,EACRC,4BAA4B,IAAIC,cAAc,EAC9CC,2BAA2B,IAAIC,aAAa,EAC5CC,6BAA6B,IAAIC,kBAAkB,EACnDC,KAAK,IAAIC,gBAAgB,EACzBC,iCAAiC,EACjCC,WAAW,QACL,yBAAyB;AAChC,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,SAAS,EAAEC,MAAM,QAAQ,oBAAoB;AACtD,SACCC,aAAa,EACbC,aAAa,EACbC,YAAY,EACZC,4BAA4B,IAAIC,cAAc,EAC9CC,yBAAyB,IAAIC,WAAW,EACxCC,gCAAgC,IAAIC,kBAAkB,EACtDC,sCAAsC,IAAIC,wBAAwB,EAClEC,wBAAwB,IAAIC,UAAU,EACtCC,4BAA4B,IAAIC,cAAc,EAC9CC,oBAAoB,IAAIC,MAAM,QACxB,uBAAuB;AAC9B,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,IAAI,EAA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,EAAE;QACZ,CAAE,CAAC;QACHP,eAAe,CAAE,KAAM,CAAC;MACzB,CAAG;MACHkH,YAAY,EAAGA,CAAEtD,KAAK,EAAEmD,SAAS,EAAEC,GAAG,EAAEG,KAAK,KAAM;QAClDpH,aAAa,CAAE;UACdO,KAAK,EAAEmF,QAAQ,CAAEnF,KAAK,GAAG6G,KAAK,CAAC7G,KAAK,EAAE,EAAG;QAC1C,CAAE,CAAC;QACHN,eAAe,CAAE,IAAK,CAAC;MACxB,CAAG;MACHoH,UAAU,EAAGnH,UAAY;MAAAkE,QAAA,GAEvB,CAAElC,sBAAsB,IACzBC,uBAAuB,IACvBE,aAAa,kBACb3C,KAAA,CAAAF,SAAA;QAAA4E,QAAA,GACGjB,eAAe,CAAC,CAAC,EACjBa,YAAY,CAAC,CAAC;MAAA,CACf,CACF,EAEC5B,WAAW,IAAIe,eAAe,CAAC,CAAC;IAAA,CACrB,CAAC;EAAA,CACX,CAAC;AAER","ignoreList":[]}
|
|
@@ -146,11 +146,6 @@
|
|
|
146
146
|
transform: rotate(-45deg);
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
.accordion-content__heading {
|
|
150
|
-
margin-block-start: 0;
|
|
151
|
-
margin-block-end: 0;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
149
|
.accordion-content__toggle {
|
|
155
150
|
font-family: inherit;
|
|
156
151
|
font-size: inherit;
|
|
@@ -181,7 +176,11 @@
|
|
|
181
176
|
.is-layout-flow > .wp-block-accordion-panel,
|
|
182
177
|
.wp-block-accordion-panel {
|
|
183
178
|
overflow: hidden;
|
|
184
|
-
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.wp-block-accordion-panel[inert],
|
|
182
|
+
.wp-block-accordion-panel[aria-hidden=true] {
|
|
183
|
+
margin-block-start: 0;
|
|
185
184
|
}
|
|
186
185
|
|
|
187
186
|
.accordion-panel__wrapper {
|
|
@@ -146,11 +146,6 @@
|
|
|
146
146
|
transform: rotate(45deg);
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
.accordion-content__heading {
|
|
150
|
-
margin-block-start: 0;
|
|
151
|
-
margin-block-end: 0;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
149
|
.accordion-content__toggle {
|
|
155
150
|
font-family: inherit;
|
|
156
151
|
font-size: inherit;
|
|
@@ -181,7 +176,11 @@
|
|
|
181
176
|
.is-layout-flow > .wp-block-accordion-panel,
|
|
182
177
|
.wp-block-accordion-panel {
|
|
183
178
|
overflow: hidden;
|
|
184
|
-
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.wp-block-accordion-panel[inert],
|
|
182
|
+
.wp-block-accordion-panel[aria-hidden=true] {
|
|
183
|
+
margin-block-start: 0;
|
|
185
184
|
}
|
|
186
185
|
|
|
187
186
|
.accordion-panel__wrapper {
|
|
@@ -1994,6 +1994,20 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
|
|
|
1994
1994
|
height: auto;
|
|
1995
1995
|
}
|
|
1996
1996
|
|
|
1997
|
+
.link-ui-page-creator {
|
|
1998
|
+
max-width: 350px;
|
|
1999
|
+
min-width: auto;
|
|
2000
|
+
width: 90vw;
|
|
2001
|
+
padding-top: 8px;
|
|
2002
|
+
}
|
|
2003
|
+
.link-ui-page-creator__inner {
|
|
2004
|
+
padding: 16px;
|
|
2005
|
+
}
|
|
2006
|
+
.link-ui-page-creator__back {
|
|
2007
|
+
margin-right: 8px;
|
|
2008
|
+
text-transform: uppercase;
|
|
2009
|
+
}
|
|
2010
|
+
|
|
1997
2011
|
.wp-block-navigation-submenu {
|
|
1998
2012
|
display: block;
|
|
1999
2013
|
}
|
package/build-style/editor.css
CHANGED
|
@@ -2001,6 +2001,20 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
|
|
|
2001
2001
|
height: auto;
|
|
2002
2002
|
}
|
|
2003
2003
|
|
|
2004
|
+
.link-ui-page-creator {
|
|
2005
|
+
max-width: 350px;
|
|
2006
|
+
min-width: auto;
|
|
2007
|
+
width: 90vw;
|
|
2008
|
+
padding-top: 8px;
|
|
2009
|
+
}
|
|
2010
|
+
.link-ui-page-creator__inner {
|
|
2011
|
+
padding: 16px;
|
|
2012
|
+
}
|
|
2013
|
+
.link-ui-page-creator__back {
|
|
2014
|
+
margin-left: 8px;
|
|
2015
|
+
text-transform: uppercase;
|
|
2016
|
+
}
|
|
2017
|
+
|
|
2004
2018
|
.wp-block-navigation-submenu {
|
|
2005
2019
|
display: block;
|
|
2006
2020
|
}
|
|
@@ -165,15 +165,16 @@
|
|
|
165
165
|
width: fit-content;
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
-
.wp-block-form-input__input {
|
|
168
|
+
:where(.wp-block-form-input__input) {
|
|
169
169
|
padding: 0 0.5em;
|
|
170
170
|
font-size: 1em;
|
|
171
171
|
margin-bottom: 0.5em;
|
|
172
172
|
}
|
|
173
|
-
.wp-block-form-input__input[type=text], .wp-block-form-input__input[type=password], .wp-block-form-input__input[type=date], .wp-block-form-input__input[type=datetime], .wp-block-form-input__input[type=datetime-local], .wp-block-form-input__input[type=email], .wp-block-form-input__input[type=month], .wp-block-form-input__input[type=number], .wp-block-form-input__input[type=search], .wp-block-form-input__input[type=tel], .wp-block-form-input__input[type=time], .wp-block-form-input__input[type=url], .wp-block-form-input__input[type=week] {
|
|
173
|
+
:where(.wp-block-form-input__input)[type=text], :where(.wp-block-form-input__input)[type=password], :where(.wp-block-form-input__input)[type=date], :where(.wp-block-form-input__input)[type=datetime], :where(.wp-block-form-input__input)[type=datetime-local], :where(.wp-block-form-input__input)[type=email], :where(.wp-block-form-input__input)[type=month], :where(.wp-block-form-input__input)[type=number], :where(.wp-block-form-input__input)[type=search], :where(.wp-block-form-input__input)[type=tel], :where(.wp-block-form-input__input)[type=time], :where(.wp-block-form-input__input)[type=url], :where(.wp-block-form-input__input)[type=week] {
|
|
174
174
|
min-height: 2em;
|
|
175
175
|
line-height: 2;
|
|
176
|
-
border: 1px
|
|
176
|
+
border-width: 1px;
|
|
177
|
+
border-style: solid;
|
|
177
178
|
}
|
|
178
179
|
|
|
179
180
|
textarea.wp-block-form-input__input {
|
|
@@ -165,15 +165,16 @@
|
|
|
165
165
|
width: fit-content;
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
-
.wp-block-form-input__input {
|
|
168
|
+
:where(.wp-block-form-input__input) {
|
|
169
169
|
padding: 0 0.5em;
|
|
170
170
|
font-size: 1em;
|
|
171
171
|
margin-bottom: 0.5em;
|
|
172
172
|
}
|
|
173
|
-
.wp-block-form-input__input[type=text], .wp-block-form-input__input[type=password], .wp-block-form-input__input[type=date], .wp-block-form-input__input[type=datetime], .wp-block-form-input__input[type=datetime-local], .wp-block-form-input__input[type=email], .wp-block-form-input__input[type=month], .wp-block-form-input__input[type=number], .wp-block-form-input__input[type=search], .wp-block-form-input__input[type=tel], .wp-block-form-input__input[type=time], .wp-block-form-input__input[type=url], .wp-block-form-input__input[type=week] {
|
|
173
|
+
:where(.wp-block-form-input__input)[type=text], :where(.wp-block-form-input__input)[type=password], :where(.wp-block-form-input__input)[type=date], :where(.wp-block-form-input__input)[type=datetime], :where(.wp-block-form-input__input)[type=datetime-local], :where(.wp-block-form-input__input)[type=email], :where(.wp-block-form-input__input)[type=month], :where(.wp-block-form-input__input)[type=number], :where(.wp-block-form-input__input)[type=search], :where(.wp-block-form-input__input)[type=tel], :where(.wp-block-form-input__input)[type=time], :where(.wp-block-form-input__input)[type=url], :where(.wp-block-form-input__input)[type=week] {
|
|
174
174
|
min-height: 2em;
|
|
175
175
|
line-height: 2;
|
|
176
|
-
border: 1px
|
|
176
|
+
border-width: 1px;
|
|
177
|
+
border-style: solid;
|
|
177
178
|
}
|
|
178
179
|
|
|
179
180
|
textarea.wp-block-form-input__input {
|
|
@@ -228,4 +228,18 @@
|
|
|
228
228
|
flex-direction: column;
|
|
229
229
|
gap: 8px;
|
|
230
230
|
height: auto;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.link-ui-page-creator {
|
|
234
|
+
max-width: 350px;
|
|
235
|
+
min-width: auto;
|
|
236
|
+
width: 90vw;
|
|
237
|
+
padding-top: 8px;
|
|
238
|
+
}
|
|
239
|
+
.link-ui-page-creator__inner {
|
|
240
|
+
padding: 16px;
|
|
241
|
+
}
|
|
242
|
+
.link-ui-page-creator__back {
|
|
243
|
+
margin-right: 8px;
|
|
244
|
+
text-transform: uppercase;
|
|
231
245
|
}
|
|
@@ -228,4 +228,18 @@
|
|
|
228
228
|
flex-direction: column;
|
|
229
229
|
gap: 8px;
|
|
230
230
|
height: auto;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.link-ui-page-creator {
|
|
234
|
+
max-width: 350px;
|
|
235
|
+
min-width: auto;
|
|
236
|
+
width: 90vw;
|
|
237
|
+
padding-top: 8px;
|
|
238
|
+
}
|
|
239
|
+
.link-ui-page-creator__inner {
|
|
240
|
+
padding: 16px;
|
|
241
|
+
}
|
|
242
|
+
.link-ui-page-creator__back {
|
|
243
|
+
margin-left: 8px;
|
|
244
|
+
text-transform: uppercase;
|
|
231
245
|
}
|
|
@@ -134,14 +134,17 @@
|
|
|
134
134
|
/**
|
|
135
135
|
* Reset the WP Admin page styles for Gutenberg-like pages.
|
|
136
136
|
*/
|
|
137
|
-
:where(.wp-block-post-comments-form
|
|
138
|
-
:where(.wp-block-post-comments-form
|
|
139
|
-
border: 1px
|
|
137
|
+
:where(.wp-block-post-comments-form textarea),
|
|
138
|
+
:where(.wp-block-post-comments-form input:not([type=submit])) {
|
|
139
|
+
border-width: 1px;
|
|
140
|
+
border-style: solid;
|
|
141
|
+
border-color: #949494;
|
|
140
142
|
font-size: 1em;
|
|
141
143
|
font-family: inherit;
|
|
142
144
|
}
|
|
143
|
-
|
|
144
|
-
:where(.wp-block-post-comments-form
|
|
145
|
+
|
|
146
|
+
:where(.wp-block-post-comments-form textarea),
|
|
147
|
+
:where(.wp-block-post-comments-form input:where(:not([type=submit]):not([type=checkbox]))) {
|
|
145
148
|
padding: calc(0.667em + 2px);
|
|
146
149
|
}
|
|
147
150
|
|