@panneau/core 2.0.42 → 2.0.51
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/es/contexts.js +19 -10
- package/es/index.js +2 -1
- package/es/utils.js +2 -1
- package/lib/contexts.js +19 -10
- package/lib/index.js +2 -1
- package/lib/utils.js +2 -1
- package/package.json +2 -2
package/es/contexts.js
CHANGED
|
@@ -7,8 +7,8 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
|
7
7
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
8
8
|
import uniqBy from 'lodash/uniqBy';
|
|
9
9
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
10
|
-
import isObject from 'lodash/isObject';
|
|
11
10
|
import { getJSON } from '@folklore/fetch';
|
|
11
|
+
import isObject from 'lodash/isObject';
|
|
12
12
|
import { loadGoogleApi, loadGoogleMaps } from '@folklore/services';
|
|
13
13
|
import { useIntl } from 'react-intl';
|
|
14
14
|
import { getDisplayName } from '@panneau/core/utils';
|
|
@@ -480,10 +480,13 @@ var GoogleKeysProvider = function GoogleKeysProvider(_ref) {
|
|
|
480
480
|
apiKey = _ref.apiKey;
|
|
481
481
|
var _useGoogleKeys = useGoogleKeys(),
|
|
482
482
|
previousApiKey = _useGoogleKeys.apiKey;
|
|
483
|
-
|
|
484
|
-
|
|
483
|
+
var value = useMemo(function () {
|
|
484
|
+
return {
|
|
485
485
|
apiKey: apiKey || previousApiKey
|
|
486
|
-
}
|
|
486
|
+
};
|
|
487
|
+
}, [previousApiKey, apiKey]);
|
|
488
|
+
return /*#__PURE__*/React.createElement(GoogleKeysContext.Provider, {
|
|
489
|
+
value: value
|
|
487
490
|
}, children);
|
|
488
491
|
};
|
|
489
492
|
GoogleKeysProvider.propTypes = propTypes$c;
|
|
@@ -869,14 +872,17 @@ var ModalsProvider = function ModalsProvider(_ref2) {
|
|
|
869
872
|
modalsRef.current = newModals;
|
|
870
873
|
}
|
|
871
874
|
}, [modals, setModals]);
|
|
872
|
-
|
|
873
|
-
|
|
875
|
+
var value = useMemo(function () {
|
|
876
|
+
return {
|
|
874
877
|
modals: modals,
|
|
875
878
|
container: container,
|
|
876
879
|
setContainer: setContainer,
|
|
877
880
|
register: register,
|
|
878
881
|
unregister: unregister
|
|
879
|
-
}
|
|
882
|
+
};
|
|
883
|
+
}, [modals, container, setContainer, register, unregister]);
|
|
884
|
+
return /*#__PURE__*/React.createElement(ModalsContext.Provider, {
|
|
885
|
+
value: value
|
|
880
886
|
}, children);
|
|
881
887
|
};
|
|
882
888
|
ModalsProvider.propTypes = propTypes$6;
|
|
@@ -952,14 +958,17 @@ var PanelsProvider = function PanelsProvider(_ref2) {
|
|
|
952
958
|
panelsRef.current = newPanels;
|
|
953
959
|
}
|
|
954
960
|
}, [panels, setPanels]);
|
|
955
|
-
|
|
956
|
-
|
|
961
|
+
var value = useMemo(function () {
|
|
962
|
+
return {
|
|
957
963
|
panels: panels,
|
|
958
964
|
setContainer: setContainer,
|
|
959
965
|
container: container,
|
|
960
966
|
register: register,
|
|
961
967
|
unregister: unregister
|
|
962
|
-
}
|
|
968
|
+
};
|
|
969
|
+
}, [panels, setContainer, container, register, unregister]);
|
|
970
|
+
return /*#__PURE__*/React.createElement(PanelsContext.Provider, {
|
|
971
|
+
value: value
|
|
963
972
|
}, children);
|
|
964
973
|
};
|
|
965
974
|
PanelsProvider.propTypes = propTypes$5;
|
package/es/index.js
CHANGED
|
@@ -230,12 +230,13 @@ var flattenComponents = function flattenComponents(components) {
|
|
|
230
230
|
|
|
231
231
|
var getComponentFromName = function getComponentFromName() {
|
|
232
232
|
var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
233
|
-
var components = arguments.length > 1 ? arguments[1] :
|
|
233
|
+
var components = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
234
234
|
var defaultComponent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
235
235
|
if (components === null || name === null) {
|
|
236
236
|
return defaultComponent;
|
|
237
237
|
}
|
|
238
238
|
var pascalName = pascalCase(name);
|
|
239
|
+
// console.log(name, pascalName, components);
|
|
239
240
|
var component = components[pascalName] || components[name] || defaultComponent;
|
|
240
241
|
if (!component) {
|
|
241
242
|
console.warn('Could not find component from name', name, pascalName, components);
|
package/es/utils.js
CHANGED
|
@@ -129,12 +129,13 @@ var getColumnsWithFields = function getColumnsWithFields(resource, columns) {
|
|
|
129
129
|
|
|
130
130
|
var getComponentFromName = function getComponentFromName() {
|
|
131
131
|
var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
132
|
-
var components = arguments.length > 1 ? arguments[1] :
|
|
132
|
+
var components = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
133
133
|
var defaultComponent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
134
134
|
if (components === null || name === null) {
|
|
135
135
|
return defaultComponent;
|
|
136
136
|
}
|
|
137
137
|
var pascalName = pascalCase(name);
|
|
138
|
+
// console.log(name, pascalName, components);
|
|
138
139
|
var component = components[pascalName] || components[name] || defaultComponent;
|
|
139
140
|
if (!component) {
|
|
140
141
|
console.warn('Could not find component from name', name, pascalName, components);
|
package/lib/contexts.js
CHANGED
|
@@ -11,8 +11,8 @@ var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
|
11
11
|
var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
|
|
12
12
|
var uniqBy = require('lodash/uniqBy');
|
|
13
13
|
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
14
|
-
var isObject = require('lodash/isObject');
|
|
15
14
|
var fetch = require('@folklore/fetch');
|
|
15
|
+
var isObject = require('lodash/isObject');
|
|
16
16
|
var services = require('@folklore/services');
|
|
17
17
|
var reactIntl = require('react-intl');
|
|
18
18
|
var utils = require('@panneau/core/utils');
|
|
@@ -515,10 +515,13 @@ var GoogleKeysProvider = function GoogleKeysProvider(_ref) {
|
|
|
515
515
|
apiKey = _ref.apiKey;
|
|
516
516
|
var _useGoogleKeys = useGoogleKeys(),
|
|
517
517
|
previousApiKey = _useGoogleKeys.apiKey;
|
|
518
|
-
|
|
519
|
-
|
|
518
|
+
var value = React.useMemo(function () {
|
|
519
|
+
return {
|
|
520
520
|
apiKey: apiKey || previousApiKey
|
|
521
|
-
}
|
|
521
|
+
};
|
|
522
|
+
}, [previousApiKey, apiKey]);
|
|
523
|
+
return /*#__PURE__*/React__default["default"].createElement(GoogleKeysContext.Provider, {
|
|
524
|
+
value: value
|
|
522
525
|
}, children);
|
|
523
526
|
};
|
|
524
527
|
GoogleKeysProvider.propTypes = propTypes$c;
|
|
@@ -904,14 +907,17 @@ var ModalsProvider = function ModalsProvider(_ref2) {
|
|
|
904
907
|
modalsRef.current = newModals;
|
|
905
908
|
}
|
|
906
909
|
}, [modals, setModals]);
|
|
907
|
-
|
|
908
|
-
|
|
910
|
+
var value = React.useMemo(function () {
|
|
911
|
+
return {
|
|
909
912
|
modals: modals,
|
|
910
913
|
container: container,
|
|
911
914
|
setContainer: setContainer,
|
|
912
915
|
register: register,
|
|
913
916
|
unregister: unregister
|
|
914
|
-
}
|
|
917
|
+
};
|
|
918
|
+
}, [modals, container, setContainer, register, unregister]);
|
|
919
|
+
return /*#__PURE__*/React__default["default"].createElement(ModalsContext.Provider, {
|
|
920
|
+
value: value
|
|
915
921
|
}, children);
|
|
916
922
|
};
|
|
917
923
|
ModalsProvider.propTypes = propTypes$6;
|
|
@@ -987,14 +993,17 @@ var PanelsProvider = function PanelsProvider(_ref2) {
|
|
|
987
993
|
panelsRef.current = newPanels;
|
|
988
994
|
}
|
|
989
995
|
}, [panels, setPanels]);
|
|
990
|
-
|
|
991
|
-
|
|
996
|
+
var value = React.useMemo(function () {
|
|
997
|
+
return {
|
|
992
998
|
panels: panels,
|
|
993
999
|
setContainer: setContainer,
|
|
994
1000
|
container: container,
|
|
995
1001
|
register: register,
|
|
996
1002
|
unregister: unregister
|
|
997
|
-
}
|
|
1003
|
+
};
|
|
1004
|
+
}, [panels, setContainer, container, register, unregister]);
|
|
1005
|
+
return /*#__PURE__*/React__default["default"].createElement(PanelsContext.Provider, {
|
|
1006
|
+
value: value
|
|
998
1007
|
}, children);
|
|
999
1008
|
};
|
|
1000
1009
|
PanelsProvider.propTypes = propTypes$5;
|
package/lib/index.js
CHANGED
|
@@ -252,12 +252,13 @@ var flattenComponents = function flattenComponents(components) {
|
|
|
252
252
|
|
|
253
253
|
var getComponentFromName = function getComponentFromName() {
|
|
254
254
|
var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
255
|
-
var components = arguments.length > 1 ? arguments[1] :
|
|
255
|
+
var components = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
256
256
|
var defaultComponent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
257
257
|
if (components === null || name === null) {
|
|
258
258
|
return defaultComponent;
|
|
259
259
|
}
|
|
260
260
|
var pascalName = changeCase.pascalCase(name);
|
|
261
|
+
// console.log(name, pascalName, components);
|
|
261
262
|
var component = components[pascalName] || components[name] || defaultComponent;
|
|
262
263
|
if (!component) {
|
|
263
264
|
console.warn('Could not find component from name', name, pascalName, components);
|
package/lib/utils.js
CHANGED
|
@@ -148,12 +148,13 @@ var getColumnsWithFields = function getColumnsWithFields(resource, columns) {
|
|
|
148
148
|
|
|
149
149
|
var getComponentFromName = function getComponentFromName() {
|
|
150
150
|
var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
151
|
-
var components = arguments.length > 1 ? arguments[1] :
|
|
151
|
+
var components = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
152
152
|
var defaultComponent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
153
153
|
if (components === null || name === null) {
|
|
154
154
|
return defaultComponent;
|
|
155
155
|
}
|
|
156
156
|
var pascalName = changeCase.pascalCase(name);
|
|
157
|
+
// console.log(name, pascalName, components);
|
|
157
158
|
var component = components[pascalName] || components[name] || defaultComponent;
|
|
158
159
|
if (!component) {
|
|
159
160
|
console.warn('Could not find component from name', name, pascalName, components);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@panneau/core",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.51",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -114,5 +114,5 @@
|
|
|
114
114
|
"publishConfig": {
|
|
115
115
|
"access": "public"
|
|
116
116
|
},
|
|
117
|
-
"gitHead": "
|
|
117
|
+
"gitHead": "dcdf30dd8429d6022ae69fff1ea7a101fc6d4e71"
|
|
118
118
|
}
|