alibaba / lowcode-engine

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

Question : disableDefaultSettingPanel: true, how to provide a plugin settings panel? #1348

Open aderici opened 1 year ago

aderici commented 1 year ago

Hi,

I noticed the disableDefaultSettingPanel option which disables the default one. I tried copying original settings panel and converting it into a plugin but it throws errors.

Is this the intended use of disableDefaultSettingPanel, providing custom settings panels as a plugin?

Can you provide a reference implementation with the standard panel but as a plugin?

Thanks and best regards,

JackLian commented 1 year ago

yes, this 'disableDefaultSettingPanel' will disable the default settingPanel, however for now default settingPanel is not a plugin yet.

if you want to implement your own setting panel, try these: 1. disable default one, 2. write your own panel and add to 'rightArea' like this:

https://github.com/alibaba/lowcode-engine/blob/feat/workspace/packages/engine/src/inner-plugins/default-panel-registry.tsx#L21-L22

and if errors thrown, maybe you can provide a demo repo by which we can try to reproduce the error, so that we can provide more help

aderici commented 1 year ago

@JackLian thank you so much for offering help.

Here's the repo : https://github.com/aderici/lowcode-demo-custom-settingspanel/commit/f0bfae309441cd9fbe20bb248a80fd19e595a130

I'm using demo-general.

And the error message :

image
JackLian commented 1 year ago

looks like you can not use settingsPane from @alilc/lowcode-editor-skeleton directly, since there are some apis can not be used outside of engine, which is why this settingsPane is not a standalone plugin yet.

and note that "@alilc/lowcode-editor-skeleton" can not be used as a individual npm.

there are two things you can try.

  1. describe why you want to customize this settings pane , normally we should provide a way to support that if functionality of settingsPane is similar.
  2. hide original one using disableDefaultSettingPanel, and just put another pane in that position, just dont use settingsPane from @alilc/lowcode-editor-skeleton
aderici commented 1 year ago

@JackLian the primary reason is i want to translate texts into english language. Forexample in settings pane it opens by default with a non-i18n text

image

Also the default outline pane has a search box which has a hard-coded non-i18n placeholder :

image
JackLian commented 1 year ago

got it, I will handle that lately, maybe in 2-4 week, is that OK?

aderici commented 1 year ago

@JackLian Yes thank you! I was able to get all the rest translated including setters because they can be used as plugins.

I will study materials part in the meanwhile,

JackLian commented 1 year ago

I`ll provide a demo of how to do i18n in plugins using standard api tomorrow

JackLian commented 1 year ago

actually about plugin`s i18n demo, you can check this out https://github.com/alibaba/lowcode-plugins/blob/d98b9efdcef5ff9f1b9f233ee1fff72c27ddc78d/packages/plugin-zh-en/src/index.tsx#L1

this show`s how we recommend to do i18n for plugin, and this depends on lowcode-engine@1.0.18 ( right now 1.0.18-beta.4 is the latest)

aderici commented 1 year ago

@JackLian thanks, a great example.

If we could get the engine part to support english then people like me can customize their individual plugins without having to worry about the core.

I'll now try to have an asset library that supports english in component names and default structures when you drag drop them into the designer area

huxingyi1997 commented 1 year ago

maybe in two weeks

Any plan to release this? And there're some case only has Chinese now in plugins. For example, '搜索组件' in plugin-components-pane Screen Shot 2022-12-26 at 3 50 34 PM , 保存schema in plugin-schema Screen Shot 2022-12-26 at 3 50 51 PM

alvarto commented 1 year ago

maybe in two weeks

Any plan to release this? And there're some case only has Chinese now in plugins. For example, '搜索组件' in plugin-components-pane Screen Shot 2022-12-26 at 3 50 34 PM , 保存schema in plugin-schema Screen Shot 2022-12-26 at 3 50 51 PM

Let's track it in this issue