@d34dman/flowdrop 0.0.36 → 0.0.37

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.
@@ -26,6 +26,24 @@
26
26
 
27
27
  let props: Props = $props();
28
28
 
29
+ /**
30
+ * Instance-specific title override from config.
31
+ * Falls back to the original label if not set.
32
+ * This allows users to customize the node title per-instance via config.
33
+ */
34
+ const displayTitle = $derived(
35
+ (props.data.config?.instanceTitle as string) || props.data.label
36
+ );
37
+
38
+ /**
39
+ * Instance-specific description override from config.
40
+ * Falls back to the metadata description if not set.
41
+ * This allows users to customize the node description per-instance via config.
42
+ */
43
+ const displayDescription = $derived(
44
+ (props.data.config?.instanceDescription as string) || props.data.metadata.description
45
+ );
46
+
29
47
  /**
30
48
  * Get the hideUnconnectedHandles setting from extensions
31
49
  * Merges node type defaults with instance overrides
@@ -137,7 +155,7 @@
137
155
  onkeydown={handleKeydown}
138
156
  role="button"
139
157
  tabindex="0"
140
- aria-label="Gateway node: {props.data.metadata.name}"
158
+ aria-label="Gateway node: {displayTitle}"
141
159
  aria-describedby="node-description-{props.data.nodeId || 'unknown'}"
142
160
  >
143
161
  <!-- Node Header -->
@@ -151,17 +169,17 @@
151
169
  <Icon icon={getNodeIcon(props.data.metadata.icon, props.data.metadata.category)} />
152
170
  </div>
153
171
 
154
- <!-- Node Title -->
172
+ <!-- Node Title - uses instanceTitle override if set -->
155
173
  <h3 class="flowdrop-text--sm flowdrop-font--medium flowdrop-truncate flowdrop-flex--1">
156
- {props.data.label}
174
+ {displayTitle}
157
175
  </h3>
158
176
  </div>
159
- <!-- Node Description -->
177
+ <!-- Node Description - uses instanceDescription override if set -->
160
178
  <p
161
179
  class="flowdrop-text--xs flowdrop-text--gray flowdrop-truncate flowdrop-mt--1"
162
180
  id="node-description-{props.data.nodeId || 'unknown'}"
163
181
  >
164
- {props.data.metadata.description}
182
+ {displayDescription}
165
183
  </p>
166
184
  </div>
167
185
 
@@ -34,20 +34,30 @@
34
34
  }>();
35
35
 
36
36
  /**
37
- * Get title from config or fallback to label/metadata
37
+ * Instance-specific title override from config.
38
+ * Falls back to the original label if not set.
39
+ * This allows users to customize the node title per-instance via config.
40
+ * Note: Also supports legacy 'title' property for backward compatibility.
38
41
  */
39
- const ideaTitle = $derived(
40
- (props.data.config?.title as string) ||
42
+ const displayTitle = $derived(
43
+ (props.data.config?.instanceTitle as string) ||
44
+ (props.data.config?.title as string) ||
41
45
  props.data.label ||
42
46
  props.data.metadata?.name ||
43
47
  "New Idea"
44
48
  );
45
49
 
46
50
  /**
47
- * Get description content from config
51
+ * Instance-specific description override from config.
52
+ * Falls back to the metadata description if not set.
53
+ * This allows users to customize the node description per-instance via config.
54
+ * Note: Also supports legacy 'description' property for backward compatibility.
48
55
  */
49
- const ideaDescription = $derived(
50
- (props.data.config?.description as string) || "Click to add description..."
56
+ const displayDescription = $derived(
57
+ (props.data.config?.instanceDescription as string) ||
58
+ (props.data.config?.description as string) ||
59
+ props.data.metadata?.description ||
60
+ "Click to add description..."
51
61
  );
52
62
 
53
63
  /**
@@ -142,7 +152,7 @@
142
152
  onkeydown={handleKeydown}
143
153
  role="button"
144
154
  tabindex="0"
145
- aria-label="Idea node: {ideaTitle}"
155
+ aria-label="Idea node: {displayTitle}"
146
156
  >
147
157
  <!-- Left Port (Target/Input) -->
148
158
  {#if enableLeftPort}
@@ -174,12 +184,12 @@
174
184
  <div class="flowdrop-idea-node__icon-wrapper">
175
185
  <Icon icon={ideaIcon} class="flowdrop-idea-node__icon" />
176
186
  </div>
177
- <h3 class="flowdrop-idea-node__title">{ideaTitle}</h3>
187
+ <h3 class="flowdrop-idea-node__title">{displayTitle}</h3>
178
188
  </div>
179
189
 
180
190
  <!-- Description Body -->
181
191
  <div class="flowdrop-idea-node__body">
182
- <p class="flowdrop-idea-node__description">{ideaDescription}</p>
192
+ <p class="flowdrop-idea-node__description">{displayDescription}</p>
183
193
  </div>
184
194
 
185
195
  <!-- Processing indicator -->
@@ -150,9 +150,27 @@
150
150
  );
151
151
 
152
152
  /**
153
- * Get display label
153
+ * Instance-specific title override from config.
154
+ * Falls back to the original label if not set.
155
+ * This allows users to customize the node title per-instance via config.
154
156
  */
155
- let displayLabel = $derived(props.data.label || props.data.metadata?.name || variantConfig.label);
157
+ const displayTitle = $derived(
158
+ (props.data.config?.instanceTitle as string) ||
159
+ props.data.label ||
160
+ props.data.metadata?.name ||
161
+ variantConfig.label
162
+ );
163
+
164
+ /**
165
+ * Instance-specific description override from config.
166
+ * Falls back to the metadata description if not set.
167
+ * This allows users to customize the node description per-instance via config.
168
+ */
169
+ const displayDescription = $derived(
170
+ (props.data.config?.instanceDescription as string) ||
171
+ props.data.metadata?.description ||
172
+ ""
173
+ );
156
174
 
157
175
  /**
158
176
  * Check if metadata explicitly defines inputs (including empty array)
@@ -282,7 +300,7 @@
282
300
  onkeydown={handleKeydown}
283
301
  role="button"
284
302
  tabindex="0"
285
- aria-label="{variant} node: {displayLabel}"
303
+ aria-label="{variant} node: {displayTitle}"
286
304
  >
287
305
  <!-- Config button at top -->
288
306
  <button
@@ -333,9 +351,16 @@
333
351
  {/if}
334
352
  </div>
335
353
 
336
- <!-- Label below the circle -->
337
- <div class="flowdrop-terminal-node__label">
338
- {displayLabel}
354
+ <!-- Label and description below the circle -->
355
+ <div class="flowdrop-terminal-node__label-container">
356
+ <div class="flowdrop-terminal-node__label">
357
+ {displayTitle}
358
+ </div>
359
+ {#if displayDescription}
360
+ <div class="flowdrop-terminal-node__description">
361
+ {displayDescription}
362
+ </div>
363
+ {/if}
339
364
  </div>
340
365
 
341
366
  <!-- Processing indicator -->
@@ -440,19 +465,37 @@
440
465
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
441
466
  }
442
467
 
468
+ .flowdrop-terminal-node__label-container {
469
+ display: flex;
470
+ flex-direction: column;
471
+ align-items: center;
472
+ gap: 0.125rem;
473
+ background-color: rgba(255, 255, 255, 0.9);
474
+ padding: 0.25rem 0.5rem;
475
+ border-radius: 0.25rem;
476
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
477
+ max-width: 140px;
478
+ }
479
+
443
480
  .flowdrop-terminal-node__label {
444
481
  font-size: 0.75rem;
445
482
  font-weight: 500;
446
483
  color: #374151;
447
484
  text-align: center;
448
- max-width: 100px;
449
485
  overflow: hidden;
450
486
  text-overflow: ellipsis;
451
487
  white-space: nowrap;
452
- background-color: rgba(255, 255, 255, 0.9);
453
- padding: 0.125rem 0.5rem;
454
- border-radius: 0.25rem;
455
- box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
488
+ max-width: 100%;
489
+ }
490
+
491
+ .flowdrop-terminal-node__description {
492
+ font-size: 0.625rem;
493
+ color: #6b7280;
494
+ text-align: center;
495
+ overflow: hidden;
496
+ text-overflow: ellipsis;
497
+ white-space: nowrap;
498
+ max-width: 100%;
456
499
  }
457
500
 
458
501
  .flowdrop-terminal-node__processing {
@@ -47,17 +47,32 @@
47
47
  let toolColor = $derived(
48
48
  (props.data.metadata?.color as string) || (props.data.config?.color as string) || '#f59e0b'
49
49
  );
50
- let toolName = $derived(
51
- (props.data.metadata?.name as string) ||
50
+
51
+ /**
52
+ * Instance-specific title override from config.
53
+ * Falls back to metadata name, toolName config, or label if not set.
54
+ * This allows users to customize the tool title per-instance via config.
55
+ */
56
+ const displayTitle = $derived(
57
+ (props.data.config?.instanceTitle as string) ||
58
+ (props.data.metadata?.name as string) ||
52
59
  (props.data.config?.toolName as string) ||
53
60
  props.data.label ||
54
- 'Tool'
61
+ "Tool"
55
62
  );
56
- let toolDescription = $derived(
57
- (props.data.metadata?.description as string) ||
63
+
64
+ /**
65
+ * Instance-specific description override from config.
66
+ * Falls back to metadata description or toolDescription config if not set.
67
+ * This allows users to customize the tool description per-instance via config.
68
+ */
69
+ const displayDescription = $derived(
70
+ (props.data.config?.instanceDescription as string) ||
71
+ (props.data.metadata?.description as string) ||
58
72
  (props.data.config?.toolDescription as string) ||
59
- 'A configurable tool for agents'
73
+ "A configurable tool for agents"
60
74
  );
75
+
61
76
  let toolVersion = $derived(
62
77
  (props.data.metadata?.version as string) ||
63
78
  (props.data.config?.toolVersion as string) ||
@@ -159,7 +174,7 @@
159
174
  <!-- Tool Info -->
160
175
  <div class="flowdrop-tool-node__info">
161
176
  <h3 class="flowdrop-tool-node__title">
162
- {toolName}
177
+ {displayTitle}
163
178
  </h3>
164
179
  <div class="flowdrop-tool-node__version">
165
180
  v{toolVersion}
@@ -170,9 +185,9 @@
170
185
  <div class="flowdrop-tool-node__badge">TOOL</div>
171
186
  </div>
172
187
 
173
- <!-- Tool Description -->
188
+ <!-- Tool Description - uses instanceDescription override if set -->
174
189
  <p class="flowdrop-tool-node__description">
175
- {toolDescription}
190
+ {displayDescription}
176
191
  </p>
177
192
  </div>
178
193
 
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@d34dman/flowdrop",
3
3
  "license": "MIT",
4
4
  "private": false,
5
- "version": "0.0.36",
5
+ "version": "0.0.37",
6
6
  "scripts": {
7
7
  "dev": "vite dev",
8
8
  "build": "vite build && npm run prepack",