@wordpress/block-directory 5.51.0 → 5.53.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 +8 -0
- package/build/components/auto-block-uninstaller/index.cjs.map +2 -2
- package/build/components/block-ratings/index.cjs.map +2 -2
- package/build/components/block-ratings/stars.cjs.map +2 -2
- package/build/components/compact-list/index.cjs.map +2 -2
- package/build/components/downloadable-block-icon/index.cjs.map +2 -2
- package/build/components/downloadable-block-list-item/index.cjs +20 -4
- package/build/components/downloadable-block-list-item/index.cjs.map +2 -2
- package/build/components/downloadable-block-notice/index.cjs.map +2 -2
- package/build/components/downloadable-blocks-list/index.cjs.map +2 -2
- package/build/components/downloadable-blocks-panel/index.cjs.map +2 -2
- package/build/components/downloadable-blocks-panel/inserter-panel.cjs.map +2 -2
- package/build/components/downloadable-blocks-panel/no-results.cjs.map +2 -2
- package/build/index.cjs.map +2 -2
- package/build/lock-unlock.cjs.map +2 -2
- package/build/plugins/get-install-missing/index.cjs.map +2 -2
- package/build/plugins/get-install-missing/install-button.cjs.map +2 -2
- package/build/plugins/index.cjs.map +2 -2
- package/build/plugins/inserter-menu-downloadable-blocks-panel/index.cjs.map +2 -2
- package/build/plugins/installed-blocks-pre-publish-panel/index.cjs.map +2 -2
- package/build/store/actions.cjs.map +2 -2
- package/build/store/index.cjs.map +2 -2
- package/build/store/load-assets.cjs.map +2 -2
- package/build/store/reducer.cjs.map +2 -2
- package/build/store/resolvers.cjs.map +2 -2
- package/build/store/selectors.cjs.map +2 -2
- package/build-module/components/auto-block-uninstaller/index.mjs.map +2 -2
- package/build-module/components/block-ratings/index.mjs.map +2 -2
- package/build-module/components/block-ratings/stars.mjs.map +2 -2
- package/build-module/components/compact-list/index.mjs.map +2 -2
- package/build-module/components/downloadable-block-icon/index.mjs.map +2 -2
- package/build-module/components/downloadable-block-list-item/index.mjs +20 -4
- package/build-module/components/downloadable-block-list-item/index.mjs.map +2 -2
- package/build-module/components/downloadable-block-notice/index.mjs.map +2 -2
- package/build-module/components/downloadable-blocks-list/index.mjs.map +2 -2
- package/build-module/components/downloadable-blocks-panel/index.mjs.map +2 -2
- package/build-module/components/downloadable-blocks-panel/inserter-panel.mjs.map +2 -2
- package/build-module/components/downloadable-blocks-panel/no-results.mjs.map +2 -2
- package/build-module/index.mjs.map +2 -2
- package/build-module/lock-unlock.mjs.map +2 -2
- package/build-module/plugins/get-install-missing/index.mjs.map +2 -2
- package/build-module/plugins/get-install-missing/install-button.mjs.map +2 -2
- package/build-module/plugins/index.mjs.map +2 -2
- package/build-module/plugins/inserter-menu-downloadable-blocks-panel/index.mjs.map +2 -2
- package/build-module/plugins/installed-blocks-pre-publish-panel/index.mjs.map +2 -2
- package/build-module/store/actions.mjs.map +2 -2
- package/build-module/store/index.mjs.map +2 -2
- package/build-module/store/load-assets.mjs.map +2 -2
- package/build-module/store/reducer.mjs.map +2 -2
- package/build-module/store/resolvers.mjs.map +2 -2
- package/build-module/store/selectors.mjs.map +2 -2
- package/package.json +22 -22
- package/src/components/auto-block-uninstaller/index.js +0 -7
- package/src/components/block-ratings/index.js +0 -3
- package/src/components/block-ratings/stars.js +0 -3
- package/src/components/compact-list/index.js +0 -7
- package/src/components/downloadable-block-icon/index.js +0 -3
- package/src/components/downloadable-block-icon/test/__snapshots__/index.js.snap +1 -1
- package/src/components/downloadable-block-icon/test/index.js +0 -7
- package/src/components/downloadable-block-list-item/index.js +20 -19
- package/src/components/downloadable-block-list-item/test/index.js +0 -11
- package/src/components/downloadable-block-notice/index.js +0 -7
- package/src/components/downloadable-blocks-list/index.js +0 -7
- package/src/components/downloadable-blocks-list/test/index.js +0 -11
- package/src/components/downloadable-blocks-panel/index.js +0 -7
- package/src/components/downloadable-blocks-panel/inserter-panel.js +0 -3
- package/src/components/downloadable-blocks-panel/no-results.js +0 -3
- package/src/index.js +0 -3
- package/src/lock-unlock.js +0 -3
- package/src/plugins/get-install-missing/index.js +0 -7
- package/src/plugins/get-install-missing/install-button.js +0 -7
- package/src/plugins/index.js +0 -7
- package/src/plugins/inserter-menu-downloadable-blocks-panel/index.js +0 -7
- package/src/plugins/installed-blocks-pre-publish-panel/index.js +0 -7
- package/src/store/actions.js +0 -7
- package/src/store/index.js +0 -7
- package/src/store/load-assets.js +0 -3
- package/src/store/reducer.js +0 -3
- package/src/store/resolvers.js +0 -11
- package/src/store/selectors.js +0 -3
- package/src/store/test/actions.js +0 -7
- package/src/store/test/load-assets.js +0 -3
- package/src/store/test/reducer.js +0 -7
- package/src/store/test/selectors.js +0 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/store/reducer.js"],
|
|
4
|
-
"sourcesContent": ["
|
|
5
|
-
"mappings": ";
|
|
4
|
+
"sourcesContent": ["import { combineReducers } from '@wordpress/data';\n\n/**\n * Reducer returning an array of downloadable blocks.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport const downloadableBlocks = ( state = {}, action ) => {\n\tswitch ( action.type ) {\n\t\tcase 'FETCH_DOWNLOADABLE_BLOCKS':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ action.filterValue ]: {\n\t\t\t\t\tisRequesting: true,\n\t\t\t\t},\n\t\t\t};\n\t\tcase 'RECEIVE_DOWNLOADABLE_BLOCKS':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ action.filterValue ]: {\n\t\t\t\t\tresults: action.downloadableBlocks,\n\t\t\t\t\tisRequesting: false,\n\t\t\t\t},\n\t\t\t};\n\t}\n\treturn state;\n};\n\n/**\n * Reducer managing the installation and deletion of blocks.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport const blockManagement = (\n\tstate = {\n\t\tinstalledBlockTypes: [],\n\t\tisInstalling: {},\n\t},\n\taction\n) => {\n\tswitch ( action.type ) {\n\t\tcase 'ADD_INSTALLED_BLOCK_TYPE':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tinstalledBlockTypes: [\n\t\t\t\t\t...state.installedBlockTypes,\n\t\t\t\t\taction.item,\n\t\t\t\t],\n\t\t\t};\n\t\tcase 'REMOVE_INSTALLED_BLOCK_TYPE':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tinstalledBlockTypes: state.installedBlockTypes.filter(\n\t\t\t\t\t( blockType ) => blockType.name !== action.item.name\n\t\t\t\t),\n\t\t\t};\n\t\tcase 'SET_INSTALLING_BLOCK':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tisInstalling: {\n\t\t\t\t\t...state.isInstalling,\n\t\t\t\t\t[ action.blockId ]: action.isInstalling,\n\t\t\t\t},\n\t\t\t};\n\t}\n\treturn state;\n};\n\n/**\n * Reducer returning an object of error notices.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport const errorNotices = ( state = {}, action ) => {\n\tswitch ( action.type ) {\n\t\tcase 'SET_ERROR_NOTICE':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ action.blockId ]: {\n\t\t\t\t\tmessage: action.message,\n\t\t\t\t\tisFatal: action.isFatal,\n\t\t\t\t},\n\t\t\t};\n\t\tcase 'CLEAR_ERROR_NOTICE':\n\t\t\tconst { [ action.blockId ]: blockId, ...restState } = state;\n\t\t\treturn restState;\n\t}\n\treturn state;\n};\n\nexport default combineReducers( {\n\tdownloadableBlocks,\n\tblockManagement,\n\terrorNotices,\n} );\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,uBAAuB;AAUzB,IAAM,qBAAqB,CAAE,QAAQ,CAAC,GAAG,WAAY;AAC3D,UAAS,OAAO,MAAO;AAAA,IACtB,KAAK;AACJ,aAAO;AAAA,QACN,GAAG;AAAA,QACH,CAAE,OAAO,WAAY,GAAG;AAAA,UACvB,cAAc;AAAA,QACf;AAAA,MACD;AAA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
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/store/resolvers.js"],
|
|
4
|
-
"sourcesContent": ["
|
|
5
|
-
"mappings": ";
|
|
4
|
+
"sourcesContent": ["import { camelCase } from 'change-case';\nimport apiFetch from '@wordpress/api-fetch';\nimport { fetchDownloadableBlocks, receiveDownloadableBlocks } from './actions';\n\nexport const getDownloadableBlocks =\n\t( filterValue ) =>\n\tasync ( { dispatch } ) => {\n\t\tif ( ! filterValue ) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tdispatch( fetchDownloadableBlocks( filterValue ) );\n\t\t\tconst results = await apiFetch( {\n\t\t\t\tpath: `wp/v2/block-directory/search?term=${ filterValue }`,\n\t\t\t} );\n\t\t\tconst blocks = results.map( ( result ) =>\n\t\t\t\tObject.fromEntries(\n\t\t\t\t\tObject.entries( result ).map( ( [ key, value ] ) => [\n\t\t\t\t\t\tcamelCase( key ),\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t] )\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tdispatch( receiveDownloadableBlocks( blocks, filterValue ) );\n\t\t} catch {\n\t\t\tdispatch( receiveDownloadableBlocks( [], filterValue ) );\n\t\t}\n\t};\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,iBAAiB;AAC1B,OAAO,cAAc;AACrB,SAAS,yBAAyB,iCAAiC;AAE5D,IAAM,wBACZ,CAAE,gBACF,OAAQ,EAAE,SAAS,MAAO;AACzB,MAAK,CAAE,aAAc;AACpB;AAAA,EACD;AAEA,MAAI;AACH,aAAU,wBAAyB,WAAY,CAAE;AACjD,UAAM,UAAU,MAAM,SAAU;AAAA,MAC/B,MAAM,qCAAsC,WAAY;AAAA,IACzD,CAAE;AACF,UAAM,SAAS,QAAQ;AAAA,MAAK,CAAE,WAC7B,OAAO;AAAA,QACN,OAAO,QAAS,MAAO,EAAE,IAAK,CAAE,CAAE,KAAK,KAAM,MAAO;AAAA,UACnD,UAAW,GAAI;AAAA,UACf;AAAA,QACD,CAAE;AAAA,MACH;AAAA,IACD;AAEA,aAAU,0BAA2B,QAAQ,WAAY,CAAE;AAAA,EAC5D,QAAQ;AACP,aAAU,0BAA2B,CAAC,GAAG,WAAY,CAAE;AAAA,EACxD;AACD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/store/selectors.js"],
|
|
4
|
-
"sourcesContent": ["
|
|
5
|
-
"mappings": ";
|
|
4
|
+
"sourcesContent": ["import { createSelector, createRegistrySelector } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\nconst EMPTY_ARRAY = [];\n\n/**\n * Returns true if application is requesting for downloadable blocks.\n *\n * @param {Object} state Global application state.\n * @param {string} filterValue Search string.\n *\n * @return {boolean} Whether a request is in progress for the blocks list.\n */\nexport function isRequestingDownloadableBlocks( state, filterValue ) {\n\treturn state.downloadableBlocks[ filterValue ]?.isRequesting ?? false;\n}\n\n/**\n * Returns the available uninstalled blocks.\n *\n * @param {Object} state Global application state.\n * @param {string} filterValue Search string.\n *\n * @return {Array} Downloadable blocks.\n */\nexport function getDownloadableBlocks( state, filterValue ) {\n\treturn state.downloadableBlocks[ filterValue ]?.results ?? EMPTY_ARRAY;\n}\n\n/**\n * Returns the block types that have been installed on the server in this\n * session.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} Block type items\n */\nexport function getInstalledBlockTypes( state ) {\n\treturn state.blockManagement.installedBlockTypes;\n}\n\n/**\n * Returns block types that have been installed on the server and used in the\n * current post.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} Block type items.\n */\nexport const getNewBlockTypes = createRegistrySelector( ( select ) =>\n\tcreateSelector(\n\t\t( state ) => {\n\t\t\tconst installedBlockTypes = getInstalledBlockTypes( state );\n\t\t\tif ( ! installedBlockTypes.length ) {\n\t\t\t\treturn EMPTY_ARRAY;\n\t\t\t}\n\n\t\t\tconst { getBlockName, getClientIdsWithDescendants } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst installedBlockNames = installedBlockTypes.map(\n\t\t\t\t( blockType ) => blockType.name\n\t\t\t);\n\t\t\tconst foundBlockNames = getClientIdsWithDescendants().flatMap(\n\t\t\t\t( clientId ) => {\n\t\t\t\t\tconst blockName = getBlockName( clientId );\n\t\t\t\t\treturn installedBlockNames.includes( blockName )\n\t\t\t\t\t\t? blockName\n\t\t\t\t\t\t: [];\n\t\t\t\t}\n\t\t\t);\n\t\t\tconst newBlockTypes = installedBlockTypes.filter( ( blockType ) =>\n\t\t\t\tfoundBlockNames.includes( blockType.name )\n\t\t\t);\n\n\t\t\treturn newBlockTypes.length > 0 ? newBlockTypes : EMPTY_ARRAY;\n\t\t},\n\t\t( state ) => [\n\t\t\tgetInstalledBlockTypes( state ),\n\t\t\tselect( blockEditorStore ).getClientIdsWithDescendants(),\n\t\t]\n\t)\n);\n\n/**\n * Returns the block types that have been installed on the server but are not\n * used in the current post.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} Block type items.\n */\nexport const getUnusedBlockTypes = createRegistrySelector( ( select ) =>\n\tcreateSelector(\n\t\t( state ) => {\n\t\t\tconst installedBlockTypes = getInstalledBlockTypes( state );\n\t\t\tif ( ! installedBlockTypes.length ) {\n\t\t\t\treturn EMPTY_ARRAY;\n\t\t\t}\n\n\t\t\tconst { getBlockName, getClientIdsWithDescendants } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst installedBlockNames = installedBlockTypes.map(\n\t\t\t\t( blockType ) => blockType.name\n\t\t\t);\n\t\t\tconst foundBlockNames = getClientIdsWithDescendants().flatMap(\n\t\t\t\t( clientId ) => {\n\t\t\t\t\tconst blockName = getBlockName( clientId );\n\t\t\t\t\treturn installedBlockNames.includes( blockName )\n\t\t\t\t\t\t? blockName\n\t\t\t\t\t\t: [];\n\t\t\t\t}\n\t\t\t);\n\t\t\tconst unusedBlockTypes = installedBlockTypes.filter(\n\t\t\t\t( blockType ) => ! foundBlockNames.includes( blockType.name )\n\t\t\t);\n\n\t\t\treturn unusedBlockTypes.length > 0 ? unusedBlockTypes : EMPTY_ARRAY;\n\t\t},\n\t\t( state ) => [\n\t\t\tgetInstalledBlockTypes( state ),\n\t\t\tselect( blockEditorStore ).getClientIdsWithDescendants(),\n\t\t]\n\t)\n);\n\n/**\n * Returns true if a block plugin install is in progress.\n *\n * @param {Object} state Global application state.\n * @param {string} blockId Id of the block.\n *\n * @return {boolean} Whether this block is currently being installed.\n */\nexport function isInstalling( state, blockId ) {\n\treturn state.blockManagement.isInstalling[ blockId ] || false;\n}\n\n/**\n * Returns all block error notices.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Object with error notices.\n */\nexport function getErrorNotices( state ) {\n\treturn state.errorNotices;\n}\n\n/**\n * Returns the error notice for a given block.\n *\n * @param {Object} state Global application state.\n * @param {string} blockId The ID of the block plugin. eg: my-block\n *\n * @return {string|boolean} The error text, or false if no error.\n */\nexport function getErrorNoticeForBlock( state, blockId ) {\n\treturn state.errorNotices[ blockId ];\n}\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,gBAAgB,8BAA8B;AACvD,SAAS,SAAS,wBAAwB;AAE1C,IAAM,cAAc,CAAC;AAUd,SAAS,+BAAgC,OAAO,aAAc;AACpE,SAAO,MAAM,mBAAoB,WAAY,GAAG,gBAAgB;AACjE;AAUO,SAAS,sBAAuB,OAAO,aAAc;AAC3D,SAAO,MAAM,mBAAoB,WAAY,GAAG,WAAW;AAC5D;AAUO,SAAS,uBAAwB,OAAQ;AAC/C,SAAO,MAAM,gBAAgB;AAC9B;AAUO,IAAM,mBAAmB;AAAA,EAAwB,CAAE,WACzD;AAAA,IACC,CAAE,UAAW;AACZ,YAAM,sBAAsB,uBAAwB,KAAM;AAC1D,UAAK,CAAE,oBAAoB,QAAS;AACnC,eAAO;AAAA,MACR;AAEA,YAAM,EAAE,cAAc,4BAA4B,IACj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ACD;AACD;AAUO,SAAS,aAAc,OAAO,SAAU;AAC9C,SAAO,MAAM,gBAAgB,aAAc,OAAQ,KAAK;AACzD;AASO,SAAS,gBAAiB,OAAQ;AACxC,SAAO,MAAM;AACd;AAUO,SAAS,uBAAwB,OAAO,SAAU;AACxD,SAAO,MAAM,aAAc,OAAQ;AACpC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-directory",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.53.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",
|
|
@@ -41,26 +41,26 @@
|
|
|
41
41
|
},
|
|
42
42
|
"wpScript": true,
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@wordpress/a11y": "^4.
|
|
45
|
-
"@wordpress/api-fetch": "^7.
|
|
46
|
-
"@wordpress/base-styles": "^
|
|
47
|
-
"@wordpress/block-editor": "^16.
|
|
48
|
-
"@wordpress/blocks": "^15.
|
|
49
|
-
"@wordpress/components": "^
|
|
50
|
-
"@wordpress/compose": "^8.
|
|
51
|
-
"@wordpress/core-data": "^7.
|
|
52
|
-
"@wordpress/data": "^10.
|
|
53
|
-
"@wordpress/editor": "^14.
|
|
54
|
-
"@wordpress/element": "^8.
|
|
55
|
-
"@wordpress/hooks": "^4.
|
|
56
|
-
"@wordpress/html-entities": "^4.
|
|
57
|
-
"@wordpress/i18n": "^6.
|
|
58
|
-
"@wordpress/icons": "^15.
|
|
59
|
-
"@wordpress/notices": "^5.
|
|
60
|
-
"@wordpress/plugins": "^7.
|
|
61
|
-
"@wordpress/private-apis": "^1.
|
|
62
|
-
"@wordpress/ui": "^0.
|
|
63
|
-
"@wordpress/url": "^4.
|
|
44
|
+
"@wordpress/a11y": "^4.53.0",
|
|
45
|
+
"@wordpress/api-fetch": "^7.53.0",
|
|
46
|
+
"@wordpress/base-styles": "^12.1.0",
|
|
47
|
+
"@wordpress/block-editor": "^16.2.0",
|
|
48
|
+
"@wordpress/blocks": "^15.26.0",
|
|
49
|
+
"@wordpress/components": "^39.0.0",
|
|
50
|
+
"@wordpress/compose": "^8.6.0",
|
|
51
|
+
"@wordpress/core-data": "^7.53.0",
|
|
52
|
+
"@wordpress/data": "^10.53.0",
|
|
53
|
+
"@wordpress/editor": "^14.53.0",
|
|
54
|
+
"@wordpress/element": "^8.5.0",
|
|
55
|
+
"@wordpress/hooks": "^4.53.0",
|
|
56
|
+
"@wordpress/html-entities": "^4.53.0",
|
|
57
|
+
"@wordpress/i18n": "^6.26.0",
|
|
58
|
+
"@wordpress/icons": "^15.4.0",
|
|
59
|
+
"@wordpress/notices": "^5.53.0",
|
|
60
|
+
"@wordpress/plugins": "^7.53.0",
|
|
61
|
+
"@wordpress/private-apis": "^1.53.0",
|
|
62
|
+
"@wordpress/ui": "^0.20.0",
|
|
63
|
+
"@wordpress/url": "^4.53.0",
|
|
64
64
|
"change-case": "^4.1.2",
|
|
65
65
|
"clsx": "^2.1.1"
|
|
66
66
|
},
|
|
@@ -77,5 +77,5 @@
|
|
|
77
77
|
"publishConfig": {
|
|
78
78
|
"access": "public"
|
|
79
79
|
},
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "989764d42ff93e33684aaf0b96a5b7f3d9bbff52"
|
|
81
81
|
}
|
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { unregisterBlockType } from '@wordpress/blocks';
|
|
5
2
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
6
3
|
import { useEffect } from '@wordpress/element';
|
|
7
4
|
import { store as editorStore } from '@wordpress/editor';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Internal dependencies
|
|
11
|
-
*/
|
|
12
5
|
import { store as blockDirectoryStore } from '../../store';
|
|
13
6
|
|
|
14
7
|
export default function AutoBlockUninstaller() {
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
1
|
import clsx from 'clsx';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* WordPress dependencies
|
|
8
|
-
*/
|
|
9
2
|
import { __, _n, sprintf } from '@wordpress/i18n';
|
|
10
3
|
import { Spinner, Composite } from '@wordpress/components';
|
|
11
4
|
import { createInterpolateElement } from '@wordpress/element';
|
|
@@ -13,10 +6,6 @@ import { decodeEntities } from '@wordpress/html-entities';
|
|
|
13
6
|
import { getBlockType } from '@wordpress/blocks';
|
|
14
7
|
import { useSelect } from '@wordpress/data';
|
|
15
8
|
import { VisuallyHidden, Tooltip } from '@wordpress/ui';
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Internal dependencies
|
|
19
|
-
*/
|
|
20
9
|
import BlockRatings from '../block-ratings';
|
|
21
10
|
import DownloadableBlockIcon from '../downloadable-block-icon';
|
|
22
11
|
import DownloadableBlockNotice from '../downloadable-block-notice';
|
|
@@ -30,24 +19,36 @@ function getDownloadableBlockLabel(
|
|
|
30
19
|
const stars = Math.round( rating / 0.5 ) * 0.5;
|
|
31
20
|
|
|
32
21
|
if ( ! isInstalled && hasNotice ) {
|
|
33
|
-
|
|
34
|
-
|
|
22
|
+
return sprintf(
|
|
23
|
+
/* translators: %s: block title */
|
|
24
|
+
__( 'Retry installing %s.' ),
|
|
25
|
+
decodeEntities( title )
|
|
26
|
+
);
|
|
35
27
|
}
|
|
36
28
|
|
|
37
29
|
if ( isInstalled ) {
|
|
38
|
-
|
|
39
|
-
|
|
30
|
+
return sprintf(
|
|
31
|
+
/* translators: %s: block title */
|
|
32
|
+
__( 'Add %s.' ),
|
|
33
|
+
decodeEntities( title )
|
|
34
|
+
);
|
|
40
35
|
}
|
|
41
36
|
|
|
42
37
|
if ( isInstalling ) {
|
|
43
|
-
|
|
44
|
-
|
|
38
|
+
return sprintf(
|
|
39
|
+
/* translators: %s: block title */
|
|
40
|
+
__( 'Installing %s.' ),
|
|
41
|
+
decodeEntities( title )
|
|
42
|
+
);
|
|
45
43
|
}
|
|
46
44
|
|
|
47
45
|
// No ratings yet, just use the title.
|
|
48
46
|
if ( ratingCount < 1 ) {
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
return sprintf(
|
|
48
|
+
/* translators: %s: block title */
|
|
49
|
+
__( 'Install %s.' ),
|
|
50
|
+
decodeEntities( title )
|
|
51
|
+
);
|
|
51
52
|
}
|
|
52
53
|
|
|
53
54
|
return sprintf(
|
|
@@ -1,17 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { render, screen } from '@testing-library/react';
|
|
5
2
|
import userEvent from '@testing-library/user-event';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* WordPress dependencies
|
|
9
|
-
*/
|
|
10
3
|
import { useSelect } from '@wordpress/data';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Internal dependencies
|
|
14
|
-
*/
|
|
15
4
|
import DownloadableBlockListItem from '../';
|
|
16
5
|
import { plugin } from '../../test/fixtures';
|
|
17
6
|
|
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { __ } from '@wordpress/i18n';
|
|
5
2
|
import { useSelect } from '@wordpress/data';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Internal dependencies
|
|
9
|
-
*/
|
|
10
3
|
import { store as blockDirectoryStore } from '../../store';
|
|
11
4
|
|
|
12
5
|
export const DownloadableBlockNotice = ( { block } ) => {
|
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { __ } from '@wordpress/i18n';
|
|
5
2
|
import { Composite } from '@wordpress/components';
|
|
6
3
|
import { getBlockType } from '@wordpress/blocks';
|
|
7
4
|
import { useDispatch } from '@wordpress/data';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Internal dependencies
|
|
11
|
-
*/
|
|
12
5
|
import DownloadableBlockListItem from '../downloadable-block-list-item';
|
|
13
6
|
import { store as blockDirectoryStore } from '../../store';
|
|
14
7
|
|
|
@@ -1,16 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { render, screen } from '@testing-library/react';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* WordPress dependencies
|
|
8
|
-
*/
|
|
9
2
|
import { useSelect } from '@wordpress/data';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Internal dependencies
|
|
13
|
-
*/
|
|
14
3
|
import DownloadableBlocksList from '../';
|
|
15
4
|
import { items } from '../../test/fixtures';
|
|
16
5
|
|
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { __ } from '@wordpress/i18n';
|
|
5
2
|
import { Spinner } from '@wordpress/components';
|
|
6
3
|
import { store as coreStore } from '@wordpress/core-data';
|
|
7
4
|
import { useSelect } from '@wordpress/data';
|
|
8
5
|
import { getBlockType } from '@wordpress/blocks';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Internal dependencies
|
|
12
|
-
*/
|
|
13
6
|
import DownloadableBlocksList from '../downloadable-blocks-list';
|
|
14
7
|
import DownloadableBlocksInserterPanel from './inserter-panel';
|
|
15
8
|
import DownloadableBlocksNoResults from './no-results';
|
package/src/index.js
CHANGED
package/src/lock-unlock.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { __, sprintf } from '@wordpress/i18n';
|
|
5
2
|
import { Button } from '@wordpress/components';
|
|
6
3
|
import { createBlock } from '@wordpress/blocks';
|
|
@@ -12,10 +9,6 @@ import {
|
|
|
12
9
|
useBlockProps,
|
|
13
10
|
store as blockEditorStore,
|
|
14
11
|
} from '@wordpress/block-editor';
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Internal dependencies
|
|
18
|
-
*/
|
|
19
12
|
import InstallButton from './install-button';
|
|
20
13
|
import { store as blockDirectoryStore } from '../../store';
|
|
21
14
|
|
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { __, sprintf } from '@wordpress/i18n';
|
|
5
2
|
import { Button } from '@wordpress/components';
|
|
6
3
|
import { createBlock, getBlockType, parse } from '@wordpress/blocks';
|
|
7
4
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
8
5
|
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Internal dependencies
|
|
12
|
-
*/
|
|
13
6
|
import { store as blockDirectoryStore } from '../../store';
|
|
14
7
|
|
|
15
8
|
export default function InstallButton( { attributes, block, clientId } ) {
|
package/src/plugins/index.js
CHANGED
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { registerPlugin } from '@wordpress/plugins';
|
|
5
2
|
import { addFilter } from '@wordpress/hooks';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Internal dependencies
|
|
9
|
-
*/
|
|
10
3
|
import AutoBlockUninstaller from '../components/auto-block-uninstaller';
|
|
11
4
|
import InserterMenuDownloadableBlocksPanel from './inserter-menu-downloadable-blocks-panel';
|
|
12
5
|
import InstalledBlocksPrePublishPanel from './installed-blocks-pre-publish-panel';
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { __unstableInserterMenuExtension } from '@wordpress/block-editor';
|
|
5
2
|
import { debounce } from '@wordpress/compose';
|
|
6
3
|
import { useState } from '@wordpress/element';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Internal dependencies
|
|
10
|
-
*/
|
|
11
4
|
import DownloadableBlocksPanel from '../../components/downloadable-blocks-panel';
|
|
12
5
|
|
|
13
6
|
function InserterMenuDownloadableBlocksPanel() {
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { _n, sprintf } from '@wordpress/i18n';
|
|
5
2
|
import { useSelect } from '@wordpress/data';
|
|
6
3
|
import { PluginPrePublishPanel } from '@wordpress/editor';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Internal dependencies
|
|
10
|
-
*/
|
|
11
4
|
import CompactList from '../../components/compact-list';
|
|
12
5
|
import { store as blockDirectoryStore } from '../../store';
|
|
13
6
|
|
package/src/store/actions.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
1
|
import {
|
|
5
2
|
store as blocksStore,
|
|
6
3
|
unstable__bootstrapServerSideBlockDefinitions, // eslint-disable-line camelcase
|
|
@@ -9,10 +6,6 @@ import { __, sprintf } from '@wordpress/i18n';
|
|
|
9
6
|
import apiFetch from '@wordpress/api-fetch';
|
|
10
7
|
import { store as noticesStore } from '@wordpress/notices';
|
|
11
8
|
import { addQueryArgs } from '@wordpress/url';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Internal dependencies
|
|
15
|
-
*/
|
|
16
9
|
import { loadAssets } from './load-assets';
|
|
17
10
|
import getPluginUrl from './utils/get-plugin-url';
|
|
18
11
|
|
package/src/store/index.js
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { createReduxStore, register } from '@wordpress/data';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Internal dependencies
|
|
8
|
-
*/
|
|
9
2
|
import reducer from './reducer';
|
|
10
3
|
import * as selectors from './selectors';
|
|
11
4
|
import * as actions from './actions';
|
package/src/store/load-assets.js
CHANGED
package/src/store/reducer.js
CHANGED
package/src/store/resolvers.js
CHANGED
|
@@ -1,16 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { camelCase } from 'change-case';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* WordPress dependencies
|
|
8
|
-
*/
|
|
9
2
|
import apiFetch from '@wordpress/api-fetch';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Internal dependencies
|
|
13
|
-
*/
|
|
14
3
|
import { fetchDownloadableBlocks, receiveDownloadableBlocks } from './actions';
|
|
15
4
|
|
|
16
5
|
export const getDownloadableBlocks =
|
package/src/store/selectors.js
CHANGED
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { createRegistry } from '@wordpress/data';
|
|
5
2
|
import { store as blocksStore } from '@wordpress/blocks';
|
|
6
3
|
import { store as noticesStore } from '@wordpress/notices';
|
|
7
4
|
import apiFetch from '@wordpress/api-fetch';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Internal dependencies
|
|
11
|
-
*/
|
|
12
5
|
import { loadAssets } from '../load-assets';
|
|
13
6
|
import { store as blockDirectoryStore } from '..';
|
|
14
7
|
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
1
|
import deepFreeze from 'deep-freeze';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Internal dependencies
|
|
8
|
-
*/
|
|
9
2
|
import { blockManagement, downloadableBlocks, errorNotices } from '../reducer';
|
|
10
3
|
import { blockTypeInstalled, downloadableBlock } from './fixtures';
|
|
11
4
|
|