@wordpress/block-editor 12.18.0 → 12.18.2
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/components/dimensions-tool/aspect-ratio-tool.js +2 -1
- package/build/components/dimensions-tool/aspect-ratio-tool.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +30 -5
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/hooks.js +10 -9
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +14 -31
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +6 -0
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/rich-text/index.js +1 -1
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/url-popover/image-url-input-ui.js +55 -34
- package/build/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build/components/url-popover/index.js +3 -1
- package/build/components/url-popover/index.js.map +1 -1
- package/build/components/url-popover/link-editor.js +2 -1
- package/build/components/url-popover/link-editor.js.map +1 -1
- package/build/components/url-popover/link-viewer.js +2 -1
- package/build/components/url-popover/link-viewer.js.map +1 -1
- package/build/hooks/dimensions.js +71 -1
- package/build/hooks/dimensions.js.map +1 -1
- package/build/hooks/index.js +2 -8
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/index.native.js +0 -6
- package/build/hooks/index.native.js.map +1 -1
- package/build/hooks/style.js +3 -0
- package/build/hooks/style.js.map +1 -1
- package/build/hooks/use-bindings-attributes.js +2 -2
- package/build/hooks/use-bindings-attributes.js.map +1 -1
- package/build/hooks/use-shadow-props.js +0 -15
- package/build/hooks/use-shadow-props.js.map +1 -1
- package/build/hooks/utils.js +4 -6
- package/build/hooks/utils.js.map +1 -1
- package/build/index.js +0 -7
- package/build/index.js.map +1 -1
- package/build/utils/object.js +0 -17
- package/build/utils/object.js.map +1 -1
- package/build-module/components/dimensions-tool/aspect-ratio-tool.js +2 -1
- package/build-module/components/dimensions-tool/aspect-ratio-tool.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +30 -5
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +10 -9
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +15 -32
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +6 -0
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/rich-text/index.js +1 -1
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/url-popover/image-url-input-ui.js +57 -36
- package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build-module/components/url-popover/index.js +3 -1
- package/build-module/components/url-popover/index.js.map +1 -1
- package/build-module/components/url-popover/link-editor.js +2 -1
- package/build-module/components/url-popover/link-editor.js.map +1 -1
- package/build-module/components/url-popover/link-viewer.js +2 -1
- package/build-module/components/url-popover/link-viewer.js.map +1 -1
- package/build-module/hooks/dimensions.js +70 -2
- package/build-module/hooks/dimensions.js.map +1 -1
- package/build-module/hooks/index.js +3 -2
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/index.native.js +1 -1
- package/build-module/hooks/index.native.js.map +1 -1
- package/build-module/hooks/style.js +3 -0
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/hooks/use-bindings-attributes.js +2 -2
- package/build-module/hooks/use-bindings-attributes.js.map +1 -1
- package/build-module/hooks/use-shadow-props.js +0 -14
- package/build-module/hooks/use-shadow-props.js.map +1 -1
- package/build-module/hooks/utils.js +4 -6
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/index.js +1 -1
- package/build-module/index.js.map +1 -1
- package/build-module/utils/object.js +0 -16
- package/build-module/utils/object.js.map +1 -1
- package/build-style/style-rtl.css +48 -31
- package/build-style/style.css +48 -31
- package/package.json +4 -4
- package/src/components/block-canvas/style.scss +2 -2
- package/src/components/dimensions-tool/aspect-ratio-tool.js +4 -1
- package/src/components/global-styles/dimensions-panel.js +50 -1
- package/src/components/global-styles/hooks.js +9 -8
- package/src/components/global-styles/typography-panel.js +13 -45
- package/src/components/global-styles/use-global-styles-output.js +6 -0
- package/src/components/media-replace-flow/style.scss +1 -1
- package/src/components/rich-text/index.js +1 -2
- package/src/components/url-popover/image-url-input-ui.js +86 -37
- package/src/components/url-popover/index.js +2 -0
- package/src/components/url-popover/link-editor.js +1 -0
- package/src/components/url-popover/link-viewer.js +1 -0
- package/src/components/url-popover/style.scss +51 -31
- package/src/hooks/dimensions.js +74 -3
- package/src/hooks/index.js +3 -1
- package/src/hooks/index.native.js +1 -1
- package/src/hooks/style.js +4 -0
- package/src/hooks/use-bindings-attributes.js +2 -5
- package/src/hooks/use-shadow-props.js +0 -14
- package/src/hooks/utils.js +8 -16
- package/src/index.js +0 -1
- package/src/utils/object.js +0 -16
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_data","_blocks","_deprecated","_interopRequireDefault","_inspectorControls","_globalStyles","_margin","_padding","_store","_lockUnlock","_utils","DIMENSIONS_SUPPORT_KEY","exports","SPACING_SUPPORT_KEY","ALL_SIDES","AXIAL_SIDES","useVisualizer","property","setProperty","useState","hideBlockInterface","showBlockInterface","unlock","useDispatch","blockEditorStore","useEffect","DimensionsInspectorControl","children","resetAllFilter","attributesResetAllFilter","useCallback","attributes","existingStyle","style","updatedStyle","_react","createElement","default","group","DimensionsPanel","clientId","name","setAttributes","settings","isEnabled","useHasDimensionsPanel","value","useSelect","select","getBlockAttributes","visualizedProperty","setVisualizedProperty","onChange","newStyle","cleanEmptyObject","defaultDimensionsControls","getBlockSupport","defaultSpacingControls","defaultControls","Fragment","as","panelId","onVisualize","spacing","padding","PaddingVisualizer","forceShow","margin","MarginVisualizer","useCustomSides","deprecated","since","version"],"sources":["@wordpress/block-editor/src/hooks/dimensions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, useEffect, useCallback } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { getBlockSupport } from '@wordpress/blocks';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport InspectorControls from '../components/inspector-controls';\nimport {\n\tDimensionsPanel as StylesDimensionsPanel,\n\tuseHasDimensionsPanel,\n} from '../components/global-styles';\nimport { MarginVisualizer } from './margin';\nimport { PaddingVisualizer } from './padding';\nimport { store as blockEditorStore } from '../store';\nimport { unlock } from '../lock-unlock';\n\nimport { cleanEmptyObject } from './utils';\n\nexport const DIMENSIONS_SUPPORT_KEY = 'dimensions';\nexport const SPACING_SUPPORT_KEY = 'spacing';\nexport const ALL_SIDES = [ 'top', 'right', 'bottom', 'left' ];\nexport const AXIAL_SIDES = [ 'vertical', 'horizontal' ];\n\nfunction useVisualizer() {\n\tconst [ property, setProperty ] = useState( false );\n\tconst { hideBlockInterface, showBlockInterface } = unlock(\n\t\tuseDispatch( blockEditorStore )\n\t);\n\tuseEffect( () => {\n\t\tif ( ! property ) {\n\t\t\tshowBlockInterface();\n\t\t} else {\n\t\t\thideBlockInterface();\n\t\t}\n\t}, [ property, showBlockInterface, hideBlockInterface ] );\n\n\treturn [ property, setProperty ];\n}\n\nfunction DimensionsInspectorControl( { children, resetAllFilter } ) {\n\tconst attributesResetAllFilter = useCallback(\n\t\t( attributes ) => {\n\t\t\tconst existingStyle = attributes.style;\n\t\t\tconst updatedStyle = resetAllFilter( existingStyle );\n\t\t\treturn {\n\t\t\t\t...attributes,\n\t\t\t\tstyle: updatedStyle,\n\t\t\t};\n\t\t},\n\t\t[ resetAllFilter ]\n\t);\n\n\treturn (\n\t\t<InspectorControls\n\t\t\tgroup=\"dimensions\"\n\t\t\tresetAllFilter={ attributesResetAllFilter }\n\t\t>\n\t\t\t{ children }\n\t\t</InspectorControls>\n\t);\n}\n\nexport function DimensionsPanel( { clientId, name, setAttributes, settings } ) {\n\tconst isEnabled = useHasDimensionsPanel( settings );\n\tconst value = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getBlockAttributes( clientId )?.style,\n\t\t[ clientId ]\n\t);\n\tconst [ visualizedProperty, setVisualizedProperty ] = useVisualizer();\n\tconst onChange = ( newStyle ) => {\n\t\tsetAttributes( {\n\t\t\tstyle: cleanEmptyObject( newStyle ),\n\t\t} );\n\t};\n\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\tconst defaultDimensionsControls = getBlockSupport( name, [\n\t\tDIMENSIONS_SUPPORT_KEY,\n\t\t'__experimentalDefaultControls',\n\t] );\n\tconst defaultSpacingControls = getBlockSupport( name, [\n\t\tSPACING_SUPPORT_KEY,\n\t\t'__experimentalDefaultControls',\n\t] );\n\tconst defaultControls = {\n\t\t...defaultDimensionsControls,\n\t\t...defaultSpacingControls,\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<StylesDimensionsPanel\n\t\t\t\tas={ DimensionsInspectorControl }\n\t\t\t\tpanelId={ clientId }\n\t\t\t\tsettings={ settings }\n\t\t\t\tvalue={ value }\n\t\t\t\tonChange={ onChange }\n\t\t\t\tdefaultControls={ defaultControls }\n\t\t\t\tonVisualize={ setVisualizedProperty }\n\t\t\t/>\n\t\t\t{ !! settings?.spacing?.padding && (\n\t\t\t\t<PaddingVisualizer\n\t\t\t\t\tforceShow={ visualizedProperty === 'padding' }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tvalue={ value }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ !! settings?.spacing?.margin && (\n\t\t\t\t<MarginVisualizer\n\t\t\t\t\tforceShow={ visualizedProperty === 'margin' }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tvalue={ value }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\n/**\n * @deprecated\n */\nexport function useCustomSides() {\n\tdeprecated( 'wp.blockEditor.__experimentalUseCustomSides', {\n\t\tsince: '6.3',\n\t\tversion: '6.4',\n\t} );\n}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ACH,MAAM8C,sBAAsB,GAAG,IAAAD,uBAAe,EAAEf,IAAI,EAAE,CACrD5B,mBAAmB,EACnB,+BAA+B,CAC9B,CAAC;EACH,MAAM6C,eAAe,GAAG;IACvB,GAAGH,yBAAyB;IAC5B,GAAGE;EACJ,CAAC;EAED,OACC,IAAAtB,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAwB,QAAA,QACC,IAAAxB,MAAA,CAAAC,aAAA,EAAC/B,aAAA,CAAAkC,eAAqB;IACrBqB,EAAE,EAAGlC,0BAA4B;IACjCmC,OAAO,EAAGrB,QAAU;IACpBG,QAAQ,EAAGA,QAAU;IACrBG,KAAK,EAAGA,KAAO;IACfM,QAAQ,EAAGA,QAAU;IACrBM,eAAe,EAAGA,eAAiB;IACnCI,WAAW,EAAGX;EAAuB,CACrC,CAAC,EACA,CAAC,CAAER,QAAQ,EAAEoB,OAAO,EAAEC,OAAO,IAC9B,IAAA7B,MAAA,CAAAC,aAAA,EAAC7B,QAAA,CAAA0D,iBAAiB;IACjBC,SAAS,EAAGhB,kBAAkB,KAAK,SAAW;IAC9CV,QAAQ,EAAGA,QAAU;IACrBM,KAAK,EAAGA;EAAO,CACf,CACD,EACC,CAAC,CAAEH,QAAQ,EAAEoB,OAAO,EAAEI,MAAM,IAC7B,IAAAhC,MAAA,CAAAC,aAAA,EAAC9B,OAAA,CAAA8D,gBAAgB;IAChBF,SAAS,EAAGhB,kBAAkB,KAAK,QAAU;IAC7CV,QAAQ,EAAGA,QAAU;IACrBM,KAAK,EAAGA;EAAO,CACf,CAED,CAAC;AAEL;;AAEA;AACA;AACA;AACO,SAASuB,cAAcA,CAAA,EAAG;EAChC,IAAAC,mBAAU,EAAE,6CAA6C,EAAE;IAC1DC,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ"}
|
|
1
|
+
{"version":3,"names":["_classnames","_interopRequireDefault","require","_element","_data","_blocks","_deprecated","_inspectorControls","_globalStyles","_margin","_padding","_store","_lockUnlock","_utils","DIMENSIONS_SUPPORT_KEY","exports","SPACING_SUPPORT_KEY","ALL_SIDES","AXIAL_SIDES","useVisualizer","property","setProperty","useState","hideBlockInterface","showBlockInterface","unlock","useDispatch","blockEditorStore","useEffect","DimensionsInspectorControl","children","resetAllFilter","attributesResetAllFilter","useCallback","attributes","existingStyle","style","updatedStyle","_react","createElement","default","group","DimensionsPanel","clientId","name","setAttributes","settings","isEnabled","useHasDimensionsPanel","value","useSelect","select","getBlockAttributes","visualizedProperty","setVisualizedProperty","onChange","newStyle","cleanEmptyObject","defaultDimensionsControls","getBlockSupport","defaultSpacingControls","defaultControls","Fragment","as","panelId","onVisualize","spacing","padding","PaddingVisualizer","forceShow","margin","MarginVisualizer","hasDimensionsSupport","blockName","feature","Platform","OS","support","aspectRatio","minHeight","_default","useBlockProps","attributeKeys","hasSupport","shouldSkipSerialization","className","classnames","dimensions","inlineStyleOverrides","useCustomSides","deprecated","since","version"],"sources":["@wordpress/block-editor/src/hooks/dimensions.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Platform, useState, useEffect, useCallback } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { getBlockSupport } from '@wordpress/blocks';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport InspectorControls from '../components/inspector-controls';\nimport {\n\tDimensionsPanel as StylesDimensionsPanel,\n\tuseHasDimensionsPanel,\n} from '../components/global-styles';\nimport { MarginVisualizer } from './margin';\nimport { PaddingVisualizer } from './padding';\nimport { store as blockEditorStore } from '../store';\nimport { unlock } from '../lock-unlock';\nimport { cleanEmptyObject, shouldSkipSerialization } from './utils';\n\nexport const DIMENSIONS_SUPPORT_KEY = 'dimensions';\nexport const SPACING_SUPPORT_KEY = 'spacing';\nexport const ALL_SIDES = [ 'top', 'right', 'bottom', 'left' ];\nexport const AXIAL_SIDES = [ 'vertical', 'horizontal' ];\n\nfunction useVisualizer() {\n\tconst [ property, setProperty ] = useState( false );\n\tconst { hideBlockInterface, showBlockInterface } = unlock(\n\t\tuseDispatch( blockEditorStore )\n\t);\n\tuseEffect( () => {\n\t\tif ( ! property ) {\n\t\t\tshowBlockInterface();\n\t\t} else {\n\t\t\thideBlockInterface();\n\t\t}\n\t}, [ property, showBlockInterface, hideBlockInterface ] );\n\n\treturn [ property, setProperty ];\n}\n\nfunction DimensionsInspectorControl( { children, resetAllFilter } ) {\n\tconst attributesResetAllFilter = useCallback(\n\t\t( attributes ) => {\n\t\t\tconst existingStyle = attributes.style;\n\t\t\tconst updatedStyle = resetAllFilter( existingStyle );\n\t\t\treturn {\n\t\t\t\t...attributes,\n\t\t\t\tstyle: updatedStyle,\n\t\t\t};\n\t\t},\n\t\t[ resetAllFilter ]\n\t);\n\n\treturn (\n\t\t<InspectorControls\n\t\t\tgroup=\"dimensions\"\n\t\t\tresetAllFilter={ attributesResetAllFilter }\n\t\t>\n\t\t\t{ children }\n\t\t</InspectorControls>\n\t);\n}\n\nexport function DimensionsPanel( { clientId, name, setAttributes, settings } ) {\n\tconst isEnabled = useHasDimensionsPanel( settings );\n\tconst value = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getBlockAttributes( clientId )?.style,\n\t\t[ clientId ]\n\t);\n\tconst [ visualizedProperty, setVisualizedProperty ] = useVisualizer();\n\tconst onChange = ( newStyle ) => {\n\t\tsetAttributes( {\n\t\t\tstyle: cleanEmptyObject( newStyle ),\n\t\t} );\n\t};\n\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\tconst defaultDimensionsControls = getBlockSupport( name, [\n\t\tDIMENSIONS_SUPPORT_KEY,\n\t\t'__experimentalDefaultControls',\n\t] );\n\tconst defaultSpacingControls = getBlockSupport( name, [\n\t\tSPACING_SUPPORT_KEY,\n\t\t'__experimentalDefaultControls',\n\t] );\n\tconst defaultControls = {\n\t\t...defaultDimensionsControls,\n\t\t...defaultSpacingControls,\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<StylesDimensionsPanel\n\t\t\t\tas={ DimensionsInspectorControl }\n\t\t\t\tpanelId={ clientId }\n\t\t\t\tsettings={ settings }\n\t\t\t\tvalue={ value }\n\t\t\t\tonChange={ onChange }\n\t\t\t\tdefaultControls={ defaultControls }\n\t\t\t\tonVisualize={ setVisualizedProperty }\n\t\t\t/>\n\t\t\t{ !! settings?.spacing?.padding && (\n\t\t\t\t<PaddingVisualizer\n\t\t\t\t\tforceShow={ visualizedProperty === 'padding' }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tvalue={ value }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ !! settings?.spacing?.margin && (\n\t\t\t\t<MarginVisualizer\n\t\t\t\t\tforceShow={ visualizedProperty === 'margin' }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tvalue={ value }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\n/**\n * Determine whether there is block support for dimensions.\n *\n * @param {string} blockName Block name.\n * @param {string} feature Background image feature to check for.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasDimensionsSupport( blockName, feature = 'any' ) {\n\tif ( Platform.OS !== 'web' ) {\n\t\treturn false;\n\t}\n\n\tconst support = getBlockSupport( blockName, DIMENSIONS_SUPPORT_KEY );\n\n\tif ( support === true ) {\n\t\treturn true;\n\t}\n\n\tif ( feature === 'any' ) {\n\t\treturn !! ( support?.aspectRatio || !! support?.minHeight );\n\t}\n\n\treturn !! support?.[ feature ];\n}\n\nexport default {\n\tuseBlockProps,\n\tattributeKeys: [ 'minHeight', 'style' ],\n\thasSupport( name ) {\n\t\treturn hasDimensionsSupport( name, 'aspectRatio' );\n\t},\n};\n\nfunction useBlockProps( { name, minHeight, style } ) {\n\tif (\n\t\t! hasDimensionsSupport( name, 'aspectRatio' ) ||\n\t\tshouldSkipSerialization( name, DIMENSIONS_SUPPORT_KEY, 'aspectRatio' )\n\t) {\n\t\treturn {};\n\t}\n\n\tconst className = classnames( {\n\t\t'has-aspect-ratio': !! style?.dimensions?.aspectRatio,\n\t} );\n\n\t// Allow dimensions-based inline style overrides to override any global styles rules that\n\t// might be set for the block, and therefore affect the display of the aspect ratio.\n\tconst inlineStyleOverrides = {};\n\n\t// Apply rules to unset incompatible styles.\n\t// Note that a set `aspectRatio` will win out if both an aspect ratio and a minHeight are set.\n\t// This is because the aspect ratio is a newer block support, so (in theory) any aspect ratio\n\t// that is set should be intentional and should override any existing minHeight. The Cover block\n\t// and dimensions controls have logic that will manually clear the aspect ratio if a minHeight\n\t// is set.\n\tif ( style?.dimensions?.aspectRatio ) {\n\t\t// To ensure the aspect ratio does not get overridden by `minHeight` unset any existing rule.\n\t\tinlineStyleOverrides.minHeight = 'unset';\n\t} else if ( minHeight || style?.dimensions?.minHeight ) {\n\t\t// To ensure the minHeight does not get overridden by `aspectRatio` unset any existing rule.\n\t\tinlineStyleOverrides.aspectRatio = 'unset';\n\t}\n\n\treturn { className, style: inlineStyleOverrides };\n}\n\n/**\n * @deprecated\n */\nexport function useCustomSides() {\n\tdeprecated( 'wp.blockEditor.__experimentalUseCustomSides', {\n\t\tsince: '6.3',\n\t\tversion: '6.4',\n\t} );\n}\n"],"mappings":";;;;;;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAL,sBAAA,CAAAC,OAAA;AAKA,IAAAK,kBAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,aAAA,GAAAN,OAAA;AAIA,IAAAO,OAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AACA,IAAAU,WAAA,GAAAV,OAAA;AACA,IAAAW,MAAA,GAAAX,OAAA;AAzBA;AACA;AACA;;AAGA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AAI,EAAE,aAAc,CAAC;EACnD;AACD,CAAC;AAAA7B,OAAA,CAAAyB,OAAA,GAAAwC,QAAA;AAED,SAASC,aAAaA,CAAE;EAAErC,IAAI;EAAEmC,SAAS;EAAE3C;AAAM,CAAC,EAAG;EACpD,IACC,CAAEoC,oBAAoB,CAAE5B,IAAI,EAAE,aAAc,CAAC,IAC7C,IAAAwC,8BAAuB,EAAExC,IAAI,EAAE9B,sBAAsB,EAAE,aAAc,CAAC,EACrE;IACD,OAAO,CAAC,CAAC;EACV;EAEA,MAAMuE,SAAS,GAAG,IAAAC,mBAAU,EAAE;IAC7B,kBAAkB,EAAE,CAAC,CAAElD,KAAK,EAAEmD,UAAU,EAAET;EAC3C,CAAE,CAAC;;EAEH;EACA;EACA,MAAMU,oBAAoB,GAAG,CAAC,CAAC;;EAE/B;EACA;EACA;EACA;EACA;EACA;EACA,IAAKpD,KAAK,EAAEmD,UAAU,EAAET,WAAW,EAAG;IACrC;IACAU,oBAAoB,CAACT,SAAS,GAAG,OAAO;EACzC,CAAC,MAAM,IAAKA,SAAS,IAAI3C,KAAK,EAAEmD,UAAU,EAAER,SAAS,EAAG;IACvD;IACAS,oBAAoB,CAACV,WAAW,GAAG,OAAO;EAC3C;EAEA,OAAO;IAAEO,SAAS;IAAEjD,KAAK,EAAEoD;EAAqB,CAAC;AAClD;;AAEA;AACA;AACA;AACO,SAASC,cAAcA,CAAA,EAAG;EAChC,IAAAC,mBAAU,EAAE,6CAA6C,EAAE;IAC1DC,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ"}
|
package/build/hooks/index.js
CHANGED
|
@@ -76,12 +76,6 @@ Object.defineProperty(exports, "useLayoutStyles", {
|
|
|
76
76
|
return _layout.useLayoutStyles;
|
|
77
77
|
}
|
|
78
78
|
});
|
|
79
|
-
Object.defineProperty(exports, "useShadowProps", {
|
|
80
|
-
enumerable: true,
|
|
81
|
-
get: function () {
|
|
82
|
-
return _useShadowProps.useShadowProps;
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
79
|
var _utils = require("./utils");
|
|
86
80
|
require("./compat");
|
|
87
81
|
var _align = _interopRequireDefault(require("./align"));
|
|
@@ -93,6 +87,7 @@ require("./generated-class-name");
|
|
|
93
87
|
var _style = _interopRequireDefault(require("./style"));
|
|
94
88
|
require("./settings");
|
|
95
89
|
var _color = _interopRequireDefault(require("./color"));
|
|
90
|
+
var _dimensions = _interopRequireWildcard(require("./dimensions"));
|
|
96
91
|
var _duotone = _interopRequireDefault(require("./duotone"));
|
|
97
92
|
var _fontFamily = _interopRequireDefault(require("./font-family"));
|
|
98
93
|
var _fontSize = _interopRequireDefault(require("./font-size"));
|
|
@@ -105,7 +100,6 @@ require("./metadata");
|
|
|
105
100
|
var _blockHooks = _interopRequireDefault(require("./block-hooks"));
|
|
106
101
|
var _blockRenaming = _interopRequireDefault(require("./block-renaming"));
|
|
107
102
|
require("./use-bindings-attributes");
|
|
108
|
-
var _dimensions = require("./dimensions");
|
|
109
103
|
var _useBorderProps = require("./use-border-props");
|
|
110
104
|
var _useShadowProps = require("./use-shadow-props");
|
|
111
105
|
var _useColorProps = require("./use-color-props");
|
|
@@ -120,6 +114,6 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
120
114
|
*/
|
|
121
115
|
|
|
122
116
|
(0, _utils.createBlockEditFilter)([_align.default, _anchor.default, _customClassName.default, _style.default, _duotone.default, _position.default, _layout.default, _contentLockUi.default, _blockHooks.default, _blockRenaming.default].filter(Boolean));
|
|
123
|
-
(0, _utils.createBlockListBlockFilter)([_align.default, _style.default, _color.default, _duotone.default, _fontFamily.default, _fontSize.default, _border.default, _position.default, _layoutChild.default]);
|
|
117
|
+
(0, _utils.createBlockListBlockFilter)([_align.default, _style.default, _color.default, _dimensions.default, _duotone.default, _fontFamily.default, _fontSize.default, _border.default, _position.default, _layoutChild.default]);
|
|
124
118
|
(0, _utils.createBlockSaveFilter)([_align.default, _anchor.default, _ariaLabel.default, _customClassName.default, _border.default, _color.default, _style.default, _fontFamily.default, _fontSize.default]);
|
|
125
119
|
//# sourceMappingURL=index.js.map
|
package/build/hooks/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_utils","require","_align","_interopRequireDefault","_anchor","_ariaLabel","_customClassName","_style","_color","_duotone","_fontFamily","_fontSize","_border","_position","_layout","
|
|
1
|
+
{"version":3,"names":["_utils","require","_align","_interopRequireDefault","_anchor","_ariaLabel","_customClassName","_style","_color","_dimensions","_interopRequireWildcard","_duotone","_fontFamily","_fontSize","_border","_position","_layout","_layoutChild","_contentLockUi","_blockHooks","_blockRenaming","_useBorderProps","_useShadowProps","_useColorProps","_useSpacingProps","_useTypographyProps","_gap","_useCachedTruthy","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","createBlockEditFilter","align","anchor","customClassName","style","duotone","position","layout","contentLockUI","blockHooks","blockRenaming","filter","Boolean","createBlockListBlockFilter","color","dimensions","fontFamily","fontSize","border","childLayout","createBlockSaveFilter","ariaLabel"],"sources":["@wordpress/block-editor/src/hooks/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport {\n\tcreateBlockEditFilter,\n\tcreateBlockListBlockFilter,\n\tcreateBlockSaveFilter,\n} from './utils';\nimport './compat';\nimport align from './align';\nimport './lock';\nimport anchor from './anchor';\nimport ariaLabel from './aria-label';\nimport customClassName from './custom-class-name';\nimport './generated-class-name';\nimport style from './style';\nimport './settings';\nimport color from './color';\nimport dimensions from './dimensions';\nimport duotone from './duotone';\nimport fontFamily from './font-family';\nimport fontSize from './font-size';\nimport border from './border';\nimport position from './position';\nimport layout from './layout';\nimport childLayout from './layout-child';\nimport contentLockUI from './content-lock-ui';\nimport './metadata';\nimport blockHooks from './block-hooks';\nimport blockRenaming from './block-renaming';\nimport './use-bindings-attributes';\n\ncreateBlockEditFilter(\n\t[\n\t\talign,\n\t\tanchor,\n\t\tcustomClassName,\n\t\tstyle,\n\t\tduotone,\n\t\tposition,\n\t\tlayout,\n\t\tcontentLockUI,\n\t\tblockHooks,\n\t\tblockRenaming,\n\t].filter( Boolean )\n);\ncreateBlockListBlockFilter( [\n\talign,\n\tstyle,\n\tcolor,\n\tdimensions,\n\tduotone,\n\tfontFamily,\n\tfontSize,\n\tborder,\n\tposition,\n\tchildLayout,\n] );\ncreateBlockSaveFilter( [\n\talign,\n\tanchor,\n\tariaLabel,\n\tcustomClassName,\n\tborder,\n\tcolor,\n\tstyle,\n\tfontFamily,\n\tfontSize,\n] );\n\nexport { useCustomSides } from './dimensions';\nexport { useLayoutClasses, useLayoutStyles } from './layout';\nexport { getBorderClassesAndStyles, useBorderProps } from './use-border-props';\nexport { getShadowClassesAndStyles } from './use-shadow-props';\nexport { getColorClassesAndStyles, useColorProps } from './use-color-props';\nexport { getSpacingClassesAndStyles } from './use-spacing-props';\nexport { getTypographyClassesAndStyles } from './use-typography-props';\nexport { getGapCSSValue } from './gap';\nexport { useCachedTruthy } from './use-cached-truthy';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAKAA,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACAA,OAAA;AACA,IAAAG,OAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,UAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,gBAAA,GAAAH,sBAAA,CAAAF,OAAA;AACAA,OAAA;AACA,IAAAM,MAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACAA,OAAA;AACA,IAAAO,MAAA,GAAAL,sBAAA,CAAAF,OAAA;AACA,IAAAQ,WAAA,GAAAC,uBAAA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_useEditorWrapperStyles.useEditorWrapperStyles;
|
|
53
53
|
}
|
|
54
54
|
});
|
|
55
|
-
Object.defineProperty(exports, "useShadowProps", {
|
|
56
|
-
enumerable: true,
|
|
57
|
-
get: function () {
|
|
58
|
-
return _useShadowProps.useShadowProps;
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
55
|
var _utils = require("./utils");
|
|
62
56
|
require("./compat");
|
|
63
57
|
var _align = _interopRequireDefault(require("./align"));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_utils","require","_align","_interopRequireDefault","_anchor","_customClassName","_style","_color","_fontSize","_useBorderProps","_useShadowProps","_useColorProps","_useSpacingProps","_useCachedTruthy","_useEditorWrapperStyles","createBlockEditFilter","align","anchor","style","createBlockListBlockFilter","color","fontSize","createBlockSaveFilter","customClassName"],"sources":["@wordpress/block-editor/src/hooks/index.native.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport {\n\tcreateBlockEditFilter,\n\tcreateBlockListBlockFilter,\n\tcreateBlockSaveFilter,\n} from './utils';\nimport './compat';\nimport align from './align';\nimport anchor from './anchor';\nimport customClassName from './custom-class-name';\nimport './generated-class-name';\nimport style from './style';\nimport color from './color';\nimport fontSize from './font-size';\nimport './layout';\n\ncreateBlockEditFilter( [ align, anchor, style ] );\ncreateBlockListBlockFilter( [ align, style, color, fontSize ] );\ncreateBlockSaveFilter( [\n\talign,\n\tanchor,\n\tcustomClassName,\n\tcolor,\n\tstyle,\n\tfontSize,\n] );\n\nexport { getBorderClassesAndStyles, useBorderProps } from './use-border-props';\nexport { getShadowClassesAndStyles
|
|
1
|
+
{"version":3,"names":["_utils","require","_align","_interopRequireDefault","_anchor","_customClassName","_style","_color","_fontSize","_useBorderProps","_useShadowProps","_useColorProps","_useSpacingProps","_useCachedTruthy","_useEditorWrapperStyles","createBlockEditFilter","align","anchor","style","createBlockListBlockFilter","color","fontSize","createBlockSaveFilter","customClassName"],"sources":["@wordpress/block-editor/src/hooks/index.native.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport {\n\tcreateBlockEditFilter,\n\tcreateBlockListBlockFilter,\n\tcreateBlockSaveFilter,\n} from './utils';\nimport './compat';\nimport align from './align';\nimport anchor from './anchor';\nimport customClassName from './custom-class-name';\nimport './generated-class-name';\nimport style from './style';\nimport color from './color';\nimport fontSize from './font-size';\nimport './layout';\n\ncreateBlockEditFilter( [ align, anchor, style ] );\ncreateBlockListBlockFilter( [ align, style, color, fontSize ] );\ncreateBlockSaveFilter( [\n\talign,\n\tanchor,\n\tcustomClassName,\n\tcolor,\n\tstyle,\n\tfontSize,\n] );\n\nexport { getBorderClassesAndStyles, useBorderProps } from './use-border-props';\nexport { getShadowClassesAndStyles } from './use-shadow-props';\nexport { getColorClassesAndStyles, useColorProps } from './use-color-props';\nexport { getSpacingClassesAndStyles } from './use-spacing-props';\nexport { useCachedTruthy } from './use-cached-truthy';\nexport { useEditorWrapperStyles } from './use-editor-wrapper-styles';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAKAA,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,gBAAA,GAAAF,sBAAA,CAAAF,OAAA;AACAA,OAAA;AACA,IAAAK,MAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,MAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACA,IAAAO,SAAA,GAAAL,sBAAA,CAAAF,OAAA;AACAA,OAAA;AAaA,IAAAQ,eAAA,GAAAR,OAAA;AACA,IAAAS,eAAA,GAAAT,OAAA;AACA,IAAAU,cAAA,GAAAV,OAAA;AACA,IAAAW,gBAAA,GAAAX,OAAA;AACA,IAAAY,gBAAA,GAAAZ,OAAA;AACA,IAAAa,uBAAA,GAAAb,OAAA;AAlCA;AACA;AACA;;AAgBA,IAAAc,4BAAqB,EAAE,CAAEC,cAAK,EAAEC,eAAM,EAAEC,cAAK,CAAG,CAAC;AACjD,IAAAC,iCAA0B,EAAE,CAAEH,cAAK,EAAEE,cAAK,EAAEE,cAAK,EAAEC,iBAAQ,CAAG,CAAC;AAC/D,IAAAC,4BAAqB,EAAE,CACtBN,cAAK,EACLC,eAAM,EACNM,wBAAe,EACfH,cAAK,EACLF,cAAK,EACLG,iBAAQ,CACP,CAAC"}
|
package/build/hooks/style.js
CHANGED
|
@@ -103,10 +103,13 @@ const skipSerializationPathsEdit = {
|
|
|
103
103
|
*/
|
|
104
104
|
const skipSerializationPathsSave = {
|
|
105
105
|
...skipSerializationPathsEdit,
|
|
106
|
+
[`${_dimensions.DIMENSIONS_SUPPORT_KEY}.aspectRatio`]: [`${_dimensions.DIMENSIONS_SUPPORT_KEY}.aspectRatio`],
|
|
107
|
+
// Skip serialization of aspect ratio in save mode.
|
|
106
108
|
[`${_background.BACKGROUND_SUPPORT_KEY}`]: [_background.BACKGROUND_SUPPORT_KEY] // Skip serialization of background support in save mode.
|
|
107
109
|
};
|
|
108
110
|
|
|
109
111
|
const skipSerializationPathsSaveChecks = {
|
|
112
|
+
[`${_dimensions.DIMENSIONS_SUPPORT_KEY}.aspectRatio`]: true,
|
|
110
113
|
[`${_background.BACKGROUND_SUPPORT_KEY}`]: true
|
|
111
114
|
};
|
|
112
115
|
|
package/build/hooks/style.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_hooks","_blocks","_compose","_styleEngine","_background","_border","_color","_typography","_dimensions","_effects","_utils","_utils2","_blockEditingMode","styleSupportKeys","TYPOGRAPHY_SUPPORT_KEYS","EFFECTS_SUPPORT_KEYS","BORDER_SUPPORT_KEY","COLOR_SUPPORT_KEY","DIMENSIONS_SUPPORT_KEY","BACKGROUND_SUPPORT_KEY","SPACING_SUPPORT_KEY","hasStyleSupport","nameOrType","some","key","hasBlockSupport","getInlineStyles","styles","output","getCSSRules","forEach","rule","value","addAttribute","settings","attributes","style","Object","assign","type","skipSerializationPathsEdit","TYPOGRAPHY_SUPPORT_KEY","SHADOW_SUPPORT_KEY","skipSerializationPathsSave","skipSerializationPathsSaveChecks","renamedFeatures","gradients","omitStyle","paths","preserveReference","newStyle","JSON","parse","stringify","Array","isArray","path","split","length","firstSubpath","restPath","addSaveProps","props","blockNameOrType","skipPaths","entries","indicator","skipSerialization","getBlockSupport","featureName","feature","BlockStyleControls","clientId","name","setAttributes","__unstableParentLayout","useBlockSettings","blockEditingMode","useBlockEditingMode","passedProps","_react","createElement","Fragment","ColorEdit","BackgroundImagePanel","TypographyPanel","BorderPanel","DimensionsPanel","EffectsPanel","_default","edit","hasSupport","attributeKeys","useBlockProps","exports","default","elementTypes","elementType","pseudo","elements","blockElementsContainerIdentifier","useInstanceId","baseElementSelector","blockElementStyles","useMemo","elementCSSRules","shouldSkipSerialization","elementStyles","selector","scopeSelector","ELEMENTS","push","compileCSS","pseudoSelector","element","join","undefined","useStyleOverride","css","className","addFilter"],"sources":["@wordpress/block-editor/src/hooks/style.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { addFilter } from '@wordpress/hooks';\nimport {\n\tgetBlockSupport,\n\thasBlockSupport,\n\t__EXPERIMENTAL_ELEMENTS as ELEMENTS,\n} from '@wordpress/blocks';\nimport { useInstanceId } from '@wordpress/compose';\nimport { getCSSRules, compileCSS } from '@wordpress/style-engine';\n\n/**\n * Internal dependencies\n */\nimport { BACKGROUND_SUPPORT_KEY, BackgroundImagePanel } from './background';\nimport { BORDER_SUPPORT_KEY, BorderPanel } from './border';\nimport { COLOR_SUPPORT_KEY, ColorEdit } from './color';\nimport {\n\tTypographyPanel,\n\tTYPOGRAPHY_SUPPORT_KEY,\n\tTYPOGRAPHY_SUPPORT_KEYS,\n} from './typography';\nimport {\n\tDIMENSIONS_SUPPORT_KEY,\n\tSPACING_SUPPORT_KEY,\n\tDimensionsPanel,\n} from './dimensions';\nimport {\n\tEFFECTS_SUPPORT_KEYS,\n\tSHADOW_SUPPORT_KEY,\n\tEffectsPanel,\n} from './effects';\nimport {\n\tshouldSkipSerialization,\n\tuseStyleOverride,\n\tuseBlockSettings,\n} from './utils';\nimport { scopeSelector } from '../components/global-styles/utils';\nimport { useBlockEditingMode } from '../components/block-editing-mode';\n\nconst styleSupportKeys = [\n\t...TYPOGRAPHY_SUPPORT_KEYS,\n\t...EFFECTS_SUPPORT_KEYS,\n\tBORDER_SUPPORT_KEY,\n\tCOLOR_SUPPORT_KEY,\n\tDIMENSIONS_SUPPORT_KEY,\n\tBACKGROUND_SUPPORT_KEY,\n\tSPACING_SUPPORT_KEY,\n];\n\nconst hasStyleSupport = ( nameOrType ) =>\n\tstyleSupportKeys.some( ( key ) => hasBlockSupport( nameOrType, key ) );\n\n/**\n * Returns the inline styles to add depending on the style object\n *\n * @param {Object} styles Styles configuration.\n *\n * @return {Object} Flattened CSS variables declaration.\n */\nexport function getInlineStyles( styles = {} ) {\n\tconst output = {};\n\t// The goal is to move everything to server side generated engine styles\n\t// This is temporary as we absorb more and more styles into the engine.\n\tgetCSSRules( styles ).forEach( ( rule ) => {\n\t\toutput[ rule.key ] = rule.value;\n\t} );\n\n\treturn output;\n}\n\n/**\n * Filters registered block settings, extending attributes to include `style` attribute.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nfunction addAttribute( settings ) {\n\tif ( ! hasStyleSupport( settings ) ) {\n\t\treturn settings;\n\t}\n\n\t// Allow blocks to specify their own attribute definition with default values if needed.\n\tif ( ! settings.attributes.style ) {\n\t\tObject.assign( settings.attributes, {\n\t\t\tstyle: {\n\t\t\t\ttype: 'object',\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn settings;\n}\n\n/**\n * A dictionary of paths to flag skipping block support serialization as the key,\n * with values providing the style paths to be omitted from serialization.\n *\n * @constant\n * @type {Record<string, string[]>}\n */\nconst skipSerializationPathsEdit = {\n\t[ `${ BORDER_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [ 'border' ],\n\t[ `${ COLOR_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tCOLOR_SUPPORT_KEY,\n\t],\n\t[ `${ TYPOGRAPHY_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tTYPOGRAPHY_SUPPORT_KEY,\n\t],\n\t[ `${ DIMENSIONS_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tDIMENSIONS_SUPPORT_KEY,\n\t],\n\t[ `${ SPACING_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tSPACING_SUPPORT_KEY,\n\t],\n\t[ `${ SHADOW_SUPPORT_KEY }` ]: [ SHADOW_SUPPORT_KEY ],\n};\n\n/**\n * A dictionary of paths to flag skipping block support serialization as the key,\n * with values providing the style paths to be omitted from serialization.\n *\n * Extends the Edit skip paths to enable skipping additional paths in just\n * the Save component. This allows a block support to be serialized within the\n * editor, while using an alternate approach, such as server-side rendering, when\n * the support is saved.\n *\n * @constant\n * @type {Record<string, string[]>}\n */\nconst skipSerializationPathsSave = {\n\t...skipSerializationPathsEdit,\n\t[ `${ BACKGROUND_SUPPORT_KEY }` ]: [ BACKGROUND_SUPPORT_KEY ], // Skip serialization of background support in save mode.\n};\n\nconst skipSerializationPathsSaveChecks = {\n\t[ `${ BACKGROUND_SUPPORT_KEY }` ]: true,\n};\n\n/**\n * A dictionary used to normalize feature names between support flags, style\n * object properties and __experimentSkipSerialization configuration arrays.\n *\n * This allows not having to provide a migration for a support flag and possible\n * backwards compatibility bridges, while still achieving consistency between\n * the support flag and the skip serialization array.\n *\n * @constant\n * @type {Record<string, string>}\n */\nconst renamedFeatures = { gradients: 'gradient' };\n\n/**\n * A utility function used to remove one or more paths from a style object.\n * Works in a way similar to Lodash's `omit()`. See unit tests and examples below.\n *\n * It supports a single string path:\n *\n * ```\n * omitStyle( { color: 'red' }, 'color' ); // {}\n * ```\n *\n * or an array of paths:\n *\n * ```\n * omitStyle( { color: 'red', background: '#fff' }, [ 'color', 'background' ] ); // {}\n * ```\n *\n * It also allows you to specify paths at multiple levels in a string.\n *\n * ```\n * omitStyle( { typography: { textDecoration: 'underline' } }, 'typography.textDecoration' ); // {}\n * ```\n *\n * You can remove multiple paths at the same time:\n *\n * ```\n * omitStyle(\n * \t\t{\n * \t\t\ttypography: {\n * \t\t\t\ttextDecoration: 'underline',\n * \t\t\t\ttextTransform: 'uppercase',\n * \t\t\t}\n *\t\t},\n *\t\t[\n * \t\t\t'typography.textDecoration',\n * \t\t\t'typography.textTransform',\n *\t\t]\n * );\n * // {}\n * ```\n *\n * You can also specify nested paths as arrays:\n *\n * ```\n * omitStyle(\n * \t\t{\n * \t\t\ttypography: {\n * \t\t\t\ttextDecoration: 'underline',\n * \t\t\t\ttextTransform: 'uppercase',\n * \t\t\t}\n *\t\t},\n *\t\t[\n * \t\t\t[ 'typography', 'textDecoration' ],\n * \t\t\t[ 'typography', 'textTransform' ],\n *\t\t]\n * );\n * // {}\n * ```\n *\n * With regards to nesting of styles, infinite depth is supported:\n *\n * ```\n * omitStyle(\n * \t\t{\n * \t\t\tborder: {\n * \t\t\t\tradius: {\n * \t\t\t\t\ttopLeft: '10px',\n * \t\t\t\t\ttopRight: '0.5rem',\n * \t\t\t\t}\n * \t\t\t}\n *\t\t},\n *\t\t[\n * \t\t\t[ 'border', 'radius', 'topRight' ],\n *\t\t]\n * );\n * // { border: { radius: { topLeft: '10px' } } }\n * ```\n *\n * The third argument, `preserveReference`, defines how to treat the input style object.\n * It is mostly necessary to properly handle mutation when recursively handling the style object.\n * Defaulting to `false`, this will always create a new object, avoiding to mutate `style`.\n * However, when recursing, we change that value to `true` in order to work with a single copy\n * of the original style object.\n *\n * @see https://lodash.com/docs/4.17.15#omit\n *\n * @param {Object} style Styles object.\n * @param {Array|string} paths Paths to remove.\n * @param {boolean} preserveReference True to mutate the `style` object, false otherwise.\n * @return {Object} Styles object with the specified paths removed.\n */\nexport function omitStyle( style, paths, preserveReference = false ) {\n\tif ( ! style ) {\n\t\treturn style;\n\t}\n\n\tlet newStyle = style;\n\tif ( ! preserveReference ) {\n\t\tnewStyle = JSON.parse( JSON.stringify( style ) );\n\t}\n\n\tif ( ! Array.isArray( paths ) ) {\n\t\tpaths = [ paths ];\n\t}\n\n\tpaths.forEach( ( path ) => {\n\t\tif ( ! Array.isArray( path ) ) {\n\t\t\tpath = path.split( '.' );\n\t\t}\n\n\t\tif ( path.length > 1 ) {\n\t\t\tconst [ firstSubpath, ...restPath ] = path;\n\t\t\tomitStyle( newStyle[ firstSubpath ], [ restPath ], true );\n\t\t} else if ( path.length === 1 ) {\n\t\t\tdelete newStyle[ path[ 0 ] ];\n\t\t}\n\t} );\n\n\treturn newStyle;\n}\n\n/**\n * Override props assigned to save component to inject the CSS variables definition.\n *\n * @param {Object} props Additional props applied to save element.\n * @param {Object|string} blockNameOrType Block type.\n * @param {Object} attributes Block attributes.\n * @param {?Record<string, string[]>} skipPaths An object of keys and paths to skip serialization.\n *\n * @return {Object} Filtered props applied to save element.\n */\nexport function addSaveProps(\n\tprops,\n\tblockNameOrType,\n\tattributes,\n\tskipPaths = skipSerializationPathsSave\n) {\n\tif ( ! hasStyleSupport( blockNameOrType ) ) {\n\t\treturn props;\n\t}\n\n\tlet { style } = attributes;\n\tObject.entries( skipPaths ).forEach( ( [ indicator, path ] ) => {\n\t\tconst skipSerialization =\n\t\t\tskipSerializationPathsSaveChecks[ indicator ] ||\n\t\t\tgetBlockSupport( blockNameOrType, indicator );\n\n\t\tif ( skipSerialization === true ) {\n\t\t\tstyle = omitStyle( style, path );\n\t\t}\n\n\t\tif ( Array.isArray( skipSerialization ) ) {\n\t\t\tskipSerialization.forEach( ( featureName ) => {\n\t\t\t\tconst feature = renamedFeatures[ featureName ] || featureName;\n\t\t\t\tstyle = omitStyle( style, [ [ ...path, feature ] ] );\n\t\t\t} );\n\t\t}\n\t} );\n\n\tprops.style = {\n\t\t...getInlineStyles( style ),\n\t\t...props.style,\n\t};\n\n\treturn props;\n}\n\nfunction BlockStyleControls( {\n\tclientId,\n\tname,\n\tsetAttributes,\n\t__unstableParentLayout,\n} ) {\n\tconst settings = useBlockSettings( name, __unstableParentLayout );\n\tconst blockEditingMode = useBlockEditingMode();\n\tconst passedProps = {\n\t\tclientId,\n\t\tname,\n\t\tsetAttributes,\n\t\tsettings,\n\t};\n\tif ( blockEditingMode !== 'default' ) {\n\t\treturn null;\n\t}\n\treturn (\n\t\t<>\n\t\t\t<ColorEdit { ...passedProps } />\n\t\t\t<BackgroundImagePanel { ...passedProps } />\n\t\t\t<TypographyPanel { ...passedProps } />\n\t\t\t<BorderPanel { ...passedProps } />\n\t\t\t<DimensionsPanel { ...passedProps } />\n\t\t\t<EffectsPanel { ...passedProps } />\n\t\t</>\n\t);\n}\n\nexport default {\n\tedit: BlockStyleControls,\n\thasSupport: hasStyleSupport,\n\taddSaveProps,\n\tattributeKeys: [ 'style' ],\n\tuseBlockProps,\n};\n\n// Defines which element types are supported, including their hover styles or\n// any other elements that have been included under a single element type\n// e.g. heading and h1-h6.\nconst elementTypes = [\n\t{ elementType: 'button' },\n\t{ elementType: 'link', pseudo: [ ':hover' ] },\n\t{\n\t\telementType: 'heading',\n\t\telements: [ 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' ],\n\t},\n];\n\nfunction useBlockProps( { name, style } ) {\n\tconst blockElementsContainerIdentifier = `wp-elements-${ useInstanceId(\n\t\tuseBlockProps\n\t) }`;\n\n\t// The .editor-styles-wrapper selector is required on elements styles. As it is\n\t// added to all other editor styles, not providing it causes reset and global\n\t// styles to override element styles because of higher specificity.\n\tconst baseElementSelector = `.editor-styles-wrapper .${ blockElementsContainerIdentifier }`;\n\tconst blockElementStyles = style?.elements;\n\n\tconst styles = useMemo( () => {\n\t\tif ( ! blockElementStyles ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst elementCSSRules = [];\n\n\t\telementTypes.forEach( ( { elementType, pseudo, elements } ) => {\n\t\t\tconst skipSerialization = shouldSkipSerialization(\n\t\t\t\tname,\n\t\t\t\tCOLOR_SUPPORT_KEY,\n\t\t\t\telementType\n\t\t\t);\n\n\t\t\tif ( skipSerialization ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst elementStyles = blockElementStyles?.[ elementType ];\n\n\t\t\t// Process primary element type styles.\n\t\t\tif ( elementStyles ) {\n\t\t\t\tconst selector = scopeSelector(\n\t\t\t\t\tbaseElementSelector,\n\t\t\t\t\tELEMENTS[ elementType ]\n\t\t\t\t);\n\n\t\t\t\telementCSSRules.push(\n\t\t\t\t\tcompileCSS( elementStyles, { selector } )\n\t\t\t\t);\n\n\t\t\t\t// Process any interactive states for the element type.\n\t\t\t\tif ( pseudo ) {\n\t\t\t\t\tpseudo.forEach( ( pseudoSelector ) => {\n\t\t\t\t\t\tif ( elementStyles[ pseudoSelector ] ) {\n\t\t\t\t\t\t\telementCSSRules.push(\n\t\t\t\t\t\t\t\tcompileCSS( elementStyles[ pseudoSelector ], {\n\t\t\t\t\t\t\t\t\tselector: scopeSelector(\n\t\t\t\t\t\t\t\t\t\tbaseElementSelector,\n\t\t\t\t\t\t\t\t\t\t`${ ELEMENTS[ elementType ] }${ pseudoSelector }`\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Process related elements e.g. h1-h6 for headings\n\t\t\tif ( elements ) {\n\t\t\t\telements.forEach( ( element ) => {\n\t\t\t\t\tif ( blockElementStyles[ element ] ) {\n\t\t\t\t\t\telementCSSRules.push(\n\t\t\t\t\t\t\tcompileCSS( blockElementStyles[ element ], {\n\t\t\t\t\t\t\t\tselector: scopeSelector(\n\t\t\t\t\t\t\t\t\tbaseElementSelector,\n\t\t\t\t\t\t\t\t\tELEMENTS[ element ]\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\n\t\treturn elementCSSRules.length > 0\n\t\t\t? elementCSSRules.join( '' )\n\t\t\t: undefined;\n\t}, [ baseElementSelector, blockElementStyles, name ] );\n\n\tuseStyleOverride( { css: styles } );\n\n\treturn addSaveProps(\n\t\t{ className: blockElementsContainerIdentifier },\n\t\tname,\n\t\t{ style },\n\t\tskipSerializationPathsEdit\n\t);\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/style/addAttribute',\n\taddAttribute\n);\n"],"mappings":";;;;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAKA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAKA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AAKA,IAAAS,WAAA,GAAAT,OAAA;AAKA,IAAAU,QAAA,GAAAV,OAAA;AAKA,IAAAW,MAAA,GAAAX,OAAA;AAKA,IAAAY,OAAA,GAAAZ,OAAA;AACA,IAAAa,iBAAA,GAAAb,OAAA;AAxCA;AACA;AACA;;AAWA;AACA;AACA;;AA2BA,MAAMc,gBAAgB,GAAG,CACxB,GAAGC,mCAAuB,EAC1B,GAAGC,6BAAoB,EACvBC,0BAAkB,EAClBC,wBAAiB,EACjBC,kCAAsB,EACtBC,kCAAsB,EACtBC,+BAAmB,CACnB;AAED,MAAMC,eAAe,GAAKC,UAAU,IACnCT,gBAAgB,CAACU,IAAI,CAAIC,GAAG,IAAM,IAAAC,uBAAe,EAAEH,UAAU,EAAEE,GAAI,CAAE,CAAC;;AAEvE;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,eAAeA,CAAEC,M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,kCAAsB,CAAE,CAAE;AAChE,CAAC;;AAED,MAAMyB,gCAAgC,GAAG;EACxC,CAAG,GAAGzB,kCAAwB,EAAC,GAAI;AACpC,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM0B,eAAe,GAAG;EAAEC,SAAS,EAAE;AAAW,CAAC;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,SAASA,CAAEX,KAAK,EAAEY,KAAK,EAAEC,iBAAiB,GAAG,KAAK,EAAG;EACpE,IAAK,CAAEb,KAAK,EAAG;IACd,OAAOA,KAAK;EACb;EAEA,IAAIc,QAAQ,GAAGd,KAAK;EACpB,IAAK,CAAEa,iBAAiB,EAAG;IAC1BC,QAAQ,GAAGC,IAAI,CAACC,KAAK,CAAED,IAAI,CAACE,SAAS,CAAEjB,KAAM,CAAE,CAAC;EACjD;EAEA,IAAK,CAAEkB,KAAK,CAACC,OAAO,CAAEP,KAAM,CAAC,EAAG;IAC/BA,KAAK,GAAG,CAAEA,KAAK,CAAE;EAClB;EAEAA,KAAK,CAAClB,OAAO,CAAI0B,IAAI,IAAM;IAC1B,IAAK,CAAEF,KAAK,CAACC,OAAO,CAAEC,IAAK,CAAC,EAAG;MAC9BA,IAAI,GAAGA,IAAI,CAACC,KAAK,CAAE,GAAI,C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AAM,CAAC,EACTI,0BACD,CAAC;AACF;AAEA,IAAAgF,gBAAS,EACR,0BAA0B,EAC1B,yBAAyB,EACzBvF,YACD,CAAC"}
|
|
1
|
+
{"version":3,"names":["_element","require","_hooks","_blocks","_compose","_styleEngine","_background","_border","_color","_typography","_dimensions","_effects","_utils","_utils2","_blockEditingMode","styleSupportKeys","TYPOGRAPHY_SUPPORT_KEYS","EFFECTS_SUPPORT_KEYS","BORDER_SUPPORT_KEY","COLOR_SUPPORT_KEY","DIMENSIONS_SUPPORT_KEY","BACKGROUND_SUPPORT_KEY","SPACING_SUPPORT_KEY","hasStyleSupport","nameOrType","some","key","hasBlockSupport","getInlineStyles","styles","output","getCSSRules","forEach","rule","value","addAttribute","settings","attributes","style","Object","assign","type","skipSerializationPathsEdit","TYPOGRAPHY_SUPPORT_KEY","SHADOW_SUPPORT_KEY","skipSerializationPathsSave","skipSerializationPathsSaveChecks","renamedFeatures","gradients","omitStyle","paths","preserveReference","newStyle","JSON","parse","stringify","Array","isArray","path","split","length","firstSubpath","restPath","addSaveProps","props","blockNameOrType","skipPaths","entries","indicator","skipSerialization","getBlockSupport","featureName","feature","BlockStyleControls","clientId","name","setAttributes","__unstableParentLayout","useBlockSettings","blockEditingMode","useBlockEditingMode","passedProps","_react","createElement","Fragment","ColorEdit","BackgroundImagePanel","TypographyPanel","BorderPanel","DimensionsPanel","EffectsPanel","_default","edit","hasSupport","attributeKeys","useBlockProps","exports","default","elementTypes","elementType","pseudo","elements","blockElementsContainerIdentifier","useInstanceId","baseElementSelector","blockElementStyles","useMemo","elementCSSRules","shouldSkipSerialization","elementStyles","selector","scopeSelector","ELEMENTS","push","compileCSS","pseudoSelector","element","join","undefined","useStyleOverride","css","className","addFilter"],"sources":["@wordpress/block-editor/src/hooks/style.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { addFilter } from '@wordpress/hooks';\nimport {\n\tgetBlockSupport,\n\thasBlockSupport,\n\t__EXPERIMENTAL_ELEMENTS as ELEMENTS,\n} from '@wordpress/blocks';\nimport { useInstanceId } from '@wordpress/compose';\nimport { getCSSRules, compileCSS } from '@wordpress/style-engine';\n\n/**\n * Internal dependencies\n */\nimport { BACKGROUND_SUPPORT_KEY, BackgroundImagePanel } from './background';\nimport { BORDER_SUPPORT_KEY, BorderPanel } from './border';\nimport { COLOR_SUPPORT_KEY, ColorEdit } from './color';\nimport {\n\tTypographyPanel,\n\tTYPOGRAPHY_SUPPORT_KEY,\n\tTYPOGRAPHY_SUPPORT_KEYS,\n} from './typography';\nimport {\n\tDIMENSIONS_SUPPORT_KEY,\n\tSPACING_SUPPORT_KEY,\n\tDimensionsPanel,\n} from './dimensions';\nimport {\n\tEFFECTS_SUPPORT_KEYS,\n\tSHADOW_SUPPORT_KEY,\n\tEffectsPanel,\n} from './effects';\nimport {\n\tshouldSkipSerialization,\n\tuseStyleOverride,\n\tuseBlockSettings,\n} from './utils';\nimport { scopeSelector } from '../components/global-styles/utils';\nimport { useBlockEditingMode } from '../components/block-editing-mode';\n\nconst styleSupportKeys = [\n\t...TYPOGRAPHY_SUPPORT_KEYS,\n\t...EFFECTS_SUPPORT_KEYS,\n\tBORDER_SUPPORT_KEY,\n\tCOLOR_SUPPORT_KEY,\n\tDIMENSIONS_SUPPORT_KEY,\n\tBACKGROUND_SUPPORT_KEY,\n\tSPACING_SUPPORT_KEY,\n];\n\nconst hasStyleSupport = ( nameOrType ) =>\n\tstyleSupportKeys.some( ( key ) => hasBlockSupport( nameOrType, key ) );\n\n/**\n * Returns the inline styles to add depending on the style object\n *\n * @param {Object} styles Styles configuration.\n *\n * @return {Object} Flattened CSS variables declaration.\n */\nexport function getInlineStyles( styles = {} ) {\n\tconst output = {};\n\t// The goal is to move everything to server side generated engine styles\n\t// This is temporary as we absorb more and more styles into the engine.\n\tgetCSSRules( styles ).forEach( ( rule ) => {\n\t\toutput[ rule.key ] = rule.value;\n\t} );\n\n\treturn output;\n}\n\n/**\n * Filters registered block settings, extending attributes to include `style` attribute.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nfunction addAttribute( settings ) {\n\tif ( ! hasStyleSupport( settings ) ) {\n\t\treturn settings;\n\t}\n\n\t// Allow blocks to specify their own attribute definition with default values if needed.\n\tif ( ! settings.attributes.style ) {\n\t\tObject.assign( settings.attributes, {\n\t\t\tstyle: {\n\t\t\t\ttype: 'object',\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn settings;\n}\n\n/**\n * A dictionary of paths to flag skipping block support serialization as the key,\n * with values providing the style paths to be omitted from serialization.\n *\n * @constant\n * @type {Record<string, string[]>}\n */\nconst skipSerializationPathsEdit = {\n\t[ `${ BORDER_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [ 'border' ],\n\t[ `${ COLOR_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tCOLOR_SUPPORT_KEY,\n\t],\n\t[ `${ TYPOGRAPHY_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tTYPOGRAPHY_SUPPORT_KEY,\n\t],\n\t[ `${ DIMENSIONS_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tDIMENSIONS_SUPPORT_KEY,\n\t],\n\t[ `${ SPACING_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tSPACING_SUPPORT_KEY,\n\t],\n\t[ `${ SHADOW_SUPPORT_KEY }` ]: [ SHADOW_SUPPORT_KEY ],\n};\n\n/**\n * A dictionary of paths to flag skipping block support serialization as the key,\n * with values providing the style paths to be omitted from serialization.\n *\n * Extends the Edit skip paths to enable skipping additional paths in just\n * the Save component. This allows a block support to be serialized within the\n * editor, while using an alternate approach, such as server-side rendering, when\n * the support is saved.\n *\n * @constant\n * @type {Record<string, string[]>}\n */\nconst skipSerializationPathsSave = {\n\t...skipSerializationPathsEdit,\n\t[ `${ DIMENSIONS_SUPPORT_KEY }.aspectRatio` ]: [\n\t\t`${ DIMENSIONS_SUPPORT_KEY }.aspectRatio`,\n\t], // Skip serialization of aspect ratio in save mode.\n\t[ `${ BACKGROUND_SUPPORT_KEY }` ]: [ BACKGROUND_SUPPORT_KEY ], // Skip serialization of background support in save mode.\n};\n\nconst skipSerializationPathsSaveChecks = {\n\t[ `${ DIMENSIONS_SUPPORT_KEY }.aspectRatio` ]: true,\n\t[ `${ BACKGROUND_SUPPORT_KEY }` ]: true,\n};\n\n/**\n * A dictionary used to normalize feature names between support flags, style\n * object properties and __experimentSkipSerialization configuration arrays.\n *\n * This allows not having to provide a migration for a support flag and possible\n * backwards compatibility bridges, while still achieving consistency between\n * the support flag and the skip serialization array.\n *\n * @constant\n * @type {Record<string, string>}\n */\nconst renamedFeatures = { gradients: 'gradient' };\n\n/**\n * A utility function used to remove one or more paths from a style object.\n * Works in a way similar to Lodash's `omit()`. See unit tests and examples below.\n *\n * It supports a single string path:\n *\n * ```\n * omitStyle( { color: 'red' }, 'color' ); // {}\n * ```\n *\n * or an array of paths:\n *\n * ```\n * omitStyle( { color: 'red', background: '#fff' }, [ 'color', 'background' ] ); // {}\n * ```\n *\n * It also allows you to specify paths at multiple levels in a string.\n *\n * ```\n * omitStyle( { typography: { textDecoration: 'underline' } }, 'typography.textDecoration' ); // {}\n * ```\n *\n * You can remove multiple paths at the same time:\n *\n * ```\n * omitStyle(\n * \t\t{\n * \t\t\ttypography: {\n * \t\t\t\ttextDecoration: 'underline',\n * \t\t\t\ttextTransform: 'uppercase',\n * \t\t\t}\n *\t\t},\n *\t\t[\n * \t\t\t'typography.textDecoration',\n * \t\t\t'typography.textTransform',\n *\t\t]\n * );\n * // {}\n * ```\n *\n * You can also specify nested paths as arrays:\n *\n * ```\n * omitStyle(\n * \t\t{\n * \t\t\ttypography: {\n * \t\t\t\ttextDecoration: 'underline',\n * \t\t\t\ttextTransform: 'uppercase',\n * \t\t\t}\n *\t\t},\n *\t\t[\n * \t\t\t[ 'typography', 'textDecoration' ],\n * \t\t\t[ 'typography', 'textTransform' ],\n *\t\t]\n * );\n * // {}\n * ```\n *\n * With regards to nesting of styles, infinite depth is supported:\n *\n * ```\n * omitStyle(\n * \t\t{\n * \t\t\tborder: {\n * \t\t\t\tradius: {\n * \t\t\t\t\ttopLeft: '10px',\n * \t\t\t\t\ttopRight: '0.5rem',\n * \t\t\t\t}\n * \t\t\t}\n *\t\t},\n *\t\t[\n * \t\t\t[ 'border', 'radius', 'topRight' ],\n *\t\t]\n * );\n * // { border: { radius: { topLeft: '10px' } } }\n * ```\n *\n * The third argument, `preserveReference`, defines how to treat the input style object.\n * It is mostly necessary to properly handle mutation when recursively handling the style object.\n * Defaulting to `false`, this will always create a new object, avoiding to mutate `style`.\n * However, when recursing, we change that value to `true` in order to work with a single copy\n * of the original style object.\n *\n * @see https://lodash.com/docs/4.17.15#omit\n *\n * @param {Object} style Styles object.\n * @param {Array|string} paths Paths to remove.\n * @param {boolean} preserveReference True to mutate the `style` object, false otherwise.\n * @return {Object} Styles object with the specified paths removed.\n */\nexport function omitStyle( style, paths, preserveReference = false ) {\n\tif ( ! style ) {\n\t\treturn style;\n\t}\n\n\tlet newStyle = style;\n\tif ( ! preserveReference ) {\n\t\tnewStyle = JSON.parse( JSON.stringify( style ) );\n\t}\n\n\tif ( ! Array.isArray( paths ) ) {\n\t\tpaths = [ paths ];\n\t}\n\n\tpaths.forEach( ( path ) => {\n\t\tif ( ! Array.isArray( path ) ) {\n\t\t\tpath = path.split( '.' );\n\t\t}\n\n\t\tif ( path.length > 1 ) {\n\t\t\tconst [ firstSubpath, ...restPath ] = path;\n\t\t\tomitStyle( newStyle[ firstSubpath ], [ restPath ], true );\n\t\t} else if ( path.length === 1 ) {\n\t\t\tdelete newStyle[ path[ 0 ] ];\n\t\t}\n\t} );\n\n\treturn newStyle;\n}\n\n/**\n * Override props assigned to save component to inject the CSS variables definition.\n *\n * @param {Object} props Additional props applied to save element.\n * @param {Object|string} blockNameOrType Block type.\n * @param {Object} attributes Block attributes.\n * @param {?Record<string, string[]>} skipPaths An object of keys and paths to skip serialization.\n *\n * @return {Object} Filtered props applied to save element.\n */\nexport function addSaveProps(\n\tprops,\n\tblockNameOrType,\n\tattributes,\n\tskipPaths = skipSerializationPathsSave\n) {\n\tif ( ! hasStyleSupport( blockNameOrType ) ) {\n\t\treturn props;\n\t}\n\n\tlet { style } = attributes;\n\tObject.entries( skipPaths ).forEach( ( [ indicator, path ] ) => {\n\t\tconst skipSerialization =\n\t\t\tskipSerializationPathsSaveChecks[ indicator ] ||\n\t\t\tgetBlockSupport( blockNameOrType, indicator );\n\n\t\tif ( skipSerialization === true ) {\n\t\t\tstyle = omitStyle( style, path );\n\t\t}\n\n\t\tif ( Array.isArray( skipSerialization ) ) {\n\t\t\tskipSerialization.forEach( ( featureName ) => {\n\t\t\t\tconst feature = renamedFeatures[ featureName ] || featureName;\n\t\t\t\tstyle = omitStyle( style, [ [ ...path, feature ] ] );\n\t\t\t} );\n\t\t}\n\t} );\n\n\tprops.style = {\n\t\t...getInlineStyles( style ),\n\t\t...props.style,\n\t};\n\n\treturn props;\n}\n\nfunction BlockStyleControls( {\n\tclientId,\n\tname,\n\tsetAttributes,\n\t__unstableParentLayout,\n} ) {\n\tconst settings = useBlockSettings( name, __unstableParentLayout );\n\tconst blockEditingMode = useBlockEditingMode();\n\tconst passedProps = {\n\t\tclientId,\n\t\tname,\n\t\tsetAttributes,\n\t\tsettings,\n\t};\n\tif ( blockEditingMode !== 'default' ) {\n\t\treturn null;\n\t}\n\treturn (\n\t\t<>\n\t\t\t<ColorEdit { ...passedProps } />\n\t\t\t<BackgroundImagePanel { ...passedProps } />\n\t\t\t<TypographyPanel { ...passedProps } />\n\t\t\t<BorderPanel { ...passedProps } />\n\t\t\t<DimensionsPanel { ...passedProps } />\n\t\t\t<EffectsPanel { ...passedProps } />\n\t\t</>\n\t);\n}\n\nexport default {\n\tedit: BlockStyleControls,\n\thasSupport: hasStyleSupport,\n\taddSaveProps,\n\tattributeKeys: [ 'style' ],\n\tuseBlockProps,\n};\n\n// Defines which element types are supported, including their hover styles or\n// any other elements that have been included under a single element type\n// e.g. heading and h1-h6.\nconst elementTypes = [\n\t{ elementType: 'button' },\n\t{ elementType: 'link', pseudo: [ ':hover' ] },\n\t{\n\t\telementType: 'heading',\n\t\telements: [ 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' ],\n\t},\n];\n\nfunction useBlockProps( { name, style } ) {\n\tconst blockElementsContainerIdentifier = `wp-elements-${ useInstanceId(\n\t\tuseBlockProps\n\t) }`;\n\n\t// The .editor-styles-wrapper selector is required on elements styles. As it is\n\t// added to all other editor styles, not providing it causes reset and global\n\t// styles to override element styles because of higher specificity.\n\tconst baseElementSelector = `.editor-styles-wrapper .${ blockElementsContainerIdentifier }`;\n\tconst blockElementStyles = style?.elements;\n\n\tconst styles = useMemo( () => {\n\t\tif ( ! blockElementStyles ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst elementCSSRules = [];\n\n\t\telementTypes.forEach( ( { elementType, pseudo, elements } ) => {\n\t\t\tconst skipSerialization = shouldSkipSerialization(\n\t\t\t\tname,\n\t\t\t\tCOLOR_SUPPORT_KEY,\n\t\t\t\telementType\n\t\t\t);\n\n\t\t\tif ( skipSerialization ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst elementStyles = blockElementStyles?.[ elementType ];\n\n\t\t\t// Process primary element type styles.\n\t\t\tif ( elementStyles ) {\n\t\t\t\tconst selector = scopeSelector(\n\t\t\t\t\tbaseElementSelector,\n\t\t\t\t\tELEMENTS[ elementType ]\n\t\t\t\t);\n\n\t\t\t\telementCSSRules.push(\n\t\t\t\t\tcompileCSS( elementStyles, { selector } )\n\t\t\t\t);\n\n\t\t\t\t// Process any interactive states for the element type.\n\t\t\t\tif ( pseudo ) {\n\t\t\t\t\tpseudo.forEach( ( pseudoSelector ) => {\n\t\t\t\t\t\tif ( elementStyles[ pseudoSelector ] ) {\n\t\t\t\t\t\t\telementCSSRules.push(\n\t\t\t\t\t\t\t\tcompileCSS( elementStyles[ pseudoSelector ], {\n\t\t\t\t\t\t\t\t\tselector: scopeSelector(\n\t\t\t\t\t\t\t\t\t\tbaseElementSelector,\n\t\t\t\t\t\t\t\t\t\t`${ ELEMENTS[ elementType ] }${ pseudoSelector }`\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Process related elements e.g. h1-h6 for headings\n\t\t\tif ( elements ) {\n\t\t\t\telements.forEach( ( element ) => {\n\t\t\t\t\tif ( blockElementStyles[ element ] ) {\n\t\t\t\t\t\telementCSSRules.push(\n\t\t\t\t\t\t\tcompileCSS( blockElementStyles[ element ], {\n\t\t\t\t\t\t\t\tselector: scopeSelector(\n\t\t\t\t\t\t\t\t\tbaseElementSelector,\n\t\t\t\t\t\t\t\t\tELEMENTS[ element ]\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\n\t\treturn elementCSSRules.length > 0\n\t\t\t? elementCSSRules.join( '' )\n\t\t\t: undefined;\n\t}, [ baseElementSelector, blockElementStyles, name ] );\n\n\tuseStyleOverride( { css: styles } );\n\n\treturn addSaveProps(\n\t\t{ className: blockElementsContainerIdentifier },\n\t\tname,\n\t\t{ style },\n\t\tskipSerializationPathsEdit\n\t);\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/style/addAttribute',\n\taddAttribute\n);\n"],"mappings":";;;;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAKA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAKA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,G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A;AACA;AACA;AACA;AACA;AACA;AACA,MAAMM,0BAA0B,GAAG;EAClC,CAAG,GAAGxB,0BAAoB,kCAAiC,GAAI,CAAE,QAAQ,CAAE;EAC3E,CAAG,GAAGC,wBAAmB,kCAAiC,GAAI,CAC7DA,wBAAiB,CACjB;EACD,CAAG,GAAGwB,kCAAwB,kCAAiC,GAAI,CAClEA,kCAAsB,CACtB;EACD,CAAG,GAAGvB,kCAAwB,kCAAiC,GAAI,CAClEA,kCAAsB,CACtB;EACD,CAAG,GAAGE,+BAAqB,kCAAiC,GAAI,CAC/DA,+BAAmB,CACnB;EACD,CAAG,GAAGsB,2BAAoB,EAAC,GAAI,CAAEA,2BAAkB;AACpD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,0BAA0B,GAAG;EAClC,GAAGH,0BAA0B;EAC7B,CAAG,GAAGtB,kCAAwB,cAAa,GAAI,CAC7C,GAAGA,kCAAwB,cAAa,CACzC;EAAE;EACH,CAAG,GAAGC,kCAAwB,EAAC,GAAI,CAAEA,kCAAsB,CAAE,CAAE;AAChE,CAAC;;AAED,MAAMyB,gCAAgC,GAAG;EACxC,CAAG,GAAG1B,kCAAwB,cAAa,GAAI,IAAI;EACnD,CAAG,GAAGC,kCAAwB,EAAC,GAAI;AACpC,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM0B,eAAe,GAAG;EAAEC,SAAS,EAAE;AAAW,CAAC;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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QACJ;MACD;;MAEA;MACA,IAAKd,QAAQ,EAAG;QACfA,QAAQ,CAACrE,OAAO,CAAIoF,OAAO,IAAM;UAChC,IAAKX,kBAAkB,CAAEW,OAAO,CAAE,EAAG;YACpCT,eAAe,CAACM,IAAI,CACnB,IAAAC,uBAAU,EAAET,kBAAkB,CAAEW,OAAO,CAAE,EAAE;cAC1CN,QAAQ,EAAE,IAAAC,qBAAa,EACtBP,mBAAmB,EACnBQ,+BAAQ,CAAEI,OAAO,CAClB;YACD,CAAE,CACH,CAAC;UACF;QACD,CAAE,CAAC;MACJ;IACD,CAAE,CAAC;IAEH,OAAOT,eAAe,CAAC/C,MAAM,GAAG,CAAC,GAC9B+C,eAAe,CAACU,IAAI,CAAE,EAAG,CAAC,GAC1BC,SAAS;EACb,CAAC,EAAE,CAAEd,mBAAmB,EAAEC,kBAAkB,EAAE9B,IAAI,CAAG,CAAC;EAEtD,IAAA4C,uBAAgB,EAAE;IAAEC,GAAG,EAAE3F;EAAO,CAAE,CAAC;EAEnC,OAAOkC,YAAY,CAClB;IAAE0D,SAAS,EAAEnB;EAAiC,CAAC,EAC/C3B,IAAI,EACJ;IAAErC;EAAM,CAAC,EACTI,0BACD,CAAC;AACF;AAEA,IAAAgF,gBAAS,EACR,0BAA0B,EAC1B,yBAAyB,EACzBvF,YACD,CAAC"}
|
|
@@ -47,13 +47,13 @@ const createEditFunctionWithBindingsAttribute = () => (0, _compose.createHigherO
|
|
|
47
47
|
const updatedAttributes = getBlockAttributes(clientId);
|
|
48
48
|
if (updatedAttributes?.metadata?.bindings) {
|
|
49
49
|
Object.entries(updatedAttributes.metadata.bindings).forEach(([attributeName, settings]) => {
|
|
50
|
-
const source = getBlockBindingsSource(settings.source
|
|
50
|
+
const source = getBlockBindingsSource(settings.source);
|
|
51
51
|
if (source) {
|
|
52
52
|
// Second argument (`updateMetaValue`) will be used to update the value in the future.
|
|
53
53
|
const {
|
|
54
54
|
placeholder,
|
|
55
55
|
useValue: [metaValue = null] = []
|
|
56
|
-
} = source.useSource(props, settings.
|
|
56
|
+
} = source.useSource(props, settings.args);
|
|
57
57
|
if (placeholder && !metaValue) {
|
|
58
58
|
// If the attribute is `src` or `href`, a placeholder can't be used because it is not a valid url.
|
|
59
59
|
// Adding this workaround until attributes and metadata fields types are improved and include `url`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_blocks","require","_compose","_data","_hooks","_store","_context","_lockUnlock","BLOCK_BINDINGS_ALLOWED_BLOCKS","createEditFunctionWithBindingsAttribute","createHigherOrderComponent","BlockEdit","props","clientId","name","blockName","useBlockEditContext","getBlockBindingsSource","unlock","useSelect","blockEditorStore","getBlockAttributes","updateBlockAttributes","updatedAttributes","metadata","bindings","Object","entries","forEach","attributeName","settings","source","placeholder","useValue","metaValue","useSource","
|
|
1
|
+
{"version":3,"names":["_blocks","require","_compose","_data","_hooks","_store","_context","_lockUnlock","BLOCK_BINDINGS_ALLOWED_BLOCKS","createEditFunctionWithBindingsAttribute","createHigherOrderComponent","BlockEdit","props","clientId","name","blockName","useBlockEditContext","getBlockBindingsSource","unlock","useSelect","blockEditorStore","getBlockAttributes","updateBlockAttributes","updatedAttributes","metadata","bindings","Object","entries","forEach","attributeName","settings","source","placeholder","useValue","metaValue","useSource","args","htmlAttribute","getBlockType","attributes","attribute","registry","useRegistry","_react","createElement","Fragment","key","setAttributes","newAttributes","blockId","batch","shimAttributeSource","edit","addFilter","contextItems","usesContextArray","usesContext","oldUsesContextArray","Set","item","has","push"],"sources":["@wordpress/block-editor/src/hooks/use-bindings-attributes.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlockType } from '@wordpress/blocks';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { useRegistry, useSelect } from '@wordpress/data';\nimport { addFilter } from '@wordpress/hooks';\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../store';\nimport { useBlockEditContext } from '../components/block-edit/context';\nimport { unlock } from '../lock-unlock';\n\n/** @typedef {import('@wordpress/compose').WPHigherOrderComponent} WPHigherOrderComponent */\n/** @typedef {import('@wordpress/blocks').WPBlockSettings} WPBlockSettings */\n\n/**\n * Given a binding of block attributes, returns a higher order component that\n * overrides its `attributes` and `setAttributes` props to sync any changes needed.\n *\n * @return {WPHigherOrderComponent} Higher-order component.\n */\n\nconst BLOCK_BINDINGS_ALLOWED_BLOCKS = {\n\t'core/paragraph': [ 'content' ],\n\t'core/heading': [ 'content' ],\n\t'core/image': [ 'url', 'title', 'alt' ],\n\t'core/button': [ 'url', 'text', 'linkTarget' ],\n};\n\nconst createEditFunctionWithBindingsAttribute = () =>\n\tcreateHigherOrderComponent(\n\t\t( BlockEdit ) => ( props ) => {\n\t\t\tconst { clientId, name: blockName } = useBlockEditContext();\n\t\t\tconst { getBlockBindingsSource } = unlock(\n\t\t\t\tuseSelect( blockEditorStore )\n\t\t\t);\n\t\t\tconst { getBlockAttributes, updateBlockAttributes } =\n\t\t\t\tuseSelect( blockEditorStore );\n\n\t\t\tconst updatedAttributes = getBlockAttributes( clientId );\n\t\t\tif ( updatedAttributes?.metadata?.bindings ) {\n\t\t\t\tObject.entries( updatedAttributes.metadata.bindings ).forEach(\n\t\t\t\t\t( [ attributeName, settings ] ) => {\n\t\t\t\t\t\tconst source = getBlockBindingsSource(\n\t\t\t\t\t\t\tsettings.source\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tif ( source ) {\n\t\t\t\t\t\t\t// Second argument (`updateMetaValue`) will be used to update the value in the future.\n\t\t\t\t\t\t\tconst {\n\t\t\t\t\t\t\t\tplaceholder,\n\t\t\t\t\t\t\t\tuseValue: [ metaValue = null ] = [],\n\t\t\t\t\t\t\t} = source.useSource( props, settings.args );\n\n\t\t\t\t\t\t\tif ( placeholder && ! metaValue ) {\n\t\t\t\t\t\t\t\t// If the attribute is `src` or `href`, a placeholder can't be used because it is not a valid url.\n\t\t\t\t\t\t\t\t// Adding this workaround until attributes and metadata fields types are improved and include `url`.\n\t\t\t\t\t\t\t\tconst htmlAttribute =\n\t\t\t\t\t\t\t\t\tgetBlockType( blockName ).attributes[\n\t\t\t\t\t\t\t\t\t\tattributeName\n\t\t\t\t\t\t\t\t\t].attribute;\n\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\thtmlAttribute === 'src' ||\n\t\t\t\t\t\t\t\t\thtmlAttribute === 'href'\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\tupdatedAttributes[ attributeName ] = null;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tupdatedAttributes[ attributeName ] =\n\t\t\t\t\t\t\t\t\t\tplaceholder;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( metaValue ) {\n\t\t\t\t\t\t\t\tupdatedAttributes[ attributeName ] = metaValue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst registry = useRegistry();\n\n\t\t\treturn (\n\t\t\t\t<>\n\t\t\t\t\t<BlockEdit\n\t\t\t\t\t\tkey=\"edit\"\n\t\t\t\t\t\tattributes={ updatedAttributes }\n\t\t\t\t\t\tsetAttributes={ ( newAttributes, blockId ) =>\n\t\t\t\t\t\t\tregistry.batch( () =>\n\t\t\t\t\t\t\t\tupdateBlockAttributes( blockId, newAttributes )\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t);\n\t\t},\n\t\t'useBoundAttributes'\n\t);\n\n/**\n * Filters a registered block's settings to enhance a block's `edit` component\n * to upgrade bound attributes.\n *\n * @param {WPBlockSettings} settings Registered block settings.\n *\n * @return {WPBlockSettings} Filtered block settings.\n */\nfunction shimAttributeSource( settings ) {\n\tif ( ! ( settings.name in BLOCK_BINDINGS_ALLOWED_BLOCKS ) ) {\n\t\treturn settings;\n\t}\n\tsettings.edit = createEditFunctionWithBindingsAttribute()( settings.edit );\n\n\treturn settings;\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/editor/custom-sources-backwards-compatibility/shim-attribute-source',\n\tshimAttributeSource\n);\n\n// Add the context to all blocks.\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/block-bindings-ui',\n\t( settings, name ) => {\n\t\tif ( ! ( name in BLOCK_BINDINGS_ALLOWED_BLOCKS ) ) {\n\t\t\treturn settings;\n\t\t}\n\t\tconst contextItems = [ 'postId', 'postType', 'queryId' ];\n\t\tconst usesContextArray = settings.usesContext;\n\t\tconst oldUsesContextArray = new Set( usesContextArray );\n\t\tcontextItems.forEach( ( item ) => {\n\t\t\tif ( ! oldUsesContextArray.has( item ) ) {\n\t\t\t\tusesContextArray.push( item );\n\t\t\t}\n\t\t} );\n\t\tsettings.usesContext = usesContextArray;\n\t\treturn settings;\n\t}\n);\n"],"mappings":";;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAIA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AAZA;AACA;AACA;;AAKA;AACA;AACA;;AAKA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMO,6BAA6B,GAAG;EACrC,gBAAgB,EAAE,CAAE,SAAS,CAAE;EAC/B,cAAc,EAAE,CAAE,SAAS,CAAE;EAC7B,YAAY,EAAE,CAAE,KAAK,EAAE,OAAO,EAAE,KAAK,CAAE;EACvC,aAAa,EAAE,CAAE,KAAK,EAAE,MAAM,EAAE,YAAY;AAC7C,CAAC;AAED,MAAMC,uCAAuC,GAAGA,CAAA,KAC/C,IAAAC,mCAA0B,EACvBC,SAAS,IAAQC,KAAK,IAAM;EAC7B,MAAM;IAAEC,QAAQ;IAAEC,IA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ACxCJ,gBAAgB,CAACM,IAAI,CAAEF,IAAK,CAAC;IAC9B;EACD,CAAE,CAAC;EACH7B,QAAQ,CAAC0B,WAAW,GAAGD,gBAAgB;EACvC,OAAOzB,QAAQ;AAChB,CACD,CAAC"}
|
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getShadowClassesAndStyles = getShadowClassesAndStyles;
|
|
7
|
-
exports.useShadowProps = useShadowProps;
|
|
8
7
|
var _style = require("./style");
|
|
9
8
|
/**
|
|
10
9
|
* Internal dependencies
|
|
@@ -24,23 +23,9 @@ var _style = require("./style");
|
|
|
24
23
|
function getShadowClassesAndStyles(attributes) {
|
|
25
24
|
const shadow = attributes.style?.shadow || '';
|
|
26
25
|
return {
|
|
27
|
-
className: undefined,
|
|
28
26
|
style: (0, _style.getInlineStyles)({
|
|
29
27
|
shadow
|
|
30
28
|
})
|
|
31
29
|
};
|
|
32
30
|
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Derives the shadow related props for a block from its shadow block support
|
|
36
|
-
* attributes.
|
|
37
|
-
*
|
|
38
|
-
* @param {Object} attributes Block attributes.
|
|
39
|
-
*
|
|
40
|
-
* @return {Object} ClassName & style props from shadow block support.
|
|
41
|
-
*/
|
|
42
|
-
function useShadowProps(attributes) {
|
|
43
|
-
const shadowProps = getShadowClassesAndStyles(attributes);
|
|
44
|
-
return shadowProps;
|
|
45
|
-
}
|
|
46
31
|
//# sourceMappingURL=use-shadow-props.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_style","require","getShadowClassesAndStyles","attributes","shadow","style","
|
|
1
|
+
{"version":3,"names":["_style","require","getShadowClassesAndStyles","attributes","shadow","style","getInlineStyles"],"sources":["@wordpress/block-editor/src/hooks/use-shadow-props.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { getInlineStyles } from './style';\n\n// This utility is intended to assist where the serialization of the shadow\n// block support is being skipped for a block but the shadow related CSS classes\n// & styles still need to be generated so they can be applied to inner elements.\n\n/**\n * Provides the CSS class names and inline styles for a block's shadow support\n * attributes.\n *\n * @param {Object} attributes Block attributes.\n * @return {Object} Shadow block support derived CSS classes & styles.\n */\nexport function getShadowClassesAndStyles( attributes ) {\n\tconst shadow = attributes.style?.shadow || '';\n\n\treturn {\n\t\tstyle: getInlineStyles( { shadow } ),\n\t};\n}\n"],"mappings":";;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,yBAAyBA,CAAEC,UAAU,EAAG;EACvD,MAAMC,MAAM,GAAGD,UAAU,CAACE,KAAK,EAAED,MAAM,IAAI,EAAE;EAE7C,OAAO;IACNC,KAAK,EAAE,IAAAC,sBAAe,EAAE;MAAEF;IAAO,CAAE;EACpC,CAAC;AACF"}
|
package/build/hooks/utils.js
CHANGED
|
@@ -149,7 +149,7 @@ function useStyleOverride({
|
|
|
149
149
|
* @return {Object} Settings object.
|
|
150
150
|
*/
|
|
151
151
|
function useBlockSettings(name, parentLayout) {
|
|
152
|
-
const [backgroundImage, backgroundSize, fontFamilies,
|
|
152
|
+
const [backgroundImage, backgroundSize, fontFamilies, fontSizes, customFontSize, fontStyle, fontWeight, lineHeight, textColumns, textDecoration, writingMode, textTransform, letterSpacing, padding, margin, blockGap, spacingSizes, units, aspectRatio, minHeight, layout, borderColor, borderRadius, borderStyle, borderWidth, customColorsEnabled, customColors, customDuotone, themeColors, defaultColors, defaultPalette, defaultDuotone, userDuotonePalette, themeDuotonePalette, defaultDuotonePalette, userGradientPalette, themeGradientPalette, defaultGradientPalette, defaultGradients, areCustomGradientsEnabled, isBackgroundEnabled, isLinkEnabled, isTextEnabled, isHeadingEnabled, isButtonEnabled, shadow] = (0, _components.useSettings)('background.backgroundImage', 'background.backgroundSize', 'typography.fontFamilies', 'typography.fontSizes', 'typography.customFontSize', 'typography.fontStyle', 'typography.fontWeight', 'typography.lineHeight', 'typography.textColumns', 'typography.textDecoration', 'typography.writingMode', 'typography.textTransform', 'typography.letterSpacing', 'spacing.padding', 'spacing.margin', 'spacing.blockGap', 'spacing.spacingSizes', 'spacing.units', 'dimensions.aspectRatio', 'dimensions.minHeight', 'layout', 'border.color', 'border.radius', 'border.style', 'border.width', 'color.custom', 'color.palette.custom', 'color.customDuotone', 'color.palette.theme', 'color.palette.default', 'color.defaultPalette', 'color.defaultDuotone', 'color.duotone.custom', 'color.duotone.theme', 'color.duotone.default', 'color.gradients.custom', 'color.gradients.theme', 'color.gradients.default', 'color.defaultGradients', 'color.customGradient', 'color.background', 'color.link', 'color.text', 'color.heading', 'color.button', 'shadow');
|
|
153
153
|
const rawSettings = (0, _element.useMemo)(() => {
|
|
154
154
|
return {
|
|
155
155
|
background: {
|
|
@@ -189,12 +189,9 @@ function useBlockSettings(name, parentLayout) {
|
|
|
189
189
|
custom: fontFamilies
|
|
190
190
|
},
|
|
191
191
|
fontSizes: {
|
|
192
|
-
custom:
|
|
193
|
-
theme: themeFontSizes,
|
|
194
|
-
default: defaultFontSizes
|
|
192
|
+
custom: fontSizes
|
|
195
193
|
},
|
|
196
194
|
customFontSize,
|
|
197
|
-
defaultFontSizes: defaultFontSizesEnabled,
|
|
198
195
|
fontStyle,
|
|
199
196
|
fontWeight,
|
|
200
197
|
lineHeight,
|
|
@@ -220,13 +217,14 @@ function useBlockSettings(name, parentLayout) {
|
|
|
220
217
|
width: borderWidth
|
|
221
218
|
},
|
|
222
219
|
dimensions: {
|
|
220
|
+
aspectRatio,
|
|
223
221
|
minHeight
|
|
224
222
|
},
|
|
225
223
|
layout,
|
|
226
224
|
parentLayout,
|
|
227
225
|
shadow
|
|
228
226
|
};
|
|
229
|
-
}, [backgroundImage, backgroundSize, fontFamilies,
|
|
227
|
+
}, [backgroundImage, backgroundSize, fontFamilies, fontSizes, customFontSize, fontStyle, fontWeight, lineHeight, textColumns, textDecoration, textTransform, letterSpacing, writingMode, padding, margin, blockGap, spacingSizes, units, aspectRatio, minHeight, layout, parentLayout, borderColor, borderRadius, borderStyle, borderWidth, customColorsEnabled, customColors, customDuotone, themeColors, defaultColors, defaultPalette, defaultDuotone, userDuotonePalette, themeDuotonePalette, defaultDuotonePalette, userGradientPalette, themeGradientPalette, defaultGradientPalette, defaultGradients, areCustomGradientsEnabled, isBackgroundEnabled, isLinkEnabled, isTextEnabled, isHeadingEnabled, isButtonEnabled, shadow]);
|
|
230
228
|
return (0, _hooks2.useSettingsForBlockElement)(rawSettings, name);
|
|
231
229
|
}
|
|
232
230
|
function createBlockEditFilter(features) {
|