@aptre/flex-layout 0.6.0 → 0.6.1

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.
@@ -1,2 +1 @@
1
- import * as React from "react";
2
- export declare function BorderTab(props: IBorderTabProps): React.JSX.Element;
1
+ export declare function BorderTab(props: IBorderTabProps): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,6 @@
1
- import * as React from "react";
2
- export declare const CloseIcon: () => React.JSX.Element;
3
- export declare const MaximizeIcon: () => React.JSX.Element;
4
- export declare const OverflowIcon: () => React.JSX.Element;
5
- export declare const EdgeIcon: () => React.JSX.Element;
6
- export declare const RestoreIcon: () => React.JSX.Element;
7
- export declare const AsterickIcon: () => React.JSX.Element;
1
+ export declare const CloseIcon: () => import("react/jsx-runtime").JSX.Element;
2
+ export declare const MaximizeIcon: () => import("react/jsx-runtime").JSX.Element;
3
+ export declare const OverflowIcon: () => import("react/jsx-runtime").JSX.Element;
4
+ export declare const EdgeIcon: () => import("react/jsx-runtime").JSX.Element;
5
+ export declare const RestoreIcon: () => import("react/jsx-runtime").JSX.Element;
6
+ export declare const AsterickIcon: () => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
- import * as React from "react";
1
+ import { Component, DragEvent as ReactDragEvent, MouseEvent as ReactMouseEvent, ReactNode } from "react";
2
2
  import { I18nLabel } from "../I18nLabel";
3
3
  import { Action } from "../model/Action";
4
4
  import { BorderNode } from "../model/BorderNode";
@@ -11,7 +11,7 @@ export interface ILayoutProps {
11
11
  /** the model for this layout */
12
12
  model: Model;
13
13
  /** factory function for creating the tab components */
14
- factory: (node: TabNode) => React.ReactNode;
14
+ factory: (node: TabNode) => ReactNode;
15
15
  /** object mapping keys among close, maximize, restore, more to React nodes to use in place of the default icons, can alternatively return functions for creating the React nodes */
16
16
  icons?: IIcons;
17
17
  /** function called whenever the layout generates an action to update the model (allows for intercepting actions before they are dispatched to the model, for example, asking the user to confirm a tab close.) Returning undefined from the function will halt the action, otherwise return the action to continue */
@@ -23,9 +23,9 @@ export interface ILayoutProps {
23
23
  /** function called when model has changed */
24
24
  onModelChange?: (model: Model, action: Action) => void;
25
25
  /** function called when an external object (not a tab) gets dragged onto the layout, with a single dragenter argument. Should return either undefined to reject the drag/drop or an object with keys dragText, jsonDrop, to create a tab via drag (similar to a call to addTabToTabSet). Function onDropis passed the added tabNodeand thedrop DragEvent`, unless the drag was canceled. */
26
- onExternalDrag?: (event: React.DragEvent<HTMLElement>) => undefined | {
26
+ onExternalDrag?: (event: ReactDragEvent<HTMLElement>) => undefined | {
27
27
  json: IJsonTabNode;
28
- onDrop?: (node?: Node, event?: React.DragEvent<HTMLElement>) => void;
28
+ onDrop?: (node?: Node, event?: ReactDragEvent<HTMLElement>) => void;
29
29
  };
30
30
  /** function called with default css class name, return value is class name that will be used. Mainly for use with css modules. */
31
31
  classNameMapper?: (defaultClassName: string) => string;
@@ -49,7 +49,7 @@ export interface ILayoutProps {
49
49
  /**
50
50
  * A React component that hosts a multi-tabbed layout
51
51
  */
52
- export declare class Layout extends React.Component<ILayoutProps> {
52
+ export declare class Layout extends Component<ILayoutProps> {
53
53
  /** re-render the layout */
54
54
  redraw(): void;
55
55
  /**
@@ -67,7 +67,7 @@ export declare class Layout extends React.Component<ILayoutProps> {
67
67
  * @param json the json for the new tab node
68
68
  * @param onDrop a callback to call when the drag is complete
69
69
  */
70
- addTabWithDragAndDrop(event: DragEvent, json: IJsonTabNode, onDrop?: (node?: Node, event?: React.DragEvent<HTMLElement>) => void): void;
70
+ addTabWithDragAndDrop(event: DragEvent, json: IJsonTabNode, onDrop?: (node?: Node, event?: ReactDragEvent<HTMLElement>) => void): void;
71
71
  /**
72
72
  * Move a tab/tabset using drag and drop, must be called from within an HTML
73
73
  * drag start handler
@@ -88,26 +88,26 @@ export declare class Layout extends React.Component<ILayoutProps> {
88
88
  * @param x the x position of the drag cursor on the image
89
89
  * @param y the x position of the drag cursor on the image
90
90
  */
91
- setDragComponent(event: DragEvent, component: React.ReactNode, x: number, y: number): void;
91
+ setDragComponent(event: DragEvent, component: ReactNode, x: number, y: number): void;
92
92
  /** Get the root div element of the layout */
93
93
  getRootDiv(): HTMLDivElement | null;
94
94
  }
95
95
  export declare const FlexLayoutVersion = "0.8.1";
96
- export type DragRectRenderCallback = (content: React.ReactNode | undefined, node?: Node, json?: IJsonTabNode) => React.ReactNode | undefined;
97
- export type NodeMouseEvent = (node: TabNode | TabSetNode | BorderNode, event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
98
- export type ShowOverflowMenuCallback = (node: TabSetNode | BorderNode, mouseEvent: React.MouseEvent<HTMLElement, MouseEvent>, items: {
96
+ export type DragRectRenderCallback = (content: ReactNode | undefined, node?: Node, json?: IJsonTabNode) => ReactNode | undefined;
97
+ export type NodeMouseEvent = (node: TabNode | TabSetNode | BorderNode, event: ReactMouseEvent<HTMLElement>) => void;
98
+ export type ShowOverflowMenuCallback = (node: TabSetNode | BorderNode, mouseEvent: ReactMouseEvent<HTMLElement>, items: {
99
99
  index: number;
100
100
  node: TabNode;
101
101
  }[], onSelect: (item: {
102
102
  index: number;
103
103
  node: TabNode;
104
104
  }) => void) => void;
105
- export type TabSetPlaceHolderCallback = (node: TabSetNode) => React.ReactNode;
105
+ export type TabSetPlaceHolderCallback = (node: TabSetNode) => ReactNode;
106
106
  export interface ITabSetRenderValues {
107
107
  /** components that will be added after the tabs */
108
- stickyButtons: React.ReactNode[];
108
+ stickyButtons: ReactNode[];
109
109
  /** components that will be added at the end of the tabset */
110
- buttons: React.ReactNode[];
110
+ buttons: ReactNode[];
111
111
  /** position to insert overflow button within [...stickyButtons, ...buttons]
112
112
  * if left undefined position will be after the sticky buttons (if any)
113
113
  */
@@ -115,21 +115,21 @@ export interface ITabSetRenderValues {
115
115
  }
116
116
  export interface ITabRenderValues {
117
117
  /** the icon or other leading component */
118
- leading: React.ReactNode;
118
+ leading: ReactNode;
119
119
  /** the main tab text/component */
120
- content: React.ReactNode;
120
+ content: ReactNode;
121
121
  /** a set of react components to add to the tab after the content */
122
- buttons: React.ReactNode[];
122
+ buttons: ReactNode[];
123
123
  }
124
124
  export interface IIcons {
125
- close?: React.ReactNode | ((tabNode: TabNode) => React.ReactNode);
126
- closeTabset?: React.ReactNode | ((tabSetNode: TabSetNode) => React.ReactNode);
127
- maximize?: React.ReactNode | ((tabSetNode: TabSetNode) => React.ReactNode);
128
- restore?: React.ReactNode | ((tabSetNode: TabSetNode) => React.ReactNode);
129
- more?: React.ReactNode | ((tabSetNode: TabSetNode | BorderNode, hiddenTabs: {
125
+ close?: ReactNode | ((tabNode: TabNode) => ReactNode);
126
+ closeTabset?: ReactNode | ((tabSetNode: TabSetNode) => ReactNode);
127
+ maximize?: ReactNode | ((tabSetNode: TabSetNode) => ReactNode);
128
+ restore?: ReactNode | ((tabSetNode: TabSetNode) => ReactNode);
129
+ more?: ReactNode | ((tabSetNode: TabSetNode | BorderNode, hiddenTabs: {
130
130
  node: TabNode;
131
131
  index: number;
132
- }[]) => React.ReactNode);
133
- edgeArrow?: React.ReactNode;
134
- activeTabset?: React.ReactNode | ((tabSetNode: TabSetNode) => React.ReactNode);
132
+ }[]) => ReactNode);
133
+ edgeArrow?: ReactNode;
134
+ activeTabset?: ReactNode | ((tabSetNode: TabSetNode) => ReactNode);
135
135
  }
@@ -1,4 +1,4 @@
1
- import * as React from "react";
1
+ import { ReactNode } from "react";
2
2
  import { TabNode } from "../model/TabNode";
3
3
  import { ILayoutProps } from "./Layout";
4
4
  /**
@@ -6,7 +6,7 @@ import { ILayoutProps } from "./Layout";
6
6
  */
7
7
  export interface IOptimizedLayoutProps extends Omit<ILayoutProps, "factory"> {
8
8
  /** Function to render tab content - receives TabNode, returns React element */
9
- renderTab: (node: TabNode) => React.ReactNode;
9
+ renderTab: (node: TabNode) => ReactNode;
10
10
  }
11
11
  /**
12
12
  * OptimizedLayout - A wrapper around FlexLayout that renders tab content outside of
@@ -26,4 +26,4 @@ export interface IOptimizedLayoutProps extends Omit<ILayoutProps, "factory"> {
26
26
  *
27
27
  * @see https://github.com/caplin/FlexLayout/issues/456
28
28
  */
29
- export declare function OptimizedLayout({ model, renderTab, classNameMapper, onDragStateChange, onModelChange: userOnModelChange, ...layoutProps }: IOptimizedLayoutProps): React.JSX.Element;
29
+ export declare function OptimizedLayout({ model, renderTab, classNameMapper, onDragStateChange, onModelChange: userOnModelChange, ...layoutProps }: IOptimizedLayoutProps): import("react/jsx-runtime").JSX.Element;
@@ -1,10 +1,10 @@
1
- import * as React from "react";
1
+ import { ReactNode } from "react";
2
2
  import { Rect } from "../Rect";
3
3
  export interface ISizeTrackerProps {
4
4
  rect: Rect;
5
5
  selected: boolean;
6
6
  forceRevision: number;
7
7
  tabsRevision: number;
8
- children: React.ReactNode;
8
+ children: ReactNode;
9
9
  }
10
- export declare const SizeTracker: React.MemoExoticComponent<({ children }: ISizeTrackerProps) => React.JSX.Element>;
10
+ export declare const SizeTracker: import("react").MemoExoticComponent<({ children }: ISizeTrackerProps) => import("react/jsx-runtime").JSX.Element>;
@@ -1,5 +1,5 @@
1
- import * as React from "react";
1
+ import { PointerEvent as ReactPointerEvent } from "react";
2
2
  export declare function enablePointerOnIFrames(enable: boolean, currentDocument: Document): void;
3
3
  export declare function getElementsByTagName(tag: string, currentDocument: Document): Element[];
4
- export declare function startDrag(doc: Document, event: React.PointerEvent<HTMLElement>, drag: (x: number, y: number) => void, dragEnd: () => void, dragCancel: () => void): void;
4
+ export declare function startDrag(doc: Document, event: ReactPointerEvent<HTMLElement>, drag: (x: number, y: number) => void, dragEnd: () => void, dragCancel: () => void): void;
5
5
  export declare function isSafari(): boolean;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@aptre/flex-layout",
3
3
  "author": "Caplin Systems Ltd",
4
4
  "description": "A multi-tab docking layout manager",
5
- "version": "0.6.0",
5
+ "version": "0.6.1",
6
6
  "license": "ISC",
7
7
  "homepage": "https://flexlayout.spacewave.app",
8
8
  "repository": {
@@ -95,7 +95,6 @@
95
95
  "@testing-library/jest-dom": "^6.9.1",
96
96
  "@testing-library/react": "^16.3.2",
97
97
  "@types/node": "^25.2.3",
98
- "@types/prismjs": "^1.26.0",
99
98
  "@types/react": "^19.2.13",
100
99
  "@types/react-dom": "^19.0.0",
101
100
  "@typescript-eslint/eslint-plugin": "^8.55.0",
@@ -112,7 +111,6 @@
112
111
  "jsdom": "^28.0.0",
113
112
  "playwright": "^1.58.2",
114
113
  "prettier": "^3.8.1",
115
- "prismjs": "^1.28.0",
116
114
  "react": "^19.2.4",
117
115
  "react-dom": "^19.2.4",
118
116
  "rimraf": "^6.0.1",
package/tsconfig.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "target": "ES2022",
4
4
  "module": "ESNext",
5
5
  "moduleResolution": "bundler",
6
- "jsx": "react",
6
+ "jsx": "react-jsx",
7
7
  "outDir": "./dist/",
8
8
  "sourceMap": true,
9
9
  "noImplicitAny": true,