@wordpress/block-directory 3.13.1-next.d6164808d3.0 → 3.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
CHANGED
package/build/store/reducer.js
CHANGED
|
@@ -5,14 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.errorNotices = exports.downloadableBlocks = exports.default = exports.blockManagement = void 0;
|
|
7
7
|
|
|
8
|
-
var _lodash = require("lodash");
|
|
9
|
-
|
|
10
8
|
var _data = require("@wordpress/data");
|
|
11
9
|
|
|
12
|
-
/**
|
|
13
|
-
* External dependencies
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
10
|
/**
|
|
17
11
|
* WordPress dependencies
|
|
18
12
|
*/
|
|
@@ -114,7 +108,11 @@ const errorNotices = function () {
|
|
|
114
108
|
};
|
|
115
109
|
|
|
116
110
|
case 'CLEAR_ERROR_NOTICE':
|
|
117
|
-
|
|
111
|
+
const {
|
|
112
|
+
[action.blockId]: blockId,
|
|
113
|
+
...restState
|
|
114
|
+
} = state;
|
|
115
|
+
return restState;
|
|
118
116
|
}
|
|
119
117
|
|
|
120
118
|
return state;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-directory/src/store/reducer.js"],"names":["downloadableBlocks","state","action","type","filterValue","isRequesting","results","blockManagement","installedBlockTypes","isInstalling","item","filter","blockType","name","blockId","errorNotices","message","isFatal"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-directory/src/store/reducer.js"],"names":["downloadableBlocks","state","action","type","filterValue","isRequesting","results","blockManagement","installedBlockTypes","isInstalling","item","filter","blockType","name","blockId","errorNotices","message","isFatal","restState"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,kBAAkB,GAAG,YAA0B;AAAA,MAAxBC,KAA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A;AACA;AACA;AACA;AACA;;;;;AACO,MAAMc,YAAY,GAAG,YAA0B;AAAA,MAAxBd,KAAwB,uEAAhB,EAAgB;AAAA,MAAZC,MAAY;;AACrD,UAASA,MAAM,CAACC,IAAhB;AACC,SAAK,kBAAL;AACC,aAAO,EACN,GAAGF,KADG;AAEN,SAAEC,MAAM,CAACY,OAAT,GAAoB;AACnBE,UAAAA,OAAO,EAAEd,MAAM,CAACc,OADG;AAEnBC,UAAAA,OAAO,EAAEf,MAAM,CAACe;AAFG;AAFd,OAAP;;AAOD,SAAK,oBAAL;AACC,YAAM;AAAE,SAAEf,MAAM,CAACY,OAAT,GAAoBA,OAAtB;AAA+B,WAAGI;AAAlC,UAAgDjB,KAAtD;AACA,aAAOiB,SAAP;AAXF;;AAaA,SAAOjB,KAAP;AACA,CAfM;;;;eAiBQ,2BAAiB;AAC/BD,EAAAA,kBAD+B;AAE/BO,EAAAA,eAF+B;AAG/BQ,EAAAA;AAH+B,CAAjB,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { 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"]}
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { omit } from 'lodash';
|
|
5
1
|
/**
|
|
6
2
|
* WordPress dependencies
|
|
7
3
|
*/
|
|
8
|
-
|
|
9
4
|
import { combineReducers } from '@wordpress/data';
|
|
10
5
|
/**
|
|
11
6
|
* Reducer returning an array of downloadable blocks.
|
|
@@ -99,7 +94,11 @@ export const errorNotices = function () {
|
|
|
99
94
|
};
|
|
100
95
|
|
|
101
96
|
case 'CLEAR_ERROR_NOTICE':
|
|
102
|
-
|
|
97
|
+
const {
|
|
98
|
+
[action.blockId]: blockId,
|
|
99
|
+
...restState
|
|
100
|
+
} = state;
|
|
101
|
+
return restState;
|
|
103
102
|
}
|
|
104
103
|
|
|
105
104
|
return state;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-directory/src/store/reducer.js"],"names":["
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-directory/src/store/reducer.js"],"names":["combineReducers","downloadableBlocks","state","action","type","filterValue","isRequesting","results","blockManagement","installedBlockTypes","isInstalling","item","filter","blockType","name","blockId","errorNotices","message","isFatal","restState"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,eAAT,QAAgC,iBAAhC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,kBAAkB,GAAG,YAA0B;AAAA,MAAxBC,KAAwB,uEAAhB,EAAgB;AAAA,MAAZC,MAAY;;AAC3D,UAASA,MAAM,CAACC,IAAhB;AACC,SAAK,2BAAL;AACC,aAAO,EACN,GAAGF,KADG;AAEN,SAAEC,MAAM,CAACE,WAAT,GAAwB;AACvBC,UAAAA,YAAY,EAAE;AADS;AAFlB,OAAP;;AAMD,SAAK,6BAAL;AACC,aAAO,EACN,GAAGJ,KADG;AAEN,SAAEC,MAAM,CAACE,WAAT,GAAwB;AACvBE,UAAAA,OAAO,EAAEJ,MAAM,CAACF,kBADO;AAEvBK,UAAAA,YAAY,EAAE;AAFS;AAFlB,OAAP;AATF;;AAiBA,SAAOJ,KAAP;AACA,CAnBM;AAqBP;AACA;AACA;AAC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AgDjB,KAAtD;AACA,aAAOiB,SAAP;AAXF;;AAaA,SAAOjB,KAAP;AACA,CAfM;AAiBP,eAAeF,eAAe,CAAE;AAC/BC,EAAAA,kBAD+B;AAE/BO,EAAAA,eAF+B;AAG/BQ,EAAAA;AAH+B,CAAF,CAA9B","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { 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"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-directory",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.15.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": "^
|
|
32
|
-
"@wordpress/blocks": "^11.
|
|
33
|
-
"@wordpress/components": "^
|
|
34
|
-
"@wordpress/compose": "^5.
|
|
35
|
-
"@wordpress/core-data": "^
|
|
36
|
-
"@wordpress/data": "^7.
|
|
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.17.0",
|
|
30
|
+
"@wordpress/api-fetch": "^6.14.0",
|
|
31
|
+
"@wordpress/block-editor": "^10.0.0",
|
|
32
|
+
"@wordpress/blocks": "^11.16.0",
|
|
33
|
+
"@wordpress/components": "^21.0.0",
|
|
34
|
+
"@wordpress/compose": "^5.15.0",
|
|
35
|
+
"@wordpress/core-data": "^5.0.0",
|
|
36
|
+
"@wordpress/data": "^7.1.0",
|
|
37
|
+
"@wordpress/edit-post": "^6.14.0",
|
|
38
|
+
"@wordpress/editor": "^12.16.0",
|
|
39
|
+
"@wordpress/element": "^4.15.0",
|
|
40
|
+
"@wordpress/hooks": "^3.17.0",
|
|
41
|
+
"@wordpress/html-entities": "^3.17.0",
|
|
42
|
+
"@wordpress/i18n": "^4.17.0",
|
|
43
|
+
"@wordpress/icons": "^9.8.0",
|
|
44
|
+
"@wordpress/notices": "^3.17.0",
|
|
45
|
+
"@wordpress/plugins": "^4.15.0",
|
|
46
|
+
"@wordpress/url": "^3.18.0",
|
|
47
47
|
"change-case": "^4.1.2",
|
|
48
48
|
"lodash": "^4.17.21"
|
|
49
49
|
},
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"publishConfig": {
|
|
55
55
|
"access": "public"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "0d732d4b184adcb28cc83087603e81b764390d4b"
|
|
58
58
|
}
|
package/src/store/reducer.js
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { omit } from 'lodash';
|
|
6
|
-
|
|
7
1
|
/**
|
|
8
2
|
* WordPress dependencies
|
|
9
3
|
*/
|
|
@@ -100,7 +94,8 @@ export const errorNotices = ( state = {}, action ) => {
|
|
|
100
94
|
},
|
|
101
95
|
};
|
|
102
96
|
case 'CLEAR_ERROR_NOTICE':
|
|
103
|
-
|
|
97
|
+
const { [ action.blockId ]: blockId, ...restState } = state;
|
|
98
|
+
return restState;
|
|
104
99
|
}
|
|
105
100
|
return state;
|
|
106
101
|
};
|