@lmzhen/dsh-evolution-merge-ui 0.34.0 → 0.36.0
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/lib/client.js +615 -289
- package/lib/types/client/MergeRow.d.ts +34 -0
- package/lib/types/client/MergeRunStrip.d.ts +16 -0
- package/lib/types/client/MergeSettings.d.ts +15 -0
- package/lib/types/client/MergeStore.d.ts +13 -0
- package/lib/types/client/Panel.d.ts +1 -1
- package/lib/types/client/api.d.ts +1 -1
- package/lib/types/client/merge-presentation.d.ts +20 -0
- package/package.json +2 -2
- package/lib/types/client/platform-menu.d.ts +0 -52
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** One merge row: summary, stage, facts, one primary decision and the copy/sort drawer. */
|
|
2
|
+
import { type DragEvent, type ReactNode } from 'react';
|
|
3
|
+
import type { MergeRowView } from './api.ts';
|
|
4
|
+
type Translate = (key: string, values?: Readonly<Record<string, string | number>>) => string;
|
|
5
|
+
export interface RowSortHandlers {
|
|
6
|
+
start(id: string): void;
|
|
7
|
+
over(event: DragEvent<HTMLDivElement>): void;
|
|
8
|
+
drop(id: string): void;
|
|
9
|
+
end(): void;
|
|
10
|
+
menu(id: string, x: number, y: number): void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Render one row as a decision card. The approve action is the only primary; A/B, reject and
|
|
14
|
+
* auxiliary sort/copy commands cannot borrow that weight.
|
|
15
|
+
* @param props - row, translator, copier, sort hooks, body opener and decision callback.
|
|
16
|
+
* @returns the row with drag/keyboard wiring and a separate more drawer.
|
|
17
|
+
*/
|
|
18
|
+
export declare function MergeRow(props: {
|
|
19
|
+
row: MergeRowView;
|
|
20
|
+
t: Translate;
|
|
21
|
+
copy: (command: string) => void;
|
|
22
|
+
sort: RowSortHandlers;
|
|
23
|
+
openBoth: (a: {
|
|
24
|
+
name: string;
|
|
25
|
+
side: 'live' | 'archive';
|
|
26
|
+
}, b: {
|
|
27
|
+
name: string;
|
|
28
|
+
side: 'live' | 'archive';
|
|
29
|
+
}, rowId: string | undefined) => void;
|
|
30
|
+
onDecide: ((rowId: string, verb: 'approve' | 'reject') => void) | undefined;
|
|
31
|
+
busy: boolean;
|
|
32
|
+
}): ReactNode;
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=MergeRow.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** The merge run strips: active/last identity, state, progress, report and details. */
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
3
|
+
import type { MergeViewPayload } from './api.ts';
|
|
4
|
+
type Translate = (key: string, values?: Readonly<Record<string, string | number>>) => string;
|
|
5
|
+
/**
|
|
6
|
+
* Render active and last runs as two independently labelled strips.
|
|
7
|
+
* @param props - view, translator and command copier.
|
|
8
|
+
* @returns the strips, or null when neither run exists.
|
|
9
|
+
*/
|
|
10
|
+
export declare function MergeRunStrips({ view, t, copy }: {
|
|
11
|
+
view: MergeViewPayload;
|
|
12
|
+
t: Translate;
|
|
13
|
+
copy: (command: string) => void;
|
|
14
|
+
}): ReactNode;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=MergeRunStrip.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** The merge settings summary: two read-only state chips and one settings path. */
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
3
|
+
import type { MergeViewPayload } from './api.ts';
|
|
4
|
+
type Translate = (key: string, values?: Readonly<Record<string, string | number>>) => string;
|
|
5
|
+
/**
|
|
6
|
+
* Render the read-only approval state without the old large settings card.
|
|
7
|
+
* @param props - the merge view and translator.
|
|
8
|
+
* @returns two chips and the one current settings path.
|
|
9
|
+
*/
|
|
10
|
+
export declare function MergeSettings({ view, t }: {
|
|
11
|
+
view: MergeViewPayload;
|
|
12
|
+
t: Translate;
|
|
13
|
+
}): ReactNode;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=MergeSettings.d.ts.map
|
|
@@ -17,6 +17,10 @@ export interface QueueState {
|
|
|
17
17
|
nextCursor?: string | undefined;
|
|
18
18
|
failure?: MergeFailure | undefined;
|
|
19
19
|
}
|
|
20
|
+
export interface BodyTarget {
|
|
21
|
+
readonly name: string;
|
|
22
|
+
readonly side: 'live' | 'archive';
|
|
23
|
+
}
|
|
20
24
|
export type OverlayState = {
|
|
21
25
|
kind: 'body';
|
|
22
26
|
name: string;
|
|
@@ -24,6 +28,14 @@ export type OverlayState = {
|
|
|
24
28
|
status: 'loading' | 'ready' | 'error';
|
|
25
29
|
body?: MergeBody;
|
|
26
30
|
failure?: MergeFailure;
|
|
31
|
+
} | {
|
|
32
|
+
kind: 'pair';
|
|
33
|
+
a: BodyTarget;
|
|
34
|
+
b: BodyTarget;
|
|
35
|
+
status: 'loading' | 'ready' | 'error';
|
|
36
|
+
aBody?: MergeBody;
|
|
37
|
+
bBody?: MergeBody;
|
|
38
|
+
failure?: MergeFailure;
|
|
27
39
|
} | {
|
|
28
40
|
kind: 'history';
|
|
29
41
|
status: 'loading' | 'ready' | 'error';
|
|
@@ -71,6 +83,7 @@ export declare class MergeStore {
|
|
|
71
83
|
refresh(): void;
|
|
72
84
|
loadMore(): void;
|
|
73
85
|
openBody(name: string, side: 'live' | 'archive', rowId?: string): Promise<void>;
|
|
86
|
+
openPair(a: BodyTarget, b: BodyTarget, rowId?: string): Promise<void>;
|
|
74
87
|
openHistory(): Promise<void>;
|
|
75
88
|
closeOverlay(): void;
|
|
76
89
|
dispose(): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** Batch 4 merge panel: keyed read store, four tabs, local overlays, localized errors. */
|
|
2
2
|
import { type ReactNode } from 'react';
|
|
3
3
|
import type { MergeStore } from './MergeStore.ts';
|
|
4
|
-
import type
|
|
4
|
+
import { type SettingsFace } from '@lmzhen/dsh-evolution-client-kit';
|
|
5
5
|
export type Translate = (key: string, values?: Readonly<Record<string, string | number>>) => string;
|
|
6
6
|
export interface MergeFace {
|
|
7
7
|
store: MergeStore;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Pure presentation decisions for one merge row; no network or store state. */
|
|
2
|
+
export type PairSummary = {
|
|
3
|
+
readonly kind: 'same';
|
|
4
|
+
readonly text: string;
|
|
5
|
+
} | {
|
|
6
|
+
readonly kind: 'different';
|
|
7
|
+
readonly a: string | null;
|
|
8
|
+
readonly b: string | null;
|
|
9
|
+
} | {
|
|
10
|
+
readonly kind: 'missing';
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Compare the two source summaries after trimming. Equal non-empty text is one fact;
|
|
14
|
+
* missing text stays missing rather than being invented.
|
|
15
|
+
* @param a - source A summary, or null.
|
|
16
|
+
* @param b - source B summary, or null.
|
|
17
|
+
* @returns the presentation form.
|
|
18
|
+
*/
|
|
19
|
+
export declare function summarizePair(a: string | null | undefined, b: string | null | undefined): PairSummary;
|
|
20
|
+
//# sourceMappingURL=merge-presentation.d.ts.map
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
]
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
|
-
"version": "0.
|
|
14
|
+
"version": "0.36.0",
|
|
15
15
|
"publishConfig": {
|
|
16
16
|
"access": "public"
|
|
17
17
|
},
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"react-dom": "^18.2.0"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@lmzhen/dsh-evolution-client-kit": "^0.
|
|
54
|
+
"@lmzhen/dsh-evolution-client-kit": "^0.36.0"
|
|
55
55
|
},
|
|
56
56
|
"engines": {
|
|
57
57
|
"dsh": ">=0.2.1-rc.2 <0.2.2-0"
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The one seam onto the platform's menu material and rows.
|
|
3
|
-
*
|
|
4
|
-
* The family bundle keeps `@deepseek-ai/*` external, so the platform components are reached through
|
|
5
|
-
* the loader-provided `require` (the same door the Markdown seam uses). A deployment without the
|
|
6
|
-
* row gets the panel's own menu fallback; the platform path is not a hard dependency.
|
|
7
|
-
* @module dsh-evolution-merge-ui/client
|
|
8
|
-
*/
|
|
9
|
-
import { type ReactNode } from 'react';
|
|
10
|
-
/** The platform's menu surface: a styled container that accepts div props. */
|
|
11
|
-
export type MenuSurfaceComponent = (props: Record<string, unknown> & {
|
|
12
|
-
children?: ReactNode;
|
|
13
|
-
}) => ReactNode;
|
|
14
|
-
/** The platform's menu row: role=menuitem plus selected/disabled/danger semantics. */
|
|
15
|
-
export type MenuItemButtonComponent = (props: {
|
|
16
|
-
children: ReactNode;
|
|
17
|
-
current?: boolean;
|
|
18
|
-
disabled?: boolean;
|
|
19
|
-
danger?: boolean;
|
|
20
|
-
separatorBefore?: boolean;
|
|
21
|
-
onSelect: () => void;
|
|
22
|
-
}) => ReactNode;
|
|
23
|
-
/** The two components this panel consumes from one platform module row. */
|
|
24
|
-
export interface MenuPrimitives {
|
|
25
|
-
MenuSurface: MenuSurfaceComponent;
|
|
26
|
-
MenuItemButton: MenuItemButtonComponent;
|
|
27
|
-
}
|
|
28
|
-
/** One row of the coordinate menu, independent of the renderer. */
|
|
29
|
-
export interface RowMenuAction {
|
|
30
|
-
readonly id: string;
|
|
31
|
-
readonly label: string;
|
|
32
|
-
readonly onSelect: () => void;
|
|
33
|
-
readonly separatorBefore?: boolean;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Render the coordinate menu through the platform primitives.
|
|
37
|
-
* @param primitives - the platform MenuSurface/MenuItemButton pair.
|
|
38
|
-
* @param actions - rows in display order.
|
|
39
|
-
* @param label - accessible menu name.
|
|
40
|
-
* @param style - fixed position computed from the pointer.
|
|
41
|
-
* @returns the menu element.
|
|
42
|
-
*/
|
|
43
|
-
export declare function renderPlatformMenu(primitives: MenuPrimitives, actions: readonly RowMenuAction[], label: string, style: Record<string, string | number>): ReactNode;
|
|
44
|
-
/**
|
|
45
|
-
* Accept only the two component functions; a namespace row without them is not a menu.
|
|
46
|
-
* @param row - the module row's exports.
|
|
47
|
-
* @returns the two components, or undefined.
|
|
48
|
-
*/
|
|
49
|
-
export declare function menuPrimitivesFrom(row: Record<string, unknown>): MenuPrimitives | undefined;
|
|
50
|
-
/** The module-table row, when this deployment carries it. */
|
|
51
|
-
export declare const PLATFORM_MENU: MenuPrimitives | undefined;
|
|
52
|
-
//# sourceMappingURL=platform-menu.d.ts.map
|