docit 0.3.1 → 0.5.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.
@@ -0,0 +1,582 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Docit
4
+ module UI
5
+ module SystemStyles
6
+ def self.css
7
+ <<~CSS
8
+ /* ───────── Theme tokens ─────────
9
+ Light is the default. [data-theme="dark"] on <html> overrides.
10
+ Accent hues (ember / dusk / method / status) are shared by both
11
+ themes — only the neutrals (surface, text, border) flip. */
12
+ :root {
13
+ /* Shared accents — identical in both themes */
14
+ --ember: #ea6a2e; --dusk: #7c4ddb;
15
+ --success: #1a9e4b; --info: #2563eb; --warning: #d97706; --danger: #dc2626;
16
+ --teal: #0d9488; --pink: #db2777; --amber: #d97706;
17
+
18
+ /* Light neutrals (default) */
19
+ --void: #f6f7f9; /* app background */
20
+ --text: #1a1f2e; /* primary text */
21
+ --smoke: #475067; /* secondary text */
22
+ --haze: #6b7488; /* tertiary / labels */
23
+ --border: #e3e6ec; /* hairlines */
24
+
25
+ --bg-solid: #ffffff; /* opaque surfaces (nodes, code) */
26
+ --bg-glass: rgba(255,255,255,0.86);
27
+ --bg-control: #ffffff;
28
+ --bg-panel: #ffffff;
29
+ --bg-card: #ffffff;
30
+ --bg-card-grad-1: #ffffff;
31
+ --bg-card-grad-2: #f6f7f9;
32
+ --bg-option-hover: rgba(15,23,42,0.04);
33
+ --grid-dot: rgba(15,23,42,0.05);
34
+ --stripe-bg-light: #fafbfc;
35
+ --stripe-card-bg: #ffffff;
36
+ --stripe-bg-sidebar: #fafbfc;
37
+ --bg-code: #f4f5f7; /* inline + block code surface */
38
+
39
+ color-scheme: light;
40
+ }
41
+
42
+ [data-theme="dark"] {
43
+ --void: #0f1117;
44
+ --text: #f2f0ec;
45
+ --smoke: #a8b4c8;
46
+ --haze: #7a8fb5;
47
+ --border: #2a3347;
48
+
49
+ --bg-solid: #161b28;
50
+ --bg-glass: rgba(15,17,23,0.96);
51
+ --bg-control: rgba(26,31,46,0.86);
52
+ --bg-panel: rgba(15,17,23,0.97);
53
+ --bg-card: rgba(26,31,46,0.6);
54
+ --bg-card-grad-1: rgba(26,31,46,0.8);
55
+ --bg-card-grad-2: rgba(15,17,23,0.6);
56
+ --bg-option-hover: rgba(42,51,71,0.3);
57
+ --grid-dot: rgba(168,180,200,0.06);
58
+ --stripe-bg-light: rgba(15,17,23,.4);
59
+ --stripe-card-bg: rgba(26,31,46,.4);
60
+ --stripe-bg-sidebar: rgba(15,17,23,.6);
61
+ --bg-code: rgba(26,31,46,.8);
62
+
63
+ color-scheme: dark;
64
+ }
65
+ *, *::before, *::after { box-sizing: border-box; }
66
+ html, body { margin: 0; min-height: 100%; background: var(--void); color: var(--text); }
67
+ body { overflow: hidden; font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
68
+ button, input, select { font: inherit; }
69
+
70
+ /* Inline icon alignment — SVG glyphs sit centered on the text baseline. */
71
+ .btn-icon, .tip-icon, .welcome-icon, .detail-ai-head svg {
72
+ display: inline-flex; align-items: center; justify-content: center;
73
+ }
74
+ .btn-icon svg, .detail-ai-head svg { vertical-align: middle; }
75
+
76
+ /* Shell */
77
+ .system-shell { display: grid; grid-template-rows: auto 1fr; height: calc(100vh - 37px); min-height: 640px; }
78
+
79
+ /* Toolbar */
80
+ .system-toolbar {
81
+ display: flex; align-items: center; gap: 8px; padding: 10px 16px; flex-wrap: wrap;
82
+ border-bottom: 1px solid var(--border); background: var(--bg-glass);
83
+ backdrop-filter: blur(16px) saturate(150%);
84
+ }
85
+ .toolbar-group { display: flex; align-items: center; gap: 6px; }
86
+ .toolbar-brand { margin-right: auto; gap: 10px; }
87
+ .toolbar-filters { gap: 6px; }
88
+ .toolbar-zoom { gap: 4px; padding: 0 6px; border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
89
+ .toolbar-actions { gap: 6px; }
90
+ .toolbar-info { gap: 8px; margin-left: 4px; }
91
+
92
+ .brand-mark {
93
+ width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
94
+ background: linear-gradient(135deg, rgba(245,121,58,.18), rgba(139,92,246,.14));
95
+ border: 1px solid rgba(245,121,58,.28); color: var(--ember); font-size: 14px;
96
+ }
97
+ .toolbar-title { min-width: 170px; }
98
+ .toolbar-title strong {
99
+ display: block; font-family: "Sora", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
100
+ font-size: 14px; letter-spacing: 0;
101
+ }
102
+ .toolbar-title span { color: var(--haze); font-size: 11px; }
103
+ .stat-pill { color: var(--haze); font-size: 11px; font-family: monospace; }
104
+
105
+ .control {
106
+ height: 32px; border: 1px solid var(--border); border-radius: 8px;
107
+ background: var(--bg-control); color: var(--text); padding: 0 10px; outline: none;
108
+ font-size: 12px; min-width: 0;
109
+ }
110
+ .control:focus { border-color: rgba(245,121,58,.6); box-shadow: 0 0 0 2px rgba(245,121,58,.12); }
111
+ input.control { width: 160px; }
112
+ select.control { width: 120px; }
113
+
114
+ .system-btn {
115
+ height: 32px; border: 1px solid rgba(168,180,200,.2); border-radius: 8px;
116
+ background: var(--bg-card); color: var(--smoke); padding: 0 10px;
117
+ cursor: pointer; font-size: 12px; display: flex; align-items: center; gap: 4px;
118
+ transition: all 120ms ease;
119
+ }
120
+ .system-btn:hover { background: var(--bg-option-hover); color: var(--text); }
121
+ .system-btn.active { background: rgba(245,121,58,.15); color: var(--ember); border-color: rgba(245,121,58,.4); }
122
+ .icon-btn { width: 32px; justify-content: center; padding: 0; font-size: 16px; font-weight: 700; }
123
+ .btn-icon { font-size: 13px; }
124
+ .zoom-label { font-size: 11px; color: var(--haze); font-family: monospace; min-width: 38px; text-align: center; }
125
+
126
+ /* Body */
127
+ .system-body { display: grid; grid-template-columns: 1fr 400px; min-height: 0; overflow: hidden; }
128
+
129
+ /* Canvas */
130
+ .canvas-wrap {
131
+ position: relative; height: 100%; min-height: 0; overflow: hidden; cursor: grab;
132
+ background:
133
+ radial-gradient(circle at 25px 25px, var(--grid-dot) 1px, transparent 1px),
134
+ radial-gradient(ellipse 800px 600px at 30% 20%, rgba(245,121,58,.04), transparent 60%),
135
+ radial-gradient(ellipse 700px 500px at 70% 80%, rgba(139,92,246,.04), transparent 60%),
136
+ var(--void);
137
+ background-size: 30px 30px, auto, auto, auto;
138
+ }
139
+ .canvas-wrap.panning,
140
+ .canvas-wrap:active { cursor: grabbing; }
141
+ .canvas { width: 100%; height: 100%; position: absolute; top: 0; left: 0; }
142
+ .canvas svg { display: block; width: 100%; height: 100%; overflow: visible; }
143
+
144
+ /* Nodes — hover & interaction */
145
+ .canvas svg .node { cursor: grab; transition: filter 180ms ease; }
146
+ .canvas svg .node:active { cursor: grabbing; }
147
+ .canvas svg .node:hover rect:first-of-type {
148
+ stroke-opacity: 0.7 !important;
149
+ filter: drop-shadow(0 6px 16px rgba(15,23,42,0.14));
150
+ }
151
+ [data-theme="dark"] .canvas svg .node:hover rect:first-of-type {
152
+ filter: drop-shadow(0 6px 16px rgba(0,0,0,0.35));
153
+ }
154
+ .canvas svg .node.selected rect:first-of-type {
155
+ filter: drop-shadow(0 8px 24px rgba(245,121,58,0.18));
156
+ }
157
+ .canvas svg .swimlane { pointer-events: none; }
158
+ .canvas svg path[marker-end] { transition: opacity 180ms ease, stroke-width 180ms ease; }
159
+ .canvas svg path[marker-end]:hover { opacity: 1 !important; stroke-width: 2.2 !important; }
160
+
161
+ /* Legend */
162
+ .legend {
163
+ position: absolute; bottom: 16px; left: 16px; z-index: 10;
164
+ background: var(--bg-glass); border: 1px solid var(--border); border-radius: 12px;
165
+ backdrop-filter: blur(12px); max-width: 200px; overflow: hidden;
166
+ transition: max-height 200ms ease;
167
+ }
168
+ .legend.collapsed .legend-content { display: none; }
169
+ .legend-toggle {
170
+ display: block; width: 100%; padding: 8px 12px; border: 0; background: transparent;
171
+ color: var(--haze); font-size: 11px; font-family: monospace; cursor: pointer; text-align: left;
172
+ }
173
+ .legend-toggle:hover { color: var(--text); }
174
+ .legend-content { padding: 0 12px 10px; }
175
+ .legend-section { margin-bottom: 8px; }
176
+ .legend-heading { font-size: 10px; color: var(--haze); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; font-family: monospace; }
177
+ .legend-item { display: flex; align-items: center; gap: 8px; padding: 2px 0; font-size: 11px; color: var(--smoke); }
178
+ .legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
179
+ .legend-line { width: 16px; height: 2px; border-radius: 1px; background: var(--haze); flex-shrink: 0; }
180
+
181
+ /* Panel */
182
+ .panel {
183
+ border-left: 1px solid var(--border); background: var(--bg-panel);
184
+ overflow-y: auto; overflow-x: hidden; scrollbar-width: thin;
185
+ scrollbar-color: var(--border) transparent;
186
+ }
187
+
188
+ .panel-welcome {
189
+ margin: 20px 16px; padding: 24px 20px; border: 1px solid var(--border); border-radius: 16px;
190
+ background: linear-gradient(145deg, var(--bg-card-grad-1), var(--bg-card-grad-2));
191
+ text-align: center;
192
+ }
193
+ .welcome-icon {
194
+ width: 48px; height: 48px; border-radius: 14px; display: inline-grid; place-items: center;
195
+ background: linear-gradient(135deg, rgba(245,121,58,.15), rgba(139,92,246,.12));
196
+ border: 1px solid rgba(245,121,58,.25); color: var(--ember); font-size: 22px; margin-bottom: 14px;
197
+ }
198
+ .panel-welcome h2 {
199
+ margin: 0 0 8px; font-family: "Sora", -apple-system, BlinkMacSystemFont, sans-serif;
200
+ font-size: 17px; font-weight: 700;
201
+ }
202
+ .panel-welcome p { margin: 0 0 18px; color: var(--haze); font-size: 13px; line-height: 1.5; }
203
+ .welcome-tips { text-align: left; }
204
+ .tip {
205
+ display: flex; align-items: flex-start; gap: 10px; padding: 8px 0;
206
+ border-bottom: 1px solid rgba(42,51,71,.5); font-size: 12px; color: var(--smoke); line-height: 1.4;
207
+ }
208
+ .tip:last-child { border-bottom: 0; }
209
+ .tip-icon { font-size: 14px; flex-shrink: 0; width: 20px; text-align: center; }
210
+ .tip strong { color: var(--ember); }
211
+
212
+ .panel-empty, .panel-section {
213
+ margin: 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-card);
214
+ }
215
+ .panel-empty { padding: 20px; color: var(--haze); font-size: 13px; line-height: 1.5; }
216
+
217
+ .panel-section { overflow: hidden; }
218
+ .panel-section h2 {
219
+ margin: 0; padding: 16px 18px 6px;
220
+ font-family: "Sora", -apple-system, BlinkMacSystemFont, sans-serif;
221
+ font-size: 15px; letter-spacing: 0; font-weight: 700;
222
+ }
223
+ .panel-section h3 {
224
+ margin: 0; padding: 12px 18px 4px; font-size: 12px; color: var(--haze);
225
+ text-transform: uppercase; letter-spacing: .04em; font-family: monospace;
226
+ }
227
+ .panel-section dl { margin: 0; padding: 6px 18px 18px; }
228
+ .panel-section dt {
229
+ margin-top: 14px; color: var(--haze); font-size: 11px; font-family: monospace;
230
+ text-transform: uppercase; letter-spacing: .04em;
231
+ }
232
+ .panel-section dd { margin: 4px 0 0; color: var(--smoke); font-size: 13px; word-break: break-word; line-height: 1.5; }
233
+ .panel-section pre {
234
+ overflow-x: auto; margin: 0; padding: 12px; border-radius: 8px; background: var(--bg-solid);
235
+ color: var(--smoke); font-size: 11px; white-space: pre-wrap; line-height: 1.5;
236
+ }
237
+
238
+ /* Node detail in panel */
239
+ .node-detail-header {
240
+ display: flex; align-items: center; gap: 10px; padding: 16px 18px;
241
+ border-bottom: 1px solid var(--border);
242
+ }
243
+ .node-detail-badge {
244
+ width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
245
+ font-size: 16px; flex-shrink: 0;
246
+ }
247
+ .node-detail-title { font-size: 15px; font-weight: 700; word-break: break-word; }
248
+ .node-detail-type { font-size: 11px; color: var(--haze); font-family: monospace; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
249
+ .node-fact {
250
+ display: inline-block; padding: 1px 6px; border-radius: 4px; font-size: 10px;
251
+ background: rgba(168,180,200,.1); color: var(--smoke); font-family: monospace; font-weight: 600;
252
+ }
253
+
254
+ /* Edge line in panel */
255
+ .edge-line {
256
+ display: flex; justify-content: space-between; align-items: flex-start; gap: 8px;
257
+ border-bottom: 1px solid var(--border); padding: 8px 0; font-size: 12px;
258
+ }
259
+ .edge-line:last-child { border-bottom: 0; }
260
+ .edge-line-info { color: var(--smoke); line-height: 1.4; }
261
+ .edge-line-type { font-weight: 600; color: var(--text); }
262
+ .edge-line button {
263
+ flex-shrink: 0; border: 0; background: transparent; color: var(--ember);
264
+ cursor: pointer; font-size: 11px; padding: 2px 4px;
265
+ }
266
+ .edge-line button:hover { text-decoration: underline; }
267
+
268
+ /* Connection items in detail panel */
269
+ .connection-item {
270
+ display: flex; align-items: flex-start; gap: 8px; padding: 8px 0;
271
+ border-bottom: 1px solid var(--border); font-size: 12px;
272
+ }
273
+ .connection-item:last-child { border-bottom: 0; }
274
+ .connection-arrow { font-size: 14px; flex-shrink: 0; margin-top: 1px; font-weight: 600; }
275
+ .connection-info { flex: 1; min-width: 0; }
276
+ .connection-verb { display: block; color: var(--smoke); font-size: 11px; line-height: 1.4; }
277
+ .connection-label { display: block; color: var(--text); font-weight: 600; font-size: 12px; word-break: break-word; }
278
+ .connection-type { color: var(--haze); font-size: 10px; font-family: monospace; }
279
+ .connection-remove {
280
+ flex-shrink: 0; width: 20px; height: 20px; border: 0; border-radius: 4px;
281
+ background: transparent; color: var(--haze); cursor: pointer; font-size: 14px;
282
+ display: grid; place-items: center; opacity: 0; transition: opacity 120ms;
283
+ }
284
+ .connection-item:hover .connection-remove { opacity: 1; }
285
+ .connection-remove:hover { color: var(--ember); background: rgba(245,121,58,.1); }
286
+
287
+ /* Controller detail — action list */
288
+ .action-summary {
289
+ padding: 10px 0; border-bottom: 1px solid var(--border);
290
+ }
291
+ .action-summary:last-child { border-bottom: 0; }
292
+ .action-summary-name {
293
+ font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 4px;
294
+ display: flex; align-items: center; gap: 6px;
295
+ }
296
+ .action-doc-badge {
297
+ font-size: 9px; font-weight: 700; font-family: monospace;
298
+ padding: 1px 5px; border-radius: 3px;
299
+ background: rgba(52,199,89,.12); color: #34c759; border: 1px solid rgba(52,199,89,.2);
300
+ text-transform: uppercase; letter-spacing: .04em;
301
+ }
302
+ .action-summary-route {
303
+ margin: 4px 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
304
+ }
305
+ .action-summary-desc {
306
+ font-size: 12px; color: var(--smoke); line-height: 1.4; margin: 4px 0;
307
+ }
308
+ .action-summary-responses {
309
+ display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap;
310
+ }
311
+ .response-code {
312
+ font-size: 10px; font-family: monospace; font-weight: 600;
313
+ padding: 1px 6px; border-radius: 3px;
314
+ background: rgba(168,180,200,.08); color: var(--haze); border: 1px solid rgba(168,180,200,.12);
315
+ }
316
+ .response-code[data-status^="2"] { background: rgba(52,199,89,.1); color: #34c759; border-color: rgba(52,199,89,.2); }
317
+ .response-code[data-status^="4"] { background: rgba(255,79,79,.1); color: #ff4f4f; border-color: rgba(255,79,79,.2); }
318
+ .response-code[data-status^="5"] { background: rgba(255,179,64,.1); color: #ffb340; border-color: rgba(255,179,64,.2); }
319
+
320
+ /* Toast */
321
+ .toast {
322
+ position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); padding: 10px 16px;
323
+ border: 1px solid rgba(245,121,58,.25); border-radius: 999px; background: var(--bg-glass);
324
+ color: var(--ember); font-size: 12px; opacity: 0; pointer-events: none;
325
+ transition: opacity 180ms ease; backdrop-filter: blur(8px); z-index: 100;
326
+ }
327
+ .toast.visible { opacity: 1; }
328
+
329
+ /* ───────── API documentation view ─────────
330
+ A real docs layout: sticky resource nav on the left, a readable
331
+ single-column reference on the right. Reads light-first. */
332
+ .stripe-docs-wrap {
333
+ display: grid; grid-template-columns: 260px minmax(0, 1fr) 400px;
334
+ height: 100%; min-height: 0; overflow: hidden; background: var(--void);
335
+ }
336
+ .mono { font-family: "SF Mono", ui-monospace, SFMono-Regular, Menlo, monospace; }
337
+
338
+ .stripe-sidebar {
339
+ border-right: 1px solid var(--border); background: var(--stripe-bg-sidebar);
340
+ padding: 28px 14px; overflow-y: auto; display: flex; flex-direction: column; gap: 26px;
341
+ scrollbar-width: thin; scrollbar-color: var(--border) transparent;
342
+ }
343
+ .stripe-sidebar-group { display: flex; flex-direction: column; gap: 2px; }
344
+ .stripe-sidebar-heading {
345
+ font-size: 11px; font-weight: 700; color: var(--text); letter-spacing: .02em;
346
+ margin-bottom: 8px; padding-left: 10px;
347
+ }
348
+ .stripe-sidebar-item {
349
+ display: flex; align-items: center; justify-content: space-between; gap: 8px;
350
+ padding: 7px 10px; border-radius: 8px; font-size: 12.5px; color: var(--smoke);
351
+ text-decoration: none; transition: background 120ms ease, color 120ms ease; cursor: pointer;
352
+ border-left: 2px solid transparent;
353
+ }
354
+ .stripe-sidebar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
355
+ .stripe-sidebar-item:hover { background: var(--bg-option-hover); color: var(--text); }
356
+ .stripe-sidebar-item.active {
357
+ background: var(--bg-option-hover); color: var(--ember); font-weight: 600;
358
+ border-left: 2px solid var(--ember); border-radius: 0 8px 8px 0;
359
+ }
360
+ .stripe-sidebar-badge {
361
+ font-size: 8px; font-weight: 800; font-family: "SF Mono", ui-monospace, monospace;
362
+ padding: 2px 5px; border-radius: 4px; letter-spacing: .03em; flex-shrink: 0;
363
+ }
364
+
365
+ .stripe-content {
366
+ padding: 44px 48px; overflow-y: auto; scroll-behavior: smooth; height: 100%;
367
+ scrollbar-width: thin; scrollbar-color: var(--border) transparent;
368
+ }
369
+ .stripe-controller-block {
370
+ margin-bottom: 64px; border-bottom: 1px solid var(--border); padding-bottom: 48px;
371
+ }
372
+ .stripe-controller-block:last-child { border-bottom: 0; margin-bottom: 24px; }
373
+ .stripe-controller-header {
374
+ display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
375
+ margin-bottom: 4px; flex-wrap: wrap;
376
+ }
377
+ .stripe-controller-kicker {
378
+ font-size: 11px; font-weight: 700; color: var(--ember); text-transform: uppercase;
379
+ letter-spacing: .08em; margin-bottom: 4px;
380
+ }
381
+ .stripe-controller-title {
382
+ margin: 0; font-family: "Sora", -apple-system, sans-serif; font-size: 26px;
383
+ font-weight: 800; color: var(--text); letter-spacing: -0.01em;
384
+ }
385
+ .stripe-controller-file {
386
+ font-size: 11px; color: var(--haze); font-family: "SF Mono", ui-monospace, monospace;
387
+ padding: 4px 8px; background: var(--bg-option-hover); border-radius: 6px; white-space: nowrap;
388
+ }
389
+ .stripe-controller-sub { margin: 0 0 24px; color: var(--haze); font-size: 13px; }
390
+ .stripe-controller-sub .mono { color: var(--smoke); }
391
+
392
+ .stripe-controller-aside { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
393
+ .stripe-coverage {
394
+ font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 999px;
395
+ border: 1px solid; white-space: nowrap;
396
+ }
397
+ .stripe-explain-btn {
398
+ display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
399
+ border: 1px solid rgba(124,77,219,.35); border-radius: 8px;
400
+ background: var(--bg-card); color: var(--dusk); font-size: 12px; font-weight: 600;
401
+ cursor: pointer; transition: background 120ms ease, border-color 120ms ease;
402
+ }
403
+ .stripe-explain-btn:hover { background: var(--bg-option-hover); border-color: var(--dusk); }
404
+
405
+ /* ───────── Right-hand detail panel ─────────
406
+ Fills the third column: endpoint request/response on click, or the
407
+ AI section explanation from "Explain section". */
408
+ .stripe-detail {
409
+ position: relative; border-left: 1px solid var(--border); background: var(--bg-panel);
410
+ overflow-y: auto; height: 100%; min-height: 0;
411
+ scrollbar-width: thin; scrollbar-color: var(--border) transparent;
412
+ }
413
+ .stripe-detail-close {
414
+ position: absolute; top: 14px; right: 14px; z-index: 2;
415
+ width: 28px; height: 28px; display: none; align-items: center; justify-content: center;
416
+ border: 1px solid var(--border); border-radius: 8px; background: var(--bg-card);
417
+ color: var(--haze); cursor: pointer;
418
+ }
419
+ .stripe-detail-close:hover { color: var(--text); background: var(--bg-option-hover); }
420
+ .stripe-detail-body { padding: 28px 24px; }
421
+
422
+ .stripe-detail-empty {
423
+ display: flex; flex-direction: column; align-items: center; justify-content: center;
424
+ text-align: center; min-height: 60vh; color: var(--haze); gap: 14px;
425
+ }
426
+ .stripe-detail-empty-icon {
427
+ width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
428
+ background: var(--bg-option-hover); color: var(--haze);
429
+ }
430
+ .stripe-detail-empty p { margin: 0; font-size: 13px; line-height: 1.5; max-width: 240px; }
431
+ .stripe-detail-empty strong { color: var(--smoke); }
432
+
433
+ /* Detail header */
434
+ .detail-kicker { font-size: 11px; font-weight: 700; color: var(--ember); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 6px; }
435
+ .detail-title {
436
+ margin: 0 0 14px; font-family: "Sora", -apple-system, sans-serif; font-size: 19px;
437
+ font-weight: 700; color: var(--text); line-height: 1.3;
438
+ }
439
+ .detail-endpoint-line {
440
+ display: flex; align-items: center; gap: 10px; font-family: "SF Mono", ui-monospace, monospace;
441
+ font-size: 12.5px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px;
442
+ background: var(--bg-solid); margin-bottom: 18px; flex-wrap: wrap;
443
+ }
444
+ .detail-endpoint-line .verb { font-weight: 800; letter-spacing: .03em; }
445
+ .detail-endpoint-line .path { color: var(--text); word-break: break-all; }
446
+ .detail-desc { font-size: 13.5px; line-height: 1.65; color: var(--smoke); margin-bottom: 22px; }
447
+
448
+ /* Detail sections (Parameters, Request, Responses) */
449
+ .detail-section { margin-bottom: 24px; }
450
+ .detail-section-title {
451
+ font-size: 11px; font-weight: 700; color: var(--haze); text-transform: uppercase;
452
+ letter-spacing: .06em; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border);
453
+ }
454
+ .detail-param {
455
+ display: flex; flex-direction: column; gap: 2px; padding: 9px 0; border-bottom: 1px solid var(--border);
456
+ }
457
+ .detail-param:last-child { border-bottom: 0; }
458
+ .detail-param-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
459
+ .detail-param-name { font-family: "SF Mono", ui-monospace, monospace; font-size: 12px; font-weight: 700; color: var(--text); }
460
+ .detail-param-type { font-family: "SF Mono", ui-monospace, monospace; font-size: 11px; color: var(--info); }
461
+ .detail-chip {
462
+ font-size: 9px; font-weight: 800; font-family: "SF Mono", ui-monospace, monospace;
463
+ padding: 1px 5px; border-radius: 4px; text-transform: uppercase; letter-spacing: .03em;
464
+ }
465
+ .detail-chip.req { background: rgba(220,38,38,.1); color: var(--danger); }
466
+ .detail-chip.loc { background: var(--bg-option-hover); color: var(--haze); }
467
+ .detail-param-desc { font-size: 12px; color: var(--smoke); line-height: 1.45; }
468
+
469
+ .detail-code {
470
+ margin: 0; padding: 12px 14px; border: 1px solid var(--border); border-radius: 9px;
471
+ background: var(--bg-code); color: var(--smoke); overflow-x: auto;
472
+ font-family: "SF Mono", ui-monospace, monospace; font-size: 11.5px; line-height: 1.6; white-space: pre;
473
+ }
474
+
475
+ .detail-response { padding: 9px 0; border-bottom: 1px solid var(--border); }
476
+ .detail-response:last-child { border-bottom: 0; }
477
+ .detail-response-head { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
478
+ .detail-response-desc { font-size: 12px; color: var(--smoke); line-height: 1.45; }
479
+
480
+ /* AI explanation inside the panel */
481
+ .detail-ai-head {
482
+ display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700;
483
+ color: var(--dusk); margin-bottom: 12px;
484
+ }
485
+ .detail-ai-body { font-size: 13px; line-height: 1.65; color: var(--smoke); }
486
+ .detail-ai-body strong { color: var(--text); }
487
+ .detail-loading { color: var(--haze); font-style: italic; font-size: 13px; }
488
+ .detail-error { color: var(--warning); font-size: 13px; line-height: 1.5; }
489
+
490
+ /* Slide-over drawer on narrow screens */
491
+ @media (max-width: 1100px) {
492
+ .stripe-docs-wrap { grid-template-columns: 240px minmax(0, 1fr); }
493
+ .stripe-detail {
494
+ position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 88vw); z-index: 200;
495
+ transform: translateX(100%); transition: transform 220ms ease;
496
+ box-shadow: -8px 0 32px rgba(15,23,42,0.18);
497
+ }
498
+ .stripe-detail.open { transform: translateX(0); }
499
+ .stripe-detail-close { display: inline-flex; }
500
+ }
501
+
502
+ .stripe-endpoint-card {
503
+ background: var(--stripe-card-bg); border: 1px solid var(--border); border-radius: 14px;
504
+ margin-bottom: 20px; padding: 24px 26px; transition: border-color 150ms, box-shadow 150ms;
505
+ scroll-margin-top: 24px; cursor: pointer;
506
+ }
507
+ .stripe-endpoint-card:hover {
508
+ border-color: var(--haze);
509
+ box-shadow: 0 4px 20px rgba(15,23,42,0.06);
510
+ }
511
+ .stripe-endpoint-card.detail-active {
512
+ border-color: var(--ember);
513
+ box-shadow: 0 4px 20px rgba(234,106,46,0.10);
514
+ }
515
+ .stripe-endpoint-header {
516
+ display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; gap: 16px;
517
+ }
518
+ .stripe-endpoint-title-wrap { min-width: 0; }
519
+ .stripe-endpoint-kicker {
520
+ display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
521
+ font-size: 11px; color: var(--haze);
522
+ }
523
+ .stripe-endpoint-title {
524
+ margin: 0; font-family: "Sora", -apple-system, sans-serif; font-size: 18px;
525
+ font-weight: 700; color: var(--text); letter-spacing: -0.005em; line-height: 1.3;
526
+ }
527
+ .stripe-endpoint-card .stripe-endpoint-explain { flex-shrink: 0; }
528
+
529
+ .stripe-endpoint-meta {
530
+ display: inline-flex; align-items: center; gap: 10px;
531
+ font-family: "SF Mono", ui-monospace, monospace; font-size: 12.5px;
532
+ padding: 9px 14px; background: var(--bg-solid); border: 1px solid var(--border); border-radius: 9px;
533
+ margin-bottom: 18px;
534
+ }
535
+ .stripe-endpoint-verb { font-weight: 800; letter-spacing: .03em; }
536
+ .stripe-endpoint-path { color: var(--text); }
537
+
538
+ .stripe-endpoint-desc {
539
+ color: var(--smoke); font-size: 14px; line-height: 1.65; margin-bottom: 22px; max-width: 70ch;
540
+ }
541
+ .stripe-endpoint-desc--empty { color: var(--haze); font-style: italic; }
542
+
543
+ .stripe-relations-title {
544
+ font-size: 11px; font-weight: 700; color: var(--haze); text-transform: uppercase;
545
+ letter-spacing: .06em; margin-bottom: 10px;
546
+ }
547
+ .stripe-relations-grid {
548
+ display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px;
549
+ }
550
+ .stripe-relation-card {
551
+ background: var(--stripe-bg-light); border: 1px solid var(--border); border-radius: 10px;
552
+ padding: 10px 12px; display: flex; align-items: center; gap: 10px; transition: all 120ms;
553
+ cursor: pointer;
554
+ }
555
+ .stripe-relation-card:hover {
556
+ border-color: var(--ember); background: var(--bg-option-hover);
557
+ }
558
+ .stripe-relation-icon {
559
+ width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; flex-shrink: 0;
560
+ }
561
+ .stripe-relation-text { min-width: 0; display: flex; flex-direction: column; }
562
+ .stripe-relation-name {
563
+ font-size: 12px; font-weight: 600; color: var(--text);
564
+ overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
565
+ }
566
+ .stripe-relation-type {
567
+ font-size: 10px; color: var(--haze); font-family: "SF Mono", ui-monospace, monospace;
568
+ }
569
+
570
+ /* Responsive */
571
+ @media (max-width: 980px) {
572
+ body { overflow: auto; }
573
+ .system-body { grid-template-columns: 1fr; }
574
+ .panel { min-height: 320px; border-left: 0; border-top: 1px solid var(--border); }
575
+ input.control { width: 120px; }
576
+ .toolbar-zoom { display: none; }
577
+ }
578
+ CSS
579
+ end
580
+ end
581
+ end
582
+ end
data/lib/docit/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Docit
4
- VERSION = "0.3.1"
4
+ VERSION = "0.5.0"
5
5
  end
data/lib/docit.rb CHANGED
@@ -11,10 +11,14 @@ require_relative "docit/schema_definition"
11
11
  require_relative "docit/doc_file"
12
12
  require_relative "docit/route_inspector"
13
13
  require_relative "docit/schema_generator"
14
+ require_relative "docit/system_graph"
14
15
  require_relative "docit/dsl"
15
16
  require_relative "docit/ui/base_renderer"
16
17
  require_relative "docit/ui/swagger_renderer"
17
18
  require_relative "docit/ui/scalar_renderer"
19
+ require_relative "docit/ui/system_styles"
20
+ require_relative "docit/ui/system_script"
21
+ require_relative "docit/ui/system_renderer"
18
22
 
19
23
  # Docit is a decorator-style API documentation gem for Ruby on Rails.
20
24
  # It generates OpenAPI 3.0.3 specs from clean DSL macros on your controllers.
@@ -102,7 +102,7 @@ module Docit
102
102
  say ""
103
103
  say "Next steps:"
104
104
  say " 1. Edit config/initializers/docit.rb to customize your API docs"
105
- say " 2. Add swagger_doc blocks or create doc files under app/docs/"
105
+ say " 2. Add doc_for blocks or create doc files under app/docs/"
106
106
  say " 3. Visit /api-docs to see your Swagger UI"
107
107
  say ""
108
108
  say "You can set up docs later with:"
@@ -146,7 +146,7 @@ module Docit
146
146
 
147
147
  def update_gitignore
148
148
  gitignore = Rails.root.join(".gitignore")
149
- if !(File.exist?(gitignore))
149
+ unless File.exist?(gitignore)
150
150
  say "Warning: .gitignore not found. Add .docit_ai.yml manually to avoid committing your API key.", :yellow
151
151
  return
152
152
  end
@@ -167,7 +167,7 @@ module Docit
167
167
  choice = ask(prompt).to_s.strip
168
168
  return choice if choices.include?(choice)
169
169
 
170
- say "Invalid choice. Please enter #{choices.join(', ')}.", :red
170
+ say "Invalid choice. Please enter #{choices.join(", ")}.", :red
171
171
  end
172
172
  end
173
173
 
@@ -13,6 +13,10 @@ Docit.configure do |config|
13
13
  # Documentation UI: :scalar (default) or :swagger
14
14
  # config.default_ui = :scalar
15
15
 
16
+ # System map: local architecture graph at /api-docs/system
17
+ # config.system_graph_enabled = true
18
+ # config.system_graph_excluded_paths = []
19
+
16
20
  # Authentication scheme (options: :bearer, :basic, :api_key)
17
21
  # config.auth :bearer
18
22
 
data/lib/tasks/docit.rake CHANGED
@@ -3,7 +3,7 @@
3
3
  namespace :docit do
4
4
  desc "Generate documentation for undocumented API endpoints using AI"
5
5
  task :autodoc, [:controller] => :environment do |_t, args|
6
- dry_run = ENV.fetch("DRY_RUN", "0") == "1" || ARGV.include?("--dry-run")
6
+ dry_run = ENV.fetch("DRY_RUN", "0") == "1"
7
7
  controller_filter = args[:controller]
8
8
 
9
9
  runner = Docit::Ai::AutodocRunner.new(