UNPKG

@wordpress/block-editor

Version:
8 lines (7 loc) 17.4 kB
{ "version": 3, "sources": ["../../src/hooks/duotone.js"], "sourcesContent": ["/**\n * External dependencies\n */\nimport { extend } from 'colord';\nimport namesPlugin from 'colord/plugins/names';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tgetBlockSupport,\n\tgetBlockType,\n\thasBlockSupport,\n} from '@wordpress/blocks';\nimport { useInstanceId } from '@wordpress/compose';\nimport { addFilter } from '@wordpress/hooks';\nimport { useMemo, useEffect } from '@wordpress/element';\nimport { getBlockSelector } from '@wordpress/global-styles-engine';\n\n/**\n * Internal dependencies\n */\nimport {\n\tBlockControls,\n\tInspectorControls,\n\t__experimentalDuotoneControl as DuotoneControl,\n\tuseSettings,\n} from '../components';\nimport {\n\tgetDuotoneFilter,\n\tgetDuotoneStylesheet,\n\tgetDuotoneUnsetStylesheet,\n} from '../components/duotone/utils';\nimport { scopeSelector } from '../components/global-styles/utils';\nimport {\n\tcleanEmptyObject,\n\tuseBlockSettings,\n\tusePrivateStyleOverride,\n} from './utils';\nimport { default as StylesFiltersPanel } from '../components/global-styles/filters-panel';\nimport { useBlockEditingMode } from '../components/block-editing-mode';\nimport { useBlockElement } from '../components/block-list/use-block-props/use-block-refs';\n\nconst EMPTY_ARRAY = [];\n\n// Safari does not always update the duotone filter when the duotone colors\n// are changed. This browser check is later used to force a re-render of the block\n// element to ensure the duotone filter is updated. The check is included at the\n// root of this file as it only needs to be run once per page load.\nconst isSafari =\n\twindow?.navigator.userAgent &&\n\twindow.navigator.userAgent.includes( 'Safari' ) &&\n\t! window.navigator.userAgent.includes( 'Chrome' ) &&\n\t! window.navigator.userAgent.includes( 'Chromium' );\n\nextend( [ namesPlugin ] );\n\nfunction useMultiOriginPresets( { presetSetting, defaultSetting } ) {\n\tconst [ enableDefault, userPresets, themePresets, defaultPresets ] =\n\t\tuseSettings(\n\t\t\tdefaultSetting,\n\t\t\t`${ presetSetting }.custom`,\n\t\t\t`${ presetSetting }.theme`,\n\t\t\t`${ presetSetting }.default`\n\t\t);\n\treturn useMemo(\n\t\t() => [\n\t\t\t...( userPresets || EMPTY_ARRAY ),\n\t\t\t...( themePresets || EMPTY_ARRAY ),\n\t\t\t...( ( enableDefault && defaultPresets ) || EMPTY_ARRAY ),\n\t\t],\n\t\t[ enableDefault, userPresets, themePresets, defaultPresets ]\n\t);\n}\n\nexport function getColorsFromDuotonePreset( duotone, duotonePalette ) {\n\tif ( ! duotone ) {\n\t\treturn;\n\t}\n\tconst preset = duotonePalette?.find( ( { slug } ) => {\n\t\treturn duotone === `var:preset|duotone|${ slug }`;\n\t} );\n\n\treturn preset ? preset.colors : undefined;\n}\n\nexport function getDuotonePresetFromColors( colors, duotonePalette ) {\n\tif ( ! colors || ! Array.isArray( colors ) ) {\n\t\treturn;\n\t}\n\n\tconst preset = duotonePalette?.find( ( duotonePreset ) => {\n\t\treturn duotonePreset?.colors?.every(\n\t\t\t( val, index ) => val === colors[ index ]\n\t\t);\n\t} );\n\n\treturn preset ? `var:preset|duotone|${ preset.slug }` : undefined;\n}\n\nfunction DuotonePanelPure( { style, setAttributes, name } ) {\n\tconst duotoneStyle = style?.color?.duotone;\n\tconst settings = useBlockSettings( name );\n\tconst blockEditingMode = useBlockEditingMode();\n\n\tconst duotonePalette = useMultiOriginPresets( {\n\t\tpresetSetting: 'color.duotone',\n\t\tdefaultSetting: 'color.defaultDuotone',\n\t} );\n\tconst colorPalette = useMultiOriginPresets( {\n\t\tpresetSetting: 'color.palette',\n\t\tdefaultSetting: 'color.defaultPalette',\n\t} );\n\tconst [ enableCustomColors, enableCustomDuotone ] = useSettings(\n\t\t'color.custom',\n\t\t'color.customDuotone'\n\t);\n\tconst disableCustomColors = ! enableCustomColors;\n\tconst disableCustomDuotone =\n\t\t! enableCustomDuotone ||\n\t\t( colorPalette?.length === 0 && disableCustomColors );\n\n\tif ( duotonePalette?.length === 0 && disableCustomDuotone ) {\n\t\treturn null;\n\t}\n\n\tif ( blockEditingMode !== 'default' ) {\n\t\treturn null;\n\t}\n\n\tconst duotonePresetOrColors =\n\t\tduotoneStyle === 'unset' || Array.isArray( duotoneStyle )\n\t\t\t? duotoneStyle\n\t\t\t: getColorsFromDuotonePreset( duotoneStyle, duotonePalette );\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls group=\"filter\">\n\t\t\t\t<StylesFiltersPanel\n\t\t\t\t\tvalue={ { filter: { duotone: duotonePresetOrColors } } }\n\t\t\t\t\tonChange={ ( newDuotone ) => {\n\t\t\t\t\t\tconst newStyle = {\n\t\t\t\t\t\t\t...style,\n\t\t\t\t\t\t\tcolor: {\n\t\t\t\t\t\t\t\t...newDuotone?.filter,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t};\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\tstyle: cleanEmptyObject( newStyle ),\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t<BlockControls group=\"block\" __experimentalShareWithChildBlocks>\n\t\t\t\t<DuotoneControl\n\t\t\t\t\tduotonePalette={ duotonePalette }\n\t\t\t\t\tcolorPalette={ colorPalette }\n\t\t\t\t\tdisableCustomDuotone={ disableCustomDuotone }\n\t\t\t\t\tdisableCustomColors={ disableCustomColors }\n\t\t\t\t\tvalue={ duotonePresetOrColors }\n\t\t\t\t\tonChange={ ( newDuotone ) => {\n\t\t\t\t\t\tconst maybePreset = getDuotonePresetFromColors(\n\t\t\t\t\t\t\tnewDuotone,\n\t\t\t\t\t\t\tduotonePalette\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tconst newStyle = {\n\t\t\t\t\t\t\t...style,\n\t\t\t\t\t\t\tcolor: {\n\t\t\t\t\t\t\t\t...style?.color,\n\t\t\t\t\t\t\t\tduotone: maybePreset ?? newDuotone, // use preset or fallback to custom colors.\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t};\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\tstyle: cleanEmptyObject( newStyle ),\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t</>\n\t);\n}\n\nexport default {\n\tshareWithChildBlocks: true,\n\tedit: DuotonePanelPure,\n\tuseBlockProps,\n\tattributeKeys: [ 'style' ],\n\thasSupport( name ) {\n\t\treturn hasBlockSupport( name, 'filter.duotone' );\n\t},\n};\n\n/**\n * Filters registered block settings, extending attributes to include\n * the `duotone` attribute.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nfunction addDuotoneAttributes( settings ) {\n\t// Previous `color.__experimentalDuotone` support flag is migrated via\n\t// block_type_metadata_settings filter in `lib/block-supports/duotone.php`.\n\tif ( ! hasBlockSupport( settings, 'filter.duotone' ) ) {\n\t\treturn settings;\n\t}\n\n\t// Allow blocks to specify their own attribute definition with default\n\t// 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\nfunction useDuotoneStyles( {\n\tclientId,\n\tid: filterId,\n\tselector: duotoneSelector,\n\tattribute: duotoneAttr,\n} ) {\n\tconst duotonePalette = useMultiOriginPresets( {\n\t\tpresetSetting: 'color.duotone',\n\t\tdefaultSetting: 'color.defaultDuotone',\n\t} );\n\n\t// Possible values for duotone attribute:\n\t// 1. Array of colors - e.g. ['#000000', '#ffffff'].\n\t// 2. Variable for an existing Duotone preset - e.g. 'var:preset|duotone|green-blue' or 'var(--wp--preset--duotone--green-blue)''\n\t// 3. A CSS string - e.g. 'unset' to remove globally applied duotone.\n\tconst isCustom = Array.isArray( duotoneAttr );\n\tconst duotonePreset = isCustom\n\t\t? undefined\n\t\t: getColorsFromDuotonePreset( duotoneAttr, duotonePalette );\n\tconst isPreset = typeof duotoneAttr === 'string' && duotonePreset;\n\tconst isCSS = typeof duotoneAttr === 'string' && ! isPreset;\n\n\t// Match the structure of WP_Duotone_Gutenberg::render_duotone_support() in PHP.\n\tlet colors = null;\n\tif ( isPreset ) {\n\t\t// Array of colors.\n\t\tcolors = duotonePreset;\n\t} else if ( isCSS ) {\n\t\t// CSS filter property string (e.g. 'unset').\n\t\tcolors = duotoneAttr;\n\t} else if ( isCustom ) {\n\t\t// Array of colors.\n\t\tcolors = duotoneAttr;\n\t}\n\n\t// Build the CSS selectors to which the filter will be applied.\n\tconst selectors = duotoneSelector.split( ',' );\n\n\tconst selectorsScoped = selectors.map( ( selectorPart ) => {\n\t\t// Assuming the selector part is a subclass selector (not a tag name)\n\t\t// so we can prepend the filter id class. If we want to support elements\n\t\t// such as `img` or namespaces, we'll need to add a case for that here.\n\t\treturn `.${ filterId }${ selectorPart.trim() }`;\n\t} );\n\n\tconst selector = selectorsScoped.join( ', ' );\n\n\tconst isValidFilter = Array.isArray( colors ) || colors === 'unset';\n\n\tusePrivateStyleOverride(\n\t\tisValidFilter\n\t\t\t? {\n\t\t\t\t\tcss:\n\t\t\t\t\t\tcolors !== 'unset'\n\t\t\t\t\t\t\t? getDuotoneStylesheet( selector, filterId )\n\t\t\t\t\t\t\t: getDuotoneUnsetStylesheet( selector ),\n\t\t\t\t\t__unstableType: 'presets',\n\t\t\t }\n\t\t\t: undefined\n\t);\n\tusePrivateStyleOverride(\n\t\tisValidFilter\n\t\t\t? {\n\t\t\t\t\tassets:\n\t\t\t\t\t\tcolors !== 'unset'\n\t\t\t\t\t\t\t? getDuotoneFilter( filterId, colors )\n\t\t\t\t\t\t\t: '',\n\t\t\t\t\t__unstableType: 'svgs',\n\t\t\t }\n\t\t\t: undefined\n\t);\n\n\tconst blockElement = useBlockElement( clientId );\n\n\tuseEffect( () => {\n\t\tif ( ! isValidFilter ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Safari does not always update the duotone filter when the duotone\n\t\t// colors are changed. When using Safari, force the block element to be\n\t\t// repainted by the browser to ensure any changes are reflected\n\t\t// visually. This logic matches that used on the site frontend in\n\t\t// `block-supports/duotone.php`.\n\t\tif ( blockElement && isSafari ) {\n\t\t\tconst display = blockElement.style.display;\n\t\t\t// Switch to `inline-block` to force a repaint. In the editor,\n\t\t\t// `inline-block` is used instead of `none` to ensure that scroll\n\t\t\t// position is not affected, as `none` results in the editor\n\t\t\t// scrolling to the top of the block.\n\t\t\tblockElement.style.setProperty( 'display', 'inline-block' );\n\t\t\t// Simply accessing el.offsetHeight flushes layout and style changes\n\t\t\t// in WebKit without having to wait for setTimeout.\n\t\t\t// eslint-disable-next-line no-unused-expressions\n\t\t\tblockElement.offsetHeight;\n\t\t\tblockElement.style.setProperty( 'display', display );\n\t\t}\n\t\t// `colors` must be a dependency so this effect runs when the colors\n\t\t// change in Safari.\n\t}, [ isValidFilter, blockElement, colors ] );\n}\n\n// Used for generating the instance ID\nconst DUOTONE_BLOCK_PROPS_REFERENCE = {};\n\nfunction useBlockProps( { clientId, name, style } ) {\n\tconst id = useInstanceId( DUOTONE_BLOCK_PROPS_REFERENCE );\n\tconst selector = useMemo( () => {\n\t\tconst blockType = getBlockType( name );\n\n\t\tif ( blockType ) {\n\t\t\t// Backwards compatibility for `supports.color.__experimentalDuotone`\n\t\t\t// is provided via the `block_type_metadata_settings` filter. If\n\t\t\t// `supports.filter.duotone` has not been set and the\n\t\t\t// experimental property has been, the experimental property\n\t\t\t// value is copied into `supports.filter.duotone`.\n\t\t\tconst duotoneSupport = getBlockSupport(\n\t\t\t\tblockType,\n\t\t\t\t'filter.duotone',\n\t\t\t\tfalse\n\t\t\t);\n\t\t\tif ( ! duotoneSupport ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// If the experimental duotone support was set, that value is\n\t\t\t// to be treated as a selector and requires scoping.\n\t\t\tconst experimentalDuotone = getBlockSupport(\n\t\t\t\tblockType,\n\t\t\t\t'color.__experimentalDuotone',\n\t\t\t\tfalse\n\t\t\t);\n\t\t\tif ( experimentalDuotone ) {\n\t\t\t\tconst rootSelector = getBlockSelector( blockType );\n\t\t\t\treturn typeof experimentalDuotone === 'string'\n\t\t\t\t\t? scopeSelector( rootSelector, experimentalDuotone )\n\t\t\t\t\t: rootSelector;\n\t\t\t}\n\n\t\t\t// Regular filter.duotone support uses filter.duotone selectors with fallbacks.\n\t\t\treturn getBlockSelector( blockType, 'filter.duotone', {\n\t\t\t\tfallback: true,\n\t\t\t} );\n\t\t}\n\t}, [ name ] );\n\n\tconst attribute = style?.color?.duotone;\n\n\tconst filterClass = `wp-duotone-${ id }`;\n\n\tconst shouldRender = selector && attribute;\n\n\tuseDuotoneStyles( {\n\t\tclientId,\n\t\tid: filterClass,\n\t\tselector,\n\t\tattribute,\n\t} );\n\n\treturn {\n\t\tclassName: shouldRender ? filterClass : '',\n\t};\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/editor/duotone/add-attributes',\n\taddDuotoneAttributes\n);\n"], "mappings": ";AAGA,SAAS,cAAc;AACvB,OAAO,iBAAiB;AAKxB;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,qBAAqB;AAC9B,SAAS,iBAAiB;AAC1B,SAAS,SAAS,iBAAiB;AACnC,SAAS,wBAAwB;AAKjC;AAAA,EACC;AAAA,EACA;AAAA,EACA,gCAAgC;AAAA,EAChC;AAAA,OACM;AACP;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,qBAAqB;AAC9B;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,WAAW,0BAA0B;AAC9C,SAAS,2BAA2B;AACpC,SAAS,uBAAuB;AA+F9B,mBAEE,KAFF;AA7FF,IAAM,cAAc,CAAC;AAMrB,IAAM,WACL,QAAQ,UAAU,aAClB,OAAO,UAAU,UAAU,SAAU,QAAS,KAC9C,CAAE,OAAO,UAAU,UAAU,SAAU,QAAS,KAChD,CAAE,OAAO,UAAU,UAAU,S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