@noya-app/noya-designsystem 0.1.70 → 0.1.71
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 +8 -0
- package/dist/index.d.mts +25 -3
- package/dist/index.d.ts +25 -3
- package/dist/index.js +238 -132
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +218 -114
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/components/Combobox.tsx +3 -0
- package/src/components/InputField.tsx +20 -4
- package/src/components/ListMenu.tsx +1 -1
- package/src/components/UserPicker.tsx +128 -0
- package/src/index.tsx +1 -0
package/dist/index.mjs
CHANGED
|
@@ -4951,7 +4951,15 @@ function parseNumber(value) {
|
|
|
4951
4951
|
return value ? Number(value) : NaN;
|
|
4952
4952
|
}
|
|
4953
4953
|
function InputFieldNumberInput(props) {
|
|
4954
|
-
const {
|
|
4954
|
+
const {
|
|
4955
|
+
value,
|
|
4956
|
+
placeholder,
|
|
4957
|
+
onNudge,
|
|
4958
|
+
onBlur,
|
|
4959
|
+
readOnly,
|
|
4960
|
+
triggersOnEmpty,
|
|
4961
|
+
...rest
|
|
4962
|
+
} = props;
|
|
4955
4963
|
const onSubmit = "onSubmit" in props ? props.onSubmit : void 0;
|
|
4956
4964
|
const onChange = "onChange" in props ? props.onChange : void 0;
|
|
4957
4965
|
const [internalValue, setInternalValue] = useState15();
|
|
@@ -4979,6 +4987,9 @@ function InputFieldNumberInput(props) {
|
|
|
4979
4987
|
(value2) => {
|
|
4980
4988
|
if (value2 === "" || value2 === "-" || value2 === ".") {
|
|
4981
4989
|
setInternalValue(value2);
|
|
4990
|
+
if (triggersOnEmpty) {
|
|
4991
|
+
onChange?.(0, { isEmpty: true });
|
|
4992
|
+
}
|
|
4982
4993
|
return;
|
|
4983
4994
|
}
|
|
4984
4995
|
if (value2.endsWith(".")) {
|
|
@@ -4988,10 +4999,10 @@ function InputFieldNumberInput(props) {
|
|
|
4988
4999
|
setInternalValue(void 0);
|
|
4989
5000
|
const newValue = parseNumber(value2);
|
|
4990
5001
|
if (!isNaN(newValue)) {
|
|
4991
|
-
onChange?.(newValue);
|
|
5002
|
+
onChange?.(newValue, { isEmpty: false });
|
|
4992
5003
|
}
|
|
4993
5004
|
},
|
|
4994
|
-
[onChange]
|
|
5005
|
+
[onChange, triggersOnEmpty]
|
|
4995
5006
|
);
|
|
4996
5007
|
const handleBlur = useCallback13(
|
|
4997
5008
|
(event) => {
|
|
@@ -10920,6 +10931,7 @@ var Combobox = memoGeneric(
|
|
|
10920
10931
|
openMenuBehavior = "showFilteredItems",
|
|
10921
10932
|
onFocus,
|
|
10922
10933
|
onDeleteWhenEmpty,
|
|
10934
|
+
iconPosition = "right",
|
|
10923
10935
|
...rest
|
|
10924
10936
|
}, forwardedRef) {
|
|
10925
10937
|
const props = useMemo27(() => {
|
|
@@ -11260,6 +11272,7 @@ var Combobox = memoGeneric(
|
|
|
11260
11272
|
onSelectItem: handleUpdateSelection,
|
|
11261
11273
|
onHoverIndex: handleIndexChange,
|
|
11262
11274
|
listSize: adjustedListSize,
|
|
11275
|
+
iconPosition,
|
|
11263
11276
|
style: {
|
|
11264
11277
|
flex: `0 0 ${computedHeight}px`
|
|
11265
11278
|
},
|
|
@@ -15017,7 +15030,7 @@ function ListMenu({
|
|
|
15017
15030
|
}) {
|
|
15018
15031
|
const selectedIds = items.flatMap(
|
|
15019
15032
|
(item) => isSelectableMenuItem(item) && item.checked ? [item.value] : []
|
|
15020
|
-
).concat(selectedIdsProp);
|
|
15033
|
+
).concat(selectedIdsProp ?? []);
|
|
15021
15034
|
let chunks = chunkBy2(
|
|
15022
15035
|
items,
|
|
15023
15036
|
(a, b) => a.type !== "separator" && b.type !== "separator"
|
|
@@ -16822,8 +16835,97 @@ function Tabs({
|
|
|
16822
16835
|
)), /* @__PURE__ */ React101.createElement(Divider, null), renderContent({ value: activeTab }));
|
|
16823
16836
|
}
|
|
16824
16837
|
|
|
16838
|
+
// src/components/UserPicker.tsx
|
|
16839
|
+
import React102, { useCallback as useCallback37, useMemo as useMemo43, useState as useState34 } from "react";
|
|
16840
|
+
function UserPicker({
|
|
16841
|
+
users,
|
|
16842
|
+
value,
|
|
16843
|
+
defaultValue: defaultValue2,
|
|
16844
|
+
onChangeUserId,
|
|
16845
|
+
onSelectUser,
|
|
16846
|
+
placeholder = "Search users...",
|
|
16847
|
+
...rest
|
|
16848
|
+
}) {
|
|
16849
|
+
const sortedUsers = useMemo43(() => {
|
|
16850
|
+
return [...users].sort(
|
|
16851
|
+
(a, b) => getUserDisplayName(a).localeCompare(getUserDisplayName(b), void 0, {
|
|
16852
|
+
sensitivity: "base"
|
|
16853
|
+
})
|
|
16854
|
+
);
|
|
16855
|
+
}, [users]);
|
|
16856
|
+
const usersById = useMemo43(() => {
|
|
16857
|
+
return new Map(sortedUsers.map((user) => [user.id, user]));
|
|
16858
|
+
}, [sortedUsers]);
|
|
16859
|
+
const items = useMemo43(() => {
|
|
16860
|
+
return sortedUsers.map(createUserMenuItem);
|
|
16861
|
+
}, [sortedUsers]);
|
|
16862
|
+
const isControlled = value !== void 0;
|
|
16863
|
+
const [uncontrolledValue, setUncontrolledValue] = useState34(defaultValue2);
|
|
16864
|
+
const selectedUserId = isControlled ? value : uncontrolledValue;
|
|
16865
|
+
const selectedItem = useMemo43(() => {
|
|
16866
|
+
if (!selectedUserId) return void 0;
|
|
16867
|
+
return items.find((item) => item.value === selectedUserId);
|
|
16868
|
+
}, [items, selectedUserId]);
|
|
16869
|
+
const updateSelectedUserId = useCallback37(
|
|
16870
|
+
(userId) => {
|
|
16871
|
+
if (!isControlled) {
|
|
16872
|
+
setUncontrolledValue(userId);
|
|
16873
|
+
}
|
|
16874
|
+
onChangeUserId?.(userId);
|
|
16875
|
+
},
|
|
16876
|
+
[isControlled, onChangeUserId]
|
|
16877
|
+
);
|
|
16878
|
+
const handleSelectItem = useCallback37(
|
|
16879
|
+
(item) => {
|
|
16880
|
+
updateSelectedUserId(item.value);
|
|
16881
|
+
onSelectUser?.(usersById.get(item.value));
|
|
16882
|
+
},
|
|
16883
|
+
[updateSelectedUserId, onSelectUser, usersById]
|
|
16884
|
+
);
|
|
16885
|
+
return /* @__PURE__ */ React102.createElement(
|
|
16886
|
+
Combobox,
|
|
16887
|
+
{
|
|
16888
|
+
...rest,
|
|
16889
|
+
placeholder,
|
|
16890
|
+
mode: "option",
|
|
16891
|
+
items,
|
|
16892
|
+
value: selectedItem,
|
|
16893
|
+
onSelectItem: handleSelectItem,
|
|
16894
|
+
iconPosition: "left"
|
|
16895
|
+
}
|
|
16896
|
+
);
|
|
16897
|
+
}
|
|
16898
|
+
function getUserDisplayName(user) {
|
|
16899
|
+
const name = user.name?.trim();
|
|
16900
|
+
const email = user.email?.trim();
|
|
16901
|
+
return name || email || "Anonymous user";
|
|
16902
|
+
}
|
|
16903
|
+
function createUserMenuItem(user) {
|
|
16904
|
+
const title = getUserDisplayName(user);
|
|
16905
|
+
const overflow = 3;
|
|
16906
|
+
return {
|
|
16907
|
+
value: user.id,
|
|
16908
|
+
title,
|
|
16909
|
+
icon: /* @__PURE__ */ React102.createElement("div", { className: "n-relative n-w-[15px] n-h-[15px]" }, /* @__PURE__ */ React102.createElement(
|
|
16910
|
+
Avatar,
|
|
16911
|
+
{
|
|
16912
|
+
size: 15 + overflow * 2,
|
|
16913
|
+
name: title,
|
|
16914
|
+
userId: user.id,
|
|
16915
|
+
image: user.image ?? void 0,
|
|
16916
|
+
className: "n-pointer-events-none",
|
|
16917
|
+
variant: "bare",
|
|
16918
|
+
style: {
|
|
16919
|
+
position: "absolute",
|
|
16920
|
+
inset: -overflow
|
|
16921
|
+
}
|
|
16922
|
+
}
|
|
16923
|
+
))
|
|
16924
|
+
};
|
|
16925
|
+
}
|
|
16926
|
+
|
|
16825
16927
|
// src/components/UserPointer.tsx
|
|
16826
|
-
import
|
|
16928
|
+
import React103, { memo as memo35, useMemo as useMemo44 } from "react";
|
|
16827
16929
|
var UserPointerContainer = memo35(function UserPointerContainer2({
|
|
16828
16930
|
point,
|
|
16829
16931
|
visible,
|
|
@@ -16831,7 +16933,7 @@ var UserPointerContainer = memo35(function UserPointerContainer2({
|
|
|
16831
16933
|
className,
|
|
16832
16934
|
style: style2
|
|
16833
16935
|
}) {
|
|
16834
|
-
return /* @__PURE__ */
|
|
16936
|
+
return /* @__PURE__ */ React103.createElement(
|
|
16835
16937
|
"div",
|
|
16836
16938
|
{
|
|
16837
16939
|
style: {
|
|
@@ -16857,7 +16959,7 @@ var UserNameTag = memo35(function UserNameTag2({
|
|
|
16857
16959
|
size = "medium",
|
|
16858
16960
|
bordered = true
|
|
16859
16961
|
}) {
|
|
16860
|
-
return /* @__PURE__ */
|
|
16962
|
+
return /* @__PURE__ */ React103.createElement(
|
|
16861
16963
|
"span",
|
|
16862
16964
|
{
|
|
16863
16965
|
className: cx(
|
|
@@ -16883,7 +16985,7 @@ var UserPointerIcon = memo35(function PointerIcon({
|
|
|
16883
16985
|
style: style2
|
|
16884
16986
|
}) {
|
|
16885
16987
|
const points = "0,5 10,0 10,10";
|
|
16886
|
-
return /* @__PURE__ */
|
|
16988
|
+
return /* @__PURE__ */ React103.createElement(
|
|
16887
16989
|
"svg",
|
|
16888
16990
|
{
|
|
16889
16991
|
width: size,
|
|
@@ -16898,7 +17000,7 @@ var UserPointerIcon = memo35(function PointerIcon({
|
|
|
16898
17000
|
...style2
|
|
16899
17001
|
}
|
|
16900
17002
|
},
|
|
16901
|
-
/* @__PURE__ */
|
|
17003
|
+
/* @__PURE__ */ React103.createElement(
|
|
16902
17004
|
"polygon",
|
|
16903
17005
|
{
|
|
16904
17006
|
points,
|
|
@@ -16924,22 +17026,22 @@ var UserPointer = memo35(function UserPointer2({
|
|
|
16924
17026
|
labelSize = "medium",
|
|
16925
17027
|
bordered = true
|
|
16926
17028
|
}) {
|
|
16927
|
-
const userBackgroundColor =
|
|
17029
|
+
const userBackgroundColor = useMemo44(
|
|
16928
17030
|
() => backgroundColor ?? colorFromString(userId ?? name ?? ""),
|
|
16929
17031
|
[backgroundColor, userId, name]
|
|
16930
17032
|
);
|
|
16931
|
-
const pointerOverlapStyle =
|
|
17033
|
+
const pointerOverlapStyle = useMemo44(
|
|
16932
17034
|
() => ({
|
|
16933
17035
|
marginRight: `-${POINTER_OVERLAP}px`,
|
|
16934
17036
|
marginBottom: `-${POINTER_OVERLAP}px`
|
|
16935
17037
|
}),
|
|
16936
17038
|
[]
|
|
16937
17039
|
);
|
|
16938
|
-
const nameTagOverlapStyle =
|
|
17040
|
+
const nameTagOverlapStyle = useMemo44(
|
|
16939
17041
|
() => ({ marginLeft: `${POINTER_SIZE - POINTER_OVERLAP + 1}px` }),
|
|
16940
17042
|
[]
|
|
16941
17043
|
);
|
|
16942
|
-
return /* @__PURE__ */
|
|
17044
|
+
return /* @__PURE__ */ React103.createElement(
|
|
16943
17045
|
UserPointerContainer,
|
|
16944
17046
|
{
|
|
16945
17047
|
point,
|
|
@@ -16947,14 +17049,14 @@ var UserPointer = memo35(function UserPointer2({
|
|
|
16947
17049
|
className,
|
|
16948
17050
|
style: style2
|
|
16949
17051
|
},
|
|
16950
|
-
name && /* @__PURE__ */
|
|
17052
|
+
name && /* @__PURE__ */ React103.createElement("div", { className: "n-relative" }, showPointerIcon && /* @__PURE__ */ React103.createElement(
|
|
16951
17053
|
UserPointerIcon,
|
|
16952
17054
|
{
|
|
16953
17055
|
size: POINTER_SIZE,
|
|
16954
17056
|
color: userBackgroundColor,
|
|
16955
17057
|
style: pointerOverlapStyle
|
|
16956
17058
|
}
|
|
16957
|
-
), /* @__PURE__ */
|
|
17059
|
+
), /* @__PURE__ */ React103.createElement(
|
|
16958
17060
|
UserNameTag,
|
|
16959
17061
|
{
|
|
16960
17062
|
backgroundColor: userBackgroundColor,
|
|
@@ -16970,16 +17072,16 @@ var UserPointer = memo35(function UserPointer2({
|
|
|
16970
17072
|
|
|
16971
17073
|
// src/components/workspace/WorkspaceLayout.tsx
|
|
16972
17074
|
import { useKeyboardShortcuts as useKeyboardShortcuts4 } from "@noya-app/noya-keymap";
|
|
16973
|
-
import
|
|
17075
|
+
import React109, {
|
|
16974
17076
|
memo as memo37,
|
|
16975
|
-
useCallback as
|
|
17077
|
+
useCallback as useCallback39,
|
|
16976
17078
|
useImperativeHandle as useImperativeHandle9,
|
|
16977
|
-
useMemo as
|
|
17079
|
+
useMemo as useMemo48,
|
|
16978
17080
|
useRef as useRef30
|
|
16979
17081
|
} from "react";
|
|
16980
17082
|
|
|
16981
17083
|
// src/components/workspace/DrawerWorkspaceLayout.tsx
|
|
16982
|
-
import
|
|
17084
|
+
import React107, { useMemo as useMemo46, useRef as useRef28, useState as useState35 } from "react";
|
|
16983
17085
|
|
|
16984
17086
|
// src/components/workspace/constants.ts
|
|
16985
17087
|
var EDITOR_PANEL_GROUP_ID = "editor-panel-group";
|
|
@@ -16988,20 +17090,20 @@ var RIGHT_SIDEBAR_ID = "editor-3-right-sidebar";
|
|
|
16988
17090
|
var CONTENT_AREA_ID = "editor-2-content-area";
|
|
16989
17091
|
|
|
16990
17092
|
// src/components/workspace/VerticalTabMenu.tsx
|
|
16991
|
-
import
|
|
17093
|
+
import React106, { useMemo as useMemo45 } from "react";
|
|
16992
17094
|
|
|
16993
17095
|
// src/components/Toolbar.tsx
|
|
16994
17096
|
import { useKeyboardShortcuts as useKeyboardShortcuts3 } from "@noya-app/noya-keymap";
|
|
16995
|
-
import
|
|
17097
|
+
import React105, {
|
|
16996
17098
|
createContext as createContext15,
|
|
16997
17099
|
useContext as useContext16
|
|
16998
17100
|
} from "react";
|
|
16999
17101
|
|
|
17000
17102
|
// src/components/ToolbarDrawer.tsx
|
|
17001
|
-
import
|
|
17103
|
+
import React104, { forwardRef as forwardRef28, memo as memo36 } from "react";
|
|
17002
17104
|
var ToolbarDrawer = memo36(
|
|
17003
17105
|
forwardRef28(function ToolbarDrawer2({ children, trigger, sideOffset = 8 }, ref) {
|
|
17004
|
-
return /* @__PURE__ */
|
|
17106
|
+
return /* @__PURE__ */ React104.createElement("div", { className: "n-relative", ref }, /* @__PURE__ */ React104.createElement(
|
|
17005
17107
|
"div",
|
|
17006
17108
|
{
|
|
17007
17109
|
className: "n-absolute n-bottom-full n-left-1/2 -n-translate-x-1/2 n-rounded-t-lg n-border n-border-toolbar-drawer-border n-border-b-transparent n-bg-toolbar-drawer-background -n-z-10",
|
|
@@ -17022,8 +17124,8 @@ var ToolbarMenuDropdown = memoGeneric(function ToolbarMenuDropdown2({
|
|
|
17022
17124
|
item,
|
|
17023
17125
|
onSelectMenuItem
|
|
17024
17126
|
}) {
|
|
17025
|
-
const [open, setOpen] =
|
|
17026
|
-
return /* @__PURE__ */
|
|
17127
|
+
const [open, setOpen] = React105.useState(false);
|
|
17128
|
+
return /* @__PURE__ */ React105.createElement(
|
|
17027
17129
|
DropdownMenu,
|
|
17028
17130
|
{
|
|
17029
17131
|
open,
|
|
@@ -17035,7 +17137,7 @@ var ToolbarMenuDropdown = memoGeneric(function ToolbarMenuDropdown2({
|
|
|
17035
17137
|
}
|
|
17036
17138
|
}
|
|
17037
17139
|
},
|
|
17038
|
-
/* @__PURE__ */
|
|
17140
|
+
/* @__PURE__ */ React105.createElement(
|
|
17039
17141
|
Button,
|
|
17040
17142
|
{
|
|
17041
17143
|
disabled: item.disabled,
|
|
@@ -17051,7 +17153,7 @@ var ToolbarShortcut = ({
|
|
|
17051
17153
|
shortcut,
|
|
17052
17154
|
label
|
|
17053
17155
|
}) => {
|
|
17054
|
-
return /* @__PURE__ */
|
|
17156
|
+
return /* @__PURE__ */ React105.createElement("div", { className: "n-flex n-items-center" }, label, /* @__PURE__ */ React105.createElement(Spacer.Horizontal, { size: 6 }), /* @__PURE__ */ React105.createElement(KeyboardShortcut, { shortcut }));
|
|
17055
17157
|
};
|
|
17056
17158
|
var ToolbarMenuPopover = memoGeneric(function ToolbarMenuPopover2({
|
|
17057
17159
|
item,
|
|
@@ -17065,8 +17167,8 @@ var ToolbarMenuPopover = memoGeneric(function ToolbarMenuPopover2({
|
|
|
17065
17167
|
content: itemContent,
|
|
17066
17168
|
checked
|
|
17067
17169
|
} = item;
|
|
17068
|
-
const [open, setOpen] =
|
|
17069
|
-
const content = /* @__PURE__ */
|
|
17170
|
+
const [open, setOpen] = React105.useState(false);
|
|
17171
|
+
const content = /* @__PURE__ */ React105.createElement("span", null, /* @__PURE__ */ React105.createElement(
|
|
17070
17172
|
Popover,
|
|
17071
17173
|
{
|
|
17072
17174
|
open,
|
|
@@ -17075,7 +17177,7 @@ var ToolbarMenuPopover = memoGeneric(function ToolbarMenuPopover2({
|
|
|
17075
17177
|
showArrow: false,
|
|
17076
17178
|
sideOffset: SIDE_OFFSET,
|
|
17077
17179
|
portalContainer,
|
|
17078
|
-
trigger: /* @__PURE__ */
|
|
17180
|
+
trigger: /* @__PURE__ */ React105.createElement(
|
|
17079
17181
|
Button,
|
|
17080
17182
|
{
|
|
17081
17183
|
disabled,
|
|
@@ -17088,7 +17190,7 @@ var ToolbarMenuPopover = memoGeneric(function ToolbarMenuPopover2({
|
|
|
17088
17190
|
},
|
|
17089
17191
|
typeof itemContent === "function" ? itemContent({ close: () => setOpen(false) }) : itemContent
|
|
17090
17192
|
));
|
|
17091
|
-
return tooltip && !open ? /* @__PURE__ */
|
|
17193
|
+
return tooltip && !open ? /* @__PURE__ */ React105.createElement(
|
|
17092
17194
|
Tooltip,
|
|
17093
17195
|
{
|
|
17094
17196
|
sideOffset: SIDE_OFFSET,
|
|
@@ -17108,7 +17210,7 @@ var ToolbarMenuButton = memoGeneric(function ToolbarMenuButton2({
|
|
|
17108
17210
|
displayFilter
|
|
17109
17211
|
}) {
|
|
17110
17212
|
const isActive = item.checked || activeValue === item.value;
|
|
17111
|
-
const content = /* @__PURE__ */
|
|
17213
|
+
const content = /* @__PURE__ */ React105.createElement(
|
|
17112
17214
|
Button,
|
|
17113
17215
|
{
|
|
17114
17216
|
as,
|
|
@@ -17125,7 +17227,7 @@ var ToolbarMenuButton = memoGeneric(function ToolbarMenuButton2({
|
|
|
17125
17227
|
displayFilter === "iconOnly" ? void 0 : item.title
|
|
17126
17228
|
);
|
|
17127
17229
|
const tooltip = item.tooltip ?? (displayFilter === "iconOnly" && item.title ? item.title : void 0);
|
|
17128
|
-
return item.drawer && isActive ? /* @__PURE__ */
|
|
17230
|
+
return item.drawer && isActive ? /* @__PURE__ */ React105.createElement(ToolbarDrawer, { trigger: content }, item.drawer) : tooltip ? /* @__PURE__ */ React105.createElement(Tooltip, { sideOffset: SIDE_OFFSET, content: tooltip, side: tooltipSide }, content) : content;
|
|
17129
17231
|
});
|
|
17130
17232
|
var ToolbarMenuItem = memoGeneric(function ToolbarMenuItem2({
|
|
17131
17233
|
item,
|
|
@@ -17141,13 +17243,13 @@ var ToolbarMenuItem = memoGeneric(function ToolbarMenuItem2({
|
|
|
17141
17243
|
const dividerOverflow = dividerOverflowProp ?? contextDividerOverflow ?? 4;
|
|
17142
17244
|
if (item.type === "sectionHeader") return null;
|
|
17143
17245
|
if (item.type === "separator") {
|
|
17144
|
-
return /* @__PURE__ */
|
|
17246
|
+
return /* @__PURE__ */ React105.createElement(DividerVertical, { overflow: dividerOverflow });
|
|
17145
17247
|
}
|
|
17146
17248
|
if (item.type === "popover") {
|
|
17147
|
-
return /* @__PURE__ */
|
|
17249
|
+
return /* @__PURE__ */ React105.createElement(ToolbarMenuPopover, { item, portalContainer });
|
|
17148
17250
|
}
|
|
17149
17251
|
if (isSelectableMenuItem(item)) {
|
|
17150
|
-
return /* @__PURE__ */
|
|
17252
|
+
return /* @__PURE__ */ React105.createElement(
|
|
17151
17253
|
ToolbarMenuButton,
|
|
17152
17254
|
{
|
|
17153
17255
|
item,
|
|
@@ -17159,7 +17261,7 @@ var ToolbarMenuItem = memoGeneric(function ToolbarMenuItem2({
|
|
|
17159
17261
|
}
|
|
17160
17262
|
);
|
|
17161
17263
|
}
|
|
17162
|
-
return /* @__PURE__ */
|
|
17264
|
+
return /* @__PURE__ */ React105.createElement(ToolbarMenuDropdown, { item, onSelectMenuItem });
|
|
17163
17265
|
});
|
|
17164
17266
|
var ToolbarMenu = memoGeneric(function ToolbarMenu2({
|
|
17165
17267
|
items,
|
|
@@ -17171,8 +17273,8 @@ var ToolbarMenu = memoGeneric(function ToolbarMenu2({
|
|
|
17171
17273
|
displayFilter = "iconAndText",
|
|
17172
17274
|
dividerOverflow
|
|
17173
17275
|
}) {
|
|
17174
|
-
return /* @__PURE__ */
|
|
17175
|
-
return /* @__PURE__ */
|
|
17276
|
+
return /* @__PURE__ */ React105.createElement(React105.Fragment, null, items.map((item, i) => {
|
|
17277
|
+
return /* @__PURE__ */ React105.createElement(
|
|
17176
17278
|
ToolbarMenuItem,
|
|
17177
17279
|
{
|
|
17178
17280
|
key: i,
|
|
@@ -17197,21 +17299,21 @@ function Toolbar({
|
|
|
17197
17299
|
shouldBindKeyboardShortcuts = true,
|
|
17198
17300
|
dividerOverflow
|
|
17199
17301
|
}) {
|
|
17200
|
-
const allMenuItems =
|
|
17302
|
+
const allMenuItems = React105.useMemo(
|
|
17201
17303
|
() => [...leftMenuItems, ...rightMenuItems],
|
|
17202
17304
|
[leftMenuItems, rightMenuItems]
|
|
17203
17305
|
);
|
|
17204
17306
|
useKeyboardShortcuts3(
|
|
17205
|
-
|
|
17307
|
+
React105.useMemo(
|
|
17206
17308
|
() => onSelectMenuItem && shouldBindKeyboardShortcuts ? getKeyboardShortcutsForMenuItems(allMenuItems, onSelectMenuItem) : {},
|
|
17207
17309
|
[allMenuItems, onSelectMenuItem, shouldBindKeyboardShortcuts]
|
|
17208
17310
|
)
|
|
17209
17311
|
);
|
|
17210
|
-
return /* @__PURE__ */
|
|
17312
|
+
return /* @__PURE__ */ React105.createElement(
|
|
17211
17313
|
BaseToolbar,
|
|
17212
17314
|
{
|
|
17213
17315
|
logo,
|
|
17214
|
-
left: leftMenuItems.length > 0 && /* @__PURE__ */
|
|
17316
|
+
left: leftMenuItems.length > 0 && /* @__PURE__ */ React105.createElement("div", { className: "n-flex n-gap-2" }, /* @__PURE__ */ React105.createElement(
|
|
17215
17317
|
ToolbarMenu,
|
|
17216
17318
|
{
|
|
17217
17319
|
items: leftMenuItems,
|
|
@@ -17219,7 +17321,7 @@ function Toolbar({
|
|
|
17219
17321
|
dividerOverflow
|
|
17220
17322
|
}
|
|
17221
17323
|
)),
|
|
17222
|
-
right: rightMenuItems.length > 0 && /* @__PURE__ */
|
|
17324
|
+
right: rightMenuItems.length > 0 && /* @__PURE__ */ React105.createElement("div", { className: "n-flex n-gap-2" }, /* @__PURE__ */ React105.createElement(
|
|
17223
17325
|
ToolbarMenu,
|
|
17224
17326
|
{
|
|
17225
17327
|
items: rightMenuItems,
|
|
@@ -17240,19 +17342,19 @@ var VerticalTabMenu = memoGeneric(function VerticalTabMenu2({
|
|
|
17240
17342
|
onChange,
|
|
17241
17343
|
tooltipSide
|
|
17242
17344
|
}) {
|
|
17243
|
-
const style2 =
|
|
17345
|
+
const style2 = useMemo45(() => {
|
|
17244
17346
|
return {
|
|
17245
17347
|
[cssVarNames.colors.inputBackground]: "transparent",
|
|
17246
17348
|
[cssVarNames.colors.buttonBackground]: "transparent"
|
|
17247
17349
|
};
|
|
17248
17350
|
}, []);
|
|
17249
|
-
return /* @__PURE__ */
|
|
17351
|
+
return /* @__PURE__ */ React106.createElement(
|
|
17250
17352
|
"div",
|
|
17251
17353
|
{
|
|
17252
17354
|
className: "n-w-[calc(var(--n-toolbar-height)+1px)] n-h-full n-bg-sidebar-background n-flex n-flex-col n-items-center n-py-3 n-gap-3",
|
|
17253
17355
|
style: style2
|
|
17254
17356
|
},
|
|
17255
|
-
/* @__PURE__ */
|
|
17357
|
+
/* @__PURE__ */ React106.createElement(
|
|
17256
17358
|
ToolbarMenu,
|
|
17257
17359
|
{
|
|
17258
17360
|
items,
|
|
@@ -17281,11 +17383,11 @@ var DrawerWorkspaceLayout = memoGeneric(function DrawerWorkspaceLayout2({
|
|
|
17281
17383
|
compactDrawerMenu
|
|
17282
17384
|
}) {
|
|
17283
17385
|
const portalContainer = useRef28(null);
|
|
17284
|
-
const [{ leftSidebarCollapsed, rightSidebarCollapsed }, setLayoutState] =
|
|
17386
|
+
const [{ leftSidebarCollapsed, rightSidebarCollapsed }, setLayoutState] = useState35({
|
|
17285
17387
|
leftSidebarCollapsed: true,
|
|
17286
17388
|
rightSidebarCollapsed: true
|
|
17287
17389
|
});
|
|
17288
|
-
const allTabItems =
|
|
17390
|
+
const allTabItems = useMemo46(
|
|
17289
17391
|
() => [
|
|
17290
17392
|
...leftPanel ? leftTabItems ?? [] : [],
|
|
17291
17393
|
...rightPanel ? rightTabItems ?? [] : []
|
|
@@ -17293,16 +17395,16 @@ var DrawerWorkspaceLayout = memoGeneric(function DrawerWorkspaceLayout2({
|
|
|
17293
17395
|
[leftTabItems, rightTabItems, leftPanel, rightPanel]
|
|
17294
17396
|
);
|
|
17295
17397
|
const hasTabs = allTabItems.length > 0;
|
|
17296
|
-
const allSelectableTabItems =
|
|
17398
|
+
const allSelectableTabItems = useMemo46(
|
|
17297
17399
|
() => allTabItems.filter(isSelectableMenuItem),
|
|
17298
17400
|
[allTabItems]
|
|
17299
17401
|
);
|
|
17300
17402
|
const useCompactInToolbar = !!compactDrawerMenu && allSelectableTabItems.length <= 1;
|
|
17301
|
-
const leftSelectableTabItems =
|
|
17403
|
+
const leftSelectableTabItems = useMemo46(
|
|
17302
17404
|
() => (leftTabItems ?? []).filter(isSelectableMenuItem),
|
|
17303
17405
|
[leftTabItems]
|
|
17304
17406
|
);
|
|
17305
|
-
const rightSelectableTabItems =
|
|
17407
|
+
const rightSelectableTabItems = useMemo46(
|
|
17306
17408
|
() => (rightTabItems ?? []).filter(isSelectableMenuItem),
|
|
17307
17409
|
[rightTabItems]
|
|
17308
17410
|
);
|
|
@@ -17339,14 +17441,14 @@ var DrawerWorkspaceLayout = memoGeneric(function DrawerWorkspaceLayout2({
|
|
|
17339
17441
|
activeValue: rightTabValue,
|
|
17340
17442
|
isSidebarCollapsed: rightSidebarCollapsed
|
|
17341
17443
|
} : { activeValue: void 0, isSidebarCollapsed: true };
|
|
17342
|
-
return /* @__PURE__ */
|
|
17444
|
+
return /* @__PURE__ */ React107.createElement(
|
|
17343
17445
|
"div",
|
|
17344
17446
|
{
|
|
17345
17447
|
ref: portalContainer,
|
|
17346
17448
|
id: EDITOR_PANEL_GROUP_ID,
|
|
17347
17449
|
className: "n-flex n-flex-1 n-relative focus:n-outline-none"
|
|
17348
17450
|
},
|
|
17349
|
-
hasTabs && !useCompactInToolbar && /* @__PURE__ */
|
|
17451
|
+
hasTabs && !useCompactInToolbar && /* @__PURE__ */ React107.createElement(React107.Fragment, null, /* @__PURE__ */ React107.createElement(
|
|
17350
17452
|
VerticalTabMenu,
|
|
17351
17453
|
{
|
|
17352
17454
|
tooltipSide: "right",
|
|
@@ -17355,8 +17457,8 @@ var DrawerWorkspaceLayout = memoGeneric(function DrawerWorkspaceLayout2({
|
|
|
17355
17457
|
isSidebarCollapsed,
|
|
17356
17458
|
onChange: (value) => handleSelectTab(value)
|
|
17357
17459
|
}
|
|
17358
|
-
), /* @__PURE__ */
|
|
17359
|
-
useCompactInToolbar && /* @__PURE__ */
|
|
17460
|
+
), /* @__PURE__ */ React107.createElement(DividerVertical, { className: "n-h-full" })),
|
|
17461
|
+
useCompactInToolbar && /* @__PURE__ */ React107.createElement("div", { className: "n-absolute n-top-0 n-left-0 n-h-[calc(var(--n-toolbar-height)+1px)] n-w-[calc(var(--n-toolbar-height)+1px)] n-bg-sidebar-background n-border-r n-border-b n-border-divider-strong n-z-10 n-flex n-items-center n-justify-center" }, allSelectableTabItems[0] && /* @__PURE__ */ React107.createElement(
|
|
17360
17462
|
Button,
|
|
17361
17463
|
{
|
|
17362
17464
|
variant: "none",
|
|
@@ -17379,8 +17481,8 @@ var DrawerWorkspaceLayout = memoGeneric(function DrawerWorkspaceLayout2({
|
|
|
17379
17481
|
}
|
|
17380
17482
|
}
|
|
17381
17483
|
)),
|
|
17382
|
-
/* @__PURE__ */
|
|
17383
|
-
leftPanel && /* @__PURE__ */
|
|
17484
|
+
/* @__PURE__ */ React107.createElement("div", { className: "n-flex-1 n-flex n-relative" }, centerPanel),
|
|
17485
|
+
leftPanel && /* @__PURE__ */ React107.createElement(
|
|
17384
17486
|
Drawer,
|
|
17385
17487
|
{
|
|
17386
17488
|
ref: leftSidebarRef,
|
|
@@ -17401,7 +17503,7 @@ var DrawerWorkspaceLayout = memoGeneric(function DrawerWorkspaceLayout2({
|
|
|
17401
17503
|
},
|
|
17402
17504
|
leftPanel
|
|
17403
17505
|
),
|
|
17404
|
-
rightPanel && /* @__PURE__ */
|
|
17506
|
+
rightPanel && /* @__PURE__ */ React107.createElement(
|
|
17405
17507
|
Drawer,
|
|
17406
17508
|
{
|
|
17407
17509
|
id: RIGHT_SIDEBAR_ID,
|
|
@@ -17427,7 +17529,7 @@ var DrawerWorkspaceLayout = memoGeneric(function DrawerWorkspaceLayout2({
|
|
|
17427
17529
|
});
|
|
17428
17530
|
|
|
17429
17531
|
// src/components/workspace/PanelWorkspaceLayout.tsx
|
|
17430
|
-
import
|
|
17532
|
+
import React108, { useCallback as useCallback38, useMemo as useMemo47, useRef as useRef29 } from "react";
|
|
17431
17533
|
import {
|
|
17432
17534
|
Panel,
|
|
17433
17535
|
PanelGroup,
|
|
@@ -17601,7 +17703,7 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
17601
17703
|
const hasLeftPanel = !!leftPanel;
|
|
17602
17704
|
const hasRightPanel = !!rightPanel;
|
|
17603
17705
|
const hasCenterPanel = !!centerPanel;
|
|
17604
|
-
const autoSaveId =
|
|
17706
|
+
const autoSaveId = useMemo47(() => {
|
|
17605
17707
|
return autoSavePrefix ? `${autoSavePrefix}--v2--${EDITOR_PANEL_GROUP_ID}` : Math.random().toString(36).substring(2, 15);
|
|
17606
17708
|
}, [autoSavePrefix]);
|
|
17607
17709
|
const layoutIds = getLayoutIds({
|
|
@@ -17628,7 +17730,7 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
17628
17730
|
});
|
|
17629
17731
|
const [data, setData] = usePersistentStateObject(clientStorage, storageKey, {});
|
|
17630
17732
|
const layoutGroup = data?.[propertyKey];
|
|
17631
|
-
const { leftSidebarCollapsed, rightSidebarCollapsed } =
|
|
17733
|
+
const { leftSidebarCollapsed, rightSidebarCollapsed } = useMemo47(() => {
|
|
17632
17734
|
return getLayoutCollapsedState({
|
|
17633
17735
|
layoutGroup,
|
|
17634
17736
|
propertyKey,
|
|
@@ -17637,7 +17739,7 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
17637
17739
|
hasRightPanel
|
|
17638
17740
|
});
|
|
17639
17741
|
}, [layoutGroup, propertyKey, layoutIds, hasLeftPanel, hasRightPanel]);
|
|
17640
|
-
const handleLeftTabChange =
|
|
17742
|
+
const handleLeftTabChange = useCallback38(
|
|
17641
17743
|
(value) => {
|
|
17642
17744
|
if (value === leftTabValue) {
|
|
17643
17745
|
if (leftSidebarRef.current?.isExpanded()) {
|
|
@@ -17654,7 +17756,7 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
17654
17756
|
},
|
|
17655
17757
|
[leftSidebarRef, leftTabValue, onChangeLeftTab]
|
|
17656
17758
|
);
|
|
17657
|
-
const handleRightTabChange =
|
|
17759
|
+
const handleRightTabChange = useCallback38(
|
|
17658
17760
|
(value) => {
|
|
17659
17761
|
if (value === rightTabValue) {
|
|
17660
17762
|
if (rightSidebarRef.current?.isExpanded()) {
|
|
@@ -17671,7 +17773,7 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
17671
17773
|
},
|
|
17672
17774
|
[onChangeRightTab, rightSidebarRef, rightTabValue]
|
|
17673
17775
|
);
|
|
17674
|
-
const handleLayoutChange =
|
|
17776
|
+
const handleLayoutChange = useCallback38(
|
|
17675
17777
|
(layout) => {
|
|
17676
17778
|
setData((prev) => {
|
|
17677
17779
|
const newData = {
|
|
@@ -17689,7 +17791,7 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
17689
17791
|
const showLeftTabs = !!leftSidebarOptions.showTabs && !!leftTabItems && // When compact drawer UI is enabled, only show the rail when the
|
|
17690
17792
|
// sidebar is collapsed (for large screens/panel layout).
|
|
17691
17793
|
(!compactDrawerMenu || leftSidebarCollapsed);
|
|
17692
|
-
return /* @__PURE__ */
|
|
17794
|
+
return /* @__PURE__ */ React108.createElement(
|
|
17693
17795
|
PanelGroup,
|
|
17694
17796
|
{
|
|
17695
17797
|
ref: panelGroupRef,
|
|
@@ -17700,7 +17802,7 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
17700
17802
|
autoSaveId,
|
|
17701
17803
|
onLayout: handleLayoutChange
|
|
17702
17804
|
},
|
|
17703
|
-
leftPanel && /* @__PURE__ */
|
|
17805
|
+
leftPanel && /* @__PURE__ */ React108.createElement(React108.Fragment, null, showLeftTabs && /* @__PURE__ */ React108.createElement(
|
|
17704
17806
|
VerticalTabMenu,
|
|
17705
17807
|
{
|
|
17706
17808
|
tooltipSide: "right",
|
|
@@ -17709,7 +17811,7 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
17709
17811
|
isSidebarCollapsed: leftSidebarCollapsed,
|
|
17710
17812
|
onChange: handleLeftTabChange
|
|
17711
17813
|
}
|
|
17712
|
-
), showLeftTabs && !leftSidebarCollapsed && /* @__PURE__ */
|
|
17814
|
+
), showLeftTabs && !leftSidebarCollapsed && /* @__PURE__ */ React108.createElement(DividerVertical, { className: "n-h-full" }), /* @__PURE__ */ React108.createElement(
|
|
17713
17815
|
Panel,
|
|
17714
17816
|
{
|
|
17715
17817
|
id: LEFT_SIDEBAR_ID,
|
|
@@ -17722,8 +17824,8 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
17722
17824
|
collapsible: true
|
|
17723
17825
|
},
|
|
17724
17826
|
leftSidebarCollapsed ? null : leftPanel
|
|
17725
|
-
), /* @__PURE__ */
|
|
17726
|
-
/* @__PURE__ */
|
|
17827
|
+
), /* @__PURE__ */ React108.createElement(PanelResizeHandle, { className: "n-cursor-col-resize n-w-px n-h-full n-bg-divider" })),
|
|
17828
|
+
/* @__PURE__ */ React108.createElement(
|
|
17727
17829
|
Panel,
|
|
17728
17830
|
{
|
|
17729
17831
|
id: CONTENT_AREA_ID,
|
|
@@ -17734,7 +17836,7 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
17734
17836
|
},
|
|
17735
17837
|
centerPanel
|
|
17736
17838
|
),
|
|
17737
|
-
rightPanel && /* @__PURE__ */
|
|
17839
|
+
rightPanel && /* @__PURE__ */ React108.createElement(React108.Fragment, null, /* @__PURE__ */ React108.createElement(PanelResizeHandle, { className: "n-cursor-col-resize n-w-px n-h-full n-bg-divider" }), /* @__PURE__ */ React108.createElement(
|
|
17738
17840
|
Panel,
|
|
17739
17841
|
{
|
|
17740
17842
|
id: RIGHT_SIDEBAR_ID,
|
|
@@ -17747,7 +17849,7 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
17747
17849
|
collapsible: true
|
|
17748
17850
|
},
|
|
17749
17851
|
rightSidebarCollapsed ? null : rightPanel
|
|
17750
|
-
), rightSidebarOptions.showTabs && rightTabItems && !rightSidebarCollapsed && /* @__PURE__ */
|
|
17852
|
+
), rightSidebarOptions.showTabs && rightTabItems && !rightSidebarCollapsed && /* @__PURE__ */ React108.createElement(DividerVertical, { className: "n-h-full" }), rightSidebarOptions.showTabs && rightTabItems && /* @__PURE__ */ React108.createElement(
|
|
17751
17853
|
VerticalTabMenu,
|
|
17752
17854
|
{
|
|
17753
17855
|
tooltipSide: "left",
|
|
@@ -17836,7 +17938,7 @@ var WorkspaceLayout = forwardRefGeneric(function WorkspaceLayout2({
|
|
|
17836
17938
|
theme,
|
|
17837
17939
|
compactDrawerMenu
|
|
17838
17940
|
}, forwardedRef) {
|
|
17839
|
-
const containerRef =
|
|
17941
|
+
const containerRef = React109.useRef(null);
|
|
17840
17942
|
const containerSize = useSize(containerRef);
|
|
17841
17943
|
const windowSize = useWindowSize();
|
|
17842
17944
|
const parentSize = detectSize === "window" ? windowSize : containerSize && containerSize.width > 0 ? containerSize : windowSize;
|
|
@@ -17937,56 +18039,56 @@ var WorkspaceLayout = forwardRefGeneric(function WorkspaceLayout2({
|
|
|
17937
18039
|
});
|
|
17938
18040
|
const centerPanelPercentage = 100 - (left ? leftSidebarPercentage : 0) - (right ? rightSidebarPercentage : 0);
|
|
17939
18041
|
const isDrawerActive = sideType === "drawer" || sideType === "auto" && parentSize.width <= sideTypeBreakpoint;
|
|
17940
|
-
const closeLeftSidebar =
|
|
18042
|
+
const closeLeftSidebar = useCallback39(() => {
|
|
17941
18043
|
if (isDrawerActive) {
|
|
17942
18044
|
leftSidebarRef.current?.collapse();
|
|
17943
18045
|
}
|
|
17944
18046
|
}, [isDrawerActive]);
|
|
17945
|
-
const closeRightSidebar =
|
|
18047
|
+
const closeRightSidebar = useCallback39(() => {
|
|
17946
18048
|
if (isDrawerActive) {
|
|
17947
18049
|
rightSidebarRef.current?.collapse();
|
|
17948
18050
|
}
|
|
17949
18051
|
}, [isDrawerActive]);
|
|
17950
|
-
const leftChildrenProps =
|
|
18052
|
+
const leftChildrenProps = useMemo48(() => {
|
|
17951
18053
|
return {
|
|
17952
18054
|
activeTabValue: leftTabValue,
|
|
17953
18055
|
closeSidebar: closeLeftSidebar
|
|
17954
18056
|
};
|
|
17955
18057
|
}, [leftTabValue, closeLeftSidebar]);
|
|
17956
|
-
const rightChildrenProps =
|
|
18058
|
+
const rightChildrenProps = useMemo48(() => {
|
|
17957
18059
|
return {
|
|
17958
18060
|
activeTabValue: rightTabValue,
|
|
17959
18061
|
closeSidebar: closeRightSidebar
|
|
17960
18062
|
};
|
|
17961
18063
|
}, [rightTabValue, closeRightSidebar]);
|
|
17962
|
-
const leftSidebarProviderValue =
|
|
18064
|
+
const leftSidebarProviderValue = useMemo48(() => {
|
|
17963
18065
|
return {
|
|
17964
18066
|
closeSidebar: closeLeftSidebar
|
|
17965
18067
|
};
|
|
17966
18068
|
}, [closeLeftSidebar]);
|
|
17967
|
-
const rightSidebarProviderValue =
|
|
18069
|
+
const rightSidebarProviderValue = useMemo48(() => {
|
|
17968
18070
|
return {
|
|
17969
18071
|
closeSidebar: closeRightSidebar
|
|
17970
18072
|
};
|
|
17971
18073
|
}, [closeRightSidebar]);
|
|
17972
|
-
const leftPanel = left && leftVisible !== false ? /* @__PURE__ */
|
|
18074
|
+
const leftPanel = left && leftVisible !== false ? /* @__PURE__ */ React109.createElement(
|
|
17973
18075
|
PanelInner,
|
|
17974
18076
|
{
|
|
17975
18077
|
style: leftStyle,
|
|
17976
18078
|
className: cx("n-bg-sidebar-background n-flex-col", leftClassName)
|
|
17977
18079
|
},
|
|
17978
|
-
/* @__PURE__ */
|
|
18080
|
+
/* @__PURE__ */ React109.createElement(WorkspaceSideProvider, { value: leftSidebarProviderValue }, leftTabValue ? renderPanelChildren(left, leftChildrenProps) : null)
|
|
17979
18081
|
) : null;
|
|
17980
|
-
const rightPanel = right && rightVisible !== false ? /* @__PURE__ */
|
|
18082
|
+
const rightPanel = right && rightVisible !== false ? /* @__PURE__ */ React109.createElement(
|
|
17981
18083
|
PanelInner,
|
|
17982
18084
|
{
|
|
17983
18085
|
style: rightStyle,
|
|
17984
18086
|
className: cx("n-bg-sidebar-background n-flex-col", rightClassName)
|
|
17985
18087
|
},
|
|
17986
|
-
/* @__PURE__ */
|
|
18088
|
+
/* @__PURE__ */ React109.createElement(WorkspaceSideProvider, { value: rightSidebarProviderValue }, rightTabValue ? renderPanelChildren(right, rightChildrenProps) : null)
|
|
17987
18089
|
) : null;
|
|
17988
|
-
const centerPanel = /* @__PURE__ */
|
|
17989
|
-
const leftSidebarOptions =
|
|
18090
|
+
const centerPanel = /* @__PURE__ */ React109.createElement(PanelInner, { className: "n-bg-canvas-background" }, children);
|
|
18091
|
+
const leftSidebarOptions = useMemo48(
|
|
17990
18092
|
() => ({
|
|
17991
18093
|
minSize: leftSidebarMinPercentage,
|
|
17992
18094
|
maxSize: leftSidebarMaxPercentage,
|
|
@@ -18004,7 +18106,7 @@ var WorkspaceLayout = forwardRefGeneric(function WorkspaceLayout2({
|
|
|
18004
18106
|
leftShowTabs
|
|
18005
18107
|
]
|
|
18006
18108
|
);
|
|
18007
|
-
const rightSidebarOptions =
|
|
18109
|
+
const rightSidebarOptions = useMemo48(
|
|
18008
18110
|
() => ({
|
|
18009
18111
|
minSize: rightSidebarMinPercentage,
|
|
18010
18112
|
maxSize: rightSidebarMaxPercentage,
|
|
@@ -18024,7 +18126,7 @@ var WorkspaceLayout = forwardRefGeneric(function WorkspaceLayout2({
|
|
|
18024
18126
|
);
|
|
18025
18127
|
const LayoutComponent = sideType === "panel" ? PanelWorkspaceLayout : sideType === "drawer" ? DrawerWorkspaceLayout : parentSize.width > sideTypeBreakpoint ? PanelWorkspaceLayout : DrawerWorkspaceLayout;
|
|
18026
18128
|
const readyToRender = detectSize === "window" || containerSize && containerSize.width > 0;
|
|
18027
|
-
return /* @__PURE__ */
|
|
18129
|
+
return /* @__PURE__ */ React109.createElement(
|
|
18028
18130
|
"div",
|
|
18029
18131
|
{
|
|
18030
18132
|
ref: containerRef,
|
|
@@ -18037,7 +18139,7 @@ var WorkspaceLayout = forwardRefGeneric(function WorkspaceLayout2({
|
|
|
18037
18139
|
"data-theme": theme
|
|
18038
18140
|
},
|
|
18039
18141
|
toolbar,
|
|
18040
|
-
/* @__PURE__ */
|
|
18142
|
+
/* @__PURE__ */ React109.createElement("div", { className: "n-flex n-flex-row n-flex-1 n-relative" }, readyToRender && /* @__PURE__ */ React109.createElement(
|
|
18041
18143
|
LayoutComponent,
|
|
18042
18144
|
{
|
|
18043
18145
|
leftPanel,
|
|
@@ -18065,7 +18167,7 @@ var PanelInner = memo37(function PanelInner2({
|
|
|
18065
18167
|
style: style2,
|
|
18066
18168
|
className
|
|
18067
18169
|
}) {
|
|
18068
|
-
return /* @__PURE__ */
|
|
18170
|
+
return /* @__PURE__ */ React109.createElement(
|
|
18069
18171
|
"div",
|
|
18070
18172
|
{
|
|
18071
18173
|
style: style2,
|
|
@@ -18080,22 +18182,22 @@ function getFirstTabValue(items, defaultValue2) {
|
|
|
18080
18182
|
}
|
|
18081
18183
|
|
|
18082
18184
|
// src/contexts/ImageDataContext.tsx
|
|
18083
|
-
import * as
|
|
18084
|
-
var ImageDataContext =
|
|
18185
|
+
import * as React110 from "react";
|
|
18186
|
+
var ImageDataContext = React110.createContext(
|
|
18085
18187
|
void 0
|
|
18086
18188
|
);
|
|
18087
|
-
var ImageDataProvider =
|
|
18189
|
+
var ImageDataProvider = React110.memo(function ImageDataProvider2({
|
|
18088
18190
|
children,
|
|
18089
18191
|
getImageData
|
|
18090
18192
|
}) {
|
|
18091
|
-
const contextValue =
|
|
18193
|
+
const contextValue = React110.useMemo(
|
|
18092
18194
|
() => ({ getImageData: getImageData ?? (() => void 0) }),
|
|
18093
18195
|
[getImageData]
|
|
18094
18196
|
);
|
|
18095
|
-
return /* @__PURE__ */
|
|
18197
|
+
return /* @__PURE__ */ React110.createElement(ImageDataContext.Provider, { value: contextValue }, children);
|
|
18096
18198
|
});
|
|
18097
18199
|
function useImageData(ref) {
|
|
18098
|
-
const value =
|
|
18200
|
+
const value = React110.useContext(ImageDataContext);
|
|
18099
18201
|
if (!value) {
|
|
18100
18202
|
throw new Error("Missing ImageDataProvider");
|
|
18101
18203
|
}
|
|
@@ -18112,9 +18214,9 @@ function usePlatformModKey() {
|
|
|
18112
18214
|
}
|
|
18113
18215
|
|
|
18114
18216
|
// src/hooks/useTheme.ts
|
|
18115
|
-
import { useEffect as useEffect23, useState as
|
|
18217
|
+
import { useEffect as useEffect23, useState as useState36 } from "react";
|
|
18116
18218
|
function useTheme() {
|
|
18117
|
-
const [theme, setTheme] =
|
|
18219
|
+
const [theme, setTheme] = useState36("light");
|
|
18118
18220
|
const checkTheme = () => {
|
|
18119
18221
|
const currentTheme = document.body.getAttribute("data-theme");
|
|
18120
18222
|
switch (currentTheme) {
|
|
@@ -18249,11 +18351,11 @@ var SUPPORTED_CANVAS_UPLOAD_TYPES = [
|
|
|
18249
18351
|
|
|
18250
18352
|
// src/components/DimensionInput.tsx
|
|
18251
18353
|
import { round as round2 } from "@noya-app/noya-utils";
|
|
18252
|
-
import * as
|
|
18354
|
+
import * as React111 from "react";
|
|
18253
18355
|
function getNewValue(value, mode, delta) {
|
|
18254
18356
|
return delta === void 0 ? value : mode === "replace" ? delta : value + delta;
|
|
18255
18357
|
}
|
|
18256
|
-
var DimensionInput =
|
|
18358
|
+
var DimensionInput = React111.memo(function DimensionInput2({
|
|
18257
18359
|
id,
|
|
18258
18360
|
value,
|
|
18259
18361
|
onSetValue,
|
|
@@ -18263,15 +18365,15 @@ var DimensionInput = React110.memo(function DimensionInput2({
|
|
|
18263
18365
|
disabled,
|
|
18264
18366
|
trigger = "submit"
|
|
18265
18367
|
}) {
|
|
18266
|
-
const handleNudgeValue =
|
|
18368
|
+
const handleNudgeValue = React111.useCallback(
|
|
18267
18369
|
(value2) => onSetValue(value2, "adjust"),
|
|
18268
18370
|
[onSetValue]
|
|
18269
18371
|
);
|
|
18270
|
-
const handleSetValue =
|
|
18372
|
+
const handleSetValue = React111.useCallback(
|
|
18271
18373
|
(value2) => onSetValue(value2, "replace"),
|
|
18272
18374
|
[onSetValue]
|
|
18273
18375
|
);
|
|
18274
|
-
return /* @__PURE__ */
|
|
18376
|
+
return /* @__PURE__ */ React111.createElement(LabeledField, { label, labelType: "inset" }, /* @__PURE__ */ React111.createElement(InputField2.Root, { id, width: size }, /* @__PURE__ */ React111.createElement(
|
|
18275
18377
|
InputField2.NumberInput,
|
|
18276
18378
|
{
|
|
18277
18379
|
value: value === void 0 ? value : round2(value, 2),
|
|
@@ -18298,11 +18400,11 @@ __export(InspectorPrimitives_exports, {
|
|
|
18298
18400
|
Title: () => Title,
|
|
18299
18401
|
VerticalSeparator: () => VerticalSeparator
|
|
18300
18402
|
});
|
|
18301
|
-
import
|
|
18403
|
+
import React112, {
|
|
18302
18404
|
forwardRef as forwardRef29,
|
|
18303
18405
|
memo as memo40
|
|
18304
18406
|
} from "react";
|
|
18305
|
-
var Section2 = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */
|
|
18407
|
+
var Section2 = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */ React112.createElement(
|
|
18306
18408
|
"div",
|
|
18307
18409
|
{
|
|
18308
18410
|
ref,
|
|
@@ -18310,8 +18412,8 @@ var Section2 = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */ Re
|
|
|
18310
18412
|
...props
|
|
18311
18413
|
}
|
|
18312
18414
|
));
|
|
18313
|
-
var SectionHeader2 = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */
|
|
18314
|
-
var Title = forwardRef29(({ className, $textStyle, ...props }, ref) => /* @__PURE__ */
|
|
18415
|
+
var SectionHeader2 = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */ React112.createElement("div", { ref, className: cx(`n-flex n-items-center`, className), ...props }));
|
|
18416
|
+
var Title = forwardRef29(({ className, $textStyle, ...props }, ref) => /* @__PURE__ */ React112.createElement(
|
|
18315
18417
|
"div",
|
|
18316
18418
|
{
|
|
18317
18419
|
ref,
|
|
@@ -18322,7 +18424,7 @@ var Title = forwardRef29(({ className, $textStyle, ...props }, ref) => /* @__PUR
|
|
|
18322
18424
|
...props
|
|
18323
18425
|
}
|
|
18324
18426
|
));
|
|
18325
|
-
var Row = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */
|
|
18427
|
+
var Row = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */ React112.createElement(
|
|
18326
18428
|
"div",
|
|
18327
18429
|
{
|
|
18328
18430
|
ref,
|
|
@@ -18330,7 +18432,7 @@ var Row = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */ React11
|
|
|
18330
18432
|
...props
|
|
18331
18433
|
}
|
|
18332
18434
|
));
|
|
18333
|
-
var Column = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */
|
|
18435
|
+
var Column = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */ React112.createElement(
|
|
18334
18436
|
"div",
|
|
18335
18437
|
{
|
|
18336
18438
|
ref,
|
|
@@ -18338,7 +18440,7 @@ var Column = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */ Reac
|
|
|
18338
18440
|
...props
|
|
18339
18441
|
}
|
|
18340
18442
|
));
|
|
18341
|
-
var Checkbox3 = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */
|
|
18443
|
+
var Checkbox3 = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */ React112.createElement(
|
|
18342
18444
|
"input",
|
|
18343
18445
|
{
|
|
18344
18446
|
ref,
|
|
@@ -18347,7 +18449,7 @@ var Checkbox3 = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */ R
|
|
|
18347
18449
|
...props
|
|
18348
18450
|
}
|
|
18349
18451
|
));
|
|
18350
|
-
var Text3 = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */
|
|
18452
|
+
var Text3 = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */ React112.createElement(
|
|
18351
18453
|
"span",
|
|
18352
18454
|
{
|
|
18353
18455
|
ref,
|
|
@@ -18355,14 +18457,14 @@ var Text3 = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */ React
|
|
|
18355
18457
|
...props
|
|
18356
18458
|
}
|
|
18357
18459
|
));
|
|
18358
|
-
var VerticalSeparator = () => /* @__PURE__ */
|
|
18359
|
-
var HorizontalSeparator = () => /* @__PURE__ */
|
|
18460
|
+
var VerticalSeparator = () => /* @__PURE__ */ React112.createElement(Spacer.Vertical, { size: "inspector-v-separator" });
|
|
18461
|
+
var HorizontalSeparator = () => /* @__PURE__ */ React112.createElement(Spacer.Horizontal, { size: "inspector-h-separator" });
|
|
18360
18462
|
var RowLabel = forwardRef29(function RowLabel2({
|
|
18361
18463
|
className,
|
|
18362
18464
|
$textStyle,
|
|
18363
18465
|
...props
|
|
18364
18466
|
}, ref) {
|
|
18365
|
-
return /* @__PURE__ */
|
|
18467
|
+
return /* @__PURE__ */ React112.createElement(
|
|
18366
18468
|
"label",
|
|
18367
18469
|
{
|
|
18368
18470
|
ref,
|
|
@@ -18382,7 +18484,7 @@ var LabeledRow = memo40(function LabeledRow2({
|
|
|
18382
18484
|
right,
|
|
18383
18485
|
className
|
|
18384
18486
|
}) {
|
|
18385
|
-
return /* @__PURE__ */
|
|
18487
|
+
return /* @__PURE__ */ React112.createElement(Row, { id, className }, /* @__PURE__ */ React112.createElement(Column, null, /* @__PURE__ */ React112.createElement(RowLabel, { $textStyle: labelTextStyle }, label, right && /* @__PURE__ */ React112.createElement(Spacer.Horizontal, null), right), /* @__PURE__ */ React112.createElement(Row, null, children)));
|
|
18386
18488
|
});
|
|
18387
18489
|
export {
|
|
18388
18490
|
AIAssistantInput,
|
|
@@ -18521,6 +18623,7 @@ export {
|
|
|
18521
18623
|
Tooltip,
|
|
18522
18624
|
TreeView,
|
|
18523
18625
|
UserAvatar,
|
|
18626
|
+
UserPicker,
|
|
18524
18627
|
UserPointer,
|
|
18525
18628
|
WorkspaceLayout,
|
|
18526
18629
|
WorkspaceSideProvider,
|
|
@@ -18554,6 +18657,7 @@ export {
|
|
|
18554
18657
|
getNextIndex,
|
|
18555
18658
|
getPipelineResultLink,
|
|
18556
18659
|
getThumbnailColors,
|
|
18660
|
+
getUserDisplayName,
|
|
18557
18661
|
isMenuItemSectionHeader,
|
|
18558
18662
|
isNonSelectableMenuItem,
|
|
18559
18663
|
isPopoverMenuItem,
|