@nodetool-ai/base-nodes 0.7.0-rc.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +72 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +270 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/audio-wav.d.ts +66 -0
- package/dist/lib/audio-wav.d.ts.map +1 -0
- package/dist/lib/audio-wav.js +215 -0
- package/dist/lib/audio-wav.js.map +1 -0
- package/dist/nodes/agents.d.ts +253 -0
- package/dist/nodes/agents.d.ts.map +1 -0
- package/dist/nodes/agents.js +2784 -0
- package/dist/nodes/agents.js.map +1 -0
- package/dist/nodes/anthropic.d.ts +26 -0
- package/dist/nodes/anthropic.d.ts.map +1 -0
- package/dist/nodes/anthropic.js +133 -0
- package/dist/nodes/anthropic.js.map +1 -0
- package/dist/nodes/apify.d.ts +120 -0
- package/dist/nodes/apify.d.ts.map +1 -0
- package/dist/nodes/apify.js +618 -0
- package/dist/nodes/apify.js.map +1 -0
- package/dist/nodes/audio.d.ts +301 -0
- package/dist/nodes/audio.d.ts.map +1 -0
- package/dist/nodes/audio.js +1274 -0
- package/dist/nodes/audio.js.map +1 -0
- package/dist/nodes/code-node.d.ts +34 -0
- package/dist/nodes/code-node.d.ts.map +1 -0
- package/dist/nodes/code-node.js +343 -0
- package/dist/nodes/code-node.js.map +1 -0
- package/dist/nodes/code.d.ts +301 -0
- package/dist/nodes/code.d.ts.map +1 -0
- package/dist/nodes/code.js +850 -0
- package/dist/nodes/code.js.map +1 -0
- package/dist/nodes/compare.d.ts +18 -0
- package/dist/nodes/compare.d.ts.map +1 -0
- package/dist/nodes/compare.js +122 -0
- package/dist/nodes/compare.js.map +1 -0
- package/dist/nodes/constant.d.ts +315 -0
- package/dist/nodes/constant.d.ts.map +1 -0
- package/dist/nodes/constant.js +715 -0
- package/dist/nodes/constant.js.map +1 -0
- package/dist/nodes/control.d.ts +83 -0
- package/dist/nodes/control.d.ts.map +1 -0
- package/dist/nodes/control.js +212 -0
- package/dist/nodes/control.js.map +1 -0
- package/dist/nodes/data.d.ts +369 -0
- package/dist/nodes/data.d.ts.map +1 -0
- package/dist/nodes/data.js +1590 -0
- package/dist/nodes/data.js.map +1 -0
- package/dist/nodes/document.d.ts +134 -0
- package/dist/nodes/document.d.ts.map +1 -0
- package/dist/nodes/document.js +984 -0
- package/dist/nodes/document.js.map +1 -0
- package/dist/nodes/extended-placeholders.d.ts +6 -0
- package/dist/nodes/extended-placeholders.d.ts.map +1 -0
- package/dist/nodes/extended-placeholders.js +19 -0
- package/dist/nodes/extended-placeholders.js.map +1 -0
- package/dist/nodes/gemini.d.ts +109 -0
- package/dist/nodes/gemini.d.ts.map +1 -0
- package/dist/nodes/gemini.js +861 -0
- package/dist/nodes/gemini.js.map +1 -0
- package/dist/nodes/generators.d.ts +84 -0
- package/dist/nodes/generators.d.ts.map +1 -0
- package/dist/nodes/generators.js +937 -0
- package/dist/nodes/generators.js.map +1 -0
- package/dist/nodes/image.d.ts +232 -0
- package/dist/nodes/image.d.ts.map +1 -0
- package/dist/nodes/image.js +1395 -0
- package/dist/nodes/image.js.map +1 -0
- package/dist/nodes/input.d.ts +445 -0
- package/dist/nodes/input.d.ts.map +1 -0
- package/dist/nodes/input.js +1459 -0
- package/dist/nodes/input.js.map +1 -0
- package/dist/nodes/kie-dynamic.d.ts +31 -0
- package/dist/nodes/kie-dynamic.d.ts.map +1 -0
- package/dist/nodes/kie-dynamic.js +270 -0
- package/dist/nodes/kie-dynamic.js.map +1 -0
- package/dist/nodes/lib-audio-dsp.d.ts +85 -0
- package/dist/nodes/lib-audio-dsp.d.ts.map +1 -0
- package/dist/nodes/lib-audio-dsp.js +450 -0
- package/dist/nodes/lib-audio-dsp.js.map +1 -0
- package/dist/nodes/lib-audio-effects.d.ts +116 -0
- package/dist/nodes/lib-audio-effects.d.ts.map +1 -0
- package/dist/nodes/lib-audio-effects.js +905 -0
- package/dist/nodes/lib-audio-effects.js.map +1 -0
- package/dist/nodes/lib-browser.d.ts +99 -0
- package/dist/nodes/lib-browser.d.ts.map +1 -0
- package/dist/nodes/lib-browser.js +692 -0
- package/dist/nodes/lib-browser.js.map +1 -0
- package/dist/nodes/lib-charts.d.ts +20 -0
- package/dist/nodes/lib-charts.d.ts.map +1 -0
- package/dist/nodes/lib-charts.js +245 -0
- package/dist/nodes/lib-charts.js.map +1 -0
- package/dist/nodes/lib-datetime.d.ts +108 -0
- package/dist/nodes/lib-datetime.d.ts.map +1 -0
- package/dist/nodes/lib-datetime.js +421 -0
- package/dist/nodes/lib-datetime.js.map +1 -0
- package/dist/nodes/lib-doc-convert.d.ts +19 -0
- package/dist/nodes/lib-doc-convert.d.ts.map +1 -0
- package/dist/nodes/lib-doc-convert.js +257 -0
- package/dist/nodes/lib-doc-convert.js.map +1 -0
- package/dist/nodes/lib-doc-transform.d.ts +39 -0
- package/dist/nodes/lib-doc-transform.d.ts.map +1 -0
- package/dist/nodes/lib-doc-transform.js +335 -0
- package/dist/nodes/lib-doc-transform.js.map +1 -0
- package/dist/nodes/lib-docx.d.ts +106 -0
- package/dist/nodes/lib-docx.d.ts.map +1 -0
- package/dist/nodes/lib-docx.js +595 -0
- package/dist/nodes/lib-docx.js.map +1 -0
- package/dist/nodes/lib-epub.d.ts +55 -0
- package/dist/nodes/lib-epub.d.ts.map +1 -0
- package/dist/nodes/lib-epub.js +220 -0
- package/dist/nodes/lib-epub.js.map +1 -0
- package/dist/nodes/lib-excel.d.ts +74 -0
- package/dist/nodes/lib-excel.d.ts.map +1 -0
- package/dist/nodes/lib-excel.js +448 -0
- package/dist/nodes/lib-excel.js.map +1 -0
- package/dist/nodes/lib-graphql.d.ts +66 -0
- package/dist/nodes/lib-graphql.d.ts.map +1 -0
- package/dist/nodes/lib-graphql.js +333 -0
- package/dist/nodes/lib-graphql.js.map +1 -0
- package/dist/nodes/lib-grid.d.ts +27 -0
- package/dist/nodes/lib-grid.d.ts.map +1 -0
- package/dist/nodes/lib-grid.js +172 -0
- package/dist/nodes/lib-grid.js.map +1 -0
- package/dist/nodes/lib-html-parse.d.ts +108 -0
- package/dist/nodes/lib-html-parse.d.ts.map +1 -0
- package/dist/nodes/lib-html-parse.js +365 -0
- package/dist/nodes/lib-html-parse.js.map +1 -0
- package/dist/nodes/lib-http.d.ts +98 -0
- package/dist/nodes/lib-http.d.ts.map +1 -0
- package/dist/nodes/lib-http.js +267 -0
- package/dist/nodes/lib-http.js.map +1 -0
- package/dist/nodes/lib-image-color-grading.d.ts +3 -0
- package/dist/nodes/lib-image-color-grading.d.ts.map +1 -0
- package/dist/nodes/lib-image-color-grading.js +1386 -0
- package/dist/nodes/lib-image-color-grading.js.map +1 -0
- package/dist/nodes/lib-image-draw.d.ts +3 -0
- package/dist/nodes/lib-image-draw.d.ts.map +1 -0
- package/dist/nodes/lib-image-draw.js +470 -0
- package/dist/nodes/lib-image-draw.js.map +1 -0
- package/dist/nodes/lib-image-enhance.d.ts +3 -0
- package/dist/nodes/lib-image-enhance.d.ts.map +1 -0
- package/dist/nodes/lib-image-enhance.js +731 -0
- package/dist/nodes/lib-image-enhance.js.map +1 -0
- package/dist/nodes/lib-image-filter.d.ts +3 -0
- package/dist/nodes/lib-image-filter.d.ts.map +1 -0
- package/dist/nodes/lib-image-filter.js +684 -0
- package/dist/nodes/lib-image-filter.js.map +1 -0
- package/dist/nodes/lib-image-utils.d.ts +24 -0
- package/dist/nodes/lib-image-utils.d.ts.map +1 -0
- package/dist/nodes/lib-image-utils.js +150 -0
- package/dist/nodes/lib-image-utils.js.map +1 -0
- package/dist/nodes/lib-mail.d.ts +74 -0
- package/dist/nodes/lib-mail.d.ts.map +1 -0
- package/dist/nodes/lib-mail.js +452 -0
- package/dist/nodes/lib-mail.js.map +1 -0
- package/dist/nodes/lib-markdown.d.ts +70 -0
- package/dist/nodes/lib-markdown.d.ts.map +1 -0
- package/dist/nodes/lib-markdown.js +236 -0
- package/dist/nodes/lib-markdown.js.map +1 -0
- package/dist/nodes/lib-nlp.d.ts +98 -0
- package/dist/nodes/lib-nlp.d.ts.map +1 -0
- package/dist/nodes/lib-nlp.js +374 -0
- package/dist/nodes/lib-nlp.js.map +1 -0
- package/dist/nodes/lib-notion.d.ts +99 -0
- package/dist/nodes/lib-notion.d.ts.map +1 -0
- package/dist/nodes/lib-notion.js +601 -0
- package/dist/nodes/lib-notion.js.map +1 -0
- package/dist/nodes/lib-ocr.d.ts +31 -0
- package/dist/nodes/lib-ocr.d.ts.map +1 -0
- package/dist/nodes/lib-ocr.js +143 -0
- package/dist/nodes/lib-ocr.js.map +1 -0
- package/dist/nodes/lib-os.d.ts +312 -0
- package/dist/nodes/lib-os.d.ts.map +1 -0
- package/dist/nodes/lib-os.js +909 -0
- package/dist/nodes/lib-os.js.map +1 -0
- package/dist/nodes/lib-pdf.d.ts +142 -0
- package/dist/nodes/lib-pdf.d.ts.map +1 -0
- package/dist/nodes/lib-pdf.js +871 -0
- package/dist/nodes/lib-pdf.js.map +1 -0
- package/dist/nodes/lib-pptx.d.ts +29 -0
- package/dist/nodes/lib-pptx.d.ts.map +1 -0
- package/dist/nodes/lib-pptx.js +122 -0
- package/dist/nodes/lib-pptx.js.map +1 -0
- package/dist/nodes/lib-rss.d.ts +31 -0
- package/dist/nodes/lib-rss.d.ts.map +1 -0
- package/dist/nodes/lib-rss.js +163 -0
- package/dist/nodes/lib-rss.js.map +1 -0
- package/dist/nodes/lib-s3.d.ts +112 -0
- package/dist/nodes/lib-s3.d.ts.map +1 -0
- package/dist/nodes/lib-s3.js +521 -0
- package/dist/nodes/lib-s3.js.map +1 -0
- package/dist/nodes/lib-secret.d.ts +15 -0
- package/dist/nodes/lib-secret.d.ts.map +1 -0
- package/dist/nodes/lib-secret.js +42 -0
- package/dist/nodes/lib-secret.js.map +1 -0
- package/dist/nodes/lib-sqlite.d.ts +102 -0
- package/dist/nodes/lib-sqlite.d.ts.map +1 -0
- package/dist/nodes/lib-sqlite.js +532 -0
- package/dist/nodes/lib-sqlite.js.map +1 -0
- package/dist/nodes/lib-supabase.d.ts +86 -0
- package/dist/nodes/lib-supabase.d.ts.map +1 -0
- package/dist/nodes/lib-supabase.js +425 -0
- package/dist/nodes/lib-supabase.js.map +1 -0
- package/dist/nodes/lib-svg.d.ts +199 -0
- package/dist/nodes/lib-svg.d.ts.map +1 -0
- package/dist/nodes/lib-svg.js +1027 -0
- package/dist/nodes/lib-svg.js.map +1 -0
- package/dist/nodes/lib-tensorflow.d.ts +71 -0
- package/dist/nodes/lib-tensorflow.d.ts.map +1 -0
- package/dist/nodes/lib-tensorflow.js +351 -0
- package/dist/nodes/lib-tensorflow.js.map +1 -0
- package/dist/nodes/lib-twilio.d.ts +71 -0
- package/dist/nodes/lib-twilio.d.ts.map +1 -0
- package/dist/nodes/lib-twilio.js +469 -0
- package/dist/nodes/lib-twilio.js.map +1 -0
- package/dist/nodes/lib-validate.d.ts +84 -0
- package/dist/nodes/lib-validate.d.ts.map +1 -0
- package/dist/nodes/lib-validate.js +215 -0
- package/dist/nodes/lib-validate.js.map +1 -0
- package/dist/nodes/lib-video-download.d.ts +26 -0
- package/dist/nodes/lib-video-download.d.ts.map +1 -0
- package/dist/nodes/lib-video-download.js +299 -0
- package/dist/nodes/lib-video-download.js.map +1 -0
- package/dist/nodes/messaging.d.ts +88 -0
- package/dist/nodes/messaging.d.ts.map +1 -0
- package/dist/nodes/messaging.js +418 -0
- package/dist/nodes/messaging.js.map +1 -0
- package/dist/nodes/mistral.d.ts +83 -0
- package/dist/nodes/mistral.d.ts.map +1 -0
- package/dist/nodes/mistral.js +450 -0
- package/dist/nodes/mistral.js.map +1 -0
- package/dist/nodes/model3d/analysis.d.ts +13 -0
- package/dist/nodes/model3d/analysis.d.ts.map +1 -0
- package/dist/nodes/model3d/analysis.js +36 -0
- package/dist/nodes/model3d/analysis.js.map +1 -0
- package/dist/nodes/model3d/base.d.ts +11 -0
- package/dist/nodes/model3d/base.d.ts.map +1 -0
- package/dist/nodes/model3d/base.js +20 -0
- package/dist/nodes/model3d/base.js.map +1 -0
- package/dist/nodes/model3d/boolean-ops.d.ts +2 -0
- package/dist/nodes/model3d/boolean-ops.d.ts.map +1 -0
- package/dist/nodes/model3d/boolean-ops.js +172 -0
- package/dist/nodes/model3d/boolean-ops.js.map +1 -0
- package/dist/nodes/model3d/cleanup.d.ts +47 -0
- package/dist/nodes/model3d/cleanup.d.ts.map +1 -0
- package/dist/nodes/model3d/cleanup.js +136 -0
- package/dist/nodes/model3d/cleanup.js.map +1 -0
- package/dist/nodes/model3d/convert.d.ts +14 -0
- package/dist/nodes/model3d/convert.d.ts.map +1 -0
- package/dist/nodes/model3d/convert.js +64 -0
- package/dist/nodes/model3d/convert.js.map +1 -0
- package/dist/nodes/model3d/defaults.d.ts +34 -0
- package/dist/nodes/model3d/defaults.d.ts.map +1 -0
- package/dist/nodes/model3d/defaults.js +28 -0
- package/dist/nodes/model3d/defaults.js.map +1 -0
- package/dist/nodes/model3d/document-ops.d.ts +4 -0
- package/dist/nodes/model3d/document-ops.d.ts.map +1 -0
- package/dist/nodes/model3d/document-ops.js +40 -0
- package/dist/nodes/model3d/document-ops.js.map +1 -0
- package/dist/nodes/model3d/generation.d.ts +39 -0
- package/dist/nodes/model3d/generation.d.ts.map +1 -0
- package/dist/nodes/model3d/generation.js +179 -0
- package/dist/nodes/model3d/generation.js.map +1 -0
- package/dist/nodes/model3d/glb.d.ts +29 -0
- package/dist/nodes/model3d/glb.d.ts.map +1 -0
- package/dist/nodes/model3d/glb.js +255 -0
- package/dist/nodes/model3d/glb.js.map +1 -0
- package/dist/nodes/model3d/index.d.ts +20 -0
- package/dist/nodes/model3d/index.d.ts.map +1 -0
- package/dist/nodes/model3d/index.js +38 -0
- package/dist/nodes/model3d/index.js.map +1 -0
- package/dist/nodes/model3d/io.d.ts +38 -0
- package/dist/nodes/model3d/io.d.ts.map +1 -0
- package/dist/nodes/model3d/io.js +162 -0
- package/dist/nodes/model3d/io.js.map +1 -0
- package/dist/nodes/model3d/mesh-ops.d.ts +40 -0
- package/dist/nodes/model3d/mesh-ops.d.ts.map +1 -0
- package/dist/nodes/model3d/mesh-ops.js +775 -0
- package/dist/nodes/model3d/mesh-ops.js.map +1 -0
- package/dist/nodes/model3d/nodes.d.ts +2 -0
- package/dist/nodes/model3d/nodes.d.ts.map +1 -0
- package/dist/nodes/model3d/nodes.js +2 -0
- package/dist/nodes/model3d/nodes.js.map +1 -0
- package/dist/nodes/model3d/ops.d.ts +37 -0
- package/dist/nodes/model3d/ops.d.ts.map +1 -0
- package/dist/nodes/model3d/ops.js +137 -0
- package/dist/nodes/model3d/ops.js.map +1 -0
- package/dist/nodes/model3d/transforms.d.ts +49 -0
- package/dist/nodes/model3d/transforms.d.ts.map +1 -0
- package/dist/nodes/model3d/transforms.js +142 -0
- package/dist/nodes/model3d/transforms.js.map +1 -0
- package/dist/nodes/model3d/types.d.ts +81 -0
- package/dist/nodes/model3d/types.d.ts.map +1 -0
- package/dist/nodes/model3d/types.js +2 -0
- package/dist/nodes/model3d/types.js.map +1 -0
- package/dist/nodes/model3d/utils.d.ts +34 -0
- package/dist/nodes/model3d/utils.d.ts.map +1 -0
- package/dist/nodes/model3d/utils.js +185 -0
- package/dist/nodes/model3d/utils.js.map +1 -0
- package/dist/nodes/model3d.d.ts +2 -0
- package/dist/nodes/model3d.d.ts.map +1 -0
- package/dist/nodes/model3d.js +2 -0
- package/dist/nodes/model3d.js.map +1 -0
- package/dist/nodes/openai.d.ts +172 -0
- package/dist/nodes/openai.d.ts.map +1 -0
- package/dist/nodes/openai.js +1294 -0
- package/dist/nodes/openai.js.map +1 -0
- package/dist/nodes/output.d.ts +29 -0
- package/dist/nodes/output.d.ts.map +1 -0
- package/dist/nodes/output.js +87 -0
- package/dist/nodes/output.js.map +1 -0
- package/dist/nodes/sandbox.d.ts +67 -0
- package/dist/nodes/sandbox.d.ts.map +1 -0
- package/dist/nodes/sandbox.js +681 -0
- package/dist/nodes/sandbox.js.map +1 -0
- package/dist/nodes/search.d.ts +117 -0
- package/dist/nodes/search.d.ts.map +1 -0
- package/dist/nodes/search.js +607 -0
- package/dist/nodes/search.js.map +1 -0
- package/dist/nodes/team.d.ts +74 -0
- package/dist/nodes/team.d.ts.map +1 -0
- package/dist/nodes/team.js +304 -0
- package/dist/nodes/team.js.map +1 -0
- package/dist/nodes/text-extra.d.ts +633 -0
- package/dist/nodes/text-extra.d.ts.map +1 -0
- package/dist/nodes/text-extra.js +2226 -0
- package/dist/nodes/text-extra.js.map +1 -0
- package/dist/nodes/tool-agents.d.ts +334 -0
- package/dist/nodes/tool-agents.d.ts.map +1 -0
- package/dist/nodes/tool-agents.js +1861 -0
- package/dist/nodes/tool-agents.js.map +1 -0
- package/dist/nodes/triggers.d.ts +107 -0
- package/dist/nodes/triggers.d.ts.map +1 -0
- package/dist/nodes/triggers.js +706 -0
- package/dist/nodes/triggers.js.map +1 -0
- package/dist/nodes/vector.d.ts +168 -0
- package/dist/nodes/vector.d.ts.map +1 -0
- package/dist/nodes/vector.js +1121 -0
- package/dist/nodes/vector.js.map +1 -0
- package/dist/nodes/video.d.ts +387 -0
- package/dist/nodes/video.d.ts.map +1 -0
- package/dist/nodes/video.js +2361 -0
- package/dist/nodes/video.js.map +1 -0
- package/dist/nodes/workflow.d.ts +24 -0
- package/dist/nodes/workflow.d.ts.map +1 -0
- package/dist/nodes/workflow.js +146 -0
- package/dist/nodes/workflow.js.map +1 -0
- package/dist/nodes/workspace.d.ts +203 -0
- package/dist/nodes/workspace.d.ts.map +1 -0
- package/dist/nodes/workspace.js +795 -0
- package/dist/nodes/workspace.js.map +1 -0
- package/package.json +103 -0
|
@@ -0,0 +1,1027 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { BaseNode, prop } from "@nodetool-ai/node-sdk";
|
|
8
|
+
function asColor(value, fallback) {
|
|
9
|
+
if (typeof value === "string")
|
|
10
|
+
return value;
|
|
11
|
+
if (value && typeof value === "object" && "value" in value) {
|
|
12
|
+
return String(value.value ?? fallback);
|
|
13
|
+
}
|
|
14
|
+
return fallback;
|
|
15
|
+
}
|
|
16
|
+
function elementToString(el) {
|
|
17
|
+
const attrs = Object.entries(el.attributes ?? {})
|
|
18
|
+
.map(([k, v]) => `${k}="${String(v).replaceAll('"', """)}"`)
|
|
19
|
+
.join(" ");
|
|
20
|
+
const open = attrs ? `<${el.name} ${attrs}>` : `<${el.name}>`;
|
|
21
|
+
const children = (el.children ?? []).map(elementToString).join("");
|
|
22
|
+
const content = el.content ?? "";
|
|
23
|
+
return `${open}${content}${children}</${el.name}>`;
|
|
24
|
+
}
|
|
25
|
+
function svgDocument(content, width, height, viewBox) {
|
|
26
|
+
return `<?xml version="1.0" encoding="UTF-8"?>\n<svg xmlns="http://www.w3.org/2000/svg" width="${width}" height="${height}" viewBox="${viewBox}">${content}</svg>`;
|
|
27
|
+
}
|
|
28
|
+
function normalizeContent(content) {
|
|
29
|
+
if (Array.isArray(content)) {
|
|
30
|
+
return content.map((c) => normalizeContent(c)).join("\n");
|
|
31
|
+
}
|
|
32
|
+
if (content && typeof content === "object" && "name" in content) {
|
|
33
|
+
return elementToString(content);
|
|
34
|
+
}
|
|
35
|
+
return String(content ?? "");
|
|
36
|
+
}
|
|
37
|
+
export class RectLibNode extends BaseNode {
|
|
38
|
+
static nodeType = "lib.svg.Rect";
|
|
39
|
+
static title = "Rectangle";
|
|
40
|
+
static description = "Generate SVG rectangle element with customizable position, size, and styling.\n svg, shape, vector, rectangle\n\n Use cases:\n - Create rectangular shapes in SVG documents\n - Design borders, frames, and backgrounds\n - Build user interface components\n - Create geometric patterns and layouts";
|
|
41
|
+
static metadataOutputTypes = {
|
|
42
|
+
output: "svg_element"
|
|
43
|
+
};
|
|
44
|
+
async process() {
|
|
45
|
+
return {
|
|
46
|
+
output: {
|
|
47
|
+
name: "rect",
|
|
48
|
+
attributes: {
|
|
49
|
+
x: String(this.x ?? 0),
|
|
50
|
+
y: String(this.y ?? 0),
|
|
51
|
+
width: String(this.width ?? 100),
|
|
52
|
+
height: String(this.height ?? 100),
|
|
53
|
+
fill: asColor(this.fill, "#000000"),
|
|
54
|
+
stroke: asColor(this.stroke, "none"),
|
|
55
|
+
"stroke-width": String(this.stroke_width ?? 1)
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
__decorate([
|
|
62
|
+
prop({ type: "int", default: 0, title: "X", description: "X coordinate" })
|
|
63
|
+
], RectLibNode.prototype, "x", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
prop({ type: "int", default: 0, title: "Y", description: "Y coordinate" })
|
|
66
|
+
], RectLibNode.prototype, "y", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
prop({ type: "int", default: 100, title: "Width", description: "Width" })
|
|
69
|
+
], RectLibNode.prototype, "width", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
prop({ type: "int", default: 100, title: "Height", description: "Height" })
|
|
72
|
+
], RectLibNode.prototype, "height", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
prop({
|
|
75
|
+
type: "color",
|
|
76
|
+
default: {
|
|
77
|
+
type: "color",
|
|
78
|
+
value: "#000000"
|
|
79
|
+
},
|
|
80
|
+
title: "Fill",
|
|
81
|
+
description: "Fill color"
|
|
82
|
+
})
|
|
83
|
+
], RectLibNode.prototype, "fill", void 0);
|
|
84
|
+
__decorate([
|
|
85
|
+
prop({
|
|
86
|
+
type: "color",
|
|
87
|
+
default: {
|
|
88
|
+
type: "color",
|
|
89
|
+
value: "none"
|
|
90
|
+
},
|
|
91
|
+
title: "Stroke",
|
|
92
|
+
description: "Stroke color"
|
|
93
|
+
})
|
|
94
|
+
], RectLibNode.prototype, "stroke", void 0);
|
|
95
|
+
__decorate([
|
|
96
|
+
prop({
|
|
97
|
+
type: "int",
|
|
98
|
+
default: 1,
|
|
99
|
+
title: "Stroke Width",
|
|
100
|
+
description: "Stroke width"
|
|
101
|
+
})
|
|
102
|
+
], RectLibNode.prototype, "stroke_width", void 0);
|
|
103
|
+
export class CircleLibNode extends BaseNode {
|
|
104
|
+
static nodeType = "lib.svg.Circle";
|
|
105
|
+
static title = "Circle";
|
|
106
|
+
static description = "Generate SVG circle element with customizable position, radius, and styling.\n svg, shape, vector, circle\n\n Use cases:\n - Create circular shapes and icons\n - Design buttons, badges, and indicators\n - Build data visualizations like pie charts\n - Create decorative elements and patterns";
|
|
107
|
+
static metadataOutputTypes = {
|
|
108
|
+
output: "svg_element"
|
|
109
|
+
};
|
|
110
|
+
async process() {
|
|
111
|
+
return {
|
|
112
|
+
output: {
|
|
113
|
+
name: "circle",
|
|
114
|
+
attributes: {
|
|
115
|
+
cx: String(this.cx ?? 0),
|
|
116
|
+
cy: String(this.cy ?? 0),
|
|
117
|
+
r: String(this.radius ?? 50),
|
|
118
|
+
fill: asColor(this.fill, "#000000"),
|
|
119
|
+
stroke: asColor(this.stroke, "none"),
|
|
120
|
+
"stroke-width": String(this.stroke_width ?? 1)
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
__decorate([
|
|
127
|
+
prop({
|
|
128
|
+
type: "int",
|
|
129
|
+
default: 0,
|
|
130
|
+
title: "Cx",
|
|
131
|
+
description: "Center X coordinate"
|
|
132
|
+
})
|
|
133
|
+
], CircleLibNode.prototype, "cx", void 0);
|
|
134
|
+
__decorate([
|
|
135
|
+
prop({
|
|
136
|
+
type: "int",
|
|
137
|
+
default: 0,
|
|
138
|
+
title: "Cy",
|
|
139
|
+
description: "Center Y coordinate"
|
|
140
|
+
})
|
|
141
|
+
], CircleLibNode.prototype, "cy", void 0);
|
|
142
|
+
__decorate([
|
|
143
|
+
prop({ type: "int", default: 50, title: "Radius", description: "Radius" })
|
|
144
|
+
], CircleLibNode.prototype, "radius", void 0);
|
|
145
|
+
__decorate([
|
|
146
|
+
prop({
|
|
147
|
+
type: "color",
|
|
148
|
+
default: {
|
|
149
|
+
type: "color",
|
|
150
|
+
value: "#000000"
|
|
151
|
+
},
|
|
152
|
+
title: "Fill",
|
|
153
|
+
description: "Fill color"
|
|
154
|
+
})
|
|
155
|
+
], CircleLibNode.prototype, "fill", void 0);
|
|
156
|
+
__decorate([
|
|
157
|
+
prop({
|
|
158
|
+
type: "color",
|
|
159
|
+
default: {
|
|
160
|
+
type: "color",
|
|
161
|
+
value: "none"
|
|
162
|
+
},
|
|
163
|
+
title: "Stroke",
|
|
164
|
+
description: "Stroke color"
|
|
165
|
+
})
|
|
166
|
+
], CircleLibNode.prototype, "stroke", void 0);
|
|
167
|
+
__decorate([
|
|
168
|
+
prop({
|
|
169
|
+
type: "int",
|
|
170
|
+
default: 1,
|
|
171
|
+
title: "Stroke Width",
|
|
172
|
+
description: "Stroke width"
|
|
173
|
+
})
|
|
174
|
+
], CircleLibNode.prototype, "stroke_width", void 0);
|
|
175
|
+
export class EllipseLibNode extends BaseNode {
|
|
176
|
+
static nodeType = "lib.svg.Ellipse";
|
|
177
|
+
static title = "Ellipse";
|
|
178
|
+
static description = "Generate SVG ellipse element with customizable position, radii, and styling.\n svg, shape, vector, ellipse\n\n Use cases:\n - Create oval shapes and organic forms\n - Design speech bubbles and callouts\n - Build data visualization elements\n - Create decorative patterns and borders";
|
|
179
|
+
static metadataOutputTypes = {
|
|
180
|
+
output: "svg_element"
|
|
181
|
+
};
|
|
182
|
+
async process() {
|
|
183
|
+
return {
|
|
184
|
+
output: {
|
|
185
|
+
name: "ellipse",
|
|
186
|
+
attributes: {
|
|
187
|
+
cx: String(this.cx ?? 0),
|
|
188
|
+
cy: String(this.cy ?? 0),
|
|
189
|
+
rx: String(this.rx ?? 100),
|
|
190
|
+
ry: String(this.ry ?? 50),
|
|
191
|
+
fill: asColor(this.fill, "#000000"),
|
|
192
|
+
stroke: asColor(this.stroke, "none"),
|
|
193
|
+
"stroke-width": String(this.stroke_width ?? 1)
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
__decorate([
|
|
200
|
+
prop({
|
|
201
|
+
type: "int",
|
|
202
|
+
default: 0,
|
|
203
|
+
title: "Cx",
|
|
204
|
+
description: "Center X coordinate"
|
|
205
|
+
})
|
|
206
|
+
], EllipseLibNode.prototype, "cx", void 0);
|
|
207
|
+
__decorate([
|
|
208
|
+
prop({
|
|
209
|
+
type: "int",
|
|
210
|
+
default: 0,
|
|
211
|
+
title: "Cy",
|
|
212
|
+
description: "Center Y coordinate"
|
|
213
|
+
})
|
|
214
|
+
], EllipseLibNode.prototype, "cy", void 0);
|
|
215
|
+
__decorate([
|
|
216
|
+
prop({ type: "int", default: 100, title: "Rx", description: "X radius" })
|
|
217
|
+
], EllipseLibNode.prototype, "rx", void 0);
|
|
218
|
+
__decorate([
|
|
219
|
+
prop({ type: "int", default: 50, title: "Ry", description: "Y radius" })
|
|
220
|
+
], EllipseLibNode.prototype, "ry", void 0);
|
|
221
|
+
__decorate([
|
|
222
|
+
prop({
|
|
223
|
+
type: "color",
|
|
224
|
+
default: {
|
|
225
|
+
type: "color",
|
|
226
|
+
value: "#000000"
|
|
227
|
+
},
|
|
228
|
+
title: "Fill",
|
|
229
|
+
description: "Fill color"
|
|
230
|
+
})
|
|
231
|
+
], EllipseLibNode.prototype, "fill", void 0);
|
|
232
|
+
__decorate([
|
|
233
|
+
prop({
|
|
234
|
+
type: "color",
|
|
235
|
+
default: {
|
|
236
|
+
type: "color",
|
|
237
|
+
value: "none"
|
|
238
|
+
},
|
|
239
|
+
title: "Stroke",
|
|
240
|
+
description: "Stroke color"
|
|
241
|
+
})
|
|
242
|
+
], EllipseLibNode.prototype, "stroke", void 0);
|
|
243
|
+
__decorate([
|
|
244
|
+
prop({
|
|
245
|
+
type: "int",
|
|
246
|
+
default: 1,
|
|
247
|
+
title: "Stroke Width",
|
|
248
|
+
description: "Stroke width"
|
|
249
|
+
})
|
|
250
|
+
], EllipseLibNode.prototype, "stroke_width", void 0);
|
|
251
|
+
export class LineLibNode extends BaseNode {
|
|
252
|
+
static nodeType = "lib.svg.Line";
|
|
253
|
+
static title = "Line";
|
|
254
|
+
static description = "Generate SVG line element with customizable endpoints and styling.\n svg, shape, vector, line\n\n Use cases:\n - Draw straight lines and connectors\n - Create dividers and separators\n - Build diagrams and flowcharts\n - Design grid patterns and borders";
|
|
255
|
+
static metadataOutputTypes = {
|
|
256
|
+
output: "svg_element"
|
|
257
|
+
};
|
|
258
|
+
async process() {
|
|
259
|
+
return {
|
|
260
|
+
output: {
|
|
261
|
+
name: "line",
|
|
262
|
+
attributes: {
|
|
263
|
+
x1: String(this.x1 ?? 0),
|
|
264
|
+
y1: String(this.y1 ?? 0),
|
|
265
|
+
x2: String(this.x2 ?? 100),
|
|
266
|
+
y2: String(this.y2 ?? 100),
|
|
267
|
+
stroke: asColor(this.stroke, "#000000"),
|
|
268
|
+
"stroke-width": String(this.stroke_width ?? 1)
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
__decorate([
|
|
275
|
+
prop({
|
|
276
|
+
type: "int",
|
|
277
|
+
default: 0,
|
|
278
|
+
title: "X1",
|
|
279
|
+
description: "Start X coordinate"
|
|
280
|
+
})
|
|
281
|
+
], LineLibNode.prototype, "x1", void 0);
|
|
282
|
+
__decorate([
|
|
283
|
+
prop({
|
|
284
|
+
type: "int",
|
|
285
|
+
default: 0,
|
|
286
|
+
title: "Y1",
|
|
287
|
+
description: "Start Y coordinate"
|
|
288
|
+
})
|
|
289
|
+
], LineLibNode.prototype, "y1", void 0);
|
|
290
|
+
__decorate([
|
|
291
|
+
prop({
|
|
292
|
+
type: "int",
|
|
293
|
+
default: 100,
|
|
294
|
+
title: "X2",
|
|
295
|
+
description: "End X coordinate"
|
|
296
|
+
})
|
|
297
|
+
], LineLibNode.prototype, "x2", void 0);
|
|
298
|
+
__decorate([
|
|
299
|
+
prop({
|
|
300
|
+
type: "int",
|
|
301
|
+
default: 100,
|
|
302
|
+
title: "Y2",
|
|
303
|
+
description: "End Y coordinate"
|
|
304
|
+
})
|
|
305
|
+
], LineLibNode.prototype, "y2", void 0);
|
|
306
|
+
__decorate([
|
|
307
|
+
prop({
|
|
308
|
+
type: "color",
|
|
309
|
+
default: {
|
|
310
|
+
type: "color",
|
|
311
|
+
value: "#000000"
|
|
312
|
+
},
|
|
313
|
+
title: "Stroke",
|
|
314
|
+
description: "Stroke color"
|
|
315
|
+
})
|
|
316
|
+
], LineLibNode.prototype, "stroke", void 0);
|
|
317
|
+
__decorate([
|
|
318
|
+
prop({
|
|
319
|
+
type: "int",
|
|
320
|
+
default: 1,
|
|
321
|
+
title: "Stroke Width",
|
|
322
|
+
description: "Stroke width"
|
|
323
|
+
})
|
|
324
|
+
], LineLibNode.prototype, "stroke_width", void 0);
|
|
325
|
+
export class PolygonLibNode extends BaseNode {
|
|
326
|
+
static nodeType = "lib.svg.Polygon";
|
|
327
|
+
static title = "Polygon";
|
|
328
|
+
static description = "Generate SVG polygon element with multiple vertices.\n svg, shape, vector, polygon\n\n Use cases:\n - Create multi-sided shapes like triangles, pentagons, stars\n - Build custom icons and symbols\n - Design complex geometric patterns\n - Create irregular shapes and forms";
|
|
329
|
+
static metadataOutputTypes = {
|
|
330
|
+
output: "svg_element"
|
|
331
|
+
};
|
|
332
|
+
async process() {
|
|
333
|
+
return {
|
|
334
|
+
output: {
|
|
335
|
+
name: "polygon",
|
|
336
|
+
attributes: {
|
|
337
|
+
points: String(this.points ?? ""),
|
|
338
|
+
fill: asColor(this.fill, "#000000"),
|
|
339
|
+
stroke: asColor(this.stroke, "none"),
|
|
340
|
+
"stroke-width": String(this.stroke_width ?? 1)
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
__decorate([
|
|
347
|
+
prop({
|
|
348
|
+
type: "str",
|
|
349
|
+
default: "",
|
|
350
|
+
title: "Points",
|
|
351
|
+
description: "Points in format 'x1,y1 x2,y2 x3,y3...'"
|
|
352
|
+
})
|
|
353
|
+
], PolygonLibNode.prototype, "points", void 0);
|
|
354
|
+
__decorate([
|
|
355
|
+
prop({
|
|
356
|
+
type: "color",
|
|
357
|
+
default: {
|
|
358
|
+
type: "color",
|
|
359
|
+
value: "#000000"
|
|
360
|
+
},
|
|
361
|
+
title: "Fill",
|
|
362
|
+
description: "Fill color"
|
|
363
|
+
})
|
|
364
|
+
], PolygonLibNode.prototype, "fill", void 0);
|
|
365
|
+
__decorate([
|
|
366
|
+
prop({
|
|
367
|
+
type: "color",
|
|
368
|
+
default: {
|
|
369
|
+
type: "color",
|
|
370
|
+
value: "none"
|
|
371
|
+
},
|
|
372
|
+
title: "Stroke",
|
|
373
|
+
description: "Stroke color"
|
|
374
|
+
})
|
|
375
|
+
], PolygonLibNode.prototype, "stroke", void 0);
|
|
376
|
+
__decorate([
|
|
377
|
+
prop({
|
|
378
|
+
type: "int",
|
|
379
|
+
default: 1,
|
|
380
|
+
title: "Stroke Width",
|
|
381
|
+
description: "Stroke width"
|
|
382
|
+
})
|
|
383
|
+
], PolygonLibNode.prototype, "stroke_width", void 0);
|
|
384
|
+
export class PathLibNode extends BaseNode {
|
|
385
|
+
static nodeType = "lib.svg.Path";
|
|
386
|
+
static title = "Path";
|
|
387
|
+
static description = "Generate SVG path element using path data commands.\n svg, shape, vector, path\n\n Use cases:\n - Create complex curved and custom shapes\n - Build logos and custom icons\n - Design intricate patterns and illustrations\n - Import path data from design tools";
|
|
388
|
+
static metadataOutputTypes = {
|
|
389
|
+
output: "svg_element"
|
|
390
|
+
};
|
|
391
|
+
async process() {
|
|
392
|
+
return {
|
|
393
|
+
output: {
|
|
394
|
+
name: "path",
|
|
395
|
+
attributes: {
|
|
396
|
+
d: String(this.path_data ?? ""),
|
|
397
|
+
fill: asColor(this.fill, "#000000"),
|
|
398
|
+
stroke: asColor(this.stroke, "none"),
|
|
399
|
+
"stroke-width": String(this.stroke_width ?? 1)
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
__decorate([
|
|
406
|
+
prop({
|
|
407
|
+
type: "str",
|
|
408
|
+
default: "",
|
|
409
|
+
title: "Path Data",
|
|
410
|
+
description: "SVG path data (d attribute)"
|
|
411
|
+
})
|
|
412
|
+
], PathLibNode.prototype, "path_data", void 0);
|
|
413
|
+
__decorate([
|
|
414
|
+
prop({
|
|
415
|
+
type: "color",
|
|
416
|
+
default: {
|
|
417
|
+
type: "color",
|
|
418
|
+
value: "#000000"
|
|
419
|
+
},
|
|
420
|
+
title: "Fill",
|
|
421
|
+
description: "Fill color"
|
|
422
|
+
})
|
|
423
|
+
], PathLibNode.prototype, "fill", void 0);
|
|
424
|
+
__decorate([
|
|
425
|
+
prop({
|
|
426
|
+
type: "color",
|
|
427
|
+
default: {
|
|
428
|
+
type: "color",
|
|
429
|
+
value: "none"
|
|
430
|
+
},
|
|
431
|
+
title: "Stroke",
|
|
432
|
+
description: "Stroke color"
|
|
433
|
+
})
|
|
434
|
+
], PathLibNode.prototype, "stroke", void 0);
|
|
435
|
+
__decorate([
|
|
436
|
+
prop({
|
|
437
|
+
type: "int",
|
|
438
|
+
default: 1,
|
|
439
|
+
title: "Stroke Width",
|
|
440
|
+
description: "Stroke width"
|
|
441
|
+
})
|
|
442
|
+
], PathLibNode.prototype, "stroke_width", void 0);
|
|
443
|
+
export class TextLibNode extends BaseNode {
|
|
444
|
+
static nodeType = "lib.svg.Text";
|
|
445
|
+
static title = "Text";
|
|
446
|
+
static description = "Add text elements to SVG.\n svg, text, typography\n\n Use cases:\n - Add labels to vector graphics\n - Create text-based logos\n - Generate dynamic text content in SVGs";
|
|
447
|
+
static metadataOutputTypes = {
|
|
448
|
+
output: "svg_element"
|
|
449
|
+
};
|
|
450
|
+
async process() {
|
|
451
|
+
return {
|
|
452
|
+
output: {
|
|
453
|
+
name: "text",
|
|
454
|
+
attributes: {
|
|
455
|
+
x: String(this.x ?? 0),
|
|
456
|
+
y: String(this.y ?? 0),
|
|
457
|
+
"font-family": String(this.font_family ?? "Arial"),
|
|
458
|
+
"font-size": String(this.font_size ?? 16),
|
|
459
|
+
fill: asColor(this.fill, "#000000"),
|
|
460
|
+
"text-anchor": String(this.text_anchor ?? "start")
|
|
461
|
+
},
|
|
462
|
+
content: String(this.text ?? "")
|
|
463
|
+
}
|
|
464
|
+
};
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
__decorate([
|
|
468
|
+
prop({
|
|
469
|
+
type: "str",
|
|
470
|
+
default: "",
|
|
471
|
+
title: "Text",
|
|
472
|
+
description: "Text content"
|
|
473
|
+
})
|
|
474
|
+
], TextLibNode.prototype, "text", void 0);
|
|
475
|
+
__decorate([
|
|
476
|
+
prop({ type: "int", default: 0, title: "X", description: "X coordinate" })
|
|
477
|
+
], TextLibNode.prototype, "x", void 0);
|
|
478
|
+
__decorate([
|
|
479
|
+
prop({ type: "int", default: 0, title: "Y", description: "Y coordinate" })
|
|
480
|
+
], TextLibNode.prototype, "y", void 0);
|
|
481
|
+
__decorate([
|
|
482
|
+
prop({
|
|
483
|
+
type: "str",
|
|
484
|
+
default: "Arial",
|
|
485
|
+
title: "Font Family",
|
|
486
|
+
description: "Font family"
|
|
487
|
+
})
|
|
488
|
+
], TextLibNode.prototype, "font_family", void 0);
|
|
489
|
+
__decorate([
|
|
490
|
+
prop({
|
|
491
|
+
type: "int",
|
|
492
|
+
default: 16,
|
|
493
|
+
title: "Font Size",
|
|
494
|
+
description: "Font size"
|
|
495
|
+
})
|
|
496
|
+
], TextLibNode.prototype, "font_size", void 0);
|
|
497
|
+
__decorate([
|
|
498
|
+
prop({
|
|
499
|
+
type: "color",
|
|
500
|
+
default: {
|
|
501
|
+
type: "color",
|
|
502
|
+
value: "#000000"
|
|
503
|
+
},
|
|
504
|
+
title: "Fill",
|
|
505
|
+
description: "Text color"
|
|
506
|
+
})
|
|
507
|
+
], TextLibNode.prototype, "fill", void 0);
|
|
508
|
+
__decorate([
|
|
509
|
+
prop({
|
|
510
|
+
type: "enum",
|
|
511
|
+
default: "start",
|
|
512
|
+
title: "Text Anchor",
|
|
513
|
+
description: "Text anchor position",
|
|
514
|
+
values: ["start", "middle", "end"]
|
|
515
|
+
})
|
|
516
|
+
], TextLibNode.prototype, "text_anchor", void 0);
|
|
517
|
+
export class GaussianBlurLibNode extends BaseNode {
|
|
518
|
+
static nodeType = "lib.svg.GaussianBlur";
|
|
519
|
+
static title = "Gaussian Blur";
|
|
520
|
+
static description = "Apply Gaussian blur filter effect to SVG elements.\n svg, filter, blur, effects\n\n Use cases:\n - Create soft focus and depth effects\n - Add subtle shadows and glows\n - Simulate motion blur\n - Soften edges in graphics";
|
|
521
|
+
static metadataOutputTypes = {
|
|
522
|
+
output: "svg_element"
|
|
523
|
+
};
|
|
524
|
+
async process() {
|
|
525
|
+
return {
|
|
526
|
+
output: {
|
|
527
|
+
name: "filter",
|
|
528
|
+
attributes: { id: "filter_gaussian_blur" },
|
|
529
|
+
children: [
|
|
530
|
+
{
|
|
531
|
+
name: "feGaussianBlur",
|
|
532
|
+
attributes: { stdDeviation: String(this.std_deviation ?? 3) }
|
|
533
|
+
}
|
|
534
|
+
]
|
|
535
|
+
}
|
|
536
|
+
};
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
__decorate([
|
|
540
|
+
prop({
|
|
541
|
+
type: "float",
|
|
542
|
+
default: 3,
|
|
543
|
+
title: "Std Deviation",
|
|
544
|
+
description: "Standard deviation for blur"
|
|
545
|
+
})
|
|
546
|
+
], GaussianBlurLibNode.prototype, "std_deviation", void 0);
|
|
547
|
+
export class DropShadowLibNode extends BaseNode {
|
|
548
|
+
static nodeType = "lib.svg.DropShadow";
|
|
549
|
+
static title = "Drop Shadow";
|
|
550
|
+
static description = "Apply drop shadow filter effect to SVG elements for depth.\n svg, filter, shadow, effects\n\n Use cases:\n - Add depth and elevation to elements\n - Create realistic shadow effects\n - Enhance visual hierarchy\n - Improve element separation and readability";
|
|
551
|
+
static metadataOutputTypes = {
|
|
552
|
+
output: "svg_element"
|
|
553
|
+
};
|
|
554
|
+
async process() {
|
|
555
|
+
return {
|
|
556
|
+
output: {
|
|
557
|
+
name: "filter",
|
|
558
|
+
attributes: { id: "filter_drop_shadow" },
|
|
559
|
+
children: [
|
|
560
|
+
{
|
|
561
|
+
name: "feGaussianBlur",
|
|
562
|
+
attributes: {
|
|
563
|
+
in: "SourceAlpha",
|
|
564
|
+
stdDeviation: String(this.std_deviation ?? 3)
|
|
565
|
+
}
|
|
566
|
+
},
|
|
567
|
+
{
|
|
568
|
+
name: "feOffset",
|
|
569
|
+
attributes: { dx: String(this.dx ?? 2), dy: String(this.dy ?? 2) }
|
|
570
|
+
},
|
|
571
|
+
{
|
|
572
|
+
name: "feFlood",
|
|
573
|
+
attributes: { "flood-color": asColor(this.color, "#000000") }
|
|
574
|
+
},
|
|
575
|
+
{
|
|
576
|
+
name: "feComposite",
|
|
577
|
+
attributes: { operator: "in", in2: "SourceAlpha" }
|
|
578
|
+
},
|
|
579
|
+
{
|
|
580
|
+
name: "feMerge",
|
|
581
|
+
children: [
|
|
582
|
+
{ name: "feMergeNode" },
|
|
583
|
+
{ name: "feMergeNode", attributes: { in: "SourceGraphic" } }
|
|
584
|
+
]
|
|
585
|
+
}
|
|
586
|
+
]
|
|
587
|
+
}
|
|
588
|
+
};
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
__decorate([
|
|
592
|
+
prop({
|
|
593
|
+
type: "float",
|
|
594
|
+
default: 3,
|
|
595
|
+
title: "Std Deviation",
|
|
596
|
+
description: "Standard deviation for blur"
|
|
597
|
+
})
|
|
598
|
+
], DropShadowLibNode.prototype, "std_deviation", void 0);
|
|
599
|
+
__decorate([
|
|
600
|
+
prop({
|
|
601
|
+
type: "int",
|
|
602
|
+
default: 2,
|
|
603
|
+
title: "Dx",
|
|
604
|
+
description: "X offset for shadow"
|
|
605
|
+
})
|
|
606
|
+
], DropShadowLibNode.prototype, "dx", void 0);
|
|
607
|
+
__decorate([
|
|
608
|
+
prop({
|
|
609
|
+
type: "int",
|
|
610
|
+
default: 2,
|
|
611
|
+
title: "Dy",
|
|
612
|
+
description: "Y offset for shadow"
|
|
613
|
+
})
|
|
614
|
+
], DropShadowLibNode.prototype, "dy", void 0);
|
|
615
|
+
__decorate([
|
|
616
|
+
prop({
|
|
617
|
+
type: "color",
|
|
618
|
+
default: {
|
|
619
|
+
type: "color",
|
|
620
|
+
value: "#000000"
|
|
621
|
+
},
|
|
622
|
+
title: "Color",
|
|
623
|
+
description: "Color for shadow"
|
|
624
|
+
})
|
|
625
|
+
], DropShadowLibNode.prototype, "color", void 0);
|
|
626
|
+
export class DocumentLibNode extends BaseNode {
|
|
627
|
+
static nodeType = "lib.svg.Document";
|
|
628
|
+
static title = "SVG Document";
|
|
629
|
+
static description = "Combine SVG elements into a complete SVG document.\n svg, document, combine\n\n Use cases:\n - Combine multiple SVG elements into a single document\n - Set document-level properties like viewBox and dimensions\n - Export complete SVG documents";
|
|
630
|
+
static metadataOutputTypes = {
|
|
631
|
+
output: "svg"
|
|
632
|
+
};
|
|
633
|
+
async process() {
|
|
634
|
+
const content = normalizeContent(this.elements ?? []);
|
|
635
|
+
const width = Number(this.width ?? 800);
|
|
636
|
+
const height = Number(this.height ?? 600);
|
|
637
|
+
const viewBox = String(this.viewBox ?? "0 0 800 600");
|
|
638
|
+
const doc = svgDocument(content, width, height, viewBox);
|
|
639
|
+
return { output: { data: Buffer.from(doc, "utf-8").toString("base64") } };
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
__decorate([
|
|
643
|
+
prop({
|
|
644
|
+
type: "list[svg_element]",
|
|
645
|
+
default: [],
|
|
646
|
+
title: "Elements",
|
|
647
|
+
description: "List of SVG elements"
|
|
648
|
+
})
|
|
649
|
+
], DocumentLibNode.prototype, "elements", void 0);
|
|
650
|
+
__decorate([
|
|
651
|
+
prop({
|
|
652
|
+
type: "int",
|
|
653
|
+
default: 800,
|
|
654
|
+
title: "Width",
|
|
655
|
+
description: "Document width",
|
|
656
|
+
min: 1,
|
|
657
|
+
max: 4096
|
|
658
|
+
})
|
|
659
|
+
], DocumentLibNode.prototype, "width", void 0);
|
|
660
|
+
__decorate([
|
|
661
|
+
prop({
|
|
662
|
+
type: "int",
|
|
663
|
+
default: 600,
|
|
664
|
+
title: "Height",
|
|
665
|
+
description: "Document height",
|
|
666
|
+
min: 1,
|
|
667
|
+
max: 4096
|
|
668
|
+
})
|
|
669
|
+
], DocumentLibNode.prototype, "height", void 0);
|
|
670
|
+
__decorate([
|
|
671
|
+
prop({
|
|
672
|
+
type: "str",
|
|
673
|
+
default: "0 0 800 600",
|
|
674
|
+
title: "Viewbox",
|
|
675
|
+
description: "SVG viewBox attribute"
|
|
676
|
+
})
|
|
677
|
+
], DocumentLibNode.prototype, "viewBox", void 0);
|
|
678
|
+
export class SVGToImageLibNode extends BaseNode {
|
|
679
|
+
static nodeType = "lib.svg.SVGToImage";
|
|
680
|
+
static title = "SVG to Image";
|
|
681
|
+
static description = "Create an SVG document and convert it to a raster image in one step.\n svg, document, raster, convert\n\n Use cases:\n - Create and rasterize SVG documents in a single operation\n - Generate image files from SVG elements\n - Convert vector graphics to bitmap format with custom dimensions";
|
|
682
|
+
static metadataOutputTypes = {
|
|
683
|
+
output: "image"
|
|
684
|
+
};
|
|
685
|
+
async process() {
|
|
686
|
+
const sharp = (await import("sharp")).default;
|
|
687
|
+
const content = normalizeContent(this.elements ?? []);
|
|
688
|
+
const width = Number(this.width ?? 800);
|
|
689
|
+
const height = Number(this.height ?? 600);
|
|
690
|
+
const scale = Number(this.scale ?? 1);
|
|
691
|
+
const viewBox = String(this.viewBox ?? "0 0 800 600");
|
|
692
|
+
const doc = svgDocument(content, width, height, viewBox);
|
|
693
|
+
const svgBuffer = Buffer.from(doc, "utf-8");
|
|
694
|
+
const pngBuffer = await sharp(svgBuffer, { density: 72 * scale })
|
|
695
|
+
.resize(width * scale, height * scale)
|
|
696
|
+
.png()
|
|
697
|
+
.toBuffer();
|
|
698
|
+
return {
|
|
699
|
+
output: {
|
|
700
|
+
type: "image",
|
|
701
|
+
data: pngBuffer.toString("base64"),
|
|
702
|
+
mimeType: "image/png",
|
|
703
|
+
width: width * scale,
|
|
704
|
+
height: height * scale
|
|
705
|
+
}
|
|
706
|
+
};
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
__decorate([
|
|
710
|
+
prop({
|
|
711
|
+
type: "list[svg_element]",
|
|
712
|
+
default: [],
|
|
713
|
+
title: "Elements",
|
|
714
|
+
description: "List of SVG elements"
|
|
715
|
+
})
|
|
716
|
+
], SVGToImageLibNode.prototype, "elements", void 0);
|
|
717
|
+
__decorate([
|
|
718
|
+
prop({
|
|
719
|
+
type: "int",
|
|
720
|
+
default: 800,
|
|
721
|
+
title: "Width",
|
|
722
|
+
description: "Document width",
|
|
723
|
+
min: 1,
|
|
724
|
+
max: 4096
|
|
725
|
+
})
|
|
726
|
+
], SVGToImageLibNode.prototype, "width", void 0);
|
|
727
|
+
__decorate([
|
|
728
|
+
prop({
|
|
729
|
+
type: "int",
|
|
730
|
+
default: 600,
|
|
731
|
+
title: "Height",
|
|
732
|
+
description: "Document height",
|
|
733
|
+
min: 1,
|
|
734
|
+
max: 4096
|
|
735
|
+
})
|
|
736
|
+
], SVGToImageLibNode.prototype, "height", void 0);
|
|
737
|
+
__decorate([
|
|
738
|
+
prop({
|
|
739
|
+
type: "str",
|
|
740
|
+
default: "0 0 800 600",
|
|
741
|
+
title: "Viewbox",
|
|
742
|
+
description: "SVG viewBox attribute"
|
|
743
|
+
})
|
|
744
|
+
], SVGToImageLibNode.prototype, "viewBox", void 0);
|
|
745
|
+
__decorate([
|
|
746
|
+
prop({
|
|
747
|
+
type: "int",
|
|
748
|
+
default: 1,
|
|
749
|
+
title: "Scale",
|
|
750
|
+
description: "Scale factor for rasterization",
|
|
751
|
+
min: 1,
|
|
752
|
+
max: 10
|
|
753
|
+
})
|
|
754
|
+
], SVGToImageLibNode.prototype, "scale", void 0);
|
|
755
|
+
export class GradientLibNode extends BaseNode {
|
|
756
|
+
static nodeType = "lib.svg.Gradient";
|
|
757
|
+
static title = "Gradient";
|
|
758
|
+
static description = "Create linear or radial gradients for SVG elements.\n svg, gradient, color\n\n Use cases:\n - Add smooth color transitions\n - Create complex color effects\n - Define reusable gradient definitions";
|
|
759
|
+
static metadataOutputTypes = {
|
|
760
|
+
output: "svg_element"
|
|
761
|
+
};
|
|
762
|
+
async process() {
|
|
763
|
+
const gradientType = String(this.gradient_type ?? "linearGradient");
|
|
764
|
+
const attrs = { id: `gradient_${gradientType}` };
|
|
765
|
+
if (gradientType === "linearGradient") {
|
|
766
|
+
attrs.x1 = `${String(this.x1 ?? 0)}%`;
|
|
767
|
+
attrs.y1 = `${String(this.y1 ?? 0)}%`;
|
|
768
|
+
attrs.x2 = `${String(this.x2 ?? 100)}%`;
|
|
769
|
+
attrs.y2 = `${String(this.y2 ?? 100)}%`;
|
|
770
|
+
}
|
|
771
|
+
else {
|
|
772
|
+
attrs.cx = `${String(this.x1 ?? 0)}%`;
|
|
773
|
+
attrs.cy = `${String(this.y1 ?? 0)}%`;
|
|
774
|
+
attrs.r = `${String(this.x2 ?? 100)}%`;
|
|
775
|
+
}
|
|
776
|
+
return {
|
|
777
|
+
output: {
|
|
778
|
+
name: gradientType,
|
|
779
|
+
attributes: attrs,
|
|
780
|
+
children: [
|
|
781
|
+
{
|
|
782
|
+
name: "stop",
|
|
783
|
+
attributes: {
|
|
784
|
+
offset: "0%",
|
|
785
|
+
style: `stop-color:${asColor(this.color1, "#000000")};stop-opacity:1`
|
|
786
|
+
}
|
|
787
|
+
},
|
|
788
|
+
{
|
|
789
|
+
name: "stop",
|
|
790
|
+
attributes: {
|
|
791
|
+
offset: "100%",
|
|
792
|
+
style: `stop-color:${asColor(this.color2, "#FFFFFF")};stop-opacity:1`
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
]
|
|
796
|
+
}
|
|
797
|
+
};
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
__decorate([
|
|
801
|
+
prop({
|
|
802
|
+
type: "enum",
|
|
803
|
+
default: "linearGradient",
|
|
804
|
+
title: "Gradient Type",
|
|
805
|
+
description: "Type of gradient",
|
|
806
|
+
values: ["linearGradient", "radialGradient"]
|
|
807
|
+
})
|
|
808
|
+
], GradientLibNode.prototype, "gradient_type", void 0);
|
|
809
|
+
__decorate([
|
|
810
|
+
prop({
|
|
811
|
+
type: "float",
|
|
812
|
+
default: 0,
|
|
813
|
+
title: "X1",
|
|
814
|
+
description: "Start X position (linear) or center X (radial)"
|
|
815
|
+
})
|
|
816
|
+
], GradientLibNode.prototype, "x1", void 0);
|
|
817
|
+
__decorate([
|
|
818
|
+
prop({
|
|
819
|
+
type: "float",
|
|
820
|
+
default: 0,
|
|
821
|
+
title: "Y1",
|
|
822
|
+
description: "Start Y position (linear) or center Y (radial)"
|
|
823
|
+
})
|
|
824
|
+
], GradientLibNode.prototype, "y1", void 0);
|
|
825
|
+
__decorate([
|
|
826
|
+
prop({
|
|
827
|
+
type: "float",
|
|
828
|
+
default: 100,
|
|
829
|
+
title: "X2",
|
|
830
|
+
description: "End X position (linear) or radius X (radial)"
|
|
831
|
+
})
|
|
832
|
+
], GradientLibNode.prototype, "x2", void 0);
|
|
833
|
+
__decorate([
|
|
834
|
+
prop({
|
|
835
|
+
type: "float",
|
|
836
|
+
default: 100,
|
|
837
|
+
title: "Y2",
|
|
838
|
+
description: "End Y position (linear) or radius Y (radial)"
|
|
839
|
+
})
|
|
840
|
+
], GradientLibNode.prototype, "y2", void 0);
|
|
841
|
+
__decorate([
|
|
842
|
+
prop({
|
|
843
|
+
type: "color",
|
|
844
|
+
default: {
|
|
845
|
+
type: "color",
|
|
846
|
+
value: "#000000"
|
|
847
|
+
},
|
|
848
|
+
title: "Color1",
|
|
849
|
+
description: "Start color of gradient"
|
|
850
|
+
})
|
|
851
|
+
], GradientLibNode.prototype, "color1", void 0);
|
|
852
|
+
__decorate([
|
|
853
|
+
prop({
|
|
854
|
+
type: "color",
|
|
855
|
+
default: {
|
|
856
|
+
type: "color",
|
|
857
|
+
value: "#FFFFFF"
|
|
858
|
+
},
|
|
859
|
+
title: "Color2",
|
|
860
|
+
description: "End color of gradient"
|
|
861
|
+
})
|
|
862
|
+
], GradientLibNode.prototype, "color2", void 0);
|
|
863
|
+
export class TransformLibNode extends BaseNode {
|
|
864
|
+
static nodeType = "lib.svg.Transform";
|
|
865
|
+
static title = "Transform";
|
|
866
|
+
static description = "Apply transformations to SVG elements.\n svg, transform, animation\n\n Use cases:\n - Rotate, scale, or translate elements\n - Create complex transformations\n - Prepare elements for animation";
|
|
867
|
+
static metadataOutputTypes = {
|
|
868
|
+
output: "svg_element"
|
|
869
|
+
};
|
|
870
|
+
async process() {
|
|
871
|
+
const content = { ...(this.content ?? {}) };
|
|
872
|
+
if (!content || typeof content !== "object" || !("name" in content)) {
|
|
873
|
+
return { output: { name: "g", attributes: {}, children: [] } };
|
|
874
|
+
}
|
|
875
|
+
const transforms = [];
|
|
876
|
+
const tx = Number(this.translate_x ?? 0);
|
|
877
|
+
const ty = Number(this.translate_y ?? 0);
|
|
878
|
+
const rotate = Number(this.rotate ?? 0);
|
|
879
|
+
const sx = Number(this.scale_x ?? 1);
|
|
880
|
+
const sy = Number(this.scale_y ?? 1);
|
|
881
|
+
if (tx !== 0 || ty !== 0)
|
|
882
|
+
transforms.push(`translate(${tx},${ty})`);
|
|
883
|
+
if (rotate !== 0)
|
|
884
|
+
transforms.push(`rotate(${rotate})`);
|
|
885
|
+
if (sx !== 1 || sy !== 1)
|
|
886
|
+
transforms.push(`scale(${sx},${sy})`);
|
|
887
|
+
if (transforms.length > 0) {
|
|
888
|
+
content.attributes = {
|
|
889
|
+
...(content.attributes ?? {}),
|
|
890
|
+
transform: transforms.join(" ")
|
|
891
|
+
};
|
|
892
|
+
}
|
|
893
|
+
return { output: content };
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
__decorate([
|
|
897
|
+
prop({
|
|
898
|
+
type: "svg_element",
|
|
899
|
+
default: {
|
|
900
|
+
type: "svg_element",
|
|
901
|
+
name: "",
|
|
902
|
+
attributes: {},
|
|
903
|
+
content: null,
|
|
904
|
+
children: []
|
|
905
|
+
},
|
|
906
|
+
title: "Content",
|
|
907
|
+
description: "SVG element to transform"
|
|
908
|
+
})
|
|
909
|
+
], TransformLibNode.prototype, "content", void 0);
|
|
910
|
+
__decorate([
|
|
911
|
+
prop({
|
|
912
|
+
type: "float",
|
|
913
|
+
default: 0,
|
|
914
|
+
title: "Translate X",
|
|
915
|
+
description: "X translation"
|
|
916
|
+
})
|
|
917
|
+
], TransformLibNode.prototype, "translate_x", void 0);
|
|
918
|
+
__decorate([
|
|
919
|
+
prop({
|
|
920
|
+
type: "float",
|
|
921
|
+
default: 0,
|
|
922
|
+
title: "Translate Y",
|
|
923
|
+
description: "Y translation"
|
|
924
|
+
})
|
|
925
|
+
], TransformLibNode.prototype, "translate_y", void 0);
|
|
926
|
+
__decorate([
|
|
927
|
+
prop({
|
|
928
|
+
type: "float",
|
|
929
|
+
default: 0,
|
|
930
|
+
title: "Rotate",
|
|
931
|
+
description: "Rotation angle in degrees"
|
|
932
|
+
})
|
|
933
|
+
], TransformLibNode.prototype, "rotate", void 0);
|
|
934
|
+
__decorate([
|
|
935
|
+
prop({
|
|
936
|
+
type: "float",
|
|
937
|
+
default: 1,
|
|
938
|
+
title: "Scale X",
|
|
939
|
+
description: "X scale factor"
|
|
940
|
+
})
|
|
941
|
+
], TransformLibNode.prototype, "scale_x", void 0);
|
|
942
|
+
__decorate([
|
|
943
|
+
prop({
|
|
944
|
+
type: "float",
|
|
945
|
+
default: 1,
|
|
946
|
+
title: "Scale Y",
|
|
947
|
+
description: "Y scale factor"
|
|
948
|
+
})
|
|
949
|
+
], TransformLibNode.prototype, "scale_y", void 0);
|
|
950
|
+
export class ClipPathLibNode extends BaseNode {
|
|
951
|
+
static nodeType = "lib.svg.ClipPath";
|
|
952
|
+
static title = "Clip Path";
|
|
953
|
+
static description = "Create clipping paths for SVG elements.\n svg, clip, mask\n\n Use cases:\n - Mask parts of elements\n - Create complex shapes through clipping\n - Apply visual effects using masks";
|
|
954
|
+
static metadataOutputTypes = {
|
|
955
|
+
output: "svg_element"
|
|
956
|
+
};
|
|
957
|
+
async process() {
|
|
958
|
+
const clipContent = (this.clip_content ?? {});
|
|
959
|
+
const content = { ...(this.content ?? {}) };
|
|
960
|
+
if (!clipContent || !content || !clipContent.name || !content.name) {
|
|
961
|
+
return { output: { name: "g", attributes: {}, children: [] } };
|
|
962
|
+
}
|
|
963
|
+
const clipId = `clip_path_${Date.now()}`;
|
|
964
|
+
content.attributes = {
|
|
965
|
+
...(content.attributes ?? {}),
|
|
966
|
+
"clip-path": `url(#${clipId})`
|
|
967
|
+
};
|
|
968
|
+
return {
|
|
969
|
+
output: {
|
|
970
|
+
name: "g",
|
|
971
|
+
children: [
|
|
972
|
+
{
|
|
973
|
+
name: "clipPath",
|
|
974
|
+
attributes: { id: clipId },
|
|
975
|
+
children: [clipContent]
|
|
976
|
+
},
|
|
977
|
+
content
|
|
978
|
+
]
|
|
979
|
+
}
|
|
980
|
+
};
|
|
981
|
+
}
|
|
982
|
+
}
|
|
983
|
+
__decorate([
|
|
984
|
+
prop({
|
|
985
|
+
type: "svg_element",
|
|
986
|
+
default: {
|
|
987
|
+
type: "svg_element",
|
|
988
|
+
name: "",
|
|
989
|
+
attributes: {},
|
|
990
|
+
content: null,
|
|
991
|
+
children: []
|
|
992
|
+
},
|
|
993
|
+
title: "Clip Content",
|
|
994
|
+
description: "SVG element to use as clip path"
|
|
995
|
+
})
|
|
996
|
+
], ClipPathLibNode.prototype, "clip_content", void 0);
|
|
997
|
+
__decorate([
|
|
998
|
+
prop({
|
|
999
|
+
type: "svg_element",
|
|
1000
|
+
default: {
|
|
1001
|
+
type: "svg_element",
|
|
1002
|
+
name: "",
|
|
1003
|
+
attributes: {},
|
|
1004
|
+
content: null,
|
|
1005
|
+
children: []
|
|
1006
|
+
},
|
|
1007
|
+
title: "Content",
|
|
1008
|
+
description: "SVG element to clip"
|
|
1009
|
+
})
|
|
1010
|
+
], ClipPathLibNode.prototype, "content", void 0);
|
|
1011
|
+
export const LIB_SVG_NODES = [
|
|
1012
|
+
RectLibNode,
|
|
1013
|
+
CircleLibNode,
|
|
1014
|
+
EllipseLibNode,
|
|
1015
|
+
LineLibNode,
|
|
1016
|
+
PolygonLibNode,
|
|
1017
|
+
PathLibNode,
|
|
1018
|
+
TextLibNode,
|
|
1019
|
+
GaussianBlurLibNode,
|
|
1020
|
+
DropShadowLibNode,
|
|
1021
|
+
DocumentLibNode,
|
|
1022
|
+
SVGToImageLibNode,
|
|
1023
|
+
GradientLibNode,
|
|
1024
|
+
TransformLibNode,
|
|
1025
|
+
ClipPathLibNode
|
|
1026
|
+
];
|
|
1027
|
+
//# sourceMappingURL=lib-svg.js.map
|