@4399ywkf/editor 0.14.2 → 0.15.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.
Files changed (37) hide show
  1. package/dist/{DocView-VTKFMW46.js → DocView-4MOGGX4Z.js} +4 -3
  2. package/dist/DocView-4MOGGX4Z.js.map +1 -0
  3. package/dist/SheetView-WP4DKSDS.js +3 -0
  4. package/dist/{SheetView-6Z5EPBN4.js.map → SheetView-WP4DKSDS.js.map} +1 -1
  5. package/dist/base-model.d.ts +499 -0
  6. package/dist/base-model.js +3 -0
  7. package/dist/base-model.js.map +1 -0
  8. package/dist/base.d.ts +910 -0
  9. package/dist/base.js +12971 -0
  10. package/dist/base.js.map +1 -0
  11. package/dist/chunk-3BRBH7MU.js +1833 -0
  12. package/dist/chunk-3BRBH7MU.js.map +1 -0
  13. package/dist/chunk-3KW24N3T.js +2256 -0
  14. package/dist/chunk-3KW24N3T.js.map +1 -0
  15. package/dist/{chunk-FMTC3EDQ.js → chunk-4SIP4BYI.js} +3 -3
  16. package/dist/{chunk-FMTC3EDQ.js.map → chunk-4SIP4BYI.js.map} +1 -1
  17. package/dist/{chunk-ZLEGKX2U.js → chunk-KZEURCGO.js} +9384 -9998
  18. package/dist/chunk-KZEURCGO.js.map +1 -0
  19. package/dist/{chunk-OBKIMG6G.js → chunk-X4BUO2RH.js} +4 -4
  20. package/dist/{chunk-OBKIMG6G.js.map → chunk-X4BUO2RH.js.map} +1 -1
  21. package/dist/csv.js +1 -1
  22. package/dist/doc-standalone.js +11888 -10255
  23. package/dist/doc-standalone.js.map +1 -1
  24. package/dist/doc.d.ts +4 -379
  25. package/dist/doc.js +3 -2
  26. package/dist/doc.js.map +1 -1
  27. package/dist/editor-config-context-DvLRd7Gx.d.ts +382 -0
  28. package/dist/{import-XL3AH3QH.js → import-TEZ37G5R.js} +5 -5
  29. package/dist/{import-XL3AH3QH.js.map → import-TEZ37G5R.js.map} +1 -1
  30. package/dist/index.js +2 -2
  31. package/dist/sheet.js +1 -1
  32. package/dist/style.css +2 -2
  33. package/dist/xlsx.js +4 -4
  34. package/package.json +10 -2
  35. package/dist/DocView-VTKFMW46.js.map +0 -1
  36. package/dist/SheetView-6Z5EPBN4.js +0 -3
  37. package/dist/chunk-ZLEGKX2U.js.map +0 -1
@@ -0,0 +1,2256 @@
1
+ import { createContext, useMemo, useContext } from 'react';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { serialize, compile, stringify } from 'stylis';
4
+
5
+ // src/contexts/editor-config-context.tsx
6
+ var DEFAULT_MAX_FILE_SIZES = {
7
+ // 飞书图片上限 20MB(IM 318644:`limitSize || 20971520`)
8
+ image: 20 * 1024 * 1024,
9
+ video: 100 * 1024 * 1024,
10
+ audio: 20 * 1024 * 1024,
11
+ file: 20 * 1024 * 1024
12
+ };
13
+ var detectMediaKind = (file) => {
14
+ if (file.type.startsWith("image/")) return "image";
15
+ if (file.type.startsWith("video/")) return "video";
16
+ if (file.type.startsWith("audio/")) return "audio";
17
+ return "file";
18
+ };
19
+ var resolveMaxSize = (kind, config) => {
20
+ const fromTypes = config?.maxFileSizes?.[kind];
21
+ if (typeof fromTypes === "number") return fromTypes;
22
+ if (kind === "image" && typeof config?.maxFileSize === "number") {
23
+ return config.maxFileSize;
24
+ }
25
+ return DEFAULT_MAX_FILE_SIZES[kind];
26
+ };
27
+ var EditorConfigContext = createContext(null);
28
+ function EditorConfigProvider({
29
+ config,
30
+ children
31
+ }) {
32
+ const value = useMemo(() => config, [config]);
33
+ return /* @__PURE__ */ jsx(EditorConfigContext.Provider, { value, children });
34
+ }
35
+ var useEditorConfig = () => useContext(EditorConfigContext);
36
+
37
+ // src/theme/base-vars.ts
38
+ var BASE_LIGHT_VARS = {
39
+ "--tt-gray-light-a-50": "rgba(56, 56, 56, 0.04)",
40
+ "--tt-gray-light-a-100": "rgba(15, 22, 36, 0.05)",
41
+ "--tt-gray-light-a-200": "rgba(37, 39, 45, 0.1)",
42
+ "--tt-gray-light-a-300": "rgba(47, 50, 55, 0.2)",
43
+ "--tt-gray-light-a-400": "rgba(40, 44, 51, 0.42)",
44
+ "--tt-gray-light-a-500": "rgba(52, 55, 60, 0.64)",
45
+ "--tt-gray-light-a-600": "rgba(36, 39, 46, 0.78)",
46
+ "--tt-gray-light-a-700": "rgba(35, 37, 42, 0.87)",
47
+ "--tt-gray-light-a-800": "rgba(30, 32, 36, 0.95)",
48
+ "--tt-gray-light-a-900": "rgba(29, 30, 32, 0.98)",
49
+ "--tt-gray-light-50": "rgba(250, 250, 250, 1)",
50
+ "--tt-gray-light-100": "rgba(244, 244, 245, 1)",
51
+ "--tt-gray-light-200": "rgba(234, 234, 235, 1)",
52
+ "--tt-gray-light-300": "rgba(213, 214, 215, 1)",
53
+ "--tt-gray-light-400": "rgba(166, 167, 171, 1)",
54
+ "--tt-gray-light-500": "rgba(125, 127, 130, 1)",
55
+ "--tt-gray-light-600": "rgba(83, 86, 90, 1)",
56
+ "--tt-gray-light-700": "rgba(64, 65, 69, 1)",
57
+ "--tt-gray-light-800": "rgba(44, 45, 48, 1)",
58
+ "--tt-gray-light-900": "rgba(34, 35, 37, 1)",
59
+ "--tt-gray-dark-a-50": "rgba(232, 232, 253, 0.05)",
60
+ "--tt-gray-dark-a-100": "rgba(231, 231, 243, 0.07)",
61
+ "--tt-gray-dark-a-200": "rgba(238, 238, 246, 0.11)",
62
+ "--tt-gray-dark-a-300": "rgba(239, 239, 245, 0.22)",
63
+ "--tt-gray-dark-a-400": "rgba(244, 244, 255, 0.37)",
64
+ "--tt-gray-dark-a-500": "rgba(236, 238, 253, 0.5)",
65
+ "--tt-gray-dark-a-600": "rgba(247, 247, 253, 0.64)",
66
+ "--tt-gray-dark-a-700": "rgba(251, 251, 254, 0.75)",
67
+ "--tt-gray-dark-a-800": "rgba(253, 253, 253, 0.88)",
68
+ "--tt-gray-dark-a-900": "rgba(255, 255, 255, 0.96)",
69
+ "--tt-gray-dark-50": "rgba(25, 25, 26, 1)",
70
+ "--tt-gray-dark-100": "rgba(32, 32, 34, 1)",
71
+ "--tt-gray-dark-200": "rgba(45, 45, 47, 1)",
72
+ "--tt-gray-dark-300": "rgba(70, 70, 73, 1)",
73
+ "--tt-gray-dark-400": "rgba(99, 99, 105, 1)",
74
+ "--tt-gray-dark-500": "rgba(124, 124, 131, 1)",
75
+ "--tt-gray-dark-600": "rgba(163, 163, 168, 1)",
76
+ "--tt-gray-dark-700": "rgba(192, 192, 195, 1)",
77
+ "--tt-gray-dark-800": "rgba(224, 224, 225, 1)",
78
+ "--tt-gray-dark-900": "rgba(245, 245, 245, 1)",
79
+ "--tt-brand-color-50": "rgba(239, 238, 255, 1)",
80
+ "--tt-brand-color-100": "rgba(222, 219, 255, 1)",
81
+ "--tt-brand-color-200": "rgba(195, 189, 255, 1)",
82
+ "--tt-brand-color-300": "rgba(157, 138, 255, 1)",
83
+ "--tt-brand-color-400": "rgba(122, 82, 255, 1)",
84
+ "--tt-brand-color-500": "rgba(98, 41, 255, 1)",
85
+ "--tt-brand-color-600": "rgba(84, 0, 229, 1)",
86
+ "--tt-brand-color-700": "rgba(75, 0, 204, 1)",
87
+ "--tt-brand-color-800": "rgba(56, 0, 153, 1)",
88
+ "--tt-brand-color-900": "rgba(43, 25, 102, 1)",
89
+ "--tt-brand-color-950": "hsla(257, 100%, 9%, 1)",
90
+ "--tt-color-green-inc-5": "hsla(129, 100%, 97%, 1)",
91
+ "--tt-color-green-inc-4": "hsla(129, 100%, 92%, 1)",
92
+ "--tt-color-green-inc-3": "hsla(131, 100%, 86%, 1)",
93
+ "--tt-color-green-inc-2": "hsla(133, 98%, 78%, 1)",
94
+ "--tt-color-green-inc-1": "hsla(137, 99%, 70%, 1)",
95
+ "--tt-color-green-base": "hsla(147, 99%, 50%, 1)",
96
+ "--tt-color-green-dec-1": "hsla(147, 97%, 41%, 1)",
97
+ "--tt-color-green-dec-2": "hsla(146, 98%, 32%, 1)",
98
+ "--tt-color-green-dec-3": "hsla(146, 100%, 24%, 1)",
99
+ "--tt-color-green-dec-4": "hsla(144, 100%, 16%, 1)",
100
+ "--tt-color-green-dec-5": "hsla(140, 100%, 9%, 1)",
101
+ "--tt-color-yellow-inc-5": "hsla(50, 100%, 97%, 1)",
102
+ "--tt-color-yellow-inc-4": "hsla(50, 100%, 91%, 1)",
103
+ "--tt-color-yellow-inc-3": "hsla(50, 100%, 84%, 1)",
104
+ "--tt-color-yellow-inc-2": "hsla(50, 100%, 77%, 1)",
105
+ "--tt-color-yellow-inc-1": "hsla(50, 100%, 68%, 1)",
106
+ "--tt-color-yellow-base": "hsla(52, 100%, 50%, 1)",
107
+ "--tt-color-yellow-dec-1": "hsla(52, 100%, 41%, 1)",
108
+ "--tt-color-yellow-dec-2": "hsla(52, 100%, 32%, 1)",
109
+ "--tt-color-yellow-dec-3": "hsla(52, 100%, 24%, 1)",
110
+ "--tt-color-yellow-dec-4": "hsla(51, 100%, 16%, 1)",
111
+ "--tt-color-yellow-dec-5": "hsla(50, 100%, 9%, 1)",
112
+ "--tt-color-red-inc-5": "hsla(11, 100%, 96%, 1)",
113
+ "--tt-color-red-inc-4": "hsla(11, 100%, 88%, 1)",
114
+ "--tt-color-red-inc-3": "hsla(10, 100%, 80%, 1)",
115
+ "--tt-color-red-inc-2": "hsla(9, 100%, 73%, 1)",
116
+ "--tt-color-red-inc-1": "hsla(7, 100%, 64%, 1)",
117
+ "--tt-color-red-base": "hsla(7, 100%, 54%, 1)",
118
+ "--tt-color-red-dec-1": "hsla(7, 100%, 41%, 1)",
119
+ "--tt-color-red-dec-2": "hsla(5, 100%, 32%, 1)",
120
+ "--tt-color-red-dec-3": "hsla(4, 100%, 24%, 1)",
121
+ "--tt-color-red-dec-4": "hsla(3, 100%, 16%, 1)",
122
+ "--tt-color-red-dec-5": "hsla(1, 100%, 9%, 1)",
123
+ "--white": "rgba(255, 255, 255, 1)",
124
+ "--black": "rgba(14, 14, 17, 1)",
125
+ "--transparent": "rgba(255, 255, 255, 0)",
126
+ "--tt-shadow-elevated-md": "0px 16px 48px 0px rgba(17, 24, 39, 0.04), 0px 12px 24px 0px rgba(17, 24, 39, 0.04), 0px 6px 8px 0px rgba(17, 24, 39, 0.02), 0px 2px 3px 0px rgba(17, 24, 39, 0.02)",
127
+ "--tt-radius-xxs": "0.125rem",
128
+ "--tt-radius-xs": "0.25rem",
129
+ "--tt-radius-sm": "0.375rem",
130
+ "--tt-radius-md": "0.5rem",
131
+ "--tt-radius-lg": "0.75rem",
132
+ "--tt-radius-xl": "1rem",
133
+ "--tt-transition-duration-short": "0.1s",
134
+ "--tt-transition-duration-default": "0.2s",
135
+ "--tt-transition-duration-long": "0.64s",
136
+ "--tt-transition-easing-default": "cubic-bezier(0.46, 0.03, 0.52, 0.96)",
137
+ "--tt-transition-easing-cubic": "cubic-bezier(0.65, 0.05, 0.36, 1)",
138
+ "--tt-transition-easing-quart": "cubic-bezier(0.77, 0, 0.18, 1)",
139
+ "--tt-transition-easing-circ": "cubic-bezier(0.79, 0.14, 0.15, 0.86)",
140
+ "--tt-transition-easing-back": "cubic-bezier(0.68, -0.55, 0.27, 1.55)",
141
+ "--tt-accent-contrast": "8%",
142
+ "--tt-destructive-contrast": "8%",
143
+ "--tt-foreground-contrast": "8%",
144
+ "--tt-bg-color": "var(--white)",
145
+ "--tt-border-color": "var(--tt-gray-light-a-200)",
146
+ "--tt-border-color-tint": "var(--tt-gray-light-a-100)",
147
+ "--tt-sidebar-bg-color": "var(--tt-gray-light-100)",
148
+ "--tt-scrollbar-color": "var(--tt-gray-light-a-200)",
149
+ "--tt-cursor-color": "#3370ff",
150
+ "--tt-selection-color": "rgba(51, 112, 255, 0.2)",
151
+ "--tt-block-selected-color": "rgba(51, 112, 255, 0.18)",
152
+ "--tt-find-current-color": "rgba(245, 74, 69, 0.5)",
153
+ "--tt-find-match-color": "rgba(255, 198, 10, 0.5)",
154
+ "--tt-card-bg-color": "var(--white)",
155
+ "--tt-card-border-color": "var(--tt-gray-light-a-100)",
156
+ "--tt-color-text-gray": "#8f959e",
157
+ "--tt-color-text-red": "#d83931",
158
+ "--tt-color-text-orange": "#de7802",
159
+ "--tt-color-text-yellow": "#dc9b04",
160
+ "--tt-color-text-green": "#2ea121",
161
+ "--tt-color-text-blue": "#245bdb",
162
+ "--tt-color-text-purple": "#6425d0",
163
+ "--tt-color-text-brown": "#9f6b53",
164
+ "--tt-color-text-pink": "#c14c8a",
165
+ "--tt-color-text-gray-contrast": "hsla(39, 26%, 26%, 0.15)",
166
+ "--tt-color-text-brown-contrast": "hsla(18, 43%, 69%, 0.35)",
167
+ "--tt-color-text-orange-contrast": "hsla(24, 73%, 55%, 0.27)",
168
+ "--tt-color-text-yellow-contrast": "hsla(44, 82%, 59%, 0.39)",
169
+ "--tt-color-text-green-contrast": "hsla(126, 29%, 60%, 0.27)",
170
+ "--tt-color-text-blue-contrast": "hsla(202, 54%, 59%, 0.27)",
171
+ "--tt-color-text-purple-contrast": "hsla(274, 37%, 64%, 0.27)",
172
+ "--tt-color-text-pink-contrast": "hsla(331, 60%, 71%, 0.27)",
173
+ "--tt-color-text-red-contrast": "hsla(8, 79%, 79%, 0.4)",
174
+ "--tt-color-highlight-gray": "#f2f3f5",
175
+ "--tt-color-highlight-red": "#fbbfbc",
176
+ "--tt-color-highlight-orange": "rgba(254,212,164,0.8)",
177
+ "--tt-color-highlight-yellow": "rgba(255,246,122,0.8)",
178
+ "--tt-color-highlight-green": "rgba(183,237,177,0.8)",
179
+ "--tt-color-highlight-blue": "rgba(186,206,253,0.7)",
180
+ "--tt-color-highlight-purple": "rgba(205,178,250,0.7)",
181
+ "--tt-color-highlight-gray-medium": "rgba(222,224,227,0.8)",
182
+ "--tt-color-highlight-gray-strong": "#bbbfc4",
183
+ "--tt-color-highlight-red-strong": "#f76964",
184
+ "--tt-color-highlight-orange-strong": "#ffa53d",
185
+ "--tt-color-highlight-yellow-strong": "#ffe928",
186
+ "--tt-color-highlight-green-strong": "#62d256",
187
+ "--tt-color-highlight-blue-strong": "rgba(78,131,253,0.55)",
188
+ "--tt-color-highlight-purple-strong": "rgba(147,90,246,0.55)",
189
+ "--tt-color-highlight-brown": "#f4eeee",
190
+ "--tt-color-highlight-pink": "#fcf1f6",
191
+ "--tt-color-highlight-yellow-contrast": "#fbe604",
192
+ "--tt-color-highlight-green-contrast": "#c7fad8",
193
+ "--tt-color-highlight-blue-contrast": "#ceeafd",
194
+ "--tt-color-highlight-purple-contrast": "#e4ccff",
195
+ "--tt-color-highlight-red-contrast": "#ffccd0",
196
+ "--tt-color-highlight-gray-contrast": "rgba(84, 72, 49, 0.15)",
197
+ "--tt-color-highlight-brown-contrast": "rgba(210, 162, 141, 0.35)",
198
+ "--tt-color-highlight-orange-contrast": "rgba(224, 124, 57, 0.27)",
199
+ "--tt-color-highlight-pink-contrast": "rgba(225, 136, 179, 0.27)",
200
+ "--tt-color-block-gray": "rgba(245,246,247,0.9)",
201
+ "--tt-color-block-red": "#fef1f1",
202
+ "--tt-color-block-orange": "#fff5eb",
203
+ "--tt-color-block-yellow": "#fefff0",
204
+ "--tt-color-block-green": "#f0fbef",
205
+ "--tt-color-block-blue": "#f0f4ff",
206
+ "--tt-color-block-purple": "#f6f1fe",
207
+ "--tt-color-block-neutral-strong": "#f2f3f5",
208
+ "--tt-color-block-gray-strong": "#eff0f1",
209
+ "--tt-color-block-red-strong": "#fde2e2",
210
+ "--tt-color-block-orange-strong": "#feead2",
211
+ "--tt-color-block-yellow-strong": "#ffffcc",
212
+ "--tt-color-block-green-strong": "#d9f5d6",
213
+ "--tt-color-block-blue-strong": "#e1eaff",
214
+ "--tt-color-block-purple-strong": "#ece2fe",
215
+ "--tt-color-callout-border-neutral": "#eff0f1",
216
+ "--tt-color-callout-border-red": "#fbbfbc",
217
+ "--tt-color-callout-border-orange": "#fed4a4",
218
+ "--tt-color-callout-border-yellow": "#fff67a",
219
+ "--tt-color-callout-border-green": "#b7edb1",
220
+ "--tt-color-callout-border-blue": "#bacefd",
221
+ "--tt-color-callout-border-purple": "#cdb2fa",
222
+ "--tt-color-callout-border-neutral-strong": "#dee0e3",
223
+ "--tt-color-callout-border-red-strong": "#f98e8b",
224
+ "--tt-color-callout-border-orange-strong": "#ffba6b",
225
+ "--tt-color-callout-border-yellow-strong": "#fff258",
226
+ "--tt-color-callout-border-green-strong": "#8ee085",
227
+ "--tt-color-callout-border-blue-strong": "#82a7fc",
228
+ "--tt-color-callout-border-purple-strong": "#ad82f7"
229
+ };
230
+ var BASE_DARK_VARS = {
231
+ "--tt-bg-color": "var(--black)",
232
+ "--tt-border-color": "var(--tt-gray-dark-a-200)",
233
+ "--tt-border-color-tint": "var(--tt-gray-dark-a-100)",
234
+ "--tt-sidebar-bg-color": "var(--tt-gray-dark-100)",
235
+ "--tt-scrollbar-color": "var(--tt-gray-dark-a-200)",
236
+ "--tt-cursor-color": "#4c88ff",
237
+ "--tt-selection-color": "rgba(76, 136, 255, 0.2)",
238
+ "--tt-block-selected-color": "rgba(76, 136, 255, 0.26)",
239
+ "--tt-find-current-color": "rgba(209, 70, 66, 0.5)",
240
+ "--tt-find-match-color": "rgba(173, 125, 21, 0.5)",
241
+ "--tt-card-bg-color": "var(--tt-gray-dark-50)",
242
+ "--tt-card-border-color": "var(--tt-gray-dark-a-50)",
243
+ "--tt-shadow-elevated-md": "0px 16px 48px 0px rgba(0, 0, 0, 0.5), 0px 12px 24px 0px rgba(0, 0, 0, 0.24), 0px 6px 8px 0px rgba(0, 0, 0, 0.22), 0px 2px 3px 0px rgba(0, 0, 0, 0.12)",
244
+ "--tt-color-text-gray": "#757575",
245
+ "--tt-color-text-red": "#fa7873",
246
+ "--tt-color-text-orange": "#f5a54a",
247
+ "--tt-color-text-yellow": "#fcd456",
248
+ "--tt-color-text-green": "#6dd162",
249
+ "--tt-color-text-blue": "#70a0ff",
250
+ "--tt-color-text-purple": "#a472fc",
251
+ "--tt-color-text-brown": "#ba856f",
252
+ "--tt-color-text-pink": "#d15796",
253
+ "--tt-color-text-gray-contrast": "hsla(0, 0%, 100%, 0.09)",
254
+ "--tt-color-text-brown-contrast": "hsla(17, 45%, 50%, 0.25)",
255
+ "--tt-color-text-orange-contrast": "hsla(27, 82%, 53%, 0.2)",
256
+ "--tt-color-text-yellow-contrast": "hsla(35, 49%, 47%, 0.2)",
257
+ "--tt-color-text-green-contrast": "hsla(151, 55%, 39%, 0.2)",
258
+ "--tt-color-text-blue-contrast": "hsla(202, 54%, 43%, 0.2)",
259
+ "--tt-color-text-purple-contrast": "hsla(271, 56%, 60%, 0.18)",
260
+ "--tt-color-text-pink-contrast": "hsla(331, 67%, 58%, 0.22)",
261
+ "--tt-color-text-red-contrast": "hsla(0, 67%, 60%, 0.25)",
262
+ "--tt-color-highlight-gray": "rgba(67,67,67,0.4)",
263
+ "--tt-color-highlight-red": "rgba(240,91,86,0.28)",
264
+ "--tt-color-highlight-orange": "rgba(242,150,44,0.22)",
265
+ "--tt-color-highlight-yellow": "rgba(245,226,49,0.16)",
266
+ "--tt-color-highlight-green": "rgba(84,194,72,0.22)",
267
+ "--tt-color-highlight-blue": "rgba(76,136,255,0.28)",
268
+ "--tt-color-highlight-purple": "rgba(151,98,245,0.31)",
269
+ "--tt-color-highlight-gray-medium": "rgba(80,80,80,0.5)",
270
+ "--tt-color-highlight-gray-strong": "rgba(95,95,95,0.6)",
271
+ "--tt-color-highlight-red-strong": "rgba(240,91,86,0.47)",
272
+ "--tt-color-highlight-orange-strong": "rgba(242,150,44,0.36)",
273
+ "--tt-color-highlight-yellow-strong": "rgba(245,226,49,0.26)",
274
+ "--tt-color-highlight-green-strong": "rgba(84,194,72,0.36)",
275
+ "--tt-color-highlight-blue-strong": "rgba(76,136,255,0.46)",
276
+ "--tt-color-highlight-purple-strong": "rgba(151,98,245,0.51)",
277
+ "--tt-color-highlight-brown": "rgb(74,50,40)",
278
+ "--tt-color-highlight-pink": "rgb(78,44,60)",
279
+ "--tt-color-highlight-yellow-contrast": "#58531e",
280
+ "--tt-color-highlight-green-contrast": "#47855d",
281
+ "--tt-color-highlight-blue-contrast": "#5e86a1",
282
+ "--tt-color-highlight-purple-contrast": "#4c3564",
283
+ "--tt-color-highlight-red-contrast": "#643539",
284
+ "--tt-color-highlight-gray-contrast": "rgba(255, 255, 255, 0.094)",
285
+ "--tt-color-highlight-brown-contrast": "rgba(184, 101, 69, 0.25)",
286
+ "--tt-color-highlight-orange-contrast": "rgba(233, 126, 37, 0.2)",
287
+ "--tt-color-highlight-pink-contrast": "rgba(220, 76, 145, 0.22)",
288
+ "--tt-color-block-gray": "rgba(67,67,67,0.3)",
289
+ "--tt-color-block-red": "rgba(240,91,86,0.14)",
290
+ "--tt-color-block-orange": "rgba(242,150,44,0.12)",
291
+ "--tt-color-block-yellow": "rgba(245,226,49,0.08)",
292
+ "--tt-color-block-green": "rgba(84,194,72,0.12)",
293
+ "--tt-color-block-blue": "rgba(76,136,255,0.14)",
294
+ "--tt-color-block-purple": "rgba(151,98,245,0.16)",
295
+ "--tt-color-block-neutral-strong": "rgba(80,80,80,0.45)",
296
+ "--tt-color-block-gray-strong": "rgba(95,95,95,0.5)",
297
+ "--tt-color-block-red-strong": "rgba(240,91,86,0.26)",
298
+ "--tt-color-block-orange-strong": "rgba(242,150,44,0.22)",
299
+ "--tt-color-block-yellow-strong": "rgba(245,226,49,0.16)",
300
+ "--tt-color-block-green-strong": "rgba(84,194,72,0.22)",
301
+ "--tt-color-block-blue-strong": "rgba(76,136,255,0.26)",
302
+ "--tt-color-block-purple-strong": "rgba(151,98,245,0.28)",
303
+ "--tt-color-callout-border-neutral": "rgba(255,255,255,0.12)",
304
+ "--tt-color-callout-border-red": "rgba(240,91,86,0.35)",
305
+ "--tt-color-callout-border-orange": "rgba(242,150,44,0.35)",
306
+ "--tt-color-callout-border-yellow": "rgba(245,226,49,0.3)",
307
+ "--tt-color-callout-border-green": "rgba(84,194,72,0.35)",
308
+ "--tt-color-callout-border-blue": "rgba(76,136,255,0.38)",
309
+ "--tt-color-callout-border-purple": "rgba(151,98,245,0.4)",
310
+ "--tt-color-callout-border-neutral-strong": "rgba(255,255,255,0.22)",
311
+ "--tt-color-callout-border-red-strong": "rgba(240,91,86,0.6)",
312
+ "--tt-color-callout-border-orange-strong": "rgba(242,150,44,0.6)",
313
+ "--tt-color-callout-border-yellow-strong": "rgba(245,226,49,0.5)",
314
+ "--tt-color-callout-border-green-strong": "rgba(84,194,72,0.6)",
315
+ "--tt-color-callout-border-blue-strong": "rgba(76,136,255,0.6)",
316
+ "--tt-color-callout-border-purple-strong": "rgba(151,98,245,0.65)"
317
+ };
318
+
319
+ // src/theme/editor-theme.ts
320
+ function luminance(color) {
321
+ let r;
322
+ let g;
323
+ let b;
324
+ const hex = color.trim().match(/^#([0-9a-f]{3}|[0-9a-f]{6})([0-9a-f]{2})?$/i);
325
+ if (hex) {
326
+ const h = hex[1].length === 3 ? [...hex[1]].map((c) => c + c).join("") : hex[1];
327
+ r = Number.parseInt(h.slice(0, 2), 16);
328
+ g = Number.parseInt(h.slice(2, 4), 16);
329
+ b = Number.parseInt(h.slice(4, 6), 16);
330
+ } else {
331
+ const rgb = color.match(/rgba?\(\s*([\d.]+)[ ,]+([\d.]+)[ ,]+([\d.]+)/i);
332
+ if (!rgb) return null;
333
+ r = Number(rgb[1]);
334
+ g = Number(rgb[2]);
335
+ b = Number(rgb[3]);
336
+ }
337
+ return (0.2126 * r + 0.7152 * g + 0.0722 * b) / 255;
338
+ }
339
+ function isDarkAntdToken(token, isDarkMode) {
340
+ if (isDarkMode) return true;
341
+ const l = luminance(token.colorBgContainer);
342
+ return l !== null && l < 0.5;
343
+ }
344
+ function notionSurface(token, isDark) {
345
+ if (isDark) {
346
+ return {
347
+ colorText: "rgba(255, 255, 255, 0.81)",
348
+ colorBgPage: token.colorBgContainer,
349
+ blockRadius: 10,
350
+ cardRadius: 10,
351
+ dividerColor: "rgba(255, 255, 255, 0.07)",
352
+ inlineCodeBg: "rgba(231, 231, 243, 0.07)",
353
+ inlineCodeBorder: "rgba(238, 238, 246, 0.11)",
354
+ blockBorderColor: "rgba(255, 255, 255, 0.094)",
355
+ blockHoverBorderColor: "rgba(255, 255, 255, 0.094)",
356
+ blockSelectedBorderColor: token.colorPrimary,
357
+ codeBg: "rgba(255, 255, 255, 0.04)",
358
+ // 标签栏用页面底色,和代码区拉开反差
359
+ codeHeaderBg: token.colorBgContainer,
360
+ codeDividerColor: "rgba(255, 255, 255, 0.07)",
361
+ calloutBordered: false,
362
+ tableBorderColor: "rgba(255, 255, 255, 0.094)",
363
+ tableHeaderBg: "rgba(255, 255, 255, 0.03)",
364
+ tableRadius: 8,
365
+ floatBg: token.colorBgElevated,
366
+ floatRadius: 10,
367
+ floatShadow: "0px 8px 12px 0px rgba(0, 0, 0, 0.24), 0px 2px 6px 0px rgba(0, 0, 0, 0.16), 0px 0px 0px 1px rgba(255, 255, 255, 0.094)",
368
+ floatBorderColor: "transparent",
369
+ itemRadius: 6,
370
+ itemHoverBg: "rgba(255, 255, 255, 0.055)",
371
+ controlHoverBg: "rgba(255, 255, 255, 0.055)",
372
+ cardBorderColor: "rgba(255, 255, 255, 0.094)",
373
+ cardHoverBg: "rgba(255, 255, 255, 0.03)",
374
+ toolbarRadius: 8,
375
+ inputRadius: 6,
376
+ accentColor: token.colorPrimary,
377
+ textSecondary: "rgba(255, 255, 255, 0.46)",
378
+ textTertiary: "rgba(255, 255, 255, 0.282)"
379
+ };
380
+ }
381
+ return {
382
+ colorText: "#2c2c2b",
383
+ // --c-texPri
384
+ colorBgPage: token.colorBgContainer,
385
+ blockRadius: 10,
386
+ // 代码块没量到,按提示框推断
387
+ cardRadius: 10,
388
+ // 提示框实测 10
389
+ dividerColor: "rgba(42, 28, 0, 0.07)",
390
+ // --ca-borSecTra
391
+ // 行内代码没量到,暂用飞书的值(待确认)
392
+ inlineCodeBg: "#f5f6f7",
393
+ inlineCodeBorder: "#dee0e3",
394
+ blockBorderColor: "rgba(28, 19, 1, 0.11)",
395
+ // --ca-borPriTra #1c13011c
396
+ // Notion 的块悬停不改描边;选中用主色
397
+ blockHoverBorderColor: "rgba(28, 19, 1, 0.11)",
398
+ blockSelectedBorderColor: token.colorPrimary,
399
+ // 代码区用冷灰(Notion 原值是暖灰 --c-codStiBloBac #f7f6f3,按需求改冷)
400
+ codeBg: "#f5f6f8",
401
+ // 代码分组的标签栏用页面底色(白),代码区保持暖灰,反差清楚
402
+ codeHeaderBg: token.colorBgContainer,
403
+ codeDividerColor: "rgba(42, 28, 0, 0.07)",
404
+ // --ca-borSecTra #2a1c0012
405
+ calloutBordered: false,
406
+ tableBorderColor: "#e6e5e3",
407
+ // --c-borPri
408
+ tableHeaderBg: "#f9f8f7",
409
+ // --c-bacSec(标题行底色是推断)
410
+ tableRadius: 8,
411
+ // 按需求:外框圆角(Notion 自己的简单表格其实是直角)
412
+ floatBg: token.colorBgElevated,
413
+ floatRadius: 10,
414
+ // --c-shaOutMd:两层淡阴影 + 一圈 #2a1c0012 当描边
415
+ floatShadow: "0px 8px 12px 0px rgba(25, 25, 25, 0.027), 0px 2px 6px 0px rgba(25, 25, 25, 0.027), 0px 0px 0px 1px rgba(42, 28, 0, 0.07)",
416
+ floatBorderColor: "transparent",
417
+ itemRadius: 6,
418
+ // 页面里悬停容器实测 6
419
+ itemHoverBg: "rgba(42, 28, 0, 0.07)",
420
+ // --ca-bacTerTra
421
+ controlHoverBg: "rgba(42, 28, 0, 0.07)",
422
+ cardBorderColor: "rgba(28, 19, 1, 0.11)",
423
+ // 同块描边
424
+ cardHoverBg: "rgba(42, 28, 0, 0.03)",
425
+ // 推断:比菜单项悬停再淡一档
426
+ toolbarRadius: 8,
427
+ // 推断
428
+ inputRadius: 6,
429
+ // 同悬停容器
430
+ accentColor: token.colorPrimary,
431
+ // 推断:Notion 经典次要 / 三级文字(rgba(55,53,47,.65) / .45 落在白底上)
432
+ textSecondary: "#787774",
433
+ textTertiary: "#9b9a97"
434
+ };
435
+ }
436
+ function feishuSurface(token, isDark) {
437
+ if (isDark) {
438
+ return {
439
+ colorText: "rgba(245, 245, 245, 1)",
440
+ colorBgPage: token.colorBgContainer,
441
+ blockRadius: 4,
442
+ cardRadius: 8,
443
+ dividerColor: "rgba(238, 238, 246, 0.11)",
444
+ // 迁移前 --tt-gray-dark-a-200
445
+ inlineCodeBg: "rgba(231, 231, 243, 0.07)",
446
+ // --tt-gray-dark-a-100
447
+ inlineCodeBorder: "rgba(238, 238, 246, 0.11)",
448
+ // --tt-gray-dark-a-200
449
+ blockBorderColor: "rgba(238, 238, 246, 0.11)",
450
+ // 迁移前深色没有单独的悬停 / 选中色,沿用浅色那两个
451
+ blockHoverBorderColor: "#bacefd",
452
+ blockSelectedBorderColor: "#3370ff",
453
+ codeBg: "rgba(232, 232, 253, 0.05)",
454
+ codeHeaderBg: "rgba(231, 231, 243, 0.07)",
455
+ codeDividerColor: "rgba(238, 238, 246, 0.11)",
456
+ calloutBordered: true,
457
+ tableBorderColor: "rgba(239, 239, 245, 0.22)",
458
+ // 迁移前 --tt-gray-dark-a-300
459
+ tableHeaderBg: "rgba(231, 231, 243, 0.07)",
460
+ // 迁移前 --tt-gray-dark-a-100
461
+ tableRadius: 0,
462
+ floatBg: token.colorBgElevated,
463
+ floatRadius: 6,
464
+ floatShadow: "0px 8px 16px 0px rgba(0, 0, 0, 0.28)",
465
+ // --shadow-md-down(深色)
466
+ floatBorderColor: "rgba(255, 255, 255, 0.12)",
467
+ itemRadius: 4,
468
+ itemHoverBg: "rgba(231, 231, 243, 0.07)",
469
+ // 迁移前 --tt-gray-dark-a-100
470
+ controlHoverBg: "rgba(238, 238, 246, 0.11)",
471
+ // 迁移前 --tt-gray-dark-a-200
472
+ cardBorderColor: "var(--tt-border-color)",
473
+ cardHoverBg: "var(--tt-gray-light-a-50, #f5f6f7)",
474
+ toolbarRadius: 6,
475
+ inputRadius: 6,
476
+ accentColor: "#3370ff",
477
+ // 迁移前读 var(--tt-codeblock-muted):深色下它被误写成 undefined,颜色失效、继承了正文色。
478
+ // 这里取它本来要给的值 --tt-gray-dark-a-600
479
+ textSecondary: "rgba(247, 247, 253, 0.64)",
480
+ textTertiary: "rgba(247, 247, 253, 0.64)"
481
+ };
482
+ }
483
+ return {
484
+ colorText: "#1f2329",
485
+ // N900
486
+ colorBgPage: token.colorBgContainer,
487
+ blockRadius: 4,
488
+ cardRadius: 8,
489
+ // 规格:卡片类块圆角 8
490
+ dividerColor: "rgba(37, 39, 45, 0.1)",
491
+ // 迁移前 --tt-gray-light-a-200
492
+ inlineCodeBg: "#f5f6f7",
493
+ // N50
494
+ inlineCodeBorder: "#dee0e3",
495
+ // N300
496
+ blockBorderColor: "#dee0e3",
497
+ // --line-border-card
498
+ blockHoverBorderColor: "#bacefd",
499
+ // 规格 §40:悬停 #bacefd
500
+ blockSelectedBorderColor: "#3370ff",
501
+ // 选中 #3370ff
502
+ codeBg: "#f5f6f7",
503
+ // N50
504
+ codeHeaderBg: "rgba(31, 35, 41, 0.04)",
505
+ codeDividerColor: "#dee0e3",
506
+ calloutBordered: true,
507
+ tableBorderColor: "#dee0e3",
508
+ // 飞书知识库 docx 实测单元格边框 N300
509
+ tableHeaderBg: "rgba(15, 22, 36, 0.05)",
510
+ // 迁移前 --tt-gray-light-a-100
511
+ tableRadius: 0,
512
+ // 直角
513
+ floatBg: token.colorBgElevated,
514
+ floatRadius: 6,
515
+ floatShadow: "0px 4px 8px 0px rgba(31, 35, 41, 0.1)",
516
+ // --shadow-md-down
517
+ floatBorderColor: "#dee0e3",
518
+ itemRadius: 4,
519
+ itemHoverBg: "rgba(15, 22, 36, 0.05)",
520
+ // 迁移前 --tt-gray-light-a-100
521
+ controlHoverBg: "rgba(37, 39, 45, 0.1)",
522
+ // 迁移前 --tt-gray-light-a-200
523
+ // 卡片 / 小工具条 / 输入框 / 文字:各组件迁移前写死的原值(组件里用 pick 原样保留)
524
+ cardBorderColor: "var(--tt-border-color)",
525
+ cardHoverBg: "var(--tt-gray-light-a-50, #f5f6f7)",
526
+ toolbarRadius: 6,
527
+ inputRadius: 6,
528
+ accentColor: "#3370ff",
529
+ textSecondary: "rgba(36, 39, 46, 0.78)",
530
+ // 迁移前 --tt-codeblock-muted = --tt-gray-light-a-600
531
+ textTertiary: "rgba(36, 39, 46, 0.78)"
532
+ };
533
+ }
534
+ function resolveEditorTheme(token, options = {}) {
535
+ const visualTheme = options.visualTheme ?? "notion";
536
+ const isDark = isDarkAntdToken(token, options.isDarkMode);
537
+ const surface = visualTheme === "feishu" ? feishuSurface(token, isDark) : notionSurface(token, isDark);
538
+ return { visualTheme, isDark, surface };
539
+ }
540
+ function brandVars(token) {
541
+ return {
542
+ "--tt-brand-color-50": token.colorPrimaryBg,
543
+ "--tt-brand-color-100": token.colorPrimaryBgHover,
544
+ "--tt-brand-color-200": token.colorPrimaryBorder,
545
+ "--tt-brand-color-300": token.colorPrimaryBorderHover,
546
+ "--tt-brand-color-400": token.colorPrimaryHover,
547
+ "--tt-brand-color-500": token.colorPrimary,
548
+ "--tt-brand-color-600": token.colorPrimaryActive,
549
+ "--tt-brand-color-700": token.colorPrimaryTextActive,
550
+ "--tt-brand-color-800": token.colorPrimaryTextActive,
551
+ "--tt-brand-color-900": token.colorPrimaryTextActive,
552
+ "--tt-brand-color-950": token.colorPrimaryTextActive
553
+ };
554
+ }
555
+ function tableVars({ surface, isDark }) {
556
+ return {
557
+ "--tt-table-border-color": surface.tableBorderColor,
558
+ // 选中单元格底色:迁移前浅色 0.4、深色 0.2
559
+ "--tt-table-selected-bg": isDark ? "rgba(195, 189, 255, 0.2)" : "rgba(195, 189, 255, 0.4)",
560
+ "--tt-table-selected-stroke": "var(--tt-brand-color-400)",
561
+ "--tt-table-column-resize-handle-bg": "var(--tt-brand-color-400)",
562
+ "--tt-table-cell-padding": "0.5rem",
563
+ "--tt-table-margin-block": "1.25rem",
564
+ "--tt-table-pad-block-start": "1rem",
565
+ "--tt-table-pad-block-end": "1.5rem",
566
+ "--tt-table-pad-inline-start": "1rem",
567
+ "--tt-table-pad-inline-end": "1.5rem"
568
+ };
569
+ }
570
+ function editorThemeVars(token, resolved) {
571
+ return {
572
+ ...BASE_LIGHT_VARS,
573
+ ...resolved.isDark ? BASE_DARK_VARS : {},
574
+ ...brandVars(token),
575
+ ...tableVars(resolved)
576
+ };
577
+ }
578
+ var declarations = (vars) => Object.entries(vars).map(([k, v]) => ` ${k}: ${v};`).join("\n");
579
+ function editorThemeCss(token, resolved) {
580
+ return `:root {
581
+ ${declarations(editorThemeVars(token, resolved))}
582
+ }
583
+ `;
584
+ }
585
+
586
+ // src/components/base/base-grid.style.ts
587
+ var baseGridStyles = ({ token, isDark }) => {
588
+ const thumb = isDark ? "rgba(255, 255, 255, 0.35)" : "rgba(31, 35, 41, 0.35)";
589
+ const thumbHover = isDark ? "rgba(255, 255, 255, 0.5)" : "rgba(31, 35, 41, 0.5)";
590
+ return `
591
+ .tt-base-grid {
592
+ width: 100%;
593
+ height: 100%;
594
+ }
595
+
596
+ .tt-base-grid-container {
597
+ position: relative;
598
+ outline: none;
599
+ }
600
+
601
+ .tt-base-grid-render-layer {
602
+ pointer-events: none;
603
+ }
604
+
605
+ .tt-base-grid-interaction {
606
+ position: absolute;
607
+ }
608
+
609
+ .tt-base-grid-stage {
610
+ width: 100%;
611
+ height: 100%;
612
+ }
613
+
614
+ .tt-base-grid-scrollbar {
615
+ position: absolute;
616
+ cursor: pointer;
617
+ will-change: transform;
618
+ scrollbar-color: ${thumb} transparent;
619
+
620
+ &::-webkit-scrollbar {
621
+ width: 8px;
622
+ height: 8px;
623
+ }
624
+ &::-webkit-scrollbar-track {
625
+ background: transparent;
626
+ }
627
+ &::-webkit-scrollbar-thumb {
628
+ background: ${thumb};
629
+ border-radius: 6px;
630
+ }
631
+ &:hover::-webkit-scrollbar-thumb {
632
+ background: ${thumbHover};
633
+ }
634
+ &.is-hidden {
635
+ opacity: 0;
636
+ pointer-events: none;
637
+ }
638
+ }
639
+
640
+ .tt-base-grid-hscroll {
641
+ bottom: 2px;
642
+ left: 0;
643
+ height: 16px;
644
+ overflow-x: scroll;
645
+ overflow-y: hidden;
646
+
647
+ &::-webkit-scrollbar-track {
648
+ margin: 0 4px;
649
+ }
650
+ }
651
+
652
+ .tt-base-grid-vscroll {
653
+ right: 2px;
654
+ width: 16px;
655
+ overflow-x: hidden;
656
+ overflow-y: scroll;
657
+
658
+ &::-webkit-scrollbar-track {
659
+ margin: 4px 0;
660
+ }
661
+ &::-webkit-scrollbar-thumb {
662
+ min-height: 32px;
663
+ }
664
+ }
665
+
666
+ .tt-base-grid-hscroll-content {
667
+ position: absolute;
668
+ }
669
+
670
+ .tt-base-grid-scroll-content {
671
+ display: flex;
672
+ flex-direction: column;
673
+ flex-shrink: 0;
674
+ width: 1px;
675
+ }
676
+
677
+ .tt-base-grid-cell-scroller {
678
+ position: absolute;
679
+ width: 10px;
680
+ cursor: pointer;
681
+ overflow-x: hidden;
682
+ overflow-y: scroll;
683
+ opacity: 0;
684
+ will-change: transform;
685
+ }
686
+
687
+ .tt-base-grid-editor-layer {
688
+ position: absolute;
689
+ left: 0;
690
+ top: 0;
691
+ width: 100%;
692
+ pointer-events: none;
693
+ }
694
+
695
+ /* 不设 pointer-events:继承浮层的 none,未进入编辑时不挡住活动格上的点击;编辑器自己在编辑时设成 auto */
696
+ .tt-base-grid-editor {
697
+ position: absolute;
698
+ z-index: 10;
699
+ }
700
+
701
+ .tt-base-grid-hidden-editor,
702
+ .tt-base-grid-hidden-input {
703
+ width: 0;
704
+ height: 0;
705
+ padding: 0;
706
+ border: none;
707
+ outline: none;
708
+ box-shadow: none;
709
+ opacity: 0;
710
+ }
711
+
712
+ .tt-base-grid-text-editor {
713
+ position: relative;
714
+ border-radius: 6px;
715
+ background: ${token.colorBgContainer};
716
+ }
717
+
718
+ .tt-base-grid-text-editor-textarea {
719
+ width: 100%;
720
+ resize: none;
721
+ border: none;
722
+ border-radius: 4px;
723
+ background: ${token.colorBgContainer};
724
+ padding: 4px 8px 0;
725
+ font-size: 14px;
726
+ line-height: 1.4rem;
727
+ color: ${token.colorText};
728
+ outline: none;
729
+ }
730
+
731
+ .tt-base-grid-text-editor-hint {
732
+ position: absolute;
733
+ bottom: 2px;
734
+ left: 0;
735
+ width: 100%;
736
+ padding: 0 4px 2px 0;
737
+ border-radius: 0 0 6px 6px;
738
+ background: ${token.colorBgContainer};
739
+ text-align: end;
740
+ font-size: 12px;
741
+ color: ${token.colorTextQuaternary};
742
+ }
743
+
744
+ .tt-base-grid-text-editor-input {
745
+ box-sizing: border-box;
746
+ cursor: text;
747
+ padding: 0 8px;
748
+ border-radius: 2px;
749
+ background: ${token.colorBgContainer};
750
+ font-size: 14px;
751
+ color: ${token.colorText};
752
+ outline: none;
753
+ }
754
+
755
+ .tt-base-grid-select-editor {
756
+ box-sizing: border-box;
757
+ display: flex;
758
+ flex-direction: column;
759
+ gap: 4px;
760
+ padding: 8px;
761
+ border: 1px solid ${token.colorBorderSecondary};
762
+ border-radius: 6px;
763
+ background: ${token.colorBgElevated};
764
+ box-shadow: ${token.boxShadowSecondary};
765
+ }
766
+
767
+ .tt-base-grid-select-search {
768
+ height: 32px;
769
+ padding: 0 8px;
770
+ border: 1px solid ${token.colorBorder};
771
+ border-radius: 6px;
772
+ font-size: 14px;
773
+ color: ${token.colorText};
774
+ background: transparent;
775
+ outline: none;
776
+
777
+ &:focus {
778
+ border-color: ${token.colorPrimary};
779
+ }
780
+ }
781
+
782
+ .tt-base-grid-select-list {
783
+ max-height: 240px;
784
+ overflow-y: auto;
785
+ }
786
+
787
+ .tt-base-grid-select-item {
788
+ display: flex;
789
+ align-items: center;
790
+ justify-content: space-between;
791
+ gap: 8px;
792
+ padding: 6px 8px;
793
+ border-radius: 4px;
794
+ cursor: pointer;
795
+
796
+ &.is-active {
797
+ background: ${token.colorFillTertiary};
798
+ }
799
+ }
800
+
801
+ .tt-base-grid-select-tag {
802
+ overflow: hidden;
803
+ padding: 0 8px;
804
+ border-radius: 10px;
805
+ font-size: 12px;
806
+ line-height: 20px;
807
+ text-overflow: ellipsis;
808
+ white-space: nowrap;
809
+ }
810
+
811
+ .tt-base-grid-select-check {
812
+ flex-shrink: 0;
813
+ font-size: 16px;
814
+ color: ${token.colorPrimary};
815
+ }
816
+
817
+ .tt-base-grid-select-empty {
818
+ padding: 12px 8px;
819
+ text-align: center;
820
+ font-size: 12px;
821
+ color: ${token.colorTextTertiary};
822
+ }
823
+
824
+ .tt-base-grid-indicators {
825
+ position: absolute;
826
+ left: 0;
827
+ top: 0;
828
+ pointer-events: none;
829
+ }
830
+
831
+ .tt-base-grid-indicator-cell {
832
+ position: absolute;
833
+ border-radius: 2px;
834
+ }
835
+
836
+ .tt-base-grid-error-dot {
837
+ position: absolute;
838
+ top: 4px;
839
+ right: 4px;
840
+ display: flex;
841
+ align-items: center;
842
+ justify-content: center;
843
+ width: 24px;
844
+ height: 24px;
845
+ border-radius: 50%;
846
+ background: ${isDark ? "rgba(245, 74, 69, 0.3)" : "#fde2e2"};
847
+ color: #f54a45;
848
+ font-size: 16px;
849
+ cursor: pointer;
850
+ pointer-events: auto;
851
+ }
852
+
853
+ .tt-base-grid-error-tip {
854
+ max-width: 280px;
855
+
856
+ p {
857
+ margin: 0 0 8px;
858
+ }
859
+ }
860
+
861
+ .tt-base-grid-error-title {
862
+ font-size: 14px;
863
+ font-weight: 500;
864
+ }
865
+
866
+ .tt-base-grid-error-message {
867
+ font-size: 12px;
868
+ word-break: break-word;
869
+ opacity: 0.75;
870
+ }
871
+
872
+ .tt-base-grid-error-actions {
873
+ display: flex;
874
+ gap: 8px;
875
+ }
876
+
877
+ .tt-base-grid-loading-stop {
878
+ position: absolute;
879
+ padding: 0;
880
+ border: none;
881
+ top: 4px;
882
+ right: 4px;
883
+ border-radius: 50%;
884
+ background: ${token.colorBgContainer};
885
+ cursor: pointer;
886
+ pointer-events: auto;
887
+ }
888
+
889
+ .tt-base-grid-loading-progress {
890
+ position: absolute;
891
+ top: 0;
892
+ right: 0;
893
+ display: flex;
894
+ align-items: center;
895
+ justify-content: center;
896
+ width: 24px;
897
+ height: 24px;
898
+ border-radius: 50%;
899
+ }
900
+
901
+ .tt-base-grid-loading-ping {
902
+ position: absolute;
903
+ inset: 4px;
904
+ border-radius: 50%;
905
+ background: ${isDark ? "rgba(255, 255, 255, 0.15)" : "rgba(31, 35, 41, 0.15)"};
906
+ animation: tt-base-grid-ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
907
+
908
+ &.is-ai {
909
+ background: rgba(255, 136, 0, 0.3);
910
+ }
911
+ }
912
+
913
+ .tt-base-grid-loading-inner {
914
+ display: flex;
915
+ align-items: center;
916
+ justify-content: center;
917
+ width: 20px;
918
+ height: 20px;
919
+ border-radius: 50%;
920
+ background: ${token.colorBgContainer};
921
+ }
922
+
923
+ .tt-base-grid-loading-ai {
924
+ position: absolute;
925
+ top: 4px;
926
+ right: 4px;
927
+ border-radius: 50%;
928
+ background: ${token.colorBgContainer};
929
+ }
930
+
931
+ .tt-base-grid-loading-spin {
932
+ position: absolute;
933
+ inset: 0;
934
+ border: 2px dotted transparent;
935
+ border-top-color: #ff8800;
936
+ border-radius: 50%;
937
+ animation: tt-base-grid-spin 1.2s linear infinite;
938
+ }
939
+
940
+ .tt-base-grid-loading-ai-icon {
941
+ width: 24px;
942
+ height: 24px;
943
+ padding: 4px;
944
+ box-sizing: border-box;
945
+ }
946
+
947
+ .tt-base-grid-icon-xs {
948
+ font-size: 12px;
949
+ }
950
+
951
+ .tt-base-grid-icon-sm {
952
+ font-size: 16px;
953
+
954
+ &.is-ai {
955
+ color: #ff8800;
956
+ }
957
+ }
958
+
959
+ @keyframes tt-base-grid-ping {
960
+ 75%,
961
+ 100% {
962
+ transform: scale(2);
963
+ opacity: 0;
964
+ }
965
+ }
966
+
967
+ @keyframes tt-base-grid-spin {
968
+ to {
969
+ transform: rotate(360deg);
970
+ }
971
+ }
972
+ `;
973
+ };
974
+
975
+ // src/components/base/base-view.style.ts
976
+ var baseViewStyles = ({ token, isDark }) => {
977
+ const c = isDark ? {
978
+ text: token.colorText,
979
+ caption: token.colorTextSecondary,
980
+ placeholder: token.colorTextQuaternary,
981
+ border: token.colorBorderSecondary,
982
+ divider: token.colorSplit,
983
+ hover: token.colorFillSecondary,
984
+ pressed: token.colorFill,
985
+ bg: token.colorBgContainer,
986
+ base: token.colorBgLayout,
987
+ float: token.colorBgElevated
988
+ } : {
989
+ text: "#1f2329",
990
+ caption: "#646a73",
991
+ placeholder: "#8f959e",
992
+ border: "#dee0e3",
993
+ hover: "rgba(31, 35, 41, 0.08)",
994
+ pressed: "rgba(31, 35, 41, 0.12)",
995
+ bg: "#ffffff",
996
+ base: "#f5f6f7",
997
+ float: "#ffffff"
998
+ };
999
+ const primary = token.colorPrimary;
1000
+ const primaryBg = token.colorPrimaryBg;
1001
+ const shadow = isDark ? "0 6px 24px rgba(0, 0, 0, 0.45)" : "0 6px 24px 0 rgba(31, 35, 41, 0.08), 0 0 1px 0 rgba(31, 35, 41, 0.18)";
1002
+ return `
1003
+ .tt-base-view {
1004
+ display: flex;
1005
+ width: 100%;
1006
+ height: 100%;
1007
+ min-height: 0;
1008
+ overflow: hidden;
1009
+ background: ${c.bg};
1010
+ color: ${c.text};
1011
+ font-size: 14px;
1012
+ line-height: 22px;
1013
+ }
1014
+
1015
+ .tt-base-view--empty {
1016
+ align-items: center;
1017
+ justify-content: center;
1018
+ color: ${c.caption};
1019
+ }
1020
+
1021
+ .tt-base-icon {
1022
+ display: inline-flex;
1023
+ flex: none;
1024
+ align-items: center;
1025
+ justify-content: center;
1026
+
1027
+ & svg {
1028
+ display: block;
1029
+ }
1030
+
1031
+ &.is-flipped {
1032
+ transform: rotate(180deg);
1033
+ }
1034
+ }
1035
+
1036
+ .tt-base-icon-button {
1037
+ display: inline-flex;
1038
+ flex: none;
1039
+ align-items: center;
1040
+ justify-content: center;
1041
+ min-width: 28px;
1042
+ height: 28px;
1043
+ padding: 0 4px;
1044
+ border: none;
1045
+ border-radius: 6px;
1046
+ background: transparent;
1047
+ color: ${c.caption};
1048
+ cursor: pointer;
1049
+
1050
+ &:hover:not(:disabled) {
1051
+ background: ${c.hover};
1052
+ color: ${c.text};
1053
+ }
1054
+
1055
+ &:active:not(:disabled) {
1056
+ background: ${c.pressed};
1057
+ }
1058
+
1059
+ &:disabled {
1060
+ cursor: not-allowed;
1061
+ opacity: 0.4;
1062
+ }
1063
+ }
1064
+
1065
+ /* ---------- 数据表侧栏 ---------- */
1066
+
1067
+ .tt-base-sidebar {
1068
+ display: flex;
1069
+ flex: none;
1070
+ flex-direction: column;
1071
+ width: 220px;
1072
+ border-right: 1px solid ${c.border};
1073
+ background: ${c.bg};
1074
+ transition: width 0.15s;
1075
+
1076
+ &.is-collapsed {
1077
+ width: 44px;
1078
+ }
1079
+ }
1080
+
1081
+ .tt-base-sidebar__head {
1082
+ display: flex;
1083
+ align-items: center;
1084
+ gap: 4px;
1085
+ height: 48px;
1086
+ padding: 0 8px 0 16px;
1087
+ }
1088
+
1089
+ .tt-base-sidebar.is-collapsed .tt-base-sidebar__head {
1090
+ justify-content: center;
1091
+ padding: 0;
1092
+ }
1093
+
1094
+ .tt-base-sidebar__title {
1095
+ flex: 1;
1096
+ color: ${c.caption};
1097
+ font-size: 12px;
1098
+ }
1099
+
1100
+ .tt-base-sidebar__list {
1101
+ flex: 1;
1102
+ overflow: auto;
1103
+ padding: 0 8px 8px;
1104
+ }
1105
+
1106
+ .tt-base-sidebar__item {
1107
+ display: flex;
1108
+ align-items: center;
1109
+ gap: 8px;
1110
+ height: 36px;
1111
+ padding: 0 4px 0 10px;
1112
+ border-radius: 6px;
1113
+ color: ${c.text};
1114
+ cursor: pointer;
1115
+ outline: none;
1116
+
1117
+ &:hover {
1118
+ background: ${c.hover};
1119
+ }
1120
+
1121
+ &.is-active {
1122
+ background: ${primaryBg};
1123
+ color: ${primary};
1124
+ font-weight: 500;
1125
+ }
1126
+
1127
+ & .tt-base-rename {
1128
+ flex: 1;
1129
+ min-width: 0;
1130
+ overflow: hidden;
1131
+ text-overflow: ellipsis;
1132
+ white-space: nowrap;
1133
+ }
1134
+ }
1135
+
1136
+ .tt-base-sidebar__more {
1137
+ visibility: hidden;
1138
+ }
1139
+
1140
+ .tt-base-sidebar__item:hover .tt-base-sidebar__more,
1141
+ .tt-base-sidebar__item.is-active .tt-base-sidebar__more {
1142
+ visibility: visible;
1143
+ }
1144
+
1145
+ .tt-base-rename__input {
1146
+ flex: 1;
1147
+ min-width: 0;
1148
+ }
1149
+
1150
+ /* ---------- 主区 ---------- */
1151
+
1152
+ .tt-base-main {
1153
+ display: flex;
1154
+ flex: 1;
1155
+ flex-direction: column;
1156
+ min-width: 0;
1157
+ min-height: 0;
1158
+ }
1159
+
1160
+ .tt-base-tabs {
1161
+ display: flex;
1162
+ flex: none;
1163
+ align-items: flex-end;
1164
+ gap: 2px;
1165
+ height: 44px;
1166
+ padding: 0 12px;
1167
+ overflow-x: auto;
1168
+ background: ${c.base};
1169
+ }
1170
+
1171
+ .tt-base-tabs__item {
1172
+ display: flex;
1173
+ flex: none;
1174
+ align-items: center;
1175
+ gap: 6px;
1176
+ height: 36px;
1177
+ max-width: 220px;
1178
+ padding: 0 12px;
1179
+ border-radius: 8px 8px 0 0;
1180
+ color: ${c.caption};
1181
+ cursor: pointer;
1182
+ outline: none;
1183
+
1184
+ &:hover {
1185
+ background: ${c.hover};
1186
+ }
1187
+
1188
+ &.is-active {
1189
+ background: ${c.bg};
1190
+ color: ${c.text};
1191
+ font-weight: 500;
1192
+ }
1193
+
1194
+ & .tt-base-rename {
1195
+ overflow: hidden;
1196
+ text-overflow: ellipsis;
1197
+ white-space: nowrap;
1198
+ }
1199
+ }
1200
+
1201
+ .tt-base-tabs__more {
1202
+ min-width: 20px;
1203
+ height: 20px;
1204
+ margin-right: -6px;
1205
+ }
1206
+
1207
+ .tt-base-tabs__add {
1208
+ align-self: center;
1209
+ margin-left: 4px;
1210
+ }
1211
+
1212
+ .tt-base-toolbar {
1213
+ display: flex;
1214
+ flex: none;
1215
+ align-items: center;
1216
+ gap: 4px;
1217
+ height: 44px;
1218
+ padding: 0 12px;
1219
+ border-bottom: 1px solid ${c.border};
1220
+ background: ${c.bg};
1221
+ overflow-x: auto;
1222
+ }
1223
+
1224
+ .tt-base-toolbar__button {
1225
+ display: inline-flex;
1226
+ flex: none;
1227
+ align-items: center;
1228
+ gap: 4px;
1229
+ height: 28px;
1230
+ padding: 0 8px;
1231
+ border: none;
1232
+ border-radius: 6px;
1233
+ background: transparent;
1234
+ color: ${c.text};
1235
+ font-size: 14px;
1236
+ white-space: nowrap;
1237
+ cursor: pointer;
1238
+
1239
+ & .tt-base-icon {
1240
+ color: ${c.caption};
1241
+ }
1242
+
1243
+ &:hover {
1244
+ background: ${c.hover};
1245
+ }
1246
+
1247
+ &.is-open {
1248
+ background: ${c.hover};
1249
+ }
1250
+
1251
+ &.is-primary {
1252
+ color: ${primary};
1253
+
1254
+ & .tt-base-icon {
1255
+ color: ${primary};
1256
+ }
1257
+ }
1258
+
1259
+ &.is-active.is-filter {
1260
+ background: rgba(20, 86, 240, 0.2);
1261
+ }
1262
+
1263
+ &.is-active.is-group {
1264
+ background: rgba(255, 129, 26, 0.15);
1265
+ }
1266
+
1267
+ &.is-active.is-sort {
1268
+ background: rgba(62, 195, 247, 0.2);
1269
+ }
1270
+
1271
+ &.is-active.is-fields {
1272
+ background: rgba(250, 211, 85, 0.2);
1273
+ }
1274
+ }
1275
+
1276
+ .tt-base-toolbar__divider {
1277
+ flex: none;
1278
+ width: 1px;
1279
+ height: 16px;
1280
+ margin: 0 4px;
1281
+ background: ${c.border};
1282
+ }
1283
+
1284
+ .tt-base-toolbar__spacer {
1285
+ flex: 1;
1286
+ }
1287
+
1288
+ .tt-base-search {
1289
+ display: inline-flex;
1290
+ flex: none;
1291
+ align-items: center;
1292
+ gap: 4px;
1293
+ height: 28px;
1294
+ padding: 0 4px 0 8px;
1295
+ border: 1px solid ${primary};
1296
+ border-radius: 6px;
1297
+ color: ${c.caption};
1298
+ }
1299
+
1300
+ .tt-base-search__input {
1301
+ width: 160px;
1302
+ border: none;
1303
+ outline: none;
1304
+ background: transparent;
1305
+ color: ${c.text};
1306
+ font-size: 14px;
1307
+ }
1308
+
1309
+ .tt-base-search__count {
1310
+ color: ${c.placeholder};
1311
+ font-size: 12px;
1312
+ }
1313
+
1314
+ .tt-base-body {
1315
+ position: relative;
1316
+ display: flex;
1317
+ flex: 1;
1318
+ min-height: 0;
1319
+ }
1320
+
1321
+ .tt-base-grid-wrap {
1322
+ position: relative;
1323
+ flex: 1;
1324
+ min-width: 0;
1325
+ min-height: 0;
1326
+ }
1327
+
1328
+ .tt-base-notice {
1329
+ position: fixed;
1330
+ left: 50%;
1331
+ top: 72px;
1332
+ z-index: 1100;
1333
+ padding: 9px 16px;
1334
+ border-radius: 8px;
1335
+ background: ${c.float};
1336
+ box-shadow: ${shadow};
1337
+ color: ${c.text};
1338
+ transform: translateX(-50%);
1339
+ }
1340
+
1341
+ /* ---------- 弹出面板与菜单 ---------- */
1342
+
1343
+ .tt-base-popover,
1344
+ .tt-base-editor-panel {
1345
+ position: fixed;
1346
+ z-index: 1000;
1347
+ box-sizing: border-box;
1348
+ border: 1px solid ${c.border};
1349
+ border-radius: 8px;
1350
+ background: ${c.float};
1351
+ box-shadow: ${shadow};
1352
+ color: ${c.text};
1353
+ font-size: 14px;
1354
+ line-height: 22px;
1355
+ }
1356
+
1357
+ .tt-base-editor-panel {
1358
+ padding: 8px;
1359
+ }
1360
+
1361
+ .tt-base-select-popup {
1362
+ z-index: 1060;
1363
+ }
1364
+
1365
+ .tt-base-menu {
1366
+ min-width: 200px;
1367
+ padding: 4px;
1368
+ }
1369
+
1370
+ .tt-base-menu__item {
1371
+ display: flex;
1372
+ align-items: center;
1373
+ gap: 8px;
1374
+ width: 100%;
1375
+ height: 36px;
1376
+ padding: 0 8px;
1377
+ border: none;
1378
+ border-radius: 6px;
1379
+ background: transparent;
1380
+ color: ${c.text};
1381
+ font-size: 14px;
1382
+ text-align: left;
1383
+ cursor: pointer;
1384
+
1385
+ &:hover:not(:disabled) {
1386
+ background: ${c.hover};
1387
+ }
1388
+
1389
+ &:disabled {
1390
+ color: ${c.placeholder};
1391
+ cursor: not-allowed;
1392
+ }
1393
+
1394
+ &.is-danger:not(:disabled) {
1395
+ color: ${token.colorError};
1396
+
1397
+ & .tt-base-menu__icon {
1398
+ color: ${token.colorError};
1399
+ }
1400
+ }
1401
+ }
1402
+
1403
+ .tt-base-menu__icon {
1404
+ display: inline-flex;
1405
+ width: 16px;
1406
+ color: ${c.caption};
1407
+ }
1408
+
1409
+ .tt-base-menu__label {
1410
+ flex: 1;
1411
+ }
1412
+
1413
+ .tt-base-menu__check {
1414
+ color: ${primary};
1415
+ }
1416
+
1417
+ .tt-base-menu__divider {
1418
+ height: 1px;
1419
+ margin: 4px 0;
1420
+ background: ${c.border};
1421
+ }
1422
+
1423
+ .tt-base-panel {
1424
+ padding: 12px 16px 16px;
1425
+ }
1426
+
1427
+ .tt-base-panel__title {
1428
+ display: flex;
1429
+ align-items: center;
1430
+ justify-content: space-between;
1431
+ margin-bottom: 12px;
1432
+ font-weight: 500;
1433
+ }
1434
+
1435
+ .tt-base-panel__label {
1436
+ margin: 12px 0 6px;
1437
+ color: ${c.caption};
1438
+ font-size: 12px;
1439
+ line-height: 20px;
1440
+
1441
+ &:first-child {
1442
+ margin-top: 0;
1443
+ }
1444
+ }
1445
+
1446
+ .tt-base-panel__hint {
1447
+ margin-top: 8px;
1448
+ color: ${c.placeholder};
1449
+ font-size: 12px;
1450
+ line-height: 18px;
1451
+ }
1452
+
1453
+ .tt-base-panel__add {
1454
+ margin-top: 4px;
1455
+ padding-left: 4px;
1456
+ color: ${primary};
1457
+ }
1458
+
1459
+ .tt-base-panel__picker {
1460
+ width: 200px;
1461
+ margin-top: 4px;
1462
+ }
1463
+
1464
+ .tt-base-filter__conjunction {
1465
+ display: flex;
1466
+ align-items: center;
1467
+ gap: 6px;
1468
+ margin-bottom: 8px;
1469
+ color: ${c.caption};
1470
+ }
1471
+
1472
+ .tt-base-filter__row {
1473
+ display: flex;
1474
+ align-items: center;
1475
+ gap: 8px;
1476
+ margin-bottom: 8px;
1477
+ }
1478
+
1479
+ .tt-base-filter__field {
1480
+ width: 160px;
1481
+ flex: none;
1482
+ }
1483
+
1484
+ .tt-base-filter__operator {
1485
+ width: 120px;
1486
+ flex: none;
1487
+ }
1488
+
1489
+ .tt-base-filter__value {
1490
+ flex: 1;
1491
+ min-width: 0;
1492
+ }
1493
+
1494
+ .tt-base-filter__date {
1495
+ display: flex;
1496
+ flex: 1;
1497
+ gap: 6px;
1498
+ min-width: 0;
1499
+
1500
+ & > * {
1501
+ flex: 1;
1502
+ min-width: 0;
1503
+ }
1504
+ }
1505
+
1506
+ .tt-base-inline-field,
1507
+ .tt-base-inline-user {
1508
+ display: inline-flex;
1509
+ align-items: center;
1510
+ gap: 6px;
1511
+ vertical-align: middle;
1512
+
1513
+ & .tt-base-icon {
1514
+ color: ${c.caption};
1515
+ }
1516
+ }
1517
+
1518
+ .tt-base-tag {
1519
+ display: inline-block;
1520
+ max-width: 100%;
1521
+ padding: 0 8px;
1522
+ border-radius: 12px;
1523
+ overflow: hidden;
1524
+ font-size: 12px;
1525
+ line-height: 20px;
1526
+ text-overflow: ellipsis;
1527
+ white-space: nowrap;
1528
+ vertical-align: middle;
1529
+ }
1530
+
1531
+ .tt-base-fields__list {
1532
+ max-height: 360px;
1533
+ margin: 0 -8px;
1534
+ overflow: auto;
1535
+ }
1536
+
1537
+ .tt-base-fields__item {
1538
+ display: flex;
1539
+ align-items: center;
1540
+ gap: 6px;
1541
+ height: 36px;
1542
+ padding: 0 8px;
1543
+ border-radius: 6px;
1544
+
1545
+ &:hover {
1546
+ background: ${c.hover};
1547
+ }
1548
+
1549
+ &.is-dragging {
1550
+ opacity: 0.5;
1551
+ }
1552
+
1553
+ & > .tt-base-icon {
1554
+ color: ${c.caption};
1555
+ }
1556
+ }
1557
+
1558
+ .tt-base-fields__drag {
1559
+ display: inline-flex;
1560
+ color: ${c.placeholder};
1561
+ cursor: grab;
1562
+ }
1563
+
1564
+ .tt-base-fields__name {
1565
+ flex: 1;
1566
+ min-width: 0;
1567
+ overflow: hidden;
1568
+ border: none;
1569
+ background: transparent;
1570
+ color: ${c.text};
1571
+ font-size: 14px;
1572
+ text-align: left;
1573
+ text-overflow: ellipsis;
1574
+ white-space: nowrap;
1575
+ cursor: pointer;
1576
+ }
1577
+
1578
+ .tt-base-field-config__type {
1579
+ width: 100%;
1580
+ }
1581
+
1582
+ .tt-base-field-config__range {
1583
+ display: flex;
1584
+ align-items: center;
1585
+ gap: 8px;
1586
+
1587
+ & > .ant-select {
1588
+ flex: 1;
1589
+ }
1590
+ }
1591
+
1592
+ .tt-base-field-config__check {
1593
+ margin-top: 12px;
1594
+ }
1595
+
1596
+ .tt-base-field-config__desc {
1597
+ display: block;
1598
+ margin-top: 12px;
1599
+ }
1600
+
1601
+ .tt-base-field-config .ant-select {
1602
+ width: 100%;
1603
+ }
1604
+
1605
+ .tt-base-options {
1606
+ display: flex;
1607
+ flex-direction: column;
1608
+ gap: 6px;
1609
+ max-height: 240px;
1610
+ overflow: auto;
1611
+ }
1612
+
1613
+ .tt-base-options__row {
1614
+ position: relative;
1615
+ display: flex;
1616
+ align-items: center;
1617
+ gap: 6px;
1618
+ }
1619
+
1620
+ .tt-base-options__swatch {
1621
+ flex: none;
1622
+ width: 16px;
1623
+ height: 16px;
1624
+ padding: 0;
1625
+ border: 1px solid transparent;
1626
+ border-radius: 50%;
1627
+ cursor: pointer;
1628
+ }
1629
+
1630
+ .tt-base-options__palette {
1631
+ position: absolute;
1632
+ left: 0;
1633
+ top: 26px;
1634
+ z-index: 2;
1635
+ display: grid;
1636
+ grid-template-columns: repeat(5, 24px);
1637
+ gap: 6px;
1638
+ padding: 8px;
1639
+ border-radius: 8px;
1640
+ background: ${c.float};
1641
+ box-shadow: ${shadow};
1642
+ }
1643
+
1644
+ .tt-base-options__color {
1645
+ width: 24px;
1646
+ height: 24px;
1647
+ padding: 0;
1648
+ border: 2px solid transparent;
1649
+ border-radius: 6px;
1650
+ font-size: 12px;
1651
+ font-weight: 500;
1652
+ cursor: pointer;
1653
+
1654
+ &.is-active {
1655
+ border-color: ${primary};
1656
+ }
1657
+ }
1658
+
1659
+ /* ---------- 单元格编辑面板 ---------- */
1660
+
1661
+ .tt-base-editor-anchor {
1662
+ position: relative;
1663
+ pointer-events: none;
1664
+ }
1665
+
1666
+ .tt-base-editor-focus {
1667
+ position: absolute;
1668
+ width: 0;
1669
+ height: 0;
1670
+ padding: 0;
1671
+ border: none;
1672
+ opacity: 0;
1673
+ }
1674
+
1675
+ .tt-base-editor-input {
1676
+ box-sizing: border-box;
1677
+ width: 100%;
1678
+ height: 32px;
1679
+ padding: 0 8px;
1680
+ border: 1px solid ${c.border};
1681
+ border-radius: 6px;
1682
+ outline: none;
1683
+ background: ${c.bg};
1684
+ color: ${c.text};
1685
+ font-size: 14px;
1686
+
1687
+ &:focus {
1688
+ border-color: ${primary};
1689
+ }
1690
+ }
1691
+
1692
+ .tt-base-editor-label {
1693
+ display: flex;
1694
+ flex-direction: column;
1695
+ gap: 4px;
1696
+ margin-bottom: 8px;
1697
+ color: ${c.caption};
1698
+ font-size: 12px;
1699
+ }
1700
+
1701
+ .tt-base-editor-actions {
1702
+ display: flex;
1703
+ justify-content: flex-end;
1704
+ gap: 8px;
1705
+ margin-top: 16px;
1706
+ }
1707
+
1708
+ .tt-base-editor-button {
1709
+ height: 32px;
1710
+ padding: 0 16px;
1711
+ border: 1px solid ${c.border};
1712
+ border-radius: 6px;
1713
+ background: ${c.bg};
1714
+ color: ${c.text};
1715
+ font-size: 14px;
1716
+ cursor: pointer;
1717
+
1718
+ &:hover:not(:disabled) {
1719
+ background: ${c.hover};
1720
+ }
1721
+
1722
+ &.is-primary {
1723
+ border-color: ${primary};
1724
+ background: ${primary};
1725
+ color: #fff;
1726
+ }
1727
+
1728
+ &.is-block {
1729
+ width: 100%;
1730
+ margin-top: 8px;
1731
+ }
1732
+
1733
+ &:disabled {
1734
+ cursor: not-allowed;
1735
+ opacity: 0.5;
1736
+ }
1737
+ }
1738
+
1739
+ .tt-base-editor-link {
1740
+ padding: 0;
1741
+ border: none;
1742
+ background: transparent;
1743
+ color: ${primary};
1744
+ font-size: 14px;
1745
+ cursor: pointer;
1746
+ }
1747
+
1748
+ .tt-base-editor-empty {
1749
+ padding: 12px 4px;
1750
+ color: ${c.placeholder};
1751
+ text-align: center;
1752
+ }
1753
+
1754
+ .tt-base-editor-error {
1755
+ margin-top: 6px;
1756
+ color: ${token.colorError};
1757
+ font-size: 12px;
1758
+ }
1759
+
1760
+ .tt-base-calendar__head {
1761
+ display: flex;
1762
+ align-items: center;
1763
+ gap: 2px;
1764
+ margin: 8px 0 4px;
1765
+
1766
+ & button {
1767
+ width: 28px;
1768
+ height: 28px;
1769
+ border: none;
1770
+ border-radius: 6px;
1771
+ background: transparent;
1772
+ color: ${c.caption};
1773
+ font-size: 16px;
1774
+ cursor: pointer;
1775
+
1776
+ &:hover {
1777
+ background: ${c.hover};
1778
+ }
1779
+ }
1780
+ }
1781
+
1782
+ .tt-base-calendar__title {
1783
+ flex: 1;
1784
+ font-weight: 500;
1785
+ text-align: center;
1786
+ }
1787
+
1788
+ .tt-base-calendar__grid {
1789
+ display: grid;
1790
+ grid-template-columns: repeat(7, 1fr);
1791
+ gap: 2px;
1792
+ }
1793
+
1794
+ .tt-base-calendar__week {
1795
+ color: ${c.placeholder};
1796
+ font-size: 12px;
1797
+ line-height: 28px;
1798
+ text-align: center;
1799
+ }
1800
+
1801
+ .tt-base-calendar__cell {
1802
+ height: 30px;
1803
+ border: none;
1804
+ border-radius: 6px;
1805
+ background: transparent;
1806
+ color: ${c.text};
1807
+ font-size: 13px;
1808
+ cursor: pointer;
1809
+
1810
+ &:hover {
1811
+ background: ${c.hover};
1812
+ }
1813
+
1814
+ &.is-other {
1815
+ color: ${c.placeholder};
1816
+ }
1817
+
1818
+ &.is-today {
1819
+ color: ${primary};
1820
+ font-weight: 600;
1821
+ }
1822
+
1823
+ &.is-selected {
1824
+ background: ${primary};
1825
+ color: #fff;
1826
+ }
1827
+ }
1828
+
1829
+ .tt-base-calendar__foot {
1830
+ display: flex;
1831
+ align-items: center;
1832
+ justify-content: flex-end;
1833
+ gap: 12px;
1834
+ margin-top: 8px;
1835
+ padding-top: 8px;
1836
+ border-top: 1px solid ${c.border};
1837
+ }
1838
+
1839
+ .tt-base-calendar__time {
1840
+ width: 72px;
1841
+ height: 28px;
1842
+ margin-right: auto;
1843
+ }
1844
+
1845
+ .tt-base-avatar {
1846
+ display: inline-flex;
1847
+ flex: none;
1848
+ align-items: center;
1849
+ justify-content: center;
1850
+ overflow: hidden;
1851
+ border-radius: 50%;
1852
+ color: #fff;
1853
+ object-fit: cover;
1854
+ }
1855
+
1856
+ .tt-base-user-picker__box {
1857
+ display: flex;
1858
+ flex-wrap: wrap;
1859
+ gap: 4px;
1860
+ min-height: 32px;
1861
+ padding: 4px;
1862
+ border: 1px solid ${primary};
1863
+ border-radius: 6px;
1864
+ }
1865
+
1866
+ .tt-base-user-picker__input {
1867
+ flex: 1;
1868
+ min-width: 60px;
1869
+ border: none;
1870
+ outline: none;
1871
+ background: transparent;
1872
+ color: ${c.text};
1873
+ font-size: 14px;
1874
+ }
1875
+
1876
+ .tt-base-user-chip {
1877
+ display: inline-flex;
1878
+ align-items: center;
1879
+ gap: 4px;
1880
+ max-width: 160px;
1881
+ padding: 0 6px 0 2px;
1882
+ border-radius: 12px;
1883
+ background: ${c.hover};
1884
+ font-size: 13px;
1885
+ line-height: 22px;
1886
+
1887
+ & button {
1888
+ padding: 0;
1889
+ border: none;
1890
+ background: transparent;
1891
+ color: ${c.caption};
1892
+ cursor: pointer;
1893
+ }
1894
+ }
1895
+
1896
+ .tt-base-user-chip__name {
1897
+ overflow: hidden;
1898
+ text-overflow: ellipsis;
1899
+ white-space: nowrap;
1900
+ }
1901
+
1902
+ .tt-base-user-picker__list {
1903
+ max-height: 240px;
1904
+ margin: 6px -4px 0;
1905
+ overflow: auto;
1906
+ }
1907
+
1908
+ .tt-base-user-picker__item {
1909
+ display: flex;
1910
+ align-items: center;
1911
+ gap: 8px;
1912
+ height: 36px;
1913
+ padding: 0 8px;
1914
+ border-radius: 6px;
1915
+ cursor: pointer;
1916
+
1917
+ &.is-active {
1918
+ background: ${c.hover};
1919
+ }
1920
+ }
1921
+
1922
+ .tt-base-user-picker__name {
1923
+ flex: 1;
1924
+ }
1925
+
1926
+ .tt-base-user-picker__check {
1927
+ color: ${primary};
1928
+ }
1929
+
1930
+ .tt-base-files {
1931
+ display: flex;
1932
+ flex-direction: column;
1933
+ gap: 4px;
1934
+ max-height: 260px;
1935
+ overflow: auto;
1936
+ }
1937
+
1938
+ .tt-base-files__item {
1939
+ display: flex;
1940
+ align-items: center;
1941
+ gap: 4px;
1942
+ padding: 2px;
1943
+ border-radius: 6px;
1944
+
1945
+ &:hover {
1946
+ background: ${c.hover};
1947
+ }
1948
+
1949
+ &.is-uploading {
1950
+ padding: 6px 8px;
1951
+ color: ${c.caption};
1952
+ }
1953
+ }
1954
+
1955
+ .tt-base-files__open {
1956
+ display: flex;
1957
+ flex: 1;
1958
+ align-items: center;
1959
+ gap: 8px;
1960
+ min-width: 0;
1961
+ padding: 2px;
1962
+ border: none;
1963
+ background: transparent;
1964
+ color: ${c.text};
1965
+ font-size: 14px;
1966
+ text-align: left;
1967
+ cursor: pointer;
1968
+ }
1969
+
1970
+ .tt-base-files__thumb {
1971
+ flex: none;
1972
+ width: 32px;
1973
+ height: 32px;
1974
+ border-radius: 4px;
1975
+ object-fit: cover;
1976
+ }
1977
+
1978
+ .tt-base-files__name {
1979
+ flex: 1;
1980
+ min-width: 0;
1981
+ overflow: hidden;
1982
+ text-overflow: ellipsis;
1983
+ white-space: nowrap;
1984
+ }
1985
+
1986
+ .tt-base-files__size {
1987
+ flex: none;
1988
+ color: ${c.placeholder};
1989
+ font-size: 12px;
1990
+ }
1991
+
1992
+ .tt-base-files__remove {
1993
+ flex: none;
1994
+ width: 24px;
1995
+ height: 24px;
1996
+ border: none;
1997
+ border-radius: 4px;
1998
+ background: transparent;
1999
+ color: ${c.caption};
2000
+ cursor: pointer;
2001
+
2002
+ &:hover {
2003
+ background: ${c.pressed};
2004
+ }
2005
+ }
2006
+
2007
+ /* ---------- 记录详情 ---------- */
2008
+
2009
+ /* 同飞书:记录详情浮在视图右侧,不挤占表格 */
2010
+ .tt-base-detail {
2011
+ position: absolute;
2012
+ top: 0;
2013
+ right: 0;
2014
+ bottom: 0;
2015
+ z-index: 5;
2016
+ display: flex;
2017
+ flex-direction: column;
2018
+ width: min(640px, 100%);
2019
+ border-left: 1px solid ${c.border};
2020
+ background: ${c.bg};
2021
+ box-shadow: ${isDark ? "-8px 0 24px rgba(0, 0, 0, 0.35)" : "-8px 0 24px rgba(31, 35, 41, 0.08)"};
2022
+ }
2023
+
2024
+ .tt-base-detail__head {
2025
+ display: flex;
2026
+ align-items: center;
2027
+ justify-content: space-between;
2028
+ height: 56px;
2029
+ padding: 0 16px;
2030
+ }
2031
+
2032
+ .tt-base-detail__nav {
2033
+ display: inline-flex;
2034
+ gap: 4px;
2035
+ }
2036
+
2037
+ .tt-base-detail__body {
2038
+ flex: 1;
2039
+ overflow: auto;
2040
+ padding: 0 40px 40px;
2041
+ }
2042
+
2043
+ @container (max-width: 480px) {
2044
+ .tt-base-detail__body {
2045
+ padding: 0 16px 24px;
2046
+ }
2047
+ }
2048
+
2049
+ .tt-base-detail__title {
2050
+ margin: 8px 0 16px;
2051
+ font-size: 24px;
2052
+ font-weight: 600;
2053
+ line-height: 32px;
2054
+ word-break: break-word;
2055
+ }
2056
+
2057
+ .tt-base-detail__tabs {
2058
+ display: flex;
2059
+ gap: 24px;
2060
+ margin-bottom: 16px;
2061
+ border-bottom: 1px solid ${c.border};
2062
+
2063
+ & span {
2064
+ padding: 8px 0;
2065
+ color: ${c.caption};
2066
+ }
2067
+
2068
+ & .is-active {
2069
+ border-bottom: 2px solid ${primary};
2070
+ color: ${primary};
2071
+ font-weight: 500;
2072
+ }
2073
+ }
2074
+
2075
+ .tt-base-detail__row {
2076
+ display: flex;
2077
+ align-items: flex-start;
2078
+ min-height: 42px;
2079
+ }
2080
+
2081
+ .tt-base-detail__label {
2082
+ display: flex;
2083
+ flex: none;
2084
+ align-items: center;
2085
+ gap: 6px;
2086
+ width: 160px;
2087
+ padding: 10px 12px 10px 0;
2088
+ color: ${c.caption};
2089
+ line-height: 22px;
2090
+
2091
+ & span:last-child {
2092
+ overflow: hidden;
2093
+ text-overflow: ellipsis;
2094
+ white-space: nowrap;
2095
+ }
2096
+ }
2097
+
2098
+ .tt-base-detail__value {
2099
+ flex: 1;
2100
+ min-width: 0;
2101
+ padding: 6px 0;
2102
+ line-height: 22px;
2103
+ }
2104
+
2105
+ .tt-base-detail__text {
2106
+ padding: 4px 11px;
2107
+ word-break: break-word;
2108
+ white-space: pre-wrap;
2109
+ }
2110
+
2111
+ .tt-base-detail__empty {
2112
+ color: ${c.placeholder};
2113
+ }
2114
+
2115
+ .tt-base-detail__input.ant-input,
2116
+ .tt-base-detail__select {
2117
+ width: 100%;
2118
+ }
2119
+
2120
+ .tt-base-detail__input.ant-input:hover,
2121
+ .tt-base-detail__select:hover {
2122
+ background: ${c.hover};
2123
+ }
2124
+
2125
+ .tt-base-detail__trigger {
2126
+ display: flex;
2127
+ align-items: center;
2128
+ min-height: 30px;
2129
+ width: 100%;
2130
+ padding: 4px 11px;
2131
+ border: none;
2132
+ border-radius: 6px;
2133
+ background: transparent;
2134
+ color: ${c.text};
2135
+ font-size: 14px;
2136
+ text-align: left;
2137
+ cursor: pointer;
2138
+
2139
+ &:hover:not(:disabled) {
2140
+ background: ${c.hover};
2141
+ }
2142
+
2143
+ &:disabled {
2144
+ cursor: default;
2145
+ }
2146
+ }
2147
+
2148
+ .tt-base-detail__users {
2149
+ display: flex;
2150
+ flex-wrap: wrap;
2151
+ gap: 4px;
2152
+ }
2153
+
2154
+ .tt-base-detail__rating {
2155
+ display: flex;
2156
+ gap: 2px;
2157
+ padding: 4px 11px;
2158
+
2159
+ & button {
2160
+ display: inline-flex;
2161
+ padding: 0;
2162
+ border: none;
2163
+ background: transparent;
2164
+ cursor: pointer;
2165
+ }
2166
+ }
2167
+
2168
+ .tt-base-detail__url {
2169
+ display: flex;
2170
+ align-items: center;
2171
+ gap: 4px;
2172
+ padding-left: 11px;
2173
+
2174
+ & a {
2175
+ overflow: hidden;
2176
+ color: ${primary};
2177
+ text-overflow: ellipsis;
2178
+ white-space: nowrap;
2179
+ }
2180
+
2181
+ & .tt-base-detail__trigger {
2182
+ width: auto;
2183
+ padding: 4px;
2184
+ }
2185
+ }
2186
+
2187
+ .tt-base-detail__files {
2188
+ padding: 0 11px;
2189
+ }
2190
+
2191
+ .tt-base-detail__hidden {
2192
+ display: inline-flex;
2193
+ align-items: center;
2194
+ gap: 6px;
2195
+ margin: 16px 0 8px;
2196
+ padding: 0;
2197
+ border: none;
2198
+ background: transparent;
2199
+ color: ${c.caption};
2200
+ font-size: 14px;
2201
+ cursor: pointer;
2202
+ }
2203
+
2204
+ .tt-base-detail__hidden-list {
2205
+ padding-left: 12px;
2206
+ border-left: 2px solid ${c.border};
2207
+ }
2208
+
2209
+ .tt-base-detail__missing {
2210
+ padding: 40px;
2211
+ color: ${c.placeholder};
2212
+ text-align: center;
2213
+ }
2214
+ `;
2215
+ };
2216
+ var SSR_PSEUDO_FLAG = "/* emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason */";
2217
+ var PSEUDO = /:(?:first|nth|nth-last)-child/;
2218
+ function markUnsafePseudo(flat) {
2219
+ const parts = [];
2220
+ let segStart = 0;
2221
+ for (let i = 0; i < flat.length; i++) {
2222
+ const ch = flat.charCodeAt(i);
2223
+ if (ch !== 123 && ch !== 125) continue;
2224
+ const seg = flat.slice(segStart, i);
2225
+ parts.push(ch === 123 && PSEUDO.test(seg) ? `${seg} ${SSR_PSEUDO_FLAG} {` : seg + flat[i]);
2226
+ segStart = i + 1;
2227
+ }
2228
+ parts.push(flat.slice(segStart));
2229
+ return parts.join("");
2230
+ }
2231
+ var cache;
2232
+ function prepareForEmotion(css) {
2233
+ if (cache?.input === css) return cache.output;
2234
+ const flat = serialize(compile(css), stringify).replace(/\n/g, " ");
2235
+ const output = markUnsafePseudo(flat);
2236
+ cache = { input: css, output };
2237
+ return output;
2238
+ }
2239
+
2240
+ // src/theme/style-context.ts
2241
+ function createStyleContext(token, resolved) {
2242
+ const vars = resolved.isDark ? { ...BASE_LIGHT_VARS, ...BASE_DARK_VARS } : BASE_LIGHT_VARS;
2243
+ const mode = resolved.isDark ? "dark" : "light";
2244
+ return {
2245
+ token,
2246
+ surface: resolved.surface,
2247
+ isDark: resolved.isDark,
2248
+ visualTheme: resolved.visualTheme,
2249
+ gray: (level, alpha = true) => vars[`--tt-gray-${mode}-${alpha ? "a-" : ""}${level}`] ?? "",
2250
+ pick: (feishu, notion) => resolved.visualTheme === "feishu" ? feishu : notion
2251
+ };
2252
+ }
2253
+
2254
+ export { DEFAULT_MAX_FILE_SIZES, EditorConfigProvider, baseGridStyles, baseViewStyles, createStyleContext, detectMediaKind, editorThemeCss, isDarkAntdToken, prepareForEmotion, resolveEditorTheme, resolveMaxSize, useEditorConfig };
2255
+ //# sourceMappingURL=chunk-3KW24N3T.js.map
2256
+ //# sourceMappingURL=chunk-3KW24N3T.js.map