@lark-apaas/coding-template-nestjs-react-fullstack 0.1.53 → 0.1.55-alpha.20261030035108
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/package.json +1 -1
- package/template/client/src/components/business-ui/README.md +10 -0
- package/template/client/src/components/business-ui/api/user-profiles/queries.ts +1 -7
- package/template/client/src/components/business-ui/comment/README.md +139 -0
- package/template/client/src/components/business-ui/comment/app-source.ts +175 -0
- package/template/client/src/components/business-ui/comment/ccm-document-source.ts +252 -0
- package/template/client/src/components/business-ui/comment/comment-content.tsx +235 -0
- package/template/client/src/components/business-ui/comment/comment-input.tsx +191 -0
- package/template/client/src/components/business-ui/comment/comment-provider.tsx +40 -0
- package/template/client/src/components/business-ui/comment/content.ts +329 -0
- package/template/client/src/components/business-ui/comment/document-icon.tsx +104 -0
- package/template/client/src/components/business-ui/comment/document-icons.ts +19 -0
- package/template/client/src/components/business-ui/comment/dom-editor.ts +581 -0
- package/template/client/src/components/business-ui/comment/editor.tsx +496 -0
- package/template/client/src/components/business-ui/comment/entity-store.ts +97 -0
- package/template/client/src/components/business-ui/comment/image-attachments.tsx +374 -0
- package/template/client/src/components/business-ui/comment/mention-appearance.ts +35 -0
- package/template/client/src/components/business-ui/comment/mention-provider.tsx +73 -0
- package/template/client/src/components/business-ui/comment/mention-suggestions.tsx +312 -0
- package/template/client/src/components/business-ui/comment/types.ts +154 -0
- package/template/client/src/components/business-ui/comment/use-mention-search.ts +107 -0
- package/template/client/src/components/business-ui/user-display/user-display.tsx +0 -13
- package/template/client/src/components/business-ui/user-profile/user-profile.tsx +146 -397
- package/template/client/src/components/business-ui/user-select/user-pill.tsx +0 -13
- package/template/client/src/hooks/use-example.ts +45 -36
- package/template/client/src/pages/ExamplePage/ExamplePage.tsx +7 -8
- package/template/client/src/tailwind-theme.css +5 -6
- package/template/eslint.config.js +0 -6
- package/template/package-lock.json +83 -62
- package/template/package.json +5 -4
- package/template/server/modules/hello/hello.controller.ts +4 -8
- package/template/server/modules/hello/hello.service.ts +3 -5
- package/template/shared/api.interface.ts +1 -8
- package/template/client/src/components/business-ui/user-profile/lark-card-pool.ts +0 -217
- package/template/client/src/lib/api-error.ts +0 -36
- package/template/server/modules/hello/hello.dto.ts +0 -21
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
CommentPart,
|
|
3
|
+
CommentApiContent,
|
|
4
|
+
CommentValue,
|
|
5
|
+
MentionRef,
|
|
6
|
+
MentionResult,
|
|
7
|
+
} from './types';
|
|
8
|
+
|
|
9
|
+
export const emptyComment = (): CommentValue => ({ version: 1, content: [] });
|
|
10
|
+
|
|
11
|
+
export function mentionKey(ref: MentionRef): string {
|
|
12
|
+
return JSON.stringify([
|
|
13
|
+
ref.kind,
|
|
14
|
+
ref.kind === 'user' ? ref.idType : ref.resourceType,
|
|
15
|
+
ref.id,
|
|
16
|
+
]);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function isMentionRef(value: unknown): value is MentionRef {
|
|
20
|
+
if (!value || typeof value !== 'object') return false;
|
|
21
|
+
const ref = value as Record<string, unknown>;
|
|
22
|
+
return (
|
|
23
|
+
typeof ref.id === 'string' &&
|
|
24
|
+
ref.id.length > 0 &&
|
|
25
|
+
((ref.kind === 'user' && ref.idType === 'apaas-user') ||
|
|
26
|
+
(ref.kind === 'document' &&
|
|
27
|
+
typeof ref.resourceType === 'string' &&
|
|
28
|
+
ref.resourceType.length > 0))
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function safeUrl(url?: string): string | undefined {
|
|
33
|
+
if (!url) return undefined;
|
|
34
|
+
if (
|
|
35
|
+
url.startsWith('/') &&
|
|
36
|
+
!url.startsWith('//') &&
|
|
37
|
+
!/[\\\s\u0000-\u001f]/.test(url)
|
|
38
|
+
)
|
|
39
|
+
return url;
|
|
40
|
+
try {
|
|
41
|
+
const parsed = new URL(url);
|
|
42
|
+
return parsed.protocol === 'https:' || parsed.protocol === 'http:'
|
|
43
|
+
? parsed.href
|
|
44
|
+
: undefined;
|
|
45
|
+
} catch {
|
|
46
|
+
return undefined;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function normalizeValue(value: CommentValue): CommentValue {
|
|
51
|
+
if (!value || value.version !== 1 || !Array.isArray(value.content)) {
|
|
52
|
+
throw new Error('不支持的评论内容格式');
|
|
53
|
+
}
|
|
54
|
+
const content: CommentPart[] = [];
|
|
55
|
+
const text = (s: string) => {
|
|
56
|
+
if (!s) return;
|
|
57
|
+
const previous = content[content.length - 1];
|
|
58
|
+
if (previous?.type === 'text') previous.text += s;
|
|
59
|
+
else content.push({ type: 'text', text: s });
|
|
60
|
+
};
|
|
61
|
+
for (const part of value.content) {
|
|
62
|
+
if (part.type === 'text' && typeof part.text === 'string') {
|
|
63
|
+
part.text
|
|
64
|
+
.replace(/\r\n?/g, '\n')
|
|
65
|
+
.split('\n')
|
|
66
|
+
.forEach((line, i) => {
|
|
67
|
+
if (i) content.push({ type: 'break' });
|
|
68
|
+
text(line);
|
|
69
|
+
});
|
|
70
|
+
} else if (part.type === 'break') content.push({ type: 'break' });
|
|
71
|
+
else if (part.type === 'link' && typeof part.url === 'string')
|
|
72
|
+
content.push({ type: 'link', url: part.url });
|
|
73
|
+
else if (part.type === 'unresolved-mention')
|
|
74
|
+
content.push({ type: 'unresolved-mention' });
|
|
75
|
+
else if (part.type === 'mention' && isMentionRef(part.ref)) {
|
|
76
|
+
if (part.label !== undefined && typeof part.label !== 'string')
|
|
77
|
+
throw new Error('评论引用名称无效');
|
|
78
|
+
content.push({
|
|
79
|
+
type: 'mention',
|
|
80
|
+
ref: { ...part.ref },
|
|
81
|
+
...(part.label ? { label: part.label } : {}),
|
|
82
|
+
...(part.ref.kind === 'document' ? documentSnapshot(part) : {}),
|
|
83
|
+
});
|
|
84
|
+
} else throw new Error('评论内容包含无效节点');
|
|
85
|
+
}
|
|
86
|
+
return { version: 1, content };
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/** Preserve document presentation through editing/clipboard without trusting HTML or URLs. */
|
|
90
|
+
export function documentSnapshot(value: {
|
|
91
|
+
href?: unknown;
|
|
92
|
+
document?: unknown;
|
|
93
|
+
}) {
|
|
94
|
+
const href = typeof value.href === 'string' ? safeUrl(value.href) : undefined;
|
|
95
|
+
const meta =
|
|
96
|
+
value.document && typeof value.document === 'object'
|
|
97
|
+
? (value.document as Record<string, unknown>)
|
|
98
|
+
: {};
|
|
99
|
+
const subType =
|
|
100
|
+
typeof meta.subType === 'number' && Number.isSafeInteger(meta.subType)
|
|
101
|
+
? meta.subType
|
|
102
|
+
: undefined;
|
|
103
|
+
const iconInfo =
|
|
104
|
+
typeof meta.iconInfo === 'string' ? meta.iconInfo : undefined;
|
|
105
|
+
return {
|
|
106
|
+
...(href ? { href } : {}),
|
|
107
|
+
...(subType !== undefined || iconInfo
|
|
108
|
+
? {
|
|
109
|
+
document: {
|
|
110
|
+
...(subType !== undefined ? { subType } : {}),
|
|
111
|
+
...(iconInfo ? { iconInfo } : {}),
|
|
112
|
+
},
|
|
113
|
+
}
|
|
114
|
+
: {}),
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export function toPlainText(value: CommentValue): string {
|
|
119
|
+
return value.content
|
|
120
|
+
.map((part) =>
|
|
121
|
+
part.type === 'text'
|
|
122
|
+
? part.text
|
|
123
|
+
: part.type === 'break'
|
|
124
|
+
? '\n'
|
|
125
|
+
: part.type === 'link'
|
|
126
|
+
? part.url
|
|
127
|
+
: part.type === 'unresolved-mention'
|
|
128
|
+
? '引用信息缺失'
|
|
129
|
+
: part.ref.kind === 'user'
|
|
130
|
+
? `@${part.label || '用户'}`
|
|
131
|
+
: part.label || part.href || '文档',
|
|
132
|
+
)
|
|
133
|
+
.join('');
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export function collectMentionRefs(value: CommentValue): MentionRef[] {
|
|
137
|
+
const refs = new Map<string, MentionRef>();
|
|
138
|
+
for (const part of value.content)
|
|
139
|
+
if (part.type === 'mention') refs.set(mentionKey(part.ref), part.ref);
|
|
140
|
+
return [...refs.values()];
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export function mentionLabel(
|
|
144
|
+
ref: MentionRef,
|
|
145
|
+
label: string | undefined,
|
|
146
|
+
result?: MentionResult,
|
|
147
|
+
strict = false,
|
|
148
|
+
): string {
|
|
149
|
+
if (result?.status === 'resolved')
|
|
150
|
+
return result.label || (ref.kind === 'user' ? '用户' : '文档');
|
|
151
|
+
if (result?.status === 'forbidden')
|
|
152
|
+
return ref.kind === 'user' ? '无权查看的用户' : '无权查看的文档';
|
|
153
|
+
if (result?.status === 'not-found')
|
|
154
|
+
return ref.kind === 'user' ? '用户不存在' : '文档已失效';
|
|
155
|
+
return (!strict && label) || (ref.kind === 'user' ? '用户' : '文档');
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/** @deprecated Legacy structural conversion; the div editor uses CommentValue directly. */
|
|
159
|
+
export interface EditorDocument {
|
|
160
|
+
type?: string;
|
|
161
|
+
text?: string;
|
|
162
|
+
attrs?: Record<string, unknown>;
|
|
163
|
+
content?: EditorDocument[];
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/** @deprecated Retained for existing consumers; new code uses CommentValue directly. */
|
|
167
|
+
export function toEditorDocument(value: CommentValue): EditorDocument {
|
|
168
|
+
return {
|
|
169
|
+
type: 'doc',
|
|
170
|
+
content: [
|
|
171
|
+
{
|
|
172
|
+
type: 'paragraph',
|
|
173
|
+
content: normalizeValue(value).content.map((part) =>
|
|
174
|
+
part.type === 'text'
|
|
175
|
+
? { type: 'text', text: part.text }
|
|
176
|
+
: part.type === 'break'
|
|
177
|
+
? { type: 'hardBreak' }
|
|
178
|
+
: part.type === 'link'
|
|
179
|
+
? { type: 'commentLink', attrs: { url: part.url } }
|
|
180
|
+
: part.type === 'unresolved-mention'
|
|
181
|
+
? { type: 'unresolvedMention' }
|
|
182
|
+
: {
|
|
183
|
+
type: 'entityMention',
|
|
184
|
+
attrs: {
|
|
185
|
+
ref: part.ref,
|
|
186
|
+
label: part.label || null,
|
|
187
|
+
href: null,
|
|
188
|
+
document: null,
|
|
189
|
+
...documentSnapshot(part),
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
),
|
|
193
|
+
},
|
|
194
|
+
],
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/** @deprecated Retained for existing consumers; new code uses CommentValue directly. */
|
|
199
|
+
export function fromEditorDocument(doc: EditorDocument): CommentValue {
|
|
200
|
+
if (doc.type !== 'doc') throw new Error('无效的评论编辑文档');
|
|
201
|
+
const content: CommentPart[] = [];
|
|
202
|
+
for (const [i, paragraph] of (doc.content || []).entries()) {
|
|
203
|
+
if (paragraph.type !== 'paragraph') throw new Error('无效的评论段落');
|
|
204
|
+
if (i) content.push({ type: 'break' });
|
|
205
|
+
for (const node of paragraph.content || []) {
|
|
206
|
+
if (node.type === 'text')
|
|
207
|
+
content.push({ type: 'text', text: node.text || '' });
|
|
208
|
+
else if (node.type === 'hardBreak') content.push({ type: 'break' });
|
|
209
|
+
else if (
|
|
210
|
+
node.type === 'commentLink' &&
|
|
211
|
+
typeof node.attrs?.url === 'string'
|
|
212
|
+
)
|
|
213
|
+
content.push({ type: 'link', url: node.attrs.url });
|
|
214
|
+
else if (node.type === 'unresolvedMention')
|
|
215
|
+
content.push({ type: 'unresolved-mention' });
|
|
216
|
+
else if (node.type === 'entityMention' && isMentionRef(node.attrs?.ref)) {
|
|
217
|
+
content.push({
|
|
218
|
+
type: 'mention',
|
|
219
|
+
ref: node.attrs.ref,
|
|
220
|
+
label:
|
|
221
|
+
typeof node.attrs.label === 'string' ? node.attrs.label : undefined,
|
|
222
|
+
...documentSnapshot({
|
|
223
|
+
href: node.attrs.href,
|
|
224
|
+
document: node.attrs.document,
|
|
225
|
+
}),
|
|
226
|
+
});
|
|
227
|
+
} else throw new Error('无效的评论编辑节点');
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
return normalizeValue({ version: 1, content });
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
const types: Record<string, string> = {
|
|
234
|
+
doc: '1',
|
|
235
|
+
docx: '22',
|
|
236
|
+
sheets: '3',
|
|
237
|
+
sheet: '3',
|
|
238
|
+
base: '8',
|
|
239
|
+
bitable: '8',
|
|
240
|
+
wiki: '16',
|
|
241
|
+
mindnotes: '11',
|
|
242
|
+
mindnote: '11',
|
|
243
|
+
slides: '30',
|
|
244
|
+
file: '12',
|
|
245
|
+
whiteboard: '38',
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
/** Only recognised cloud-document hosts/routes become metadata references. Other URLs stay links. */
|
|
249
|
+
export function documentRefFromUrl(url: string): MentionRef | undefined {
|
|
250
|
+
try {
|
|
251
|
+
const parsed = new URL(url);
|
|
252
|
+
if (parsed.protocol !== 'https:' && parsed.protocol !== 'http:')
|
|
253
|
+
return undefined;
|
|
254
|
+
if (
|
|
255
|
+
!['feishu.cn', 'larkoffice.com', 'larksuite.com', 'doubao.com'].some(
|
|
256
|
+
(domain) =>
|
|
257
|
+
parsed.hostname === domain || parsed.hostname.endsWith(`.${domain}`),
|
|
258
|
+
)
|
|
259
|
+
)
|
|
260
|
+
return undefined;
|
|
261
|
+
const match =
|
|
262
|
+
/^\/(doc|docx|sheets?|base|bitable|wiki|mindnotes?|slides|file|whiteboard)\/([a-zA-Z0-9_-]+)(?:\/|$)/.exec(
|
|
263
|
+
parsed.pathname,
|
|
264
|
+
);
|
|
265
|
+
return match
|
|
266
|
+
? { kind: 'document', id: match[2], resourceType: types[match[1]] }
|
|
267
|
+
: undefined;
|
|
268
|
+
} catch {
|
|
269
|
+
return undefined;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/** Read the exact text/mention/link protocol without send-state validation. */
|
|
274
|
+
export function readApiContent(value: CommentValue): CommentApiContent[] {
|
|
275
|
+
const content: CommentApiContent[] = [];
|
|
276
|
+
for (const part of normalizeValue(value).content) {
|
|
277
|
+
if (part.type === 'text' || part.type === 'break') {
|
|
278
|
+
const text = part.type === 'text' ? part.text : '\n';
|
|
279
|
+
const previous = content.at(-1);
|
|
280
|
+
if (previous?.type === 'text') previous.text += text;
|
|
281
|
+
else content.push({ type: 'text', text });
|
|
282
|
+
} else if (part.type === 'unresolved-mention')
|
|
283
|
+
content.push({ type: 'mention' });
|
|
284
|
+
else if (part.type === 'link')
|
|
285
|
+
content.push({ type: 'link', url: part.url });
|
|
286
|
+
else if (part.ref.kind === 'document')
|
|
287
|
+
content.push({ type: 'link', url: part.href || '' });
|
|
288
|
+
else content.push({ type: 'mention', userID: apiUserID(part.ref.id) });
|
|
289
|
+
}
|
|
290
|
+
return content;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
function apiUserID(id: string): number {
|
|
294
|
+
const number = Number(id);
|
|
295
|
+
if (
|
|
296
|
+
!/^[1-9]\d*$/.test(id) ||
|
|
297
|
+
!Number.isSafeInteger(number) ||
|
|
298
|
+
String(number) !== id
|
|
299
|
+
)
|
|
300
|
+
throw new Error('人员 userID 必须是可精确表示的正整数');
|
|
301
|
+
return number;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
export function fromApiContent(
|
|
305
|
+
content: readonly CommentApiContent[],
|
|
306
|
+
): CommentValue {
|
|
307
|
+
if (!Array.isArray(content)) throw new Error('评论 content 必须是数组');
|
|
308
|
+
const parts = content.map((part): CommentPart => {
|
|
309
|
+
if (part?.type === 'text' && typeof part.text === 'string')
|
|
310
|
+
return { type: 'text', text: part.text };
|
|
311
|
+
if (part?.type === 'mention') {
|
|
312
|
+
if (part.userID == null) return { type: 'unresolved-mention' };
|
|
313
|
+
const id = String(part.userID);
|
|
314
|
+
apiUserID(id);
|
|
315
|
+
return {
|
|
316
|
+
type: 'mention',
|
|
317
|
+
ref: { kind: 'user', id, idType: 'apaas-user' },
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
if (part?.type === 'link' && typeof part.url === 'string') {
|
|
321
|
+
const ref = documentRefFromUrl(part.url);
|
|
322
|
+
return ref
|
|
323
|
+
? { type: 'mention', ref, href: part.url }
|
|
324
|
+
: { type: 'link', url: part.url };
|
|
325
|
+
}
|
|
326
|
+
throw new Error('评论 content 包含未支持的节点');
|
|
327
|
+
});
|
|
328
|
+
return normalizeValue({ version: 1, content: parts });
|
|
329
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { DOCUMENT_ICONS } from './document-icons';
|
|
3
|
+
import type {
|
|
4
|
+
DocumentMentionMetadata,
|
|
5
|
+
MentionRef,
|
|
6
|
+
} from './types';
|
|
7
|
+
|
|
8
|
+
export function DocumentIcon({
|
|
9
|
+
refValue,
|
|
10
|
+
metadata,
|
|
11
|
+
variant = 'inline',
|
|
12
|
+
}: {
|
|
13
|
+
refValue: MentionRef;
|
|
14
|
+
metadata?: DocumentMentionMetadata;
|
|
15
|
+
variant?: 'inline' | 'option';
|
|
16
|
+
}) {
|
|
17
|
+
const emoji = documentEmoji(metadata?.iconInfo);
|
|
18
|
+
const size = variant === 'option' ? 32 : 14;
|
|
19
|
+
const className =
|
|
20
|
+
variant === 'option'
|
|
21
|
+
? 'inline-block shrink-0 text-center leading-none'
|
|
22
|
+
: '-mb-0.5 mr-0.5 inline-block text-center leading-none';
|
|
23
|
+
return emoji ? (
|
|
24
|
+
<span
|
|
25
|
+
aria-hidden
|
|
26
|
+
className={className}
|
|
27
|
+
style={{ width: size, height: size, fontSize: size }}
|
|
28
|
+
>
|
|
29
|
+
{emoji}
|
|
30
|
+
</span>
|
|
31
|
+
) : (
|
|
32
|
+
<span
|
|
33
|
+
aria-hidden
|
|
34
|
+
className={className}
|
|
35
|
+
style={{ width: size, height: size }}
|
|
36
|
+
// Only bundled static UD SVGs enter this HTML sink; never document metadata.
|
|
37
|
+
dangerouslySetInnerHTML={{
|
|
38
|
+
__html: documentIconSvg(refValue, metadata, variant),
|
|
39
|
+
}}
|
|
40
|
+
/>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const outline: Record<string, keyof typeof DOCUMENT_ICONS> = {
|
|
45
|
+
'1': 'FileDocV2Outlined',
|
|
46
|
+
'2': 'FileDocV2Outlined',
|
|
47
|
+
'22': 'FileDocV2Outlined',
|
|
48
|
+
'16': 'FileDocV2Outlined',
|
|
49
|
+
'44': 'FileDocV2Outlined',
|
|
50
|
+
'3': 'FileSheetV2Outlined',
|
|
51
|
+
'8': 'FileBitableV2Outlined',
|
|
52
|
+
'11': 'FileMindnoteV2Outlined',
|
|
53
|
+
'12': 'FileUnknowV2Outlined',
|
|
54
|
+
'15': 'FileLinkSlideV2Outlined',
|
|
55
|
+
'30': 'FileSlidesV2Outlined',
|
|
56
|
+
'38': 'FileBoardV2Outlined',
|
|
57
|
+
};
|
|
58
|
+
const colorful: Record<string, keyof typeof DOCUMENT_ICONS> = {
|
|
59
|
+
'1': 'FileRoundDocV2Colorful',
|
|
60
|
+
'2': 'FileRoundDocV2Colorful',
|
|
61
|
+
'22': 'FileRoundDocV2Colorful',
|
|
62
|
+
'3': 'FileRoundSheetV2Colorful',
|
|
63
|
+
'8': 'FileRoundBitableV2Colorful',
|
|
64
|
+
'11': 'FileRoundMindnoteV2Colorful',
|
|
65
|
+
'12': 'FileRoundUnknowV2Colorful',
|
|
66
|
+
'15': 'FileRoundPptV2Colorful',
|
|
67
|
+
'30': 'FileRoundSlidesV2Colorful',
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export function documentIconSvg(
|
|
71
|
+
ref: MentionRef,
|
|
72
|
+
meta?: DocumentMentionMetadata,
|
|
73
|
+
variant: 'inline' | 'option' = 'inline',
|
|
74
|
+
) {
|
|
75
|
+
const type = ref.kind === 'document' ? ref.resourceType : '';
|
|
76
|
+
// Inline AtSuite uses the mention type; the search panel uses a wiki's real type.
|
|
77
|
+
const iconType =
|
|
78
|
+
variant === 'option' && type === '16' && meta?.subType
|
|
79
|
+
? String(meta.subType)
|
|
80
|
+
: type;
|
|
81
|
+
return DOCUMENT_ICONS[
|
|
82
|
+
variant === 'option'
|
|
83
|
+
? colorful[iconType] || 'FileRoundDocV2Colorful'
|
|
84
|
+
: outline[iconType] || 'FileDocV2Outlined'
|
|
85
|
+
];
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export function documentEmoji(iconInfo?: string): string {
|
|
89
|
+
if (!iconInfo) return '';
|
|
90
|
+
try {
|
|
91
|
+
const { type, key } = JSON.parse(decodeURIComponent(iconInfo));
|
|
92
|
+
if (
|
|
93
|
+
type !== 1 ||
|
|
94
|
+
typeof key !== 'string' ||
|
|
95
|
+
!/^[0-9a-f]+(?:-[0-9a-f]+)*$/i.test(key)
|
|
96
|
+
)
|
|
97
|
+
return '';
|
|
98
|
+
return String.fromCodePoint(
|
|
99
|
+
...key.split('-').map((part) => parseInt(part, 16)),
|
|
100
|
+
);
|
|
101
|
+
} catch {
|
|
102
|
+
return '';
|
|
103
|
+
}
|
|
104
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Static SVGs from @universe-design/icons-react 3.350.0, matching miaoda ud-provider-icons V2.
|
|
2
|
+
// Only the document glyphs are included; no icon library runtime dependency.
|
|
3
|
+
export const DOCUMENT_ICONS = {
|
|
4
|
+
"FileDocV2Outlined": "<svg width=\"100%\" height=\"100%\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" data-icon=\"FileDocV2Outlined\"><path d=\"M16.716 14.36a.783.783 0 0 1 0 1.565H7.282a.783.783 0 0 1 0-1.565h9.434Zm-5.001-4.229a.8.8 0 0 1 0 1.6h-4.4a.8.8 0 0 1 0-1.6h4.4Z\" fill=\"currentColor\"></path><path d=\"M15.153 1.5c.75.006 1.472.36 2.02.874l3.875 3.63c.607.569.952 1.366.952 2.198v8.28c0 3.323-2.687 6.017-6 6.017H8c-3.313 0-6-2.694-6-6.016v-8.97C2 4.17 4.72 1.469 8.056 1.5h7.097ZM8.037 3.503A4.006 4.006 0 0 0 4 7.514v8.969a4.006 4.006 0 0 0 4 4.01h8c2.209 0 4-1.796 4-4.01v-8.28c0-.083-.012-.164-.031-.243h-2.42l-.203-.01a2.005 2.005 0 0 1-1.796-1.996V3.666c0-.137-.152-.16-.29-.162H8.038Z\" fill=\"currentColor\"></path></svg>",
|
|
5
|
+
"FileSheetV2Outlined": "<svg width=\"100%\" height=\"100%\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" data-icon=\"FileSheetV2Outlined\"><path d=\"M12 7.96c.774 0 1.5.05 2.133.115a3.068 3.068 0 0 1 2.753 2.76A20.8 20.8 0 0 1 17 12.974c0 .775-.048 1.504-.114 2.139a3.069 3.069 0 0 1-2.753 2.76c-.634.067-1.36.115-2.133.115-.58 0-1.134-.027-1.642-.069l-.49-.046a3.065 3.065 0 0 1-2.714-2.488l-.04-.272A20.772 20.772 0 0 1 7 12.973c0-.58.027-1.136.068-1.645l.046-.493a3.066 3.066 0 0 1 2.482-2.72l.271-.04A20.58 20.58 0 0 1 12 7.96Zm-.386 8.418a17.484 17.484 0 0 0 2.353-.101 1.466 1.466 0 0 0 1.327-1.33c.061-.59.106-1.263.106-1.973 0-.125-.003-.25-.005-.371h-3.78v3.775ZM8.6 12.974c0 .7.043 1.364.103 1.95l.027.18c.13.634.636 1.103 1.303 1.173l.18.016v-3.69H8.605c-.002.122-.004.246-.004.37Zm1.455-3.306-.18.028a1.46 1.46 0 0 0-1.169 1.306l-.02.196h1.528V9.653l-.16.015Zm1.56-.098v1.628h3.697c-.006-.066-.011-.132-.018-.196a1.466 1.466 0 0 0-1.327-1.33 18.991 18.991 0 0 0-2.353-.102Z\" fill=\"currentColor\"></path><path d=\"M15.153 1.5c.75.007 1.472.362 2.02.875l3.875 3.63c.607.569.952 1.365.952 2.198v8.28c0 3.323-2.687 6.017-6 6.017H8c-3.313 0-6-2.694-6-6.016v-8.97C2 4.172 4.72 1.47 8.056 1.5h7.097ZM8.037 3.505A4.005 4.005 0 0 0 4 7.515v8.969a4.006 4.006 0 0 0 4 4.01h8c2.209 0 4-1.796 4-4.01v-8.28c0-.083-.012-.164-.031-.243h-2.42l-.203-.01a2.005 2.005 0 0 1-1.796-1.996V3.667c0-.138-.152-.16-.29-.162H8.038Z\" fill=\"currentColor\"></path></svg>",
|
|
6
|
+
"FileBitableV2Outlined": "<svg width=\"100%\" height=\"100%\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" data-icon=\"FileBitableV2Outlined\"><path d=\"M13.515 8.189a1.001 1.001 0 0 1 1.32.084l1.889 1.89a1 1 0 0 1 .084 1.319l-1.174 1.514 1.174 1.516a1 1 0 0 1-.084 1.32l-1.889 1.888a1.001 1.001 0 0 1-1.32.084L12 16.63l-1.513 1.174a1 1 0 0 1-1.32-.083l-1.89-1.89a1 1 0 0 1-.085-1.32l1.174-1.515-1.174-1.514a1 1 0 0 1 .084-1.32l1.891-1.89a1 1 0 0 1 1.32-.082L12 9.363l1.515-1.174Zm-5.149 4.807L12 16.63l3.634-3.634L12 9.363l-3.634 3.633Z\" fill=\"currentColor\"></path><path d=\"M15.153 1.5c.75.007 1.472.362 2.02.875l3.875 3.63c.607.569.952 1.365.952 2.198v8.28c0 3.323-2.686 6.017-6 6.017H8c-3.314 0-6-2.694-6-6.016v-8.97C2 4.172 4.72 1.47 8.056 1.5h7.097ZM8.037 3.505A4.005 4.005 0 0 0 4 7.515v8.969a4.006 4.006 0 0 0 4 4.01h8c2.209 0 4-1.796 4-4.01v-8.28c0-.083-.012-.164-.031-.243h-2.42l-.203-.01a2.004 2.004 0 0 1-1.796-1.996V3.667c0-.138-.152-.16-.29-.162H8.038Z\" fill=\"currentColor\"></path></svg>",
|
|
7
|
+
"FileMindnoteV2Outlined": "<svg width=\"100%\" height=\"100%\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" data-icon=\"FileMindnoteV2Outlined\"><path d=\"M12 7.96a1.403 1.403 0 0 1 .7 2.616v.666a4.909 4.909 0 0 1 4.2 4.862v.33a1.403 1.403 0 0 1-.8 2.554 1.403 1.403 0 0 1-.601-2.67v-.214a3.507 3.507 0 0 0-2.799-3.438v3.705a1.403 1.403 0 0 1-.7 2.617 1.403 1.403 0 0 1-.7-2.617v-3.705a3.508 3.508 0 0 0-2.8 3.438v.214a1.403 1.403 0 0 1-.6 2.67 1.403 1.403 0 0 1-.8-2.554v-.33a4.909 4.909 0 0 1 4.2-4.861v-.667A1.403 1.403 0 0 1 12 7.96Z\" fill=\"currentColor\"></path><path d=\"M15.153 2c.75.006 1.472.36 2.02.874l3.875 3.63c.607.569.952 1.366.952 2.198v8.28C22 20.306 19.313 23 16 23H8c-3.313 0-6-2.694-6-6.016v-8.97C2 4.67 4.72 1.969 8.056 2h7.097ZM8.037 4.003A4.006 4.006 0 0 0 4 8.014v8.969a4.006 4.006 0 0 0 4 4.01h8c2.209 0 4-1.796 4-4.01v-8.28c0-.083-.012-.164-.031-.243h-2.42l-.203-.01a2.005 2.005 0 0 1-1.796-1.996V4.166c0-.137-.152-.16-.29-.162H8.038Z\" fill=\"currentColor\"></path></svg>",
|
|
8
|
+
"FileUnknowV2Outlined": "<svg width=\"100%\" height=\"100%\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" data-icon=\"FileUnknowV2Outlined\"><path d=\"M12.001 16.484a1.002 1.002 0 0 1 0 2.005 1.001 1.001 0 0 1 0-2.006ZM12 7.694c1.692 0 3.008 1.423 3.009 3.109 0 .93-.397 1.774-1.033 2.347-.342.307-.644.575-.872.863-.222.282-.303.5-.303.683a.801.801 0 1 1-1.6 0c0-.691.314-1.254.65-1.678.33-.418.748-.785 1.055-1.062.304-.273.503-.685.503-1.153 0-.863-.662-1.506-1.409-1.506s-1.408.643-1.408 1.506c0 .148.02.291.056.425a.8.8 0 1 1-1.543.425 3.218 3.218 0 0 1-.113-.85c0-1.686 1.316-3.11 3.008-3.11Z\" fill=\"currentColor\"></path><path d=\"M15.153 1.5c.75.007 1.472.362 2.02.875l3.875 3.63c.607.569.952 1.365.952 2.198v8.28c0 3.323-2.686 6.017-6 6.017H8c-3.314 0-6-2.694-6-6.016v-8.97C2 4.172 4.72 1.47 8.056 1.5h7.097ZM8.037 3.505A4.005 4.005 0 0 0 4 7.515v8.969a4.006 4.006 0 0 0 4 4.01h8c2.209 0 4-1.796 4-4.01v-8.28c0-.083-.012-.164-.031-.243h-2.42l-.203-.01a2.004 2.004 0 0 1-1.796-1.996V3.667c0-.138-.152-.16-.29-.162H8.038Z\" fill=\"currentColor\"></path></svg>",
|
|
9
|
+
"FileLinkSlideV2Outlined": "<svg width=\"100%\" height=\"100%\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" data-icon=\"FileLinkSlideV2Outlined\"><path d=\"M15.204 17.49A2 2 0 0 0 17 15.5v-5a2 2 0 0 0-2-2H9a2 2 0 0 0-2 2v5l.01.204a2 2 0 0 0 1.786 1.785L9 17.5h6l.204-.01ZM9.3 15.5a.8.8 0 0 1-.8-.8v-3.6a.6.6 0 0 1 .6-.6h5.8a.6.6 0 0 1 .6.6v3.8a.6.6 0 0 1-.6.6H9.3Z\" fill=\"currentColor\"></path><path d=\"M16 22.5c3.314 0 6-2.694 6-6.016v-8.28c0-.834-.345-1.63-.952-2.199l-3.874-3.63c-.549-.513-1.27-.868-2.02-.875H8.055C4.72 1.47 2 4.171 2 7.515v8.969C2 19.806 4.686 22.5 8 22.5h8Zm-8-2.006c-2.21 0-4-1.795-4-4.01v-8.97a4.005 4.005 0 0 1 4.037-4.009h7.224c.137.003.289.025.289.162v2.288c0 1.039.787 1.893 1.796 1.995l.204.011h2.419c.02.079.03.16.031.242v8.28a4.004 4.004 0 0 1-4 4.011H8Z\" fill=\"currentColor\"></path></svg>",
|
|
10
|
+
"FileSlidesV2Outlined": "<svg width=\"100%\" height=\"100%\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" data-icon=\"FileSlidesV2Outlined\"><path d=\"M11.933 18.423c3 0 5.433-2.44 5.433-5.448 0-3.009-2.433-5.447-5.433-5.447S6.5 9.966 6.5 12.975c0 3.008 2.432 5.448 5.433 5.448Zm0-1.604A3.839 3.839 0 0 1 8.1 12.975a3.843 3.843 0 0 1 3.053-3.765v3.334c0 .72.582 1.304 1.3 1.304h3.213a3.838 3.838 0 0 1-3.733 2.97Zm.82-7.599a3.844 3.844 0 0 1 2.943 3.023h-2.943V9.22Z\" fill=\"currentColor\"></path><path d=\"M16 22.5c3.314 0 6-2.694 6-6.016v-8.28c0-.834-.345-1.63-.952-2.199l-3.874-3.63c-.549-.513-1.27-.868-2.02-.875H8.055C4.72 1.47 2 4.171 2 7.515v8.969C2 19.806 4.686 22.5 8 22.5h8Zm-8-2.006c-2.21 0-4-1.795-4-4.01v-8.97a4.005 4.005 0 0 1 4.037-4.009h7.224c.137.003.289.025.289.162v2.288c0 1.039.787 1.893 1.796 1.995l.204.011h2.419c.02.079.03.16.031.242v8.28a4.004 4.004 0 0 1-4 4.011H8Z\" fill=\"currentColor\"></path></svg>",
|
|
11
|
+
"FileBoardV2Outlined": "<svg width=\"100%\" height=\"100%\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" data-icon=\"FileBoardV2Outlined\"><path d=\"M13.633 8.19c.397.018.75.182 1.054.478.236.229.365.507.373.826.007.3-.08.63-.24.986-.16.35-.384.743-.67 1.175-.282.425-.61.898-.981 1.417l-.812 1.129c-.222.309-.403.567-.543.772-.14.204-.24.366-.305.485h-.001a.716.716 0 0 0-.084.218c0 .01 0 .016.003.021h.021a.91.91 0 0 0 .276-.124 5.89 5.89 0 0 0 .564-.405c.235-.185.53-.433.883-.745.379-.33.717-.618 1.014-.864v-.001c.304-.249.582-.445.83-.584l.193-.097c.19-.084.378-.129.56-.126.259.004.49.117.688.31l.105.116a.919.919 0 0 1 .185.396h.002c.04.185.025.383-.031.588h-.001a3.346 3.346 0 0 1-.25.633c-.055.112-.116.23-.182.353l-.214.386c-.16.28-.29.517-.393.707l-.001-.002a3.007 3.007 0 0 0-.17.367c.072-.032.172-.088.3-.18l.003-.002c.155-.111.341-.27.557-.48h.001a.544.544 0 0 1 .334-.154.454.454 0 0 1 .364.138.437.437 0 0 1 .127.4.67.67 0 0 1-.197.349l-.002.001c-.458.448-.888.744-1.288.855-.39.108-.743.069-1-.188l-.003-.002a.942.942 0 0 1-.268-.504l-.01-.082c-.015-.2.02-.406.097-.615a3.89 3.89 0 0 1 .288-.614v-.002c.117-.197.231-.393.344-.587l.304-.535a1.71 1.71 0 0 0 .152-.348l.001-.01a.62.62 0 0 0-.109.053h.001c-.16.1-.366.257-.62.476-.254.219-.538.467-.852.746l-.002.002a18.82 18.82 0 0 1-1.516 1.203l-.001-.001c-.445.311-.851.512-1.218.579l-.001-.001a1.08 1.08 0 0 1-1.015-.313 1.14 1.14 0 0 1-.355-.71H9.92c-.026-.26.021-.537.13-.824v-.002c.11-.28.266-.582.466-.903.197-.318.428-.66.691-1.023l.839-1.165v-.002c.198-.271.39-.542.578-.81.093-.135.18-.265.262-.389l.226-.357c.138-.229.227-.413.274-.556v-.002a.534.534 0 0 0 .025-.103.899.899 0 0 0-.223.11l-.002.001c-.22.138-.515.372-.886.708-.368.333-.8.745-1.295 1.235-.493.489-1.039 1.037-1.639 1.645l-.334.337-.002.002c-.096.096-.18.182-.252.256l-.186.186a3.591 3.591 0 0 1-.131.125 1.083 1.083 0 0 1-.996.256.893.893 0 0 1-.4-.226.925.925 0 0 1-.23-.394l-.002-.004a1.02 1.02 0 0 1-.007-.497c.04-.184.135-.354.272-.508H7.1c.031-.036.073-.08.125-.13l.186-.187.264-.253c.1-.096.213-.208.342-.336v-.001a56.897 56.897 0 0 1 2.495-2.337l.5-.42a9.95 9.95 0 0 1 1.28-.905l.184-.1c.423-.219.81-.332 1.156-.316Z\" fill=\"currentColor\"></path><path d=\"M15.153 1.5c.75.007 1.472.362 2.02.875l3.875 3.63c.607.569.952 1.365.952 2.198v8.28c0 3.323-2.686 6.017-6 6.017H8c-3.314 0-6-2.694-6-6.016v-8.97C2 4.172 4.72 1.47 8.056 1.5h7.097ZM8.037 3.505A4.005 4.005 0 0 0 4 7.515v8.969a4.006 4.006 0 0 0 4 4.01h8c2.209 0 4-1.796 4-4.01v-8.28c0-.083-.012-.164-.031-.243h-2.42l-.203-.01a2.004 2.004 0 0 1-1.796-1.996V3.667c0-.138-.152-.16-.29-.162H8.038Z\" fill=\"currentColor\"></path></svg>",
|
|
12
|
+
"FileRoundDocV2Colorful": "<svg width=\"100%\" height=\"100%\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" data-icon=\"FileRoundDocV2Colorful\"><circle cx=\"12\" cy=\"12\" r=\"12\" fill=\"#F0F4FF\"></circle><path opacity=\"0.99\" d=\"M5.333 11.4v1.2c0 2.24 0 3.36.436 4.216a4 4 0 0 0 1.748 1.748C8.373 19 9.493 19 11.733 19h.533c2.24 0 3.36 0 4.216-.436a4 4 0 0 0 1.748-1.748c.436-.856.436-1.976.436-4.216v-.833c0-.652 0-.978-.073-1.285a2.666 2.666 0 0 0-.32-.77c-.165-.27-.395-.5-.856-.962l-2.501-2.5c-.461-.462-.692-.692-.96-.857a2.667 2.667 0 0 0-.772-.32C12.877 5 12.551 5 11.9 5h-.166c-2.24 0-3.36 0-4.216.436A4 4 0 0 0 5.77 7.184c-.436.856-.436 1.976-.436 4.216Z\" fill=\"#fff\"></path><path d=\"M12.232 4.66c.637 0 1.01-.002 1.364.083a3 3 0 0 1 .867.359c.31.19.573.455 1.023.905l2.167 2.167c.45.45.715.713.905 1.023a3 3 0 0 1 .36.867c.084.354.082.727.082 1.364v1.166c0 1.114 0 1.97-.055 2.654-.056.687-.171 1.23-.417 1.713a4.334 4.334 0 0 1-1.894 1.894c-.483.245-1.025.36-1.713.416-.683.056-1.54.056-2.654.056h-.534c-1.114 0-1.97 0-2.654-.056-.688-.056-1.23-.17-1.713-.416a4.334 4.334 0 0 1-1.894-1.894c-.246-.483-.36-1.026-.417-1.713C5 14.564 5 13.708 5 12.594v-1.2c0-1.115 0-1.972.055-2.655.057-.688.171-1.23.417-1.713a4.334 4.334 0 0 1 1.894-1.894c.482-.246 1.025-.36 1.713-.417.683-.056 1.54-.055 2.654-.055h.5Zm-.499.667c-1.125 0-1.95 0-2.6.053-.646.053-1.091.156-1.464.346a3.673 3.673 0 0 0-1.603 1.603c-.19.373-.293.818-.346 1.464-.053.65-.053 1.475-.053 2.6v1.2c0 1.126 0 1.95.053 2.6.053.647.156 1.092.346 1.465.352.69.913 1.25 1.603 1.602.373.19.818.294 1.464.347.65.053 1.475.053 2.6.053h.534c1.125 0 1.95 0 2.6-.053.646-.053 1.091-.157 1.464-.347a3.666 3.666 0 0 0 1.603-1.602c.19-.373.293-.818.346-1.465.053-.65.053-1.474.053-2.6v-1.165c0-.669-.002-.949-.064-1.208a2.31 2.31 0 0 0-.086-.274.835.835 0 0 0-.208-.071 3.176 3.176 0 0 0-.642-.048v-.004c-.1.002-.216.004-.347.004-.457 0-.808 0-1.09-.02a2.238 2.238 0 0 1-.713-.14c-.54-.22-.97-.649-1.19-1.19a2.254 2.254 0 0 1-.14-.713c-.02-.282-.02-.632-.02-1.09 0-.13.001-.246.003-.347h-.003a3.18 3.18 0 0 0-.048-.642.832.832 0 0 0-.072-.209 2.332 2.332 0 0 0-.273-.085c-.26-.062-.54-.064-1.208-.064h-.499Z\" fill=\"#C0D2FC\"></path><path d=\"M15.214 12.993a.534.534 0 0 1 0 1.066H8.949a.534.534 0 1 1 0-1.066h6.265ZM11.88 9.66a.533.533 0 0 1 0 1.066H8.948a.533.533 0 1 1 0-1.066h2.932Z\" fill=\"#336DF4\"></path></svg>",
|
|
13
|
+
"FileRoundSheetV2Colorful": "<svg width=\"100%\" height=\"100%\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" data-icon=\"FileRoundSheetV2Colorful\"><circle cx=\"12\" cy=\"12\" r=\"12\" fill=\"#E4FAE1\"></circle><path opacity=\"0.99\" d=\"M5.333 11.4v1.2c0 2.24 0 3.36.436 4.216a4 4 0 0 0 1.748 1.748C8.373 19 9.493 19 11.733 19h.533c2.24 0 3.36 0 4.216-.436a4 4 0 0 0 1.748-1.748c.436-.856.436-1.976.436-4.216v-.833c0-.652 0-.978-.073-1.285a2.666 2.666 0 0 0-.32-.77c-.165-.27-.395-.5-.856-.962l-2.501-2.5c-.461-.462-.692-.692-.96-.857a2.667 2.667 0 0 0-.772-.32C12.877 5 12.551 5 11.9 5h-.166c-2.24 0-3.36 0-4.216.436A4 4 0 0 0 5.77 7.184c-.436.856-.436 1.976-.436 4.216Z\" fill=\"#fff\"></path><path d=\"M12.232 4.667c.637 0 1.01-.003 1.364.082a3 3 0 0 1 .867.36c.31.19.573.455 1.023.905l2.167 2.167c.45.45.715.712.905 1.023a3 3 0 0 1 .36.867c.084.354.082.727.082 1.363V12.6c0 1.115 0 1.97-.055 2.654-.056.688-.171 1.23-.417 1.713a4.334 4.334 0 0 1-1.894 1.894c-.483.246-1.025.36-1.713.417-.683.056-1.54.055-2.654.055h-.534c-1.114 0-1.97 0-2.654-.055-.688-.056-1.23-.17-1.713-.417a4.334 4.334 0 0 1-1.894-1.894c-.246-.482-.36-1.025-.417-1.713C5 14.571 5 13.714 5 12.6v-1.2c0-1.115 0-1.971.055-2.655.057-.687.171-1.23.417-1.713A4.334 4.334 0 0 1 7.366 5.14c.482-.246 1.025-.361 1.713-.417.683-.056 1.54-.055 2.654-.055h.5Zm-.499.666c-1.125 0-1.95 0-2.6.054-.646.052-1.091.156-1.464.346a3.666 3.666 0 0 0-1.603 1.602c-.19.373-.293.819-.346 1.465-.053.65-.053 1.474-.053 2.6v1.2c0 1.126 0 1.95.053 2.6.053.646.156 1.092.346 1.465.352.69.913 1.25 1.603 1.602.373.19.818.293 1.464.346.65.053 1.475.053 2.6.053h.534c1.125 0 1.95 0 2.6-.053.646-.053 1.091-.156 1.464-.346a3.667 3.667 0 0 0 1.603-1.602c.19-.373.293-.819.346-1.465.053-.65.053-1.474.053-2.6v-1.166c0-.668-.002-.948-.064-1.208a2.314 2.314 0 0 0-.086-.274.835.835 0 0 0-.208-.07 3.176 3.176 0 0 0-.642-.049V9.83c-.1.002-.216.003-.347.003-.457 0-.808 0-1.09-.019-.283-.019-.508-.057-.713-.14-.54-.22-.97-.65-1.19-1.19a2.254 2.254 0 0 1-.14-.713c-.02-.282-.02-.633-.02-1.09 0-.131.001-.247.003-.348h-.003a3.18 3.18 0 0 0-.048-.642.832.832 0 0 0-.072-.208 2.334 2.334 0 0 0-.273-.085c-.26-.063-.54-.065-1.208-.065h-.499Z\" fill=\"#9EE8A2\"></path><path d=\"M10.704 11.857v3.882l-.126-.008a2.04 2.04 0 0 1-1.809-1.654l-.026-.181a13.763 13.763 0 0 1-.062-2.039h2.023ZM12 9.14c.516 0 1 .033 1.422.077.98.102 1.79 1.413 1.835 1.835v.005h-3.753V9.151c.161-.006.327-.01.496-.01Zm-1.296 1.917H8.742v-.005a2.04 2.04 0 0 1 1.655-1.809l.181-.026.126-.013v1.853Z\" fill=\"#32A645\"></path><path d=\"M15.317 11.844c.007.151.012.306.014.465v.341c-.006.457-.035.886-.074 1.265a2.052 2.052 0 0 1-1.835 1.853 13.639 13.639 0 0 1-1.918.066v-3.99h3.813Z\" fill=\"#5CD168\"></path></svg>",
|
|
14
|
+
"FileRoundBitableV2Colorful": "<svg width=\"100%\" height=\"100%\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" data-icon=\"FileRoundBitableV2Colorful\"><circle cx=\"12\" cy=\"12\" r=\"12\" fill=\"#F5F0FE\"></circle><path opacity=\"0.99\" d=\"M5.333 11.4v1.2c0 2.24 0 3.36.436 4.216a4 4 0 0 0 1.748 1.748C8.373 19 9.493 19 11.733 19h.533c2.24 0 3.36 0 4.216-.436a4 4 0 0 0 1.748-1.748c.436-.856.436-1.976.436-4.216v-.833c0-.652 0-.978-.073-1.285a2.666 2.666 0 0 0-.32-.77c-.165-.27-.395-.5-.856-.962l-2.501-2.5c-.461-.462-.692-.692-.96-.857a2.667 2.667 0 0 0-.772-.32C12.877 5 12.551 5 11.9 5h-.166c-2.24 0-3.36 0-4.216.436A4 4 0 0 0 5.77 7.184c-.436.856-.436 1.976-.436 4.216Z\" fill=\"#fff\"></path><path d=\"M12.232 4.667c.637 0 1.01-.003 1.364.082a3 3 0 0 1 .867.36c.31.19.573.455 1.023.905l2.167 2.167c.45.45.715.712.905 1.023a3 3 0 0 1 .36.867c.084.354.082.727.082 1.363V12.6c0 1.115 0 1.97-.055 2.655-.056.687-.171 1.23-.417 1.712a4.334 4.334 0 0 1-1.894 1.894c-.483.246-1.025.36-1.713.417-.683.056-1.54.055-2.654.055h-.534c-1.114 0-1.97 0-2.654-.055-.688-.056-1.23-.17-1.713-.417a4.334 4.334 0 0 1-1.894-1.894c-.246-.482-.36-1.025-.417-1.712C5 14.57 5 13.715 5 12.6v-1.2c0-1.115 0-1.97.055-2.655.057-.687.171-1.23.417-1.712a4.334 4.334 0 0 1 1.894-1.894c.482-.246 1.025-.36 1.713-.417.683-.056 1.54-.055 2.654-.055h.5Zm-.499.666c-1.125 0-1.95 0-2.6.054-.646.053-1.091.156-1.464.346a3.671 3.671 0 0 0-1.603 1.602c-.19.373-.293.819-.346 1.465-.053.65-.053 1.474-.053 2.6v1.2c0 1.126 0 1.95.053 2.6.053.646.156 1.092.346 1.465.352.69.913 1.25 1.603 1.602.373.19.818.294 1.464.346.65.053 1.475.054 2.6.054h.534c1.125 0 1.95 0 2.6-.054.646-.052 1.091-.156 1.464-.346a3.666 3.666 0 0 0 1.603-1.602c.19-.373.293-.819.346-1.465.053-.65.053-1.474.053-2.6v-1.166c0-.668-.002-.948-.064-1.207a2.312 2.312 0 0 0-.086-.275.834.834 0 0 0-.208-.07 3.175 3.175 0 0 0-.642-.049V9.83c-.1.002-.216.003-.347.003-.457 0-.808 0-1.09-.019-.283-.019-.508-.057-.713-.14-.54-.22-.97-.65-1.19-1.19a2.254 2.254 0 0 1-.14-.713c-.02-.282-.02-.633-.02-1.09 0-.131.001-.247.003-.348h-.003a3.18 3.18 0 0 0-.048-.642.832.832 0 0 0-.072-.208 2.334 2.334 0 0 0-.273-.085c-.26-.063-.54-.065-1.208-.065h-.499Z\" fill=\"#D9C5FC\"></path><path d=\"m9.621 12.667-.761.983a.667.667 0 0 0 .056.88l1.222 1.221a.667.667 0 0 0 .88.056l.982-.762.983.762a.667.667 0 0 0 .88-.056l1.222-1.221a.667.667 0 0 0 .055-.88l-.761-.983.761-.984a.667.667 0 0 0-.055-.88l-1.222-1.221a.667.667 0 0 0-.88-.056l-.983.762-.982-.761a.667.667 0 0 0-.88.055l-1.222 1.222a.667.667 0 0 0-.056.88l.761.983ZM12 10.288l2.379 2.379L12 15.045l-2.379-2.378L12 10.288Z\" fill=\"#8D55ED\"></path></svg>",
|
|
15
|
+
"FileRoundMindnoteV2Colorful": "<svg width=\"100%\" height=\"100%\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" data-icon=\"FileRoundMindnoteV2Colorful\"><circle cx=\"12\" cy=\"12\" r=\"12\" fill=\"#E7F8FE\"></circle><path opacity=\"0.99\" d=\"M5.333 11.4v1.2c0 2.24 0 3.36.436 4.216a4 4 0 0 0 1.748 1.748C8.373 19 9.493 19 11.733 19h.533c2.24 0 3.36 0 4.216-.436a4 4 0 0 0 1.748-1.748c.436-.856.436-1.976.436-4.216v-.833c0-.652 0-.978-.073-1.285a2.666 2.666 0 0 0-.32-.77c-.165-.27-.395-.5-.856-.962l-2.501-2.5c-.461-.462-.692-.692-.96-.857a2.667 2.667 0 0 0-.772-.32C12.877 5 12.551 5 11.9 5h-.166c-2.24 0-3.36 0-4.216.436A4 4 0 0 0 5.77 7.184c-.436.856-.436 1.976-.436 4.216Z\" fill=\"#fff\"></path><path d=\"M12.232 4.667c.637 0 1.01-.003 1.364.082a3 3 0 0 1 .867.36c.31.19.573.455 1.023.905l2.167 2.167c.45.45.715.712.905 1.023a3 3 0 0 1 .36.867c.084.354.082.727.082 1.363V12.6c0 1.115 0 1.97-.055 2.655-.056.687-.171 1.23-.417 1.712a4.334 4.334 0 0 1-1.894 1.894c-.483.246-1.025.36-1.713.417-.683.056-1.54.055-2.654.055h-.534c-1.114 0-1.97 0-2.654-.055-.688-.056-1.23-.17-1.713-.417a4.334 4.334 0 0 1-1.894-1.894c-.246-.482-.36-1.025-.417-1.712C5 14.57 5 13.715 5 12.6v-1.2c0-1.115 0-1.97.055-2.655.057-.687.171-1.23.417-1.712a4.334 4.334 0 0 1 1.894-1.894c.482-.246 1.025-.36 1.713-.417.683-.056 1.54-.055 2.654-.055h.5Zm-.499.666c-1.125 0-1.95 0-2.6.054-.646.053-1.091.156-1.464.346a3.671 3.671 0 0 0-1.603 1.602c-.19.373-.293.819-.346 1.465-.053.65-.053 1.474-.053 2.6v1.2c0 1.126 0 1.95.053 2.6.053.646.156 1.092.346 1.465.352.69.913 1.25 1.603 1.602.373.19.818.294 1.464.346.65.053 1.475.054 2.6.054h.534c1.125 0 1.95 0 2.6-.054.646-.052 1.091-.156 1.464-.346a3.666 3.666 0 0 0 1.603-1.602c.19-.373.293-.819.346-1.465.053-.65.053-1.474.053-2.6v-1.166c0-.668-.002-.948-.064-1.207a2.312 2.312 0 0 0-.086-.275.834.834 0 0 0-.208-.07 3.175 3.175 0 0 0-.642-.049V9.83c-.1.002-.216.003-.347.003-.457 0-.808 0-1.09-.019-.283-.019-.508-.057-.713-.14-.54-.22-.97-.65-1.19-1.19a2.254 2.254 0 0 1-.14-.713c-.02-.282-.02-.633-.02-1.09 0-.131.001-.247.003-.348h-.003a3.18 3.18 0 0 0-.048-.642.832.832 0 0 0-.072-.208 2.334 2.334 0 0 0-.273-.085c-.26-.063-.54-.065-1.208-.065h-.499Z\" fill=\"#A5DFFA\"></path><path d=\"M15.61 15.098a.833.833 0 1 1-1.21-.743v-.072a2.4 2.4 0 0 0-1.978-2.362v2.433a.833.833 0 1 1-.8.028v-2.47a2.4 2.4 0 0 0-2.021 2.37v.074a.832.832 0 1 1-.8.024v-.097a3.2 3.2 0 0 1 2.821-3.177v-.687a.832.832 0 0 1 .422-1.552.834.834 0 0 1 .378 1.576v.67a3.199 3.199 0 0 1 2.778 3.17v.098c.245.145.41.411.41.717Z\" fill=\"#047FB0\"></path></svg>",
|
|
16
|
+
"FileRoundUnknowV2Colorful": "<svg width=\"100%\" height=\"100%\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" data-icon=\"FileRoundUnknowV2Colorful\"><circle cx=\"12\" cy=\"12\" r=\"12\" fill=\"#F5F6F7\"></circle><path opacity=\"0.99\" d=\"M5.333 11.4v1.2c0 2.24 0 3.36.436 4.216a4 4 0 0 0 1.748 1.748C8.373 19 9.493 19 11.733 19h.533c2.24 0 3.36 0 4.216-.436a4 4 0 0 0 1.748-1.748c.436-.856.436-1.976.436-4.216v-.833c0-.652 0-.978-.073-1.285a2.666 2.666 0 0 0-.32-.77c-.165-.27-.395-.5-.856-.962l-2.501-2.5c-.461-.462-.692-.692-.96-.857a2.667 2.667 0 0 0-.772-.32C12.877 5 12.551 5 11.9 5h-.166c-2.24 0-3.36 0-4.216.436A4 4 0 0 0 5.77 7.184c-.436.856-.436 1.976-.436 4.216Z\" fill=\"#fff\"></path><path d=\"M12.232 4.667c.637 0 1.01-.003 1.364.082a3 3 0 0 1 .867.36c.31.19.573.455 1.023.905l2.167 2.167c.45.45.715.712.905 1.023a3 3 0 0 1 .36.867c.084.354.082.727.082 1.363V12.6c0 1.115 0 1.97-.055 2.655-.056.687-.171 1.23-.417 1.712a4.334 4.334 0 0 1-1.894 1.894c-.483.246-1.025.36-1.713.417-.683.056-1.54.055-2.654.055h-.534c-1.114 0-1.97 0-2.654-.055-.688-.056-1.23-.17-1.713-.417a4.334 4.334 0 0 1-1.894-1.894c-.246-.482-.36-1.025-.417-1.712C5 14.57 5 13.715 5 12.6v-1.2c0-1.115 0-1.97.055-2.655.057-.687.171-1.23.417-1.712a4.334 4.334 0 0 1 1.894-1.894c.482-.246 1.025-.36 1.713-.417.683-.056 1.54-.055 2.654-.055h.5Zm-.499.666c-1.125 0-1.95 0-2.6.054-.646.053-1.091.156-1.464.346a3.671 3.671 0 0 0-1.603 1.602c-.19.373-.293.819-.346 1.465-.053.65-.053 1.474-.053 2.6v1.2c0 1.126 0 1.95.053 2.6.053.646.156 1.092.346 1.465.352.69.913 1.25 1.603 1.602.373.19.818.294 1.464.346.65.053 1.475.054 2.6.054h.534c1.125 0 1.95 0 2.6-.054.646-.052 1.091-.156 1.464-.346a3.666 3.666 0 0 0 1.603-1.602c.19-.373.293-.819.346-1.465.053-.65.053-1.474.053-2.6v-1.166c0-.668-.002-.948-.064-1.207a2.312 2.312 0 0 0-.086-.275.834.834 0 0 0-.208-.07 3.175 3.175 0 0 0-.642-.049V9.83c-.1.002-.216.003-.347.003-.457 0-.808 0-1.09-.019-.283-.019-.508-.057-.713-.14-.54-.22-.97-.65-1.19-1.19a2.254 2.254 0 0 1-.14-.713c-.02-.282-.02-.633-.02-1.09 0-.131.001-.247.003-.348h-.003a3.18 3.18 0 0 0-.048-.642.832.832 0 0 0-.072-.208 2.334 2.334 0 0 0-.273-.085c-.26-.063-.54-.065-1.208-.065h-.499Z\" fill=\"#D0D3D6\"></path><path d=\"M12 14.77a.667.667 0 1 1 0 1.334.667.667 0 0 1 0-1.334Zm0-5.844c1.128 0 2.006.947 2.006 2.067 0 .62-.265 1.18-.69 1.56-.227.205-.428.383-.58.575-.148.187-.202.331-.202.453a.534.534 0 0 1-1.067 0c0-.46.21-.833.433-1.115.22-.278.5-.522.704-.706.202-.182.335-.455.335-.767 0-.574-.441-1-.94-1-.497 0-.938.427-.938 1 0 .1.014.194.038.282a.534.534 0 0 1-1.029.283 2.11 2.11 0 0 1-.075-.565c0-1.12.877-2.067 2.005-2.067Z\" fill=\"#646A73\"></path></svg>",
|
|
17
|
+
"FileRoundPptV2Colorful": "<svg width=\"100%\" height=\"100%\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" data-icon=\"FileRoundPptV2Colorful\"><circle cx=\"12\" cy=\"12\" r=\"12\" fill=\"#FFF3E5\"></circle><path opacity=\"0.99\" d=\"M5.333 11.4v1.2c0 2.24 0 3.36.436 4.216a4 4 0 0 0 1.748 1.748C8.373 19 9.493 19 11.733 19h.533c2.24 0 3.36 0 4.216-.436a4 4 0 0 0 1.748-1.748c.436-.856.436-1.976.436-4.216v-.833c0-.652 0-.978-.073-1.285a2.666 2.666 0 0 0-.32-.77c-.165-.27-.395-.5-.856-.962l-2.501-2.5c-.461-.462-.692-.692-.96-.857a2.667 2.667 0 0 0-.772-.32C12.877 5 12.551 5 11.9 5h-.166c-2.24 0-3.36 0-4.216.436A4 4 0 0 0 5.77 7.184c-.436.856-.436 1.976-.436 4.216Z\" fill=\"#fff\"></path><path d=\"M12.232 4.667c.637 0 1.01-.003 1.364.082a3 3 0 0 1 .867.36c.31.19.573.455 1.023.905l2.167 2.167c.45.45.715.712.905 1.023a3 3 0 0 1 .36.867c.084.354.082.727.082 1.363V12.6c0 1.115 0 1.97-.055 2.655-.056.687-.171 1.23-.417 1.712a4.334 4.334 0 0 1-1.894 1.894c-.483.246-1.025.36-1.713.417-.683.056-1.54.055-2.654.055h-.534c-1.114 0-1.97 0-2.654-.055-.688-.056-1.23-.17-1.713-.417a4.334 4.334 0 0 1-1.894-1.894c-.246-.482-.36-1.025-.417-1.712C5 14.57 5 13.715 5 12.6v-1.2c0-1.115 0-1.97.055-2.655.057-.687.171-1.23.417-1.712a4.334 4.334 0 0 1 1.894-1.894c.482-.246 1.025-.36 1.713-.417.683-.056 1.54-.055 2.654-.055h.5Zm-.499.666c-1.125 0-1.95 0-2.6.054-.646.053-1.091.156-1.464.346a3.671 3.671 0 0 0-1.603 1.602c-.19.373-.293.819-.346 1.465-.053.65-.053 1.474-.053 2.6v1.2c0 1.126 0 1.95.053 2.6.053.646.156 1.092.346 1.465.352.69.913 1.25 1.603 1.602.373.19.818.294 1.464.346.65.053 1.475.054 2.6.054h.534c1.125 0 1.95 0 2.6-.054.646-.052 1.091-.156 1.464-.346a3.666 3.666 0 0 0 1.603-1.602c.19-.373.293-.819.346-1.465.053-.65.053-1.474.053-2.6v-1.166c0-.668-.002-.948-.064-1.207a2.312 2.312 0 0 0-.086-.275.834.834 0 0 0-.208-.07 3.175 3.175 0 0 0-.642-.049V9.83c-.1.002-.216.003-.347.003-.457 0-.808 0-1.09-.019-.283-.019-.508-.057-.713-.14-.54-.22-.97-.65-1.19-1.19a2.254 2.254 0 0 1-.14-.713c-.02-.282-.02-.633-.02-1.09 0-.131.001-.247.003-.348h-.003a3.18 3.18 0 0 0-.048-.642.832.832 0 0 0-.072-.208 2.334 2.334 0 0 0-.273-.085c-.26-.063-.54-.065-1.208-.065h-.499Z\" fill=\"#FCC38B\"></path><path d=\"M13.426 11.759c0-.666-.539-1.205-1.204-1.205h-1.156v2.41h1.156c.665 0 1.204-.54 1.204-1.205Zm1.067 0a2.272 2.272 0 0 1-2.271 2.271h-1.156v1.382a.533.533 0 0 1-1.066 0v-5.058c0-.479.388-.867.867-.867h1.355a2.272 2.272 0 0 1 2.271 2.272Z\" fill=\"#C25705\"></path></svg>",
|
|
18
|
+
"FileRoundSlidesV2Colorful": "<svg width=\"100%\" height=\"100%\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" data-icon=\"FileRoundSlidesV2Colorful\"><circle cx=\"12\" cy=\"12\" r=\"12\" fill=\"#FFF3E5\"></circle><path opacity=\"0.99\" d=\"M5.333 11.4v1.2c0 2.24 0 3.36.436 4.216a4 4 0 0 0 1.748 1.748C8.373 19 9.493 19 11.733 19h.533c2.24 0 3.36 0 4.216-.436a4 4 0 0 0 1.748-1.748c.436-.856.436-1.976.436-4.216v-.833c0-.652 0-.978-.073-1.285a2.666 2.666 0 0 0-.32-.77c-.165-.27-.395-.5-.856-.962l-2.501-2.5c-.461-.462-.692-.692-.96-.857a2.667 2.667 0 0 0-.772-.32C12.877 5 12.551 5 11.9 5h-.166c-2.24 0-3.36 0-4.216.436A4 4 0 0 0 5.77 7.184c-.436.856-.436 1.976-.436 4.216Z\" fill=\"#fff\"></path><path d=\"M12.232 4.667c.637 0 1.01-.003 1.364.082a3 3 0 0 1 .867.36c.31.19.573.455 1.023.905l2.167 2.167c.45.45.715.712.905 1.023a3 3 0 0 1 .36.867c.084.354.082.727.082 1.363V12.6c0 1.115 0 1.97-.055 2.655-.056.687-.171 1.23-.417 1.712a4.334 4.334 0 0 1-1.894 1.894c-.483.246-1.025.36-1.713.417-.683.056-1.54.055-2.654.055h-.534c-1.114 0-1.97 0-2.654-.055-.688-.056-1.23-.17-1.713-.417a4.334 4.334 0 0 1-1.894-1.894c-.246-.482-.36-1.025-.417-1.712C5 14.57 5 13.715 5 12.6v-1.2c0-1.115 0-1.97.055-2.655.057-.687.171-1.23.417-1.712a4.334 4.334 0 0 1 1.894-1.894c.482-.246 1.025-.36 1.713-.417.683-.056 1.54-.055 2.654-.055h.5Zm-.499.666c-1.125 0-1.95 0-2.6.054-.646.053-1.091.156-1.464.346a3.671 3.671 0 0 0-1.603 1.602c-.19.373-.293.819-.346 1.465-.053.65-.053 1.474-.053 2.6v1.2c0 1.126 0 1.95.053 2.6.053.646.156 1.092.346 1.465.352.69.913 1.25 1.603 1.602.373.19.818.294 1.464.346.65.053 1.475.054 2.6.054h.534c1.125 0 1.95 0 2.6-.054.646-.052 1.091-.156 1.464-.346a3.666 3.666 0 0 0 1.603-1.602c.19-.373.293-.819.346-1.465.053-.65.053-1.474.053-2.6v-1.166c0-.668-.002-.948-.064-1.207a2.312 2.312 0 0 0-.086-.275.834.834 0 0 0-.208-.07 3.175 3.175 0 0 0-.642-.049V9.83c-.1.002-.216.003-.347.003-.457 0-.808 0-1.09-.019-.283-.019-.508-.057-.713-.14-.54-.22-.97-.65-1.19-1.19a2.254 2.254 0 0 1-.14-.713c-.02-.282-.02-.633-.02-1.09 0-.131.001-.247.003-.348h-.003a3.18 3.18 0 0 0-.048-.642.832.832 0 0 0-.072-.208 2.334 2.334 0 0 0-.273-.085c-.26-.063-.54-.065-1.208-.065h-.499Z\" fill=\"#FCC38B\"></path><path d=\"M14.833 12.833c.184 0 .335.15.317.333a3.333 3.333 0 1 1-3.65-3.65.31.31 0 0 1 .333.317V12.5c0 .184.15.333.334.333h2.666Z\" fill=\"#FF9D4C\"></path><path d=\"M15.167 12.167c.184 0 .335-.15.315-.333a2.998 2.998 0 0 0-2.65-2.649c-.182-.02-.332.13-.332.315v2.467c0 .11.09.2.2.2h2.467Z\" fill=\"#ED6D0C\"></path></svg>"
|
|
19
|
+
} as const;
|