@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vuu-ui/vuu-layout",
3
- "version": "0.6.5",
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.5",
12
- "@vuu-ui/vuu-utils": "0.6.5",
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"
@@ -4,5 +4,5 @@ export interface rect {
4
4
  right: number;
5
5
  top: number;
6
6
  }
7
- export declare type rectTuple = [number, number, number, number];
8
- export declare type dimension = 'width' | 'height';
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 declare type IntrinsicSizes = {
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
- declare type DragConstraint = {
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 declare type DragStartCallback = (e: MouseEvent, x: number, y: number) => void;
6
- export declare type DragMoveCallback = (x: number | undefined, y: number | undefined) => void;
7
- export declare type DragEndCallback = (droppedTarget: Partial<DropTarget>) => void;
8
- export declare type DragInstructions = {
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;
@@ -10,7 +10,7 @@ export interface DropTargetProps {
10
10
  clientRect: DragDropRect;
11
11
  nextDropTarget: DropTarget | null;
12
12
  }
13
- export declare type GuideLine = [
13
+ export type GuideLine = [
14
14
  number,
15
15
  number,
16
16
  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
- declare type Point = [number, number];
6
- declare type TabMode = "full-view" | "tab-only";
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 declare type RelativePosition = 'after' | 'before';
37
- export declare type DropPosTab = {
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 declare type SplitterDragStartHandler = (index: number) => void;
4
- export declare type SplitterDragHandler = (index: number, distance: number) => void;
5
- export declare type SplitterDragEndHandler = () => void;
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 declare type SplitterFactory = (index: number) => ReactElement<SplitterProps>;
32
- export declare type ContentMeta = {
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 declare type FlexSize = {
43
+ export type FlexSize = {
44
44
  size: number;
45
45
  minSize: number;
46
46
  };
47
- export declare type BreakPoint = "xs" | "sm" | "md" | "lg" | "xl";
48
- export declare type BreakPoints = BreakPoint[];
49
- export declare type BreakPointsProp = {
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
- declare type LayoutChangeHandler = (layout: LayoutJSON, source: string) => void;
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 declare type LayoutProviderDispatch = Dispatch<LayoutReducerAction | SaveAction | DragStartAction>;
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 declare type flexDirection = "row" | "column";
5
- declare type contraDimension = dimension;
6
- declare type flexDimensionTuple = [dimension, contraDimension, flexDirection];
7
- export declare type position = {
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
- declare type insertionPosition = "before" | "after";
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 declare type LayoutModel = LayoutRoot | ReactElement | WithType;
32
- export declare type layoutType = "Flexbox" | "View" | "DraggableLayout" | "Stack";
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 declare type AddAction = {
48
+ export type AddAction = {
49
49
  component: any;
50
50
  path: string;
51
51
  type: typeof LayoutActionType.ADD;
52
52
  };
53
- export declare type DragDropAction = {
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 declare type MaximizeAction = {
59
+ export type MaximizeAction = {
60
60
  path?: string;
61
61
  type: typeof LayoutActionType.MAXIMIZE;
62
62
  };
63
- export declare type MinimizeAction = {
63
+ export type MinimizeAction = {
64
64
  path?: string;
65
65
  type: typeof LayoutActionType.MINIMIZE;
66
66
  };
67
- export declare type RemoveAction = {
67
+ export type RemoveAction = {
68
68
  path?: string;
69
69
  type: typeof LayoutActionType.REMOVE;
70
70
  };
71
- export declare type ReplaceAction = {
71
+ export type ReplaceAction = {
72
72
  replacement: any;
73
73
  target: any;
74
74
  type: typeof LayoutActionType.REPLACE;
75
75
  };
76
- export declare type RestoreAction = {
76
+ export type RestoreAction = {
77
77
  path?: string;
78
78
  type: typeof LayoutActionType.RESTORE;
79
79
  };
80
- export declare type SetTitleAction = {
80
+ export type SetTitleAction = {
81
81
  path: string;
82
82
  title: string;
83
83
  type: typeof LayoutActionType.SET_TITLE;
84
84
  };
85
- export declare type SplitterResizeAction = {
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 declare type SwitchTabAction = {
93
+ export type SwitchTabAction = {
94
94
  nextIdx: number;
95
95
  path: string;
96
96
  type: typeof LayoutActionType.SWITCH_TAB;
97
97
  };
98
- export declare type TearoutAction = {
98
+ export type TearoutAction = {
99
99
  path?: string;
100
100
  type: typeof LayoutActionType.TEAROUT;
101
101
  };
102
- export declare type LayoutReducerAction = AddAction | DragDropAction | MaximizeAction | MinimizeAction | RemoveAction | ReplaceAction | RestoreAction | SetTitleAction | SplitterResizeAction | SwitchTabAction;
103
- export declare type SaveAction = {
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 declare type AddToolbarContributionViewAction = {
106
+ export type AddToolbarContributionViewAction = {
107
107
  content: ReactElement;
108
108
  location: string;
109
109
  type: "add-toolbar-contribution";
110
110
  };
111
- export declare type RemoveToolbarContributionViewAction = {
111
+ export type RemoveToolbarContributionViewAction = {
112
112
  location: string;
113
113
  type: "remove-toolbar-contribution";
114
114
  };
115
- export declare type MousedownViewAction = {
115
+ export type MousedownViewAction = {
116
116
  preDragActivity?: any;
117
117
  index?: number;
118
118
  type: "mousedown";
119
119
  };
120
- export declare type DragStartAction = {
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 declare type ViewDispatch = <Action extends ViewAction = ViewAction>(action: Action, evt?: SyntheticEvent) => Promise<boolean | void>;
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,6 +1,6 @@
1
1
  import { ReactElement, RefObject } from "react";
2
2
  import { ViewDispatch } from "./ViewContext";
3
- export declare type Contribution = {
3
+ export type Contribution = {
4
4
  index?: number;
5
5
  location?: string;
6
6
  content: ReactElement;
@@ -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 declare type ViewAction = MaximizeAction | MinimizeAction | MousedownViewAction | RemoveAction | RestoreAction | TearoutAction | AddToolbarContributionViewAction | RemoveToolbarContributionViewAction;
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 declare type layoutComponentType = "component" | "container" | "view";
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 declare type BreakPointRamp = [string, number, number];
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 declare type measurements<T = string | number> = {
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 declare type ResizeHandler = (measurements: measurements<number>) => void;
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;
@@ -1,5 +1,5 @@
1
1
  export declare const isResponsiveAttribute: (propName: string) => boolean;
2
- declare type Props = {
2
+ type Props = {
3
3
  [key: string]: any;
4
4
  };
5
5
  export declare const extractResponsiveProps: (props: Props) => [Props, Props];
@@ -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
- declare type NextStepResult = {
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 declare type CSSFlexProperties = Pick<CSSProperties, 'flexBasis' | 'flexGrow' | 'flexShrink'>;
2
+ export type CSSFlexProperties = Pick<CSSProperties, 'flexBasis' | 'flexGrow' | 'flexShrink'>;
3
3
  export declare const expandFlex: (flex: number | CSSFlexProperties) => CSSFlexProperties;