@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.
- package/package.json +50 -16
- package/src/App.vue +82 -752
- package/src/appearance/appearance.ts +14 -4
- package/src/appearance/components/ThemePresetPreview.vue +52 -8
- package/src/appearance/interface-font.ts +99 -0
- package/src/appearance/theme.ts +26 -10
- package/src/appearance/use-interface-font.ts +30 -0
- package/src/assets/mail-provider-icons/NOTICE.txt +27 -0
- package/src/assets/mail-provider-icons/aliyun-mail.svg +3 -0
- package/src/assets/mail-provider-icons/gmail.svg +1 -0
- package/src/assets/mail-provider-icons/icloud.svg +12 -0
- package/src/assets/mail-provider-icons/netease-126.svg +5 -0
- package/src/assets/mail-provider-icons/netease-163.svg +5 -0
- package/src/assets/mail-provider-icons/qq.svg +9 -0
- package/src/assets/mail-provider-icons/tencent-exmail.svg +4 -0
- package/src/assistant/agent-identities.ts +1 -97
- package/src/assistant/agent-task-context.ts +1 -54
- package/src/assistant/attachments.ts +1 -1
- package/src/assistant/completion.ts +1 -61
- package/src/assistant/components/AssistantChangeList.vue +98 -21
- package/src/assistant/components/AssistantPanel.vue +425 -8
- package/src/assistant/components/PluginToolProposalCard.vue +235 -0
- package/src/assistant/connection-actions.ts +237 -0
- package/src/assistant/document-mentions.ts +1 -33
- package/src/assistant/engine.ts +1 -532
- package/src/assistant/execution.ts +6 -33
- package/src/assistant/files.ts +5 -13
- package/src/assistant/hash.ts +1 -4
- package/src/assistant/inbox.ts +1 -148
- package/src/assistant/language.ts +10 -37
- package/src/assistant/mention-autocomplete.ts +69 -0
- package/src/assistant/plugin-bridge-builder.ts +146 -0
- package/src/assistant/prompts.ts +1 -58
- package/src/assistant/proposal-actions.ts +336 -0
- package/src/assistant/results.ts +20 -86
- package/src/assistant/store.ts +167 -327
- package/src/assistant/structures.ts +1 -155
- package/src/assistant/tasks.ts +8 -96
- package/src/assistant/tool-rules.ts +1 -7
- package/src/assistant/workspace-bridge.ts +1 -1
- package/src/composables/use-document-actions.ts +38 -20
- package/src/composables/use-file-tree-controller.ts +7 -12
- package/src/composables/use-workbench-help.ts +177 -0
- package/src/composables/use-workbench-history.ts +2 -4
- package/src/composables/use-workbench-lifecycle.ts +249 -0
- package/src/composables/use-workbench-modals.ts +6 -1
- package/src/composables/use-workbench-outline.ts +0 -5
- package/src/composables/use-workbench-settings.ts +185 -0
- package/src/composables/use-workbench-shortcuts.ts +40 -1021
- package/src/composables/use-workbench-views.ts +325 -0
- package/src/data-tables/data-tables.ts +1 -2
- package/src/documents/components/DocumentActionMenu.vue +279 -0
- package/src/documents/components/DocumentHistoryPanel.vue +3 -1
- package/src/documents/components/DocumentInspector.vue +168 -0
- package/src/documents/components/DocumentPane.vue +482 -0
- package/src/documents/description-merge.ts +1 -9
- package/src/features.ts +1 -0
- package/src/files/components/FileMetadataPanel.vue +49 -15
- package/src/fonts/Inter-Latin-Italic.woff2 +0 -0
- package/src/fonts/Inter-Latin.woff2 +0 -0
- package/src/fonts/TanoUISansSC-Bold.woff2 +0 -0
- package/src/fonts/TanoUISansSC-Medium.woff2 +0 -0
- package/src/fonts/TanoUISansSC-Regular.woff2 +0 -0
- package/src/help/help-milestones.ts +3 -5
- package/src/i18n/locale-catalogs.ts +7 -6
- package/src/i18n/locale-registry.ts +8 -6
- package/src/i18n/locales/de-DE.json +371 -3
- package/src/i18n/locales/en-US.json +371 -2
- package/src/i18n/locales/es-ES.json +371 -3
- package/src/i18n/locales/ja-JP.json +370 -2
- package/src/i18n/locales/zh-TW.json +370 -2
- package/src/mail/components/MailAccountDialog.vue +450 -0
- package/src/mail/components/MailComposerDialog.vue +326 -0
- package/src/mail/components/MailProviderIcon.vue +30 -0
- package/src/mail/components/MailWorkspaceView.vue +821 -0
- package/src/mail/components/SidebarMail.vue +134 -0
- package/src/mail/mail-avatar.ts +17 -0
- package/src/mail/mail-bridge.ts +68 -0
- package/src/mail/mail-calendar.ts +208 -0
- package/src/mail/mail-markdown.ts +195 -0
- package/src/mail/types.ts +226 -0
- package/src/objects/components/ObjectDetailModal.vue +1001 -0
- package/src/objects/content-references.ts +6 -56
- package/src/objects/wiki-links.ts +1 -48
- package/src/objects/workspace-objects.ts +3 -4
- package/src/plan-sync/types.ts +6 -3
- package/src/plans/calendar-interaction.ts +194 -0
- package/src/plans/calendar.ts +65 -9
- package/src/plans/components/CalendarAgendaView.vue +165 -0
- package/src/plans/components/CalendarDayPopover.vue +172 -39
- package/src/plans/components/CalendarFilterBar.vue +128 -0
- package/src/plans/components/CalendarMonthView.vue +224 -0
- package/src/plans/components/CalendarQuickCreateDialog.vue +269 -0
- package/src/plans/components/CalendarTimelineView.vue +517 -0
- package/src/plans/components/CalendarTopbarControls.vue +101 -0
- package/src/plans/components/CalendarView.vue +264 -748
- package/src/plans/components/CalendarYearView.vue +138 -0
- package/src/plans/components/PlanArchiveDialog.vue +295 -0
- package/src/plans/components/PlanConnectionsDialog.vue +1 -1
- package/src/plans/components/PlanDateField.vue +6 -4
- package/src/plans/components/PlanDetailPanel.vue +227 -32
- package/src/plans/components/PlanEventList.vue +16 -4
- package/src/plans/components/SidebarPlan.vue +22 -15
- package/src/plans/components/TaskRepeatControls.vue +169 -30
- package/src/plans/components/calendar-shared.css +192 -0
- package/src/plans/composables/use-calendar-interactions.ts +396 -0
- package/src/plans/composables/use-calendar-scroll.ts +420 -0
- package/src/plans/local-reminders.ts +149 -0
- package/src/plans/personal-plans.ts +10 -1
- package/src/plans/plan-date.ts +8 -1
- package/src/plans/plan-migration.ts +95 -0
- package/src/plans/recurrence.ts +95 -0
- package/src/plans/task-repeat.ts +8 -8
- package/src/plans/timeline-layout.ts +92 -0
- package/src/plugins/assistant-bridge.ts +520 -0
- package/src/plugins/attachment-reader.ts +3 -1
- package/src/plugins/cache-storage.ts +42 -2
- package/src/plugins/components/PluginAutomations.vue +3 -3
- package/src/plugins/components/PluginCatalogBrowser.vue +17 -8
- package/src/plugins/components/PluginChangeSummary.vue +16 -3
- package/src/plugins/components/PluginConnections.vue +1 -1
- package/src/plugins/components/PluginCustomView.vue +2 -2
- package/src/plugins/components/PluginDetailPage.vue +136 -57
- package/src/plugins/components/PluginDeveloperArea.vue +192 -0
- package/src/plugins/components/PluginDocumentSlot.vue +63 -0
- package/src/plugins/components/PluginExplorer.vue +21 -25
- package/src/plugins/components/PluginImportDialog.vue +410 -0
- package/src/plugins/components/PluginInstaller.vue +273 -288
- package/src/plugins/components/PluginListItem.vue +3 -0
- package/src/plugins/components/PluginMaintenance.vue +37 -34
- package/src/plugins/components/PluginRepositoryStorage.vue +4 -2
- package/src/plugins/components/PluginRuntimePanel.vue +3 -3
- package/src/plugins/components/PluginSettingsForm.vue +112 -0
- package/src/plugins/components/PluginStatusBar.vue +161 -0
- package/src/plugins/components/PluginSurface.vue +18 -6
- package/src/plugins/components/PluginUiDialog.vue +452 -0
- package/src/plugins/components/PluginsTabPage.vue +61 -0
- package/src/plugins/components/plugin-center.css +5 -0
- package/src/plugins/data.ts +9 -86
- package/src/plugins/editor-plugin-adapters.ts +169 -0
- package/src/plugins/excalidraw/bundle.tano-plugin.json +1 -1
- package/src/plugins/excalidraw/manifest.json +12 -1
- package/src/plugins/host.ts +662 -43
- package/src/plugins/native.ts +2 -10
- package/src/plugins/overlay-mapping.ts +125 -0
- package/src/plugins/packages.ts +73 -1
- package/src/plugins/plugin-data.ts +2 -3
- package/src/plugins/plugin-permissions.ts +57 -0
- package/src/plugins/plugin-rpc-router.ts +558 -0
- package/src/plugins/plugin-sdk.ts +1 -94
- package/src/plugins/plugin-ui-dialogs.ts +167 -0
- package/src/plugins/policy.ts +53 -3
- package/src/plugins/presentation-preview/bundle.tano-plugin.json +1 -1
- package/src/plugins/presentation-preview/manifest.json +2 -1
- package/src/plugins/queries.ts +1 -73
- package/src/plugins/sandbox.ts +15 -1
- package/src/plugins/use-plugin-actions.ts +67 -20
- package/src/plugins/user-plugins.ts +254 -0
- package/src/plugins/view-header.ts +2 -7
- package/src/plugins/word-preview/bundle.tano-plugin.json +1 -1
- package/src/plugins/word-preview/manifest.json +13 -1
- package/src/plugins/workbench.ts +175 -2
- package/src/plugins/worker.js +105 -8
- package/src/plugins/workspace-plugin-runtime.ts +23 -7
- package/src/plugins/workspace-plugins.ts +212 -21
- package/src/runtime.ts +103 -4
- package/src/settings/components/SettingsAppearancePage.vue +46 -0
- package/src/settings/components/SettingsDocumentsPage.vue +0 -1
- package/src/settings/components/SettingsPanel.vue +8 -3
- package/src/settings/components/WorkbenchSettings.vue +20 -7
- package/src/settings/components/settings-context.ts +1 -1
- package/src/settings/components/settings-search.ts +2 -3
- package/src/settings/settings-tab.ts +1 -0
- package/src/shell/command-palette.ts +3 -3
- package/src/shell/components/EditorToolbar.vue +8 -9
- package/src/shell/components/EditorTools.vue +1 -5
- package/src/shell/components/PaneTopbar.vue +393 -0
- package/src/shell/components/SelectionToolbar.vue +0 -2
- package/src/shell/components/SidebarNavigation.vue +22 -2
- package/src/shell/components/WorkbenchContextMenus.vue +58 -34
- package/src/shell/components/WorkbenchModals.vue +47 -62
- package/src/shell/components/WorkbenchPanes.vue +371 -1342
- package/src/shell/components/WorkbenchSidebar.vue +486 -0
- package/src/shell/components/WorkspaceBreadcrumb.vue +6 -14
- package/src/shell/components/WorkspaceViewSwitcher.vue +12 -7
- package/src/shell/pane-registry.ts +69 -0
- package/src/shell/use-surface-dismissal.ts +219 -0
- package/src/shell/use-workbench-commands.ts +599 -0
- package/src/shell/use-workbench-keybindings.ts +337 -0
- package/src/shell/use-workbench.ts +531 -1153
- package/src/shell/workbench-async-components.ts +14 -5
- package/src/shell/workbench-context.ts +30 -3
- package/src/stores/mail.ts +414 -0
- package/src/stores/plan-sync.ts +2 -1
- package/src/stores/plans.ts +2 -9
- package/src/stores/workspace-document-io.ts +807 -0
- package/src/stores/workspace-file-ops.ts +1 -1
- package/src/stores/workspace-knowledge.ts +2 -114
- package/src/stores/workspace-lifecycle.ts +459 -0
- package/src/stores/workspace-plugins-state.ts +254 -259
- package/src/stores/workspace-session.ts +287 -0
- package/src/stores/workspace-tabs-layout.ts +6 -44
- package/src/stores/workspace-types.ts +50 -0
- package/src/stores/workspace.ts +184 -1363
- package/src/styles/agent-diff-modals.css +0 -7
- package/src/styles/dark-theme.css +3 -3
- package/src/styles/inspector.css +0 -59
- package/src/styles/layout-themes.css +346 -0
- package/src/styles/mail.css +1568 -0
- package/src/styles/mobile.css +2 -2
- package/src/styles/recent-and-media.css +0 -17
- package/src/styles/theme-contract.css +3 -3
- package/src/styles/workbench-shell.css +110 -17
- package/src/styles/workspace-states.css +9 -33
- package/src/styles.css +0 -1
- package/src/tabs/components/DesktopTabs.vue +19 -14
- package/src/tabs/components/NewTabPicker.vue +10 -4
- package/src/tabs/tab-label.ts +0 -1
- package/src/windows/AuxiliaryWindows.vue +2 -2
- package/src/windows/use-window-event-bridge.ts +152 -0
- package/src/workspace/components/TemplateLibrary.vue +1 -1
- package/src/workspace/components/WorkspaceGeneralSettings.vue +0 -13
- package/src/workspace/components/WorkspaceIconPicker.vue +30 -7
- package/src/workspace/components/WorkspacePickerMenu.vue +317 -0
- package/src/workspace/workspace-comments.ts +11 -151
- package/src/workspace/workspace-welcome.ts +1 -1
- package/src/assistant/locales/de-DE.json +0 -126
- package/src/assistant/locales/en-US.json +0 -126
- package/src/assistant/locales/es-ES.json +0 -126
- package/src/assistant/locales/ja-JP.json +0 -126
- package/src/assistant/locales/zh-CN.json +0 -126
- package/src/assistant/locales/zh-TW.json +0 -126
- package/src/assistant/task-prompts.json +0 -39
- package/src/documents/components/FormulaMenu.vue +0 -50
- package/src/files/components/FileDatabasePage.vue +0 -152
- package/src/files/components/FolderHomeIcon.vue +0 -12
- package/src/objects/components/ObjectDatabasePage.vue +0 -100
- package/src/objects/components/ObjectPanel.vue +0 -554
- package/src/plans/components/PersonalPlanDialog.vue +0 -105
- package/src/shell/components/WorkspaceViewPage.vue +0 -127
- package/src/shell/components/WorkspaceViewTab.vue +0 -24
- package/src/styles/object-panel.css +0 -163
- package/src/workspace/components/GitInspectionPanel.vue +0 -35
- package/src/workspace/components/WorkspaceSyncPanel.vue +0 -50
- package/src/workspace/welcome-slogans.ts +0 -11
- package/src/workspace/workspace-git.ts +0 -35
- package/src/workspace/workspace-sync.ts +0 -46
- package/src/workspace/workspace-views.ts +0 -48
|
@@ -1,57 +1,72 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import './plugin-center.css';
|
|
2
3
|
import { recordHelpCompleted } from '../../help/help-checklist';
|
|
3
4
|
import { usePluginActions, matchesPlugin } from '../use-plugin-actions';
|
|
4
5
|
import LoadingSkeleton from '../../shell/components/LoadingSkeleton.vue';
|
|
5
6
|
import { retiredSystemPlugin } from '../workspace-plugins';
|
|
6
7
|
import { t } from '../../i18n/i18n';
|
|
7
|
-
import { computed, nextTick, ref, watch } from 'vue';
|
|
8
|
+
import { computed, inject, nextTick, ref, useSlots, watch } from 'vue';
|
|
8
9
|
import {
|
|
9
|
-
ArrowUpRight,
|
|
10
10
|
Check,
|
|
11
11
|
ChevronDown,
|
|
12
|
-
|
|
13
|
-
LoaderCircle,
|
|
12
|
+
Code2,
|
|
14
13
|
Package,
|
|
14
|
+
Plus,
|
|
15
15
|
Search,
|
|
16
|
-
ShieldCheck,
|
|
17
|
-
Upload,
|
|
18
16
|
X,
|
|
19
17
|
} from 'lucide-vue-next';
|
|
20
|
-
import {
|
|
21
|
-
import
|
|
18
|
+
import type { PluginManifest, WorkspacePersonalPluginPolicy } from '@tano/protocol';
|
|
19
|
+
import { useWorkbenchRuntime } from '../../runtime';
|
|
20
|
+
import { workbenchPrefsKey } from '../../shell/workbench-context';
|
|
22
21
|
import PluginRuntimePanel from './PluginRuntimePanel.vue';
|
|
23
|
-
|
|
24
|
-
import PluginChangeSummary from './PluginChangeSummary.vue';
|
|
25
|
-
import PluginRepositoryStorage from './PluginRepositoryStorage.vue';
|
|
26
22
|
import PluginCatalogBrowser from './PluginCatalogBrowser.vue';
|
|
27
23
|
import PluginConnections from './PluginConnections.vue';
|
|
28
24
|
import PluginAutomations from './PluginAutomations.vue';
|
|
29
|
-
import
|
|
25
|
+
import PluginImportDialog from './PluginImportDialog.vue';
|
|
26
|
+
import PluginDeveloperArea from './PluginDeveloperArea.vue';
|
|
30
27
|
|
|
31
28
|
import { useWorkspaceStore } from '../../stores/workspace';
|
|
32
29
|
|
|
33
|
-
import PluginDialog from './PluginDialog.vue';
|
|
34
|
-
|
|
35
30
|
import PluginListItem from './PluginListItem.vue';
|
|
36
31
|
import { bundledPluginCatalog, type PluginCatalogEntry } from '../plugin-catalog';
|
|
37
32
|
|
|
38
|
-
const props = withDefaults(
|
|
39
|
-
|
|
40
|
-
|
|
33
|
+
const props = withDefaults(
|
|
34
|
+
defineProps<{
|
|
35
|
+
catalog?: readonly PluginCatalogEntry[];
|
|
36
|
+
developerMode?: boolean;
|
|
37
|
+
}>(),
|
|
38
|
+
{
|
|
39
|
+
catalog: () => bundledPluginCatalog,
|
|
40
|
+
developerMode: undefined,
|
|
41
|
+
},
|
|
42
|
+
);
|
|
43
|
+
const slots = useSlots();
|
|
44
|
+
const workbench = inject(workbenchPrefsKey, null);
|
|
45
|
+
const runtime = useWorkbenchRuntime();
|
|
41
46
|
const store = useWorkspaceStore();
|
|
42
47
|
const { error, status, pending, busy, change, installFromCatalog } = usePluginActions(undefined, () => props.catalog);
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
48
|
+
const emit = defineEmits<{
|
|
49
|
+
createObject: [type: string];
|
|
50
|
+
feedback: [status: string, error: string];
|
|
51
|
+
enableDeveloperMode: [];
|
|
52
|
+
}>();
|
|
53
|
+
|
|
54
|
+
const localDeveloperMode = ref(false);
|
|
55
|
+
const isDeveloperMode = computed(
|
|
56
|
+
() => props.developerMode ?? (workbench ? Boolean(workbench.developerMode) : localDeveloperMode.value),
|
|
57
|
+
);
|
|
58
|
+
const communityAvailable = computed(() => Boolean(store.pluginCatalogSource));
|
|
59
|
+
const automationsAvailable = computed(() => Boolean(runtime.plugins?.automations));
|
|
60
|
+
const pluginObjectTypes = computed(() =>
|
|
61
|
+
store.objectDefinitions.filter((type) => type.category === 'plugin' && type.storage === 'record'),
|
|
62
|
+
);
|
|
46
63
|
watch([status, error], ([message, failure]) => emit('feedback', message, failure));
|
|
47
|
-
|
|
64
|
+
|
|
48
65
|
const search = ref<HTMLInputElement>();
|
|
49
|
-
|
|
50
|
-
const preview = ref<PluginManifest>();
|
|
51
|
-
const previewPackage = ref<PluginPackage>();
|
|
52
|
-
type View = 'discover' | 'installed' | 'community' | 'publishing';
|
|
66
|
+
type View = 'discover' | 'installed' | 'community' | 'customize' | 'developer';
|
|
53
67
|
const view = ref<View>('discover');
|
|
54
|
-
const
|
|
68
|
+
const developerOpened = ref(false);
|
|
69
|
+
const developerSection = ref<'tools' | 'forge' | 'publishing'>('tools');
|
|
55
70
|
const query = ref('');
|
|
56
71
|
const category = ref('all');
|
|
57
72
|
const installedFilter = ref('all');
|
|
@@ -72,8 +87,6 @@ const installedById = computed(
|
|
|
72
87
|
() => new Map(store.installedPlugins.map((item) => [item.manifest.id, item])),
|
|
73
88
|
);
|
|
74
89
|
const feedbackError = computed(() => error.value || store.pluginError);
|
|
75
|
-
const hasDialog = computed(() => importing.value);
|
|
76
|
-
let importSequence = 0;
|
|
77
90
|
|
|
78
91
|
const matches = (plugin: PluginManifest) => matchesPlugin(plugin, query.value);
|
|
79
92
|
const catalog = computed(() =>
|
|
@@ -112,14 +125,46 @@ const resultsTitle = computed(() =>
|
|
|
112
125
|
watch([view, query, category, installedFilter, () => props.catalog], () => {
|
|
113
126
|
visibleLimit.value = pageSize;
|
|
114
127
|
});
|
|
128
|
+
watch(isDeveloperMode, (enabled) => {
|
|
129
|
+
if (!enabled) {
|
|
130
|
+
developerOpened.value = false;
|
|
131
|
+
if (view.value === 'developer') view.value = 'discover';
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
watch(communityAvailable, (available) => {
|
|
135
|
+
if (!available && view.value === 'community') {
|
|
136
|
+
view.value = 'discover';
|
|
137
|
+
}
|
|
138
|
+
});
|
|
115
139
|
|
|
116
140
|
function chooseView(value: View) {
|
|
117
|
-
if (value === '
|
|
141
|
+
if (value === 'community' && !communityAvailable.value) return;
|
|
142
|
+
if (value === 'customize' && !slots.customize) return;
|
|
143
|
+
if (value === 'developer' && !isDeveloperMode.value) return;
|
|
144
|
+
if (value === 'developer') developerOpened.value = true;
|
|
118
145
|
view.value = value;
|
|
119
146
|
query.value = '';
|
|
120
147
|
category.value = 'all';
|
|
121
148
|
installedFilter.value = 'all';
|
|
122
149
|
}
|
|
150
|
+
function enableDeveloperArea() {
|
|
151
|
+
if (workbench) {
|
|
152
|
+
workbench.developerMode = true;
|
|
153
|
+
} else {
|
|
154
|
+
localDeveloperMode.value = true;
|
|
155
|
+
}
|
|
156
|
+
emit('enableDeveloperMode');
|
|
157
|
+
nextTick(() => {
|
|
158
|
+
if (isDeveloperMode.value) {
|
|
159
|
+
developerSection.value = 'tools';
|
|
160
|
+
chooseView('developer');
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
function updatePersonalPolicy(value: WorkspacePersonalPluginPolicy) {
|
|
165
|
+
if (!store.workspace) return;
|
|
166
|
+
void change({ personalCodePlugins: value });
|
|
167
|
+
}
|
|
123
168
|
function clearFilters() {
|
|
124
169
|
query.value = '';
|
|
125
170
|
category.value = 'all';
|
|
@@ -130,295 +175,235 @@ function browse() {
|
|
|
130
175
|
chooseView('discover');
|
|
131
176
|
nextTick(() => search.value?.focus());
|
|
132
177
|
}
|
|
133
|
-
function showDetails(plugin: PluginManifest) {
|
|
178
|
+
function showDetails(plugin: PluginManifest) {
|
|
179
|
+
recordHelpCompleted('plugins', 'plugin-details');
|
|
180
|
+
void store.openPluginDetail(plugin.id);
|
|
181
|
+
}
|
|
134
182
|
function openImport() {
|
|
135
183
|
error.value = '';
|
|
136
184
|
status.value = '';
|
|
137
185
|
importing.value = true;
|
|
138
186
|
}
|
|
139
|
-
|
|
140
|
-
if (busy.value) return;
|
|
141
|
-
importSequence++;
|
|
142
|
-
|
|
143
|
-
importing.value = false;
|
|
144
|
-
manifestText.value = '';
|
|
145
|
-
preview.value = undefined;
|
|
146
|
-
error.value = '';
|
|
147
|
-
}
|
|
187
|
+
defineExpose({ openImport });
|
|
148
188
|
watch(
|
|
149
189
|
() => store.workspace?.id,
|
|
150
190
|
() => {
|
|
151
|
-
importSequence++;
|
|
152
191
|
importing.value = false;
|
|
153
|
-
|
|
154
|
-
manifestText.value = '';
|
|
155
|
-
preview.value = undefined;
|
|
192
|
+
developerOpened.value = false;
|
|
156
193
|
error.value = '';
|
|
157
194
|
status.value = '';
|
|
158
195
|
chooseView('discover');
|
|
159
196
|
},
|
|
160
197
|
);
|
|
161
|
-
watch(manifestText, () => {
|
|
162
|
-
preview.value = undefined;
|
|
163
|
-
previewPackage.value = undefined;
|
|
164
|
-
});
|
|
165
|
-
function inspect() {
|
|
166
|
-
error.value = '';
|
|
167
|
-
status.value = '';
|
|
168
|
-
preview.value = undefined;
|
|
169
|
-
try {
|
|
170
|
-
previewPackage.value = parsePluginPackage(manifestText.value);
|
|
171
|
-
preview.value = previewPackage.value.manifest;
|
|
172
|
-
} catch (cause) {
|
|
173
|
-
error.value =
|
|
174
|
-
cause instanceof SyntaxError
|
|
175
|
-
? t('JSON 格式有误,请检查引号、逗号和括号后重试。')
|
|
176
|
-
: String(cause);
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
async function importFile(event: Event) {
|
|
180
|
-
const file = (event.target as HTMLInputElement).files?.[0];
|
|
181
|
-
(event.target as HTMLInputElement).value = '';
|
|
182
|
-
if (!file) return;
|
|
183
|
-
preview.value = undefined;
|
|
184
|
-
error.value = '';
|
|
185
|
-
status.value = '';
|
|
186
|
-
const workspace = store.workspace?.id;
|
|
187
|
-
const sequence = ++importSequence;
|
|
188
|
-
try {
|
|
189
|
-
if (file.size > pluginPackageLimit) throw new Error(t('插件包不能超过 4 MiB'));
|
|
190
|
-
const content = await file.text();
|
|
191
|
-
if (store.workspace?.id !== workspace || sequence !== importSequence) return;
|
|
192
|
-
manifestText.value = content;
|
|
193
|
-
// Watch invalidation must finish before publishing the inspected preview.
|
|
194
|
-
await nextTick();
|
|
195
|
-
if (store.workspace?.id === workspace && sequence === importSequence) inspect();
|
|
196
|
-
} catch (cause) {
|
|
197
|
-
if (store.workspace?.id === workspace && sequence === importSequence)
|
|
198
|
-
error.value = String(cause);
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
async function importCachedPackage() {
|
|
202
|
-
try { await store.cachePluginPackage(manifestText.value); status.value = t('插件包已保存到此设备,请在详情中授权运行'); await store.refresh(); }
|
|
203
|
-
catch (cause) { error.value = String(cause); }
|
|
204
|
-
}
|
|
205
198
|
</script>
|
|
206
199
|
|
|
207
200
|
<template>
|
|
208
201
|
<div class="plugin-center">
|
|
209
202
|
<LoadingSkeleton v-if="store.workspaceLoading?.plugins" :rows="6" />
|
|
210
203
|
<div v-show="!store.workspaceLoading?.plugins" class="component-loading-content">
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
204
|
+
<div class="catalog-controls">
|
|
205
|
+
<header class="center-heading">
|
|
206
|
+
<div class="center-title">
|
|
207
|
+
<h1>{{ t('插件') }}</h1>
|
|
208
|
+
<p>{{ t('发现、安装和管理你的同页扩展。') }}</p>
|
|
209
|
+
</div>
|
|
210
|
+
<div class="heading-actions">
|
|
211
|
+
<label v-if="view === 'discover' || view === 'installed'" class="plugin-search"
|
|
212
|
+
><Search :size="15" aria-hidden="true" />
|
|
213
|
+
<input
|
|
214
|
+
ref="search"
|
|
215
|
+
v-model="query"
|
|
216
|
+
type="search"
|
|
217
|
+
:aria-label="t('查找插件')"
|
|
218
|
+
:placeholder="view === 'discover' ? t('搜索插件') : t('搜索已安装插件')"
|
|
219
|
+
/>
|
|
220
|
+
<button
|
|
221
|
+
v-if="query"
|
|
222
|
+
:aria-label="t('清空搜索')"
|
|
223
|
+
@click="
|
|
224
|
+
query = '';
|
|
225
|
+
search?.focus();
|
|
226
|
+
"
|
|
227
|
+
>
|
|
228
|
+
<X :size="14" />
|
|
229
|
+
</button>
|
|
230
|
+
</label>
|
|
231
|
+
</div>
|
|
232
|
+
</header>
|
|
233
|
+
<div class="catalog-navigation">
|
|
234
|
+
<nav class="center-nav" :aria-label="t('插件中心导航')">
|
|
227
235
|
<button
|
|
228
|
-
|
|
229
|
-
:aria-
|
|
230
|
-
@click="
|
|
231
|
-
query = '';
|
|
232
|
-
search?.focus();
|
|
233
|
-
"
|
|
236
|
+
:class="{ active: view === 'discover' }"
|
|
237
|
+
:aria-pressed="view === 'discover'"
|
|
238
|
+
@click="chooseView('discover')"
|
|
234
239
|
>
|
|
235
|
-
|
|
240
|
+
{{ t('发现') }}
|
|
236
241
|
</button>
|
|
242
|
+
<button
|
|
243
|
+
v-if="communityAvailable"
|
|
244
|
+
:class="{ active: view === 'community' }"
|
|
245
|
+
:aria-pressed="view === 'community'"
|
|
246
|
+
@click="chooseView('community')"
|
|
247
|
+
>
|
|
248
|
+
{{ t('社区目录') }}
|
|
249
|
+
</button>
|
|
250
|
+
<button
|
|
251
|
+
:class="{ active: view === 'installed' }"
|
|
252
|
+
:aria-pressed="view === 'installed'"
|
|
253
|
+
@click="chooseView('installed')"
|
|
254
|
+
>
|
|
255
|
+
{{ t('已安装') }} <span class="nav-count">{{ store.installedPlugins.length }}</span>
|
|
256
|
+
</button>
|
|
257
|
+
<button
|
|
258
|
+
v-if="$slots.customize"
|
|
259
|
+
:class="{ active: view === 'customize' }"
|
|
260
|
+
:aria-pressed="view === 'customize'"
|
|
261
|
+
@click="chooseView('customize')"
|
|
262
|
+
>
|
|
263
|
+
{{ t('工作台微调') }}
|
|
264
|
+
</button>
|
|
265
|
+
<button
|
|
266
|
+
v-if="isDeveloperMode"
|
|
267
|
+
:class="{ active: view === 'developer' }"
|
|
268
|
+
:aria-pressed="view === 'developer'"
|
|
269
|
+
@click="chooseView('developer')"
|
|
270
|
+
>
|
|
271
|
+
<Code2 :size="14" aria-hidden="true" />{{ t('开发者') }}
|
|
272
|
+
</button>
|
|
273
|
+
</nav>
|
|
274
|
+
<label v-if="view === 'discover' || view === 'installed'" class="catalog-filter">
|
|
275
|
+
<select v-if="view === 'discover'" v-model="category" :aria-label="t('插件分类')">
|
|
276
|
+
<option value="all">{{ t('全部分类') }}</option>
|
|
277
|
+
<option v-for="group in categories" :key="group.id" :value="group.id">
|
|
278
|
+
{{ group.label }} · {{ group.count }}
|
|
279
|
+
</option>
|
|
280
|
+
</select>
|
|
281
|
+
<select v-else v-model="installedFilter" :aria-label="t('安装状态')">
|
|
282
|
+
<option value="all">{{ t('全部状态') }}</option>
|
|
283
|
+
<option value="enabled">{{ t('已启用') }}</option>
|
|
284
|
+
<option value="disabled">{{ t('已停用') }}</option>
|
|
285
|
+
</select>
|
|
286
|
+
<ChevronDown :size="13" aria-hidden="true" />
|
|
237
287
|
</label>
|
|
238
|
-
<button v-if="view === 'community' && $slots.publishing" class="pc-button pc-primary" @click="chooseView('publishing')">
|
|
239
|
-
<Upload :size="15" />{{ t('发布插件') }}
|
|
240
|
-
</button>
|
|
241
|
-
<button v-if="view !== 'publishing'" class="pc-button pc-add" :aria-label="t('导入插件')" @click="openImport">
|
|
242
|
-
<Upload :size="15" />{{ t('导入') }}
|
|
243
|
-
</button>
|
|
244
288
|
</div>
|
|
245
|
-
</header>
|
|
246
|
-
<div class="catalog-navigation">
|
|
247
|
-
<nav class="center-nav" :aria-label="t('插件中心导航')">
|
|
248
|
-
<button :class="{ active: view === 'community' }" :aria-pressed="view === 'community'" @click="chooseView('community')">{{ t('社区目录') }}</button>
|
|
249
|
-
<button
|
|
250
|
-
:class="{ active: view === 'discover' }"
|
|
251
|
-
:aria-pressed="view === 'discover'"
|
|
252
|
-
@click="chooseView('discover')"
|
|
253
|
-
>
|
|
254
|
-
{{ t('发现') }}
|
|
255
|
-
</button>
|
|
256
|
-
<button
|
|
257
|
-
:class="{ active: view === 'installed' }"
|
|
258
|
-
:aria-pressed="view === 'installed'"
|
|
259
|
-
@click="chooseView('installed')"
|
|
260
|
-
>
|
|
261
|
-
{{ t('已安装') }} <span class="nav-count">{{ store.installedPlugins.length }}</span>
|
|
262
|
-
</button>
|
|
263
|
-
<button v-if="$slots.publishing" :class="{ active: view === 'publishing' }" :aria-pressed="view === 'publishing'" @click="chooseView('publishing')">{{ t('我的投稿') }}</button>
|
|
264
|
-
</nav>
|
|
265
|
-
<label v-if="view === 'discover' || view === 'installed'" class="catalog-filter">
|
|
266
|
-
<select v-if="view === 'discover'" v-model="category" :aria-label="t('插件分类')">
|
|
267
|
-
<option value="all">{{ t('全部分类') }}</option>
|
|
268
|
-
<option v-for="group in categories" :key="group.id" :value="group.id">
|
|
269
|
-
{{ group.label }} · {{ group.count }}
|
|
270
|
-
</option>
|
|
271
|
-
</select>
|
|
272
|
-
<select v-else v-model="installedFilter" :aria-label="t('安装状态')">
|
|
273
|
-
<option value="all">{{ t('全部状态') }}</option>
|
|
274
|
-
<option value="enabled">{{ t('已启用') }}</option>
|
|
275
|
-
<option value="disabled">{{ t('已停用') }}</option>
|
|
276
|
-
</select>
|
|
277
|
-
<ChevronDown :size="13" aria-hidden="true" />
|
|
278
|
-
</label>
|
|
279
289
|
</div>
|
|
280
|
-
</div>
|
|
281
|
-
|
|
282
|
-
<template v-if="!hasDialog && view !== 'publishing'">
|
|
283
|
-
<p v-if="feedbackError" class="pc-feedback error" role="alert">{{ feedbackError }}</p>
|
|
284
|
-
<p v-if="status" class="pc-feedback success" role="status">
|
|
285
|
-
<Check :size="15" />{{ status }}
|
|
286
|
-
</p>
|
|
287
|
-
</template>
|
|
288
290
|
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
<h2>{{ resultsTitle }}</h2>
|
|
296
|
-
<span class="result-count" role="status" :aria-label="t('{0} 款插件', [resultCount])">{{
|
|
297
|
-
resultCount
|
|
298
|
-
}}</span>
|
|
299
|
-
</div>
|
|
300
|
-
<div v-if="visiblePlugins.length" class="plugin-list">
|
|
301
|
-
<PluginListItem
|
|
302
|
-
v-for="plugin in visiblePlugins"
|
|
303
|
-
:key="plugin.id"
|
|
304
|
-
:plugin="plugin"
|
|
305
|
-
:installed="installedById.has(plugin.id)"
|
|
306
|
-
:enabled="installedById.get(plugin.id)?.enabled"
|
|
307
|
-
:show-state="view === 'installed'"
|
|
308
|
-
:busy="busy || !store.canManagePlugins"
|
|
309
|
-
:pending="pending === plugin.id"
|
|
310
|
-
@details="showDetails(plugin)"
|
|
311
|
-
@install="installFromCatalog(plugin)"
|
|
312
|
-
/>
|
|
313
|
-
</div>
|
|
314
|
-
<div v-else-if="view === 'installed' && !store.installedPlugins.length" class="pc-empty">
|
|
315
|
-
<Package :size="28" :stroke-width="1.4" />
|
|
316
|
-
<h3>{{ t('还没有安装插件') }}</h3>
|
|
317
|
-
<p>{{ t('去发现适合你的插件,或导入自己的插件。') }}</p>
|
|
318
|
-
<button class="pc-button pc-secondary" @click="browse">{{ t('浏览插件') }}</button>
|
|
319
|
-
</div>
|
|
320
|
-
<div v-else class="pc-empty">
|
|
321
|
-
<Search :size="28" :stroke-width="1.4" />
|
|
322
|
-
<h3>{{ t('没有找到匹配的插件') }}</h3>
|
|
323
|
-
<p>{{ t('试试其他关键词,或调整筛选条件。') }}</p>
|
|
324
|
-
<button class="pc-button pc-secondary" @click="clearFilters">{{ t('重置筛选') }}</button>
|
|
325
|
-
</div>
|
|
326
|
-
<div v-if="remaining" class="catalog-more">
|
|
327
|
-
<button class="pc-button pc-secondary" @click="visibleLimit += pageSize">
|
|
328
|
-
{{ t('显示更多') }} <ChevronDown :size="14" /></button
|
|
329
|
-
><span>{{ t('已显示') }} {{ visiblePlugins.length }} / {{ resultCount }}</span>
|
|
330
|
-
</div>
|
|
331
|
-
<p v-if="view === 'installed' && visiblePlugins.length" class="installed-note">
|
|
332
|
-
{{ t('插件版本与共享设置跟随工作区;个人启用和代码授权保存在此设备。卸载后保留已有内容。') }}
|
|
333
|
-
</p>
|
|
334
|
-
</section>
|
|
291
|
+
<template v-if="!importing && view !== 'developer'">
|
|
292
|
+
<p v-if="feedbackError" class="pc-feedback error" role="alert">{{ feedbackError }}</p>
|
|
293
|
+
<p v-if="status" class="pc-feedback success" role="status">
|
|
294
|
+
<Check :size="15" />{{ status }}
|
|
295
|
+
</p>
|
|
296
|
+
</template>
|
|
335
297
|
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
v-if="
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
<
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
<input
|
|
363
|
-
ref="input"
|
|
364
|
-
type="file"
|
|
365
|
-
accept=".json,application/json"
|
|
366
|
-
hidden
|
|
367
|
-
@change="importFile"
|
|
368
|
-
/>
|
|
369
|
-
<button class="import-file" :disabled="busy" @click="input?.click()">
|
|
370
|
-
<Upload :size="25" /><strong>{{ t('选择 JSON 文件') }}</strong
|
|
371
|
-
><span>{{ t('支持 .json 文件,最大 4 MiB') }}</span>
|
|
372
|
-
</button>
|
|
373
|
-
<label class="manifest-label" for="plugin-manifest">{{ t('或粘贴插件清单') }}</label>
|
|
374
|
-
<textarea
|
|
375
|
-
id="plugin-manifest"
|
|
376
|
-
v-model="manifestText"
|
|
377
|
-
:aria-label="t('插件 JSON 清单')"
|
|
378
|
-
:disabled="busy"
|
|
379
|
-
spellcheck="false"
|
|
380
|
-
:placeholder="t('在此粘贴 JSON 内容…')"
|
|
381
|
-
rows="6"
|
|
382
|
-
/>
|
|
383
|
-
<div class="import-check">
|
|
384
|
-
<span>{{ t('代码插件需要单独授权;导入和检查不会执行脚本。') }}</span
|
|
385
|
-
><button
|
|
386
|
-
class="pc-button pc-secondary"
|
|
387
|
-
:disabled="!manifestText.trim() || busy"
|
|
388
|
-
@click="inspect"
|
|
389
|
-
>
|
|
390
|
-
{{ t('检查清单') }}
|
|
391
|
-
</button>
|
|
298
|
+
<PluginDeveloperArea
|
|
299
|
+
v-if="developerOpened && isDeveloperMode"
|
|
300
|
+
v-show="view === 'developer'"
|
|
301
|
+
:can-publish="!!$slots.publishing"
|
|
302
|
+
:initial-section="developerSection"
|
|
303
|
+
@open-import="openImport"
|
|
304
|
+
>
|
|
305
|
+
<template v-if="$slots.forge" #forge="slotProps">
|
|
306
|
+
<slot name="forge" v-bind="slotProps" />
|
|
307
|
+
</template>
|
|
308
|
+
<template v-if="$slots.publishing" #publishing="slotProps">
|
|
309
|
+
<slot name="publishing" v-bind="slotProps" />
|
|
310
|
+
</template>
|
|
311
|
+
</PluginDeveloperArea>
|
|
312
|
+
<PluginCatalogBrowser v-if="view === 'community' && communityAvailable" />
|
|
313
|
+
<slot v-else-if="view === 'customize' && $slots.customize" name="customize" :developer-mode="isDeveloperMode" />
|
|
314
|
+
<section
|
|
315
|
+
v-else-if="view === 'discover' || view === 'installed'"
|
|
316
|
+
class="catalog-results"
|
|
317
|
+
:aria-label="view === 'discover' ? t('可安装插件') : t('已安装插件')"
|
|
318
|
+
>
|
|
319
|
+
<div class="catalog-heading">
|
|
320
|
+
<h2>{{ resultsTitle }}</h2>
|
|
321
|
+
<span class="result-count" role="status" :aria-label="t('{0} 款插件', [resultCount])">{{
|
|
322
|
+
resultCount
|
|
323
|
+
}}</span>
|
|
392
324
|
</div>
|
|
393
|
-
<div v-if="
|
|
394
|
-
<
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
@click="change({ install: preview, package: previewPackage })"
|
|
408
|
-
>
|
|
409
|
-
<Download :size="15" />{{
|
|
410
|
-
installedById.has(preview.id) ? t('更新并启用插件') : t('安装此插件')
|
|
411
|
-
}}
|
|
412
|
-
</button>
|
|
413
|
-
<button v-if="preview.manifestVersion === 2" class="pc-button pc-secondary" :disabled="busy" @click="importCachedPackage">{{ t('仅保存到此设备') }}</button>
|
|
325
|
+
<div v-if="visiblePlugins.length" class="plugin-list">
|
|
326
|
+
<PluginListItem
|
|
327
|
+
v-for="plugin in visiblePlugins"
|
|
328
|
+
:key="plugin.id"
|
|
329
|
+
:plugin="plugin"
|
|
330
|
+
:installed="installedById.has(plugin.id)"
|
|
331
|
+
:enabled="installedById.get(plugin.id)?.enabled"
|
|
332
|
+
:scope="installedById.get(plugin.id)?.scope"
|
|
333
|
+
:show-state="view === 'installed'"
|
|
334
|
+
:busy="busy || !store.canManagePlugins"
|
|
335
|
+
:pending="pending === plugin.id"
|
|
336
|
+
@details="showDetails(plugin)"
|
|
337
|
+
@install="installFromCatalog(plugin)"
|
|
338
|
+
/>
|
|
414
339
|
</div>
|
|
415
|
-
|
|
416
|
-
|
|
340
|
+
<div v-else-if="view === 'installed' && !store.installedPlugins.length" class="pc-empty">
|
|
341
|
+
<Package :size="28" :stroke-width="1.4" />
|
|
342
|
+
<h3>{{ t('还没有安装插件') }}</h3>
|
|
343
|
+
<p>{{ t('去发现适合你的插件,扩展你的工作台能力。') }}</p>
|
|
344
|
+
<button class="pc-button pc-secondary" @click="browse">{{ t('浏览插件') }}</button>
|
|
345
|
+
</div>
|
|
346
|
+
<div v-else class="pc-empty">
|
|
347
|
+
<Search :size="28" :stroke-width="1.4" />
|
|
348
|
+
<h3>{{ t('没有找到匹配的插件') }}</h3>
|
|
349
|
+
<p>{{ t('试试其他关键词,或调整筛选条件。') }}</p>
|
|
350
|
+
<button class="pc-button pc-secondary" @click="clearFilters">{{ t('重置筛选') }}</button>
|
|
351
|
+
</div>
|
|
352
|
+
<div v-if="remaining" class="catalog-more">
|
|
353
|
+
<button class="pc-button pc-secondary" @click="visibleLimit += pageSize">
|
|
354
|
+
{{ t('显示更多') }} <ChevronDown :size="14" /></button
|
|
355
|
+
><span>{{ t('已显示') }} {{ visiblePlugins.length }} / {{ resultCount }}</span>
|
|
356
|
+
</div>
|
|
357
|
+
|
|
358
|
+
<template v-if="view === 'installed'">
|
|
359
|
+
<p v-if="visiblePlugins.length" class="installed-note">
|
|
360
|
+
{{ t('工作区插件与共享设置跟随工作区;全局插件、个人启用和代码授权保存在此设备,跨工作区生效。卸载后保留已有内容。') }}
|
|
361
|
+
</p>
|
|
362
|
+
<div v-if="store.canManagePlugins && store.workspace" class="workspace-plugin-policy">
|
|
363
|
+
<label>
|
|
364
|
+
<span>{{ t('本工作区对个人代码插件的策略') }}</span>
|
|
365
|
+
<select
|
|
366
|
+
:value="store.personalCodePluginPolicy"
|
|
367
|
+
:disabled="busy"
|
|
368
|
+
:aria-label="t('本工作区对个人代码插件的策略')"
|
|
369
|
+
@change="updatePersonalPolicy(($event.target as HTMLSelectElement).value as WorkspacePersonalPluginPolicy)"
|
|
370
|
+
>
|
|
371
|
+
<option value="allow">{{ t('允许运行(遵循个人授权)') }}</option>
|
|
372
|
+
<option value="read-only">{{ t('仅允许只读访问(禁止写入)') }}</option>
|
|
373
|
+
<option value="block">{{ t('禁止个人代码插件访问本工作区') }}</option>
|
|
374
|
+
</select>
|
|
375
|
+
</label>
|
|
376
|
+
</div>
|
|
377
|
+
<PluginRuntimePanel v-if="store.pluginRuntime.length" />
|
|
378
|
+
<PluginConnections v-if="store.pluginConnectionStorageLabel" />
|
|
379
|
+
<PluginAutomations v-if="automationsAvailable" />
|
|
380
|
+
</template>
|
|
381
|
+
</section>
|
|
382
|
+
|
|
383
|
+
<footer v-if="view !== 'developer' && view !== 'customize'" class="center-footer">
|
|
384
|
+
<span v-if="communityAvailable">{{ t('社区目录已接入 · 版本由工作区管理员选择') }}</span>
|
|
385
|
+
<button
|
|
386
|
+
v-if="!isDeveloperMode"
|
|
387
|
+
type="button"
|
|
388
|
+
class="dev-optin-link"
|
|
389
|
+
@click="enableDeveloperArea"
|
|
390
|
+
>
|
|
391
|
+
<Code2 :size="13" aria-hidden="true" />{{ t('开启开发者模式以导入或开发插件') }}
|
|
392
|
+
</button>
|
|
393
|
+
<button
|
|
394
|
+
v-if="pluginObjectTypes.length"
|
|
395
|
+
:disabled="!store.workspace || store.workspace.readOnly || !store.capabilities.features.objectReferences"
|
|
396
|
+
@click="emit('createObject', pluginObjectTypes[0]!.type)"
|
|
397
|
+
>
|
|
398
|
+
<Plus :size="13" />{{ t('新建插件对象') }}
|
|
399
|
+
</button>
|
|
400
|
+
</footer>
|
|
401
|
+
<PluginImportDialog
|
|
402
|
+
v-if="importing"
|
|
403
|
+
@close="importing = false"
|
|
404
|
+
@installed="chooseView('installed')"
|
|
405
|
+
@feedback="(message, failure) => { status = message; error = failure; }"
|
|
406
|
+
/>
|
|
417
407
|
</div>
|
|
418
408
|
</div>
|
|
419
409
|
</template>
|
|
420
|
-
|
|
421
|
-
<style scoped src="./plugin-center.css"></style>
|
|
422
|
-
|
|
423
|
-
<style scoped>
|
|
424
|
-
</style>
|