@wordpress/block-directory 3.10.0 → 3.13.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 +6 -0
- package/build/components/downloadable-blocks-panel/no-results.js +2 -2
- package/build/components/downloadable-blocks-panel/no-results.js.map +1 -1
- package/build-module/components/downloadable-blocks-panel/no-results.js +2 -2
- package/build-module/components/downloadable-blocks-panel/no-results.js.map +1 -1
- package/package.json +20 -20
- package/src/components/downloadable-block-list-item/test/index.js +16 -12
- package/src/components/downloadable-blocks-panel/no-results.js +5 -8
package/CHANGELOG.md
CHANGED
|
@@ -24,9 +24,9 @@ function DownloadableBlocksNoResults() {
|
|
|
24
24
|
icon: _icons.blockDefault
|
|
25
25
|
}), (0, _element.createElement)("p", null, (0, _i18n.__)('No results found.'))), (0, _element.createElement)("div", {
|
|
26
26
|
className: "block-editor-inserter__tips"
|
|
27
|
-
}, (0, _element.createElement)(_components.Tip, null, (0,
|
|
27
|
+
}, (0, _element.createElement)(_components.Tip, null, (0, _i18n.__)('Interested in creating your own block?'), (0, _element.createElement)("br", null), (0, _element.createElement)(_components.ExternalLink, {
|
|
28
28
|
href: "https://developer.wordpress.org/block-editor/"
|
|
29
|
-
}, (0, _i18n.__)('Get started here'), "."))))
|
|
29
|
+
}, (0, _i18n.__)('Get started here'), "."))));
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
var _default = DownloadableBlocksNoResults;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-directory/src/components/downloadable-blocks-panel/no-results.js"],"names":["DownloadableBlocksNoResults","blockDefault"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AALA;AACA;AACA;AAKA,SAASA,2BAAT,GAAuC;AACtC,SACC,qDACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,WAAD;AACC,IAAA,SAAS,EAAC,wCADX;AAEC,IAAA,IAAI,EAAGC;AAFR,IADD,EAKC,uCAAK,cAAI,mBAAJ,CAAL,CALD,CADD,EAQC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,eAAD,
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-directory/src/components/downloadable-blocks-panel/no-results.js"],"names":["DownloadableBlocksNoResults","blockDefault"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AALA;AACA;AACA;AAKA,SAASA,2BAAT,GAAuC;AACtC,SACC,qDACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,WAAD;AACC,IAAA,SAAS,EAAC,wCADX;AAEC,IAAA,IAAI,EAAGC;AAFR,IADD,EAKC,uCAAK,cAAI,mBAAJ,CAAL,CALD,CADD,EAQC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,eAAD,QACG,cAAI,wCAAJ,CADH,EAEC,uCAFD,EAGC,4BAAC,wBAAD;AAAc,IAAA,IAAI,EAAC;AAAnB,KACG,cAAI,kBAAJ,CADH,MAHD,CADD,CARD,CADD;AAoBA;;eAEcD,2B","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Icon, blockDefault } from '@wordpress/icons';\nimport { Tip, ExternalLink } from '@wordpress/components';\n\nfunction DownloadableBlocksNoResults() {\n\treturn (\n\t\t<>\n\t\t\t<div className=\"block-editor-inserter__no-results\">\n\t\t\t\t<Icon\n\t\t\t\t\tclassName=\"block-editor-inserter__no-results-icon\"\n\t\t\t\t\ticon={ blockDefault }\n\t\t\t\t/>\n\t\t\t\t<p>{ __( 'No results found.' ) }</p>\n\t\t\t</div>\n\t\t\t<div className=\"block-editor-inserter__tips\">\n\t\t\t\t<Tip>\n\t\t\t\t\t{ __( 'Interested in creating your own block?' ) }\n\t\t\t\t\t<br />\n\t\t\t\t\t<ExternalLink href=\"https://developer.wordpress.org/block-editor/\">\n\t\t\t\t\t\t{ __( 'Get started here' ) }.\n\t\t\t\t\t</ExternalLink>\n\t\t\t\t</Tip>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default DownloadableBlocksNoResults;\n"]}
|
|
@@ -15,9 +15,9 @@ function DownloadableBlocksNoResults() {
|
|
|
15
15
|
icon: blockDefault
|
|
16
16
|
}), createElement("p", null, __('No results found.'))), createElement("div", {
|
|
17
17
|
className: "block-editor-inserter__tips"
|
|
18
|
-
}, createElement(Tip, null,
|
|
18
|
+
}, createElement(Tip, null, __('Interested in creating your own block?'), createElement("br", null), createElement(ExternalLink, {
|
|
19
19
|
href: "https://developer.wordpress.org/block-editor/"
|
|
20
|
-
}, __('Get started here'), "."))))
|
|
20
|
+
}, __('Get started here'), "."))));
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
export default DownloadableBlocksNoResults;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-directory/src/components/downloadable-blocks-panel/no-results.js"],"names":["__","Icon","blockDefault","Tip","ExternalLink","DownloadableBlocksNoResults"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,IAAT,EAAeC,YAAf,QAAmC,kBAAnC;AACA,SAASC,GAAT,EAAcC,YAAd,QAAkC,uBAAlC;;AAEA,SAASC,2BAAT,GAAuC;AACtC,SACC,8BACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,cAAC,IAAD;AACC,IAAA,SAAS,EAAC,wCADX;AAEC,IAAA,IAAI,EAAGH;AAFR,IADD,EAKC,yBAAKF,EAAE,CAAE,mBAAF,CAAP,CALD,CADD,EAQC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,cAAC,GAAD,
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-directory/src/components/downloadable-blocks-panel/no-results.js"],"names":["__","Icon","blockDefault","Tip","ExternalLink","DownloadableBlocksNoResults"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,IAAT,EAAeC,YAAf,QAAmC,kBAAnC;AACA,SAASC,GAAT,EAAcC,YAAd,QAAkC,uBAAlC;;AAEA,SAASC,2BAAT,GAAuC;AACtC,SACC,8BACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,cAAC,IAAD;AACC,IAAA,SAAS,EAAC,wCADX;AAEC,IAAA,IAAI,EAAGH;AAFR,IADD,EAKC,yBAAKF,EAAE,CAAE,mBAAF,CAAP,CALD,CADD,EAQC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,cAAC,GAAD,QACGA,EAAE,CAAE,wCAAF,CADL,EAEC,yBAFD,EAGC,cAAC,YAAD;AAAc,IAAA,IAAI,EAAC;AAAnB,KACGA,EAAE,CAAE,kBAAF,CADL,MAHD,CADD,CARD,CADD;AAoBA;;AAED,eAAeK,2BAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Icon, blockDefault } from '@wordpress/icons';\nimport { Tip, ExternalLink } from '@wordpress/components';\n\nfunction DownloadableBlocksNoResults() {\n\treturn (\n\t\t<>\n\t\t\t<div className=\"block-editor-inserter__no-results\">\n\t\t\t\t<Icon\n\t\t\t\t\tclassName=\"block-editor-inserter__no-results-icon\"\n\t\t\t\t\ticon={ blockDefault }\n\t\t\t\t/>\n\t\t\t\t<p>{ __( 'No results found.' ) }</p>\n\t\t\t</div>\n\t\t\t<div className=\"block-editor-inserter__tips\">\n\t\t\t\t<Tip>\n\t\t\t\t\t{ __( 'Interested in creating your own block?' ) }\n\t\t\t\t\t<br />\n\t\t\t\t\t<ExternalLink href=\"https://developer.wordpress.org/block-editor/\">\n\t\t\t\t\t\t{ __( 'Get started here' ) }.\n\t\t\t\t\t</ExternalLink>\n\t\t\t\t</Tip>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default DownloadableBlocksNoResults;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-directory",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.13.0",
|
|
4
4
|
"description": "Extend editor with block directory features to search, download and install blocks.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -26,24 +26,24 @@
|
|
|
26
26
|
"react-native": "src/index",
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@babel/runtime": "^7.16.0",
|
|
29
|
-
"@wordpress/a11y": "^3.
|
|
30
|
-
"@wordpress/api-fetch": "^6.
|
|
31
|
-
"@wordpress/block-editor": "^9.
|
|
32
|
-
"@wordpress/blocks": "^11.
|
|
33
|
-
"@wordpress/components": "^19.
|
|
34
|
-
"@wordpress/compose": "^5.
|
|
35
|
-
"@wordpress/core-data": "^4.
|
|
36
|
-
"@wordpress/data": "^6.
|
|
37
|
-
"@wordpress/edit-post": "^6.
|
|
38
|
-
"@wordpress/editor": "^12.
|
|
39
|
-
"@wordpress/element": "^4.
|
|
40
|
-
"@wordpress/hooks": "^3.
|
|
41
|
-
"@wordpress/html-entities": "^3.
|
|
42
|
-
"@wordpress/i18n": "^4.
|
|
43
|
-
"@wordpress/icons": "^9.
|
|
44
|
-
"@wordpress/notices": "^3.
|
|
45
|
-
"@wordpress/plugins": "^4.
|
|
46
|
-
"@wordpress/url": "^3.
|
|
29
|
+
"@wordpress/a11y": "^3.15.0",
|
|
30
|
+
"@wordpress/api-fetch": "^6.12.0",
|
|
31
|
+
"@wordpress/block-editor": "^9.7.0",
|
|
32
|
+
"@wordpress/blocks": "^11.14.0",
|
|
33
|
+
"@wordpress/components": "^19.17.0",
|
|
34
|
+
"@wordpress/compose": "^5.13.0",
|
|
35
|
+
"@wordpress/core-data": "^4.13.0",
|
|
36
|
+
"@wordpress/data": "^6.15.0",
|
|
37
|
+
"@wordpress/edit-post": "^6.12.0",
|
|
38
|
+
"@wordpress/editor": "^12.14.0",
|
|
39
|
+
"@wordpress/element": "^4.13.0",
|
|
40
|
+
"@wordpress/hooks": "^3.15.0",
|
|
41
|
+
"@wordpress/html-entities": "^3.15.0",
|
|
42
|
+
"@wordpress/i18n": "^4.15.0",
|
|
43
|
+
"@wordpress/icons": "^9.6.0",
|
|
44
|
+
"@wordpress/notices": "^3.15.0",
|
|
45
|
+
"@wordpress/plugins": "^4.13.0",
|
|
46
|
+
"@wordpress/url": "^3.16.0",
|
|
47
47
|
"lodash": "^4.17.21"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"publishConfig": {
|
|
54
54
|
"access": "public"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "08358f53b627a15148c3a3e433cdf58cf8714aa4"
|
|
57
57
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { render,
|
|
4
|
+
import { render, screen } from '@testing-library/react';
|
|
5
|
+
import userEvent from '@testing-library/user-event';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* WordPress dependencies
|
|
@@ -27,11 +28,11 @@ describe( 'DownloadableBlockListItem', () => {
|
|
|
27
28
|
isInstallable: true,
|
|
28
29
|
} ) );
|
|
29
30
|
|
|
30
|
-
|
|
31
|
+
render(
|
|
31
32
|
<DownloadableBlockListItem onClick={ jest.fn() } item={ plugin } />
|
|
32
33
|
);
|
|
33
|
-
const author = queryByText( `by ${ plugin.author }` );
|
|
34
|
-
const description = queryByText( plugin.description );
|
|
34
|
+
const author = screen.queryByText( `by ${ plugin.author }` );
|
|
35
|
+
const description = screen.queryByText( plugin.description );
|
|
35
36
|
expect( author ).not.toBeNull();
|
|
36
37
|
expect( description ).not.toBeNull();
|
|
37
38
|
} );
|
|
@@ -42,10 +43,10 @@ describe( 'DownloadableBlockListItem', () => {
|
|
|
42
43
|
isInstallable: true,
|
|
43
44
|
} ) );
|
|
44
45
|
|
|
45
|
-
|
|
46
|
+
render(
|
|
46
47
|
<DownloadableBlockListItem onClick={ jest.fn() } item={ plugin } />
|
|
47
48
|
);
|
|
48
|
-
const statusLabel = queryByText( 'Installing…' );
|
|
49
|
+
const statusLabel = screen.queryByText( 'Installing…' );
|
|
49
50
|
expect( statusLabel ).not.toBeNull();
|
|
50
51
|
} );
|
|
51
52
|
|
|
@@ -55,27 +56,30 @@ describe( 'DownloadableBlockListItem', () => {
|
|
|
55
56
|
isInstallable: false,
|
|
56
57
|
} ) );
|
|
57
58
|
|
|
58
|
-
|
|
59
|
+
render(
|
|
59
60
|
<DownloadableBlockListItem onClick={ jest.fn() } item={ plugin } />
|
|
60
61
|
);
|
|
61
|
-
const button = getByRole( 'option' );
|
|
62
|
+
const button = screen.getByRole( 'option' );
|
|
62
63
|
// Keeping it false to avoid focus loss and disable it using aria-disabled.
|
|
63
64
|
expect( button.disabled ).toBe( false );
|
|
64
65
|
expect( button.getAttribute( 'aria-disabled' ) ).toBe( 'true' );
|
|
65
66
|
} );
|
|
66
67
|
|
|
67
|
-
it( 'should try to install the block plugin', () => {
|
|
68
|
+
it( 'should try to install the block plugin', async () => {
|
|
69
|
+
const user = userEvent.setup( {
|
|
70
|
+
advanceTimers: jest.advanceTimersByTime,
|
|
71
|
+
} );
|
|
72
|
+
|
|
68
73
|
useSelect.mockImplementation( () => ( {
|
|
69
74
|
isInstalling: false,
|
|
70
75
|
isInstallable: true,
|
|
71
76
|
} ) );
|
|
72
77
|
const onClick = jest.fn();
|
|
73
|
-
|
|
78
|
+
render(
|
|
74
79
|
<DownloadableBlockListItem onClick={ onClick } item={ plugin } />
|
|
75
80
|
);
|
|
76
81
|
|
|
77
|
-
|
|
78
|
-
fireEvent.click( button );
|
|
82
|
+
await user.click( screen.getByRole( 'option' ) );
|
|
79
83
|
|
|
80
84
|
expect( onClick ).toHaveBeenCalledTimes( 1 );
|
|
81
85
|
} );
|
|
@@ -17,14 +17,11 @@ function DownloadableBlocksNoResults() {
|
|
|
17
17
|
</div>
|
|
18
18
|
<div className="block-editor-inserter__tips">
|
|
19
19
|
<Tip>
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
{ __( 'Get started here' ) }.
|
|
26
|
-
</ExternalLink>
|
|
27
|
-
</div>
|
|
20
|
+
{ __( 'Interested in creating your own block?' ) }
|
|
21
|
+
<br />
|
|
22
|
+
<ExternalLink href="https://developer.wordpress.org/block-editor/">
|
|
23
|
+
{ __( 'Get started here' ) }.
|
|
24
|
+
</ExternalLink>
|
|
28
25
|
</Tip>
|
|
29
26
|
</div>
|
|
30
27
|
</>
|