@noya-app/noya-designsystem 0.1.18 → 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/.turbo/turbo-build.log +9 -9
- package/CHANGELOG.md +13 -0
- package/dist/index.d.mts +15 -2
- package/dist/index.d.ts +15 -2
- package/dist/index.js +97 -72
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +97 -72
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/components/WorkspaceLayout.tsx +59 -12
package/.turbo/turbo-build.log
CHANGED
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
[34mCLI[39m Target: esnext
|
|
6
6
|
[34mCJS[39m Build start
|
|
7
7
|
[34mESM[39m Build start
|
|
8
|
-
[32mCJS[39m [1mdist/index.js [22m[32m226.61 KB[39m
|
|
9
|
-
[32mCJS[39m [1mdist/index.js.map [22m[32m457.18 KB[39m
|
|
10
|
-
[32mCJS[39m ⚡️ Build success in 151ms
|
|
11
|
-
[32mESM[39m [1mdist/index.mjs [22m[32m208.82 KB[39m
|
|
12
|
-
[32mESM[39m [1mdist/index.mjs.map [22m[32m457.30 KB[39m
|
|
13
|
-
[32mESM[39m ⚡️ Build success in 147ms
|
|
14
8
|
[34mDTS[39m Build start
|
|
15
|
-
[
|
|
16
|
-
[
|
|
17
|
-
[
|
|
9
|
+
[32mCJS[39m [1mdist/index.js [22m[32m227.57 KB[39m
|
|
10
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m458.94 KB[39m
|
|
11
|
+
[32mCJS[39m ⚡️ Build success in 249ms
|
|
12
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m209.78 KB[39m
|
|
13
|
+
[32mESM[39m [1mdist/index.mjs.map [22m[32m459.06 KB[39m
|
|
14
|
+
[32mESM[39m ⚡️ Build success in 252ms
|
|
15
|
+
[32mDTS[39m ⚡️ Build success in 9569ms
|
|
16
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m60.59 KB[39m
|
|
17
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m60.59 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @noya-app/noya-designsystem
|
|
2
2
|
|
|
3
|
+
## 0.1.20
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 7306000: Improve embedded apis
|
|
8
|
+
- 5f3843e: Improve workspace sizing
|
|
9
|
+
|
|
10
|
+
## 0.1.19
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- 1114573: Don't autosave workspace layout by default
|
|
15
|
+
|
|
3
16
|
## 0.1.18
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -1075,9 +1075,22 @@ interface Props$1 {
|
|
|
1075
1075
|
hasRightSidebar?: boolean;
|
|
1076
1076
|
hasLeftSidebar?: boolean;
|
|
1077
1077
|
onChangeLayoutState?: (layoutState: PanelLayoutState) => void;
|
|
1078
|
-
leftSidebarInitialSize?: number;
|
|
1079
|
-
rightSidebarInitialSize?: number;
|
|
1080
1078
|
leftSidebarCanResize?: boolean;
|
|
1079
|
+
id?: string;
|
|
1080
|
+
className?: string;
|
|
1081
|
+
style?: React__default.CSSProperties;
|
|
1082
|
+
/**
|
|
1083
|
+
* Accepts a number (px) or % string (e.g. "50%").
|
|
1084
|
+
* Use % to avoid flicker server-rendering.
|
|
1085
|
+
*/
|
|
1086
|
+
leftSidebarInitialSize?: number | string;
|
|
1087
|
+
leftSidebarMinSize?: number | string;
|
|
1088
|
+
/**
|
|
1089
|
+
* Accepts a number (px) or % string (e.g. "50%").
|
|
1090
|
+
* Use % to avoid flicker server-rendering.
|
|
1091
|
+
*/
|
|
1092
|
+
rightSidebarInitialSize?: number | string;
|
|
1093
|
+
rightSidebarMinSize?: number | string;
|
|
1081
1094
|
}
|
|
1082
1095
|
type IWorkspaceLayout = {
|
|
1083
1096
|
setLeftSidebarExpanded: (expanded: boolean) => void;
|
package/dist/index.d.ts
CHANGED
|
@@ -1075,9 +1075,22 @@ interface Props$1 {
|
|
|
1075
1075
|
hasRightSidebar?: boolean;
|
|
1076
1076
|
hasLeftSidebar?: boolean;
|
|
1077
1077
|
onChangeLayoutState?: (layoutState: PanelLayoutState) => void;
|
|
1078
|
-
leftSidebarInitialSize?: number;
|
|
1079
|
-
rightSidebarInitialSize?: number;
|
|
1080
1078
|
leftSidebarCanResize?: boolean;
|
|
1079
|
+
id?: string;
|
|
1080
|
+
className?: string;
|
|
1081
|
+
style?: React__default.CSSProperties;
|
|
1082
|
+
/**
|
|
1083
|
+
* Accepts a number (px) or % string (e.g. "50%").
|
|
1084
|
+
* Use % to avoid flicker server-rendering.
|
|
1085
|
+
*/
|
|
1086
|
+
leftSidebarInitialSize?: number | string;
|
|
1087
|
+
leftSidebarMinSize?: number | string;
|
|
1088
|
+
/**
|
|
1089
|
+
* Accepts a number (px) or % string (e.g. "50%").
|
|
1090
|
+
* Use % to avoid flicker server-rendering.
|
|
1091
|
+
*/
|
|
1092
|
+
rightSidebarInitialSize?: number | string;
|
|
1093
|
+
rightSidebarMinSize?: number | string;
|
|
1081
1094
|
}
|
|
1082
1095
|
type IWorkspaceLayout = {
|
|
1083
1096
|
setLeftSidebarExpanded: (expanded: boolean) => void;
|
package/dist/index.js
CHANGED
|
@@ -6305,11 +6305,21 @@ var WorkspaceLayout = (0, import_react63.forwardRef)(function WorkspaceLayout2({
|
|
|
6305
6305
|
onChangeLayoutState,
|
|
6306
6306
|
leftSidebarInitialSize = 280,
|
|
6307
6307
|
rightSidebarInitialSize = 400,
|
|
6308
|
-
|
|
6308
|
+
leftSidebarMinSize,
|
|
6309
|
+
rightSidebarMinSize,
|
|
6310
|
+
leftSidebarCanResize = false,
|
|
6311
|
+
id,
|
|
6312
|
+
className,
|
|
6313
|
+
style: style3
|
|
6309
6314
|
}, forwardedRef) {
|
|
6310
6315
|
const windowSize = useWindowSize();
|
|
6311
|
-
|
|
6312
|
-
|
|
6316
|
+
function getPercentage(size2) {
|
|
6317
|
+
return typeof size2 === "string" ? parseFloat(size2) : size2 / windowSize.width * 100;
|
|
6318
|
+
}
|
|
6319
|
+
const leftSidebarPercentage = getPercentage(leftSidebarInitialSize);
|
|
6320
|
+
const rightSidebarPercentage = getPercentage(rightSidebarInitialSize);
|
|
6321
|
+
const leftSidebarMinPercentage = leftSidebarMinSize !== void 0 ? getPercentage(leftSidebarMinSize) : void 0;
|
|
6322
|
+
const rightSidebarMinPercentage = rightSidebarMinSize !== void 0 ? getPercentage(rightSidebarMinSize) : void 0;
|
|
6313
6323
|
const panelGroupRef = (0, import_react63.useRef)(null);
|
|
6314
6324
|
const leftSidebarRef = (0, import_react63.useRef)(null);
|
|
6315
6325
|
const rightSidebarRef = (0, import_react63.useRef)(null);
|
|
@@ -6371,82 +6381,97 @@ var WorkspaceLayout = (0, import_react63.forwardRef)(function WorkspaceLayout2({
|
|
|
6371
6381
|
}
|
|
6372
6382
|
}
|
|
6373
6383
|
});
|
|
6374
|
-
|
|
6375
|
-
|
|
6384
|
+
const centerPanelPercentage = 100 - (leftPanelContent ? leftSidebarPercentage : 0) - (rightPanelContent ? rightSidebarPercentage : 0);
|
|
6385
|
+
return /* @__PURE__ */ import_react63.default.createElement(
|
|
6386
|
+
"div",
|
|
6376
6387
|
{
|
|
6377
|
-
|
|
6378
|
-
|
|
6379
|
-
|
|
6380
|
-
|
|
6381
|
-
|
|
6382
|
-
|
|
6383
|
-
|
|
6384
|
-
import_react_resizable_panels.Panel,
|
|
6385
|
-
{
|
|
6386
|
-
id: LEFT_SIDEBAR_ID,
|
|
6387
|
-
order: 1,
|
|
6388
|
-
ref: leftSidebarRef,
|
|
6389
|
-
defaultSize: leftSidebarPercentage,
|
|
6390
|
-
minSize: leftSidebarPercentage,
|
|
6391
|
-
...!leftSidebarCanResize && { maxSize: leftSidebarPercentage },
|
|
6392
|
-
collapsible: true,
|
|
6393
|
-
style: {
|
|
6394
|
-
display: "flex",
|
|
6395
|
-
flexDirection: "row"
|
|
6396
|
-
}
|
|
6397
|
-
},
|
|
6398
|
-
leftPanelContent
|
|
6399
|
-
), /* @__PURE__ */ import_react63.default.createElement(
|
|
6400
|
-
import_react_resizable_panels.PanelResizeHandle,
|
|
6401
|
-
{
|
|
6402
|
-
style: {
|
|
6403
|
-
cursor: "col-resize",
|
|
6404
|
-
width: "1px",
|
|
6405
|
-
height: "100%",
|
|
6406
|
-
backgroundColor: theme.colors.divider
|
|
6407
|
-
}
|
|
6388
|
+
id,
|
|
6389
|
+
className,
|
|
6390
|
+
style: {
|
|
6391
|
+
backgroundColor: theme.colors.canvas.background,
|
|
6392
|
+
display: "flex",
|
|
6393
|
+
flexDirection: "row",
|
|
6394
|
+
...style3
|
|
6408
6395
|
}
|
|
6409
|
-
|
|
6396
|
+
},
|
|
6410
6397
|
/* @__PURE__ */ import_react63.default.createElement(
|
|
6411
|
-
import_react_resizable_panels.
|
|
6398
|
+
import_react_resizable_panels.PanelGroup,
|
|
6412
6399
|
{
|
|
6413
|
-
|
|
6414
|
-
|
|
6415
|
-
|
|
6416
|
-
|
|
6417
|
-
|
|
6418
|
-
flexDirection: "row"
|
|
6419
|
-
}
|
|
6400
|
+
ref: panelGroupRef,
|
|
6401
|
+
id: EDITOR_PANEL_GROUP_ID,
|
|
6402
|
+
direction: "horizontal",
|
|
6403
|
+
autoSaveId: autoSavePrefix ? `${autoSavePrefix}--${EDITOR_PANEL_GROUP_ID}` : void 0,
|
|
6404
|
+
style: { flex: "1" }
|
|
6420
6405
|
},
|
|
6421
|
-
|
|
6422
|
-
|
|
6423
|
-
|
|
6424
|
-
|
|
6425
|
-
|
|
6426
|
-
|
|
6427
|
-
|
|
6428
|
-
|
|
6429
|
-
|
|
6430
|
-
|
|
6406
|
+
hasLeftSidebar && /* @__PURE__ */ import_react63.default.createElement(import_react63.default.Fragment, null, /* @__PURE__ */ import_react63.default.createElement(
|
|
6407
|
+
import_react_resizable_panels.Panel,
|
|
6408
|
+
{
|
|
6409
|
+
id: LEFT_SIDEBAR_ID,
|
|
6410
|
+
order: 1,
|
|
6411
|
+
ref: leftSidebarRef,
|
|
6412
|
+
defaultSize: leftSidebarPercentage,
|
|
6413
|
+
minSize: leftSidebarMinPercentage ?? leftSidebarPercentage,
|
|
6414
|
+
...!leftSidebarCanResize && { maxSize: leftSidebarPercentage },
|
|
6415
|
+
collapsible: true,
|
|
6416
|
+
style: {
|
|
6417
|
+
display: "flex",
|
|
6418
|
+
flexDirection: "row"
|
|
6419
|
+
}
|
|
6420
|
+
},
|
|
6421
|
+
leftPanelContent
|
|
6422
|
+
), /* @__PURE__ */ import_react63.default.createElement(
|
|
6423
|
+
import_react_resizable_panels.PanelResizeHandle,
|
|
6424
|
+
{
|
|
6425
|
+
style: {
|
|
6426
|
+
cursor: "col-resize",
|
|
6427
|
+
width: "1px",
|
|
6428
|
+
height: "100%",
|
|
6429
|
+
backgroundColor: theme.colors.divider
|
|
6430
|
+
}
|
|
6431
6431
|
}
|
|
6432
|
-
|
|
6433
|
-
|
|
6434
|
-
|
|
6435
|
-
|
|
6436
|
-
|
|
6437
|
-
|
|
6438
|
-
|
|
6439
|
-
|
|
6440
|
-
|
|
6441
|
-
|
|
6442
|
-
|
|
6443
|
-
|
|
6444
|
-
|
|
6432
|
+
)),
|
|
6433
|
+
/* @__PURE__ */ import_react63.default.createElement(
|
|
6434
|
+
import_react_resizable_panels.Panel,
|
|
6435
|
+
{
|
|
6436
|
+
id: CONTENT_AREA_ID,
|
|
6437
|
+
order: 2,
|
|
6438
|
+
defaultSize: centerPanelPercentage,
|
|
6439
|
+
minSize: 10,
|
|
6440
|
+
style: {
|
|
6441
|
+
display: "flex",
|
|
6442
|
+
flexDirection: "row"
|
|
6443
|
+
}
|
|
6444
|
+
},
|
|
6445
|
+
centerPanelContent
|
|
6446
|
+
),
|
|
6447
|
+
hasRightSidebar && /* @__PURE__ */ import_react63.default.createElement(import_react63.default.Fragment, null, /* @__PURE__ */ import_react63.default.createElement(
|
|
6448
|
+
import_react_resizable_panels.PanelResizeHandle,
|
|
6449
|
+
{
|
|
6450
|
+
style: {
|
|
6451
|
+
cursor: "col-resize",
|
|
6452
|
+
width: "1px",
|
|
6453
|
+
height: "100%",
|
|
6454
|
+
backgroundColor: theme.colors.divider
|
|
6455
|
+
}
|
|
6445
6456
|
}
|
|
6446
|
-
|
|
6447
|
-
|
|
6448
|
-
|
|
6449
|
-
|
|
6457
|
+
), /* @__PURE__ */ import_react63.default.createElement(
|
|
6458
|
+
import_react_resizable_panels.Panel,
|
|
6459
|
+
{
|
|
6460
|
+
id: RIGHT_SIDEBAR_ID,
|
|
6461
|
+
order: 3,
|
|
6462
|
+
ref: rightSidebarRef,
|
|
6463
|
+
minSize: rightSidebarMinPercentage ?? rightSidebarPercentage,
|
|
6464
|
+
defaultSize: rightSidebarPercentage,
|
|
6465
|
+
collapsible: true,
|
|
6466
|
+
style: {
|
|
6467
|
+
display: "flex",
|
|
6468
|
+
flexDirection: "row"
|
|
6469
|
+
}
|
|
6470
|
+
},
|
|
6471
|
+
rightPanelContent
|
|
6472
|
+
))
|
|
6473
|
+
)
|
|
6474
|
+
);
|
|
6450
6475
|
});
|
|
6451
6476
|
|
|
6452
6477
|
// src/hooks/usePlatform.ts
|