@vuu-ui/vuu-layout 0.6.8-debug → 0.6.9-debug
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 +6 -4
- package/types/Component.d.ts +7 -0
- package/types/DraggableLayout.d.ts +6 -0
- package/types/chest-of-drawers/Chest.d.ts +10 -0
- package/types/chest-of-drawers/Drawer.d.ts +18 -0
- package/types/chest-of-drawers/index.d.ts +2 -0
- package/types/common-types.d.ts +8 -0
- package/types/debug.d.ts +2 -0
- package/types/drag-drop/BoxModel.d.ts +143 -0
- package/types/drag-drop/DragState.d.ts +46 -0
- package/types/drag-drop/Draggable.d.ts +23 -0
- package/types/drag-drop/DropMenu.d.ts +10 -0
- package/types/drag-drop/DropTarget.d.ts +61 -0
- package/types/drag-drop/DropTargetRenderer.d.ts +18 -0
- package/types/drag-drop/dragDropTypes.d.ts +51 -0
- package/types/drag-drop/index.d.ts +4 -0
- package/types/flexbox/Flexbox.d.ts +5 -0
- package/types/flexbox/FlexboxLayout.d.ts +6 -0
- package/types/flexbox/FluidGrid.d.ts +7 -0
- package/types/flexbox/FluidGridLayout.d.ts +6 -0
- package/types/flexbox/Splitter.d.ts +13 -0
- package/types/flexbox/flexbox-utils.d.ts +12 -0
- package/types/flexbox/flexboxTypes.d.ts +51 -0
- package/types/flexbox/index.d.ts +4 -0
- package/types/flexbox/useResponsiveSizing.d.ts +10 -0
- package/types/flexbox/useSplitterResizing.d.ts +2 -0
- package/types/index.d.ts +18 -0
- package/types/layout-action.d.ts +21 -0
- package/types/layout-header/ActionButton.d.ts +8 -0
- package/types/layout-header/Header.d.ts +13 -0
- package/types/layout-header/index.d.ts +1 -0
- package/types/layout-provider/LayoutProvider.d.ts +14 -0
- package/types/layout-provider/LayoutProviderContext.d.ts +8 -0
- package/types/layout-provider/index.d.ts +2 -0
- package/types/layout-provider/useLayoutDragDrop.d.ts +4 -0
- package/types/layout-reducer/flexUtils.d.ts +22 -0
- package/types/layout-reducer/index.d.ts +4 -0
- package/types/layout-reducer/insert-layout-element.d.ts +8 -0
- package/types/layout-reducer/layout-reducer.d.ts +3 -0
- package/types/layout-reducer/layoutTypes.d.ts +130 -0
- package/types/layout-reducer/layoutUtils.d.ts +28 -0
- package/types/layout-reducer/remove-layout-element.d.ts +3 -0
- package/types/layout-reducer/replace-layout-element.d.ts +6 -0
- package/types/layout-reducer/resize-flex-children.d.ts +3 -0
- package/types/layout-reducer/wrap-layout-element.d.ts +9 -0
- package/types/layout-view/View.d.ts +11 -0
- package/types/layout-view/ViewContext.d.ts +18 -0
- package/types/layout-view/index.d.ts +4 -0
- package/types/layout-view/useView.d.ts +21 -0
- package/types/layout-view/useViewActionDispatcher.d.ts +8 -0
- package/types/layout-view/useViewResize.d.ts +7 -0
- package/types/layout-view/viewTypes.d.ts +18 -0
- package/types/palette/Palette.d.ts +18 -0
- package/types/palette/PaletteSalt.d.ts +14 -0
- package/types/palette/index.d.ts +2 -0
- package/types/placeholder/Placeholder.d.ts +12 -0
- package/types/placeholder/index.d.ts +1 -0
- package/types/registry/ComponentRegistry.d.ts +14 -0
- package/types/registry/index.d.ts +1 -0
- package/types/responsive/breakpoints.d.ts +4 -0
- package/types/responsive/index.d.ts +3 -0
- package/types/responsive/measureMinimumNodeSize.d.ts +1 -0
- package/types/responsive/overflowUtils.d.ts +2 -0
- package/types/responsive/use-breakpoints.d.ts +7 -0
- package/types/responsive/useResizeObserver.d.ts +12 -0
- package/types/responsive/utils.d.ts +6 -0
- package/types/stack/Stack.d.ts +4 -0
- package/types/stack/StackLayout.d.ts +7 -0
- package/types/stack/index.d.ts +3 -0
- package/types/stack/stackTypes.d.ts +20 -0
- package/types/tabs/TabPanel.d.ts +7 -0
- package/types/tabs/index.d.ts +1 -0
- package/types/tools/config-wrapper/ConfigWrapper.d.ts +2 -0
- package/types/tools/config-wrapper/index.d.ts +1 -0
- package/types/tools/devtools-box/layout-configurator.d.ts +31 -0
- package/types/tools/devtools-tree/layout-tree-viewer.d.ts +5 -0
- package/types/tools/index.d.ts +3 -0
- package/types/use-persistent-state.d.ts +11 -0
- package/types/utils/index.d.ts +5 -0
- package/types/utils/pathUtils.d.ts +18 -0
- package/types/utils/propUtils.d.ts +5 -0
- package/types/utils/refUtils.d.ts +2 -0
- package/types/utils/styleUtils.d.ts +3 -0
- package/types/utils/typeOf.d.ts +4 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReactElement } from "react";
|
|
2
|
+
import { LayoutJSON } from "../layout-reducer";
|
|
3
|
+
import { LayoutProviderDispatch } from "./LayoutProviderContext";
|
|
4
|
+
type LayoutChangeHandler = (layout: LayoutJSON, source: string) => void;
|
|
5
|
+
export interface LayoutProviderProps {
|
|
6
|
+
children: ReactElement;
|
|
7
|
+
layout?: LayoutJSON;
|
|
8
|
+
onLayoutChange?: LayoutChangeHandler;
|
|
9
|
+
}
|
|
10
|
+
export declare const LayoutProviderVersion: () => JSX.Element;
|
|
11
|
+
export declare const LayoutProvider: (props: LayoutProviderProps) => ReactElement;
|
|
12
|
+
export declare const useLayoutProviderDispatch: () => LayoutProviderDispatch;
|
|
13
|
+
export declare const useLayoutProviderVersion: () => number;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Dispatch } from 'react';
|
|
2
|
+
import { DragStartAction, LayoutReducerAction, SaveAction } from '../layout-reducer';
|
|
3
|
+
export type LayoutProviderDispatch = Dispatch<LayoutReducerAction | SaveAction | DragStartAction>;
|
|
4
|
+
export interface LayoutProviderContextProps {
|
|
5
|
+
dispatchLayoutProvider: LayoutProviderDispatch;
|
|
6
|
+
version: number;
|
|
7
|
+
}
|
|
8
|
+
export declare const LayoutProviderContext: import("react").Context<LayoutProviderContextProps>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { MutableRefObject, ReactElement } from "react";
|
|
2
|
+
import { DragStartAction } from "../layout-reducer";
|
|
3
|
+
import { LayoutProviderDispatch } from "./LayoutProviderContext";
|
|
4
|
+
export declare const useLayoutDragDrop: (rootLayoutRef: MutableRefObject<ReactElement>, dispatch: LayoutProviderDispatch) => (action: DragStartAction) => void;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React, { CSSProperties, ReactElement, ReactNode } from "react";
|
|
2
|
+
import { dimension, rect, rectTuple } from "../common-types";
|
|
3
|
+
import { DropPos } from "../drag-drop/dragDropTypes";
|
|
4
|
+
export type flexDirection = "row" | "column";
|
|
5
|
+
type contraDimension = dimension;
|
|
6
|
+
type flexDimensionTuple = [dimension, contraDimension, flexDirection];
|
|
7
|
+
export type position = {
|
|
8
|
+
height?: number;
|
|
9
|
+
width?: number;
|
|
10
|
+
};
|
|
11
|
+
export declare const getFlexDimensions: (flexDirection?: flexDirection) => flexDimensionTuple;
|
|
12
|
+
export declare const getIntrinsicSize: (component: ReactElement) => {
|
|
13
|
+
height?: number | undefined;
|
|
14
|
+
width?: number | undefined;
|
|
15
|
+
} | undefined;
|
|
16
|
+
export declare function getFlexStyle(component: ReactElement, dimension: dimension, pos?: DropPos): any;
|
|
17
|
+
export declare function hasUnboundedFlexStyle(component: ReactElement): boolean;
|
|
18
|
+
export declare function getFlexOrIntrinsicStyle(component: ReactElement, dimension: dimension, pos: position): any;
|
|
19
|
+
export declare function wrapIntrinsicSizeComponentWithFlexbox(component: ReactElement, flexDirection: flexDirection, path: string, clientRect?: rect, dropRect?: rectTuple): React.FunctionComponentElement<any>;
|
|
20
|
+
export declare function createFlexbox(flexDirection: flexDirection, props: any, children: ReactNode, path: string): React.FunctionComponentElement<any>;
|
|
21
|
+
export declare function createPlaceHolder(path: string, size: number, style?: CSSProperties, props?: any): React.DetailedReactHTMLElement<any, HTMLElement>;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ReactElement } from "react";
|
|
2
|
+
import { DropPos } from "../drag-drop";
|
|
3
|
+
import { LayoutModel } from "./layoutTypes";
|
|
4
|
+
type insertionPosition = "before" | "after";
|
|
5
|
+
export declare function getInsertTabBeforeAfter(stack: LayoutModel, pos: DropPos): any[];
|
|
6
|
+
export declare function insertIntoContainer(container: ReactElement, targetContainer: ReactElement, newComponent: ReactElement): ReactElement;
|
|
7
|
+
export declare function insertBesideChild(container: ReactElement, existingComponent: any, newComponent: any, insertionPosition: insertionPosition, pos?: DropPos, clientRect?: any, dropRect?: any): ReactElement;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { ReactElement } from "react";
|
|
2
|
+
import { DragDropRect, DragInstructions } from "../drag-drop";
|
|
3
|
+
import { DropTarget } from "../drag-drop/DropTarget";
|
|
4
|
+
export interface WithProps {
|
|
5
|
+
props?: {
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export interface WithType {
|
|
10
|
+
props?: any;
|
|
11
|
+
title?: string;
|
|
12
|
+
type: string;
|
|
13
|
+
}
|
|
14
|
+
export interface LayoutRoot extends WithProps {
|
|
15
|
+
active?: number;
|
|
16
|
+
children?: ReactElement[];
|
|
17
|
+
type: string;
|
|
18
|
+
}
|
|
19
|
+
export interface LayoutJSON extends WithType {
|
|
20
|
+
children?: LayoutJSON[];
|
|
21
|
+
id?: string;
|
|
22
|
+
props?: {
|
|
23
|
+
[key: string]: any;
|
|
24
|
+
};
|
|
25
|
+
state?: any;
|
|
26
|
+
type: string;
|
|
27
|
+
}
|
|
28
|
+
export interface WithActive {
|
|
29
|
+
active?: number;
|
|
30
|
+
}
|
|
31
|
+
export type LayoutModel = LayoutRoot | ReactElement | WithType;
|
|
32
|
+
export type layoutType = "Flexbox" | "View" | "DraggableLayout" | "Stack";
|
|
33
|
+
export declare const LayoutActionType: {
|
|
34
|
+
readonly ADD: "add";
|
|
35
|
+
readonly DRAG_START: "drag-start";
|
|
36
|
+
readonly DRAG_DROP: "drag-drop";
|
|
37
|
+
readonly MAXIMIZE: "maximize";
|
|
38
|
+
readonly MINIMIZE: "minimize";
|
|
39
|
+
readonly REMOVE: "remove";
|
|
40
|
+
readonly REPLACE: "replace";
|
|
41
|
+
readonly RESTORE: "restore";
|
|
42
|
+
readonly SAVE: "save";
|
|
43
|
+
readonly SET_TITLE: "set-title";
|
|
44
|
+
readonly SPLITTER_RESIZE: "splitter-resize";
|
|
45
|
+
readonly SWITCH_TAB: "switch-tab";
|
|
46
|
+
readonly TEAROUT: "tearout";
|
|
47
|
+
};
|
|
48
|
+
export type AddAction = {
|
|
49
|
+
component: any;
|
|
50
|
+
path: string;
|
|
51
|
+
type: typeof LayoutActionType.ADD;
|
|
52
|
+
};
|
|
53
|
+
export type DragDropAction = {
|
|
54
|
+
draggedReactElement: ReactElement;
|
|
55
|
+
dragInstructions: any;
|
|
56
|
+
dropTarget: Partial<DropTarget>;
|
|
57
|
+
type: typeof LayoutActionType.DRAG_DROP;
|
|
58
|
+
};
|
|
59
|
+
export type MaximizeAction = {
|
|
60
|
+
path?: string;
|
|
61
|
+
type: typeof LayoutActionType.MAXIMIZE;
|
|
62
|
+
};
|
|
63
|
+
export type MinimizeAction = {
|
|
64
|
+
path?: string;
|
|
65
|
+
type: typeof LayoutActionType.MINIMIZE;
|
|
66
|
+
};
|
|
67
|
+
export type RemoveAction = {
|
|
68
|
+
path?: string;
|
|
69
|
+
type: typeof LayoutActionType.REMOVE;
|
|
70
|
+
};
|
|
71
|
+
export type ReplaceAction = {
|
|
72
|
+
replacement: any;
|
|
73
|
+
target: any;
|
|
74
|
+
type: typeof LayoutActionType.REPLACE;
|
|
75
|
+
};
|
|
76
|
+
export type RestoreAction = {
|
|
77
|
+
path?: string;
|
|
78
|
+
type: typeof LayoutActionType.RESTORE;
|
|
79
|
+
};
|
|
80
|
+
export type SetTitleAction = {
|
|
81
|
+
path: string;
|
|
82
|
+
title: string;
|
|
83
|
+
type: typeof LayoutActionType.SET_TITLE;
|
|
84
|
+
};
|
|
85
|
+
export type SplitterResizeAction = {
|
|
86
|
+
path: string;
|
|
87
|
+
sizes: {
|
|
88
|
+
currentSize: number;
|
|
89
|
+
flexBasis: number;
|
|
90
|
+
}[];
|
|
91
|
+
type: typeof LayoutActionType.SPLITTER_RESIZE;
|
|
92
|
+
};
|
|
93
|
+
export type SwitchTabAction = {
|
|
94
|
+
nextIdx: number;
|
|
95
|
+
path: string;
|
|
96
|
+
type: typeof LayoutActionType.SWITCH_TAB;
|
|
97
|
+
};
|
|
98
|
+
export type TearoutAction = {
|
|
99
|
+
path?: string;
|
|
100
|
+
type: typeof LayoutActionType.TEAROUT;
|
|
101
|
+
};
|
|
102
|
+
export type LayoutReducerAction = AddAction | DragDropAction | MaximizeAction | MinimizeAction | RemoveAction | ReplaceAction | RestoreAction | SetTitleAction | SplitterResizeAction | SwitchTabAction;
|
|
103
|
+
export type SaveAction = {
|
|
104
|
+
type: typeof LayoutActionType.SAVE;
|
|
105
|
+
};
|
|
106
|
+
export type AddToolbarContributionViewAction = {
|
|
107
|
+
content: ReactElement;
|
|
108
|
+
location: string;
|
|
109
|
+
type: "add-toolbar-contribution";
|
|
110
|
+
};
|
|
111
|
+
export type RemoveToolbarContributionViewAction = {
|
|
112
|
+
location: string;
|
|
113
|
+
type: "remove-toolbar-contribution";
|
|
114
|
+
};
|
|
115
|
+
export type MousedownViewAction = {
|
|
116
|
+
preDragActivity?: any;
|
|
117
|
+
index?: number;
|
|
118
|
+
type: "mousedown";
|
|
119
|
+
};
|
|
120
|
+
export type DragStartAction = {
|
|
121
|
+
payload?: ReactElement;
|
|
122
|
+
dragContainerPath?: string;
|
|
123
|
+
dragElement?: HTMLElement;
|
|
124
|
+
dragRect: DragDropRect;
|
|
125
|
+
dropTargets?: string[];
|
|
126
|
+
evt: MouseEvent;
|
|
127
|
+
instructions?: DragInstructions;
|
|
128
|
+
path: string;
|
|
129
|
+
type: typeof LayoutActionType.DRAG_START;
|
|
130
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React, { CSSProperties, ReactElement } from "react";
|
|
2
|
+
import { dimension } from "../common-types";
|
|
3
|
+
import { ComponentWithId } from "../registry/ComponentRegistry";
|
|
4
|
+
import { LayoutJSON, LayoutModel, layoutType } from "./layoutTypes";
|
|
5
|
+
export declare const getManagedDimension: (style: CSSProperties) => [dimension, dimension];
|
|
6
|
+
export declare const applyLayoutProps: (component: ReactElement, path?: string) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
7
|
+
export interface LayoutProps extends ComponentWithId {
|
|
8
|
+
active?: number;
|
|
9
|
+
"data-path"?: string;
|
|
10
|
+
children?: ReactElement[];
|
|
11
|
+
column?: any;
|
|
12
|
+
dropTarget?: any;
|
|
13
|
+
key: string;
|
|
14
|
+
layout?: any;
|
|
15
|
+
path?: string;
|
|
16
|
+
resizeable?: boolean;
|
|
17
|
+
style: CSSProperties;
|
|
18
|
+
type?: string;
|
|
19
|
+
version?: number;
|
|
20
|
+
}
|
|
21
|
+
export declare const processLayoutElement: (layoutElement: ReactElement, previousLayout?: ReactElement) => ReactElement;
|
|
22
|
+
export declare const applyLayout: (type: layoutType, props: LayoutProps, previousLayout?: LayoutModel) => LayoutModel;
|
|
23
|
+
export declare function layoutFromJson({ id, type, children, props, state }: LayoutJSON, path: string): ReactElement;
|
|
24
|
+
export declare function layoutToJSON(component: ReactElement): LayoutJSON;
|
|
25
|
+
export declare function componentToJson(component: ReactElement): LayoutJSON;
|
|
26
|
+
export declare function serializeProps(props?: LayoutProps): {
|
|
27
|
+
[key: string]: any;
|
|
28
|
+
} | undefined;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React, { ReactElement } from 'react';
|
|
2
|
+
import { ReplaceAction } from './layoutTypes';
|
|
3
|
+
import { LayoutProps } from './layoutUtils';
|
|
4
|
+
export declare function replaceChild(model: ReactElement, { target, replacement }: ReplaceAction): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
5
|
+
export declare function _replaceChild(model: ReactElement, child: ReactElement, replacement: ReactElement<LayoutProps>): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
6
|
+
export declare function swapChild(model: ReactElement, child: ReactElement, replacement: ReactElement, op?: 'maximize' | 'minimize' | 'restore'): ReactElement;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import React, { ReactElement } from 'react';
|
|
2
|
+
import { SplitterResizeAction } from './layoutTypes';
|
|
3
|
+
export declare function resizeFlexChildren(layoutRoot: ReactElement, { path, sizes }: SplitterResizeAction): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactElement } from "react";
|
|
2
|
+
import { DropPos } from "../drag-drop/dragDropTypes";
|
|
3
|
+
import { DropTarget } from "../drag-drop/DropTarget";
|
|
4
|
+
export interface LayoutSpec {
|
|
5
|
+
type: "Stack" | "Flexbox";
|
|
6
|
+
flexDirection: "column" | "row";
|
|
7
|
+
showTabs?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function wrap(container: ReactElement, existingComponent: any, newComponent: any, pos: DropPos, clientRect?: DropTarget["clientRect"], dropRect?: DropTarget["dropRect"]): ReactElement;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ForwardedRef, ReactElement } from "react";
|
|
2
|
+
import { ViewProps } from "./viewTypes";
|
|
3
|
+
import "./View.css";
|
|
4
|
+
interface ViewComponentType {
|
|
5
|
+
(props: ViewProps & {
|
|
6
|
+
ref?: ForwardedRef<HTMLDivElement>;
|
|
7
|
+
}): ReactElement<ViewProps>;
|
|
8
|
+
displayName?: string;
|
|
9
|
+
}
|
|
10
|
+
declare const MemoView: ViewComponentType;
|
|
11
|
+
export { MemoView as View };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React, { SyntheticEvent } from "react";
|
|
2
|
+
import { ViewAction } from "./viewTypes";
|
|
3
|
+
export type ViewDispatch = <Action extends ViewAction = ViewAction>(action: Action, evt?: SyntheticEvent) => Promise<boolean | void>;
|
|
4
|
+
export interface ViewContextProps {
|
|
5
|
+
dispatch?: ViewDispatch | null;
|
|
6
|
+
id?: string;
|
|
7
|
+
load?: (key?: string) => unknown;
|
|
8
|
+
loadSession?: (key?: string) => unknown;
|
|
9
|
+
onConfigChange?: (config: unknown) => void;
|
|
10
|
+
path?: string;
|
|
11
|
+
purge?: (key: string) => void;
|
|
12
|
+
save?: (state: unknown, key: string) => void;
|
|
13
|
+
saveSession?: (state: unknown, key: string) => void;
|
|
14
|
+
title?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare const ViewContext: React.Context<ViewContextProps>;
|
|
17
|
+
export declare const useViewDispatch: () => ViewDispatch | null;
|
|
18
|
+
export declare const useViewContext: () => ViewContextProps;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { RefObject } from "react";
|
|
2
|
+
export interface ViewHookProps {
|
|
3
|
+
id: string;
|
|
4
|
+
rootRef: RefObject<HTMLDivElement>;
|
|
5
|
+
path?: string;
|
|
6
|
+
dropTargets?: string[];
|
|
7
|
+
title?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const useView: ({ id, rootRef, path, dropTargets, title: titleProp, }: ViewHookProps) => {
|
|
10
|
+
contributions: import("./useViewActionDispatcher").Contribution[] | undefined;
|
|
11
|
+
dispatchViewAction: import("./ViewContext").ViewDispatch;
|
|
12
|
+
load: (key?: string) => any;
|
|
13
|
+
loadSession: (key?: string) => any;
|
|
14
|
+
onConfigChange: ({ type: key, ...config }: any) => void;
|
|
15
|
+
onEditTitle: (title: string) => void;
|
|
16
|
+
purge: (key: any) => void;
|
|
17
|
+
restoredState: any;
|
|
18
|
+
save: (state: any, key: any) => void;
|
|
19
|
+
saveSession: (state: any, key: any) => void;
|
|
20
|
+
title: any;
|
|
21
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ReactElement, RefObject } from "react";
|
|
2
|
+
import { ViewDispatch } from "./ViewContext";
|
|
3
|
+
export type Contribution = {
|
|
4
|
+
index?: number;
|
|
5
|
+
location?: string;
|
|
6
|
+
content: ReactElement;
|
|
7
|
+
};
|
|
8
|
+
export declare const useViewActionDispatcher: (id: string, root: RefObject<HTMLDivElement>, viewPath?: string, dropTargets?: string[]) => [ViewDispatch, Contribution[] | undefined];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { RefObject } from "react";
|
|
2
|
+
export interface ViewResizeHookProps {
|
|
3
|
+
mainRef: RefObject<HTMLDivElement>;
|
|
4
|
+
resize?: "defer" | "responsive";
|
|
5
|
+
rootRef: RefObject<HTMLDivElement>;
|
|
6
|
+
}
|
|
7
|
+
export declare const useViewResize: ({ mainRef, resize, rootRef, }: ViewResizeHookProps) => void;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HTMLAttributes } from "react";
|
|
2
|
+
import { HeaderProps } from "../layout-header";
|
|
3
|
+
import { AddToolbarContributionViewAction, MaximizeAction, MinimizeAction, MousedownViewAction, RemoveAction, RemoveToolbarContributionViewAction, RestoreAction, TearoutAction } from "../layout-reducer";
|
|
4
|
+
export type ViewAction = MaximizeAction | MinimizeAction | MousedownViewAction | RemoveAction | RestoreAction | TearoutAction | AddToolbarContributionViewAction | RemoveToolbarContributionViewAction;
|
|
5
|
+
export interface ViewProps extends HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
closeable?: boolean;
|
|
7
|
+
collapsed?: boolean;
|
|
8
|
+
"data-resizeable"?: boolean;
|
|
9
|
+
dropTargets?: string[];
|
|
10
|
+
expanded?: boolean;
|
|
11
|
+
flexFill?: any;
|
|
12
|
+
header?: boolean | Partial<HeaderProps>;
|
|
13
|
+
orientation?: "vertical" | "horizontal";
|
|
14
|
+
path?: string;
|
|
15
|
+
resize?: "defer" | "responsive";
|
|
16
|
+
resizeable?: boolean;
|
|
17
|
+
tearOut?: boolean;
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ListItemProps } from "@heswell/salt-lab";
|
|
2
|
+
import { HTMLAttributes, ReactElement } from "react";
|
|
3
|
+
import "./Palette.css";
|
|
4
|
+
export interface PaletteItemProps extends ListItemProps {
|
|
5
|
+
children: ReactElement;
|
|
6
|
+
closeable?: boolean;
|
|
7
|
+
header?: boolean;
|
|
8
|
+
idx?: number;
|
|
9
|
+
resize?: "defer";
|
|
10
|
+
resizeable?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const PaletteItem: import("react").MemoExoticComponent<({ className, children: component, idx, resizeable, header, closeable, ...props }: PaletteItemProps) => JSX.Element>;
|
|
13
|
+
export interface PaletteProps extends Omit<HTMLAttributes<HTMLDivElement>, "onSelect"> {
|
|
14
|
+
children: ReactElement[];
|
|
15
|
+
orientation: "horizontal" | "vertical";
|
|
16
|
+
selection?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare const Palette: ({ children, className, orientation, ...props }: PaletteProps) => JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ListItemProps, ListProps } from "@heswell/salt-lab";
|
|
2
|
+
import { ReactElement } from "react";
|
|
3
|
+
import "./PaletteSalt.css";
|
|
4
|
+
export interface PaletteListItemProps extends ListItemProps {
|
|
5
|
+
children: ReactElement;
|
|
6
|
+
ViewProps: {
|
|
7
|
+
header?: boolean;
|
|
8
|
+
closeable?: boolean;
|
|
9
|
+
resizeable?: boolean;
|
|
10
|
+
};
|
|
11
|
+
template: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare const PaletteListItem: (props: PaletteListItemProps) => JSX.Element;
|
|
14
|
+
export declare const PaletteSalt: ({ className, ...props }: ListProps) => JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { HTMLAttributes } from "react";
|
|
2
|
+
import "./Placeholder.css";
|
|
3
|
+
export interface PlaceholderProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
closeable?: boolean;
|
|
5
|
+
flexFill?: boolean;
|
|
6
|
+
resizeable?: boolean;
|
|
7
|
+
shim?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const Placeholder: {
|
|
10
|
+
({ className, closeable, flexFill, resizeable, shim, ...props }: PlaceholderProps): JSX.Element;
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Placeholder';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FunctionComponent } from "react";
|
|
2
|
+
export type layoutComponentType = "component" | "container" | "view";
|
|
3
|
+
export interface ComponentWithId {
|
|
4
|
+
id: string;
|
|
5
|
+
[key: string]: unknown;
|
|
6
|
+
}
|
|
7
|
+
export declare const ComponentRegistry: {
|
|
8
|
+
[key: string]: FunctionComponent<ComponentWithId>;
|
|
9
|
+
};
|
|
10
|
+
export declare function isContainer(componentType: string): boolean;
|
|
11
|
+
export declare function isView(componentType: string): boolean;
|
|
12
|
+
export declare const isLayoutComponent: (type: string) => boolean;
|
|
13
|
+
export declare const isRegistered: (className: string) => boolean;
|
|
14
|
+
export declare function registerComponent(componentName: string, component: FunctionComponent<any>, type?: layoutComponentType): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ComponentRegistry';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { BreakPointsProp } from "../flexbox/flexboxTypes";
|
|
2
|
+
export type BreakPointRamp = [string, number, number];
|
|
3
|
+
export declare const breakpointRamp: (breakpoints: BreakPointsProp) => BreakPointRamp[];
|
|
4
|
+
export declare const getBreakPoints: (themeName?: string) => BreakPointRamp[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function measureMinimumNodeSize(node: HTMLElement, dimension?: 'width' | 'height'): number;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { RefObject } from "react";
|
|
2
|
+
import { BreakPointsProp } from "../flexbox/flexboxTypes";
|
|
3
|
+
export interface BreakpointsHookProps {
|
|
4
|
+
breakPoints?: BreakPointsProp;
|
|
5
|
+
smallerThan?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const useBreakpoints: ({ breakPoints: breakPointsProp, smallerThan }: BreakpointsHookProps, ref: RefObject<HTMLElement>) => string | boolean;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
export declare const WidthHeight: string[];
|
|
3
|
+
export declare const HeightOnly: string[];
|
|
4
|
+
export declare const WidthOnly: string[];
|
|
5
|
+
export type measurements<T = string | number> = {
|
|
6
|
+
height?: T;
|
|
7
|
+
scrollHeight?: T;
|
|
8
|
+
scrollWidth?: T;
|
|
9
|
+
width?: T;
|
|
10
|
+
};
|
|
11
|
+
export type ResizeHandler = (measurements: measurements<number>) => void;
|
|
12
|
+
export declare function useResizeObserver(ref: RefObject<Element | HTMLElement | null>, dimensions: string[], onResize: ResizeHandler, reportInitialSize?: boolean): void;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { TabstripProps } from "@heswell/salt-lab";
|
|
2
|
+
import { HTMLAttributes, MouseEvent, ReactElement, ReactNode } from "react";
|
|
3
|
+
export interface StackProps extends Omit<HTMLAttributes<HTMLDivElement>, "onMouseDown"> {
|
|
4
|
+
active?: number;
|
|
5
|
+
createNewChild?: (index: number) => ReactElement;
|
|
6
|
+
enableAddTab?: boolean;
|
|
7
|
+
enableCloseTabs?: boolean;
|
|
8
|
+
getTabIcon?: (component: ReactElement, index: number) => string | undefined;
|
|
9
|
+
getTabLabel?: (component: ReactElement, index: number) => string | undefined;
|
|
10
|
+
keyBoardActivation?: "automatic" | "manual";
|
|
11
|
+
onMouseDown?: (e: MouseEvent, tabIndex: number) => void;
|
|
12
|
+
onTabAdd?: (tabIndex: number) => void;
|
|
13
|
+
onTabClose?: (tabIndex: number) => void;
|
|
14
|
+
onTabEdit?: (tabIndex: number, label: string) => void;
|
|
15
|
+
onTabSelectionChanged?: (nextIndex: number) => void;
|
|
16
|
+
path?: string;
|
|
17
|
+
showTabs?: boolean;
|
|
18
|
+
toolbarContent?: ReactNode;
|
|
19
|
+
TabstripProps?: Partial<TabstripProps>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
import './TabPanel.css';
|
|
3
|
+
export interface TabPanelProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
ariaLabelledBy: string;
|
|
5
|
+
}
|
|
6
|
+
declare const TabPanel: ({ ariaLabelledBy, children, id }: TabPanelProps) => JSX.Element;
|
|
7
|
+
export default TabPanel;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as TabPanel } from './TabPanel';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ConfigWrapper';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export function XXXnormalizeStyles(layoutStyle?: {}, visualStyle?: {}): {};
|
|
2
|
+
export namespace MARGIN_STYLES {
|
|
3
|
+
const margin: boolean;
|
|
4
|
+
const marginTop: boolean;
|
|
5
|
+
const marginRight: boolean;
|
|
6
|
+
const marginBottom: boolean;
|
|
7
|
+
const marginLeft: boolean;
|
|
8
|
+
}
|
|
9
|
+
export namespace PADDING_STYLES {
|
|
10
|
+
const padding: boolean;
|
|
11
|
+
const paddingTop: boolean;
|
|
12
|
+
const paddingRight: boolean;
|
|
13
|
+
const paddingBottom: boolean;
|
|
14
|
+
const paddingLeft: boolean;
|
|
15
|
+
}
|
|
16
|
+
export namespace BORDER_STYLES {
|
|
17
|
+
const border: boolean;
|
|
18
|
+
const borderColor: boolean;
|
|
19
|
+
const borderWidth: boolean;
|
|
20
|
+
const borderTopWidth: boolean;
|
|
21
|
+
const borderRightWidth: boolean;
|
|
22
|
+
const borderBottomWidth: boolean;
|
|
23
|
+
const borderLeftWidth: boolean;
|
|
24
|
+
}
|
|
25
|
+
export function LayoutConfigurator({ height, managedStyle, onChange, style, width, }: {
|
|
26
|
+
height: any;
|
|
27
|
+
managedStyle: any;
|
|
28
|
+
onChange: any;
|
|
29
|
+
style: any;
|
|
30
|
+
width: any;
|
|
31
|
+
}): JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const getPersistentState: (id: string) => any;
|
|
2
|
+
export declare const hasPersistentState: (id: string) => boolean;
|
|
3
|
+
export declare const setPersistentState: (id: string, value: any) => Map<string, any>;
|
|
4
|
+
export declare const usePersistentState: () => {
|
|
5
|
+
loadSessionState: (id: any, key: any) => any;
|
|
6
|
+
loadState: (id: string, key?: string) => any;
|
|
7
|
+
saveSessionState: (id: any, key: any, data: any) => void;
|
|
8
|
+
saveState: (id: string, key: string | undefined, data: unknown) => void;
|
|
9
|
+
purgeState: (id: string, key?: string) => void;
|
|
10
|
+
purgeSessionState: (id: string, key?: string) => void;
|
|
11
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React, { ReactElement } from "react";
|
|
2
|
+
import { LayoutModel } from "../layout-reducer";
|
|
3
|
+
export declare function followPathToParent(source: ReactElement, path: string): ReactElement | null;
|
|
4
|
+
export declare function findTarget(source: LayoutModel, test: (props: any) => boolean): LayoutModel | undefined;
|
|
5
|
+
export declare function containerOf(source: LayoutModel, target: LayoutModel): LayoutModel | null;
|
|
6
|
+
export declare const getChild: (children: ReactElement[], idx: number) => ReactElement | undefined;
|
|
7
|
+
export declare function followPathToComponent(component: ReactElement, path: string): React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
|
|
8
|
+
export declare function followPath(source: LayoutModel, path: string): LayoutModel | undefined;
|
|
9
|
+
export declare function followPath(source: ReactElement, path: string, throwIfNotFound: true): ReactElement;
|
|
10
|
+
export declare function nextLeaf(root: ReactElement, path: string): any;
|
|
11
|
+
export declare function previousLeaf(root: ReactElement, path: string): any;
|
|
12
|
+
type NextStepResult = {
|
|
13
|
+
idx: number;
|
|
14
|
+
finalStep: boolean;
|
|
15
|
+
};
|
|
16
|
+
export declare function nextStep(pathSoFar: string, targetPath: string, followPathToEnd?: boolean): NextStepResult;
|
|
17
|
+
export declare function resetPath(model: ReactElement, path: string, additionalProps?: any): ReactElement;
|
|
18
|
+
export {};
|