@veltra/desktop 1.10.0 → 1.11.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/dist/components/ai-button/ai-button.js +117 -0
- package/dist/components/ai-button/ai-button.js.map +1 -0
- package/dist/components/ai-button/style.d.ts +1 -0
- package/dist/components/ai-button/style.js +3 -0
- package/dist/components/ai-button/style2.css +29 -0
- package/dist/components/code-editor/basic-setup.js +5 -5
- package/dist/components/code-editor/code-editor.js +2 -2
- package/dist/components/code-editor/langs/bash/index.js +2 -2
- package/dist/components/code-editor/langs/powershell/index.js +2 -2
- package/dist/components/code-editor/langs/spel/index.js +1 -1
- package/dist/components/code-editor/langs/spel/language.js +1 -1
- package/dist/components/code-editor/shell-extension.js +2 -2
- package/dist/components/file-viewer/previewers/pdf-worker-wrapper.js.map +1 -1
- package/dist/components/file-viewer/previewers/sheet-previewer.js +5 -5
- package/dist/components/file-viewer/previewers/sheet-previewer.js.map +1 -1
- package/dist/components/file-viewer/style2.css +42 -176
- package/dist/components/index.d.ts +2 -1
- package/dist/components/index.js +3 -1
- package/dist/components/index.js.map +1 -1
- package/dist/index.d.ts +108 -106
- package/dist/index.js +107 -106
- package/dist/node_modules/.bun/@codemirror_autocomplete@6.20.3/node_modules/@codemirror/autocomplete/dist/index.js +3 -3
- package/dist/node_modules/.bun/@codemirror_autocomplete@6.20.3/node_modules/@codemirror/autocomplete/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/{@codemirror_commands@6.11.0 → @codemirror_commands@6.11.1}/node_modules/@codemirror/commands/dist/index.js +6 -6
- package/dist/node_modules/.bun/@codemirror_commands@6.11.1/node_modules/@codemirror/commands/dist/index.js.map +1 -0
- package/dist/node_modules/.bun/@codemirror_lang-css@6.3.1/node_modules/@codemirror/lang-css/dist/index.js +1 -1
- package/dist/node_modules/.bun/@codemirror_lang-css@6.3.1/node_modules/@codemirror/lang-css/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@codemirror_lang-html@6.4.12/node_modules/@codemirror/lang-html/dist/index.js +3 -3
- package/dist/node_modules/.bun/@codemirror_lang-html@6.4.12/node_modules/@codemirror/lang-html/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@codemirror_lang-java@6.0.2/node_modules/@codemirror/lang-java/dist/index.js +1 -1
- package/dist/node_modules/.bun/@codemirror_lang-java@6.0.2/node_modules/@codemirror/lang-java/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@codemirror_lang-javascript@6.2.5/node_modules/@codemirror/lang-javascript/dist/index.js +3 -3
- package/dist/node_modules/.bun/@codemirror_lang-javascript@6.2.5/node_modules/@codemirror/lang-javascript/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@codemirror_lang-json@6.0.2/node_modules/@codemirror/lang-json/dist/index.js +1 -1
- package/dist/node_modules/.bun/@codemirror_lang-json@6.0.2/node_modules/@codemirror/lang-json/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@codemirror_lang-markdown@6.5.2/node_modules/@codemirror/lang-markdown/dist/index.js +3 -3
- package/dist/node_modules/.bun/@codemirror_lang-markdown@6.5.2/node_modules/@codemirror/lang-markdown/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@codemirror_lang-sql@6.10.0/node_modules/@codemirror/lang-sql/dist/index.js +1 -1
- package/dist/node_modules/.bun/@codemirror_lang-sql@6.10.0/node_modules/@codemirror/lang-sql/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/{@codemirror_language@6.12.4 → @codemirror_language@6.13.1}/node_modules/@codemirror/language/dist/index.js +5 -168
- package/dist/node_modules/.bun/@codemirror_language@6.13.1/node_modules/@codemirror/language/dist/index.js.map +1 -0
- package/dist/node_modules/.bun/{@codemirror_legacy-modes@6.5.4 → @codemirror_legacy-modes@6.5.5}/node_modules/@codemirror/legacy-modes/mode/powershell.js +1 -1
- package/dist/node_modules/.bun/{@codemirror_legacy-modes@6.5.4 → @codemirror_legacy-modes@6.5.5}/node_modules/@codemirror/legacy-modes/mode/powershell.js.map +1 -1
- package/dist/node_modules/.bun/{@codemirror_legacy-modes@6.5.4 → @codemirror_legacy-modes@6.5.5}/node_modules/@codemirror/legacy-modes/mode/shell.js +1 -1
- package/dist/node_modules/.bun/{@codemirror_legacy-modes@6.5.4 → @codemirror_legacy-modes@6.5.5}/node_modules/@codemirror/legacy-modes/mode/shell.js.map +1 -1
- package/dist/node_modules/.bun/@codemirror_lint@6.9.7/node_modules/@codemirror/lint/dist/index.js +2 -2
- package/dist/node_modules/.bun/@codemirror_lint@6.9.7/node_modules/@codemirror/lint/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/{@codemirror_search@6.7.1 → @codemirror_search@6.7.2}/node_modules/@codemirror/search/dist/index.js +10 -3
- package/dist/node_modules/.bun/@codemirror_search@6.7.2/node_modules/@codemirror/search/dist/index.js.map +1 -0
- package/dist/node_modules/.bun/{@codemirror_state@6.7.1 → @codemirror_state@6.7.6}/node_modules/@codemirror/state/dist/index.js +50 -16
- package/dist/node_modules/.bun/@codemirror_state@6.7.6/node_modules/@codemirror/state/dist/index.js.map +1 -0
- package/dist/node_modules/.bun/@codemirror_streamparser@6.0.0/node_modules/@codemirror/streamparser/dist/index.js +169 -0
- package/dist/node_modules/.bun/@codemirror_streamparser@6.0.0/node_modules/@codemirror/streamparser/dist/index.js.map +1 -0
- package/dist/node_modules/.bun/@codemirror_theme-one-dark@6.1.3/node_modules/@codemirror/theme-one-dark/dist/index.js +2 -2
- package/dist/node_modules/.bun/@codemirror_theme-one-dark@6.1.3/node_modules/@codemirror/theme-one-dark/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/{@codemirror_view@6.43.9 → @codemirror_view@6.43.14}/node_modules/@codemirror/view/dist/index.js +159 -93
- package/dist/node_modules/.bun/@codemirror_view@6.43.14/node_modules/@codemirror/view/dist/index.js.map +1 -0
- package/dist/node_modules/.bun/@lezer_common@1.5.3/node_modules/@lezer/common/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@lezer_css@1.3.9/node_modules/@lezer/css/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@lezer_highlight@1.2.5/node_modules/@lezer/highlight/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@lezer_html@1.3.13/node_modules/@lezer/html/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@lezer_java@1.1.5/node_modules/@lezer/java/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@lezer_javascript@1.5.6/node_modules/@lezer/javascript/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@lezer_json@1.0.3/node_modules/@lezer/json/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@lezer_lr@1.4.11/node_modules/@lezer/lr/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@lezer_markdown@1.8.0/node_modules/@lezer/markdown/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@marijn_find-cluster-break@1.0.4/node_modules/@marijn/find-cluster-break/src/index.js.map +1 -1
- package/dist/node_modules/.bun/crelt@1.0.7/node_modules/crelt/index.js.map +1 -1
- package/dist/node_modules/.bun/style-mod@4.1.4/node_modules/style-mod/src/style-mod.js.map +1 -1
- package/dist/node_modules/.bun/w3c-keyname@2.2.8/node_modules/w3c-keyname/index.js.map +1 -1
- package/dist/types/ai-button.d.ts +42 -0
- package/dist/types/index.d.ts +2 -1
- package/package.json +16 -16
- package/src/components/ai-button/__test__/ai-button.test.ts +375 -0
- package/src/components/ai-button/ai-button.vue +87 -0
- package/src/components/ai-button/index.ts +1 -0
- package/src/components/ai-button/style.scss +19 -0
- package/src/components/ai-button/style.ts +3 -0
- package/src/components/file-viewer/previewers/sheet-previewer.vue +1 -1
- package/src/components/file-viewer/style.scss +52 -233
- package/src/components/index.ts +2 -0
- package/src/types/ai-button.ts +44 -0
- package/src/types/index.ts +2 -0
- package/dist/node_modules/.bun/@codemirror_commands@6.11.0/node_modules/@codemirror/commands/dist/index.js.map +0 -1
- package/dist/node_modules/.bun/@codemirror_language@6.12.4/node_modules/@codemirror/language/dist/index.js.map +0 -1
- package/dist/node_modules/.bun/@codemirror_search@6.7.1/node_modules/@codemirror/search/dist/index.js.map +0 -1
- package/dist/node_modules/.bun/@codemirror_state@6.7.1/node_modules/@codemirror/state/dist/index.js.map +0 -1
- package/dist/node_modules/.bun/@codemirror_view@6.43.9/node_modules/@codemirror/view/dist/index.js.map +0 -1
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<!-- pre-input 变体:先经气泡收集补充输入,确认后再发请求 -->
|
|
3
|
+
<u-tip
|
|
4
|
+
v-if="variant === 'pre-input'"
|
|
5
|
+
trigger="click"
|
|
6
|
+
direction="bottom"
|
|
7
|
+
v-model:visible="visible"
|
|
8
|
+
>
|
|
9
|
+
<u-button :class="cls.b" :size="size" :icon="Sparkles" :loading="loading" />
|
|
10
|
+
|
|
11
|
+
<template #content>
|
|
12
|
+
<div :class="cls.e('main')">
|
|
13
|
+
<slot name="pre-input" />
|
|
14
|
+
</div>
|
|
15
|
+
<div :class="cls.e('action')">
|
|
16
|
+
<u-button size="small" type="primary" text @click="cancel"> 取消 </u-button>
|
|
17
|
+
<u-button size="small" type="primary" @click="confirm"> 确认 </u-button>
|
|
18
|
+
</div>
|
|
19
|
+
</template>
|
|
20
|
+
</u-tip>
|
|
21
|
+
|
|
22
|
+
<!-- 普通变体:点击即发 -->
|
|
23
|
+
<u-button v-else :class="cls.b" :size="size" :icon="Sparkles" :loading="loading" @click="send" />
|
|
24
|
+
</template>
|
|
25
|
+
|
|
26
|
+
<script lang="ts" setup>
|
|
27
|
+
import { useConfig } from '@veltra/compositions'
|
|
28
|
+
import { Sparkles } from '@veltra/icons'
|
|
29
|
+
import { bem, requestAiText } from '@veltra/utils'
|
|
30
|
+
import type { AiProviderConfig } from '@veltra/utils'
|
|
31
|
+
import { computed, ref } from 'vue'
|
|
32
|
+
|
|
33
|
+
import type { AiButtonEmits, AiButtonProps } from '../../types'
|
|
34
|
+
import { UButton } from '../button'
|
|
35
|
+
import { UTip } from '../tip'
|
|
36
|
+
|
|
37
|
+
defineOptions({ name: 'UAiButton' })
|
|
38
|
+
|
|
39
|
+
const { provider, systemPrompt, prompt, variant = 'default', size } = defineProps<AiButtonProps>()
|
|
40
|
+
|
|
41
|
+
const emit = defineEmits<AiButtonEmits>()
|
|
42
|
+
|
|
43
|
+
const cls = bem('ai-button')
|
|
44
|
+
|
|
45
|
+
const { config } = useConfig()
|
|
46
|
+
|
|
47
|
+
/** 配置优先级:实例 provider 字段 > 全局 ai 字段 > 默认值(stream 缺省 false) */
|
|
48
|
+
const requestConfig = computed<AiProviderConfig>(() => ({
|
|
49
|
+
stream: false,
|
|
50
|
+
...config.ai,
|
|
51
|
+
...provider
|
|
52
|
+
}))
|
|
53
|
+
|
|
54
|
+
/** 生成中:按钮 loading 转圈并禁用 */
|
|
55
|
+
const loading = ref(false)
|
|
56
|
+
|
|
57
|
+
/** 发起请求;生成中忽略重复触发 */
|
|
58
|
+
function send() {
|
|
59
|
+
if (loading.value) return
|
|
60
|
+
loading.value = true
|
|
61
|
+
|
|
62
|
+
requestAiText({
|
|
63
|
+
config: requestConfig.value,
|
|
64
|
+
prompt: prompt ?? '',
|
|
65
|
+
systemPrompt,
|
|
66
|
+
onDelta: (chunk) => emit('delta', chunk),
|
|
67
|
+
onSuccess: (text) => emit('success', text),
|
|
68
|
+
onError: (error) => emit('error', error)
|
|
69
|
+
}).finally(() => {
|
|
70
|
+
loading.value = false
|
|
71
|
+
})
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** pre-input 气泡可见性 */
|
|
75
|
+
const visible = ref(false)
|
|
76
|
+
|
|
77
|
+
function confirm() {
|
|
78
|
+
emit('confirm')
|
|
79
|
+
visible.value = false
|
|
80
|
+
send()
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function cancel() {
|
|
84
|
+
emit('cancel')
|
|
85
|
+
visible.value = false
|
|
86
|
+
}
|
|
87
|
+
</script>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as UAiButton } from './ai-button.vue'
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
@use 'pkg:@veltra/styles/mixins' as m;
|
|
2
|
+
@use 'pkg:@veltra/styles/functions' as fn;
|
|
3
|
+
@use 'pkg:@veltra/styles/vars';
|
|
4
|
+
|
|
5
|
+
// 方便拼接
|
|
6
|
+
$root-name: ai-button;
|
|
7
|
+
|
|
8
|
+
@include m.b($root-name) {
|
|
9
|
+
@include m.e(main) {
|
|
10
|
+
max-width: 280px;
|
|
11
|
+
width: max-content;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@include m.e(action) {
|
|
15
|
+
margin-top: fn.use-var(gap, default);
|
|
16
|
+
@include m.flex($justify: flex-end);
|
|
17
|
+
gap: fn.use-var(gap, small);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
共 {{ totalRows.toLocaleString() }} 行,超出预览上限
|
|
9
9
|
{{ maxRows.toLocaleString() }} 行,已全量加载
|
|
10
10
|
</div>
|
|
11
|
+
<div ref="container" :class="cls.e('sheet-stage')" />
|
|
11
12
|
<div v-if="sheets.length > 1" :class="cls.e('sheet-tabs')">
|
|
12
13
|
<button
|
|
13
14
|
v-for="(s, i) in sheets"
|
|
@@ -18,7 +19,6 @@
|
|
|
18
19
|
{{ s.name }}
|
|
19
20
|
</button>
|
|
20
21
|
</div>
|
|
21
|
-
<div ref="container" :class="cls.e('sheet-stage')" />
|
|
22
22
|
<div v-if="loading" :class="cls.e('loading')">加载中…</div>
|
|
23
23
|
</template>
|
|
24
24
|
</div>
|
|
@@ -4,56 +4,17 @@
|
|
|
4
4
|
/**
|
|
5
5
|
* 文件查看器样式
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
7
|
+
* 画布与模态均跟随主题:内嵌与模态共用同一套主题表面(bg-color.bottom 做画布底、
|
|
8
|
+
* bg-color.middle 做顶部微亮渐变),模态仅以全屏接管 + 入场动画表达层级,与 dialog
|
|
9
|
+
* 的遮罩/表面策略保持一致。纸面(图片/PDF/OFD/DOCX 页面)始终恒白,不随主题切换,
|
|
10
|
+
* 其色值收敛到下方文件头变量块(待 styles 包扩充深色中性阶 token 后可替换)。
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
@include m.b(file-viewer) {
|
|
14
|
-
// ──
|
|
15
|
-
--u-file-viewer-canvas: #101114;
|
|
16
|
-
--u-file-viewer-canvas-soft: #17191f;
|
|
17
|
-
--u-file-viewer-canvas-overlay: rgba(16, 17, 20, 0.74);
|
|
18
|
-
|
|
19
|
-
// ── 恒定亮面:纸面与模态主按钮的恒白表面及墨色(画布恒暗的配对设计)──
|
|
14
|
+
// ── 恒定亮面:纸面的恒白表面及墨色(画布随主题的配对设计)──
|
|
20
15
|
--u-file-viewer-light-surface: #fff;
|
|
21
16
|
--u-file-viewer-light-ink: #222;
|
|
22
17
|
|
|
23
|
-
// 纸张投影:三级阴影 token 按浅底设计,在恒暗画布上几乎不可见,故保留定制重投影
|
|
24
|
-
--u-file-viewer-page-shadow: 0 24px 72px rgba(0, 0, 0, 0.34);
|
|
25
|
-
// 模态纸张投影:重投影 + 白色发丝描边的组合阴影,三级阴影 token 无法等价表达
|
|
26
|
-
--u-file-viewer-page-shadow-modal:
|
|
27
|
-
0 38px 110px rgba(0, 0, 0, 0.5),
|
|
28
|
-
0 0 0 1px rgba(255, 255, 255, 0.04);
|
|
29
|
-
|
|
30
|
-
// ── 模态沉浸层恒暗表面(不随主题切换;styles 包暂无 mask/overlay 类 token,待扩充后收敛)──
|
|
31
|
-
--u-file-viewer-modal-backdrop: linear-gradient(
|
|
32
|
-
180deg,
|
|
33
|
-
rgba(5, 7, 11, 0.78),
|
|
34
|
-
rgba(4, 5, 8, 0.94)
|
|
35
|
-
);
|
|
36
|
-
--u-file-viewer-modal-sidebar: linear-gradient(
|
|
37
|
-
90deg,
|
|
38
|
-
rgba(8, 10, 15, 0.76),
|
|
39
|
-
rgba(8, 10, 15, 0.58) 78%,
|
|
40
|
-
rgba(8, 10, 15, 0.34)
|
|
41
|
-
);
|
|
42
|
-
--u-file-viewer-modal-stage-head: linear-gradient(
|
|
43
|
-
180deg,
|
|
44
|
-
rgba(9, 11, 16, 0.72),
|
|
45
|
-
rgba(9, 11, 16, 0.28) 72%,
|
|
46
|
-
transparent
|
|
47
|
-
);
|
|
48
|
-
--u-file-viewer-modal-body: linear-gradient(
|
|
49
|
-
180deg,
|
|
50
|
-
rgba(13, 16, 23, 0.58),
|
|
51
|
-
rgba(5, 6, 10, 0.82)
|
|
52
|
-
);
|
|
53
|
-
--u-file-viewer-modal-surface: rgba(8, 10, 14, 0.82);
|
|
54
|
-
--u-file-viewer-modal-panel: rgba(10, 12, 18, 0.78);
|
|
55
|
-
--u-file-viewer-modal-text: rgba(5, 7, 10, 0.76);
|
|
56
|
-
|
|
57
18
|
// ── kind badge 彩色:pink/violet 无对应色板 token(包内仅 primary/success/warning/danger/info),
|
|
58
19
|
// 待 styles 包扩充色板后收敛 ──
|
|
59
20
|
--u-file-viewer-kind-video: #db2777;
|
|
@@ -101,17 +62,8 @@
|
|
|
101
62
|
&.is-modal &__backdrop {
|
|
102
63
|
position: absolute;
|
|
103
64
|
inset: 0;
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
linear-gradient(
|
|
107
|
-
90deg,
|
|
108
|
-
fn.color-a(text-color, 5, white),
|
|
109
|
-
transparent 24%,
|
|
110
|
-
transparent 76%,
|
|
111
|
-
fn.color-a(text-color, 4, white)
|
|
112
|
-
);
|
|
113
|
-
backdrop-filter: fn.use-var(bg-filter);
|
|
114
|
-
-webkit-backdrop-filter: fn.use-var(bg-filter);
|
|
65
|
+
// 全屏接管的主题底色:侧栏与舞台均不透明,遮罩只作为兜底表面(与 dialog 表面策略一致)
|
|
66
|
+
background: fn.use-var(bg-color, bottom);
|
|
115
67
|
}
|
|
116
68
|
|
|
117
69
|
&.is-modal &__sidebar,
|
|
@@ -134,14 +86,6 @@
|
|
|
134
86
|
border-right: 1px solid fn.use-var(border, color);
|
|
135
87
|
}
|
|
136
88
|
|
|
137
|
-
&.is-modal &__sidebar {
|
|
138
|
-
color: fn.color-a(text-color, 86, white);
|
|
139
|
-
background: var(--u-file-viewer-modal-sidebar);
|
|
140
|
-
border-right: 1px solid fn.color-a(text-color, 5, white);
|
|
141
|
-
backdrop-filter: fn.use-var(bg-filter);
|
|
142
|
-
-webkit-backdrop-filter: fn.use-var(bg-filter);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
89
|
@include m.e(sidebar-head) {
|
|
146
90
|
display: flex;
|
|
147
91
|
align-items: center;
|
|
@@ -151,10 +95,6 @@
|
|
|
151
95
|
color: fn.use-var(text-color, title);
|
|
152
96
|
}
|
|
153
97
|
|
|
154
|
-
&.is-modal &__sidebar-head {
|
|
155
|
-
color: fn.color-a(text-color, 70, white);
|
|
156
|
-
}
|
|
157
|
-
|
|
158
98
|
@include m.e(sidebar-title) {
|
|
159
99
|
font-size: 12px;
|
|
160
100
|
font-weight: 620;
|
|
@@ -168,11 +108,6 @@
|
|
|
168
108
|
color: fn.use-var(text-color, second);
|
|
169
109
|
}
|
|
170
110
|
|
|
171
|
-
&.is-modal &__sidebar-count,
|
|
172
|
-
&.is-modal &__item-size {
|
|
173
|
-
color: fn.color-a(text-color, 50, white);
|
|
174
|
-
}
|
|
175
|
-
|
|
176
111
|
@include m.e(list) {
|
|
177
112
|
flex: 1;
|
|
178
113
|
min-height: 0;
|
|
@@ -192,10 +127,10 @@
|
|
|
192
127
|
display: flex;
|
|
193
128
|
align-items: center;
|
|
194
129
|
gap: 12px;
|
|
195
|
-
min-height:
|
|
196
|
-
padding: 7px 8px 7px
|
|
130
|
+
min-height: 44px;
|
|
131
|
+
padding: 7px 8px 7px 14px;
|
|
197
132
|
margin: 0;
|
|
198
|
-
border-radius:
|
|
133
|
+
border-radius: 8px;
|
|
199
134
|
cursor: pointer;
|
|
200
135
|
transition:
|
|
201
136
|
background fn.use-var(transition, fast) fn.use-var(transition, ease),
|
|
@@ -203,9 +138,9 @@
|
|
|
203
138
|
|
|
204
139
|
&::before {
|
|
205
140
|
position: absolute;
|
|
206
|
-
left:
|
|
207
|
-
top:
|
|
208
|
-
bottom:
|
|
141
|
+
left: 4px;
|
|
142
|
+
top: 10px;
|
|
143
|
+
bottom: 10px;
|
|
209
144
|
width: 2px;
|
|
210
145
|
border-radius: 999px;
|
|
211
146
|
background: fn.use-var(color, primary);
|
|
@@ -231,23 +166,6 @@
|
|
|
231
166
|
}
|
|
232
167
|
}
|
|
233
168
|
|
|
234
|
-
&.is-modal &__item {
|
|
235
|
-
color: fn.color-a(text-color, 70, white);
|
|
236
|
-
|
|
237
|
-
&:hover {
|
|
238
|
-
background: fn.color-a(text-color, 5, white);
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
@include m.is(active) {
|
|
242
|
-
color: fn.use-var(text-color, white);
|
|
243
|
-
background: fn.color-a(text-color, 8, white);
|
|
244
|
-
|
|
245
|
-
&::before {
|
|
246
|
-
background: fn.color-a(text-color, 86, white);
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
|
|
251
169
|
@include m.e(item-meta) {
|
|
252
170
|
display: flex;
|
|
253
171
|
flex: 1;
|
|
@@ -265,10 +183,6 @@
|
|
|
265
183
|
@include m.ellipsis;
|
|
266
184
|
}
|
|
267
185
|
|
|
268
|
-
&.is-modal &__item-name {
|
|
269
|
-
color: fn.color-a(text-color, 86, white);
|
|
270
|
-
}
|
|
271
|
-
|
|
272
186
|
@include m.e(item-size) {
|
|
273
187
|
font-size: 11px;
|
|
274
188
|
line-height: 1;
|
|
@@ -285,14 +199,6 @@
|
|
|
285
199
|
text-align: right;
|
|
286
200
|
}
|
|
287
201
|
|
|
288
|
-
&.is-modal &__item-kind {
|
|
289
|
-
color: fn.color-a(text-color, 40, white);
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
&.is-modal &__item.is-active &__item-kind {
|
|
293
|
-
color: fn.color-a(text-color, 70, white);
|
|
294
|
-
}
|
|
295
|
-
|
|
296
202
|
@include m.e(badge) {
|
|
297
203
|
--u-file-viewer-kind: #{fn.use-var(text-color, second)};
|
|
298
204
|
--u-file-viewer-kind-border: #{fn.color-a(text-color, 28, second)};
|
|
@@ -360,34 +266,19 @@
|
|
|
360
266
|
background: fn.use-var(bg-color, top);
|
|
361
267
|
}
|
|
362
268
|
|
|
363
|
-
&.is-modal &__stage {
|
|
364
|
-
position: relative;
|
|
365
|
-
color: fn.color-a(text-color, 86, white);
|
|
366
|
-
background: transparent;
|
|
367
|
-
}
|
|
368
|
-
|
|
369
269
|
@include m.e(stage-head) {
|
|
370
270
|
display: flex;
|
|
371
271
|
align-items: center;
|
|
372
272
|
justify-content: space-between;
|
|
373
273
|
gap: 16px;
|
|
374
|
-
min-height:
|
|
375
|
-
padding:
|
|
274
|
+
min-height: 58px;
|
|
275
|
+
padding: 10px 14px 10px 16px;
|
|
376
276
|
background:
|
|
377
277
|
linear-gradient(180deg, fn.color-a(text-color, 4, white), transparent), fn.use-var(bg-color, top);
|
|
378
278
|
border-bottom: 1px solid fn.use-var(border, color);
|
|
379
279
|
flex-shrink: 0;
|
|
380
280
|
}
|
|
381
281
|
|
|
382
|
-
&.is-modal &__stage-head {
|
|
383
|
-
min-height: 64px;
|
|
384
|
-
color: fn.color-a(text-color, 86, white);
|
|
385
|
-
background: var(--u-file-viewer-modal-stage-head);
|
|
386
|
-
border-bottom-color: transparent;
|
|
387
|
-
backdrop-filter: fn.use-var(bg-filter);
|
|
388
|
-
-webkit-backdrop-filter: fn.use-var(bg-filter);
|
|
389
|
-
}
|
|
390
|
-
|
|
391
282
|
@include m.e(stage-title) {
|
|
392
283
|
display: flex;
|
|
393
284
|
align-items: center;
|
|
@@ -411,10 +302,6 @@
|
|
|
411
302
|
@include m.ellipsis;
|
|
412
303
|
}
|
|
413
304
|
|
|
414
|
-
&.is-modal &__stage-name {
|
|
415
|
-
color: fn.color-a(text-color, 86, white);
|
|
416
|
-
}
|
|
417
|
-
|
|
418
305
|
@include m.e(stage-sub) {
|
|
419
306
|
display: flex;
|
|
420
307
|
align-items: center;
|
|
@@ -443,10 +330,6 @@
|
|
|
443
330
|
}
|
|
444
331
|
}
|
|
445
332
|
|
|
446
|
-
&.is-modal &__stage-sub {
|
|
447
|
-
color: fn.color-a(text-color, 52, white);
|
|
448
|
-
}
|
|
449
|
-
|
|
450
333
|
@include m.e(stage-actions) {
|
|
451
334
|
display: flex;
|
|
452
335
|
align-items: center;
|
|
@@ -463,15 +346,10 @@
|
|
|
463
346
|
height: 34px;
|
|
464
347
|
padding: 2px;
|
|
465
348
|
border: 1px solid fn.color-a(border, 86, color);
|
|
466
|
-
border-radius:
|
|
349
|
+
border-radius: 10px;
|
|
467
350
|
background: fn.use-var(bg-color, middle);
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
&.is-modal &__action-group {
|
|
471
|
-
border-color: fn.color-a(text-color, 8, white);
|
|
472
|
-
background: fn.color-a(text-color, 5, white);
|
|
473
|
-
// 内侧白色发丝高光(非海拔投影,不适用三级阴影 token)
|
|
474
|
-
box-shadow: 0 1px 0 fn.color-a(text-color, 5, white) inset;
|
|
351
|
+
// 顶部内侧发丝高光,让按钮组有一点胶囊体积感
|
|
352
|
+
box-shadow: 0 1px 0 fn.color-a(text-color, 4, white) inset;
|
|
475
353
|
}
|
|
476
354
|
|
|
477
355
|
@include m.e(action) {
|
|
@@ -512,15 +390,6 @@
|
|
|
512
390
|
}
|
|
513
391
|
}
|
|
514
392
|
|
|
515
|
-
&.is-modal &__action {
|
|
516
|
-
color: fn.color-a(text-color, 70, white);
|
|
517
|
-
|
|
518
|
-
&:not(:disabled):hover {
|
|
519
|
-
color: fn.use-var(text-color, white);
|
|
520
|
-
background: fn.color-a(text-color, 10, white);
|
|
521
|
-
}
|
|
522
|
-
}
|
|
523
|
-
|
|
524
393
|
@include m.em(action, icon) {
|
|
525
394
|
width: 30px;
|
|
526
395
|
padding: 0;
|
|
@@ -537,17 +406,6 @@
|
|
|
537
406
|
}
|
|
538
407
|
}
|
|
539
408
|
|
|
540
|
-
&.is-modal &__action--primary {
|
|
541
|
-
color: var(--u-file-viewer-light-ink);
|
|
542
|
-
background: fn.color-a(text-color, 86, white);
|
|
543
|
-
border-color: fn.color-a(text-color, 86, white);
|
|
544
|
-
|
|
545
|
-
&:not(:disabled):hover {
|
|
546
|
-
color: var(--u-file-viewer-light-ink);
|
|
547
|
-
background: var(--u-file-viewer-light-surface);
|
|
548
|
-
}
|
|
549
|
-
}
|
|
550
|
-
|
|
551
409
|
@include m.e(zoom-value) {
|
|
552
410
|
min-width: 48px;
|
|
553
411
|
color: fn.use-var(text-color, title);
|
|
@@ -557,30 +415,15 @@
|
|
|
557
415
|
user-select: none;
|
|
558
416
|
}
|
|
559
417
|
|
|
560
|
-
&.is-modal &__zoom-value {
|
|
561
|
-
color: fn.color-a(text-color, 86, white);
|
|
562
|
-
}
|
|
563
|
-
|
|
564
418
|
@include m.e(body) {
|
|
565
419
|
position: relative;
|
|
566
420
|
flex: 1;
|
|
567
421
|
min-height: 0;
|
|
568
422
|
overflow: hidden;
|
|
423
|
+
// 顶部微亮的径向渐变给画布一点纵深,画布底用 bg-color 最深一档与纸面拉开层次
|
|
569
424
|
background:
|
|
570
|
-
|
|
571
|
-
var(
|
|
572
|
-
}
|
|
573
|
-
|
|
574
|
-
&.is-modal &__body {
|
|
575
|
-
background:
|
|
576
|
-
var(--u-file-viewer-modal-body),
|
|
577
|
-
linear-gradient(
|
|
578
|
-
90deg,
|
|
579
|
-
fn.color-a(text-color, 4, white),
|
|
580
|
-
transparent 22%,
|
|
581
|
-
transparent 78%,
|
|
582
|
-
fn.color-a(text-color, 4, white)
|
|
583
|
-
);
|
|
425
|
+
radial-gradient(120% 80% at 50% 0%, fn.use-var(bg-color, middle), transparent 62%),
|
|
426
|
+
fn.use-var(bg-color, bottom);
|
|
584
427
|
}
|
|
585
428
|
|
|
586
429
|
@include m.e(viewport) {
|
|
@@ -598,7 +441,7 @@
|
|
|
598
441
|
display: flex;
|
|
599
442
|
align-items: center;
|
|
600
443
|
justify-content: center;
|
|
601
|
-
color: fn.
|
|
444
|
+
color: fn.use-var(text-color, second);
|
|
602
445
|
}
|
|
603
446
|
|
|
604
447
|
@include m.e(image) {
|
|
@@ -631,7 +474,6 @@
|
|
|
631
474
|
object-fit: contain;
|
|
632
475
|
border-radius: 6px;
|
|
633
476
|
background: var(--u-file-viewer-light-surface);
|
|
634
|
-
box-shadow: var(--u-file-viewer-page-shadow);
|
|
635
477
|
}
|
|
636
478
|
}
|
|
637
479
|
|
|
@@ -639,9 +481,7 @@
|
|
|
639
481
|
padding: clamp(18px, 4vw, 64px);
|
|
640
482
|
|
|
641
483
|
img {
|
|
642
|
-
background: fn.color-a(text-color, 4, white);
|
|
643
484
|
border-radius: 4px;
|
|
644
|
-
box-shadow: var(--u-file-viewer-page-shadow-modal);
|
|
645
485
|
}
|
|
646
486
|
}
|
|
647
487
|
|
|
@@ -667,18 +507,14 @@
|
|
|
667
507
|
@include m.e(text) {
|
|
668
508
|
position: absolute;
|
|
669
509
|
inset: 0;
|
|
670
|
-
|
|
671
|
-
}
|
|
672
|
-
|
|
673
|
-
&.is-modal &__text {
|
|
674
|
-
background: var(--u-file-viewer-modal-text);
|
|
510
|
+
// 透明继承 __body 的主题画布底色
|
|
675
511
|
}
|
|
676
512
|
|
|
677
513
|
@include m.e(text-pre) {
|
|
678
514
|
min-width: max-content;
|
|
679
515
|
margin: 0;
|
|
680
516
|
padding: 22px 26px;
|
|
681
|
-
color: fn.
|
|
517
|
+
color: fn.use-var(text-color, main);
|
|
682
518
|
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
|
683
519
|
font-size: 12.5px;
|
|
684
520
|
line-height: 1.65;
|
|
@@ -716,9 +552,8 @@
|
|
|
716
552
|
}
|
|
717
553
|
|
|
718
554
|
@include m.e(pdf-page) {
|
|
719
|
-
margin:
|
|
555
|
+
margin: 28px auto;
|
|
720
556
|
background: var(--u-file-viewer-light-surface);
|
|
721
|
-
box-shadow: var(--u-file-viewer-page-shadow);
|
|
722
557
|
|
|
723
558
|
// 物理分辨率与 CSS 尺寸解耦:canvas 固定铺满占位块(超限降采样时由 CSS 拉伸)
|
|
724
559
|
canvas {
|
|
@@ -730,7 +565,6 @@
|
|
|
730
565
|
|
|
731
566
|
&.is-modal &__pdf-page {
|
|
732
567
|
margin: clamp(24px, 3vw, 44px) auto;
|
|
733
|
-
box-shadow: var(--u-file-viewer-page-shadow-modal);
|
|
734
568
|
}
|
|
735
569
|
|
|
736
570
|
// 加载失败的错误态,视觉与 loading 一致(覆盖整个画布的居中提示),文案用 danger 语义色
|
|
@@ -741,7 +575,9 @@
|
|
|
741
575
|
align-items: center;
|
|
742
576
|
justify-content: center;
|
|
743
577
|
color: fn.use-var(color, danger);
|
|
744
|
-
background:
|
|
578
|
+
background: fn.color-a(bg-color, 70, bottom);
|
|
579
|
+
backdrop-filter: blur(4px);
|
|
580
|
+
-webkit-backdrop-filter: blur(4px);
|
|
745
581
|
font-size: 13px;
|
|
746
582
|
pointer-events: none;
|
|
747
583
|
}
|
|
@@ -758,9 +594,8 @@
|
|
|
758
594
|
}
|
|
759
595
|
|
|
760
596
|
@include m.e(ofd-page) {
|
|
761
|
-
margin:
|
|
597
|
+
margin: 28px auto;
|
|
762
598
|
background: var(--u-file-viewer-light-surface);
|
|
763
|
-
box-shadow: var(--u-file-viewer-page-shadow);
|
|
764
599
|
|
|
765
600
|
svg {
|
|
766
601
|
display: block;
|
|
@@ -788,17 +623,12 @@
|
|
|
788
623
|
margin: 0 auto;
|
|
789
624
|
color: var(--u-file-viewer-light-ink);
|
|
790
625
|
background: var(--u-file-viewer-light-surface);
|
|
791
|
-
box-shadow: var(--u-file-viewer-page-shadow);
|
|
792
626
|
}
|
|
793
627
|
|
|
794
628
|
&.is-modal &__docx-body {
|
|
795
629
|
padding: clamp(24px, 4vw, 64px);
|
|
796
630
|
}
|
|
797
631
|
|
|
798
|
-
&.is-modal &__docx-doc {
|
|
799
|
-
box-shadow: var(--u-file-viewer-page-shadow-modal);
|
|
800
|
-
}
|
|
801
|
-
|
|
802
632
|
@include m.e(sheet) {
|
|
803
633
|
position: absolute;
|
|
804
634
|
inset: 0;
|
|
@@ -807,10 +637,6 @@
|
|
|
807
637
|
background: fn.use-var(bg-color, top);
|
|
808
638
|
}
|
|
809
639
|
|
|
810
|
-
&.is-modal &__sheet {
|
|
811
|
-
background: var(--u-file-viewer-modal-surface);
|
|
812
|
-
}
|
|
813
|
-
|
|
814
640
|
@include m.e(sheet-note) {
|
|
815
641
|
padding: 8px 16px;
|
|
816
642
|
color: fn.use-var(text-color, second);
|
|
@@ -821,21 +647,22 @@
|
|
|
821
647
|
flex-shrink: 0;
|
|
822
648
|
}
|
|
823
649
|
|
|
824
|
-
&.is-modal &__sheet-note,
|
|
825
|
-
&.is-modal &__sheet-tabs {
|
|
826
|
-
color: fn.color-a(text-color, 60, white);
|
|
827
|
-
background: var(--u-file-viewer-modal-panel);
|
|
828
|
-
border-bottom-color: fn.color-a(text-color, 8, white);
|
|
829
|
-
}
|
|
830
|
-
|
|
831
650
|
@include m.e(sheet-tabs) {
|
|
832
651
|
display: flex;
|
|
833
652
|
gap: 6px;
|
|
834
653
|
padding: 9px 12px;
|
|
835
|
-
|
|
654
|
+
// 表签条位于预览区下方,分隔线朝上
|
|
655
|
+
border-top: 1px solid fn.use-var(border, color);
|
|
836
656
|
background: fn.use-var(bg-color, top);
|
|
837
657
|
flex-shrink: 0;
|
|
838
658
|
overflow-x: auto;
|
|
659
|
+
// 表签条横向滚动时隐藏原生滚动条,保持胶囊观感
|
|
660
|
+
scrollbar-width: none;
|
|
661
|
+
|
|
662
|
+
&::-webkit-scrollbar {
|
|
663
|
+
width: 0;
|
|
664
|
+
height: 0;
|
|
665
|
+
}
|
|
839
666
|
}
|
|
840
667
|
|
|
841
668
|
@include m.e(sheet-tab) {
|
|
@@ -869,21 +696,6 @@
|
|
|
869
696
|
}
|
|
870
697
|
}
|
|
871
698
|
|
|
872
|
-
&.is-modal &__sheet-tab {
|
|
873
|
-
color: fn.color-a(text-color, 60, white);
|
|
874
|
-
|
|
875
|
-
&:hover {
|
|
876
|
-
color: fn.color-a(text-color, 86, white);
|
|
877
|
-
background: fn.color-a(text-color, 8, white);
|
|
878
|
-
}
|
|
879
|
-
|
|
880
|
-
@include m.is(active) {
|
|
881
|
-
color: fn.use-var(text-color, white);
|
|
882
|
-
background: fn.color-a(text-color, 10, white);
|
|
883
|
-
border-color: fn.color-a(text-color, 11, white);
|
|
884
|
-
}
|
|
885
|
-
}
|
|
886
|
-
|
|
887
699
|
@include m.e(sheet-stage) {
|
|
888
700
|
flex: 1;
|
|
889
701
|
min-height: 0;
|
|
@@ -896,9 +708,12 @@
|
|
|
896
708
|
display: flex;
|
|
897
709
|
align-items: center;
|
|
898
710
|
justify-content: center;
|
|
899
|
-
color: fn.
|
|
900
|
-
background:
|
|
711
|
+
color: fn.use-var(text-color, second);
|
|
712
|
+
background: fn.color-a(bg-color, 70, bottom);
|
|
713
|
+
backdrop-filter: blur(4px);
|
|
714
|
+
-webkit-backdrop-filter: blur(4px);
|
|
901
715
|
font-size: 13px;
|
|
716
|
+
letter-spacing: 0.02em;
|
|
902
717
|
pointer-events: none;
|
|
903
718
|
}
|
|
904
719
|
|
|
@@ -919,11 +734,6 @@
|
|
|
919
734
|
border-bottom: 1px solid fn.use-var(border, color);
|
|
920
735
|
}
|
|
921
736
|
|
|
922
|
-
&.is-modal &__sidebar {
|
|
923
|
-
border-bottom-color: fn.color-a(text-color, 8, white);
|
|
924
|
-
border-right: none;
|
|
925
|
-
}
|
|
926
|
-
|
|
927
737
|
@include m.e(stage-head) {
|
|
928
738
|
align-items: flex-start;
|
|
929
739
|
flex-direction: column;
|
|
@@ -955,6 +765,15 @@
|
|
|
955
765
|
will-change: opacity;
|
|
956
766
|
}
|
|
957
767
|
|
|
768
|
+
// 打开时舞台自下而上轻微上浮,与背景淡入配合出纵深(参考 Drive / flyfish file-viewer 的入场)
|
|
769
|
+
.u-file-viewer-modal-enter-active .u-file-viewer__stage {
|
|
770
|
+
transition: transform fn.use-var(transition, normal) fn.use-var(transition, ease);
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
.u-file-viewer-modal-enter-from .u-file-viewer__stage {
|
|
774
|
+
transform: translateY(10px) scale(0.99);
|
|
775
|
+
}
|
|
776
|
+
|
|
958
777
|
.u-file-viewer-modal-leave-active {
|
|
959
778
|
pointer-events: none;
|
|
960
779
|
}
|