@tano.page/workbench 0.14.0 → 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 (177) hide show
  1. package/package.json +21 -8
  2. package/src/App.vue +76 -17
  3. package/src/appearance/appearance.ts +14 -4
  4. package/src/appearance/components/ThemePresetPreview.vue +52 -8
  5. package/src/appearance/interface-font.ts +99 -0
  6. package/src/appearance/theme.ts +26 -10
  7. package/src/appearance/use-interface-font.ts +30 -0
  8. package/src/assets/mail-provider-icons/NOTICE.txt +27 -0
  9. package/src/assets/mail-provider-icons/aliyun-mail.svg +3 -0
  10. package/src/assets/mail-provider-icons/gmail.svg +1 -0
  11. package/src/assets/mail-provider-icons/icloud.svg +12 -0
  12. package/src/assets/mail-provider-icons/netease-126.svg +5 -0
  13. package/src/assets/mail-provider-icons/netease-163.svg +5 -0
  14. package/src/assets/mail-provider-icons/qq.svg +9 -0
  15. package/src/assets/mail-provider-icons/tencent-exmail.svg +4 -0
  16. package/src/assistant/components/AssistantChangeList.vue +98 -21
  17. package/src/assistant/components/AssistantPanel.vue +424 -7
  18. package/src/assistant/components/PluginToolProposalCard.vue +235 -0
  19. package/src/assistant/engine.ts +56 -3
  20. package/src/assistant/files.ts +5 -13
  21. package/src/assistant/inbox.ts +1 -148
  22. package/src/assistant/locales/de-DE.json +4 -1
  23. package/src/assistant/locales/en-US.json +4 -1
  24. package/src/assistant/locales/es-ES.json +4 -1
  25. package/src/assistant/locales/ja-JP.json +4 -1
  26. package/src/assistant/locales/zh-CN.json +4 -1
  27. package/src/assistant/locales/zh-TW.json +4 -1
  28. package/src/assistant/mention-autocomplete.ts +69 -0
  29. package/src/assistant/prompts.ts +7 -0
  30. package/src/assistant/results.ts +20 -86
  31. package/src/assistant/store.ts +319 -12
  32. package/src/assistant/structures.ts +7 -5
  33. package/src/assistant/tasks.ts +3 -5
  34. package/src/assistant/workspace-bridge.ts +1 -1
  35. package/src/composables/use-document-actions.ts +38 -20
  36. package/src/composables/use-file-tree-controller.ts +7 -12
  37. package/src/composables/use-workbench-history.ts +2 -4
  38. package/src/composables/use-workbench-modals.ts +6 -1
  39. package/src/composables/use-workbench-outline.ts +0 -5
  40. package/src/composables/use-workbench-shortcuts.ts +26 -22
  41. package/src/data-tables/data-tables.ts +1 -2
  42. package/src/documents/components/DocumentHistoryPanel.vue +3 -1
  43. package/src/features.ts +1 -0
  44. package/src/fonts/Inter-Latin-Italic.woff2 +0 -0
  45. package/src/fonts/Inter-Latin.woff2 +0 -0
  46. package/src/fonts/TanoUISansSC-Bold.woff2 +0 -0
  47. package/src/fonts/TanoUISansSC-Medium.woff2 +0 -0
  48. package/src/fonts/TanoUISansSC-Regular.woff2 +0 -0
  49. package/src/help/help-milestones.ts +3 -5
  50. package/src/i18n/locales/de-DE.json +349 -3
  51. package/src/i18n/locales/en-US.json +349 -2
  52. package/src/i18n/locales/es-ES.json +349 -3
  53. package/src/i18n/locales/ja-JP.json +348 -2
  54. package/src/i18n/locales/zh-TW.json +348 -2
  55. package/src/mail/components/MailAccountDialog.vue +449 -0
  56. package/src/mail/components/MailComposerDialog.vue +325 -0
  57. package/src/mail/components/MailProviderIcon.vue +30 -0
  58. package/src/mail/components/MailWorkspaceView.vue +820 -0
  59. package/src/mail/components/SidebarMail.vue +133 -0
  60. package/src/mail/mail-avatar.ts +17 -0
  61. package/src/mail/mail-bridge.ts +68 -0
  62. package/src/mail/mail-calendar.ts +208 -0
  63. package/src/mail/mail-markdown.ts +195 -0
  64. package/src/mail/types.ts +226 -0
  65. package/src/objects/components/ObjectDetailModal.vue +1001 -0
  66. package/src/objects/workspace-objects.ts +1 -1
  67. package/src/plan-sync/types.ts +6 -3
  68. package/src/plans/calendar-interaction.ts +194 -0
  69. package/src/plans/calendar.ts +63 -7
  70. package/src/plans/components/CalendarDayPopover.vue +172 -39
  71. package/src/plans/components/CalendarView.vue +1736 -276
  72. package/src/plans/components/PlanArchiveDialog.vue +295 -0
  73. package/src/plans/components/PlanDateField.vue +6 -4
  74. package/src/plans/components/PlanDetailPanel.vue +227 -32
  75. package/src/plans/components/PlanEventList.vue +16 -4
  76. package/src/plans/components/SidebarPlan.vue +22 -15
  77. package/src/plans/components/TaskRepeatControls.vue +169 -30
  78. package/src/plans/local-reminders.ts +149 -0
  79. package/src/plans/personal-plans.ts +10 -1
  80. package/src/plans/plan-date.ts +8 -1
  81. package/src/plans/plan-migration.ts +95 -0
  82. package/src/plans/recurrence.ts +95 -0
  83. package/src/plans/task-repeat.ts +8 -8
  84. package/src/plans/timeline-layout.ts +92 -0
  85. package/src/plugins/assistant-bridge.ts +520 -0
  86. package/src/plugins/attachment-reader.ts +3 -1
  87. package/src/plugins/cache-storage.ts +42 -2
  88. package/src/plugins/components/PluginAutomations.vue +3 -3
  89. package/src/plugins/components/PluginCatalogBrowser.vue +17 -8
  90. package/src/plugins/components/PluginChangeSummary.vue +16 -3
  91. package/src/plugins/components/PluginConnections.vue +1 -1
  92. package/src/plugins/components/PluginCustomView.vue +2 -2
  93. package/src/plugins/components/PluginDetailPage.vue +129 -54
  94. package/src/plugins/components/PluginDocumentSlot.vue +63 -0
  95. package/src/plugins/components/PluginExplorer.vue +15 -21
  96. package/src/plugins/components/PluginImportDialog.vue +410 -0
  97. package/src/plugins/components/PluginInstaller.vue +39 -145
  98. package/src/plugins/components/PluginListItem.vue +3 -0
  99. package/src/plugins/components/PluginMaintenance.vue +21 -6
  100. package/src/plugins/components/PluginRuntimePanel.vue +3 -3
  101. package/src/plugins/components/PluginSettingsForm.vue +111 -0
  102. package/src/plugins/components/PluginStatusBar.vue +161 -0
  103. package/src/plugins/components/PluginSurface.vue +18 -6
  104. package/src/plugins/components/PluginUiDialog.vue +452 -0
  105. package/src/plugins/excalidraw/bundle.tano-plugin.json +1 -1
  106. package/src/plugins/excalidraw/manifest.json +12 -1
  107. package/src/plugins/host.ts +662 -43
  108. package/src/plugins/native.ts +2 -10
  109. package/src/plugins/overlay-mapping.ts +125 -0
  110. package/src/plugins/packages.ts +73 -1
  111. package/src/plugins/plugin-permissions.ts +57 -0
  112. package/src/plugins/plugin-sdk.ts +174 -8
  113. package/src/plugins/policy.ts +53 -3
  114. package/src/plugins/presentation-preview/bundle.tano-plugin.json +1 -1
  115. package/src/plugins/presentation-preview/manifest.json +2 -1
  116. package/src/plugins/queries.ts +3 -1
  117. package/src/plugins/sandbox.ts +15 -1
  118. package/src/plugins/use-plugin-actions.ts +67 -20
  119. package/src/plugins/user-plugins.ts +254 -0
  120. package/src/plugins/word-preview/bundle.tano-plugin.json +1 -1
  121. package/src/plugins/word-preview/manifest.json +13 -1
  122. package/src/plugins/workbench.ts +175 -2
  123. package/src/plugins/worker.js +105 -8
  124. package/src/plugins/workspace-plugin-runtime.ts +23 -7
  125. package/src/plugins/workspace-plugins.ts +212 -21
  126. package/src/runtime.ts +101 -3
  127. package/src/settings/components/SettingsAppearancePage.vue +46 -0
  128. package/src/settings/components/SettingsDocumentsPage.vue +0 -1
  129. package/src/settings/components/settings-search.ts +2 -3
  130. package/src/shell/components/SidebarNavigation.vue +22 -2
  131. package/src/shell/components/WorkbenchContextMenus.vue +21 -8
  132. package/src/shell/components/WorkbenchModals.vue +27 -46
  133. package/src/shell/components/WorkbenchPanes.vue +267 -84
  134. package/src/shell/components/WorkspaceBreadcrumb.vue +6 -14
  135. package/src/shell/components/WorkspaceViewSwitcher.vue +12 -7
  136. package/src/shell/use-workbench.ts +116 -145
  137. package/src/shell/workbench-async-components.ts +14 -5
  138. package/src/stores/mail.ts +414 -0
  139. package/src/stores/plan-sync.ts +2 -1
  140. package/src/stores/plans.ts +2 -9
  141. package/src/stores/workspace-knowledge.ts +1 -113
  142. package/src/stores/workspace-plugins-state.ts +537 -14
  143. package/src/stores/workspace-tabs-layout.ts +5 -43
  144. package/src/stores/workspace.ts +69 -66
  145. package/src/styles/agent-diff-modals.css +0 -7
  146. package/src/styles/dark-theme.css +3 -3
  147. package/src/styles/inspector.css +0 -59
  148. package/src/styles/layout-themes.css +346 -0
  149. package/src/styles/mail.css +1568 -0
  150. package/src/styles/mobile.css +2 -2
  151. package/src/styles/recent-and-media.css +0 -17
  152. package/src/styles/theme-contract.css +3 -3
  153. package/src/styles/workbench-shell.css +110 -17
  154. package/src/styles/workspace-states.css +9 -33
  155. package/src/styles.css +1 -1
  156. package/src/tabs/components/DesktopTabs.vue +0 -3
  157. package/src/tabs/components/NewTabPicker.vue +10 -4
  158. package/src/tabs/tab-label.ts +0 -1
  159. package/src/workspace/components/WorkspaceGeneralSettings.vue +0 -13
  160. package/src/workspace/components/WorkspaceIconPicker.vue +28 -6
  161. package/src/workspace/workspace-comments.ts +11 -151
  162. package/src/workspace/workspace-welcome.ts +1 -1
  163. package/src/documents/components/FormulaMenu.vue +0 -50
  164. package/src/files/components/FileDatabasePage.vue +0 -152
  165. package/src/files/components/FolderHomeIcon.vue +0 -12
  166. package/src/objects/components/ObjectDatabasePage.vue +0 -100
  167. package/src/objects/components/ObjectPanel.vue +0 -554
  168. package/src/plans/components/PersonalPlanDialog.vue +0 -105
  169. package/src/shell/components/WorkspaceViewPage.vue +0 -127
  170. package/src/shell/components/WorkspaceViewTab.vue +0 -24
  171. package/src/styles/object-panel.css +0 -163
  172. package/src/workspace/components/GitInspectionPanel.vue +0 -35
  173. package/src/workspace/components/WorkspaceSyncPanel.vue +0 -50
  174. package/src/workspace/welcome-slogans.ts +0 -11
  175. package/src/workspace/workspace-git.ts +0 -35
  176. package/src/workspace/workspace-sync.ts +0 -46
  177. package/src/workspace/workspace-views.ts +0 -48
@@ -1,151 +1,11 @@
1
- import {
2
- commentDataPath,
3
- emptyCommentFile,
4
- parseCommentFile,
5
- rebaseCommentMentions,
6
- } from '@tano/protocol';
7
- import type {
8
- CommentAnchor,
9
- CommentFile,
10
- CommentKind,
11
- CommentMessage,
12
- CommentMention,
13
- CommentThread,
14
- WorkspaceAdapter,
15
- Workspace,
16
- } from '@tano/protocol';
17
-
18
- export interface CommentAuthor { id: string; name: string }
19
- export type CommentStorage = Pick<WorkspaceAdapter, 'refresh' | 'read' | 'write' | 'create'>;
20
- export interface CommentMessageEdit { messageId: string; expectedBody: string; body: string; mentions?: CommentMention[] }
21
- export interface CommentMessageRemoval {
22
- messageId: string;
23
- expectedBody: string;
24
- expectedMessages?: { id: string; body: string }[];
25
- }
26
- const pendingWrites = new WeakMap<CommentStorage, Map<string, Promise<unknown>>>();
27
- export type CommentChange =
28
- | { type: 'start'; id: string; body: string; author: CommentAuthor; anchor?: CommentAnchor; mentions?: CommentMention[]; agentTaskId?: string }
29
- | { type: 'reply'; threadId: string; id: string; body: string; author: CommentAuthor; replyTo?: string; mentions?: CommentMention[]; agentTaskId?: string }
30
- | { type: 'resolve'; threadId: string; resolved: boolean }
31
- | ({ type: 'edit'; threadId: string; authorId: string } & CommentMessageEdit)
32
- | ({ type: 'delete'; threadId: string; authorId: string } & CommentMessageRemoval)
33
- | { type: 'reanchor'; threadId: string; expectedBaseHash: string; anchor: CommentAnchor | null };
34
-
35
- function message(id: string, body: string, author: CommentAuthor, mentions?: CommentMention[], replyTo?: string): CommentMessage {
36
- return { id, body: body.trim(), authorId: author.id, authorName: author.name, createdAt: Date.now(),
37
- ...(mentions?.length ? { mentions: rebaseCommentMentions(mentions, body, body.trim()) } : {}), ...(replyTo ? { replyTo } : {}) };
38
- }
39
-
40
- /** Each edit is reapplied to the newest file, so independent replies survive a CAS conflict. */
41
- export function applyCommentChange(file: CommentFile, change: CommentChange): CommentFile {
42
- const next = structuredClone(file);
43
- if (change.type === 'start') {
44
- if (next.threads.some(thread => thread.id === change.id)) return next;
45
- if (!change.body.trim()) throw new Error('请输入评论内容');
46
- if (next.kind === 'annotation' && !change.anchor) throw new Error('请先选择要批注的内容');
47
- if (next.kind === 'discussion' && change.anchor) throw new Error('整篇讨论不需要局部锚点');
48
- const createdAt = Date.now();
49
- next.threads.push({ id: change.id, ...(change.anchor ? { anchor: change.anchor } : {}),
50
- messages: [{ ...message(change.id, change.body, change.author, change.mentions),
51
- ...(change.agentTaskId ? { agentTaskId: change.agentTaskId } : {}) }], resolved: false,
52
- detached: false, createdAt });
53
- } else {
54
- const thread = next.threads.find(item => item.id === change.threadId);
55
- if (!thread && change.type === 'delete') return next;
56
- if (!thread) throw new Error('评论已被移除,请刷新后重试');
57
- if (change.type === 'reply') {
58
- if (thread.messages.some(item => item.id === change.id)) return next;
59
- if (!change.body.trim()) throw new Error('请输入回复内容');
60
- thread.messages.push({ ...message(change.id, change.body, change.author, change.mentions, change.replyTo),
61
- ...(change.agentTaskId ? { agentTaskId: change.agentTaskId } : {}) });
62
- } else if (change.type === 'resolve') thread.resolved = change.resolved;
63
- else if (change.type === 'edit' || change.type === 'delete') {
64
- const index = thread.messages.findIndex(item => item.id === change.messageId);
65
- const current = thread.messages[index];
66
- if (!current && change.type === 'delete') return next;
67
- if (!current) throw new Error('评论已被移除,请刷新后重试');
68
- if (current.authorId !== change.authorId) throw new Error('只能编辑或删除自己发表的评论');
69
- if (current.body !== change.expectedBody) throw new Error('评论已由其他编辑更新,请刷新后重试;输入内容仍保留');
70
- if (change.type === 'edit') {
71
- if (!change.body.trim()) throw new Error('请输入评论内容');
72
- current.mentions = change.mentions === undefined
73
- ? rebaseCommentMentions(current.mentions ?? [], current.body, change.body.trim())
74
- : rebaseCommentMentions(change.mentions, change.body, change.body.trim());
75
- current.body = change.body.trim();
76
- current.updatedAt = Date.now();
77
- } else if (index === 0) {
78
- if (!change.expectedMessages || change.expectedMessages.length !== thread.messages.length ||
79
- thread.messages.some((item, i) => item.id !== change.expectedMessages![i]?.id ||
80
- item.body !== change.expectedMessages![i]?.body))
81
- throw new Error('评论或回复已变化,请刷新后重新确认删除');
82
- next.threads = next.threads.filter(item => item.id !== thread.id);
83
- } else {
84
- thread.messages.splice(index, 1);
85
- for (const item of thread.messages) if (item.replyTo === change.messageId) delete item.replyTo;
86
- }
87
- }
88
- else {
89
- if (!thread.anchor || thread.anchor.baseHash !== change.expectedBaseHash)
90
- throw new Error('批注锚点已由其他编辑更新,请刷新后重试');
91
- if (change.anchor) thread.anchor = change.anchor;
92
- thread.detached = !change.anchor;
93
- }
94
- }
95
- return parseCommentFile(JSON.stringify(next), next.kind, next.fileId);
96
- }
97
-
98
- export async function loadCommentFile(adapter: CommentStorage, kind: CommentKind, fileId: string, workspaceSnapshot?: Workspace) {
99
- const path = commentDataPath(kind, fileId);
100
- const workspace = workspaceSnapshot ?? await adapter.refresh();
101
- if (!workspace.files.some(file => file.kind === 'file' && file.path === path))
102
- return { file: emptyCommentFile(kind, fileId), hash: null as string | null };
103
- const snapshot = await adapter.read(path);
104
- return { file: parseCommentFile(snapshot.content, kind, fileId), hash: snapshot.hash };
105
- }
106
-
107
- export async function saveCommentChange(
108
- adapter: CommentStorage,
109
- kind: CommentKind,
110
- fileId: string,
111
- change: CommentChange,
112
- ) {
113
- const path = commentDataPath(kind, fileId);
114
- let queued = pendingWrites.get(adapter);
115
- if (!queued) { queued = new Map(); pendingWrites.set(adapter, queued); }
116
- const previous = queued.get(path);
117
- const save = async () => {
118
- await previous?.catch(() => {});
119
- return writeCommentChange(adapter, kind, fileId, path, change);
120
- };
121
- const result = save();
122
- queued.set(path, result);
123
- try { return await result; }
124
- finally { if (queued.get(path) === result) queued.delete(path); }
125
- }
126
-
127
- async function writeCommentChange(
128
- adapter: CommentStorage, kind: CommentKind, fileId: string, path: string, change: CommentChange,
129
- ) {
130
- for (let attempt = 0; attempt < 5; attempt++) {
131
- const current = await loadCommentFile(adapter, kind, fileId);
132
- const updated = applyCommentChange(current.file, change);
133
- const content = `${JSON.stringify(updated, null, 2)}\n`;
134
- if (current.hash) {
135
- const result = await adapter.write(path, content, current.hash);
136
- if (result.status === 'saved') return updated;
137
- if (result.status === 'missing') continue;
138
- } else {
139
- try { await adapter.create(path, content); return updated; }
140
- catch (error) {
141
- const refreshed = await adapter.refresh();
142
- if (!refreshed.files.some(file => file.path === path)) throw error;
143
- }
144
- }
145
- }
146
- throw new Error('评论同时被修改,请稍后重试;输入内容仍保留');
147
- }
148
-
149
- export function visibleThreads(file: CommentFile): CommentThread[] {
150
- return file.threads.filter(thread => !thread.detached);
151
- }
1
+ export {
2
+ applyCommentChange,
3
+ loadCommentFile,
4
+ saveCommentChange,
5
+ visibleThreads,
6
+ type CommentAuthor,
7
+ type CommentChange,
8
+ type CommentMessageEdit,
9
+ type CommentMessageRemoval,
10
+ type CommentStorage,
11
+ } from '@tano/protocol/workspace-comments';
@@ -24,7 +24,7 @@ ${storage}
24
24
  - [ ] 点击左侧工作区名称旁的「新建文档」按钮,创建你的第一篇笔记。
25
25
  - [ ] 点击侧栏的搜索按钮,查找刚刚写下的内容。
26
26
  - [ ] 勾选一个方框,记录你已经完成的步骤。
27
- - [ ] 在工作区对象面板中查看文件资源,确认文档和附件仍是普通文件。
27
+ - [ ] 在文档中输入 \`@\` 引用人物、任务、文档或附件,确认文档和附件仍是普通文件。
28
28
  - [ ] 打开关系图,沿着稳定身份从文件回到对象,再回到原始文件。
29
29
 
30
30
  ## 让想法自然成形
@@ -1,50 +0,0 @@
1
- <script setup lang="ts">
2
- import { useWindowContext } from '../../windows/context';
3
- const { window, document } = useWindowContext();
4
-
5
- import { vSurfaceMotion } from '@tano/editor/surface-motion';
6
- import { t } from '../../i18n/i18n';
7
- import { onBeforeUnmount, onMounted, ref } from 'vue';
8
- import { Sigma } from 'lucide-vue-next';
9
-
10
- defineProps<{ disabled?: boolean }>();
11
- const emit = defineEmits<{ insert: [command: 'math' | 'math-block'] }>();
12
- const open = ref(false);
13
- const root = ref<HTMLElement>();
14
- const trigger = ref<HTMLButtonElement>();
15
- function closeOutside(event: MouseEvent) {
16
- if (!root.value?.contains(event.target as Node)) open.value = false;
17
- }
18
- function insert(command: 'math' | 'math-block') {
19
- open.value = false;
20
- emit('insert', command);
21
- }
22
- function escape() {
23
- open.value = false;
24
- trigger.value?.focus();
25
- }
26
- onMounted(() => window.addEventListener('click', closeOutside));
27
- onBeforeUnmount(() => window.removeEventListener('click', closeOutside));
28
-
29
- </script>
30
-
31
- <template>
32
- <div ref="root" class="menu-wrap" @keydown.esc.stop.prevent="escape">
33
- <button
34
- ref="trigger"
35
- class="icon-button"
36
- :aria-label="t('插入公式')"
37
- :data-tooltip="t('插入 LaTeX 公式')"
38
- :aria-expanded="open && !disabled"
39
- :disabled="disabled"
40
- @mousedown.prevent
41
- @click="open = !open"
42
- >
43
- <Sigma :size="17" />
44
- </button>
45
- <div v-surface-motion="'FormulaMenu:0'" v-if="open && !disabled" class="dropdown document-dropdown">
46
- <button @mousedown.prevent @click="insert('math')">{{ t('行内公式 · $…$') }}</button>
47
- <button @mousedown.prevent @click="insert('math-block')">{{ t('公式块 · $$…$$') }}</button>
48
- </div>
49
- </div>
50
- </template>
@@ -1,152 +0,0 @@
1
- <script setup lang="ts">
2
- import { useWindowContext } from '../../windows/context';
3
- const { window, document } = useWindowContext();
4
-
5
- import LoadingSkeleton from '../../shell/components/LoadingSkeleton.vue';
6
- import { computed, ref, watch } from 'vue';
7
- import { Database, Filter, Save, SlidersHorizontal } from 'lucide-vue-next';
8
- import { emptyFileMetadata, fileMetadataPath, queryFileDatabase, groupFileDatabase, isMarkdown } from '@tano/protocol';
9
- import type { FileEntry, FileMetadata, WorkspaceViewDefinition } from '@tano/protocol';
10
- import { useWorkspaceStore } from '../../stores/workspace';
11
- import FileMetadataPanel from './FileMetadataPanel.vue';
12
- import DocumentScrollbar from '../../documents/components/DocumentScrollbar.vue';
13
- import { t } from '../../i18n/i18n';
14
- const props = defineProps<{ view: WorkspaceViewDefinition }>();
15
- const emit = defineEmits<{ 'open-file': [file: FileEntry]; 'edit-document-properties': [file: FileEntry] }>();
16
- const store = useWorkspaceStore();
17
- const scrollElement = ref<HTMLElement>();
18
- const draft = ref(JSON.parse(JSON.stringify(props.view)) as WorkspaceViewDefinition);
19
- const base = ref(store.workspaceViews.find(record => record.view.id === props.view.id)?.snapshot);
20
- const query = computed(() => draft.value.database!);
21
- // Compare parsed data: portable JSON may be indented or have different property order.
22
- const changed = computed(() => !base.value || JSON.stringify(draft.value) !== JSON.stringify(JSON.parse(base.value.content)));
23
- const error = ref(''); const loading = ref(false); const saving = ref(false); const selected = ref('');
24
- const metadata = ref<Record<string, FileMetadata>>({});
25
- const referenceCounts = ref<Record<string, number>>({});
26
- const errors = ref<string[]>([]);
27
- const files = computed(() => store.workspace?.id === props.view.workspaceId ? store.fileRegistry?.userFiles() ?? [] : []);
28
- const rows = computed(() => files.value.map(file => ({ file, metadata: metadata.value[file.id] ?? emptyFileMetadata(file.id) })));
29
- const results = computed(() => queryFileDatabase(rows.value, query.value));
30
- const groups = computed(() => groupFileDatabase(results.value, query.value.groupBy));
31
- const fields = computed(() => [
32
- { key: 'path', label: '路径' }, { key: 'name', label: '名称' }, { key: 'type', label: '格式' },
33
- { key: 'tags', label: '标签' }, { key: 'property:owner', label: '负责人' }, { key: 'property:status', label: '状态' },
34
- { key: 'size', label: '大小' }, { key: 'modified', label: '修改时间' },
35
- ...[...new Set(Object.values(metadata.value).flatMap(m => Object.keys(m.properties)))].filter(k => !['owner', 'status'].includes(k)).sort().map(key => ({ key: `property:${key}`, label: key })),
36
- ]);
37
- const external = computed(() => store.workspaceViews.find(record => record.view.id === props.view.id));
38
- const stale = computed(() => external.value?.snapshot.hash !== base.value?.hash);
39
- function reload() {
40
- if (!external.value) return;
41
- draft.value = JSON.parse(JSON.stringify(external.value.view)); base.value = external.value.snapshot; error.value = '';
42
- }
43
- watch(() => props.view, () => { if (!changed.value) reload(); });
44
- watch(() => [props.view.workspaceId, files.value.map(f => `${f.id}:${f.path}:${f.contentHash ?? f.modified}`).join(','), store.referenceRevision, store.workspace?.files.filter(f => f.path.startsWith('.tano/files/')).map(f => `${f.path}:${f.contentHash ?? f.modified}`).join(',')], async (_, _old, onCleanup) => {
45
- let current = true; onCleanup(() => { current = false; }); loading.value = true;
46
- const next: Record<string, FileMetadata> = {}; const failures: string[] = [];
47
- const counts: Record<string, number> = {};
48
- const paths = new Set(store.workspace?.files.map(entry => entry.path));
49
- for (const file of files.value) {
50
- if (!isMarkdown(file.path) && !paths.has(fileMetadataPath(file.id))) continue;
51
- try { const state = await store.readFileMetadata(file.id, props.view.workspaceId); next[file.id] = state.file; if (state.referenceCount !== undefined) counts[file.id] = state.referenceCount; }
52
- catch (reason) { failures.push(`${file.path}: ${String(reason)}`); }
53
- if (!current) return;
54
- }
55
- metadata.value = next; referenceCounts.value = counts; errors.value = failures; loading.value = false;
56
- }, { immediate: true });
57
- async function save() {
58
- if (!base.value) return;
59
- saving.value = true; error.value = '';
60
- try { base.value = await store.saveFileDatabase(JSON.parse(JSON.stringify(draft.value)), base.value); }
61
- catch (reason) { error.value = String(reason); } finally { saving.value = false; }
62
- }
63
- function linkCount(id: string) {
64
- if (files.value.some(file => file.id === id && isMarkdown(file.path))) return referenceCounts.value[id] ?? 0;
65
- return store.relations.filter(row => [row.source, row.target].some(e => ['asset', 'document'].includes(e.type) && e.id === id)).length;
66
- }
67
- function editProperties(file: FileEntry) {
68
- if (isMarkdown(file.path)) emit('edit-document-properties', file);
69
- else selected.value = file.id;
70
- }
71
-
72
- </script>
73
- <template>
74
- <div class="file-database-shell">
75
- <main ref="scrollElement" class="file-database" :aria-label="view.name"><div class="database-content">
76
- <header><div class="database-heading"><Database :size="22" /><h1><input v-model="draft.name" :aria-label="t('视图名称')" maxlength="200" required /></h1><span class="database-count">{{ results.length }} / {{ files.length }} {{ t('个文件') }}</span></div><p>{{ query.directory || t('工作区根目录') }} · {{ t('直接查询原文件,不复制源文件') }}</p></header>
77
- <form class="database-query" @submit.prevent="save">
78
- <label class="checkbox"><input v-model="query.recursive" type="checkbox" />{{ t('包含子目录') }}</label>
79
- <div v-for="(filter, index) in query.filters" :key="index" class="filter-row">
80
- <select v-model="filter.field" :aria-label="t('筛选字段')"><option v-for="field in fields" :key="field.key" :value="field.key">{{ t(field.label) }}</option></select>
81
- <select v-model="filter.operator" :aria-label="t('筛选条件')"><option value="contains">{{ t('包含') }}</option><option value="equals">{{ t('等于') }}</option><option value="empty">{{ t('为空') }}</option></select>
82
- <input v-if="filter.operator !== 'empty'" v-model="filter.value" :aria-label="t('筛选值')" maxlength="1000" />
83
- <button type="button" :aria-label="t('移除筛选')" @click="query.filters.splice(index, 1)">×</button>
84
- </div>
85
- <div class="query-actions">
86
- <button type="button" :disabled="query.filters.length >= 20" @click="query.filters.push({ field: 'path', operator: 'contains', value: '' })"><Filter :size="14" />{{ t('添加筛选') }}</button>
87
- <label>{{ t('排序') }}<select v-model="query.sort.field" :aria-label="t('排序')"><option v-for="field in fields" :key="field.key" :value="field.key">{{ t(field.label) }}</option></select></label>
88
- <select v-model="query.sort.direction" :aria-label="t('排序方向')"><option value="asc">{{ t('升序') }}</option><option value="desc">{{ t('降序') }}</option></select>
89
- <label>{{ t('分组') }}<select v-model="query.groupBy" :aria-label="t('分组')"><option value="">{{ t('不分组') }}</option><option v-for="field in fields" :key="field.key" :value="field.key">{{ t(field.label) }}</option></select></label>
90
- <button type="submit" :disabled="saving || !changed || store.workspace?.readOnly"><Save :size="14" />{{ saving ? t('保存中…') : t('保存视图') }}</button>
91
- <span v-if="changed">{{ t('设置尚未保存') }}</span>
92
- </div>
93
- </form>
94
- <p v-if="stale" role="status">{{ t('视图已在外部更新,当前设置仍保留。') }}<button @click="reload">{{ t('丢弃当前设置并重新载入') }}</button></p>
95
- <p v-if="error" role="alert">{{ error }}</p>
96
- <LoadingSkeleton v-if="loading" :rows="4" />
97
- <p v-for="message in errors" :key="message" role="alert">{{ message }}</p>
98
- <p v-if="!results.length && !loading">{{ t('没有符合条件的文件,请调整筛选或向目录添加文件。') }}</p>
99
- <section v-for="group in groups" :key="group.name">
100
- <h2 v-if="query.groupBy">{{ group.name || t('未设置') }} <small>{{ group.rows.length }}</small></h2>
101
- <div class="database-scroll panel-scrollbar"><table><colgroup><col class="column-file" /><col class="column-format" /><col class="column-tags" /><col class="column-owner" /><col class="column-status" /><col class="column-links" /><col class="column-actions" /></colgroup><thead><tr><th>{{ t('文件') }}</th><th>{{ t('格式') }}</th><th>{{ t('标签') }}</th><th>{{ t('负责人') }}</th><th>{{ t('状态') }}</th><th>{{ t('关联') }}</th><th>{{ t('属性') }}</th></tr></thead>
102
- <tbody><tr v-for="row in group.rows" :key="row.file.id" :data-file-id="row.file.id">
103
- <td :title="row.file.path"><button class="file-link" @click="emit('open-file', row.file)">{{ row.file.name }}</button><small>{{ row.file.path }}</small></td><td>{{ row.file.handlerId }}</td><td :title="row.metadata.tags.join(' · ')">{{ row.metadata.tags.join(' · ') || '—' }}</td><td :title="String(row.metadata.properties.owner ?? '')">{{ row.metadata.properties.owner ?? '—' }}</td><td :title="String(row.metadata.properties.status ?? '')">{{ row.metadata.properties.status ?? '—' }}</td><td>{{ linkCount(row.file.id) }}</td><td><button class="row-properties" :aria-label="`${t('编辑属性')}:${row.file.name}`" :title="isMarkdown(row.file.path) ? t('在文档中编辑属性') : t('编辑属性')" @click="editProperties(row.file)"><SlidersHorizontal :size="15" /></button></td>
104
- </tr></tbody></table></div>
105
- </section>
106
- <Teleport :to="document.body"><FileMetadataPanel v-if="selected" :file-id="selected" :workspace-id="view.workspaceId" @close="selected = ''" /></Teleport>
107
- </div></main>
108
- <DocumentScrollbar :scroll-element="scrollElement" />
109
- </div>
110
- </template>
111
- <style scoped>
112
- .file-database-shell { display: flex; height: 100%; min-height: 0; overflow: hidden; background: var(--paper); }
113
- .file-database { flex: 1; height: 100%; min-width: 0; box-sizing: border-box; overflow: auto; padding: 22px 28px 24px; background: var(--paper); color: var(--text); }
114
- .database-heading { display: flex; align-items: center; gap: 10px; }
115
- .database-heading > svg { flex: none; color: var(--muted); }
116
- h1 { flex: 1; min-width: 0; margin: 0; font-size: 23px; font-weight: 600; }
117
- h1 input { width: 100%; min-width: 0; font-size: inherit; font-weight: inherit; border-color: transparent; padding: 3px; background: transparent; }
118
- header p { margin: 8px 0 14px 35px; color: var(--muted); font-size: 12px; line-height: 1.5; }
119
- .database-count { color: var(--muted); white-space: nowrap; font-size: 11px; }
120
- .database-query { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 0 0 14px; padding: 8px 0 12px; border-bottom: 1px solid var(--line); }
121
- label, .query-actions, .filter-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; }
122
- label { color: var(--muted); }
123
- .filter-row { flex-basis: 100%; }
124
- input, select, button { color: var(--text); background: transparent; border: 1px solid transparent; border-radius: 5px; padding: 5px 7px; font: inherit; }
125
- button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; cursor: pointer; font-size: 12px; }
126
- button:not(:disabled):hover, select:hover { background: var(--hover); }
127
- button:disabled { opacity: .45; cursor: default; }
128
- input { max-width: 100%; box-sizing: border-box; }
129
- .filter-row input, .filter-row select { border-color: var(--line); background: var(--paper); }
130
- input[type=checkbox] { accent-color: var(--green); margin: 0; }
131
- input:focus-visible, select:focus-visible, button:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
132
- .query-actions > span { color: var(--muted); font-size: 11px; }
133
- .database-scroll { overflow-x: auto; }
134
- table { width: 100%; min-width: 900px; table-layout: fixed; border-collapse: collapse; font-size: 12px; text-align: left; }
135
- th, td { padding: 8px 9px; border-bottom: 1px solid var(--line); border-right: 1px solid color-mix(in srgb, var(--line) 65%, transparent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
136
- .column-file { width: 32%; }
137
- .column-format { width: 100px; }
138
- .column-owner, .column-status { width: 110px; }
139
- .column-links { width: 64px; }
140
- .column-actions { width: 50px; }
141
- th:last-child, td:last-child { border-right: 0; }
142
- th { color: var(--muted); font-weight: 400; white-space: nowrap; background: var(--paper); }
143
- tbody tr:hover { background: var(--sidebar); }
144
- td small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
145
- .file-link { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; justify-content: flex-start; padding: 0; border: 0; background: transparent; color: var(--text); text-align: left; }
146
- .file-link:hover { color: var(--text); text-decoration: underline; background: transparent !important; }
147
- .row-properties { color: var(--muted); padding: 5px; }
148
- h2 { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; margin: 18px 0 8px; }
149
- h2 small { color: var(--muted); font-size: 11px; font-weight: 400; }
150
- [role=alert] { color: var(--danger); font-size: 13px; }
151
- @media(max-width: 620px) { .file-database { padding: 16px 12px 20px; } h1 { font-size: 18px; } .database-heading { flex-wrap: wrap; } .database-count { margin-left: 32px; } header p { margin-left: 32px; } .filter-row input { width: 100%; } .database-query { gap: 10px; } }
152
- </style>
@@ -1,12 +0,0 @@
1
- <script setup lang="ts">
2
- import ResourceIcon from './ResourceIcon.vue';
3
- withDefaults(defineProps<{ path?: string; expanded?: boolean }>(), { path: '' });
4
- </script>
5
-
6
- <template>
7
- <ResourceIcon class="folder-home-icon" :path="path" kind="directory" :folder-home="true" :expanded="expanded" />
8
- </template>
9
-
10
- <style scoped>
11
- .folder-home-icon { position: relative; display: inline-flex; width: 16px; height: 16px; }
12
- </style>
@@ -1,100 +0,0 @@
1
- <script setup lang="ts">
2
- import { useWindowContext } from '../../windows/context';
3
- const { window, document } = useWindowContext();
4
-
5
- import { computed, ref, watch } from 'vue';
6
- import { objectViewText, objectViewValue, referenceKey, viewEngine } from '@tano/protocol';
7
- import type { WorkspaceObject, WorkspaceViewDefinition, ReferenceIdentity, ObjectViewLayout } from '@tano/protocol';
8
- import { useWorkspaceStore } from '../../stores/workspace';
9
- import { t } from '../../i18n/i18n';
10
- import ObjectPanel from './ObjectPanel.vue';
11
- const props = defineProps<{ view: WorkspaceViewDefinition }>();
12
- const emit = defineEmits<{ 'open-object': [identity: ReferenceIdentity] }>();
13
- const store = useWorkspaceStore();
14
- const draft = ref(JSON.parse(JSON.stringify(props.view)) as WorkspaceViewDefinition);
15
- const base = ref(store.workspaceViews.find(record => record.view.id === props.view.id)?.snapshot);
16
- const query = computed(() => draft.value.objectDatabase!);
17
- const dirty = computed(() => !base.value || JSON.stringify(draft.value) !== JSON.stringify(JSON.parse(base.value.content)));
18
- const latest = computed(() => store.workspaceViews.find(record => record.view.id === props.view.id));
19
- const stale = computed(() => latest.value?.snapshot.hash !== base.value?.hash);
20
- const error = ref(''); const busy = ref(false); const panel = ref<{ id?: string; type?: string }>();
21
- const writable = computed(() => store.workspace?.id === props.view.workspaceId && !store.workspace?.readOnly && store.capabilities.features.objectReferences);
22
- const records = computed(() => store.workspace?.id === props.view.workspaceId ? store.objects : []);
23
- const projection = computed(() => viewEngine.query(records.value.map(record => record.object), query.value, store.relations));
24
- const types = computed(() => store.objectDefinitions.filter(type => type.storage === 'record' && !type.retired));
25
- const fields = computed(() => {
26
- const names = new Map([['name', '名称'], ['type', '类型'], ['description', '描述'], ['archived', '归档'], ['property:status', '状态']]);
27
- for (const type of types.value) for (const field of type.fields) names.set(`property:${field.key}`, field.label);
28
- for (const record of records.value) for (const key of Object.keys(record.object.properties)) if (key.length > 0 && key.length <= 100 && !names.has(`property:${key}`)) names.set(`property:${key}`, key);
29
- return [...names].map(([key, label]) => ({ key, label }));
30
- });
31
- const statuses = computed(() => [...new Set(['待处理', '进行中', '已完成', ...records.value.map(r => objectViewText(r.object.properties.status)).filter(Boolean)])]);
32
- const layouts: { id: ObjectViewLayout; label: string }[] = [{ id: 'table', label: '表格' }, { id: 'board', label: '看板' }, { id: 'gallery', label: '画廊' }];
33
- const relationTarget = computed({ get: () => query.value.relatedTo ? referenceKey(query.value.relatedTo) : '', set: value => {
34
- const target = store.referenceTargets.find(target => referenceKey(target) === value);
35
- if (target) query.value.relatedTo = { type: target.type, id: target.id }; else delete query.value.relatedTo;
36
- } });
37
- function reload() { if (latest.value) { draft.value = JSON.parse(JSON.stringify(latest.value.view)); base.value = latest.value.snapshot; error.value = ''; } }
38
- watch(() => props.view, () => { if (!dirty.value) reload(); });
39
- async function save() {
40
- if (!base.value || busy.value) return;
41
- busy.value = true; error.value = '';
42
- try { base.value = await store.saveFileDatabase(JSON.parse(JSON.stringify(draft.value)), base.value); }
43
- catch (reason) { error.value = String(reason); } finally { busy.value = false; }
44
- }
45
- function countLinks(row: WorkspaceObject) { return store.relations.filter(edge => [edge.source, edge.target].some(endpoint => referenceKey(endpoint) === referenceKey(row))).length; }
46
- function label(type: string) { return types.value.find(definition => definition.type === type)?.label ?? type; }
47
- async function setStatus(row: WorkspaceObject, event: Event) {
48
- const record = records.value.find(record => record.object.id === row.id);
49
- if (!record || !writable.value || busy.value) return;
50
- const status = (event.target as HTMLSelectElement).value;
51
- busy.value = true; error.value = '';
52
- try {
53
- const value = JSON.parse(JSON.stringify(row)) as WorkspaceObject;
54
- value.properties.status = status;
55
- if (value.type === 'task') value.properties.completed = ['已完成', 'done', 'completed'].includes(status);
56
- await store.updateObject(record, value, props.view.workspaceId);
57
- } catch (reason) { error.value = String(reason); (event.target as HTMLSelectElement).value = objectViewText(row.properties.status); }
58
- finally { busy.value = false; }
59
- }
60
-
61
- </script>
62
- <template>
63
- <main class="object-database" :aria-label="view.name">
64
- <header><div><p>{{ t('对象数据库') }}</p><h1>{{ view.name }}</h1><p>{{ t('同一批记录,多个视图;切换视图不会复制对象或关系。') }}</p></div><strong>{{ projection.rows.length }} {{ t('条记录') }}</strong></header>
65
- <nav :aria-label="t('切换对象视图')"><button v-for="layout in layouts" :key="layout.id" :aria-pressed="query.layout === layout.id" @click="query.layout = layout.id">{{ t(layout.label) }}</button></nav>
66
- <form class="query" @submit.prevent="save">
67
- <label>{{ t('视图名称') }}<input v-model="draft.name" required maxlength="200" /></label>
68
- <fieldset><legend>{{ t('对象类型') }}</legend><label v-for="type in types" :key="type.type"><input v-model="query.types" type="checkbox" :value="type.type" />{{ t(type.label) }}</label></fieldset>
69
- <label><input v-model="query.includeArchived" type="checkbox" />{{ t('包含已归档记录') }}</label>
70
- <div v-for="(filter, index) in query.filters" :key="index" class="controls">
71
- <select v-model="filter.field" :aria-label="t('筛选字段')"><option v-for="field in fields" :key="field.key" :value="field.key">{{ t(field.label) }}</option></select>
72
- <select v-model="filter.operator" :aria-label="t('筛选条件')"><option value="contains">{{ t('包含') }}</option><option value="equals">{{ t('等于') }}</option><option value="empty">{{ t('为空') }}</option></select>
73
- <input v-if="filter.operator !== 'empty'" v-model="filter.value" :aria-label="t('筛选值')" maxlength="2000" />
74
- <button type="button" :aria-label="t('移除筛选')" @click="query.filters.splice(index, 1)">×</button>
75
- </div>
76
- <div class="controls">
77
- <button type="button" :disabled="query.filters.length >= 20" @click="query.filters.push({ field: 'name', operator: 'contains', value: '' })">{{ t('添加筛选') }}</button>
78
- <label>{{ t('排序') }}<select v-model="query.sort.field" :aria-label="t('排序')"><option v-for="field in fields" :key="field.key" :value="field.key">{{ t(field.label) }}</option></select></label>
79
- <select v-model="query.sort.direction" :aria-label="t('排序方向')"><option value="asc">{{ t('升序') }}</option><option value="desc">{{ t('降序') }}</option></select>
80
- <label>{{ t('分组') }}<select v-model="query.groupBy" :aria-label="t('分组')"><option v-for="field in fields" :key="field.key" :value="field.key">{{ t(field.label) }}</option></select></label>
81
- <label>{{ t('关联到') }}<select v-model="relationTarget" :aria-label="t('关联到')"><option value="">{{ t('全部') }}</option><option v-for="target in store.referenceTargets" :key="referenceKey(target)" :value="referenceKey(target)">{{ target.name }} · {{ target.type }}</option></select></label>
82
- <button type="submit" :disabled="busy || !dirty || !writable">{{ t('保存视图') }}</button><span v-if="dirty">{{ t('设置尚未保存') }}</span>
83
- </div>
84
- </form>
85
- <p v-if="stale" role="status">{{ t('视图已在外部更新,当前设置仍保留。') }}<button @click="reload">{{ t('丢弃当前设置并重新载入') }}</button></p>
86
- <p v-if="error" role="alert">{{ error }}</p>
87
- <p v-for="message in store.objectErrors" :key="message" role="alert">{{ message }}</p>
88
- <div class="controls"><button v-for="type in types" :key="type.type" :disabled="!writable || busy" @click="panel = { type: type.type }">{{ t('新建{0}', [t(type.label)]) }}</button></div>
89
- <p v-if="!projection.rows.length">{{ t('没有符合条件的对象记录。') }}</p>
90
- <div v-if="query.layout === 'table'" class="table-scroll"><table><thead><tr><th>{{ t('名称') }}</th><th>{{ t('类型') }}</th><th>{{ t('状态') }}</th><th>{{ t('描述') }}</th><th>{{ t('关联') }}</th></tr></thead><tbody>
91
- <tr v-for="row in projection.rows" :key="referenceKey(row)" :data-object-id="row.id"><td><button @click="panel = { id: row.id }">{{ row.name }}</button></td><td>{{ t(label(row.type)) }}</td><td><select :value="row.properties.status ?? ''" :aria-label="`${t('状态')}:${row.name}`" :disabled="!writable || busy || row.properties.syncReadOnly === true" @change="setStatus(row, $event)"><option value="">{{ t('未设置') }}</option><option v-for="status in statuses" :key="status">{{ status }}</option></select></td><td>{{ row.description }}</td><td>{{ countLinks(row) }}</td></tr>
92
- </tbody></table></div>
93
- <div v-else-if="query.layout === 'board'" class="board"><section v-for="group in projection.groups" :key="group.name" class="column"><h2>{{ group.name || t('未设置') }} <small>{{ group.rows.length }}</small></h2><article v-for="row in group.rows" :key="referenceKey(row)" :data-object-id="row.id"><button @click="panel = { id: row.id }">{{ row.name }}</button><p>{{ t(label(row.type)) }}</p><p>{{ row.description }}</p><label>{{ t('状态') }}<select :value="row.properties.status ?? ''" :aria-label="`${t('状态')}:${row.name}`" :disabled="!writable || busy || row.properties.syncReadOnly === true" @change="setStatus(row, $event)"><option value="">{{ t('未设置') }}</option><option v-for="status in statuses" :key="status">{{ status }}</option></select></label><small>{{ countLinks(row) }} {{ t('关联') }}</small></article></section></div>
94
- <div v-else class="gallery"><article v-for="row in projection.rows" :key="referenceKey(row)" :data-object-id="row.id"><p>{{ t(label(row.type)) }} · {{ objectViewText(objectViewValue(row, 'property:status')) || t('未设置') }}</p><h2><button @click="panel = { id: row.id }">{{ row.name }}</button></h2><p class="description">{{ row.description }}</p><small>{{ countLinks(row) }} {{ t('关联') }}</small></article></div>
95
- <Teleport :to="document.body"><ObjectPanel v-show="!!panel" :open="!!panel" :selected-id="panel?.id" :initial-type="panel?.type" @close="panel = undefined" @open-reference="emit('open-object', $event)" @open-resource="emit('open-object', $event)" /></Teleport>
96
- </main>
97
- </template>
98
- <style scoped>
99
- .object-database { height: 100%; overflow: auto; box-sizing: border-box; padding: 28px; background: var(--surface); color: var(--text); } header { display: flex; justify-content: space-between; align-items: center; gap: 18px; } header p, small { color: var(--muted); } h1 { font-size: 26px; } h2 { font-size: 17px; } nav, .controls, fieldset { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; } nav { margin: 20px 0; } button, input, select { color: var(--text); background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; font: inherit; max-width: 100%; box-sizing: border-box; } button { cursor: pointer; } button[aria-pressed=true] { background: var(--accent); font-weight: 600; } button:disabled { opacity: .5; cursor: default; } label { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; } fieldset { border: 0; padding: 0; } legend { font-size: 13px; margin-bottom: 8px; } .query { display: grid; gap: 12px; padding: 16px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 10px; } .table-scroll { overflow-x: auto; margin-top: 18px; } table { min-width: 720px; width: 100%; border-collapse: collapse; text-align: left; } th, td { padding: 12px; border-bottom: 1px solid var(--line); font-size: 13px; max-width: 350px; overflow-wrap: anywhere; } .board { display: flex; gap: 16px; overflow-x: auto; margin-top: 18px; } .column { flex: 0 0 280px; } article { padding: 16px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 10px; overflow-wrap: anywhere; } article p { font-size: 13px; line-height: 1.6; white-space: pre-wrap; } .gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 16px; margin-top: 20px; } .description { max-height: 160px; overflow: auto; } [role=alert] { color: var(--danger, #b33); } @media(max-width:620px) { .object-database { padding: 16px; } header { display: block; } }
100
- </style>