@deepseek-ai/dsh-client-ui-dockkit 0.1.6-alpha.2 → 0.1.7-alpha.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/README.i18n.yaml +2 -2
- package/README.md +4 -2
- package/README.zh.md +4 -2
- package/lib/components/dockkit.module.css +101 -6
- package/lib/index.js +587 -327
- package/lib/types/components/DockSurface.d.ts +11 -2
- package/lib/types/components/FloatLayer.d.ts +30 -2
- package/lib/types/components/TabLayout.d.ts +27 -0
- package/lib/types/components/TabPanel.d.ts +5 -1
- package/lib/types/index.d.ts +2 -0
- package/package.json +5 -5
|
@@ -2,6 +2,7 @@ import type { ReactNode } from 'react';
|
|
|
2
2
|
import type { DockIntents, DockLabels, TabMenuExtras, TabRenderer } from '../contract/adapter.ts';
|
|
3
3
|
import type { LayoutState, PaneId, TabId } from '../contract/types.ts';
|
|
4
4
|
import type { HalvesFit } from '../engine/geometry.ts';
|
|
5
|
+
import { type TabRetention } from './TabLayout.tsx';
|
|
5
6
|
/** What the docked surface needs: the layout, its limits, and the outward contracts. */
|
|
6
7
|
export interface DockSurfaceProps {
|
|
7
8
|
readonly state: LayoutState;
|
|
@@ -55,6 +56,14 @@ export interface DockSurfaceProps {
|
|
|
55
56
|
*/
|
|
56
57
|
readonly onRoom?: (fits: ReadonlyMap<PaneId, HalvesFit>) => void;
|
|
57
58
|
}
|
|
58
|
-
/**
|
|
59
|
-
export declare function DockSurface(
|
|
59
|
+
/** Recursive docked layout; floating content is rendered separately by FloatLayer. */
|
|
60
|
+
export declare function DockSurface(props: DockSurfaceProps): ReactNode;
|
|
61
|
+
/** Horizontal Sidebar layout with stable tab containers across docking and floating. */
|
|
62
|
+
export type DockLayoutProps = DockSurfaceProps & TabRetention;
|
|
63
|
+
/**
|
|
64
|
+
* Render one pane or two horizontal panes, and their floats, in one stable content tree.
|
|
65
|
+
* @param props - layout, gestures and lazy body-retention policy.
|
|
66
|
+
* @returns the layout; the containing ancestors must not clip or establish a fixed-position containing block.
|
|
67
|
+
*/
|
|
68
|
+
export declare function DockLayout(props: DockLayoutProps): ReactNode;
|
|
60
69
|
//# sourceMappingURL=DockSurface.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
1
|
+
import type { PointerEvent as ReactPointerEvent, ReactNode } from 'react';
|
|
2
2
|
import type { DockIntents, DockLabels, TabRenderer } from '../contract/adapter.ts';
|
|
3
|
-
import type { LayoutState, TabId } from '../contract/types.ts';
|
|
3
|
+
import type { FloatRect, LayoutState, PaneId, TabId, TabRecord } from '../contract/types.ts';
|
|
4
4
|
/** The layout whose `floats` this layer draws. */
|
|
5
5
|
export interface FloatLayerProps {
|
|
6
6
|
readonly state: LayoutState;
|
|
@@ -12,6 +12,34 @@ export interface FloatLayerProps {
|
|
|
12
12
|
/** The panel header's title content; omit to show the record's `title` text (see `DockSurfaceProps`). */
|
|
13
13
|
readonly renderTabTitle?: TabRenderer;
|
|
14
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Shared move/resize gestures; changing layout mode never owns the content DOM.
|
|
17
|
+
* @param state - committed layout and float stacking order.
|
|
18
|
+
* @param intents - gesture settlements.
|
|
19
|
+
* @returns the current preview and focus/gesture callbacks.
|
|
20
|
+
*/
|
|
21
|
+
export declare function useFloatGestures(state: LayoutState, intents: DockIntents): {
|
|
22
|
+
preview: {
|
|
23
|
+
paneId: PaneId;
|
|
24
|
+
rect: FloatRect;
|
|
25
|
+
} | undefined;
|
|
26
|
+
raise: (paneId: PaneId) => void;
|
|
27
|
+
drag: (mode: "move" | "resize", paneId: PaneId, event: ReactPointerEvent<HTMLElement>) => void;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Header-only controls, usable above either retained or visibility-mounted bodies.
|
|
31
|
+
* @param props - owning pane/tab, localized labels and gesture callbacks.
|
|
32
|
+
* @returns the float header without a content container.
|
|
33
|
+
*/
|
|
34
|
+
export declare function FloatHeader({ paneId, tab, labels, intents, renderTabTitle, canCloseTab, drag }: {
|
|
35
|
+
readonly paneId: PaneId;
|
|
36
|
+
readonly tab: TabRecord;
|
|
37
|
+
readonly labels: DockLabels;
|
|
38
|
+
readonly intents: DockIntents;
|
|
39
|
+
readonly renderTabTitle: TabRenderer | undefined;
|
|
40
|
+
readonly canCloseTab: ((id: TabId) => boolean) | undefined;
|
|
41
|
+
readonly drag: ReturnType<typeof useFloatGestures>['drag'];
|
|
42
|
+
}): ReactNode;
|
|
15
43
|
/** Every floating panel, in z order. */
|
|
16
44
|
export declare function FloatLayer({ state, intents, labels, renderTab, renderTabTitle, canCloseTab }: FloatLayerProps): ReactNode;
|
|
17
45
|
//# sourceMappingURL=FloatLayer.d.ts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { DockIntents } from '../contract/adapter.ts';
|
|
3
|
+
import type { LayoutState, TabRecord } from '../contract/types.ts';
|
|
4
|
+
import type { SizePreview } from './PaneTree.tsx';
|
|
5
|
+
import type { PaneCallbacks } from './render.ts';
|
|
6
|
+
/** Host policy for lazily retaining a tab body without reparenting it. */
|
|
7
|
+
export interface TabRetention {
|
|
8
|
+
/** Whether a visited body survives hiding; omitted means visibility-mounted. */
|
|
9
|
+
readonly keepMounted?: (tab: TabRecord) => boolean;
|
|
10
|
+
/** Whether this layout's Session is on screen; defaults to true. */
|
|
11
|
+
readonly active?: boolean;
|
|
12
|
+
}
|
|
13
|
+
interface LayoutProps extends TabRetention {
|
|
14
|
+
readonly state: LayoutState;
|
|
15
|
+
readonly callbacks: PaneCallbacks;
|
|
16
|
+
readonly preview: SizePreview | undefined;
|
|
17
|
+
readonly intents: DockIntents;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* One or two horizontal panes; CSS resolves content sizes from track fractions.
|
|
21
|
+
* @param props - committed layout, gesture preview and body retention policy.
|
|
22
|
+
* @returns stable tab containers, including floating tabs.
|
|
23
|
+
* @throws if the docked tree is not one pane or two horizontal panes.
|
|
24
|
+
*/
|
|
25
|
+
export declare function TabLayout(props: LayoutProps): ReactNode;
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=TabLayout.d.ts.map
|
|
@@ -7,6 +7,10 @@ export interface TabPanelProps {
|
|
|
7
7
|
readonly pane: PaneNode;
|
|
8
8
|
readonly callbacks: PaneCallbacks;
|
|
9
9
|
}
|
|
10
|
-
/**
|
|
10
|
+
/** @param props - pane state and gestures. @returns its tab strip without a content container. */
|
|
11
|
+
export declare function TabStrip({ state, pane, callbacks }: TabPanelProps): ReactNode;
|
|
12
|
+
/** @param props - target pane and drag preview. @returns body-local drop feedback, or nothing. */
|
|
13
|
+
export declare function PaneDropHints({ pane, callbacks }: Pick<TabPanelProps, 'pane' | 'callbacks'>): ReactNode;
|
|
14
|
+
/** @param props - pane state and gestures. @returns one pane in the recursive, visibility-mounted layout. */
|
|
11
15
|
export declare function TabPanel({ state, pane, callbacks }: TabPanelProps): ReactNode;
|
|
12
16
|
//# sourceMappingURL=TabPanel.d.ts.map
|
package/lib/types/index.d.ts
CHANGED
|
@@ -35,4 +35,6 @@ export { DockSurface } from './components/DockSurface.tsx';
|
|
|
35
35
|
export type { DockSurfaceProps } from './components/DockSurface.tsx';
|
|
36
36
|
export { FloatLayer } from './components/FloatLayer.tsx';
|
|
37
37
|
export type { FloatLayerProps } from './components/FloatLayer.tsx';
|
|
38
|
+
export { DockLayout } from './components/DockSurface.tsx';
|
|
39
|
+
export type { DockLayoutProps } from './components/DockSurface.tsx';
|
|
38
40
|
//# sourceMappingURL=index.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-client-ui-dockkit",
|
|
3
3
|
"description": "Docking layout kit: split-tree engine with invertible operations, and the React components that render and drive it (zero cordis)",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.7-alpha.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"react-dom": "^18.2.0",
|
|
30
30
|
"react": "^18.2.0",
|
|
31
31
|
"clsx": "^2.0.0",
|
|
32
|
-
"@deepseek-ai/
|
|
33
|
-
"@deepseek-ai/dsh-brand": "
|
|
34
|
-
"@deepseek-ai/
|
|
32
|
+
"@deepseek-ai/dsh-client-ui-primitives": "0.1.7-alpha.2",
|
|
33
|
+
"@deepseek-ai/dsh-brand": "0.1.7-alpha.2",
|
|
34
|
+
"@deepseek-ai/cordis": "~4.0.4"
|
|
35
35
|
},
|
|
36
36
|
"files": [
|
|
37
37
|
"lib/index.js",
|
|
@@ -39,6 +39,6 @@
|
|
|
39
39
|
"lib/types/**/*.d.ts"
|
|
40
40
|
],
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"@deepseek-ai/cordis": "
|
|
42
|
+
"@deepseek-ai/cordis": "~4.0.4"
|
|
43
43
|
}
|
|
44
44
|
}
|