@wordpress/edit-widgets 6.13.1-next.cd6172eb0.0 → 6.15.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 +4 -0
- package/LICENSE.md +1 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +1 -0
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/shortcut.js +1 -0
- package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build/components/notices/index.js +1 -0
- package/build/components/notices/index.js.map +1 -1
- package/build/components/secondary-sidebar/inserter-sidebar.js +5 -16
- package/build/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
- package/build/components/welcome-guide/index.js +4 -3
- package/build/components/welcome-guide/index.js.map +1 -1
- package/build/index.js +1 -0
- package/build/index.js.map +1 -1
- package/build/store/actions.js +1 -0
- package/build/store/actions.js.map +1 -1
- package/build/store/selectors.js +1 -0
- package/build/store/selectors.js.map +1 -1
- package/build/store/transformers.js +1 -1
- package/build/store/transformers.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +1 -0
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +1 -0
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build-module/components/notices/index.js +1 -0
- package/build-module/components/notices/index.js.map +1 -1
- package/build-module/components/secondary-sidebar/inserter-sidebar.js +6 -17
- package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
- package/build-module/components/welcome-guide/index.js +4 -3
- package/build-module/components/welcome-guide/index.js.map +1 -1
- package/build-module/index.js +1 -0
- package/build-module/index.js.map +1 -1
- package/build-module/store/actions.js +1 -0
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/selectors.js +1 -0
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/store/transformers.js +1 -1
- package/build-module/store/transformers.js.map +1 -1
- package/build-style/style-rtl.css +4 -17
- package/build-style/style.css +4 -17
- package/package.json +28 -28
- package/src/components/layout/style.scss +0 -7
- package/src/components/secondary-sidebar/inserter-sidebar.js +1 -12
- package/src/components/welcome-guide/index.js +3 -3
- package/src/store/transformers.js +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createBlock","parse","serialize","addWidgetIdToBlock","transformWidgetToBlock","widget","id_base","parsedBlocks","instance","raw","content","__unstableSkipAutop","length","id","attributes","_embedded","about","is_multi","idBase","transformBlockToWidget","block","relatedWidget","isValidLegacyWidgetBlock","name","_block$attributes$id","_block$attributes$idB","_block$attributes$ins","rendered","rendered_form"],"sources":["@wordpress/edit-widgets/src/store/transformers.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createBlock, parse, serialize } from '@wordpress/blocks';\nimport { addWidgetIdToBlock } from '@wordpress/widgets';\n\n/**\n * Converts a widget entity record into a block.\n *\n * @param {Object} widget The widget entity record.\n * @return {Object} a block (converted from the entity record).\n */\nexport function transformWidgetToBlock( widget ) {\n\tif ( widget.id_base === 'block' ) {\n\t\tconst parsedBlocks = parse( widget.instance.raw.content, {\n\t\t\t__unstableSkipAutop: true,\n\t\t} );\n\t\tif ( ! parsedBlocks.length ) {\n\t\t\treturn addWidgetIdToBlock(\n\t\t\t\tcreateBlock( 'core/paragraph', {}, [] ),\n\t\t\t\twidget.id\n\t\t\t);\n\t\t}\n\t\treturn addWidgetIdToBlock( parsedBlocks[ 0 ], widget.id );\n\t}\n\n\tlet attributes;\n\tif ( widget._embedded.about[ 0 ].is_multi ) {\n\t\tattributes = {\n\t\t\tidBase: widget.id_base,\n\t\t\tinstance: widget.instance,\n\t\t};\n\t} else {\n\t\tattributes = {\n\t\t\tid: widget.id,\n\t\t};\n\t}\n\n\treturn addWidgetIdToBlock(\n\t\tcreateBlock( 'core/legacy-widget', attributes, [] ),\n\t\twidget.id\n\t);\n}\n\n/**\n * Converts a block to a widget entity record.\n *\n * @param {Object} block The block.\n * @param {Object
|
|
1
|
+
{"version":3,"names":["createBlock","parse","serialize","addWidgetIdToBlock","transformWidgetToBlock","widget","id_base","parsedBlocks","instance","raw","content","__unstableSkipAutop","length","id","attributes","_embedded","about","is_multi","idBase","transformBlockToWidget","block","relatedWidget","isValidLegacyWidgetBlock","name","_block$attributes$id","_block$attributes$idB","_block$attributes$ins","rendered","rendered_form"],"sources":["@wordpress/edit-widgets/src/store/transformers.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createBlock, parse, serialize } from '@wordpress/blocks';\nimport { addWidgetIdToBlock } from '@wordpress/widgets';\n\n/**\n * Converts a widget entity record into a block.\n *\n * @param {Object} widget The widget entity record.\n * @return {Object} a block (converted from the entity record).\n */\nexport function transformWidgetToBlock( widget ) {\n\tif ( widget.id_base === 'block' ) {\n\t\tconst parsedBlocks = parse( widget.instance.raw.content, {\n\t\t\t__unstableSkipAutop: true,\n\t\t} );\n\t\tif ( ! parsedBlocks.length ) {\n\t\t\treturn addWidgetIdToBlock(\n\t\t\t\tcreateBlock( 'core/paragraph', {}, [] ),\n\t\t\t\twidget.id\n\t\t\t);\n\t\t}\n\t\treturn addWidgetIdToBlock( parsedBlocks[ 0 ], widget.id );\n\t}\n\n\tlet attributes;\n\tif ( widget._embedded.about[ 0 ].is_multi ) {\n\t\tattributes = {\n\t\t\tidBase: widget.id_base,\n\t\t\tinstance: widget.instance,\n\t\t};\n\t} else {\n\t\tattributes = {\n\t\t\tid: widget.id,\n\t\t};\n\t}\n\n\treturn addWidgetIdToBlock(\n\t\tcreateBlock( 'core/legacy-widget', attributes, [] ),\n\t\twidget.id\n\t);\n}\n\n/**\n * Converts a block to a widget entity record.\n *\n * @param {Object} block The block.\n * @param {?Object} relatedWidget A related widget entity record from the API (optional).\n * @return {Object} the widget object (converted from block).\n */\nexport function transformBlockToWidget( block, relatedWidget = {} ) {\n\tlet widget;\n\n\tconst isValidLegacyWidgetBlock =\n\t\tblock.name === 'core/legacy-widget' &&\n\t\t( block.attributes.id || block.attributes.instance );\n\n\tif ( isValidLegacyWidgetBlock ) {\n\t\twidget = {\n\t\t\t...relatedWidget,\n\t\t\tid: block.attributes.id ?? relatedWidget.id,\n\t\t\tid_base: block.attributes.idBase ?? relatedWidget.id_base,\n\t\t\tinstance: block.attributes.instance ?? relatedWidget.instance,\n\t\t};\n\t} else {\n\t\twidget = {\n\t\t\t...relatedWidget,\n\t\t\tid_base: 'block',\n\t\t\tinstance: {\n\t\t\t\traw: {\n\t\t\t\t\tcontent: serialize( block ),\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\t}\n\n\t// Delete read-only properties.\n\tdelete widget.rendered;\n\tdelete widget.rendered_form;\n\n\treturn widget;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,KAAK,EAAEC,SAAS,QAAQ,mBAAmB;AACjE,SAASC,kBAAkB,QAAQ,oBAAoB;;AAEvD;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,sBAAsBA,CAAEC,MAAM,EAAG;EAChD,IAAKA,MAAM,CAACC,OAAO,KAAK,OAAO,EAAG;IACjC,MAAMC,YAAY,GAAGN,KAAK,CAAEI,MAAM,CAACG,QAAQ,CAACC,GAAG,CAACC,OAAO,EAAE;MACxDC,mBAAmB,EAAE;IACtB,CAAE,CAAC;IACH,IAAK,CAAEJ,YAAY,CAACK,MAAM,EAAG;MAC5B,OAAOT,kBAAkB,CACxBH,WAAW,CAAE,gBAAgB,EAAE,CAAC,CAAC,EAAE,EAAG,CAAC,EACvCK,MAAM,CAACQ,EACR,CAAC;IACF;IACA,OAAOV,kBAAkB,CAAEI,YAAY,CAAE,CAAC,CAAE,EAAEF,MAAM,CAACQ,EAAG,CAAC;EAC1D;EAEA,IAAIC,UAAU;EACd,IAAKT,MAAM,CAACU,SAAS,CAACC,KAAK,CAAE,CAAC,CAAE,CAACC,QAAQ,EAAG;IAC3CH,UAAU,GAAG;MACZI,MAAM,EAAEb,MAAM,CAACC,OAAO;MACtBE,QAAQ,EAAEH,MAAM,CAACG;IAClB,CAAC;EACF,CAAC,MAAM;IACNM,UAAU,GAAG;MACZD,EAAE,EAAER,MAAM,CAACQ;IACZ,CAAC;EACF;EAEA,OAAOV,kBAAkB,CACxBH,WAAW,CAAE,oBAAoB,EAAEc,UAAU,EAAE,EAAG,CAAC,EACnDT,MAAM,CAACQ,EACR,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASM,sBAAsBA,CAAEC,KAAK,EAAEC,aAAa,GAAG,CAAC,CAAC,EAAG;EACnE,IAAIhB,MAAM;EAEV,MAAMiB,wBAAwB,GAC7BF,KAAK,CAACG,IAAI,KAAK,oBAAoB,KACjCH,KAAK,CAACN,UAAU,CAACD,EAAE,IAAIO,KAAK,CAACN,UAAU,CAACN,QAAQ,CAAE;EAErD,IAAKc,wBAAwB,EAAG;IAAA,IAAAE,oBAAA,EAAAC,qBAAA,EAAAC,qBAAA;IAC/BrB,MAAM,GAAG;MACR,GAAGgB,aAAa;MAChBR,EAAE,GAAAW,oBAAA,GAAEJ,KAAK,CAACN,UAAU,CAACD,EAAE,cAAAW,oBAAA,cAAAA,oBAAA,GAAIH,aAAa,CAACR,EAAE;MAC3CP,OAAO,GAAAmB,qBAAA,GAAEL,KAAK,CAACN,UAAU,CAACI,MAAM,cAAAO,qBAAA,cAAAA,qBAAA,GAAIJ,aAAa,CAACf,OAAO;MACzDE,QAAQ,GAAAkB,qBAAA,GAAEN,KAAK,CAACN,UAAU,CAACN,QAAQ,cAAAkB,qBAAA,cAAAA,qBAAA,GAAIL,aAAa,CAACb;IACtD,CAAC;EACF,CAAC,MAAM;IACNH,MAAM,GAAG;MACR,GAAGgB,aAAa;MAChBf,OAAO,EAAE,OAAO;MAChBE,QAAQ,EAAE;QACTC,GAAG,EAAE;UACJC,OAAO,EAAER,SAAS,CAAEkB,KAAM;QAC3B;MACD;IACD,CAAC;EACF;;EAEA;EACA,OAAOf,MAAM,CAACsB,QAAQ;EACtB,OAAOtB,MAAM,CAACuB,aAAa;EAE3B,OAAOvB,MAAM;AACd","ignoreList":[]}
|
|
@@ -248,8 +248,7 @@ html.interface-interface-skeleton__html-container {
|
|
|
248
248
|
overflow: hidden;
|
|
249
249
|
}
|
|
250
250
|
|
|
251
|
-
.interface-interface-skeleton {
|
|
252
|
-
/* Set left position when auto-fold is not on the body element. */
|
|
251
|
+
.interface-interface-skeleton { /* Set left position when auto-fold is not on the body element. */
|
|
253
252
|
right: 0;
|
|
254
253
|
}
|
|
255
254
|
@media (min-width: 783px) {
|
|
@@ -258,9 +257,7 @@ html.interface-interface-skeleton__html-container {
|
|
|
258
257
|
}
|
|
259
258
|
}
|
|
260
259
|
|
|
261
|
-
.auto-fold .interface-interface-skeleton {
|
|
262
|
-
/* Auto fold is when on smaller breakpoints, nav menu auto collapses. */
|
|
263
|
-
}
|
|
260
|
+
.auto-fold .interface-interface-skeleton { /* Auto fold is when on smaller breakpoints, nav menu auto collapses. */ }
|
|
264
261
|
@media (min-width: 783px) {
|
|
265
262
|
.auto-fold .interface-interface-skeleton {
|
|
266
263
|
right: 36px;
|
|
@@ -703,8 +700,7 @@ body.is-dragging-components-draggable .wp-block[data-type="core/widget-area"] .c
|
|
|
703
700
|
padding-left: 16px;
|
|
704
701
|
}
|
|
705
702
|
|
|
706
|
-
.edit-widgets-notices__snackbar {
|
|
707
|
-
/* Set left position when auto-fold is not on the body element. */
|
|
703
|
+
.edit-widgets-notices__snackbar { /* Set left position when auto-fold is not on the body element. */
|
|
708
704
|
right: 0;
|
|
709
705
|
}
|
|
710
706
|
@media (min-width: 783px) {
|
|
@@ -713,9 +709,7 @@ body.is-dragging-components-draggable .wp-block[data-type="core/widget-area"] .c
|
|
|
713
709
|
}
|
|
714
710
|
}
|
|
715
711
|
|
|
716
|
-
.auto-fold .edit-widgets-notices__snackbar {
|
|
717
|
-
/* Auto fold is when on smaller breakpoints, nav menu auto collapses. */
|
|
718
|
-
}
|
|
712
|
+
.auto-fold .edit-widgets-notices__snackbar { /* Auto fold is when on smaller breakpoints, nav menu auto collapses. */ }
|
|
719
713
|
@media (min-width: 783px) {
|
|
720
714
|
.auto-fold .edit-widgets-notices__snackbar {
|
|
721
715
|
right: 36px;
|
|
@@ -762,13 +756,6 @@ body.is-fullscreen-mode .edit-widgets-notices__snackbar {
|
|
|
762
756
|
overflow: hidden;
|
|
763
757
|
}
|
|
764
758
|
|
|
765
|
-
.edit-widgets-layout__inserter-panel-header {
|
|
766
|
-
padding-top: 8px;
|
|
767
|
-
padding-left: 8px;
|
|
768
|
-
display: flex;
|
|
769
|
-
justify-content: flex-end;
|
|
770
|
-
}
|
|
771
|
-
|
|
772
759
|
.edit-widgets-layout__inserter-panel-content {
|
|
773
760
|
height: calc(100% - 36px - 8px);
|
|
774
761
|
}
|
package/build-style/style.css
CHANGED
|
@@ -248,8 +248,7 @@ html.interface-interface-skeleton__html-container {
|
|
|
248
248
|
overflow: hidden;
|
|
249
249
|
}
|
|
250
250
|
|
|
251
|
-
.interface-interface-skeleton {
|
|
252
|
-
/* Set left position when auto-fold is not on the body element. */
|
|
251
|
+
.interface-interface-skeleton { /* Set left position when auto-fold is not on the body element. */
|
|
253
252
|
left: 0;
|
|
254
253
|
}
|
|
255
254
|
@media (min-width: 783px) {
|
|
@@ -258,9 +257,7 @@ html.interface-interface-skeleton__html-container {
|
|
|
258
257
|
}
|
|
259
258
|
}
|
|
260
259
|
|
|
261
|
-
.auto-fold .interface-interface-skeleton {
|
|
262
|
-
/* Auto fold is when on smaller breakpoints, nav menu auto collapses. */
|
|
263
|
-
}
|
|
260
|
+
.auto-fold .interface-interface-skeleton { /* Auto fold is when on smaller breakpoints, nav menu auto collapses. */ }
|
|
264
261
|
@media (min-width: 783px) {
|
|
265
262
|
.auto-fold .interface-interface-skeleton {
|
|
266
263
|
left: 36px;
|
|
@@ -703,8 +700,7 @@ body.is-dragging-components-draggable .wp-block[data-type="core/widget-area"] .c
|
|
|
703
700
|
padding-right: 16px;
|
|
704
701
|
}
|
|
705
702
|
|
|
706
|
-
.edit-widgets-notices__snackbar {
|
|
707
|
-
/* Set left position when auto-fold is not on the body element. */
|
|
703
|
+
.edit-widgets-notices__snackbar { /* Set left position when auto-fold is not on the body element. */
|
|
708
704
|
left: 0;
|
|
709
705
|
}
|
|
710
706
|
@media (min-width: 783px) {
|
|
@@ -713,9 +709,7 @@ body.is-dragging-components-draggable .wp-block[data-type="core/widget-area"] .c
|
|
|
713
709
|
}
|
|
714
710
|
}
|
|
715
711
|
|
|
716
|
-
.auto-fold .edit-widgets-notices__snackbar {
|
|
717
|
-
/* Auto fold is when on smaller breakpoints, nav menu auto collapses. */
|
|
718
|
-
}
|
|
712
|
+
.auto-fold .edit-widgets-notices__snackbar { /* Auto fold is when on smaller breakpoints, nav menu auto collapses. */ }
|
|
719
713
|
@media (min-width: 783px) {
|
|
720
714
|
.auto-fold .edit-widgets-notices__snackbar {
|
|
721
715
|
left: 36px;
|
|
@@ -762,13 +756,6 @@ body.is-fullscreen-mode .edit-widgets-notices__snackbar {
|
|
|
762
756
|
overflow: hidden;
|
|
763
757
|
}
|
|
764
758
|
|
|
765
|
-
.edit-widgets-layout__inserter-panel-header {
|
|
766
|
-
padding-top: 8px;
|
|
767
|
-
padding-right: 8px;
|
|
768
|
-
display: flex;
|
|
769
|
-
justify-content: flex-end;
|
|
770
|
-
}
|
|
771
|
-
|
|
772
759
|
.edit-widgets-layout__inserter-panel-content {
|
|
773
760
|
height: calc(100% - 36px - 8px);
|
|
774
761
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/edit-widgets",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.15.0",
|
|
4
4
|
"description": "Widgets Page module for WordPress..",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -29,32 +29,32 @@
|
|
|
29
29
|
"wpScript": true,
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@babel/runtime": "7.25.7",
|
|
32
|
-
"@wordpress/api-fetch": "^7.
|
|
33
|
-
"@wordpress/block-editor": "^14.
|
|
34
|
-
"@wordpress/block-library": "^9.
|
|
35
|
-
"@wordpress/blocks": "^14.
|
|
36
|
-
"@wordpress/components": "
|
|
37
|
-
"@wordpress/compose": "^7.
|
|
38
|
-
"@wordpress/core-data": "^7.
|
|
39
|
-
"@wordpress/data": "^10.
|
|
40
|
-
"@wordpress/deprecated": "^4.
|
|
41
|
-
"@wordpress/dom": "^4.
|
|
42
|
-
"@wordpress/element": "^6.
|
|
43
|
-
"@wordpress/hooks": "^4.
|
|
44
|
-
"@wordpress/i18n": "^5.
|
|
45
|
-
"@wordpress/icons": "^10.
|
|
46
|
-
"@wordpress/interface": "^
|
|
47
|
-
"@wordpress/keyboard-shortcuts": "^5.
|
|
48
|
-
"@wordpress/keycodes": "^4.
|
|
49
|
-
"@wordpress/media-utils": "^5.
|
|
50
|
-
"@wordpress/notices": "^5.
|
|
51
|
-
"@wordpress/patterns": "^2.
|
|
52
|
-
"@wordpress/plugins": "^7.
|
|
53
|
-
"@wordpress/preferences": "^4.
|
|
54
|
-
"@wordpress/private-apis": "^1.
|
|
55
|
-
"@wordpress/reusable-blocks": "^5.
|
|
56
|
-
"@wordpress/url": "^4.
|
|
57
|
-
"@wordpress/widgets": "^4.
|
|
32
|
+
"@wordpress/api-fetch": "^7.15.0",
|
|
33
|
+
"@wordpress/block-editor": "^14.10.0",
|
|
34
|
+
"@wordpress/block-library": "^9.15.0",
|
|
35
|
+
"@wordpress/blocks": "^14.4.0",
|
|
36
|
+
"@wordpress/components": "^29.1.0",
|
|
37
|
+
"@wordpress/compose": "^7.15.0",
|
|
38
|
+
"@wordpress/core-data": "^7.15.0",
|
|
39
|
+
"@wordpress/data": "^10.15.0",
|
|
40
|
+
"@wordpress/deprecated": "^4.15.0",
|
|
41
|
+
"@wordpress/dom": "^4.15.0",
|
|
42
|
+
"@wordpress/element": "^6.15.0",
|
|
43
|
+
"@wordpress/hooks": "^4.15.0",
|
|
44
|
+
"@wordpress/i18n": "^5.15.0",
|
|
45
|
+
"@wordpress/icons": "^10.15.0",
|
|
46
|
+
"@wordpress/interface": "^9.0.0",
|
|
47
|
+
"@wordpress/keyboard-shortcuts": "^5.15.0",
|
|
48
|
+
"@wordpress/keycodes": "^4.15.0",
|
|
49
|
+
"@wordpress/media-utils": "^5.15.0",
|
|
50
|
+
"@wordpress/notices": "^5.15.0",
|
|
51
|
+
"@wordpress/patterns": "^2.15.0",
|
|
52
|
+
"@wordpress/plugins": "^7.15.0",
|
|
53
|
+
"@wordpress/preferences": "^4.15.0",
|
|
54
|
+
"@wordpress/private-apis": "^1.15.0",
|
|
55
|
+
"@wordpress/reusable-blocks": "^5.15.0",
|
|
56
|
+
"@wordpress/url": "^4.15.0",
|
|
57
|
+
"@wordpress/widgets": "^4.15.0",
|
|
58
58
|
"clsx": "^2.1.1"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"publishConfig": {
|
|
65
65
|
"access": "public"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "75a65eb8ffc168a92042544052f46d080a71ea45"
|
|
68
68
|
}
|
|
@@ -7,13 +7,6 @@
|
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
.edit-widgets-layout__inserter-panel-header {
|
|
11
|
-
padding-top: $grid-unit-10;
|
|
12
|
-
padding-right: $grid-unit-10;
|
|
13
|
-
display: flex;
|
|
14
|
-
justify-content: flex-end;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
10
|
.edit-widgets-layout__inserter-panel-content {
|
|
18
11
|
// Leave space for the close button
|
|
19
12
|
height: calc(100% - #{$button-size} - #{$grid-unit-10});
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { Button, VisuallyHidden } from '@wordpress/components';
|
|
5
|
-
import { close } from '@wordpress/icons';
|
|
6
4
|
import { __experimentalLibrary as Library } from '@wordpress/block-editor';
|
|
7
5
|
import {
|
|
8
6
|
useViewportMatch,
|
|
@@ -10,7 +8,6 @@ import {
|
|
|
10
8
|
} from '@wordpress/compose';
|
|
11
9
|
import { useCallback, useRef } from '@wordpress/element';
|
|
12
10
|
import { useDispatch } from '@wordpress/data';
|
|
13
|
-
import { __ } from '@wordpress/i18n';
|
|
14
11
|
|
|
15
12
|
/**
|
|
16
13
|
* Internal dependencies
|
|
@@ -28,7 +25,6 @@ export default function InserterSidebar() {
|
|
|
28
25
|
return setIsInserterOpened( false );
|
|
29
26
|
}, [ setIsInserterOpened ] );
|
|
30
27
|
|
|
31
|
-
const TagName = ! isMobileViewport ? VisuallyHidden : 'div';
|
|
32
28
|
const [ inserterDialogRef, inserterDialogProps ] = useDialog( {
|
|
33
29
|
onClose: closeInserter,
|
|
34
30
|
focusOnMount: true,
|
|
@@ -42,14 +38,6 @@ export default function InserterSidebar() {
|
|
|
42
38
|
{ ...inserterDialogProps }
|
|
43
39
|
className="edit-widgets-layout__inserter-panel"
|
|
44
40
|
>
|
|
45
|
-
<TagName className="edit-widgets-layout__inserter-panel-header">
|
|
46
|
-
<Button
|
|
47
|
-
__next40pxDefaultSize
|
|
48
|
-
icon={ close }
|
|
49
|
-
onClick={ closeInserter }
|
|
50
|
-
label={ __( 'Close Block Inserter' ) }
|
|
51
|
-
/>
|
|
52
|
-
</TagName>
|
|
53
41
|
<div className="edit-widgets-layout__inserter-panel-content">
|
|
54
42
|
<Library
|
|
55
43
|
showInserterHelpPanel
|
|
@@ -57,6 +45,7 @@ export default function InserterSidebar() {
|
|
|
57
45
|
rootClientId={ rootClientId }
|
|
58
46
|
__experimentalInsertionIndex={ insertionIndex }
|
|
59
47
|
ref={ libraryRef }
|
|
48
|
+
onClose={ closeInserter }
|
|
60
49
|
/>
|
|
61
50
|
</div>
|
|
62
51
|
</div>
|
|
@@ -118,7 +118,7 @@ export default function WelcomeGuide() {
|
|
|
118
118
|
content: (
|
|
119
119
|
<>
|
|
120
120
|
<h1 className="edit-widgets-welcome-guide__heading">
|
|
121
|
-
{ __( '
|
|
121
|
+
{ __( 'Customize each block' ) }
|
|
122
122
|
</h1>
|
|
123
123
|
<p className="edit-widgets-welcome-guide__text">
|
|
124
124
|
{ __(
|
|
@@ -138,7 +138,7 @@ export default function WelcomeGuide() {
|
|
|
138
138
|
content: (
|
|
139
139
|
<>
|
|
140
140
|
<h1 className="edit-widgets-welcome-guide__heading">
|
|
141
|
-
{ __( '
|
|
141
|
+
{ __( 'Explore all blocks' ) }
|
|
142
142
|
</h1>
|
|
143
143
|
<p className="edit-widgets-welcome-guide__text">
|
|
144
144
|
{ createInterpolateElement(
|
|
@@ -169,7 +169,7 @@ export default function WelcomeGuide() {
|
|
|
169
169
|
content: (
|
|
170
170
|
<>
|
|
171
171
|
<h1 className="edit-widgets-welcome-guide__heading">
|
|
172
|
-
{ __( 'Learn
|
|
172
|
+
{ __( 'Learn more' ) }
|
|
173
173
|
</h1>
|
|
174
174
|
<p className="edit-widgets-welcome-guide__text">
|
|
175
175
|
{ createInterpolateElement(
|
|
@@ -46,7 +46,7 @@ export function transformWidgetToBlock( widget ) {
|
|
|
46
46
|
* Converts a block to a widget entity record.
|
|
47
47
|
*
|
|
48
48
|
* @param {Object} block The block.
|
|
49
|
-
* @param {Object
|
|
49
|
+
* @param {?Object} relatedWidget A related widget entity record from the API (optional).
|
|
50
50
|
* @return {Object} the widget object (converted from block).
|
|
51
51
|
*/
|
|
52
52
|
export function transformBlockToWidget( block, relatedWidget = {} ) {
|