insync-stage-handler 4.0.0-beta.3 → 4.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/dist/module.js CHANGED
@@ -3714,6 +3714,19 @@ const createDockviewGridNode = (section, sections) => {
3714
3714
  data: children
3715
3715
  };
3716
3716
  };
3717
+ const ensureBranchRoot = node => {
3718
+ if (!node || node.type !== "leaf") {
3719
+ return node;
3720
+ }
3721
+ return {
3722
+ type: "branch",
3723
+ size: 100,
3724
+ data: [{
3725
+ ...node,
3726
+ size: 100
3727
+ }]
3728
+ };
3729
+ };
3717
3730
  const filterLayoutSectionsByAssets = (sectionsById, assetsById) => {
3718
3731
  return R.pipe(R.map(section => {
3719
3732
  const assetId = R.path(["props", "assetId"], section);
@@ -3738,12 +3751,13 @@ const convertLegacyLayoutToDockview = stage => {
3738
3751
  const sections = filterLayoutSectionsByAssets(rawSections, assetsById);
3739
3752
  const rootSection = getRootSection(content, sections);
3740
3753
  const rootNode = createDockviewGridNode(rootSection, sections);
3741
- if (!rootSection || !rootNode) {
3754
+ const dockviewRoot = ensureBranchRoot(rootNode);
3755
+ if (!rootSection || !dockviewRoot) {
3742
3756
  return null;
3743
3757
  }
3744
3758
  return {
3745
3759
  grid: {
3746
- root: rootNode,
3760
+ root: dockviewRoot,
3747
3761
  height: 100,
3748
3762
  width: 100,
3749
3763
  orientation: getOrientationForSection(rootSection)
@@ -3982,7 +3996,7 @@ const settingsCleaner = R.pipe(R.dissocPath(["timer", "wantedTime"]));
3982
3996
  var settingsHandler = (stage, settings) => R.pipe(settingsUpgrader(stage), settingsCleaner)(settings);
3983
3997
 
3984
3998
  var name = "insync-stage-handler";
3985
- var version = "4.0.0-beta.2";
3999
+ var version = "4.0.0";
3986
4000
  var description = "Handles stages files. This consists of validating, upgrading and consolodating them.";
3987
4001
  var author = "David Ammeraal (Noterik B.V.)";
3988
4002
  var license = "MIT";