n8n-nodes-svgr 0.1.1 → 0.2.0

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/LICENSE.md CHANGED
@@ -1,4 +1,4 @@
1
- Copyright 2022 n8n
1
+ Copyright 2026 SeonHyungJo
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy of
4
4
  this software and associated documentation files (the "Software"), to deal in
package/README.md CHANGED
@@ -7,17 +7,26 @@ This is an n8n community node that transforms SVG code into React components.
7
7
  ## ✅ n8n Cloud Compatible
8
8
 
9
9
  This node has **no external dependencies** and is fully compatible with both:
10
+
10
11
  - ✅ n8n Cloud
11
12
  - ✅ Self-hosted n8n instances
12
13
 
13
14
  ## Features
14
15
 
15
16
  - Transform SVG code into React components
16
- - Customizable options:
17
- - **Icon Mode**: Replace width/height with `1em` for scalable icons
18
- - **TypeScript**: Generate TypeScript-compatible code
19
- - **Prettier**: Format output with Prettier
20
- - **Dimensions**: Keep or remove original width/height attributes
17
+ - **Basic Options**: icon, dimensions, svgo, prettier, removeViewBox, addFillCurrentColor
18
+ - **Code Generation**: typescript, jsxRuntime (classic/automatic), exportType (default/named)
19
+ - **Component Wrapping**: ref (forwardRef), memo (React.memo)
20
+ - **Props Control**: expandProps, svgProps, replaceAttrValues
21
+ - **Accessibility**: titleProp, descProp (aria-labelledby, aria-describedby)
22
+ - **React Native**: native mode with react-native-svg support
23
+
24
+ ## Documentation
25
+
26
+ - [Options Guide (English)](docs/OPTIONS_EN.md)
27
+ - [옵션 가이드 (한국어)](docs/OPTIONS_KO.md)
28
+ - [SVGO Options (English)](docs/SVGO_OPTIONS_EN.md)
29
+ - [SVGO 옵션 (한국어)](docs/SVGO_OPTIONS_KO.md)
21
30
 
22
31
  ## Installation
23
32
 
@@ -60,16 +69,26 @@ Or install through the n8n UI:
60
69
 
61
70
  1. Add the **SVGR** node to your workflow
62
71
  2. Enter your SVG code in the **SVG Code** field
63
- 3. Configure options as needed:
64
- - **Icon**: Enable for icon-style components (default: `true`)
65
- - **TypeScript**: Generate TypeScript code (default: `false`)
66
- - **Prettier**: Format with Prettier (default: `true`)
67
- - **Dimensions**: Keep original dimensions (default: `false`)
68
- 4. Execute the node to get the transformed React component
72
+ 3. Set the **Component Name** (default: `SvgComponent`)
73
+ 4. Configure options as needed (see [Options Guide](docs/OPTIONS_EN.md) for details)
74
+ 5. Execute the node to get the transformed React component
75
+
76
+ ### Quick Options Reference
77
+
78
+ | Option | Default | Description |
79
+ | ---------- | --------- | -------------------------------------- |
80
+ | icon | `true` | Remove width/height for scalable icons |
81
+ | typescript | `false` | Generate TypeScript code |
82
+ | jsxRuntime | `classic` | JSX runtime (`classic` or `automatic`) |
83
+ | ref | `false` | Wrap with forwardRef |
84
+ | memo | `false` | Wrap with React.memo |
85
+ | native | `false` | Generate React Native SVG code |
86
+ | exportType | `default` | Export type (`default` or `named`) |
69
87
 
70
88
  ### Example
71
89
 
72
90
  **Input (SVG Code):**
91
+
73
92
  ```xml
74
93
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
75
94
  <path d="M12 2L2 7v10c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V7l-10-5z"/>
@@ -77,12 +96,13 @@ Or install through the n8n UI:
77
96
  ```
78
97
 
79
98
  **Output (reactCode):**
99
+
80
100
  ```jsx
81
- import * as React from "react";
101
+ import * as React from 'react';
82
102
  const SvgComponent = (props) => (
83
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" {...props}>
84
- <path d="M12 2 2 7v10c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V7l-10-5z" />
85
- </svg>
103
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" {...props}>
104
+ <path d="M12 2 2 7v10c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V7l-10-5z" />
105
+ </svg>
86
106
  );
87
107
  export default SvgComponent;
88
108
  ```
@@ -149,20 +169,22 @@ Then test your node in n8n workflows at http://localhost:5678
149
169
  ## Compatibility
150
170
 
151
171
  | n8n Version | Compatibility |
152
- |-------------|---------------|
153
- | 1.0+ | ✅ Compatible |
154
- | n8n Cloud | ✅ Compatible |
172
+ | ----------- | ------------- |
173
+ | 1.0+ | ✅ Compatible |
174
+ | n8n Cloud | ✅ Compatible |
155
175
 
156
176
  **No external dependencies required!** This node uses a custom SVG→JSX transformer built specifically for n8n, making it fully compatible with n8n Cloud.
157
177
 
158
178
  ## Technical Details
159
179
 
160
180
  This node uses a custom-built SVG→JSX transformer that:
181
+
161
182
  - Converts HTML attributes to React JSX syntax (e.g., `class` → `className`, `stroke-width` → `strokeWidth`)
162
183
  - Handles style attributes by converting them to React style objects
163
184
  - Supports icon mode (removes dimensions for scalable icons)
164
185
  - Generates TypeScript-compatible code when enabled
165
186
  - Formats output with basic prettification
187
+ - Includes built-in SVGO optimization (27 plugins for SVG cleanup)
166
188
 
167
189
  The transformer is built without external dependencies, making it fully compatible with n8n Cloud restrictions.
168
190
 
@@ -174,6 +196,7 @@ The transformer is built without external dependencies, making it fully compatib
174
196
  ## Version History
175
197
 
176
198
  ### 0.1.0
199
+
177
200
  - Initial release
178
201
  - Transform SVG to React components
179
202
  - Configurable options (Icon, TypeScript, Prettier, Dimensions)
@@ -186,6 +209,7 @@ The transformer is built without external dependencies, making it fully compatib
186
209
  ## Author
187
210
 
188
211
  **SeonHyungjo**
212
+
189
213
  - Email: seonhyung.jo@gmail.com
190
214
  - GitHub: [@SeonHyungjo](https://github.com/SeonHyungjo)
191
215
 
@@ -196,6 +220,7 @@ Issues and pull requests are welcome! Please feel free to contribute.
196
220
  ## Support
197
221
 
198
222
  If you encounter any issues or have questions:
223
+
199
224
  1. Check the [Issues](https://github.com/SeonHyungjo/n8n-nodes-svgr/issues) page
200
225
  2. Create a new issue if your problem isn't already listed
201
226
  3. Visit the [n8n Community Forum](https://community.n8n.io/)
@@ -53,6 +53,13 @@ class Svgr {
53
53
  default: false,
54
54
  description: 'Whether to add fill="currentColor" to the SVG element (removes existing fill attributes)',
55
55
  },
56
+ {
57
+ displayName: 'Desc Prop',
58
+ name: 'descProp',
59
+ type: 'boolean',
60
+ default: false,
61
+ description: 'Whether to add desc and descId props for accessibility (adds aria-describedby)',
62
+ },
56
63
  {
57
64
  displayName: 'Dimensions',
58
65
  name: 'dimensions',
@@ -60,6 +67,49 @@ class Svgr {
60
67
  default: false,
61
68
  description: 'Whether to keep width and height attributes from the original SVG',
62
69
  },
70
+ {
71
+ displayName: 'Expand Props',
72
+ name: 'expandProps',
73
+ type: 'options',
74
+ options: [
75
+ {
76
+ name: 'End (Default)',
77
+ value: 'end',
78
+ description: 'Add {...props} at the end of SVG attributes',
79
+ },
80
+ {
81
+ name: 'Start',
82
+ value: 'start',
83
+ description: 'Add {...props} at the start of SVG attributes',
84
+ },
85
+ {
86
+ name: 'None',
87
+ value: 'none',
88
+ description: 'Do not add props spread',
89
+ },
90
+ ],
91
+ default: 'end',
92
+ description: 'Where to expand props on the SVG element',
93
+ },
94
+ {
95
+ displayName: 'Export Type',
96
+ name: 'exportType',
97
+ type: 'options',
98
+ options: [
99
+ {
100
+ name: 'Default Export',
101
+ value: 'default',
102
+ description: 'Use export default Component',
103
+ },
104
+ {
105
+ name: 'Named Export',
106
+ value: 'named',
107
+ description: 'Use export { Component }',
108
+ },
109
+ ],
110
+ default: 'default',
111
+ description: 'How to export the generated component',
112
+ },
63
113
  {
64
114
  displayName: 'Icon',
65
115
  name: 'icon',
@@ -67,6 +117,39 @@ class Svgr {
67
117
  default: true,
68
118
  description: 'Whether to remove width and height attributes for scalable icons',
69
119
  },
120
+ {
121
+ displayName: 'JSX Runtime',
122
+ name: 'jsxRuntime',
123
+ type: 'options',
124
+ options: [
125
+ {
126
+ name: 'Classic',
127
+ value: 'classic',
128
+ description: 'Use classic JSX runtime (requires React import)',
129
+ },
130
+ {
131
+ name: 'Automatic',
132
+ value: 'automatic',
133
+ description: 'Use automatic JSX runtime (React 17+, minimal imports)',
134
+ },
135
+ ],
136
+ default: 'classic',
137
+ description: 'Which JSX runtime to use for the generated component',
138
+ },
139
+ {
140
+ displayName: 'Memo',
141
+ name: 'memo',
142
+ type: 'boolean',
143
+ default: false,
144
+ description: 'Whether to wrap the component with React.memo for performance optimization',
145
+ },
146
+ {
147
+ displayName: 'Native (React Native)',
148
+ name: 'native',
149
+ type: 'boolean',
150
+ default: false,
151
+ description: 'Whether to generate React Native SVG compatible code using react-native-svg',
152
+ },
70
153
  {
71
154
  displayName: 'Prettier',
72
155
  name: 'prettier',
@@ -74,6 +157,13 @@ class Svgr {
74
157
  default: true,
75
158
  description: 'Whether to format the output code',
76
159
  },
160
+ {
161
+ displayName: 'Ref (ForwardRef)',
162
+ name: 'ref',
163
+ type: 'boolean',
164
+ default: false,
165
+ description: 'Whether to forward ref to the SVG element using forwardRef',
166
+ },
77
167
  {
78
168
  displayName: 'Remove View Box',
79
169
  name: 'removeViewBox',
@@ -88,6 +178,13 @@ class Svgr {
88
178
  default: true,
89
179
  description: 'Whether to apply SVGO optimizations (removes xmlns, style, shape-rendering attributes)',
90
180
  },
181
+ {
182
+ displayName: 'Title Prop',
183
+ name: 'titleProp',
184
+ type: 'boolean',
185
+ default: false,
186
+ description: 'Whether to add title and titleId props for accessibility (adds aria-labelledby)',
187
+ },
91
188
  {
92
189
  displayName: 'TypeScript',
93
190
  name: 'typescript',
@@ -97,6 +194,76 @@ class Svgr {
97
194
  },
98
195
  ],
99
196
  },
197
+ {
198
+ displayName: 'Replace Attribute Values',
199
+ name: 'replaceAttrValues',
200
+ type: 'fixedCollection',
201
+ typeOptions: {
202
+ multipleValues: true,
203
+ },
204
+ placeholder: 'Add Replacement',
205
+ default: {},
206
+ options: [
207
+ {
208
+ name: 'replacements',
209
+ displayName: 'Replacements',
210
+ values: [
211
+ {
212
+ displayName: 'From',
213
+ name: 'from',
214
+ type: 'string',
215
+ default: '',
216
+ placeholder: '#000',
217
+ description: 'The attribute value to replace',
218
+ },
219
+ {
220
+ displayName: 'To',
221
+ name: 'to',
222
+ type: 'string',
223
+ default: '',
224
+ placeholder: 'currentColor',
225
+ description: 'The new value to use',
226
+ },
227
+ ],
228
+ },
229
+ ],
230
+ description: 'Replace attribute values in the SVG (e.g., #000 → currentColor)',
231
+ },
232
+ {
233
+ displayName: 'SVG Props',
234
+ name: 'svgProps',
235
+ type: 'fixedCollection',
236
+ typeOptions: {
237
+ multipleValues: true,
238
+ },
239
+ placeholder: 'Add SVG Prop',
240
+ default: {},
241
+ options: [
242
+ {
243
+ name: 'props',
244
+ displayName: 'Props',
245
+ values: [
246
+ {
247
+ displayName: 'Name',
248
+ name: 'name',
249
+ type: 'string',
250
+ default: '',
251
+ placeholder: 'role',
252
+ description: 'The prop name to add',
253
+ },
254
+ {
255
+ displayName: 'Value',
256
+ name: 'value',
257
+ type: 'string',
258
+ default: '',
259
+ placeholder: 'img',
260
+ description: 'The prop value',
261
+ },
262
+ ],
263
+ },
264
+ ],
265
+ description: 'Add custom props to the SVG element (e.g., role="img", aria-label)',
266
+ },
100
267
  ],
101
268
  };
102
269
  }
@@ -111,6 +278,25 @@ class Svgr {
111
278
  }
112
279
  const componentName = this.getNodeParameter('componentName', itemIndex, 'SvgComponent');
113
280
  const options = this.getNodeParameter('options', itemIndex, {});
281
+ const replaceAttrValuesRaw = this.getNodeParameter('replaceAttrValues', itemIndex, {});
282
+ const svgPropsRaw = this.getNodeParameter('svgProps', itemIndex, {});
283
+ const replaceAttrValues = {};
284
+ if (replaceAttrValuesRaw.replacements) {
285
+ for (const replacement of replaceAttrValuesRaw.replacements) {
286
+ if (replacement.from && replacement.to) {
287
+ replaceAttrValues[replacement.from] = replacement.to;
288
+ }
289
+ }
290
+ }
291
+ const svgProps = {};
292
+ if (svgPropsRaw.props) {
293
+ for (const prop of svgPropsRaw.props) {
294
+ if (prop.name && prop.value) {
295
+ svgProps[prop.name] = prop.value;
296
+ }
297
+ }
298
+ }
299
+ const expandProps = options.expandProps === 'none' ? false : (options.expandProps || 'end');
114
300
  const transformOptions = {
115
301
  componentName,
116
302
  icon: options.icon !== undefined ? options.icon : true,
@@ -120,6 +306,16 @@ class Svgr {
120
306
  addFillCurrentColor: options.addFillCurrentColor !== undefined ? options.addFillCurrentColor : false,
121
307
  svgo: options.svgo !== undefined ? options.svgo : true,
122
308
  removeViewBox: options.removeViewBox !== undefined ? options.removeViewBox : false,
309
+ jsxRuntime: options.jsxRuntime || 'classic',
310
+ ref: options.ref !== undefined ? options.ref : false,
311
+ memo: options.memo !== undefined ? options.memo : false,
312
+ replaceAttrValues: Object.keys(replaceAttrValues).length > 0 ? replaceAttrValues : undefined,
313
+ svgProps: Object.keys(svgProps).length > 0 ? svgProps : undefined,
314
+ expandProps,
315
+ titleProp: options.titleProp !== undefined ? options.titleProp : false,
316
+ descProp: options.descProp !== undefined ? options.descProp : false,
317
+ native: options.native !== undefined ? options.native : false,
318
+ exportType: options.exportType || 'default',
123
319
  };
124
320
  const reactCode = (0, svgTransformer_1.transformSvg)(svgCode, transformOptions);
125
321
  const item = {
@@ -1 +1 @@
1
- {"version":3,"file":"Svgr.node.js","sourceRoot":"","sources":["../../../nodes/Svgr/Svgr.node.ts"],"names":[],"mappings":";;;AAMA,+CAAuE;AACvE,qDAAgD;AAEhD,MAAa,IAAI;IAAjB;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,MAAM;YACnB,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,EAAE,KAAK,EAAE,2BAA2B,EAAE,IAAI,EAAE,gCAAgC,EAAE;YACpF,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,gDAAgD;YAC7D,QAAQ,EAAE;gBACT,IAAI,EAAE,MAAM;aACZ;YACD,MAAM,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC;YAClC,OAAO,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC;YACnC,YAAY,EAAE,IAAI;YAClB,UAAU,EAAE;gB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qBACT,CAAC,CAAC;gBACJ,CAAC;YACF,CAAC;QACF,CAAC;QAED,OAAO,CAAC,UAAU,CAAC,CAAC;IACrB,CAAC;CACD;AAnYD,oBAmYC"}
@@ -1,3 +1,4 @@
1
+ import { type SvgoOptions } from './svgo';
1
2
  export interface TransformOptions {
2
3
  icon?: boolean;
3
4
  typescript?: boolean;
@@ -7,5 +8,16 @@ export interface TransformOptions {
7
8
  addFillCurrentColor?: boolean;
8
9
  removeViewBox?: boolean;
9
10
  svgo?: boolean;
11
+ svgoOptions?: Partial<SvgoOptions>;
12
+ jsxRuntime?: 'classic' | 'automatic';
13
+ ref?: boolean;
14
+ memo?: boolean;
15
+ replaceAttrValues?: Record<string, string>;
16
+ svgProps?: Record<string, string>;
17
+ expandProps?: 'start' | 'end' | false;
18
+ titleProp?: boolean;
19
+ descProp?: boolean;
20
+ native?: boolean;
21
+ exportType?: 'default' | 'named';
10
22
  }
11
23
  export declare function transformSvg(svgCode: string, options?: TransformOptions): string;