How to get FxOperation
import FxOperation from 'fontoxml-fx/src/FxOperation.jsx'
A children as a function component that can be used to get the operationState of the given operationName and/or execute it without using a specific FX component.
if you can use a React hook because you're writing a functional component, prefer useOperation over this component. Note: this component simply uses useOperation internally and renders its children as a function that receives the results from useOperation as an argument.
This component has been optimized for performance. This component and its API will probably remain intact for more (major) versions than the operationsManager. This component is more flexible, but also more verbose than using an FX component: FX components all use this component internally to couple operation state to a specific UI element like a Button.
So: Prefer using a specific FX component if one suffices. (Send us a signal if you're missing one.) Prefer using this component instead of using the operationsManager directly. And prefer using the useOperation hook directly if possible, otherwise use this component.
Returns an object with the following properties, all related to the given operationName:
Whether or not the editor (content view) should be focused after the operation with the given operationName is executed (using executeOperation as given to the children function of this component). This will not apply for other executions of the operation, outside of this component. Defaults to false.
Defaults to 300. Used for performance micro optimization. Don't change this if you're not really sure you want to and think you need it. (In the SDK, for Fx components, this is not changed at all.)
The operation state change notifier from the operationsManager can fire multiple times in quick succession in certain cases, without the state actually changing. To prevent multiple re-renders in quick succession that do not render anything new (the state didn't change) the notifier callbacks are windowed.
This property controls the number of ms during which all successive notifier callbacks are windowed: meaning, during this time, nothing will happen directly when the notifier callback fires. Instead a timeout is set for this duration that is cleared whenever a new notifier callback is fired. If the timeout expires, a re-render is triggered with the latest operationState at the moment of rendering.
The name by with the operation was registered. The component will be replaced with a CompactStateMessage if the operation is not found.
Additional operation data, which will be added to the stepData of the operation.