@plone/volto 17.0.0-alpha.15 → 17.0.0-alpha.17
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/.yarn/install-state.gz +0 -0
- package/CHANGELOG.md +30 -0
- package/cypress/support/commands.js +18 -0
- package/locales/ca/LC_MESSAGES/volto.po +41 -0
- package/locales/ca.json +1 -1
- package/locales/de/LC_MESSAGES/volto.po +41 -0
- package/locales/de.json +1 -1
- package/locales/en/LC_MESSAGES/volto.po +41 -0
- package/locales/en.json +1 -1
- package/locales/es/LC_MESSAGES/volto.po +41 -0
- package/locales/es.json +1 -1
- package/locales/eu/LC_MESSAGES/volto.po +41 -0
- package/locales/eu.json +1 -1
- package/locales/fi/LC_MESSAGES/volto.po +41 -0
- package/locales/fi.json +1 -1
- package/locales/fr/LC_MESSAGES/volto.po +41 -0
- package/locales/fr.json +1 -1
- package/locales/it/LC_MESSAGES/volto.po +41 -0
- package/locales/it.json +1 -1
- package/locales/ja/LC_MESSAGES/volto.po +41 -0
- package/locales/ja.json +1 -1
- package/locales/nl/LC_MESSAGES/volto.po +41 -0
- package/locales/nl.json +1 -1
- package/locales/pt/LC_MESSAGES/volto.po +41 -0
- package/locales/pt.json +1 -1
- package/locales/pt_BR/LC_MESSAGES/volto.po +41 -0
- package/locales/pt_BR.json +1 -1
- package/locales/ro/LC_MESSAGES/volto.po +41 -0
- package/locales/ro.json +1 -1
- package/locales/volto.pot +42 -1
- package/locales/zh_CN/LC_MESSAGES/volto.po +41 -0
- package/locales/zh_CN.json +1 -1
- package/news/4351.bugfix +1 -0
- package/news/4725.bugfix +1 -0
- package/news/4932.bugfix +1 -0
- package/news/4941.documentation +1 -0
- package/news/4951.breaking +1 -0
- package/news/4962.feature +1 -0
- package/news/4964.bugfix +1 -0
- package/package.json +1 -1
- package/packages/volto-slate/package.json +1 -1
- package/packages/volto-slate/src/blocks/Text/index.js +8 -0
- package/src/components/manage/Blocks/Block/BlocksForm.jsx +19 -2
- package/src/components/manage/Blocks/Block/Edit.jsx +1 -1
- package/src/components/manage/Blocks/Container/Data.jsx +32 -0
- package/src/components/manage/Blocks/Container/Edit.jsx +174 -0
- package/src/components/manage/Blocks/Container/EditBlockWrapper.jsx +120 -0
- package/src/components/manage/Blocks/Container/NewBlockAddButton.jsx +84 -0
- package/src/components/manage/Blocks/Container/SimpleContainerToolbar.jsx +54 -0
- package/src/components/manage/Blocks/Grid/Edit.jsx +33 -0
- package/src/components/manage/Blocks/Grid/View.jsx +43 -0
- package/src/components/manage/Blocks/Grid/adapter.js +14 -0
- package/src/components/manage/Blocks/Grid/grid-1.svg +6 -0
- package/src/components/manage/Blocks/Grid/grid-2.svg +9 -0
- package/src/components/manage/Blocks/Grid/grid-3.svg +10 -0
- package/src/components/manage/Blocks/Grid/grid-4.svg +11 -0
- package/src/components/manage/Blocks/Grid/schema.js +35 -0
- package/src/components/manage/Blocks/Grid/templates.js +47 -0
- package/src/components/manage/Blocks/Image/ImageSidebar.jsx +2 -1
- package/src/components/manage/Blocks/Image/schema.js +11 -0
- package/src/components/manage/Blocks/Listing/withQuerystringResults.jsx +3 -4
- package/src/components/manage/Blocks/Teaser/Body.jsx +0 -1
- package/src/components/manage/Blocks/Teaser/DefaultBody.jsx +20 -15
- package/src/components/manage/Blocks/Teaser/schema.js +5 -0
- package/src/components/manage/DragDropList/DragDropList.jsx +18 -13
- package/src/components/manage/TemplateChooser/TemplateChooser.jsx +38 -0
- package/src/components/manage/TemplateChooser/TemplateChooser.test.jsx +34 -0
- package/src/components/manage/TemplateChooser/template.svg +10 -0
- package/src/components/manage/UniversalLink/UniversalLink.jsx +2 -6
- package/src/components/manage/UniversalLink/UniversalLink.test.jsx +36 -0
- package/src/components/theme/Anontools/Anontools.jsx +3 -4
- package/src/components/theme/Component/Component.jsx +1 -1
- package/src/components/theme/Header/Header.jsx +2 -2
- package/src/components/theme/View/AlbumView.jsx +9 -1
- package/src/components/theme/View/EventView.jsx +6 -2
- package/src/components/theme/View/FileView.jsx +23 -18
- package/src/components/theme/View/ImageView.jsx +37 -32
- package/src/components/theme/View/LinkView.jsx +4 -1
- package/src/components/theme/View/ListingView.jsx +33 -27
- package/src/components/theme/View/RenderBlocks.jsx +56 -27
- package/src/components/theme/View/RenderEmptyBlock.jsx +5 -0
- package/src/components/theme/View/SummaryView.jsx +47 -38
- package/src/components/theme/View/TabularView.jsx +59 -53
- package/src/config/Blocks.jsx +44 -0
- package/src/helpers/Blocks/Blocks.js +26 -0
- package/src/helpers/Blocks/Blocks.test.js +21 -0
- package/src/helpers/Utils/Utils.js +25 -0
- package/src/helpers/index.js +2 -0
- package/src/hooks/index.js +0 -1
- package/src/icons/grid-block.svg +11 -0
- package/theme/themes/pastanaga/extras/grid.less +426 -0
- package/theme/themes/pastanaga/extras/main.less +1 -0
- package/src/hooks/content/useContent.js +0 -31
- package/src/hooks/userSession/useToken.js +0 -5
|
@@ -0,0 +1,426 @@
|
|
|
1
|
+
// Row block
|
|
2
|
+
@blueArctic: #e2f1fd;
|
|
3
|
+
@greySnow: #f3f5f7;
|
|
4
|
+
@greySmoke: #e4e8ec;
|
|
5
|
+
@grid-images-aspect-ratio: var(--grid-images-aspect-ratio, 16/9);
|
|
6
|
+
@grid-images-object-position: var(--grid-images-object-position, top left);
|
|
7
|
+
|
|
8
|
+
.block-editor-gridBlock {
|
|
9
|
+
position: relative;
|
|
10
|
+
// Removed because it broke the z-index of the blockChooser, making it fall behind
|
|
11
|
+
// z-index: 10;
|
|
12
|
+
|
|
13
|
+
.block {
|
|
14
|
+
height: 100%;
|
|
15
|
+
|
|
16
|
+
.image {
|
|
17
|
+
& > div {
|
|
18
|
+
height: 100%;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
& > div > div {
|
|
22
|
+
height: 100%;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
[class^='block-editor-'].contained {
|
|
29
|
+
.block {
|
|
30
|
+
height: 100%;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.block-editor-image.contained {
|
|
34
|
+
.image {
|
|
35
|
+
& > div {
|
|
36
|
+
height: 100%;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
& > div > div {
|
|
40
|
+
height: 100%;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.ui.message {
|
|
46
|
+
height: 100%;
|
|
47
|
+
margin: 0;
|
|
48
|
+
border-radius: 6px;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Override handler TODO: do it better (when using QuantaToolbar, only for grids)
|
|
53
|
+
body.has-toolbar.has-sidebar .drag.gridBlock.handle.wrapper {
|
|
54
|
+
// TODO: review
|
|
55
|
+
margin-top: 5px;
|
|
56
|
+
margin-left: 0px !important;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Inner Remove block button
|
|
60
|
+
.ui.basic.button.remove-block-button {
|
|
61
|
+
position: absolute;
|
|
62
|
+
z-index: 3;
|
|
63
|
+
top: 6px;
|
|
64
|
+
right: 2px;
|
|
65
|
+
display: none;
|
|
66
|
+
|
|
67
|
+
.icon {
|
|
68
|
+
height: 18px !important;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.circled {
|
|
72
|
+
padding: 8px;
|
|
73
|
+
border: 1px solid @greySmoke;
|
|
74
|
+
background: @greySnow;
|
|
75
|
+
|
|
76
|
+
&:hover {
|
|
77
|
+
background-color: @greySmoke;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
&:hover {
|
|
82
|
+
background-color: transparent !important;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.block.gridBlock {
|
|
87
|
+
[class^='block-editor-'].selected .ui.basic.button.remove-block-button,
|
|
88
|
+
[class^='block-editor-']:hover .ui.basic.button.remove-block-button {
|
|
89
|
+
display: block;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// The Empty block cell (yet to be added)
|
|
94
|
+
.gridBlock-empty-placeholder {
|
|
95
|
+
position: relative;
|
|
96
|
+
display: flex;
|
|
97
|
+
height: 100%;
|
|
98
|
+
min-height: 200px;
|
|
99
|
+
flex-direction: column;
|
|
100
|
+
align-items: center;
|
|
101
|
+
justify-content: center;
|
|
102
|
+
|
|
103
|
+
background: @blueArctic;
|
|
104
|
+
|
|
105
|
+
&.selected::before {
|
|
106
|
+
position: absolute;
|
|
107
|
+
// otherwise, this layer is above the object, then it does not allow clicking inside
|
|
108
|
+
z-index: -1;
|
|
109
|
+
top: -5px;
|
|
110
|
+
left: -5px;
|
|
111
|
+
width: calc(100% + 10px);
|
|
112
|
+
height: calc(100% + 10px);
|
|
113
|
+
border: 1px solid rgba(120, 192, 215, 0.5);
|
|
114
|
+
border-radius: 3px;
|
|
115
|
+
content: '';
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.ui.basic.button.add-block-button {
|
|
119
|
+
box-shadow: 0px 0px 0px @2px transparent inset !important;
|
|
120
|
+
|
|
121
|
+
.icon {
|
|
122
|
+
height: 32px !important;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.circled {
|
|
126
|
+
padding: 10px;
|
|
127
|
+
border: none;
|
|
128
|
+
background: @greySnow;
|
|
129
|
+
|
|
130
|
+
&:hover {
|
|
131
|
+
background-color: @greySmoke;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
&:hover {
|
|
136
|
+
background-color: transparent !important;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.blocks-chooser {
|
|
141
|
+
top: 0;
|
|
142
|
+
left: 50%;
|
|
143
|
+
transform: translate(-50%, 0);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// Required to overcome the droppable from b-d&d at the bottom
|
|
148
|
+
// !! Required for ALL blocks that have b-d&d and a grid
|
|
149
|
+
.block.gridBlock {
|
|
150
|
+
.ui.grid {
|
|
151
|
+
margin-top: 0;
|
|
152
|
+
margin-bottom: 0;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.column {
|
|
156
|
+
// Removed because it broke the z-index of the blockChooser, making it fall behind
|
|
157
|
+
// z-index: 2;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
// Toolbar position
|
|
162
|
+
.block-editor-gridBlock .block .toolbar {
|
|
163
|
+
top: -50px;
|
|
164
|
+
left: -10px;
|
|
165
|
+
border-radius: 6px;
|
|
166
|
+
box-shadow: 0px 9px 18px rgba(2, 19, 34, 0.18),
|
|
167
|
+
0px 6px 12px rgba(2, 19, 34, 0.06);
|
|
168
|
+
transform: initial;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.block.gridBlock {
|
|
172
|
+
h2,
|
|
173
|
+
h3 {
|
|
174
|
+
&:not(.headline) {
|
|
175
|
+
margin: 0 !important;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.grid-teaser-item {
|
|
180
|
+
h2,
|
|
181
|
+
h3 {
|
|
182
|
+
margin-bottom: 1rem !important;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.content {
|
|
186
|
+
h2 {
|
|
187
|
+
padding-bottom: 7px;
|
|
188
|
+
margin-bottom: 0px !important;
|
|
189
|
+
font-size: 14px;
|
|
190
|
+
font-weight: 300;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.grid-image-wrapper {
|
|
196
|
+
display: flex;
|
|
197
|
+
// This one is because Safari has a bug with flexed items, the default is
|
|
198
|
+
// align-items `stretched`, so it's required to reset it.
|
|
199
|
+
align-items: flex-start;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.grid-image-wrapper::before {
|
|
203
|
+
padding-top: 60%;
|
|
204
|
+
content: '';
|
|
205
|
+
float: left;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.grid-image-wrapper::after {
|
|
209
|
+
display: block;
|
|
210
|
+
clear: both;
|
|
211
|
+
content: '';
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.grid-image-wrapper {
|
|
215
|
+
position: relative;
|
|
216
|
+
|
|
217
|
+
img {
|
|
218
|
+
position: absolute;
|
|
219
|
+
top: 0;
|
|
220
|
+
right: 0;
|
|
221
|
+
bottom: 0;
|
|
222
|
+
left: 0;
|
|
223
|
+
width: 100%;
|
|
224
|
+
height: 100%;
|
|
225
|
+
object-fit: cover;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.ui.message {
|
|
230
|
+
height: 100%;
|
|
231
|
+
margin: 0;
|
|
232
|
+
border-radius: 6px;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.grid-teaser-item {
|
|
237
|
+
display: flex;
|
|
238
|
+
flex-direction: column;
|
|
239
|
+
|
|
240
|
+
a,
|
|
241
|
+
a:hover {
|
|
242
|
+
color: rgba(0, 0, 0, 0.87);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
p {
|
|
246
|
+
// Defaults are always standard, on theme with customizations
|
|
247
|
+
margin-bottom: 0;
|
|
248
|
+
text-align: left;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
&.default {
|
|
252
|
+
display: flex;
|
|
253
|
+
flex-direction: column;
|
|
254
|
+
align-items: center;
|
|
255
|
+
|
|
256
|
+
img {
|
|
257
|
+
max-width: 300px;
|
|
258
|
+
align-self: center;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
&.top .grid-image-wrapper {
|
|
263
|
+
margin-bottom: 25px;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
&.top a {
|
|
267
|
+
display: flex;
|
|
268
|
+
flex-direction: column;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
// Template chooser
|
|
273
|
+
.ui.button.template-chooser-item {
|
|
274
|
+
display: flex;
|
|
275
|
+
flex-direction: column;
|
|
276
|
+
align-items: center;
|
|
277
|
+
justify-content: center;
|
|
278
|
+
padding: 20px 20px 0 20px;
|
|
279
|
+
background: #fff;
|
|
280
|
+
border-radius: 3px;
|
|
281
|
+
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.15);
|
|
282
|
+
|
|
283
|
+
.template-chooser-title {
|
|
284
|
+
padding-top: 20px;
|
|
285
|
+
padding-bottom: 20px;
|
|
286
|
+
text-align: center;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
// Agnostic flexbox behavior for the Blocks Editor
|
|
291
|
+
// Reasoning: SemanticUI Grid does not support detached (as non consecutive)
|
|
292
|
+
// Grid > Grid.Columns support, so we have to build our own because of the
|
|
293
|
+
// Blocks Editor wrappers
|
|
294
|
+
.block.gridBlock .grid-items [data-rbd-droppable-id] {
|
|
295
|
+
display: flex;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
// general spacing in the Row block wrapper
|
|
299
|
+
.block.gridBlock [class^='block-editor-'],
|
|
300
|
+
[class^='block-editor-'].contained {
|
|
301
|
+
padding-right: 1rem;
|
|
302
|
+
padding-left: 1rem;
|
|
303
|
+
margin-top: 1rem;
|
|
304
|
+
margin-bottom: 1rem;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
.block.gridBlock .one.grid-items [class^='block-editor-'] {
|
|
308
|
+
width: 100%;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
.block.gridBlock .two.grid-items [class^='block-editor-'] {
|
|
312
|
+
width: 50%;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
.block.gridBlock .three.grid-items [class^='block-editor-'] {
|
|
316
|
+
width: 33.33333333%;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
.block.gridBlock .four.grid-items [class^='block-editor-'] {
|
|
320
|
+
width: 25%;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
// Outter cell item flexbox behavior so all have the same height
|
|
324
|
+
.block.gridBlock [class^='block-editor-'],
|
|
325
|
+
[class^='block-editor-'].contained {
|
|
326
|
+
display: inline-flex !important;
|
|
327
|
+
flex-direction: column;
|
|
328
|
+
align-self: stretch;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
// (Inner) cell wrapper flexbox behavior so all have the same height
|
|
332
|
+
.cell-wrapper {
|
|
333
|
+
position: relative;
|
|
334
|
+
flex-grow: 1;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
// Add our own block selected marker different than the normal one so we can full control over it
|
|
338
|
+
.block.gridBlock {
|
|
339
|
+
[class^='block-editor-'].selected .cell-wrapper::before {
|
|
340
|
+
position: absolute;
|
|
341
|
+
// otherwise, this layer is above the object, then it does not allow clicking inside
|
|
342
|
+
z-index: -1;
|
|
343
|
+
top: -5px;
|
|
344
|
+
left: -5px;
|
|
345
|
+
display: block;
|
|
346
|
+
width: calc(100% + 10px);
|
|
347
|
+
height: calc(100% + 10px);
|
|
348
|
+
border: 1px solid rgba(120, 192, 215, 0.5);
|
|
349
|
+
border-radius: 3px;
|
|
350
|
+
content: '';
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
// Remove default bottom image block margin
|
|
355
|
+
.block.gridBlock [class^='block-editor-'] .block.image,
|
|
356
|
+
[class^='block-editor-'].contained .block.image {
|
|
357
|
+
margin: 0;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
// Remove the text block "add block" button TODO: remove when we move to Quanta Toolbar
|
|
361
|
+
.block.gridBlock [class^='block-editor-'] .block-add-button {
|
|
362
|
+
display: none;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
// Remove completely the default inner selection marker, so we are using our own
|
|
366
|
+
.block.gridBlock {
|
|
367
|
+
[class^='block-editor-'] .block.selected::before {
|
|
368
|
+
content: unset;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
// Disable hover blue border on inner blocks
|
|
373
|
+
.block.gridBlock [class^='block-editor-'] {
|
|
374
|
+
.block:not(.inner):not(.selected)::before {
|
|
375
|
+
content: unset;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
// Remove block selection blue outline on hover for view only
|
|
380
|
+
.block.gridBlock {
|
|
381
|
+
:not([class^='block-editor-']) .block:hover::before {
|
|
382
|
+
border: none;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
.block.gridBlock {
|
|
387
|
+
.block.inner.slate {
|
|
388
|
+
cursor: text;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
body.cms-ui .ui.basic.segment.content-area & {
|
|
392
|
+
cursor: grab;
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
// Aspect ratio on all images
|
|
397
|
+
.grid-image-wrapper img,
|
|
398
|
+
.gridBlock .block.image img,
|
|
399
|
+
.block-editor-gridBlock .block-editor-image img,
|
|
400
|
+
.block-editor-image.contained img {
|
|
401
|
+
width: 100%;
|
|
402
|
+
aspect-ratio: @grid-images-aspect-ratio;
|
|
403
|
+
object-fit: cover;
|
|
404
|
+
object-position: @grid-images-object-position;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
// Prevents the above styling to leak to the unset image wrapper
|
|
408
|
+
.block-editor-gridBlock .block-editor-image .no-image-wrapper img,
|
|
409
|
+
.block-editor-image.contained .no-image-wrapper img {
|
|
410
|
+
width: unset;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
.block.gridBlock .teaser-item,
|
|
414
|
+
.block-editor-teaser.contained .teaser-item {
|
|
415
|
+
flex-direction: column;
|
|
416
|
+
|
|
417
|
+
&.default .image-wrapper {
|
|
418
|
+
width: 100%;
|
|
419
|
+
margin-right: 0;
|
|
420
|
+
margin-bottom: 25px;
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
.container-chooser-wrapper {
|
|
425
|
+
z-index: 10;
|
|
426
|
+
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { useSelector, shallowEqual } from 'react-redux';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* useContent hook
|
|
5
|
-
*
|
|
6
|
-
* This hook returns the current content that is stored in the Redux store in the
|
|
7
|
-
* `content` reducer, and returns it along with the related state (loading/loaded/error).
|
|
8
|
-
*
|
|
9
|
-
* @export
|
|
10
|
-
* @return {{ data: ContentData, loading: boolean, loaded: boolean, error: Error }}
|
|
11
|
-
*/
|
|
12
|
-
export function useContent() {
|
|
13
|
-
const data = useSelector((state) => state.content.data, shallowEqual);
|
|
14
|
-
const loading = useSelector((state) => state.content.get.loading);
|
|
15
|
-
const loaded = useSelector((state) => state.content.get.loaded);
|
|
16
|
-
const error = useSelector((state) => state.content.get.error, shallowEqual);
|
|
17
|
-
|
|
18
|
-
return { data, loading, loaded, error };
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
// For reference purposes: Potential future useQuery version
|
|
22
|
-
// export function useContent() {
|
|
23
|
-
// // the cache will need to know the current location
|
|
24
|
-
// const pathname = useLocation();
|
|
25
|
-
// const query = useQuery(getContentQuery({ path }))
|
|
26
|
-
|
|
27
|
-
// // This might not be needed if we rename the properties
|
|
28
|
-
// const {isLoading: loading, isSuccess: loaded, ...rest} = query;
|
|
29
|
-
|
|
30
|
-
// return { loading, loaded, ...rest };
|
|
31
|
-
// }
|