A configuration object used to register 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.
| Property | Type | Description |
|---|---|---|
id* | string | The view ID. Must be unique accross the app. |
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.ComponentType | The React component rendered by the view. If the view is an instance view, the component will receive the view instance data as its props. |
onInsertData | function | Called 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
| Argument | Type | Description |
|---|---|---|
core* | Core | A MindDrop core instance. |
data* | DataInsert | The inserted data. |
viewInstance | ViewInstance | The view instance into which the data was inserted if the view is an instance view. |