mirror of
https://github.com/litruv/picoGraph.git
synced 2026-07-24 02:36:04 +10:00
Initial commit
moved from private version control
This commit is contained in:
26
scripts/nodes/library/stringLiteral.js
Normal file
26
scripts/nodes/library/stringLiteral.js
Normal file
@@ -0,0 +1,26 @@
|
||||
import { createNodeModule } from "../nodeTypes.js";
|
||||
|
||||
/**
|
||||
* Constant string literal.
|
||||
*/
|
||||
export const stringLiteralNode = createNodeModule(
|
||||
{
|
||||
id: "string_literal",
|
||||
title: "String",
|
||||
category: "Values",
|
||||
description: "Constant string literal.",
|
||||
searchTags: ["string", "literal", "text", "value"],
|
||||
inputs: [],
|
||||
outputs: [
|
||||
{ id: "value", name: "Value", direction: "output", kind: "string" },
|
||||
],
|
||||
properties: [
|
||||
{ key: "value", label: "Text", type: "string", defaultValue: "hello" },
|
||||
],
|
||||
},
|
||||
{
|
||||
evaluateValue: ({ node, formatLiteral }) => {
|
||||
return formatLiteral("string", node.properties.value ?? "");
|
||||
},
|
||||
}
|
||||
);
|
||||
Reference in New Issue
Block a user