alibaba / lowcode-engine

An enterprise-class low-code technology stack with scale-out design / 一套面向扩展设计的企业级低代码技术体系
https://lowcode-engine.cn
MIT License
14.66k stars 2.55k forks source link

无法覆盖同名的内置插件 #2579

Open shiwofeiwo opened 1 year ago

shiwofeiwo commented 1 year ago

在IPublicTypeEditorView的ctx中覆盖同名的内置插件没有生效是什么原因?lowcode-engine版本是1.2.0
image

liujuping commented 1 year ago

需要先 remove 掉原来的插件面板

skeleton.remove({
  area: 'leftArea',
  name: 'outline-master-pane',
  type: 'PanelDock',
});

skeleton.remove({
  area: 'rightArea',
  name: 'outline-backup-pane',
  type: 'Panel',
});
shiwofeiwo commented 1 year ago

好的,我试试

shiwofeiwo commented 1 year ago

补充一下,是在workspace模式下,目前还是不行

liujuping commented 1 year ago

那就需要在对应的试图里面通过插件进行 remove 和注册。

shiwofeiwo commented 1 year ago

比如我要覆盖的是outline插件,能否具体给一段代码参考一下

shiwofeiwo commented 1 year ago

await plugins.delete('OutlinePlugin'); await plugins.register(OutlinePlugin as any, {}, { override: true }); 我是这样写的,没有生效

liujuping commented 1 year ago

你需要移除的是内部注册的面板,而不是插件。

shiwofeiwo commented 1 year ago

我应该在什么时机对这个内部注册的面板进行remove

liujuping commented 1 year ago

比如说,你定制的 OutlinePlugin 插件里面。加上之前的那段代码,看看是否可行。

shiwofeiwo commented 1 year ago

image remove了然后add,没有生效

liujuping commented 1 year ago

提供可复现的 demo 吧。

shiwofeiwo commented 1 year ago

https://codesandbox.io/p/github/shiwofeiwo/editor-demo/main?layout=%257B%2522sidebarPanel%2522%253A%2522EXPLORER%2522%252C%2522rootPanelGroup%2522%253A%257B%2522direction%2522%253A%2522horizontal%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522id%2522%253A%2522ROOT_LAYOUT%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522clo51xovk0007356jxde2w61d%2522%252C%2522sizes%2522%253A%255B100%252C0%255D%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522EDITOR%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522id%2522%253A%2522clo51xovj0003356jyeczfbq5%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522SHELLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522id%2522%253A%2522clo51xovj0005356js68o7xqn%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522DEVTOOLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522id%2522%253A%2522clo51xovj0006356jj3qyybc0%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%255D%252C%2522sizes%2522%253A%255B100%252C0%255D%257D%252C%2522tabbedPanels%2522%253A%257B%2522clo51xovj0003356jyeczfbq5%2522%253A%257B%2522id%2522%253A%2522clo51xovj0003356jyeczfbq5%2522%252C%2522tabs%2522%253A%255B%257B%2522type%2522%253A%2522FILE%2522%252C%2522filepath%2522%253A%2522%252Fsrc%252Fplugins%252Fplugin-outline-pane%252Findex.tsx%2522%252C%2522id%2522%253A%2522clo52d6k600c7356j646vfy8g%2522%252C%2522mode%2522%253A%2522temporary%2522%257D%255D%252C%2522activeTabId%2522%253A%2522clo52d6k600c7356j646vfy8g%2522%257D%252C%2522clo51xovj0006356jj3qyybc0%2522%253A%257B%2522id%2522%253A%2522clo51xovj0006356jj3qyybc0%2522%252C%2522activeTabId%2522%253A%2522clo525qw900of356jundauxr8%2522%252C%2522tabs%2522%253A%255B%257B%2522type%2522%253A%2522ENV_SETUP%2522%252C%2522id%2522%253A%2522clo51xp0i000p356jtkpb0otn%2522%252C%2522mode%2522%253A%2522permanent%2522%257D%252C%257B%2522type%2522%253A%2522TASK_PORT%2522%252C%2522taskId%2522%253A%2522start%2522%252C%2522port%2522%253A5556%252C%2522id%2522%253A%2522clo525qw900of356jundauxr8%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522path%2522%253A%2522%252F%2522%257D%255D%257D%252C%2522clo51xovj0005356js68o7xqn%2522%253A%257B%2522id%2522%253A%2522clo51xovj0005356js68o7xqn%2522%252C%2522tabs%2522%253A%255B%257B%2522id%2522%253A%2522clo51xovj0004356jl5oim4fr%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522TERMINAL%2522%252C%2522shellId%2522%253A%2522clo51xpll002xegcndscm71c2%2522%257D%255D%252C%2522activeTabId%2522%253A%2522clo51xovj0004356jl5oim4fr%2522%257D%257D%252C%2522showDevtools%2522%253Afalse%252C%2522showShells%2522%253Afalse%252C%2522showSidebar%2522%253Atrue%252C%2522sidebarPanelSize%2522%253A15%257D

这是复现的demo

dayangege commented 6 months ago

后来怎么解决的?

lxdu commented 6 months ago

同问,是否已解决?怎么解决的?