@panneau/core 4.0.11 → 4.0.15
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/dist/contexts.d.ts +450 -0
- package/{es → dist}/contexts.js +170 -170
- package/dist/hooks.d.ts +362 -0
- package/{es → dist}/hooks.js +60 -60
- package/dist/index.d.ts +502 -0
- package/{es → dist}/index.js +7 -258
- package/dist/utils.d.ts +207 -0
- package/{es → dist}/utils.js +56 -57
- package/package.json +23 -23
- package/es/types/core.d.ts +0 -133
- package/es/types/form.d.ts +0 -58
- package/es/types/index.d.ts +0 -20
- package/es/types/panneau.d.ts +0 -50
- package/es/types/resource.d.ts +0 -112
- package/lib/contexts.js +0 -1432
- package/lib/hooks.js +0 -1168
- package/lib/index.js +0 -1019
- package/lib/utils.js +0 -789
package/{es → dist}/contexts.js
RENAMED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
2
|
-
import isString from 'lodash
|
|
3
|
-
import { createContext, useContext, useMemo, useState, useEffect, useRef, useCallback } from 'react';
|
|
2
|
+
import isString from 'lodash/isString';
|
|
3
|
+
import { createContext, useContext, useMemo, useState, use, useEffect, useRef, useCallback } from 'react';
|
|
4
4
|
import { ComponentsManager, FieldsManager, Tracking } from '@panneau/core';
|
|
5
5
|
import { jsx } from 'react/jsx-runtime';
|
|
6
6
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
7
7
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
8
|
-
import uniqBy from 'lodash
|
|
8
|
+
import uniqBy from 'lodash/uniqBy';
|
|
9
9
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
10
10
|
import { getJSON } from '@folklore/fetch';
|
|
11
|
-
import isObject from 'lodash
|
|
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';
|
|
@@ -35,21 +35,21 @@ var ComponentsContext = /*#__PURE__*/createContext(null);
|
|
|
35
35
|
/**
|
|
36
36
|
* Hooks
|
|
37
37
|
*/
|
|
38
|
-
|
|
38
|
+
function useComponentsManager() {
|
|
39
39
|
var namespace = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
40
40
|
var manager = useContext(ComponentsContext);
|
|
41
41
|
var finalManager = useMemo(function () {
|
|
42
42
|
return namespace !== null ? new ComponentsManager(manager.getComponents(namespace)) : manager;
|
|
43
43
|
}, [manager, namespace]);
|
|
44
44
|
return finalManager;
|
|
45
|
-
}
|
|
46
|
-
|
|
45
|
+
}
|
|
46
|
+
function useComponents() {
|
|
47
47
|
var namespace = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
48
48
|
var defaultComponents = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
49
49
|
var manager = useComponentsManager();
|
|
50
50
|
return manager.getComponents(namespace) || defaultComponents;
|
|
51
|
-
}
|
|
52
|
-
|
|
51
|
+
}
|
|
52
|
+
function useComponent(name) {
|
|
53
53
|
var defaultComponent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
54
54
|
var namespace = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
55
55
|
var manager = useComponentsManager(namespace);
|
|
@@ -59,172 +59,172 @@ var useComponent = function useComponent(name) {
|
|
|
59
59
|
}
|
|
60
60
|
return manager.getComponent(name) || defaultComponent;
|
|
61
61
|
}, [manager, name, defaultComponent]);
|
|
62
|
-
}
|
|
62
|
+
}
|
|
63
63
|
|
|
64
64
|
/**
|
|
65
65
|
* Fields hooks
|
|
66
66
|
*/
|
|
67
|
-
|
|
67
|
+
function useFieldsComponentsManager() {
|
|
68
68
|
return useComponentsManager(FIELDS_NAMESPACE);
|
|
69
|
-
}
|
|
70
|
-
|
|
69
|
+
}
|
|
70
|
+
function useFieldsComponents() {
|
|
71
71
|
var defaultComponents = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
72
72
|
return useComponents(FIELDS_NAMESPACE, defaultComponents);
|
|
73
|
-
}
|
|
74
|
-
|
|
73
|
+
}
|
|
74
|
+
function useFieldComponent(name) {
|
|
75
75
|
var defaultComponent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
76
76
|
return useComponent(name, defaultComponent, FIELDS_NAMESPACE);
|
|
77
|
-
}
|
|
77
|
+
}
|
|
78
78
|
|
|
79
79
|
/**
|
|
80
80
|
* Forms hooks
|
|
81
81
|
*/
|
|
82
|
-
|
|
82
|
+
function useFormsComponentsManager() {
|
|
83
83
|
return useComponentsManager(FORMS_NAMESPACE);
|
|
84
|
-
}
|
|
85
|
-
|
|
84
|
+
}
|
|
85
|
+
function useFormsComponents() {
|
|
86
86
|
var defaultComponents = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
87
87
|
return useComponents(FORMS_NAMESPACE, defaultComponents);
|
|
88
|
-
}
|
|
89
|
-
|
|
88
|
+
}
|
|
89
|
+
function useFormComponent(name) {
|
|
90
90
|
var defaultComponent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
91
91
|
return useComponent(name, defaultComponent, FORMS_NAMESPACE);
|
|
92
|
-
}
|
|
92
|
+
}
|
|
93
93
|
|
|
94
94
|
/**
|
|
95
95
|
* Modals hooks
|
|
96
96
|
*/
|
|
97
|
-
|
|
97
|
+
function useModalsComponentsManager() {
|
|
98
98
|
return useComponentsManager(MODALS_NAMESPACE);
|
|
99
|
-
}
|
|
100
|
-
|
|
99
|
+
}
|
|
100
|
+
function useModalsComponents() {
|
|
101
101
|
var defaultComponents = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
102
102
|
return useComponents(MODALS_NAMESPACE, defaultComponents);
|
|
103
|
-
}
|
|
104
|
-
|
|
103
|
+
}
|
|
104
|
+
function useModalComponent(name) {
|
|
105
105
|
var defaultComponent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
106
106
|
return useComponent(name, defaultComponent, MODALS_NAMESPACE);
|
|
107
|
-
}
|
|
107
|
+
}
|
|
108
108
|
|
|
109
109
|
/**
|
|
110
110
|
* Filters hooks
|
|
111
111
|
*/
|
|
112
|
-
|
|
112
|
+
function useFiltersComponentsManager() {
|
|
113
113
|
return useComponentsManager(FILTERS_NAMESPACE);
|
|
114
|
-
}
|
|
115
|
-
|
|
114
|
+
}
|
|
115
|
+
function useFiltersComponents() {
|
|
116
116
|
var defaultComponents = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
117
117
|
return useComponents(FILTERS_NAMESPACE, defaultComponents);
|
|
118
|
-
}
|
|
119
|
-
|
|
118
|
+
}
|
|
119
|
+
function useFilterComponent(name) {
|
|
120
120
|
var defaultComponent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
121
121
|
return useComponent(name, defaultComponent, FILTERS_NAMESPACE);
|
|
122
|
-
}
|
|
122
|
+
}
|
|
123
123
|
|
|
124
124
|
/**
|
|
125
125
|
* Lists hooks
|
|
126
126
|
*/
|
|
127
|
-
|
|
127
|
+
function useListsComponentsManager() {
|
|
128
128
|
return useComponentsManager(LISTS_NAMESPACE);
|
|
129
|
-
}
|
|
130
|
-
|
|
129
|
+
}
|
|
130
|
+
function useListsComponents() {
|
|
131
131
|
var defaultComponents = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
132
132
|
return useComponents(LISTS_NAMESPACE, defaultComponents);
|
|
133
|
-
}
|
|
134
|
-
|
|
133
|
+
}
|
|
134
|
+
function useListComponent(name) {
|
|
135
135
|
var defaultComponent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
136
136
|
return useComponent(name, defaultComponent, LISTS_NAMESPACE);
|
|
137
|
-
}
|
|
137
|
+
}
|
|
138
138
|
|
|
139
139
|
/**
|
|
140
140
|
* Displays hooks
|
|
141
141
|
*/
|
|
142
|
-
|
|
142
|
+
function useDisplaysComponentsManager() {
|
|
143
143
|
return useComponentsManager(DISPLAYS_NAMESPACE);
|
|
144
|
-
}
|
|
145
|
-
|
|
144
|
+
}
|
|
145
|
+
function useDisplaysComponents() {
|
|
146
146
|
var defaultComponents = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
147
147
|
return useComponents(DISPLAYS_NAMESPACE, defaultComponents);
|
|
148
|
-
}
|
|
149
|
-
|
|
148
|
+
}
|
|
149
|
+
function useDisplayComponent(name) {
|
|
150
150
|
var defaultComponent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
151
151
|
return useComponent(name, defaultComponent, DISPLAYS_NAMESPACE);
|
|
152
|
-
}
|
|
152
|
+
}
|
|
153
153
|
|
|
154
154
|
/**
|
|
155
155
|
* Actions hooks
|
|
156
156
|
*/
|
|
157
|
-
|
|
157
|
+
function useActionsComponentsManager() {
|
|
158
158
|
return useComponentsManager(ACTIONS_NAMESPACE);
|
|
159
|
-
}
|
|
160
|
-
|
|
159
|
+
}
|
|
160
|
+
function useActionsComponents() {
|
|
161
161
|
var defaultComponents = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
162
162
|
return useComponents(ACTIONS_NAMESPACE, defaultComponents);
|
|
163
|
-
}
|
|
164
|
-
|
|
163
|
+
}
|
|
164
|
+
function useActionComponent(name) {
|
|
165
165
|
var defaultComponent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
166
166
|
return useComponent(name, defaultComponent, ACTIONS_NAMESPACE);
|
|
167
|
-
}
|
|
167
|
+
}
|
|
168
168
|
|
|
169
169
|
/**
|
|
170
170
|
* Buttons hooks
|
|
171
171
|
*/
|
|
172
|
-
|
|
172
|
+
function useButtonsComponentsManager() {
|
|
173
173
|
return useComponentsManager(BUTTONS_NAMESPACE);
|
|
174
|
-
}
|
|
175
|
-
|
|
174
|
+
}
|
|
175
|
+
function useButtonsComponents() {
|
|
176
176
|
var defaultComponents = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
177
177
|
return useComponents(BUTTONS_NAMESPACE, defaultComponents);
|
|
178
|
-
}
|
|
179
|
-
|
|
178
|
+
}
|
|
179
|
+
function useButtonComponent(name) {
|
|
180
180
|
var defaultComponent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
181
181
|
return useComponent(name, defaultComponent, BUTTONS_NAMESPACE);
|
|
182
|
-
}
|
|
182
|
+
}
|
|
183
183
|
|
|
184
184
|
/**
|
|
185
185
|
* Pages hooks
|
|
186
186
|
*/
|
|
187
|
-
|
|
187
|
+
function usePagesComponentsManager() {
|
|
188
188
|
return useComponentsManager(PAGES_NAMESPACE);
|
|
189
|
-
}
|
|
190
|
-
|
|
189
|
+
}
|
|
190
|
+
function usePagesComponents() {
|
|
191
191
|
var defaultComponents = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
192
192
|
return useComponents(PAGES_NAMESPACE, defaultComponents);
|
|
193
|
-
}
|
|
194
|
-
|
|
193
|
+
}
|
|
194
|
+
function usePageComponent(name) {
|
|
195
195
|
var defaultComponent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
196
196
|
return useComponent(name, defaultComponent, PAGES_NAMESPACE);
|
|
197
|
-
}
|
|
197
|
+
}
|
|
198
198
|
|
|
199
199
|
/**
|
|
200
200
|
* Previews hooks
|
|
201
201
|
*/
|
|
202
|
-
|
|
202
|
+
function usePreviewsComponentsManager() {
|
|
203
203
|
return useComponentsManager(PREVIEWS_NAMESPACE);
|
|
204
|
-
}
|
|
205
|
-
|
|
204
|
+
}
|
|
205
|
+
function usePreviewsComponents() {
|
|
206
206
|
var defaultComponents = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
207
207
|
return useComponents(PREVIEWS_NAMESPACE, defaultComponents);
|
|
208
|
-
}
|
|
209
|
-
|
|
208
|
+
}
|
|
209
|
+
function usePreviewComponent(name) {
|
|
210
210
|
var defaultComponent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
211
211
|
return useComponent(name, defaultComponent, PREVIEWS_NAMESPACE);
|
|
212
|
-
}
|
|
212
|
+
}
|
|
213
213
|
|
|
214
214
|
/**
|
|
215
215
|
* App hooks
|
|
216
216
|
*/
|
|
217
|
-
|
|
217
|
+
function useAppComponentsManager() {
|
|
218
218
|
return useComponentsManager(APP_NAMESPACE);
|
|
219
|
-
}
|
|
220
|
-
|
|
219
|
+
}
|
|
220
|
+
function useAppComponents() {
|
|
221
221
|
var defaultComponents = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
222
222
|
return useComponents(APP_NAMESPACE, defaultComponents);
|
|
223
|
-
}
|
|
224
|
-
|
|
223
|
+
}
|
|
224
|
+
function useAppComponent(name) {
|
|
225
225
|
var defaultComponent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
226
226
|
return useComponent(name, defaultComponent, APP_NAMESPACE);
|
|
227
|
-
}
|
|
227
|
+
}
|
|
228
228
|
|
|
229
229
|
/**
|
|
230
230
|
* Provider
|
|
@@ -250,13 +250,13 @@ function ComponentsProvider(_ref) {
|
|
|
250
250
|
}
|
|
251
251
|
|
|
252
252
|
var DefinitionContext = /*#__PURE__*/createContext(null);
|
|
253
|
-
|
|
253
|
+
function useDefinitionContext() {
|
|
254
254
|
return useContext(DefinitionContext);
|
|
255
|
-
}
|
|
256
|
-
|
|
255
|
+
}
|
|
256
|
+
function useDefinition() {
|
|
257
257
|
var definition = useDefinitionContext();
|
|
258
258
|
return definition || null;
|
|
259
|
-
}
|
|
259
|
+
}
|
|
260
260
|
function DefinitionProvider(_ref) {
|
|
261
261
|
var definition = _ref.definition,
|
|
262
262
|
children = _ref.children;
|
|
@@ -267,17 +267,17 @@ function DefinitionProvider(_ref) {
|
|
|
267
267
|
}
|
|
268
268
|
|
|
269
269
|
var FieldsContext = /*#__PURE__*/createContext(null);
|
|
270
|
-
|
|
270
|
+
function useFieldsManager() {
|
|
271
271
|
return useContext(FieldsContext);
|
|
272
|
-
}
|
|
273
|
-
|
|
272
|
+
}
|
|
273
|
+
function useField(id) {
|
|
274
274
|
var manager = useFieldsManager();
|
|
275
275
|
return manager.getDefinition(id);
|
|
276
|
-
}
|
|
277
|
-
|
|
276
|
+
}
|
|
277
|
+
function useFields() {
|
|
278
278
|
var manager = useFieldsManager();
|
|
279
279
|
return manager.getDefinitions();
|
|
280
|
-
}
|
|
280
|
+
}
|
|
281
281
|
function FieldsProvider(_ref) {
|
|
282
282
|
var _ref$fields = _ref.fields,
|
|
283
283
|
fields = _ref$fields === void 0 ? null : _ref$fields,
|
|
@@ -312,9 +312,9 @@ function FieldsProvider(_ref) {
|
|
|
312
312
|
var GoogleKeysContext = /*#__PURE__*/createContext({
|
|
313
313
|
apiKey: null
|
|
314
314
|
});
|
|
315
|
-
|
|
315
|
+
function useGoogleKeys() {
|
|
316
316
|
return useContext(GoogleKeysContext);
|
|
317
|
-
}
|
|
317
|
+
}
|
|
318
318
|
function GoogleKeysProvider(_ref) {
|
|
319
319
|
var children = _ref.children,
|
|
320
320
|
_ref$apiKey = _ref.apiKey,
|
|
@@ -337,7 +337,7 @@ var FontsContext = /*#__PURE__*/createContext({
|
|
|
337
337
|
googleFonts: null,
|
|
338
338
|
customFonts: null
|
|
339
339
|
});
|
|
340
|
-
|
|
340
|
+
function useGoogleFonts() {
|
|
341
341
|
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
342
342
|
_ref$disabled = _ref.disabled,
|
|
343
343
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
@@ -376,20 +376,20 @@ var useGoogleFonts = function useGoogleFonts() {
|
|
|
376
376
|
};
|
|
377
377
|
}, [apiKey, disabled, setFonts, setGoogleFonts]);
|
|
378
378
|
return googleFonts;
|
|
379
|
-
}
|
|
380
|
-
|
|
379
|
+
}
|
|
380
|
+
function useFonts() {
|
|
381
381
|
var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
382
382
|
_ref3$withoutGoogleFo = _ref3.withoutGoogleFonts,
|
|
383
383
|
withoutGoogleFonts = _ref3$withoutGoogleFo === void 0 ? false : _ref3$withoutGoogleFo;
|
|
384
|
-
var
|
|
385
|
-
|
|
386
|
-
setGoogleFonts =
|
|
387
|
-
|
|
388
|
-
systemFonts =
|
|
389
|
-
|
|
390
|
-
googleFonts =
|
|
391
|
-
|
|
392
|
-
customFonts =
|
|
384
|
+
var _use = use(FontsContext),
|
|
385
|
+
_use$setGoogleFonts = _use.setGoogleFonts,
|
|
386
|
+
setGoogleFonts = _use$setGoogleFonts === void 0 ? null : _use$setGoogleFonts,
|
|
387
|
+
_use$systemFonts = _use.systemFonts,
|
|
388
|
+
systemFonts = _use$systemFonts === void 0 ? null : _use$systemFonts,
|
|
389
|
+
_use$googleFonts = _use.googleFonts,
|
|
390
|
+
googleFonts = _use$googleFonts === void 0 ? null : _use$googleFonts,
|
|
391
|
+
_use$customFonts = _use.customFonts,
|
|
392
|
+
customFonts = _use$customFonts === void 0 ? null : _use$customFonts;
|
|
393
393
|
useGoogleFonts({
|
|
394
394
|
disabled: withoutGoogleFonts || googleFonts !== null && googleFonts.length > 0,
|
|
395
395
|
setFonts: setGoogleFonts
|
|
@@ -402,7 +402,7 @@ var useFonts = function useFonts() {
|
|
|
402
402
|
};
|
|
403
403
|
}, [systemFonts, googleFonts, customFonts]);
|
|
404
404
|
return fonts;
|
|
405
|
-
}
|
|
405
|
+
}
|
|
406
406
|
var DEFAULT_SYSTEM_FONTS = ['Arial', 'Courier', 'Georgia', 'Times New Roman', 'Verdana'];
|
|
407
407
|
function FontsProvider(_ref4) {
|
|
408
408
|
var _ref4$systemFonts = _ref4.systemFonts,
|
|
@@ -442,19 +442,19 @@ function FontsProvider(_ref4) {
|
|
|
442
442
|
}
|
|
443
443
|
|
|
444
444
|
var FormContext = /*#__PURE__*/createContext(null);
|
|
445
|
-
|
|
446
|
-
return
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
var
|
|
450
|
-
value =
|
|
445
|
+
function useFormContext() {
|
|
446
|
+
return use(FormContext);
|
|
447
|
+
}
|
|
448
|
+
function useFormValue() {
|
|
449
|
+
var _useFormContext = useFormContext(),
|
|
450
|
+
value = _useFormContext.value;
|
|
451
451
|
return value;
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
var
|
|
455
|
-
setValue =
|
|
452
|
+
}
|
|
453
|
+
function useFormSetValue() {
|
|
454
|
+
var _useFormContext2 = useFormContext(),
|
|
455
|
+
setValue = _useFormContext2.setValue;
|
|
456
456
|
return setValue;
|
|
457
|
-
}
|
|
457
|
+
}
|
|
458
458
|
function FormProvider(_ref) {
|
|
459
459
|
var value = _ref.value,
|
|
460
460
|
setValue = _ref.setValue,
|
|
@@ -472,18 +472,18 @@ function FormProvider(_ref) {
|
|
|
472
472
|
}
|
|
473
473
|
|
|
474
474
|
var GoogleApiClientContext = /*#__PURE__*/createContext(null);
|
|
475
|
-
|
|
475
|
+
function useGoogleApiClient() {
|
|
476
476
|
return useContext(GoogleApiClientContext);
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
|
|
477
|
+
}
|
|
478
|
+
function withGoogleApiClient(WrappedComponent) {
|
|
479
|
+
function getDisplayName(_ref) {
|
|
480
480
|
var _ref$displayName = _ref.displayName,
|
|
481
481
|
displayName = _ref$displayName === void 0 ? null : _ref$displayName,
|
|
482
482
|
_ref$name = _ref.name,
|
|
483
483
|
name = _ref$name === void 0 ? null : _ref$name;
|
|
484
484
|
return displayName || name || 'Component';
|
|
485
|
-
}
|
|
486
|
-
|
|
485
|
+
}
|
|
486
|
+
function WithGoogleApiClientComponent(props) {
|
|
487
487
|
return /*#__PURE__*/jsx(GoogleApiClientContext.Consumer, {
|
|
488
488
|
children: function children(client) {
|
|
489
489
|
return /*#__PURE__*/jsx(WrappedComponent, _objectSpread({
|
|
@@ -491,10 +491,10 @@ var withGoogleApiClient = function withGoogleApiClient(WrappedComponent) {
|
|
|
491
491
|
}, props));
|
|
492
492
|
}
|
|
493
493
|
});
|
|
494
|
-
}
|
|
494
|
+
}
|
|
495
495
|
WithGoogleApiClientComponent.displayName = "WithGoogleApiClient(".concat(getDisplayName(WrappedComponent), ")");
|
|
496
496
|
return WithGoogleApiClientComponent;
|
|
497
|
-
}
|
|
497
|
+
}
|
|
498
498
|
function GoogleApiClientProvider(_ref2) {
|
|
499
499
|
var children = _ref2.children;
|
|
500
500
|
var _useGoogleKeys = useGoogleKeys(),
|
|
@@ -521,18 +521,18 @@ function GoogleApiClientProvider(_ref2) {
|
|
|
521
521
|
}
|
|
522
522
|
|
|
523
523
|
var GoogleMapsClientContext = /*#__PURE__*/createContext(null);
|
|
524
|
-
|
|
524
|
+
function useGoogleMapsClient() {
|
|
525
525
|
return useContext(GoogleMapsClientContext);
|
|
526
|
-
}
|
|
527
|
-
|
|
528
|
-
|
|
526
|
+
}
|
|
527
|
+
function withGoogleMapsClient(WrappedComponent) {
|
|
528
|
+
function getDisplayName(_ref) {
|
|
529
529
|
var _ref$displayName = _ref.displayName,
|
|
530
530
|
displayName = _ref$displayName === void 0 ? null : _ref$displayName,
|
|
531
531
|
_ref$name = _ref.name,
|
|
532
532
|
name = _ref$name === void 0 ? null : _ref$name;
|
|
533
533
|
return displayName || name || 'Component';
|
|
534
|
-
}
|
|
535
|
-
|
|
534
|
+
}
|
|
535
|
+
function WithGoogleMapsClientComponent(props) {
|
|
536
536
|
return /*#__PURE__*/jsx(GoogleMapsClientContext.Consumer, {
|
|
537
537
|
children: function children(client) {
|
|
538
538
|
return /*#__PURE__*/jsx(WrappedComponent, _objectSpread({
|
|
@@ -540,10 +540,10 @@ var withGoogleMapsClient = function withGoogleMapsClient(WrappedComponent) {
|
|
|
540
540
|
}, props));
|
|
541
541
|
}
|
|
542
542
|
});
|
|
543
|
-
}
|
|
543
|
+
}
|
|
544
544
|
WithGoogleMapsClientComponent.displayName = "WithGoogleMapsClient(".concat(getDisplayName(WrappedComponent), ")");
|
|
545
545
|
return WithGoogleMapsClientComponent;
|
|
546
|
-
}
|
|
546
|
+
}
|
|
547
547
|
function GoogleMapsClientProvider(_ref2) {
|
|
548
548
|
var children = _ref2.children,
|
|
549
549
|
_ref2$locale = _ref2.locale,
|
|
@@ -578,16 +578,16 @@ var defaultLocales = ['en', 'fr'];
|
|
|
578
578
|
var LocalesContext = /*#__PURE__*/createContext({
|
|
579
579
|
locales: defaultLocales
|
|
580
580
|
});
|
|
581
|
-
|
|
581
|
+
function useLocalesContext() {
|
|
582
582
|
var context = useContext(LocalesContext);
|
|
583
583
|
return context;
|
|
584
|
-
}
|
|
585
|
-
|
|
584
|
+
}
|
|
585
|
+
function useLocales() {
|
|
586
586
|
var _useLocalesContext = useLocalesContext(),
|
|
587
587
|
locales = _useLocalesContext.locales;
|
|
588
588
|
return locales;
|
|
589
|
-
}
|
|
590
|
-
|
|
589
|
+
}
|
|
590
|
+
function useOtherLocales() {
|
|
591
591
|
var _useLocalesContext2 = useLocalesContext(),
|
|
592
592
|
locales = _useLocalesContext2.locales;
|
|
593
593
|
var _useIntl = useIntl(),
|
|
@@ -598,7 +598,7 @@ var useOtherLocales = function useOtherLocales() {
|
|
|
598
598
|
});
|
|
599
599
|
}, [locales, locale]);
|
|
600
600
|
return otherLocales;
|
|
601
|
-
}
|
|
601
|
+
}
|
|
602
602
|
var DEFAULT_LOCALES = [];
|
|
603
603
|
function LocalesProvider(_ref) {
|
|
604
604
|
var _ref$locales = _ref.locales,
|
|
@@ -616,9 +616,9 @@ function LocalesProvider(_ref) {
|
|
|
616
616
|
}
|
|
617
617
|
|
|
618
618
|
var ModalContext = /*#__PURE__*/createContext(null);
|
|
619
|
-
|
|
619
|
+
function useModal() {
|
|
620
620
|
return useContext(ModalContext) || {};
|
|
621
|
-
}
|
|
621
|
+
}
|
|
622
622
|
var DEFAULT_MODALS = [];
|
|
623
623
|
function ModalProvider(_ref) {
|
|
624
624
|
var children = _ref.children,
|
|
@@ -715,11 +715,11 @@ var PanelsContext = /*#__PURE__*/createContext({
|
|
|
715
715
|
register: function register() {},
|
|
716
716
|
unregister: function unregister() {}
|
|
717
717
|
});
|
|
718
|
-
|
|
718
|
+
function usePanels() {
|
|
719
719
|
return useContext(PanelsContext) || {};
|
|
720
|
-
}
|
|
721
|
-
|
|
722
|
-
|
|
720
|
+
}
|
|
721
|
+
function withPanels(WrappedComponent) {
|
|
722
|
+
function WithPanelsComponent(props) {
|
|
723
723
|
return /*#__PURE__*/jsx(PanelsContext.Consumer, {
|
|
724
724
|
children: function children(_ref) {
|
|
725
725
|
var panels = _ref.panels,
|
|
@@ -736,10 +736,10 @@ var withPanels = function withPanels(WrappedComponent) {
|
|
|
736
736
|
}, props));
|
|
737
737
|
}
|
|
738
738
|
});
|
|
739
|
-
}
|
|
739
|
+
}
|
|
740
740
|
WithPanelsComponent.displayName = "WithPanels(".concat(getDisplayName(WrappedComponent), ")");
|
|
741
741
|
return WithPanelsComponent;
|
|
742
|
-
}
|
|
742
|
+
}
|
|
743
743
|
function PanelsProvider(_ref2) {
|
|
744
744
|
var children = _ref2.children,
|
|
745
745
|
_ref2$container = _ref2.container,
|
|
@@ -794,23 +794,23 @@ function PanelsProvider(_ref2) {
|
|
|
794
794
|
|
|
795
795
|
var _excluded = ["component"];
|
|
796
796
|
var PanneauContext = /*#__PURE__*/createContext(null);
|
|
797
|
-
|
|
797
|
+
function usePanneau() {
|
|
798
798
|
return useContext(PanneauContext);
|
|
799
|
-
}
|
|
799
|
+
}
|
|
800
800
|
var DEFAULT_RESOURCES = [];
|
|
801
|
-
|
|
801
|
+
function usePanneauResources() {
|
|
802
802
|
var _ref = usePanneau() || {},
|
|
803
803
|
_ref$resources = _ref.resources,
|
|
804
804
|
resources = _ref$resources === void 0 ? DEFAULT_RESOURCES : _ref$resources;
|
|
805
805
|
return resources;
|
|
806
|
-
}
|
|
807
|
-
|
|
806
|
+
}
|
|
807
|
+
function usePanneauResource(id) {
|
|
808
808
|
var resources = usePanneauResources();
|
|
809
809
|
return resources.find(function (it) {
|
|
810
810
|
return it.id === id;
|
|
811
811
|
}) || null;
|
|
812
|
-
}
|
|
813
|
-
|
|
812
|
+
}
|
|
813
|
+
function usePanneauColorScheme() {
|
|
814
814
|
var _ref2 = usePanneau() || {},
|
|
815
815
|
_ref2$theme = _ref2.theme,
|
|
816
816
|
theme = _ref2$theme === void 0 ? null : _ref2$theme;
|
|
@@ -833,42 +833,42 @@ var usePanneauColorScheme = function usePanneauColorScheme() {
|
|
|
833
833
|
background: null,
|
|
834
834
|
text: null
|
|
835
835
|
};
|
|
836
|
-
}
|
|
836
|
+
}
|
|
837
837
|
var DEFAULT_COMPONENTS = {};
|
|
838
|
-
|
|
838
|
+
function usePanneauComponents() {
|
|
839
839
|
var _ref4 = usePanneau() || {},
|
|
840
840
|
_ref4$components = _ref4.components,
|
|
841
841
|
components = _ref4$components === void 0 ? DEFAULT_COMPONENTS : _ref4$components;
|
|
842
842
|
return components;
|
|
843
|
-
}
|
|
844
|
-
|
|
843
|
+
}
|
|
844
|
+
function usePanneauComponent(namespace, name) {
|
|
845
845
|
var _ref5 = usePanneau() || {},
|
|
846
846
|
_ref5$components = _ref5.components,
|
|
847
847
|
components = _ref5$components === void 0 ? {} : _ref5$components;
|
|
848
848
|
var path = namespace !== null ? "".concat(namespace, ".").concat(name) : name || null;
|
|
849
|
-
var component = components[path] || null;
|
|
849
|
+
var component = path !== null ? components[path] || null : null;
|
|
850
850
|
if (isString(component)) {
|
|
851
851
|
return component;
|
|
852
852
|
}
|
|
853
|
-
if (isObject(component) && isString(component === null || component === void 0 ? void 0 : component.
|
|
853
|
+
if (isObject(component) && isString(component === null || component === void 0 ? void 0 : component.component)) {
|
|
854
854
|
component.component;
|
|
855
855
|
_objectWithoutProperties(component, _excluded);
|
|
856
856
|
return component.component;
|
|
857
857
|
}
|
|
858
858
|
return null;
|
|
859
|
-
}
|
|
860
|
-
|
|
859
|
+
}
|
|
860
|
+
function usePanneauAuth() {
|
|
861
861
|
var _ref6 = usePanneau() || {},
|
|
862
862
|
_ref6$auth = _ref6.auth,
|
|
863
863
|
auth = _ref6$auth === void 0 ? {} : _ref6$auth;
|
|
864
864
|
return auth;
|
|
865
|
-
}
|
|
866
|
-
|
|
865
|
+
}
|
|
866
|
+
function usePanneauSettings() {
|
|
867
867
|
var _ref7 = usePanneau() || {},
|
|
868
868
|
_ref7$settings = _ref7.settings,
|
|
869
869
|
settings = _ref7$settings === void 0 ? {} : _ref7$settings;
|
|
870
870
|
return settings;
|
|
871
|
-
}
|
|
871
|
+
}
|
|
872
872
|
function PanneauProvider(_ref8) {
|
|
873
873
|
var definition = _ref8.definition,
|
|
874
874
|
children = _ref8.children;
|
|
@@ -879,9 +879,9 @@ function PanneauProvider(_ref8) {
|
|
|
879
879
|
}
|
|
880
880
|
|
|
881
881
|
var ResourceContext = /*#__PURE__*/createContext(null);
|
|
882
|
-
|
|
883
|
-
return
|
|
884
|
-
}
|
|
882
|
+
function useResource() {
|
|
883
|
+
return use(ResourceContext);
|
|
884
|
+
}
|
|
885
885
|
function ResourceProvider(_ref) {
|
|
886
886
|
var resource = _ref.resource,
|
|
887
887
|
children = _ref.children;
|
|
@@ -891,7 +891,7 @@ function ResourceProvider(_ref) {
|
|
|
891
891
|
});
|
|
892
892
|
}
|
|
893
893
|
|
|
894
|
-
|
|
894
|
+
function useRoutePush() {
|
|
895
895
|
var url = useUrlGenerator();
|
|
896
896
|
var _useLocation = useLocation(),
|
|
897
897
|
_useLocation2 = _slicedToArray(_useLocation, 2),
|
|
@@ -912,8 +912,8 @@ var useRoutePush = function useRoutePush() {
|
|
|
912
912
|
}
|
|
913
913
|
}, [navigate, url]);
|
|
914
914
|
return push;
|
|
915
|
-
}
|
|
916
|
-
|
|
915
|
+
}
|
|
916
|
+
function useRouteBack() {
|
|
917
917
|
var url = useUrlGenerator();
|
|
918
918
|
var _useLocation3 = useLocation(),
|
|
919
919
|
_useLocation4 = _slicedToArray(_useLocation3, 2),
|
|
@@ -922,11 +922,11 @@ var useRouteBack = function useRouteBack() {
|
|
|
922
922
|
return navigate(-1);
|
|
923
923
|
}, [navigate, url]);
|
|
924
924
|
return back;
|
|
925
|
-
}
|
|
925
|
+
}
|
|
926
926
|
|
|
927
|
-
|
|
927
|
+
function useTracking() {
|
|
928
928
|
return useContext(TrackingContext);
|
|
929
|
-
}
|
|
929
|
+
}
|
|
930
930
|
function TrackingProvider(_ref) {
|
|
931
931
|
var _ref$variables = _ref.variables,
|
|
932
932
|
variables = _ref$variables === void 0 ? null : _ref$variables,
|
|
@@ -947,4 +947,4 @@ function TrackingProvider(_ref) {
|
|
|
947
947
|
});
|
|
948
948
|
}
|
|
949
949
|
|
|
950
|
-
export { ACTIONS_NAMESPACE, APP_NAMESPACE, BUTTONS_NAMESPACE, ComponentsContext, ComponentsProvider, DISPLAYS_NAMESPACE, DefinitionProvider, FIELDS_NAMESPACE, FILTERS_NAMESPACE, FORMS_NAMESPACE, FieldsContext, FieldsProvider, FontsContext, FontsProvider, FormProvider, GoogleApiClientContext, GoogleApiClientProvider, GoogleKeysContext, GoogleKeysProvider, GoogleMapsClientContext, GoogleMapsClientProvider, LISTS_NAMESPACE, LocalesContext, LocalesProvider, MODALS_NAMESPACE, ModalContext, ModalProvider, PAGES_NAMESPACE, PREVIEWS_NAMESPACE, PanelsContext, PanelsProvider, PanneauProvider, ResourceProvider, TrackingProvider, useActionComponent, useActionsComponents, useActionsComponentsManager, useAppComponent, useAppComponents, useAppComponentsManager, useButtonComponent, useButtonsComponents, useButtonsComponentsManager, useComponent, useComponents, useComponentsManager, useDefinition, useDefinitionContext, useDisplayComponent, useDisplaysComponents, useDisplaysComponentsManager, useField, useFieldComponent, useFields, useFieldsComponents, useFieldsComponentsManager, useFieldsManager, useFilterComponent, useFiltersComponents, useFiltersComponentsManager, useFonts,
|
|
950
|
+
export { ACTIONS_NAMESPACE, APP_NAMESPACE, BUTTONS_NAMESPACE, ComponentsContext, ComponentsProvider, DISPLAYS_NAMESPACE, DefinitionProvider, FIELDS_NAMESPACE, FILTERS_NAMESPACE, FORMS_NAMESPACE, FieldsContext, FieldsProvider, FontsContext, FontsProvider, FormProvider, GoogleApiClientContext, GoogleApiClientProvider, GoogleKeysContext, GoogleKeysProvider, GoogleMapsClientContext, GoogleMapsClientProvider, LISTS_NAMESPACE, LocalesContext, LocalesProvider, MODALS_NAMESPACE, ModalContext, ModalProvider, PAGES_NAMESPACE, PREVIEWS_NAMESPACE, PanelsContext, PanelsProvider, PanneauProvider, ResourceProvider, TrackingProvider, useActionComponent, useActionsComponents, useActionsComponentsManager, useAppComponent, useAppComponents, useAppComponentsManager, useButtonComponent, useButtonsComponents, useButtonsComponentsManager, useComponent, useComponents, useComponentsManager, useDefinition, useDefinitionContext, useDisplayComponent, useDisplaysComponents, useDisplaysComponentsManager, useField, useFieldComponent, useFields, useFieldsComponents, useFieldsComponentsManager, useFieldsManager, useFilterComponent, useFiltersComponents, useFiltersComponentsManager, useFonts, useFormComponent, useFormContext, useFormSetValue, useFormValue, useFormsComponents, useFormsComponentsManager, useGoogleApiClient, useGoogleFonts, useGoogleKeys, useGoogleMapsClient, useListComponent, useListsComponents, useListsComponentsManager, useLocales, useLocalesContext, useModal, useModalComponent, useModalsComponents, useModalsComponentsManager, useOtherLocales, usePageComponent, usePagesComponents, usePagesComponentsManager, usePanels, usePanneau, usePanneauAuth, usePanneauColorScheme, usePanneauComponent, usePanneauComponents, usePanneauResource, usePanneauResources, usePanneauSettings, usePreviewComponent, usePreviewsComponents, usePreviewsComponentsManager, useResource, useRouteBack, useRoutePush, useTracking, withGoogleApiClient, withGoogleMapsClient, withPanels };
|