@trops/dash-core 0.1.332 → 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;
@@ -52280,63 +52295,19 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
52280
52295
  children: [toasts.length > 0 && /*#__PURE__*/jsx("div", {
52281
52296
  className: "fixed bottom-4 right-4 z-[9999] flex flex-col gap-2 pointer-events-none w-80",
52282
52297
  children: toasts.map(function (t) {
52283
- var typeStyles = {
52284
- success: {
52285
- bg: "bg-emerald-950/95",
52286
- border: "border-emerald-500",
52287
- accent: "text-emerald-400",
52288
- icon: "circle-check"
52289
- },
52290
- error: {
52291
- bg: "bg-rose-950/95",
52292
- border: "border-rose-500",
52293
- accent: "text-rose-400",
52294
- icon: "circle-xmark"
52295
- },
52296
- warning: {
52297
- bg: "bg-amber-950/95",
52298
- border: "border-amber-500",
52299
- accent: "text-amber-400",
52300
- icon: "triangle-exclamation"
52301
- },
52302
- info: {
52303
- bg: "bg-sky-950/95",
52304
- border: "border-sky-500",
52305
- accent: "text-sky-400",
52306
- icon: "circle-info"
52307
- }
52308
- };
52309
- var style = typeStyles[t.type] || typeStyles.info;
52310
52298
  return /*#__PURE__*/jsx("div", {
52311
- className: "pointer-events-auto rounded-md border-l-4 ".concat(style.border, " ").concat(style.bg, " shadow-lg p-3 text-white animate-in slide-in-from-right"),
52312
- role: "status",
52313
- children: /*#__PURE__*/jsxs("div", {
52314
- className: "flex items-start gap-3",
52315
- children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
52316
- icon: style.icon,
52317
- className: "h-4 w-4 mt-0.5 flex-shrink-0 ".concat(style.accent)
52318
- }), /*#__PURE__*/jsxs("div", {
52319
- className: "flex-1 min-w-0",
52320
- children: [t.title && /*#__PURE__*/jsx("div", {
52321
- className: "font-semibold text-sm ".concat(style.accent),
52322
- children: t.title
52323
- }), t.message && /*#__PURE__*/jsx("div", {
52324
- className: "text-sm text-white/90 break-words",
52325
- children: t.message
52326
- })]
52327
- }), /*#__PURE__*/jsx("button", {
52328
- type: "button",
52329
- onClick: function onClick() {
52330
- return setToasts(function (prev) {
52331
- return prev.filter(function (x) {
52332
- return x.id !== t.id;
52333
- });
52299
+ className: "pointer-events-auto",
52300
+ children: /*#__PURE__*/jsx(Toast, {
52301
+ type: t.type,
52302
+ title: t.title,
52303
+ message: t.message,
52304
+ onClose: function onClose() {
52305
+ return setToasts(function (prev) {
52306
+ return prev.filter(function (x) {
52307
+ return x.id !== t.id;
52334
52308
  });
52335
- },
52336
- className: "text-white/60 hover:text-white text-lg leading-none flex-shrink-0",
52337
- "aria-label": "Close toast",
52338
- children: "\xD7"
52339
- })]
52309
+ });
52310
+ }
52340
52311
  })
52341
52312
  }, t.id);
52342
52313
  })