@wordpress/widgets 3.34.0 → 4.0.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.
Files changed (51) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/build/blocks/legacy-widget/edit/convert-to-blocks-button.js +5 -4
  3. package/build/blocks/legacy-widget/edit/convert-to-blocks-button.js.map +1 -1
  4. package/build/blocks/legacy-widget/edit/form.js +29 -24
  5. package/build/blocks/legacy-widget/edit/form.js.map +1 -1
  6. package/build/blocks/legacy-widget/edit/index.js +87 -69
  7. package/build/blocks/legacy-widget/edit/index.js.map +1 -1
  8. package/build/blocks/legacy-widget/edit/inspector-card.js +10 -6
  9. package/build/blocks/legacy-widget/edit/inspector-card.js.map +1 -1
  10. package/build/blocks/legacy-widget/edit/no-preview.js +9 -4
  11. package/build/blocks/legacy-widget/edit/no-preview.js.map +1 -1
  12. package/build/blocks/legacy-widget/edit/preview.js +29 -22
  13. package/build/blocks/legacy-widget/edit/preview.js.map +1 -1
  14. package/build/blocks/legacy-widget/edit/widget-type-selector.js +3 -3
  15. package/build/blocks/legacy-widget/edit/widget-type-selector.js.map +1 -1
  16. package/build/blocks/widget-group/deprecated.js +8 -6
  17. package/build/blocks/widget-group/deprecated.js.map +1 -1
  18. package/build/blocks/widget-group/edit.js +35 -29
  19. package/build/blocks/widget-group/edit.js.map +1 -1
  20. package/build/blocks/widget-group/save.js +11 -8
  21. package/build/blocks/widget-group/save.js.map +1 -1
  22. package/build/components/move-to-widget-area/index.js +27 -21
  23. package/build/components/move-to-widget-area/index.js.map +1 -1
  24. package/build-module/blocks/legacy-widget/edit/convert-to-blocks-button.js +5 -4
  25. package/build-module/blocks/legacy-widget/edit/convert-to-blocks-button.js.map +1 -1
  26. package/build-module/blocks/legacy-widget/edit/form.js +30 -24
  27. package/build-module/blocks/legacy-widget/edit/form.js.map +1 -1
  28. package/build-module/blocks/legacy-widget/edit/index.js +89 -69
  29. package/build-module/blocks/legacy-widget/edit/index.js.map +1 -1
  30. package/build-module/blocks/legacy-widget/edit/inspector-card.js +11 -6
  31. package/build-module/blocks/legacy-widget/edit/inspector-card.js.map +1 -1
  32. package/build-module/blocks/legacy-widget/edit/no-preview.js +10 -4
  33. package/build-module/blocks/legacy-widget/edit/no-preview.js.map +1 -1
  34. package/build-module/blocks/legacy-widget/edit/preview.js +31 -22
  35. package/build-module/blocks/legacy-widget/edit/preview.js.map +1 -1
  36. package/build-module/blocks/legacy-widget/edit/widget-type-selector.js +3 -3
  37. package/build-module/blocks/legacy-widget/edit/widget-type-selector.js.map +1 -1
  38. package/build-module/blocks/widget-group/deprecated.js +10 -6
  39. package/build-module/blocks/widget-group/deprecated.js.map +1 -1
  40. package/build-module/blocks/widget-group/edit.js +37 -29
  41. package/build-module/blocks/widget-group/edit.js.map +1 -1
  42. package/build-module/blocks/widget-group/save.js +13 -8
  43. package/build-module/blocks/widget-group/save.js.map +1 -1
  44. package/build-module/components/move-to-widget-area/index.js +27 -21
  45. package/build-module/components/move-to-widget-area/index.js.map +1 -1
  46. package/package.json +18 -14
  47. package/src/blocks/legacy-widget/edit/form.js +2 -2
  48. package/src/blocks/legacy-widget/edit/index.js +2 -2
  49. package/src/blocks/legacy-widget/edit/preview.js +4 -7
  50. package/src/blocks/legacy-widget/index.php +6 -0
  51. package/src/blocks/widget-group/index.php +8 -0
@@ -1 +1 @@
1
- {"version":3,"names":["_classnames","_interopRequireDefault","require","_compose","_element","_components","_i18n","_apiFetch","Preview","idBase","instance","isVisible","isLoaded","setIsLoaded","useState","srcDoc","setSrcDoc","useEffect","abortController","window","AbortController","undefined","fetchPreviewHTML","restRoute","apiFetch","path","method","signal","data","then","response","preview","catch","error","name","abort","ref","useRefEffect","iframe","setHeight","_iframe$contentDocume","_iframe$contentDocume2","height","Math","max","contentDocument","documentElement","offsetHeight","body","style","IntersectionObserver","ownerDocument","defaultView","intersectionObserver","entry","isIntersecting","threshold","observe","addEventListener","disconnect","removeEventListener","_react","createElement","Fragment","Placeholder","Spinner","className","classnames","Disabled","tabIndex","title","__","onLoad","event","target","overflow"],"sources":["@wordpress/widgets/src/blocks/legacy-widget/edit/preview.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useRefEffect } from '@wordpress/compose';\nimport { useEffect, useState } from '@wordpress/element';\nimport { Disabled, Placeholder, Spinner } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport apiFetch from '@wordpress/api-fetch';\n\nexport default function Preview( { idBase, instance, isVisible } ) {\n\tconst [ isLoaded, setIsLoaded ] = useState( false );\n\tconst [ srcDoc, setSrcDoc ] = useState( '' );\n\n\tuseEffect( () => {\n\t\tconst abortController =\n\t\t\ttypeof window.AbortController === 'undefined'\n\t\t\t\t? undefined\n\t\t\t\t: new window.AbortController();\n\n\t\tasync function fetchPreviewHTML() {\n\t\t\tconst restRoute = `/wp/v2/widget-types/${ idBase }/render`;\n\t\t\treturn await apiFetch( {\n\t\t\t\tpath: restRoute,\n\t\t\t\tmethod: 'POST',\n\t\t\t\tsignal: abortController?.signal,\n\t\t\t\tdata: instance ? { instance } : {},\n\t\t\t} );\n\t\t}\n\n\t\tfetchPreviewHTML()\n\t\t\t.then( ( response ) => {\n\t\t\t\tsetSrcDoc( response.preview );\n\t\t\t} )\n\t\t\t.catch( ( error ) => {\n\t\t\t\tif ( 'AbortError' === error.name ) {\n\t\t\t\t\t// We don't want to log aborted requests.\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthrow error;\n\t\t\t} );\n\n\t\treturn () => abortController?.abort();\n\t}, [ idBase, instance ] );\n\n\t// Resize the iframe on either the load event, or when the iframe becomes visible.\n\tconst ref = useRefEffect(\n\t\t( iframe ) => {\n\t\t\t// Only set height if the iframe is loaded,\n\t\t\t// or it will grow to an unexpected large height in Safari if it's hidden initially.\n\t\t\tif ( ! isLoaded ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// If the preview frame has another origin then this won't work.\n\t\t\t// One possible solution is to add custom script to call `postMessage` in the preview frame.\n\t\t\t// Or, better yet, we migrate away from iframe.\n\t\t\tfunction setHeight() {\n\t\t\t\t// Pick the maximum of these two values to account for margin collapsing.\n\t\t\t\tconst height = Math.max(\n\t\t\t\t\tiframe.contentDocument.documentElement?.offsetHeight ?? 0,\n\t\t\t\t\tiframe.contentDocument.body?.offsetHeight ?? 0\n\t\t\t\t);\n\n\t\t\t\t// Fallback to a height of 100px if the height cannot be determined.\n\t\t\t\t// This ensures the block is still selectable. 100px should hopefully\n\t\t\t\t// be not so big that it's annoying, and not so small that nothing\n\t\t\t\t// can be seen.\n\t\t\t\tiframe.style.height = `${ height !== 0 ? height : 100 }px`;\n\t\t\t}\n\n\t\t\tconst { IntersectionObserver } = iframe.ownerDocument.defaultView;\n\n\t\t\t// Observe for intersections that might cause a change in the height of\n\t\t\t// the iframe, e.g. a Widget Area becoming expanded.\n\t\t\tconst intersectionObserver = new IntersectionObserver(\n\t\t\t\t( [ entry ] ) => {\n\t\t\t\t\tif ( entry.isIntersecting ) {\n\t\t\t\t\t\tsetHeight();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tthreshold: 1,\n\t\t\t\t}\n\t\t\t);\n\t\t\tintersectionObserver.observe( iframe );\n\n\t\t\tiframe.addEventListener( 'load', setHeight );\n\n\t\t\treturn () => {\n\t\t\t\tintersectionObserver.disconnect();\n\t\t\t\tiframe.removeEventListener( 'load', setHeight );\n\t\t\t};\n\t\t},\n\t\t[ isLoaded ]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t{ /*\n\t\t\tWhile the iframe contents are loading, we move the iframe off-screen\n\t\t\tand display a placeholder instead. This ensures that the user\n\t\t\tdoesn't see the iframe resize (which looks really janky). We have to\n\t\t\tmove the iframe off-screen instead of hiding it because web browsers\n\t\t\twill not trigger onLoad if the iframe is hidden.\n\t\t\t*/ }\n\t\t\t{ isVisible && ! isLoaded && (\n\t\t\t\t<Placeholder>\n\t\t\t\t\t<Spinner />\n\t\t\t\t</Placeholder>\n\t\t\t) }\n\t\t\t<div\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'wp-block-legacy-widget__edit-preview',\n\t\t\t\t\t{\n\t\t\t\t\t\t'is-offscreen': ! isVisible || ! isLoaded,\n\t\t\t\t\t}\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t<Disabled>\n\t\t\t\t\t{ /*\n\t\t\t\t\tWe use an iframe so that the widget has an opportunity to\n\t\t\t\t\tload scripts and styles that it needs to run.\n\t\t\t\t\t*/ }\n\t\t\t\t\t<iframe\n\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\tclassName=\"wp-block-legacy-widget__edit-preview-iframe\"\n\t\t\t\t\t\ttabIndex=\"-1\"\n\t\t\t\t\t\ttitle={ __( 'Legacy Widget Preview' ) }\n\t\t\t\t\t\tsrcDoc={ srcDoc }\n\t\t\t\t\t\tonLoad={ ( event ) => {\n\t\t\t\t\t\t\t// To hide the scrollbars of the preview frame for some edge cases,\n\t\t\t\t\t\t\t// such as negative margins in the Gallery Legacy Widget.\n\t\t\t\t\t\t\t// It can't be scrolled anyway.\n\t\t\t\t\t\t\t// TODO: Ideally, this should be fixed in core.\n\t\t\t\t\t\t\tevent.target.contentDocument.body.style.overflow =\n\t\t\t\t\t\t\t\t'hidden';\n\n\t\t\t\t\t\t\tsetIsLoaded( true );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\theight={ 100 }\n\t\t\t\t\t/>\n\t\t\t\t</Disabled>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAN,sBAAA,CAAAC,OAAA;AAZA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ACzD,WAAA,CAAA4D,OAAO,MAAE,CACE,CACb,EACD,IAAAJ,MAAA,CAAAC,aAAA;IACCI,SAAS,EAAG,IAAAC,mBAAU,EACrB,sCAAsC,EACtC;MACC,cAAc,EAAE,CAAExD,SAAS,IAAI,CAAEC;IAClC,CACD;EAAG,GAEH,IAAAiD,MAAA,CAAAC,aAAA,EAACzD,WAAA,CAAA+D,QAAQ,QAKR,IAAAP,MAAA,CAAAC,aAAA;IACC1B,GAAG,EAAGA,GAAK;IACX8B,SAAS,EAAC,6CAA6C;IACvDG,QAAQ,EAAC,IAAI;IACbC,KAAK,EAAG,IAAAC,QAAE,EAAE,uBAAwB,CAAG;IACvCxD,MAAM,EAAGA,MAAQ;IACjByD,MAAM,EAAKC,KAAK,IAAM;MACrB;MACA;MACA;MACA;MACAA,KAAK,CAACC,MAAM,CAAC7B,eAAe,CAACG,IAAI,CAACC,KAAK,CAAC0B,QAAQ,GAC/C,QAAQ;MAET9D,WAAW,CAAE,IAAK,CAAC;IACpB,CAAG;IACH6B,MAAM,EAAG;EAAK,CACd,CACQ,CACN,CACJ,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_compose","_element","_components","_i18n","_apiFetch","_jsxRuntime","Preview","idBase","instance","isVisible","isLoaded","setIsLoaded","useState","srcDoc","setSrcDoc","useEffect","abortController","window","AbortController","undefined","fetchPreviewHTML","restRoute","apiFetch","path","method","signal","data","then","response","preview","catch","error","name","abort","ref","useRefEffect","iframe","setHeight","_iframe$contentDocume","_iframe$contentDocume2","height","Math","max","contentDocument","documentElement","offsetHeight","body","style","IntersectionObserver","ownerDocument","defaultView","intersectionObserver","entry","isIntersecting","threshold","observe","addEventListener","disconnect","removeEventListener","jsxs","Fragment","children","jsx","Placeholder","Spinner","className","clsx","Disabled","tabIndex","title","__","onLoad","event","target","overflow"],"sources":["@wordpress/widgets/src/blocks/legacy-widget/edit/preview.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useRefEffect } from '@wordpress/compose';\nimport { useEffect, useState } from '@wordpress/element';\nimport { Disabled, Placeholder, Spinner } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport apiFetch from '@wordpress/api-fetch';\n\nexport default function Preview( { idBase, instance, isVisible } ) {\n\tconst [ isLoaded, setIsLoaded ] = useState( false );\n\tconst [ srcDoc, setSrcDoc ] = useState( '' );\n\n\tuseEffect( () => {\n\t\tconst abortController =\n\t\t\ttypeof window.AbortController === 'undefined'\n\t\t\t\t? undefined\n\t\t\t\t: new window.AbortController();\n\n\t\tasync function fetchPreviewHTML() {\n\t\t\tconst restRoute = `/wp/v2/widget-types/${ idBase }/render`;\n\t\t\treturn await apiFetch( {\n\t\t\t\tpath: restRoute,\n\t\t\t\tmethod: 'POST',\n\t\t\t\tsignal: abortController?.signal,\n\t\t\t\tdata: instance ? { instance } : {},\n\t\t\t} );\n\t\t}\n\n\t\tfetchPreviewHTML()\n\t\t\t.then( ( response ) => {\n\t\t\t\tsetSrcDoc( response.preview );\n\t\t\t} )\n\t\t\t.catch( ( error ) => {\n\t\t\t\tif ( 'AbortError' === error.name ) {\n\t\t\t\t\t// We don't want to log aborted requests.\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthrow error;\n\t\t\t} );\n\n\t\treturn () => abortController?.abort();\n\t}, [ idBase, instance ] );\n\n\t// Resize the iframe on either the load event, or when the iframe becomes visible.\n\tconst ref = useRefEffect(\n\t\t( iframe ) => {\n\t\t\t// Only set height if the iframe is loaded,\n\t\t\t// or it will grow to an unexpected large height in Safari if it's hidden initially.\n\t\t\tif ( ! isLoaded ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// If the preview frame has another origin then this won't work.\n\t\t\t// One possible solution is to add custom script to call `postMessage` in the preview frame.\n\t\t\t// Or, better yet, we migrate away from iframe.\n\t\t\tfunction setHeight() {\n\t\t\t\t// Pick the maximum of these two values to account for margin collapsing.\n\t\t\t\tconst height = Math.max(\n\t\t\t\t\tiframe.contentDocument.documentElement?.offsetHeight ?? 0,\n\t\t\t\t\tiframe.contentDocument.body?.offsetHeight ?? 0\n\t\t\t\t);\n\n\t\t\t\t// Fallback to a height of 100px if the height cannot be determined.\n\t\t\t\t// This ensures the block is still selectable. 100px should hopefully\n\t\t\t\t// be not so big that it's annoying, and not so small that nothing\n\t\t\t\t// can be seen.\n\t\t\t\tiframe.style.height = `${ height !== 0 ? height : 100 }px`;\n\t\t\t}\n\n\t\t\tconst { IntersectionObserver } = iframe.ownerDocument.defaultView;\n\n\t\t\t// Observe for intersections that might cause a change in the height of\n\t\t\t// the iframe, e.g. a Widget Area becoming expanded.\n\t\t\tconst intersectionObserver = new IntersectionObserver(\n\t\t\t\t( [ entry ] ) => {\n\t\t\t\t\tif ( entry.isIntersecting ) {\n\t\t\t\t\t\tsetHeight();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tthreshold: 1,\n\t\t\t\t}\n\t\t\t);\n\t\t\tintersectionObserver.observe( iframe );\n\n\t\t\tiframe.addEventListener( 'load', setHeight );\n\n\t\t\treturn () => {\n\t\t\t\tintersectionObserver.disconnect();\n\t\t\t\tiframe.removeEventListener( 'load', setHeight );\n\t\t\t};\n\t\t},\n\t\t[ isLoaded ]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t{ /*\n\t\t\tWhile the iframe contents are loading, we move the iframe off-screen\n\t\t\tand display a placeholder instead. This ensures that the user\n\t\t\tdoesn't see the iframe resize (which looks really janky). We have to\n\t\t\tmove the iframe off-screen instead of hiding it because web browsers\n\t\t\twill not trigger onLoad if the iframe is hidden.\n\t\t\t*/ }\n\t\t\t{ isVisible && ! isLoaded && (\n\t\t\t\t<Placeholder>\n\t\t\t\t\t<Spinner />\n\t\t\t\t</Placeholder>\n\t\t\t) }\n\t\t\t<div\n\t\t\t\tclassName={ clsx( 'wp-block-legacy-widget__edit-preview', {\n\t\t\t\t\t'is-offscreen': ! isVisible || ! isLoaded,\n\t\t\t\t} ) }\n\t\t\t>\n\t\t\t\t<Disabled>\n\t\t\t\t\t{ /*\n\t\t\t\t\tWe use an iframe so that the widget has an opportunity to\n\t\t\t\t\tload scripts and styles that it needs to run.\n\t\t\t\t\t*/ }\n\t\t\t\t\t<iframe\n\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\tclassName=\"wp-block-legacy-widget__edit-preview-iframe\"\n\t\t\t\t\t\ttabIndex=\"-1\"\n\t\t\t\t\t\ttitle={ __( 'Legacy Widget Preview' ) }\n\t\t\t\t\t\tsrcDoc={ srcDoc }\n\t\t\t\t\t\tonLoad={ ( event ) => {\n\t\t\t\t\t\t\t// To hide the scrollbars of the preview frame for some edge cases,\n\t\t\t\t\t\t\t// such as negative margins in the Gallery Legacy Widget.\n\t\t\t\t\t\t\t// It can't be scrolled anyway.\n\t\t\t\t\t\t\t// TODO: Ideally, this should be fixed in core.\n\t\t\t\t\t\t\tevent.target.contentDocument.body.style.overflow =\n\t\t\t\t\t\t\t\t'hidden';\n\n\t\t\t\t\t\t\tsetIsLoaded( true );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\theight={ 100 }\n\t\t\t\t\t/>\n\t\t\t\t</Disabled>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAN,sBAAA,CAAAC,OAAA;AAA4C,IAAAM,WAAA,GAAAN,OAAA;AAZ5C;AACA;AACA;;AAGA;AACA;AACA;;AAOe,SAASO,OAAOA,CAAE;EAAEC,MAAM;EAAEC,QAAQ;EAAEC;AAAU,CAAC,EAAG;EAClE,MAAM,CAAEC,QAAQ,EAAEC,WAAW,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,EAAE,sCAAsC,EAAE;QACzD,cAAc,EAAE,CAAEzD,SAAS,IAAI,CAAEC;MAClC,CAAE,CAAG;MAAAmD,QAAA,eAEL,IAAAxD,WAAA,CAAAyD,GAAA,EAAC5D,WAAA,CAAAiE,QAAQ;QAAAN,QAAA,eAKR,IAAAxD,WAAA,CAAAyD,GAAA;UACC5B,GAAG,EAAGA,GAAK;UACX+B,SAAS,EAAC,6CAA6C;UACvDG,QAAQ,EAAC,IAAI;UACbC,KAAK,EAAG,IAAAC,QAAE,EAAE,uBAAwB,CAAG;UACvCzD,MAAM,EAAGA,MAAQ;UACjB0D,MAAM,EAAKC,KAAK,IAAM;YACrB;YACA;YACA;YACA;YACAA,KAAK,CAACC,MAAM,CAAC9B,eAAe,CAACG,IAAI,CAACC,KAAK,CAAC2B,QAAQ,GAC/C,QAAQ;YAET/D,WAAW,CAAE,IAAK,CAAC;UACpB,CAAG;UACH6B,MAAM,EAAG;QAAK,CACd;MAAC,CACO;IAAC,CACP,CAAC;EAAA,CACL,CAAC;AAEL","ignoreList":[]}
@@ -4,12 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = WidgetTypeSelector;
7
- var _react = require("react");
8
7
  var _components = require("@wordpress/components");
9
8
  var _i18n = require("@wordpress/i18n");
10
9
  var _data = require("@wordpress/data");
11
10
  var _coreData = require("@wordpress/core-data");
12
11
  var _blockEditor = require("@wordpress/block-editor");
12
+ var _jsxRuntime = require("react/jsx-runtime");
13
13
  /**
14
14
  * WordPress dependencies
15
15
  */
@@ -26,12 +26,12 @@ function WidgetTypeSelector({
26
26
  })?.filter(widgetType => !hiddenIds.includes(widgetType.id));
27
27
  }, []);
28
28
  if (!widgetTypes) {
29
- return (0, _react.createElement)(_components.Spinner, null);
29
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Spinner, {});
30
30
  }
31
31
  if (widgetTypes.length === 0) {
32
32
  return (0, _i18n.__)('There are no widgets available.');
33
33
  }
34
- return (0, _react.createElement)(_components.SelectControl, {
34
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.SelectControl, {
35
35
  __nextHasNoMarginBottom: true,
36
36
  label: (0, _i18n.__)('Select a legacy widget to display:'),
37
37
  value: selectedId !== null && selectedId !== void 0 ? selectedId : '',
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","_i18n","_data","_coreData","_blockEditor","WidgetTypeSelector","selectedId","onSelect","widgetTypes","useSelect","select","_select$getSettings$w","hiddenIds","blockEditorStore","getSettings","widgetTypesToHideFromLegacyWidgetBlock","coreStore","getWidgetTypes","per_page","filter","widgetType","includes","id","_react","createElement","Spinner","length","__","SelectControl","__nextHasNoMarginBottom","label","value","options","map","name","onChange","selected","find","isMulti","is_multi"],"sources":["@wordpress/widgets/src/blocks/legacy-widget/edit/widget-type-selector.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Spinner, SelectControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\nexport default function WidgetTypeSelector( { selectedId, onSelect } ) {\n\tconst widgetTypes = useSelect( ( select ) => {\n\t\tconst hiddenIds =\n\t\t\tselect( blockEditorStore ).getSettings()\n\t\t\t\t?.widgetTypesToHideFromLegacyWidgetBlock ?? [];\n\t\treturn select( coreStore )\n\t\t\t.getWidgetTypes( { per_page: -1 } )\n\t\t\t?.filter( ( widgetType ) => ! hiddenIds.includes( widgetType.id ) );\n\t}, [] );\n\n\tif ( ! widgetTypes ) {\n\t\treturn <Spinner />;\n\t}\n\n\tif ( widgetTypes.length === 0 ) {\n\t\treturn __( 'There are no widgets available.' );\n\t}\n\n\treturn (\n\t\t<SelectControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\tlabel={ __( 'Select a legacy widget to display:' ) }\n\t\t\tvalue={ selectedId ?? '' }\n\t\t\toptions={ [\n\t\t\t\t{ value: '', label: __( 'Select widget' ) },\n\t\t\t\t...widgetTypes.map( ( widgetType ) => ( {\n\t\t\t\t\tvalue: widgetType.id,\n\t\t\t\t\tlabel: widgetType.name,\n\t\t\t\t} ) ),\n\t\t\t] }\n\t\t\tonChange={ ( value ) => {\n\t\t\t\tif ( value ) {\n\t\t\t\t\tconst selected = widgetTypes.find(\n\t\t\t\t\t\t( widgetType ) => widgetType.id === value\n\t\t\t\t\t);\n\t\t\t\t\tonSelect( {\n\t\t\t\t\t\tselectedId: selected.id,\n\t\t\t\t\t\tisMulti: selected.is_multi,\n\t\t\t\t\t} );\n\t\t\t\t} else {\n\t\t\t\t\tonSelect( { selectedId: null } );\n\t\t\t\t}\n\t\t\t} }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAPA;AACA;AACA;;AAOe,SAASK,kBAAkBA,CAAE;EAAEC,UAAU;EAAEC;AAAS,CAAC,EAAG;EACtE,MAAMC,WAAW,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAAA,IAAAC,qBAAA;IAC5C,MAAMC,SAAS,IAAAD,qBAAA,GACdD,MAAM,CAAEG,kBAAiB,CAAC,CAACC,WAAW,CAAC,CAAC,EACrCC,sCAAsC,cAAAJ,qBAAA,cAAAA,qBAAA,GAAI,EAAE;IAChD,OAAOD,MAAM,CAAEM,eAAU,CAAC,CACxBC,cAAc,CAAE;MAAEC,QAAQ,EAAE,CAAC;IAAE,CAAE,CAAC,EACjCC,MAAM,CAAIC,UAAU,IAAM,CAAER,SAAS,CAACS,QAAQ,CAAED,UAAU,CAACE,EAAG,CAAE,CAAC;EACrE,CAAC,EAAE,EAAG,CAAC;EAEP,IAAK,CAAEd,WAAW,EAAG;IACpB,OAAO,IAAAe,MAAA,CAAAC,aAAA,EAACzB,WAAA,CAAA0B,OAAO,MAAE,CAAC;EACnB;EAEA,IAAKjB,WAAW,CAACkB,MAAM,KAAK,CAAC,EAAG;IAC/B,OAAO,IAAAC,QAAE,EAAE,iCAAkC,CAAC;EAC/C;EAEA,OACC,IAAAJ,MAAA,CAAAC,aAAA,EAACzB,WAAA,CAAA6B,aAAa;IACbC,uBAAuB;IACvBC,KAAK,EAAG,IAAAH,QAAE,EAAE,oCAAqC,CAAG;IACpDI,KAAK,EAAGzB,UAAU,aAAVA,UAAU,cAAVA,UAAU,GAAI,EAAI;IAC1B0B,OAAO,EAAG,CACT;MAAED,KAAK,EAAE,EAAE;MAAED,KAAK,EAAE,IAAAH,QAAE,EAAE,eAAgB;IAAE,CAAC,EAC3C,GAAGnB,WAAW,CAACyB,GAAG,CAAIb,UAAU,KAAQ;MACvCW,KAAK,EAAEX,UAAU,CAACE,EAAE;MACpBQ,KAAK,EAAEV,UAAU,CAACc;IACnB,CAAC,CAAG,CAAC,CACH;IACHC,QAAQ,EAAKJ,KAAK,IAAM;MACvB,IAAKA,KAAK,EAAG;QACZ,MAAMK,QAAQ,GAAG5B,WAAW,CAAC6B,IAAI,CAC9BjB,UAAU,IAAMA,UAAU,CAACE,EAAE,KAAKS,KACrC,CAAC;QACDxB,QAAQ,CAAE;UACTD,UAAU,EAAE8B,QAAQ,CAACd,EAAE;UACvBgB,OAAO,EAAEF,QAAQ,CAACG;QACnB,CAAE,CAAC;MACJ,CAAC,MAAM;QACNhC,QAAQ,CAAE;UAAED,UAAU,EAAE;QAAK,CAAE,CAAC;MACjC;IACD;EAAG,CACH,CAAC;AAEJ","ignoreList":[]}
1
+ {"version":3,"names":["_components","require","_i18n","_data","_coreData","_blockEditor","_jsxRuntime","WidgetTypeSelector","selectedId","onSelect","widgetTypes","useSelect","select","_select$getSettings$w","hiddenIds","blockEditorStore","getSettings","widgetTypesToHideFromLegacyWidgetBlock","coreStore","getWidgetTypes","per_page","filter","widgetType","includes","id","jsx","Spinner","length","__","SelectControl","__nextHasNoMarginBottom","label","value","options","map","name","onChange","selected","find","isMulti","is_multi"],"sources":["@wordpress/widgets/src/blocks/legacy-widget/edit/widget-type-selector.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Spinner, SelectControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\nexport default function WidgetTypeSelector( { selectedId, onSelect } ) {\n\tconst widgetTypes = useSelect( ( select ) => {\n\t\tconst hiddenIds =\n\t\t\tselect( blockEditorStore ).getSettings()\n\t\t\t\t?.widgetTypesToHideFromLegacyWidgetBlock ?? [];\n\t\treturn select( coreStore )\n\t\t\t.getWidgetTypes( { per_page: -1 } )\n\t\t\t?.filter( ( widgetType ) => ! hiddenIds.includes( widgetType.id ) );\n\t}, [] );\n\n\tif ( ! widgetTypes ) {\n\t\treturn <Spinner />;\n\t}\n\n\tif ( widgetTypes.length === 0 ) {\n\t\treturn __( 'There are no widgets available.' );\n\t}\n\n\treturn (\n\t\t<SelectControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\tlabel={ __( 'Select a legacy widget to display:' ) }\n\t\t\tvalue={ selectedId ?? '' }\n\t\t\toptions={ [\n\t\t\t\t{ value: '', label: __( 'Select widget' ) },\n\t\t\t\t...widgetTypes.map( ( widgetType ) => ( {\n\t\t\t\t\tvalue: widgetType.id,\n\t\t\t\t\tlabel: widgetType.name,\n\t\t\t\t} ) ),\n\t\t\t] }\n\t\t\tonChange={ ( value ) => {\n\t\t\t\tif ( value ) {\n\t\t\t\t\tconst selected = widgetTypes.find(\n\t\t\t\t\t\t( widgetType ) => widgetType.id === value\n\t\t\t\t\t);\n\t\t\t\t\tonSelect( {\n\t\t\t\t\t\tselectedId: selected.id,\n\t\t\t\t\t\tisMulti: selected.is_multi,\n\t\t\t\t\t} );\n\t\t\t\t} else {\n\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AAU,GAAI,EAAI;IAC1ByB,OAAO,EAAG,CACT;MAAED,KAAK,EAAE,EAAE;MAAED,KAAK,EAAE,IAAAH,QAAE,EAAE,eAAgB;IAAE,CAAC,EAC3C,GAAGlB,WAAW,CAACwB,GAAG,CAAIZ,UAAU,KAAQ;MACvCU,KAAK,EAAEV,UAAU,CAACE,EAAE;MACpBO,KAAK,EAAET,UAAU,CAACa;IACnB,CAAC,CAAG,CAAC,CACH;IACHC,QAAQ,EAAKJ,KAAK,IAAM;MACvB,IAAKA,KAAK,EAAG;QACZ,MAAMK,QAAQ,GAAG3B,WAAW,CAAC4B,IAAI,CAC9BhB,UAAU,IAAMA,UAAU,CAACE,EAAE,KAAKQ,KACrC,CAAC;QACDvB,QAAQ,CAAE;UACTD,UAAU,EAAE6B,QAAQ,CAACb,EAAE;UACvBe,OAAO,EAAEF,QAAQ,CAACG;QACnB,CAAE,CAAC;MACJ,CAAC,MAAM;QACN/B,QAAQ,CAAE;UAAED,UAAU,EAAE;QAAK,CAAE,CAAC;MACjC;IACD;EAAG,CACH,CAAC;AAEJ","ignoreList":[]}
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- var _react = require("react");
8
7
  var _blockEditor = require("@wordpress/block-editor");
8
+ var _jsxRuntime = require("react/jsx-runtime");
9
9
  /**
10
10
  * WordPress dependencies
11
11
  */
@@ -25,11 +25,13 @@ const v1 = {
25
25
  save({
26
26
  attributes
27
27
  }) {
28
- return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_blockEditor.RichText.Content, {
29
- tagName: "h2",
30
- className: "widget-title",
31
- value: attributes.title
32
- }), (0, _react.createElement)(_blockEditor.InnerBlocks.Content, null));
28
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
29
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.RichText.Content, {
30
+ tagName: "h2",
31
+ className: "widget-title",
32
+ value: attributes.title
33
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.InnerBlocks.Content, {})]
34
+ });
33
35
  }
34
36
  };
35
37
  var _default = exports.default = [v1];
@@ -1 +1 @@
1
- {"version":3,"names":["_blockEditor","require","v1","attributes","title","type","supports","html","inserter","customClassName","reusable","save","_react","createElement","Fragment","RichText","Content","tagName","className","value","InnerBlocks","_default","exports","default"],"sources":["@wordpress/widgets/src/blocks/widget-group/deprecated.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { InnerBlocks, RichText } from '@wordpress/block-editor';\n\nconst v1 = {\n\tattributes: {\n\t\ttitle: {\n\t\t\ttype: 'string',\n\t\t},\n\t},\n\tsupports: {\n\t\thtml: false,\n\t\tinserter: true,\n\t\tcustomClassName: true,\n\t\treusable: false,\n\t},\n\tsave( { attributes } ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<RichText.Content\n\t\t\t\t\ttagName=\"h2\"\n\t\t\t\t\tclassName=\"widget-title\"\n\t\t\t\t\tvalue={ attributes.title }\n\t\t\t\t/>\n\t\t\t\t<InnerBlocks.Content />\n\t\t\t</>\n\t\t);\n\t},\n};\n\nexport default [ v1 ];\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA,MAAMC,EAAE,GAAG;EACVC,UAAU,EAAE;IACXC,KAAK,EAAE;MACNC,IAAI,EAAE;IACP;EACD,CAAC;EACDC,QAAQ,EAAE;IACTC,IAAI,EAAE,KAAK;IACXC,QAAQ,EAAE,IAAI;IACdC,eAAe,EAAE,IAAI;IACrBC,QAAQ,EAAE;EACX,CAAC;EACDC,IAAIA,CAAE;IAAER;EAAW,CAAC,EAAG;IACtB,OACC,IAAAS,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAE,QAAA,QACC,IAAAF,MAAA,CAAAC,aAAA,EAACb,YAAA,CAAAe,QAAQ,CAACC,OAAO;MAChBC,OAAO,EAAC,IAAI;MACZC,SAAS,EAAC,cAAc;MACxBC,KAAK,EAAGhB,UAAU,CAACC;IAAO,CAC1B,CAAC,EACF,IAAAQ,MAAA,CAAAC,aAAA,EAACb,YAAA,CAAAoB,WAAW,CAACJ,OAAO,MAAE,CACrB,CAAC;EAEL;AACD,CAAC;AAAC,IAAAK,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEa,CAAErB,EAAE,CAAE","ignoreList":[]}
1
+ {"version":3,"names":["_blockEditor","require","_jsxRuntime","v1","attributes","title","type","supports","html","inserter","customClassName","reusable","save","jsxs","Fragment","children","jsx","RichText","Content","tagName","className","value","InnerBlocks","_default","exports","default"],"sources":["@wordpress/widgets/src/blocks/widget-group/deprecated.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { InnerBlocks, RichText } from '@wordpress/block-editor';\n\nconst v1 = {\n\tattributes: {\n\t\ttitle: {\n\t\t\ttype: 'string',\n\t\t},\n\t},\n\tsupports: {\n\t\thtml: false,\n\t\tinserter: true,\n\t\tcustomClassName: true,\n\t\treusable: false,\n\t},\n\tsave( { attributes } ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<RichText.Content\n\t\t\t\t\ttagName=\"h2\"\n\t\t\t\t\tclassName=\"widget-title\"\n\t\t\t\t\tvalue={ attributes.title }\n\t\t\t\t/>\n\t\t\t\t<InnerBlocks.Content />\n\t\t\t</>\n\t\t);\n\t},\n};\n\nexport default [ v1 ];\n"],"mappings":";;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAAgE,IAAAC,WAAA,GAAAD,OAAA;AAHhE;AACA;AACA;;AAGA,MAAME,EAAE,GAAG;EACVC,UAAU,EAAE;IACXC,KAAK,EAAE;MACNC,IAAI,EAAE;IACP;EACD,CAAC;EACDC,QAAQ,EAAE;IACTC,IAAI,EAAE,KAAK;IACXC,QAAQ,EAAE,IAAI;IACdC,eAAe,EAAE,IAAI;IACrBC,QAAQ,EAAE;EACX,CAAC;EACDC,IAAIA,CAAE;IAAER;EAAW,CAAC,EAAG;IACtB,oBACC,IAAAF,WAAA,CAAAW,IAAA,EAAAX,WAAA,CAAAY,QAAA;MAAAC,QAAA,gBACC,IAAAb,WAAA,CAAAc,GAAA,EAAChB,YAAA,CAAAiB,QAAQ,CAACC,OAAO;QAChBC,OAAO,EAAC,IAAI;QACZC,SAAS,EAAC,cAAc;QACxBC,KAAK,EAAGjB,UAAU,CAACC;MAAO,CAC1B,CAAC,eACF,IAAAH,WAAA,CAAAc,GAAA,EAAChB,YAAA,CAAAsB,WAAW,CAACJ,OAAO,IAAE,CAAC;IAAA,CACtB,CAAC;EAEL;AACD,CAAC;AAAC,IAAAK,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEa,CAAEtB,EAAE,CAAE","ignoreList":[]}
@@ -4,12 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = Edit;
7
- var _react = require("react");
8
7
  var _blockEditor = require("@wordpress/block-editor");
9
8
  var _components = require("@wordpress/components");
10
9
  var _icons = require("@wordpress/icons");
11
10
  var _i18n = require("@wordpress/i18n");
12
11
  var _data = require("@wordpress/data");
12
+ var _jsxRuntime = require("react/jsx-runtime");
13
13
  /**
14
14
  * WordPress dependencies
15
15
  */
@@ -21,46 +21,52 @@ function Edit(props) {
21
21
  const {
22
22
  innerBlocks
23
23
  } = (0, _data.useSelect)(select => select(_blockEditor.store).getBlock(clientId), [clientId]);
24
- return (0, _react.createElement)("div", {
24
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
25
25
  ...(0, _blockEditor.useBlockProps)({
26
26
  className: 'widget'
27
+ }),
28
+ children: innerBlocks.length === 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(PlaceholderContent, {
29
+ ...props
30
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(PreviewContent, {
31
+ ...props
27
32
  })
28
- }, innerBlocks.length === 0 ? (0, _react.createElement)(PlaceholderContent, {
29
- ...props
30
- }) : (0, _react.createElement)(PreviewContent, {
31
- ...props
32
- }));
33
+ });
33
34
  }
34
35
  function PlaceholderContent({
35
36
  clientId
36
37
  }) {
37
- return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_components.Placeholder, {
38
- className: "wp-block-widget-group__placeholder",
39
- icon: (0, _react.createElement)(_blockEditor.BlockIcon, {
40
- icon: _icons.group
41
- }),
42
- label: (0, _i18n.__)('Widget Group')
43
- }, (0, _react.createElement)(_blockEditor.ButtonBlockAppender, {
44
- rootClientId: clientId
45
- })), (0, _react.createElement)(_blockEditor.InnerBlocks, {
46
- renderAppender: false
47
- }));
38
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
39
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Placeholder, {
40
+ className: "wp-block-widget-group__placeholder",
41
+ icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.BlockIcon, {
42
+ icon: _icons.group
43
+ }),
44
+ label: (0, _i18n.__)('Widget Group'),
45
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.ButtonBlockAppender, {
46
+ rootClientId: clientId
47
+ })
48
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.InnerBlocks, {
49
+ renderAppender: false
50
+ })]
51
+ });
48
52
  }
49
53
  function PreviewContent({
50
54
  attributes,
51
55
  setAttributes
52
56
  }) {
53
57
  var _attributes$title;
54
- return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_blockEditor.RichText, {
55
- tagName: "h2",
56
- identifier: "title",
57
- className: "widget-title",
58
- allowedFormats: [],
59
- placeholder: (0, _i18n.__)('Title'),
60
- value: (_attributes$title = attributes.title) !== null && _attributes$title !== void 0 ? _attributes$title : '',
61
- onChange: title => setAttributes({
62
- title
63
- })
64
- }), (0, _react.createElement)(_blockEditor.InnerBlocks, null));
58
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
59
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.RichText, {
60
+ tagName: "h2",
61
+ identifier: "title",
62
+ className: "widget-title",
63
+ allowedFormats: [],
64
+ placeholder: (0, _i18n.__)('Title'),
65
+ value: (_attributes$title = attributes.title) !== null && _attributes$title !== void 0 ? _attributes$title : '',
66
+ onChange: title => setAttributes({
67
+ title
68
+ })
69
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.InnerBlocks, {})]
70
+ });
65
71
  }
66
72
  //# sourceMappingURL=edit.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_blockEditor","require","_components","_icons","_i18n","_data","Edit","props","clientId","innerBlocks","useSelect","select","blockEditorStore","getBlock","_react","createElement","useBlockProps","className","length","PlaceholderContent","PreviewContent","Fragment","Placeholder","icon","BlockIcon","groupIcon","label","__","ButtonBlockAppender","rootClientId","InnerBlocks","renderAppender","attributes","setAttributes","_attributes$title","RichText","tagName","identifier","allowedFormats","placeholder","value","title","onChange"],"sources":["@wordpress/widgets/src/blocks/widget-group/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tuseBlockProps,\n\tBlockIcon,\n\tButtonBlockAppender,\n\tInnerBlocks,\n\tstore as blockEditorStore,\n\tRichText,\n} from '@wordpress/block-editor';\nimport { Placeholder } from '@wordpress/components';\nimport { group as groupIcon } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\n\nexport default function Edit( props ) {\n\tconst { clientId } = props;\n\tconst { innerBlocks } = useSelect(\n\t\t( select ) => select( blockEditorStore ).getBlock( clientId ),\n\t\t[ clientId ]\n\t);\n\n\treturn (\n\t\t<div { ...useBlockProps( { className: 'widget' } ) }>\n\t\t\t{ innerBlocks.length === 0 ? (\n\t\t\t\t<PlaceholderContent { ...props } />\n\t\t\t) : (\n\t\t\t\t<PreviewContent { ...props } />\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nfunction PlaceholderContent( { clientId } ) {\n\treturn (\n\t\t<>\n\t\t\t<Placeholder\n\t\t\t\tclassName=\"wp-block-widget-group__placeholder\"\n\t\t\t\ticon={ <BlockIcon icon={ groupIcon } /> }\n\t\t\t\tlabel={ __( 'Widget Group' ) }\n\t\t\t>\n\t\t\t\t<ButtonBlockAppender rootClientId={ clientId } />\n\t\t\t</Placeholder>\n\t\t\t<InnerBlocks renderAppender={ false } />\n\t\t</>\n\t);\n}\n\nfunction PreviewContent( { attributes, setAttributes } ) {\n\treturn (\n\t\t<>\n\t\t\t<RichText\n\t\t\t\ttagName=\"h2\"\n\t\t\t\tidentifier=\"title\"\n\t\t\t\tclassName=\"widget-title\"\n\t\t\t\tallowedFormats={ [] }\n\t\t\t\tplaceholder={ __( 'Title' ) }\n\t\t\t\tvalue={ attributes.title ?? '' }\n\t\t\t\tonChange={ ( title ) => setAttributes( { title } ) }\n\t\t\t/>\n\t\t\t<InnerBlocks />\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAQA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAdA;AACA;AACA;;AAce,SAASK,IAAIA,CAAEC,KAAK,EAAG;EACrC,MAAM;IAAEC;EAAS,CAAC,GAAGD,KAAK;EAC1B,MAAM;IAAEE;EAAY,CAAC,GAAG,IAAAC,eAAS,EAC9BC,MAAM,IAAMA,MAAM,CAAEC,kBAAiB,CAAC,CAACC,QAAQ,CAAEL,QAAS,CAAC,EAC7D,CAAEA,QAAQ,CACX,CAAC;EAED,OACC,IAAAM,MAAA,CAAAC,aAAA;IAAA,GAAU,IAAAC,0BAAa,EAAE;MAAEC,SAAS,EAAE;IAAS,CAAE;EAAC,GAC/CR,WAAW,CAACS,MAAM,KAAK,CAAC,GACzB,IAAAJ,MAAA,CAAAC,aAAA,EAACI,kBAAkB;IAA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CAAC,EACF,IAAA3B,MAAA,CAAAC,aAAA,EAACf,YAAA,CAAA8B,WAAW,MAAE,CACb,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["_blockEditor","require","_components","_icons","_i18n","_data","_jsxRuntime","Edit","props","clientId","innerBlocks","useSelect","select","blockEditorStore","getBlock","jsx","useBlockProps","className","children","length","PlaceholderContent","PreviewContent","jsxs","Fragment","Placeholder","icon","BlockIcon","groupIcon","label","__","ButtonBlockAppender","rootClientId","InnerBlocks","renderAppender","attributes","setAttributes","_attributes$title","RichText","tagName","identifier","allowedFormats","placeholder","value","title","onChange"],"sources":["@wordpress/widgets/src/blocks/widget-group/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tuseBlockProps,\n\tBlockIcon,\n\tButtonBlockAppender,\n\tInnerBlocks,\n\tstore as blockEditorStore,\n\tRichText,\n} from '@wordpress/block-editor';\nimport { Placeholder } from '@wordpress/components';\nimport { group as groupIcon } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\n\nexport default function Edit( props ) {\n\tconst { clientId } = props;\n\tconst { innerBlocks } = useSelect(\n\t\t( select ) => select( blockEditorStore ).getBlock( clientId ),\n\t\t[ clientId ]\n\t);\n\n\treturn (\n\t\t<div { ...useBlockProps( { className: 'widget' } ) }>\n\t\t\t{ innerBlocks.length === 0 ? (\n\t\t\t\t<PlaceholderContent { ...props } />\n\t\t\t) : (\n\t\t\t\t<PreviewContent { ...props } />\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nfunction PlaceholderContent( { clientId } ) {\n\treturn (\n\t\t<>\n\t\t\t<Placeholder\n\t\t\t\tclassName=\"wp-block-widget-group__placeholder\"\n\t\t\t\ticon={ <BlockIcon icon={ groupIcon } /> }\n\t\t\t\tlabel={ __( 'Widget Group' ) }\n\t\t\t>\n\t\t\t\t<ButtonBlockAppender rootClientId={ clientId } />\n\t\t\t</Placeholder>\n\t\t\t<InnerBlocks renderAppender={ false } />\n\t\t</>\n\t);\n}\n\nfunction PreviewContent( { attributes, setAttributes } ) {\n\treturn (\n\t\t<>\n\t\t\t<RichText\n\t\t\t\ttagName=\"h2\"\n\t\t\t\tidentifier=\"title\"\n\t\t\t\tclassName=\"widget-title\"\n\t\t\t\tallowedFormats={ [] }\n\t\t\t\tplaceholder={ __( 'Title' ) }\n\t\t\t\tvalue={ attributes.title ?? '' }\n\t\t\t\tonChange={ ( title ) => setAttributes( { title } ) }\n\t\t\t/>\n\t\t\t<InnerBlocks />\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAQA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAA4C,IAAAK,WAAA,GAAAL,OAAA;AAd5C;AACA;AACA;;AAce,SAASM,IAAIA,CAAEC,KAAK,EAAG;EACrC,MAAM;IAAEC;EAAS,CAAC,GAAGD,KAAK;EAC1B,MAAM;IAAEE;EAAY,CAAC,GAAG,IAAAC,eAAS,EAC9BC,MAAM,IAAMA,MAAM,CAAEC,kBAAiB,CAAC,CAACC,QAAQ,CAAEL,QAAS,CAAC,EAC7D,CAAEA,QAAQ,CACX,CAAC;EAED,oBACC,IAAAH,WAAA,CAAAS,GAAA;IAAA,GAAU,IAAAC,0BAAa,EAAE;MAAEC,SAAS,EAAE;IAAS,CAAE,CAAC;IAAAC,QAAA,EAC/CR,WAAW,CAACS,MAAM,KAAK,CAAC,gBACzB,IAAAb,WAAA,CAAAS,GAAA,EAACK,kBAAkB;MAAA,GAAMZ;IAAK,CAAI,CAAC,gBAEnC,IAAAF,WAAA,CAAAS,GAAA,EAACM,cAAc;MAAA,GAAMb;IAAK,CAAI;EAC9B,CACG,CAAC;AAER;AAEA,SAASY,kBAAkBA,CAAE;EAAEX;AAAS,CAAC,EAAG;EAC3C,oBACC,IA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}
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = save;
7
- var _react = require("react");
8
7
  var _blockEditor = require("@wordpress/block-editor");
8
+ var _jsxRuntime = require("react/jsx-runtime");
9
9
  /**
10
10
  * WordPress dependencies
11
11
  */
@@ -13,12 +13,15 @@ var _blockEditor = require("@wordpress/block-editor");
13
13
  function save({
14
14
  attributes
15
15
  }) {
16
- return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_blockEditor.RichText.Content, {
17
- tagName: "h2",
18
- className: "widget-title",
19
- value: attributes.title
20
- }), (0, _react.createElement)("div", {
21
- className: "wp-widget-group__inner-blocks"
22
- }, (0, _react.createElement)(_blockEditor.InnerBlocks.Content, null)));
16
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
17
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.RichText.Content, {
18
+ tagName: "h2",
19
+ className: "widget-title",
20
+ value: attributes.title
21
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
22
+ className: "wp-widget-group__inner-blocks",
23
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.InnerBlocks.Content, {})
24
+ })]
25
+ });
23
26
  }
24
27
  //# sourceMappingURL=save.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_blockEditor","require","save","attributes","_react","createElement","Fragment","RichText","Content","tagName","className","value","title","InnerBlocks"],"sources":["@wordpress/widgets/src/blocks/widget-group/save.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { InnerBlocks, RichText } from '@wordpress/block-editor';\n\nexport default function save( { attributes } ) {\n\treturn (\n\t\t<>\n\t\t\t<RichText.Content\n\t\t\t\ttagName=\"h2\"\n\t\t\t\tclassName=\"widget-title\"\n\t\t\t\tvalue={ attributes.title }\n\t\t\t/>\n\t\t\t<div className=\"wp-widget-group__inner-blocks\">\n\t\t\t\t<InnerBlocks.Content />\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGe,SAASC,IAAIA,CAAE;EAAEC;AAAW,CAAC,EAAG;EAC9C,OACC,IAAAC,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAE,QAAA,QACC,IAAAF,MAAA,CAAAC,aAAA,EAACL,YAAA,CAAAO,QAAQ,CAACC,OAAO;IAChBC,OAAO,EAAC,IAAI;IACZC,SAAS,EAAC,cAAc;IACxBC,KAAK,EAAGR,UAAU,CAACS;EAAO,CAC1B,CAAC,EACF,IAAAR,MAAA,CAAAC,aAAA;IAAKK,SAAS,EAAC;EAA+B,GAC7C,IAAAN,MAAA,CAAAC,aAAA,EAACL,YAAA,CAAAa,WAAW,CAACL,OAAO,MAAE,CAClB,CACJ,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["_blockEditor","require","_jsxRuntime","save","attributes","jsxs","Fragment","children","jsx","RichText","Content","tagName","className","value","title","InnerBlocks"],"sources":["@wordpress/widgets/src/blocks/widget-group/save.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { InnerBlocks, RichText } from '@wordpress/block-editor';\n\nexport default function save( { attributes } ) {\n\treturn (\n\t\t<>\n\t\t\t<RichText.Content\n\t\t\t\ttagName=\"h2\"\n\t\t\t\tclassName=\"widget-title\"\n\t\t\t\tvalue={ attributes.title }\n\t\t\t/>\n\t\t\t<div className=\"wp-widget-group__inner-blocks\">\n\t\t\t\t<InnerBlocks.Content />\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAAgE,IAAAC,WAAA,GAAAD,OAAA;AAHhE;AACA;AACA;;AAGe,SAASE,IAAIA,CAAE;EAAEC;AAAW,CAAC,EAAG;EAC9C,oBACC,IAAAF,WAAA,CAAAG,IAAA,EAAAH,WAAA,CAAAI,QAAA;IAAAC,QAAA,gBACC,IAAAL,WAAA,CAAAM,GAAA,EAACR,YAAA,CAAAS,QAAQ,CAACC,OAAO;MAChBC,OAAO,EAAC,IAAI;MACZC,SAAS,EAAC,cAAc;MACxBC,KAAK,EAAGT,UAAU,CAACU;IAAO,CAC1B,CAAC,eACF,IAAAZ,WAAA,CAAAM,GAAA;MAAKI,SAAS,EAAC,+BAA+B;MAAAL,QAAA,eAC7C,IAAAL,WAAA,CAAAM,GAAA,EAACR,YAAA,CAAAe,WAAW,CAACL,OAAO,IAAE;IAAC,CACnB,CAAC;EAAA,CACL,CAAC;AAEL","ignoreList":[]}
@@ -4,10 +4,10 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = MoveToWidgetArea;
7
- var _react = require("react");
8
7
  var _components = require("@wordpress/components");
9
8
  var _i18n = require("@wordpress/i18n");
10
9
  var _icons = require("@wordpress/icons");
10
+ var _jsxRuntime = require("react/jsx-runtime");
11
11
  /**
12
12
  * WordPress dependencies
13
13
  */
@@ -17,25 +17,31 @@ function MoveToWidgetArea({
17
17
  widgetAreas,
18
18
  onSelect
19
19
  }) {
20
- return (0, _react.createElement)(_components.ToolbarGroup, null, (0, _react.createElement)(_components.ToolbarItem, null, toggleProps => (0, _react.createElement)(_components.DropdownMenu, {
21
- icon: _icons.moveTo,
22
- label: (0, _i18n.__)('Move to widget area'),
23
- toggleProps: toggleProps
24
- }, ({
25
- onClose
26
- }) => (0, _react.createElement)(_components.MenuGroup, {
27
- label: (0, _i18n.__)('Move to')
28
- }, (0, _react.createElement)(_components.MenuItemsChoice, {
29
- choices: widgetAreas.map(widgetArea => ({
30
- value: widgetArea.id,
31
- label: widgetArea.name,
32
- info: widgetArea.description
33
- })),
34
- value: currentWidgetAreaId,
35
- onSelect: value => {
36
- onSelect(value);
37
- onClose();
38
- }
39
- })))));
20
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToolbarGroup, {
21
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToolbarItem, {
22
+ children: toggleProps => /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.DropdownMenu, {
23
+ icon: _icons.moveTo,
24
+ label: (0, _i18n.__)('Move to widget area'),
25
+ toggleProps: toggleProps,
26
+ children: ({
27
+ onClose
28
+ }) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.MenuGroup, {
29
+ label: (0, _i18n.__)('Move to'),
30
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.MenuItemsChoice, {
31
+ choices: widgetAreas.map(widgetArea => ({
32
+ value: widgetArea.id,
33
+ label: widgetArea.name,
34
+ info: widgetArea.description
35
+ })),
36
+ value: currentWidgetAreaId,
37
+ onSelect: value => {
38
+ onSelect(value);
39
+ onClose();
40
+ }
41
+ })
42
+ })
43
+ })
44
+ })
45
+ });
40
46
  }
41
47
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","_i18n","_icons","MoveToWidgetArea","currentWidgetAreaId","widgetAreas","onSelect","_react","createElement","ToolbarGroup","ToolbarItem","toggleProps","DropdownMenu","icon","moveTo","label","__","onClose","MenuGroup","MenuItemsChoice","choices","map","widgetArea","value","id","name","info","description"],"sources":["@wordpress/widgets/src/components/move-to-widget-area/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tDropdownMenu,\n\tMenuGroup,\n\tMenuItemsChoice,\n\tToolbarGroup,\n\tToolbarItem,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { moveTo } from '@wordpress/icons';\n\nexport default function MoveToWidgetArea( {\n\tcurrentWidgetAreaId,\n\twidgetAreas,\n\tonSelect,\n} ) {\n\treturn (\n\t\t<ToolbarGroup>\n\t\t\t<ToolbarItem>\n\t\t\t\t{ ( toggleProps ) => (\n\t\t\t\t\t<DropdownMenu\n\t\t\t\t\t\ticon={ moveTo }\n\t\t\t\t\t\tlabel={ __( 'Move to widget area' ) }\n\t\t\t\t\t\ttoggleProps={ toggleProps }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t\t<MenuGroup label={ __( 'Move to' ) }>\n\t\t\t\t\t\t\t\t<MenuItemsChoice\n\t\t\t\t\t\t\t\t\tchoices={ widgetAreas.map(\n\t\t\t\t\t\t\t\t\t\t( widgetArea ) => ( {\n\t\t\t\t\t\t\t\t\t\t\tvalue: widgetArea.id,\n\t\t\t\t\t\t\t\t\t\t\tlabel: widgetArea.name,\n\t\t\t\t\t\t\t\t\t\t\tinfo: widgetArea.description,\n\t\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tvalue={ currentWidgetAreaId }\n\t\t\t\t\t\t\t\t\tonSelect={ ( value ) => {\n\t\t\t\t\t\t\t\t\t\tonSelect( value );\n\t\t\t\t\t\t\t\t\t\tonClose();\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</MenuGroup>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</DropdownMenu>\n\t\t\t\t) }\n\t\t\t</ToolbarItem>\n\t\t</ToolbarGroup>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAOA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAXA;AACA;AACA;;AAWe,SAASG,gBAAgBA,CAAE;EACzCC,mBAAmB;EACnBC,WAAW;EACXC;AACD,CAAC,EAAG;EACH,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACT,WAAA,CAAAU,YAAY,QACZ,IAAAF,MAAA,CAAAC,aAAA,EAACT,WAAA,CAAAW,WAAW,QACPC,WAAW,IACd,IAAAJ,MAAA,CAAAC,aAAA,EAACT,WAAA,CAAAa,YAAY;IACZC,IAAI,EAAGC,aAAQ;IACfC,KAAK,EAAG,IAAAC,QAAE,EAAE,qBAAsB,CAAG;IACrCL,WAAW,EAAGA;EAAa,GAEzB,CAAE;IAAEM;EAAQ,CAAC,KACd,IAAAV,MAAA,CAAAC,aAAA,EAACT,WAAA,CAAAmB,SAAS;IAACH,KAAK,EAAG,IAAAC,QAAE,EAAE,SAAU;EAAG,GACnC,IAAAT,MAAA,CAAAC,aAAA,EAACT,WAAA,CAAAoB,eAAe;IACfC,OAAO,EAAGf,WAAW,CAACgB,GAAG,CACtBC,UAAU,KAAQ;MACnBC,KAAK,EAAED,UAAU,CAACE,EAAE;MACpBT,KAAK,EAAEO,UAAU,CAACG,IAAI;MACtBC,IAAI,EAAEJ,UAAU,CAACK;IAClB,CAAC,CACF,CAAG;IACHJ,KAAK,EAAGnB,mBAAqB;IAC7BE,QAAQ,EAAKiB,KAAK,IAAM;MACvBjB,QAAQ,CAAEiB,KAAM,CAAC;MACjBN,OAAO,CAAC,CAAC;IACV;EAAG,CACH,CACS,CAEC,CAEH,CACA,CAAC;AAEjB","ignoreList":[]}
1
+ {"version":3,"names":["_components","require","_i18n","_icons","_jsxRuntime","MoveToWidgetArea","currentWidgetAreaId","widgetAreas","onSelect","jsx","ToolbarGroup","children","ToolbarItem","toggleProps","DropdownMenu","icon","moveTo","label","__","onClose","MenuGroup","MenuItemsChoice","choices","map","widgetArea","value","id","name","info","description"],"sources":["@wordpress/widgets/src/components/move-to-widget-area/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tDropdownMenu,\n\tMenuGroup,\n\tMenuItemsChoice,\n\tToolbarGroup,\n\tToolbarItem,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { moveTo } from '@wordpress/icons';\n\nexport default function MoveToWidgetArea( {\n\tcurrentWidgetAreaId,\n\twidgetAreas,\n\tonSelect,\n} ) {\n\treturn (\n\t\t<ToolbarGroup>\n\t\t\t<ToolbarItem>\n\t\t\t\t{ ( toggleProps ) => (\n\t\t\t\t\t<DropdownMenu\n\t\t\t\t\t\ticon={ moveTo }\n\t\t\t\t\t\tlabel={ __( 'Move to widget area' ) }\n\t\t\t\t\t\ttoggleProps={ toggleProps }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t\t<MenuGroup label={ __( 'Move to' ) }>\n\t\t\t\t\t\t\t\t<MenuItemsChoice\n\t\t\t\t\t\t\t\t\tchoices={ widgetAreas.map(\n\t\t\t\t\t\t\t\t\t\t( widgetArea ) => ( {\n\t\t\t\t\t\t\t\t\t\t\tvalue: widgetArea.id,\n\t\t\t\t\t\t\t\t\t\t\tlabel: widgetArea.name,\n\t\t\t\t\t\t\t\t\t\t\tinfo: widgetArea.description,\n\t\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tvalue={ currentWidgetAreaId }\n\t\t\t\t\t\t\t\t\tonSelect={ ( value ) => {\n\t\t\t\t\t\t\t\t\t\tonSelect( value );\n\t\t\t\t\t\t\t\t\t\tonClose();\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</MenuGroup>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</DropdownMenu>\n\t\t\t\t) }\n\t\t\t</ToolbarItem>\n\t\t</ToolbarGroup>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAOA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAA0C,IAAAG,WAAA,GAAAH,OAAA;AAX1C;AACA;AACA;;AAWe,SAASI,gBAAgBA,CAAE;EACzCC,mBAAmB;EACnBC,WAAW;EACXC;AACD,CAAC,EAAG;EACH,oBACC,IAAAJ,WAAA,CAAAK,GAAA,EAACT,WAAA,CAAAU,YAAY;IAAAC,QAAA,eACZ,IAAAP,WAAA,CAAAK,GAAA,EAACT,WAAA,CAAAY,WAAW;MAAAD,QAAA,EACPE,WAAW,iBACd,IAAAT,WAAA,CAAAK,GAAA,EAACT,WAAA,CAAAc,YAAY;QACZC,IAAI,EAAGC,aAAQ;QACfC,KAAK,EAAG,IAAAC,QAAE,EAAE,qBAAsB,CAAG;QACrCL,WAAW,EAAGA,WAAa;QAAAF,QAAA,EAEzBA,CAAE;UAAEQ;QAAQ,CAAC,kBACd,IAAAf,WAAA,CAAAK,GAAA,EAACT,WAAA,CAAAoB,SAAS;UAACH,KAAK,EAAG,IAAAC,QAAE,EAAE,SAAU,CAAG;UAAAP,QAAA,eACnC,IAAAP,WAAA,CAAAK,GAAA,EAACT,WAAA,CAAAqB,eAAe;YACfC,OAAO,EAAGf,WAAW,CAACgB,GAAG,CACtBC,UAAU,KAAQ;cACnBC,KAAK,EAAED,UAAU,CAACE,EAAE;cACpBT,KAAK,EAAEO,UAAU,CAACG,IAAI;cACtBC,IAAI,EAAEJ,UAAU,CAACK;YAClB,CAAC,CACF,CAAG;YACHJ,KAAK,EAAGnB,mBAAqB;YAC7BE,QAAQ,EAAKiB,KAAK,IAAM;cACvBjB,QAAQ,CAAEiB,KAAM,CAAC;cACjBN,OAAO,CAAC,CAAC;YACV;UAAG,CACH;QAAC,CACQ;MACX,CACY;IACd,CACW;EAAC,CACD,CAAC;AAEjB","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- import { createElement } from "react";
2
1
  /**
3
2
  * WordPress dependencies
4
3
  */
@@ -7,6 +6,7 @@ import { store as blockEditorStore } from '@wordpress/block-editor';
7
6
  import { ToolbarButton } from '@wordpress/components';
8
7
  import { createBlock, rawHandler } from '@wordpress/blocks';
9
8
  import { __ } from '@wordpress/i18n';
9
+ import { jsx as _jsx } from "react/jsx-runtime";
10
10
  export default function ConvertToBlocksButton({
11
11
  clientId,
12
12
  rawInstance
@@ -14,7 +14,7 @@ export default function ConvertToBlocksButton({
14
14
  const {
15
15
  replaceBlocks
16
16
  } = useDispatch(blockEditorStore);
17
- return createElement(ToolbarButton, {
17
+ return /*#__PURE__*/_jsx(ToolbarButton, {
18
18
  onClick: () => {
19
19
  if (rawInstance.title) {
20
20
  replaceBlocks(clientId, [createBlock('core/heading', {
@@ -27,7 +27,8 @@ export default function ConvertToBlocksButton({
27
27
  HTML: rawInstance.text
28
28
  }));
29
29
  }
30
- }
31
- }, __('Convert to blocks'));
30
+ },
31
+ children: __('Convert to blocks')
32
+ });
32
33
  }
33
34
  //# sourceMappingURL=convert-to-blocks-button.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useDispatch","store","blockEditorStore","ToolbarButton","createBlock","rawHandler","__","ConvertToBlocksButton","clientId","rawInstance","replaceBlocks","createElement","onClick","title","content","HTML","text"],"sources":["@wordpress/widgets/src/blocks/legacy-widget/edit/convert-to-blocks-button.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { ToolbarButton } from '@wordpress/components';\nimport { createBlock, rawHandler } from '@wordpress/blocks';\nimport { __ } from '@wordpress/i18n';\n\nexport default function ConvertToBlocksButton( { clientId, rawInstance } ) {\n\tconst { replaceBlocks } = useDispatch( blockEditorStore );\n\n\treturn (\n\t\t<ToolbarButton\n\t\t\tonClick={ () => {\n\t\t\t\tif ( rawInstance.title ) {\n\t\t\t\t\treplaceBlocks( clientId, [\n\t\t\t\t\t\tcreateBlock( 'core/heading', {\n\t\t\t\t\t\t\tcontent: rawInstance.title,\n\t\t\t\t\t\t} ),\n\t\t\t\t\t\t...rawHandler( { HTML: rawInstance.text } ),\n\t\t\t\t\t] );\n\t\t\t\t} else {\n\t\t\t\t\treplaceBlocks(\n\t\t\t\t\t\tclientId,\n\t\t\t\t\t\trawHandler( { HTML: rawInstance.text } )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} }\n\t\t>\n\t\t\t{ __( 'Convert to blocks' ) }\n\t\t</ToolbarButton>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AACnE,SAASC,aAAa,QAAQ,uBAAuB;AACrD,SAASC,WAAW,EAAEC,UAAU,QAAQ,mBAAmB;AAC3D,SAASC,EAAE,QAAQ,iBAAiB;AAEpC,eAAe,SAASC,qBAAqBA,CAAE;EAAEC,QAAQ;EAAEC;AAAY,CAAC,EAAG;EAC1E,MAAM;IAAEC;EAAc,CAAC,GAAGV,WAAW,CAAEE,gBAAiB,CAAC;EAEzD,OACCS,aAAA,CAACR,aAAa;IACbS,OAAO,EAAGA,CAAA,KAAM;MACf,IAAKH,WAAW,CAACI,KAAK,EAAG;QACxBH,aAAa,CAAEF,QAAQ,EAAE,CACxBJ,WAAW,CAAE,cAAc,EAAE;UAC5BU,OAAO,EAAEL,WAAW,CAACI;QACtB,CAAE,CAAC,EACH,GAAGR,UAAU,CAAE;UAAEU,IAAI,EAAEN,WAAW,CAACO;QAAK,CAAE,CAAC,CAC1C,CAAC;MACJ,CAAC,MAAM;QACNN,aAAa,CACZF,QAAQ,EACRH,UAAU,CAAE;UAAEU,IAAI,EAAEN,WAAW,CAACO;QAAK,CAAE,CACxC,CAAC;MACF;IACD;EAAG,GAEDV,EAAE,CAAE,mBAAoB,CACZ,CAAC;AAElB","ignoreList":[]}
1
+ {"version":3,"names":["useDispatch","store","blockEditorStore","ToolbarButton","createBlock","rawHandler","__","jsx","_jsx","ConvertToBlocksButton","clientId","rawInstance","replaceBlocks","onClick","title","content","HTML","text","children"],"sources":["@wordpress/widgets/src/blocks/legacy-widget/edit/convert-to-blocks-button.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { ToolbarButton } from '@wordpress/components';\nimport { createBlock, rawHandler } from '@wordpress/blocks';\nimport { __ } from '@wordpress/i18n';\n\nexport default function ConvertToBlocksButton( { clientId, rawInstance } ) {\n\tconst { replaceBlocks } = useDispatch( blockEditorStore );\n\n\treturn (\n\t\t<ToolbarButton\n\t\t\tonClick={ () => {\n\t\t\t\tif ( rawInstance.title ) {\n\t\t\t\t\treplaceBlocks( clientId, [\n\t\t\t\t\t\tcreateBlock( 'core/heading', {\n\t\t\t\t\t\t\tcontent: rawInstance.title,\n\t\t\t\t\t\t} ),\n\t\t\t\t\t\t...rawHandler( { HTML: rawInstance.text } ),\n\t\t\t\t\t] );\n\t\t\t\t} else {\n\t\t\t\t\treplaceBlocks(\n\t\t\t\t\t\tclientId,\n\t\t\t\t\t\trawHandler( { HTML: rawInstance.text } )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} }\n\t\t>\n\t\t\t{ __( 'Convert to blocks' ) }\n\t\t</ToolbarButton>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AACnE,SAASC,aAAa,QAAQ,uBAAuB;AACrD,SAASC,WAAW,EAAEC,UAAU,QAAQ,mBAAmB;AAC3D,SAASC,EAAE,QAAQ,iBAAiB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAErC,eAAe,SAASC,qBAAqBA,CAAE;EAAEC,QAAQ;EAAEC;AAAY,CAAC,EAAG;EAC1E,MAAM;IAAEC;EAAc,CAAC,GAAGZ,WAAW,CAAEE,gBAAiB,CAAC;EAEzD,oBACCM,IAAA,CAACL,aAAa;IACbU,OAAO,EAAGA,CAAA,KAAM;MACf,IAAKF,WAAW,CAACG,KAAK,EAAG;QACxBF,aAAa,CAAEF,QAAQ,EAAE,CACxBN,WAAW,CAAE,cAAc,EAAE;UAC5BW,OAAO,EAAEJ,WAAW,CAACG;QACtB,CAAE,CAAC,EACH,GAAGT,UAAU,CAAE;UAAEW,IAAI,EAAEL,WAAW,CAACM;QAAK,CAAE,CAAC,CAC1C,CAAC;MACJ,CAAC,MAAM;QACNL,aAAa,CACZF,QAAQ,EACRL,UAAU,CAAE;UAAEW,IAAI,EAAEL,WAAW,CAACM;QAAK,CAAE,CACxC,CAAC;MACF;IACD,CAAG;IAAAC,QAAA,EAEDZ,EAAE,CAAE,mBAAoB;EAAC,CACb,CAAC;AAElB","ignoreList":[]}
@@ -1,8 +1,7 @@
1
- import { createElement } from "react";
2
1
  /**
3
2
  * External dependencies
4
3
  */
5
- import classnames from 'classnames';
4
+ import clsx from 'clsx';
6
5
  /**
7
6
  * WordPress dependencies
8
7
  */
@@ -16,6 +15,8 @@ import { useViewportMatch } from '@wordpress/compose';
16
15
  * Internal dependencies
17
16
  */
18
17
  import Control from './control';
18
+ import { jsx as _jsx } from "react/jsx-runtime";
19
+ import { jsxs as _jsxs } from "react/jsx-runtime";
19
20
  export default function Form({
20
21
  title,
21
22
  isVisible,
@@ -69,31 +70,36 @@ export default function Form({
69
70
  };
70
71
  }, [id, idBase, instance, onChangeInstance, onChangeHasPreview, isMediumLargeViewport]);
71
72
  if (isWide && isMediumLargeViewport) {
72
- return createElement("div", {
73
- className: classnames({
73
+ return /*#__PURE__*/_jsxs("div", {
74
+ className: clsx({
74
75
  'wp-block-legacy-widget__container': isVisible
75
- })
76
- }, isVisible && createElement("h3", {
77
- className: "wp-block-legacy-widget__edit-form-title"
78
- }, title), createElement(Popover, {
79
- focusOnMount: false,
80
- placement: "right",
81
- offset: 32,
82
- resize: false,
83
- flip: false,
84
- shift: true
85
- }, createElement("div", {
86
- ref: ref,
87
- className: "wp-block-legacy-widget__edit-form",
88
- hidden: !isVisible
89
- })));
76
+ }),
77
+ children: [isVisible && /*#__PURE__*/_jsx("h3", {
78
+ className: "wp-block-legacy-widget__edit-form-title",
79
+ children: title
80
+ }), /*#__PURE__*/_jsx(Popover, {
81
+ focusOnMount: false,
82
+ placement: "right",
83
+ offset: 32,
84
+ resize: false,
85
+ flip: false,
86
+ shift: true,
87
+ children: /*#__PURE__*/_jsx("div", {
88
+ ref: ref,
89
+ className: "wp-block-legacy-widget__edit-form",
90
+ hidden: !isVisible
91
+ })
92
+ })]
93
+ });
90
94
  }
91
- return createElement("div", {
95
+ return /*#__PURE__*/_jsx("div", {
92
96
  ref: ref,
93
97
  className: "wp-block-legacy-widget__edit-form",
94
- hidden: !isVisible
95
- }, createElement("h3", {
96
- className: "wp-block-legacy-widget__edit-form-title"
97
- }, title));
98
+ hidden: !isVisible,
99
+ children: /*#__PURE__*/_jsx("h3", {
100
+ className: "wp-block-legacy-widget__edit-form-title",
101
+ children: title
102
+ })
103
+ });
98
104
  }
99
105
  //# sourceMappingURL=form.js.map
@@ -1 +1 @@
1
- {"version":3,"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","createElement","className","focusOnMount","placement","offset","resize","flip","shift","hidden"],"sources":["@wordpress/widgets/src/blocks/legacy-widget/edit/form.js"],"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\tresize={ false }\n\t\t\t\t\tflip={ false }\n\t\t\t\t\tshift\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"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;AACnC;AACA;AACA;AACA,SAASC,MAAM,EAAEC,SAAS,QAAQ,oBAAoB;AACtD,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,KAAK,IAAIC,YAAY,QAAQ,oBAAoB;AAC1D,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,OAAO,QAAQ,uBAAuB;AAC/C,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD;AACA;AACA;AACA,OAAOC,OAAO,MAAM,WAAW;AAE/B,eAAe,SAASC,IAAIA,CAAE;EAC7BC,KAAK;EACLC,SAAS;EACTC,EAAE;EACFC,MAAM;EACNC,QAAQ;EACRC,MAAM;EACNC,gBAAgB;EAChBC;AACD,CAAC,EAAG;EACH,MAAMC,GAAG,GAAGnB,MAAM,CAAC,CAAC;EAEpB,MAAMoB,qBAAqB,GAAGZ,gBAAgB,CAAE,OAAQ,CAAC;;EAEzD;EACA;EACA;EACA;EACA,MAAMa,iBAAiB,GAAGrB,MAAM,CAAE,IAAIsB,GAAG,CAAC,CAAE,CAAC;EAC7C,MAAMC,iBAAiB,GAAGvB,MAAM,CAAE,IAAIsB,GAAG,CAAC,CAA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,EAAGxC,UAAU,CAAE;QACvB,mCAAmC,EAAEa;MACtC,CAAE;IAAG,GAEHA,SAAS,IACV0B,aAAA;MAAIC,SAAS,EAAC;IAAyC,GACpD5B,KACC,CACJ,EACD2B,aAAA,CAAC/B,OAAO;MACPiC,YAAY,EAAG,KAAO;MACtBC,SAAS,EAAC,OAAO;MACjBC,MAAM,EAAG,EAAI;MACbC,MAAM,EAAG,KAAO;MAChBC,IAAI,EAAG,KAAO;MACdC,KAAK;IAAA,GAELP,aAAA;MACCnB,GAAG,EAAGA,GAAK;MACXoB,SAAS,EAAC,mCAAmC;MAC7CO,MAAM,EAAG,CAAElC;IAAW,CACjB,CACE,CACL,CAAC;EAER;EAEA,OACC0B,aAAA;IACCnB,GAAG,EAAGA,GAAK;IACXoB,SAAS,EAAC,mCAAmC;IAC7CO,MAAM,EAAG,CAAElC;EAAW,GAEtB0B,aAAA;IAAIC,SAAS,EAAC;EAAyC,GACpD5B,KACC,CACA,CAAC;AAER","ignoreList":[]}
1
+ {"version":3,"names":["clsx","useRef","useEffect","useDispatch","store","noticesStore","__","sprintf","Popover","useViewportMatch","Control","jsx","_jsx","jsxs","_jsxs","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","className","children","focusOnMount","placement","offset","resize","flip","shift","hidden"],"sources":["@wordpress/widgets/src/blocks/legacy-widget/edit/form.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\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={ clsx( {\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\tresize={ false }\n\t\t\t\t\tflip={ false }\n\t\t\t\t\tshift\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"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;AACvB;AACA;AACA;AACA,SAASC,MAAM,EAAEC,SAAS,QAAQ,oBAAoB;AACtD,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,KAAK,IAAIC,YAAY,QAAQ,oBAAoB;AAC1D,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,OAAO,QAAQ,uBAAuB;AAC/C,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD;AACA;AACA;AACA,OAAOC,OAAO,MAAM,WAAW;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAEh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