@vuu-ui/vuu-layout 0.8.67 → 0.8.68

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 (32) hide show
  1. package/cjs/drag-drop/BoxModel.js.map +1 -1
  2. package/cjs/drag-drop/Draggable.js.map +1 -1
  3. package/cjs/drag-drop/DropTarget.js.map +1 -1
  4. package/cjs/layout-provider/LayoutProvider.js.map +1 -1
  5. package/cjs/layout-reducer/insert-layout-element.js.map +1 -1
  6. package/cjs/layout-reducer/layoutTypes.js.map +1 -1
  7. package/cjs/layout-reducer/layoutUtils.js.map +1 -1
  8. package/cjs/layout-reducer/wrap-layout-element.js.map +1 -1
  9. package/cjs/utils/pathUtils.js.map +1 -1
  10. package/cjs/utils/propUtils.js.map +1 -1
  11. package/cjs/utils/typeOf.js.map +1 -1
  12. package/esm/drag-drop/BoxModel.js.map +1 -1
  13. package/esm/drag-drop/Draggable.js.map +1 -1
  14. package/esm/drag-drop/DropTarget.js.map +1 -1
  15. package/esm/layout-provider/LayoutProvider.js.map +1 -1
  16. package/esm/layout-reducer/insert-layout-element.js.map +1 -1
  17. package/esm/layout-reducer/layoutTypes.js.map +1 -1
  18. package/esm/layout-reducer/layoutUtils.js.map +1 -1
  19. package/esm/layout-reducer/wrap-layout-element.js.map +1 -1
  20. package/esm/utils/pathUtils.js.map +1 -1
  21. package/esm/utils/propUtils.js.map +1 -1
  22. package/esm/utils/typeOf.js.map +1 -1
  23. package/package.json +8 -9
  24. package/types/drag-drop/BoxModel.d.ts +1 -1
  25. package/types/drag-drop/DropTarget.d.ts +1 -2
  26. package/types/layout-provider/LayoutProvider.d.ts +2 -1
  27. package/types/layout-reducer/insert-layout-element.d.ts +1 -1
  28. package/types/layout-reducer/layoutTypes.d.ts +2 -50
  29. package/types/layout-reducer/layoutUtils.d.ts +2 -2
  30. package/types/utils/pathUtils.d.ts +1 -1
  31. package/types/utils/propUtils.d.ts +1 -1
  32. package/types/utils/typeOf.d.ts +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"typeOf.js","sources":["../../src/utils/typeOf.ts"],"sourcesContent":["import { ReactElement } from 'react';\nimport { LayoutJSON, LayoutModel, WithType } from '../layout-reducer';\n\nexport function typeOf(element?: LayoutModel | WithType): string | undefined {\n if (element) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const type = element.type as any;\n if (typeof type === 'function' || typeof type === 'object') {\n const elementName = type.displayName || type.name || type.type?.name;\n if (typeof elementName === 'string') {\n return elementName;\n }\n }\n if (typeof element.type === 'string') {\n return element.type;\n }\n if (element.constructor) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return (element.constructor as any).displayName as string;\n }\n throw Error(`typeOf unable to determine type of element`);\n }\n}\n\nexport const isTypeOf = (element: ReactElement, type: string) => typeOf(element) === type;\n\nexport const isLayoutJSON = (layout: LayoutJSON): layout is LayoutJSON =>\n layout !== undefined && \"type\" in layout;\n"],"names":[],"mappings":"AAGO,SAAS,OAAO,OAAsD,EAAA;AAC3E,EAAA,IAAI,OAAS,EAAA;AAEX,IAAA,MAAM,OAAO,OAAQ,CAAA,IAAA,CAAA;AACrB,IAAA,IAAI,OAAO,IAAA,KAAS,UAAc,IAAA,OAAO,SAAS,QAAU,EAAA;AAC1D,MAAA,MAAM,cAAc,IAAK,CAAA,WAAA,IAAe,IAAK,CAAA,IAAA,IAAQ,KAAK,IAAM,EAAA,IAAA,CAAA;AAChE,MAAI,IAAA,OAAO,gBAAgB,QAAU,EAAA;AACnC,QAAO,OAAA,WAAA,CAAA;AAAA,OACT;AAAA,KACF;AACA,IAAI,IAAA,OAAO,OAAQ,CAAA,IAAA,KAAS,QAAU,EAAA;AACpC,MAAA,OAAO,OAAQ,CAAA,IAAA,CAAA;AAAA,KACjB;AACA,IAAA,IAAI,QAAQ,WAAa,EAAA;AAEvB,MAAA,OAAQ,QAAQ,WAAoB,CAAA,WAAA,CAAA;AAAA,KACtC;AACA,IAAA,MAAM,MAAM,CAA4C,0CAAA,CAAA,CAAA,CAAA;AAAA,GAC1D;AACF,CAAA;AAEO,MAAM,WAAW,CAAC,OAAA,EAAuB,IAAiB,KAAA,MAAA,CAAO,OAAO,CAAM,KAAA,KAAA;AAE9E,MAAM,YAAe,GAAA,CAAC,MAC3B,KAAA,MAAA,KAAW,UAAa,MAAU,IAAA;;;;"}
1
+ {"version":3,"file":"typeOf.js","sources":["../../src/utils/typeOf.ts"],"sourcesContent":["import { LayoutJSON, LayoutModel, WithType } from \"@vuu-ui/vuu-utils\";\nimport { ReactElement } from \"react\";\n\nexport function typeOf(element?: LayoutModel | WithType): string | undefined {\n if (element) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const type = element.type as any;\n if (typeof type === \"function\" || typeof type === \"object\") {\n const elementName = type.displayName || type.name || type.type?.name;\n if (typeof elementName === \"string\") {\n return elementName;\n }\n }\n if (typeof element.type === \"string\") {\n return element.type;\n }\n if (element.constructor) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return (element.constructor as any).displayName as string;\n }\n throw Error(`typeOf unable to determine type of element`);\n }\n}\n\nexport const isTypeOf = (element: ReactElement, type: string) =>\n typeOf(element) === type;\n\nexport const isLayoutJSON = (layout: LayoutJSON): layout is LayoutJSON =>\n layout !== undefined && \"type\" in layout;\n"],"names":[],"mappings":"AAGO,SAAS,OAAO,OAAsD,EAAA;AAC3E,EAAA,IAAI,OAAS,EAAA;AAEX,IAAA,MAAM,OAAO,OAAQ,CAAA,IAAA,CAAA;AACrB,IAAA,IAAI,OAAO,IAAA,KAAS,UAAc,IAAA,OAAO,SAAS,QAAU,EAAA;AAC1D,MAAA,MAAM,cAAc,IAAK,CAAA,WAAA,IAAe,IAAK,CAAA,IAAA,IAAQ,KAAK,IAAM,EAAA,IAAA,CAAA;AAChE,MAAI,IAAA,OAAO,gBAAgB,QAAU,EAAA;AACnC,QAAO,OAAA,WAAA,CAAA;AAAA,OACT;AAAA,KACF;AACA,IAAI,IAAA,OAAO,OAAQ,CAAA,IAAA,KAAS,QAAU,EAAA;AACpC,MAAA,OAAO,OAAQ,CAAA,IAAA,CAAA;AAAA,KACjB;AACA,IAAA,IAAI,QAAQ,WAAa,EAAA;AAEvB,MAAA,OAAQ,QAAQ,WAAoB,CAAA,WAAA,CAAA;AAAA,KACtC;AACA,IAAA,MAAM,MAAM,CAA4C,0CAAA,CAAA,CAAA,CAAA;AAAA,GAC1D;AACF,CAAA;AAEO,MAAM,WAAW,CAAC,OAAA,EAAuB,IAC9C,KAAA,MAAA,CAAO,OAAO,CAAM,KAAA,KAAA;AAEf,MAAM,YAAe,GAAA,CAAC,MAC3B,KAAA,MAAA,KAAW,UAAa,MAAU,IAAA;;;;"}
package/package.json CHANGED
@@ -1,23 +1,22 @@
1
1
  {
2
- "version": "0.8.67",
2
+ "version": "0.8.68",
3
3
  "description": "VUU Layout Components",
4
4
  "author": "heswell",
5
5
  "license": "Apache-2.0",
6
6
  "types": "types/index.d.ts",
7
7
  "devDependencies": {
8
- "@vuu-ui/vuu-data-types": "0.8.67",
9
- "@vuu-ui/vuu-filter-types": "0.8.67"
8
+ "@vuu-ui/vuu-data-types": "0.8.68",
9
+ "@vuu-ui/vuu-filter-types": "0.8.68"
10
10
  },
11
11
  "dependencies": {
12
12
  "@salt-ds/core": "1.27.1",
13
13
  "@salt-ds/styles": "0.2.1",
14
14
  "@salt-ds/window": "0.1.1",
15
- "@vuu-ui/vuu-data-types": "0.8.67",
16
- "@vuu-ui/vuu-filters": "0.8.67",
17
- "@vuu-ui/vuu-popups": "0.8.67",
18
- "@vuu-ui/vuu-table": "0.8.67",
19
- "@vuu-ui/vuu-ui-controls": "0.8.67",
20
- "@vuu-ui/vuu-utils": "0.8.67"
15
+ "@vuu-ui/vuu-filters": "0.8.68",
16
+ "@vuu-ui/vuu-popups": "0.8.68",
17
+ "@vuu-ui/vuu-table": "0.8.68",
18
+ "@vuu-ui/vuu-ui-controls": "0.8.68",
19
+ "@vuu-ui/vuu-utils": "0.8.68"
21
20
  },
22
21
  "peerDependencies": {
23
22
  "clsx": "^2.0.0",
@@ -1,5 +1,5 @@
1
1
  import { ReactElement } from "react";
2
- import { LayoutModel } from "../layout-reducer";
2
+ import { LayoutModel } from "@vuu-ui/vuu-utils";
3
3
  import { DragDropRect, DropPos, RelativePosition } from "./dragDropTypes";
4
4
  export declare const positionValues: {
5
5
  north: number;
@@ -1,5 +1,4 @@
1
- import { rectTuple } from "@vuu-ui/vuu-utils";
2
- import { LayoutModel } from "../layout-reducer";
1
+ import { LayoutModel, rectTuple } from "@vuu-ui/vuu-utils";
3
2
  import { Measurements } from "./BoxModel";
4
3
  import { DragDropRect, DropPos, DropPosTab } from "./dragDropTypes";
5
4
  import { DragState } from "./DragState";
@@ -1,5 +1,6 @@
1
+ import type { LayoutJSON } from "@vuu-ui/vuu-utils";
1
2
  import { ReactElement } from "react";
2
- import { type LayoutChangeHandler, type LayoutJSON } from "../layout-reducer";
3
+ import { type LayoutChangeHandler } from "../layout-reducer";
3
4
  import { LayoutProviderDispatch } from "./LayoutProviderContext";
4
5
  export interface LayoutProviderProps {
5
6
  children: ReactElement;
@@ -1,6 +1,6 @@
1
+ import { LayoutModel } from "@vuu-ui/vuu-utils";
1
2
  import { ReactElement } from "react";
2
3
  import { DropPos } from "../drag-drop";
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;
@@ -1,55 +1,7 @@
1
- import { NamedFilter } from "@vuu-ui/vuu-filter-types";
2
- import { CSSProperties, ReactElement } from "react";
1
+ import { LayoutJSON } from "@vuu-ui/vuu-utils";
2
+ import { ReactElement } from "react";
3
3
  import { DragDropRect, DragInstructions } from "../drag-drop";
4
4
  import { DropTarget } from "../drag-drop/DropTarget";
5
- export interface WithProps {
6
- props?: {
7
- [key: string]: any;
8
- };
9
- }
10
- export interface WithType {
11
- props?: any;
12
- title?: string;
13
- type: string;
14
- }
15
- export interface LayoutRoot extends WithProps {
16
- active?: number;
17
- children?: ReactElement[];
18
- type: string;
19
- }
20
- export type ValueOf<T> = T[keyof T];
21
- export interface ApplicationSettings {
22
- leftNav?: {
23
- activeTabIndex: number;
24
- expanded: boolean;
25
- };
26
- /**
27
- * filters are keyed by MODULE:tablename
28
- */
29
- filters?: {
30
- [key: string]: NamedFilter[];
31
- };
32
- }
33
- export type ApplicationSetting = ValueOf<ApplicationSettings>;
34
- export interface ApplicationJSON {
35
- layout: LayoutJSON;
36
- settings?: ApplicationSettings;
37
- }
38
- export interface LayoutJSON extends WithType {
39
- active?: number;
40
- children?: LayoutJSON[];
41
- id?: string;
42
- props?: {
43
- [key: string]: any;
44
- };
45
- state?: any;
46
- type: string;
47
- style?: CSSProperties;
48
- }
49
- export interface WithActive {
50
- active?: number;
51
- }
52
- export type LayoutModel = LayoutRoot | ReactElement | WithType;
53
5
  export type layoutType = "Flexbox" | "View" | "DraggableLayout" | "Stack";
54
6
  export declare const LayoutActionType: {
55
7
  readonly ADD: "add";
@@ -1,7 +1,7 @@
1
- import { dimension } from "@vuu-ui/vuu-utils";
1
+ import { LayoutJSON, LayoutModel, dimension } from "@vuu-ui/vuu-utils";
2
2
  import React, { CSSProperties, ReactElement } from "react";
3
3
  import { TabLabelFactory } from "../stack";
4
- import { LayoutJSON, LayoutModel, layoutType } from "./layoutTypes";
4
+ import { layoutType } from "./layoutTypes";
5
5
  interface ComponentWithId {
6
6
  id: string;
7
7
  [key: string]: unknown;
@@ -1,5 +1,5 @@
1
+ import { LayoutJSON, LayoutModel } from "@vuu-ui/vuu-utils";
1
2
  import React, { ReactElement } from "react";
2
- import { LayoutJSON, LayoutModel } from "../layout-reducer";
3
3
  /**
4
4
  * This is a very specific function at the moment. It resolves a path of the form
5
5
  * '#{componentid}.ACTIVE_CHILD'
@@ -1,5 +1,5 @@
1
1
  import { ReactElement } from "react";
2
- import { LayoutModel } from "../layout-reducer";
2
+ import { LayoutModel } from "@vuu-ui/vuu-utils";
3
3
  export declare const getProp: (component: LayoutModel | undefined, propName: string) => any;
4
4
  export declare const getProps: (component?: LayoutModel) => any;
5
5
  export declare const getChildProp: (container: LayoutModel) => ReactElement<any, string | import("react").JSXElementConstructor<any>> | undefined;
@@ -1,5 +1,5 @@
1
- import { ReactElement } from 'react';
2
- import { LayoutJSON, LayoutModel, WithType } from '../layout-reducer';
1
+ import { LayoutJSON, LayoutModel, WithType } from "@vuu-ui/vuu-utils";
2
+ import { ReactElement } from "react";
3
3
  export declare function typeOf(element?: LayoutModel | WithType): string | undefined;
4
4
  export declare const isTypeOf: (element: ReactElement, type: string) => boolean;
5
5
  export declare const isLayoutJSON: (layout: LayoutJSON) => layout is LayoutJSON;