mirror of
https://github.com/litruv/picoGraph.git
synced 2026-07-24 02:36:04 +10:00
27 lines
672 B
JavaScript
27 lines
672 B
JavaScript
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 ?? "");
|
|
},
|
|
}
|
|
);
|