Skip to content

Commit 5f57cfc

Browse files
walmikclaude
andcommitted
Add custom module support with persistent library
Introduces a blank/custom module placeholder that users can name and reuse across patches. Includes: - custom-module symbol (dashed octagon SVG) in a new Custom category - IndexedDB-backed custom module library (lib/customModuleLibrary.js) - Auto-saves named modules to the library on first placement; blocks duplicates with an alert - Saved modules appear in the palette under Custom for quick re-use without a name prompt - Rename from the palette propagates to all matching canvas instances - Delete from the palette warns if instances exist and offers to remove them, cancelling does nothing Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent fbc6f3e commit 5f57cfc

5 files changed

Lines changed: 542 additions & 184 deletions

File tree

app/globals.css

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,62 @@ button {
190190
box-shadow: var(--card-shadow);
191191
}
192192

193+
.saved-custom-module {
194+
position: relative;
195+
cursor: grab;
196+
}
197+
198+
.custom-module-action {
199+
position: absolute;
200+
top: 6px;
201+
width: 20px;
202+
height: 20px;
203+
padding: 0;
204+
border: none;
205+
border-radius: 50%;
206+
background: transparent;
207+
color: var(--ink);
208+
font-size: 14px;
209+
line-height: 1;
210+
opacity: 0;
211+
cursor: pointer;
212+
transition: opacity 120ms ease, background 120ms ease;
213+
}
214+
215+
.custom-module-edit {
216+
right: 30px;
217+
}
218+
219+
.custom-module-delete {
220+
right: 6px;
221+
}
222+
223+
.saved-custom-module:hover .custom-module-action {
224+
opacity: 0.5;
225+
}
226+
227+
.custom-module-edit:hover {
228+
opacity: 1 !important;
229+
background: rgba(11, 136, 216, 0.12);
230+
color: #0b88d8;
231+
}
232+
233+
.custom-module-delete:hover {
234+
opacity: 1 !important;
235+
background: rgba(200, 30, 30, 0.12);
236+
color: #c01e1e;
237+
}
238+
239+
html.theme-dark .custom-module-edit:hover {
240+
background: rgba(11, 136, 216, 0.2);
241+
color: #4daee8;
242+
}
243+
244+
html.theme-dark .custom-module-delete:hover {
245+
background: rgba(220, 50, 50, 0.18);
246+
color: #e05555;
247+
}
248+
193249
.symbol-meta {
194250
min-width: 0;
195251
}

0 commit comments

Comments
 (0)