@tano.page/workbench 0.14.0 → 0.16.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 (248) hide show
  1. package/package.json +50 -16
  2. package/src/App.vue +82 -752
  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/agent-identities.ts +1 -97
  17. package/src/assistant/agent-task-context.ts +1 -54
  18. package/src/assistant/attachments.ts +1 -1
  19. package/src/assistant/completion.ts +1 -61
  20. package/src/assistant/components/AssistantChangeList.vue +98 -21
  21. package/src/assistant/components/AssistantPanel.vue +425 -8
  22. package/src/assistant/components/PluginToolProposalCard.vue +235 -0
  23. package/src/assistant/connection-actions.ts +237 -0
  24. package/src/assistant/document-mentions.ts +1 -33
  25. package/src/assistant/engine.ts +1 -532
  26. package/src/assistant/execution.ts +6 -33
  27. package/src/assistant/files.ts +5 -13
  28. package/src/assistant/hash.ts +1 -4
  29. package/src/assistant/inbox.ts +1 -148
  30. package/src/assistant/language.ts +10 -37
  31. package/src/assistant/mention-autocomplete.ts +69 -0
  32. package/src/assistant/plugin-bridge-builder.ts +146 -0
  33. package/src/assistant/prompts.ts +1 -58
  34. package/src/assistant/proposal-actions.ts +336 -0
  35. package/src/assistant/results.ts +20 -86
  36. package/src/assistant/store.ts +167 -327
  37. package/src/assistant/structures.ts +1 -155
  38. package/src/assistant/tasks.ts +8 -96
  39. package/src/assistant/tool-rules.ts +1 -7
  40. package/src/assistant/workspace-bridge.ts +1 -1
  41. package/src/composables/use-document-actions.ts +38 -20
  42. package/src/composables/use-file-tree-controller.ts +7 -12
  43. package/src/composables/use-workbench-help.ts +177 -0
  44. package/src/composables/use-workbench-history.ts +2 -4
  45. package/src/composables/use-workbench-lifecycle.ts +249 -0
  46. package/src/composables/use-workbench-modals.ts +6 -1
  47. package/src/composables/use-workbench-outline.ts +0 -5
  48. package/src/composables/use-workbench-settings.ts +185 -0
  49. package/src/composables/use-workbench-shortcuts.ts +40 -1021
  50. package/src/composables/use-workbench-views.ts +325 -0
  51. package/src/data-tables/data-tables.ts +1 -2
  52. package/src/documents/components/DocumentActionMenu.vue +279 -0
  53. package/src/documents/components/DocumentHistoryPanel.vue +3 -1
  54. package/src/documents/components/DocumentInspector.vue +168 -0
  55. package/src/documents/components/DocumentPane.vue +482 -0
  56. package/src/documents/description-merge.ts +1 -9
  57. package/src/features.ts +1 -0
  58. package/src/files/components/FileMetadataPanel.vue +49 -15
  59. package/src/fonts/Inter-Latin-Italic.woff2 +0 -0
  60. package/src/fonts/Inter-Latin.woff2 +0 -0
  61. package/src/fonts/TanoUISansSC-Bold.woff2 +0 -0
  62. package/src/fonts/TanoUISansSC-Medium.woff2 +0 -0
  63. package/src/fonts/TanoUISansSC-Regular.woff2 +0 -0
  64. package/src/help/help-milestones.ts +3 -5
  65. package/src/i18n/locale-catalogs.ts +7 -6
  66. package/src/i18n/locale-registry.ts +8 -6
  67. package/src/i18n/locales/de-DE.json +371 -3
  68. package/src/i18n/locales/en-US.json +371 -2
  69. package/src/i18n/locales/es-ES.json +371 -3
  70. package/src/i18n/locales/ja-JP.json +370 -2
  71. package/src/i18n/locales/zh-TW.json +370 -2
  72. package/src/mail/components/MailAccountDialog.vue +450 -0
  73. package/src/mail/components/MailComposerDialog.vue +326 -0
  74. package/src/mail/components/MailProviderIcon.vue +30 -0
  75. package/src/mail/components/MailWorkspaceView.vue +821 -0
  76. package/src/mail/components/SidebarMail.vue +134 -0
  77. package/src/mail/mail-avatar.ts +17 -0
  78. package/src/mail/mail-bridge.ts +68 -0
  79. package/src/mail/mail-calendar.ts +208 -0
  80. package/src/mail/mail-markdown.ts +195 -0
  81. package/src/mail/types.ts +226 -0
  82. package/src/objects/components/ObjectDetailModal.vue +1001 -0
  83. package/src/objects/content-references.ts +6 -56
  84. package/src/objects/wiki-links.ts +1 -48
  85. package/src/objects/workspace-objects.ts +3 -4
  86. package/src/plan-sync/types.ts +6 -3
  87. package/src/plans/calendar-interaction.ts +194 -0
  88. package/src/plans/calendar.ts +65 -9
  89. package/src/plans/components/CalendarAgendaView.vue +165 -0
  90. package/src/plans/components/CalendarDayPopover.vue +172 -39
  91. package/src/plans/components/CalendarFilterBar.vue +128 -0
  92. package/src/plans/components/CalendarMonthView.vue +224 -0
  93. package/src/plans/components/CalendarQuickCreateDialog.vue +269 -0
  94. package/src/plans/components/CalendarTimelineView.vue +517 -0
  95. package/src/plans/components/CalendarTopbarControls.vue +101 -0
  96. package/src/plans/components/CalendarView.vue +264 -748
  97. package/src/plans/components/CalendarYearView.vue +138 -0
  98. package/src/plans/components/PlanArchiveDialog.vue +295 -0
  99. package/src/plans/components/PlanConnectionsDialog.vue +1 -1
  100. package/src/plans/components/PlanDateField.vue +6 -4
  101. package/src/plans/components/PlanDetailPanel.vue +227 -32
  102. package/src/plans/components/PlanEventList.vue +16 -4
  103. package/src/plans/components/SidebarPlan.vue +22 -15
  104. package/src/plans/components/TaskRepeatControls.vue +169 -30
  105. package/src/plans/components/calendar-shared.css +192 -0
  106. package/src/plans/composables/use-calendar-interactions.ts +396 -0
  107. package/src/plans/composables/use-calendar-scroll.ts +420 -0
  108. package/src/plans/local-reminders.ts +149 -0
  109. package/src/plans/personal-plans.ts +10 -1
  110. package/src/plans/plan-date.ts +8 -1
  111. package/src/plans/plan-migration.ts +95 -0
  112. package/src/plans/recurrence.ts +95 -0
  113. package/src/plans/task-repeat.ts +8 -8
  114. package/src/plans/timeline-layout.ts +92 -0
  115. package/src/plugins/assistant-bridge.ts +520 -0
  116. package/src/plugins/attachment-reader.ts +3 -1
  117. package/src/plugins/cache-storage.ts +42 -2
  118. package/src/plugins/components/PluginAutomations.vue +3 -3
  119. package/src/plugins/components/PluginCatalogBrowser.vue +17 -8
  120. package/src/plugins/components/PluginChangeSummary.vue +16 -3
  121. package/src/plugins/components/PluginConnections.vue +1 -1
  122. package/src/plugins/components/PluginCustomView.vue +2 -2
  123. package/src/plugins/components/PluginDetailPage.vue +136 -57
  124. package/src/plugins/components/PluginDeveloperArea.vue +192 -0
  125. package/src/plugins/components/PluginDocumentSlot.vue +63 -0
  126. package/src/plugins/components/PluginExplorer.vue +21 -25
  127. package/src/plugins/components/PluginImportDialog.vue +410 -0
  128. package/src/plugins/components/PluginInstaller.vue +273 -288
  129. package/src/plugins/components/PluginListItem.vue +3 -0
  130. package/src/plugins/components/PluginMaintenance.vue +37 -34
  131. package/src/plugins/components/PluginRepositoryStorage.vue +4 -2
  132. package/src/plugins/components/PluginRuntimePanel.vue +3 -3
  133. package/src/plugins/components/PluginSettingsForm.vue +112 -0
  134. package/src/plugins/components/PluginStatusBar.vue +161 -0
  135. package/src/plugins/components/PluginSurface.vue +18 -6
  136. package/src/plugins/components/PluginUiDialog.vue +452 -0
  137. package/src/plugins/components/PluginsTabPage.vue +61 -0
  138. package/src/plugins/components/plugin-center.css +5 -0
  139. package/src/plugins/data.ts +9 -86
  140. package/src/plugins/editor-plugin-adapters.ts +169 -0
  141. package/src/plugins/excalidraw/bundle.tano-plugin.json +1 -1
  142. package/src/plugins/excalidraw/manifest.json +12 -1
  143. package/src/plugins/host.ts +662 -43
  144. package/src/plugins/native.ts +2 -10
  145. package/src/plugins/overlay-mapping.ts +125 -0
  146. package/src/plugins/packages.ts +73 -1
  147. package/src/plugins/plugin-data.ts +2 -3
  148. package/src/plugins/plugin-permissions.ts +57 -0
  149. package/src/plugins/plugin-rpc-router.ts +558 -0
  150. package/src/plugins/plugin-sdk.ts +1 -94
  151. package/src/plugins/plugin-ui-dialogs.ts +167 -0
  152. package/src/plugins/policy.ts +53 -3
  153. package/src/plugins/presentation-preview/bundle.tano-plugin.json +1 -1
  154. package/src/plugins/presentation-preview/manifest.json +2 -1
  155. package/src/plugins/queries.ts +1 -73
  156. package/src/plugins/sandbox.ts +15 -1
  157. package/src/plugins/use-plugin-actions.ts +67 -20
  158. package/src/plugins/user-plugins.ts +254 -0
  159. package/src/plugins/view-header.ts +2 -7
  160. package/src/plugins/word-preview/bundle.tano-plugin.json +1 -1
  161. package/src/plugins/word-preview/manifest.json +13 -1
  162. package/src/plugins/workbench.ts +175 -2
  163. package/src/plugins/worker.js +105 -8
  164. package/src/plugins/workspace-plugin-runtime.ts +23 -7
  165. package/src/plugins/workspace-plugins.ts +212 -21
  166. package/src/runtime.ts +103 -4
  167. package/src/settings/components/SettingsAppearancePage.vue +46 -0
  168. package/src/settings/components/SettingsDocumentsPage.vue +0 -1
  169. package/src/settings/components/SettingsPanel.vue +8 -3
  170. package/src/settings/components/WorkbenchSettings.vue +20 -7
  171. package/src/settings/components/settings-context.ts +1 -1
  172. package/src/settings/components/settings-search.ts +2 -3
  173. package/src/settings/settings-tab.ts +1 -0
  174. package/src/shell/command-palette.ts +3 -3
  175. package/src/shell/components/EditorToolbar.vue +8 -9
  176. package/src/shell/components/EditorTools.vue +1 -5
  177. package/src/shell/components/PaneTopbar.vue +393 -0
  178. package/src/shell/components/SelectionToolbar.vue +0 -2
  179. package/src/shell/components/SidebarNavigation.vue +22 -2
  180. package/src/shell/components/WorkbenchContextMenus.vue +58 -34
  181. package/src/shell/components/WorkbenchModals.vue +47 -62
  182. package/src/shell/components/WorkbenchPanes.vue +371 -1342
  183. package/src/shell/components/WorkbenchSidebar.vue +486 -0
  184. package/src/shell/components/WorkspaceBreadcrumb.vue +6 -14
  185. package/src/shell/components/WorkspaceViewSwitcher.vue +12 -7
  186. package/src/shell/pane-registry.ts +69 -0
  187. package/src/shell/use-surface-dismissal.ts +219 -0
  188. package/src/shell/use-workbench-commands.ts +599 -0
  189. package/src/shell/use-workbench-keybindings.ts +337 -0
  190. package/src/shell/use-workbench.ts +531 -1153
  191. package/src/shell/workbench-async-components.ts +14 -5
  192. package/src/shell/workbench-context.ts +30 -3
  193. package/src/stores/mail.ts +414 -0
  194. package/src/stores/plan-sync.ts +2 -1
  195. package/src/stores/plans.ts +2 -9
  196. package/src/stores/workspace-document-io.ts +807 -0
  197. package/src/stores/workspace-file-ops.ts +1 -1
  198. package/src/stores/workspace-knowledge.ts +2 -114
  199. package/src/stores/workspace-lifecycle.ts +459 -0
  200. package/src/stores/workspace-plugins-state.ts +254 -259
  201. package/src/stores/workspace-session.ts +287 -0
  202. package/src/stores/workspace-tabs-layout.ts +6 -44
  203. package/src/stores/workspace-types.ts +50 -0
  204. package/src/stores/workspace.ts +184 -1363
  205. package/src/styles/agent-diff-modals.css +0 -7
  206. package/src/styles/dark-theme.css +3 -3
  207. package/src/styles/inspector.css +0 -59
  208. package/src/styles/layout-themes.css +346 -0
  209. package/src/styles/mail.css +1568 -0
  210. package/src/styles/mobile.css +2 -2
  211. package/src/styles/recent-and-media.css +0 -17
  212. package/src/styles/theme-contract.css +3 -3
  213. package/src/styles/workbench-shell.css +110 -17
  214. package/src/styles/workspace-states.css +9 -33
  215. package/src/styles.css +0 -1
  216. package/src/tabs/components/DesktopTabs.vue +19 -14
  217. package/src/tabs/components/NewTabPicker.vue +10 -4
  218. package/src/tabs/tab-label.ts +0 -1
  219. package/src/windows/AuxiliaryWindows.vue +2 -2
  220. package/src/windows/use-window-event-bridge.ts +152 -0
  221. package/src/workspace/components/TemplateLibrary.vue +1 -1
  222. package/src/workspace/components/WorkspaceGeneralSettings.vue +0 -13
  223. package/src/workspace/components/WorkspaceIconPicker.vue +30 -7
  224. package/src/workspace/components/WorkspacePickerMenu.vue +317 -0
  225. package/src/workspace/workspace-comments.ts +11 -151
  226. package/src/workspace/workspace-welcome.ts +1 -1
  227. package/src/assistant/locales/de-DE.json +0 -126
  228. package/src/assistant/locales/en-US.json +0 -126
  229. package/src/assistant/locales/es-ES.json +0 -126
  230. package/src/assistant/locales/ja-JP.json +0 -126
  231. package/src/assistant/locales/zh-CN.json +0 -126
  232. package/src/assistant/locales/zh-TW.json +0 -126
  233. package/src/assistant/task-prompts.json +0 -39
  234. package/src/documents/components/FormulaMenu.vue +0 -50
  235. package/src/files/components/FileDatabasePage.vue +0 -152
  236. package/src/files/components/FolderHomeIcon.vue +0 -12
  237. package/src/objects/components/ObjectDatabasePage.vue +0 -100
  238. package/src/objects/components/ObjectPanel.vue +0 -554
  239. package/src/plans/components/PersonalPlanDialog.vue +0 -105
  240. package/src/shell/components/WorkspaceViewPage.vue +0 -127
  241. package/src/shell/components/WorkspaceViewTab.vue +0 -24
  242. package/src/styles/object-panel.css +0 -163
  243. package/src/workspace/components/GitInspectionPanel.vue +0 -35
  244. package/src/workspace/components/WorkspaceSyncPanel.vue +0 -50
  245. package/src/workspace/welcome-slogans.ts +0 -11
  246. package/src/workspace/workspace-git.ts +0 -35
  247. package/src/workspace/workspace-sync.ts +0 -46
  248. package/src/workspace/workspace-views.ts +0 -48
@@ -0,0 +1,1001 @@
1
+ <script setup lang="ts">
2
+ import { useWindowContext } from '../../windows/context';
3
+ const { document } = useWindowContext();
4
+
5
+ import { vSurfaceMotion } from '@tano/editor/surface-motion';
6
+ import { t } from '../../i18n/i18n';
7
+ import { computed, nextTick, onBeforeUnmount, onMounted, ref, shallowRef, useId, watch } from 'vue';
8
+ import {
9
+ Archive,
10
+ Blocks,
11
+ Bot,
12
+ Check,
13
+ CircleDot,
14
+ LoaderCircle,
15
+ Lock,
16
+ Puzzle,
17
+ Save,
18
+ Trash2,
19
+ UserRound,
20
+ X,
21
+ } from 'lucide-vue-next';
22
+ import { isAgentPerson, referenceUrl } from '@tano/protocol';
23
+ import type { ObjectField, ReferenceIdentity, WorkspaceObject } from '@tano/protocol';
24
+ import type { ObjectRecord } from '../workspace-objects';
25
+ import { objectTypeLabel as referenceTypeLabel } from '../../i18n/ui-labels';
26
+ import { useWorkspaceStore } from '../../stores/workspace';
27
+ import { useWorkbenchRuntime } from '../../runtime';
28
+ import DescriptionEditor from '../../documents/components/DescriptionEditor.vue';
29
+ import ReferenceConnections from './ReferenceConnections.vue';
30
+ import ObjectRelationEditor from './ObjectRelationEditor.vue';
31
+
32
+ const props = defineProps<{
33
+ record?: ObjectRecord;
34
+ objectId?: string;
35
+ initialType?: string;
36
+ }>();
37
+
38
+ const emit = defineEmits<{
39
+ close: [];
40
+ openReference: [identity: ReferenceIdentity];
41
+ saved: [record: ObjectRecord];
42
+ deleted: [id: string];
43
+ }>();
44
+
45
+ const store = useWorkspaceStore();
46
+ const objectDetails = useWorkbenchRuntime().extensions?.().objectDetails;
47
+ const panel = ref<HTMLElement>();
48
+ const nameInput = ref<HTMLTextAreaElement>();
49
+ const nameId = useId();
50
+ const typeId = useId();
51
+ const previousFocus = document.activeElement as HTMLElement | null;
52
+
53
+ function clone(value: WorkspaceObject): WorkspaceObject {
54
+ return JSON.parse(JSON.stringify(value));
55
+ }
56
+
57
+ const resolvedRecord = computed<ObjectRecord | undefined>(() => {
58
+ if (props.record) {
59
+ return (
60
+ store.objects.find(
61
+ (item) =>
62
+ item.object.id === props.record!.object.id &&
63
+ item.object.type === props.record!.object.type,
64
+ ) ?? props.record
65
+ );
66
+ }
67
+ if (props.objectId) {
68
+ return store.objects.find((item) => item.object.id === props.objectId);
69
+ }
70
+ return undefined;
71
+ });
72
+
73
+ const creatableTypes = computed(() =>
74
+ store.objectDefinitions.filter(
75
+ (type) => type.storage === 'record' && !type.legacy && type.type !== 'event',
76
+ ),
77
+ );
78
+
79
+ function buildDraft(record?: ObjectRecord, initialType?: string): WorkspaceObject {
80
+ if (record) return clone(record.object);
81
+ const preferred =
82
+ initialType && creatableTypes.value.some((type) => type.type === initialType)
83
+ ? initialType
84
+ : (creatableTypes.value[0]?.type ?? initialType ?? 'person');
85
+ return {
86
+ version: 1,
87
+ id: '',
88
+ type: preferred,
89
+ name: '',
90
+ description: '',
91
+ archived: false,
92
+ properties: {},
93
+ };
94
+ }
95
+
96
+ const base = shallowRef<ObjectRecord | undefined>(resolvedRecord.value);
97
+ const draft = ref<WorkspaceObject>(buildDraft(resolvedRecord.value, props.initialType));
98
+ const rawJson = ref(JSON.stringify(draft.value.properties, null, 2));
99
+ const jsonError = ref('');
100
+ const busy = ref(false);
101
+ const error = ref('');
102
+ const confirmDelete = ref(false);
103
+ const workspaceScopeId = ref(store.workspace?.id ?? '');
104
+
105
+ const definition = computed(() =>
106
+ store.objectDefinitions.find((type) => type.type === draft.value.type),
107
+ );
108
+ const isAgent = computed(() => isAgentPerson(draft.value));
109
+ const isPerson = computed(() => draft.value.type === 'person');
110
+ const isPluginObject = computed(() => definition.value?.category === 'plugin');
111
+ const dirty = computed(() => {
112
+ if (!base.value) {
113
+ return Boolean(
114
+ draft.value.name.trim() ||
115
+ draft.value.description.trim() ||
116
+ Object.keys(draft.value.properties).length > 0,
117
+ );
118
+ }
119
+ return JSON.stringify(draft.value) !== JSON.stringify(base.value.object) || Boolean(jsonError.value);
120
+ });
121
+ const editDisabled = computed(
122
+ () =>
123
+ busy.value ||
124
+ !store.workspace ||
125
+ store.workspace.id !== workspaceScopeId.value ||
126
+ store.workspace.readOnly ||
127
+ !store.capabilities.features.objectReferences ||
128
+ !definition.value ||
129
+ base.value?.object.properties.syncReadOnly === true,
130
+ );
131
+ const canSave = computed(
132
+ () => !editDisabled.value && !jsonError.value && Boolean(draft.value.name.trim()) && (!base.value || dirty.value),
133
+ );
134
+ const typeBadgeLabel = computed(() => {
135
+ if (isAgent.value) return t('AI Agent');
136
+ if (definition.value) {
137
+ return definition.value.category === 'core' ? t(definition.value.label) : definition.value.label;
138
+ }
139
+ return referenceTypeLabel(draft.value.type);
140
+ });
141
+ const dialogLabel = computed(() => {
142
+ if (!base.value) return t('新建{0}', [typeBadgeLabel.value]);
143
+ return t('{0}详情', [typeBadgeLabel.value]);
144
+ });
145
+ const referenceTargets = computed(() =>
146
+ store.referenceTargets.filter(
147
+ (target) => target.type !== 'document' || !target.path.startsWith('.tano/'),
148
+ ),
149
+ );
150
+ const readonlyEntries = computed(() =>
151
+ Object.entries(draft.value.properties).map(([key, value]) => ({
152
+ key,
153
+ value:
154
+ value === null || value === undefined
155
+ ? '—'
156
+ : typeof value === 'boolean'
157
+ ? value
158
+ ? t('是')
159
+ : t('否')
160
+ : typeof value === 'string' || typeof value === 'number'
161
+ ? String(value)
162
+ : Array.isArray(value)
163
+ ? value.every((item) => typeof item !== 'object' || item === null)
164
+ ? value.map((item) => String(item)).join('、')
165
+ : JSON.stringify(value)
166
+ : JSON.stringify(value),
167
+ })),
168
+ );
169
+ const uri = computed(() =>
170
+ base.value
171
+ ? referenceUrl({ type: base.value.object.type, id: base.value.object.id })
172
+ : t('保存后生成唯一 ID'),
173
+ );
174
+
175
+ watch(resolvedRecord, (next) => {
176
+ if (!next) return;
177
+ if (!base.value || (next.object.id === base.value.object.id && !dirty.value)) {
178
+ base.value = next;
179
+ draft.value = clone(next.object);
180
+ rawJson.value = JSON.stringify(draft.value.properties, null, 2);
181
+ jsonError.value = '';
182
+ }
183
+ });
184
+
185
+ watch(
186
+ () => store.workspace?.id,
187
+ (id) => {
188
+ if (id !== workspaceScopeId.value) emit('close');
189
+ },
190
+ );
191
+
192
+ async function resizeName() {
193
+ await nextTick();
194
+ if (!nameInput.value) return;
195
+ nameInput.value.style.height = 'auto';
196
+ nameInput.value.style.height = `${Math.min(120, Math.max(36, nameInput.value.scrollHeight))}px`;
197
+ }
198
+ watch(() => draft.value.name, resizeName);
199
+
200
+ function updateName(event: Event) {
201
+ if (editDisabled.value) return;
202
+ draft.value.name = (event.target as HTMLTextAreaElement).value.replace(/[\r\n]+/g, ' ');
203
+ }
204
+
205
+ function onNameKeydown(event: KeyboardEvent) {
206
+ if (event.key === 'Enter' && !event.isComposing) event.preventDefault();
207
+ }
208
+
209
+ function fieldValue(field: ObjectField) {
210
+ const value = draft.value.properties[field.key];
211
+ if (field.type === 'datetime' && typeof value === 'string' && value) {
212
+ const date = new Date(value);
213
+ if (!Number.isFinite(date.getTime())) return '';
214
+ return new Date(date.getTime() - date.getTimezoneOffset() * 60000).toISOString().slice(0, 16);
215
+ }
216
+ return value ?? '';
217
+ }
218
+
219
+ function updateField(field: ObjectField, event: Event) {
220
+ if (editDisabled.value) return;
221
+ const input = event.target as HTMLInputElement;
222
+ const next = { ...draft.value.properties };
223
+ if (field.type === 'boolean') {
224
+ next[field.key] = input.checked;
225
+ } else if (!input.value) {
226
+ delete next[field.key];
227
+ } else if (field.type === 'datetime') {
228
+ next[field.key] = new Date(input.value).toISOString();
229
+ } else if (field.type === 'number') {
230
+ next[field.key] = Number(input.value);
231
+ } else {
232
+ next[field.key] = input.value;
233
+ }
234
+ draft.value.properties = next;
235
+ rawJson.value = JSON.stringify(next, null, 2);
236
+ jsonError.value = '';
237
+ error.value = '';
238
+ }
239
+
240
+ function updateRawJson(event: Event) {
241
+ const value = (event.target as HTMLTextAreaElement).value;
242
+ rawJson.value = value;
243
+ try {
244
+ const parsed = JSON.parse(value);
245
+ if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {
246
+ jsonError.value = t('属性必须是 JSON 对象');
247
+ return;
248
+ }
249
+ draft.value.properties = parsed;
250
+ jsonError.value = '';
251
+ } catch {
252
+ jsonError.value = t('JSON 格式无效,请检查语法');
253
+ }
254
+ }
255
+
256
+ function toggleArchive() {
257
+ if (editDisabled.value) return;
258
+ draft.value.archived = !draft.value.archived;
259
+ }
260
+
261
+ async function save() {
262
+ if (!canSave.value) return;
263
+ error.value = '';
264
+ busy.value = true;
265
+ const scope = workspaceScopeId.value;
266
+ try {
267
+ const value: WorkspaceObject = {
268
+ ...clone(draft.value),
269
+ name: draft.value.name.trim(),
270
+ };
271
+ const saved = base.value
272
+ ? await store.updateObject(base.value, value, scope)
273
+ : await store.createObject(value);
274
+ base.value = saved;
275
+ draft.value = clone(saved.object);
276
+ rawJson.value = JSON.stringify(saved.object.properties, null, 2);
277
+ jsonError.value = '';
278
+ emit('saved', saved);
279
+ } catch (reason) {
280
+ error.value = reason instanceof Error ? reason.message : String(reason);
281
+ } finally {
282
+ busy.value = false;
283
+ }
284
+ }
285
+
286
+ async function removeCurrent() {
287
+ if (!base.value || editDisabled.value) return;
288
+ busy.value = true;
289
+ error.value = '';
290
+ try {
291
+ const id = base.value.object.id;
292
+ await store.deleteObject(base.value, workspaceScopeId.value);
293
+ confirmDelete.value = false;
294
+ emit('deleted', id);
295
+ emit('close');
296
+ } catch (reason) {
297
+ error.value = reason instanceof Error ? reason.message : String(reason);
298
+ } finally {
299
+ busy.value = false;
300
+ }
301
+ }
302
+
303
+ function trapFocus(event: KeyboardEvent) {
304
+ if (event.key !== 'Tab' || !panel.value) return;
305
+ const controls = Array.from(
306
+ panel.value.querySelectorAll<HTMLElement>(
307
+ 'button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), summary',
308
+ ),
309
+ ).filter((el) => el.getClientRects().length);
310
+ const first = controls[0];
311
+ const last = controls.at(-1);
312
+ if (
313
+ event.shiftKey &&
314
+ (document.activeElement === first || document.activeElement === panel.value)
315
+ ) {
316
+ event.preventDefault();
317
+ last?.focus();
318
+ } else if (!event.shiftKey && document.activeElement === last) {
319
+ event.preventDefault();
320
+ first?.focus();
321
+ }
322
+ }
323
+
324
+ onMounted(async () => {
325
+ await resizeName();
326
+ if (!base.value && nameInput.value) nameInput.value.focus();
327
+ else panel.value?.focus();
328
+ });
329
+
330
+ onBeforeUnmount(() => {
331
+ if (previousFocus?.isConnected) previousFocus.focus();
332
+ });
333
+ </script>
334
+
335
+ <template>
336
+ <div
337
+ v-surface-motion="'ObjectDetailModal:0'"
338
+ class="object-detail-backdrop"
339
+ @mousedown.self="emit('close')"
340
+ >
341
+ <section
342
+ ref="panel"
343
+ class="object-detail-panel"
344
+ tabindex="-1"
345
+ role="dialog"
346
+ aria-modal="true"
347
+ :aria-label="dialogLabel"
348
+ @keydown.esc.stop.prevent="emit('close')"
349
+ @keydown="trapFocus"
350
+ >
351
+ <header class="object-detail-header">
352
+ <div class="object-detail-badges">
353
+ <span class="object-type-pill" :class="{ 'is-agent': isAgent, 'is-plugin': isPluginObject }">
354
+ <Bot v-if="isAgent" :size="14" aria-hidden="true" />
355
+ <UserRound v-else-if="isPerson" :size="14" aria-hidden="true" />
356
+ <Puzzle v-else-if="isPluginObject" :size="14" aria-hidden="true" />
357
+ <Blocks v-else :size="14" aria-hidden="true" />
358
+ <template v-if="!base && creatableTypes.length > 1">
359
+ <label class="sr-only" :for="typeId">{{ t('对象类型') }}</label>
360
+ <select
361
+ :id="typeId"
362
+ v-model="draft.type"
363
+ class="object-type-select"
364
+ :aria-label="t('对象类型')"
365
+ :disabled="busy"
366
+ >
367
+ <option v-for="type in creatableTypes" :key="type.type" :value="type.type">
368
+ {{ type.category === 'core' ? t(type.label) : type.label }}
369
+ </option>
370
+ </select>
371
+ </template>
372
+ <span v-else>{{ typeBadgeLabel }}</span>
373
+ </span>
374
+ <span v-if="!definition" class="object-meta-pill">
375
+ <Lock :size="12" aria-hidden="true" />{{ t('只读保留') }}
376
+ </span>
377
+ <span v-if="draft.archived" class="object-meta-pill">
378
+ <Archive :size="12" aria-hidden="true" />{{ t('已归档') }}
379
+ </span>
380
+ </div>
381
+ <div class="object-detail-actions">
382
+ <button
383
+ v-if="base && definition"
384
+ type="button"
385
+ class="icon-button"
386
+ :class="{ active: draft.archived }"
387
+ :aria-label="draft.archived ? t('取消归档') : t('归档')"
388
+ :data-tooltip="draft.archived ? t('取消归档') : t('归档(保留引用,停止推荐)')"
389
+ :aria-pressed="draft.archived"
390
+ :disabled="editDisabled"
391
+ @click="toggleArchive"
392
+ >
393
+ <Archive :size="16" />
394
+ </button>
395
+ <button
396
+ v-if="base && definition"
397
+ type="button"
398
+ class="icon-button"
399
+ :class="{ active: confirmDelete }"
400
+ :aria-label="t('删除对象')"
401
+ :data-tooltip="t('删除对象')"
402
+ :disabled="editDisabled"
403
+ @click="confirmDelete = !confirmDelete"
404
+ >
405
+ <Trash2 :size="16" />
406
+ </button>
407
+ <button
408
+ type="button"
409
+ class="icon-button"
410
+ :aria-label="t('关闭')"
411
+ :data-tooltip="t('关闭 · Esc')"
412
+ @click="emit('close')"
413
+ >
414
+ <X :size="17" />
415
+ </button>
416
+ </div>
417
+ </header>
418
+
419
+ <div v-if="confirmDelete && base" class="object-confirm-bar" role="alert">
420
+ <span>{{ t('删除后,文档和关系中的既有引用会保留为缺失引用。确认删除?') }}</span>
421
+ <div>
422
+ <button type="button" :disabled="busy" @click="confirmDelete = false">{{ t('取消') }}</button>
423
+ <button
424
+ type="button"
425
+ class="is-danger"
426
+ :disabled="editDisabled"
427
+ @click="removeCurrent"
428
+ >
429
+ {{ busy ? t('删除中…') : t('确认删除') }}
430
+ </button>
431
+ </div>
432
+ </div>
433
+
434
+ <div class="object-detail-content">
435
+ <div class="object-detail-name">
436
+ <label class="sr-only" :for="nameId">{{ t('名称') }}</label>
437
+ <textarea
438
+ :id="nameId"
439
+ ref="nameInput"
440
+ :value="draft.name"
441
+ rows="1"
442
+ maxlength="200"
443
+ :aria-label="t('名称')"
444
+ :placeholder="t('输入名称…')"
445
+ :disabled="editDisabled"
446
+ @input="updateName"
447
+ @keydown="onNameKeydown"
448
+ />
449
+ </div>
450
+
451
+ <p v-if="!definition" class="detail-callout">
452
+ {{ t('此类型插件未启用,原文件与文档中的既有引用已只读保留,不再参与引用推荐。') }}
453
+ </p>
454
+ <p v-else-if="!store.capabilities.features.objectReferences" class="detail-callout">
455
+ {{ t('「工作区对象与引用」已关闭,当前仅可查看;可在工作区设置中重新启用。') }}
456
+ </p>
457
+ <p v-else-if="isAgent" class="detail-callout">
458
+ {{ t('AI Agent 身份用于在文档和评论中被 @ 提及与派发;模型连接与收件箱设置请在「助手」中管理。') }}
459
+ </p>
460
+ <p v-else-if="isPerson && !objectDetails" class="detail-notice">
461
+ {{ t('人物是工作区记录,不代表登录账号或访问权限。') }}
462
+ </p>
463
+ <p v-if="store.isDemo" class="detail-notice">
464
+ {{ t('浏览器演示存储:修改仅保存在当前浏览器中。') }}
465
+ </p>
466
+
467
+ <div
468
+ v-if="
469
+ (objectDetails && base) ||
470
+ (definition?.fields.length ?? 0) > 0 ||
471
+ (!definition && readonlyEntries.length > 0)
472
+ "
473
+ class="object-detail-properties"
474
+ >
475
+ <component
476
+ :is="objectDetails"
477
+ v-if="objectDetails && base"
478
+ :key="`${workspaceScopeId}:${base.object.id}`"
479
+ :workspace-id="workspaceScopeId"
480
+ :object="base.object"
481
+ :disabled="editDisabled || dirty"
482
+ @open-reference="emit('openReference', $event)"
483
+ />
484
+
485
+ <template v-if="definition?.fields.length">
486
+ <div v-for="field in definition.fields" :key="field.key" class="object-detail-row">
487
+ <label :for="`object-field-${field.key}`">
488
+ {{ definition.category === 'core' ? t(field.label) : field.label
489
+ }}{{ field.required ? ' *' : '' }}
490
+ </label>
491
+ <div class="object-field-control">
492
+ <input
493
+ v-if="field.type === 'boolean'"
494
+ :id="`object-field-${field.key}`"
495
+ type="checkbox"
496
+ :checked="fieldValue(field) === true"
497
+ :disabled="editDisabled"
498
+ @change="updateField(field, $event)"
499
+ />
500
+ <input
501
+ v-else
502
+ :id="`object-field-${field.key}`"
503
+ :type="
504
+ field.type === 'datetime'
505
+ ? 'datetime-local'
506
+ : field.type === 'number'
507
+ ? 'number'
508
+ : 'text'
509
+ "
510
+ :step="field.type === 'number' ? 'any' : undefined"
511
+ :value="fieldValue(field)"
512
+ :required="field.required"
513
+ :disabled="editDisabled"
514
+ @input="updateField(field, $event)"
515
+ />
516
+ </div>
517
+ </div>
518
+ </template>
519
+
520
+ <template v-else-if="!definition && readonlyEntries.length">
521
+ <div v-for="entry in readonlyEntries" :key="entry.key" class="object-detail-row">
522
+ <span class="object-detail-label">{{ entry.key }}</span>
523
+ <span class="object-readonly-value">{{ entry.value }}</span>
524
+ </div>
525
+ </template>
526
+ </div>
527
+
528
+ <DescriptionEditor
529
+ :key="`${workspaceScopeId}:${base?.object.id ?? `new:${draft.type}`}`"
530
+ v-model="draft.description"
531
+ :disabled="editDisabled"
532
+ :targets="referenceTargets"
533
+ preview
534
+ />
535
+
536
+ <ReferenceConnections
537
+ v-if="base"
538
+ class="object-detail-references"
539
+ :identity="base.object"
540
+ :draft="draft.description"
541
+ :active="true"
542
+ @open="emit('openReference', $event)"
543
+ />
544
+
545
+ <ObjectRelationEditor
546
+ v-if="base && definition"
547
+ :identity="base.object"
548
+ :workspace-id="workspaceScopeId"
549
+ :disabled="editDisabled"
550
+ @open="emit('openReference', $event)"
551
+ />
552
+
553
+ <details v-if="base || isPluginObject" class="object-technical-details">
554
+ <summary>{{ t('更多信息') }}</summary>
555
+ <div class="object-technical-body">
556
+ <div class="object-meta-line">
557
+ <span>{{ t('引用身份') }}</span>
558
+ <code>{{ uri }}</code>
559
+ </div>
560
+ <div v-if="base" class="object-meta-line">
561
+ <span>{{ t('文件位置') }}</span>
562
+ <code>{{ base.path }}</code>
563
+ </div>
564
+ <div v-if="isPluginObject" class="object-json-field">
565
+ <label :for="`object-json-${nameId}`">{{ t('自定义属性(JSON)') }}</label>
566
+ <textarea
567
+ :id="`object-json-${nameId}`"
568
+ :value="rawJson"
569
+ rows="4"
570
+ spellcheck="false"
571
+ :disabled="editDisabled"
572
+ @input="updateRawJson"
573
+ />
574
+ <p v-if="jsonError" class="detail-error" role="alert">{{ jsonError }}</p>
575
+ </div>
576
+ </div>
577
+ </details>
578
+
579
+ <p v-if="error" class="detail-error" role="alert">{{ error }}</p>
580
+ </div>
581
+
582
+ <footer class="object-detail-footer">
583
+ <span class="detail-save-state" :class="{ 'has-changes': dirty }">
584
+ <LoaderCircle v-if="busy" :size="14" class="detail-spinner" aria-hidden="true" />
585
+ <Lock v-else-if="!definition" :size="14" aria-hidden="true" />
586
+ <CircleDot v-else-if="dirty" :size="14" aria-hidden="true" />
587
+ <Check v-else :size="14" aria-hidden="true" />
588
+ {{
589
+ busy
590
+ ? t('正在保存…')
591
+ : !definition
592
+ ? t('只读保留')
593
+ : dirty
594
+ ? t('有未保存的更改')
595
+ : base
596
+ ? t('已保存')
597
+ : t('填写名称后保存')
598
+ }}
599
+ </span>
600
+ <div class="object-footer-actions">
601
+ <button type="button" class="detail-close" :disabled="busy" @click="emit('close')">
602
+ {{ t('关闭') }}
603
+ </button>
604
+ <button
605
+ v-if="definition"
606
+ type="button"
607
+ class="detail-save"
608
+ :disabled="!canSave"
609
+ @click="save"
610
+ >
611
+ <Save :size="15" aria-hidden="true" />{{ base ? t('保存') : t('创建') }}
612
+ </button>
613
+ </div>
614
+ </footer>
615
+ </section>
616
+ </div>
617
+ </template>
618
+
619
+ <style scoped>
620
+ .sr-only {
621
+ position: absolute;
622
+ width: 1px;
623
+ height: 1px;
624
+ padding: 0;
625
+ margin: -1px;
626
+ overflow: hidden;
627
+ clip: rect(0, 0, 0, 0);
628
+ white-space: nowrap;
629
+ border: 0;
630
+ }
631
+ .object-detail-backdrop {
632
+ position: fixed;
633
+ inset: 0;
634
+ z-index: 80;
635
+ display: grid;
636
+ place-items: center;
637
+ padding: 20px;
638
+ background: rgb(15 23 20 / 32%);
639
+ backdrop-filter: blur(2px);
640
+ }
641
+ .object-detail-panel {
642
+ display: flex;
643
+ flex-direction: column;
644
+ width: min(640px, 100%);
645
+ max-height: min(760px, calc(100dvh - 40px));
646
+ background: var(--paper);
647
+ color: var(--text);
648
+ border: 1px solid var(--line);
649
+ border-radius: 14px;
650
+ box-shadow: 0 20px 60px rgb(0 0 0 / 18%);
651
+ overflow: hidden;
652
+ outline: none;
653
+ }
654
+ .object-detail-header,
655
+ .object-detail-footer {
656
+ display: flex;
657
+ align-items: center;
658
+ justify-content: space-between;
659
+ gap: 12px;
660
+ padding: 12px 20px;
661
+ flex: none;
662
+ }
663
+ .object-detail-header {
664
+ border-bottom: 1px solid var(--line);
665
+ }
666
+ .object-detail-badges,
667
+ .object-detail-actions,
668
+ .object-footer-actions {
669
+ display: flex;
670
+ align-items: center;
671
+ gap: 8px;
672
+ min-width: 0;
673
+ }
674
+ .object-type-pill,
675
+ .object-meta-pill {
676
+ display: inline-flex;
677
+ align-items: center;
678
+ gap: 6px;
679
+ padding: 4px 10px;
680
+ border-radius: 999px;
681
+ font-size: 12px;
682
+ font-weight: 500;
683
+ background: var(--surface);
684
+ color: var(--text-secondary);
685
+ border: 1px solid var(--line);
686
+ }
687
+ .object-type-pill.is-agent {
688
+ color: var(--green);
689
+ border-color: color-mix(in srgb, var(--green) 35%, var(--line));
690
+ background: color-mix(in srgb, var(--green) 8%, var(--paper));
691
+ }
692
+ .object-type-select {
693
+ border: 0;
694
+ background: transparent;
695
+ color: inherit;
696
+ font: inherit;
697
+ cursor: pointer;
698
+ outline: none;
699
+ }
700
+ .object-detail-actions .icon-button {
701
+ width: 30px;
702
+ height: 30px;
703
+ border-radius: 7px;
704
+ color: var(--muted);
705
+ }
706
+ .object-detail-actions .icon-button:hover:not(:disabled),
707
+ .object-detail-actions .icon-button.active {
708
+ background: var(--hover);
709
+ color: var(--text);
710
+ }
711
+ .object-confirm-bar {
712
+ display: flex;
713
+ flex-wrap: wrap;
714
+ align-items: center;
715
+ justify-content: space-between;
716
+ gap: 10px;
717
+ padding: 10px 20px;
718
+ border-bottom: 1px solid var(--line);
719
+ background: color-mix(in srgb, var(--danger) 8%, var(--surface));
720
+ font-size: 12px;
721
+ color: var(--text);
722
+ }
723
+ .object-confirm-bar > div {
724
+ display: flex;
725
+ gap: 8px;
726
+ }
727
+ .object-confirm-bar button {
728
+ padding: 5px 10px;
729
+ border: 1px solid var(--line);
730
+ border-radius: 6px;
731
+ background: var(--paper);
732
+ color: var(--text);
733
+ font: inherit;
734
+ font-size: 12px;
735
+ cursor: pointer;
736
+ }
737
+ .object-confirm-bar button.is-danger {
738
+ border-color: var(--danger);
739
+ background: var(--danger);
740
+ color: #fff;
741
+ }
742
+ .object-detail-content {
743
+ flex: 1 1 auto;
744
+ min-height: 0;
745
+ overflow-y: auto;
746
+ padding: 22px 24px 24px;
747
+ }
748
+ .object-detail-name {
749
+ margin-bottom: 14px;
750
+ }
751
+ .object-detail-name textarea {
752
+ display: block;
753
+ width: 100%;
754
+ box-sizing: border-box;
755
+ margin: 0;
756
+ padding: 2px 0;
757
+ border: 0;
758
+ background: transparent;
759
+ color: var(--text);
760
+ font: inherit;
761
+ font-size: 24px;
762
+ font-weight: 600;
763
+ line-height: 1.35;
764
+ resize: none;
765
+ outline: none;
766
+ }
767
+ .object-detail-name textarea::placeholder {
768
+ color: var(--muted);
769
+ font-weight: 500;
770
+ }
771
+ .detail-callout {
772
+ margin: 0 0 16px;
773
+ padding: 10px 12px;
774
+ border: 1px solid var(--line);
775
+ border-radius: 8px;
776
+ background: var(--surface);
777
+ color: var(--text-secondary);
778
+ font-size: 12px;
779
+ line-height: 1.6;
780
+ }
781
+ .detail-notice {
782
+ margin: 0 0 14px;
783
+ color: var(--muted);
784
+ font-size: 12px;
785
+ line-height: 1.6;
786
+ }
787
+ .object-detail-properties {
788
+ display: grid;
789
+ gap: 6px;
790
+ padding: 14px 0 16px;
791
+ margin-bottom: 14px;
792
+ border-top: 1px solid var(--line);
793
+ border-bottom: 1px solid var(--line);
794
+ }
795
+ .object-detail-row {
796
+ display: grid;
797
+ grid-template-columns: 112px minmax(0, 1fr);
798
+ column-gap: 12px;
799
+ align-items: center;
800
+ min-width: 0;
801
+ }
802
+ .object-detail-row > label,
803
+ .object-detail-label {
804
+ font-size: 13px;
805
+ color: var(--muted);
806
+ overflow-wrap: anywhere;
807
+ }
808
+ .object-field-control input:not([type='checkbox']) {
809
+ box-sizing: border-box;
810
+ width: 100%;
811
+ height: 32px;
812
+ padding: 0 8px;
813
+ border: 1px solid transparent;
814
+ border-radius: 6px;
815
+ background: transparent;
816
+ color: var(--text);
817
+ font: inherit;
818
+ font-size: 13px;
819
+ }
820
+ .object-field-control input:not([type='checkbox']):hover:not(:disabled, :focus) {
821
+ background: var(--hover);
822
+ }
823
+ .object-field-control input:not([type='checkbox']):focus-visible {
824
+ outline: none;
825
+ border-color: color-mix(in srgb, var(--text) 35%, var(--line));
826
+ background: var(--paper);
827
+ }
828
+ .object-readonly-value {
829
+ font-size: 13px;
830
+ color: var(--text);
831
+ overflow-wrap: anywhere;
832
+ padding: 4px 8px;
833
+ }
834
+ .object-detail-panel :deep(.description-heading) {
835
+ font-size: 13px;
836
+ font-weight: 500;
837
+ color: var(--text-secondary);
838
+ }
839
+ .object-detail-panel :deep(.description-preview) {
840
+ min-height: 56px;
841
+ padding: 6px 8px;
842
+ margin: 0 -8px;
843
+ border-radius: 8px;
844
+ }
845
+ .object-detail-panel :deep(.description-preview:hover) {
846
+ background: var(--hover);
847
+ }
848
+ .object-detail-panel :deep(.description-editor > textarea) {
849
+ box-sizing: border-box;
850
+ width: 100%;
851
+ padding: 10px 12px;
852
+ line-height: 1.65;
853
+ font-size: 13px;
854
+ border: 1px solid var(--control-border);
855
+ border-radius: 6px;
856
+ background: var(--paper);
857
+ color: var(--text);
858
+ min-height: 110px;
859
+ }
860
+ .object-detail-panel :deep(.object-detail-references) {
861
+ display: grid;
862
+ grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
863
+ gap: 20px;
864
+ margin-top: 20px;
865
+ padding-top: 16px;
866
+ }
867
+ .object-detail-panel :deep(.object-detail-references .reference-direction + .reference-direction) {
868
+ margin-top: 0;
869
+ }
870
+ .object-technical-details {
871
+ margin-top: 18px;
872
+ padding-top: 12px;
873
+ border-top: 1px solid var(--line);
874
+ font-size: 12px;
875
+ color: var(--muted);
876
+ }
877
+ .object-technical-details summary {
878
+ cursor: pointer;
879
+ user-select: none;
880
+ }
881
+ .object-technical-body {
882
+ display: grid;
883
+ gap: 10px;
884
+ margin-top: 10px;
885
+ }
886
+ .object-meta-line {
887
+ display: flex;
888
+ flex-wrap: wrap;
889
+ align-items: baseline;
890
+ gap: 8px;
891
+ }
892
+ .object-meta-line code {
893
+ font-size: 11px;
894
+ color: var(--text-secondary);
895
+ overflow-wrap: anywhere;
896
+ user-select: all;
897
+ }
898
+ .object-json-field {
899
+ display: grid;
900
+ gap: 6px;
901
+ }
902
+ .object-json-field textarea {
903
+ box-sizing: border-box;
904
+ width: 100%;
905
+ padding: 8px 10px;
906
+ border: 1px solid var(--line);
907
+ border-radius: 6px;
908
+ background: var(--surface);
909
+ color: var(--text);
910
+ font-family: var(--font-mono, monospace);
911
+ font-size: 12px;
912
+ resize: vertical;
913
+ }
914
+ .detail-error {
915
+ margin: 12px 0 0;
916
+ font-size: 12px;
917
+ color: var(--danger);
918
+ overflow-wrap: anywhere;
919
+ }
920
+ .object-detail-footer {
921
+ border-top: 1px solid var(--line);
922
+ background: var(--surface);
923
+ padding-bottom: max(12px, env(safe-area-inset-bottom));
924
+ }
925
+ .detail-save-state {
926
+ display: inline-flex;
927
+ align-items: center;
928
+ gap: 6px;
929
+ min-width: 0;
930
+ font-size: 12px;
931
+ color: var(--muted);
932
+ }
933
+ .detail-save-state.has-changes {
934
+ color: var(--text-secondary);
935
+ }
936
+ .detail-close,
937
+ .detail-save {
938
+ border: 0;
939
+ cursor: pointer;
940
+ font: inherit;
941
+ font-size: 13px;
942
+ }
943
+ .detail-close {
944
+ height: 34px;
945
+ padding: 0 12px;
946
+ border-radius: 7px;
947
+ background: transparent;
948
+ color: var(--text-secondary);
949
+ }
950
+ .detail-close:hover:not(:disabled) {
951
+ background: var(--hover);
952
+ color: var(--text);
953
+ }
954
+ .detail-save {
955
+ display: inline-flex;
956
+ align-items: center;
957
+ justify-content: center;
958
+ gap: 6px;
959
+ height: 34px;
960
+ min-width: 82px;
961
+ padding: 0 14px;
962
+ border-radius: 7px;
963
+ background: var(--green-fill);
964
+ color: var(--on-accent, #fff);
965
+ font-weight: 500;
966
+ }
967
+ .detail-save:hover:not(:disabled) {
968
+ background: var(--green-fill-hover);
969
+ }
970
+ .detail-save:disabled {
971
+ background: var(--hover);
972
+ color: var(--muted);
973
+ cursor: not-allowed;
974
+ }
975
+ .detail-spinner {
976
+ animation: object-detail-spin 1s linear infinite;
977
+ }
978
+ @keyframes object-detail-spin {
979
+ to {
980
+ transform: rotate(360deg);
981
+ }
982
+ }
983
+ @media (max-width: 600px) {
984
+ .object-detail-backdrop {
985
+ padding: 12px;
986
+ }
987
+ .object-detail-panel {
988
+ max-height: calc(100dvh - 24px);
989
+ }
990
+ .object-detail-content {
991
+ padding: 18px 16px 20px;
992
+ }
993
+ .object-detail-row {
994
+ grid-template-columns: minmax(0, 1fr);
995
+ gap: 4px;
996
+ }
997
+ .object-detail-panel :deep(.object-detail-references) {
998
+ grid-template-columns: minmax(0, 1fr);
999
+ }
1000
+ }
1001
+ </style>