@wordpress/block-editor 8.0.4 → 8.0.5

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.
@@ -68,6 +68,7 @@ function AutoBlockPreview(_ref) {
68
68
  documentElement
69
69
  }
70
70
  } = bodyElement;
71
+ documentElement.classList.add('block-editor-block-preview__content-iframe');
71
72
  documentElement.style.position = 'absolute';
72
73
  documentElement.style.width = '100%';
73
74
  bodyElement.style.padding = __experimentalPadding + 'px';
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/block-preview/auto.js"],"names":["MemoizedBlockList","AutoBlockPreview","viewportWidth","__experimentalPadding","containerResizeListener","width","containerWidth","contentResizeListener","height","contentHeight","styles","select","store","getSettings","BlockList","scale","transform","bodyElement","ownerDocument","documentElement","style","position","padding","pointerEvents"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAbA;AACA;AACA;;AAKA;AACA;AACA;AAMA;AACA,IAAIA,iBAAJ;;AAEA,SAASC,gBAAT,OAAsE;AAAA,MAA3C;AAAEC,IAAAA,aAAF;AAAiBC,IAAAA;AAAjB,GAA2C;AACrE,QAAM,CACLC,uBADK,EAEL;AAAEC,IAAAA,KAAK,EAAEC;AAAT,GAFK,IAGF,iCAHJ;AAIA,QAAM,CACLC,qBADK,EAEL;AAAEC,IAAAA,MAAM,EAAEC;AAAV,GAFK,IAGF,iCAHJ;AAIA,QAAMC,MAAM,GAAG,qBAAaC,MAAF,IAAc;AACvC,WAAOA,MAAM,CAAEC,YAAF,CAAN,CAAgBC,WAAhB,GAA8BH,MAArC;AACA,GAFc,EAEZ,EAFY,CAAf,CATqE,CAarE;;AACAV,EAAAA,iBAAiB,GAAGA,iBAAiB,IAAI,mBAAMc,kBAAN,CAAzC;AAEA,QAAMC,KAAK,GAAGT,cAAc,GAAGJ,aAA/B;AAEA,SACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACGE,uBADH,EAEC,4BAAC,oBAAD;AACC,IAAA,SAAS,EAAC,qCADX;AAEC,IAAA,KAAK,EAAG;AACPY,MAAAA,SAAS,EAAG,SAASD,KAAO,GADrB;AAEPP,MAAAA,MAAM,EAAEC,aAAa,GAAGM;AAFjB;AAFT,KAOC,4BAAC,eAAD;AACC,IAAA,IAAI,EAAG,4BAAC,qBAAD;AAAc,MAAA,MAAM,EAAGL;AAAvB,MADR;AAEC,IAAA,UAAU,EAAG,2BAAgBO,WAAF,IAAmB;AAC7C,YAAM;AACLC,QAAAA,aAAa,EAAE;AAAEC,UAAAA;AAAF;AADV,UAEFF,WAFJ;AAGAE,MAAAA,eAAe,CAACC,KAAhB,CAAsBC,QAAtB,GAAiC,UAAjC;AACAF,MAAAA,eAAe,CAACC,KAAhB,CAAsBf,KAAtB,GAA8B,MAA9B;AACAY,MAAAA,WAAW,CAACG,KAAZ,CAAkBE,OAAlB,GACCnB,qBAAqB,GAAG,IADzB;AAEA,KARY,EAQV,EARU,CAFd;AAWC,uBAXD;AAYC,IAAA,QAAQ,EAAG,CAAC,CAZb;AAaC,IAAA,KAAK,EAAG;AACPkB,MAAAA,QAAQ,EAAE,UADH;AAEPhB,MAAAA,KAAK,EAAEH,aAFA;AAGPM,MAAAA,MAAM,EAAEC,aAHD;AAIPc,MAAAA,aAAa,EAAE;AAJR;AAbT,KAoBGhB,qBApBH,EAqBC,4BAAC,iBAAD;AAAmB,IAAA,cAAc,EAAG;AAApC,IArBD,CAPD,CAFD,CADD;AAoCA;;eAEcN,gB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Disabled } from '@wordpress/components';\nimport { useResizeObserver, pure, useRefEffect } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport BlockList from '../block-list';\nimport Iframe from '../iframe';\nimport EditorStyles from '../editor-styles';\nimport { store } from '../../store';\n\n// This is used to avoid rendering the block list if the sizes change.\nlet MemoizedBlockList;\n\nfunction AutoBlockPreview( { viewportWidth, __experimentalPadding } ) {\n\tconst [\n\t\tcontainerResizeListener,\n\t\t{ width: containerWidth },\n\t] = useResizeObserver();\n\tconst [\n\t\tcontentResizeListener,\n\t\t{ height: contentHeight },\n\t] = useResizeObserver();\n\tconst styles = useSelect( ( select ) => {\n\t\treturn select( store ).getSettings().styles;\n\t}, [] );\n\n\t// Initialize on render instead of module top level, to avoid circular dependency issues.\n\tMemoizedBlockList = MemoizedBlockList || pure( BlockList );\n\n\tconst scale = containerWidth / viewportWidth;\n\n\treturn (\n\t\t<div className=\"block-editor-block-preview__container\">\n\t\t\t{ containerResizeListener }\n\t\t\t<Disabled\n\t\t\t\tclassName=\"block-editor-block-preview__content\"\n\t\t\t\tstyle={ {\n\t\t\t\t\ttransform: `scale(${ scale })`,\n\t\t\t\t\theight: contentHeight * scale,\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<Iframe\n\t\t\t\t\thead={ <EditorStyles styles={ styles } /> }\n\t\t\t\t\tcontentRef={ useRefEffect( ( bodyElement ) => {\n\t\t\t\t\t\tconst {\n\t\t\t\t\t\t\townerDocument: { documentElement },\n\t\t\t\t\t\t} = bodyElement;\n\t\t\t\t\t\tdocumentElement.style.position = 'absolute';\n\t\t\t\t\t\tdocumentElement.style.width = '100%';\n\t\t\t\t\t\tbodyElement.style.padding =\n\t\t\t\t\t\t\t__experimentalPadding + 'px';\n\t\t\t\t\t}, [] ) }\n\t\t\t\t\taria-hidden\n\t\t\t\t\ttabIndex={ -1 }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t\twidth: viewportWidth,\n\t\t\t\t\t\theight: contentHeight,\n\t\t\t\t\t\tpointerEvents: 'none',\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ contentResizeListener }\n\t\t\t\t\t<MemoizedBlockList renderAppender={ false } />\n\t\t\t\t</Iframe>\n\t\t\t</Disabled>\n\t\t</div>\n\t);\n}\n\nexport default AutoBlockPreview;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/block-preview/auto.js"],"names":["MemoizedBlockList","AutoBlockPreview","viewportWidth","__experimentalPadding","containerResizeListener","width","containerWidth","contentResizeListener","height","contentHeight","styles","select","store","getSettings","BlockList","scale","transform","bodyElement","ownerDocument","documentElement","classList","add","style","position","padding","pointerEvents"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAbA;AACA;AACA;;AAKA;AACA;AACA;AAMA;AACA,IAAIA,iBAAJ;;AAEA,SAASC,gBAAT,OAAsE;AAAA,MAA3C;AAAEC,IAAAA,aAAF;AAAiBC,IAAAA;AAAjB,GAA2C;AACrE,QAAM,CACLC,uBADK,EAEL;AAAEC,IAAAA,KAAK,EAAEC;AAAT,GAFK,IAGF,iCAHJ;AAIA,QAAM,CACLC,qBADK,EAEL;AAAEC,IAAAA,MAAM,EAAEC;AAAV,GAFK,IAGF,iCAHJ;AAIA,QAAMC,MAAM,GAAG,qBAAaC,MAAF,IAAc;AACvC,WAAOA,MAAM,CAAEC,YAAF,CAAN,CAAgBC,WAAhB,GAA8BH,MAArC;AACA,GAFc,EAEZ,EAFY,CAAf,CATqE,CAarE;;AACAV,EAAAA,iBAAiB,GAAGA,iBAAiB,IAAI,mBAAMc,kBAAN,CAAzC;AAEA,QAAMC,KAAK,GAAGT,cAAc,GAAGJ,aAA/B;AAEA,SACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACGE,uBADH,EAEC,4BAAC,oBAAD;AACC,IAAA,SAAS,EAAC,qCADX;AAEC,IAAA,KAAK,EAAG;AACPY,MAAAA,SAAS,EAAG,SAASD,KAAO,GADrB;AAEPP,MAAAA,MAAM,EAAEC,aAAa,GAAGM;AAFjB;AAFT,KAOC,4BAAC,eAAD;AACC,IAAA,IAAI,EAAG,4BAAC,qBAAD;AAAc,MAAA,MAAM,EAAGL;AAAvB,MADR;AAEC,IAAA,UAAU,EAAG,2BAAgBO,WAAF,IAAmB;AAC7C,YAAM;AACLC,QAAAA,aAAa,EAAE;AAAEC,UAAAA;AAAF;AADV,UAEFF,WAFJ;AAGAE,MAAAA,eAAe,CAACC,SAAhB,CAA0BC,GAA1B,CACC,4CADD;AAGAF,MAAAA,eAAe,CAACG,KAAhB,CAAsBC,QAAtB,GAAiC,UAAjC;AACAJ,MAAAA,eAAe,CAACG,KAAhB,CAAsBjB,KAAtB,GAA8B,MAA9B;AACAY,MAAAA,WAAW,CAACK,KAAZ,CAAkBE,OAAlB,GACCrB,qBAAqB,GAAG,IADzB;AAEA,KAXY,EAWV,EAXU,CAFd;AAcC,uBAdD;AAeC,IAAA,QAAQ,EAAG,CAAC,CAfb;AAgBC,IAAA,KAAK,EAAG;AACPoB,MAAAA,QAAQ,EAAE,UADH;AAEPlB,MAAAA,KAAK,EAAEH,aAFA;AAGPM,MAAAA,MAAM,EAAEC,aAHD;AAIPgB,MAAAA,aAAa,EAAE;AAJR;AAhBT,KAuBGlB,qBAvBH,EAwBC,4BAAC,iBAAD;AAAmB,IAAA,cAAc,EAAG;AAApC,IAxBD,CAPD,CAFD,CADD;AAuCA;;eAEcN,gB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Disabled } from '@wordpress/components';\nimport { useResizeObserver, pure, useRefEffect } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport BlockList from '../block-list';\nimport Iframe from '../iframe';\nimport EditorStyles from '../editor-styles';\nimport { store } from '../../store';\n\n// This is used to avoid rendering the block list if the sizes change.\nlet MemoizedBlockList;\n\nfunction AutoBlockPreview( { viewportWidth, __experimentalPadding } ) {\n\tconst [\n\t\tcontainerResizeListener,\n\t\t{ width: containerWidth },\n\t] = useResizeObserver();\n\tconst [\n\t\tcontentResizeListener,\n\t\t{ height: contentHeight },\n\t] = useResizeObserver();\n\tconst styles = useSelect( ( select ) => {\n\t\treturn select( store ).getSettings().styles;\n\t}, [] );\n\n\t// Initialize on render instead of module top level, to avoid circular dependency issues.\n\tMemoizedBlockList = MemoizedBlockList || pure( BlockList );\n\n\tconst scale = containerWidth / viewportWidth;\n\n\treturn (\n\t\t<div className=\"block-editor-block-preview__container\">\n\t\t\t{ containerResizeListener }\n\t\t\t<Disabled\n\t\t\t\tclassName=\"block-editor-block-preview__content\"\n\t\t\t\tstyle={ {\n\t\t\t\t\ttransform: `scale(${ scale })`,\n\t\t\t\t\theight: contentHeight * scale,\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<Iframe\n\t\t\t\t\thead={ <EditorStyles styles={ styles } /> }\n\t\t\t\t\tcontentRef={ useRefEffect( ( bodyElement ) => {\n\t\t\t\t\t\tconst {\n\t\t\t\t\t\t\townerDocument: { documentElement },\n\t\t\t\t\t\t} = bodyElement;\n\t\t\t\t\t\tdocumentElement.classList.add(\n\t\t\t\t\t\t\t'block-editor-block-preview__content-iframe'\n\t\t\t\t\t\t);\n\t\t\t\t\t\tdocumentElement.style.position = 'absolute';\n\t\t\t\t\t\tdocumentElement.style.width = '100%';\n\t\t\t\t\t\tbodyElement.style.padding =\n\t\t\t\t\t\t\t__experimentalPadding + 'px';\n\t\t\t\t\t}, [] ) }\n\t\t\t\t\taria-hidden\n\t\t\t\t\ttabIndex={ -1 }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t\twidth: viewportWidth,\n\t\t\t\t\t\theight: contentHeight,\n\t\t\t\t\t\tpointerEvents: 'none',\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ contentResizeListener }\n\t\t\t\t\t<MemoizedBlockList renderAppender={ false } />\n\t\t\t\t</Iframe>\n\t\t\t</Disabled>\n\t\t</div>\n\t);\n}\n\nexport default AutoBlockPreview;\n"]}
@@ -52,6 +52,7 @@ function AutoBlockPreview(_ref) {
52
52
  documentElement
53
53
  }
54
54
  } = bodyElement;
55
+ documentElement.classList.add('block-editor-block-preview__content-iframe');
55
56
  documentElement.style.position = 'absolute';
56
57
  documentElement.style.width = '100%';
57
58
  bodyElement.style.padding = __experimentalPadding + 'px';
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/block-preview/auto.js"],"names":["Disabled","useResizeObserver","pure","useRefEffect","useSelect","BlockList","Iframe","EditorStyles","store","MemoizedBlockList","AutoBlockPreview","viewportWidth","__experimentalPadding","containerResizeListener","width","containerWidth","contentResizeListener","height","contentHeight","styles","select","getSettings","scale","transform","bodyElement","ownerDocument","documentElement","style","position","padding","pointerEvents"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,QAAT,QAAyB,uBAAzB;AACA,SAASC,iBAAT,EAA4BC,IAA5B,EAAkCC,YAAlC,QAAsD,oBAAtD;AACA,SAASC,SAAT,QAA0B,iBAA1B;AAEA;AACA;AACA;;AACA,OAAOC,SAAP,MAAsB,eAAtB;AACA,OAAOC,MAAP,MAAmB,WAAnB;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,SAASC,KAAT,QAAsB,aAAtB,C,CAEA;;AACA,IAAIC,iBAAJ;;AAEA,SAASC,gBAAT,OAAsE;AAAA,MAA3C;AAAEC,IAAAA,aAAF;AAAiBC,IAAAA;AAAjB,GAA2C;AACrE,QAAM,CACLC,uBADK,EAEL;AAAEC,IAAAA,KAAK,EAAEC;AAAT,GAFK,IAGFd,iBAAiB,EAHrB;AAIA,QAAM,CACLe,qBADK,EAEL;AAAEC,IAAAA,MAAM,EAAEC;AAAV,GAFK,IAGFjB,iBAAiB,EAHrB;AAIA,QAAMkB,MAAM,GAAGf,SAAS,CAAIgB,MAAF,IAAc;AACvC,WAAOA,MAAM,CAAEZ,KAAF,CAAN,CAAgBa,WAAhB,GAA8BF,MAArC;AACA,GAFuB,EAErB,EAFqB,CAAxB,CATqE,CAarE;;AACAV,EAAAA,iBAAiB,GAAGA,iBAAiB,IAAIP,IAAI,CAAEG,SAAF,CAA7C;AAEA,QAAMiB,KAAK,GAAGP,cAAc,GAAGJ,aAA/B;AAEA,SACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACGE,uBADH,EAEC,cAAC,QAAD;AACC,IAAA,SAAS,EAAC,qCADX;AAEC,IAAA,KAAK,EAAG;AACPU,MAAAA,SAAS,EAAG,SAASD,KAAO,GADrB;AAEPL,MAAAA,MAAM,EAAEC,aAAa,GAAGI;AAFjB;AAFT,KAOC,cAAC,MAAD;AACC,IAAA,IAAI,EAAG,cAAC,YAAD;AAAc,MAAA,MAAM,EAAGH;AAAvB,MADR;AAEC,IAAA,UAAU,EAAGhB,YAAY,CAAIqB,WAAF,IAAmB;AAC7C,YAAM;AACLC,QAAAA,aAAa,EAAE;AAAEC,UAAAA;AAAF;AADV,UAEFF,WAFJ;AAGAE,MAAAA,eAAe,CAACC,KAAhB,CAAsBC,QAAtB,GAAiC,UAAjC;AACAF,MAAAA,eAAe,CAACC,KAAhB,CAAsBb,KAAtB,GAA8B,MAA9B;AACAU,MAAAA,WAAW,CAACG,KAAZ,CAAkBE,OAAlB,GACCjB,qBAAqB,GAAG,IADzB;AAEA,KARwB,EAQtB,EARsB,CAF1B;AAWC,uBAXD;AAYC,IAAA,QAAQ,EAAG,CAAC,CAZb;AAaC,IAAA,KAAK,EAAG;AACPgB,MAAAA,QAAQ,EAAE,UADH;AAEPd,MAAAA,KAAK,EAAEH,aAFA;AAGPM,MAAAA,MAAM,EAAEC,aAHD;AAIPY,MAAAA,aAAa,EAAE;AAJR;AAbT,KAoBGd,qBApBH,EAqBC,cAAC,iBAAD;AAAmB,IAAA,cAAc,EAAG;AAApC,IArBD,CAPD,CAFD,CADD;AAoCA;;AAED,eAAeN,gBAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Disabled } from '@wordpress/components';\nimport { useResizeObserver, pure, useRefEffect } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport BlockList from '../block-list';\nimport Iframe from '../iframe';\nimport EditorStyles from '../editor-styles';\nimport { store } from '../../store';\n\n// This is used to avoid rendering the block list if the sizes change.\nlet MemoizedBlockList;\n\nfunction AutoBlockPreview( { viewportWidth, __experimentalPadding } ) {\n\tconst [\n\t\tcontainerResizeListener,\n\t\t{ width: containerWidth },\n\t] = useResizeObserver();\n\tconst [\n\t\tcontentResizeListener,\n\t\t{ height: contentHeight },\n\t] = useResizeObserver();\n\tconst styles = useSelect( ( select ) => {\n\t\treturn select( store ).getSettings().styles;\n\t}, [] );\n\n\t// Initialize on render instead of module top level, to avoid circular dependency issues.\n\tMemoizedBlockList = MemoizedBlockList || pure( BlockList );\n\n\tconst scale = containerWidth / viewportWidth;\n\n\treturn (\n\t\t<div className=\"block-editor-block-preview__container\">\n\t\t\t{ containerResizeListener }\n\t\t\t<Disabled\n\t\t\t\tclassName=\"block-editor-block-preview__content\"\n\t\t\t\tstyle={ {\n\t\t\t\t\ttransform: `scale(${ scale })`,\n\t\t\t\t\theight: contentHeight * scale,\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<Iframe\n\t\t\t\t\thead={ <EditorStyles styles={ styles } /> }\n\t\t\t\t\tcontentRef={ useRefEffect( ( bodyElement ) => {\n\t\t\t\t\t\tconst {\n\t\t\t\t\t\t\townerDocument: { documentElement },\n\t\t\t\t\t\t} = bodyElement;\n\t\t\t\t\t\tdocumentElement.style.position = 'absolute';\n\t\t\t\t\t\tdocumentElement.style.width = '100%';\n\t\t\t\t\t\tbodyElement.style.padding =\n\t\t\t\t\t\t\t__experimentalPadding + 'px';\n\t\t\t\t\t}, [] ) }\n\t\t\t\t\taria-hidden\n\t\t\t\t\ttabIndex={ -1 }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t\twidth: viewportWidth,\n\t\t\t\t\t\theight: contentHeight,\n\t\t\t\t\t\tpointerEvents: 'none',\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ contentResizeListener }\n\t\t\t\t\t<MemoizedBlockList renderAppender={ false } />\n\t\t\t\t</Iframe>\n\t\t\t</Disabled>\n\t\t</div>\n\t);\n}\n\nexport default AutoBlockPreview;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/block-preview/auto.js"],"names":["Disabled","useResizeObserver","pure","useRefEffect","useSelect","BlockList","Iframe","EditorStyles","store","MemoizedBlockList","AutoBlockPreview","viewportWidth","__experimentalPadding","containerResizeListener","width","containerWidth","contentResizeListener","height","contentHeight","styles","select","getSettings","scale","transform","bodyElement","ownerDocument","documentElement","classList","add","style","position","padding","pointerEvents"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,QAAT,QAAyB,uBAAzB;AACA,SAASC,iBAAT,EAA4BC,IAA5B,EAAkCC,YAAlC,QAAsD,oBAAtD;AACA,SAASC,SAAT,QAA0B,iBAA1B;AAEA;AACA;AACA;;AACA,OAAOC,SAAP,MAAsB,eAAtB;AACA,OAAOC,MAAP,MAAmB,WAAnB;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,SAASC,KAAT,QAAsB,aAAtB,C,CAEA;;AACA,IAAIC,iBAAJ;;AAEA,SAASC,gBAAT,OAAsE;AAAA,MAA3C;AAAEC,IAAAA,aAAF;AAAiBC,IAAAA;AAAjB,GAA2C;AACrE,QAAM,CACLC,uBADK,EAEL;AAAEC,IAAAA,KAAK,EAAEC;AAAT,GAFK,IAGFd,iBAAiB,EAHrB;AAIA,QAAM,CACLe,qBADK,EAEL;AAAEC,IAAAA,MAAM,EAAEC;AAAV,GAFK,IAGFjB,iBAAiB,EAHrB;AAIA,QAAMkB,MAAM,GAAGf,SAAS,CAAIgB,MAAF,IAAc;AACvC,WAAOA,MAAM,CAAEZ,KAAF,CAAN,CAAgBa,WAAhB,GAA8BF,MAArC;AACA,GAFuB,EAErB,EAFqB,CAAxB,CATqE,CAarE;;AACAV,EAAAA,iBAAiB,GAAGA,iBAAiB,IAAIP,IAAI,CAAEG,SAAF,CAA7C;AAEA,QAAMiB,KAAK,GAAGP,cAAc,GAAGJ,aAA/B;AAEA,SACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACGE,uBADH,EAEC,cAAC,QAAD;AACC,IAAA,SAAS,EAAC,qCADX;AAEC,IAAA,KAAK,EAAG;AACPU,MAAAA,SAAS,EAAG,SAASD,KAAO,GADrB;AAEPL,MAAAA,MAAM,EAAEC,aAAa,GAAGI;AAFjB;AAFT,KAOC,cAAC,MAAD;AACC,IAAA,IAAI,EAAG,cAAC,YAAD;AAAc,MAAA,MAAM,EAAGH;AAAvB,MADR;AAEC,IAAA,UAAU,EAAGhB,YAAY,CAAIqB,WAAF,IAAmB;AAC7C,YAAM;AACLC,QAAAA,aAAa,EAAE;AAAEC,UAAAA;AAAF;AADV,UAEFF,WAFJ;AAGAE,MAAAA,eAAe,CAACC,SAAhB,CAA0BC,GAA1B,CACC,4CADD;AAGAF,MAAAA,eAAe,CAACG,KAAhB,CAAsBC,QAAtB,GAAiC,UAAjC;AACAJ,MAAAA,eAAe,CAACG,KAAhB,CAAsBf,KAAtB,GAA8B,MAA9B;AACAU,MAAAA,WAAW,CAACK,KAAZ,CAAkBE,OAAlB,GACCnB,qBAAqB,GAAG,IADzB;AAEA,KAXwB,EAWtB,EAXsB,CAF1B;AAcC,uBAdD;AAeC,IAAA,QAAQ,EAAG,CAAC,CAfb;AAgBC,IAAA,KAAK,EAAG;AACPkB,MAAAA,QAAQ,EAAE,UADH;AAEPhB,MAAAA,KAAK,EAAEH,aAFA;AAGPM,MAAAA,MAAM,EAAEC,aAHD;AAIPc,MAAAA,aAAa,EAAE;AAJR;AAhBT,KAuBGhB,qBAvBH,EAwBC,cAAC,iBAAD;AAAmB,IAAA,cAAc,EAAG;AAApC,IAxBD,CAPD,CAFD,CADD;AAuCA;;AAED,eAAeN,gBAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Disabled } from '@wordpress/components';\nimport { useResizeObserver, pure, useRefEffect } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport BlockList from '../block-list';\nimport Iframe from '../iframe';\nimport EditorStyles from '../editor-styles';\nimport { store } from '../../store';\n\n// This is used to avoid rendering the block list if the sizes change.\nlet MemoizedBlockList;\n\nfunction AutoBlockPreview( { viewportWidth, __experimentalPadding } ) {\n\tconst [\n\t\tcontainerResizeListener,\n\t\t{ width: containerWidth },\n\t] = useResizeObserver();\n\tconst [\n\t\tcontentResizeListener,\n\t\t{ height: contentHeight },\n\t] = useResizeObserver();\n\tconst styles = useSelect( ( select ) => {\n\t\treturn select( store ).getSettings().styles;\n\t}, [] );\n\n\t// Initialize on render instead of module top level, to avoid circular dependency issues.\n\tMemoizedBlockList = MemoizedBlockList || pure( BlockList );\n\n\tconst scale = containerWidth / viewportWidth;\n\n\treturn (\n\t\t<div className=\"block-editor-block-preview__container\">\n\t\t\t{ containerResizeListener }\n\t\t\t<Disabled\n\t\t\t\tclassName=\"block-editor-block-preview__content\"\n\t\t\t\tstyle={ {\n\t\t\t\t\ttransform: `scale(${ scale })`,\n\t\t\t\t\theight: contentHeight * scale,\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<Iframe\n\t\t\t\t\thead={ <EditorStyles styles={ styles } /> }\n\t\t\t\t\tcontentRef={ useRefEffect( ( bodyElement ) => {\n\t\t\t\t\t\tconst {\n\t\t\t\t\t\t\townerDocument: { documentElement },\n\t\t\t\t\t\t} = bodyElement;\n\t\t\t\t\t\tdocumentElement.classList.add(\n\t\t\t\t\t\t\t'block-editor-block-preview__content-iframe'\n\t\t\t\t\t\t);\n\t\t\t\t\t\tdocumentElement.style.position = 'absolute';\n\t\t\t\t\t\tdocumentElement.style.width = '100%';\n\t\t\t\t\t\tbodyElement.style.padding =\n\t\t\t\t\t\t\t__experimentalPadding + 'px';\n\t\t\t\t\t}, [] ) }\n\t\t\t\t\taria-hidden\n\t\t\t\t\ttabIndex={ -1 }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t\twidth: viewportWidth,\n\t\t\t\t\t\theight: contentHeight,\n\t\t\t\t\t\tpointerEvents: 'none',\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ contentResizeListener }\n\t\t\t\t\t<MemoizedBlockList renderAppender={ false } />\n\t\t\t\t</Iframe>\n\t\t\t</Disabled>\n\t\t</div>\n\t);\n}\n\nexport default AutoBlockPreview;\n"]}
@@ -1184,6 +1184,10 @@
1184
1184
  display: none;
1185
1185
  }
1186
1186
 
1187
+ .block-editor-block-preview__content-iframe .block-list-appender {
1188
+ display: none;
1189
+ }
1190
+
1187
1191
  .block-editor-block-settings-menu__popover .components-dropdown-menu__menu {
1188
1192
  padding: 0;
1189
1193
  }
@@ -1184,6 +1184,10 @@
1184
1184
  display: none;
1185
1185
  }
1186
1186
 
1187
+ .block-editor-block-preview__content-iframe .block-list-appender {
1188
+ display: none;
1189
+ }
1190
+
1187
1191
  .block-editor-block-settings-menu__popover .components-dropdown-menu__menu {
1188
1192
  padding: 0;
1189
1193
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-editor",
3
- "version": "8.0.4",
3
+ "version": "8.0.5",
4
4
  "description": "Generic block editor.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -38,7 +38,7 @@
38
38
  "@wordpress/blob": "^3.2.2",
39
39
  "@wordpress/block-serialization-default-parser": "^4.2.3",
40
40
  "@wordpress/blocks": "^11.1.4",
41
- "@wordpress/components": "^19.0.4",
41
+ "@wordpress/components": "^19.0.5",
42
42
  "@wordpress/compose": "^5.0.6",
43
43
  "@wordpress/data": "^6.1.4",
44
44
  "@wordpress/deprecated": "^3.2.3",
@@ -75,5 +75,5 @@
75
75
  "publishConfig": {
76
76
  "access": "public"
77
77
  },
78
- "gitHead": "ca22e8852fcc91889510e417bdaa180ad60f8dac"
78
+ "gitHead": "518e7a279a0f596612232c55c83a351460f8816d"
79
79
  }
@@ -50,6 +50,9 @@ function AutoBlockPreview( { viewportWidth, __experimentalPadding } ) {
50
50
  const {
51
51
  ownerDocument: { documentElement },
52
52
  } = bodyElement;
53
+ documentElement.classList.add(
54
+ 'block-editor-block-preview__content-iframe'
55
+ );
53
56
  documentElement.style.position = 'absolute';
54
57
  documentElement.style.width = '100%';
55
58
  bodyElement.style.padding =
@@ -36,3 +36,8 @@
36
36
  }
37
37
  }
38
38
  }
39
+
40
+ // Hide inserter from previews.
41
+ .block-editor-block-preview__content-iframe .block-list-appender {
42
+ display: none;
43
+ }