@openviking/react 0.1.2 → 0.1.3
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/dist/1~0.js +506 -0
- package/dist/2~0.js +122 -0
- package/dist/{g~0.js → 30~0.js} +292 -167
- package/dist/client/index.d.ts +2 -1
- package/dist/client/paths.d.ts +64 -0
- package/dist/client/response.d.ts +31 -0
- package/dist/client/sse.d.ts +39 -0
- package/dist/client/stream.d.ts +26 -0
- package/dist/client/types.d.ts +104 -0
- package/dist/client.js +1 -239
- package/dist/components/agent-connect/style.css +2 -2
- package/dist/components/file-browser-entries/file-browser-entries-icons.d.ts +18 -0
- package/dist/components/file-browser-entries/file-browser-entries.d.ts +14 -0
- package/dist/components/file-browser-entries/index.d.ts +1 -0
- package/dist/components/file-browser-entries/style.css +155 -0
- package/dist/components/file-browser-entries/style.js +0 -0
- package/dist/components/file-browser-entries/types.d.ts +45 -0
- package/dist/components/file-browser-entries.js +1 -0
- package/dist/components/file-preview/file-preview-directory.d.ts +32 -0
- package/dist/components/file-preview/file-preview-header.d.ts +21 -3
- package/dist/components/file-preview/file-preview-panels.d.ts +41 -0
- package/dist/components/file-preview/file-preview-state.d.ts +10 -3
- package/dist/components/file-preview/file-preview.d.ts +2 -1
- package/dist/components/file-preview/level-selection.d.ts +25 -0
- package/dist/components/file-preview/style.css +76 -3
- package/dist/components/file-preview/types.d.ts +100 -1
- package/dist/components/file-preview/use-directory-level.d.ts +30 -0
- package/dist/components/file-preview/use-file-preview-actions-context.d.ts +6 -2
- package/dist/components/file-preview/use-file-preview-actions.d.ts +1 -1
- package/dist/components/file-preview.js +1 -1
- package/dist/components/file-tree/file-tree-info-tooltip.d.ts +7 -7
- package/dist/components/file-tree/file-tree-row-context.d.ts +0 -5
- package/dist/components/file-tree/file-tree-row-shared.d.ts +9 -2
- package/dist/components/file-tree/file-tree-tooltip-surface.d.ts +8 -8
- package/dist/components/file-tree/style.css +71 -34
- package/dist/components/file-tree/types.d.ts +20 -0
- package/dist/components/scope-switcher/style.css +2 -2
- package/dist/components/style.css +312 -47
- package/dist/components/tui/style.css +2 -2
- package/dist/components/viking-bot/style.css +2 -2
- package/dist/file-preview-viewer~0.js +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/l~0.js +1464 -25
- package/dist/modules/console/style.css +2 -2
- package/dist/modules/file-browser/file-browser-detail-icons.d.ts +10 -0
- package/dist/modules/file-browser/file-browser-detail.d.ts +33 -0
- package/dist/modules/file-browser/file-browser-empty.d.ts +3 -0
- package/dist/modules/file-browser/file-browser-failure.d.ts +22 -0
- package/dist/modules/file-browser/file-browser-icons.d.ts +18 -0
- package/dist/modules/file-browser/file-browser-labels.d.ts +28 -0
- package/dist/modules/file-browser/file-browser-layout.d.ts +27 -0
- package/dist/modules/file-browser/file-browser-toolbar.d.ts +18 -0
- package/dist/modules/file-browser/file-browser-tree-pane.d.ts +30 -0
- package/dist/modules/file-browser/file-browser.d.ts +14 -5
- package/dist/modules/file-browser/find-result.d.ts +24 -0
- package/dist/modules/file-browser/fs-directories.d.ts +33 -0
- package/dist/modules/file-browser/fs-file-kind.d.ts +19 -0
- package/dist/modules/file-browser/fs-icon.d.ts +17 -0
- package/dist/modules/file-browser/fs-model.d.ts +106 -0
- package/dist/modules/file-browser/fs-page.d.ts +16 -0
- package/dist/modules/file-browser/fs-path.d.ts +16 -0
- package/dist/modules/file-browser/fs-read-directory.d.ts +20 -0
- package/dist/modules/file-browser/fs-scope.d.ts +22 -0
- package/dist/modules/file-browser/fs-stat.d.ts +25 -0
- package/dist/modules/file-browser/index.d.ts +3 -1
- package/dist/modules/file-browser/style.css +4927 -35
- package/dist/modules/file-browser/tree-info-copy.d.ts +15 -0
- package/dist/modules/file-browser/tree-info-copy.zh-CN.d.ts +15 -0
- package/dist/modules/file-browser/types.d.ts +189 -44
- package/dist/modules/file-browser/use-container-width.d.ts +17 -0
- package/dist/modules/file-browser/use-file-browser.d.ts +49 -0
- package/dist/modules/file-browser/use-fs-preview.d.ts +51 -0
- package/dist/modules/file-browser/use-fs-search.d.ts +35 -0
- package/dist/modules/file-browser/use-fs-tree.d.ts +43 -0
- package/dist/modules/file-browser/use-request-scope.d.ts +39 -0
- package/dist/modules/file-browser.js +1 -1
- package/dist/modules/scope-cascade/style.css +2 -2
- package/dist/modules/style.css +4933 -41
- package/dist/n~0.js +178 -74
- package/dist/o~0.js +103 -0
- package/dist/shared/components/divider/divider.d.ts +18 -0
- package/dist/shared/components/divider/index.d.ts +1 -0
- package/dist/shared/components/divider/types.d.ts +35 -0
- package/dist/shared/components/overlay/types.d.ts +7 -0
- package/dist/shared/components/{tooltip/use-tooltip-position.d.ts → overlay/use-overlay-position.d.ts} +6 -6
- package/dist/shared/components/popover/index.d.ts +1 -0
- package/dist/shared/components/popover/popover.d.ts +23 -0
- package/dist/shared/components/popover/types.d.ts +50 -0
- package/dist/shared/components/resizable/clamp.d.ts +13 -0
- package/dist/shared/components/resizable/index.d.ts +2 -0
- package/dist/shared/components/resizable/resizable-handle.d.ts +25 -0
- package/dist/shared/components/resizable/types.d.ts +48 -0
- package/dist/shared/components/tooltip/types.d.ts +5 -5
- package/dist/style.css +5345 -188
- package/package.json +6 -1
- package/dist/components/file-tree/file-tree-tooltip.d.ts +0 -17
- package/dist/modules/file-browser/file-browser-toolbar-button.d.ts +0 -10
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 把宽度夹到 `[min, max]` 之间,并取整。
|
|
3
|
+
*
|
|
4
|
+
* 上限可能小于下限——容器被压得很窄时就会这样。此时以下限为准:面板宁可把
|
|
5
|
+
* 邻居挤小,也不该缩到看不见内容。
|
|
6
|
+
*
|
|
7
|
+
* Clamps a width into `[min, max]` and rounds it.
|
|
8
|
+
*
|
|
9
|
+
* The maximum can fall below the minimum when the container is squeezed hard. The
|
|
10
|
+
* minimum wins then: a panel may crowd its neighbour rather than shrink until
|
|
11
|
+
* nothing is readable.
|
|
12
|
+
*/
|
|
13
|
+
export declare function clampResizableWidth(width: number, min: number, max: number): number;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ResizableHandleProps } from './types.js';
|
|
2
|
+
export type { ResizableHandleProps, ResizeDirection } from './types.js';
|
|
3
|
+
export { clampResizableWidth } from './clamp.js';
|
|
4
|
+
/**
|
|
5
|
+
* 一条可拖拽的分隔条,用来改相邻面板的宽度。
|
|
6
|
+
*
|
|
7
|
+
* 宽度是受控的:组件只上报夹取后的新值,面板多宽由调用方决定。拖动期间用
|
|
8
|
+
* 指针捕获接住后续事件,因此不需要往 `window` 上挂监听,也不留全局副作用
|
|
9
|
+
* ——`preventDefault` 已经挡住拖动引起的文字选中。方向键同样能改宽,键盘用户
|
|
10
|
+
* 不必依赖指针。
|
|
11
|
+
*
|
|
12
|
+
* 省略 `onResize` 时退化成一根装饰线:不可拖动、不可聚焦,也不播报宽度。
|
|
13
|
+
*
|
|
14
|
+
* A draggable divider that resizes the neighbouring panel.
|
|
15
|
+
*
|
|
16
|
+
* The width is controlled: this only reports a clamped new value and the caller
|
|
17
|
+
* decides how wide the panel is. Pointer capture receives the rest of the drag, so
|
|
18
|
+
* nothing is bound to `window` and no global state is touched — `preventDefault`
|
|
19
|
+
* already stops the drag from selecting text. The arrow keys resize too, so a
|
|
20
|
+
* keyboard user never needs a pointer.
|
|
21
|
+
*
|
|
22
|
+
* Without `onResize` it degrades to a decorative rule: not draggable, not
|
|
23
|
+
* focusable, and it announces no width.
|
|
24
|
+
*/
|
|
25
|
+
export declare function ResizableHandle({ label, min, max, value, step, direction, onResize, className, ...rest }: ResizableHandleProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* 拖动方向:向右拖动让面板变宽为 `1`,变窄为 `-1`。
|
|
4
|
+
*
|
|
5
|
+
* 面板在分隔条左侧时用 `1`,在右侧时用 `-1`,否则往右拖反而变小。
|
|
6
|
+
*
|
|
7
|
+
* Drag direction: `1` widens the panel as the pointer moves right, `-1` narrows
|
|
8
|
+
* it. A panel left of the divider uses `1`, one on its right uses `-1`; the
|
|
9
|
+
* wrong sign makes a rightward drag shrink the panel.
|
|
10
|
+
*/
|
|
11
|
+
export type ResizeDirection = 1 | -1;
|
|
12
|
+
/**
|
|
13
|
+
* 分隔条的属性。
|
|
14
|
+
*
|
|
15
|
+
* 它是一个 `role="separator"` 的可聚焦控件:拖动改宽,左右方向键也能改,屏幕
|
|
16
|
+
* 阅读器通过 `aria-valuenow` 读到当前宽度。宽度本身由调用方持有,这里只上报
|
|
17
|
+
* 夹取后的新值——面板多宽属于布局,不属于分隔条。
|
|
18
|
+
*
|
|
19
|
+
* Props of the divider.
|
|
20
|
+
*
|
|
21
|
+
* It is a focusable `role="separator"` control: drag to resize, or use the left
|
|
22
|
+
* and right arrow keys, with a screen reader reading the current width from
|
|
23
|
+
* `aria-valuenow`. The width itself belongs to the caller; this only reports the
|
|
24
|
+
* clamped new value, because how wide a panel is is layout, not a divider's own
|
|
25
|
+
* state.
|
|
26
|
+
*/
|
|
27
|
+
export interface ResizableHandleProps extends Omit<HTMLAttributes<HTMLDivElement>, 'role' | 'children' | 'defaultValue'> {
|
|
28
|
+
/** 无障碍名称,例如「调整目录树宽度」。 Accessible name, such as "Resize the directory tree". */
|
|
29
|
+
label: string;
|
|
30
|
+
/** 最小宽度,单位像素。 Minimum width in pixels. */
|
|
31
|
+
min: number;
|
|
32
|
+
/** 最大宽度,单位像素。 Maximum width in pixels. */
|
|
33
|
+
max: number;
|
|
34
|
+
/** 当前宽度,单位像素。 Current width in pixels. */
|
|
35
|
+
value: number;
|
|
36
|
+
/** 方向键每次调整的像素数,缺省 16。 Pixels per arrow-key press, 16 by default. */
|
|
37
|
+
step?: number;
|
|
38
|
+
/** 拖动方向,缺省 `1`。 Drag direction, `1` by default. */
|
|
39
|
+
direction?: ResizeDirection;
|
|
40
|
+
/**
|
|
41
|
+
* 拖动或按键产生新宽度时触发,参数已夹到 `[min, max]`。省略时分隔条只作为
|
|
42
|
+
* 装饰线存在,不可拖动也不可聚焦。
|
|
43
|
+
*
|
|
44
|
+
* Fires with a new width already clamped to `[min, max]`. Omitting it leaves the
|
|
45
|
+
* divider as a decorative rule: not draggable and not focusable.
|
|
46
|
+
*/
|
|
47
|
+
onResize?: (width: number) => void;
|
|
48
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { CSSProperties, ReactElement, ReactNode } from 'react';
|
|
2
|
+
import type { OverlayPlacement } from '../overlay/types.js';
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* when there is not enough room.
|
|
4
|
+
* 提示相对触发元素的方位,与浮层共用一套取值。空间不足时自动翻到对侧。
|
|
5
|
+
* Where the hint sits relative to its trigger, sharing the overlay's values. It
|
|
6
|
+
* flips to the opposite side when there is not enough room.
|
|
7
7
|
*/
|
|
8
|
-
export type TooltipPlacement =
|
|
8
|
+
export type TooltipPlacement = OverlayPlacement;
|
|
9
9
|
/**
|
|
10
10
|
* 触发方式。`hover` 悬停与聚焦都展示,适合按钮提示;`click` 点击切换,
|
|
11
11
|
* 适合放可交互的内容。
|