@wordpress/widgets 2.13.0 → 2.14.1-next.957ca95e4c.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.14.0 (2022-08-24)
6
+
5
7
  ## 2.13.0 (2022-08-10)
6
8
 
7
9
  ## 2.12.0 (2022-07-27)
@@ -103,8 +103,10 @@ function Form(_ref) {
103
103
  className: "wp-block-legacy-widget__edit-form-title"
104
104
  }, title), (0, _element.createElement)(_components.Popover, {
105
105
  focusOnMount: false,
106
- position: "middle right",
107
- __unstableForcePosition: true
106
+ placement: "right",
107
+ offset: 32,
108
+ __unstableForcePosition: true,
109
+ __unstableShift: true
108
110
  }, (0, _element.createElement)("div", {
109
111
  ref: ref,
110
112
  className: "wp-block-legacy-widget__edit-form",
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/widgets/src/blocks/legacy-widget/edit/form.js"],"names":["Form","title","isVisible","id","idBase","instance","isWide","onChangeInstance","onChangeHasPreview","ref","isMediumLargeViewport","outgoingInstances","Set","incomingInstances","createNotice","noticesStore","current","has","delete","control","Control","nextInstance","add","onError","error","window","console","appendChild","element","destroy"],"mappings":";;;;;;;;;AAOA;;AAJA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAIA;;AAhBA;AACA;AACA;;AAEA;AACA;AACA;;AAOA;AACA;AACA;AAGe,SAASA,IAAT,OASX;AAAA,MAT0B;AAC7BC,IAAAA,KAD6B;AAE7BC,IAAAA,SAF6B;AAG7BC,IAAAA,EAH6B;AAI7BC,IAAAA,MAJ6B;AAK7BC,IAAAA,QAL6B;AAM7BC,IAAAA,MAN6B;AAO7BC,IAAAA,gBAP6B;AAQ7BC,IAAAA;AAR6B,GAS1B;AACH,QAAMC,GAAG,GAAG,sBAAZ;AAEA,QAAMC,qBAAqB,GAAG,+BAAkB,OAAlB,CAA9B,C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AkCb,QAAlC;AACA;AACA;;AAEDc,MAAAA,OAAO,CAACU,OAAR;AACA,KAPD;AAQA,GAzCD,EAyCG,CACF1B,EADE,EAEFC,MAFE,EAGFC,QAHE,EAIFE,gBAJE,EAKFC,kBALE,EAMFE,qBANE,CAzCH;;AAkDA,MAAKJ,MAAM,IAAII,qBAAf,EAAuC;AACtC,WACC;AACC,MAAA,SAAS,EAAG,yBAAY;AACvB,6CAAqCR;AADd,OAAZ;AADb,OAKGA,SAAS,IACV;AAAI,MAAA,SAAS,EAAC;AAAd,OACGD,KADH,CANF,EAUC,4BAAC,mBAAD;AACC,MAAA,YAAY,EAAG,KADhB;AAEC,MAAA,QAAQ,EAAC,cAFV;AAGC,MAAA,uBAAuB;AAHxB,OAKC;AACC,MAAA,GAAG,EAAGQ,GADP;AAEC,MAAA,SAAS,EAAC,mCAFX;AAGC,MAAA,MAAM,EAAG,CAAEP;AAHZ,MALD,CAVD,CADD;AAwBA;;AAED,SACC;AACC,IAAA,GAAG,EAAGO,GADP;AAEC,IAAA,SAAS,EAAC,mCAFX;AAGC,IAAA,MAAM,EAAG,CAAEP;AAHZ,KAKC;AAAI,IAAA,SAAS,EAAC;AAAd,KACGD,KADH,CALD,CADD;AAWA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n/**\n * WordPress dependencies\n */\nimport { useRef, useEffect } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Popover } from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\n/**\n * Internal dependencies\n */\nimport Control from './control';\n\nexport default function Form( {\n\ttitle,\n\tisVisible,\n\tid,\n\tidBase,\n\tinstance,\n\tisWide,\n\tonChangeInstance,\n\tonChangeHasPreview,\n} ) {\n\tconst ref = useRef();\n\n\tconst isMediumLargeViewport = useViewportMatch( 'small' );\n\n\t// We only want to remount the control when the instance changes\n\t// *externally*. For example, if the user performs an undo. To do this, we\n\t// keep track of changes made to instance by the control itself and then\n\t// ignore those.\n\tconst outgoingInstances = useRef( new Set() );\n\tconst incomingInstances = useRef( new Set() );\n\n\tconst { createNotice } = useDispatch( noticesStore );\n\n\tuseEffect( () => {\n\t\tif ( incomingInstances.current.has( instance ) ) {\n\t\t\tincomingInstances.current.delete( instance );\n\t\t\treturn;\n\t\t}\n\n\t\tconst control = new Control( {\n\t\t\tid,\n\t\t\tidBase,\n\t\t\tinstance,\n\t\t\tonChangeInstance( nextInstance ) {\n\t\t\t\toutgoingInstances.current.add( instance );\n\t\t\t\tincomingInstances.current.add( nextInstance );\n\t\t\t\tonChangeInstance( nextInstance );\n\t\t\t},\n\t\t\tonChangeHasPreview,\n\t\t\tonError( error ) {\n\t\t\t\twindow.console.error( error );\n\t\t\t\tcreateNotice(\n\t\t\t\t\t'error',\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: %s: the name of the affected block. */\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'The \"%s\" block was affected by errors and may not function properly. Check the developer tools for more details.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tidBase || id\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t},\n\t\t} );\n\n\t\tref.current.appendChild( control.element );\n\n\t\treturn () => {\n\t\t\tif ( outgoingInstances.current.has( instance ) ) {\n\t\t\t\toutgoingInstances.current.delete( instance );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcontrol.destroy();\n\t\t};\n\t}, [\n\t\tid,\n\t\tidBase,\n\t\tinstance,\n\t\tonChangeInstance,\n\t\tonChangeHasPreview,\n\t\tisMediumLargeViewport,\n\t] );\n\n\tif ( isWide && isMediumLargeViewport ) {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclassName={ classnames( {\n\t\t\t\t\t'wp-block-legacy-widget__container': isVisible,\n\t\t\t\t} ) }\n\t\t\t>\n\t\t\t\t{ isVisible && (\n\t\t\t\t\t<h3 className=\"wp-block-legacy-widget__edit-form-title\">\n\t\t\t\t\t\t{ title }\n\t\t\t\t\t</h3>\n\t\t\t\t) }\n\t\t\t\t<Popover\n\t\t\t\t\tfocusOnMount={ false }\n\t\t\t\t\tposition=\"middle right\"\n\t\t\t\t\t__unstableForcePosition\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\tclassName=\"wp-block-legacy-widget__edit-form\"\n\t\t\t\t\t\thidden={ ! isVisible }\n\t\t\t\t\t></div>\n\t\t\t\t</Popover>\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn (\n\t\t<div\n\t\t\tref={ ref }\n\t\t\tclassName=\"wp-block-legacy-widget__edit-form\"\n\t\t\thidden={ ! isVisible }\n\t\t>\n\t\t\t<h3 className=\"wp-block-legacy-widget__edit-form-title\">\n\t\t\t\t{ title }\n\t\t\t</h3>\n\t\t</div>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/widgets/src/blocks/legacy-widget/edit/form.js"],"names":["Form","title","isVisible","id","idBase","instance","isWide","onChangeInstance","onChangeHasPreview","ref","isMediumLargeViewport","outgoingInstances","Set","incomingInstances","createNotice","noticesStore","current","has","delete","control","Control","nextInstance","add","onError","error","window","console","appendChild","element","destroy"],"mappings":";;;;;;;;;AAOA;;AAJA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAIA;;AAhBA;AACA;AACA;;AAEA;AACA;AACA;;AAOA;AACA;AACA;AAGe,SAASA,IAAT,OASX;AAAA,MAT0B;AAC7BC,IAAAA,KAD6B;AAE7BC,IAAAA,SAF6B;AAG7BC,IAAAA,EAH6B;AAI7BC,IAAAA,MAJ6B;AAK7BC,IAAAA,QAL6B;AAM7BC,IAAAA,MAN6B;AAO7BC,IAAAA,gBAP6B;AAQ7BC,IAAAA;AAR6B,GAS1B;AACH,QAAMC,GAAG,GAAG,sBAAZ;AAEA,QAAMC,qBAAqB,GAAG,+BAAkB,OAAlB,CAA9B,CAHG,CAKH;AACA;AACA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ACA;;AAEDc,MAAAA,OAAO,CAACU,OAAR;AACA,KAPD;AAQA,GAzCD,EAyCG,CACF1B,EADE,EAEFC,MAFE,EAGFC,QAHE,EAIFE,gBAJE,EAKFC,kBALE,EAMFE,qBANE,CAzCH;;AAkDA,MAAKJ,MAAM,IAAII,qBAAf,EAAuC;AACtC,WACC;AACC,MAAA,SAAS,EAAG,yBAAY;AACvB,6CAAqCR;AADd,OAAZ;AADb,OAKGA,SAAS,IACV;AAAI,MAAA,SAAS,EAAC;AAAd,OACGD,KADH,CANF,EAUC,4BAAC,mBAAD;AACC,MAAA,YAAY,EAAG,KADhB;AAEC,MAAA,SAAS,EAAC,OAFX;AAGC,MAAA,MAAM,EAAG,EAHV;AAIC,MAAA,uBAAuB,MAJxB;AAKC,MAAA,eAAe;AALhB,OAOC;AACC,MAAA,GAAG,EAAGQ,GADP;AAEC,MAAA,SAAS,EAAC,mCAFX;AAGC,MAAA,MAAM,EAAG,CAAEP;AAHZ,MAPD,CAVD,CADD;AA0BA;;AAED,SACC;AACC,IAAA,GAAG,EAAGO,GADP;AAEC,IAAA,SAAS,EAAC,mCAFX;AAGC,IAAA,MAAM,EAAG,CAAEP;AAHZ,KAKC;AAAI,IAAA,SAAS,EAAC;AAAd,KACGD,KADH,CALD,CADD;AAWA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n/**\n * WordPress dependencies\n */\nimport { useRef, useEffect } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Popover } from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\n/**\n * Internal dependencies\n */\nimport Control from './control';\n\nexport default function Form( {\n\ttitle,\n\tisVisible,\n\tid,\n\tidBase,\n\tinstance,\n\tisWide,\n\tonChangeInstance,\n\tonChangeHasPreview,\n} ) {\n\tconst ref = useRef();\n\n\tconst isMediumLargeViewport = useViewportMatch( 'small' );\n\n\t// We only want to remount the control when the instance changes\n\t// *externally*. For example, if the user performs an undo. To do this, we\n\t// keep track of changes made to instance by the control itself and then\n\t// ignore those.\n\tconst outgoingInstances = useRef( new Set() );\n\tconst incomingInstances = useRef( new Set() );\n\n\tconst { createNotice } = useDispatch( noticesStore );\n\n\tuseEffect( () => {\n\t\tif ( incomingInstances.current.has( instance ) ) {\n\t\t\tincomingInstances.current.delete( instance );\n\t\t\treturn;\n\t\t}\n\n\t\tconst control = new Control( {\n\t\t\tid,\n\t\t\tidBase,\n\t\t\tinstance,\n\t\t\tonChangeInstance( nextInstance ) {\n\t\t\t\toutgoingInstances.current.add( instance );\n\t\t\t\tincomingInstances.current.add( nextInstance );\n\t\t\t\tonChangeInstance( nextInstance );\n\t\t\t},\n\t\t\tonChangeHasPreview,\n\t\t\tonError( error ) {\n\t\t\t\twindow.console.error( error );\n\t\t\t\tcreateNotice(\n\t\t\t\t\t'error',\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: %s: the name of the affected block. */\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'The \"%s\" block was affected by errors and may not function properly. Check the developer tools for more details.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tidBase || id\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t},\n\t\t} );\n\n\t\tref.current.appendChild( control.element );\n\n\t\treturn () => {\n\t\t\tif ( outgoingInstances.current.has( instance ) ) {\n\t\t\t\toutgoingInstances.current.delete( instance );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcontrol.destroy();\n\t\t};\n\t}, [\n\t\tid,\n\t\tidBase,\n\t\tinstance,\n\t\tonChangeInstance,\n\t\tonChangeHasPreview,\n\t\tisMediumLargeViewport,\n\t] );\n\n\tif ( isWide && isMediumLargeViewport ) {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclassName={ classnames( {\n\t\t\t\t\t'wp-block-legacy-widget__container': isVisible,\n\t\t\t\t} ) }\n\t\t\t>\n\t\t\t\t{ isVisible && (\n\t\t\t\t\t<h3 className=\"wp-block-legacy-widget__edit-form-title\">\n\t\t\t\t\t\t{ title }\n\t\t\t\t\t</h3>\n\t\t\t\t) }\n\t\t\t\t<Popover\n\t\t\t\t\tfocusOnMount={ false }\n\t\t\t\t\tplacement=\"right\"\n\t\t\t\t\toffset={ 32 }\n\t\t\t\t\t__unstableForcePosition\n\t\t\t\t\t__unstableShift\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\tclassName=\"wp-block-legacy-widget__edit-form\"\n\t\t\t\t\t\thidden={ ! isVisible }\n\t\t\t\t\t></div>\n\t\t\t\t</Popover>\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn (\n\t\t<div\n\t\t\tref={ ref }\n\t\t\tclassName=\"wp-block-legacy-widget__edit-form\"\n\t\t\thidden={ ! isVisible }\n\t\t>\n\t\t\t<h3 className=\"wp-block-legacy-widget__edit-form-title\">\n\t\t\t\t{ title }\n\t\t\t</h3>\n\t\t</div>\n\t);\n}\n"]}
@@ -88,8 +88,10 @@ export default function Form(_ref) {
88
88
  className: "wp-block-legacy-widget__edit-form-title"
89
89
  }, title), createElement(Popover, {
90
90
  focusOnMount: false,
91
- position: "middle right",
92
- __unstableForcePosition: true
91
+ placement: "right",
92
+ offset: 32,
93
+ __unstableForcePosition: true,
94
+ __unstableShift: true
93
95
  }, createElement("div", {
94
96
  ref: ref,
95
97
  className: "wp-block-legacy-widget__edit-form",
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/widgets/src/blocks/legacy-widget/edit/form.js"],"names":["classnames","useRef","useEffect","useDispatch","store","noticesStore","__","sprintf","Popover","useViewportMatch","Control","Form","title","isVisible","id","idBase","instance","isWide","onChangeInstance","onChangeHasPreview","ref","isMediumLargeViewport","outgoingInstances","Set","incomingInstances","createNotice","current","has","delete","control","nextInstance","add","onError","error","window","console","appendChild","element","destroy"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAu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S,EAAC,mCAFX;AAGC,MAAA,MAAM,EAAG,CAAEP;AAHZ,MALD,CAVD,CADD;AAwBA;;AAED,SACC;AACC,IAAA,GAAG,EAAGO,GADP;AAEC,IAAA,SAAS,EAAC,mCAFX;AAGC,IAAA,MAAM,EAAG,CAAEP;AAHZ,KAKC;AAAI,IAAA,SAAS,EAAC;AAAd,KACGD,KADH,CALD,CADD;AAWA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n/**\n * WordPress dependencies\n */\nimport { useRef, useEffect } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Popover } from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\n/**\n * Internal dependencies\n */\nimport Control from './control';\n\nexport default function Form( {\n\ttitle,\n\tisVisible,\n\tid,\n\tidBase,\n\tinstance,\n\tisWide,\n\tonChangeInstance,\n\tonChangeHasPreview,\n} ) {\n\tconst ref = useRef();\n\n\tconst isMediumLargeViewport = useViewportMatch( 'small' );\n\n\t// We only want to remount the control when the instance changes\n\t// *externally*. For example, if the user performs an undo. To do this, we\n\t// keep track of changes made to instance by the control itself and then\n\t// ignore those.\n\tconst outgoingInstances = useRef( new Set() );\n\tconst incomingInstances = useRef( new Set() );\n\n\tconst { createNotice } = useDispatch( noticesStore );\n\n\tuseEffect( () => {\n\t\tif ( incomingInstances.current.has( instance ) ) {\n\t\t\tincomingInstances.current.delete( instance );\n\t\t\treturn;\n\t\t}\n\n\t\tconst control = new Control( {\n\t\t\tid,\n\t\t\tidBase,\n\t\t\tinstance,\n\t\t\tonChangeInstance( nextInstance ) {\n\t\t\t\toutgoingInstances.current.add( instance );\n\t\t\t\tincomingInstances.current.add( nextInstance );\n\t\t\t\tonChangeInstance( nextInstance );\n\t\t\t},\n\t\t\tonChangeHasPreview,\n\t\t\tonError( error ) {\n\t\t\t\twindow.console.error( error );\n\t\t\t\tcreateNotice(\n\t\t\t\t\t'error',\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: %s: the name of the affected block. */\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'The \"%s\" block was affected by errors and may not function properly. Check the developer tools for more details.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tidBase || id\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t},\n\t\t} );\n\n\t\tref.current.appendChild( control.element );\n\n\t\treturn () => {\n\t\t\tif ( outgoingInstances.current.has( instance ) ) {\n\t\t\t\toutgoingInstances.current.delete( instance );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcontrol.destroy();\n\t\t};\n\t}, [\n\t\tid,\n\t\tidBase,\n\t\tinstance,\n\t\tonChangeInstance,\n\t\tonChangeHasPreview,\n\t\tisMediumLargeViewport,\n\t] );\n\n\tif ( isWide && isMediumLargeViewport ) {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclassName={ classnames( {\n\t\t\t\t\t'wp-block-legacy-widget__container': isVisible,\n\t\t\t\t} ) }\n\t\t\t>\n\t\t\t\t{ isVisible && (\n\t\t\t\t\t<h3 className=\"wp-block-legacy-widget__edit-form-title\">\n\t\t\t\t\t\t{ title }\n\t\t\t\t\t</h3>\n\t\t\t\t) }\n\t\t\t\t<Popover\n\t\t\t\t\tfocusOnMount={ false }\n\t\t\t\t\tposition=\"middle right\"\n\t\t\t\t\t__unstableForcePosition\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\tclassName=\"wp-block-legacy-widget__edit-form\"\n\t\t\t\t\t\thidden={ ! isVisible }\n\t\t\t\t\t></div>\n\t\t\t\t</Popover>\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn (\n\t\t<div\n\t\t\tref={ ref }\n\t\t\tclassName=\"wp-block-legacy-widget__edit-form\"\n\t\t\thidden={ ! isVisible }\n\t\t>\n\t\t\t<h3 className=\"wp-block-legacy-widget__edit-form-title\">\n\t\t\t\t{ title }\n\t\t\t</h3>\n\t\t</div>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/widgets/src/blocks/legacy-widget/edit/form.js"],"names":["classnames","useRef","useEffect","useDispatch","store","noticesStore","__","sprintf","Popover","useViewportMatch","Control","Form","title","isVisible","id","idBase","instance","isWide","onChangeInstance","onChangeHasPreview","ref","isMediumLargeViewport","outgoingInstances","Set","incomingInstances","createNotice","current","has","delete","control","nextInstance","add","onError","error","window","console","appendChild","element","destroy"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AACA;AACA;AACA;;AACA,SAASC,MAAT,EAAiBC,SAAjB,QAAkC,oBAAlC;AACA,SAASC,WAAT,QAA4B,iBAA5B;AACA,SAASC,KAAK,IAAIC,YAAlB,QAAsC,oBAAtC;AACA,SAASC,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SAASC,OAAT,QAAwB,uBAAxB;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AACA;AACA;AACA;;AACA,OAAOC,OAAP,MAAoB,WAApB;AAEA,eAAe,SAASC,IAAT,OASX;AAAA,MAT0B;AAC7BC,IAAAA,KAD6B;AAE7BC,IAAAA,SAF6B;AAG7BC,IAAAA,EAH6B;AAI7BC,IAAAA,MAJ6B;AAK7BC,IAAAA,QAL6B;AAM7BC,IAAAA,MAN6B;AAO7BC,IAAAA,gBAP6B;AAQ7BC,IAAAA;AAR6B,GAS1B;AACH,QAAMC,GAAG,GAAGnB,MAAM,EAAlB;AAEA,QAAMoB,qBAAqB,GAAGZ,gBAAgB,CAAE,OAAF,CAA9C,CAHG,CAKH;AACA;AACA;AACA;;AACA,QAAMa,iBAAiB,GAAGrB,MAAM,CAAE,IAAIsB,GAAJ,EAAF,CAAhC;AACA,QAAMC,iBAAiB,GAAGvB,MAAM,CAAE,IAAIsB,GAAJ,EAAF,CAAhC;AAEA,QAAM;AAAEE,IAAAA;AAAF,MAAmBtB,WAAW,CAAEE,YAAF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CAzCM,CAAT;;AAkDA,MAAKJ,MAAM,IAAII,qBAAf,EAAuC;AACtC,WACC;AACC,MAAA,SAAS,EAAGrB,UAAU,CAAE;AACvB,6CAAqCa;AADd,OAAF;AADvB,OAKGA,SAAS,IACV;AAAI,MAAA,SAAS,EAAC;AAAd,OACGD,KADH,CANF,EAUC,cAAC,OAAD;AACC,MAAA,YAAY,EAAG,KADhB;AAEC,MAAA,SAAS,EAAC,OAFX;AAGC,MAAA,MAAM,EAAG,EAHV;AAIC,MAAA,uBAAuB,MAJxB;AAKC,MAAA,eAAe;AALhB,OAOC;AACC,MAAA,GAAG,EAAGQ,GADP;AAEC,MAAA,SAAS,EAAC,mCAFX;AAGC,MAAA,MAAM,EAAG,CAAEP;AAHZ,MAPD,CAVD,CADD;AA0BA;;AAED,SACC;AACC,IAAA,GAAG,EAAGO,GADP;AAEC,IAAA,SAAS,EAAC,mCAFX;AAGC,IAAA,MAAM,EAAG,CAAEP;AAHZ,KAKC;AAAI,IAAA,SAAS,EAAC;AAAd,KACGD,KADH,CALD,CADD;AAWA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n/**\n * WordPress dependencies\n */\nimport { useRef, useEffect } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Popover } from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\n/**\n * Internal dependencies\n */\nimport Control from './control';\n\nexport default function Form( {\n\ttitle,\n\tisVisible,\n\tid,\n\tidBase,\n\tinstance,\n\tisWide,\n\tonChangeInstance,\n\tonChangeHasPreview,\n} ) {\n\tconst ref = useRef();\n\n\tconst isMediumLargeViewport = useViewportMatch( 'small' );\n\n\t// We only want to remount the control when the instance changes\n\t// *externally*. For example, if the user performs an undo. To do this, we\n\t// keep track of changes made to instance by the control itself and then\n\t// ignore those.\n\tconst outgoingInstances = useRef( new Set() );\n\tconst incomingInstances = useRef( new Set() );\n\n\tconst { createNotice } = useDispatch( noticesStore );\n\n\tuseEffect( () => {\n\t\tif ( incomingInstances.current.has( instance ) ) {\n\t\t\tincomingInstances.current.delete( instance );\n\t\t\treturn;\n\t\t}\n\n\t\tconst control = new Control( {\n\t\t\tid,\n\t\t\tidBase,\n\t\t\tinstance,\n\t\t\tonChangeInstance( nextInstance ) {\n\t\t\t\toutgoingInstances.current.add( instance );\n\t\t\t\tincomingInstances.current.add( nextInstance );\n\t\t\t\tonChangeInstance( nextInstance );\n\t\t\t},\n\t\t\tonChangeHasPreview,\n\t\t\tonError( error ) {\n\t\t\t\twindow.console.error( error );\n\t\t\t\tcreateNotice(\n\t\t\t\t\t'error',\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: %s: the name of the affected block. */\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'The \"%s\" block was affected by errors and may not function properly. Check the developer tools for more details.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tidBase || id\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t},\n\t\t} );\n\n\t\tref.current.appendChild( control.element );\n\n\t\treturn () => {\n\t\t\tif ( outgoingInstances.current.has( instance ) ) {\n\t\t\t\toutgoingInstances.current.delete( instance );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcontrol.destroy();\n\t\t};\n\t}, [\n\t\tid,\n\t\tidBase,\n\t\tinstance,\n\t\tonChangeInstance,\n\t\tonChangeHasPreview,\n\t\tisMediumLargeViewport,\n\t] );\n\n\tif ( isWide && isMediumLargeViewport ) {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclassName={ classnames( {\n\t\t\t\t\t'wp-block-legacy-widget__container': isVisible,\n\t\t\t\t} ) }\n\t\t\t>\n\t\t\t\t{ isVisible && (\n\t\t\t\t\t<h3 className=\"wp-block-legacy-widget__edit-form-title\">\n\t\t\t\t\t\t{ title }\n\t\t\t\t\t</h3>\n\t\t\t\t) }\n\t\t\t\t<Popover\n\t\t\t\t\tfocusOnMount={ false }\n\t\t\t\t\tplacement=\"right\"\n\t\t\t\t\toffset={ 32 }\n\t\t\t\t\t__unstableForcePosition\n\t\t\t\t\t__unstableShift\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\tclassName=\"wp-block-legacy-widget__edit-form\"\n\t\t\t\t\t\thidden={ ! isVisible }\n\t\t\t\t\t></div>\n\t\t\t\t</Popover>\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn (\n\t\t<div\n\t\t\tref={ ref }\n\t\t\tclassName=\"wp-block-legacy-widget__edit-form\"\n\t\t\thidden={ ! isVisible }\n\t\t>\n\t\t\t<h3 className=\"wp-block-legacy-widget__edit-form-title\">\n\t\t\t\t{ title }\n\t\t\t</h3>\n\t\t</div>\n\t);\n}\n"]}
@@ -94,6 +94,8 @@
94
94
  border-radius: 2px;
95
95
  border: 1px solid #1e1e1e;
96
96
  padding: 11px;
97
+ max-height: calc(100vh - 2px);
98
+ overflow-y: scroll;
97
99
  }
98
100
  .wp-block-legacy-widget__edit-form:not([hidden]) {
99
101
  display: flow-root;
@@ -94,6 +94,8 @@
94
94
  border-radius: 2px;
95
95
  border: 1px solid #1e1e1e;
96
96
  padding: 11px;
97
+ max-height: calc(100vh - 2px);
98
+ overflow-y: scroll;
97
99
  }
98
100
  .wp-block-legacy-widget__edit-form:not([hidden]) {
99
101
  display: flow-root;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/widgets",
3
- "version": "2.13.0",
3
+ "version": "2.14.1-next.957ca95e4c.0",
4
4
  "description": "Functionality used by the widgets block editor in the Widgets screen and the Customizer.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -21,17 +21,17 @@
21
21
  "react-native": "src/index",
22
22
  "dependencies": {
23
23
  "@babel/runtime": "^7.16.0",
24
- "@wordpress/api-fetch": "^6.12.0",
25
- "@wordpress/block-editor": "^9.7.0",
26
- "@wordpress/blocks": "^11.14.0",
27
- "@wordpress/components": "^19.17.0",
28
- "@wordpress/compose": "^5.13.0",
29
- "@wordpress/core-data": "^4.13.0",
30
- "@wordpress/data": "^6.15.0",
31
- "@wordpress/element": "^4.13.0",
32
- "@wordpress/i18n": "^4.15.0",
33
- "@wordpress/icons": "^9.6.0",
34
- "@wordpress/notices": "^3.15.0",
24
+ "@wordpress/api-fetch": "^6.13.1-next.957ca95e4c.0",
25
+ "@wordpress/block-editor": "^9.8.1-next.957ca95e4c.0",
26
+ "@wordpress/blocks": "^11.15.1-next.957ca95e4c.0",
27
+ "@wordpress/components": "^20.0.2-next.957ca95e4c.0",
28
+ "@wordpress/compose": "^5.14.1-next.957ca95e4c.0",
29
+ "@wordpress/core-data": "^5.0.1-next.957ca95e4c.0",
30
+ "@wordpress/data": "^7.0.1-next.957ca95e4c.0",
31
+ "@wordpress/element": "^4.14.1-next.957ca95e4c.0",
32
+ "@wordpress/i18n": "^4.16.1-next.957ca95e4c.0",
33
+ "@wordpress/icons": "^9.7.1-next.957ca95e4c.0",
34
+ "@wordpress/notices": "^3.16.1-next.957ca95e4c.0",
35
35
  "classnames": "^2.3.1",
36
36
  "lodash": "^4.17.21"
37
37
  },
@@ -42,5 +42,5 @@
42
42
  "publishConfig": {
43
43
  "access": "public"
44
44
  },
45
- "gitHead": "08358f53b627a15148c3a3e433cdf58cf8714aa4"
45
+ "gitHead": "272a74bbbaab10ee24424eafe9578e705fbfbbb4"
46
46
  }
@@ -103,8 +103,10 @@ export default function Form( {
103
103
  ) }
104
104
  <Popover
105
105
  focusOnMount={ false }
106
- position="middle right"
106
+ placement="right"
107
+ offset={ 32 }
107
108
  __unstableForcePosition
109
+ __unstableShift
108
110
  >
109
111
  <div
110
112
  ref={ ref }
@@ -5,7 +5,9 @@
5
5
  background: $white;
6
6
  border-radius: $radius-block-ui;
7
7
  border: 1px solid $gray-900;
8
- padding: $grid-unit-15 - 1px; //Subtract the border width.
8
+ padding: $grid-unit-15 - 1px; // Subtract the border width.
9
+ max-height: calc(100vh - 2px); // Subtract the border width (both top and bottom).
10
+ overflow-y: scroll;
9
11
 
10
12
  .wp-block-legacy-widget__edit-form-title {
11
13
  color: $black;