Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

feat:Support Render type plugins

robin85516530ca1d
diff --git a/ui/src/utils/pluginKit/index.ts b/ui/src/utils/pluginKit/index.ts
index 1f7efaca..26e3a288 100644
--- a/ui/src/utils/pluginKit/index.ts
+++ b/ui/src/utils/pluginKit/index.ts
@@ -221,7 +221,8 @@ const useRenderHtmlPlugin = (
return (
plugin.activated &&
plugin.hooks?.useRender &&
- plugin.info.type === PluginType.Editor
+ (plugin.info.type === PluginType.Editor ||
+ plugin.info.type === PluginType.Render)
);
})
.forEach((plugin) => {
diff --git a/ui/src/utils/pluginKit/interface.ts b/ui/src/utils/pluginKit/interface.ts
index e1b8ab0c..462ae47b 100644
--- a/ui/src/utils/pluginKit/interface.ts
+++ b/ui/src/utils/pluginKit/interface.ts
@@ -27,6 +27,7 @@ export enum PluginType {
Editor = 'editor',
Route = 'route',
Captcha = 'captcha',
+ Render = 'render',
}
export interface PluginInfo {
@@ -45,7 +46,7 @@ export interface Plugin {
useRender?: Array<
(element: HTMLElement | RefObject<HTMLElement> | null) => void
>;
- useCaptcha?: (props: { captchaKey: Type.CaptchaKey; commonProps: any }) => {
+ useCaptcha?: (props: { captchaKey: Type.CaptchaKey; commonProps: any; }) => {
getCaptcha: () => Record<string, any>;
check: (t: () => void) => void;
handleCaptchaError: (error) => any;