StructureView

How to get StructureView

import StructureView from 'fontoxml-structure-view/src/StructureView.jsx'

Type: Component

Displays the structure view for the currently loaded documents, as configured using configureAsStructureViewItem.

This allows the structure view to be embedded in custom UI, for example to allow navigation and selection from the set of documents loaded in the editor.

Props

# Name Type Description
1. [onItemClick] Function

A callback that is called when an item is clicked.


  Arguments
# Name Type Description
1. item Object
  Members

Members

Name Type Description
contextNodeId NodeId

The ID of the DOM node corresponding to the clicked item.

hierarchyNodeId HierarchyNodeId

The ID of the documents hierarchy node corresponding to the clicked item.

2. [selectedContextNodeId] NodeId

The ID of a node determining the selected item. If provided, the item corresponding to the closest ancestor of this node will appear selected, provided it also matches the given selectedHierarchyNodeId.


  Default value
null
3. [selectedHierarchyNodeId] HierarchyNodeId

The ID of the documents hierarchy node determining the selected item.


  Default value
null
4. [showOperationsMenu] Boolean

Whether to show the operations menu for each item. This should probably only be used in the actual structure view sidebar.


  Default value
false
5. enableDragAndDrop
  Default value
false

Returns

Type: ReactElement