StructureView

How to get StructureView

import StructureView from 'fontoxml-structure/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. checkedItems Array<CheckedItem>

Determines which checkboxes are checked. Whether the checkboxes are visible is determined by showCheckboxSelector.


  Default value
[]
2. [enableDragAndDrop] Boolean

This is an internal property.


  Default value
false
3. indeterminateItems Array<IndeterminateItem>

Determines which checkboxes are indeterminate checked. Whether the checkboxes are visible is determined by showCheckboxSelector.


  Default value
[]
4. [onItemCheckboxClick] Function

A callback that is called when a checkbox is clicked. Whether the checkboxes are visible is determined by showCheckboxSelector.


  Arguments
# Name Type Description
1. item Object
  Members

Members

Name Type Description
node 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.

5. [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.

6. [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
7. [selectedHierarchyNodeId] HierarchyNodeId

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


  Default value
null
8. [showCheckboxSelector] XPathTest

Whether to show checkboxes after each item and which of those should be shown or not. This will be based on both the contextNode and the sourceNode (if there is one). For at least one of them true needs to be returned else the checkbox will be hidden. In the case of JIT loading a document could not be loaded, which means only the sourceNode will be available to determine whether the checkbox is shown. If you want to show all checkboxes use "true()". Example: The following selector will give all items that are a document a checkbox, also when they are not loaded because of JIT loading: self::topic[not(parent::*)] or self::topicref.",

Also implement onItemCheckboxClick, checkedItems and optionally indeterminateItems.


  Default value
null
9. [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

Returns

Type: ReactElement

Was this page helpful?