@myunisoft/design-system 1.2.9-rev157.2 → 1.2.9-rev396
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.d.ts +0 -1
- package/dist/index.js +2 -2
- package/package.json +6 -10
- package/dist/components/DocumentComposer/LoadingSkeleton.d.ts +0 -2
- package/dist/components/DocumentComposer/NoSectionsPlaceholder/index.d.ts +0 -4
- package/dist/components/DocumentComposer/Treeview/CustomTreeItem.d.ts +0 -9
- package/dist/components/DocumentComposer/Treeview/hooks/useTreeItemMenu.d.ts +0 -14
- package/dist/components/DocumentComposer/Treeview/index.d.ts +0 -3
- package/dist/components/DocumentComposer/Treeview/slots/IconContainerSlot.d.ts +0 -14
- package/dist/components/DocumentComposer/Treeview/slots/LabelInputSlot.d.ts +0 -12
- package/dist/components/DocumentComposer/Treeview/slots/LabelSlot.d.ts +0 -23
- package/dist/components/DocumentComposer/Treeview/slots/index.d.ts +0 -3
- package/dist/components/DocumentComposer/Treeview/types.d.ts +0 -50
- package/dist/components/DocumentComposer/hooks/useSectionsMap.d.ts +0 -5
- package/dist/components/DocumentComposer/hooks/useTemporarySection.d.ts +0 -25
- package/dist/components/DocumentComposer/index.d.ts +0 -6
- package/dist/components/DocumentComposer/types.d.ts +0 -41
- package/dist/components/DocumentComposer/utils/getSectionMenuItems.d.ts +0 -14
- package/dist/components/DocumentComposer/utils/sectionHelpers.d.ts +0 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@myunisoft/design-system",
|
|
3
|
-
"version": "1.2.9-
|
|
3
|
+
"version": "1.2.9-rev396",
|
|
4
4
|
"description": "Design System of MyUnisoft",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"source": "src/index.ts",
|
|
@@ -35,10 +35,6 @@
|
|
|
35
35
|
"@babel/runtime": "7.20.6",
|
|
36
36
|
"@emotion/react": "11.14.0",
|
|
37
37
|
"@emotion/styled": "11.14.1",
|
|
38
|
-
"@mui/x-license": "8.17.0",
|
|
39
|
-
"@mui/x-tree-view-pro": "8.17.0",
|
|
40
|
-
"@myunisoft/mui-symbols-material-w300-esm": "0.7.3",
|
|
41
|
-
"@myunisoft/mui-symbols-material-w400-esm": "0.7.3",
|
|
42
38
|
"@mui/material": "7.3.6",
|
|
43
39
|
"@mui/utils": "7.3.6",
|
|
44
40
|
"@mui/x-data-grid-pro": "7.29.9",
|
|
@@ -55,9 +51,9 @@
|
|
|
55
51
|
"numeral": "2.0.6",
|
|
56
52
|
"pretty-bytes": "6.0.0",
|
|
57
53
|
"prop-types": "15.8.1",
|
|
58
|
-
"react": "19.
|
|
54
|
+
"react": "19.1.1",
|
|
59
55
|
"react-color": "2.19.3",
|
|
60
|
-
"react-dom": "19.
|
|
56
|
+
"react-dom": "19.1.1",
|
|
61
57
|
"react-draft-wysiwyg": "1.15.0",
|
|
62
58
|
"react-draggable": "4.4.6",
|
|
63
59
|
"react-dropzone": "14.2.3",
|
|
@@ -115,7 +111,7 @@
|
|
|
115
111
|
},
|
|
116
112
|
"peerDependencies": {
|
|
117
113
|
"@mui/material": "7.3.6",
|
|
118
|
-
"react": "19.
|
|
119
|
-
"react-dom": "19.
|
|
114
|
+
"react": "19.1.1",
|
|
115
|
+
"react-dom": "19.1.1"
|
|
120
116
|
}
|
|
121
|
-
}
|
|
117
|
+
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { RichTreeViewProApiRef, TreeItemProps } from '@mui/x-tree-view-pro';
|
|
2
|
-
import type { TreeviewProps } from './types';
|
|
3
|
-
type TreeItemCallbacks<T extends Record<string, unknown>> = Pick<TreeviewProps<T>, 'isSectionItem' | 'isVisibleItem' | 'getIconItem' | 'hasItemMenu' | 'getMenuItems' | 'isItemReorderable' | 'onItemVisibilityChange' | 'isTemporaryItem' | 'onTemporarySectionValidation' | 'onTemporarySectionCancel' | 'onItemLabelChange' | 'hiddenSectionTooltip' | 'visibleIconTooltip' | 'hiddenIconTooltip'> & {
|
|
4
|
-
apiRef: RichTreeViewProApiRef;
|
|
5
|
-
onEditingChange?: (itemId: string | null) => void;
|
|
6
|
-
};
|
|
7
|
-
type CustomTreeItemProps<T extends Record<string, unknown>> = TreeItemProps & TreeItemCallbacks<T>;
|
|
8
|
-
export declare const CustomTreeItem: <T extends Record<string, unknown>>(props: CustomTreeItemProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export declare const useTreeItemMenu: () => {
|
|
2
|
-
containerRef: import("react").RefObject<HTMLDivElement | null>;
|
|
3
|
-
menuAnchorEl: HTMLElement | null;
|
|
4
|
-
menuPosition: {
|
|
5
|
-
top: number;
|
|
6
|
-
left: number;
|
|
7
|
-
} | null;
|
|
8
|
-
handleMenuClick: (event: React.MouseEvent<HTMLElement>) => void;
|
|
9
|
-
handleMenuClose: () => void;
|
|
10
|
-
scheduleMenuAction: (action: () => void) => void;
|
|
11
|
-
onMenuExited: () => void;
|
|
12
|
-
createMouseMoveHandler: (isHovered: boolean, onHoverChange?: (isHovered: boolean) => void) => (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
13
|
-
createMouseLeaveHandler: (onHoverChange?: (isHovered: boolean) => void) => () => void;
|
|
14
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { SxProps, Theme } from '@mui/material';
|
|
2
|
-
type IconContainerSlotProps = {
|
|
3
|
-
ownerState?: unknown;
|
|
4
|
-
children?: React.ReactNode;
|
|
5
|
-
sx?: SxProps<Theme>;
|
|
6
|
-
isDraggable?: boolean;
|
|
7
|
-
isVisible?: boolean;
|
|
8
|
-
[key: string]: unknown;
|
|
9
|
-
};
|
|
10
|
-
export declare const IconContainerSlot: {
|
|
11
|
-
(props: IconContainerSlotProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
displayName: string;
|
|
13
|
-
};
|
|
14
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { InputHTMLAttributes } from 'react';
|
|
2
|
-
import type { RichTreeViewProApiRef } from '@mui/x-tree-view-pro';
|
|
3
|
-
export declare const LabelInputSlot: import("react").ForwardRefExoticComponent<InputHTMLAttributes<HTMLInputElement> & {
|
|
4
|
-
ownerState?: unknown;
|
|
5
|
-
itemId?: string;
|
|
6
|
-
isTemporary?: boolean;
|
|
7
|
-
onTemporarySectionValidation?: (label: string) => void;
|
|
8
|
-
onTemporarySectionCancel?: () => void;
|
|
9
|
-
onItemLabelChange?: (itemId: string, newLabel: string) => void;
|
|
10
|
-
apiRef?: RichTreeViewProApiRef;
|
|
11
|
-
onEditingEnd?: () => void;
|
|
12
|
-
} & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { SxProps, Theme } from '@mui/material';
|
|
2
|
-
type LabelSlotProps = {
|
|
3
|
-
ownerState?: unknown;
|
|
4
|
-
editable?: unknown;
|
|
5
|
-
children?: React.ReactNode;
|
|
6
|
-
sx?: SxProps<Theme>;
|
|
7
|
-
customIcon?: React.ReactNode;
|
|
8
|
-
hasMenu?: boolean;
|
|
9
|
-
isVisible?: boolean;
|
|
10
|
-
itemId: string;
|
|
11
|
-
menuAnchorEl?: HTMLElement | null;
|
|
12
|
-
onMenuClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
13
|
-
onItemVisibilityChange?: (itemId: string, visible: boolean) => void;
|
|
14
|
-
hiddenSectionTooltip?: string;
|
|
15
|
-
visibleIconTooltip?: string;
|
|
16
|
-
hiddenIconTooltip?: string;
|
|
17
|
-
[key: string]: unknown;
|
|
18
|
-
};
|
|
19
|
-
export declare const LabelSlot: {
|
|
20
|
-
(props: LabelSlotProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
-
displayName: string;
|
|
22
|
-
};
|
|
23
|
-
export {};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import type { RichTreeViewProApiRef } from '@mui/x-tree-view-pro';
|
|
2
|
-
import type { TemporarySection } from '../hooks/useTemporarySection';
|
|
3
|
-
export type ItemPositionParams = {
|
|
4
|
-
itemId: string;
|
|
5
|
-
oldPosition: {
|
|
6
|
-
parentId: string | null;
|
|
7
|
-
index: number;
|
|
8
|
-
};
|
|
9
|
-
newPosition: {
|
|
10
|
-
parentId: string | null;
|
|
11
|
-
index: number;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
export type ScheduleMenuAction = (action: () => void) => void;
|
|
15
|
-
type CustomTreeviewItemProps<T> = {
|
|
16
|
-
hasItemMenu: (item: T) => boolean;
|
|
17
|
-
getMenuItems: (item: T, scheduleMenuAction: ScheduleMenuAction) => React.ReactNode[];
|
|
18
|
-
isSectionItem: (item: T) => boolean;
|
|
19
|
-
getIconItem: (item: T) => React.ReactNode;
|
|
20
|
-
isItemEditable: (item: T) => boolean;
|
|
21
|
-
isVisibleItem: (item: T) => boolean;
|
|
22
|
-
onItemVisibilityChange: (itemId: string, visible: boolean) => void;
|
|
23
|
-
hiddenSectionTooltip?: string;
|
|
24
|
-
visibleIconTooltip?: string;
|
|
25
|
-
hiddenIconTooltip?: string;
|
|
26
|
-
};
|
|
27
|
-
export type TreeviewProps<T> = {
|
|
28
|
-
apiRef: RichTreeViewProApiRef;
|
|
29
|
-
items: readonly T[];
|
|
30
|
-
getItemId: (item: T) => string;
|
|
31
|
-
getItemLabel: (item: T) => string;
|
|
32
|
-
getItemChildren: (item: T) => T[] | undefined;
|
|
33
|
-
isItemReorderable: (itemId: string) => boolean;
|
|
34
|
-
canMoveItemToNewPosition: (params: ItemPositionParams) => boolean;
|
|
35
|
-
onItemPositionChange: (params: ItemPositionParams) => void;
|
|
36
|
-
onItemLabelChange: (itemId: string, newLabel: string) => void;
|
|
37
|
-
temporaryItem: TemporarySection | null;
|
|
38
|
-
isTemporaryItem: (itemId: string) => boolean;
|
|
39
|
-
onTemporarySectionValidation: (label: string) => void;
|
|
40
|
-
onTemporarySectionCancel: () => void;
|
|
41
|
-
defaultExpandedItems: string[];
|
|
42
|
-
checkboxSelection?: boolean;
|
|
43
|
-
multiSelect?: boolean;
|
|
44
|
-
} & CustomTreeviewItemProps<T>;
|
|
45
|
-
export type TreeviewItemProps<T> = {
|
|
46
|
-
itemId: string;
|
|
47
|
-
label?: React.ReactNode;
|
|
48
|
-
children?: React.ReactNode;
|
|
49
|
-
} & CustomTreeviewItemProps<T>;
|
|
50
|
-
export {};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { RichTreeViewProApiRef } from '@mui/x-tree-view-pro';
|
|
2
|
-
import type { DocumentSection } from '../types';
|
|
3
|
-
export type TemporarySection = Pick<DocumentSection, 'id' | 'parentId'> & {
|
|
4
|
-
parentVisible: boolean;
|
|
5
|
-
};
|
|
6
|
-
type UseTemporarySectionParams = {
|
|
7
|
-
apiRef: RichTreeViewProApiRef;
|
|
8
|
-
getSectionById: (sectionId: string) => DocumentSection | null;
|
|
9
|
-
onSubsectionCreate?: (parentId: string | null, title: string) => string | Promise<string>;
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* Flow:
|
|
13
|
-
* 1. User triggers `create(parentId)` from context menu
|
|
14
|
-
* 2. A temporary section appears in the tree in edit mode
|
|
15
|
-
* 3. User types a title and presses Enter → `validate()` is called
|
|
16
|
-
* 4. User presses Escape or leaves empty → `cancel()` is called
|
|
17
|
-
*/
|
|
18
|
-
export declare const useTemporarySection: ({ apiRef, getSectionById, onSubsectionCreate }: UseTemporarySectionParams) => {
|
|
19
|
-
temporarySection: TemporarySection | null;
|
|
20
|
-
create: (parentId: string) => void;
|
|
21
|
-
validate: (title: string) => Promise<void>;
|
|
22
|
-
cancel: () => void;
|
|
23
|
-
isTemporary: (sectionId: string) => boolean;
|
|
24
|
-
};
|
|
25
|
-
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { DocumentComposerCallbacks, DocumentComposerCustomProps, DocumentSection } from './types';
|
|
2
|
-
type DocumentComposerProps = {
|
|
3
|
-
sections?: DocumentSection[];
|
|
4
|
-
} & DocumentComposerCallbacks & DocumentComposerCustomProps;
|
|
5
|
-
declare const DocumentComposer: ({ sections, onSectionOrderChange, onSectionTitleChange, onSectionDelete, onSectionVisibilityChange, onSubsectionCreate, noSectionsPlaceholder, isLoading, getSectionRenamePermission, getSectionDeletePermission, getSectionReorderPermission, getSubsectionCreatePermission, getSectionVisibilityPermission, hiddenSectionTooltip, visibleIconTooltip, hiddenIconTooltip }: DocumentComposerProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
export default DocumentComposer;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import type { ItemPositionParams } from './Treeview/types';
|
|
2
|
-
export type DocumentSection = {
|
|
3
|
-
id: string;
|
|
4
|
-
title: string;
|
|
5
|
-
visible: boolean;
|
|
6
|
-
parentId: string | null;
|
|
7
|
-
sections?: DocumentSection[] | null;
|
|
8
|
-
};
|
|
9
|
-
export type ItemDisplayOrder = {
|
|
10
|
-
id: string;
|
|
11
|
-
displayOrder: number;
|
|
12
|
-
};
|
|
13
|
-
export type DocumentComposerCustomProps = {
|
|
14
|
-
/** Content displayed when there are no sections */
|
|
15
|
-
noSectionsPlaceholder?: string | React.ReactNode;
|
|
16
|
-
/** Show a loading state that prevents rendering the sections */
|
|
17
|
-
isLoading?: boolean;
|
|
18
|
-
/** Returns whether section title can be edited (double-click + "Renommer" menu). Defaults to `() => true`. */
|
|
19
|
-
getSectionRenamePermission?: (section: DocumentSection) => boolean;
|
|
20
|
-
/** Returns whether section can be deleted ("Supprimer" menu). Defaults to `() => true`. */
|
|
21
|
-
getSectionDeletePermission?: (section: DocumentSection) => boolean;
|
|
22
|
-
/** Returns whether section can be reordered via drag & drop. Defaults to `() => true`. */
|
|
23
|
-
getSectionReorderPermission?: (section: DocumentSection) => boolean;
|
|
24
|
-
/** Returns whether a subsection can be created under this section. Defaults to `() => true`. */
|
|
25
|
-
getSubsectionCreatePermission?: (section: DocumentSection) => boolean;
|
|
26
|
-
/** Returns whether section visibility can be toggled. Defaults to `() => true`. */
|
|
27
|
-
getSectionVisibilityPermission?: (section: DocumentSection) => boolean;
|
|
28
|
-
/** Tooltip text displayed when hovering a hidden section label (visible: false) */
|
|
29
|
-
hiddenSectionTooltip?: string;
|
|
30
|
-
/** Tooltip text displayed when hovering the visibility icon of a visible section */
|
|
31
|
-
visibleIconTooltip?: string;
|
|
32
|
-
/** Tooltip text displayed when hovering the visibility icon of a hidden section */
|
|
33
|
-
hiddenIconTooltip?: string;
|
|
34
|
-
};
|
|
35
|
-
export type DocumentComposerCallbacks = {
|
|
36
|
-
onSectionOrderChange?: (params: ItemPositionParams) => void;
|
|
37
|
-
onSectionTitleChange?: (sectionId: string, newTitle: string) => void;
|
|
38
|
-
onSectionDelete?: (sectionId: string) => void;
|
|
39
|
-
onSectionVisibilityChange?: (sectionId: string, visible: boolean) => void;
|
|
40
|
-
onSubsectionCreate?: (parentId: string | null, title: string) => string | Promise<string>;
|
|
41
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { ScheduleMenuAction } from '../Treeview/types';
|
|
2
|
-
import type { DocumentSection } from '../types';
|
|
3
|
-
type MenuItemCallbacks = {
|
|
4
|
-
onRename: (sectionId: string) => void;
|
|
5
|
-
onDelete: (sectionId: string) => void;
|
|
6
|
-
onCreateSubsection: (parentId: string) => void;
|
|
7
|
-
};
|
|
8
|
-
type SectionMenuCapabilities = {
|
|
9
|
-
canRename: boolean;
|
|
10
|
-
canDelete: boolean;
|
|
11
|
-
canCreateSubsection: boolean;
|
|
12
|
-
};
|
|
13
|
-
export declare const getSectionMenuItems: (section: DocumentSection, callbacks: MenuItemCallbacks, scheduleMenuAction: ScheduleMenuAction, capabilities: SectionMenuCapabilities) => React.ReactNode[];
|
|
14
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { DocumentSection } from '../types';
|
|
2
|
-
export declare const getAllExpandableSectionIds: (sections: DocumentSection[]) => string[];
|
|
3
|
-
export declare const getAllSectionsFlat: (sections: DocumentSection[]) => DocumentSection[];
|
|
4
|
-
export declare const isRootSection: (section: DocumentSection) => boolean;
|
|
5
|
-
export declare const hasSectionMenu: (_section: DocumentSection) => boolean;
|
|
6
|
-
export declare const isSectionVisible: (section: DocumentSection) => boolean;
|
|
7
|
-
export declare const getSectionChildren: (section: DocumentSection) => DocumentSection[] | undefined;
|
|
8
|
-
export declare const getSectionId: (section: DocumentSection) => string;
|
|
9
|
-
export declare const getSectionTitle: (section: DocumentSection) => string;
|
|
10
|
-
export declare const getSectionIcon: (section: DocumentSection) => import("react/jsx-runtime").JSX.Element | null;
|