@wordpress/patterns 2.8.3 → 2.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 2.9.0 (2024-10-03)
6
+
5
7
  ## 2.8.0 (2024-09-19)
6
8
 
7
9
  ## 2.7.0 (2024-09-05)
@@ -10,7 +10,6 @@ var _components = require("@wordpress/components");
10
10
  var _i18n = require("@wordpress/i18n");
11
11
  var _constants = require("../constants");
12
12
  var _allowOverridesModal = require("./allow-overrides-modal");
13
- var _lockUnlock = require("../lock-unlock");
14
13
  var _jsxRuntime = require("react/jsx-runtime");
15
14
  /**
16
15
  * WordPress dependencies
@@ -20,9 +19,6 @@ var _jsxRuntime = require("react/jsx-runtime");
20
19
  * Internal dependencies
21
20
  */
22
21
 
23
- const {
24
- useBlockBindingsUtils
25
- } = (0, _lockUnlock.unlock)(_blockEditor.privateApis);
26
22
  function PatternOverridesControls({
27
23
  attributes,
28
24
  setAttributes,
@@ -37,7 +33,7 @@ function PatternOverridesControls({
37
33
  const isConnectedToOtherSources = defaultBindings?.source && defaultBindings.source !== _constants.PATTERN_OVERRIDES_BINDING_SOURCE;
38
34
  const {
39
35
  updateBlockBindings
40
- } = useBlockBindingsUtils();
36
+ } = (0, _blockEditor.useBlockBindingsUtils)();
41
37
  function updateBindings(isChecked, customName) {
42
38
  if (customName) {
43
39
  setAttributes({
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_blockEditor","_components","_i18n","_constants","_allowOverridesModal","_lockUnlock","_jsxRuntime","useBlockBindingsUtils","unlock","blockEditorPrivateApis","PatternOverridesControls","attributes","setAttributes","name","blockName","controlId","useId","showAllowOverridesModal","setShowAllowOverridesModal","useState","showDisallowOverridesModal","setShowDisallowOverridesModal","hasName","metadata","defaultBindings","bindings","__default","hasOverrides","source","PATTERN_OVERRIDES_BINDING_SOURCE","isConnectedToOtherSources","updateBlockBindings","updateBindings","isChecked","customName","undefined","hasUnsupportedImageAttributes","caption","length","href","helpText","__","jsxs","Fragment","children","jsx","InspectorControls","group","BaseControl","__nextHasNoMarginBottom","id","label","help","Button","__next40pxDefaultSize","className","variant","onClick","disabled","accessibleWhenDisabled","AllowOverridesModal","initialName","onClose","onSave","newName","DisallowOverridesModal","_default","exports","default"],"sources":["@wordpress/patterns/src/components/pattern-overrides-controls.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, useId } from '@wordpress/element';\nimport {\n\tInspectorControls,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { BaseControl, Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { PATTERN_OVERRIDES_BINDING_SOURCE } from '../constants';\nimport {\n\tAllowOverridesModal,\n\tDisallowOverridesModal,\n} from './allow-overrides-modal';\nimport { unlock } from '../lock-unlock';\n\nconst { useBlockBindingsUtils } = unlock( blockEditorPrivateApis );\n\nfunction PatternOverridesControls( {\n\tattributes,\n\tsetAttributes,\n\tname: blockName,\n} ) {\n\tconst controlId = useId();\n\tconst [ showAllowOverridesModal, setShowAllowOverridesModal ] =\n\t\tuseState( false );\n\tconst [ showDisallowOverridesModal, setShowDisallowOverridesModal ] =\n\t\tuseState( false );\n\n\tconst hasName = !! attributes.metadata?.name;\n\tconst defaultBindings = attributes.metadata?.bindings?.__default;\n\tconst hasOverrides =\n\t\thasName && defaultBindings?.source === PATTERN_OVERRIDES_BINDING_SOURCE;\n\tconst isConnectedToOtherSources =\n\t\tdefaultBindings?.source &&\n\t\tdefaultBindings.source !== PATTERN_OVERRIDES_BINDING_SOURCE;\n\tconst { updateBlockBindings } = useBlockBindingsUtils();\n\n\tfunction updateBindings( isChecked, customName ) {\n\t\tif ( customName ) {\n\t\t\tsetAttributes( {\n\t\t\t\tmetadata: {\n\t\t\t\t\t...attributes.metadata,\n\t\t\t\t\tname: customName,\n\t\t\t\t},\n\t\t\t} );\n\t\t}\n\n\t\tupdateBlockBindings( {\n\t\t\t__default: isChecked\n\t\t\t\t? { source: PATTERN_OVERRIDES_BINDING_SOURCE }\n\t\t\t\t: undefined,\n\t\t} );\n\t}\n\n\t// Avoid overwriting other (e.g. meta) bindings.\n\tif ( isConnectedToOtherSources ) {\n\t\treturn null;\n\t}\n\n\tconst hasUnsupportedImageAttributes =\n\t\tblockName === 'core/image' &&\n\t\t( !! attributes.caption?.length || !! attributes.href?.length );\n\n\tconst helpText =\n\t\t! hasOverrides && hasUnsupportedImageAttributes\n\t\t\t? __(\n\t\t\t\t\t`Overrides currently don't support image captions or links. Remove the caption or link first before enabling overrides.`\n\t\t\t )\n\t\t\t: __(\n\t\t\t\t\t'Allow changes to this block throughout instances of this pattern.'\n\t\t\t );\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t<BaseControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tid={ controlId }\n\t\t\t\t\tlabel={ __( 'Overrides' ) }\n\t\t\t\t\thelp={ helpText }\n\t\t\t\t>\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tclassName=\"pattern-overrides-control__allow-overrides-button\"\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\taria-haspopup=\"dialog\"\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tif ( hasOverrides ) {\n\t\t\t\t\t\t\t\tsetShowDisallowOverridesModal( true );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tsetShowAllowOverridesModal( true );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tdisabled={\n\t\t\t\t\t\t\t! hasOverrides && hasUnsupportedImageAttributes\n\t\t\t\t\t\t}\n\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t>\n\t\t\t\t\t\t{ hasOverrides\n\t\t\t\t\t\t\t? __( 'Disable overrides' )\n\t\t\t\t\t\t\t: __( 'Enable overrides' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</BaseControl>\n\t\t\t</InspectorControls>\n\n\t\t\t{ showAllowOverridesModal && (\n\t\t\t\t<AllowOverridesModal\n\t\t\t\t\tinitialName={ attributes.metadata?.name }\n\t\t\t\t\tonClose={ () => setShowAllowOverridesModal( false ) }\n\t\t\t\t\tonSave={ ( newName ) => {\n\t\t\t\t\t\tupdateBindings( true, newName );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ showDisallowOverridesModal && (\n\t\t\t\t<DisallowOverridesModal\n\t\t\t\t\tonClose={ () => setShowDisallowOverridesModal( false ) }\n\t\t\t\t\tonSave={ () => updateBindings( false ) }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default PatternOverridesControls;\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAIA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAKA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,oBAAA,GAAAL,OAAA;AAIA,IAAAM,WAAA,GAAAN,OAAA;AAAwC,IAAAO,WAAA,GAAAP,OAAA;AAnBxC;AACA;AACA;;AASA;AACA;AACA;;AAQA,MAAM;EAAEQ;AAAsB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAElE,SAASC,wBAAwBA,CAAE;EAClCC,UAAU;EACVC,aAAa;EACbC,IAAI,EAAEC;AACP,CAAC,EAAG;EACH,MAAMC,SAAS,GAAG,IAAAC,cAAK,EAAC,CAAC;EACzB,MAAM,CAAEC,uBAAuB,EAAEC,0BAA0B,CAAE,GAC5D,IAAAC,iBAAQ,EAAE,KAAM,CAAC;EAClB,MAAM,CAAEC,0BAA0B,EAAEC,6BAA6B,CAAE,GA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AAc,CAAE,KAAM;IAAG,CACxC,CACD;EAAA,CACA,CAAC;AAEL;AAAC,IAAAkC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc1D,wBAAwB","ignoreList":[]}
1
+ {"version":3,"names":["_element","require","_blockEditor","_components","_i18n","_constants","_allowOverridesModal","_jsxRuntime","PatternOverridesControls","attributes","setAttributes","name","blockName","controlId","useId","showAllowOverridesModal","setShowAllowOverridesModal","useState","showDisallowOverridesModal","setShowDisallowOverridesModal","hasName","metadata","defaultBindings","bindings","__default","hasOverrides","source","PATTERN_OVERRIDES_BINDING_SOURCE","isConnectedToOtherSources","updateBlockBindings","useBlockBindingsUtils","updateBindings","isChecked","customName","undefined","hasUnsupportedImageAttributes","caption","length","href","helpText","__","jsxs","Fragment","children","jsx","InspectorControls","group","BaseControl","__nextHasNoMarginBottom","id","label","help","Button","__next40pxDefaultSize","className","variant","onClick","disabled","accessibleWhenDisabled","AllowOverridesModal","initialName","onClose","onSave","newName","DisallowOverridesModal","_default","exports","default"],"sources":["@wordpress/patterns/src/components/pattern-overrides-controls.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, useId } from '@wordpress/element';\nimport {\n\tInspectorControls,\n\tuseBlockBindingsUtils,\n} from '@wordpress/block-editor';\nimport { BaseControl, Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { PATTERN_OVERRIDES_BINDING_SOURCE } from '../constants';\nimport {\n\tAllowOverridesModal,\n\tDisallowOverridesModal,\n} from './allow-overrides-modal';\n\nfunction PatternOverridesControls( {\n\tattributes,\n\tsetAttributes,\n\tname: blockName,\n} ) {\n\tconst controlId = useId();\n\tconst [ showAllowOverridesModal, setShowAllowOverridesModal ] =\n\t\tuseState( false );\n\tconst [ showDisallowOverridesModal, setShowDisallowOverridesModal ] =\n\t\tuseState( false );\n\n\tconst hasName = !! attributes.metadata?.name;\n\tconst defaultBindings = attributes.metadata?.bindings?.__default;\n\tconst hasOverrides =\n\t\thasName && defaultBindings?.source === PATTERN_OVERRIDES_BINDING_SOURCE;\n\tconst isConnectedToOtherSources =\n\t\tdefaultBindings?.source &&\n\t\tdefaultBindings.source !== PATTERN_OVERRIDES_BINDING_SOURCE;\n\tconst { updateBlockBindings } = useBlockBindingsUtils();\n\n\tfunction updateBindings( isChecked, customName ) {\n\t\tif ( customName ) {\n\t\t\tsetAttributes( {\n\t\t\t\tmetadata: {\n\t\t\t\t\t...attributes.metadata,\n\t\t\t\t\tname: customName,\n\t\t\t\t},\n\t\t\t} );\n\t\t}\n\n\t\tupdateBlockBindings( {\n\t\t\t__default: isChecked\n\t\t\t\t? { source: PATTERN_OVERRIDES_BINDING_SOURCE }\n\t\t\t\t: undefined,\n\t\t} );\n\t}\n\n\t// Avoid overwriting other (e.g. meta) bindings.\n\tif ( isConnectedToOtherSources ) {\n\t\treturn null;\n\t}\n\n\tconst hasUnsupportedImageAttributes =\n\t\tblockName === 'core/image' &&\n\t\t( !! attributes.caption?.length || !! attributes.href?.length );\n\n\tconst helpText =\n\t\t! hasOverrides && hasUnsupportedImageAttributes\n\t\t\t? __(\n\t\t\t\t\t`Overrides currently don't support image captions or links. Remove the caption or link first before enabling overrides.`\n\t\t\t )\n\t\t\t: __(\n\t\t\t\t\t'Allow changes to this block throughout instances of this pattern.'\n\t\t\t );\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t<BaseControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tid={ controlId }\n\t\t\t\t\tlabel={ __( 'Overrides' ) }\n\t\t\t\t\thelp={ helpText }\n\t\t\t\t>\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tclassName=\"pattern-overrides-control__allow-overrides-button\"\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\taria-haspopup=\"dialog\"\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tif ( hasOverrides ) {\n\t\t\t\t\t\t\t\tsetShowDisallowOverridesModal( true );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tsetShowAllowOverridesModal( true );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tdisabled={\n\t\t\t\t\t\t\t! hasOverrides && hasUnsupportedImageAttributes\n\t\t\t\t\t\t}\n\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t>\n\t\t\t\t\t\t{ hasOverrides\n\t\t\t\t\t\t\t? __( 'Disable overrides' )\n\t\t\t\t\t\t\t: __( 'Enable overrides' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</BaseControl>\n\t\t\t</InspectorControls>\n\n\t\t\t{ showAllowOverridesModal && (\n\t\t\t\t<AllowOverridesModal\n\t\t\t\t\tinitialName={ attributes.metadata?.name }\n\t\t\t\t\tonClose={ () => setShowAllowOverridesModal( false ) }\n\t\t\t\t\tonSave={ ( newName ) => {\n\t\t\t\t\t\tupdateBindings( true, newName );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ showDisallowOverridesModal && (\n\t\t\t\t<DisallowOverridesModal\n\t\t\t\t\tonClose={ () => setShowDisallowOverridesModal( false ) }\n\t\t\t\t\tonSave={ () => updateBindings( false ) }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default PatternOverridesControls;\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAIA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAKA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,oBAAA,GAAAL,OAAA;AAGiC,IAAAM,WAAA,GAAAN,OAAA;AAlBjC;AACA;AACA;;AASA;AACA;AACA;;AAOA,SAASO,wBAAwBA,CAAE;EAClCC,UAAU;EACVC,aAAa;EACbC,IAAI,EAAEC;A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AAC;MAChC;IAAG,CACH,CACD,EACC7C,0BAA0B,iBAC3B,IAAAX,WAAA,CAAAqC,GAAA,EAACtC,oBAAA,CAAA0D,sBAAsB;MACtBH,OAAO,EAAGA,CAAA,KAAM1C,6BAA6B,CAAE,KAAM,CAAG;MACxD2C,MAAM,EAAGA,CAAA,KAAM/B,cAAc,CAAE,KAAM;IAAG,CACxC,CACD;EAAA,CACA,CAAC;AAEL;AAAC,IAAAkC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc3D,wBAAwB","ignoreList":[]}
@@ -2,7 +2,7 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { useState, useId } from '@wordpress/element';
5
- import { InspectorControls, privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
5
+ import { InspectorControls, useBlockBindingsUtils } from '@wordpress/block-editor';
6
6
  import { BaseControl, Button } from '@wordpress/components';
7
7
  import { __ } from '@wordpress/i18n';
8
8
 
@@ -11,13 +11,9 @@ import { __ } from '@wordpress/i18n';
11
11
  */
12
12
  import { PATTERN_OVERRIDES_BINDING_SOURCE } from '../constants';
13
13
  import { AllowOverridesModal, DisallowOverridesModal } from './allow-overrides-modal';
14
- import { unlock } from '../lock-unlock';
15
14
  import { jsx as _jsx } from "react/jsx-runtime";
16
15
  import { Fragment as _Fragment } from "react/jsx-runtime";
17
16
  import { jsxs as _jsxs } from "react/jsx-runtime";
18
- const {
19
- useBlockBindingsUtils
20
- } = unlock(blockEditorPrivateApis);
21
17
  function PatternOverridesControls({
22
18
  attributes,
23
19
  setAttributes,
@@ -1 +1 @@
1
- {"version":3,"names":["useState","useId","InspectorControls","privateApis","blockEditorPrivateApis","BaseControl","Button","__","PATTERN_OVERRIDES_BINDING_SOURCE","AllowOverridesModal","DisallowOverridesModal","unlock","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","useBlockBindingsUtils","PatternOverridesControls","attributes","setAttributes","name","blockName","controlId","showAllowOverridesModal","setShowAllowOverridesModal","showDisallowOverridesModal","setShowDisallowOverridesModal","hasName","metadata","defaultBindings","bindings","__default","hasOverrides","source","isConnectedToOtherSources","updateBlockBindings","updateBindings","isChecked","customName","undefined","hasUnsupportedImageAttributes","caption","length","href","helpText","children","group","__nextHasNoMarginBottom","id","label","help","__next40pxDefaultSize","className","variant","onClick","disabled","accessibleWhenDisabled","initialName","onClose","onSave","newName"],"sources":["@wordpress/patterns/src/components/pattern-overrides-controls.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, useId } from '@wordpress/element';\nimport {\n\tInspectorControls,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { BaseControl, Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { PATTERN_OVERRIDES_BINDING_SOURCE } from '../constants';\nimport {\n\tAllowOverridesModal,\n\tDisallowOverridesModal,\n} from './allow-overrides-modal';\nimport { unlock } from '../lock-unlock';\n\nconst { useBlockBindingsUtils } = unlock( blockEditorPrivateApis );\n\nfunction PatternOverridesControls( {\n\tattributes,\n\tsetAttributes,\n\tname: blockName,\n} ) {\n\tconst controlId = useId();\n\tconst [ showAllowOverridesModal, setShowAllowOverridesModal ] =\n\t\tuseState( false );\n\tconst [ showDisallowOverridesModal, setShowDisallowOverridesModal ] =\n\t\tuseState( false );\n\n\tconst hasName = !! attributes.metadata?.name;\n\tconst defaultBindings = attributes.metadata?.bindings?.__default;\n\tconst hasOverrides =\n\t\thasName && defaultBindings?.source === PATTERN_OVERRIDES_BINDING_SOURCE;\n\tconst isConnectedToOtherSources =\n\t\tdefaultBindings?.source &&\n\t\tdefaultBindings.source !== PATTERN_OVERRIDES_BINDING_SOURCE;\n\tconst { updateBlockBindings } = useBlockBindingsUtils();\n\n\tfunction updateBindings( isChecked, customName ) {\n\t\tif ( customName ) {\n\t\t\tsetAttributes( {\n\t\t\t\tmetadata: {\n\t\t\t\t\t...attributes.metadata,\n\t\t\t\t\tname: customName,\n\t\t\t\t},\n\t\t\t} );\n\t\t}\n\n\t\tupdateBlockBindings( {\n\t\t\t__default: isChecked\n\t\t\t\t? { source: PATTERN_OVERRIDES_BINDING_SOURCE }\n\t\t\t\t: undefined,\n\t\t} );\n\t}\n\n\t// Avoid overwriting other (e.g. meta) bindings.\n\tif ( isConnectedToOtherSources ) {\n\t\treturn null;\n\t}\n\n\tconst hasUnsupportedImageAttributes =\n\t\tblockName === 'core/image' &&\n\t\t( !! attributes.caption?.length || !! attributes.href?.length );\n\n\tconst helpText =\n\t\t! hasOverrides && hasUnsupportedImageAttributes\n\t\t\t? __(\n\t\t\t\t\t`Overrides currently don't support image captions or links. Remove the caption or link first before enabling overrides.`\n\t\t\t )\n\t\t\t: __(\n\t\t\t\t\t'Allow changes to this block throughout instances of this pattern.'\n\t\t\t );\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t<BaseControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tid={ controlId }\n\t\t\t\t\tlabel={ __( 'Overrides' ) }\n\t\t\t\t\thelp={ helpText }\n\t\t\t\t>\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tclassName=\"pattern-overrides-control__allow-overrides-button\"\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\taria-haspopup=\"dialog\"\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tif ( hasOverrides ) {\n\t\t\t\t\t\t\t\tsetShowDisallowOverridesModal( true );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tsetShowAllowOverridesModal( true );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tdisabled={\n\t\t\t\t\t\t\t! hasOverrides && hasUnsupportedImageAttributes\n\t\t\t\t\t\t}\n\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t>\n\t\t\t\t\t\t{ hasOverrides\n\t\t\t\t\t\t\t? __( 'Disable overrides' )\n\t\t\t\t\t\t\t: __( 'Enable overrides' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</BaseControl>\n\t\t\t</InspectorControls>\n\n\t\t\t{ showAllowOverridesModal && (\n\t\t\t\t<AllowOverridesModal\n\t\t\t\t\tinitialName={ attributes.metadata?.name }\n\t\t\t\t\tonClose={ () => setShowAllowOverridesModal( false ) }\n\t\t\t\t\tonSave={ ( newName ) => {\n\t\t\t\t\t\tupdateBindings( true, newName );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ showDisallowOverridesModal && (\n\t\t\t\t<DisallowOverridesModal\n\t\t\t\t\tonClose={ () => setShowDisallowOverridesModal( false ) }\n\t\t\t\t\tonSave={ () => updateBindings( false ) }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default PatternOverridesControls;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,EAAEC,KAAK,QAAQ,oBAAoB;AACpD,SACCC,iBAAiB,EACjBC,WAAW,IAAIC,sBAAsB,QAC/B,yBAAyB;AAChC,SAASC,WAAW,EAAEC,MAAM,QAAQ,uBAAuB;AAC3D,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,SAASC,gCAAgC,QAAQ,cAAc;AAC/D,SACCC,mBAAmB,EACnBC,sBAAsB,QAChB,yBAAyB;AAChC,SAASC,MAAM,QAAQ,gBAAgB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAExC,MAAM;EAAEC;AAAsB,CAAC,GAAGP,MAAM,CAAEP,sBAAuB,CAAC;AAElE,SAASe,wBAAwBA,CAAE;EAClCC,UAAU;EACVC,aAAa;EACbC,IAAI,EAAEC;AACP,CAAC,EAAG;EACH,MAAMC,SAAS,GAAGvB,KAAK,CAAC,CAAC;EACzB,MAAM,CAAEwB,uBAAuB,EAAE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","BaseControl","Button","__","PATTERN_OVERRIDES_BINDING_SOURCE","AllowOverridesModal","DisallowOverridesModal","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","PatternOverridesControls","attributes","setAttributes","name","blockName","controlId","showAllowOverridesModal","setShowAllowOverridesModal","showDisallowOverridesModal","setShowDisallowOverridesModal","hasName","metadata","defaultBindings","bindings","__default","hasOverrides","source","isConnectedToOtherSources","updateBlockBindings","updateBindings","isChecked","customName","undefined","hasUnsupportedImageAttributes","caption","length","href","helpText","children","group","__nextHasNoMarginBottom","id","label","help","__next40pxDefaultSize","className","variant","onClick","disabled","accessibleWhenDisabled","initialName","onClose","onSave","newName"],"sources":["@wordpress/patterns/src/components/pattern-overrides-controls.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, useId } from '@wordpress/element';\nimport {\n\tInspectorControls,\n\tuseBlockBindingsUtils,\n} from '@wordpress/block-editor';\nimport { BaseControl, Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { PATTERN_OVERRIDES_BINDING_SOURCE } from '../constants';\nimport {\n\tAllowOverridesModal,\n\tDisallowOverridesModal,\n} from './allow-overrides-modal';\n\nfunction PatternOverridesControls( {\n\tattributes,\n\tsetAttributes,\n\tname: blockName,\n} ) {\n\tconst controlId = useId();\n\tconst [ showAllowOverridesModal, setShowAllowOverridesModal ] =\n\t\tuseState( false );\n\tconst [ showDisallowOverridesModal, setShowDisallowOverridesModal ] =\n\t\tuseState( false );\n\n\tconst hasName = !! attributes.metadata?.name;\n\tconst defaultBindings = attributes.metadata?.bindings?.__default;\n\tconst hasOverrides =\n\t\thasName && defaultBindings?.source === PATTERN_OVERRIDES_BINDING_SOURCE;\n\tconst isConnectedToOtherSources =\n\t\tdefaultBindings?.source &&\n\t\tdefaultBindings.source !== PATTERN_OVERRIDES_BINDING_SOURCE;\n\tconst { updateBlockBindings } = useBlockBindingsUtils();\n\n\tfunction updateBindings( isChecked, customName ) {\n\t\tif ( customName ) {\n\t\t\tsetAttributes( {\n\t\t\t\tmetadata: {\n\t\t\t\t\t...attributes.metadata,\n\t\t\t\t\tname: customName,\n\t\t\t\t},\n\t\t\t} );\n\t\t}\n\n\t\tupdateBlockBindings( {\n\t\t\t__default: isChecked\n\t\t\t\t? { source: PATTERN_OVERRIDES_BINDING_SOURCE }\n\t\t\t\t: undefined,\n\t\t} );\n\t}\n\n\t// Avoid overwriting other (e.g. meta) bindings.\n\tif ( isConnectedToOtherSources ) {\n\t\treturn null;\n\t}\n\n\tconst hasUnsupportedImageAttributes =\n\t\tblockName === 'core/image' &&\n\t\t( !! attributes.caption?.length || !! attributes.href?.length );\n\n\tconst helpText =\n\t\t! hasOverrides && hasUnsupportedImageAttributes\n\t\t\t? __(\n\t\t\t\t\t`Overrides currently don't support image captions or links. Remove the caption or link first before enabling overrides.`\n\t\t\t )\n\t\t\t: __(\n\t\t\t\t\t'Allow changes to this block throughout instances of this pattern.'\n\t\t\t );\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t<BaseControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tid={ controlId }\n\t\t\t\t\tlabel={ __( 'Overrides' ) }\n\t\t\t\t\thelp={ helpText }\n\t\t\t\t>\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tclassName=\"pattern-overrides-control__allow-overrides-button\"\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\taria-haspopup=\"dialog\"\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tif ( hasOverrides ) {\n\t\t\t\t\t\t\t\tsetShowDisallowOverridesModal( true );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tsetShowAllowOverridesModal( true );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tdisabled={\n\t\t\t\t\t\t\t! hasOverrides && hasUnsupportedImageAttributes\n\t\t\t\t\t\t}\n\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t>\n\t\t\t\t\t\t{ hasOverrides\n\t\t\t\t\t\t\t? __( 'Disable overrides' )\n\t\t\t\t\t\t\t: __( 'Enable overrides' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</BaseControl>\n\t\t\t</InspectorControls>\n\n\t\t\t{ showAllowOverridesModal && (\n\t\t\t\t<AllowOverridesModal\n\t\t\t\t\tinitialName={ attributes.metadata?.name }\n\t\t\t\t\tonClose={ () => setShowAllowOverridesModal( false ) }\n\t\t\t\t\tonSave={ ( newName ) => {\n\t\t\t\t\t\tupdateBindings( true, newName );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ showDisallowOverridesModal && (\n\t\t\t\t<DisallowOverridesModal\n\t\t\t\t\tonClose={ () => setShowDisallowOverridesModal( false ) }\n\t\t\t\t\tonSave={ () => updateBindings( false ) }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default PatternOverridesControls;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,EAAEC,KAAK,QAAQ,oBAAoB;AACpD,SACCC,iBAAiB,EACjBC,qBAAqB,QACf,yBAAyB;AAChC,SAASC,WAAW,EAAEC,MAAM,QAAQ,uBAAuB;AAC3D,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,SAASC,gCAAgC,QAAQ,cAAc;AAC/D,SACCC,mBAAmB,EACnBC,sBAAsB,QAChB,yBAAyB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAEjC,SAASC,wBAAwBA,CAAE;EAClCC,UAAU;EACVC,aAAa;EACbC,IAAI,EAAEC;AACP,CAAC,EAAG;EACH,MAAMC,SAAS,GAAGpB,KAAK,CAAC,CAAC;EACzB,MAAM,CAAEqB,uBAAuB,EAA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variables.
31
31
  */
32
+ /**
33
+ * Typography
34
+ */
32
35
  /**
33
36
  * Grid System.
34
37
  * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
@@ -43,7 +46,10 @@
43
46
  * Dimensions.
44
47
  */
45
48
  /**
46
- * Editor widths.
49
+ * Mobile specific styles
50
+ */
51
+ /**
52
+ * Editor styles.
47
53
  */
48
54
  /**
49
55
  * Block & Editor UI.
@@ -67,6 +73,9 @@
67
73
  * Creates a fading overlay to signify that the content is longer
68
74
  * than the space allows.
69
75
  */
76
+ /**
77
+ * Typography
78
+ */
70
79
  /**
71
80
  * Breakpoint mixins
72
81
  */
@@ -29,6 +29,9 @@
29
29
  /**
30
30
  * Fonts & basic variables.
31
31
  */
32
+ /**
33
+ * Typography
34
+ */
32
35
  /**
33
36
  * Grid System.
34
37
  * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
@@ -43,7 +46,10 @@
43
46
  * Dimensions.
44
47
  */
45
48
  /**
46
- * Editor widths.
49
+ * Mobile specific styles
50
+ */
51
+ /**
52
+ * Editor styles.
47
53
  */
48
54
  /**
49
55
  * Block & Editor UI.
@@ -67,6 +73,9 @@
67
73
  * Creates a fading overlay to signify that the content is longer
68
74
  * than the space allows.
69
75
  */
76
+ /**
77
+ * Typography
78
+ */
70
79
  /**
71
80
  * Breakpoint mixins
72
81
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/patterns",
3
- "version": "2.8.3",
3
+ "version": "2.9.0",
4
4
  "description": "Management of user pattern editing.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -32,20 +32,20 @@
32
32
  ],
33
33
  "dependencies": {
34
34
  "@babel/runtime": "^7.16.0",
35
- "@wordpress/a11y": "^4.8.2",
36
- "@wordpress/block-editor": "^14.3.3",
37
- "@wordpress/blocks": "^13.8.3",
38
- "@wordpress/components": "^28.8.3",
39
- "@wordpress/compose": "^7.8.3",
40
- "@wordpress/core-data": "^7.8.3",
41
- "@wordpress/data": "^10.8.3",
42
- "@wordpress/element": "^6.8.1",
43
- "@wordpress/html-entities": "^4.8.1",
44
- "@wordpress/i18n": "^5.8.2",
45
- "@wordpress/icons": "^10.8.2",
46
- "@wordpress/notices": "^5.8.3",
47
- "@wordpress/private-apis": "^1.8.1",
48
- "@wordpress/url": "^4.8.1"
35
+ "@wordpress/a11y": "^4.9.0",
36
+ "@wordpress/block-editor": "^14.4.0",
37
+ "@wordpress/blocks": "^13.9.0",
38
+ "@wordpress/components": "^28.9.0",
39
+ "@wordpress/compose": "^7.9.0",
40
+ "@wordpress/core-data": "^7.9.0",
41
+ "@wordpress/data": "^10.9.0",
42
+ "@wordpress/element": "^6.9.0",
43
+ "@wordpress/html-entities": "^4.9.0",
44
+ "@wordpress/i18n": "^5.9.0",
45
+ "@wordpress/icons": "^10.9.0",
46
+ "@wordpress/notices": "^5.9.0",
47
+ "@wordpress/private-apis": "^1.9.0",
48
+ "@wordpress/url": "^4.9.0"
49
49
  },
50
50
  "peerDependencies": {
51
51
  "react": "^18.0.0",
@@ -54,5 +54,5 @@
54
54
  "publishConfig": {
55
55
  "access": "public"
56
56
  },
57
- "gitHead": "6187079697e13c3292eb098d6338523a6676c6e8"
57
+ "gitHead": "2e5495c635910cb34bfaca3c6258d2e989f66214"
58
58
  }
@@ -4,7 +4,7 @@
4
4
  import { useState, useId } from '@wordpress/element';
5
5
  import {
6
6
  InspectorControls,
7
- privateApis as blockEditorPrivateApis,
7
+ useBlockBindingsUtils,
8
8
  } from '@wordpress/block-editor';
9
9
  import { BaseControl, Button } from '@wordpress/components';
10
10
  import { __ } from '@wordpress/i18n';
@@ -17,9 +17,6 @@ import {
17
17
  AllowOverridesModal,
18
18
  DisallowOverridesModal,
19
19
  } from './allow-overrides-modal';
20
- import { unlock } from '../lock-unlock';
21
-
22
- const { useBlockBindingsUtils } = unlock( blockEditorPrivateApis );
23
20
 
24
21
  function PatternOverridesControls( {
25
22
  attributes,