mirror of
https://github.com/litruv/lit.ruv.wtf.git
synced 2026-07-24 10:46:03 +10:00
update to node site
This commit is contained in:
35
website/scripts/nodes/InfoNode.js
Normal file
35
website/scripts/nodes/InfoNode.js
Normal file
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* @file InfoNode.js
|
||||
* @UCLASS(BlueprintType, Blueprintable)
|
||||
*/
|
||||
|
||||
import { NodeBase } from './NodeBase.js';
|
||||
import { NodeRegistry } from './NodeRegistry.js';
|
||||
|
||||
/**
|
||||
* @UCLASS(BlueprintType)
|
||||
* Renders a markdown body below the node header.
|
||||
*/
|
||||
export class InfoNode extends NodeBase {
|
||||
/** @UCLASS(BlueprintType) */
|
||||
static NodeType = "info";
|
||||
|
||||
/**
|
||||
* @UFUNCTION(BlueprintNativeEvent)
|
||||
* @param {HTMLElement} article
|
||||
* @param {import('../GraphNode.js').GraphNode} graphNode
|
||||
* @param {import('./NodeRenderContext.js').NodeRenderContext} renderCtx
|
||||
*/
|
||||
BlueprintNativeEvent_OnRender(article, graphNode, renderCtx) {
|
||||
if (!graphNode.markdownSrc) return;
|
||||
|
||||
const body = document.createElement("div");
|
||||
body.className = "node-body";
|
||||
body.setAttribute("aria-live", "polite");
|
||||
article.appendChild(body);
|
||||
|
||||
renderCtx.BlueprintCallable_LoadMarkdown(graphNode.markdownSrc, body);
|
||||
}
|
||||
}
|
||||
|
||||
NodeRegistry.UCLASS_Register(InfoNode);
|
||||
Reference in New Issue
Block a user