CrossReferencePopover

How to get CrossReferencePopover

import CrossReferencePopover from 'fontoxml-crosslink-references/src/CrossReferencePopover.jsx'

Type: Component

A component used for making a popover for cross references.

The CrossReferencePopover completely implements FxReferencePopover for cross referencing. The only property that still needs to be added is the resolveReference property.

# Name Type Description
1. data Object

The popoverData as provided by the family configuration, this only needs to be passed through.

  Members

Name Type Description
contextNodeId NodeId

A property that comes from the popover method self, contains the node ID of the node that is configured.

[deleteOperationName] String

The operation for removing the reference. Is by default reference-delete.

[editOperationName] String

Only when an editOperationName is used, a edit button is made. The edit operation should provide a way to edit the reference.

[referenceMarkupLabel] String

Provide an alternative label for this reference, provided as REFERENCE_MARKUP_LABEL to the MessageFormat for the popover's description. If omitted, the configured markup label for the reference node is used instead.

[targetIsPermanentId] Boolean

Determines wether the reference contains permanentId's.

targetQuery XPathQuery

Determines the reference content with a xpath query, starting from the context node. Often this is just an attribute, for example @href.

2. resolveReference Function

This callback will be triggered when the popover is opened or after the permanent id is resolved (if the reference has permanent ids data.targetIsPermanentId).


  Arguments
# Name Type Description
1. target String

The unresolved target, this is the resolved permanent id or the outcome of data.targetQuery.

  Returns

Type: Promise<returnObject>

The resolved target. This should be a promise that resolves into an object.


  returnObject

Type: Object

Name Type Description
documentId DocumentId

The document ID of the document that is referenced

[nodeId] NodeId

The node ID of the node that is referenced