@websolutespa/bom-mixer-hooks 1.9.3 → 2.0.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 +268 -252
- package/dist/index.d.ts +3 -2
- package/dist/index.js +2 -1
- package/dist/index.mjs +2 -1
- package/package.json +8 -8
- package/src/useLayout/useLayout.tsx +10 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,252 +1,268 @@
|
|
|
1
|
-
# @websolutespa/bom-mixer-hooks
|
|
2
|
-
|
|
3
|
-
##
|
|
4
|
-
|
|
5
|
-
###
|
|
6
|
-
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
-
|
|
18
|
-
|
|
19
|
-
## 1.9.
|
|
20
|
-
|
|
21
|
-
### Patch Changes
|
|
22
|
-
|
|
23
|
-
- Modified:
|
|
24
|
-
- Updated dependencies
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
-
|
|
40
|
-
- Updated dependencies
|
|
41
|
-
- @websolutespa/bom-mixer-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
-
|
|
49
|
-
|
|
50
|
-
## 1.8.
|
|
51
|
-
|
|
52
|
-
### Patch Changes
|
|
53
|
-
|
|
54
|
-
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
-
|
|
129
|
-
-
|
|
130
|
-
- @websolutespa/bom-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
-
|
|
139
|
-
|
|
140
|
-
## 1.7.
|
|
141
|
-
|
|
142
|
-
### Patch Changes
|
|
143
|
-
|
|
144
|
-
-
|
|
145
|
-
- Updated dependencies
|
|
146
|
-
- @websolutespa/bom-mixer-models@1.7.
|
|
147
|
-
- @websolutespa/bom-mixer-store@1.7.
|
|
148
|
-
- @websolutespa/bom-core@1.7.
|
|
149
|
-
|
|
150
|
-
## 1.7.
|
|
151
|
-
|
|
152
|
-
### Patch Changes
|
|
153
|
-
|
|
154
|
-
-
|
|
155
|
-
|
|
156
|
-
## 1.7.
|
|
157
|
-
|
|
158
|
-
###
|
|
159
|
-
|
|
160
|
-
-
|
|
161
|
-
- Updated dependencies
|
|
162
|
-
- @websolutespa/bom-mixer-models@1.7.
|
|
163
|
-
- @websolutespa/bom-mixer-store@1.7.
|
|
164
|
-
- @websolutespa/bom-core@1.7.
|
|
165
|
-
|
|
166
|
-
## 1.
|
|
167
|
-
|
|
168
|
-
### Patch Changes
|
|
169
|
-
|
|
170
|
-
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
-
|
|
191
|
-
|
|
192
|
-
## 1.
|
|
193
|
-
|
|
194
|
-
###
|
|
195
|
-
|
|
196
|
-
- Added:
|
|
197
|
-
- Modified:
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
1
|
+
# @websolutespa/bom-mixer-hooks
|
|
2
|
+
|
|
3
|
+
## 2.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- Release: Bom 2.0
|
|
8
|
+
|
|
9
|
+
## 1.9.4
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Added: IApp global
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
- @websolutespa/bom-mixer-models@1.10.3
|
|
16
|
+
- @websolutespa/bom-mixer-store@1.10.1
|
|
17
|
+
- @websolutespa/bom-core@1.8.24
|
|
18
|
+
|
|
19
|
+
## 1.9.3
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- 0c7f05f: Modified: useMetaData canonical
|
|
24
|
+
- Updated dependencies [0c7f05f]
|
|
25
|
+
- Updated dependencies [0c7f05f]
|
|
26
|
+
- @websolutespa/bom-mixer-models@1.10.1
|
|
27
|
+
- @websolutespa/bom-core@1.8.23
|
|
28
|
+
|
|
29
|
+
## 1.9.2
|
|
30
|
+
|
|
31
|
+
### Patch Changes
|
|
32
|
+
|
|
33
|
+
- 4c2d7a6: Added: useScrollDirection
|
|
34
|
+
|
|
35
|
+
## 1.9.1
|
|
36
|
+
|
|
37
|
+
### Patch Changes
|
|
38
|
+
|
|
39
|
+
- Modified: MetaData Meta added xDefault
|
|
40
|
+
- Updated dependencies
|
|
41
|
+
- @websolutespa/bom-mixer-models@1.9.5
|
|
42
|
+
|
|
43
|
+
## 1.9.0
|
|
44
|
+
|
|
45
|
+
### Minor Changes
|
|
46
|
+
|
|
47
|
+
- Modified: usePagination
|
|
48
|
+
- Added: useMetaData
|
|
49
|
+
|
|
50
|
+
## 1.8.11
|
|
51
|
+
|
|
52
|
+
### Patch Changes
|
|
53
|
+
|
|
54
|
+
- Modified: usePage typings
|
|
55
|
+
- Updated dependencies
|
|
56
|
+
- Updated dependencies
|
|
57
|
+
- @websolutespa/bom-mixer-store@1.8.11
|
|
58
|
+
- @websolutespa/bom-mixer-models@1.8.18
|
|
59
|
+
|
|
60
|
+
## 1.8.10
|
|
61
|
+
|
|
62
|
+
### Patch Changes
|
|
63
|
+
|
|
64
|
+
- 88267c3: Modified: useAutosizeTextArea
|
|
65
|
+
|
|
66
|
+
## 1.8.9
|
|
67
|
+
|
|
68
|
+
### Patch Changes
|
|
69
|
+
|
|
70
|
+
- 3a7fc91: Added: useAutosizeTextArea, useColorScheme, useFocusTrap, useReducedMotion
|
|
71
|
+
|
|
72
|
+
## 1.8.8
|
|
73
|
+
|
|
74
|
+
### Patch Changes
|
|
75
|
+
|
|
76
|
+
- Modified: useGenericContext returning context
|
|
77
|
+
|
|
78
|
+
## 1.8.7
|
|
79
|
+
|
|
80
|
+
### Patch Changes
|
|
81
|
+
|
|
82
|
+
- b43eb2e: Modified: useSearchParams shallow routing
|
|
83
|
+
|
|
84
|
+
## 1.8.6
|
|
85
|
+
|
|
86
|
+
### Patch Changes
|
|
87
|
+
|
|
88
|
+
- Modified: SearchParamsEncoded
|
|
89
|
+
|
|
90
|
+
## 1.8.5
|
|
91
|
+
|
|
92
|
+
### Patch Changes
|
|
93
|
+
|
|
94
|
+
- Modified: useSearchParams, useSearchParamsEncoded, useSearchParamsQs scroll false
|
|
95
|
+
|
|
96
|
+
## 1.8.4
|
|
97
|
+
|
|
98
|
+
### Patch Changes
|
|
99
|
+
|
|
100
|
+
- Modified: usePageLoading, shallow routes do not fire loading state
|
|
101
|
+
|
|
102
|
+
## 1.8.3
|
|
103
|
+
|
|
104
|
+
### Patch Changes
|
|
105
|
+
|
|
106
|
+
- Added: usePageLoading
|
|
107
|
+
- Modified: useSearchParams, useSearchParamsEncoded, useSearchParamsQs
|
|
108
|
+
|
|
109
|
+
## 1.8.2
|
|
110
|
+
|
|
111
|
+
### Patch Changes
|
|
112
|
+
|
|
113
|
+
- Modified: useSearchParams, useSearchParamsEncoded, useSearchParamsQs added pushParams
|
|
114
|
+
|
|
115
|
+
## 1.8.1
|
|
116
|
+
|
|
117
|
+
### Patch Changes
|
|
118
|
+
|
|
119
|
+
- Updated dependencies
|
|
120
|
+
- @websolutespa/bom-core@1.8.5
|
|
121
|
+
|
|
122
|
+
## 1.8.0
|
|
123
|
+
|
|
124
|
+
### Minor Changes
|
|
125
|
+
|
|
126
|
+
- f8a1d97: Modified: removed sample hooks
|
|
127
|
+
- Updated dependencies [f8a1d97]
|
|
128
|
+
- @websolutespa/bom-mixer-models@1.8.0
|
|
129
|
+
- @websolutespa/bom-mixer-store@1.8.0
|
|
130
|
+
- @websolutespa/bom-core@1.8.0
|
|
131
|
+
|
|
132
|
+
## 1.7.5
|
|
133
|
+
|
|
134
|
+
### Patch Changes
|
|
135
|
+
|
|
136
|
+
- Added: getRemoteApiRequestOptions, getLocalApiRequestOptions
|
|
137
|
+
- Updated dependencies
|
|
138
|
+
- @websolutespa/bom-mixer-store@1.7.7
|
|
139
|
+
|
|
140
|
+
## 1.7.4
|
|
141
|
+
|
|
142
|
+
### Patch Changes
|
|
143
|
+
|
|
144
|
+
- Fixing: downgrading eslint to v8.56.0
|
|
145
|
+
- Updated dependencies
|
|
146
|
+
- @websolutespa/bom-mixer-models@1.7.6
|
|
147
|
+
- @websolutespa/bom-mixer-store@1.7.5
|
|
148
|
+
- @websolutespa/bom-core@1.7.8
|
|
149
|
+
|
|
150
|
+
## 1.7.3
|
|
151
|
+
|
|
152
|
+
### Patch Changes
|
|
153
|
+
|
|
154
|
+
- Modified: useIntersectionObserver
|
|
155
|
+
|
|
156
|
+
## 1.7.2
|
|
157
|
+
|
|
158
|
+
### Patch Changes
|
|
159
|
+
|
|
160
|
+
- Updating: dependencies
|
|
161
|
+
- Updated dependencies
|
|
162
|
+
- @websolutespa/bom-mixer-models@1.7.2
|
|
163
|
+
- @websolutespa/bom-mixer-store@1.7.3
|
|
164
|
+
- @websolutespa/bom-core@1.7.3
|
|
165
|
+
|
|
166
|
+
## 1.7.1
|
|
167
|
+
|
|
168
|
+
### Patch Changes
|
|
169
|
+
|
|
170
|
+
- aa41666: Added: useIntersectionObserver
|
|
171
|
+
|
|
172
|
+
## 1.7.0
|
|
173
|
+
|
|
174
|
+
### Minor Changes
|
|
175
|
+
|
|
176
|
+
- 28e86bd: Modified: IPage, Store services & decorators
|
|
177
|
+
- Updated dependencies [28e86bd]
|
|
178
|
+
- @websolutespa/bom-mixer-models@1.7.0
|
|
179
|
+
- @websolutespa/bom-mixer-store@1.7.0
|
|
180
|
+
- @websolutespa/bom-core@1.7.0
|
|
181
|
+
|
|
182
|
+
## 1.4.2
|
|
183
|
+
|
|
184
|
+
### Patch Changes
|
|
185
|
+
|
|
186
|
+
- Modified: IFeatureType
|
|
187
|
+
- Updated dependencies
|
|
188
|
+
- @websolutespa/bom-mixer-models@1.5.4
|
|
189
|
+
- @websolutespa/bom-mixer-store@1.4.3
|
|
190
|
+
- @websolutespa/bom-core@0.6.5
|
|
191
|
+
|
|
192
|
+
## 1.4.1
|
|
193
|
+
|
|
194
|
+
### Patch Changes
|
|
195
|
+
|
|
196
|
+
- Added: useCollectionApi, useExtra
|
|
197
|
+
- Modified: usePagination, useSearchParamsQs
|
|
198
|
+
- Updated dependencies
|
|
199
|
+
- @websolutespa/bom-mixer-models@1.5.2
|
|
200
|
+
- @websolutespa/bom-core@0.6.2
|
|
201
|
+
|
|
202
|
+
## 1.4.0
|
|
203
|
+
|
|
204
|
+
### Minor Changes
|
|
205
|
+
|
|
206
|
+
- Added useLazyModules
|
|
207
|
+
|
|
208
|
+
## 1.3.0
|
|
209
|
+
|
|
210
|
+
### Minor Changes
|
|
211
|
+
|
|
212
|
+
- Added: useSearchParamsQs
|
|
213
|
+
- Modified: useSearchParamsEncoded, useSearchParams, useScrollTo
|
|
214
|
+
|
|
215
|
+
## 1.2.1
|
|
216
|
+
|
|
217
|
+
### Patch Changes
|
|
218
|
+
|
|
219
|
+
- Added: LabelService
|
|
220
|
+
- Modified: useLabels, useScrollTo
|
|
221
|
+
|
|
222
|
+
## 1.2.0
|
|
223
|
+
|
|
224
|
+
### Minor Changes
|
|
225
|
+
|
|
226
|
+
- Updating: next 13
|
|
227
|
+
|
|
228
|
+
## 1.1.0
|
|
229
|
+
|
|
230
|
+
### Minor Changes
|
|
231
|
+
|
|
232
|
+
- Modified: useHttp, useApi
|
|
233
|
+
|
|
234
|
+
## 1.0.0
|
|
235
|
+
|
|
236
|
+
### Minor Changes
|
|
237
|
+
|
|
238
|
+
- Added: useScrolled
|
|
239
|
+
|
|
240
|
+
## 0.2.2
|
|
241
|
+
|
|
242
|
+
### Patch Changes
|
|
243
|
+
|
|
244
|
+
- Modified: useBreakpoint theme mediaQuery
|
|
245
|
+
|
|
246
|
+
## 0.2.1
|
|
247
|
+
|
|
248
|
+
### Patch Changes
|
|
249
|
+
|
|
250
|
+
- Added: source files
|
|
251
|
+
|
|
252
|
+
## 0.2.0
|
|
253
|
+
|
|
254
|
+
### Minor Changes
|
|
255
|
+
|
|
256
|
+
- Added: splat routes
|
|
257
|
+
|
|
258
|
+
## 0.1.0
|
|
259
|
+
|
|
260
|
+
### Minor Changes
|
|
261
|
+
|
|
262
|
+
- Added: @websolutespa/bom-core
|
|
263
|
+
|
|
264
|
+
## 0.0.2
|
|
265
|
+
|
|
266
|
+
### Patch Changes
|
|
267
|
+
|
|
268
|
+
- Added: first release
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as react from 'react';
|
|
|
2
2
|
import react__default, { RefObject, Dispatch, SetStateAction, CSSProperties, MutableRefObject, ComponentProps, useEffect } from 'react';
|
|
3
3
|
import { ApiRequestOptions } from '@websolutespa/bom-mixer-store';
|
|
4
4
|
import * as _websolutespa_bom_core from '@websolutespa/bom-core';
|
|
5
|
-
import { QueryParams, IEquatable, IFeatureType, ILabel, ILocalizable, ILayout, ILocalized, IPage } from '@websolutespa/bom-core';
|
|
5
|
+
import { QueryParams, IEquatable, IFeatureType, ILabel, ILocalizable, ILayout, IAppExtended, ILocalized, IPage } from '@websolutespa/bom-core';
|
|
6
6
|
import * as zustand from 'zustand';
|
|
7
7
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
8
8
|
import { ILazyModules, IMetaData, StructuredDataType, OpenGraphType, TwitterCardType } from '@websolutespa/bom-mixer-models';
|
|
@@ -392,11 +392,12 @@ declare function parseLabel(dictionary: Record<string, ILocalizable | undefined>
|
|
|
392
392
|
declare function parseParams(label: string, params: Record<string, any>): string;
|
|
393
393
|
|
|
394
394
|
type ILayoutContext = ILayout;
|
|
395
|
-
declare const useLayout: () => ILayout;
|
|
396
395
|
declare function LayoutProvider({ children, layout }: {
|
|
397
396
|
children?: react__default.ReactNode;
|
|
398
397
|
layout: ILayout;
|
|
399
398
|
}): react_jsx_runtime.JSX.Element;
|
|
399
|
+
type UseLayout = <T extends IAppExtended = IAppExtended>() => ILayout<T>;
|
|
400
|
+
declare const useLayout: UseLayout;
|
|
400
401
|
|
|
401
402
|
type ILazyModulesContext = ILazyModules;
|
|
402
403
|
declare const useLazyModules: () => ILazyModules;
|
package/dist/index.js
CHANGED
|
@@ -248,10 +248,11 @@ var createGenericContext = (defaultContext = null) => {
|
|
|
248
248
|
|
|
249
249
|
// src/useLayout/useLayout.tsx
|
|
250
250
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
251
|
-
var [
|
|
251
|
+
var [useLayout_, LayoutContextProvider] = createGenericContext();
|
|
252
252
|
function LayoutProvider({ children, layout }) {
|
|
253
253
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LayoutContextProvider, { value: layout, children });
|
|
254
254
|
}
|
|
255
|
+
var useLayout = useLayout_;
|
|
255
256
|
|
|
256
257
|
// src/useApi/useApi.ts
|
|
257
258
|
function useApiFetch(pathname, options = {}) {
|
package/dist/index.mjs
CHANGED
|
@@ -93,10 +93,11 @@ var createGenericContext = (defaultContext = null) => {
|
|
|
93
93
|
|
|
94
94
|
// src/useLayout/useLayout.tsx
|
|
95
95
|
import { jsx } from "react/jsx-runtime";
|
|
96
|
-
var [
|
|
96
|
+
var [useLayout_, LayoutContextProvider] = createGenericContext();
|
|
97
97
|
function LayoutProvider({ children, layout }) {
|
|
98
98
|
return /* @__PURE__ */ jsx(LayoutContextProvider, { value: layout, children });
|
|
99
99
|
}
|
|
100
|
+
var useLayout = useLayout_;
|
|
100
101
|
|
|
101
102
|
// src/useApi/useApi.ts
|
|
102
103
|
function useApiFetch(pathname, options = {}) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@websolutespa/bom-mixer-hooks",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Mixer Hooks module of the BOM Repository",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bom",
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {},
|
|
26
26
|
"peerDependencies": {
|
|
27
|
-
"@websolutespa/bom-core": "
|
|
28
|
-
"@websolutespa/bom-mixer-models": "
|
|
29
|
-
"@websolutespa/bom-mixer-store": "
|
|
27
|
+
"@websolutespa/bom-core": "^2.0.0",
|
|
28
|
+
"@websolutespa/bom-mixer-models": "^2.0.0",
|
|
29
|
+
"@websolutespa/bom-mixer-store": "^2.0.0",
|
|
30
30
|
"framer-motion": ">= 7.2.1",
|
|
31
31
|
"html-to-text": "^9.0.5",
|
|
32
32
|
"iron-session": ">= 8.0.3",
|
|
@@ -41,11 +41,11 @@
|
|
|
41
41
|
"@types/react": "^18.2.75",
|
|
42
42
|
"@types/react-dom": "^18.2.24",
|
|
43
43
|
"@types/styled-components": "^5.1.26",
|
|
44
|
-
"@websolutespa/bom-cli": "
|
|
45
|
-
"@websolutespa/test": "
|
|
46
|
-
"@websolutespa/tsconfig": "
|
|
44
|
+
"@websolutespa/bom-cli": "^2.0.0",
|
|
45
|
+
"@websolutespa/test": "^2.0.0",
|
|
46
|
+
"@websolutespa/tsconfig": "^2.0.0",
|
|
47
47
|
"eslint": "^8.56.0",
|
|
48
|
-
"eslint-config-websolute": "
|
|
48
|
+
"eslint-config-websolute": "^2.0.0",
|
|
49
49
|
"npm-run-all": "^4.1.5",
|
|
50
50
|
"raw-loader": "^4.0.2",
|
|
51
51
|
"react": "^18.2.0",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ILayout } from '@websolutespa/bom-core';
|
|
1
|
+
import { IAppExtended, ILayout } from '@websolutespa/bom-core';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { createGenericContext } from '../useGenericContext/useGenericContext';
|
|
4
4
|
|
|
5
5
|
export type ILayoutContext = ILayout;
|
|
6
6
|
|
|
7
|
-
const [
|
|
7
|
+
const [useLayout_, LayoutContextProvider] = createGenericContext<ILayoutContext>();
|
|
8
8
|
|
|
9
9
|
function LayoutProvider({ children, layout }: { children?: React.ReactNode, layout: ILayout }) {
|
|
10
10
|
// console.log('LayoutProvider.context', context);
|
|
@@ -15,5 +15,12 @@ function LayoutProvider({ children, layout }: { children?: React.ReactNode, layo
|
|
|
15
15
|
);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
type UseLayout = <T extends IAppExtended = IAppExtended>() => ILayout<T>;
|
|
19
|
+
|
|
20
|
+
const useLayout:UseLayout = useLayout_ as UseLayout;
|
|
21
|
+
|
|
22
|
+
export {
|
|
23
|
+
LayoutProvider,
|
|
24
|
+
useLayout
|
|
25
|
+
};
|
|
19
26
|
|