@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,155 @@
|
|
|
1
|
+
.ov-agent-connect, .ov-divider, .ov-file-browser, .ov-file-browser-entries, .ov-file-preview, .ov-file-tree, .ov-module-placeholder, .ov-popover, .ov-scope-switcher, .ov-tooltip, .ov-tui, .ov-viking-bot, .ov-viking-bot__interaction {
|
|
2
|
+
--ov-ui-primary-default: #5252ff;
|
|
3
|
+
--ov-ui-primary-hover-default: #7075ff;
|
|
4
|
+
--ov-ui-primary-active-default: #3833d2;
|
|
5
|
+
--ov-ui-primary-light-default: #f5f7ff;
|
|
6
|
+
--ov-ui-connect-glow-warm-default: #ff952b0a;
|
|
7
|
+
--ov-ui-connect-glow-pink-default: #fb4fbc0f;
|
|
8
|
+
--ov-ui-connect-glow-pink-soft-default: #fb4fbc0a;
|
|
9
|
+
--ov-ui-on-primary-default: #fff;
|
|
10
|
+
--ov-ui-text-1-default: #0b0b0f;
|
|
11
|
+
--ov-ui-text-2-default: #3f3f51;
|
|
12
|
+
--ov-ui-text-3-default: #6e718c;
|
|
13
|
+
--ov-ui-text-description-default: #0006;
|
|
14
|
+
--ov-ui-text-disabled-default: #a5a7bb;
|
|
15
|
+
--ov-ui-border-1-default: #f0f2fa;
|
|
16
|
+
--ov-ui-border-2-default: #e1e4f2;
|
|
17
|
+
--ov-ui-border-3-default: #d7daea;
|
|
18
|
+
--ov-ui-bg-1-default: #fff;
|
|
19
|
+
--ov-ui-bg-3-default: #f7f8fd;
|
|
20
|
+
--ov-ui-bg-4-default: #f6f7fa;
|
|
21
|
+
--ov-ui-bg-5-default: #f1f2f9;
|
|
22
|
+
--ov-ui-status-success-default: #1f9d55;
|
|
23
|
+
--ov-ui-shadow-default: #0f172a;
|
|
24
|
+
--ov-ui-focus-default: #5252ff;
|
|
25
|
+
--ov-ui-fill-hover-default: #f1f2f9;
|
|
26
|
+
--ov-ui-status-error-default: #c43838;
|
|
27
|
+
--ov-ui-warning-default: #b26a00;
|
|
28
|
+
--ov-ui-warning-light-default: #fff0b3;
|
|
29
|
+
--ov-ui-tooltip-bg-default: #1f2329;
|
|
30
|
+
--ov-ui-tooltip-text-default: #fff;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.dark .ov-agent-connect, .dark .ov-divider, .dark .ov-file-browser, .dark .ov-file-browser-entries, .dark .ov-file-preview, .dark .ov-file-tree, .dark .ov-module-placeholder, .dark .ov-popover, .dark .ov-scope-switcher, .dark .ov-tooltip, .dark .ov-tui, .dark .ov-viking-bot, .dark .ov-viking-bot__interaction {
|
|
34
|
+
--ov-ui-primary-default: #5f5fff;
|
|
35
|
+
--ov-ui-primary-hover-default: #7075ff;
|
|
36
|
+
--ov-ui-primary-active-default: #4242ba;
|
|
37
|
+
--ov-ui-primary-light-default: #1a1632;
|
|
38
|
+
--ov-ui-connect-glow-warm-default: #ff952b05;
|
|
39
|
+
--ov-ui-connect-glow-pink-default: #fb4fbc08;
|
|
40
|
+
--ov-ui-connect-glow-pink-soft-default: #fb4fbc05;
|
|
41
|
+
--ov-ui-text-1-default: #c7ccd6;
|
|
42
|
+
--ov-ui-text-2-default: #9da3af;
|
|
43
|
+
--ov-ui-text-3-default: #737a87;
|
|
44
|
+
--ov-ui-text-description-default: #fff6;
|
|
45
|
+
--ov-ui-text-disabled-default: #42464e;
|
|
46
|
+
--ov-ui-border-1-default: #23252a;
|
|
47
|
+
--ov-ui-border-2-default: #2e3138;
|
|
48
|
+
--ov-ui-border-3-default: #3a3d45;
|
|
49
|
+
--ov-ui-bg-1-default: #131416;
|
|
50
|
+
--ov-ui-bg-3-default: #1b1d21;
|
|
51
|
+
--ov-ui-bg-4-default: #202227;
|
|
52
|
+
--ov-ui-bg-5-default: #23252a;
|
|
53
|
+
--ov-ui-focus-default: #5f5fff;
|
|
54
|
+
--ov-ui-fill-hover-default: #23252a;
|
|
55
|
+
--ov-ui-status-error-default: #ff9595;
|
|
56
|
+
--ov-ui-warning-default: #e0a04a;
|
|
57
|
+
--ov-ui-warning-light-default: #3a2f14;
|
|
58
|
+
--ov-ui-tooltip-bg-default: #2a2d33;
|
|
59
|
+
--ov-ui-tooltip-text-default: #f0f1f3;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.ov-agent-connect {
|
|
63
|
+
--ov-ui-connect-card-default: #fbfbfc;
|
|
64
|
+
--ov-ui-connect-tabs-default: #f7f7f9;
|
|
65
|
+
--ov-ui-connect-selected-default: #f3f4f7;
|
|
66
|
+
--ov-ui-connect-border-default: #edeef2;
|
|
67
|
+
--ov-ui-connect-outline-default: #e1e3ea;
|
|
68
|
+
--ov-ui-connect-muted-default: #787c91;
|
|
69
|
+
--ov-ui-connect-notice-default: #2e2984;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.dark .ov-agent-connect {
|
|
73
|
+
--ov-ui-connect-card-default: var(--ov-ui-bg-3-default);
|
|
74
|
+
--ov-ui-connect-tabs-default: var(--ov-ui-bg-3-default);
|
|
75
|
+
--ov-ui-connect-selected-default: var(--ov-ui-bg-4-default);
|
|
76
|
+
--ov-ui-connect-border-default: var(--ov-ui-border-1-default);
|
|
77
|
+
--ov-ui-connect-outline-default: var(--ov-ui-border-2-default);
|
|
78
|
+
--ov-ui-connect-muted-default: var(--ov-ui-text-3-default);
|
|
79
|
+
--ov-ui-connect-notice-default: var(--ov-ui-text-2-default);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.ov-divider {
|
|
83
|
+
box-sizing: border-box;
|
|
84
|
+
display: block;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.ov-file-browser-entries {
|
|
88
|
+
--ov-file-browser-entries-height: 32px;
|
|
89
|
+
box-sizing: border-box;
|
|
90
|
+
height: var(--ov-file-browser-entries-height);
|
|
91
|
+
background: color-mix(in srgb,
|
|
92
|
+
var(--ov-ui-color-primary, var(--ov-ui-primary-default, #5252ff)) 6%,
|
|
93
|
+
var(--ov-ui-color-bg-1, var(--ov-ui-bg-1-default, #fff)));
|
|
94
|
+
border-radius: 8px;
|
|
95
|
+
justify-content: center;
|
|
96
|
+
align-items: center;
|
|
97
|
+
gap: 6px;
|
|
98
|
+
display: flex;
|
|
99
|
+
overflow: hidden;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.ov-file-browser-entries__entry {
|
|
103
|
+
min-width: 1px;
|
|
104
|
+
height: var(--ov-file-browser-entries-height);
|
|
105
|
+
color: var(--ov-ui-color-primary, var(--ov-ui-primary-default, #5252ff));
|
|
106
|
+
font: inherit;
|
|
107
|
+
letter-spacing: .039px;
|
|
108
|
+
white-space: nowrap;
|
|
109
|
+
cursor: pointer;
|
|
110
|
+
background: none;
|
|
111
|
+
border: 0;
|
|
112
|
+
border-radius: 6px;
|
|
113
|
+
flex: 1 0 0;
|
|
114
|
+
justify-content: center;
|
|
115
|
+
align-items: center;
|
|
116
|
+
gap: 6px;
|
|
117
|
+
padding: 0;
|
|
118
|
+
font-size: 13px;
|
|
119
|
+
font-weight: 500;
|
|
120
|
+
line-height: 22px;
|
|
121
|
+
transition: background-color .16s;
|
|
122
|
+
display: inline-flex;
|
|
123
|
+
overflow: hidden;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.ov-file-browser-entries__entry:hover:not(:disabled) {
|
|
127
|
+
background: color-mix(in srgb,
|
|
128
|
+
var(--ov-ui-color-primary, var(--ov-ui-primary-default, #5252ff)) 10%,
|
|
129
|
+
transparent);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.ov-file-browser-entries__entry:focus-visible {
|
|
133
|
+
outline: 2px solid
|
|
134
|
+
var(--ov-ui-color-focus, var(--ov-ui-focus-default, #5252ff));
|
|
135
|
+
outline-offset: -2px;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.ov-file-browser-entries__entry:disabled {
|
|
139
|
+
color: var(--ov-ui-color-text-disabled, var(--ov-ui-text-disabled-default, #a5a7bb));
|
|
140
|
+
cursor: not-allowed;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.ov-file-browser-entries__icon {
|
|
144
|
+
flex: none;
|
|
145
|
+
align-items: center;
|
|
146
|
+
display: inline-flex;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.ov-file-browser-entries__label {
|
|
150
|
+
text-overflow: ellipsis;
|
|
151
|
+
overflow: hidden;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
File without changes
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* 文件浏览入口条的文案。两项的文案都可替换,缺省为英文。
|
|
4
|
+
* Copy of the file browser entry row. Both labels are replaceable, English by
|
|
5
|
+
* default.
|
|
6
|
+
*/
|
|
7
|
+
export interface FileBrowserEntriesLabels {
|
|
8
|
+
/** 连接 Agent 的文案。Label of the connect-agent entry. */
|
|
9
|
+
connectAgent?: string;
|
|
10
|
+
/** 导入资源的文案。Label of the import-resources entry. */
|
|
11
|
+
importResources?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* 文件浏览入口条的属性。
|
|
15
|
+
*
|
|
16
|
+
* 它固定是两个入口:连接 Agent 与导入资源。宿主只决定显示哪几个、点击后做
|
|
17
|
+
* 什么,图标、文案、等分排布与两者之间的分隔线都由组件负责——这两项在每个
|
|
18
|
+
* 宿主下外观都相同,差别只在点击行为。
|
|
19
|
+
*
|
|
20
|
+
* 只显示一个入口时不画分隔线:线分隔的是两个相邻项,只剩一个就无从分隔。
|
|
21
|
+
*
|
|
22
|
+
* Props of the file browser entry row.
|
|
23
|
+
*
|
|
24
|
+
* It is fixed to two entries: connect an agent, import resources. The host only
|
|
25
|
+
* decides which appear and what a click does; the icons, copy, equal-width layout
|
|
26
|
+
* and the divider between them belong to the component, because both look the same
|
|
27
|
+
* under every host and differ only in behaviour.
|
|
28
|
+
*
|
|
29
|
+
* With a single entry no divider is drawn: a divider separates two neighbours, and
|
|
30
|
+
* there is nothing left to separate.
|
|
31
|
+
*/
|
|
32
|
+
export interface FileBrowserEntriesProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
33
|
+
/**
|
|
34
|
+
* 连接 Agent 成功后触发。省略时不显示该入口。
|
|
35
|
+
* Called after the connect-agent entry is clicked. Omit it to hide that entry.
|
|
36
|
+
*/
|
|
37
|
+
onConnectAgent?: () => void;
|
|
38
|
+
/**
|
|
39
|
+
* 导入资源成功后触发。省略时不显示该入口。
|
|
40
|
+
* Called after the import-resources entry is clicked. Omit it to hide that entry.
|
|
41
|
+
*/
|
|
42
|
+
onImportResources?: () => void;
|
|
43
|
+
/** 可替换文案,缺省为英文。Replaceable copy; English by default. */
|
|
44
|
+
labels?: FileBrowserEntriesLabels;
|
|
45
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FileBrowserEntries } from "../2~0.js";
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ViewerHandle, ViewerViewModeOption } from '@ark-design/ui/file-viewer/core';
|
|
2
|
+
import type { FilePreviewActions } from './types.js';
|
|
3
|
+
import type { useFilePreviewEditing } from './use-file-preview-editing.js';
|
|
4
|
+
import type { FilePreviewDirectoryTab, FilePreviewLabels, FilePreviewViewMode } from './types.js';
|
|
5
|
+
/**
|
|
6
|
+
* 目录页签的正文:标题行之下多一层同级视图切换(L0 摘要 / L1 总览),每一级
|
|
7
|
+
* 各自是一份 Markdown,走与文件页签相同的渲染路径。
|
|
8
|
+
*
|
|
9
|
+
* 这一层属于目录这种实体:文件没有同级视图可切,给它加同样的插槽只会留一个
|
|
10
|
+
* 永远空着的位置。
|
|
11
|
+
*
|
|
12
|
+
* The body of a directory tab: one extra level of sibling switching between
|
|
13
|
+
* summary levels (L0 / L1) under the header, each level its own Markdown going
|
|
14
|
+
* through the same rendering path as a file tab.
|
|
15
|
+
*
|
|
16
|
+
* That level belongs to the directory entity: a file has no sibling views to
|
|
17
|
+
* switch, so giving it the same slot would only leave a permanently empty space.
|
|
18
|
+
*/
|
|
19
|
+
export interface FilePreviewDirectoryBodyProps {
|
|
20
|
+
tab: FilePreviewDirectoryTab;
|
|
21
|
+
text: Required<FilePreviewLabels>;
|
|
22
|
+
locale?: 'en-US' | 'zh-CN';
|
|
23
|
+
actions: FilePreviewActions;
|
|
24
|
+
editing: ReturnType<typeof useFilePreviewEditing>;
|
|
25
|
+
viewMode: FilePreviewViewMode;
|
|
26
|
+
onViewModeChange: (mode: FilePreviewViewMode) => void;
|
|
27
|
+
onHandleChange: (handle: ViewerHandle | null) => void;
|
|
28
|
+
onViewModesChange: (modes: readonly ViewerViewModeOption[]) => void;
|
|
29
|
+
onDownload: () => void;
|
|
30
|
+
onCancelEditing: () => void;
|
|
31
|
+
}
|
|
32
|
+
export declare function FilePreviewDirectoryBody({ tab, text, locale, actions, editing, viewMode, onViewModeChange, onHandleChange, onViewModesChange, onDownload, onCancelEditing, }: FilePreviewDirectoryBodyProps): import("react").JSX.Element | null;
|
|
@@ -1,6 +1,24 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { FilePreviewActions } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* 标题行需要的最少信息。它按字段而不是按页签类型取值,文件页签与目录页签因此
|
|
5
|
+
* 共用同一条渲染路径——两者的路径行本来就一样。
|
|
6
|
+
*
|
|
7
|
+
* The least a header needs. It reads fields rather than a tab kind, so a file tab
|
|
8
|
+
* and a directory tab share one rendering path — their path rows are the same.
|
|
9
|
+
*/
|
|
2
10
|
export interface FilePreviewHeaderProps {
|
|
3
|
-
|
|
11
|
+
/** 完整路径,显示为面包屑;省略时面包屑退化为文件名。 */
|
|
12
|
+
path?: string;
|
|
13
|
+
/** 无路径时回落到文件名。Falls back to the file name when there is no path. */
|
|
14
|
+
fileName: string;
|
|
15
|
+
/** 能否沿路径向上打开。Whether an ancestor can be opened. */
|
|
16
|
+
canOpenParent: boolean;
|
|
17
|
+
/** 标题旁的额外内容。Extra content next to the title. */
|
|
18
|
+
titleExtra?: ReactNode;
|
|
19
|
+
/** 标题行动作区,节点或接收上下文的函数。 */
|
|
20
|
+
/** The header action area: a node, or a function of the actions context. */
|
|
21
|
+
slotActions?: ReactNode | ((actions: FilePreviewActions) => ReactNode);
|
|
4
22
|
actions: FilePreviewActions;
|
|
5
23
|
text: {
|
|
6
24
|
copyPath: string;
|
|
@@ -22,4 +40,4 @@ export interface FilePreviewHeaderProps {
|
|
|
22
40
|
* body, download, view switch, edit) carry host product semantics and copy, and
|
|
23
41
|
* the host renders them in `slots.actions` from the `actions` context.
|
|
24
42
|
*/
|
|
25
|
-
export declare function FilePreviewHeader({
|
|
43
|
+
export declare function FilePreviewHeader({ path, fileName, canOpenParent, titleExtra, slotActions, actions, text, onOpenParent, }: FilePreviewHeaderProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { MarkdownAdapterOptions } from '@ark-design/ui/file-viewer/adapters/markdown';
|
|
2
|
+
import type { ViewerHandle, ViewerViewModeOption } from '@ark-design/ui/file-viewer/core';
|
|
3
|
+
import type { HTMLAttributes } from 'react';
|
|
4
|
+
import type { useFilePreviewActions } from './use-file-preview-actions.js';
|
|
5
|
+
import type { FilePreviewActions } from './types.js';
|
|
6
|
+
import type { useFilePreviewEditing } from './use-file-preview-editing.js';
|
|
7
|
+
import type { FilePreviewContentTab, FilePreviewDirectoryTab, FilePreviewFileTab, FilePreviewLabels, FilePreviewTab, FilePreviewViewMode } from './types.js';
|
|
8
|
+
/**
|
|
9
|
+
* 页签正文的三种渲染分支:内容页签整块交给宿主,目录页签多一层摘要切换,文件
|
|
10
|
+
* 页签走底座。
|
|
11
|
+
*
|
|
12
|
+
* 单独成文件是因为三条分支的参数加起来让主组件超出了行数上限;分支本身仍是
|
|
13
|
+
* 主组件的一次渲染,没有引入新的状态。
|
|
14
|
+
*
|
|
15
|
+
* The three ways a tab body renders: a content tab hands the whole body to the
|
|
16
|
+
* host, a directory tab adds one summary-switching layer, and a file tab goes
|
|
17
|
+
* through the base component.
|
|
18
|
+
*
|
|
19
|
+
* It lives in its own file because the three branches' parameters pushed the main
|
|
20
|
+
* component past the line limit; it is still one render of that component and
|
|
21
|
+
* introduces no state of its own.
|
|
22
|
+
*/
|
|
23
|
+
export interface FilePreviewPanelsProps {
|
|
24
|
+
contentTab?: FilePreviewContentTab;
|
|
25
|
+
directoryTab?: FilePreviewDirectoryTab;
|
|
26
|
+
fileTab?: FilePreviewFileTab;
|
|
27
|
+
panelProps: HTMLAttributes<HTMLDivElement>;
|
|
28
|
+
panelClass: string;
|
|
29
|
+
text: Required<FilePreviewLabels>;
|
|
30
|
+
locale?: 'en-US' | 'zh-CN';
|
|
31
|
+
actions: ReturnType<typeof useFilePreviewActions>;
|
|
32
|
+
actionContext: FilePreviewActions;
|
|
33
|
+
editing: ReturnType<typeof useFilePreviewEditing>;
|
|
34
|
+
viewMode: FilePreviewViewMode;
|
|
35
|
+
setViewMode: (mode: FilePreviewViewMode) => void;
|
|
36
|
+
onHandleChange: (handle: ViewerHandle | null) => void;
|
|
37
|
+
onViewModesChange: (modes: readonly ViewerViewModeOption[]) => void;
|
|
38
|
+
linkClickHandler?: MarkdownAdapterOptions['onLinkClick'];
|
|
39
|
+
activeTab: FilePreviewTab;
|
|
40
|
+
}
|
|
41
|
+
export declare function FilePreviewPanels({ contentTab, directoryTab, fileTab, panelProps, panelClass, text, locale, actions, actionContext, editing, viewMode, setViewMode, onHandleChange, onViewModesChange, linkClickHandler, activeTab, }: FilePreviewPanelsProps): import("react").JSX.Element | null;
|
|
@@ -7,9 +7,16 @@ export declare function EmptyFileState({ text, }: {
|
|
|
7
7
|
export declare function NoContentState({ text, }: {
|
|
8
8
|
text: Required<FilePreviewLabels>;
|
|
9
9
|
}): import("react").JSX.Element;
|
|
10
|
-
/**
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
/**
|
|
11
|
+
* 加载态。只用到 `loading` 一条文案,因此参数收窄到这一项:宿主在正文还没
|
|
12
|
+
* 取回来时手上没有完整的一套文案,也不该为了显示加载中而编一份。
|
|
13
|
+
*
|
|
14
|
+
* A loading state. Only `loading` is read, so the parameter narrows to that one
|
|
15
|
+
* field: a host that has not received the body yet has no full copy set, and should
|
|
16
|
+
* not have to invent one just to show that something is loading.
|
|
17
|
+
*/
|
|
18
|
+
export declare function LoadingState({ text, }: {
|
|
19
|
+
text: Pick<FilePreviewLabels, 'loading'>;
|
|
13
20
|
}): import("react").JSX.Element;
|
|
14
21
|
/** 读取失败态,带重试入口。A read-failure state with a retry entry. */
|
|
15
22
|
export declare function LoadFailedState({ text, description, onRetry, }: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { FilePreviewComponent } from './types.js';
|
|
2
|
-
export
|
|
2
|
+
export { LoadingState } from './file-preview-state.js';
|
|
3
|
+
export type { FilePreviewActions, FilePreviewComponent, FilePreviewContentTab, FilePreviewDirectoryLevel, FilePreviewDirectoryTab, FilePreviewEditing, FilePreviewFileTab, FilePreviewFileTabSlots, FilePreviewHandle, FilePreviewHeaderSlots, FilePreviewLabels, FilePreviewOperations, FilePreviewProps, FilePreviewSource, FilePreviewTab, FilePreviewTabBase, FilePreviewViewMode, } from './types.js';
|
|
3
4
|
/**
|
|
4
5
|
* 文件预览:页签行、内容区标题行与正文组成的外壳,正文由底座按格式渲染。
|
|
5
6
|
*
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 目录页签的初始层级:受控值优先,其次是非受控时记下的选择,然后是
|
|
3
|
+
* `defaultLevelKey`,最后回落到第一级。
|
|
4
|
+
*
|
|
5
|
+
* 单列成纯函数是因为它有一条容易漏掉的规则:外壳算出的 `activeLevelKey` 是受控
|
|
6
|
+
* 值,正文组件因此没有机会用上自己的初值,`defaultLevelKey` 必须在这里就被尊重,
|
|
7
|
+
* 否则宿主声明的默认层级会被静默改成第一级。
|
|
8
|
+
*
|
|
9
|
+
* The initial level of a directory tab: the controlled value first, then the choice
|
|
10
|
+
* recorded while uncontrolled, then `defaultLevelKey`, and the first level as the last
|
|
11
|
+
* resort.
|
|
12
|
+
*
|
|
13
|
+
* It is a standalone pure function because of one easily missed rule: the
|
|
14
|
+
* `activeLevelKey` the shell computes is a controlled value, so the body component never
|
|
15
|
+
* applies its own initial one — `defaultLevelKey` has to be honoured here, or the
|
|
16
|
+
* host's declared default is silently replaced by the first level.
|
|
17
|
+
*/
|
|
18
|
+
export interface LevelChoiceTab {
|
|
19
|
+
levels: readonly {
|
|
20
|
+
key: string;
|
|
21
|
+
}[];
|
|
22
|
+
activeLevelKey?: string;
|
|
23
|
+
defaultLevelKey?: string;
|
|
24
|
+
}
|
|
25
|
+
export declare function initialLevelKey(tab: LevelChoiceTab, remembered: Readonly<Record<string, string>>, tabKey: string): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.ov-agent-connect, .ov-file-browser, .ov-file-preview, .ov-file-tree, .ov-module-placeholder, .ov-scope-switcher, .ov-tooltip, .ov-tui, .ov-viking-bot, .ov-viking-bot__interaction {
|
|
1
|
+
.ov-agent-connect, .ov-divider, .ov-file-browser, .ov-file-browser-entries, .ov-file-preview, .ov-file-tree, .ov-module-placeholder, .ov-popover, .ov-scope-switcher, .ov-tooltip, .ov-tui, .ov-viking-bot, .ov-viking-bot__interaction {
|
|
2
2
|
--ov-ui-primary-default: #5252ff;
|
|
3
3
|
--ov-ui-primary-hover-default: #7075ff;
|
|
4
4
|
--ov-ui-primary-active-default: #3833d2;
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
--ov-ui-tooltip-text-default: #fff;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
.dark .ov-agent-connect, .dark .ov-file-browser, .dark .ov-file-preview, .dark .ov-file-tree, .dark .ov-module-placeholder, .dark .ov-scope-switcher, .dark .ov-tooltip, .dark .ov-tui, .dark .ov-viking-bot, .dark .ov-viking-bot__interaction {
|
|
33
|
+
.dark .ov-agent-connect, .dark .ov-divider, .dark .ov-file-browser, .dark .ov-file-browser-entries, .dark .ov-file-preview, .dark .ov-file-tree, .dark .ov-module-placeholder, .dark .ov-popover, .dark .ov-scope-switcher, .dark .ov-tooltip, .dark .ov-tui, .dark .ov-viking-bot, .dark .ov-viking-bot__interaction {
|
|
34
34
|
--ov-ui-primary-default: #5f5fff;
|
|
35
35
|
--ov-ui-primary-hover-default: #7075ff;
|
|
36
36
|
--ov-ui-primary-active-default: #4242ba;
|
|
@@ -258,7 +258,6 @@
|
|
|
258
258
|
}
|
|
259
259
|
|
|
260
260
|
.ov-file-preview__header {
|
|
261
|
-
border-bottom: 1px solid var(--ov-ui-file-preview-border);
|
|
262
261
|
flex: none;
|
|
263
262
|
justify-content: space-between;
|
|
264
263
|
align-items: center;
|
|
@@ -593,6 +592,80 @@
|
|
|
593
592
|
font-size: 12px;
|
|
594
593
|
}
|
|
595
594
|
|
|
595
|
+
.ov-file-preview__levels {
|
|
596
|
+
flex: none;
|
|
597
|
+
align-items: stretch;
|
|
598
|
+
gap: 32px;
|
|
599
|
+
height: 34px;
|
|
600
|
+
padding: 0 16px;
|
|
601
|
+
display: flex;
|
|
602
|
+
position: relative;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
.ov-file-preview__level {
|
|
606
|
+
color: var(--ov-ui-file-preview-text-muted);
|
|
607
|
+
font: inherit;
|
|
608
|
+
letter-spacing: .039px;
|
|
609
|
+
cursor: pointer;
|
|
610
|
+
background: none;
|
|
611
|
+
border: 0;
|
|
612
|
+
align-items: center;
|
|
613
|
+
padding: 0 0 2px;
|
|
614
|
+
font-size: 13px;
|
|
615
|
+
line-height: 22px;
|
|
616
|
+
transition: color .16s;
|
|
617
|
+
display: inline-flex;
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
.ov-file-preview__level:hover {
|
|
621
|
+
color: var(--ov-ui-file-preview-text);
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
.ov-file-preview__level[data-active] {
|
|
625
|
+
color: var(--ov-ui-file-preview-text);
|
|
626
|
+
font-weight: 500;
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
.ov-file-preview__level-indicator {
|
|
630
|
+
background: var(--ov-ui-file-preview-text);
|
|
631
|
+
border-radius: 1px;
|
|
632
|
+
height: 2px;
|
|
633
|
+
transition: transform .2s cubic-bezier(.2, 0, 0, 1), width .2s cubic-bezier(.2, 0, 0, 1);
|
|
634
|
+
position: absolute;
|
|
635
|
+
bottom: 0;
|
|
636
|
+
left: 0;
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
@media (prefers-reduced-motion: reduce) {
|
|
640
|
+
.ov-file-preview__level-indicator {
|
|
641
|
+
transition: none;
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
.ov-file-preview__spinner {
|
|
646
|
+
box-sizing: border-box;
|
|
647
|
+
border: 2px solid var(--ov-ui-file-preview-border);
|
|
648
|
+
border-top-color: var(--ov-ui-file-preview-text-muted);
|
|
649
|
+
border-radius: 50%;
|
|
650
|
+
flex: none;
|
|
651
|
+
width: 16px;
|
|
652
|
+
height: 16px;
|
|
653
|
+
animation: .9s linear infinite ov-file-preview-spin;
|
|
654
|
+
display: inline-block;
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
@keyframes ov-file-preview-spin {
|
|
658
|
+
to {
|
|
659
|
+
transform: rotate(360deg);
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
@media (prefers-reduced-motion: reduce) {
|
|
664
|
+
.ov-file-preview__spinner {
|
|
665
|
+
animation-duration: 2s;
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
|
|
596
669
|
/*!
|
|
597
670
|
* Copyright (c) 2026 Bytedance, Inc. and its affiliates.
|
|
598
671
|
* SPDX-License-Identifier: MIT
|
|
@@ -112,7 +112,7 @@ export interface FilePreviewTabBase {
|
|
|
112
112
|
* 文件预览页签或宿主自定义内容页签。
|
|
113
113
|
* A file-preview tab or a tab with host-provided content.
|
|
114
114
|
*/
|
|
115
|
-
export type FilePreviewTab = FilePreviewFileTab | FilePreviewContentTab;
|
|
115
|
+
export type FilePreviewTab = FilePreviewFileTab | FilePreviewContentTab | FilePreviewDirectoryTab;
|
|
116
116
|
/**
|
|
117
117
|
* 按文件格式预览 `source` 的页签。
|
|
118
118
|
* A tab that previews `source` according to its file format.
|
|
@@ -123,6 +123,18 @@ export interface FilePreviewFileTab extends FilePreviewTabBase {
|
|
|
123
123
|
* Tab kind discriminator, always `file`.
|
|
124
124
|
*/
|
|
125
125
|
kind: 'file';
|
|
126
|
+
/**
|
|
127
|
+
* 正文是否还在读取。为真时组件渲染加载态而不是正文,外壳(页签行、路径行)
|
|
128
|
+
* 照常显示——宿主切换文件时外壳因此不闪,只有正文区在等。
|
|
129
|
+
*
|
|
130
|
+
* `source` 在加载中可以为空;组件不会把它判成「空文件」。
|
|
131
|
+
*
|
|
132
|
+
* Whether the body is still being read. When true the component renders its
|
|
133
|
+
* loading state instead of the body while the shell — tab row, path row — stays
|
|
134
|
+
* put, so a host switching files does not flash the whole area. `source` may be
|
|
135
|
+
* empty while loading; it is not treated as an empty file.
|
|
136
|
+
*/
|
|
137
|
+
loading?: boolean;
|
|
126
138
|
/**
|
|
127
139
|
* 要预览的内容及文件信息。
|
|
128
140
|
* The content and file information to preview.
|
|
@@ -203,6 +215,93 @@ export interface FilePreviewContentTab extends FilePreviewTabBase {
|
|
|
203
215
|
*/
|
|
204
216
|
content: ReactNode;
|
|
205
217
|
}
|
|
218
|
+
/**
|
|
219
|
+
* 目录页签:一个目录的若干级摘要,例如 L0 摘要与 L1 总览。
|
|
220
|
+
*
|
|
221
|
+
* 它和文件页签的区别在于**正文的层级**:文件页签只有正文;目录页签在标题行
|
|
222
|
+
* 之下、正文之上还有一层同级视图切换(下划线页签),每一级各自是一份
|
|
223
|
+
* Markdown。这一层属于目录这种实体,不属于所有文件页签,因此单独开一类,
|
|
224
|
+
* 而不是给文件页签加一个通用插槽——那样每个文件页签都会多一个它用不到的
|
|
225
|
+
* 空位。
|
|
226
|
+
*
|
|
227
|
+
* A tab for a directory's summary levels, for example its L0 abstract and L1
|
|
228
|
+
* overview.
|
|
229
|
+
*
|
|
230
|
+
* It differs from a file tab in the layering of the body: a file tab has a body
|
|
231
|
+
* and nothing else, while a directory tab has one more level between the header
|
|
232
|
+
* and the body — an underlined switch between sibling views, each holding its own
|
|
233
|
+
* Markdown. That level belongs to the directory entity rather than to every file
|
|
234
|
+
* tab, so it gets its own kind instead of a generic slot on file tabs, which would
|
|
235
|
+
* leave every file tab with an empty space it never uses.
|
|
236
|
+
*/
|
|
237
|
+
export interface FilePreviewDirectoryTab extends FilePreviewTabBase {
|
|
238
|
+
/**
|
|
239
|
+
* 页签类型标记,固定为 `directory`。
|
|
240
|
+
* Tab kind discriminator, always `directory`.
|
|
241
|
+
*/
|
|
242
|
+
kind: 'directory';
|
|
243
|
+
/**
|
|
244
|
+
* 摘要是否还在读取。与文件页签同义:为真时正文区显示加载态,外壳照常。
|
|
245
|
+
* Whether the summary is still being read. Same as a file tab: the body shows
|
|
246
|
+
* the loading state while the shell stays put.
|
|
247
|
+
*/
|
|
248
|
+
loading?: boolean;
|
|
249
|
+
/**
|
|
250
|
+
* 可切换的摘要层级,至少一级。每级用 `source` 交给组件按格式渲染,与文件
|
|
251
|
+
* 页签的正文同一条渲染路径。
|
|
252
|
+
* The summary levels to switch between, at least one. Each level's `source` goes
|
|
253
|
+
* through the same rendering path as a file tab's body.
|
|
254
|
+
*/
|
|
255
|
+
levels: readonly [FilePreviewDirectoryLevel, ...FilePreviewDirectoryLevel[]];
|
|
256
|
+
/**
|
|
257
|
+
* 受控的当前层级 key。传入时由宿主决定层级,组件只上报切换意图。
|
|
258
|
+
* The controlled active level key. When given, the host owns the level and the
|
|
259
|
+
* component only reports switch intent.
|
|
260
|
+
*/
|
|
261
|
+
activeLevelKey?: string;
|
|
262
|
+
/**
|
|
263
|
+
* 非受控时的初始层级 key,省略时选中第一级。
|
|
264
|
+
* Initial level key when uncontrolled; the first level is selected when omitted.
|
|
265
|
+
*/
|
|
266
|
+
defaultLevelKey?: string;
|
|
267
|
+
/**
|
|
268
|
+
* 当前层级变化后触发,参数为新的层级 key。
|
|
269
|
+
* Called after the active level changes, with the new level key.
|
|
270
|
+
*/
|
|
271
|
+
onActiveLevelChange?: (key: string) => void;
|
|
272
|
+
/**
|
|
273
|
+
* 目录操作的执行能力,例如沿路径向上打开。省略对应方法时该操作不可用。
|
|
274
|
+
* Directory operation capabilities, for example opening an ancestor. Omitting a
|
|
275
|
+
* method makes its operation unavailable.
|
|
276
|
+
*/
|
|
277
|
+
operations?: FilePreviewOperations;
|
|
278
|
+
/**
|
|
279
|
+
* 目录页签的插槽。标题行动作与状态兜底与文件页签一致。
|
|
280
|
+
* Slots of a directory tab. Header actions and state fallbacks match a file tab.
|
|
281
|
+
*/
|
|
282
|
+
slots?: FilePreviewFileTabSlots;
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* 目录的一级摘要。One summary level of a directory.
|
|
286
|
+
*/
|
|
287
|
+
export interface FilePreviewDirectoryLevel {
|
|
288
|
+
/**
|
|
289
|
+
* 层级唯一标识,用于切换与受控状态。
|
|
290
|
+
* Unique level key, used for switching and controlled state.
|
|
291
|
+
*/
|
|
292
|
+
key: string;
|
|
293
|
+
/**
|
|
294
|
+
* 页签行显示的名称,例如「L0 摘要」。
|
|
295
|
+
* What the level switch shows, for example "L0 Summary".
|
|
296
|
+
*/
|
|
297
|
+
label: ReactNode;
|
|
298
|
+
/**
|
|
299
|
+
* 该级的正文来源,与文件页签的 `source` 同形,交给组件按格式渲染。
|
|
300
|
+
* The body source of this level, the same shape as a file tab's `source`, handed
|
|
301
|
+
* to the component for format rendering.
|
|
302
|
+
*/
|
|
303
|
+
source: FilePreviewSource;
|
|
304
|
+
}
|
|
206
305
|
/**
|
|
207
306
|
* 文件操作的执行能力。方法返回的 Promise 完成后才触发对应的成功通知。
|
|
208
307
|
* File operation capabilities. The matching success notification fires only
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { FilePreviewDirectoryTab, FilePreviewSource } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* 目录页签当前看的是哪一级摘要。
|
|
4
|
+
*
|
|
5
|
+
* 它必须由预览外壳持有,而不是留在正文组件内部:复制正文取的是「用户正在看的
|
|
6
|
+
* 那一份」,标题行的路径也来自同一级,两处都在外壳这一层取值;留在正文里,复制
|
|
7
|
+
* 到的永远是第一级。
|
|
8
|
+
*
|
|
9
|
+
* 宿主给了 `activeLevelKey` 时以宿主的为准,这里只记非受控页签自己的选择。
|
|
10
|
+
*
|
|
11
|
+
* Which summary level of a directory tab is on screen.
|
|
12
|
+
*
|
|
13
|
+
* It belongs to the preview shell rather than inside the body component: copy-content
|
|
14
|
+
* takes "what the user is looking at" and the header path comes from the same level,
|
|
15
|
+
* both read at this layer — kept in the body, a copy would always take the first
|
|
16
|
+
* level.
|
|
17
|
+
*
|
|
18
|
+
* A host-supplied `activeLevelKey` wins; this only records the choice of an
|
|
19
|
+
* uncontrolled tab.
|
|
20
|
+
*/
|
|
21
|
+
export interface DirectoryLevelState {
|
|
22
|
+
/** 实际渲染的那一级。The level actually rendered. */
|
|
23
|
+
activeLevel?: FilePreviewDirectoryTab['levels'][number];
|
|
24
|
+
/** 把当前层级固定下来的目录页签,交给正文组件。 */
|
|
25
|
+
/** The directory tab with the level pinned, handed to the body. */
|
|
26
|
+
directoryTab?: FilePreviewDirectoryTab;
|
|
27
|
+
/** 复制路径与复制正文共用的来源。The source shared by copy-path and copy-content. */
|
|
28
|
+
source?: FilePreviewSource;
|
|
29
|
+
}
|
|
30
|
+
export declare function useDirectoryLevel(tab: FilePreviewDirectoryTab | undefined): DirectoryLevelState;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { useFilePreviewActions } from './use-file-preview-actions.js';
|
|
2
2
|
import type { useFilePreviewEditing } from './use-file-preview-editing.js';
|
|
3
|
-
import type { FilePreviewActions, FilePreviewFileTab, FilePreviewTab, FilePreviewViewMode } from './types.js';
|
|
3
|
+
import type { FilePreviewActions, FilePreviewFileTab, FilePreviewSource, FilePreviewTab, FilePreviewViewMode } from './types.js';
|
|
4
4
|
type Operations = ReturnType<typeof useFilePreviewActions>;
|
|
5
5
|
type Editing = ReturnType<typeof useFilePreviewEditing>;
|
|
6
6
|
/**
|
|
@@ -11,9 +11,13 @@ type Editing = ReturnType<typeof useFilePreviewEditing>;
|
|
|
11
11
|
* and operation state together with the methods that change them, so a
|
|
12
12
|
* `slots.actions` renderer can build its own buttons.
|
|
13
13
|
*/
|
|
14
|
-
export declare function useFilePreviewActionsContext({ activeTab, fileTab, viewMode, canSwitchView, setViewMode, editing, operations, }: {
|
|
14
|
+
export declare function useFilePreviewActionsContext({ activeTab, fileTab, currentPath, currentSource, viewMode, canSwitchView, setViewMode, editing, operations, }: {
|
|
15
15
|
activeTab: FilePreviewTab;
|
|
16
16
|
fileTab?: FilePreviewFileTab;
|
|
17
|
+
/** 当前页签的路径;目录页签也有。The current tab's path; a directory has one too. */
|
|
18
|
+
currentPath?: string;
|
|
19
|
+
/** 当前页签的正文来源;目录页签取当前那一级。The body source; a directory uses its active level. */
|
|
20
|
+
currentSource?: FilePreviewSource;
|
|
17
21
|
viewMode: FilePreviewViewMode;
|
|
18
22
|
canSwitchView: boolean;
|
|
19
23
|
setViewMode: (mode: FilePreviewViewMode) => void;
|
|
@@ -15,5 +15,5 @@ export declare function useFilePreviewActions(): {
|
|
|
15
15
|
download: (tab: FilePreviewFileTab) => Promise<void>;
|
|
16
16
|
openUri: (tab: FilePreviewFileTab, uri: string) => Promise<void>;
|
|
17
17
|
copyPath: (tab: FilePreviewTab, path: string) => Promise<boolean>;
|
|
18
|
-
copyContent: (tab:
|
|
18
|
+
copyContent: (tab: FilePreviewTab, text: string) => Promise<boolean>;
|
|
19
19
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { FilePreview } from "../
|
|
1
|
+
export { FilePreview, LoadingState } from "../30~0.js";
|