@nodetool-ai/base-nodes 0.7.0-rc.23 → 0.8.1

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.
Files changed (363) hide show
  1. package/README.md +21 -0
  2. package/dist/.nodetool-build-stamp +1 -0
  3. package/dist/index.d.ts +61 -67
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.js +179 -173
  6. package/dist/index.js.map +1 -1
  7. package/dist/platforms/browser.d.ts +19 -0
  8. package/dist/platforms/browser.d.ts.map +1 -0
  9. package/dist/platforms/browser.js +29 -0
  10. package/dist/platforms/browser.js.map +1 -0
  11. package/package.json +53 -65
  12. package/dist/lib/audio-wav.d.ts +0 -66
  13. package/dist/lib/audio-wav.d.ts.map +0 -1
  14. package/dist/lib/audio-wav.js +0 -215
  15. package/dist/lib/audio-wav.js.map +0 -1
  16. package/dist/nodes/agent-tool-hydration.d.ts +0 -10
  17. package/dist/nodes/agent-tool-hydration.d.ts.map +0 -1
  18. package/dist/nodes/agent-tool-hydration.js +0 -43
  19. package/dist/nodes/agent-tool-hydration.js.map +0 -1
  20. package/dist/nodes/agents.d.ts +0 -262
  21. package/dist/nodes/agents.d.ts.map +0 -1
  22. package/dist/nodes/agents.js +0 -2856
  23. package/dist/nodes/agents.js.map +0 -1
  24. package/dist/nodes/anthropic.d.ts +0 -26
  25. package/dist/nodes/anthropic.d.ts.map +0 -1
  26. package/dist/nodes/anthropic.js +0 -133
  27. package/dist/nodes/anthropic.js.map +0 -1
  28. package/dist/nodes/apify.d.ts +0 -120
  29. package/dist/nodes/apify.d.ts.map +0 -1
  30. package/dist/nodes/apify.js +0 -618
  31. package/dist/nodes/apify.js.map +0 -1
  32. package/dist/nodes/audio.d.ts +0 -301
  33. package/dist/nodes/audio.d.ts.map +0 -1
  34. package/dist/nodes/audio.js +0 -1274
  35. package/dist/nodes/audio.js.map +0 -1
  36. package/dist/nodes/code-node.d.ts +0 -34
  37. package/dist/nodes/code-node.d.ts.map +0 -1
  38. package/dist/nodes/code-node.js +0 -343
  39. package/dist/nodes/code-node.js.map +0 -1
  40. package/dist/nodes/code.d.ts +0 -301
  41. package/dist/nodes/code.d.ts.map +0 -1
  42. package/dist/nodes/code.js +0 -850
  43. package/dist/nodes/code.js.map +0 -1
  44. package/dist/nodes/compare.d.ts +0 -18
  45. package/dist/nodes/compare.d.ts.map +0 -1
  46. package/dist/nodes/compare.js +0 -122
  47. package/dist/nodes/compare.js.map +0 -1
  48. package/dist/nodes/constant.d.ts +0 -315
  49. package/dist/nodes/constant.d.ts.map +0 -1
  50. package/dist/nodes/constant.js +0 -715
  51. package/dist/nodes/constant.js.map +0 -1
  52. package/dist/nodes/control.d.ts +0 -83
  53. package/dist/nodes/control.d.ts.map +0 -1
  54. package/dist/nodes/control.js +0 -212
  55. package/dist/nodes/control.js.map +0 -1
  56. package/dist/nodes/data.d.ts +0 -369
  57. package/dist/nodes/data.d.ts.map +0 -1
  58. package/dist/nodes/data.js +0 -1590
  59. package/dist/nodes/data.js.map +0 -1
  60. package/dist/nodes/document.d.ts +0 -134
  61. package/dist/nodes/document.d.ts.map +0 -1
  62. package/dist/nodes/document.js +0 -984
  63. package/dist/nodes/document.js.map +0 -1
  64. package/dist/nodes/extended-placeholders.d.ts +0 -6
  65. package/dist/nodes/extended-placeholders.d.ts.map +0 -1
  66. package/dist/nodes/extended-placeholders.js +0 -19
  67. package/dist/nodes/extended-placeholders.js.map +0 -1
  68. package/dist/nodes/gemini.d.ts +0 -110
  69. package/dist/nodes/gemini.d.ts.map +0 -1
  70. package/dist/nodes/gemini.js +0 -871
  71. package/dist/nodes/gemini.js.map +0 -1
  72. package/dist/nodes/generators.d.ts +0 -84
  73. package/dist/nodes/generators.d.ts.map +0 -1
  74. package/dist/nodes/generators.js +0 -968
  75. package/dist/nodes/generators.js.map +0 -1
  76. package/dist/nodes/image.d.ts +0 -232
  77. package/dist/nodes/image.d.ts.map +0 -1
  78. package/dist/nodes/image.js +0 -1395
  79. package/dist/nodes/image.js.map +0 -1
  80. package/dist/nodes/input.d.ts +0 -445
  81. package/dist/nodes/input.d.ts.map +0 -1
  82. package/dist/nodes/input.js +0 -1459
  83. package/dist/nodes/input.js.map +0 -1
  84. package/dist/nodes/kie-dynamic.d.ts +0 -31
  85. package/dist/nodes/kie-dynamic.d.ts.map +0 -1
  86. package/dist/nodes/kie-dynamic.js +0 -270
  87. package/dist/nodes/kie-dynamic.js.map +0 -1
  88. package/dist/nodes/lib-audio-dsp.d.ts +0 -85
  89. package/dist/nodes/lib-audio-dsp.d.ts.map +0 -1
  90. package/dist/nodes/lib-audio-dsp.js +0 -450
  91. package/dist/nodes/lib-audio-dsp.js.map +0 -1
  92. package/dist/nodes/lib-audio-effects.d.ts +0 -116
  93. package/dist/nodes/lib-audio-effects.d.ts.map +0 -1
  94. package/dist/nodes/lib-audio-effects.js +0 -905
  95. package/dist/nodes/lib-audio-effects.js.map +0 -1
  96. package/dist/nodes/lib-browser.d.ts +0 -99
  97. package/dist/nodes/lib-browser.d.ts.map +0 -1
  98. package/dist/nodes/lib-browser.js +0 -692
  99. package/dist/nodes/lib-browser.js.map +0 -1
  100. package/dist/nodes/lib-charts.d.ts +0 -20
  101. package/dist/nodes/lib-charts.d.ts.map +0 -1
  102. package/dist/nodes/lib-charts.js +0 -245
  103. package/dist/nodes/lib-charts.js.map +0 -1
  104. package/dist/nodes/lib-datetime.d.ts +0 -108
  105. package/dist/nodes/lib-datetime.d.ts.map +0 -1
  106. package/dist/nodes/lib-datetime.js +0 -421
  107. package/dist/nodes/lib-datetime.js.map +0 -1
  108. package/dist/nodes/lib-doc-convert.d.ts +0 -19
  109. package/dist/nodes/lib-doc-convert.d.ts.map +0 -1
  110. package/dist/nodes/lib-doc-convert.js +0 -257
  111. package/dist/nodes/lib-doc-convert.js.map +0 -1
  112. package/dist/nodes/lib-doc-transform.d.ts +0 -39
  113. package/dist/nodes/lib-doc-transform.d.ts.map +0 -1
  114. package/dist/nodes/lib-doc-transform.js +0 -335
  115. package/dist/nodes/lib-doc-transform.js.map +0 -1
  116. package/dist/nodes/lib-docx.d.ts +0 -106
  117. package/dist/nodes/lib-docx.d.ts.map +0 -1
  118. package/dist/nodes/lib-docx.js +0 -595
  119. package/dist/nodes/lib-docx.js.map +0 -1
  120. package/dist/nodes/lib-epub.d.ts +0 -55
  121. package/dist/nodes/lib-epub.d.ts.map +0 -1
  122. package/dist/nodes/lib-epub.js +0 -220
  123. package/dist/nodes/lib-epub.js.map +0 -1
  124. package/dist/nodes/lib-excel.d.ts +0 -74
  125. package/dist/nodes/lib-excel.d.ts.map +0 -1
  126. package/dist/nodes/lib-excel.js +0 -448
  127. package/dist/nodes/lib-excel.js.map +0 -1
  128. package/dist/nodes/lib-graphql.d.ts +0 -66
  129. package/dist/nodes/lib-graphql.d.ts.map +0 -1
  130. package/dist/nodes/lib-graphql.js +0 -333
  131. package/dist/nodes/lib-graphql.js.map +0 -1
  132. package/dist/nodes/lib-grid.d.ts +0 -27
  133. package/dist/nodes/lib-grid.d.ts.map +0 -1
  134. package/dist/nodes/lib-grid.js +0 -172
  135. package/dist/nodes/lib-grid.js.map +0 -1
  136. package/dist/nodes/lib-html-parse.d.ts +0 -108
  137. package/dist/nodes/lib-html-parse.d.ts.map +0 -1
  138. package/dist/nodes/lib-html-parse.js +0 -365
  139. package/dist/nodes/lib-html-parse.js.map +0 -1
  140. package/dist/nodes/lib-http.d.ts +0 -98
  141. package/dist/nodes/lib-http.d.ts.map +0 -1
  142. package/dist/nodes/lib-http.js +0 -267
  143. package/dist/nodes/lib-http.js.map +0 -1
  144. package/dist/nodes/lib-image-color-grading.d.ts +0 -3
  145. package/dist/nodes/lib-image-color-grading.d.ts.map +0 -1
  146. package/dist/nodes/lib-image-color-grading.js +0 -1386
  147. package/dist/nodes/lib-image-color-grading.js.map +0 -1
  148. package/dist/nodes/lib-image-draw.d.ts +0 -3
  149. package/dist/nodes/lib-image-draw.d.ts.map +0 -1
  150. package/dist/nodes/lib-image-draw.js +0 -470
  151. package/dist/nodes/lib-image-draw.js.map +0 -1
  152. package/dist/nodes/lib-image-enhance.d.ts +0 -3
  153. package/dist/nodes/lib-image-enhance.d.ts.map +0 -1
  154. package/dist/nodes/lib-image-enhance.js +0 -731
  155. package/dist/nodes/lib-image-enhance.js.map +0 -1
  156. package/dist/nodes/lib-image-filter.d.ts +0 -3
  157. package/dist/nodes/lib-image-filter.d.ts.map +0 -1
  158. package/dist/nodes/lib-image-filter.js +0 -684
  159. package/dist/nodes/lib-image-filter.js.map +0 -1
  160. package/dist/nodes/lib-image-utils.d.ts +0 -24
  161. package/dist/nodes/lib-image-utils.d.ts.map +0 -1
  162. package/dist/nodes/lib-image-utils.js +0 -150
  163. package/dist/nodes/lib-image-utils.js.map +0 -1
  164. package/dist/nodes/lib-mail.d.ts +0 -74
  165. package/dist/nodes/lib-mail.d.ts.map +0 -1
  166. package/dist/nodes/lib-mail.js +0 -452
  167. package/dist/nodes/lib-mail.js.map +0 -1
  168. package/dist/nodes/lib-markdown.d.ts +0 -70
  169. package/dist/nodes/lib-markdown.d.ts.map +0 -1
  170. package/dist/nodes/lib-markdown.js +0 -236
  171. package/dist/nodes/lib-markdown.js.map +0 -1
  172. package/dist/nodes/lib-nlp.d.ts +0 -98
  173. package/dist/nodes/lib-nlp.d.ts.map +0 -1
  174. package/dist/nodes/lib-nlp.js +0 -374
  175. package/dist/nodes/lib-nlp.js.map +0 -1
  176. package/dist/nodes/lib-notion.d.ts +0 -99
  177. package/dist/nodes/lib-notion.d.ts.map +0 -1
  178. package/dist/nodes/lib-notion.js +0 -601
  179. package/dist/nodes/lib-notion.js.map +0 -1
  180. package/dist/nodes/lib-ocr.d.ts +0 -31
  181. package/dist/nodes/lib-ocr.d.ts.map +0 -1
  182. package/dist/nodes/lib-ocr.js +0 -143
  183. package/dist/nodes/lib-ocr.js.map +0 -1
  184. package/dist/nodes/lib-os.d.ts +0 -312
  185. package/dist/nodes/lib-os.d.ts.map +0 -1
  186. package/dist/nodes/lib-os.js +0 -909
  187. package/dist/nodes/lib-os.js.map +0 -1
  188. package/dist/nodes/lib-pdf.d.ts +0 -142
  189. package/dist/nodes/lib-pdf.d.ts.map +0 -1
  190. package/dist/nodes/lib-pdf.js +0 -871
  191. package/dist/nodes/lib-pdf.js.map +0 -1
  192. package/dist/nodes/lib-pptx.d.ts +0 -29
  193. package/dist/nodes/lib-pptx.d.ts.map +0 -1
  194. package/dist/nodes/lib-pptx.js +0 -122
  195. package/dist/nodes/lib-pptx.js.map +0 -1
  196. package/dist/nodes/lib-rss.d.ts +0 -31
  197. package/dist/nodes/lib-rss.d.ts.map +0 -1
  198. package/dist/nodes/lib-rss.js +0 -163
  199. package/dist/nodes/lib-rss.js.map +0 -1
  200. package/dist/nodes/lib-s3.d.ts +0 -112
  201. package/dist/nodes/lib-s3.d.ts.map +0 -1
  202. package/dist/nodes/lib-s3.js +0 -521
  203. package/dist/nodes/lib-s3.js.map +0 -1
  204. package/dist/nodes/lib-secret.d.ts +0 -15
  205. package/dist/nodes/lib-secret.d.ts.map +0 -1
  206. package/dist/nodes/lib-secret.js +0 -42
  207. package/dist/nodes/lib-secret.js.map +0 -1
  208. package/dist/nodes/lib-sqlite.d.ts +0 -102
  209. package/dist/nodes/lib-sqlite.d.ts.map +0 -1
  210. package/dist/nodes/lib-sqlite.js +0 -532
  211. package/dist/nodes/lib-sqlite.js.map +0 -1
  212. package/dist/nodes/lib-supabase.d.ts +0 -86
  213. package/dist/nodes/lib-supabase.d.ts.map +0 -1
  214. package/dist/nodes/lib-supabase.js +0 -425
  215. package/dist/nodes/lib-supabase.js.map +0 -1
  216. package/dist/nodes/lib-svg.d.ts +0 -199
  217. package/dist/nodes/lib-svg.d.ts.map +0 -1
  218. package/dist/nodes/lib-svg.js +0 -1027
  219. package/dist/nodes/lib-svg.js.map +0 -1
  220. package/dist/nodes/lib-tensorflow.d.ts +0 -71
  221. package/dist/nodes/lib-tensorflow.d.ts.map +0 -1
  222. package/dist/nodes/lib-tensorflow.js +0 -351
  223. package/dist/nodes/lib-tensorflow.js.map +0 -1
  224. package/dist/nodes/lib-twilio.d.ts +0 -71
  225. package/dist/nodes/lib-twilio.d.ts.map +0 -1
  226. package/dist/nodes/lib-twilio.js +0 -469
  227. package/dist/nodes/lib-twilio.js.map +0 -1
  228. package/dist/nodes/lib-validate.d.ts +0 -84
  229. package/dist/nodes/lib-validate.d.ts.map +0 -1
  230. package/dist/nodes/lib-validate.js +0 -215
  231. package/dist/nodes/lib-validate.js.map +0 -1
  232. package/dist/nodes/lib-video-download.d.ts +0 -26
  233. package/dist/nodes/lib-video-download.d.ts.map +0 -1
  234. package/dist/nodes/lib-video-download.js +0 -299
  235. package/dist/nodes/lib-video-download.js.map +0 -1
  236. package/dist/nodes/messaging.d.ts +0 -88
  237. package/dist/nodes/messaging.d.ts.map +0 -1
  238. package/dist/nodes/messaging.js +0 -418
  239. package/dist/nodes/messaging.js.map +0 -1
  240. package/dist/nodes/mistral.d.ts +0 -83
  241. package/dist/nodes/mistral.d.ts.map +0 -1
  242. package/dist/nodes/mistral.js +0 -450
  243. package/dist/nodes/mistral.js.map +0 -1
  244. package/dist/nodes/model3d/analysis.d.ts +0 -13
  245. package/dist/nodes/model3d/analysis.d.ts.map +0 -1
  246. package/dist/nodes/model3d/analysis.js +0 -36
  247. package/dist/nodes/model3d/analysis.js.map +0 -1
  248. package/dist/nodes/model3d/base.d.ts +0 -11
  249. package/dist/nodes/model3d/base.d.ts.map +0 -1
  250. package/dist/nodes/model3d/base.js +0 -20
  251. package/dist/nodes/model3d/base.js.map +0 -1
  252. package/dist/nodes/model3d/boolean-ops.d.ts +0 -2
  253. package/dist/nodes/model3d/boolean-ops.d.ts.map +0 -1
  254. package/dist/nodes/model3d/boolean-ops.js +0 -172
  255. package/dist/nodes/model3d/boolean-ops.js.map +0 -1
  256. package/dist/nodes/model3d/cleanup.d.ts +0 -47
  257. package/dist/nodes/model3d/cleanup.d.ts.map +0 -1
  258. package/dist/nodes/model3d/cleanup.js +0 -136
  259. package/dist/nodes/model3d/cleanup.js.map +0 -1
  260. package/dist/nodes/model3d/convert.d.ts +0 -14
  261. package/dist/nodes/model3d/convert.d.ts.map +0 -1
  262. package/dist/nodes/model3d/convert.js +0 -64
  263. package/dist/nodes/model3d/convert.js.map +0 -1
  264. package/dist/nodes/model3d/defaults.d.ts +0 -34
  265. package/dist/nodes/model3d/defaults.d.ts.map +0 -1
  266. package/dist/nodes/model3d/defaults.js +0 -28
  267. package/dist/nodes/model3d/defaults.js.map +0 -1
  268. package/dist/nodes/model3d/document-ops.d.ts +0 -4
  269. package/dist/nodes/model3d/document-ops.d.ts.map +0 -1
  270. package/dist/nodes/model3d/document-ops.js +0 -40
  271. package/dist/nodes/model3d/document-ops.js.map +0 -1
  272. package/dist/nodes/model3d/generation.d.ts +0 -39
  273. package/dist/nodes/model3d/generation.d.ts.map +0 -1
  274. package/dist/nodes/model3d/generation.js +0 -179
  275. package/dist/nodes/model3d/generation.js.map +0 -1
  276. package/dist/nodes/model3d/glb.d.ts +0 -29
  277. package/dist/nodes/model3d/glb.d.ts.map +0 -1
  278. package/dist/nodes/model3d/glb.js +0 -255
  279. package/dist/nodes/model3d/glb.js.map +0 -1
  280. package/dist/nodes/model3d/index.d.ts +0 -20
  281. package/dist/nodes/model3d/index.d.ts.map +0 -1
  282. package/dist/nodes/model3d/index.js +0 -38
  283. package/dist/nodes/model3d/index.js.map +0 -1
  284. package/dist/nodes/model3d/io.d.ts +0 -38
  285. package/dist/nodes/model3d/io.d.ts.map +0 -1
  286. package/dist/nodes/model3d/io.js +0 -162
  287. package/dist/nodes/model3d/io.js.map +0 -1
  288. package/dist/nodes/model3d/mesh-ops.d.ts +0 -40
  289. package/dist/nodes/model3d/mesh-ops.d.ts.map +0 -1
  290. package/dist/nodes/model3d/mesh-ops.js +0 -775
  291. package/dist/nodes/model3d/mesh-ops.js.map +0 -1
  292. package/dist/nodes/model3d/nodes.d.ts +0 -2
  293. package/dist/nodes/model3d/nodes.d.ts.map +0 -1
  294. package/dist/nodes/model3d/nodes.js +0 -2
  295. package/dist/nodes/model3d/nodes.js.map +0 -1
  296. package/dist/nodes/model3d/ops.d.ts +0 -37
  297. package/dist/nodes/model3d/ops.d.ts.map +0 -1
  298. package/dist/nodes/model3d/ops.js +0 -137
  299. package/dist/nodes/model3d/ops.js.map +0 -1
  300. package/dist/nodes/model3d/transforms.d.ts +0 -49
  301. package/dist/nodes/model3d/transforms.d.ts.map +0 -1
  302. package/dist/nodes/model3d/transforms.js +0 -142
  303. package/dist/nodes/model3d/transforms.js.map +0 -1
  304. package/dist/nodes/model3d/types.d.ts +0 -81
  305. package/dist/nodes/model3d/types.d.ts.map +0 -1
  306. package/dist/nodes/model3d/types.js +0 -2
  307. package/dist/nodes/model3d/types.js.map +0 -1
  308. package/dist/nodes/model3d/utils.d.ts +0 -34
  309. package/dist/nodes/model3d/utils.d.ts.map +0 -1
  310. package/dist/nodes/model3d/utils.js +0 -185
  311. package/dist/nodes/model3d/utils.js.map +0 -1
  312. package/dist/nodes/model3d.d.ts +0 -2
  313. package/dist/nodes/model3d.d.ts.map +0 -1
  314. package/dist/nodes/model3d.js +0 -2
  315. package/dist/nodes/model3d.js.map +0 -1
  316. package/dist/nodes/openai.d.ts +0 -172
  317. package/dist/nodes/openai.d.ts.map +0 -1
  318. package/dist/nodes/openai.js +0 -1294
  319. package/dist/nodes/openai.js.map +0 -1
  320. package/dist/nodes/output.d.ts +0 -29
  321. package/dist/nodes/output.d.ts.map +0 -1
  322. package/dist/nodes/output.js +0 -87
  323. package/dist/nodes/output.js.map +0 -1
  324. package/dist/nodes/sandbox.d.ts +0 -63
  325. package/dist/nodes/sandbox.d.ts.map +0 -1
  326. package/dist/nodes/sandbox.js +0 -633
  327. package/dist/nodes/sandbox.js.map +0 -1
  328. package/dist/nodes/search.d.ts +0 -117
  329. package/dist/nodes/search.d.ts.map +0 -1
  330. package/dist/nodes/search.js +0 -607
  331. package/dist/nodes/search.js.map +0 -1
  332. package/dist/nodes/team.d.ts +0 -74
  333. package/dist/nodes/team.d.ts.map +0 -1
  334. package/dist/nodes/team.js +0 -309
  335. package/dist/nodes/team.js.map +0 -1
  336. package/dist/nodes/text-extra.d.ts +0 -633
  337. package/dist/nodes/text-extra.d.ts.map +0 -1
  338. package/dist/nodes/text-extra.js +0 -2226
  339. package/dist/nodes/text-extra.js.map +0 -1
  340. package/dist/nodes/tool-agents.d.ts +0 -334
  341. package/dist/nodes/tool-agents.d.ts.map +0 -1
  342. package/dist/nodes/tool-agents.js +0 -1861
  343. package/dist/nodes/tool-agents.js.map +0 -1
  344. package/dist/nodes/triggers.d.ts +0 -107
  345. package/dist/nodes/triggers.d.ts.map +0 -1
  346. package/dist/nodes/triggers.js +0 -706
  347. package/dist/nodes/triggers.js.map +0 -1
  348. package/dist/nodes/vector.d.ts +0 -168
  349. package/dist/nodes/vector.d.ts.map +0 -1
  350. package/dist/nodes/vector.js +0 -1121
  351. package/dist/nodes/vector.js.map +0 -1
  352. package/dist/nodes/video.d.ts +0 -387
  353. package/dist/nodes/video.d.ts.map +0 -1
  354. package/dist/nodes/video.js +0 -2383
  355. package/dist/nodes/video.js.map +0 -1
  356. package/dist/nodes/workflow.d.ts +0 -24
  357. package/dist/nodes/workflow.d.ts.map +0 -1
  358. package/dist/nodes/workflow.js +0 -146
  359. package/dist/nodes/workflow.js.map +0 -1
  360. package/dist/nodes/workspace.d.ts +0 -203
  361. package/dist/nodes/workspace.d.ts.map +0 -1
  362. package/dist/nodes/workspace.js +0 -795
  363. package/dist/nodes/workspace.js.map +0 -1
@@ -1,1027 +0,0 @@
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('"', "&quot;")}"`)
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