ui-layout-manager-dev 0.0.29-dev → 0.0.31-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 +9 -5
- package/src/components/LayoutManager/Components/RootContainer/RootContainer.scss +37 -7
- package/src/components/LayoutManager/Controller/LayoutController.js +2 -3
package/package.json
CHANGED
|
@@ -30,13 +30,13 @@ export const RootContainer = () => {
|
|
|
30
30
|
const timerRef = useRef(null);
|
|
31
31
|
const resizingRef = useRef(false);
|
|
32
32
|
const loadingOverlayRef = useRef(null);
|
|
33
|
-
const [
|
|
33
|
+
const [showLoadingScreen, setShowLoadingScreen] = useState(true);
|
|
34
34
|
|
|
35
35
|
// Create the container API that will be used by the controller.
|
|
36
36
|
const rootContainerAPI = useRef({});
|
|
37
37
|
rootContainerAPI.current = {
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
hideLoadingScreen: () => {
|
|
39
|
+
setShowLoadingScreen(false);
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
42
|
|
|
@@ -124,7 +124,7 @@ export const RootContainer = () => {
|
|
|
124
124
|
observer.disconnect();
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
|
-
}, [layoutController,
|
|
127
|
+
}, [layoutController, setShowLoadingScreen, showLoadingScreen]);
|
|
128
128
|
|
|
129
129
|
const sensors = useSensors(
|
|
130
130
|
useSensor(PointerSensor, {
|
|
@@ -153,7 +153,11 @@ export const RootContainer = () => {
|
|
|
153
153
|
onDragEnd={dragController.onDragEnd}
|
|
154
154
|
onDragCancel={dragController.onDragCancel}>
|
|
155
155
|
|
|
156
|
-
|
|
156
|
+
{showLoadingScreen && <div className="loading-overlay" ref={loadingOverlayRef}>
|
|
157
|
+
<div className="loading-bar">
|
|
158
|
+
<div className="loading-bar-fill"></div>
|
|
159
|
+
</div>
|
|
160
|
+
</div>}
|
|
157
161
|
<div className="root-container">
|
|
158
162
|
<div ref={rootRef} className="relative-container">
|
|
159
163
|
{childElements}
|
|
@@ -7,12 +7,18 @@
|
|
|
7
7
|
|
|
8
8
|
.relative-container {
|
|
9
9
|
position: relative;
|
|
10
|
-
display:flex;
|
|
11
|
-
width:100%;
|
|
10
|
+
display: flex;
|
|
11
|
+
width: 100%;
|
|
12
12
|
height: 100%;
|
|
13
13
|
overflow: hidden;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
.drag-overlay {
|
|
17
|
+
position: fixed;
|
|
18
|
+
pointer-events: none;
|
|
19
|
+
z-index: 9999;
|
|
20
|
+
}
|
|
21
|
+
|
|
16
22
|
.loading-overlay {
|
|
17
23
|
position: absolute;
|
|
18
24
|
top: 0;
|
|
@@ -22,12 +28,36 @@
|
|
|
22
28
|
background-color: #1a1a1a;
|
|
23
29
|
display: flex;
|
|
24
30
|
justify-content: center;
|
|
25
|
-
align-items:
|
|
31
|
+
align-items: self-start;
|
|
26
32
|
z-index: 9999;
|
|
27
33
|
}
|
|
28
34
|
|
|
29
|
-
.
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
35
|
+
.loading-bar {
|
|
36
|
+
width: 100%;
|
|
37
|
+
height: 4px;
|
|
38
|
+
background: #1a1a1a;
|
|
39
|
+
overflow: hidden;
|
|
40
|
+
position: relative;
|
|
41
|
+
border-radius: 999px;
|
|
33
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
|
+
|
|
60
|
+
100% {
|
|
61
|
+
left: 100%;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -185,9 +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
|
-
//
|
|
189
|
-
|
|
190
|
-
this.containers["root"].current.hideOverlay();
|
|
188
|
+
// After initial layout is applied, we can hide the loading screen.
|
|
189
|
+
this.containers["root"].current.hideLoadingScreen();
|
|
191
190
|
break;
|
|
192
191
|
case LAYOUT_WORKER_PROTOCOL.TRANSFORMATIONS:
|
|
193
192
|
transformations = event.data.data;
|