Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

expose useful libs #4489

Merged
merged 3 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions ui/v2.5/src/docs/en/Manual/UIPluginApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ An example using various aspects of `PluginApi` may be found in the source code

An instance of the React library.

### `ReactDOM`

An instance of the ReactDOM library.

### `GQL`

This namespace contains the generated graphql client interface. This is a low-level interface. In many cases, `StashService` should be used instead.
Expand All @@ -25,6 +29,8 @@ This namespace contains the generated graphql client interface. This is a low-le
- `Intl`
- `FontAwesomeRegular`
- `FontAwesomeSolid`
- `Mousetrap`
- `MousetrapPause`

### `register`

Expand Down
6 changes: 6 additions & 0 deletions ui/v2.5/src/pluginApi.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import React from "react";
import ReactDOM from "react-dom";
import * as ReactRouterDOM from "react-router-dom";
import Mousetrap from "mousetrap";
import MousetrapPause from "mousetrap-pause";
import NavUtils from "./utils/navigation";
import { HoverPopover } from "./components/Shared/HoverPopover";
import { TagLink } from "./components/Shared/TagLink";
Expand Down Expand Up @@ -97,6 +100,7 @@ export function RegisterComponent(component: string, fn: Function) {
}
export const PluginApi = {
React,
ReactDOM,
GQL,
libraries: {
ReactRouterDOM,
Expand All @@ -105,6 +109,8 @@ export const PluginApi = {
Intl,
FontAwesomeRegular,
FontAwesomeSolid,
Mousetrap,
MousetrapPause,
},
register: {
// register a route to be added to the main router
Expand Down
Loading