View

An interface for describing MindDrop's views.

Views are used to render content in the main content area of MindDrop's window (on the right of the sidebar). MindDrop renders a single view at a time.

Views need to be registered before they can be opneded using the Views.register method.

Static views simply render the view component provided as part of the View when registering a view.

Instance views are rendererd using a persistently stored ViewInstance document passed in to the view component.

The view instance document allows for storing data related to a particular instance of a view. For example, topics are rendered using view instances which store the filter and layout options for each view instance.

View instances can be creqated using the Views.createInstance method.

PropertyTypeDescription
id*stringThe view ID. Must be unique accross the app.
extension*stringThe ID of the extension that registered the view.
type*'static' | 'instance' The view type. 'static' views simply render the component. 'instance' views are rendered using a persistently stored view instance document passed in to the component.
component*React.ComponentTypeThe React component rendered by the view.
onInsertDatafunctionCalled when data is inserted into the view, usually in the form of a drag and drop or paste event.

Called when data is inserted into the view, usually in the from of a drag and drop or paste event.

onInsertData(core: Core, data: DataInsert, viewInstance?: ViewInstance): void
ArgumentTypeDescription
core*CoreA MindDrop core instance.
data*DataInsertThe inserted data.
viewInstanceViewInstanceThe view instance into which the data was inserted if the view is an instance view.