@vuu-ui/vuu-layout 0.13.4 → 0.13.5

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.
Files changed (79) hide show
  1. package/package.json +14 -12
  2. package/types/Component.d.ts +6 -0
  3. package/types/LayoutContainer.d.ts +6 -0
  4. package/types/debug.d.ts +2 -0
  5. package/types/dock-layout/DockLayout.d.ts +7 -0
  6. package/types/dock-layout/Drawer.d.ts +17 -0
  7. package/types/dock-layout/index.d.ts +2 -0
  8. package/types/drag-drop/BoxModel.d.ts +143 -0
  9. package/types/drag-drop/DragState.d.ts +46 -0
  10. package/types/drag-drop/Draggable.d.ts +24 -0
  11. package/types/drag-drop/DropTarget.d.ts +60 -0
  12. package/types/drag-drop/DropTargetRenderer.d.ts +17 -0
  13. package/types/drag-drop/dragDropTypes.d.ts +51 -0
  14. package/types/drag-drop/index.d.ts +3 -0
  15. package/types/flexbox/Flexbox.d.ts +3 -0
  16. package/types/flexbox/FlexboxLayout.d.ts +5 -0
  17. package/types/flexbox/Splitter.d.ts +12 -0
  18. package/types/flexbox/flexbox-utils.d.ts +12 -0
  19. package/types/flexbox/flexboxTypes.d.ts +52 -0
  20. package/types/flexbox/index.d.ts +2 -0
  21. package/types/flexbox/useSplitterResizing.d.ts +2 -0
  22. package/types/index.d.ts +17 -0
  23. package/types/layout-action.d.ts +19 -0
  24. package/types/layout-header/ActionButton.d.ts +8 -0
  25. package/types/layout-header/Header.d.ts +15 -0
  26. package/types/layout-header/index.d.ts +1 -0
  27. package/types/layout-header/useHeader.d.ts +20 -0
  28. package/types/layout-provider/LayoutProvider.d.ts +20 -0
  29. package/types/layout-provider/LayoutProviderContext.d.ts +15 -0
  30. package/types/layout-provider/index.d.ts +2 -0
  31. package/types/layout-provider/useLayoutDragDrop.d.ts +4 -0
  32. package/types/layout-reducer/flexUtils.d.ts +22 -0
  33. package/types/layout-reducer/index.d.ts +4 -0
  34. package/types/layout-reducer/insert-layout-element.d.ts +8 -0
  35. package/types/layout-reducer/layout-reducer.d.ts +3 -0
  36. package/types/layout-reducer/layoutTypes.d.ts +135 -0
  37. package/types/layout-reducer/layoutUtils.d.ts +44 -0
  38. package/types/layout-reducer/move-layout-element.d.ts +3 -0
  39. package/types/layout-reducer/remove-layout-element.d.ts +3 -0
  40. package/types/layout-reducer/replace-layout-element.d.ts +6 -0
  41. package/types/layout-reducer/resize-flex-children.d.ts +4 -0
  42. package/types/layout-reducer/wrap-layout-element.d.ts +9 -0
  43. package/types/layout-view/View.d.ts +10 -0
  44. package/types/layout-view/index.d.ts +3 -0
  45. package/types/layout-view/useView.d.ts +22 -0
  46. package/types/layout-view/useViewBroadcastChannel.d.ts +7 -0
  47. package/types/layout-view/useViewResize.d.ts +7 -0
  48. package/types/layout-view/viewTypes.d.ts +48 -0
  49. package/types/layout-view-actions/ViewContext.d.ts +37 -0
  50. package/types/layout-view-actions/index.d.ts +2 -0
  51. package/types/layout-view-actions/useViewActionDispatcher.d.ts +4 -0
  52. package/types/palette/Palette.d.ts +24 -0
  53. package/types/palette/index.d.ts +1 -0
  54. package/types/placeholder/LayoutStartPanel.d.ts +5 -0
  55. package/types/placeholder/Placeholder.d.ts +16 -0
  56. package/types/placeholder/index.d.ts +1 -0
  57. package/types/responsive/index.d.ts +2 -0
  58. package/types/responsive/measureMinimumNodeSize.d.ts +1 -0
  59. package/types/responsive/overflowUtils.d.ts +2 -0
  60. package/types/responsive/useResizeObserver.d.ts +13 -0
  61. package/types/responsive/utils.d.ts +6 -0
  62. package/types/stack/Stack.d.ts +3 -0
  63. package/types/stack/StackLayout.d.ts +5 -0
  64. package/types/stack/index.d.ts +3 -0
  65. package/types/stack/stackTypes.d.ts +24 -0
  66. package/types/tabs/TabPanel.d.ts +7 -0
  67. package/types/tabs/index.d.ts +1 -0
  68. package/types/tools/config-wrapper/ConfigWrapper.d.ts +1 -0
  69. package/types/tools/config-wrapper/index.d.ts +1 -0
  70. package/types/tools/devtools-box/layout-configurator.d.ts +31 -0
  71. package/types/tools/devtools-tree/layout-tree-viewer.d.ts +5 -0
  72. package/types/tools/index.d.ts +3 -0
  73. package/types/use-persistent-state.d.ts +11 -0
  74. package/types/utils/index.d.ts +5 -0
  75. package/types/utils/pathUtils.d.ts +31 -0
  76. package/types/utils/propUtils.d.ts +5 -0
  77. package/types/utils/refUtils.d.ts +2 -0
  78. package/types/utils/styleUtils.d.ts +3 -0
  79. package/types/utils/typeOf.d.ts +5 -0
@@ -0,0 +1,15 @@
1
+ import { Dispatch, ReactElement } from "react";
2
+ import { DragStartAction, LayoutReducerAction, QueryAction } from "../layout-reducer";
3
+ import { SaveAction } from "../layout-view";
4
+ import { LayoutJSON } from "@vuu-ui/vuu-utils";
5
+ export declare const isUnconfiguredProperty: (property: unknown) => boolean;
6
+ export type LayoutProviderDispatch = Dispatch<LayoutReducerAction | SaveAction | DragStartAction | QueryAction>;
7
+ export interface LayoutProviderContextProps {
8
+ addComponentToWorkspace: (component: ReactElement) => void;
9
+ createNewChild?: (index?: number) => ReactElement;
10
+ dispatchLayoutProvider: LayoutProviderDispatch;
11
+ showComponentInContextPanel: (component: ReactElement | LayoutJSON, title?: string, onContextPanelClose?: () => void) => void;
12
+ switchWorkspace: (idx: number) => void;
13
+ version: number;
14
+ }
15
+ export declare const LayoutProviderContext: import("react").Context<LayoutProviderContextProps>;
@@ -0,0 +1,2 @@
1
+ export * from './LayoutProvider';
2
+ export * from './LayoutProviderContext';
@@ -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, pathToDropTarget?: string) => (action: DragStartAction) => void;
@@ -0,0 +1,22 @@
1
+ import { dimension, rect, rectTuple } from "@vuu-ui/vuu-utils";
2
+ import React, { CSSProperties, ReactElement, ReactNode } from "react";
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;
14
+ width?: number;
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,4 @@
1
+ export * from './flexUtils';
2
+ export * from './layout-reducer';
3
+ export * from './layoutTypes';
4
+ export * from './layoutUtils';
@@ -0,0 +1,8 @@
1
+ import { LayoutModel } from "@vuu-ui/vuu-utils";
2
+ import { ReactElement } from "react";
3
+ import { DropPos } from "../drag-drop";
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[]): 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,3 @@
1
+ import { ReactElement } from "react";
2
+ import { LayoutReducerAction } from "./layoutTypes";
3
+ export declare const layoutReducer: (state: ReactElement, action: LayoutReducerAction) => ReactElement;
@@ -0,0 +1,135 @@
1
+ import { LayoutJSON } from "@vuu-ui/vuu-utils";
2
+ import { ReactElement } from "react";
3
+ import { DragDropRect, DragInstructions } from "../drag-drop";
4
+ import { DropTarget } from "../drag-drop/DropTarget";
5
+ export type layoutType = "Flexbox" | "View" | "LayoutContainer" | "Stack";
6
+ export declare const LayoutActionType: {
7
+ readonly ADD: "add";
8
+ readonly DRAG_START: "drag-start";
9
+ readonly DRAG_DROP: "drag-drop";
10
+ readonly LAYOUT_RESIZE: "layout-resize";
11
+ readonly MAXIMIZE: "maximize";
12
+ readonly MINIMIZE: "minimize";
13
+ readonly MOVE_CHILD: "move-child";
14
+ readonly QUERY: "query";
15
+ readonly REMOVE: "remove";
16
+ readonly REPLACE: "replace";
17
+ readonly RESTORE: "restore";
18
+ readonly SET_PROP: "set-prop";
19
+ readonly SET_PROPS: "set-props";
20
+ readonly SET_TITLE: "set-title";
21
+ readonly SPLITTER_RESIZE: "splitter-resize";
22
+ readonly SWITCH_TAB: "switch-tab";
23
+ readonly TEAROUT: "tearout";
24
+ };
25
+ export type AddAction = {
26
+ component: any;
27
+ path: string;
28
+ type: typeof LayoutActionType.ADD;
29
+ };
30
+ export type DragDropAction = {
31
+ draggedReactElement: ReactElement;
32
+ dragInstructions: any;
33
+ dropTarget: Partial<DropTarget>;
34
+ type: typeof LayoutActionType.DRAG_DROP;
35
+ };
36
+ export type MaximizeAction = {
37
+ path?: string;
38
+ type: typeof LayoutActionType.MAXIMIZE;
39
+ };
40
+ export type CollapseAction = {
41
+ path?: string;
42
+ type: "collapse";
43
+ };
44
+ export type ExpandAction = {
45
+ path?: string;
46
+ type: "expand";
47
+ };
48
+ export type MoveChildAction = {
49
+ fromIndex: number;
50
+ toIndex: number;
51
+ path: string;
52
+ type: typeof LayoutActionType.MOVE_CHILD;
53
+ };
54
+ export type QueryAction = {
55
+ path?: string;
56
+ query: string;
57
+ type: typeof LayoutActionType.QUERY;
58
+ };
59
+ export type RemoveAction = {
60
+ path?: string;
61
+ type: typeof LayoutActionType.REMOVE;
62
+ };
63
+ export type ReplaceAction = {
64
+ replacement: any;
65
+ target: any;
66
+ type: typeof LayoutActionType.REPLACE;
67
+ };
68
+ export type RestoreAction = {
69
+ path?: string;
70
+ type: typeof LayoutActionType.RESTORE;
71
+ };
72
+ export type SetPropAction = {
73
+ path: string;
74
+ propName: string;
75
+ propValue: string | number | boolean;
76
+ type: typeof LayoutActionType.SET_PROP;
77
+ };
78
+ export type SetPropsAction = {
79
+ path: string;
80
+ props: {
81
+ [key: string]: unknown;
82
+ };
83
+ type: typeof LayoutActionType.SET_PROPS;
84
+ };
85
+ export type SetTitleAction = {
86
+ path: string;
87
+ title: string;
88
+ type: typeof LayoutActionType.SET_TITLE;
89
+ };
90
+ export type SplitterResizeAction = {
91
+ path: string;
92
+ sizes: {
93
+ currentSize: number;
94
+ flexBasis: number;
95
+ }[];
96
+ type: typeof LayoutActionType.SPLITTER_RESIZE;
97
+ };
98
+ export type LayoutResizeAction = {
99
+ path: string;
100
+ size: number;
101
+ type: typeof LayoutActionType.LAYOUT_RESIZE;
102
+ };
103
+ export type SwitchTabAction = {
104
+ id?: string;
105
+ nextIdx: number;
106
+ path: string;
107
+ type: typeof LayoutActionType.SWITCH_TAB;
108
+ };
109
+ export type TearoutAction = {
110
+ path?: string;
111
+ type: typeof LayoutActionType.TEAROUT;
112
+ };
113
+ export type LayoutReducerAction = AddAction | DragDropAction | LayoutResizeAction | CollapseAction | ExpandAction | MoveChildAction | RemoveAction | ReplaceAction | RestoreAction | SetPropAction | SetPropsAction | SetTitleAction | SplitterResizeAction | SwitchTabAction;
114
+ export type MousedownViewAction = {
115
+ preDragActivity?: unknown;
116
+ index?: number;
117
+ type: "mousedown";
118
+ };
119
+ export type DragStartAction = {
120
+ payload?: ReactElement;
121
+ dragContainerPath?: string;
122
+ dragElement?: HTMLElement;
123
+ dragRect: DragDropRect;
124
+ dropTargets?: string[];
125
+ evt: MouseEvent;
126
+ instructions?: DragInstructions;
127
+ path: string;
128
+ type: typeof LayoutActionType.DRAG_START;
129
+ };
130
+ export type LayoutLevelChange = "add-component" | "drag-drop-operation" | "edit-feature-title" | "remove-component" | "resize-component" | "switch-active-tab" | "save-feature-props";
131
+ export type ApplicationLevelChange = "switch-active-layout" | "open-layout" | "close-layout" | "rename-layout" | "resize-application-chrome";
132
+ export type LayoutChangeReason = LayoutLevelChange | ApplicationLevelChange;
133
+ export type LayoutChangeHandler = (layout: LayoutJSON, layoutChangeReason: LayoutChangeReason) => void;
134
+ export declare const isApplicationLevelChange: (layoutChangeReason: LayoutChangeReason) => layoutChangeReason is ApplicationLevelChange;
135
+ export declare const isLayoutLevelChange: (layoutChangeReason: LayoutChangeReason) => layoutChangeReason is LayoutLevelChange;
@@ -0,0 +1,44 @@
1
+ import { LayoutJSON, LayoutModel, dimension } from "@vuu-ui/vuu-utils";
2
+ import React, { CSSProperties, ReactElement } from "react";
3
+ import { TabLabelFactory } from "../stack";
4
+ import { layoutType } from "./layoutTypes";
5
+ interface ComponentWithId {
6
+ id: string;
7
+ [key: string]: unknown;
8
+ }
9
+ export declare const getManagedDimension: (style: CSSProperties) => [dimension, dimension];
10
+ export declare const applyLayoutProps: (component: ReactElement, path?: string) => React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
11
+ export interface LayoutProps extends ComponentWithId {
12
+ active?: number;
13
+ "data-path"?: string;
14
+ children?: ReactElement[];
15
+ column?: boolean;
16
+ dropTarget?: boolean;
17
+ key: string;
18
+ layout?: LayoutJSON;
19
+ path?: string;
20
+ resizeable?: boolean;
21
+ style: CSSProperties;
22
+ type?: string;
23
+ version?: number;
24
+ }
25
+ /**
26
+ * parse the declarative JSX and clone adding layout attributes
27
+ */
28
+ export declare const cloneElementAddLayoutProps: (layoutElement: ReactElement, previousLayout?: ReactElement) => ReactElement;
29
+ export declare const applyLayout: (type: layoutType, props: LayoutProps, previousLayout?: LayoutModel) => LayoutModel;
30
+ export declare function layoutFromJson({ active, id, type, children, props, state }: LayoutJSON, path: string): ReactElement;
31
+ export declare function layoutToJSON(component: ReactElement): LayoutJSON<{
32
+ [key: string]: any;
33
+ }>;
34
+ export declare function componentToJson(component: ReactElement): LayoutJSON;
35
+ export declare function serializeProps(props?: LayoutProps): {
36
+ [key: string]: any;
37
+ } | undefined;
38
+ export type LayoutQuery = "PARENT_CONTAINER";
39
+ export declare const layoutQuery: (query: LayoutQuery, path?: string, layoutRoot?: ReactElement) => {
40
+ parentContainerId: any;
41
+ parentContainerType: string | undefined;
42
+ } | undefined;
43
+ export declare const getDefaultTabLabel: TabLabelFactory;
44
+ export {};
@@ -0,0 +1,3 @@
1
+ import { ReactElement } from "react";
2
+ import { MoveChildAction } from "./layoutTypes";
3
+ export declare function moveChild(layoutRoot: ReactElement, { fromIndex, path, toIndex }: MoveChildAction): ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
@@ -0,0 +1,3 @@
1
+ import React, { ReactElement } from "react";
2
+ import { RemoveAction } from "./layoutTypes";
3
+ export declare function removeChild(layoutRoot: ReactElement, { path }: RemoveAction): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
@@ -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<unknown, string | React.JSXElementConstructor<any>>;
5
+ export declare function _replaceChild(model: ReactElement, child: ReactElement, replacement: ReactElement<LayoutProps>): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
6
+ export declare function swapChild(model: ReactElement, child: ReactElement, replacement: ReactElement, op?: "collapse" | "expand"): ReactElement;
@@ -0,0 +1,4 @@
1
+ import React, { ReactElement } from "react";
2
+ import { LayoutResizeAction, SplitterResizeAction } from "./layoutTypes";
3
+ export declare function resizeFlexChild(layoutRoot: ReactElement, { path, size }: LayoutResizeAction): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
4
+ export declare function resizeFlexChildren(layoutRoot: ReactElement, { path, sizes }: SplitterResizeAction): React.ReactElement<unknown, 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: ReactElement, newComponent: any, pos: DropPos, clientRect?: DropTarget["clientRect"], dropRect?: DropTarget["dropRect"]): ReactElement;
@@ -0,0 +1,10 @@
1
+ import { ForwardedRef, ReactElement } from "react";
2
+ import { ViewProps } from "./viewTypes";
3
+ interface ViewComponentType {
4
+ (props: ViewProps & {
5
+ ref?: ForwardedRef<HTMLDivElement>;
6
+ }): ReactElement<ViewProps>;
7
+ displayName?: string;
8
+ }
9
+ declare const MemoView: ViewComponentType;
10
+ export { MemoView as View };
@@ -0,0 +1,3 @@
1
+ export * from "./useViewBroadcastChannel";
2
+ export * from "./View";
3
+ export * from "./viewTypes";
@@ -0,0 +1,22 @@
1
+ import { RefObject } from "react";
2
+ import { ConfigChangeHandler } from "../layout-view-actions";
3
+ export interface ViewHookProps {
4
+ id: string;
5
+ rootRef: RefObject<HTMLDivElement | null>;
6
+ path?: string;
7
+ dropTargets?: string[];
8
+ title?: string;
9
+ }
10
+ export declare const useView: ({ id, rootRef, path, dropTargets, title: titleProp, }: ViewHookProps) => {
11
+ contributions: import("./viewTypes").Contribution[] | undefined;
12
+ dispatchViewAction: import("../layout-view-actions").ViewDispatch;
13
+ load: (key?: string) => any;
14
+ loadSession: (key?: string) => any;
15
+ onConfigChange: ConfigChangeHandler;
16
+ onEditTitle: (title: string) => void;
17
+ purge: (key: string) => void;
18
+ restoredState: any;
19
+ save: (state: unknown, key: string) => void;
20
+ saveSession: (state: unknown, key: string) => void;
21
+ title: any;
22
+ };
@@ -0,0 +1,7 @@
1
+ export interface ViewBroadcastMessage {
2
+ path?: string;
3
+ targetId?: string;
4
+ type: "highlight-on" | "highlight-off" | "layout-closed";
5
+ }
6
+ export type BroadcastMessageHandler = (message: ViewBroadcastMessage) => void;
7
+ export declare const useViewBroadcastChannel: (id?: string, path?: string, onMessageReceived?: BroadcastMessageHandler) => (message: ViewBroadcastMessage) => void;
@@ -0,0 +1,7 @@
1
+ import { RefObject } from "react";
2
+ export interface ViewResizeHookProps {
3
+ mainRef: RefObject<HTMLDivElement | null>;
4
+ resize?: "defer" | "responsive";
5
+ rootRef: RefObject<HTMLDivElement | null>;
6
+ }
7
+ export declare const useViewResize: ({ mainRef, resize, rootRef, }: ViewResizeHookProps) => void;
@@ -0,0 +1,48 @@
1
+ import { CSSProperties, FunctionComponent, HTMLAttributes, ReactElement } from "react";
2
+ import { HeaderProps } from "../layout-header";
3
+ import { MaximizeAction, CollapseAction, ExpandAction, MousedownViewAction, QueryAction, RemoveAction, RestoreAction, TearoutAction } from "../layout-reducer";
4
+ import { ViewBroadcastMessage } from "./useViewBroadcastChannel";
5
+ export type SaveAction = {
6
+ type: "save";
7
+ };
8
+ export type ContributionLocation = "post-title" | "pre-title";
9
+ export type Contribution = {
10
+ index?: number;
11
+ location?: ContributionLocation;
12
+ content: ReactElement;
13
+ };
14
+ export type AddToolbarContributionViewAction = {
15
+ content: ReactElement;
16
+ location: ContributionLocation;
17
+ type: "add-toolbar-contribution";
18
+ };
19
+ export type RemoveToolbarContributionViewAction = {
20
+ location: ContributionLocation;
21
+ type: "remove-toolbar-contribution";
22
+ };
23
+ export type BroadcastMessageViewAction = {
24
+ type: "broadcast-message";
25
+ message: ViewBroadcastMessage;
26
+ };
27
+ export type ViewAction = BroadcastMessageViewAction | MaximizeAction | CollapseAction | ExpandAction | MousedownViewAction | QueryAction | RemoveAction | RestoreAction | TearoutAction | AddToolbarContributionViewAction | RemoveToolbarContributionViewAction;
28
+ export type ResizeStrategy = "defer" | "responsive";
29
+ export interface ViewProps extends HTMLAttributes<HTMLDivElement> {
30
+ Header?: FunctionComponent<HeaderProps>;
31
+ allowRename?: boolean;
32
+ closeable?: boolean;
33
+ collapsed?: boolean;
34
+ "data-path"?: string;
35
+ "data-resizeable"?: boolean;
36
+ dropTargets?: string[];
37
+ expanded?: boolean;
38
+ flexFill?: boolean;
39
+ header?: boolean | Partial<HeaderProps>;
40
+ onCollapse?: () => void;
41
+ onExpand?: () => void;
42
+ orientation?: "vertical" | "horizontal";
43
+ path?: string;
44
+ resize?: ResizeStrategy;
45
+ resizeable?: boolean;
46
+ restoreStyle?: CSSProperties;
47
+ tearOut?: boolean;
48
+ }
@@ -0,0 +1,37 @@
1
+ import React, { SyntheticEvent } from "react";
2
+ import type { ViewAction } from "../layout-view";
3
+ export type QueryReponse = {
4
+ [key: string]: unknown;
5
+ };
6
+ export type ConfigChangeHandler = (config: {
7
+ [key: string]: unknown;
8
+ type: string;
9
+ }) => void;
10
+ export type ViewDispatch = <Action extends ViewAction = ViewAction>(action: Action, evt?: SyntheticEvent) => Promise<boolean | QueryReponse | void>;
11
+ /**
12
+ * This API is available to any Feature hosted within Vuu (as all Features are wrapped
13
+ * with View component). It offers metadata about the View as well as access to the
14
+ * Vuu persistencew API;
15
+ */
16
+ export interface ViewContextAPI {
17
+ /**
18
+ * dispatcher for View actions. These are a subset of LayoutActions, specifically for
19
+ * View manipulation
20
+ */
21
+ dispatch?: ViewDispatch | null;
22
+ id?: string;
23
+ load?: <T = unknown>(key?: string) => T;
24
+ loadSession?: (key?: string) => unknown;
25
+ onConfigChange?: ConfigChangeHandler;
26
+ path?: string;
27
+ purge?: (key: string) => void;
28
+ save?: (state: unknown, key: string) => void;
29
+ saveSession?: (state: unknown, key: string) => void;
30
+ setComponentProps: (props: {
31
+ [key: string]: unknown;
32
+ }) => void;
33
+ title?: string;
34
+ }
35
+ export declare const ViewContext: React.Context<ViewContextAPI>;
36
+ export declare const useViewDispatch: () => ViewDispatch | null;
37
+ export declare const useViewContext: () => ViewContextAPI;
@@ -0,0 +1,2 @@
1
+ export * from "./useViewActionDispatcher";
2
+ export * from "./ViewContext";
@@ -0,0 +1,4 @@
1
+ import { RefObject } from "react";
2
+ import { ViewDispatch } from "./ViewContext";
3
+ import type { Contribution } from "../layout-view";
4
+ export declare const useViewActionDispatcher: (id: string, rootRef: RefObject<HTMLDivElement | null>, viewPath?: string, dropTargets?: string[]) => [ViewDispatch, Contribution[] | undefined];
@@ -0,0 +1,24 @@
1
+ import { ListBoxProps, OptionProps } from "@salt-ds/core";
2
+ import { HTMLAttributes, ReactElement } from "react";
3
+ import { ViewProps } from "../layout-view";
4
+ export interface PaletteItemProps extends OptionProps {
5
+ /**
6
+ * This is the payload that will be created when the
7
+ * palette item is dropped
8
+ */
9
+ component: ReactElement;
10
+ closeable?: boolean;
11
+ header?: boolean;
12
+ idx?: number;
13
+ resize?: "defer";
14
+ resizeable?: boolean;
15
+ }
16
+ export declare const PaletteItem: import("react").MemoExoticComponent<({ className, component, idx, key, resizeable, header, closeable, ...props }: PaletteItemProps) => import("react/jsx-runtime").JSX.Element>;
17
+ export interface PaletteProps extends Omit<HTMLAttributes<HTMLDivElement>, "onDragStart" | "onDrop" | "onSelect"> {
18
+ ListBoxProps?: Partial<ListBoxProps>;
19
+ ViewProps?: Partial<ViewProps>;
20
+ children: ReactElement[];
21
+ orientation: "horizontal" | "vertical";
22
+ selection?: string;
23
+ }
24
+ export declare const Palette: ({ ListBoxProps, ViewProps, children, className, orientation, ...props }: PaletteProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from "./Palette";
@@ -0,0 +1,5 @@
1
+ import { HTMLAttributes } from "react";
2
+ export interface LayoutStartPanelProps extends HTMLAttributes<HTMLDivElement> {
3
+ label?: string;
4
+ }
5
+ export declare const LayoutStartPanel: (htmlAttributes: LayoutStartPanelProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,16 @@
1
+ import type { ViewProps } from "../layout-view/viewTypes";
2
+ export interface PlaceholderProps extends ViewProps {
3
+ closeable?: boolean;
4
+ flexFill?: boolean;
5
+ resizeable?: boolean;
6
+ showStartMenu?: boolean;
7
+ /**
8
+ * shim is only when we're dealing with intrinsically sized children, which is never
9
+ * in an actual application. Intrinsic sizing is still experimental.
10
+ */
11
+ shim?: boolean;
12
+ }
13
+ export declare const Placeholder: {
14
+ ({ className: classNameProp, showStartMenu, ...viewProps }: PlaceholderProps): import("react/jsx-runtime").JSX.Element;
15
+ displayName: string;
16
+ };
@@ -0,0 +1 @@
1
+ export * from './Placeholder';
@@ -0,0 +1,2 @@
1
+ export * from "./useResizeObserver";
2
+ export * from "./utils";
@@ -0,0 +1 @@
1
+ export declare function measureMinimumNodeSize(node: HTMLElement, dimension?: 'width' | 'height'): number;
@@ -0,0 +1,2 @@
1
+ export function getOverflowedItems(containerRef: any, height?: number): any[][];
2
+ export function findFirstOverflow(elements: any, height: any): number;
@@ -0,0 +1,13 @@
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 const resizeObserver: ResizeObserver;
13
+ export declare function useResizeObserver(ref: RefObject<Element | HTMLElement | null>, dimensions: string[], onResize: ResizeHandler, reportInitialSize?: boolean): void;
@@ -0,0 +1,6 @@
1
+ export declare const isResponsiveAttribute: (propName: string) => boolean;
2
+ type Props = {
3
+ [key: string]: any;
4
+ };
5
+ export declare const extractResponsiveProps: (props: Props) => [Props, Props];
6
+ export {};
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ import { StackProps } from "./stackTypes";
3
+ export declare const Stack: React.ForwardRefExoticComponent<StackProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,5 @@
1
+ import { StackProps } from "./stackTypes";
2
+ export declare const StackLayout: {
3
+ (props: StackProps): import("react/jsx-runtime").JSX.Element;
4
+ displayName: string;
5
+ };
@@ -0,0 +1,3 @@
1
+ export * from "./Stack";
2
+ export * from "./StackLayout";
3
+ export * from "./stackTypes";
@@ -0,0 +1,24 @@
1
+ import { TabstripProps } from "@vuu-ui/vuu-ui-controls";
2
+ import { HTMLAttributes, MouseEvent, ReactElement, ReactNode } from "react";
3
+ export type TabLabelFactory = (component: ReactElement, index: number, existingLabels: string[]) => string;
4
+ export interface SerializableStackProps {
5
+ active?: number;
6
+ /** should the Stack display a Tabstrip and where ? default top */
7
+ showTabs?: false | TabPosition;
8
+ }
9
+ export type TabPosition = "top" | "left" | "right" | "bottom";
10
+ export interface StackProps extends SerializableStackProps, Omit<HTMLAttributes<HTMLDivElement>, "onMouseDown"> {
11
+ TabstripProps?: Partial<TabstripProps>;
12
+ createNewChild?: (index: number) => ReactElement;
13
+ getTabIcon?: (component: ReactElement, index: number) => string | undefined;
14
+ getTabLabel?: TabLabelFactory;
15
+ keyBoardActivation?: "automatic" | "manual";
16
+ onAddTab?: () => void;
17
+ onMoveTab?: (fromIndex: number, toIndex: number) => void;
18
+ onMouseDown?: (e: MouseEvent, tabIndex: number) => void;
19
+ onTabClose?: (tabIndex: number) => void;
20
+ onTabEdit?: (tabIndex: number, label: string) => void;
21
+ onTabSelectionChanged?: (nextIndex: number) => void;
22
+ path?: string;
23
+ toolbarContent?: ReactNode;
24
+ }
@@ -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) => import("react/jsx-runtime").JSX.Element;
7
+ export default TabPanel;
@@ -0,0 +1 @@
1
+ export { default as TabPanel } from './TabPanel';
@@ -0,0 +1 @@
1
+ export declare const ConfigWrapper: ({ children }: any) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './ConfigWrapper';
@@ -0,0 +1,31 @@
1
+ export function XXXnormalizeStyles(layoutStyle?: {}, visualStyle?: {}): {};
2
+ export namespace MARGIN_STYLES {
3
+ let margin: boolean;
4
+ let marginTop: boolean;
5
+ let marginRight: boolean;
6
+ let marginBottom: boolean;
7
+ let marginLeft: boolean;
8
+ }
9
+ export namespace PADDING_STYLES {
10
+ let padding: boolean;
11
+ let paddingTop: boolean;
12
+ let paddingRight: boolean;
13
+ let paddingBottom: boolean;
14
+ let paddingLeft: boolean;
15
+ }
16
+ export namespace BORDER_STYLES {
17
+ let border: boolean;
18
+ let borderColor: boolean;
19
+ let borderWidth: boolean;
20
+ let borderTopWidth: boolean;
21
+ let borderRightWidth: boolean;
22
+ let borderBottomWidth: boolean;
23
+ let 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
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ export function LayoutTreeViewer({ layout, onSelect: _, style }: {
2
+ layout: any;
3
+ onSelect: any;
4
+ style: any;
5
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export * from './config-wrapper';
2
+ export * from './devtools-box/layout-configurator';
3
+ export * from './devtools-tree/layout-tree-viewer';