ui-layout-manager-dev 0.0.36-dev → 0.0.37-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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ui-layout-manager-dev",
3
- "version": "0.0.36-dev",
3
+ "version": "0.0.37-dev",
4
4
  "description": "A react component to manage layout and themes in single page applications.",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -79,8 +79,7 @@ export class LayoutController {
79
79
 
80
80
  if (this.registeredContainers === this.numberOfContainers && !this.layoutLoaded) {
81
81
  // console.log("All containers registered, layout is ready.");
82
- this.sendToWorker(LAYOUT_WORKER_PROTOCOL.INITIALIZE_FLEXBOX,
83
- { sizes: this.getContainerSizes() });
82
+ this.sendToWorker(LAYOUT_WORKER_PROTOCOL.INITIALIZE_FLEXBOX);
84
83
  }
85
84
  }
86
85
 
@@ -179,12 +178,17 @@ export class LayoutController {
179
178
  break;
180
179
  }
181
180
  };
182
- if (isInitial) {
183
- // After the initial transformations have been applied, we can hide
184
- // the loading screen for the root container.
181
+ if (this.layoutLoaded && !isInitial) {
185
182
  this.containers[this.ldf.layoutRoot].current.hideLoadingScreen();
186
183
  console.log("Layout is ready, hiding loading screen.");
187
184
  }
185
+ if (isInitial) {
186
+ // After the initial style has been applied, we request the worker
187
+ // to apply layout before we hide the loading screen so containers
188
+ // are set to correct initial state.
189
+ this.layoutLoaded = true;
190
+ this.handleRootResize();
191
+ }
188
192
  });
189
193
  };
190
194
 
@@ -19,10 +19,8 @@ export class LayoutEditor {
19
19
  * Initializes flexbox layout by processing LDF file.
20
20
  * @param {Object} sizes Initial sizes of the containers.
21
21
  */
22
- initializeFlexBox(sizes) {
23
- this.initializeNode(this.ldf.containers[this.ldf.layoutRoot]);
24
- this.sizes = sizes;
25
- this.applyLayoutToNode(this.ldf.layoutRoot);
22
+ initializeFlexBox() {
23
+ this.initializeNode(this.ldf.containers[this.ldf.layoutRoot]);
26
24
  postMessage({
27
25
  type: LAYOUT_WORKER_PROTOCOL.INITIALIZE_FLEXBOX,
28
26
  data: this.transformations
@@ -17,7 +17,7 @@ self.onmessage = function (e) {
17
17
  editor = new LayoutEditor(args.ldf);
18
18
  break;
19
19
  case LAYOUT_WORKER_PROTOCOL.INITIALIZE_FLEXBOX:
20
- editor.initializeFlexBox(args.sizes);
20
+ editor.initializeFlexBox();
21
21
  break;
22
22
  case LAYOUT_WORKER_PROTOCOL.APPLY_SIZES:
23
23
  editor.applySizes(args.sizes);