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 ). |