* Adding PostAction plugin hook

* Adding missing doc string

* WIP

* Simplifying it

* Adding support for selected text

* fixing linter errors

* Adding support for the plugin editor action in the thread view

* Fixing ci check-types

* Addressing PR review comments

* Fix linter error in CI

* Fixing tests
Этот коммит содержится в:
Jesús Espino
2023-08-08 20:36:37 +02:00
коммит произвёл GitHub
родитель 60fb112a27
Коммит e1c6ae7d85
14 изменённых файлов: 128 добавлений и 6 удалений

Просмотреть файл

@@ -496,6 +496,18 @@ export default class PluginRegistry {
return id;
});
// Register a component to the add to the post message menu shown on hover.
// Accepts a React component. Returns a unique identifier.
registerPostActionComponent = reArg(['component'], ({component}: DPluginComponentProp) => {
return dispatchPluginComponentAction('PostAction', this.id, component);
});
// Register a component to the add to the post text editor menu.
// Accepts a React component. Returns a unique identifier.
registerPostEditorActionComponent = reArg(['component'], ({component}: DPluginComponentProp) => {
return dispatchPluginComponentAction('PostEditorAction', this.id, component);
});
// Register a post menu list item by providing some text and an action function.
// Accepts the following:
// - text - A string or React element to display in the menu