@wordpress/block-library 9.0.1 → 9.0.3
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/lock-unlock.js +1 -1
- package/build/lock-unlock.js.map +1 -1
- package/build/quote/edit.js +1 -0
- package/build/quote/edit.js.map +1 -1
- package/build/social-link/edit.js +4 -18
- package/build/social-link/edit.js.map +1 -1
- package/build/utils/caption.js +2 -1
- package/build/utils/caption.js.map +1 -1
- package/build-module/lock-unlock.js +1 -1
- package/build-module/lock-unlock.js.map +1 -1
- package/build-module/quote/edit.js +1 -0
- package/build-module/quote/edit.js.map +1 -1
- package/build-module/social-link/edit.js +5 -19
- package/build-module/social-link/edit.js.map +1 -1
- package/build-module/utils/caption.js +2 -1
- package/build-module/utils/caption.js.map +1 -1
- package/build-style/common-rtl.css +1 -3
- package/build-style/common.css +1 -3
- package/build-style/search/style-rtl.css +1 -2
- package/build-style/search/style.css +1 -2
- package/build-style/style-rtl.css +2 -5
- package/build-style/style.css +2 -5
- package/package.json +15 -15
- package/src/lock-unlock.js +1 -1
- package/src/quote/edit.js +1 -0
- package/src/social-link/edit.js +0 -20
- package/src/template-part/index.php +1 -1
- package/src/utils/caption.js +5 -1
package/build/lock-unlock.js
CHANGED
|
@@ -12,7 +12,7 @@ var _privateApis = require("@wordpress/private-apis");
|
|
|
12
12
|
const {
|
|
13
13
|
lock,
|
|
14
14
|
unlock
|
|
15
|
-
} = (0, _privateApis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I
|
|
15
|
+
} = (0, _privateApis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/block-library');
|
|
16
16
|
exports.unlock = unlock;
|
|
17
17
|
exports.lock = lock;
|
|
18
18
|
//# sourceMappingURL=lock-unlock.js.map
|
package/build/lock-unlock.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_privateApis","require","lock","unlock","__dangerousOptInToUnstableAPIsOnlyForCoreModules","exports"],"sources":["@wordpress/block-library/src/lock-unlock.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I
|
|
1
|
+
{"version":3,"names":["_privateApis","require","lock","unlock","__dangerousOptInToUnstableAPIsOnlyForCoreModules","exports"],"sources":["@wordpress/block-library/src/lock-unlock.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.',\n\t\t'@wordpress/block-library'\n\t);\n"],"mappings":";;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGO,MAAM;EAAEC,IAAI;EAAEC;AAAO,CAAC,GAC5B,IAAAC,6DAAgD,EAC/C,+HAA+H,EAC/H,0BACD,CAAC;AAACC,OAAA,CAAAF,MAAA,GAAAA,MAAA;AAAAE,OAAA,CAAAH,IAAA,GAAAA,IAAA","ignoreList":[]}
|
package/build/quote/edit.js
CHANGED
|
@@ -122,6 +122,7 @@ function QuoteEdit({
|
|
|
122
122
|
(0, _i18n.__)('Add citation'),
|
|
123
123
|
addLabel: (0, _i18n.__)('Add citation'),
|
|
124
124
|
removeLabel: (0, _i18n.__)('Remove citation'),
|
|
125
|
+
excludeElementClassName: true,
|
|
125
126
|
className: "wp-block-quote__citation",
|
|
126
127
|
insertBlocksAfter: insertBlocksAfter,
|
|
127
128
|
...(!isWebPlatform ? {
|
package/build/quote/edit.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_blockEditor","_components","_data","_element","_deprecated","_icons","_deprecated2","_caption","_jsxRuntime","isWebPlatform","Platform","OS","TEMPLATE","useMigrateOnLoad","attributes","clientId","registry","useRegistry","updateBlockAttributes","replaceInnerBlocks","useDispatch","blockEditorStore","useEffect","value","newAttributes","newInnerBlocks","migrateToQuoteV2","deprecated","since","version","alternative","batch","QuoteEdit","setAttributes","insertBlocksAfter","className","style","isSelected","textAlign","blockProps","useBlockProps","clsx","innerBlocksProps","useInnerBlocksProps","template","templateInsertUpdatesSelection","__experimentalCaptureToolbars","renderAppender","jsxs","Fragment","children","jsx","BlockControls","group","AlignmentControl","onChange","nextAlign","BlockQuotation","Caption","attributeKey","tagName","display","__unstableMobileNoFocusOnMount","icon","verse","label","__","placeholder","addLabel","removeLabel"],"sources":["@wordpress/block-library/src/quote/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { BlockQuotation } from '@wordpress/components';\nimport { useDispatch, useRegistry } from '@wordpress/data';\nimport { Platform, useEffect } from '@wordpress/element';\nimport deprecated from '@wordpress/deprecated';\nimport { verse } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { migrateToQuoteV2 } from './deprecated';\nimport { Caption } from '../utils/caption';\n\nconst isWebPlatform = Platform.OS === 'web';\n\nconst TEMPLATE = [ [ 'core/paragraph', {} ] ];\n\n/**\n * At the moment, deprecations don't handle create blocks from attributes\n * (like when using CPT templates). For this reason, this hook is necessary\n * to avoid breaking templates using the old quote block format.\n *\n * @param {Object} attributes Block attributes.\n * @param {string} clientId Block client ID.\n */\nconst useMigrateOnLoad = ( attributes, clientId ) => {\n\tconst registry = useRegistry();\n\tconst { updateBlockAttributes, replaceInnerBlocks } =\n\t\tuseDispatch( blockEditorStore );\n\tuseEffect( () => {\n\t\t// As soon as the block is loaded, migrate it to the new version.\n\n\t\tif ( ! attributes.value ) {\n\t\t\t// No need to migrate if it doesn't have the value attribute.\n\t\t\treturn;\n\t\t}\n\n\t\tconst [ newAttributes, newInnerBlocks ] =\n\t\t\tmigrateToQuoteV2( attributes );\n\n\t\tdeprecated( 'Value attribute on the quote block', {\n\t\t\tsince: '6.0',\n\t\t\tversion: '6.5',\n\t\t\talternative: 'inner blocks',\n\t\t} );\n\n\t\tregistry.batch( () => {\n\t\t\tupdateBlockAttributes( clientId, newAttributes );\n\t\t\treplaceInnerBlocks( clientId, newInnerBlocks );\n\t\t} );\n\t}, [ attributes.value ] );\n};\n\nexport default function QuoteEdit( {\n\tattributes,\n\tsetAttributes,\n\tinsertBlocksAfter,\n\tclientId,\n\tclassName,\n\tstyle,\n\tisSelected,\n} ) {\n\tconst { textAlign } = attributes;\n\n\tuseMigrateOnLoad( attributes, clientId );\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( className, {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t\t...( ! isWebPlatform && { style } ),\n\t} );\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\ttemplate: TEMPLATE,\n\t\ttemplateInsertUpdatesSelection: true,\n\t\t__experimentalCaptureToolbars: true,\n\t\trenderAppender: false,\n\t} );\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t<AlignmentControl\n\t\t\t\t\tvalue={ textAlign }\n\t\t\t\t\tonChange={ ( nextAlign ) => {\n\t\t\t\t\t\tsetAttributes( { textAlign: nextAlign } );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t\t<BlockQuotation { ...innerBlocksProps }>\n\t\t\t\t{ innerBlocksProps.children }\n\t\t\t\t<Caption\n\t\t\t\t\tattributeKey=\"citation\"\n\t\t\t\t\ttagName={ isWebPlatform ? 'cite' : 'p' }\n\t\t\t\t\tstyle={ isWebPlatform && { display: 'block' } }\n\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t__unstableMobileNoFocusOnMount\n\t\t\t\t\ticon={ verse }\n\t\t\t\t\tlabel={ __( 'Quote citation' ) }\n\t\t\t\t\tplaceholder={\n\t\t\t\t\t\t// translators: placeholder text used for the\n\t\t\t\t\t\t// citation\n\t\t\t\t\t\t__( 'Add citation' )\n\t\t\t\t\t}\n\t\t\t\t\taddLabel={ __( 'Add citation' ) }\n\t\t\t\t\tremoveLabel={ __( 'Remove citation' ) }\n\t\t\t\t\tclassName=\"wp-block-quote__citation\"\n\t\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\t\t{ ...( ! isWebPlatform ? { textAlign } : {} ) }\n\t\t\t\t/>\n\t\t\t</BlockQuotation>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAOA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AAKA,IAAAQ,YAAA,GAAAR,OAAA;AACA,IAAAS,QAAA,GAAAT,OAAA;AAA2C,IAAAU,WAAA,GAAAV,OAAA;AA1B3C;AACA;AACA;;AAGA;AACA;AACA;;AAeA;AACA;AACA;;AAIA,MAAMW,aAAa,GAAGC,iBAAQ,CAACC,EAAE,KAAK,KAAK;AAE3C,MAAMC,QAAQ,GAAG,CAAE,CAAE,gBAAgB,EAAE,CAAC,CAAC,CAAE,CAAE;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MA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|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_blockEditor","_components","_data","_element","_deprecated","_icons","_deprecated2","_caption","_jsxRuntime","isWebPlatform","Platform","OS","TEMPLATE","useMigrateOnLoad","attributes","clientId","registry","useRegistry","updateBlockAttributes","replaceInnerBlocks","useDispatch","blockEditorStore","useEffect","value","newAttributes","newInnerBlocks","migrateToQuoteV2","deprecated","since","version","alternative","batch","QuoteEdit","setAttributes","insertBlocksAfter","className","style","isSelected","textAlign","blockProps","useBlockProps","clsx","innerBlocksProps","useInnerBlocksProps","template","templateInsertUpdatesSelection","__experimentalCaptureToolbars","renderAppender","jsxs","Fragment","children","jsx","BlockControls","group","AlignmentControl","onChange","nextAlign","BlockQuotation","Caption","attributeKey","tagName","display","__unstableMobileNoFocusOnMount","icon","verse","label","__","placeholder","addLabel","removeLabel","excludeElementClassName"],"sources":["@wordpress/block-library/src/quote/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { BlockQuotation } from '@wordpress/components';\nimport { useDispatch, useRegistry } from '@wordpress/data';\nimport { Platform, useEffect } from '@wordpress/element';\nimport deprecated from '@wordpress/deprecated';\nimport { verse } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { migrateToQuoteV2 } from './deprecated';\nimport { Caption } from '../utils/caption';\n\nconst isWebPlatform = Platform.OS === 'web';\n\nconst TEMPLATE = [ [ 'core/paragraph', {} ] ];\n\n/**\n * At the moment, deprecations don't handle create blocks from attributes\n * (like when using CPT templates). For this reason, this hook is necessary\n * to avoid breaking templates using the old quote block format.\n *\n * @param {Object} attributes Block attributes.\n * @param {string} clientId Block client ID.\n */\nconst useMigrateOnLoad = ( attributes, clientId ) => {\n\tconst registry = useRegistry();\n\tconst { updateBlockAttributes, replaceInnerBlocks } =\n\t\tuseDispatch( blockEditorStore );\n\tuseEffect( () => {\n\t\t// As soon as the block is loaded, migrate it to the new version.\n\n\t\tif ( ! attributes.value ) {\n\t\t\t// No need to migrate if it doesn't have the value attribute.\n\t\t\treturn;\n\t\t}\n\n\t\tconst [ newAttributes, newInnerBlocks ] =\n\t\t\tmigrateToQuoteV2( attributes );\n\n\t\tdeprecated( 'Value attribute on the quote block', {\n\t\t\tsince: '6.0',\n\t\t\tversion: '6.5',\n\t\t\talternative: 'inner blocks',\n\t\t} );\n\n\t\tregistry.batch( () => {\n\t\t\tupdateBlockAttributes( clientId, newAttributes );\n\t\t\treplaceInnerBlocks( clientId, newInnerBlocks );\n\t\t} );\n\t}, [ attributes.value ] );\n};\n\nexport default function QuoteEdit( {\n\tattributes,\n\tsetAttributes,\n\tinsertBlocksAfter,\n\tclientId,\n\tclassName,\n\tstyle,\n\tisSelected,\n} ) {\n\tconst { textAlign } = attributes;\n\n\tuseMigrateOnLoad( attributes, clientId );\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( className, {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t\t...( ! isWebPlatform && { style } ),\n\t} );\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\ttemplate: TEMPLATE,\n\t\ttemplateInsertUpdatesSelection: true,\n\t\t__experimentalCaptureToolbars: true,\n\t\trenderAppender: false,\n\t} );\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t<AlignmentControl\n\t\t\t\t\tvalue={ textAlign }\n\t\t\t\t\tonChange={ ( nextAlign ) => {\n\t\t\t\t\t\tsetAttributes( { textAlign: nextAlign } );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t\t<BlockQuotation { ...innerBlocksProps }>\n\t\t\t\t{ innerBlocksProps.children }\n\t\t\t\t<Caption\n\t\t\t\t\tattributeKey=\"citation\"\n\t\t\t\t\ttagName={ isWebPlatform ? 'cite' : 'p' }\n\t\t\t\t\tstyle={ isWebPlatform && { display: 'block' } }\n\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t__unstableMobileNoFocusOnMount\n\t\t\t\t\ticon={ verse }\n\t\t\t\t\tlabel={ __( 'Quote citation' ) }\n\t\t\t\t\tplaceholder={\n\t\t\t\t\t\t// translators: placeholder text used for the\n\t\t\t\t\t\t// citation\n\t\t\t\t\t\t__( 'Add citation' )\n\t\t\t\t\t}\n\t\t\t\t\taddLabel={ __( 'Add citation' ) }\n\t\t\t\t\tremoveLabel={ __( 'Remove citation' ) }\n\t\t\t\t\texcludeElementClassName\n\t\t\t\t\tclassName=\"wp-block-quote__citation\"\n\t\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\t\t{ ...( ! isWebPlatform ? { textAlign } : {} ) }\n\t\t\t\t/>\n\t\t\t</BlockQuotation>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAOA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AAKA,IAAAQ,YAAA,GAAAR,OAAA;AACA,IAAAS,QAAA,GAAAT,OAAA;AAA2C,IAAAU,WAAA,GAAAV,OAAA;AA1B3C;AACA;AACA;;AAGA;AACA;AACA;;AAeA;AACA;AACA;;AAIA,MAAMW,aAAa,GAAGC,iBAAQ,CAACC,EAAE,KAAK,KAAK;AAE3C,MAAMC,QAAQ,GAAG,CAAE,CAAE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AG,IAAAF,QAAE,EAAE,cAAe,CAAG;QACjCG,WAAW,EAAG,IAAAH,QAAE,EAAE,iBAAkB,CAAG;QACvCI,uBAAuB;QACvBnC,SAAS,EAAC,0BAA0B;QACpCD,iBAAiB,EAAGA,iBAAmB;QAAA,IAChC,CAAEzB,aAAa,GAAG;UAAE6B;QAAU,CAAC,GAAG,CAAC,CAAC;MAAA,CAC3C,CAAC;IAAA,CACa,CAAC;EAAA,CAChB,CAAC;AAEL","ignoreList":[]}
|
|
@@ -6,8 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
9
|
-
var _keycodes = require("@wordpress/keycodes");
|
|
10
|
-
var _data = require("@wordpress/data");
|
|
11
9
|
var _blockEditor = require("@wordpress/block-editor");
|
|
12
10
|
var _element = require("@wordpress/element");
|
|
13
11
|
var _components = require("@wordpress/components");
|
|
@@ -31,12 +29,8 @@ const SocialLinkURLPopover = ({
|
|
|
31
29
|
url,
|
|
32
30
|
setAttributes,
|
|
33
31
|
setPopover,
|
|
34
|
-
popoverAnchor
|
|
35
|
-
clientId
|
|
32
|
+
popoverAnchor
|
|
36
33
|
}) => {
|
|
37
|
-
const {
|
|
38
|
-
removeBlock
|
|
39
|
-
} = (0, _data.useDispatch)(_blockEditor.store);
|
|
40
34
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.URLPopover, {
|
|
41
35
|
anchor: popoverAnchor,
|
|
42
36
|
onClose: () => setPopover(false),
|
|
@@ -57,13 +51,7 @@ const SocialLinkURLPopover = ({
|
|
|
57
51
|
placeholder: (0, _i18n.__)('Enter social link'),
|
|
58
52
|
label: (0, _i18n.__)('Enter social link'),
|
|
59
53
|
hideLabelFromVision: true,
|
|
60
|
-
disableSuggestions: true
|
|
61
|
-
onKeyDown: event => {
|
|
62
|
-
if (!!url || event.defaultPrevented || ![_keycodes.BACKSPACE, _keycodes.DELETE].includes(event.keyCode)) {
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
removeBlock(clientId);
|
|
66
|
-
}
|
|
54
|
+
disableSuggestions: true
|
|
67
55
|
})
|
|
68
56
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
69
57
|
icon: _icons.keyboardReturn,
|
|
@@ -77,8 +65,7 @@ const SocialLinkEdit = ({
|
|
|
77
65
|
attributes,
|
|
78
66
|
context,
|
|
79
67
|
isSelected,
|
|
80
|
-
setAttributes
|
|
81
|
-
clientId
|
|
68
|
+
setAttributes
|
|
82
69
|
}) => {
|
|
83
70
|
const {
|
|
84
71
|
url,
|
|
@@ -160,8 +147,7 @@ const SocialLinkEdit = ({
|
|
|
160
147
|
url: url,
|
|
161
148
|
setAttributes: setAttributes,
|
|
162
149
|
setPopover: setPopover,
|
|
163
|
-
popoverAnchor: popoverAnchor
|
|
164
|
-
clientId: clientId
|
|
150
|
+
popoverAnchor: popoverAnchor
|
|
165
151
|
})]
|
|
166
152
|
})]
|
|
167
153
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_keycodes","_data","_blockEditor","_element","_components","_i18n","_icons","_socialList","_jsxRuntime","SocialLinkURLPopover","url","setAttributes","setPopover","popoverAnchor","clientId","removeBlock","useDispatch","blockEditorStore","jsx","URLPopover","anchor","onClose","children","jsxs","className","onSubmit","event","preventDefault","URLInput","__nextHasNoMarginBottom","value","onChange","nextURL","placeholder","__","label","hideLabelFromVision","disableSuggestions","onKeyDown","defaultPrevented","BACKSPACE","DELETE","includes","keyCode","Button","icon","keyboardReturn","type","SocialLinkEdit","attributes","context","isSelected","service","rel","showLabels","iconColor","iconColorValue","iconBackgroundColor","iconBackgroundColorValue","showURLPopover","useState","classes","clsx","setPopoverAnchor","IconComponent","getIconBySite","socialLinkName","getNameBySite","socialLinkText","trim","blockProps","useBlockProps","style","color","backgroundColor","Fragment","InspectorControls","PanelBody","title","PanelRow","TextControl","help","group","ref","onClick","_default","exports","default"],"sources":["@wordpress/block-library/src/social-link/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { DELETE, BACKSPACE } from '@wordpress/keycodes';\nimport { useDispatch } from '@wordpress/data';\n\nimport {\n\tInspectorControls,\n\tURLPopover,\n\tURLInput,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useState } from '@wordpress/element';\nimport {\n\tButton,\n\tPanelBody,\n\tPanelRow,\n\tTextControl,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { keyboardReturn } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { getIconBySite, getNameBySite } from './social-list';\n\nconst SocialLinkURLPopover = ( {\n\turl,\n\tsetAttributes,\n\tsetPopover,\n\tpopoverAnchor,\n\tclientId,\n} ) => {\n\tconst { removeBlock } = useDispatch( blockEditorStore );\n\treturn (\n\t\t<URLPopover\n\t\t\tanchor={ popoverAnchor }\n\t\t\tonClose={ () => setPopover( false ) }\n\t\t>\n\t\t\t<form\n\t\t\t\tclassName=\"block-editor-url-popover__link-editor\"\n\t\t\t\tonSubmit={ ( event ) => {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tsetPopover( false );\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<div className=\"block-editor-url-input\">\n\t\t\t\t\t<URLInput\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tvalue={ url }\n\t\t\t\t\t\tonChange={ ( nextURL ) =>\n\t\t\t\t\t\t\tsetAttributes( { url: nextURL } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tplaceholder={ __( 'Enter social link' ) }\n\t\t\t\t\t\tlabel={ __( 'Enter social link' ) }\n\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\tdisableSuggestions\n\t\t\t\t\t\tonKeyDown={ ( event ) => {\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t!! url ||\n\t\t\t\t\t\t\t\tevent.defaultPrevented ||\n\t\t\t\t\t\t\t\t! [ BACKSPACE, DELETE ].includes(\n\t\t\t\t\t\t\t\t\tevent.keyCode\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tremoveBlock( clientId );\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t<Button\n\t\t\t\t\ticon={ keyboardReturn }\n\t\t\t\t\tlabel={ __( 'Apply' ) }\n\t\t\t\t\ttype=\"submit\"\n\t\t\t\t/>\n\t\t\t</form>\n\t\t</URLPopover>\n\t);\n};\n\nconst SocialLinkEdit = ( {\n\tattributes,\n\tcontext,\n\tisSelected,\n\tsetAttributes,\n\tclientId,\n} ) => {\n\tconst { url, service, label = '', rel } = attributes;\n\tconst {\n\t\tshowLabels,\n\t\ticonColor,\n\t\ticonColorValue,\n\t\ticonBackgroundColor,\n\t\ticonBackgroundColorValue,\n\t} = context;\n\tconst [ showURLPopover, setPopover ] = useState( false );\n\tconst classes = clsx( 'wp-social-link', 'wp-social-link-' + service, {\n\t\t'wp-social-link__is-incomplete': ! url,\n\t\t[ `has-${ iconColor }-color` ]: iconColor,\n\t\t[ `has-${ iconBackgroundColor }-background-color` ]:\n\t\t\ticonBackgroundColor,\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 IconComponent = getIconBySite( service );\n\tconst socialLinkName = getNameBySite( service );\n\t// The initial label (ie. the link text) is an empty string.\n\t// We want to prevent empty links so that the link text always fallbacks to\n\t// the social name, even when users enter and save an empty string or only\n\t// spaces. The PHP render callback fallbacks to the social name as well.\n\tconst socialLinkText = label.trim() === '' ? socialLinkName : label;\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classes,\n\t\tstyle: {\n\t\t\tcolor: iconColorValue,\n\t\t\tbackgroundColor: iconBackgroundColorValue,\n\t\t},\n\t} );\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t<PanelRow>\n\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Link text' ) }\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'The link text is visible when enabled from the parent Social Icons block.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tvalue={ label }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { label: value } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tplaceholder={ socialLinkName }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</PanelRow>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t<TextControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Link rel' ) }\n\t\t\t\t\tvalue={ rel || '' }\n\t\t\t\t\tonChange={ ( value ) => setAttributes( { rel: value } ) }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t<li { ...blockProps }>\n\t\t\t\t<button\n\t\t\t\t\tclassName=\"wp-block-social-link-anchor\"\n\t\t\t\t\tref={ setPopoverAnchor }\n\t\t\t\t\tonClick={ () => setPopover( true ) }\n\t\t\t\t>\n\t\t\t\t\t<IconComponent />\n\t\t\t\t\t<span\n\t\t\t\t\t\tclassName={ clsx( 'wp-block-social-link-label', {\n\t\t\t\t\t\t\t'screen-reader-text': ! showLabels,\n\t\t\t\t\t\t} ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ socialLinkText }\n\t\t\t\t\t</span>\n\t\t\t\t</button>\n\t\t\t\t{ isSelected && showURLPopover && (\n\t\t\t\t\t<SocialLinkURLPopover\n\t\t\t\t\t\turl={ url }\n\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\tsetPopover={ setPopover }\n\t\t\t\t\t\tpopoverAnchor={ popoverAnchor }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</li>\n\t\t</>\n\t);\n};\n\nexport default SocialLinkEdit;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAEA,IAAAG,YAAA,GAAAH,OAAA;AAOA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AAMA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AAKA,IAAAQ,WAAA,GAAAR,OAAA;AAA6D,IAAAS,WAAA,GAAAT,OAAA;AA/B7D;AACA;AACA;;AAGA;AACA;AACA;;AAqBA;AACA;AACA;;AAGA,MAAMU,oBAAoB,GAAGA,CAAE;EAC9BC,GAAG;EACHC,aAAa;EACbC,UAAU;EACVC,aAAa;EACbC;AACD,CAAC,KAAM;EACN,MAAM;IAAEC;EAAY,CAAC,GAAG,IAAAC,iBAAW,EAAEC,kBAAiB,CAAC;EACvD,oBACC,IAAAT,WAAA,CAAAU,GAAA,EAAChB,YAAA,CAAAiB,UAAU;IACVC,MAAM,EAAGP,aAAe;IACxBQ,OAAO,EAAGA,CAAA,KAAMT,UAAU,CAAE,KAAM,CAAG;IAAAU,QAAA,eAErC,IAAAd,WAAA,CAAAe,IAAA;MACCC,SAAS,EAAC,uCAAuC;MACjDC,QAAQ,EAAKC,KAAK,IAAM;QACvBA,KAAK,CAACC,cAAc,CAAC,CAAC;QACtBf,UAAU,CAAE,KAAM,CAAC;MACpB,C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GAAG,EAAGA,GAAK;QACXC,aAAa,EAAGA,aAAe;QAC/BC,UAAU,EAAGA,UAAY;QACzBC,aAAa,EAAGA,aAAe;QAC/BC,QAAQ,EAAGA;MAAU,CACrB,CACD;IAAA,CACE,CAAC;EAAA,CACJ,CAAC;AAEL,CAAC;AAAC,IAAAuE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEavC,cAAc","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_blockEditor","_element","_components","_i18n","_icons","_socialList","_jsxRuntime","SocialLinkURLPopover","url","setAttributes","setPopover","popoverAnchor","jsx","URLPopover","anchor","onClose","children","jsxs","className","onSubmit","event","preventDefault","URLInput","__nextHasNoMarginBottom","value","onChange","nextURL","placeholder","__","label","hideLabelFromVision","disableSuggestions","Button","icon","keyboardReturn","type","SocialLinkEdit","attributes","context","isSelected","service","rel","showLabels","iconColor","iconColorValue","iconBackgroundColor","iconBackgroundColorValue","showURLPopover","useState","classes","clsx","setPopoverAnchor","IconComponent","getIconBySite","socialLinkName","getNameBySite","socialLinkText","trim","blockProps","useBlockProps","style","color","backgroundColor","Fragment","InspectorControls","PanelBody","title","PanelRow","TextControl","help","group","ref","onClick","_default","exports","default"],"sources":["@wordpress/block-library/src/social-link/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tInspectorControls,\n\tURLPopover,\n\tURLInput,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport { useState } from '@wordpress/element';\nimport {\n\tButton,\n\tPanelBody,\n\tPanelRow,\n\tTextControl,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { keyboardReturn } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { getIconBySite, getNameBySite } from './social-list';\n\nconst SocialLinkURLPopover = ( {\n\turl,\n\tsetAttributes,\n\tsetPopover,\n\tpopoverAnchor,\n} ) => {\n\treturn (\n\t\t<URLPopover\n\t\t\tanchor={ popoverAnchor }\n\t\t\tonClose={ () => setPopover( false ) }\n\t\t>\n\t\t\t<form\n\t\t\t\tclassName=\"block-editor-url-popover__link-editor\"\n\t\t\t\tonSubmit={ ( event ) => {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tsetPopover( false );\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<div className=\"block-editor-url-input\">\n\t\t\t\t\t<URLInput\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tvalue={ url }\n\t\t\t\t\t\tonChange={ ( nextURL ) =>\n\t\t\t\t\t\t\tsetAttributes( { url: nextURL } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tplaceholder={ __( 'Enter social link' ) }\n\t\t\t\t\t\tlabel={ __( 'Enter social link' ) }\n\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\tdisableSuggestions\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t<Button\n\t\t\t\t\ticon={ keyboardReturn }\n\t\t\t\t\tlabel={ __( 'Apply' ) }\n\t\t\t\t\ttype=\"submit\"\n\t\t\t\t/>\n\t\t\t</form>\n\t\t</URLPopover>\n\t);\n};\n\nconst SocialLinkEdit = ( {\n\tattributes,\n\tcontext,\n\tisSelected,\n\tsetAttributes,\n} ) => {\n\tconst { url, service, label = '', rel } = attributes;\n\tconst {\n\t\tshowLabels,\n\t\ticonColor,\n\t\ticonColorValue,\n\t\ticonBackgroundColor,\n\t\ticonBackgroundColorValue,\n\t} = context;\n\tconst [ showURLPopover, setPopover ] = useState( false );\n\tconst classes = clsx( 'wp-social-link', 'wp-social-link-' + service, {\n\t\t'wp-social-link__is-incomplete': ! url,\n\t\t[ `has-${ iconColor }-color` ]: iconColor,\n\t\t[ `has-${ iconBackgroundColor }-background-color` ]:\n\t\t\ticonBackgroundColor,\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 IconComponent = getIconBySite( service );\n\tconst socialLinkName = getNameBySite( service );\n\t// The initial label (ie. the link text) is an empty string.\n\t// We want to prevent empty links so that the link text always fallbacks to\n\t// the social name, even when users enter and save an empty string or only\n\t// spaces. The PHP render callback fallbacks to the social name as well.\n\tconst socialLinkText = label.trim() === '' ? socialLinkName : label;\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classes,\n\t\tstyle: {\n\t\t\tcolor: iconColorValue,\n\t\t\tbackgroundColor: iconBackgroundColorValue,\n\t\t},\n\t} );\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t<PanelRow>\n\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Link text' ) }\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'The link text is visible when enabled from the parent Social Icons block.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tvalue={ label }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { label: value } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tplaceholder={ socialLinkName }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</PanelRow>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t<TextControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Link rel' ) }\n\t\t\t\t\tvalue={ rel || '' }\n\t\t\t\t\tonChange={ ( value ) => setAttributes( { rel: value } ) }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t<li { ...blockProps }>\n\t\t\t\t<button\n\t\t\t\t\tclassName=\"wp-block-social-link-anchor\"\n\t\t\t\t\tref={ setPopoverAnchor }\n\t\t\t\t\tonClick={ () => setPopover( true ) }\n\t\t\t\t>\n\t\t\t\t\t<IconComponent />\n\t\t\t\t\t<span\n\t\t\t\t\t\tclassName={ clsx( 'wp-block-social-link-label', {\n\t\t\t\t\t\t\t'screen-reader-text': ! showLabels,\n\t\t\t\t\t\t} ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ socialLinkText }\n\t\t\t\t\t</span>\n\t\t\t\t</button>\n\t\t\t\t{ isSelected && showURLPopover && (\n\t\t\t\t\t<SocialLinkURLPopover\n\t\t\t\t\t\turl={ url }\n\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\tsetPopover={ setPopover }\n\t\t\t\t\t\tpopoverAnchor={ popoverAnchor }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</li>\n\t\t</>\n\t);\n};\n\nexport default SocialLinkEdit;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,YAAA,GAAAD,OAAA;AAMA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAMA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAKA,IAAAM,WAAA,GAAAN,OAAA;AAA6D,IAAAO,WAAA,GAAAP,OAAA;AA3B7D;AACA;AACA;;AAGA;AACA;AACA;;AAiBA;AACA;AACA;;AAGA,MAAMQ,oBAAoB,GAAGA,CAAE;EAC9BC,GAAG;EACHC,aAAa;EACbC,UAAU;EACVC;AACD,CAAC,KAAM;EACN,oBACC,IAAAL,WAAA,CAAAM,GAAA,EAACZ,YAAA,CAAAa,UAAU;IACVC,MAAM,EAAGH,aAAe;IACxBI,OAAO,EAAGA,CAAA,KAAML,UAAU,CAAE,KAAM,CAAG;IAAAM,QAAA,eAErC,IAAAV,WAAA,CAAAW,IAAA;MACCC,SAAS,EAAC,uCAAuC;MACjDC,QAAQ,EAAKC,KAAK,IAAM;QACvBA,KAAK,CAAC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OAAA,GAEavC,cAAc","ignoreList":[]}
|
package/build/utils/caption.js
CHANGED
|
@@ -36,6 +36,7 @@ function Caption({
|
|
|
36
36
|
placeholder = (0, _i18n.__)('Add caption'),
|
|
37
37
|
label = (0, _i18n.__)('Caption text'),
|
|
38
38
|
showToolbarButton = true,
|
|
39
|
+
excludeElementClassName,
|
|
39
40
|
className,
|
|
40
41
|
readOnly,
|
|
41
42
|
tagName = 'figcaption',
|
|
@@ -91,7 +92,7 @@ function Caption({
|
|
|
91
92
|
}), showCaption && (!RichText.isEmpty(caption) || isSelected) && /*#__PURE__*/(0, _jsxRuntime.jsx)(RichText, {
|
|
92
93
|
identifier: attributeKey,
|
|
93
94
|
tagName: tagName,
|
|
94
|
-
className: (0, _clsx.default)(className, (0, _blockEditor.__experimentalGetElementClassName)('caption')),
|
|
95
|
+
className: (0, _clsx.default)(className, excludeElementClassName ? '' : (0, _blockEditor.__experimentalGetElementClassName)('caption')),
|
|
95
96
|
ref: ref,
|
|
96
97
|
"aria-label": label,
|
|
97
98
|
placeholder: placeholder,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_compose","_i18n","_blockEditor","_components","_icons","_blocks","_lockUnlock","_jsxRuntime","Caption","attributeKey","attributes","setAttributes","isSelected","insertBlocksAfter","placeholder","__","label","showToolbarButton","className","readOnly","tagName","addLabel","removeLabel","icon","captionIcon","props","caption","prevCaption","usePrevious","PrivateRichText","RichText","unlock","blockEditorPrivateApis","isCaptionEmpty","isEmpty","isPrevCaptionEmpty","showCaption","setShowCaption","useState","useEffect","ref","useCallback","node","focus","jsxs","Fragment","children","jsx","BlockControls","group","ToolbarButton","onClick","undefined","isPressed","identifier","clsx","__experimentalGetElementClassName","value","onChange","inlineToolbar","__unstableOnSplitAtEnd","createBlock","getDefaultBlockName"],"sources":["@wordpress/block-library/src/utils/caption.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useState, useEffect, useCallback } from '@wordpress/element';\nimport { usePrevious } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tBlockControls,\n\t__experimentalGetElementClassName,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { ToolbarButton } from '@wordpress/components';\nimport { caption as captionIcon } from '@wordpress/icons';\nimport { createBlock, getDefaultBlockName } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\n\nexport function Caption( {\n\tattributeKey = 'caption',\n\tattributes,\n\tsetAttributes,\n\tisSelected,\n\tinsertBlocksAfter,\n\tplaceholder = __( 'Add caption' ),\n\tlabel = __( 'Caption text' ),\n\tshowToolbarButton = true,\n\tclassName,\n\treadOnly,\n\ttagName = 'figcaption',\n\taddLabel = __( 'Add caption' ),\n\tremoveLabel = __( 'Remove caption' ),\n\ticon = captionIcon,\n\t...props\n} ) {\n\tconst caption = attributes[ attributeKey ];\n\tconst prevCaption = usePrevious( caption );\n\tconst { PrivateRichText: RichText } = unlock( blockEditorPrivateApis );\n\tconst isCaptionEmpty = RichText.isEmpty( caption );\n\tconst isPrevCaptionEmpty = RichText.isEmpty( prevCaption );\n\tconst [ showCaption, setShowCaption ] = useState( ! isCaptionEmpty );\n\n\t// We need to show the caption when changes come from\n\t// history navigation(undo/redo).\n\tuseEffect( () => {\n\t\tif ( ! isCaptionEmpty && isPrevCaptionEmpty ) {\n\t\t\tsetShowCaption( true );\n\t\t}\n\t}, [ isCaptionEmpty, isPrevCaptionEmpty ] );\n\n\tuseEffect( () => {\n\t\tif ( ! isSelected && isCaptionEmpty ) {\n\t\t\tsetShowCaption( false );\n\t\t}\n\t}, [ isSelected, isCaptionEmpty ] );\n\n\t// Focus the caption when we click to add one.\n\tconst ref = useCallback(\n\t\t( node ) => {\n\t\t\tif ( node && isCaptionEmpty ) {\n\t\t\t\tnode.focus();\n\t\t\t}\n\t\t},\n\t\t[ isCaptionEmpty ]\n\t);\n\treturn (\n\t\t<>\n\t\t\t{ showToolbarButton && (\n\t\t\t\t<BlockControls group=\"block\">\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tsetShowCaption( ! showCaption );\n\t\t\t\t\t\t\tif ( showCaption && caption ) {\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t[ attributeKey ]: undefined,\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\ticon={ icon }\n\t\t\t\t\t\tisPressed={ showCaption }\n\t\t\t\t\t\tlabel={ showCaption ? removeLabel : addLabel }\n\t\t\t\t\t/>\n\t\t\t\t</BlockControls>\n\t\t\t) }\n\t\t\t{ showCaption &&\n\t\t\t\t( ! RichText.isEmpty( caption ) || isSelected ) && (\n\t\t\t\t\t<RichText\n\t\t\t\t\t\tidentifier={ attributeKey }\n\t\t\t\t\t\ttagName={ tagName }\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\tclassName,\n\t\t\t\t\t\t\
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_compose","_i18n","_blockEditor","_components","_icons","_blocks","_lockUnlock","_jsxRuntime","Caption","attributeKey","attributes","setAttributes","isSelected","insertBlocksAfter","placeholder","__","label","showToolbarButton","excludeElementClassName","className","readOnly","tagName","addLabel","removeLabel","icon","captionIcon","props","caption","prevCaption","usePrevious","PrivateRichText","RichText","unlock","blockEditorPrivateApis","isCaptionEmpty","isEmpty","isPrevCaptionEmpty","showCaption","setShowCaption","useState","useEffect","ref","useCallback","node","focus","jsxs","Fragment","children","jsx","BlockControls","group","ToolbarButton","onClick","undefined","isPressed","identifier","clsx","__experimentalGetElementClassName","value","onChange","inlineToolbar","__unstableOnSplitAtEnd","createBlock","getDefaultBlockName"],"sources":["@wordpress/block-library/src/utils/caption.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useState, useEffect, useCallback } from '@wordpress/element';\nimport { usePrevious } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tBlockControls,\n\t__experimentalGetElementClassName,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { ToolbarButton } from '@wordpress/components';\nimport { caption as captionIcon } from '@wordpress/icons';\nimport { createBlock, getDefaultBlockName } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\n\nexport function Caption( {\n\tattributeKey = 'caption',\n\tattributes,\n\tsetAttributes,\n\tisSelected,\n\tinsertBlocksAfter,\n\tplaceholder = __( 'Add caption' ),\n\tlabel = __( 'Caption text' ),\n\tshowToolbarButton = true,\n\texcludeElementClassName,\n\tclassName,\n\treadOnly,\n\ttagName = 'figcaption',\n\taddLabel = __( 'Add caption' ),\n\tremoveLabel = __( 'Remove caption' ),\n\ticon = captionIcon,\n\t...props\n} ) {\n\tconst caption = attributes[ attributeKey ];\n\tconst prevCaption = usePrevious( caption );\n\tconst { PrivateRichText: RichText } = unlock( blockEditorPrivateApis );\n\tconst isCaptionEmpty = RichText.isEmpty( caption );\n\tconst isPrevCaptionEmpty = RichText.isEmpty( prevCaption );\n\tconst [ showCaption, setShowCaption ] = useState( ! isCaptionEmpty );\n\n\t// We need to show the caption when changes come from\n\t// history navigation(undo/redo).\n\tuseEffect( () => {\n\t\tif ( ! isCaptionEmpty && isPrevCaptionEmpty ) {\n\t\t\tsetShowCaption( true );\n\t\t}\n\t}, [ isCaptionEmpty, isPrevCaptionEmpty ] );\n\n\tuseEffect( () => {\n\t\tif ( ! isSelected && isCaptionEmpty ) {\n\t\t\tsetShowCaption( false );\n\t\t}\n\t}, [ isSelected, isCaptionEmpty ] );\n\n\t// Focus the caption when we click to add one.\n\tconst ref = useCallback(\n\t\t( node ) => {\n\t\t\tif ( node && isCaptionEmpty ) {\n\t\t\t\tnode.focus();\n\t\t\t}\n\t\t},\n\t\t[ isCaptionEmpty ]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t{ showToolbarButton && (\n\t\t\t\t<BlockControls group=\"block\">\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tsetShowCaption( ! showCaption );\n\t\t\t\t\t\t\tif ( showCaption && caption ) {\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t[ attributeKey ]: undefined,\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\ticon={ icon }\n\t\t\t\t\t\tisPressed={ showCaption }\n\t\t\t\t\t\tlabel={ showCaption ? removeLabel : addLabel }\n\t\t\t\t\t/>\n\t\t\t\t</BlockControls>\n\t\t\t) }\n\t\t\t{ showCaption &&\n\t\t\t\t( ! RichText.isEmpty( caption ) || isSelected ) && (\n\t\t\t\t\t<RichText\n\t\t\t\t\t\tidentifier={ attributeKey }\n\t\t\t\t\t\ttagName={ tagName }\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\tclassName,\n\t\t\t\t\t\t\texcludeElementClassName\n\t\t\t\t\t\t\t\t? ''\n\t\t\t\t\t\t\t\t: __experimentalGetElementClassName( 'caption' )\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\taria-label={ label }\n\t\t\t\t\t\tplaceholder={ placeholder }\n\t\t\t\t\t\tvalue={ caption }\n\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\tsetAttributes( { [ attributeKey ]: value } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tinlineToolbar\n\t\t\t\t\t\t__unstableOnSplitAtEnd={ () =>\n\t\t\t\t\t\t\tinsertBlocksAfter(\n\t\t\t\t\t\t\t\tcreateBlock( getDefaultBlockName() )\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t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K,EAAGqB,WAAW,GAAGd,WAAW,GAAGD;MAAU,CAC9C;IAAC,CACY,CACf,EACCe,WAAW,KACV,CAAEN,QAAQ,CAACI,OAAO,CAAER,OAAQ,CAAC,IAAIf,UAAU,CAAE,iBAC9C,IAAAL,WAAA,CAAAyC,GAAA,EAACjB,QAAQ;MACRwB,UAAU,EAAG9C,YAAc;MAC3BY,OAAO,EAAGA,OAAS;MACnBF,SAAS,EAAG,IAAAqC,aAAI,EACfrC,SAAS,EACTD,uBAAuB,GACpB,EAAE,GACF,IAAAuC,8CAAiC,EAAE,SAAU,CACjD,CAAG;MACHhB,GAAG,EAAGA,GAAK;MACX,cAAazB,KAAO;MACpBF,WAAW,EAAGA,WAAa;MAC3B4C,KAAK,EAAG/B,OAAS;MACjBgC,QAAQ,EAAKD,KAAK,IACjB/C,aAAa,CAAE;QAAE,CAAEF,YAAY,GAAIiD;MAAM,CAAE,CAC3C;MACDE,aAAa;MACbC,sBAAsB,EAAGA,CAAA,KACxBhD,iBAAiB,CAChB,IAAAiD,mBAAW,EAAE,IAAAC,2BAAmB,EAAC,CAAE,CACpC,CACA;MACD3C,QAAQ,EAAGA,QAAU;MAAA,GAChBM;IAAK,CACV,CACD;EAAA,CACD,CAAC;AAEL","ignoreList":[]}
|
|
@@ -5,5 +5,5 @@ import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/pri
|
|
|
5
5
|
export const {
|
|
6
6
|
lock,
|
|
7
7
|
unlock
|
|
8
|
-
} = __dangerousOptInToUnstableAPIsOnlyForCoreModules('I
|
|
8
|
+
} = __dangerousOptInToUnstableAPIsOnlyForCoreModules('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/block-library');
|
|
9
9
|
//# sourceMappingURL=lock-unlock.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__dangerousOptInToUnstableAPIsOnlyForCoreModules","lock","unlock"],"sources":["@wordpress/block-library/src/lock-unlock.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I
|
|
1
|
+
{"version":3,"names":["__dangerousOptInToUnstableAPIsOnlyForCoreModules","lock","unlock"],"sources":["@wordpress/block-library/src/lock-unlock.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.',\n\t\t'@wordpress/block-library'\n\t);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gDAAgD,QAAQ,yBAAyB;AAE1F,OAAO,MAAM;EAAEC,IAAI;EAAEC;AAAO,CAAC,GAC5BF,gDAAgD,CAC/C,+HAA+H,EAC/H,0BACD,CAAC","ignoreList":[]}
|
|
@@ -116,6 +116,7 @@ export default function QuoteEdit({
|
|
|
116
116
|
__('Add citation'),
|
|
117
117
|
addLabel: __('Add citation'),
|
|
118
118
|
removeLabel: __('Remove citation'),
|
|
119
|
+
excludeElementClassName: true,
|
|
119
120
|
className: "wp-block-quote__citation",
|
|
120
121
|
insertBlocksAfter: insertBlocksAfter,
|
|
121
122
|
...(!isWebPlatform ? {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","__","AlignmentControl","BlockControls","useBlockProps","useInnerBlocksProps","store","blockEditorStore","BlockQuotation","useDispatch","useRegistry","Platform","useEffect","deprecated","verse","migrateToQuoteV2","Caption","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","isWebPlatform","OS","TEMPLATE","useMigrateOnLoad","attributes","clientId","registry","updateBlockAttributes","replaceInnerBlocks","value","newAttributes","newInnerBlocks","since","version","alternative","batch","QuoteEdit","setAttributes","insertBlocksAfter","className","style","isSelected","textAlign","blockProps","innerBlocksProps","template","templateInsertUpdatesSelection","__experimentalCaptureToolbars","renderAppender","children","group","onChange","nextAlign","attributeKey","tagName","display","__unstableMobileNoFocusOnMount","icon","label","placeholder","addLabel","removeLabel"],"sources":["@wordpress/block-library/src/quote/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { BlockQuotation } from '@wordpress/components';\nimport { useDispatch, useRegistry } from '@wordpress/data';\nimport { Platform, useEffect } from '@wordpress/element';\nimport deprecated from '@wordpress/deprecated';\nimport { verse } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { migrateToQuoteV2 } from './deprecated';\nimport { Caption } from '../utils/caption';\n\nconst isWebPlatform = Platform.OS === 'web';\n\nconst TEMPLATE = [ [ 'core/paragraph', {} ] ];\n\n/**\n * At the moment, deprecations don't handle create blocks from attributes\n * (like when using CPT templates). For this reason, this hook is necessary\n * to avoid breaking templates using the old quote block format.\n *\n * @param {Object} attributes Block attributes.\n * @param {string} clientId Block client ID.\n */\nconst useMigrateOnLoad = ( attributes, clientId ) => {\n\tconst registry = useRegistry();\n\tconst { updateBlockAttributes, replaceInnerBlocks } =\n\t\tuseDispatch( blockEditorStore );\n\tuseEffect( () => {\n\t\t// As soon as the block is loaded, migrate it to the new version.\n\n\t\tif ( ! attributes.value ) {\n\t\t\t// No need to migrate if it doesn't have the value attribute.\n\t\t\treturn;\n\t\t}\n\n\t\tconst [ newAttributes, newInnerBlocks ] =\n\t\t\tmigrateToQuoteV2( attributes );\n\n\t\tdeprecated( 'Value attribute on the quote block', {\n\t\t\tsince: '6.0',\n\t\t\tversion: '6.5',\n\t\t\talternative: 'inner blocks',\n\t\t} );\n\n\t\tregistry.batch( () => {\n\t\t\tupdateBlockAttributes( clientId, newAttributes );\n\t\t\treplaceInnerBlocks( clientId, newInnerBlocks );\n\t\t} );\n\t}, [ attributes.value ] );\n};\n\nexport default function QuoteEdit( {\n\tattributes,\n\tsetAttributes,\n\tinsertBlocksAfter,\n\tclientId,\n\tclassName,\n\tstyle,\n\tisSelected,\n} ) {\n\tconst { textAlign } = attributes;\n\n\tuseMigrateOnLoad( attributes, clientId );\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( className, {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t\t...( ! isWebPlatform && { style } ),\n\t} );\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\ttemplate: TEMPLATE,\n\t\ttemplateInsertUpdatesSelection: true,\n\t\t__experimentalCaptureToolbars: true,\n\t\trenderAppender: false,\n\t} );\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t<AlignmentControl\n\t\t\t\t\tvalue={ textAlign }\n\t\t\t\t\tonChange={ ( nextAlign ) => {\n\t\t\t\t\t\tsetAttributes( { textAlign: nextAlign } );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t\t<BlockQuotation { ...innerBlocksProps }>\n\t\t\t\t{ innerBlocksProps.children }\n\t\t\t\t<Caption\n\t\t\t\t\tattributeKey=\"citation\"\n\t\t\t\t\ttagName={ isWebPlatform ? 'cite' : 'p' }\n\t\t\t\t\tstyle={ isWebPlatform && { display: 'block' } }\n\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t__unstableMobileNoFocusOnMount\n\t\t\t\t\ticon={ verse }\n\t\t\t\t\tlabel={ __( 'Quote citation' ) }\n\t\t\t\t\tplaceholder={\n\t\t\t\t\t\t// translators: placeholder text used for the\n\t\t\t\t\t\t// citation\n\t\t\t\t\t\t__( 'Add citation' )\n\t\t\t\t\t}\n\t\t\t\t\taddLabel={ __( 'Add citation' ) }\n\t\t\t\t\tremoveLabel={ __( 'Remove citation' ) }\n\t\t\t\t\tclassName=\"wp-block-quote__citation\"\n\t\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\t\t{ ...( ! isWebPlatform ? { textAlign } : {} ) }\n\t\t\t\t/>\n\t\t\t</BlockQuotation>\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SACCC,gBAAgB,EAChBC,aAAa,EACbC,aAAa,EACbC,mBAAmB,EACnBC,KAAK,IAAIC,gBAAgB,QACnB,yBAAyB;AAChC,SAASC,cAAc,QAAQ,uBAAuB;AACtD,SAASC,WAAW,EAAEC,WAAW,QAAQ,iBAAiB;AAC1D,SAASC,QAAQ,EAAEC,SAAS,QAAQ,oBAAoB;AACxD,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,KAAK,QAAQ,kBAAkB;;AAExC;AACA;AACA;AACA,SAASC,gBAAgB,QAAQ,cAAc;AAC/C,SAASC,OAAO,QAAQ,kBAAkB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAE3C,MAAMC,aAAa,GAAGZ,QAAQ,CAACa,EAAE,KAAK,KAAK;AAE3C,MAAMC,QAAQ,GAAG,CAAE,CAAE,gBAAgB,EAAE,CAAC,CAAC,CAAE,CAAE;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,gBAAgB,GAAGA,CAAEC,UAAU,EAAEC,QAAQ,KAAM;EACpD,MAAMC,QAAQ,GAAGnB,WAAW,CAAC,CAAC;EAC9B,MAAM;IAAEoB,qBAAqB;IAAEC;EAAmB,CAAC,GAClDtB,WAAW,CAAEF,gBAAiB,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KAAK,EAAC,OAAO;MAAAD,QAAA,eAC3BlC,IAAA,CAAChB,gBAAgB;QAChB8B,KAAK,EAAGa,SAAW;QACnBS,QAAQ,EAAKC,SAAS,IAAM;UAC3Bf,aAAa,CAAE;YAAEK,SAAS,EAAEU;UAAU,CAAE,CAAC;QAC1C;MAAG,CACH;IAAC,CACY,CAAC,eAChBnC,KAAA,CAACZ,cAAc;MAAA,GAAMuC,gBAAgB;MAAAK,QAAA,GAClCL,gBAAgB,CAACK,QAAQ,eAC3BlC,IAAA,CAACF,OAAO;QACPwC,YAAY,EAAC,UAAU;QACvBC,OAAO,EAAGlC,aAAa,GAAG,MAAM,GAAG,GAAK;QACxCoB,KAAK,EAAGpB,aAAa,IAAI;UAAEmC,OAAO,EAAE;QAAQ,CAAG;QAC/Cd,UAAU,EAAGA,UAAY;QACzBjB,UAAU,EAAGA,UAAY;QACzBa,aAAa,EAAGA,aAAe;QAC/BmB,8BAA8B;QAC9BC,IAAI,EAAG9C,KAAO;QACd+C,KAAK,EAAG5D,EAAE,CAAE,gBAAiB,CAAG;QAChC6D,WAAW;QACV;QACA;QACA7D,EAAE,CAAE,cAAe,CACnB;QACD8D,QAAQ,EAAG9D,EAAE,CAAE,cAAe,CAAG;QACjC+D,WAAW,EAAG/D,EAAE,CAAE,iBAAkB,CAAG;
|
|
1
|
+
{"version":3,"names":["clsx","__","AlignmentControl","BlockControls","useBlockProps","useInnerBlocksProps","store","blockEditorStore","BlockQuotation","useDispatch","useRegistry","Platform","useEffect","deprecated","verse","migrateToQuoteV2","Caption","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","isWebPlatform","OS","TEMPLATE","useMigrateOnLoad","attributes","clientId","registry","updateBlockAttributes","replaceInnerBlocks","value","newAttributes","newInnerBlocks","since","version","alternative","batch","QuoteEdit","setAttributes","insertBlocksAfter","className","style","isSelected","textAlign","blockProps","innerBlocksProps","template","templateInsertUpdatesSelection","__experimentalCaptureToolbars","renderAppender","children","group","onChange","nextAlign","attributeKey","tagName","display","__unstableMobileNoFocusOnMount","icon","label","placeholder","addLabel","removeLabel","excludeElementClassName"],"sources":["@wordpress/block-library/src/quote/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { BlockQuotation } from '@wordpress/components';\nimport { useDispatch, useRegistry } from '@wordpress/data';\nimport { Platform, useEffect } from '@wordpress/element';\nimport deprecated from '@wordpress/deprecated';\nimport { verse } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { migrateToQuoteV2 } from './deprecated';\nimport { Caption } from '../utils/caption';\n\nconst isWebPlatform = Platform.OS === 'web';\n\nconst TEMPLATE = [ [ 'core/paragraph', {} ] ];\n\n/**\n * At the moment, deprecations don't handle create blocks from attributes\n * (like when using CPT templates). For this reason, this hook is necessary\n * to avoid breaking templates using the old quote block format.\n *\n * @param {Object} attributes Block attributes.\n * @param {string} clientId Block client ID.\n */\nconst useMigrateOnLoad = ( attributes, clientId ) => {\n\tconst registry = useRegistry();\n\tconst { updateBlockAttributes, replaceInnerBlocks } =\n\t\tuseDispatch( blockEditorStore );\n\tuseEffect( () => {\n\t\t// As soon as the block is loaded, migrate it to the new version.\n\n\t\tif ( ! attributes.value ) {\n\t\t\t// No need to migrate if it doesn't have the value attribute.\n\t\t\treturn;\n\t\t}\n\n\t\tconst [ newAttributes, newInnerBlocks ] =\n\t\t\tmigrateToQuoteV2( attributes );\n\n\t\tdeprecated( 'Value attribute on the quote block', {\n\t\t\tsince: '6.0',\n\t\t\tversion: '6.5',\n\t\t\talternative: 'inner blocks',\n\t\t} );\n\n\t\tregistry.batch( () => {\n\t\t\tupdateBlockAttributes( clientId, newAttributes );\n\t\t\treplaceInnerBlocks( clientId, newInnerBlocks );\n\t\t} );\n\t}, [ attributes.value ] );\n};\n\nexport default function QuoteEdit( {\n\tattributes,\n\tsetAttributes,\n\tinsertBlocksAfter,\n\tclientId,\n\tclassName,\n\tstyle,\n\tisSelected,\n} ) {\n\tconst { textAlign } = attributes;\n\n\tuseMigrateOnLoad( attributes, clientId );\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( className, {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t\t...( ! isWebPlatform && { style } ),\n\t} );\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\ttemplate: TEMPLATE,\n\t\ttemplateInsertUpdatesSelection: true,\n\t\t__experimentalCaptureToolbars: true,\n\t\trenderAppender: false,\n\t} );\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t<AlignmentControl\n\t\t\t\t\tvalue={ textAlign }\n\t\t\t\t\tonChange={ ( nextAlign ) => {\n\t\t\t\t\t\tsetAttributes( { textAlign: nextAlign } );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t\t<BlockQuotation { ...innerBlocksProps }>\n\t\t\t\t{ innerBlocksProps.children }\n\t\t\t\t<Caption\n\t\t\t\t\tattributeKey=\"citation\"\n\t\t\t\t\ttagName={ isWebPlatform ? 'cite' : 'p' }\n\t\t\t\t\tstyle={ isWebPlatform && { display: 'block' } }\n\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t__unstableMobileNoFocusOnMount\n\t\t\t\t\ticon={ verse }\n\t\t\t\t\tlabel={ __( 'Quote citation' ) }\n\t\t\t\t\tplaceholder={\n\t\t\t\t\t\t// translators: placeholder text used for the\n\t\t\t\t\t\t// citation\n\t\t\t\t\t\t__( 'Add citation' )\n\t\t\t\t\t}\n\t\t\t\t\taddLabel={ __( 'Add citation' ) }\n\t\t\t\t\tremoveLabel={ __( 'Remove citation' ) }\n\t\t\t\t\texcludeElementClassName\n\t\t\t\t\tclassName=\"wp-block-quote__citation\"\n\t\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\t\t{ ...( ! isWebPlatform ? { textAlign } : {} ) }\n\t\t\t\t/>\n\t\t\t</BlockQuotation>\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SACCC,gBAAgB,EAChBC,aAAa,EACbC,aAAa,EACbC,mBAAmB,EACnBC,KAAK,IAAIC,gBAAgB,QACnB,yBAAyB;AAChC,SAASC,cAAc,QAAQ,uBAAuB;AACtD,SAASC,WAAW,EAAEC,WAAW,QAAQ,iBAAiB;AAC1D,SAASC,QAAQ,EAAEC,SAAS,QAAQ,oBAAoB;AACxD,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,KAAK,QAAQ,kBAAkB;;AAExC;AACA;AACA;AACA,SAASC,gBAAgB,QAAQ,cAAc;AAC/C,SAASC,OAAO,QAAQ,kBAAkB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAE3C,MAAMC,aAAa,GAAGZ,QAAQ,CAACa,EAAE,KAAK,KAAK;AAE3C,MAAMC,QAAQ,GAAG,CAAE,CAAE,gBAAgB,EAAE,CAAC,CAAC,CAAE,CAAE;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,gBAAgB,GAAGA,CAAEC,UAAU,EAAEC,QAAQ,KAAM;EACpD,MAAMC,QAAQ,GAAGnB,WAAW,CAAC,CAAC;EAC9B,MAAM;IAAEoB,qBAAqB;IAAEC;EAAmB,CAAC,GAClDtB,WAAW,CAAEF,gBAAiB,CAAC;EAChCK,SAAS,CAAE,MAAM;IAChB;;IAEA,IAAK,CAAEe,UAAU,CA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B8B,KAAK,EAAGa,SAAW;QACnBS,QAAQ,EAAKC,SAAS,IAAM;UAC3Bf,aAAa,CAAE;YAAEK,SAAS,EAAEU;UAAU,CAAE,CAAC;QAC1C;MAAG,CACH;IAAC,CACY,CAAC,eAChBnC,KAAA,CAACZ,cAAc;MAAA,GAAMuC,gBAAgB;MAAAK,QAAA,GAClCL,gBAAgB,CAACK,QAAQ,eAC3BlC,IAAA,CAACF,OAAO;QACPwC,YAAY,EAAC,UAAU;QACvBC,OAAO,EAAGlC,aAAa,GAAG,MAAM,GAAG,GAAK;QACxCoB,KAAK,EAAGpB,aAAa,IAAI;UAAEmC,OAAO,EAAE;QAAQ,CAAG;QAC/Cd,UAAU,EAAGA,UAAY;QACzBjB,UAAU,EAAGA,UAAY;QACzBa,aAAa,EAAGA,aAAe;QAC/BmB,8BAA8B;QAC9BC,IAAI,EAAG9C,KAAO;QACd+C,KAAK,EAAG5D,EAAE,CAAE,gBAAiB,CAAG;QAChC6D,WAAW;QACV;QACA;QACA7D,EAAE,CAAE,cAAe,CACnB;QACD8D,QAAQ,EAAG9D,EAAE,CAAE,cAAe,CAAG;QACjC+D,WAAW,EAAG/D,EAAE,CAAE,iBAAkB,CAAG;QACvCgE,uBAAuB;QACvBvB,SAAS,EAAC,0BAA0B;QACpCD,iBAAiB,EAAGA,iBAAmB;QAAA,IAChC,CAAElB,aAAa,GAAG;UAAEsB;QAAU,CAAC,GAAG,CAAC,CAAC;MAAA,CAC3C,CAAC;IAAA,CACa,CAAC;EAAA,CAChB,CAAC;AAEL","ignoreList":[]}
|
|
@@ -6,9 +6,7 @@ import clsx from 'clsx';
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
|
-
import {
|
|
10
|
-
import { useDispatch } from '@wordpress/data';
|
|
11
|
-
import { InspectorControls, URLPopover, URLInput, useBlockProps, store as blockEditorStore } from '@wordpress/block-editor';
|
|
9
|
+
import { InspectorControls, URLPopover, URLInput, useBlockProps } from '@wordpress/block-editor';
|
|
12
10
|
import { useState } from '@wordpress/element';
|
|
13
11
|
import { Button, PanelBody, PanelRow, TextControl } from '@wordpress/components';
|
|
14
12
|
import { __ } from '@wordpress/i18n';
|
|
@@ -25,12 +23,8 @@ const SocialLinkURLPopover = ({
|
|
|
25
23
|
url,
|
|
26
24
|
setAttributes,
|
|
27
25
|
setPopover,
|
|
28
|
-
popoverAnchor
|
|
29
|
-
clientId
|
|
26
|
+
popoverAnchor
|
|
30
27
|
}) => {
|
|
31
|
-
const {
|
|
32
|
-
removeBlock
|
|
33
|
-
} = useDispatch(blockEditorStore);
|
|
34
28
|
return /*#__PURE__*/_jsx(URLPopover, {
|
|
35
29
|
anchor: popoverAnchor,
|
|
36
30
|
onClose: () => setPopover(false),
|
|
@@ -51,13 +45,7 @@ const SocialLinkURLPopover = ({
|
|
|
51
45
|
placeholder: __('Enter social link'),
|
|
52
46
|
label: __('Enter social link'),
|
|
53
47
|
hideLabelFromVision: true,
|
|
54
|
-
disableSuggestions: true
|
|
55
|
-
onKeyDown: event => {
|
|
56
|
-
if (!!url || event.defaultPrevented || ![BACKSPACE, DELETE].includes(event.keyCode)) {
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
removeBlock(clientId);
|
|
60
|
-
}
|
|
48
|
+
disableSuggestions: true
|
|
61
49
|
})
|
|
62
50
|
}), /*#__PURE__*/_jsx(Button, {
|
|
63
51
|
icon: keyboardReturn,
|
|
@@ -71,8 +59,7 @@ const SocialLinkEdit = ({
|
|
|
71
59
|
attributes,
|
|
72
60
|
context,
|
|
73
61
|
isSelected,
|
|
74
|
-
setAttributes
|
|
75
|
-
clientId
|
|
62
|
+
setAttributes
|
|
76
63
|
}) => {
|
|
77
64
|
const {
|
|
78
65
|
url,
|
|
@@ -154,8 +141,7 @@ const SocialLinkEdit = ({
|
|
|
154
141
|
url: url,
|
|
155
142
|
setAttributes: setAttributes,
|
|
156
143
|
setPopover: setPopover,
|
|
157
|
-
popoverAnchor: popoverAnchor
|
|
158
|
-
clientId: clientId
|
|
144
|
+
popoverAnchor: popoverAnchor
|
|
159
145
|
})]
|
|
160
146
|
})]
|
|
161
147
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","DELETE","BACKSPACE","useDispatch","InspectorControls","URLPopover","URLInput","useBlockProps","store","blockEditorStore","useState","Button","PanelBody","PanelRow","TextControl","__","keyboardReturn","getIconBySite","getNameBySite","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","SocialLinkURLPopover","url","setAttributes","setPopover","popoverAnchor","clientId","removeBlock","anchor","onClose","children","className","onSubmit","event","preventDefault","__nextHasNoMarginBottom","value","onChange","nextURL","placeholder","label","hideLabelFromVision","disableSuggestions","onKeyDown","defaultPrevented","includes","keyCode","icon","type","SocialLinkEdit","attributes","context","isSelected","service","rel","showLabels","iconColor","iconColorValue","iconBackgroundColor","iconBackgroundColorValue","showURLPopover","classes","setPopoverAnchor","IconComponent","socialLinkName","socialLinkText","trim","blockProps","style","color","backgroundColor","title","help","group","ref","onClick"],"sources":["@wordpress/block-library/src/social-link/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { DELETE, BACKSPACE } from '@wordpress/keycodes';\nimport { useDispatch } from '@wordpress/data';\n\nimport {\n\tInspectorControls,\n\tURLPopover,\n\tURLInput,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useState } from '@wordpress/element';\nimport {\n\tButton,\n\tPanelBody,\n\tPanelRow,\n\tTextControl,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { keyboardReturn } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { getIconBySite, getNameBySite } from './social-list';\n\nconst SocialLinkURLPopover = ( {\n\turl,\n\tsetAttributes,\n\tsetPopover,\n\tpopoverAnchor,\n\tclientId,\n} ) => {\n\tconst { removeBlock } = useDispatch( blockEditorStore );\n\treturn (\n\t\t<URLPopover\n\t\t\tanchor={ popoverAnchor }\n\t\t\tonClose={ () => setPopover( false ) }\n\t\t>\n\t\t\t<form\n\t\t\t\tclassName=\"block-editor-url-popover__link-editor\"\n\t\t\t\tonSubmit={ ( event ) => {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tsetPopover( false );\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<div className=\"block-editor-url-input\">\n\t\t\t\t\t<URLInput\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tvalue={ url }\n\t\t\t\t\t\tonChange={ ( nextURL ) =>\n\t\t\t\t\t\t\tsetAttributes( { url: nextURL } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tplaceholder={ __( 'Enter social link' ) }\n\t\t\t\t\t\tlabel={ __( 'Enter social link' ) }\n\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\tdisableSuggestions\n\t\t\t\t\t\tonKeyDown={ ( event ) => {\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t!! url ||\n\t\t\t\t\t\t\t\tevent.defaultPrevented ||\n\t\t\t\t\t\t\t\t! [ BACKSPACE, DELETE ].includes(\n\t\t\t\t\t\t\t\t\tevent.keyCode\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tremoveBlock( clientId );\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t<Button\n\t\t\t\t\ticon={ keyboardReturn }\n\t\t\t\t\tlabel={ __( 'Apply' ) }\n\t\t\t\t\ttype=\"submit\"\n\t\t\t\t/>\n\t\t\t</form>\n\t\t</URLPopover>\n\t);\n};\n\nconst SocialLinkEdit = ( {\n\tattributes,\n\tcontext,\n\tisSelected,\n\tsetAttributes,\n\tclientId,\n} ) => {\n\tconst { url, service, label = '', rel } = attributes;\n\tconst {\n\t\tshowLabels,\n\t\ticonColor,\n\t\ticonColorValue,\n\t\ticonBackgroundColor,\n\t\ticonBackgroundColorValue,\n\t} = context;\n\tconst [ showURLPopover, setPopover ] = useState( false );\n\tconst classes = clsx( 'wp-social-link', 'wp-social-link-' + service, {\n\t\t'wp-social-link__is-incomplete': ! url,\n\t\t[ `has-${ iconColor }-color` ]: iconColor,\n\t\t[ `has-${ iconBackgroundColor }-background-color` ]:\n\t\t\ticonBackgroundColor,\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 IconComponent = getIconBySite( service );\n\tconst socialLinkName = getNameBySite( service );\n\t// The initial label (ie. the link text) is an empty string.\n\t// We want to prevent empty links so that the link text always fallbacks to\n\t// the social name, even when users enter and save an empty string or only\n\t// spaces. The PHP render callback fallbacks to the social name as well.\n\tconst socialLinkText = label.trim() === '' ? socialLinkName : label;\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classes,\n\t\tstyle: {\n\t\t\tcolor: iconColorValue,\n\t\t\tbackgroundColor: iconBackgroundColorValue,\n\t\t},\n\t} );\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t<PanelRow>\n\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Link text' ) }\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'The link text is visible when enabled from the parent Social Icons block.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tvalue={ label }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { label: value } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tplaceholder={ socialLinkName }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</PanelRow>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t<TextControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Link rel' ) }\n\t\t\t\t\tvalue={ rel || '' }\n\t\t\t\t\tonChange={ ( value ) => setAttributes( { rel: value } ) }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t<li { ...blockProps }>\n\t\t\t\t<button\n\t\t\t\t\tclassName=\"wp-block-social-link-anchor\"\n\t\t\t\t\tref={ setPopoverAnchor }\n\t\t\t\t\tonClick={ () => setPopover( true ) }\n\t\t\t\t>\n\t\t\t\t\t<IconComponent />\n\t\t\t\t\t<span\n\t\t\t\t\t\tclassName={ clsx( 'wp-block-social-link-label', {\n\t\t\t\t\t\t\t'screen-reader-text': ! showLabels,\n\t\t\t\t\t\t} ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ socialLinkText }\n\t\t\t\t\t</span>\n\t\t\t\t</button>\n\t\t\t\t{ isSelected && showURLPopover && (\n\t\t\t\t\t<SocialLinkURLPopover\n\t\t\t\t\t\turl={ url }\n\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\tsetPopover={ setPopover }\n\t\t\t\t\t\tpopoverAnchor={ popoverAnchor }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</li>\n\t\t</>\n\t);\n};\n\nexport default SocialLinkEdit;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,MAAM,EAAEC,SAAS,QAAQ,qBAAqB;AACvD,SAASC,WAAW,QAAQ,iBAAiB;AAE7C,SACCC,iBAAiB,EACjBC,UAAU,EACVC,QAAQ,EACRC,aAAa,EACbC,KAAK,IAAIC,gBAAgB,QACnB,yBAAyB;AAChC,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SACCC,MAAM,EACN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B/C,IAAA;UACCe,SAAS,EAAGnC,IAAI,CAAE,4BAA4B,EAAE;YAC/C,oBAAoB,EAAE,CAAE2D;UACzB,CAAE,CAAG;UAAAzB,QAAA,EAEHmC;QAAc,CACX,CAAC;MAAA,CACA,CAAC,EACPb,UAAU,IAAIQ,cAAc,iBAC7B5C,IAAA,CAACK,oBAAoB;QACpBC,GAAG,EAAGA,GAAK;QACXC,aAAa,EAAGA,aAAe;QAC/BC,UAAU,EAAGA,UAAY;QACzBC,aAAa,EAAGA,aAAe;QAC/BC,QAAQ,EAAGA;MAAU,CACrB,CACD;IAAA,CACE,CAAC;EAAA,CACJ,CAAC;AAEL,CAAC;AAED,eAAeuB,cAAc","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["clsx","InspectorControls","URLPopover","URLInput","useBlockProps","useState","Button","PanelBody","PanelRow","TextControl","__","keyboardReturn","getIconBySite","getNameBySite","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","SocialLinkURLPopover","url","setAttributes","setPopover","popoverAnchor","anchor","onClose","children","className","onSubmit","event","preventDefault","__nextHasNoMarginBottom","value","onChange","nextURL","placeholder","label","hideLabelFromVision","disableSuggestions","icon","type","SocialLinkEdit","attributes","context","isSelected","service","rel","showLabels","iconColor","iconColorValue","iconBackgroundColor","iconBackgroundColorValue","showURLPopover","classes","setPopoverAnchor","IconComponent","socialLinkName","socialLinkText","trim","blockProps","style","color","backgroundColor","title","help","group","ref","onClick"],"sources":["@wordpress/block-library/src/social-link/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tInspectorControls,\n\tURLPopover,\n\tURLInput,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport { useState } from '@wordpress/element';\nimport {\n\tButton,\n\tPanelBody,\n\tPanelRow,\n\tTextControl,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { keyboardReturn } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { getIconBySite, getNameBySite } from './social-list';\n\nconst SocialLinkURLPopover = ( {\n\turl,\n\tsetAttributes,\n\tsetPopover,\n\tpopoverAnchor,\n} ) => {\n\treturn (\n\t\t<URLPopover\n\t\t\tanchor={ popoverAnchor }\n\t\t\tonClose={ () => setPopover( false ) }\n\t\t>\n\t\t\t<form\n\t\t\t\tclassName=\"block-editor-url-popover__link-editor\"\n\t\t\t\tonSubmit={ ( event ) => {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tsetPopover( false );\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<div className=\"block-editor-url-input\">\n\t\t\t\t\t<URLInput\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tvalue={ url }\n\t\t\t\t\t\tonChange={ ( nextURL ) =>\n\t\t\t\t\t\t\tsetAttributes( { url: nextURL } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tplaceholder={ __( 'Enter social link' ) }\n\t\t\t\t\t\tlabel={ __( 'Enter social link' ) }\n\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\tdisableSuggestions\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t<Button\n\t\t\t\t\ticon={ keyboardReturn }\n\t\t\t\t\tlabel={ __( 'Apply' ) }\n\t\t\t\t\ttype=\"submit\"\n\t\t\t\t/>\n\t\t\t</form>\n\t\t</URLPopover>\n\t);\n};\n\nconst SocialLinkEdit = ( {\n\tattributes,\n\tcontext,\n\tisSelected,\n\tsetAttributes,\n} ) => {\n\tconst { url, service, label = '', rel } = attributes;\n\tconst {\n\t\tshowLabels,\n\t\ticonColor,\n\t\ticonColorValue,\n\t\ticonBackgroundColor,\n\t\ticonBackgroundColorValue,\n\t} = context;\n\tconst [ showURLPopover, setPopover ] = useState( false );\n\tconst classes = clsx( 'wp-social-link', 'wp-social-link-' + service, {\n\t\t'wp-social-link__is-incomplete': ! url,\n\t\t[ `has-${ iconColor }-color` ]: iconColor,\n\t\t[ `has-${ iconBackgroundColor }-background-color` ]:\n\t\t\ticonBackgroundColor,\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 IconComponent = getIconBySite( service );\n\tconst socialLinkName = getNameBySite( service );\n\t// The initial label (ie. the link text) is an empty string.\n\t// We want to prevent empty links so that the link text always fallbacks to\n\t// the social name, even when users enter and save an empty string or only\n\t// spaces. The PHP render callback fallbacks to the social name as well.\n\tconst socialLinkText = label.trim() === '' ? socialLinkName : label;\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classes,\n\t\tstyle: {\n\t\t\tcolor: iconColorValue,\n\t\t\tbackgroundColor: iconBackgroundColorValue,\n\t\t},\n\t} );\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t<PanelRow>\n\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Link text' ) }\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'The link text is visible when enabled from the parent Social Icons block.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tvalue={ label }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { label: value } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tplaceholder={ socialLinkName }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</PanelRow>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t<TextControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Link rel' ) }\n\t\t\t\t\tvalue={ rel || '' }\n\t\t\t\t\tonChange={ ( value ) => setAttributes( { rel: value } ) }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t<li { ...blockProps }>\n\t\t\t\t<button\n\t\t\t\t\tclassName=\"wp-block-social-link-anchor\"\n\t\t\t\t\tref={ setPopoverAnchor }\n\t\t\t\t\tonClick={ () => setPopover( true ) }\n\t\t\t\t>\n\t\t\t\t\t<IconComponent />\n\t\t\t\t\t<span\n\t\t\t\t\t\tclassName={ clsx( 'wp-block-social-link-label', {\n\t\t\t\t\t\t\t'screen-reader-text': ! showLabels,\n\t\t\t\t\t\t} ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ socialLinkText }\n\t\t\t\t\t</span>\n\t\t\t\t</button>\n\t\t\t\t{ isSelected && showURLPopover && (\n\t\t\t\t\t<SocialLinkURLPopover\n\t\t\t\t\t\turl={ url }\n\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\tsetPopover={ setPopover }\n\t\t\t\t\t\tpopoverAnchor={ popoverAnchor }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</li>\n\t\t</>\n\t);\n};\n\nexport default SocialLinkEdit;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,iBAAiB,EACjBC,UAAU,EACVC,QAAQ,EACRC,aAAa,QACP,yBAAyB;AAChC,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SACCC,MAAM,EACNC,SAAS,EACTC,QAAQ,EACRC,WAAW,QACL,uBAAuB;AAC9B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,cAAc,QAAQ,kBAAkB;;AAEjD;AACA;AACA;AACA,SAASC,aAAa,EAAEC,aAAa,QAAQ,eAAe;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAE7D,MAAMC,oBAAoB,GAAGA,CAAE;EAC9BC,GAAG;EACHC,aAAa;EACbC,UAAU;EACVC;AACD,CAAC,KAAM;EACN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,CAACd,iBAAiB;MAACiE,KAAK,EAAC,UAAU;MAAAvC,QAAA,eAClCZ,IAAA,CAACN,WAAW;QACXuB,uBAAuB;QACvBK,KAAK,EAAG3B,EAAE,CAAE,UAAW,CAAG;QAC1BuB,KAAK,EAAGc,GAAG,IAAI,EAAI;QACnBb,QAAQ,EAAKD,KAAK,IAAMX,aAAa,CAAE;UAAEyB,GAAG,EAAEd;QAAM,CAAE;MAAG,CACzD;IAAC,CACgB,CAAC,eACpBhB,KAAA;MAAA,GAAS2C,UAAU;MAAAjC,QAAA,gBAClBV,KAAA;QACCW,SAAS,EAAC,6BAA6B;QACvCuC,GAAG,EAAGZ,gBAAkB;QACxBa,OAAO,EAAGA,CAAA,KAAM7C,UAAU,CAAE,IAAK,CAAG;QAAAI,QAAA,gBAEpCZ,IAAA,CAACyC,aAAa,IAAE,CAAC,eACjBzC,IAAA;UACCa,SAAS,EAAG5B,IAAI,CAAE,4BAA4B,EAAE;YAC/C,oBAAoB,EAAE,CAAEgD;UACzB,CAAE,CAAG;UAAArB,QAAA,EAEH+B;QAAc,CACX,CAAC;MAAA,CACA,CAAC,EACPb,UAAU,IAAIQ,cAAc,iBAC7BtC,IAAA,CAACK,oBAAoB;QACpBC,GAAG,EAAGA,GAAK;QACXC,aAAa,EAAGA,aAAe;QAC/BC,UAAU,EAAGA,UAAY;QACzBC,aAAa,EAAGA;MAAe,CAC/B,CACD;IAAA,CACE,CAAC;EAAA,CACJ,CAAC;AAEL,CAAC;AAED,eAAekB,cAAc","ignoreList":[]}
|
|
@@ -30,6 +30,7 @@ export function Caption({
|
|
|
30
30
|
placeholder = __('Add caption'),
|
|
31
31
|
label = __('Caption text'),
|
|
32
32
|
showToolbarButton = true,
|
|
33
|
+
excludeElementClassName,
|
|
33
34
|
className,
|
|
34
35
|
readOnly,
|
|
35
36
|
tagName = 'figcaption',
|
|
@@ -85,7 +86,7 @@ export function Caption({
|
|
|
85
86
|
}), showCaption && (!RichText.isEmpty(caption) || isSelected) && /*#__PURE__*/_jsx(RichText, {
|
|
86
87
|
identifier: attributeKey,
|
|
87
88
|
tagName: tagName,
|
|
88
|
-
className: clsx(className, __experimentalGetElementClassName('caption')),
|
|
89
|
+
className: clsx(className, excludeElementClassName ? '' : __experimentalGetElementClassName('caption')),
|
|
89
90
|
ref: ref,
|
|
90
91
|
"aria-label": label,
|
|
91
92
|
placeholder: placeholder,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","useState","useEffect","useCallback","usePrevious","__","BlockControls","__experimentalGetElementClassName","privateApis","blockEditorPrivateApis","ToolbarButton","caption","captionIcon","createBlock","getDefaultBlockName","unlock","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","Caption","attributeKey","attributes","setAttributes","isSelected","insertBlocksAfter","placeholder","label","showToolbarButton","className","readOnly","tagName","addLabel","removeLabel","icon","props","prevCaption","PrivateRichText","RichText","isCaptionEmpty","isEmpty","isPrevCaptionEmpty","showCaption","setShowCaption","ref","node","focus","children","group","onClick","undefined","isPressed","identifier","value","onChange","inlineToolbar","__unstableOnSplitAtEnd"],"sources":["@wordpress/block-library/src/utils/caption.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useState, useEffect, useCallback } from '@wordpress/element';\nimport { usePrevious } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tBlockControls,\n\t__experimentalGetElementClassName,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { ToolbarButton } from '@wordpress/components';\nimport { caption as captionIcon } from '@wordpress/icons';\nimport { createBlock, getDefaultBlockName } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\n\nexport function Caption( {\n\tattributeKey = 'caption',\n\tattributes,\n\tsetAttributes,\n\tisSelected,\n\tinsertBlocksAfter,\n\tplaceholder = __( 'Add caption' ),\n\tlabel = __( 'Caption text' ),\n\tshowToolbarButton = true,\n\tclassName,\n\treadOnly,\n\ttagName = 'figcaption',\n\taddLabel = __( 'Add caption' ),\n\tremoveLabel = __( 'Remove caption' ),\n\ticon = captionIcon,\n\t...props\n} ) {\n\tconst caption = attributes[ attributeKey ];\n\tconst prevCaption = usePrevious( caption );\n\tconst { PrivateRichText: RichText } = unlock( blockEditorPrivateApis );\n\tconst isCaptionEmpty = RichText.isEmpty( caption );\n\tconst isPrevCaptionEmpty = RichText.isEmpty( prevCaption );\n\tconst [ showCaption, setShowCaption ] = useState( ! isCaptionEmpty );\n\n\t// We need to show the caption when changes come from\n\t// history navigation(undo/redo).\n\tuseEffect( () => {\n\t\tif ( ! isCaptionEmpty && isPrevCaptionEmpty ) {\n\t\t\tsetShowCaption( true );\n\t\t}\n\t}, [ isCaptionEmpty, isPrevCaptionEmpty ] );\n\n\tuseEffect( () => {\n\t\tif ( ! isSelected && isCaptionEmpty ) {\n\t\t\tsetShowCaption( false );\n\t\t}\n\t}, [ isSelected, isCaptionEmpty ] );\n\n\t// Focus the caption when we click to add one.\n\tconst ref = useCallback(\n\t\t( node ) => {\n\t\t\tif ( node && isCaptionEmpty ) {\n\t\t\t\tnode.focus();\n\t\t\t}\n\t\t},\n\t\t[ isCaptionEmpty ]\n\t);\n\treturn (\n\t\t<>\n\t\t\t{ showToolbarButton && (\n\t\t\t\t<BlockControls group=\"block\">\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tsetShowCaption( ! showCaption );\n\t\t\t\t\t\t\tif ( showCaption && caption ) {\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t[ attributeKey ]: undefined,\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\ticon={ icon }\n\t\t\t\t\t\tisPressed={ showCaption }\n\t\t\t\t\t\tlabel={ showCaption ? removeLabel : addLabel }\n\t\t\t\t\t/>\n\t\t\t\t</BlockControls>\n\t\t\t) }\n\t\t\t{ showCaption &&\n\t\t\t\t( ! RichText.isEmpty( caption ) || isSelected ) && (\n\t\t\t\t\t<RichText\n\t\t\t\t\t\tidentifier={ attributeKey }\n\t\t\t\t\t\ttagName={ tagName }\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\tclassName,\n\t\t\t\t\t\t\
|
|
1
|
+
{"version":3,"names":["clsx","useState","useEffect","useCallback","usePrevious","__","BlockControls","__experimentalGetElementClassName","privateApis","blockEditorPrivateApis","ToolbarButton","caption","captionIcon","createBlock","getDefaultBlockName","unlock","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","Caption","attributeKey","attributes","setAttributes","isSelected","insertBlocksAfter","placeholder","label","showToolbarButton","excludeElementClassName","className","readOnly","tagName","addLabel","removeLabel","icon","props","prevCaption","PrivateRichText","RichText","isCaptionEmpty","isEmpty","isPrevCaptionEmpty","showCaption","setShowCaption","ref","node","focus","children","group","onClick","undefined","isPressed","identifier","value","onChange","inlineToolbar","__unstableOnSplitAtEnd"],"sources":["@wordpress/block-library/src/utils/caption.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useState, useEffect, useCallback } from '@wordpress/element';\nimport { usePrevious } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tBlockControls,\n\t__experimentalGetElementClassName,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { ToolbarButton } from '@wordpress/components';\nimport { caption as captionIcon } from '@wordpress/icons';\nimport { createBlock, getDefaultBlockName } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\n\nexport function Caption( {\n\tattributeKey = 'caption',\n\tattributes,\n\tsetAttributes,\n\tisSelected,\n\tinsertBlocksAfter,\n\tplaceholder = __( 'Add caption' ),\n\tlabel = __( 'Caption text' ),\n\tshowToolbarButton = true,\n\texcludeElementClassName,\n\tclassName,\n\treadOnly,\n\ttagName = 'figcaption',\n\taddLabel = __( 'Add caption' ),\n\tremoveLabel = __( 'Remove caption' ),\n\ticon = captionIcon,\n\t...props\n} ) {\n\tconst caption = attributes[ attributeKey ];\n\tconst prevCaption = usePrevious( caption );\n\tconst { PrivateRichText: RichText } = unlock( blockEditorPrivateApis );\n\tconst isCaptionEmpty = RichText.isEmpty( caption );\n\tconst isPrevCaptionEmpty = RichText.isEmpty( prevCaption );\n\tconst [ showCaption, setShowCaption ] = useState( ! isCaptionEmpty );\n\n\t// We need to show the caption when changes come from\n\t// history navigation(undo/redo).\n\tuseEffect( () => {\n\t\tif ( ! isCaptionEmpty && isPrevCaptionEmpty ) {\n\t\t\tsetShowCaption( true );\n\t\t}\n\t}, [ isCaptionEmpty, isPrevCaptionEmpty ] );\n\n\tuseEffect( () => {\n\t\tif ( ! isSelected && isCaptionEmpty ) {\n\t\t\tsetShowCaption( false );\n\t\t}\n\t}, [ isSelected, isCaptionEmpty ] );\n\n\t// Focus the caption when we click to add one.\n\tconst ref = useCallback(\n\t\t( node ) => {\n\t\t\tif ( node && isCaptionEmpty ) {\n\t\t\t\tnode.focus();\n\t\t\t}\n\t\t},\n\t\t[ isCaptionEmpty ]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t{ showToolbarButton && (\n\t\t\t\t<BlockControls group=\"block\">\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tsetShowCaption( ! showCaption );\n\t\t\t\t\t\t\tif ( showCaption && caption ) {\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t[ attributeKey ]: undefined,\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\ticon={ icon }\n\t\t\t\t\t\tisPressed={ showCaption }\n\t\t\t\t\t\tlabel={ showCaption ? removeLabel : addLabel }\n\t\t\t\t\t/>\n\t\t\t\t</BlockControls>\n\t\t\t) }\n\t\t\t{ showCaption &&\n\t\t\t\t( ! RichText.isEmpty( caption ) || isSelected ) && (\n\t\t\t\t\t<RichText\n\t\t\t\t\t\tidentifier={ attributeKey }\n\t\t\t\t\t\ttagName={ tagName }\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\tclassName,\n\t\t\t\t\t\t\texcludeElementClassName\n\t\t\t\t\t\t\t\t? ''\n\t\t\t\t\t\t\t\t: __experimentalGetElementClassName( 'caption' )\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\taria-label={ label }\n\t\t\t\t\t\tplaceholder={ placeholder }\n\t\t\t\t\t\tvalue={ caption }\n\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\tsetAttributes( { [ attributeKey ]: value } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tinlineToolbar\n\t\t\t\t\t\t__unstableOnSplitAtEnd={ () =>\n\t\t\t\t\t\t\tinsertBlocksAfter(\n\t\t\t\t\t\t\t\tcreateBlock( getDefaultBlockName() )\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\treadOnly={ readOnly }\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,QAAQ,EAAEC,SAAS,EAAEC,WAAW,QAAQ,oBAAoB;AACrE,SAASC,WAAW,QAAQ,oBAAoB;AAChD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SACCC,aAAa,EACbC,iCAAiC,EACjCC,WAAW,IAAIC,sBAAsB,QAC/B,yBAAyB;AAChC,SAASC,aAAa,QAAQ,uBAAuB;AACrD,SAASC,OAAO,IAAIC,WAAW,QAAQ,kBAAkB;AACzD,SAASC,WAAW,EAAEC,mBAAmB,QAAQ,mBAAmB;;AAEpE;AACA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,YAAY,GAAIiC;MAAM,CAAE,CAC3C;MACDE,aAAa;MACbC,sBAAsB,EAAGA,CAAA,KACxBhC,iBAAiB,CAChBd,WAAW,CAAEC,mBAAmB,CAAC,CAAE,CACpC,CACA;MACDmB,QAAQ,EAAGA,QAAU;MAAA,GAChBK;IAAK,CACV,CACD;EAAA,CACD,CAAC;AAEL","ignoreList":[]}
|
|
@@ -206,7 +206,6 @@
|
|
|
206
206
|
.screen-reader-text {
|
|
207
207
|
border: 0;
|
|
208
208
|
clip: rect(1px, 1px, 1px, 1px);
|
|
209
|
-
-webkit-clip-path: inset(50%);
|
|
210
209
|
clip-path: inset(50%);
|
|
211
210
|
height: 1px;
|
|
212
211
|
margin: -1px;
|
|
@@ -220,8 +219,7 @@
|
|
|
220
219
|
.screen-reader-text:focus {
|
|
221
220
|
background-color: #ddd;
|
|
222
221
|
clip: auto !important;
|
|
223
|
-
|
|
224
|
-
clip-path: none;
|
|
222
|
+
clip-path: none;
|
|
225
223
|
color: #444;
|
|
226
224
|
display: block;
|
|
227
225
|
font-size: 1em;
|
package/build-style/common.css
CHANGED
|
@@ -208,7 +208,6 @@
|
|
|
208
208
|
.screen-reader-text {
|
|
209
209
|
border: 0;
|
|
210
210
|
clip: rect(1px, 1px, 1px, 1px);
|
|
211
|
-
-webkit-clip-path: inset(50%);
|
|
212
211
|
clip-path: inset(50%);
|
|
213
212
|
height: 1px;
|
|
214
213
|
margin: -1px;
|
|
@@ -222,8 +221,7 @@
|
|
|
222
221
|
.screen-reader-text:focus {
|
|
223
222
|
background-color: #ddd;
|
|
224
223
|
clip: auto !important;
|
|
225
|
-
|
|
226
|
-
clip-path: none;
|
|
224
|
+
clip-path: none;
|
|
227
225
|
color: #444;
|
|
228
226
|
display: block;
|
|
229
227
|
font-size: 1em;
|
|
@@ -126,8 +126,7 @@
|
|
|
126
126
|
min-width: 3rem;
|
|
127
127
|
border: 1px solid #949494;
|
|
128
128
|
text-decoration: unset !important;
|
|
129
|
-
|
|
130
|
-
appearance: initial;
|
|
129
|
+
appearance: initial;
|
|
131
130
|
}
|
|
132
131
|
|
|
133
132
|
.wp-block-search.wp-block-search__button-only .wp-block-search__button {
|
|
@@ -126,8 +126,7 @@
|
|
|
126
126
|
min-width: 3rem;
|
|
127
127
|
border: 1px solid #949494;
|
|
128
128
|
text-decoration: unset !important;
|
|
129
|
-
|
|
130
|
-
appearance: initial;
|
|
129
|
+
appearance: initial;
|
|
131
130
|
}
|
|
132
131
|
|
|
133
132
|
.wp-block-search.wp-block-search__button-only .wp-block-search__button {
|
|
@@ -3195,8 +3195,7 @@ ul.wp-block-rss.is-grid li {
|
|
|
3195
3195
|
min-width: 3rem;
|
|
3196
3196
|
border: 1px solid #949494;
|
|
3197
3197
|
text-decoration: unset !important;
|
|
3198
|
-
|
|
3199
|
-
appearance: initial;
|
|
3198
|
+
appearance: initial;
|
|
3200
3199
|
}
|
|
3201
3200
|
|
|
3202
3201
|
.wp-block-search.wp-block-search__button-only .wp-block-search__button {
|
|
@@ -4105,7 +4104,6 @@ a[data-fn].fn::after {
|
|
|
4105
4104
|
.screen-reader-text {
|
|
4106
4105
|
border: 0;
|
|
4107
4106
|
clip: rect(1px, 1px, 1px, 1px);
|
|
4108
|
-
-webkit-clip-path: inset(50%);
|
|
4109
4107
|
clip-path: inset(50%);
|
|
4110
4108
|
height: 1px;
|
|
4111
4109
|
margin: -1px;
|
|
@@ -4119,8 +4117,7 @@ a[data-fn].fn::after {
|
|
|
4119
4117
|
.screen-reader-text:focus {
|
|
4120
4118
|
background-color: #ddd;
|
|
4121
4119
|
clip: auto !important;
|
|
4122
|
-
|
|
4123
|
-
clip-path: none;
|
|
4120
|
+
clip-path: none;
|
|
4124
4121
|
color: #444;
|
|
4125
4122
|
display: block;
|
|
4126
4123
|
font-size: 1em;
|
package/build-style/style.css
CHANGED
|
@@ -3229,8 +3229,7 @@ ul.wp-block-rss.is-grid li {
|
|
|
3229
3229
|
min-width: 3rem;
|
|
3230
3230
|
border: 1px solid #949494;
|
|
3231
3231
|
text-decoration: unset !important;
|
|
3232
|
-
|
|
3233
|
-
appearance: initial;
|
|
3232
|
+
appearance: initial;
|
|
3234
3233
|
}
|
|
3235
3234
|
|
|
3236
3235
|
.wp-block-search.wp-block-search__button-only .wp-block-search__button {
|
|
@@ -4142,7 +4141,6 @@ a[data-fn].fn::after {
|
|
|
4142
4141
|
.screen-reader-text {
|
|
4143
4142
|
border: 0;
|
|
4144
4143
|
clip: rect(1px, 1px, 1px, 1px);
|
|
4145
|
-
-webkit-clip-path: inset(50%);
|
|
4146
4144
|
clip-path: inset(50%);
|
|
4147
4145
|
height: 1px;
|
|
4148
4146
|
margin: -1px;
|
|
@@ -4156,8 +4154,7 @@ a[data-fn].fn::after {
|
|
|
4156
4154
|
.screen-reader-text:focus {
|
|
4157
4155
|
background-color: #ddd;
|
|
4158
4156
|
clip: auto !important;
|
|
4159
|
-
|
|
4160
|
-
clip-path: none;
|
|
4157
|
+
clip-path: none;
|
|
4161
4158
|
color: #444;
|
|
4162
4159
|
display: block;
|
|
4163
4160
|
font-size: 1em;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-library",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.3",
|
|
4
4
|
"description": "Block library for the WordPress editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -36,12 +36,12 @@
|
|
|
36
36
|
"@wordpress/api-fetch": "^7.0.1",
|
|
37
37
|
"@wordpress/autop": "^4.0.1",
|
|
38
38
|
"@wordpress/blob": "^4.0.1",
|
|
39
|
-
"@wordpress/block-editor": "^13.0.
|
|
40
|
-
"@wordpress/blocks": "^13.0.
|
|
41
|
-
"@wordpress/components": "^28.0.
|
|
39
|
+
"@wordpress/block-editor": "^13.0.2",
|
|
40
|
+
"@wordpress/blocks": "^13.0.2",
|
|
41
|
+
"@wordpress/components": "^28.0.2",
|
|
42
42
|
"@wordpress/compose": "^7.0.1",
|
|
43
|
-
"@wordpress/core-data": "^7.0.
|
|
44
|
-
"@wordpress/data": "^10.0.
|
|
43
|
+
"@wordpress/core-data": "^7.0.2",
|
|
44
|
+
"@wordpress/data": "^10.0.2",
|
|
45
45
|
"@wordpress/date": "^5.0.1",
|
|
46
46
|
"@wordpress/deprecated": "^4.0.1",
|
|
47
47
|
"@wordpress/dom": "^4.0.1",
|
|
@@ -53,17 +53,17 @@
|
|
|
53
53
|
"@wordpress/icons": "^10.0.1",
|
|
54
54
|
"@wordpress/interactivity": "^6.0.1",
|
|
55
55
|
"@wordpress/interactivity-router": "^2.0.1",
|
|
56
|
-
"@wordpress/keyboard-shortcuts": "^5.0.
|
|
56
|
+
"@wordpress/keyboard-shortcuts": "^5.0.2",
|
|
57
57
|
"@wordpress/keycodes": "^4.0.1",
|
|
58
|
-
"@wordpress/notices": "^5.0.
|
|
59
|
-
"@wordpress/patterns": "^2.0.
|
|
58
|
+
"@wordpress/notices": "^5.0.2",
|
|
59
|
+
"@wordpress/patterns": "^2.0.2",
|
|
60
60
|
"@wordpress/primitives": "^4.0.1",
|
|
61
|
-
"@wordpress/private-apis": "^1.0.
|
|
62
|
-
"@wordpress/reusable-blocks": "^5.0.
|
|
63
|
-
"@wordpress/rich-text": "^7.0.
|
|
64
|
-
"@wordpress/server-side-render": "^5.0.
|
|
61
|
+
"@wordpress/private-apis": "^1.0.2",
|
|
62
|
+
"@wordpress/reusable-blocks": "^5.0.2",
|
|
63
|
+
"@wordpress/rich-text": "^7.0.2",
|
|
64
|
+
"@wordpress/server-side-render": "^5.0.2",
|
|
65
65
|
"@wordpress/url": "^4.0.1",
|
|
66
|
-
"@wordpress/viewport": "^6.0.
|
|
66
|
+
"@wordpress/viewport": "^6.0.2",
|
|
67
67
|
"@wordpress/wordcount": "^4.0.1",
|
|
68
68
|
"change-case": "^4.1.2",
|
|
69
69
|
"clsx": "^2.1.1",
|
|
@@ -82,5 +82,5 @@
|
|
|
82
82
|
"publishConfig": {
|
|
83
83
|
"access": "public"
|
|
84
84
|
},
|
|
85
|
-
"gitHead": "
|
|
85
|
+
"gitHead": "d0d80eabf45745725edbb19ce6667157fc68a6aa"
|
|
86
86
|
}
|
package/src/lock-unlock.js
CHANGED
|
@@ -5,6 +5,6 @@ import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/pri
|
|
|
5
5
|
|
|
6
6
|
export const { lock, unlock } =
|
|
7
7
|
__dangerousOptInToUnstableAPIsOnlyForCoreModules(
|
|
8
|
-
'I
|
|
8
|
+
'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.',
|
|
9
9
|
'@wordpress/block-library'
|
|
10
10
|
);
|
package/src/quote/edit.js
CHANGED
|
@@ -121,6 +121,7 @@ export default function QuoteEdit( {
|
|
|
121
121
|
}
|
|
122
122
|
addLabel={ __( 'Add citation' ) }
|
|
123
123
|
removeLabel={ __( 'Remove citation' ) }
|
|
124
|
+
excludeElementClassName
|
|
124
125
|
className="wp-block-quote__citation"
|
|
125
126
|
insertBlocksAfter={ insertBlocksAfter }
|
|
126
127
|
{ ...( ! isWebPlatform ? { textAlign } : {} ) }
|
package/src/social-link/edit.js
CHANGED
|
@@ -6,15 +6,11 @@ import clsx from 'clsx';
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
|
-
import { DELETE, BACKSPACE } from '@wordpress/keycodes';
|
|
10
|
-
import { useDispatch } from '@wordpress/data';
|
|
11
|
-
|
|
12
9
|
import {
|
|
13
10
|
InspectorControls,
|
|
14
11
|
URLPopover,
|
|
15
12
|
URLInput,
|
|
16
13
|
useBlockProps,
|
|
17
|
-
store as blockEditorStore,
|
|
18
14
|
} from '@wordpress/block-editor';
|
|
19
15
|
import { useState } from '@wordpress/element';
|
|
20
16
|
import {
|
|
@@ -36,9 +32,7 @@ const SocialLinkURLPopover = ( {
|
|
|
36
32
|
setAttributes,
|
|
37
33
|
setPopover,
|
|
38
34
|
popoverAnchor,
|
|
39
|
-
clientId,
|
|
40
35
|
} ) => {
|
|
41
|
-
const { removeBlock } = useDispatch( blockEditorStore );
|
|
42
36
|
return (
|
|
43
37
|
<URLPopover
|
|
44
38
|
anchor={ popoverAnchor }
|
|
@@ -62,18 +56,6 @@ const SocialLinkURLPopover = ( {
|
|
|
62
56
|
label={ __( 'Enter social link' ) }
|
|
63
57
|
hideLabelFromVision
|
|
64
58
|
disableSuggestions
|
|
65
|
-
onKeyDown={ ( event ) => {
|
|
66
|
-
if (
|
|
67
|
-
!! url ||
|
|
68
|
-
event.defaultPrevented ||
|
|
69
|
-
! [ BACKSPACE, DELETE ].includes(
|
|
70
|
-
event.keyCode
|
|
71
|
-
)
|
|
72
|
-
) {
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
removeBlock( clientId );
|
|
76
|
-
} }
|
|
77
59
|
/>
|
|
78
60
|
</div>
|
|
79
61
|
<Button
|
|
@@ -91,7 +73,6 @@ const SocialLinkEdit = ( {
|
|
|
91
73
|
context,
|
|
92
74
|
isSelected,
|
|
93
75
|
setAttributes,
|
|
94
|
-
clientId,
|
|
95
76
|
} ) => {
|
|
96
77
|
const { url, service, label = '', rel } = attributes;
|
|
97
78
|
const {
|
|
@@ -178,7 +159,6 @@ const SocialLinkEdit = ( {
|
|
|
178
159
|
setAttributes={ setAttributes }
|
|
179
160
|
setPopover={ setPopover }
|
|
180
161
|
popoverAnchor={ popoverAnchor }
|
|
181
|
-
clientId={ clientId }
|
|
182
162
|
/>
|
|
183
163
|
) }
|
|
184
164
|
</li>
|
|
@@ -161,7 +161,7 @@ function render_block_core_template_part( $attributes ) {
|
|
|
161
161
|
global $wp_embed;
|
|
162
162
|
$content = $wp_embed->autoembed( $content );
|
|
163
163
|
|
|
164
|
-
if ( empty( $attributes['tagName'] ) ) {
|
|
164
|
+
if ( empty( $attributes['tagName'] ) || tag_escape( $attributes['tagName'] ) !== $attributes['tagName'] ) {
|
|
165
165
|
$area_tag = 'div';
|
|
166
166
|
if ( $area_definition && isset( $area_definition['area_tag'] ) ) {
|
|
167
167
|
$area_tag = $area_definition['area_tag'];
|
package/src/utils/caption.js
CHANGED
|
@@ -32,6 +32,7 @@ export function Caption( {
|
|
|
32
32
|
placeholder = __( 'Add caption' ),
|
|
33
33
|
label = __( 'Caption text' ),
|
|
34
34
|
showToolbarButton = true,
|
|
35
|
+
excludeElementClassName,
|
|
35
36
|
className,
|
|
36
37
|
readOnly,
|
|
37
38
|
tagName = 'figcaption',
|
|
@@ -70,6 +71,7 @@ export function Caption( {
|
|
|
70
71
|
},
|
|
71
72
|
[ isCaptionEmpty ]
|
|
72
73
|
);
|
|
74
|
+
|
|
73
75
|
return (
|
|
74
76
|
<>
|
|
75
77
|
{ showToolbarButton && (
|
|
@@ -96,7 +98,9 @@ export function Caption( {
|
|
|
96
98
|
tagName={ tagName }
|
|
97
99
|
className={ clsx(
|
|
98
100
|
className,
|
|
99
|
-
|
|
101
|
+
excludeElementClassName
|
|
102
|
+
? ''
|
|
103
|
+
: __experimentalGetElementClassName( 'caption' )
|
|
100
104
|
) }
|
|
101
105
|
ref={ ref }
|
|
102
106
|
aria-label={ label }
|