From 996696057f7ec229fd1930188955283042f0c852 Mon Sep 17 00:00:00 2001 From: lyingbug Date: Sat, 26 Sep 2026 14:46:49 +0800 Subject: [PATCH] feat(plugin): sandboxed plugin pages and the @weknora/plugin-ui bridge (P2 batch 5) (#3727) * feat(plugin): sandboxed plugin pages and the @weknora/plugin-ui bridge * ci(pluginsdk): run the Python job's steps in bash on Windows too --- .github/workflows/plugin-sdk.yml | 11 +- examples/plugins/links/main.py | 78 +++++++ examples/plugins/links/package.sh | 18 ++ examples/plugins/links/plugin.yaml | 31 +++ examples/plugins/links/test_main.py | 56 +++++ examples/plugins/links/ui/app.css | 41 ++++ examples/plugins/links/ui/index.html | 13 ++ examples/plugins/links/ui/kb.html | 13 ++ examples/plugins/links/ui/links.js | 95 ++++++++ examples/plugins/links/ui/manage.html | 13 ++ frontend/src/api/plugin.ts | 41 +++- frontend/src/config/toolbox.test.ts | 3 +- .../extensions/pluginFrame/PluginFrame.vue | 192 ++++++++++++++++ .../extensions/pluginFrame/bridgeHost.test.ts | 113 +++++++++ .../src/extensions/pluginFrame/bridgeHost.ts | 214 ++++++++++++++++++ .../pluginFrame/pluginPages.test.ts | 44 ++++ .../src/extensions/pluginFrame/pluginPages.ts | 74 ++++++ .../extensions/pluginFrame/settingsSync.ts | 41 ++++ frontend/src/i18n/locales/en-US.ts | 10 +- frontend/src/i18n/locales/ja-JP.ts | 10 +- frontend/src/i18n/locales/ko-KR.ts | 10 +- frontend/src/i18n/locales/ru-RU.ts | 10 +- frontend/src/i18n/locales/zh-CN.ts | 10 +- frontend/src/stores/auth.ts | 2 + frontend/src/stores/pluginPages.ts | 55 +++++ .../src/views/knowledge/KnowledgeBase.vue | 49 +++- frontend/src/views/settings/PluginCenter.vue | 5 + frontend/src/views/settings/Settings.vue | 19 +- frontend/src/views/toolbox/Toolbox.vue | 54 ++++- internal/container/container.go | 2 + internal/container/plugin_runtime.go | 3 +- internal/handler/plugin.go | 11 +- internal/handler/plugin_ui.go | 178 +++++++++++++++ internal/handler/plugin_ui_test.go | 153 +++++++++++++ internal/plugin/activate/ui.go | 110 +++++++++ internal/plugin/manifest/manifest.go | 37 +++ internal/plugin/manifest/manifest_test.go | 26 +++ internal/plugin/manifest/point.go | 21 ++ internal/plugin/pkg/pkg.go | 3 + internal/router/router.go | 8 +- internal/router/routes_plugin.go | 10 +- packages/plugin-ui/README.md | 61 +++++ packages/plugin-ui/index.d.ts | 63 ++++++ packages/plugin-ui/index.js | 174 ++++++++++++++ packages/plugin-ui/package.json | 13 ++ pluginsdk/README.md | 23 ++ pluginsdk/conformance/conformance.go | 8 + pluginsdk/openapi_test.go | 2 +- pluginsdk/plugin.go | 5 + pluginsdk/plugin_test.go | 35 +++ pluginsdk/pluginapi/openapi.yaml | 43 ++++ pluginsdk/pluginapi/ui.go | 31 +++ pluginsdk/python/README.md | 14 ++ .../python/src/weknora_plugin/__init__.py | 4 + pluginsdk/python/src/weknora_plugin/plugin.py | 27 +++ pluginsdk/python/src/weknora_plugin/types.py | 27 ++- pluginsdk/python/tests/fixture.py | 8 + pluginsdk/python/tests/test_plugin.py | 18 +- pluginsdk/ui.go | 51 +++++ website-docs/03-features/25-plugins.md | 19 +- 60 files changed, 2475 insertions(+), 38 deletions(-) create mode 100644 examples/plugins/links/main.py create mode 100755 examples/plugins/links/package.sh create mode 100644 examples/plugins/links/plugin.yaml create mode 100644 examples/plugins/links/test_main.py create mode 100644 examples/plugins/links/ui/app.css create mode 100644 examples/plugins/links/ui/index.html create mode 100644 examples/plugins/links/ui/kb.html create mode 100644 examples/plugins/links/ui/links.js create mode 100644 examples/plugins/links/ui/manage.html create mode 100644 frontend/src/extensions/pluginFrame/PluginFrame.vue create mode 100644 frontend/src/extensions/pluginFrame/bridgeHost.test.ts create mode 100644 frontend/src/extensions/pluginFrame/bridgeHost.ts create mode 100644 frontend/src/extensions/pluginFrame/pluginPages.test.ts create mode 100644 frontend/src/extensions/pluginFrame/pluginPages.ts create mode 100644 frontend/src/extensions/pluginFrame/settingsSync.ts create mode 100644 frontend/src/stores/pluginPages.ts create mode 100644 internal/handler/plugin_ui.go create mode 100644 internal/handler/plugin_ui_test.go create mode 100644 internal/plugin/activate/ui.go create mode 100644 packages/plugin-ui/README.md create mode 100644 packages/plugin-ui/index.d.ts create mode 100644 packages/plugin-ui/index.js create mode 100644 packages/plugin-ui/package.json create mode 100644 pluginsdk/pluginapi/ui.go create mode 100644 pluginsdk/ui.go diff --git a/.github/workflows/plugin-sdk.yml b/.github/workflows/plugin-sdk.yml index 6c06455f..fd863d09 100644 --- a/.github/workflows/plugin-sdk.yml +++ b/.github/workflows/plugin-sdk.yml @@ -11,11 +11,13 @@ on: paths: - 'pluginsdk/**' - 'examples/plugins/notebooks/**' + - 'examples/plugins/links/**' - '.github/workflows/plugin-sdk.yml' pull_request: paths: - 'pluginsdk/**' - 'examples/plugins/notebooks/**' + - 'examples/plugins/links/**' - '.github/workflows/plugin-sdk.yml' defaults: @@ -63,6 +65,8 @@ jobs: defaults: run: working-directory: pluginsdk/python + # A job's run defaults replace the workflow's, shell included. + shell: bash steps: - uses: actions/checkout@v6 - uses: actions/setup-python@v6 @@ -70,8 +74,9 @@ jobs: python-version: ${{ matrix.python }} - name: unittest run: python -W error::ResourceWarning -m unittest discover -s tests -v - - name: example plugin - working-directory: examples/plugins/notebooks - run: python -m unittest -v test_main + - name: example plugins + run: | + (cd ../../examples/plugins/notebooks && python -m unittest -v test_main) + (cd ../../examples/plugins/links && python -m unittest -v test_main) - name: build the package run: python -m pip install build && python -m build diff --git a/examples/plugins/links/main.py b/examples/plugins/links/main.py new file mode 100644 index 00000000..184a1c1d --- /dev/null +++ b/examples/plugins/links/main.py @@ -0,0 +1,78 @@ +"""A WeKnora plugin with pages, written with the Python SDK: a toolbox page +listing the workspace's links, a settings section where admins edit them, +and a tab on each knowledge base with links about it. The pages run +sandboxed in the browser and reach this code only through the bridge +(wk.get / wk.put), which WeKnora relays as UI requests.""" + +from __future__ import annotations + +import re +from urllib.parse import urlparse + +from weknora_plugin import ErrorCode, Plugin, PluginError, UIResponse + +plugin = Plugin("weknora-examples.links", "1.0.0") + +MAX_LINKS = 200 +EDITORS = {"contributor", "admin", "owner"} +KB_PATH = re.compile(r"^/kb/([A-Za-z0-9_-]{1,64})/links$") + + +def clean_links(value) -> list: + """Validates links from a page: [{title, url}], http(s) only.""" + if not isinstance(value, list) or len(value) > MAX_LINKS: + raise ValueError(f"send a list of at most {MAX_LINKS} links") + out = [] + for item in value: + if not isinstance(item, dict): + raise ValueError("each link is an object with a title and a url") + title = str(item.get("title") or "").strip()[:120] + url = str(item.get("url") or "").strip() + parsed = urlparse(url) + if parsed.scheme not in ("http", "https") or not parsed.netloc: + raise ValueError(f"{url or 'an empty url'} is not an http(s) link") + out.append({"title": title or parsed.netloc, "url": url[:2000]}) + return out + + +def store(call): + host = call.host() + if host is None: + raise PluginError(ErrorCode.UNAVAILABLE, "the Host API is not available to this plugin") + return host + + +def handle(call, req) -> UIResponse: + host = store(call) + if req.path == "/links": + if req.method == "GET": + return UIResponse(body=host.kv_get("links", [])) + # Only the settings section edits the workspace's links; WeKnora + # lets admins alone open it. + if req.method == "PUT" and req.mount == "settingsSections/manage": + return save(host, "links", req.body) + m = KB_PATH.match(req.path) + if m and req.mount == "kbTabs/links": + key = f"kb:{m.group(1)}" + if req.method == "GET": + return UIResponse(body=host.kv_get(key, [])) + if req.method == "PUT": + if req.role not in EDITORS: + return UIResponse(status=403, body={"error": "only editors of the workspace can change links"}) + return save(host, key, req.body) + return UIResponse(status=404, body={"error": f"no {req.method} {req.path} here"}) + + +def save(host, key, body) -> UIResponse: + try: + links = clean_links(body) + except ValueError as e: + return UIResponse(status=400, body={"error": str(e)}) + host.kv_put(key, links) + return UIResponse(body=links) + + +plugin.ui(handle) + +if __name__ == "__main__": + plugin.serve() diff --git a/examples/plugins/links/package.sh b/examples/plugins/links/package.sh new file mode 100755 index 00000000..18d1b053 --- /dev/null +++ b/examples/plugins/links/package.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# Packages the links example plugin as a .wkp: plugin.yaml, main.py, the +# pages under ui/ with the bridge library, and the Python SDK under vendor/. +set -euo pipefail +cd "$(dirname "$0")" +version=$(sed -n 's/^version: //p' plugin.yaml) +out=${1:-"weknora-examples-links-${version}.wkp"} +stage=$(mktemp -d) +trap 'rm -rf "$stage"' EXIT +cp plugin.yaml main.py "$stage"/ +cp -r ui "$stage"/ +cp ../../../packages/plugin-ui/index.js "$stage/ui/weknora-plugin-ui.js" +mkdir -p "$stage/vendor" +cp -r ../../../pluginsdk/python/src/weknora_plugin "$stage/vendor/" +find "$stage" -name __pycache__ -prune -exec rm -rf {} + +rm -f "$out" +(cd "$stage" && zip -qr - .) > "$out" +echo "wrote $out" diff --git a/examples/plugins/links/plugin.yaml b/examples/plugins/links/plugin.yaml new file mode 100644 index 00000000..007a1a6e --- /dev/null +++ b/examples/plugins/links/plugin.yaml @@ -0,0 +1,31 @@ +schemaVersion: 1 +id: weknora-examples.links +version: 1.0.0 +apiVersion: weknora.plugin/v1 +name: { en-US: Team links, zh-CN: 团队链接 } +description: + en-US: A page of links for the workspace and a tab of links on each knowledge base. Shows plugin pages, written in Python. + zh-CN: 空间的常用链接页,以及每个知识库上的链接页签。演示插件页面,用 Python 编写。 +publisher: { id: weknora-examples, name: WeKnora examples } +homepage: https://github.com/Tencent/WeKnora/tree/main/examples/plugins/links +license: MIT +runtime: { type: host, kind: python, entry: main.py } +permissions: + # Links live in the plugin's key-value store, per workspace. + hostApi: [kv] +contributes: + pages: + - id: links + name: { en-US: Team links, zh-CN: 团队链接 } + description: { en-US: Links the workspace shares, zh-CN: 空间共享的常用链接 } + entry: ui/index.html + settingsSections: + - id: manage + name: { en-US: Team links, zh-CN: 团队链接 } + entry: ui/manage.html + # minRole defaults to admin for settings sections + kbTabs: + - id: links + name: { en-US: Links, zh-CN: 链接 } + description: { en-US: Links about this knowledge base, zh-CN: 与本知识库相关的链接 } + entry: ui/kb.html diff --git a/examples/plugins/links/test_main.py b/examples/plugins/links/test_main.py new file mode 100644 index 00000000..0726c619 --- /dev/null +++ b/examples/plugins/links/test_main.py @@ -0,0 +1,56 @@ +import os +import sys +import unittest + +HERE = os.path.dirname(os.path.abspath(__file__)) +sys.path.insert(0, os.path.join(HERE, "..", "..", "..", "pluginsdk", "python", "src")) +sys.path.insert(0, HERE) + +import main # noqa: E402 +from weknora_plugin import UIRequest # noqa: E402 + + +class FakeHost: + def __init__(self): + self.data = {} + + def kv_get(self, key, default=None): + return self.data.get(key, default) + + def kv_put(self, key, value, ttl=0): + self.data[key] = value + + +class LinksTest(unittest.TestCase): + def setUp(self): + self.host = FakeHost() + main.store = lambda call: self.host + + def req(self, mount, method, path, body=None, role="viewer"): + return main.handle(None, UIRequest(mount=mount, method=method, path=path, body=body, role=role)) + + def test_workspace_links(self): + self.assertEqual(self.req("pages/links", "GET", "/links").body, []) + links = [{"title": "", "url": "https://github.com/Tencent/WeKnora"}] + # Only the settings section (admins) writes the workspace's links. + self.assertEqual(self.req("pages/links", "PUT", "/links", links, role="owner").status, 404) + saved = self.req("settingsSections/manage", "PUT", "/links", links, role="admin") + self.assertEqual(saved.body, [{"title": "github.com", "url": "https://github.com/Tencent/WeKnora"}]) + self.assertEqual(self.req("pages/links", "GET", "/links").body, saved.body) + + def test_kb_links(self): + path = "/kb/kb-1/links" + self.assertEqual(self.req("kbTabs/links", "PUT", path, [], role="viewer").status, 403) + self.assertEqual(self.req("kbTabs/links", "PUT", path, [{"title": "Spec", "url": "http://x.example"}], role="contributor").status, 200) + self.assertEqual(self.req("kbTabs/links", "GET", path).body[0]["title"], "Spec") + self.assertEqual(self.req("kbTabs/links", "GET", "/kb/kb-2/links").body, []) + self.assertEqual(self.req("pages/links", "GET", path).status, 404) + + def test_bad_links(self): + for body in ({"url": "x"}, [{"url": "javascript:alert(1)"}], [{"url": "ftp://x"}], [{}] * 201): + resp = self.req("settingsSections/manage", "PUT", "/links", body, role="admin") + self.assertEqual(resp.status, 400, body) + + +if __name__ == "__main__": + unittest.main() diff --git a/examples/plugins/links/ui/app.css b/examples/plugins/links/ui/app.css new file mode 100644 index 00000000..d875d490 --- /dev/null +++ b/examples/plugins/links/ui/app.css @@ -0,0 +1,41 @@ +/* Colours and fonts come from the app theme (--wk-* variables, set by the + bridge), with fallbacks for opening the page on its own. */ +:root { + color-scheme: light; + --fg: var(--wk-text-color-primary, #1f2329); + --muted: var(--wk-text-color-secondary, #646a73); + --line: var(--wk-component-border, #dee0e3); + --card: var(--wk-bg-color-container, #fff); + --brand: var(--wk-brand-color, #0052d9); + --danger: var(--wk-error-color, #d54941); + --radius: var(--wk-radius-default, 6px); +} +:root[data-theme='dark'] { color-scheme: dark; } +* { box-sizing: border-box; } +body { + margin: 0; + font: 14px/1.5 var(--wk-font-family, system-ui, sans-serif); + color: var(--fg); + background: transparent; +} +main { padding: 4px 2px 12px; } +.empty { color: var(--muted); padding: 24px 0; text-align: center; } +ul.links { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; } +.links li { + display: flex; align-items: center; gap: 10px; + padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); +} +.links a { color: var(--brand); text-decoration: none; font-weight: 500; } +.links a:hover { text-decoration: underline; } +.links .url { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; } +form { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; } +input { + flex: 1; min-width: 140px; padding: 6px 10px; font: inherit; color: var(--fg); + background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); +} +button { + padding: 6px 14px; font: inherit; border-radius: var(--radius); cursor: pointer; + border: 1px solid var(--brand); background: var(--brand); color: #fff; +} +button.remove { border-color: transparent; background: transparent; color: var(--danger); padding: 4px 8px; } +button:disabled { opacity: 0.6; cursor: default; } diff --git a/examples/plugins/links/ui/index.html b/examples/plugins/links/ui/index.html new file mode 100644 index 00000000..d71690eb --- /dev/null +++ b/examples/plugins/links/ui/index.html @@ -0,0 +1,13 @@ + + + + + + Team links + + + +
+ + + diff --git a/examples/plugins/links/ui/kb.html b/examples/plugins/links/ui/kb.html new file mode 100644 index 00000000..f1214a57 --- /dev/null +++ b/examples/plugins/links/ui/kb.html @@ -0,0 +1,13 @@ + + + + + + Team links + + + +
+ + + diff --git a/examples/plugins/links/ui/links.js b/examples/plugins/links/ui/links.js new file mode 100644 index 00000000..f2bdbb40 --- /dev/null +++ b/examples/plugins/links/ui/links.js @@ -0,0 +1,95 @@ +// The three pages of the plugin. They run in a sandboxed iframe: no network, +// no storage of the app. Everything goes through the bridge (wk.*), which +// the app relays to main.py. +import { connect } from './weknora-plugin-ui.js' + +const TEXT = { + en: { + empty: 'No links yet.', emptyManage: 'No links yet. Add the first one below.', + title: 'Title', url: 'https://…', add: 'Add', remove: 'Remove', saved: 'Links saved', + confirm: 'Remove this link?', readOnly: 'Only editors of the workspace can change these links.', + }, + zh: { + empty: '还没有链接。', emptyManage: '还没有链接,在下方添加第一个。', + title: '标题', url: 'https://…', add: '添加', remove: '删除', saved: '链接已保存', + confirm: '删除这个链接?', readOnly: '只有空间的编辑者可以修改这些链接。', + }, +} + +const wk = await connect() +const app = document.getElementById('app') +const mode = document.body.dataset.mode +let text = pick(wk.context.locale) +wk.on('locale', (locale) => { + text = pick(locale) + void load() +}) +// A knowledge base tab follows the app to another knowledge base. +wk.on('init', () => void load()) + +function pick(locale) { + return String(locale || '').startsWith('zh') ? TEXT.zh : TEXT.en +} + +function path() { + return mode === 'kb' ? `/kb/${wk.context.context.knowledgeBaseId}/links` : '/links' +} + +function el(tag, props = {}, ...children) { + const node = Object.assign(document.createElement(tag), props) + node.append(...children) + return node +} + +async function load() { + app.setAttribute('aria-busy', 'true') + try { + const { body } = await wk.get(path()) + render(Array.isArray(body) ? body : []) + } catch (e) { + app.replaceChildren(el('p', { className: 'empty', textContent: e.message })) + } finally { + app.removeAttribute('aria-busy') + } +} + +async function save(links) { + try { + const { body } = await wk.put(path(), links) + await wk.toast(text.saved, 'success') + render(body) + } catch (e) { + await wk.toast(e.message, 'error') + } +} + +function render(links) { + const editable = mode === 'manage' || (mode === 'kb' && wk.context.role !== 'viewer') + const list = el('ul', { className: 'links' }) + links.forEach((link, i) => { + const a = el('a', { href: link.url, target: '_blank', rel: 'noopener noreferrer', textContent: link.title }) + const item = el('li', {}, a, el('span', { className: 'url', textContent: link.url })) + if (editable) { + const remove = el('button', { className: 'remove', type: 'button', textContent: text.remove }) + remove.addEventListener('click', async () => { + if (await wk.confirm(text.confirm)) await save(links.filter((_, j) => j !== i)) + }) + item.append(remove) + } + list.append(item) + }) + const nodes = links.length ? [list] : [el('p', { className: 'empty', textContent: mode === 'manage' ? text.emptyManage : text.empty })] + if (editable) { + const title = el('input', { placeholder: text.title, maxLength: 120 }) + const url = el('input', { placeholder: text.url, type: 'url', required: true }) + const form = el('form', {}, title, url, el('button', { type: 'submit', textContent: text.add })) + form.addEventListener('submit', async (event) => { + event.preventDefault() + await save([...links, { title: title.value, url: url.value }]) + }) + nodes.push(form) + } + app.replaceChildren(...nodes) +} + +await load() diff --git a/examples/plugins/links/ui/manage.html b/examples/plugins/links/ui/manage.html new file mode 100644 index 00000000..9a63b9d8 --- /dev/null +++ b/examples/plugins/links/ui/manage.html @@ -0,0 +1,13 @@ + + + + + + Team links + + + +
+ + + diff --git a/frontend/src/api/plugin.ts b/frontend/src/api/plugin.ts index d866a04b..9310bfb2 100644 --- a/frontend/src/api/plugin.ts +++ b/frontend/src/api/plugin.ts @@ -1,4 +1,4 @@ -import { get, put } from '@/utils/request' +import { get, post, put } from '@/utils/request' import type { ConfigSchema, ConfigValue } from '@/components/schema-form/schema' import type { LocalizedText } from '@/utils/localizedText' @@ -14,6 +14,9 @@ export type ExtensionPoint = | 'parsers' | 'skills' | 'mcpServers' + | 'pages' + | 'settingsSections' + | 'kbTabs' export interface PluginContribution { id: string @@ -27,6 +30,23 @@ export interface PluginContribution { path?: string /** Remote MCP server an installed plugin contributes. */ mcp?: { url: string; transport?: string; headers?: Record } + /** The HTML page of a UI contribution (pages, settingsSections, kbTabs), under ui/. */ + entry?: string + /** Workspace role a UI contribution needs. */ + minRole?: 'viewer' | 'contributor' | 'admin' | 'owner' +} + +/** A contribution as GET /plugins/contributions lists it. */ +export interface ListedContribution extends PluginContribution { + pluginId: string + qualifiedId: string + version?: string + enabled: boolean +} + +export interface ContributionListing { + points: Array<{ point: ExtensionPoint; thirdParty: boolean; declarative: boolean }> + contributions: Partial> } export interface PluginPermissions { @@ -98,6 +118,25 @@ export function setPluginEnabled(id: string, enabled: boolean) { return put<{ data: TenantPlugin }>(`/api/v1/plugins/${encodeURIComponent(id)}/enabled`, { enabled }) } +/** Every contribution the deployment has, with the workspace's switches. */ +export function listContributions(point?: ExtensionPoint) { + return get<{ data: ContributionListing }>('/api/v1/plugins/contributions', point ? { params: { point } } : undefined) +} + +/** What a plugin page's request returned. */ +export interface PluginPageResponse { + status: number + body?: unknown +} + +/** Relays a request from a plugin page to the plugin's backend. */ +export function pluginPageRequest( + pluginId: string, + req: { mount: string; method: string; path: string; body?: unknown }, +) { + return post<{ data: PluginPageResponse }>(`/api/v1/plugins/${encodeURIComponent(pluginId)}/ui-request`, req) +} + /** The workspace's configuration of a plugin (Admin+). */ export function getPluginConfig(id: string) { return get<{ data: PluginConfig }>(`/api/v1/plugins/${encodeURIComponent(id)}/config`) diff --git a/frontend/src/config/toolbox.test.ts b/frontend/src/config/toolbox.test.ts index 3059169f..7539cf93 100644 --- a/frontend/src/config/toolbox.test.ts +++ b/frontend/src/config/toolbox.test.ts @@ -95,6 +95,7 @@ test('settings no longer render moved panels, and old bookmarks reach toolbox', assert.match(router, /to\.path === '\/platform\/settings' && isToolboxSection\(to\.query\.section\)/) assert.match(router, /toolboxLocation\(to\.query\.section/) const page = readFileSync(new URL('../views/toolbox/Toolbox.vue', import.meta.url), 'utf8') - assert.match(page, /if \(!selectedItem\.value && fallback\) void router\.replace\(toolboxLocation\(fallback\.key\)\)/) + // Unknown sections (and plugin pages that are gone) fall back to the first tool. + assert.match(page, /if \(!selectedItem\.value && !selectedPage\.value && !pendingPage && fallback\) \{\s*void router\.replace\(toolboxLocation\(fallback\.key\)\)/) assert.match(page, /:key="sandboxId"\s+:initial-sandbox-id="sandboxId"/) }) diff --git a/frontend/src/extensions/pluginFrame/PluginFrame.vue b/frontend/src/extensions/pluginFrame/PluginFrame.vue new file mode 100644 index 00000000..f9edba07 --- /dev/null +++ b/frontend/src/extensions/pluginFrame/PluginFrame.vue @@ -0,0 +1,192 @@ +