@vuu-ui/vuu-layout 0.6.5 → 0.6.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/package.json +3 -3
- package/types/common-types.d.ts +2 -2
- package/types/drag-drop/DragState.d.ts +2 -2
- package/types/drag-drop/Draggable.d.ts +4 -4
- package/types/drag-drop/DropTarget.d.ts +1 -1
- package/types/drag-drop/DropTargetRenderer.d.ts +2 -2
- package/types/drag-drop/dragDropTypes.d.ts +2 -2
- package/types/flexbox/Splitter.d.ts +3 -3
- package/types/flexbox/flexboxTypes.d.ts +6 -6
- package/types/layout-provider/LayoutProvider.d.ts +1 -1
- package/types/layout-provider/LayoutProviderContext.d.ts +1 -1
- package/types/layout-reducer/flexUtils.d.ts +4 -4
- package/types/layout-reducer/insert-layout-element.d.ts +1 -1
- package/types/layout-reducer/layoutTypes.d.ts +19 -19
- package/types/layout-view/ViewContext.d.ts +1 -1
- package/types/layout-view/useViewActionDispatcher.d.ts +1 -1
- package/types/layout-view/viewTypes.d.ts +1 -1
- package/types/registry/ComponentRegistry.d.ts +1 -1
- package/types/responsive/breakpoints.d.ts +1 -1
- package/types/responsive/useResizeObserver.d.ts +2 -2
- package/types/responsive/utils.d.ts +1 -1
- package/types/utils/pathUtils.d.ts +1 -1
- package/types/utils/styleUtils.d.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vuu-ui/vuu-layout",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.7",
|
|
4
4
|
"description": "VUU Layout Components",
|
|
5
5
|
"author": "heswell",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
"@salt-ds/core": "1.0.0",
|
|
9
9
|
"@salt-ds/icons": "1.0.0",
|
|
10
10
|
"@heswell/salt-lab": "1.0.0-alpha.0-vuu.1",
|
|
11
|
-
"@vuu-ui/vuu-popups": "0.6.
|
|
12
|
-
"@vuu-ui/vuu-utils": "0.6.
|
|
11
|
+
"@vuu-ui/vuu-popups": "0.6.7",
|
|
12
|
+
"@vuu-ui/vuu-utils": "0.6.7",
|
|
13
13
|
"classnames": "^2.2.6",
|
|
14
14
|
"react": "^17.0.2",
|
|
15
15
|
"react-dom": "^17.0.2"
|
package/types/common-types.d.ts
CHANGED
|
@@ -4,5 +4,5 @@ export interface rect {
|
|
|
4
4
|
right: number;
|
|
5
5
|
top: number;
|
|
6
6
|
}
|
|
7
|
-
export
|
|
8
|
-
export
|
|
7
|
+
export type rectTuple = [number, number, number, number];
|
|
8
|
+
export type dimension = 'width' | 'height';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DragDropRect } from './dragDropTypes';
|
|
2
|
-
export
|
|
2
|
+
export type IntrinsicSizes = {
|
|
3
3
|
height?: number;
|
|
4
4
|
width?: number;
|
|
5
5
|
};
|
|
@@ -7,7 +7,7 @@ interface ZoneRange {
|
|
|
7
7
|
hi: number;
|
|
8
8
|
lo: number;
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
type DragConstraint = {
|
|
11
11
|
zone: {
|
|
12
12
|
x: ZoneRange;
|
|
13
13
|
y: ZoneRange;
|
|
@@ -2,10 +2,10 @@ import { ReactElement } from "react";
|
|
|
2
2
|
import { rect } from "../common-types";
|
|
3
3
|
import { IntrinsicSizes } from "./DragState";
|
|
4
4
|
import { DropTarget } from "./DropTarget";
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
5
|
+
export type DragStartCallback = (e: MouseEvent, x: number, y: number) => void;
|
|
6
|
+
export type DragMoveCallback = (x: number | undefined, y: number | undefined) => void;
|
|
7
|
+
export type DragEndCallback = (droppedTarget: Partial<DropTarget>) => void;
|
|
8
|
+
export type DragInstructions = {
|
|
9
9
|
DoNotRemove?: boolean;
|
|
10
10
|
DoNotTransform?: boolean;
|
|
11
11
|
dragThreshold?: number;
|
|
@@ -2,8 +2,8 @@ import { DragDropRect } from "./dragDropTypes";
|
|
|
2
2
|
import { DragState } from "./DragState";
|
|
3
3
|
import { DropTarget } from "./DropTarget";
|
|
4
4
|
import "./DropTargetRenderer.css";
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
type Point = [number, number];
|
|
6
|
+
type TabMode = "full-view" | "tab-only";
|
|
7
7
|
export default class DropTargetCanvas {
|
|
8
8
|
private currentPath;
|
|
9
9
|
private tabMode;
|
|
@@ -33,8 +33,8 @@ export interface DropPosition {
|
|
|
33
33
|
SouthOrEast: boolean;
|
|
34
34
|
West: boolean;
|
|
35
35
|
}
|
|
36
|
-
export
|
|
37
|
-
export
|
|
36
|
+
export type RelativePosition = 'after' | 'before';
|
|
37
|
+
export type DropPosTab = {
|
|
38
38
|
index: number;
|
|
39
39
|
left: number;
|
|
40
40
|
positionRelativeToTab: RelativePosition;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { HTMLAttributes } from 'react';
|
|
2
2
|
import './Splitter.css';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
3
|
+
export type SplitterDragStartHandler = (index: number) => void;
|
|
4
|
+
export type SplitterDragHandler = (index: number, distance: number) => void;
|
|
5
|
+
export type SplitterDragEndHandler = () => void;
|
|
6
6
|
export interface SplitterProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onDrag' | 'onDragStart'> {
|
|
7
7
|
column: boolean;
|
|
8
8
|
index: number;
|
|
@@ -28,8 +28,8 @@ export interface SplitterHookResult {
|
|
|
28
28
|
content: ReactElement[];
|
|
29
29
|
rootRef: MutableRefObject<HTMLDivElement | null>;
|
|
30
30
|
}
|
|
31
|
-
export
|
|
32
|
-
export
|
|
31
|
+
export type SplitterFactory = (index: number) => ReactElement<SplitterProps>;
|
|
32
|
+
export type ContentMeta = {
|
|
33
33
|
currentSize?: number;
|
|
34
34
|
flexOpen?: boolean;
|
|
35
35
|
flexBasis?: number;
|
|
@@ -40,12 +40,12 @@ export declare type ContentMeta = {
|
|
|
40
40
|
shim?: boolean;
|
|
41
41
|
splitter?: boolean;
|
|
42
42
|
};
|
|
43
|
-
export
|
|
43
|
+
export type FlexSize = {
|
|
44
44
|
size: number;
|
|
45
45
|
minSize: number;
|
|
46
46
|
};
|
|
47
|
-
export
|
|
48
|
-
export
|
|
49
|
-
export
|
|
47
|
+
export type BreakPoint = "xs" | "sm" | "md" | "lg" | "xl";
|
|
48
|
+
export type BreakPoints = BreakPoint[];
|
|
49
|
+
export type BreakPointsProp = {
|
|
50
50
|
[keys in BreakPoint]?: number;
|
|
51
51
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReactElement } from "react";
|
|
2
2
|
import { LayoutJSON } from "../layout-reducer";
|
|
3
3
|
import { LayoutProviderDispatch } from "./LayoutProviderContext";
|
|
4
|
-
|
|
4
|
+
type LayoutChangeHandler = (layout: LayoutJSON, source: string) => void;
|
|
5
5
|
export interface LayoutProviderProps {
|
|
6
6
|
children: ReactElement;
|
|
7
7
|
layout?: LayoutJSON;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Dispatch } from 'react';
|
|
2
2
|
import { DragStartAction, LayoutReducerAction, SaveAction } from '../layout-reducer';
|
|
3
|
-
export
|
|
3
|
+
export type LayoutProviderDispatch = Dispatch<LayoutReducerAction | SaveAction | DragStartAction>;
|
|
4
4
|
export interface LayoutProviderContextProps {
|
|
5
5
|
dispatchLayoutProvider: LayoutProviderDispatch;
|
|
6
6
|
version: number;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React, { CSSProperties, ReactElement, ReactNode } from "react";
|
|
2
2
|
import { dimension, rect, rectTuple } from "../common-types";
|
|
3
3
|
import { DropPos } from "../drag-drop/dragDropTypes";
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export
|
|
4
|
+
export type flexDirection = "row" | "column";
|
|
5
|
+
type contraDimension = dimension;
|
|
6
|
+
type flexDimensionTuple = [dimension, contraDimension, flexDirection];
|
|
7
|
+
export type position = {
|
|
8
8
|
height?: number;
|
|
9
9
|
width?: number;
|
|
10
10
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReactElement } from "react";
|
|
2
2
|
import { DropPos } from "../drag-drop";
|
|
3
3
|
import { LayoutModel } from "./layoutTypes";
|
|
4
|
-
|
|
4
|
+
type insertionPosition = "before" | "after";
|
|
5
5
|
export declare function getInsertTabBeforeAfter(stack: LayoutModel, pos: DropPos): any[];
|
|
6
6
|
export declare function insertIntoContainer(container: ReactElement, targetContainer: ReactElement, newComponent: ReactElement): ReactElement;
|
|
7
7
|
export declare function insertBesideChild(container: ReactElement, existingComponent: any, newComponent: any, insertionPosition: insertionPosition, pos?: DropPos, clientRect?: any, dropRect?: any): ReactElement;
|
|
@@ -28,8 +28,8 @@ export interface LayoutJSON extends WithType {
|
|
|
28
28
|
export interface WithActive {
|
|
29
29
|
active?: number;
|
|
30
30
|
}
|
|
31
|
-
export
|
|
32
|
-
export
|
|
31
|
+
export type LayoutModel = LayoutRoot | ReactElement | WithType;
|
|
32
|
+
export type layoutType = "Flexbox" | "View" | "DraggableLayout" | "Stack";
|
|
33
33
|
export declare const LayoutActionType: {
|
|
34
34
|
readonly ADD: "add";
|
|
35
35
|
readonly DRAG_START: "drag-start";
|
|
@@ -45,44 +45,44 @@ export declare const LayoutActionType: {
|
|
|
45
45
|
readonly SWITCH_TAB: "switch-tab";
|
|
46
46
|
readonly TEAROUT: "tearout";
|
|
47
47
|
};
|
|
48
|
-
export
|
|
48
|
+
export type AddAction = {
|
|
49
49
|
component: any;
|
|
50
50
|
path: string;
|
|
51
51
|
type: typeof LayoutActionType.ADD;
|
|
52
52
|
};
|
|
53
|
-
export
|
|
53
|
+
export type DragDropAction = {
|
|
54
54
|
draggedReactElement: ReactElement;
|
|
55
55
|
dragInstructions: any;
|
|
56
56
|
dropTarget: Partial<DropTarget>;
|
|
57
57
|
type: typeof LayoutActionType.DRAG_DROP;
|
|
58
58
|
};
|
|
59
|
-
export
|
|
59
|
+
export type MaximizeAction = {
|
|
60
60
|
path?: string;
|
|
61
61
|
type: typeof LayoutActionType.MAXIMIZE;
|
|
62
62
|
};
|
|
63
|
-
export
|
|
63
|
+
export type MinimizeAction = {
|
|
64
64
|
path?: string;
|
|
65
65
|
type: typeof LayoutActionType.MINIMIZE;
|
|
66
66
|
};
|
|
67
|
-
export
|
|
67
|
+
export type RemoveAction = {
|
|
68
68
|
path?: string;
|
|
69
69
|
type: typeof LayoutActionType.REMOVE;
|
|
70
70
|
};
|
|
71
|
-
export
|
|
71
|
+
export type ReplaceAction = {
|
|
72
72
|
replacement: any;
|
|
73
73
|
target: any;
|
|
74
74
|
type: typeof LayoutActionType.REPLACE;
|
|
75
75
|
};
|
|
76
|
-
export
|
|
76
|
+
export type RestoreAction = {
|
|
77
77
|
path?: string;
|
|
78
78
|
type: typeof LayoutActionType.RESTORE;
|
|
79
79
|
};
|
|
80
|
-
export
|
|
80
|
+
export type SetTitleAction = {
|
|
81
81
|
path: string;
|
|
82
82
|
title: string;
|
|
83
83
|
type: typeof LayoutActionType.SET_TITLE;
|
|
84
84
|
};
|
|
85
|
-
export
|
|
85
|
+
export type SplitterResizeAction = {
|
|
86
86
|
path: string;
|
|
87
87
|
sizes: {
|
|
88
88
|
currentSize: number;
|
|
@@ -90,34 +90,34 @@ export declare type SplitterResizeAction = {
|
|
|
90
90
|
}[];
|
|
91
91
|
type: typeof LayoutActionType.SPLITTER_RESIZE;
|
|
92
92
|
};
|
|
93
|
-
export
|
|
93
|
+
export type SwitchTabAction = {
|
|
94
94
|
nextIdx: number;
|
|
95
95
|
path: string;
|
|
96
96
|
type: typeof LayoutActionType.SWITCH_TAB;
|
|
97
97
|
};
|
|
98
|
-
export
|
|
98
|
+
export type TearoutAction = {
|
|
99
99
|
path?: string;
|
|
100
100
|
type: typeof LayoutActionType.TEAROUT;
|
|
101
101
|
};
|
|
102
|
-
export
|
|
103
|
-
export
|
|
102
|
+
export type LayoutReducerAction = AddAction | DragDropAction | MaximizeAction | MinimizeAction | RemoveAction | ReplaceAction | RestoreAction | SetTitleAction | SplitterResizeAction | SwitchTabAction;
|
|
103
|
+
export type SaveAction = {
|
|
104
104
|
type: typeof LayoutActionType.SAVE;
|
|
105
105
|
};
|
|
106
|
-
export
|
|
106
|
+
export type AddToolbarContributionViewAction = {
|
|
107
107
|
content: ReactElement;
|
|
108
108
|
location: string;
|
|
109
109
|
type: "add-toolbar-contribution";
|
|
110
110
|
};
|
|
111
|
-
export
|
|
111
|
+
export type RemoveToolbarContributionViewAction = {
|
|
112
112
|
location: string;
|
|
113
113
|
type: "remove-toolbar-contribution";
|
|
114
114
|
};
|
|
115
|
-
export
|
|
115
|
+
export type MousedownViewAction = {
|
|
116
116
|
preDragActivity?: any;
|
|
117
117
|
index?: number;
|
|
118
118
|
type: "mousedown";
|
|
119
119
|
};
|
|
120
|
-
export
|
|
120
|
+
export type DragStartAction = {
|
|
121
121
|
payload?: ReactElement;
|
|
122
122
|
dragContainerPath?: string;
|
|
123
123
|
dragElement?: HTMLElement;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { SyntheticEvent } from "react";
|
|
2
2
|
import { ViewAction } from "./viewTypes";
|
|
3
|
-
export
|
|
3
|
+
export type ViewDispatch = <Action extends ViewAction = ViewAction>(action: Action, evt?: SyntheticEvent) => Promise<boolean | void>;
|
|
4
4
|
export interface ViewContextProps {
|
|
5
5
|
dispatch?: ViewDispatch | null;
|
|
6
6
|
id?: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { HTMLAttributes } from "react";
|
|
2
2
|
import { HeaderProps } from "../layout-header";
|
|
3
3
|
import { AddToolbarContributionViewAction, MaximizeAction, MinimizeAction, MousedownViewAction, RemoveAction, RemoveToolbarContributionViewAction, RestoreAction, TearoutAction } from "../layout-reducer";
|
|
4
|
-
export
|
|
4
|
+
export type ViewAction = MaximizeAction | MinimizeAction | MousedownViewAction | RemoveAction | RestoreAction | TearoutAction | AddToolbarContributionViewAction | RemoveToolbarContributionViewAction;
|
|
5
5
|
export interface ViewProps extends HTMLAttributes<HTMLDivElement> {
|
|
6
6
|
closeable?: boolean;
|
|
7
7
|
collapsed?: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FunctionComponent } from "react";
|
|
2
|
-
export
|
|
2
|
+
export type layoutComponentType = "component" | "container" | "view";
|
|
3
3
|
export interface ComponentWithId {
|
|
4
4
|
id: string;
|
|
5
5
|
[key: string]: unknown;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { BreakPointsProp } from "../flexbox/flexboxTypes";
|
|
2
|
-
export
|
|
2
|
+
export type BreakPointRamp = [string, number, number];
|
|
3
3
|
export declare const breakpointRamp: (breakpoints: BreakPointsProp) => BreakPointRamp[];
|
|
4
4
|
export declare const getBreakPoints: (themeName?: string) => BreakPointRamp[];
|
|
@@ -2,11 +2,11 @@ import { RefObject } from 'react';
|
|
|
2
2
|
export declare const WidthHeight: string[];
|
|
3
3
|
export declare const HeightOnly: string[];
|
|
4
4
|
export declare const WidthOnly: string[];
|
|
5
|
-
export
|
|
5
|
+
export type measurements<T = string | number> = {
|
|
6
6
|
height?: T;
|
|
7
7
|
scrollHeight?: T;
|
|
8
8
|
scrollWidth?: T;
|
|
9
9
|
width?: T;
|
|
10
10
|
};
|
|
11
|
-
export
|
|
11
|
+
export type ResizeHandler = (measurements: measurements<number>) => void;
|
|
12
12
|
export declare function useResizeObserver(ref: RefObject<Element | HTMLElement | null>, dimensions: string[], onResize: ResizeHandler, reportInitialSize?: boolean): void;
|
|
@@ -9,7 +9,7 @@ export declare function followPath(source: LayoutModel, path: string): LayoutMod
|
|
|
9
9
|
export declare function followPath(source: ReactElement, path: string, throwIfNotFound: true): ReactElement;
|
|
10
10
|
export declare function nextLeaf(root: ReactElement, path: string): any;
|
|
11
11
|
export declare function previousLeaf(root: ReactElement, path: string): any;
|
|
12
|
-
|
|
12
|
+
type NextStepResult = {
|
|
13
13
|
idx: number;
|
|
14
14
|
finalStep: boolean;
|
|
15
15
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { CSSProperties } from 'react';
|
|
2
|
-
export
|
|
2
|
+
export type CSSFlexProperties = Pick<CSSProperties, 'flexBasis' | 'flexGrow' | 'flexShrink'>;
|
|
3
3
|
export declare const expandFlex: (flex: number | CSSFlexProperties) => CSSFlexProperties;
|