Structure View
Type: React component
How to get StructureView?
JavaScript
import StructureView from 'fontoxml-structure/src/StructureView.jsx'
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
checked
Items (Required)
Type: Array<CheckedItem>
Determines which checkboxes are checked. Whether the checkboxes are visible is determined by showCheckboxSelector.
Default value
enable
Drag And Drop (Optional)
Type: Boolean
This is an internal property.
Default value
indeterminate
Items (Required)
Type: Array<IndeterminateItem>
Determines which checkboxes are indeterminate checked. Whether the checkboxes are visible is determined by showCheckboxSelector.
Default value
on
Item Checkbox Click (Optional)
Type: Function
A callback that is called when a checkbox is clicked. Whether the checkboxes are visible is determined by showCheckboxSelector.
Arguments
Default value
on
Item Click (Optional)
Type: Function
A callback that is called when an item is clicked.
Arguments
Default value
selected
Context Node Id (Optional)
Type: 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
selected
Hierarchy Node Id (Optional)
Type: HierarchyNodeId
The ID of the documents hierarchy node determining the selected item.
Default value
show
Checkbox Selector (Optional)
Type: 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
show
Node Status (Optional)
Type: Boolean
Whether to show the node status badges on items. Defaults to false.
Default value
show
Operations Menu (Optional)
Type: Boolean
Whether to show the operations menu for each item. This should probably only be used in the actual structure view sidebar.
Default value
show
Remote Document State (Optional)
Type: Boolean
Whether to show the remote document state icons on items. Defaults to false.
Default value
Returns
Type: ReactElement