@scaleflex/widget-core 4.4.0 → 4.5.1

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.
@@ -0,0 +1,18 @@
1
+ import { useContext, useMemo } from 'react';
2
+ import { FilerobotPackagesContext } from '../Providers';
3
+
4
+ // pluginsType => [acquirer, editor, modifier, uploader, progressindicator, orchestrator]
5
+ var usePluginsType = function usePluginsType(pluginsType) {
6
+ var _useContext = useContext(FilerobotPackagesContext),
7
+ plugins = _useContext.plugins;
8
+ return useMemo(function () {
9
+ if (pluginsType) {
10
+ var foundPlugins = plugins[pluginsType] || [];
11
+ return foundPlugins.filter(function (plugin) {
12
+ return !plugin.invisible;
13
+ });
14
+ }
15
+ return [];
16
+ }, [plugins, pluginsType]);
17
+ };
18
+ export default usePluginsType;