collabmd 0.1.21 → 0.1.23

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 (99) hide show
  1. package/README.md +94 -7
  2. package/bin/collabmd.js +3 -2
  3. package/docker-compose.yml +13 -1
  4. package/package.json +2 -1
  5. package/public/assets/css/style.css +1 -1
  6. package/public/assets/js/chunks/{chunk-HEWVH67U.js → chunk-CYK7KO7W.js} +8 -8
  7. package/public/assets/js/chunks/editor-session-S5AT7BMV.js +22 -0
  8. package/public/assets/js/{excalidraw-editor-TCIH6GJL.js → excalidraw-editor-5YWMGLKF.js} +145 -62
  9. package/public/assets/js/excalidraw-editor.js +1 -1
  10. package/public/assets/js/main.js +503 -182
  11. package/public/index.html +104 -84
  12. package/src/client/application/app-shell/git-feature.js +247 -9
  13. package/src/client/application/app-shell/ui-feature.js +65 -7
  14. package/src/client/application/app-shell/workspace-feature.js +46 -0
  15. package/src/client/application/app-shell-elements.js +2 -0
  16. package/src/client/application/mermaid-preview-hydrator.js +1 -1
  17. package/src/client/application/plantuml-preview-hydrator.js +1 -1
  18. package/src/client/application/workspace-coordinator.js +147 -18
  19. package/src/client/application/workspace-preview-controller.js +34 -0
  20. package/src/client/application/workspace-route-controller.js +104 -0
  21. package/src/client/bootstrap/collabmd-app-shell.js +95 -0
  22. package/src/client/domain/runtime-paths.js +5 -0
  23. package/src/client/excalidraw-editor.js +50 -2
  24. package/src/client/infrastructure/auth-client.js +219 -52
  25. package/src/client/infrastructure/browser-navigation-port.js +20 -0
  26. package/src/client/infrastructure/editor-collaboration-client.js +4 -0
  27. package/src/client/infrastructure/editor-session.js +47 -7
  28. package/src/client/infrastructure/editor-view-adapter.js +122 -58
  29. package/src/client/infrastructure/runtime-config.js +66 -0
  30. package/src/client/presentation/comment-ui-controller.js +82 -26
  31. package/src/client/presentation/comments-panel.js +2 -2
  32. package/src/client/presentation/excalidraw-embed-controller.js +60 -2
  33. package/src/client/presentation/file-history-view-controller.js +806 -0
  34. package/src/client/presentation/git-diff-view-controller.js +718 -121
  35. package/src/client/presentation/git-panel-controller.js +458 -66
  36. package/src/client/presentation/layout-controller.js +1 -1
  37. package/src/client/styles/components/actions.css +89 -0
  38. package/src/client/styles/components/feedback.css +43 -0
  39. package/src/client/styles/components/navigation.css +68 -0
  40. package/src/client/styles/components/scrollbars.css +104 -0
  41. package/src/client/styles/components/states.css +289 -0
  42. package/src/client/styles/components/surfaces.css +155 -0
  43. package/src/client/styles/features/backlinks.css +213 -0
  44. package/src/client/styles/features/collaboration-chat.css +228 -0
  45. package/src/client/styles/features/collaboration-dialogs.css +154 -0
  46. package/src/client/styles/features/collaboration-presence.css +103 -0
  47. package/src/client/styles/features/collaboration-ui.css +3 -0
  48. package/src/client/styles/features/comment-card.css +236 -0
  49. package/src/client/styles/features/comment-markdown.css +127 -0
  50. package/src/client/styles/features/comment-overlays.css +60 -0
  51. package/src/client/styles/features/comments-drawer.css +120 -0
  52. package/src/client/styles/features/comments.css +4 -0
  53. package/src/client/styles/features/diagram-preview.css +227 -0
  54. package/src/client/styles/features/diff-commit.css +268 -0
  55. package/src/client/styles/features/diff-lines.css +160 -0
  56. package/src/client/styles/features/diff-toolbar.css +98 -0
  57. package/src/client/styles/features/diff.css +3 -0
  58. package/src/client/styles/features/embedded-preview.css +218 -0
  59. package/src/client/styles/features/git-branch.css +155 -0
  60. package/src/client/styles/features/git-files.css +105 -0
  61. package/src/client/styles/features/git-history.css +339 -0
  62. package/src/client/styles/features/git.css +3 -0
  63. package/src/client/styles/features/media-lightbox.css +157 -0
  64. package/src/client/styles/features/outline.css +115 -0
  65. package/src/client/styles/features/preview-content.css +3 -0
  66. package/src/client/styles/features/preview-markdown.css +201 -0
  67. package/src/client/styles/features/preview-sidebars.css +2 -0
  68. package/src/client/styles/features/quick-switcher.css +167 -0
  69. package/src/client/styles/foundation/themes.css +347 -0
  70. package/src/client/styles/foundation/tokens.css +66 -0
  71. package/src/client/styles/foundation/utilities.css +36 -0
  72. package/src/client/styles/layout/editor-page.css +203 -0
  73. package/src/client/styles/layout/overlays.css +132 -0
  74. package/src/client/styles/layout/responsive.css +251 -0
  75. package/src/client/styles/layout/shell.css +314 -0
  76. package/src/client/styles/layout/sidebar.css +176 -0
  77. package/src/client/styles/layout/view-modes.css +92 -0
  78. package/src/client/styles/overrides/codemirror.css +53 -0
  79. package/src/client/styles/overrides/highlightjs.css +7 -0
  80. package/src/client/styles/overrides/vendor.css +2 -0
  81. package/src/client/styles/primitives/controls.css +276 -0
  82. package/src/client/styles/style.css +25 -4945
  83. package/src/server/auth/create-auth-service.js +373 -15
  84. package/src/server/auth/session-cookie.js +30 -4
  85. package/src/server/config/env.js +121 -5
  86. package/src/server/create-app-server.js +8 -0
  87. package/src/server/domain/collaboration/collaboration-room.js +90 -47
  88. package/src/server/index.js +3 -1
  89. package/src/server/infrastructure/git/command-runner.js +2 -1
  90. package/src/server/infrastructure/git/git-service.js +48 -2
  91. package/src/server/infrastructure/git/history-service.js +683 -0
  92. package/src/server/infrastructure/git/parsers.js +30 -0
  93. package/src/server/infrastructure/git/responses.js +73 -0
  94. package/src/server/infrastructure/http/create-auth-api-handler.js +30 -2
  95. package/src/server/infrastructure/http/create-git-api-command-handler.js +2 -0
  96. package/src/server/infrastructure/http/create-git-api-handler.js +2 -0
  97. package/src/server/infrastructure/http/create-git-api-query-handler.js +61 -0
  98. package/src/server/infrastructure/http/create-request-handler.js +15 -0
  99. package/public/assets/js/chunks/editor-session-EAUBJCHH.js +0 -22
@@ -0,0 +1,201 @@
1
+ /* ===== PREVIEW / MARKDOWN ===== */
2
+
3
+ .preview-content h1 {
4
+ margin: var(--space-8) 0 var(--space-4);
5
+ padding-bottom: var(--space-2);
6
+ border-bottom: 1px solid var(--color-divider);
7
+ font-size: var(--text-xl);
8
+ font-weight: 700;
9
+ letter-spacing: -0.02em;
10
+ }
11
+
12
+ .preview-content h1:first-child {
13
+ margin-top: 0;
14
+ }
15
+
16
+ .preview-content h2 {
17
+ margin: var(--space-6) 0 var(--space-3);
18
+ font-size: var(--text-lg);
19
+ font-weight: 600;
20
+ letter-spacing: -0.01em;
21
+ }
22
+
23
+ .preview-content h3 {
24
+ margin: var(--space-5) 0 var(--space-2);
25
+ font-size: var(--text-base);
26
+ font-weight: 600;
27
+ }
28
+
29
+ .preview-content h4,
30
+ .preview-content h5,
31
+ .preview-content h6 {
32
+ margin: var(--space-4) 0 var(--space-2);
33
+ color: var(--color-text-muted);
34
+ font-size: var(--text-sm);
35
+ font-weight: 600;
36
+ }
37
+
38
+ .preview-content p {
39
+ max-width: 72ch;
40
+ margin-bottom: var(--space-4);
41
+ }
42
+
43
+ .preview-content p:has(> .excalidraw-embed-placeholder:only-child),
44
+ .preview-content p:has(> .video-embed-placeholder:only-child),
45
+ .preview-content p:has(> .plantuml-shell:only-child) {
46
+ max-width: none;
47
+ margin-bottom: 0;
48
+ }
49
+
50
+ .preview-content a {
51
+ color: var(--color-primary);
52
+ text-decoration: none;
53
+ border-bottom: 1px solid oklch(from var(--color-primary) l c h / 0.3);
54
+ transition: border-color var(--transition-interactive);
55
+ }
56
+
57
+ .preview-content a:hover {
58
+ border-bottom-color: var(--color-primary);
59
+ }
60
+
61
+ .preview-content strong {
62
+ font-weight: 600;
63
+ }
64
+
65
+ .preview-content em {
66
+ font-style: italic;
67
+ }
68
+
69
+ .preview-content del {
70
+ color: var(--color-text-muted);
71
+ text-decoration: line-through;
72
+ }
73
+
74
+ .preview-content ul,
75
+ .preview-content ol {
76
+ margin-bottom: var(--space-4);
77
+ padding-left: var(--space-6);
78
+ }
79
+
80
+ .preview-content li {
81
+ margin-bottom: var(--space-1);
82
+ }
83
+
84
+ .preview-content li > ul,
85
+ .preview-content li > ol {
86
+ margin-top: var(--space-1);
87
+ margin-bottom: 0;
88
+ }
89
+
90
+ .preview-content .task-list-item {
91
+ list-style: none;
92
+ margin-left: calc(var(--space-6) * -1);
93
+ padding-left: var(--space-1);
94
+ }
95
+
96
+ .preview-content .task-list-item input[type='checkbox'] {
97
+ margin-right: var(--space-2);
98
+ accent-color: var(--color-primary);
99
+ vertical-align: middle;
100
+ }
101
+
102
+ .preview-content blockquote {
103
+ margin: var(--space-4) 0;
104
+ padding: var(--space-3) var(--space-5);
105
+ border-left: 3px solid var(--color-primary);
106
+ border-radius: 0 var(--radius-md) var(--radius-md) 0;
107
+ background: var(--color-surface);
108
+ color: var(--color-text-muted);
109
+ }
110
+
111
+ .preview-content blockquote p:last-child {
112
+ margin-bottom: 0;
113
+ }
114
+
115
+ .preview-content code {
116
+ padding: 2px 6px;
117
+ border-radius: var(--radius-sm);
118
+ background: var(--color-surface-offset);
119
+ color: var(--color-primary);
120
+ font-family: var(--font-mono);
121
+ font-size: 0.875em;
122
+ }
123
+
124
+ .preview-content pre {
125
+ max-width: 100%;
126
+ margin: var(--space-4) 0;
127
+ overflow-x: auto;
128
+ border: 1px solid var(--color-border);
129
+ border-radius: var(--radius-lg);
130
+ background: var(--color-surface);
131
+ -webkit-overflow-scrolling: touch;
132
+ }
133
+
134
+ .preview-content pre code {
135
+ display: block;
136
+ width: fit-content;
137
+ min-width: 100%;
138
+ padding: var(--space-4);
139
+ background: none;
140
+ color: var(--color-text);
141
+ font-size: var(--text-ui-sm);
142
+ line-height: 1.6;
143
+ white-space: pre;
144
+ word-wrap: normal;
145
+ overflow-wrap: normal;
146
+ }
147
+
148
+ .preview-content .table-wrapper {
149
+ margin: var(--space-4) 0;
150
+ overflow-x: auto;
151
+ border: 1px solid var(--color-border);
152
+ border-radius: var(--radius-md);
153
+ -webkit-overflow-scrolling: touch;
154
+ }
155
+
156
+ .preview-content table {
157
+ width: 100%;
158
+ min-width: 100%;
159
+ border-collapse: collapse;
160
+ white-space: nowrap;
161
+ }
162
+
163
+ .preview-content th,
164
+ .preview-content td {
165
+ padding: var(--space-2) var(--space-3);
166
+ border-bottom: 1px solid var(--color-divider);
167
+ text-align: left;
168
+ font-size: var(--text-sm);
169
+ }
170
+
171
+ .preview-content th {
172
+ background: var(--color-surface-offset);
173
+ color: var(--color-text-muted);
174
+ font-size: var(--text-xs);
175
+ font-weight: 600;
176
+ letter-spacing: 0.03em;
177
+ text-transform: uppercase;
178
+ }
179
+
180
+ .preview-content tr:last-child td {
181
+ border-bottom: none;
182
+ }
183
+
184
+ .preview-content tr:hover td {
185
+ background: var(--color-surface-offset);
186
+ }
187
+
188
+ .preview-content hr {
189
+ height: 1px;
190
+ margin: var(--space-8) 0;
191
+ border: none;
192
+ background: var(--color-divider);
193
+ }
194
+
195
+ .preview-content img {
196
+ max-width: 100%;
197
+ height: auto;
198
+ margin: var(--space-4) 0;
199
+ border-radius: var(--radius-md);
200
+ cursor: zoom-in;
201
+ }
@@ -0,0 +1,2 @@
1
+ @import './backlinks.css';
2
+ @import './outline.css';
@@ -0,0 +1,167 @@
1
+ /* ===== QUICK SWITCHER (Cmd+K) ===== */
2
+
3
+ .qs-overlay {
4
+ position: fixed;
5
+ inset: 0;
6
+ z-index: 9999;
7
+ display: flex;
8
+ justify-content: center;
9
+ padding-top: min(20vh, 160px);
10
+ background: var(--surface-scrim);
11
+ backdrop-filter: blur(4px);
12
+ opacity: 0;
13
+ visibility: hidden;
14
+ transition: opacity 120ms ease, visibility 120ms ease, display 120ms ease allow-discrete;
15
+ }
16
+
17
+ .qs-overlay.visible {
18
+ opacity: 1;
19
+ visibility: visible;
20
+ }
21
+
22
+ @starting-style {
23
+ .qs-overlay.visible {
24
+ opacity: 0;
25
+ }
26
+ }
27
+
28
+ .qs-modal {
29
+ width: min(560px, calc(100vw - 32px));
30
+ max-height: min(440px, 60vh);
31
+ display: flex;
32
+ flex-direction: column;
33
+ overflow: hidden;
34
+ border: 1px solid var(--color-border);
35
+ border-radius: var(--radius-lg);
36
+ background: var(--color-surface);
37
+ box-shadow: var(--shadow-lg);
38
+ transform: translateY(-8px) scale(0.98);
39
+ transition: transform 120ms cubic-bezier(0.16, 1, 0.3, 1);
40
+ }
41
+
42
+ .qs-overlay.visible .qs-modal {
43
+ transform: translateY(0) scale(1);
44
+ }
45
+
46
+ @starting-style {
47
+ .qs-overlay.visible .qs-modal {
48
+ transform: translateY(-8px) scale(0.98);
49
+ }
50
+ }
51
+
52
+ .qs-input-wrap {
53
+ display: flex;
54
+ align-items: center;
55
+ gap: var(--space-2);
56
+ padding: var(--space-3) var(--space-4);
57
+ border-bottom: 1px solid var(--color-divider);
58
+ }
59
+
60
+ .qs-search-icon {
61
+ flex-shrink: 0;
62
+ color: var(--color-text-muted);
63
+ }
64
+
65
+ .qs-input {
66
+ flex: 1;
67
+ border: none;
68
+ outline: none;
69
+ background: transparent;
70
+ color: var(--color-text);
71
+ font-size: var(--text-sm);
72
+ font-family: var(--font-body);
73
+ line-height: 1.5;
74
+ }
75
+
76
+ .qs-input::placeholder {
77
+ color: var(--color-text-faint);
78
+ }
79
+
80
+ .qs-kbd {
81
+ flex-shrink: 0;
82
+ padding: 3px 6px;
83
+ border: 1px solid var(--color-divider);
84
+ border-radius: var(--radius-sm);
85
+ background: var(--color-surface-offset);
86
+ color: var(--color-text-muted);
87
+ font-family: var(--font-body);
88
+ font-size: var(--text-meta);
89
+ line-height: 1;
90
+ letter-spacing: 0.03em;
91
+ text-transform: uppercase;
92
+ }
93
+
94
+ .qs-results {
95
+ overflow-y: auto;
96
+ overscroll-behavior: contain;
97
+ padding: var(--space-1) 0;
98
+ }
99
+
100
+ .qs-result-item {
101
+ display: flex;
102
+ align-items: center;
103
+ gap: var(--space-2);
104
+ width: 100%;
105
+ padding: var(--space-2) var(--space-4);
106
+ border: none;
107
+ background: transparent;
108
+ color: var(--color-text);
109
+ font-size: var(--text-sm);
110
+ font-family: var(--font-body);
111
+ text-align: left;
112
+ cursor: pointer;
113
+ transition: background 60ms ease;
114
+ }
115
+
116
+ .qs-result-item:hover,
117
+ .qs-result-item.selected {
118
+ background: var(--color-surface-offset);
119
+ }
120
+
121
+ .qs-result-item.selected {
122
+ background: var(--color-primary-highlight);
123
+ }
124
+
125
+ [data-theme="dark"] .qs-result-item.selected {
126
+ background: oklch(from var(--color-primary) l c h / 0.18);
127
+ }
128
+
129
+ .qs-result-icon {
130
+ flex-shrink: 0;
131
+ color: var(--color-text-muted);
132
+ }
133
+
134
+ .qs-result-name {
135
+ flex: 1;
136
+ overflow: hidden;
137
+ text-overflow: ellipsis;
138
+ white-space: nowrap;
139
+ }
140
+
141
+ .qs-result-name mark {
142
+ padding: 0 1px;
143
+ border-radius: var(--radius-2xs);
144
+ background: oklch(from var(--color-primary) l c h / 0.2);
145
+ color: var(--color-primary);
146
+ }
147
+
148
+ .qs-result-path {
149
+ flex-shrink: 0;
150
+ max-width: 200px;
151
+ overflow: hidden;
152
+ color: var(--color-text-faint);
153
+ text-overflow: ellipsis;
154
+ white-space: nowrap;
155
+ font-size: var(--text-xs);
156
+ }
157
+
158
+ .qs-hint {
159
+ padding: var(--space-4);
160
+ color: var(--color-text-muted);
161
+ text-align: center;
162
+ font-size: var(--text-xs);
163
+ }
164
+
165
+ .qs-hint.hidden {
166
+ display: none;
167
+ }