ui-layout-manager-dev 0.0.28-dev → 0.0.30-dev
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/cjs/index.js +3 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +3 -3
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/LayoutManager/Components/RootContainer/RootContainer.jsx +13 -2
- package/src/components/LayoutManager/Components/RootContainer/RootContainer.scss +42 -0
- package/src/components/LayoutManager/Controller/LayoutController.js +2 -0
package/package.json
CHANGED
|
@@ -29,10 +29,16 @@ export const RootContainer = () => {
|
|
|
29
29
|
const rootRef = useRef(null);
|
|
30
30
|
const timerRef = useRef(null);
|
|
31
31
|
const resizingRef = useRef(false);
|
|
32
|
+
const loadingOverlayRef = useRef(null);
|
|
33
|
+
const [showOverlay, setShowOverlay] = useState(true);
|
|
32
34
|
|
|
33
35
|
// Create the container API that will be used by the controller.
|
|
34
36
|
const rootContainerAPI = useRef({});
|
|
35
|
-
rootContainerAPI.current = {
|
|
37
|
+
rootContainerAPI.current = {
|
|
38
|
+
hideOverlay: () => {
|
|
39
|
+
setShowOverlay(false);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
36
42
|
|
|
37
43
|
const [childElements, setChildElements] = useState(null);
|
|
38
44
|
|
|
@@ -118,7 +124,7 @@ export const RootContainer = () => {
|
|
|
118
124
|
observer.disconnect();
|
|
119
125
|
}
|
|
120
126
|
}
|
|
121
|
-
}, [layoutController]);
|
|
127
|
+
}, [layoutController, setShowOverlay, showOverlay]);
|
|
122
128
|
|
|
123
129
|
const sensors = useSensors(
|
|
124
130
|
useSensor(PointerSensor, {
|
|
@@ -147,6 +153,11 @@ export const RootContainer = () => {
|
|
|
147
153
|
onDragEnd={dragController.onDragEnd}
|
|
148
154
|
onDragCancel={dragController.onDragCancel}>
|
|
149
155
|
|
|
156
|
+
{showOverlay && <div className="loading-overlay" ref={loadingOverlayRef}>
|
|
157
|
+
<div className="loading-bar">
|
|
158
|
+
<div className="loading-bar-fill"></div>
|
|
159
|
+
</div>
|
|
160
|
+
</div>}
|
|
150
161
|
<div className="root-container">
|
|
151
162
|
<div ref={rootRef} className="relative-container">
|
|
152
163
|
{childElements}
|
|
@@ -18,3 +18,45 @@
|
|
|
18
18
|
pointer-events: none;
|
|
19
19
|
z-index: 9999;
|
|
20
20
|
}
|
|
21
|
+
|
|
22
|
+
.loading-overlay {
|
|
23
|
+
position: absolute;
|
|
24
|
+
top: 0;
|
|
25
|
+
left: 0;
|
|
26
|
+
width: 100%;
|
|
27
|
+
height: 100%;
|
|
28
|
+
background-color: #1a1a1a;
|
|
29
|
+
display: flex;
|
|
30
|
+
justify-content: center;
|
|
31
|
+
align-items: self-start;
|
|
32
|
+
z-index: 9999;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.loading-bar {
|
|
36
|
+
width: 100%;
|
|
37
|
+
height: 4px;
|
|
38
|
+
background: #1a1a1a;
|
|
39
|
+
overflow: hidden;
|
|
40
|
+
position: relative;
|
|
41
|
+
border-radius: 999px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.loading-bar-fill {
|
|
45
|
+
position: absolute;
|
|
46
|
+
top: 0;
|
|
47
|
+
left: -40%;
|
|
48
|
+
width: 40%;
|
|
49
|
+
height: 100%;
|
|
50
|
+
background: #4da3ff;
|
|
51
|
+
border-radius: 999px;
|
|
52
|
+
animation: loading-slide 1.2s infinite ease-in-out;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@keyframes loading-slide {
|
|
56
|
+
0% {
|
|
57
|
+
left: -40%;
|
|
58
|
+
}
|
|
59
|
+
100% {
|
|
60
|
+
left: 100%;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -185,6 +185,8 @@ export class LayoutController {
|
|
|
185
185
|
case LAYOUT_WORKER_PROTOCOL.INITIALIZE_FLEXBOX:
|
|
186
186
|
transformations = event.data.data;
|
|
187
187
|
this.applyTransformations(transformations, true);
|
|
188
|
+
// After initial layout is applied, we can hide the loading overlay.
|
|
189
|
+
this.containers["root"].current.hideOverlay();
|
|
188
190
|
break;
|
|
189
191
|
case LAYOUT_WORKER_PROTOCOL.TRANSFORMATIONS:
|
|
190
192
|
transformations = event.data.data;
|