canvas_erd 0.1.0 → 0.3.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.
@@ -66,6 +66,14 @@
66
66
  <div><dt>New</dt><dd><kbd>⌘/Ctrl</kbd> <kbd>N</kbd></dd></div>
67
67
  <div><dt>Save</dt><dd><kbd>⌘/Ctrl</kbd> <kbd>S</kbd></dd></div>
68
68
  <div><dt>Add note at cursor</dt><dd><kbd>N</kbd></dd></div>
69
+ <div><dt>Add code at cursor</dt><dd><kbd>C</kbd></dd></div>
70
+ <div><dt>Bold note</dt><dd><kbd>⌘/Ctrl</kbd> <kbd>B</kbd></dd></div>
71
+ <div><dt>Italic note</dt><dd><kbd>⌘/Ctrl</kbd> <kbd>I</kbd></dd></div>
72
+ <div><dt>Underline note</dt><dd><kbd>⌘/Ctrl</kbd> <kbd>U</kbd></dd></div>
73
+ <div><dt>Title style</dt><dd><kbd>⌘/Ctrl</kbd> <kbd>Alt</kbd> <kbd>1</kbd></dd></div>
74
+ <div><dt>Heading style</dt><dd><kbd>⌘/Ctrl</kbd> <kbd>Alt</kbd> <kbd>2</kbd></dd></div>
75
+ <div><dt>Paragraph style</dt><dd><kbd>⌘/Ctrl</kbd> <kbd>Alt</kbd> <kbd>3</kbd></dd></div>
76
+ <div><dt>Code style</dt><dd><kbd>⌘/Ctrl</kbd> <kbd>Alt</kbd> <kbd>4</kbd></dd></div>
69
77
  <div><dt>Arrow tool</dt><dd><kbd>A</kbd></dd></div>
70
78
  <div><dt>Free arrow endpoint</dt><dd><kbd>Ctrl</kbd></dd></div>
71
79
  <div><dt>Toggle tables</dt><dd><kbd>T</kbd></dd></div>
@@ -76,6 +84,203 @@
76
84
  <div><dt>Shortcut help</dt><dd><kbd>?</kbd></dd></div>
77
85
  </dl>
78
86
  </div>
87
+ <div id="note-formatting" class="note-formatting" role="toolbar" aria-label="Note formatting" hidden>
88
+ <button id="note-bold" class="format-button note-bold" type="button" aria-label="Bold" title="Bold (⌘/Ctrl-B)" aria-pressed="false">B</button>
89
+ <button id="note-italic" class="format-button note-italic" type="button" aria-label="Italic" title="Italic (⌘/Ctrl-I)" aria-pressed="false">I</button>
90
+ <button id="note-underline" class="format-button note-underline" type="button" aria-label="Underline" title="Underline (⌘/Ctrl-U)" aria-pressed="false">U</button>
91
+ <div class="color-control">
92
+ <button id="note-text-color-button" class="note-color-button" type="button" aria-label="Text color" title="Text color" aria-expanded="false">
93
+ <span id="note-text-color-preview" class="color-preview" aria-hidden="true"></span>
94
+ <span>Text</span>
95
+ </button>
96
+ <div id="note-text-color-menu" class="color-menu" hidden>
97
+ <div id="note-text-color-swatches" class="color-swatches" role="group" aria-label="Text color swatches"></div>
98
+ <label class="custom-color">
99
+ <span>Custom…</span>
100
+ <input id="note-text-custom-color" type="color" value="#374151" aria-label="Custom text color">
101
+ </label>
102
+ </div>
103
+ </div>
104
+ <div class="color-control">
105
+ <button id="note-background-color-button" class="note-color-button" type="button" aria-label="Background color" title="Background color" aria-expanded="false">
106
+ <span id="note-background-color-preview" class="color-preview" aria-hidden="true"></span>
107
+ <span>Fill</span>
108
+ </button>
109
+ <div id="note-background-color-menu" class="color-menu" hidden>
110
+ <div id="note-background-color-swatches" class="color-swatches" role="group" aria-label="Background color swatches"></div>
111
+ <div class="color-menu-actions">
112
+ <button id="note-background-transparent" class="transparent-option" type="button" aria-label="Transparent background" aria-pressed="false">
113
+ <span class="color-preview transparent-color" aria-hidden="true"></span>
114
+ </button>
115
+ <label class="custom-color">
116
+ <span>Custom…</span>
117
+ <input id="note-background-custom-color" type="color" value="#fff2a8" aria-label="Custom background color">
118
+ </label>
119
+ </div>
120
+ </div>
121
+ </div>
122
+ <label class="note-format-field">
123
+ <span>Style</span>
124
+ <select id="note-paragraph-style" aria-label="Paragraph style">
125
+ <option value="title">Title</option>
126
+ <option value="heading">Heading</option>
127
+ <option value="paragraph" selected>Paragraph</option>
128
+ <option value="code">Code</option>
129
+ </select>
130
+ </label>
131
+ <label class="note-format-field">
132
+ <span>Align</span>
133
+ <select id="note-alignment" aria-label="Text alignment">
134
+ <option value="left">Left</option>
135
+ <option value="center">Center</option>
136
+ <option value="right">Right</option>
137
+ </select>
138
+ </label>
139
+ </div>
140
+ <div id="table-formatting" class="table-formatting" role="toolbar" aria-label="Table formatting" hidden>
141
+ <div class="color-control">
142
+ <button id="table-header-color-button" class="note-color-button" type="button" aria-label="Table header color" title="Table header color" aria-expanded="false">
143
+ <span id="table-header-color-preview" class="color-preview" aria-hidden="true"></span>
144
+ <span>Header</span>
145
+ </button>
146
+ <div id="table-header-color-menu" class="color-menu" hidden>
147
+ <div id="table-header-color-swatches" class="color-swatches" role="group" aria-label="Table header color swatches"></div>
148
+ <label class="custom-color">
149
+ <span>Custom…</span>
150
+ <input id="table-header-custom-color" type="color" value="#243b63" aria-label="Custom table header color">
151
+ </label>
152
+ </div>
153
+ </div>
154
+ </div>
155
+ <div id="arrow-formatting" class="arrow-formatting" role="toolbar" aria-label="Arrow formatting" hidden>
156
+ <div class="color-control">
157
+ <button id="arrow-color-button" class="note-color-button" type="button" aria-label="Arrow color" title="Arrow color" aria-expanded="false">
158
+ <span id="arrow-color-preview" class="color-preview" aria-hidden="true"></span>
159
+ <span>Color</span>
160
+ </button>
161
+ <div id="arrow-color-menu" class="color-menu" hidden>
162
+ <div id="arrow-color-swatches" class="color-swatches" role="group" aria-label="Arrow color swatches"></div>
163
+ <label class="custom-color">
164
+ <span>Custom…</span>
165
+ <input id="arrow-custom-color" type="color" value="#243b63" aria-label="Custom arrow color">
166
+ </label>
167
+ </div>
168
+ </div>
169
+ <label class="note-format-field">
170
+ <span>Start</span>
171
+ <select id="arrow-start-head" aria-label="Start arrowhead">
172
+ <option value="none" selected>None</option>
173
+ <option value="open">Arrow — open</option>
174
+ <option value="filled">Arrow — closed</option>
175
+ <option value="circle-open">Circle — open</option>
176
+ <option value="circle">Circle — closed</option>
177
+ <option value="diamond-open">Diamond — open</option>
178
+ <option value="diamond">Diamond — closed</option>
179
+ </select>
180
+ </label>
181
+ <label class="note-format-field">
182
+ <span>End</span>
183
+ <select id="arrow-end-head" aria-label="End arrowhead">
184
+ <option value="none">None</option>
185
+ <option value="open">Arrow — open</option>
186
+ <option value="filled" selected>Arrow — closed</option>
187
+ <option value="circle-open">Circle — open</option>
188
+ <option value="circle">Circle — closed</option>
189
+ <option value="diamond-open">Diamond — open</option>
190
+ <option value="diamond">Diamond — closed</option>
191
+ </select>
192
+ </label>
193
+ <label class="note-format-field">
194
+ <span>Line</span>
195
+ <select id="arrow-line-style" aria-label="Arrow line style">
196
+ <option value="solid" selected>Solid</option>
197
+ <option value="dashed">Dashed</option>
198
+ <option value="dotted">Dotted</option>
199
+ </select>
200
+ </label>
201
+ <label class="note-format-field">
202
+ <span>Width</span>
203
+ <input id="arrow-stroke-width" type="number" min="0.5" max="20" step="0.25" value="2.25" aria-label="Arrow line width">
204
+ </label>
205
+ </div>
206
+ <div id="frame-formatting" class="frame-formatting" role="toolbar" aria-label="Frame formatting" hidden>
207
+ <div class="color-control">
208
+ <button id="frame-color-button" class="note-color-button" type="button" aria-label="Frame color" title="Frame color" aria-expanded="false">
209
+ <span id="frame-color-preview" class="color-preview" aria-hidden="true"></span>
210
+ <span>Color</span>
211
+ </button>
212
+ <div id="frame-color-menu" class="color-menu" hidden>
213
+ <div id="frame-color-swatches" class="color-swatches" role="group" aria-label="Frame color swatches"></div>
214
+ <label class="custom-color">
215
+ <span>Custom…</span>
216
+ <input id="frame-custom-color" type="color" value="#243b63" aria-label="Custom frame color">
217
+ </label>
218
+ </div>
219
+ </div>
220
+ <label class="note-format-field">
221
+ <span>Border</span>
222
+ <select id="frame-line-style" aria-label="Frame border style">
223
+ <option value="solid" selected>Solid</option>
224
+ <option value="dashed">Dashed</option>
225
+ <option value="dotted">Dotted</option>
226
+ </select>
227
+ </label>
228
+ </div>
229
+ <div id="code-formatting" class="code-formatting" role="toolbar" aria-label="Code formatting" hidden>
230
+ <label class="note-format-field">
231
+ <span>Language</span>
232
+ <select id="code-language" aria-label="Code language"></select>
233
+ </label>
234
+ <label class="note-format-field">
235
+ <span>Size</span>
236
+ <select id="code-size" aria-label="Code font size">
237
+ <option value="small">Small</option>
238
+ <option value="medium" selected>Medium</option>
239
+ <option value="large">Large</option>
240
+ </select>
241
+ </label>
242
+ <button id="code-line-numbers"class="format-button" type="button" aria-label="Line numbers" title="Line numbers" aria-pressed="false">#</button>
243
+ <span id="code-source" class="code-source" hidden></span>
244
+ <div id="code-source-fields" class="code-source-fields" hidden>
245
+ <label class="note-format-field">
246
+ <span>Path</span>
247
+ <input id="code-source-path" class="source-path-input" type="text" list="source-file-paths" autocomplete="off" aria-label="Source file path">
248
+ </label>
249
+ <label class="note-format-field">
250
+ <span>Lines</span>
251
+ <input id="code-source-start" class="line-input" type="number" min="1" placeholder="1" aria-label="Start line">
252
+ </label>
253
+ <label class="note-format-field">
254
+ <span>to</span>
255
+ <input id="code-source-end" class="line-input" type="number" min="1" placeholder="end" aria-label="End line">
256
+ </label>
257
+ </div>
258
+ </div>
259
+ <datalist id="source-file-paths"></datalist>
260
+ <dialog id="source-dialog" class="source-dialog" aria-labelledby="source-dialog-title">
261
+ <form id="source-form">
262
+ <h2 id="source-dialog-title">Add source file</h2>
263
+ <label class="source-field">
264
+ <span>Path</span>
265
+ <input id="source-path" class="source-path-input" type="text" list="source-file-paths" autocomplete="off" placeholder="app/models/book.rb" required>
266
+ </label>
267
+ <div class="source-lines">
268
+ <label class="source-field">
269
+ <span>Start line</span>
270
+ <input id="source-start" class="line-input" type="number" min="1" placeholder="1">
271
+ </label>
272
+ <label class="source-field">
273
+ <span>End line</span>
274
+ <input id="source-end" class="line-input" type="number" min="1" placeholder="end">
275
+ </label>
276
+ </div>
277
+ <p id="source-error" class="source-error" role="alert" hidden></p>
278
+ <div class="source-actions">
279
+ <button id="source-cancel" type="button">Cancel</button>
280
+ <button id="source-submit" type="submit">Add</button>
281
+ </div>
282
+ </form>
283
+ </dialog>
79
284
  <div class="canvas-tools" aria-label="Canvas tools">
80
285
  <button id="toggle-tables" class="icon-button" type="button" aria-label="Show tables" title="Show tables (T)" aria-expanded="false">
81
286
  <svg width="24px" height="24px" viewBox="0 0 24 24" fill="none" color="#000000" aria-hidden="true" focusable="false"><path d="M3 20.4V3.6C3 3.26863 3.26863 3 3.6 3H20.4C20.7314 3 21 3.26863 21 3.6V20.4C21 20.7314 20.7314 21 20.4 21H3.6C3.26863 21 3 20.7314 3 20.4Z" stroke="#000000" stroke-width="1.5"></path><path d="M3 16.5H21" stroke="#000000" stroke-width="1.5"></path><path d="M3 12H21" stroke="#000000" stroke-width="1.5"></path><path d="M21 7.5H3" stroke="#000000" stroke-width="1.5"></path><path d="M12 21V3" stroke="#000000" stroke-width="1.5"></path></svg>
@@ -83,10 +288,19 @@
83
288
  <button id="layout-tables" class="icon-button" type="button" aria-label="Layout tables" title="Layout tables (L)" aria-expanded="false">
84
289
  <svg width="24px" height="24px" viewBox="0 0 24 24" fill="none" color="#000000" aria-hidden="true" focusable="false"><path d="M21 3.6V12H12V3H20.4C20.7314 3 21 3.26863 21 3.6Z" stroke="#000000" stroke-width="1.5"></path><path d="M21 20.4V12H12V21H20.4C20.7314 21 21 20.7314 21 20.4Z" stroke="#000000" stroke-width="1.5"></path><path d="M3 12V3.6C3 3.26863 3.26863 3 3.6 3H12V12H3Z" stroke="#000000" stroke-width="1.5"></path><path d="M3 12V20.4C3 20.7314 3.26863 21 3.6 21H12V12H3Z" stroke="#000000" stroke-width="1.5"></path></svg>
85
290
  </button>
291
+ <button id="add-frame" class="icon-button" type="button" aria-label="Frame tool" title="Frame tool" aria-pressed="false">
292
+ <svg width="24px" height="24px" viewBox="0 0 24 24" fill="none" color="#000000" aria-hidden="true" focusable="false"><rect x="3" y="4" width="18" height="16" rx="1" stroke="#000000" stroke-width="1.5" stroke-dasharray="3 2"></rect><path d="M6 8H12" stroke="#000000" stroke-width="1.5" stroke-linecap="round"></path></svg>
293
+ </button>
86
294
  <button id="add-note" class="icon-button" type="button" aria-label="Add note" title="Add note (N)">
87
295
  <svg width="24px" height="24px" viewBox="0 0 24 24" fill="none" color="#000000" aria-hidden="true" focusable="false"><path d="M12 8L12 16M12 8H8M12 8H16" stroke="#000000" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M21 13.5V19C21 20.1046 20.1046 21 19 21H5C3.89543 21 3 20.1046 3 19V13.5M21 10.5V5C21 3.89543 20.1046 3 19 3H5C3.89543 3 3 3.89543 3 5V10.5" stroke="#000000" stroke-width="1.5" stroke-linejoin="round"></path><path d="M19.5 13.5V10.5H22.5V13.5H19.5Z" stroke="#000000" stroke-width="1.5" stroke-linejoin="round"></path><path d="M1.5 13.5V10.5H4.5V13.5H1.5Z" stroke="#000000" stroke-width="1.5" stroke-linejoin="round"></path></svg>
88
296
  </button>
89
- <button id="add-arrow" class="icon-button" type="button" aria-label="Arrow tool" title="Arrow tool (A) · Double-click an arrow to edit endpoints · Hold Ctrl for a free endpoint" aria-pressed="false">
297
+ <button id="add-code" class="icon-button" type="button" aria-label="Add code" title="Add code (C)">
298
+ <svg width="24px" height="24px" viewBox="0 0 24 24" fill="none" color="#000000" aria-hidden="true" focusable="false"><path d="M13.5 6L10 18.5" stroke="#000000" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M6.5 8.5L3 12L6.5 15.5" stroke="#000000" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M17.5 8.5L21 12L17.5 15.5" stroke="#000000" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path></svg>
299
+ </button>
300
+ <button id="add-source" class="icon-button" type="button" aria-label="Add source file" title="Add source file">
301
+ <svg width="24px" height="24px" viewBox="0 0 24 24" fill="none" color="#000000" aria-hidden="true" focusable="false"><path d="M4 21.4V2.6C4 2.26863 4.26863 2 4.6 2H16.2515C16.4106 2 16.5632 2.06321 16.6757 2.17574L19.8243 5.32426C19.9368 5.43679 20 5.5894 20 5.74853V21.4C20 21.7314 19.7314 22 19.4 22H4.6C4.26863 22 4 21.7314 4 21.4Z" stroke="#000000" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M8 10L16 10" stroke="#000000" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M8 18L16 18" stroke="#000000" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M8 14L12 14" stroke="#000000" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M16 2V5.4C16 5.73137 16.2686 6 16.6 6H20" stroke="#000000" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path></svg>
302
+ </button>
303
+ <button id="add-arrow" class="icon-button" type="button" aria-label="Arrow tool" title="Arrow tool (A) · Select an arrow to edit endpoints · Hold Ctrl for a free endpoint" aria-pressed="false">
90
304
  <svg width="24px" height="24px" viewBox="0 0 24 24" fill="none" color="#000000" aria-hidden="true" focusable="false"><path d="M6.00005 19L19 5.99996M19 5.99996V18.48M19 5.99996H6.52005" stroke="#000000" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path></svg>
91
305
  </button>
92
306
  </div>
@@ -321,6 +321,217 @@ select:focus-visible {
321
321
  box-shadow: 0 5px 18px rgba(15, 23, 42, 0.12);
322
322
  }
323
323
 
324
+ .note-formatting,
325
+ .table-formatting,
326
+ .arrow-formatting,
327
+ .frame-formatting,
328
+ .code-formatting {
329
+ position: absolute;
330
+ bottom: 4rem;
331
+ left: 50%;
332
+ z-index: 2;
333
+ display: flex;
334
+ flex-wrap: wrap;
335
+ align-items: center;
336
+ justify-content: center;
337
+ gap: 0.25rem;
338
+ max-width: calc(100% - 1.5rem);
339
+ border: 1px solid rgba(203, 213, 225, 0.9);
340
+ border-radius: 0.75rem;
341
+ background: rgba(255, 255, 255, 0.96);
342
+ padding: 0.35rem;
343
+ transform: translateX(-50%);
344
+ box-shadow: 0 5px 18px rgba(15, 23, 42, 0.12);
345
+ }
346
+
347
+ .format-button {
348
+ width: 2.25rem;
349
+ padding: 0;
350
+ }
351
+
352
+ .format-button[aria-pressed="true"] {
353
+ border-color: #2563eb;
354
+ color: #1d4ed8;
355
+ background: #eff6ff;
356
+ }
357
+
358
+ .note-bold {
359
+ font-weight: 700;
360
+ }
361
+
362
+ .note-italic {
363
+ font-style: italic;
364
+ }
365
+
366
+ .note-underline {
367
+ text-decoration: underline;
368
+ }
369
+
370
+ .note-format-field {
371
+ display: flex;
372
+ align-items: center;
373
+ gap: 0.35rem;
374
+ min-height: 2.25rem;
375
+ color: #526277;
376
+ padding: 0 0.35rem;
377
+ font-size: 0.72rem;
378
+ }
379
+
380
+ .color-control {
381
+ position: relative;
382
+ }
383
+
384
+ .note-color-button {
385
+ display: flex;
386
+ align-items: center;
387
+ gap: 0.4rem;
388
+ padding: 0.35rem 0.55rem;
389
+ font-size: 0.72rem;
390
+ }
391
+
392
+ .color-preview {
393
+ width: 1.15rem;
394
+ height: 1.15rem;
395
+ border: 1px solid rgba(15, 23, 42, 0.25);
396
+ border-radius: 0.25rem;
397
+ background: #ffffff;
398
+ }
399
+
400
+ .transparent-color {
401
+ background-color: #ffffff !important;
402
+ background-image:
403
+ linear-gradient(45deg, #cbd5e1 25%, transparent 25%),
404
+ linear-gradient(-45deg, #cbd5e1 25%, transparent 25%),
405
+ linear-gradient(45deg, transparent 75%, #cbd5e1 75%),
406
+ linear-gradient(-45deg, transparent 75%, #cbd5e1 75%);
407
+ background-position: 0 0, 0 5px, 5px -5px, -5px 0;
408
+ background-size: 10px 10px;
409
+ }
410
+
411
+ .mixed-color {
412
+ background-color: #ffffff !important;
413
+ background-image: linear-gradient(135deg, #243b63 50%, #9a3412 50%);
414
+ }
415
+
416
+ .color-menu {
417
+ position: absolute;
418
+ bottom: calc(100% + 0.55rem);
419
+ left: 50%;
420
+ width: 11.5rem;
421
+ border: 1px solid #cbd3df;
422
+ border-radius: 0.6rem;
423
+ background: #ffffff;
424
+ padding: 0.55rem;
425
+ transform: translateX(-50%);
426
+ box-shadow: 0 6px 20px rgba(15, 23, 42, 0.16);
427
+ }
428
+
429
+ .color-swatches {
430
+ display: grid;
431
+ grid-template-columns: repeat(4, 1fr);
432
+ gap: 0.4rem;
433
+ }
434
+
435
+ .color-swatch {
436
+ width: 2.2rem;
437
+ min-height: 2.2rem;
438
+ border-color: rgba(15, 23, 42, 0.25);
439
+ padding: 0;
440
+ }
441
+
442
+ .color-swatch[aria-pressed="true"] {
443
+ outline: 2px solid #2563eb;
444
+ outline-offset: 1px;
445
+ }
446
+
447
+ .swatch-separator {
448
+ grid-column: 1 / -1;
449
+ height: 1px;
450
+ margin: 0.15rem 0;
451
+ background: #e2e8f0;
452
+ }
453
+
454
+ .color-menu-actions {
455
+ display: grid;
456
+ grid-template-columns: auto 1fr;
457
+ gap: 0.4rem;
458
+ margin-top: 0.55rem;
459
+ border-top: 1px solid #e2e8f0;
460
+ padding-top: 0.55rem;
461
+ }
462
+
463
+ .transparent-option {
464
+ display: flex;
465
+ width: 2.25rem;
466
+ min-width: 2.25rem;
467
+ align-items: center;
468
+ justify-content: center;
469
+ padding: 0;
470
+ }
471
+
472
+ .transparent-option[aria-pressed="true"] {
473
+ border-color: #2563eb;
474
+ color: #1d4ed8;
475
+ background: #eff6ff;
476
+ }
477
+
478
+ .color-menu-actions .custom-color {
479
+ min-width: 0;
480
+ width: 100%;
481
+ margin: 0;
482
+ border: 1px solid #cbd3df;
483
+ border-radius: 0.45rem;
484
+ padding: 0.25rem 0.35rem;
485
+ font-size: 0.68rem;
486
+ }
487
+
488
+ .custom-color {
489
+ display: flex;
490
+ align-items: center;
491
+ justify-content: space-between;
492
+ gap: 0.5rem;
493
+ margin-top: 0.55rem;
494
+ border-top: 1px solid #e2e8f0;
495
+ color: #526277;
496
+ cursor: pointer;
497
+ padding-top: 0.55rem;
498
+ font-size: 0.75rem;
499
+ }
500
+
501
+ .custom-color input {
502
+ width: 2rem;
503
+ height: 1.65rem;
504
+ border: 0;
505
+ background: transparent;
506
+ cursor: pointer;
507
+ padding: 0;
508
+ }
509
+
510
+ .note-format-field select {
511
+ min-height: 1.9rem;
512
+ border: 1px solid #cbd3df;
513
+ border-radius: 0.35rem;
514
+ color: #263447;
515
+ background: #ffffff;
516
+ padding: 0.2rem 0.35rem;
517
+ }
518
+
519
+ #arrow-stroke-width,
520
+ .source-path-input,
521
+ .line-input {
522
+ width: 4rem;
523
+ min-height: 1.9rem;
524
+ border: 1px solid #cbd3df;
525
+ border-radius: 0.35rem;
526
+ color: #263447;
527
+ background: #ffffff;
528
+ padding: 0.2rem 0.35rem;
529
+ }
530
+
531
+ #note-paragraph-style {
532
+ max-width: 7.5rem;
533
+ }
534
+
324
535
  .canvas-panel .canvas-container {
325
536
  position: absolute !important;
326
537
  inset: 0;
@@ -437,3 +648,87 @@ kbd {
437
648
  border-color: #fecaca;
438
649
  background: #fff7f7;
439
650
  }
651
+
652
+ .code-source {
653
+ color: #526277;
654
+ padding: 0 0.35rem;
655
+ font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
656
+ font-size: 0.72rem;
657
+ }
658
+
659
+ .detail-toggle {
660
+ min-height: 1.4rem;
661
+ margin-left: auto;
662
+ border-radius: 999px;
663
+ color: #526277;
664
+ padding: 0 0.5rem;
665
+ font-size: 0.7rem;
666
+ }
667
+
668
+ .detail-toggle[aria-pressed="true"] {
669
+ border-color: #2563eb;
670
+ color: #1d4ed8;
671
+ background: #eff6ff;
672
+ }
673
+
674
+ .code-source-fields {
675
+ display: flex;
676
+ align-items: center;
677
+ }
678
+
679
+ .note-format-field .source-path-input {
680
+ width: 18rem;
681
+ }
682
+
683
+ .source-dialog {
684
+ width: min(32rem, calc(100% - 2rem));
685
+ border: 1px solid rgba(203, 213, 225, 0.9);
686
+ border-radius: 0.75rem;
687
+ color: #263447;
688
+ padding: 1rem;
689
+ box-shadow: 0 10px 30px rgba(15, 23, 42, 0.2);
690
+ }
691
+
692
+ .source-dialog::backdrop {
693
+ background: rgba(15, 23, 42, 0.2);
694
+ }
695
+
696
+ .source-dialog h2 {
697
+ margin: 0 0 0.8rem;
698
+ color: #172554;
699
+ font-size: 0.95rem;
700
+ }
701
+
702
+ .source-field {
703
+ display: flex;
704
+ flex-direction: column;
705
+ gap: 0.3rem;
706
+ color: #526277;
707
+ font-size: 0.75rem;
708
+ }
709
+
710
+ .source-dialog .source-path-input,
711
+ .source-dialog .line-input {
712
+ width: 100%;
713
+ min-height: 2.25rem;
714
+ }
715
+
716
+ .source-lines {
717
+ display: grid;
718
+ grid-template-columns: 1fr 1fr;
719
+ gap: 0.75rem;
720
+ margin-top: 0.75rem;
721
+ }
722
+
723
+ .source-error {
724
+ margin: 0.75rem 0 0;
725
+ color: #b91c1c;
726
+ font-size: 0.8rem;
727
+ }
728
+
729
+ .source-actions {
730
+ display: flex;
731
+ justify-content: flex-end;
732
+ gap: 0.5rem;
733
+ margin-top: 1rem;
734
+ }
data/lib/canvas_erd.rb CHANGED
@@ -5,6 +5,9 @@ require "canvas_erd/diagram"
5
5
  require "canvas_erd/schema_provider"
6
6
  require "canvas_erd/png_document"
7
7
  require "canvas_erd/diagram_store"
8
+ require "canvas_erd/highlighter"
9
+ require "canvas_erd/source_files"
10
+ require "canvas_erd/model_details"
8
11
  require "canvas_erd/application_loader"
9
12
  require "canvas_erd/browser"
10
13
  require "canvas_erd/server"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: canvas_erd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marc Heiligers
@@ -43,6 +43,26 @@ dependencies:
43
43
  - - "<"
44
44
  - !ruby/object:Gem::Version
45
45
  version: '4'
46
+ - !ruby/object:Gem::Dependency
47
+ name: rouge
48
+ requirement: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: '4.0'
53
+ - - "<"
54
+ - !ruby/object:Gem::Version
55
+ version: '6'
56
+ type: :runtime
57
+ prerelease: false
58
+ version_requirements: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: '4.0'
63
+ - - "<"
64
+ - !ruby/object:Gem::Version
65
+ version: '6'
46
66
  - !ruby/object:Gem::Dependency
47
67
  name: minitest
48
68
  requirement: !ruby/object:Gem::Requirement
@@ -110,9 +130,12 @@ files:
110
130
  - lib/canvas_erd/cli.rb
111
131
  - lib/canvas_erd/diagram.rb
112
132
  - lib/canvas_erd/diagram_store.rb
133
+ - lib/canvas_erd/highlighter.rb
134
+ - lib/canvas_erd/model_details.rb
113
135
  - lib/canvas_erd/png_document.rb
114
136
  - lib/canvas_erd/schema_provider.rb
115
137
  - lib/canvas_erd/server.rb
138
+ - lib/canvas_erd/source_files.rb
116
139
  - lib/canvas_erd/version.rb
117
140
  - lib/canvas_erd/web/app.js
118
141
  - lib/canvas_erd/web/document.js
@@ -142,14 +165,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
142
165
  requirements:
143
166
  - - ">="
144
167
  - !ruby/object:Gem::Version
145
- version: '3.1'
168
+ version: '3.3'
146
169
  required_rubygems_version: !ruby/object:Gem::Requirement
147
170
  requirements:
148
171
  - - ">="
149
172
  - !ruby/object:Gem::Version
150
173
  version: '0'
151
174
  requirements: []
152
- rubygems_version: 4.0.16
175
+ rubygems_version: 4.0.20
153
176
  specification_version: 4
154
177
  summary: Edit Rails ERD diagrams on an interactive canvas
155
178
  test_files: []