@noya-app/noya-designsystem 0.1.19 → 0.1.20

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.mjs CHANGED
@@ -6343,11 +6343,21 @@ var WorkspaceLayout = forwardRef18(function WorkspaceLayout2({
6343
6343
  onChangeLayoutState,
6344
6344
  leftSidebarInitialSize = 280,
6345
6345
  rightSidebarInitialSize = 400,
6346
- leftSidebarCanResize = false
6346
+ leftSidebarMinSize,
6347
+ rightSidebarMinSize,
6348
+ leftSidebarCanResize = false,
6349
+ id,
6350
+ className,
6351
+ style: style3
6347
6352
  }, forwardedRef) {
6348
6353
  const windowSize = useWindowSize();
6349
- const leftSidebarPercentage = leftSidebarInitialSize / windowSize.width * 100;
6350
- const rightSidebarPercentage = rightSidebarInitialSize / windowSize.width * 100;
6354
+ function getPercentage(size2) {
6355
+ return typeof size2 === "string" ? parseFloat(size2) : size2 / windowSize.width * 100;
6356
+ }
6357
+ const leftSidebarPercentage = getPercentage(leftSidebarInitialSize);
6358
+ const rightSidebarPercentage = getPercentage(rightSidebarInitialSize);
6359
+ const leftSidebarMinPercentage = leftSidebarMinSize !== void 0 ? getPercentage(leftSidebarMinSize) : void 0;
6360
+ const rightSidebarMinPercentage = rightSidebarMinSize !== void 0 ? getPercentage(rightSidebarMinSize) : void 0;
6351
6361
  const panelGroupRef = useRef20(null);
6352
6362
  const leftSidebarRef = useRef20(null);
6353
6363
  const rightSidebarRef = useRef20(null);
@@ -6409,82 +6419,97 @@ var WorkspaceLayout = forwardRef18(function WorkspaceLayout2({
6409
6419
  }
6410
6420
  }
6411
6421
  });
6412
- return /* @__PURE__ */ React47.createElement(Stack.H, { flex: "1" }, /* @__PURE__ */ React47.createElement(
6413
- PanelGroup,
6422
+ const centerPanelPercentage = 100 - (leftPanelContent ? leftSidebarPercentage : 0) - (rightPanelContent ? rightSidebarPercentage : 0);
6423
+ return /* @__PURE__ */ React47.createElement(
6424
+ "div",
6414
6425
  {
6415
- ref: panelGroupRef,
6416
- id: EDITOR_PANEL_GROUP_ID,
6417
- direction: "horizontal",
6418
- autoSaveId: autoSavePrefix ? `${autoSavePrefix}--${EDITOR_PANEL_GROUP_ID}` : void 0,
6419
- style: { flex: "1" }
6420
- },
6421
- hasLeftSidebar && /* @__PURE__ */ React47.createElement(React47.Fragment, null, /* @__PURE__ */ React47.createElement(
6422
- Panel,
6423
- {
6424
- id: LEFT_SIDEBAR_ID,
6425
- order: 1,
6426
- ref: leftSidebarRef,
6427
- defaultSize: leftSidebarPercentage,
6428
- minSize: leftSidebarPercentage,
6429
- ...!leftSidebarCanResize && { maxSize: leftSidebarPercentage },
6430
- collapsible: true,
6431
- style: {
6432
- display: "flex",
6433
- flexDirection: "row"
6434
- }
6435
- },
6436
- leftPanelContent
6437
- ), /* @__PURE__ */ React47.createElement(
6438
- PanelResizeHandle,
6439
- {
6440
- style: {
6441
- cursor: "col-resize",
6442
- width: "1px",
6443
- height: "100%",
6444
- backgroundColor: theme.colors.divider
6445
- }
6426
+ id,
6427
+ className,
6428
+ style: {
6429
+ backgroundColor: theme.colors.canvas.background,
6430
+ display: "flex",
6431
+ flexDirection: "row",
6432
+ ...style3
6446
6433
  }
6447
- )),
6434
+ },
6448
6435
  /* @__PURE__ */ React47.createElement(
6449
- Panel,
6436
+ PanelGroup,
6450
6437
  {
6451
- id: CONTENT_AREA_ID,
6452
- order: 2,
6453
- minSize: 10,
6454
- style: {
6455
- display: "flex",
6456
- flexDirection: "row"
6457
- }
6438
+ ref: panelGroupRef,
6439
+ id: EDITOR_PANEL_GROUP_ID,
6440
+ direction: "horizontal",
6441
+ autoSaveId: autoSavePrefix ? `${autoSavePrefix}--${EDITOR_PANEL_GROUP_ID}` : void 0,
6442
+ style: { flex: "1" }
6458
6443
  },
6459
- centerPanelContent
6460
- ),
6461
- hasRightSidebar && /* @__PURE__ */ React47.createElement(React47.Fragment, null, /* @__PURE__ */ React47.createElement(
6462
- PanelResizeHandle,
6463
- {
6464
- style: {
6465
- cursor: "col-resize",
6466
- width: "1px",
6467
- height: "100%",
6468
- backgroundColor: theme.colors.divider
6444
+ hasLeftSidebar && /* @__PURE__ */ React47.createElement(React47.Fragment, null, /* @__PURE__ */ React47.createElement(
6445
+ Panel,
6446
+ {
6447
+ id: LEFT_SIDEBAR_ID,
6448
+ order: 1,
6449
+ ref: leftSidebarRef,
6450
+ defaultSize: leftSidebarPercentage,
6451
+ minSize: leftSidebarMinPercentage ?? leftSidebarPercentage,
6452
+ ...!leftSidebarCanResize && { maxSize: leftSidebarPercentage },
6453
+ collapsible: true,
6454
+ style: {
6455
+ display: "flex",
6456
+ flexDirection: "row"
6457
+ }
6458
+ },
6459
+ leftPanelContent
6460
+ ), /* @__PURE__ */ React47.createElement(
6461
+ PanelResizeHandle,
6462
+ {
6463
+ style: {
6464
+ cursor: "col-resize",
6465
+ width: "1px",
6466
+ height: "100%",
6467
+ backgroundColor: theme.colors.divider
6468
+ }
6469
6469
  }
6470
- }
6471
- ), /* @__PURE__ */ React47.createElement(
6472
- Panel,
6473
- {
6474
- id: RIGHT_SIDEBAR_ID,
6475
- order: 3,
6476
- ref: rightSidebarRef,
6477
- minSize: rightSidebarPercentage,
6478
- defaultSize: rightSidebarPercentage,
6479
- collapsible: true,
6480
- style: {
6481
- display: "flex",
6482
- flexDirection: "row"
6470
+ )),
6471
+ /* @__PURE__ */ React47.createElement(
6472
+ Panel,
6473
+ {
6474
+ id: CONTENT_AREA_ID,
6475
+ order: 2,
6476
+ defaultSize: centerPanelPercentage,
6477
+ minSize: 10,
6478
+ style: {
6479
+ display: "flex",
6480
+ flexDirection: "row"
6481
+ }
6482
+ },
6483
+ centerPanelContent
6484
+ ),
6485
+ hasRightSidebar && /* @__PURE__ */ React47.createElement(React47.Fragment, null, /* @__PURE__ */ React47.createElement(
6486
+ PanelResizeHandle,
6487
+ {
6488
+ style: {
6489
+ cursor: "col-resize",
6490
+ width: "1px",
6491
+ height: "100%",
6492
+ backgroundColor: theme.colors.divider
6493
+ }
6483
6494
  }
6484
- },
6485
- rightPanelContent
6486
- ))
6487
- ));
6495
+ ), /* @__PURE__ */ React47.createElement(
6496
+ Panel,
6497
+ {
6498
+ id: RIGHT_SIDEBAR_ID,
6499
+ order: 3,
6500
+ ref: rightSidebarRef,
6501
+ minSize: rightSidebarMinPercentage ?? rightSidebarPercentage,
6502
+ defaultSize: rightSidebarPercentage,
6503
+ collapsible: true,
6504
+ style: {
6505
+ display: "flex",
6506
+ flexDirection: "row"
6507
+ }
6508
+ },
6509
+ rightPanelContent
6510
+ ))
6511
+ )
6512
+ );
6488
6513
  });
6489
6514
 
6490
6515
  // src/hooks/usePlatform.ts