StructureView

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

  1. checkedItems

    (Required)

    Type: Array<Object>

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

    Properties

    Default value

  2. enableDragAndDrop

    (Optional)

    Type: Boolean

    This is an internal property.

    Default value

  3. indeterminateItems

    (Required)

    Type: Array<Object>

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

    Default value

  4. onItemCheckboxClick

    (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

  5. onItemClick

    (Optional)

    Type: Function

    A callback that is called when an item is clicked.

    Arguments

    Default value

  6. selectedContextNodeId

    (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

  7. selectedHierarchyNodeId

    (Optional)

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

    Default value

  8. showCheckboxSelector

    (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

  9. showNodeStatus

    (Optional)

    Type: Boolean

    Whether to show the node status badges on items. Defaults to false.

    Default value

  10. showOperationsMenu

    (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

  11. showRemoteDocumentState

    (Optional)

    Type: Boolean

    Whether to show the remote document state icons on items. Defaults to false.

    Default value

Returns