@wordpress/block-directory 6.1.0 → 6.3.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 (106) hide show
  1. package/build/components/auto-block-uninstaller/index.cjs.map +1 -1
  2. package/build/components/block-ratings/index.cjs +9 -7
  3. package/build/components/block-ratings/index.cjs.map +1 -1
  4. package/build/components/block-ratings/stars.cjs +5 -1
  5. package/build/components/block-ratings/stars.cjs.map +1 -1
  6. package/build/components/compact-list/index.cjs +14 -8
  7. package/build/components/compact-list/index.cjs.map +1 -1
  8. package/build/components/downloadable-block-list-item/index.cjs +45 -16
  9. package/build/components/downloadable-block-list-item/index.cjs.map +1 -1
  10. package/build/components/downloadable-block-notice/index.cjs +2 -3
  11. package/build/components/downloadable-block-notice/index.cjs.map +1 -1
  12. package/build/components/downloadable-blocks-list/index.cjs +9 -7
  13. package/build/components/downloadable-blocks-list/index.cjs.map +1 -1
  14. package/build/components/downloadable-blocks-panel/index.cjs +11 -9
  15. package/build/components/downloadable-blocks-panel/index.cjs.map +1 -1
  16. package/build/components/downloadable-blocks-panel/inserter-panel.cjs +5 -1
  17. package/build/components/downloadable-blocks-panel/inserter-panel.cjs.map +1 -1
  18. package/build/plugins/get-install-missing/index.cjs +19 -9
  19. package/build/plugins/get-install-missing/index.cjs.map +1 -1
  20. package/build/plugins/get-install-missing/install-button.cjs +5 -1
  21. package/build/plugins/get-install-missing/install-button.cjs.map +1 -1
  22. package/build/plugins/index.cjs +12 -10
  23. package/build/plugins/index.cjs.map +1 -1
  24. package/build/plugins/inserter-menu-downloadable-blocks-panel/index.cjs +9 -7
  25. package/build/plugins/inserter-menu-downloadable-blocks-panel/index.cjs.map +1 -1
  26. package/build/plugins/installed-blocks-pre-publish-panel/index.cjs +15 -9
  27. package/build/plugins/installed-blocks-pre-publish-panel/index.cjs.map +1 -1
  28. package/build/store/actions.cjs +14 -8
  29. package/build/store/actions.cjs.map +1 -1
  30. package/build/store/index.cjs +11 -9
  31. package/build/store/index.cjs.map +1 -1
  32. package/build/store/load-assets.cjs +8 -6
  33. package/build/store/load-assets.cjs.map +1 -1
  34. package/build/store/resolvers.cjs +9 -7
  35. package/build/store/resolvers.cjs.map +1 -1
  36. package/build-module/components/block-ratings/stars.mjs +5 -1
  37. package/build-module/components/block-ratings/stars.mjs.map +1 -1
  38. package/build-module/components/compact-list/index.mjs +5 -1
  39. package/build-module/components/compact-list/index.mjs.map +1 -1
  40. package/build-module/components/downloadable-block-list-item/index.mjs +33 -6
  41. package/build-module/components/downloadable-block-list-item/index.mjs.map +1 -1
  42. package/build-module/components/downloadable-block-notice/index.mjs +3 -4
  43. package/build-module/components/downloadable-block-notice/index.mjs.map +1 -1
  44. package/build-module/components/downloadable-blocks-panel/inserter-panel.mjs +5 -1
  45. package/build-module/components/downloadable-blocks-panel/inserter-panel.mjs.map +1 -1
  46. package/build-module/plugins/get-install-missing/index.mjs +10 -2
  47. package/build-module/plugins/get-install-missing/index.mjs.map +1 -1
  48. package/build-module/plugins/get-install-missing/install-button.mjs +5 -1
  49. package/build-module/plugins/get-install-missing/install-button.mjs.map +1 -1
  50. package/build-module/plugins/installed-blocks-pre-publish-panel/index.mjs +7 -3
  51. package/build-module/plugins/installed-blocks-pre-publish-panel/index.mjs.map +1 -1
  52. package/build-module/store/actions.mjs +5 -1
  53. package/build-module/store/actions.mjs.map +1 -1
  54. package/build-style/style-rtl.css +7 -7
  55. package/build-style/style.css +7 -7
  56. package/build-types/components/auto-block-uninstaller/index.d.ts +2 -0
  57. package/build-types/components/auto-block-uninstaller/index.d.ts.map +1 -0
  58. package/build-types/components/block-ratings/index.d.ts +5 -0
  59. package/build-types/components/block-ratings/index.d.ts.map +1 -0
  60. package/build-types/components/block-ratings/stars.d.ts +5 -0
  61. package/build-types/components/block-ratings/stars.d.ts.map +1 -0
  62. package/build-types/components/compact-list/index.d.ts +4 -0
  63. package/build-types/components/compact-list/index.d.ts.map +1 -0
  64. package/build-types/components/downloadable-block-icon/index.d.ts +5 -0
  65. package/build-types/components/downloadable-block-icon/index.d.ts.map +1 -0
  66. package/build-types/components/downloadable-block-list-item/index.d.ts +6 -0
  67. package/build-types/components/downloadable-block-list-item/index.d.ts.map +1 -0
  68. package/build-types/components/downloadable-block-notice/index.d.ts +5 -0
  69. package/build-types/components/downloadable-block-notice/index.d.ts.map +1 -0
  70. package/build-types/components/downloadable-blocks-list/index.d.ts +8 -0
  71. package/build-types/components/downloadable-blocks-list/index.d.ts.map +1 -0
  72. package/build-types/components/downloadable-blocks-panel/index.d.ts +8 -0
  73. package/build-types/components/downloadable-blocks-panel/index.d.ts.map +1 -0
  74. package/build-types/components/downloadable-blocks-panel/inserter-panel.d.ts +7 -0
  75. package/build-types/components/downloadable-blocks-panel/inserter-panel.d.ts.map +1 -0
  76. package/build-types/components/downloadable-blocks-panel/no-results.d.ts +3 -0
  77. package/build-types/components/downloadable-blocks-panel/no-results.d.ts.map +1 -0
  78. package/build-types/index.d.ts +3 -0
  79. package/build-types/index.d.ts.map +1 -0
  80. package/build-types/plugins/get-install-missing/index.d.ts +3 -0
  81. package/build-types/plugins/get-install-missing/index.d.ts.map +1 -0
  82. package/build-types/plugins/get-install-missing/install-button.d.ts +6 -0
  83. package/build-types/plugins/get-install-missing/install-button.d.ts.map +1 -0
  84. package/build-types/plugins/index.d.ts +2 -0
  85. package/build-types/plugins/index.d.ts.map +1 -0
  86. package/build-types/plugins/inserter-menu-downloadable-blocks-panel/index.d.ts +3 -0
  87. package/build-types/plugins/inserter-menu-downloadable-blocks-panel/index.d.ts.map +1 -0
  88. package/build-types/plugins/installed-blocks-pre-publish-panel/index.d.ts +2 -0
  89. package/build-types/plugins/installed-blocks-pre-publish-panel/index.d.ts.map +1 -0
  90. package/build-types/store/actions.d.ts +82 -0
  91. package/build-types/store/actions.d.ts.map +1 -0
  92. package/build-types/store/index.d.ts +17 -0
  93. package/build-types/store/index.d.ts.map +1 -0
  94. package/build-types/store/load-assets.d.ts +16 -0
  95. package/build-types/store/load-assets.d.ts.map +1 -0
  96. package/build-types/store/reducer.d.ts +38 -0
  97. package/build-types/store/reducer.d.ts.map +1 -0
  98. package/build-types/store/resolvers.d.ts +4 -0
  99. package/build-types/store/resolvers.d.ts.map +1 -0
  100. package/build-types/store/selectors.d.ts +80 -0
  101. package/build-types/store/selectors.d.ts.map +1 -0
  102. package/build-types/store/utils/get-plugin-url.d.ts +9 -0
  103. package/build-types/store/utils/get-plugin-url.d.ts.map +1 -0
  104. package/package.json +23 -23
  105. package/src/components/downloadable-block-notice/index.jsx +0 -4
  106. package/src/plugins/installed-blocks-pre-publish-panel/index.jsx +6 -6
@@ -0,0 +1,4 @@
1
+ export declare const getDownloadableBlocks: (filterValue: any) => ({ dispatch }: {
2
+ dispatch: any;
3
+ }) => Promise<void>;
4
+ //# sourceMappingURL=resolvers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../../src/store/resolvers.js"],"names":[],"mappings":"AAIA,eAAO,MAAM,qBAAqB;;mBAyBhC,CAAC"}
@@ -0,0 +1,80 @@
1
+ /**
2
+ * Returns true if application is requesting for downloadable blocks.
3
+ *
4
+ * @param {Object} state Global application state.
5
+ * @param {string} filterValue Search string.
6
+ *
7
+ * @return {boolean} Whether a request is in progress for the blocks list.
8
+ */
9
+ export declare function isRequestingDownloadableBlocks(state: Object, filterValue: string): boolean;
10
+ /**
11
+ * Returns the available uninstalled blocks.
12
+ *
13
+ * @param {Object} state Global application state.
14
+ * @param {string} filterValue Search string.
15
+ *
16
+ * @return {Array} Downloadable blocks.
17
+ */
18
+ export declare function getDownloadableBlocks(state: Object, filterValue: string): any[];
19
+ /**
20
+ * Returns the block types that have been installed on the server in this
21
+ * session.
22
+ *
23
+ * @param {Object} state Global application state.
24
+ *
25
+ * @return {Array} Block type items
26
+ */
27
+ export declare function getInstalledBlockTypes(state: Object): any[];
28
+ /**
29
+ * Returns block types that have been installed on the server and used in the
30
+ * current post.
31
+ *
32
+ * @param {Object} state Global application state.
33
+ *
34
+ * @return {Array} Block type items.
35
+ */
36
+ export declare const getNewBlockTypes: {
37
+ (state: any): any[];
38
+ isRegistrySelector?: boolean;
39
+ registry?: any;
40
+ };
41
+ /**
42
+ * Returns the block types that have been installed on the server but are not
43
+ * used in the current post.
44
+ *
45
+ * @param {Object} state Global application state.
46
+ *
47
+ * @return {Array} Block type items.
48
+ */
49
+ export declare const getUnusedBlockTypes: {
50
+ (state: any): any[];
51
+ isRegistrySelector?: boolean;
52
+ registry?: any;
53
+ };
54
+ /**
55
+ * Returns true if a block plugin install is in progress.
56
+ *
57
+ * @param {Object} state Global application state.
58
+ * @param {string} blockId Id of the block.
59
+ *
60
+ * @return {boolean} Whether this block is currently being installed.
61
+ */
62
+ export declare function isInstalling(state: Object, blockId: string): boolean;
63
+ /**
64
+ * Returns all block error notices.
65
+ *
66
+ * @param {Object} state Global application state.
67
+ *
68
+ * @return {Object} Object with error notices.
69
+ */
70
+ export declare function getErrorNotices(state: Object): Object;
71
+ /**
72
+ * Returns the error notice for a given block.
73
+ *
74
+ * @param {Object} state Global application state.
75
+ * @param {string} blockId The ID of the block plugin. eg: my-block
76
+ *
77
+ * @return {string|boolean} The error text, or false if no error.
78
+ */
79
+ export declare function getErrorNoticeForBlock(state: Object, blockId: string): string | boolean;
80
+ //# sourceMappingURL=selectors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../../src/store/selectors.js"],"names":[],"mappings":"AAKA;;;;;;;GAOG;AACH,wBAAgB,8BAA8B,CAAE,KAAK,EAL1C,MAK0C,EAAE,WAAW,EAJvD,MAIuD,GAFtD,OAAO,CAIlB;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAE,KAAK,EALjC,MAKiC,EAAE,WAAW,EAJ9C,MAI8C,SAExD;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAE,KAAK,EAJlC,MAIkC,SAE5C;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB;;;;CAgC5B,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB;;;;CAgC/B,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAE,KAAK,EALxB,MAKwB,EAAE,OAAO,EAJjC,MAIiC,GAFhC,OAAO,CAIlB;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAE,KAAK,EAJ3B,MAI2B,GAF1B,MAAM,CAIjB;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAE,KAAK,EALlC,MAKkC,EAAE,OAAO,EAJ3C,MAI2C,GAF1C,MAAM,GAAC,OAAO,CAIzB"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Get the plugin's direct API link out of a block-directory response.
3
+ *
4
+ * @param {Object} block The block object
5
+ *
6
+ * @return {string} The plugin URL, if exists.
7
+ */
8
+ export default function getPluginUrl(block: Object): string;
9
+ //# sourceMappingURL=get-plugin-url.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-plugin-url.d.ts","sourceRoot":"","sources":["../../../src/store/utils/get-plugin-url.js"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAAE,KAAK,EAJhC,MAIgC,GAF/B,MAAM,CAWjB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-directory",
3
- "version": "6.1.0",
3
+ "version": "6.3.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",
@@ -39,34 +39,34 @@
39
39
  },
40
40
  "wpScript": true,
41
41
  "dependencies": {
42
- "@wordpress/a11y": "^5.1.0",
43
- "@wordpress/api-fetch": "^8.1.0",
44
- "@wordpress/base-styles": "^15.0.0",
45
- "@wordpress/block-editor": "^20.0.0",
46
- "@wordpress/blocks": "^17.1.0",
47
- "@wordpress/components": "^44.0.0",
48
- "@wordpress/compose": "^9.1.0",
49
- "@wordpress/core-data": "^9.1.0",
50
- "@wordpress/data": "^11.1.0",
51
- "@wordpress/editor": "^16.1.0",
52
- "@wordpress/element": "^10.1.0",
53
- "@wordpress/hooks": "^5.1.0",
54
- "@wordpress/html-entities": "^5.1.0",
55
- "@wordpress/i18n": "^7.1.0",
56
- "@wordpress/icons": "^20.0.0",
57
- "@wordpress/notices": "^6.1.0",
58
- "@wordpress/plugins": "^8.1.0",
59
- "@wordpress/ui": "^0.26.0",
60
- "@wordpress/url": "^5.1.0",
42
+ "@wordpress/a11y": "^5.3.0",
43
+ "@wordpress/api-fetch": "^8.3.0",
44
+ "@wordpress/base-styles": "^15.2.0",
45
+ "@wordpress/block-editor": "^20.2.0",
46
+ "@wordpress/blocks": "^17.3.0",
47
+ "@wordpress/components": "^45.1.0",
48
+ "@wordpress/compose": "^9.3.0",
49
+ "@wordpress/core-data": "^9.3.0",
50
+ "@wordpress/data": "^11.3.0",
51
+ "@wordpress/editor": "^16.3.0",
52
+ "@wordpress/element": "^10.3.0",
53
+ "@wordpress/hooks": "^5.3.0",
54
+ "@wordpress/html-entities": "^5.3.0",
55
+ "@wordpress/i18n": "^7.3.0",
56
+ "@wordpress/icons": "^21.1.0",
57
+ "@wordpress/notices": "^6.3.0",
58
+ "@wordpress/plugins": "^8.3.0",
59
+ "@wordpress/ui": "^0.28.0",
60
+ "@wordpress/url": "^5.3.0",
61
61
  "change-case": "^4.1.2",
62
62
  "clsx": "^2.1.1"
63
63
  },
64
64
  "devDependencies": {
65
65
  "@testing-library/dom": "^10.4.2",
66
66
  "@testing-library/react": "^16.3.3",
67
- "@testing-library/user-event": "^14.6.8",
67
+ "@testing-library/user-event": "^14.6.13",
68
68
  "deep-freeze": "^0.0.1",
69
- "vitest": "^5.0.5"
69
+ "vitest": "^5.1.1"
70
70
  },
71
71
  "peerDependencies": {
72
72
  "react": "^18 || ^19",
@@ -75,5 +75,5 @@
75
75
  "publishConfig": {
76
76
  "access": "public"
77
77
  },
78
- "gitHead": "9b70363b9f93cff0583a1f3153738d383cf5a49e"
78
+ "gitHead": "7f19202f61aeba8f4bdce892a1a0df485ad76e2b"
79
79
  }
@@ -1,4 +1,3 @@
1
- import { __ } from '@wordpress/i18n';
2
1
  import { useSelect } from '@wordpress/data';
3
2
  import { store as blockDirectoryStore } from '../../store';
4
3
 
@@ -17,9 +16,6 @@ export const DownloadableBlockNotice = ( { block } ) => {
17
16
  <div className="block-directory-downloadable-block-notice">
18
17
  <div className="block-directory-downloadable-block-notice__content">
19
18
  { errorNotice.message }
20
- { errorNotice.isFatal
21
- ? ' ' + __( 'Try reloading the page.' )
22
- : null }
23
19
  </div>
24
20
  </div>
25
21
  );
@@ -1,4 +1,4 @@
1
- import { _n, sprintf } from '@wordpress/i18n';
1
+ import { __, _n, sprintf } from '@wordpress/i18n';
2
2
  import { useSelect } from '@wordpress/data';
3
3
  import { PluginPrePublishPanel } from '@wordpress/editor';
4
4
  import CompactList from '../../components/compact-list';
@@ -28,11 +28,11 @@ export default function InstalledBlocksPrePublishPanel() {
28
28
  initialOpen
29
29
  >
30
30
  <p className="installed-blocks-pre-publish-panel__copy">
31
- { _n(
32
- 'The following block has been added to your site.',
33
- 'The following blocks have been added to your site.',
34
- newBlockTypes.length
35
- ) }
31
+ { newBlockTypes.length === 1
32
+ ? __( 'The following block has been added to your site.' )
33
+ : __(
34
+ 'The following blocks have been added to your site.'
35
+ ) }
36
36
  </p>
37
37
  <CompactList items={ newBlockTypes } />
38
38
  </PluginPrePublishPanel>