@noya-app/noya-designsystem 0.1.6 → 0.1.7
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 +10 -0
- package/dist/index.d.mts +7 -4
- package/dist/index.d.ts +7 -4
- package/dist/index.js +16 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
- package/src/components/DraggableMenuButton.tsx +21 -15
- package/src/components/InspectorPrimitives.tsx +1 -0
- package/src/components/ListView.tsx +10 -5
- package/src/components/Select.tsx +1 -1
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
|
-
[32mESM[39m [1mdist/index.mjs [22m[32m183.12 KB[39m
|
|
9
|
-
[32mESM[39m [1mdist/index.mjs.map [22m[32m404.00 KB[39m
|
|
10
|
-
[32mESM[39m ⚡️ Build success in 111ms
|
|
11
|
-
[32mCJS[39m [1mdist/index.js [22m[32m199.40 KB[39m
|
|
12
|
-
[32mCJS[39m [1mdist/index.js.map [22m[32m404.28 KB[39m
|
|
13
|
-
[32mCJS[39m ⚡️ Build success in 112ms
|
|
14
8
|
[34mDTS[39m Build start
|
|
15
|
-
[
|
|
16
|
-
[
|
|
17
|
-
[
|
|
9
|
+
[32mCJS[39m [1mdist/index.js [22m[32m199.65 KB[39m
|
|
10
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m404.79 KB[39m
|
|
11
|
+
[32mCJS[39m ⚡️ Build success in 185ms
|
|
12
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m183.34 KB[39m
|
|
13
|
+
[32mESM[39m [1mdist/index.mjs.map [22m[32m404.50 KB[39m
|
|
14
|
+
[32mESM[39m ⚡️ Build success in 190ms
|
|
15
|
+
[32mDTS[39m ⚡️ Build success in 6688ms
|
|
16
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m54.34 KB[39m
|
|
17
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m54.34 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @noya-app/noya-designsystem
|
|
2
2
|
|
|
3
|
+
## 0.1.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 6a13e8b: Improve multiplayer and design system
|
|
8
|
+
- Updated dependencies [6a13e8b]
|
|
9
|
+
- @noya-app/noya-colorpicker@0.1.5
|
|
10
|
+
- @noya-app/noya-geometry@0.1.2
|
|
11
|
+
- @noya-app/noya-icons@0.1.2
|
|
12
|
+
|
|
3
13
|
## 0.1.6
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -283,8 +283,8 @@ declare const DividerVertical: (props: DividerProps) => React__default.ReactElem
|
|
|
283
283
|
* A button that opens a menu when clicked, but also allows dragging the
|
|
284
284
|
*/
|
|
285
285
|
declare const DraggableMenuButton: <T extends string>(props: {
|
|
286
|
-
items
|
|
287
|
-
onSelect
|
|
286
|
+
items?: MenuItem<T>[] | undefined;
|
|
287
|
+
onSelect?: ((value: T) => void) | undefined;
|
|
288
288
|
isVisible?: boolean | undefined;
|
|
289
289
|
}) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
|
|
290
290
|
|
|
@@ -621,6 +621,7 @@ interface ListViewRowProps<MenuItemType extends string = string> {
|
|
|
621
621
|
onContextMenu?: () => void;
|
|
622
622
|
onMenuOpenChange?: (isOpen: boolean) => void;
|
|
623
623
|
onKeyDown?: (event: React__default.KeyboardEvent) => void;
|
|
624
|
+
style?: CSSProperties;
|
|
624
625
|
}
|
|
625
626
|
interface IVirtualizedList {
|
|
626
627
|
scrollToIndex(index: number): void;
|
|
@@ -636,7 +637,9 @@ type RenderProps<T> = {
|
|
|
636
637
|
renderItem: (item: T, index: number, info: ListViewItemInfo) => ReactNode;
|
|
637
638
|
keyExtractor: (item: T, index: number) => string;
|
|
638
639
|
/**
|
|
639
|
-
* Each item must have an `id` in order to be sortable
|
|
640
|
+
* Each item must have an `id` in order to be sortable.
|
|
641
|
+
*
|
|
642
|
+
* Additionally, the key extracted with `keyExtractor` must match the ListItem.Row `id`.
|
|
640
643
|
*/
|
|
641
644
|
sortable?: boolean;
|
|
642
645
|
virtualized?: Size;
|
|
@@ -795,7 +798,7 @@ declare const SelectOption: <T extends string>(props: SelectOptionProps<T>) => R
|
|
|
795
798
|
type ChildrenProps<T> = {
|
|
796
799
|
children: ReactNode;
|
|
797
800
|
} | {
|
|
798
|
-
options: T[];
|
|
801
|
+
options: readonly T[];
|
|
799
802
|
getTitle?: (option: T, index: number) => string;
|
|
800
803
|
onChange: (value: T) => void;
|
|
801
804
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -283,8 +283,8 @@ declare const DividerVertical: (props: DividerProps) => React__default.ReactElem
|
|
|
283
283
|
* A button that opens a menu when clicked, but also allows dragging the
|
|
284
284
|
*/
|
|
285
285
|
declare const DraggableMenuButton: <T extends string>(props: {
|
|
286
|
-
items
|
|
287
|
-
onSelect
|
|
286
|
+
items?: MenuItem<T>[] | undefined;
|
|
287
|
+
onSelect?: ((value: T) => void) | undefined;
|
|
288
288
|
isVisible?: boolean | undefined;
|
|
289
289
|
}) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
|
|
290
290
|
|
|
@@ -621,6 +621,7 @@ interface ListViewRowProps<MenuItemType extends string = string> {
|
|
|
621
621
|
onContextMenu?: () => void;
|
|
622
622
|
onMenuOpenChange?: (isOpen: boolean) => void;
|
|
623
623
|
onKeyDown?: (event: React__default.KeyboardEvent) => void;
|
|
624
|
+
style?: CSSProperties;
|
|
624
625
|
}
|
|
625
626
|
interface IVirtualizedList {
|
|
626
627
|
scrollToIndex(index: number): void;
|
|
@@ -636,7 +637,9 @@ type RenderProps<T> = {
|
|
|
636
637
|
renderItem: (item: T, index: number, info: ListViewItemInfo) => ReactNode;
|
|
637
638
|
keyExtractor: (item: T, index: number) => string;
|
|
638
639
|
/**
|
|
639
|
-
* Each item must have an `id` in order to be sortable
|
|
640
|
+
* Each item must have an `id` in order to be sortable.
|
|
641
|
+
*
|
|
642
|
+
* Additionally, the key extracted with `keyExtractor` must match the ListItem.Row `id`.
|
|
640
643
|
*/
|
|
641
644
|
sortable?: boolean;
|
|
642
645
|
virtualized?: Size;
|
|
@@ -795,7 +798,7 @@ declare const SelectOption: <T extends string>(props: SelectOptionProps<T>) => R
|
|
|
795
798
|
type ChildrenProps<T> = {
|
|
796
799
|
children: ReactNode;
|
|
797
800
|
} | {
|
|
798
|
-
options: T[];
|
|
801
|
+
options: readonly T[];
|
|
799
802
|
getTitle?: (option: T, index: number) => string;
|
|
800
803
|
onChange: (value: T) => void;
|
|
801
804
|
};
|
package/dist/index.js
CHANGED
|
@@ -2435,7 +2435,7 @@ var DraggableMenuButton = (0, import_react36.memo)(function DraggableMenuButton2
|
|
|
2435
2435
|
event.preventDefault();
|
|
2436
2436
|
}
|
|
2437
2437
|
},
|
|
2438
|
-
/* @__PURE__ */ import_react36.default.createElement(
|
|
2438
|
+
items && onSelect ? /* @__PURE__ */ import_react36.default.createElement(
|
|
2439
2439
|
DropdownMenu,
|
|
2440
2440
|
{
|
|
2441
2441
|
open,
|
|
@@ -2450,6 +2450,11 @@ var DraggableMenuButton = (0, import_react36.memo)(function DraggableMenuButton2
|
|
|
2450
2450
|
color: isVisible || open ? color : "transparent"
|
|
2451
2451
|
}
|
|
2452
2452
|
))
|
|
2453
|
+
) : /* @__PURE__ */ import_react36.default.createElement(
|
|
2454
|
+
import_noya_icons5.DragHandleDots2Icon,
|
|
2455
|
+
{
|
|
2456
|
+
color: isVisible || open ? color : "transparent"
|
|
2457
|
+
}
|
|
2453
2458
|
)
|
|
2454
2459
|
);
|
|
2455
2460
|
});
|
|
@@ -3900,7 +3905,8 @@ var ListViewRow = (0, import_react45.forwardRef)(function ListViewRow2({
|
|
|
3900
3905
|
onContextMenu,
|
|
3901
3906
|
onSelectMenuItem,
|
|
3902
3907
|
onMenuOpenChange,
|
|
3903
|
-
onKeyDown
|
|
3908
|
+
onKeyDown,
|
|
3909
|
+
style: style3
|
|
3904
3910
|
}, forwardedRef) {
|
|
3905
3911
|
depth = Math.max(0, depth);
|
|
3906
3912
|
const {
|
|
@@ -3934,13 +3940,14 @@ var ListViewRow = (0, import_react45.forwardRef)(function ListViewRow2({
|
|
|
3934
3940
|
},
|
|
3935
3941
|
[onDoubleClick]
|
|
3936
3942
|
);
|
|
3937
|
-
const
|
|
3943
|
+
const mergedStyle = (0, import_react45.useMemo)(() => {
|
|
3938
3944
|
return isDragging ? {
|
|
3939
3945
|
// TODO: Where do these offsets actually come from?
|
|
3940
3946
|
transform: `translate3d(-36px, -6px, 0)`,
|
|
3941
|
-
width: `calc(100% + 48px)
|
|
3942
|
-
|
|
3943
|
-
|
|
3947
|
+
width: `calc(100% + 48px)`,
|
|
3948
|
+
...style3
|
|
3949
|
+
} : style3;
|
|
3950
|
+
}, [isDragging, style3]);
|
|
3944
3951
|
const renderContent = ({
|
|
3945
3952
|
relativeDropPosition,
|
|
3946
3953
|
...renderProps
|
|
@@ -3968,7 +3975,7 @@ var ListViewRow = (0, import_react45.forwardRef)(function ListViewRow2({
|
|
|
3968
3975
|
"aria-selected": selected,
|
|
3969
3976
|
divider: !isDragging && divider,
|
|
3970
3977
|
onKeyDown,
|
|
3971
|
-
style:
|
|
3978
|
+
style: mergedStyle,
|
|
3972
3979
|
...renderProps,
|
|
3973
3980
|
...mergeEventHandlers(
|
|
3974
3981
|
{ onPointerDown: renderProps.onPointerDown },
|
|
@@ -5684,8 +5691,9 @@ var RowLabel = import_styled_components35.default.span(({ theme, textStyle }) =>
|
|
|
5684
5691
|
color: theme.colors.textSubtle,
|
|
5685
5692
|
fontWeight: "bold"
|
|
5686
5693
|
},
|
|
5687
|
-
lineHeight: "19px"
|
|
5694
|
+
lineHeight: "19px",
|
|
5688
5695
|
// Button height
|
|
5696
|
+
alignItems: "center"
|
|
5689
5697
|
}));
|
|
5690
5698
|
var LabeledRow = (0, import_react56.memo)(function LabeledRow2({
|
|
5691
5699
|
id,
|