@trops/dash-core 0.1.333 → 0.1.334

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/index.esm.js CHANGED
@@ -27333,6 +27333,21 @@ var WorkspaceModel = function WorkspaceModel(workspaceItem) {
27333
27333
  workspace.layout = "layout" in obj ? obj["layout"] : [];
27334
27334
  workspace.pages = "pages" in obj ? obj["pages"] : [];
27335
27335
  workspace.activePageId = "activePageId" in obj ? obj["activePageId"] : null;
27336
+
27337
+ // Always-pages model: every workspace must have at least one page.
27338
+ // If the source data is single-page (empty pages array but populated
27339
+ // layout), wrap the layout into pages[0] now so renderers always have
27340
+ // a page to display. Idempotent: a no-op if pages is already populated.
27341
+ if (!Array.isArray(workspace.pages) || workspace.pages.length === 0) {
27342
+ var page = {
27343
+ id: "page-".concat(workspace.id || Date.now()),
27344
+ name: workspace.name || "Page 1",
27345
+ order: 0,
27346
+ layout: workspace.layout || []
27347
+ };
27348
+ workspace.pages = [page];
27349
+ workspace.activePageId = page.id;
27350
+ }
27336
27351
  workspace.sidebarEnabled = "sidebarEnabled" in obj ? obj["sidebarEnabled"] : false;
27337
27352
  workspace.sidebarLayout = "sidebarLayout" in obj ? obj["sidebarLayout"] : [];
27338
27353
  workspace.sidebarWidth = "sidebarWidth" in obj ? obj["sidebarWidth"] : 280;