NodeBlock class
đ Descriptionâ
The NodeBlock class is an abstract class for creating node blocks for the builder. A node block defines a behavior for a Node. An instance of a derived NodeBlock class is created using the assignBlock method of a Node.
Follow this tutorial to learn how to build a custom block.
đ Applicable decoratorsâ
The following decorators can be applied in this class:
Class decorators âšī¸â
Property decorators âšī¸â
Method decorators âšī¸â
đ Staticsâ
đˇī¸ iconâ
Contains the icon of the block.
Typeâ
SVGImage | string
đˇī¸ identifierâ
Contains the type identifier of the block.
Typeâ
string
đˇī¸ kindâ
Contains the kind of block. It can be one of the following values:
ui: Visual block that the user can see and interact with (for example, a text input field);headless: Invisible block that can perform a certain action.
Typeâ
"ui" | "headless"
đˇī¸ labelâ
Retrieves the localized label (name) of the block.
Typeâ
string
đˇī¸ versionâ
Contains the version of the block.
Typeâ
string
đ§ flagâ
Verifies if the block has the specified flag enabled.
Flags can be set using the flag function.
Signatureâ
flag(id: string): boolean
Parametersâ
| Name | Type | Optional | Description |
|---|---|---|---|
id | string | No | Specifies the flag identifier to verify. |
Return valueâ
Returns true if the specified flag was enabled.
đī¸ Fieldsâ
đˇī¸ allowMarkdownâ
Specifies if markdown is supported in the label of the block.
When omitted, basic markdown formatting (bold, italic, underline, strikethrough and hyperlinks) is supported.
Typeâ
boolean
đˇī¸ conditionsâ
Retrieves the ConditionsOrchestrator instance used to define conditions for the block.
You should use the @conditions decorator to mark the method that defines the conditions.
Typeâ
đˇī¸ editorâ
Retrieves the EditorOrchestrator instance used to define the controls to manage the block.
You should use the @editor decorator to mark the method that implements the controls.
Typeâ
đˇī¸ iconâ
Retrieves the icon of the node block.
Typeâ
SVGImage | string
đˇ ī¸ idâ
Retrieves the identifier of the node.
Typeâ
string
đˇī¸ isInitializedâ
Retrieves if the block is initialized.
Typeâ
boolean
đˇī¸ isRequiredâ
Retrieves if the block is required or can be skipped.
This property is used by the builder to visually indicate if a node is required.
Typeâ
boolean
đˇī¸ labelâ
Retrieves the label of the node block. This label is shown in the builder.
Typeâ
string
đˇī¸ nodeâ
Retrieves a reference to the Node instance that holds the block.
Typeâ
đˇī¸ slotsâ
Retrieves a reference to the Slots collection instance.
Typeâ
âļī¸ Methodsâ
đ§ detectChangeâ
Notifies the builder that a change has occurred and the definition has changed.
Change detection is normally handled automatically. The builder monitors all block properties that are decorated with the @definition decorator.
Signatureâ
detectChange(): void
đ§ rerenderâ
Rerenders the block.
Signatureâ
rerender(force?: boolean): void
Parametersâ
| Name | Type | Optional | Description |
|---|---|---|---|
force | boolean | Yes | Specifies to force the rerendering (default is false). |