inkpen 0.7.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 (95) hide show
  1. checksums.yaml +7 -0
  2. data/.DS_Store +0 -0
  3. data/.rubocop.yml +8 -0
  4. data/.yardopts +11 -0
  5. data/CLAUDE.md +141 -0
  6. data/README.md +409 -0
  7. data/Rakefile +19 -0
  8. data/app/assets/javascripts/inkpen/controllers/editor_controller.js +2050 -0
  9. data/app/assets/javascripts/inkpen/controllers/sticky_toolbar_controller.js +667 -0
  10. data/app/assets/javascripts/inkpen/controllers/toolbar_controller.js +693 -0
  11. data/app/assets/javascripts/inkpen/export/html.js +637 -0
  12. data/app/assets/javascripts/inkpen/export/index.js +30 -0
  13. data/app/assets/javascripts/inkpen/export/markdown.js +697 -0
  14. data/app/assets/javascripts/inkpen/export/pdf.js +372 -0
  15. data/app/assets/javascripts/inkpen/extensions/advanced_table.js +640 -0
  16. data/app/assets/javascripts/inkpen/extensions/block_commands.js +300 -0
  17. data/app/assets/javascripts/inkpen/extensions/block_gutter.js +338 -0
  18. data/app/assets/javascripts/inkpen/extensions/callout.js +303 -0
  19. data/app/assets/javascripts/inkpen/extensions/columns.js +403 -0
  20. data/app/assets/javascripts/inkpen/extensions/database.js +990 -0
  21. data/app/assets/javascripts/inkpen/extensions/document_section.js +352 -0
  22. data/app/assets/javascripts/inkpen/extensions/drag_handle.js +407 -0
  23. data/app/assets/javascripts/inkpen/extensions/embed.js +629 -0
  24. data/app/assets/javascripts/inkpen/extensions/enhanced_image.js +566 -0
  25. data/app/assets/javascripts/inkpen/extensions/export_commands.js +271 -0
  26. data/app/assets/javascripts/inkpen/extensions/file_attachment.js +593 -0
  27. data/app/assets/javascripts/inkpen/extensions/inkpen_table/index.js +58 -0
  28. data/app/assets/javascripts/inkpen/extensions/inkpen_table/inkpen_table.js +638 -0
  29. data/app/assets/javascripts/inkpen/extensions/inkpen_table/inkpen_table_cell.js +100 -0
  30. data/app/assets/javascripts/inkpen/extensions/inkpen_table/inkpen_table_header.js +100 -0
  31. data/app/assets/javascripts/inkpen/extensions/inkpen_table/table_constants.js +152 -0
  32. data/app/assets/javascripts/inkpen/extensions/inkpen_table/table_helpers.js +254 -0
  33. data/app/assets/javascripts/inkpen/extensions/inkpen_table/table_menu.js +282 -0
  34. data/app/assets/javascripts/inkpen/extensions/preformatted.js +239 -0
  35. data/app/assets/javascripts/inkpen/extensions/section.js +281 -0
  36. data/app/assets/javascripts/inkpen/extensions/section_title.js +126 -0
  37. data/app/assets/javascripts/inkpen/extensions/slash_commands.js +439 -0
  38. data/app/assets/javascripts/inkpen/extensions/table_of_contents.js +474 -0
  39. data/app/assets/javascripts/inkpen/extensions/toggle_block.js +332 -0
  40. data/app/assets/javascripts/inkpen/index.js +87 -0
  41. data/app/assets/stylesheets/inkpen/advanced_table.css +514 -0
  42. data/app/assets/stylesheets/inkpen/animations.css +626 -0
  43. data/app/assets/stylesheets/inkpen/block_gutter.css +265 -0
  44. data/app/assets/stylesheets/inkpen/callout.css +359 -0
  45. data/app/assets/stylesheets/inkpen/columns.css +314 -0
  46. data/app/assets/stylesheets/inkpen/database.css +658 -0
  47. data/app/assets/stylesheets/inkpen/document_section.css +305 -0
  48. data/app/assets/stylesheets/inkpen/drag_drop.css +220 -0
  49. data/app/assets/stylesheets/inkpen/editor.css +652 -0
  50. data/app/assets/stylesheets/inkpen/embed.css +468 -0
  51. data/app/assets/stylesheets/inkpen/enhanced_image.css +453 -0
  52. data/app/assets/stylesheets/inkpen/export.css +499 -0
  53. data/app/assets/stylesheets/inkpen/file_attachment.css +347 -0
  54. data/app/assets/stylesheets/inkpen/footnotes.css +136 -0
  55. data/app/assets/stylesheets/inkpen/inkpen_table.css +608 -0
  56. data/app/assets/stylesheets/inkpen/preformatted.css +215 -0
  57. data/app/assets/stylesheets/inkpen/search_replace.css +58 -0
  58. data/app/assets/stylesheets/inkpen/section.css +236 -0
  59. data/app/assets/stylesheets/inkpen/slash_menu.css +252 -0
  60. data/app/assets/stylesheets/inkpen/sticky_toolbar.css +314 -0
  61. data/app/assets/stylesheets/inkpen/toc.css +386 -0
  62. data/app/assets/stylesheets/inkpen/toggle.css +260 -0
  63. data/app/helpers/inkpen/editor_helper.rb +114 -0
  64. data/app/views/inkpen/_editor.html.erb +139 -0
  65. data/config/importmap.rb +170 -0
  66. data/docs/.DS_Store +0 -0
  67. data/docs/CHANGELOG.md +571 -0
  68. data/docs/FEATURES.md +436 -0
  69. data/docs/ROADMAP.md +3029 -0
  70. data/docs/VISION.md +235 -0
  71. data/docs/extensions/INKPEN_TABLE.md +482 -0
  72. data/docs/thinking/CORRECTED_NO_VUE.md +756 -0
  73. data/docs/thinking/EXECUTIVE_SUMMARY.md +403 -0
  74. data/docs/thinking/INKPEN_CODE_SAMPLES.md +1479 -0
  75. data/docs/thinking/INKPEN_MASTER_GUIDE.md +891 -0
  76. data/docs/thinking/README_START_HERE.md +341 -0
  77. data/lib/inkpen/configuration.rb +175 -0
  78. data/lib/inkpen/editor.rb +204 -0
  79. data/lib/inkpen/engine.rb +32 -0
  80. data/lib/inkpen/extensions/base.rb +109 -0
  81. data/lib/inkpen/extensions/code_block_syntax.rb +177 -0
  82. data/lib/inkpen/extensions/document_section.rb +111 -0
  83. data/lib/inkpen/extensions/forced_document.rb +183 -0
  84. data/lib/inkpen/extensions/mention.rb +155 -0
  85. data/lib/inkpen/extensions/preformatted.rb +111 -0
  86. data/lib/inkpen/extensions/section.rb +139 -0
  87. data/lib/inkpen/extensions/slash_commands.rb +100 -0
  88. data/lib/inkpen/extensions/table.rb +182 -0
  89. data/lib/inkpen/extensions/task_list.rb +145 -0
  90. data/lib/inkpen/sticky_toolbar.rb +157 -0
  91. data/lib/inkpen/toolbar.rb +145 -0
  92. data/lib/inkpen/version.rb +5 -0
  93. data/lib/inkpen.rb +101 -0
  94. data/sig/inkpen.rbs +4 -0
  95. metadata +165 -0
@@ -0,0 +1,514 @@
1
+ /**
2
+ * Advanced Table Styles
3
+ *
4
+ * Enhanced table styling with variants, cell colors, and controls.
5
+ *
6
+ * @since 0.6.0
7
+ */
8
+
9
+ /* ============================================
10
+ CSS Custom Properties
11
+ ============================================ */
12
+
13
+ :root {
14
+ /* Cell background colors */
15
+ --inkpen-table-bg-gray: rgba(120, 120, 120, 0.12);
16
+ --inkpen-table-bg-red: rgba(239, 68, 68, 0.15);
17
+ --inkpen-table-bg-orange: rgba(249, 115, 22, 0.15);
18
+ --inkpen-table-bg-yellow: rgba(234, 179, 8, 0.15);
19
+ --inkpen-table-bg-green: rgba(34, 197, 94, 0.15);
20
+ --inkpen-table-bg-blue: rgba(59, 130, 246, 0.15);
21
+ --inkpen-table-bg-purple: rgba(168, 85, 247, 0.15);
22
+ }
23
+
24
+ /* ============================================
25
+ Table Wrapper
26
+ ============================================ */
27
+
28
+ .inkpen-table-wrapper {
29
+ position: relative;
30
+ margin: 1.5rem 0;
31
+ }
32
+
33
+ .inkpen-table-wrapper:focus-within .inkpen-table__controls,
34
+ .inkpen-table-wrapper:hover .inkpen-table__controls {
35
+ opacity: 1;
36
+ pointer-events: auto;
37
+ }
38
+
39
+ /* ============================================
40
+ Table Caption
41
+ ============================================ */
42
+
43
+ .inkpen-table__caption {
44
+ font-size: 0.875rem;
45
+ color: var(--inkpen-color-text-muted);
46
+ margin-bottom: 0.5rem;
47
+ font-style: italic;
48
+ padding: 0.25rem 0;
49
+ min-height: 1.5em;
50
+ outline: none;
51
+ border-radius: var(--inkpen-radius-sm, 2px);
52
+ }
53
+
54
+ .inkpen-table__caption:empty::before {
55
+ content: attr(placeholder);
56
+ color: var(--inkpen-color-text-muted);
57
+ opacity: 0.5;
58
+ }
59
+
60
+ .inkpen-table__caption:focus {
61
+ background: var(--inkpen-color-bg-subtle);
62
+ }
63
+
64
+ /* ============================================
65
+ Table Controls Toolbar
66
+ ============================================ */
67
+
68
+ .inkpen-table__controls {
69
+ position: absolute;
70
+ top: -40px;
71
+ left: 50%;
72
+ transform: translateX(-50%);
73
+ display: flex;
74
+ align-items: center;
75
+ gap: 0.25rem;
76
+ padding: 0.375rem;
77
+ background: var(--inkpen-toolbar-bg);
78
+ border: 1px solid var(--inkpen-color-border);
79
+ border-radius: var(--inkpen-radius);
80
+ box-shadow: var(--inkpen-shadow);
81
+ opacity: 0;
82
+ pointer-events: none;
83
+ transition: opacity 150ms ease;
84
+ z-index: 50;
85
+ }
86
+
87
+ .inkpen-table__control-group {
88
+ display: flex;
89
+ gap: 0.125rem;
90
+ }
91
+
92
+ .inkpen-table__control-btn {
93
+ display: flex;
94
+ align-items: center;
95
+ justify-content: center;
96
+ width: 28px;
97
+ height: 28px;
98
+ padding: 0;
99
+ border: none;
100
+ border-radius: var(--inkpen-radius-sm, 4px);
101
+ background: transparent;
102
+ color: var(--inkpen-color-text);
103
+ font-size: 0.875rem;
104
+ cursor: pointer;
105
+ transition: background 150ms ease;
106
+ }
107
+
108
+ .inkpen-table__control-btn:hover {
109
+ background: var(--inkpen-color-bg-subtle);
110
+ }
111
+
112
+ .inkpen-table__control-btn:active {
113
+ background: var(--inkpen-color-border);
114
+ }
115
+
116
+ .inkpen-table__control-divider {
117
+ width: 1px;
118
+ height: 20px;
119
+ background: var(--inkpen-color-border);
120
+ margin: 0 0.25rem;
121
+ }
122
+
123
+ /* ============================================
124
+ Table Container & Base Styles
125
+ ============================================ */
126
+
127
+ .inkpen-table__container {
128
+ overflow-x: auto;
129
+ -webkit-overflow-scrolling: touch;
130
+ }
131
+
132
+ .inkpen-table__container table {
133
+ width: 100%;
134
+ border-collapse: collapse;
135
+ table-layout: auto;
136
+ }
137
+
138
+ .inkpen-table__container th,
139
+ .inkpen-table__container td {
140
+ position: relative;
141
+ min-width: 80px;
142
+ padding: 0.5rem 0.75rem;
143
+ vertical-align: top;
144
+ box-sizing: border-box;
145
+ }
146
+
147
+ .inkpen-table__container th {
148
+ font-weight: 600;
149
+ text-align: left;
150
+ background: var(--inkpen-color-bg-subtle);
151
+ }
152
+
153
+ .inkpen-table__container td {
154
+ background: transparent;
155
+ }
156
+
157
+ /* Selection state */
158
+ .inkpen-table__container .selectedCell::after {
159
+ content: "";
160
+ position: absolute;
161
+ inset: 0;
162
+ background: var(--inkpen-color-primary);
163
+ opacity: 0.1;
164
+ pointer-events: none;
165
+ }
166
+
167
+ /* ============================================
168
+ Table Variant: Default
169
+ ============================================ */
170
+
171
+ .inkpen-table--default th,
172
+ .inkpen-table--default td {
173
+ border: 1px solid var(--inkpen-color-border);
174
+ }
175
+
176
+ /* ============================================
177
+ Table Variant: Striped
178
+ ============================================ */
179
+
180
+ .inkpen-table--striped th,
181
+ .inkpen-table--striped td {
182
+ border: 1px solid var(--inkpen-color-border);
183
+ }
184
+
185
+ .inkpen-table--striped tbody tr:nth-child(even) td {
186
+ background: var(--inkpen-color-bg-subtle);
187
+ }
188
+
189
+ /* Preserve cell background colors on striped rows */
190
+ .inkpen-table--striped tbody tr:nth-child(even) td[data-background] {
191
+ background: none;
192
+ }
193
+
194
+ /* ============================================
195
+ Table Variant: Borderless
196
+ ============================================ */
197
+
198
+ .inkpen-table--borderless th,
199
+ .inkpen-table--borderless td {
200
+ border: none;
201
+ border-bottom: 1px solid var(--inkpen-color-border);
202
+ }
203
+
204
+ .inkpen-table--borderless th {
205
+ border-bottom-width: 2px;
206
+ }
207
+
208
+ /* ============================================
209
+ Table Variant: Minimal
210
+ ============================================ */
211
+
212
+ .inkpen-table--minimal th,
213
+ .inkpen-table--minimal td {
214
+ border: none;
215
+ padding: 0.625rem 1rem;
216
+ }
217
+
218
+ .inkpen-table--minimal th {
219
+ border-bottom: 1px solid var(--inkpen-color-border);
220
+ }
221
+
222
+ .inkpen-table--minimal tbody tr:hover td {
223
+ background: var(--inkpen-color-bg-subtle);
224
+ }
225
+
226
+ /* ============================================
227
+ Cell Alignment
228
+ ============================================ */
229
+
230
+ .inkpen-table__container [data-align="left"] {
231
+ text-align: left;
232
+ }
233
+
234
+ .inkpen-table__container [data-align="center"] {
235
+ text-align: center;
236
+ }
237
+
238
+ .inkpen-table__container [data-align="right"] {
239
+ text-align: right;
240
+ }
241
+
242
+ /* ============================================
243
+ Cell Background Colors
244
+ ============================================ */
245
+
246
+ .inkpen-table__container [data-background="gray"] {
247
+ background: var(--inkpen-table-bg-gray) !important;
248
+ }
249
+
250
+ .inkpen-table__container [data-background="red"] {
251
+ background: var(--inkpen-table-bg-red) !important;
252
+ }
253
+
254
+ .inkpen-table__container [data-background="orange"] {
255
+ background: var(--inkpen-table-bg-orange) !important;
256
+ }
257
+
258
+ .inkpen-table__container [data-background="yellow"] {
259
+ background: var(--inkpen-table-bg-yellow) !important;
260
+ }
261
+
262
+ .inkpen-table__container [data-background="green"] {
263
+ background: var(--inkpen-table-bg-green) !important;
264
+ }
265
+
266
+ .inkpen-table__container [data-background="blue"] {
267
+ background: var(--inkpen-table-bg-blue) !important;
268
+ }
269
+
270
+ .inkpen-table__container [data-background="purple"] {
271
+ background: var(--inkpen-table-bg-purple) !important;
272
+ }
273
+
274
+ /* ============================================
275
+ Sticky Header
276
+ ============================================ */
277
+
278
+ .inkpen-table-wrapper--sticky-header .inkpen-table__container {
279
+ max-height: 500px;
280
+ overflow-y: auto;
281
+ }
282
+
283
+ .inkpen-table-wrapper--sticky-header thead {
284
+ position: sticky;
285
+ top: 0;
286
+ z-index: 10;
287
+ }
288
+
289
+ .inkpen-table-wrapper--sticky-header thead th {
290
+ background: var(--inkpen-toolbar-bg);
291
+ box-shadow: 0 1px 0 var(--inkpen-color-border);
292
+ }
293
+
294
+ /* ============================================
295
+ Column Resize Handle
296
+ ============================================ */
297
+
298
+ .inkpen-table__container .column-resize-handle {
299
+ position: absolute;
300
+ right: -2px;
301
+ top: 0;
302
+ bottom: 0;
303
+ width: 4px;
304
+ background: var(--inkpen-color-primary);
305
+ cursor: col-resize;
306
+ opacity: 0;
307
+ transition: opacity 150ms ease;
308
+ z-index: 20;
309
+ }
310
+
311
+ .inkpen-table__container th:hover .column-resize-handle,
312
+ .inkpen-table__container td:hover .column-resize-handle {
313
+ opacity: 1;
314
+ }
315
+
316
+ /* ============================================
317
+ Dropdown Menu
318
+ ============================================ */
319
+
320
+ .inkpen-table__dropdown {
321
+ min-width: 180px;
322
+ padding: 0.375rem;
323
+ background: var(--inkpen-toolbar-bg);
324
+ border: 1px solid var(--inkpen-color-border);
325
+ border-radius: var(--inkpen-radius);
326
+ box-shadow: var(--inkpen-shadow-lg, 0 4px 12px rgba(0, 0, 0, 0.15));
327
+ animation: inkpen-dropdown-in 150ms ease;
328
+ }
329
+
330
+ @keyframes inkpen-dropdown-in {
331
+ from {
332
+ opacity: 0;
333
+ transform: translateY(-4px);
334
+ }
335
+ to {
336
+ opacity: 1;
337
+ transform: translateY(0);
338
+ }
339
+ }
340
+
341
+ .inkpen-table__dropdown-item {
342
+ display: flex;
343
+ flex-direction: column;
344
+ align-items: flex-start;
345
+ width: 100%;
346
+ padding: 0.5rem 0.75rem;
347
+ border: none;
348
+ border-radius: var(--inkpen-radius-sm, 4px);
349
+ background: transparent;
350
+ color: var(--inkpen-color-text);
351
+ text-align: left;
352
+ cursor: pointer;
353
+ transition: background 150ms ease;
354
+ }
355
+
356
+ .inkpen-table__dropdown-item:hover {
357
+ background: var(--inkpen-color-bg-subtle);
358
+ }
359
+
360
+ .inkpen-table__dropdown-item.is-active {
361
+ background: var(--inkpen-color-primary);
362
+ background: rgba(var(--inkpen-color-primary-rgb, 59, 130, 246), 0.1);
363
+ }
364
+
365
+ .inkpen-table__dropdown-item.is-active::before {
366
+ content: "✓";
367
+ position: absolute;
368
+ right: 0.75rem;
369
+ color: var(--inkpen-color-primary);
370
+ }
371
+
372
+ .inkpen-table__dropdown-label {
373
+ font-size: 0.875rem;
374
+ font-weight: 500;
375
+ }
376
+
377
+ .inkpen-table__dropdown-desc {
378
+ font-size: 0.75rem;
379
+ color: var(--inkpen-color-text-muted);
380
+ margin-top: 0.125rem;
381
+ }
382
+
383
+ /* ============================================
384
+ Color Dropdown
385
+ ============================================ */
386
+
387
+ .inkpen-table__dropdown--colors {
388
+ display: flex;
389
+ flex-wrap: wrap;
390
+ gap: 0.375rem;
391
+ min-width: auto;
392
+ width: 156px;
393
+ padding: 0.5rem;
394
+ }
395
+
396
+ .inkpen-table__color-btn {
397
+ width: 28px;
398
+ height: 28px;
399
+ border: 2px solid transparent;
400
+ border-radius: var(--inkpen-radius-sm, 4px);
401
+ cursor: pointer;
402
+ transition: transform 150ms ease, border-color 150ms ease;
403
+ }
404
+
405
+ .inkpen-table__color-btn:hover {
406
+ transform: scale(1.1);
407
+ border-color: var(--inkpen-color-text);
408
+ }
409
+
410
+ .inkpen-table__color-btn--clear {
411
+ background: var(--inkpen-toolbar-bg);
412
+ border: 1px dashed var(--inkpen-color-border);
413
+ color: var(--inkpen-color-text-muted);
414
+ font-size: 0.75rem;
415
+ display: flex;
416
+ align-items: center;
417
+ justify-content: center;
418
+ }
419
+
420
+ .inkpen-table__color-btn--gray { background: var(--inkpen-table-bg-gray); }
421
+ .inkpen-table__color-btn--red { background: var(--inkpen-table-bg-red); }
422
+ .inkpen-table__color-btn--orange { background: var(--inkpen-table-bg-orange); }
423
+ .inkpen-table__color-btn--yellow { background: var(--inkpen-table-bg-yellow); }
424
+ .inkpen-table__color-btn--green { background: var(--inkpen-table-bg-green); }
425
+ .inkpen-table__color-btn--blue { background: var(--inkpen-table-bg-blue); }
426
+ .inkpen-table__color-btn--purple { background: var(--inkpen-table-bg-purple); }
427
+
428
+ /* ============================================
429
+ Dark Mode
430
+ ============================================ */
431
+
432
+ @media (prefers-color-scheme: dark) {
433
+ :root {
434
+ --inkpen-table-bg-gray: rgba(180, 180, 180, 0.15);
435
+ --inkpen-table-bg-red: rgba(239, 68, 68, 0.2);
436
+ --inkpen-table-bg-orange: rgba(249, 115, 22, 0.2);
437
+ --inkpen-table-bg-yellow: rgba(234, 179, 8, 0.2);
438
+ --inkpen-table-bg-green: rgba(34, 197, 94, 0.2);
439
+ --inkpen-table-bg-blue: rgba(59, 130, 246, 0.2);
440
+ --inkpen-table-bg-purple: rgba(168, 85, 247, 0.2);
441
+ }
442
+ }
443
+
444
+ /* ============================================
445
+ Mobile Optimizations
446
+ ============================================ */
447
+
448
+ @media (max-width: 768px) {
449
+ .inkpen-table__controls {
450
+ top: auto;
451
+ bottom: -44px;
452
+ transform: translateX(-50%);
453
+ padding: 0.5rem;
454
+ gap: 0.375rem;
455
+ }
456
+
457
+ .inkpen-table__control-btn {
458
+ width: 36px;
459
+ height: 36px;
460
+ font-size: 1rem;
461
+ }
462
+
463
+ .inkpen-table__container th,
464
+ .inkpen-table__container td {
465
+ min-width: 60px;
466
+ padding: 0.375rem 0.5rem;
467
+ font-size: 0.875rem;
468
+ }
469
+
470
+ .inkpen-table-wrapper--sticky-header .inkpen-table__container {
471
+ max-height: 300px;
472
+ }
473
+ }
474
+
475
+ /* ============================================
476
+ Print Styles
477
+ ============================================ */
478
+
479
+ @media print {
480
+ .inkpen-table__controls {
481
+ display: none !important;
482
+ }
483
+
484
+ .inkpen-table__container {
485
+ overflow: visible !important;
486
+ }
487
+
488
+ .inkpen-table-wrapper--sticky-header thead {
489
+ position: static;
490
+ }
491
+
492
+ .inkpen-table__caption {
493
+ font-style: italic;
494
+ margin-bottom: 0.5rem;
495
+ }
496
+ }
497
+
498
+ /* ============================================
499
+ Reduced Motion
500
+ ============================================ */
501
+
502
+ @media (prefers-reduced-motion: reduce) {
503
+ .inkpen-table__controls,
504
+ .inkpen-table__dropdown,
505
+ .inkpen-table__color-btn,
506
+ .inkpen-table__control-btn {
507
+ transition: none;
508
+ }
509
+
510
+ @keyframes inkpen-dropdown-in {
511
+ from { opacity: 1; transform: none; }
512
+ to { opacity: 1; transform: none; }
513
+ }
514
+ }