dockview 1.7.0 → 1.7.2
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/LICENSE +21 -0
- package/README.md +50 -52
- package/dist/cjs/dockview/defaultTab.d.ts +5 -4
- package/dist/cjs/dockview/defaultTab.d.ts.map +1 -0
- package/dist/cjs/dockview/defaultTab.js +72 -72
- package/dist/cjs/dockview/dockview.d.ts +36 -32
- package/dist/cjs/dockview/dockview.d.ts.map +1 -0
- package/dist/cjs/dockview/dockview.js +196 -210
- package/dist/cjs/dockview/dockview.js.map +1 -1
- package/dist/cjs/dockview/groupControlsRenderer.d.ts +33 -32
- package/dist/cjs/dockview/groupControlsRenderer.d.ts.map +1 -0
- package/dist/cjs/dockview/groupControlsRenderer.js +86 -86
- package/dist/cjs/dockview/reactContentPart.d.ts +23 -22
- package/dist/cjs/dockview/reactContentPart.d.ts.map +1 -0
- package/dist/cjs/dockview/reactContentPart.js +50 -50
- package/dist/cjs/dockview/reactHeaderPart.d.ts +19 -18
- package/dist/cjs/dockview/reactHeaderPart.d.ts.map +1 -0
- package/dist/cjs/dockview/reactHeaderPart.js +43 -43
- package/dist/cjs/dockview/reactWatermarkPart.d.ts +25 -24
- package/dist/cjs/dockview/reactWatermarkPart.d.ts.map +1 -0
- package/dist/cjs/dockview/reactWatermarkPart.js +53 -53
- package/dist/cjs/gridview/gridview.d.ts +23 -22
- package/dist/cjs/gridview/gridview.d.ts.map +1 -0
- package/dist/cjs/gridview/gridview.js +96 -109
- package/dist/cjs/gridview/gridview.js.map +1 -1
- package/dist/cjs/gridview/view.d.ts +11 -10
- package/dist/cjs/gridview/view.d.ts.map +1 -0
- package/dist/cjs/gridview/view.js +39 -39
- package/dist/cjs/index.d.ts +11 -10
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +24 -24
- package/dist/cjs/paneview/paneview.d.ts +25 -24
- package/dist/cjs/paneview/paneview.d.ts.map +1 -0
- package/dist/cjs/paneview/paneview.js +139 -153
- package/dist/cjs/paneview/paneview.js.map +1 -1
- package/dist/cjs/paneview/view.d.ts +20 -19
- package/dist/cjs/paneview/view.d.ts.map +1 -0
- package/dist/cjs/paneview/view.js +44 -44
- package/dist/cjs/react.d.ts +36 -35
- package/dist/cjs/react.d.ts.map +1 -0
- package/dist/cjs/react.js +196 -196
- package/dist/cjs/splitview/splitview.d.ts +23 -22
- package/dist/cjs/splitview/splitview.d.ts.map +1 -0
- package/dist/cjs/splitview/splitview.js +91 -105
- package/dist/cjs/splitview/splitview.js.map +1 -1
- package/dist/cjs/splitview/view.d.ts +11 -10
- package/dist/cjs/splitview/view.d.ts.map +1 -0
- package/dist/cjs/splitview/view.js +39 -39
- package/dist/cjs/svg.d.ts +4 -3
- package/dist/cjs/svg.d.ts.map +1 -0
- package/dist/cjs/svg.js +35 -35
- package/dist/cjs/types.d.ts +8 -7
- package/dist/cjs/types.d.ts.map +1 -0
- package/dist/cjs/types.js +2 -2
- package/dist/dockview.amd.js +7037 -7091
- package/dist/dockview.amd.min.js +2 -2
- package/dist/dockview.amd.min.noStyle.js +2 -2
- package/dist/dockview.amd.noStyle.js +7035 -7089
- package/dist/dockview.cjs.js +7037 -7091
- package/dist/dockview.esm.js +7040 -7094
- package/dist/dockview.esm.min.js +2 -2
- package/dist/dockview.js +7037 -7091
- package/dist/dockview.min.js +2 -2
- package/dist/dockview.min.noStyle.js +2 -2
- package/dist/dockview.noStyle.js +7035 -7089
- package/dist/esm/dockview/defaultTab.d.ts +5 -4
- package/dist/esm/dockview/defaultTab.d.ts.map +1 -0
- package/dist/esm/dockview/defaultTab.js +35 -34
- package/dist/esm/dockview/defaultTab.js.map +1 -0
- package/dist/esm/dockview/dockview.d.ts +36 -32
- package/dist/esm/dockview/dockview.d.ts.map +1 -0
- package/dist/esm/dockview/dockview.js +155 -168
- package/dist/esm/dockview/dockview.js.map +1 -0
- package/dist/esm/dockview/groupControlsRenderer.d.ts +33 -32
- package/dist/esm/dockview/groupControlsRenderer.d.ts.map +1 -0
- package/dist/esm/dockview/groupControlsRenderer.js +69 -68
- package/dist/esm/dockview/groupControlsRenderer.js.map +1 -0
- package/dist/esm/dockview/reactContentPart.d.ts +23 -22
- package/dist/esm/dockview/reactContentPart.d.ts.map +1 -0
- package/dist/esm/dockview/reactContentPart.js +42 -41
- package/dist/esm/dockview/reactContentPart.js.map +1 -0
- package/dist/esm/dockview/reactHeaderPart.d.ts +19 -18
- package/dist/esm/dockview/reactHeaderPart.d.ts.map +1 -0
- package/dist/esm/dockview/reactHeaderPart.js +35 -34
- package/dist/esm/dockview/reactHeaderPart.js.map +1 -0
- package/dist/esm/dockview/reactWatermarkPart.d.ts +25 -24
- package/dist/esm/dockview/reactWatermarkPart.d.ts.map +1 -0
- package/dist/esm/dockview/reactWatermarkPart.js +45 -44
- package/dist/esm/dockview/reactWatermarkPart.js.map +1 -0
- package/dist/esm/gridview/gridview.d.ts +23 -22
- package/dist/esm/gridview/gridview.d.ts.map +1 -0
- package/dist/esm/gridview/gridview.js +55 -67
- package/dist/esm/gridview/gridview.js.map +1 -0
- package/dist/esm/gridview/view.d.ts +11 -10
- package/dist/esm/gridview/view.d.ts.map +1 -0
- package/dist/esm/gridview/view.js +18 -17
- package/dist/esm/gridview/view.js.map +1 -0
- package/dist/esm/index.d.ts +11 -10
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +9 -8
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/paneview/paneview.d.ts +25 -24
- package/dist/esm/paneview/paneview.d.ts.map +1 -0
- package/dist/esm/paneview/paneview.js +85 -98
- package/dist/esm/paneview/paneview.js.map +1 -0
- package/dist/esm/paneview/view.d.ts +20 -19
- package/dist/esm/paneview/view.d.ts.map +1 -0
- package/dist/esm/paneview/view.js +36 -35
- package/dist/esm/paneview/view.js.map +1 -0
- package/dist/esm/react.d.ts +36 -35
- package/dist/esm/react.d.ts.map +1 -0
- package/dist/esm/react.js +128 -127
- package/dist/esm/react.js.map +1 -0
- package/dist/esm/splitview/splitview.d.ts +23 -22
- package/dist/esm/splitview/splitview.d.ts.map +1 -0
- package/dist/esm/splitview/splitview.js +50 -63
- package/dist/esm/splitview/splitview.js.map +1 -0
- package/dist/esm/splitview/view.d.ts +11 -10
- package/dist/esm/splitview/view.d.ts.map +1 -0
- package/dist/esm/splitview/view.js +18 -17
- package/dist/esm/splitview/view.js.map +1 -0
- package/dist/esm/svg.d.ts +4 -3
- package/dist/esm/svg.d.ts.map +1 -0
- package/dist/esm/svg.js +8 -7
- package/dist/esm/svg.js.map +1 -0
- package/dist/esm/types.d.ts +8 -7
- package/dist/esm/types.d.ts.map +1 -0
- package/dist/esm/types.js +2 -1
- package/dist/esm/types.js.map +1 -0
- package/package.json +5 -5
package/dist/esm/react.d.ts
CHANGED
|
@@ -1,35 +1,36 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { IFrameworkPart, IDockviewDisposable } from 'dockview-core';
|
|
3
|
-
export interface ReactPortalStore {
|
|
4
|
-
addPortal: (portal: React.ReactPortal) => IDockviewDisposable;
|
|
5
|
-
}
|
|
6
|
-
export declare const ReactPartContext: React.Context<{}>;
|
|
7
|
-
export declare class ReactPart<P extends object, C extends object = {}> implements IFrameworkPart {
|
|
8
|
-
private readonly parent;
|
|
9
|
-
private readonly portalStore;
|
|
10
|
-
private readonly component;
|
|
11
|
-
private readonly parameters;
|
|
12
|
-
private readonly context?;
|
|
13
|
-
private _initialProps;
|
|
14
|
-
private componentInstance?;
|
|
15
|
-
private ref?;
|
|
16
|
-
private disposed;
|
|
17
|
-
constructor(parent: HTMLElement, portalStore: ReactPortalStore, component: React.FunctionComponent<P>, parameters: P, context?: C | undefined);
|
|
18
|
-
update(props: {
|
|
19
|
-
[index: string]: any;
|
|
20
|
-
}): void;
|
|
21
|
-
private createPortal;
|
|
22
|
-
dispose(): void;
|
|
23
|
-
}
|
|
24
|
-
type PortalLifecycleHook = () => [
|
|
25
|
-
React.ReactPortal[],
|
|
26
|
-
(portal: React.ReactPortal) => IDockviewDisposable
|
|
27
|
-
];
|
|
28
|
-
/**
|
|
29
|
-
* A React Hook that returns an array of portals to be rendered by the user of this hook
|
|
30
|
-
* and a disposable function to add a portal. Calling dispose removes this portal from the
|
|
31
|
-
* portal array
|
|
32
|
-
*/
|
|
33
|
-
export declare const usePortalsLifecycle: PortalLifecycleHook;
|
|
34
|
-
export declare function isReactElement(element: any | React.ReactElement): element is React.ReactElement;
|
|
35
|
-
export {};
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { IFrameworkPart, IDockviewDisposable } from 'dockview-core';
|
|
3
|
+
export interface ReactPortalStore {
|
|
4
|
+
addPortal: (portal: React.ReactPortal) => IDockviewDisposable;
|
|
5
|
+
}
|
|
6
|
+
export declare const ReactPartContext: React.Context<{}>;
|
|
7
|
+
export declare class ReactPart<P extends object, C extends object = {}> implements IFrameworkPart {
|
|
8
|
+
private readonly parent;
|
|
9
|
+
private readonly portalStore;
|
|
10
|
+
private readonly component;
|
|
11
|
+
private readonly parameters;
|
|
12
|
+
private readonly context?;
|
|
13
|
+
private _initialProps;
|
|
14
|
+
private componentInstance?;
|
|
15
|
+
private ref?;
|
|
16
|
+
private disposed;
|
|
17
|
+
constructor(parent: HTMLElement, portalStore: ReactPortalStore, component: React.FunctionComponent<P>, parameters: P, context?: C | undefined);
|
|
18
|
+
update(props: {
|
|
19
|
+
[index: string]: any;
|
|
20
|
+
}): void;
|
|
21
|
+
private createPortal;
|
|
22
|
+
dispose(): void;
|
|
23
|
+
}
|
|
24
|
+
type PortalLifecycleHook = () => [
|
|
25
|
+
React.ReactPortal[],
|
|
26
|
+
(portal: React.ReactPortal) => IDockviewDisposable
|
|
27
|
+
];
|
|
28
|
+
/**
|
|
29
|
+
* A React Hook that returns an array of portals to be rendered by the user of this hook
|
|
30
|
+
* and a disposable function to add a portal. Calling dispose removes this portal from the
|
|
31
|
+
* portal array
|
|
32
|
+
*/
|
|
33
|
+
export declare const usePortalsLifecycle: PortalLifecycleHook;
|
|
34
|
+
export declare function isReactElement(element: any | React.ReactElement): element is React.ReactElement;
|
|
35
|
+
export {};
|
|
36
|
+
//# sourceMappingURL=react.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../src/react.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEpE,MAAM,WAAW,gBAAgB;IAC7B,SAAS,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,WAAW,KAAK,mBAAmB,CAAC;CACjE;AAyDD,eAAO,MAAM,gBAAgB,mBAA8B,CAAC;AAE5D,qBAAa,SAAS,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,GAAG,EAAE,CAC1D,YAAW,cAAc;IAWrB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;IAb7B,OAAO,CAAC,aAAa,CAA2B;IAChD,OAAO,CAAC,iBAAiB,CAAC,CAAmB;IAC7C,OAAO,CAAC,GAAG,CAAC,CAGV;IACF,OAAO,CAAC,QAAQ,CAAS;gBAGJ,MAAM,EAAE,WAAW,EACnB,WAAW,EAAE,gBAAgB,EAC7B,SAAS,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC,EACrC,UAAU,EAAE,CAAC,EACb,OAAO,CAAC,eAAG;IAKzB,MAAM,CAAC,KAAK,EAAE;QAAE,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE;IAa7C,OAAO,CAAC,YAAY;IAqDb,OAAO;CAIjB;AAED,KAAK,mBAAmB,GAAG,MAAM;IAC7B,KAAK,CAAC,WAAW,EAAE;IACnB,CAAC,MAAM,EAAE,KAAK,CAAC,WAAW,KAAK,mBAAmB;CACrD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,EAAE,mBAwBjC,CAAC;AAGF,wBAAgB,cAAc,CAC1B,OAAO,EAAE,GAAG,GAAG,KAAK,CAAC,YAAY,GAClC,OAAO,IAAI,KAAK,CAAC,YAAY,CAE/B"}
|
package/dist/esm/react.js
CHANGED
|
@@ -1,127 +1,128 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import * as ReactDOM from 'react-dom';
|
|
3
|
-
/**
|
|
4
|
-
* This component is intended to interface between vanilla-js and React hence we need to be
|
|
5
|
-
* creative in how we update props.
|
|
6
|
-
* A ref of the component is exposed with an update method; which when called stores the props
|
|
7
|
-
* as a ref within this component and forcefully triggers a re-render of the component using
|
|
8
|
-
* the ref of props we just set on the renderered component as the props passed to the inner
|
|
9
|
-
* component
|
|
10
|
-
*/
|
|
11
|
-
const ReactComponentBridge = (props, ref) => {
|
|
12
|
-
const [_, triggerRender] = React.useState();
|
|
13
|
-
const _props = React.useRef(props.componentProps);
|
|
14
|
-
React.useImperativeHandle(ref, () => ({
|
|
15
|
-
update: (componentProps) => {
|
|
16
|
-
_props.current = Object.assign(Object.assign({}, _props.current), componentProps);
|
|
17
|
-
/**
|
|
18
|
-
* setting a arbitrary piece of state within this component will
|
|
19
|
-
* trigger a re-render.
|
|
20
|
-
* we use this rather than updating through a prop since we can
|
|
21
|
-
* pass a ref into the vanilla-js world.
|
|
22
|
-
*/
|
|
23
|
-
triggerRender(Date.now());
|
|
24
|
-
},
|
|
25
|
-
}), []);
|
|
26
|
-
return React.createElement(props.component, _props.current);
|
|
27
|
-
};
|
|
28
|
-
ReactComponentBridge.displayName = 'DockviewReactJsBridge';
|
|
29
|
-
/**
|
|
30
|
-
* Since we are storing the React.Portal references in a rendered array they
|
|
31
|
-
* require a key property like any other React element rendered in an array
|
|
32
|
-
* to prevent excessive re-rendering
|
|
33
|
-
*/
|
|
34
|
-
const uniquePortalKeyGenerator = (() => {
|
|
35
|
-
let value = 1;
|
|
36
|
-
return { next: () => `dockview_react_portal_key_${(value++).toString()}` };
|
|
37
|
-
})();
|
|
38
|
-
export const ReactPartContext = React.createContext({});
|
|
39
|
-
export class ReactPart {
|
|
40
|
-
constructor(parent, portalStore, component, parameters, context) {
|
|
41
|
-
this.parent = parent;
|
|
42
|
-
this.portalStore = portalStore;
|
|
43
|
-
this.component = component;
|
|
44
|
-
this.parameters = parameters;
|
|
45
|
-
this.context = context;
|
|
46
|
-
this._initialProps = {};
|
|
47
|
-
this.disposed = false;
|
|
48
|
-
this.createPortal();
|
|
49
|
-
}
|
|
50
|
-
update(props) {
|
|
51
|
-
if (this.disposed) {
|
|
52
|
-
throw new Error('invalid operation: resource is already disposed');
|
|
53
|
-
}
|
|
54
|
-
if (!this.componentInstance) {
|
|
55
|
-
// if the component is yet to be mounted store the props
|
|
56
|
-
this._initialProps = Object.assign(Object.assign({}, this._initialProps), props);
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
this.componentInstance.update(props);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
createPortal() {
|
|
63
|
-
if (this.disposed) {
|
|
64
|
-
throw new Error('invalid operation: resource is already disposed');
|
|
65
|
-
}
|
|
66
|
-
if (typeof this.component !== 'function') {
|
|
67
|
-
/**
|
|
68
|
-
* we know this isn't a React.FunctionComponent so throw an error here.
|
|
69
|
-
* if we do not intercept this the React library will throw a very obsure error
|
|
70
|
-
* for the same reason, at least at this point we will emit a sensible stacktrace.
|
|
71
|
-
*/
|
|
72
|
-
throw new Error('Invalid Operation. dockview only supports React Functional Components.');
|
|
73
|
-
}
|
|
74
|
-
const bridgeComponent = React.createElement(React.forwardRef(ReactComponentBridge), {
|
|
75
|
-
component: this
|
|
76
|
-
.component,
|
|
77
|
-
componentProps: this.parameters,
|
|
78
|
-
ref: (element) => {
|
|
79
|
-
this.componentInstance = element;
|
|
80
|
-
if (Object.keys(this._initialProps).length > 0) {
|
|
81
|
-
this.componentInstance.update(this._initialProps);
|
|
82
|
-
this._initialProps = {}; // don't keep a reference to the users object once no longer required
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
});
|
|
86
|
-
const node = this.context
|
|
87
|
-
? React.createElement(ReactPartContext.Provider, { value: this.context }, bridgeComponent)
|
|
88
|
-
: bridgeComponent;
|
|
89
|
-
const portal = ReactDOM.createPortal(node, this.parent, uniquePortalKeyGenerator.next());
|
|
90
|
-
this.ref = {
|
|
91
|
-
portal,
|
|
92
|
-
disposable: this.portalStore.addPortal(portal),
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
dispose() {
|
|
96
|
-
var _a;
|
|
97
|
-
(_a = this.ref) === null || _a === void 0 ? void 0 : _a.disposable.dispose();
|
|
98
|
-
this.disposed = true;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* A React Hook that returns an array of portals to be rendered by the user of this hook
|
|
103
|
-
* and a disposable function to add a portal. Calling dispose removes this portal from the
|
|
104
|
-
* portal array
|
|
105
|
-
*/
|
|
106
|
-
export const usePortalsLifecycle = () => {
|
|
107
|
-
const [portals, setPortals] = React.useState([]);
|
|
108
|
-
React.useDebugValue(`Portal count: ${portals.length}`);
|
|
109
|
-
const addPortal = React.useCallback((portal) => {
|
|
110
|
-
setPortals((existingPortals) => [...existingPortals, portal]);
|
|
111
|
-
let disposed = false;
|
|
112
|
-
return {
|
|
113
|
-
dispose: () => {
|
|
114
|
-
if (disposed) {
|
|
115
|
-
throw new Error('invalid operation: resource already disposed');
|
|
116
|
-
}
|
|
117
|
-
disposed = true;
|
|
118
|
-
setPortals((existingPortals) => existingPortals.filter((p) => p !== portal));
|
|
119
|
-
},
|
|
120
|
-
};
|
|
121
|
-
}, []);
|
|
122
|
-
return [portals, addPortal];
|
|
123
|
-
};
|
|
124
|
-
// it does the job...
|
|
125
|
-
export function isReactElement(element) {
|
|
126
|
-
return element === null || element === void 0 ? void 0 : element.type;
|
|
127
|
-
}
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as ReactDOM from 'react-dom';
|
|
3
|
+
/**
|
|
4
|
+
* This component is intended to interface between vanilla-js and React hence we need to be
|
|
5
|
+
* creative in how we update props.
|
|
6
|
+
* A ref of the component is exposed with an update method; which when called stores the props
|
|
7
|
+
* as a ref within this component and forcefully triggers a re-render of the component using
|
|
8
|
+
* the ref of props we just set on the renderered component as the props passed to the inner
|
|
9
|
+
* component
|
|
10
|
+
*/
|
|
11
|
+
const ReactComponentBridge = (props, ref) => {
|
|
12
|
+
const [_, triggerRender] = React.useState();
|
|
13
|
+
const _props = React.useRef(props.componentProps);
|
|
14
|
+
React.useImperativeHandle(ref, () => ({
|
|
15
|
+
update: (componentProps) => {
|
|
16
|
+
_props.current = Object.assign(Object.assign({}, _props.current), componentProps);
|
|
17
|
+
/**
|
|
18
|
+
* setting a arbitrary piece of state within this component will
|
|
19
|
+
* trigger a re-render.
|
|
20
|
+
* we use this rather than updating through a prop since we can
|
|
21
|
+
* pass a ref into the vanilla-js world.
|
|
22
|
+
*/
|
|
23
|
+
triggerRender(Date.now());
|
|
24
|
+
},
|
|
25
|
+
}), []);
|
|
26
|
+
return React.createElement(props.component, _props.current);
|
|
27
|
+
};
|
|
28
|
+
ReactComponentBridge.displayName = 'DockviewReactJsBridge';
|
|
29
|
+
/**
|
|
30
|
+
* Since we are storing the React.Portal references in a rendered array they
|
|
31
|
+
* require a key property like any other React element rendered in an array
|
|
32
|
+
* to prevent excessive re-rendering
|
|
33
|
+
*/
|
|
34
|
+
const uniquePortalKeyGenerator = (() => {
|
|
35
|
+
let value = 1;
|
|
36
|
+
return { next: () => `dockview_react_portal_key_${(value++).toString()}` };
|
|
37
|
+
})();
|
|
38
|
+
export const ReactPartContext = React.createContext({});
|
|
39
|
+
export class ReactPart {
|
|
40
|
+
constructor(parent, portalStore, component, parameters, context) {
|
|
41
|
+
this.parent = parent;
|
|
42
|
+
this.portalStore = portalStore;
|
|
43
|
+
this.component = component;
|
|
44
|
+
this.parameters = parameters;
|
|
45
|
+
this.context = context;
|
|
46
|
+
this._initialProps = {};
|
|
47
|
+
this.disposed = false;
|
|
48
|
+
this.createPortal();
|
|
49
|
+
}
|
|
50
|
+
update(props) {
|
|
51
|
+
if (this.disposed) {
|
|
52
|
+
throw new Error('invalid operation: resource is already disposed');
|
|
53
|
+
}
|
|
54
|
+
if (!this.componentInstance) {
|
|
55
|
+
// if the component is yet to be mounted store the props
|
|
56
|
+
this._initialProps = Object.assign(Object.assign({}, this._initialProps), props);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
this.componentInstance.update(props);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
createPortal() {
|
|
63
|
+
if (this.disposed) {
|
|
64
|
+
throw new Error('invalid operation: resource is already disposed');
|
|
65
|
+
}
|
|
66
|
+
if (typeof this.component !== 'function') {
|
|
67
|
+
/**
|
|
68
|
+
* we know this isn't a React.FunctionComponent so throw an error here.
|
|
69
|
+
* if we do not intercept this the React library will throw a very obsure error
|
|
70
|
+
* for the same reason, at least at this point we will emit a sensible stacktrace.
|
|
71
|
+
*/
|
|
72
|
+
throw new Error('Invalid Operation. dockview only supports React Functional Components.');
|
|
73
|
+
}
|
|
74
|
+
const bridgeComponent = React.createElement(React.forwardRef(ReactComponentBridge), {
|
|
75
|
+
component: this
|
|
76
|
+
.component,
|
|
77
|
+
componentProps: this.parameters,
|
|
78
|
+
ref: (element) => {
|
|
79
|
+
this.componentInstance = element;
|
|
80
|
+
if (Object.keys(this._initialProps).length > 0) {
|
|
81
|
+
this.componentInstance.update(this._initialProps);
|
|
82
|
+
this._initialProps = {}; // don't keep a reference to the users object once no longer required
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
});
|
|
86
|
+
const node = this.context
|
|
87
|
+
? React.createElement(ReactPartContext.Provider, { value: this.context }, bridgeComponent)
|
|
88
|
+
: bridgeComponent;
|
|
89
|
+
const portal = ReactDOM.createPortal(node, this.parent, uniquePortalKeyGenerator.next());
|
|
90
|
+
this.ref = {
|
|
91
|
+
portal,
|
|
92
|
+
disposable: this.portalStore.addPortal(portal),
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
dispose() {
|
|
96
|
+
var _a;
|
|
97
|
+
(_a = this.ref) === null || _a === void 0 ? void 0 : _a.disposable.dispose();
|
|
98
|
+
this.disposed = true;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* A React Hook that returns an array of portals to be rendered by the user of this hook
|
|
103
|
+
* and a disposable function to add a portal. Calling dispose removes this portal from the
|
|
104
|
+
* portal array
|
|
105
|
+
*/
|
|
106
|
+
export const usePortalsLifecycle = () => {
|
|
107
|
+
const [portals, setPortals] = React.useState([]);
|
|
108
|
+
React.useDebugValue(`Portal count: ${portals.length}`);
|
|
109
|
+
const addPortal = React.useCallback((portal) => {
|
|
110
|
+
setPortals((existingPortals) => [...existingPortals, portal]);
|
|
111
|
+
let disposed = false;
|
|
112
|
+
return {
|
|
113
|
+
dispose: () => {
|
|
114
|
+
if (disposed) {
|
|
115
|
+
throw new Error('invalid operation: resource already disposed');
|
|
116
|
+
}
|
|
117
|
+
disposed = true;
|
|
118
|
+
setPortals((existingPortals) => existingPortals.filter((p) => p !== portal));
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
}, []);
|
|
122
|
+
return [portals, addPortal];
|
|
123
|
+
};
|
|
124
|
+
// it does the job...
|
|
125
|
+
export function isReactElement(element) {
|
|
126
|
+
return element === null || element === void 0 ? void 0 : element.type;
|
|
127
|
+
}
|
|
128
|
+
//# sourceMappingURL=react.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react.js","sourceRoot":"","sources":["../../src/react.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,QAA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,UAAU,CAAC,CAAC,eAAe,EAAE,EAAE,CAC3B,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,MAAM,CAAC,CAC9C,CAAC;YACN,CAAC;SACJ,CAAC;IACN,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;AAChC,CAAC,CAAC;AAEF,qBAAqB;AACrB,MAAM,UAAU,cAAc,CAC1B,OAAiC;IAEjC,OAAO,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CAAC;AACzB,CAAC"}
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { SplitviewApi, SplitviewPanelApi, Orientation } from 'dockview-core';
|
|
3
|
-
import { PanelCollection, PanelParameters } from '../types';
|
|
4
|
-
export interface SplitviewReadyEvent {
|
|
5
|
-
api: SplitviewApi;
|
|
6
|
-
}
|
|
7
|
-
export interface ISplitviewPanelProps<T extends {
|
|
8
|
-
[index: string]: any;
|
|
9
|
-
} = any> extends PanelParameters<T> {
|
|
10
|
-
api: SplitviewPanelApi;
|
|
11
|
-
containerApi: SplitviewApi;
|
|
12
|
-
}
|
|
13
|
-
export interface ISplitviewReactProps {
|
|
14
|
-
orientation?: Orientation;
|
|
15
|
-
onReady: (event: SplitviewReadyEvent) => void;
|
|
16
|
-
components: PanelCollection<ISplitviewPanelProps>;
|
|
17
|
-
proportionalLayout?: boolean;
|
|
18
|
-
hideBorders?: boolean;
|
|
19
|
-
className?: string;
|
|
20
|
-
disableAutoResizing?: boolean;
|
|
21
|
-
}
|
|
22
|
-
export declare const SplitviewReact: React.ForwardRefExoticComponent<ISplitviewReactProps & React.RefAttributes<HTMLDivElement>>;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { SplitviewApi, SplitviewPanelApi, Orientation } from 'dockview-core';
|
|
3
|
+
import { PanelCollection, PanelParameters } from '../types';
|
|
4
|
+
export interface SplitviewReadyEvent {
|
|
5
|
+
api: SplitviewApi;
|
|
6
|
+
}
|
|
7
|
+
export interface ISplitviewPanelProps<T extends {
|
|
8
|
+
[index: string]: any;
|
|
9
|
+
} = any> extends PanelParameters<T> {
|
|
10
|
+
api: SplitviewPanelApi;
|
|
11
|
+
containerApi: SplitviewApi;
|
|
12
|
+
}
|
|
13
|
+
export interface ISplitviewReactProps {
|
|
14
|
+
orientation?: Orientation;
|
|
15
|
+
onReady: (event: SplitviewReadyEvent) => void;
|
|
16
|
+
components: PanelCollection<ISplitviewPanelProps>;
|
|
17
|
+
proportionalLayout?: boolean;
|
|
18
|
+
hideBorders?: boolean;
|
|
19
|
+
className?: string;
|
|
20
|
+
disableAutoResizing?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export declare const SplitviewReact: React.ForwardRefExoticComponent<ISplitviewReactProps & React.RefAttributes<HTMLDivElement>>;
|
|
23
|
+
//# sourceMappingURL=splitview.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"splitview.d.ts","sourceRoot":"","sources":["../../../src/splitview/splitview.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACH,YAAY,EACZ,iBAAiB,EAGjB,WAAW,EACd,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAG5D,MAAM,WAAW,mBAAmB;IAChC,GAAG,EAAE,YAAY,CAAC;CACrB;AAED,MAAM,WAAW,oBAAoB,CAAC,CAAC,SAAS;IAAE,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,GAAG,GAAG,CAC1E,SAAQ,eAAe,CAAC,CAAC,CAAC;IAC1B,GAAG,EAAE,iBAAiB,CAAC;IACvB,YAAY,EAAE,YAAY,CAAC;CAC9B;AAED,MAAM,WAAW,oBAAoB;IACjC,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,OAAO,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,CAAC;IAC9C,UAAU,EAAE,eAAe,CAAC,oBAAoB,CAAC,CAAC;IAClD,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mBAAmB,CAAC,EAAE,OAAO,CAAC;CACjC;AAED,eAAO,MAAM,cAAc,6FAkE1B,CAAC"}
|
|
@@ -1,63 +1,50 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { SplitviewApi, SplitviewComponent, Orientation,
|
|
3
|
-
import { usePortalsLifecycle } from '../react';
|
|
4
|
-
import { ReactPanelView } from './view';
|
|
5
|
-
export const SplitviewReact = React.forwardRef((props, ref) => {
|
|
6
|
-
const domRef = React.useRef(null);
|
|
7
|
-
const splitviewRef = React.useRef();
|
|
8
|
-
const [portals, addPortal] = usePortalsLifecycle();
|
|
9
|
-
React.useImperativeHandle(ref, () => domRef.current, []);
|
|
10
|
-
React.useEffect(() => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
};
|
|
52
|
-
}, []);
|
|
53
|
-
React.useEffect(() => {
|
|
54
|
-
if (!splitviewRef.current) {
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
splitviewRef.current.updateOptions({
|
|
58
|
-
frameworkComponents: props.components,
|
|
59
|
-
});
|
|
60
|
-
}, [props.components]);
|
|
61
|
-
return (React.createElement("div", { className: props.className, style: { height: '100%', width: '100%' }, ref: domRef }, portals));
|
|
62
|
-
});
|
|
63
|
-
SplitviewReact.displayName = 'SplitviewComponent';
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { SplitviewApi, SplitviewComponent, Orientation, } from 'dockview-core';
|
|
3
|
+
import { usePortalsLifecycle } from '../react';
|
|
4
|
+
import { ReactPanelView } from './view';
|
|
5
|
+
export const SplitviewReact = React.forwardRef((props, ref) => {
|
|
6
|
+
const domRef = React.useRef(null);
|
|
7
|
+
const splitviewRef = React.useRef();
|
|
8
|
+
const [portals, addPortal] = usePortalsLifecycle();
|
|
9
|
+
React.useImperativeHandle(ref, () => domRef.current, []);
|
|
10
|
+
React.useEffect(() => {
|
|
11
|
+
const splitview = new SplitviewComponent({
|
|
12
|
+
parentElement: domRef.current,
|
|
13
|
+
orientation: props.orientation || Orientation.HORIZONTAL,
|
|
14
|
+
frameworkComponents: props.components,
|
|
15
|
+
frameworkWrapper: {
|
|
16
|
+
createComponent: (id, componentId, component) => {
|
|
17
|
+
return new ReactPanelView(id, componentId, component, {
|
|
18
|
+
addPortal,
|
|
19
|
+
});
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
proportionalLayout: typeof props.proportionalLayout === 'boolean'
|
|
23
|
+
? props.proportionalLayout
|
|
24
|
+
: true,
|
|
25
|
+
styles: props.hideBorders
|
|
26
|
+
? { separatorBorder: 'transparent' }
|
|
27
|
+
: undefined,
|
|
28
|
+
});
|
|
29
|
+
const { clientWidth, clientHeight } = domRef.current;
|
|
30
|
+
splitview.layout(clientWidth, clientHeight);
|
|
31
|
+
if (props.onReady) {
|
|
32
|
+
props.onReady({ api: new SplitviewApi(splitview) });
|
|
33
|
+
}
|
|
34
|
+
splitviewRef.current = splitview;
|
|
35
|
+
return () => {
|
|
36
|
+
splitview.dispose();
|
|
37
|
+
};
|
|
38
|
+
}, []);
|
|
39
|
+
React.useEffect(() => {
|
|
40
|
+
if (!splitviewRef.current) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
splitviewRef.current.updateOptions({
|
|
44
|
+
frameworkComponents: props.components,
|
|
45
|
+
});
|
|
46
|
+
}, [props.components]);
|
|
47
|
+
return (React.createElement("div", { className: props.className, style: { height: '100%', width: '100%' }, ref: domRef }, portals));
|
|
48
|
+
});
|
|
49
|
+
SplitviewReact.displayName = 'SplitviewComponent';
|
|
50
|
+
//# sourceMappingURL=splitview.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"splitview.js","sourceRoot":"","sources":["../../../src/splitview/splitview.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACH,YAAY,EAGZ,kBAAkB,EAClB,WAAW,GACd,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/C,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAsBxC,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,CAAC,UAAU,CAC1C,CAAC,KAA2B,EAAE,GAAuC,EAAE,EAAE;IACrE,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAiB,IAAI,CAAC,CAAC;IAClD,MAAM,YAAY,GAAG,KAAK,CAAC,MAAM,EAAuB,CAAC;IACzD,MAAM,CAAC,OAAO,EAAE,SAAS,CAAC,GAAG,mBAAmB,EAAE,CAAC;IAEnD,KAAK,CAAC,mBAAmB,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAQ,EAAE,EAAE,CAAC,CAAC;IAE1D,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACjB,MAAM,SAAS,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,CAAC;IACP,CAAC,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;IAEvB,OAAO,CACH,6BACI,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EACxC,GAAG,EAAE,MAAM,IAEV,OAAO,CACN,CACT,CAAC;AACN,CAAC,CACJ,CAAC;AACF,cAAc,CAAC,WAAW,GAAG,oBAAoB,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { SplitviewPanel } from 'dockview-core';
|
|
3
|
-
import { ReactPart, ReactPortalStore } from '../react';
|
|
4
|
-
import { ISplitviewPanelProps } from './splitview';
|
|
5
|
-
export declare class ReactPanelView extends SplitviewPanel {
|
|
6
|
-
private readonly reactComponent;
|
|
7
|
-
private readonly reactPortalStore;
|
|
8
|
-
constructor(id: string, component: string, reactComponent: React.FunctionComponent<ISplitviewPanelProps>, reactPortalStore: ReactPortalStore);
|
|
9
|
-
getComponent(): ReactPart<ISplitviewPanelProps>;
|
|
10
|
-
}
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { SplitviewPanel } from 'dockview-core';
|
|
3
|
+
import { ReactPart, ReactPortalStore } from '../react';
|
|
4
|
+
import { ISplitviewPanelProps } from './splitview';
|
|
5
|
+
export declare class ReactPanelView extends SplitviewPanel {
|
|
6
|
+
private readonly reactComponent;
|
|
7
|
+
private readonly reactPortalStore;
|
|
8
|
+
constructor(id: string, component: string, reactComponent: React.FunctionComponent<ISplitviewPanelProps>, reactPortalStore: ReactPortalStore);
|
|
9
|
+
getComponent(): ReactPart<ISplitviewPanelProps>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../../src/splitview/view.ts"],"names":[],"mappings":";AAAA,OAAO,EAGH,cAAc,EACjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD,qBAAa,cAAe,SAAQ,cAAc;IAI1C,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,gBAAgB;gBAHjC,EAAE,EAAE,MAAM,EACV,SAAS,EAAE,MAAM,EACA,cAAc,EAAE,KAAK,CAAC,iBAAiB,CAAC,oBAAoB,CAAC,EAC7D,gBAAgB,EAAE,gBAAgB;IAKvD,YAAY,IAAI,SAAS,CAAC,oBAAoB,CAAC;CAclD"}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { SplitviewApi, SplitviewPanel, } from 'dockview-core';
|
|
2
|
-
import { ReactPart } from '../react';
|
|
3
|
-
export class ReactPanelView extends SplitviewPanel {
|
|
4
|
-
constructor(id, component, reactComponent, reactPortalStore) {
|
|
5
|
-
super(id, component);
|
|
6
|
-
this.reactComponent = reactComponent;
|
|
7
|
-
this.reactPortalStore = reactPortalStore;
|
|
8
|
-
}
|
|
9
|
-
getComponent() {
|
|
10
|
-
var _a;
|
|
11
|
-
return new ReactPart(this.element, this.reactPortalStore, this.reactComponent, {
|
|
12
|
-
params: ((_a = this._params) === null || _a === void 0 ? void 0 : _a.params) || {},
|
|
13
|
-
api: this.api,
|
|
14
|
-
containerApi: new SplitviewApi(this._params.accessor),
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
}
|
|
1
|
+
import { SplitviewApi, SplitviewPanel, } from 'dockview-core';
|
|
2
|
+
import { ReactPart } from '../react';
|
|
3
|
+
export class ReactPanelView extends SplitviewPanel {
|
|
4
|
+
constructor(id, component, reactComponent, reactPortalStore) {
|
|
5
|
+
super(id, component);
|
|
6
|
+
this.reactComponent = reactComponent;
|
|
7
|
+
this.reactPortalStore = reactPortalStore;
|
|
8
|
+
}
|
|
9
|
+
getComponent() {
|
|
10
|
+
var _a;
|
|
11
|
+
return new ReactPart(this.element, this.reactPortalStore, this.reactComponent, {
|
|
12
|
+
params: ((_a = this._params) === null || _a === void 0 ? void 0 : _a.params) || {},
|
|
13
|
+
api: this.api,
|
|
14
|
+
containerApi: new SplitviewApi(this._params.accessor),
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view.js","sourceRoot":"","sources":["../../../src/splitview/view.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,YAAY,EAEZ,cAAc,GACjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,SAAS,EAAoB,MAAM,UAAU,CAAC;AAGvD,MAAM,OAAO,cAAe,SAAQ,cAAc;IAC9C,YACI,EAAU,EACV,SAAiB,EACA,cAA6D,EAC7D,gBAAkC;QAEnD,KAAK,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;QAHJ,mBAAc,GAAd,cAAc,CAA+C;QAC7D,qBAAgB,GAAhB,gBAAgB,CAAkB;IAGvD,CAAC;IAED,YAAY;;QACR,OAAO,IAAI,SAAS,CAChB,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,gBAAgB,EACrB,IAAI,CAAC,cAAc,EACnB;YACI,MAAM,EAAE,CAAA,MAAA,IAAI,CAAC,OAAO,0CAAE,MAAM,KAAI,EAAE;YAClC,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,YAAY,EAAE,IAAI,YAAY,CACzB,IAAI,CAAC,OAAmC,CAAC,QAAQ,CACrD;SACJ,CACJ,CAAC;IACN,CAAC;CACJ"}
|
package/dist/esm/svg.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export declare const CloseButton: () => JSX.Element;
|
|
3
|
-
export declare const ExpandMore: () => JSX.Element;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const CloseButton: () => JSX.Element;
|
|
3
|
+
export declare const ExpandMore: () => JSX.Element;
|
|
4
|
+
//# sourceMappingURL=svg.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svg.d.ts","sourceRoot":"","sources":["../../src/svg.tsx"],"names":[],"mappings":";AAEA,eAAO,MAAM,WAAW,mBAWvB,CAAC;AAEF,eAAO,MAAM,UAAU,mBAatB,CAAC"}
|
package/dist/esm/svg.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
export const CloseButton = () => (React.createElement("svg", { height: "11", width: "11", viewBox: "0 0 28 28", "aria-hidden": 'false', focusable: false, className: "dockview-svg" },
|
|
3
|
-
React.createElement("path", { d: "M2.1 27.3L0 25.2L11.55 13.65L0 2.1L2.1 0L13.65 11.55L25.2 0L27.3 2.1L15.75 13.65L27.3 25.2L25.2 27.3L13.65 15.75L2.1 27.3Z" })));
|
|
4
|
-
export const ExpandMore = () => {
|
|
5
|
-
return (React.createElement("svg", { width: "11", height: "11", viewBox: "0 0 24 15", "aria-hidden": 'false', focusable: false, className: "dockview-svg" },
|
|
6
|
-
React.createElement("path", { d: "M12 14.15L0 2.15L2.15 0L12 9.9L21.85 0.0499992L24 2.2L12 14.15Z" })));
|
|
7
|
-
};
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export const CloseButton = () => (React.createElement("svg", { height: "11", width: "11", viewBox: "0 0 28 28", "aria-hidden": 'false', focusable: false, className: "dockview-svg" },
|
|
3
|
+
React.createElement("path", { d: "M2.1 27.3L0 25.2L11.55 13.65L0 2.1L2.1 0L13.65 11.55L25.2 0L27.3 2.1L15.75 13.65L27.3 25.2L25.2 27.3L13.65 15.75L2.1 27.3Z" })));
|
|
4
|
+
export const ExpandMore = () => {
|
|
5
|
+
return (React.createElement("svg", { width: "11", height: "11", viewBox: "0 0 24 15", "aria-hidden": 'false', focusable: false, className: "dockview-svg" },
|
|
6
|
+
React.createElement("path", { d: "M12 14.15L0 2.15L2.15 0L12 9.9L21.85 0.0499992L24 2.2L12 14.15Z" })));
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=svg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svg.js","sourceRoot":"","sources":["../../src/svg.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,CAC7B,6BACI,MAAM,EAAC,IAAI,EACX,KAAK,EAAC,IAAI,EACV,OAAO,EAAC,WAAW,iBACN,OAAO,EACpB,SAAS,EAAE,KAAK,EAChB,SAAS,EAAC,cAAc;IAExB,8BAAM,CAAC,EAAC,4HAA4H,GAAQ,CAC1I,CACT,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,EAAE;IAC3B,OAAO,CACH,6BACI,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,iBACN,OAAO,EACpB,SAAS,EAAE,KAAK,EAChB,SAAS,EAAC,cAAc;QAExB,8BAAM,CAAC,EAAC,iEAAiE,GAAG,CAC1E,CACT,CAAC;AACN,CAAC,CAAC"}
|
package/dist/esm/types.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
export interface PanelCollection<T extends object> {
|
|
3
|
-
[name: string]: React.FunctionComponent<T>;
|
|
4
|
-
}
|
|
5
|
-
export interface PanelParameters<T extends {} = Record<string, any>> {
|
|
6
|
-
params: T;
|
|
7
|
-
}
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface PanelCollection<T extends object> {
|
|
3
|
+
[name: string]: React.FunctionComponent<T>;
|
|
4
|
+
}
|
|
5
|
+
export interface PanelParameters<T extends {} = Record<string, any>> {
|
|
6
|
+
params: T;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=types.d.ts.map
|