deepspace 0.10.1 → 0.10.3
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.
- package/CHANGELOG.md +14 -0
- package/dist/chunk-ZJ43EK3N.js +1751 -0
- package/dist/chunk-ZJ43EK3N.js.map +1 -0
- package/dist/cli.js +848 -650
- package/dist/cli.js.map +1 -1
- package/dist/documentation-client-core.d.ts +18 -0
- package/dist/documentation-client-core.js +395 -0
- package/dist/documentation-client-core.js.map +1 -0
- package/dist/documentation-default-renderer.cjs +124 -0
- package/dist/documentation-react.d.ts +2 -0
- package/dist/documentation-react.js +35 -0
- package/dist/documentation-react.js.map +1 -0
- package/dist/documentation-runtime.js +71 -0
- package/dist/documentation-server-core.d.ts +11 -0
- package/dist/documentation-server-core.js +48 -0
- package/dist/documentation-server-core.js.map +1 -0
- package/dist/documentation.d.ts +367 -0
- package/dist/documentation.js +4122 -0
- package/dist/documentation.js.map +1 -0
- package/dist/feature-installer.js +145 -0
- package/dist/feature-installer.js.map +1 -1
- package/dist/fonts/geist-mono-OFL.txt +93 -0
- package/dist/fonts/geist-mono-variable.woff2 +0 -0
- package/dist/fonts/inter-OFL.txt +92 -0
- package/dist/fonts/inter-variable.woff2 +0 -0
- package/dist/index.d.ts +177 -1
- package/dist/index.js +133 -0
- package/dist/index.js.map +1 -1
- package/dist/public-BGRX_Cjd.d.ts +234 -0
- package/dist/schema.d.ts +186 -0
- package/dist/schema.js +610 -0
- package/dist/schema.js.map +1 -0
- package/dist/server.d.ts +83 -4
- package/dist/server.js +296 -1
- package/dist/server.js.map +1 -1
- package/dist/testing.d.ts +5 -8
- package/dist/testing.js +48 -14
- package/dist/testing.js.map +1 -1
- package/dist/worker.d.ts +249 -5
- package/dist/worker.js +1438 -19
- package/dist/worker.js.map +1 -1
- package/features/admin-page/src/admin-schema.ts +1 -1
- package/features/ai-chat/feature.json +2 -2
- package/features/ai-chat/src/ChatPanel.tsx +6 -11
- package/features/ai-chat/src/ai-chat-schema.ts +1 -2
- package/features/canvas/src/canvas-schema.ts +1 -1
- package/features/documentation/content/index.mdx +14 -0
- package/features/documentation/content/quickstart.mdx +12 -0
- package/features/documentation/documentation.json +18 -0
- package/features/documentation/feature.json +68 -0
- package/features/{docs → documents}/feature.json +27 -27
- package/features/{docs/src/DocsEditorPage.tsx → documents/src/DocumentsEditorPage.tsx} +74 -74
- package/features/{docs/src/DocsListPage.tsx → documents/src/DocumentsListPage.tsx} +102 -102
- package/features/{docs/src/DocsOutlinePanel.tsx → documents/src/DocumentsOutlinePanel.tsx} +9 -9
- package/features/{docs/src/DocsPresence.tsx → documents/src/DocumentsPresence.tsx} +18 -18
- package/features/{docs → documents}/src/InviteDialog.tsx +21 -21
- package/features/{docs → documents}/src/LibrarySidebar.tsx +25 -25
- package/features/documents/src/__tests__/documents-presence-access.test.ts +71 -0
- package/features/{docs/src/docs-library-types.ts → documents/src/documents-library-types.ts} +3 -3
- package/features/{docs/src/docs-schema.ts → documents/src/documents-schema.ts} +6 -6
- package/features/{docs/src/docs-ui.css → documents/src/documents-ui.css} +89 -89
- package/features/{docs → documents}/src/editor/DocEditorSurface.tsx +11 -11
- package/features/{docs/src/editor/DocsTiptapToolbar.tsx → documents/src/editor/DocumentsTiptapToolbar.tsx} +21 -21
- package/features/{docs → documents}/src/editor/useDocEditor.ts +4 -4
- package/features/{docs/src/use-docs-presence-access.ts → documents/src/use-documents-presence-access.ts} +51 -51
- package/features/file-attachments/src/attachments-schema.ts +1 -1
- package/features/items/src/items-schema.ts +1 -1
- package/features/leaderboard/src/leaderboard-schema.ts +1 -1
- package/features/messaging/src/ChatMultiPage.tsx +1 -1
- package/features/messaging/src/ChatPage.tsx +1 -1
- package/features/messaging/src/messaging-schema.ts +2 -2
- package/features/tasks/src/tasks-schema.ts +1 -1
- package/features/testing/src/test-schema.ts +2 -2
- package/package.json +26 -1
- package/features/docs/src/__tests__/docs-presence-access.test.ts +0 -71
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Documents feature UI — derives palette from the host app's design tokens (--color-* on
|
|
3
3
|
* shadcn/Tailwind starters, --theme-* / --ui-* when DeepSpaceThemeProvider applies a theme).
|
|
4
4
|
* No separate light/dark block: inherits whatever the root provides (e.g. [data-theme] changes).
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
.
|
|
8
|
-
--
|
|
9
|
-
--
|
|
7
|
+
.documents-feature-scope {
|
|
8
|
+
--documents-el-bg: var(--color-background, var(--theme-background, #fafafa));
|
|
9
|
+
--documents-el-surface: var(
|
|
10
10
|
--color-card,
|
|
11
11
|
var(--theme-library-card-bg, var(--theme-panel-bg, #ffffff))
|
|
12
12
|
);
|
|
13
|
-
--
|
|
14
|
-
--
|
|
13
|
+
--documents-el-text: var(--color-foreground, var(--theme-text, #1d1d1f));
|
|
14
|
+
--documents-el-muted: var(
|
|
15
15
|
--color-muted-foreground,
|
|
16
16
|
var(--theme-text-secondary, var(--theme-text-tertiary, #86868b))
|
|
17
17
|
);
|
|
18
|
-
--
|
|
19
|
-
--
|
|
18
|
+
--documents-el-accent: var(--color-primary, var(--theme-accent, var(--ui-accent, #3b82f6)));
|
|
19
|
+
--documents-el-line: var(--color-border, var(--theme-border, rgba(15, 23, 42, 0.12)));
|
|
20
20
|
|
|
21
|
-
--
|
|
21
|
+
--documents-el-selection: color-mix(in srgb, var(--documents-el-accent) 22%, transparent);
|
|
22
22
|
|
|
23
|
-
--
|
|
23
|
+
--documents-editor-desk: var(
|
|
24
24
|
--color-muted,
|
|
25
25
|
var(
|
|
26
26
|
--theme-library-surface,
|
|
27
|
-
var(--theme-surface-solid, var(--theme-surface, var(--
|
|
27
|
+
var(--theme-surface-solid, var(--theme-surface, var(--documents-el-bg)))
|
|
28
28
|
)
|
|
29
29
|
);
|
|
30
|
-
--
|
|
31
|
-
--
|
|
32
|
-
--
|
|
33
|
-
--
|
|
34
|
-
--
|
|
30
|
+
--documents-editor-paper: #ffffff;
|
|
31
|
+
--documents-editor-paper-text: #111111;
|
|
32
|
+
--documents-editor-paper-muted: #6b7280;
|
|
33
|
+
--documents-editor-paper-border: var(--documents-el-line);
|
|
34
|
+
--documents-editor-paper-shadow: var(
|
|
35
35
|
--shadow-card,
|
|
36
36
|
var(--ui-shadow-md, 0 4px 12px rgba(15, 23, 42, 0.08))
|
|
37
37
|
);
|
|
@@ -52,30 +52,30 @@
|
|
|
52
52
|
* - `-webkit-text-fill-color: inherit` is the same fix for Safari, which
|
|
53
53
|
* would otherwise still override `color` inside `::selection`.
|
|
54
54
|
*/
|
|
55
|
-
.
|
|
56
|
-
.
|
|
55
|
+
.documents-paged-editor .ProseMirror ::selection,
|
|
56
|
+
.documents-paged-editor .ProseMirror::selection {
|
|
57
57
|
background-color: #6aa8f3;
|
|
58
58
|
color: inherit;
|
|
59
59
|
-webkit-text-fill-color: inherit;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
.
|
|
63
|
-
background-color: var(--
|
|
64
|
-
border: 1px solid var(--
|
|
65
|
-
box-shadow: var(--
|
|
62
|
+
.documents-editor-paper {
|
|
63
|
+
background-color: var(--documents-editor-paper);
|
|
64
|
+
border: 1px solid var(--documents-editor-paper-border);
|
|
65
|
+
box-shadow: var(--documents-editor-paper-shadow);
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
.
|
|
69
|
-
background-color: var(--
|
|
68
|
+
.documents-paged-editor-canvas {
|
|
69
|
+
background-color: var(--documents-editor-desk);
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
.
|
|
73
|
-
.
|
|
72
|
+
.documents-presence-avatar,
|
|
73
|
+
.documents-presence-more {
|
|
74
74
|
align-items: center;
|
|
75
|
-
background-color: color-mix(in srgb, var(--
|
|
76
|
-
border: 2px solid var(--
|
|
75
|
+
background-color: color-mix(in srgb, var(--documents-el-accent) 14%, var(--documents-el-surface));
|
|
76
|
+
border: 2px solid var(--documents-el-surface);
|
|
77
77
|
border-radius: 9999px;
|
|
78
|
-
color: var(--
|
|
78
|
+
color: var(--documents-el-text);
|
|
79
79
|
display: inline-flex;
|
|
80
80
|
flex: none;
|
|
81
81
|
font-size: 11px;
|
|
@@ -87,153 +87,153 @@
|
|
|
87
87
|
width: 30px;
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
.
|
|
90
|
+
.documents-presence-more {
|
|
91
91
|
cursor: pointer;
|
|
92
92
|
transition:
|
|
93
93
|
background-color 160ms ease,
|
|
94
94
|
color 160ms ease;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
.
|
|
98
|
-
background-color: color-mix(in srgb, var(--
|
|
99
|
-
color: var(--
|
|
97
|
+
.documents-presence-more:hover {
|
|
98
|
+
background-color: color-mix(in srgb, var(--documents-el-accent) 22%, var(--documents-el-surface));
|
|
99
|
+
color: var(--documents-el-accent);
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
.
|
|
103
|
-
--
|
|
104
|
-
--
|
|
105
|
-
padding: var(--
|
|
102
|
+
.documents-paged-page-padding {
|
|
103
|
+
--documents-pad-v: 0.42in;
|
|
104
|
+
--documents-pad-h: 0.38in;
|
|
105
|
+
padding: var(--documents-pad-v) var(--documents-pad-h);
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
@media (min-width: 640px) {
|
|
109
|
-
.
|
|
110
|
-
--
|
|
111
|
-
--
|
|
109
|
+
.documents-paged-page-padding {
|
|
110
|
+
--documents-pad-v: 0.55in;
|
|
111
|
+
--documents-pad-h: 0.65in;
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
@media (min-width: 1024px) {
|
|
116
|
-
.
|
|
117
|
-
--
|
|
118
|
-
--
|
|
116
|
+
.documents-paged-page-padding {
|
|
117
|
+
--documents-pad-v: 0.62in;
|
|
118
|
+
--documents-pad-h: 0.75in;
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
.
|
|
122
|
+
.documents-paged-editor-font {
|
|
123
123
|
font-size: 11pt;
|
|
124
124
|
line-height: 1.4;
|
|
125
|
-
color: var(--
|
|
125
|
+
color: var(--documents-editor-paper-text);
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
@media (max-width: 640px) {
|
|
129
|
-
.
|
|
129
|
+
.documents-paged-editor-font {
|
|
130
130
|
font-size: 16px;
|
|
131
131
|
line-height: 1.6;
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
/* Tiptap ProseMirror canvas */
|
|
136
|
-
.
|
|
137
|
-
.
|
|
138
|
-
.
|
|
136
|
+
.documents-paged-editor .ProseMirror,
|
|
137
|
+
.documents-paged-editor .tiptap.ProseMirror,
|
|
138
|
+
.documents-paged-editor .documents-tiptap-editor {
|
|
139
139
|
outline: none;
|
|
140
140
|
min-height: 1.6em;
|
|
141
141
|
caret-color: #000;
|
|
142
|
-
color: var(--
|
|
142
|
+
color: var(--documents-editor-paper-text);
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
-
.
|
|
146
|
-
.
|
|
147
|
-
.
|
|
148
|
-
.
|
|
149
|
-
.
|
|
150
|
-
.
|
|
151
|
-
.
|
|
152
|
-
.
|
|
145
|
+
.documents-paged-editor .ProseMirror p,
|
|
146
|
+
.documents-paged-editor .ProseMirror li,
|
|
147
|
+
.documents-paged-editor .ProseMirror h1,
|
|
148
|
+
.documents-paged-editor .ProseMirror h2,
|
|
149
|
+
.documents-paged-editor .ProseMirror h3,
|
|
150
|
+
.documents-paged-editor .ProseMirror h4,
|
|
151
|
+
.documents-paged-editor .ProseMirror h5,
|
|
152
|
+
.documents-paged-editor .ProseMirror h6 {
|
|
153
153
|
margin: 0 0 0.45em;
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
-
.
|
|
156
|
+
.documents-paged-editor .ProseMirror h1 {
|
|
157
157
|
font-size: 1.9em;
|
|
158
158
|
font-weight: 700;
|
|
159
159
|
line-height: 1.2;
|
|
160
160
|
margin-top: 0.2em;
|
|
161
161
|
}
|
|
162
|
-
.
|
|
162
|
+
.documents-paged-editor .ProseMirror h2 {
|
|
163
163
|
font-size: 1.5em;
|
|
164
164
|
font-weight: 700;
|
|
165
165
|
line-height: 1.25;
|
|
166
166
|
margin-top: 0.15em;
|
|
167
167
|
}
|
|
168
|
-
.
|
|
168
|
+
.documents-paged-editor .ProseMirror h3 {
|
|
169
169
|
font-size: 1.25em;
|
|
170
170
|
font-weight: 600;
|
|
171
171
|
line-height: 1.3;
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
-
.
|
|
175
|
-
border-left: 3px solid var(--
|
|
174
|
+
.documents-paged-editor .ProseMirror blockquote {
|
|
175
|
+
border-left: 3px solid var(--documents-el-line);
|
|
176
176
|
margin: 0.5em 0;
|
|
177
177
|
padding: 0.1em 0.85em;
|
|
178
|
-
color: var(--
|
|
178
|
+
color: var(--documents-editor-paper-muted);
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
-
.
|
|
182
|
-
.
|
|
181
|
+
.documents-paged-editor .ProseMirror ul,
|
|
182
|
+
.documents-paged-editor .ProseMirror ol {
|
|
183
183
|
padding-left: 1.4em;
|
|
184
184
|
margin: 0 0 0.45em;
|
|
185
185
|
}
|
|
186
186
|
|
|
187
|
-
.
|
|
187
|
+
.documents-paged-editor .ProseMirror ul[data-type='taskList'] {
|
|
188
188
|
list-style: none;
|
|
189
189
|
padding: 0;
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
-
.
|
|
192
|
+
.documents-paged-editor .ProseMirror ul[data-type='taskList'] li {
|
|
193
193
|
align-items: flex-start;
|
|
194
194
|
display: flex;
|
|
195
195
|
gap: 0.5em;
|
|
196
196
|
}
|
|
197
197
|
|
|
198
|
-
.
|
|
198
|
+
.documents-paged-editor .ProseMirror ul[data-type='taskList'] li > label {
|
|
199
199
|
flex: none;
|
|
200
200
|
margin-top: 0.25em;
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
-
.
|
|
203
|
+
.documents-paged-editor .ProseMirror hr {
|
|
204
204
|
border: none;
|
|
205
|
-
border-top: 1px solid var(--
|
|
205
|
+
border-top: 1px solid var(--documents-el-line);
|
|
206
206
|
margin: 1em 0;
|
|
207
207
|
}
|
|
208
208
|
|
|
209
|
-
.
|
|
210
|
-
color: var(--
|
|
209
|
+
.documents-paged-editor .ProseMirror a {
|
|
210
|
+
color: var(--documents-el-accent);
|
|
211
211
|
text-decoration: underline;
|
|
212
212
|
text-underline-offset: 2px;
|
|
213
213
|
}
|
|
214
214
|
|
|
215
|
-
.
|
|
216
|
-
background-color: color-mix(in srgb, var(--
|
|
215
|
+
.documents-paged-editor .ProseMirror code {
|
|
216
|
+
background-color: color-mix(in srgb, var(--documents-el-muted) 14%, transparent);
|
|
217
217
|
border-radius: 3px;
|
|
218
218
|
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
|
219
219
|
font-size: 0.9em;
|
|
220
220
|
padding: 0.1em 0.3em;
|
|
221
221
|
}
|
|
222
222
|
|
|
223
|
-
.
|
|
224
|
-
.
|
|
223
|
+
.documents-paged-editor .ProseMirror mark,
|
|
224
|
+
.documents-paged-editor .ProseMirror .documents-text-highlight {
|
|
225
225
|
background-color: #bfdbfe;
|
|
226
|
-
color: var(--
|
|
226
|
+
color: var(--documents-editor-paper-text);
|
|
227
227
|
}
|
|
228
228
|
|
|
229
|
-
.
|
|
230
|
-
.
|
|
231
|
-
color: var(--
|
|
229
|
+
.documents-paged-editor .ProseMirror mark *,
|
|
230
|
+
.documents-paged-editor .ProseMirror .documents-text-highlight * {
|
|
231
|
+
color: var(--documents-editor-paper-text) !important;
|
|
232
232
|
}
|
|
233
233
|
|
|
234
234
|
/* Placeholder (from @tiptap/extension-placeholder) — applied to the first empty paragraph. */
|
|
235
|
-
.
|
|
236
|
-
color: var(--
|
|
235
|
+
.documents-paged-editor .ProseMirror p.is-editor-empty:first-child::before {
|
|
236
|
+
color: var(--documents-editor-paper-muted);
|
|
237
237
|
content: attr(data-placeholder);
|
|
238
238
|
float: left;
|
|
239
239
|
height: 0;
|
|
@@ -241,7 +241,7 @@
|
|
|
241
241
|
}
|
|
242
242
|
|
|
243
243
|
/* Soft page break: decoration spacer that fills the rest of the current page. */
|
|
244
|
-
.
|
|
244
|
+
.documents-soft-page-break {
|
|
245
245
|
display: block;
|
|
246
246
|
flex: none;
|
|
247
247
|
width: 100%;
|
|
@@ -250,7 +250,7 @@
|
|
|
250
250
|
}
|
|
251
251
|
|
|
252
252
|
@media print {
|
|
253
|
-
.
|
|
253
|
+
.documents-soft-page-break {
|
|
254
254
|
display: none !important;
|
|
255
255
|
}
|
|
256
256
|
}
|
|
@@ -289,15 +289,15 @@
|
|
|
289
289
|
|
|
290
290
|
/*
|
|
291
291
|
* Print: the on-screen editor inherits the host theme's foreground color via
|
|
292
|
-
* --
|
|
292
|
+
* --documents-el-text (often a light gray on dark themes), but the print canvas is
|
|
293
293
|
* forced to white. Without this override, the printed page comes out blank.
|
|
294
294
|
*/
|
|
295
295
|
@media print {
|
|
296
|
-
.
|
|
296
|
+
.documents-paged-page-face {
|
|
297
297
|
background-color: #ffffff !important;
|
|
298
298
|
}
|
|
299
|
-
.
|
|
300
|
-
color: var(--
|
|
299
|
+
.documents-paged-editor {
|
|
300
|
+
color: var(--documents-editor-paper-text) !important;
|
|
301
301
|
}
|
|
302
302
|
.collaboration-carets__caret,
|
|
303
303
|
.collaboration-carets__label {
|
|
@@ -53,14 +53,14 @@ function makeSoftPageBreakDecorations(editor: Editor, breaks: SoftPageBreak[]) {
|
|
|
53
53
|
Math.min(pageBreak.pos, docSize),
|
|
54
54
|
() => {
|
|
55
55
|
const spacer = document.createElement('span')
|
|
56
|
-
spacer.className = '
|
|
56
|
+
spacer.className = 'documents-soft-page-break'
|
|
57
57
|
spacer.style.height = `${pageBreak.height}px`
|
|
58
58
|
spacer.contentEditable = 'false'
|
|
59
59
|
spacer.setAttribute('aria-hidden', 'true')
|
|
60
60
|
return spacer
|
|
61
61
|
},
|
|
62
62
|
{
|
|
63
|
-
key: `
|
|
63
|
+
key: `documents-page-break-${index}-${pageBreak.pos}-${Math.round(pageBreak.height)}`,
|
|
64
64
|
side: 1,
|
|
65
65
|
ignoreSelection: true,
|
|
66
66
|
},
|
|
@@ -112,7 +112,7 @@ export function DocEditorSurface({ editor, onPageCountChange }: DocEditorSurface
|
|
|
112
112
|
const refreshDecorations = () => {
|
|
113
113
|
if (!viewIsAlive()) return
|
|
114
114
|
view.dispatch(
|
|
115
|
-
view.state.tr.setMeta('addToHistory', false).setMeta('
|
|
115
|
+
view.state.tr.setMeta('addToHistory', false).setMeta('documentsPagination', true),
|
|
116
116
|
)
|
|
117
117
|
}
|
|
118
118
|
|
|
@@ -145,7 +145,7 @@ export function DocEditorSurface({ editor, onPageCountChange }: DocEditorSurface
|
|
|
145
145
|
rafRef.current = requestAnimationFrame(() => {
|
|
146
146
|
rafRef.current = undefined
|
|
147
147
|
if (!viewIsAlive()) return
|
|
148
|
-
const shell = dom.closest<HTMLElement>('.
|
|
148
|
+
const shell = dom.closest<HTMLElement>('.documents-paged-content')
|
|
149
149
|
if (!shell) return
|
|
150
150
|
|
|
151
151
|
const shellStyle = window.getComputedStyle(shell)
|
|
@@ -225,27 +225,27 @@ export function DocEditorSurface({ editor, onPageCountChange }: DocEditorSurface
|
|
|
225
225
|
const stackHeight = pageCount * PAGE_HEIGHT_PX + Math.max(0, pageCount - 1) * GAP_PX
|
|
226
226
|
|
|
227
227
|
return (
|
|
228
|
-
<div className="
|
|
229
|
-
<div className="
|
|
228
|
+
<div className="documents-paged-editor-canvas h-full min-h-0 w-full flex-1 overflow-y-auto overflow-x-hidden overscroll-y-contain print:block print:!h-auto print:!overflow-visible print:!bg-white">
|
|
229
|
+
<div className="documents-paged-inner pointer-events-auto mx-auto w-full max-w-full px-2 py-3 sm:px-3 sm:py-4 md:py-5">
|
|
230
230
|
<div
|
|
231
|
-
className="
|
|
231
|
+
className="documents-paged-page-frame relative mx-auto"
|
|
232
232
|
style={{ width: `${PAGE_W_IN}in`, maxWidth: '100%' }}
|
|
233
233
|
>
|
|
234
|
-
<div className="
|
|
234
|
+
<div className="documents-paged-page-stack relative" style={{ minHeight: `${stackHeight}px` }}>
|
|
235
235
|
{Array.from({ length: pageCount }, (_, index) => (
|
|
236
236
|
<div
|
|
237
237
|
key={index}
|
|
238
|
-
className="
|
|
238
|
+
className="documents-paged-page-face documents-editor-paper pointer-events-none absolute left-0 top-0 h-[11in] w-full rounded-sm print:static print:h-auto print:shadow-none print:border-0"
|
|
239
239
|
style={{ transform: `translateY(${index * PAGE_STRIDE_PX}px)` }}
|
|
240
240
|
/>
|
|
241
241
|
))}
|
|
242
242
|
<div
|
|
243
|
-
className="
|
|
243
|
+
className="documents-paged-content documents-paged-page-padding relative z-10 box-border"
|
|
244
244
|
style={{ maxWidth: '100%', minHeight: `${stackHeight}px` }}
|
|
245
245
|
>
|
|
246
246
|
<EditorContent
|
|
247
247
|
editor={editor}
|
|
248
|
-
className="
|
|
248
|
+
className="documents-paged-editor documents-paged-editor-font tiptap"
|
|
249
249
|
data-testid="editor-content"
|
|
250
250
|
/>
|
|
251
251
|
</div>
|
|
@@ -60,7 +60,7 @@ const HIGHLIGHT_OPTIONS = [
|
|
|
60
60
|
|
|
61
61
|
function Divider() {
|
|
62
62
|
return (
|
|
63
|
-
<div className="mx-1 h-6 w-px self-center" style={{ backgroundColor: 'var(--
|
|
63
|
+
<div className="mx-1 h-6 w-px self-center" style={{ backgroundColor: 'var(--documents-el-line)' }} />
|
|
64
64
|
)
|
|
65
65
|
}
|
|
66
66
|
|
|
@@ -90,9 +90,9 @@ function ToolbarButton({
|
|
|
90
90
|
: 'hover:bg-black/[0.06] dark:hover:bg-white/[0.08]'
|
|
91
91
|
}`}
|
|
92
92
|
style={{
|
|
93
|
-
color: active ? 'var(--
|
|
93
|
+
color: active ? 'var(--documents-el-accent)' : 'var(--documents-el-muted)',
|
|
94
94
|
backgroundColor: active
|
|
95
|
-
? 'color-mix(in srgb, var(--
|
|
95
|
+
? 'color-mix(in srgb, var(--documents-el-accent) 14%, transparent)'
|
|
96
96
|
: undefined,
|
|
97
97
|
}}
|
|
98
98
|
>
|
|
@@ -101,7 +101,7 @@ function ToolbarButton({
|
|
|
101
101
|
)
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
export interface
|
|
104
|
+
export interface DocumentsTiptapToolbarProps {
|
|
105
105
|
editor: Editor | null
|
|
106
106
|
disabled?: boolean
|
|
107
107
|
canvasZoom: number
|
|
@@ -126,12 +126,12 @@ const EMPTY_TOOLBAR_STATE = {
|
|
|
126
126
|
alignRight: false,
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
export function
|
|
129
|
+
export function DocumentsTiptapToolbar({
|
|
130
130
|
editor,
|
|
131
131
|
disabled,
|
|
132
132
|
canvasZoom,
|
|
133
133
|
onCanvasZoomChange,
|
|
134
|
-
}:
|
|
134
|
+
}: DocumentsTiptapToolbarProps) {
|
|
135
135
|
const [zoomOpen, setZoomOpen] = useState(false)
|
|
136
136
|
const [colorOpen, setColorOpen] = useState(false)
|
|
137
137
|
const [highlightOpen, setHighlightOpen] = useState(false)
|
|
@@ -194,8 +194,8 @@ export function DocsTiptapToolbar({
|
|
|
194
194
|
data-testid="editor-toolbar"
|
|
195
195
|
className="sticky top-0 z-10 flex flex-wrap items-center gap-0.5 border-b px-3 py-1.5 print:hidden"
|
|
196
196
|
style={{
|
|
197
|
-
borderColor: 'var(--
|
|
198
|
-
backgroundColor: 'color-mix(in srgb, var(--
|
|
197
|
+
borderColor: 'var(--documents-el-line)',
|
|
198
|
+
backgroundColor: 'color-mix(in srgb, var(--documents-el-surface) 96%, transparent)',
|
|
199
199
|
}}
|
|
200
200
|
>
|
|
201
201
|
<ToolbarButton
|
|
@@ -288,7 +288,7 @@ export function DocsTiptapToolbar({
|
|
|
288
288
|
}}
|
|
289
289
|
disabled={formattingLocked}
|
|
290
290
|
className="flex items-center gap-1 rounded px-2 py-1 text-sm transition-colors hover:bg-black/[0.05] disabled:cursor-not-allowed disabled:opacity-40 dark:hover:bg-white/[0.06]"
|
|
291
|
-
style={{ color: 'var(--
|
|
291
|
+
style={{ color: 'var(--documents-el-muted)' }}
|
|
292
292
|
title="Text color"
|
|
293
293
|
>
|
|
294
294
|
<Palette className="h-3.5 w-3.5" />
|
|
@@ -307,8 +307,8 @@ export function DocsTiptapToolbar({
|
|
|
307
307
|
<div
|
|
308
308
|
className="absolute left-0 top-full z-50 mt-1 grid w-[9.5rem] grid-cols-4 gap-1 rounded-lg border p-2 shadow-lg"
|
|
309
309
|
style={{
|
|
310
|
-
borderColor: 'var(--
|
|
311
|
-
backgroundColor: 'var(--
|
|
310
|
+
borderColor: 'var(--documents-el-line)',
|
|
311
|
+
backgroundColor: 'var(--documents-el-surface)',
|
|
312
312
|
}}
|
|
313
313
|
>
|
|
314
314
|
{TEXT_COLOR_OPTIONS.map(({ label, value }) => (
|
|
@@ -326,7 +326,7 @@ export function DocsTiptapToolbar({
|
|
|
326
326
|
className="h-7 w-7 rounded-full border transition-transform hover:scale-105"
|
|
327
327
|
style={{
|
|
328
328
|
backgroundColor: value || 'transparent',
|
|
329
|
-
borderColor: 'var(--
|
|
329
|
+
borderColor: 'var(--documents-el-line)',
|
|
330
330
|
}}
|
|
331
331
|
/>
|
|
332
332
|
))}
|
|
@@ -346,7 +346,7 @@ export function DocsTiptapToolbar({
|
|
|
346
346
|
}}
|
|
347
347
|
disabled={formattingLocked}
|
|
348
348
|
className="flex items-center gap-1 rounded px-2 py-1 text-sm transition-colors hover:bg-black/[0.05] disabled:cursor-not-allowed disabled:opacity-40 dark:hover:bg-white/[0.06]"
|
|
349
|
-
style={{ color: 'var(--
|
|
349
|
+
style={{ color: 'var(--documents-el-muted)' }}
|
|
350
350
|
title="Highlight"
|
|
351
351
|
>
|
|
352
352
|
<Highlighter className="h-3.5 w-3.5" />
|
|
@@ -365,8 +365,8 @@ export function DocsTiptapToolbar({
|
|
|
365
365
|
<div
|
|
366
366
|
className="absolute left-0 top-full z-50 mt-1 grid w-[9.5rem] grid-cols-4 gap-1 rounded-lg border p-2 shadow-lg"
|
|
367
367
|
style={{
|
|
368
|
-
borderColor: 'var(--
|
|
369
|
-
backgroundColor: 'var(--
|
|
368
|
+
borderColor: 'var(--documents-el-line)',
|
|
369
|
+
backgroundColor: 'var(--documents-el-surface)',
|
|
370
370
|
}}
|
|
371
371
|
>
|
|
372
372
|
{HIGHLIGHT_OPTIONS.map(({ label, value }) => (
|
|
@@ -384,7 +384,7 @@ export function DocsTiptapToolbar({
|
|
|
384
384
|
className="h-7 w-7 rounded-full border transition-transform hover:scale-105"
|
|
385
385
|
style={{
|
|
386
386
|
backgroundColor: value || 'transparent',
|
|
387
|
-
borderColor: 'var(--
|
|
387
|
+
borderColor: 'var(--documents-el-line)',
|
|
388
388
|
}}
|
|
389
389
|
/>
|
|
390
390
|
))}
|
|
@@ -509,7 +509,7 @@ export function DocsTiptapToolbar({
|
|
|
509
509
|
type="button"
|
|
510
510
|
onClick={() => setZoomOpen(!zoomOpen)}
|
|
511
511
|
className="flex min-w-[3.25rem] items-center gap-1 rounded px-2 py-1 text-sm tabular-nums transition-colors hover:bg-black/[0.05] dark:hover:bg-white/[0.06]"
|
|
512
|
-
style={{ color: 'var(--
|
|
512
|
+
style={{ color: 'var(--documents-el-muted)' }}
|
|
513
513
|
>
|
|
514
514
|
{normalizedZoom}
|
|
515
515
|
<svg className="h-3 w-3 shrink-0" viewBox="0 0 12 12" fill="currentColor" aria-hidden>
|
|
@@ -527,8 +527,8 @@ export function DocsTiptapToolbar({
|
|
|
527
527
|
<div
|
|
528
528
|
className="absolute right-0 top-full z-50 mt-1 min-w-[7rem] overflow-y-auto rounded-lg border py-1 shadow-lg"
|
|
529
529
|
style={{
|
|
530
|
-
borderColor: 'var(--
|
|
531
|
-
backgroundColor: 'var(--
|
|
530
|
+
borderColor: 'var(--documents-el-line)',
|
|
531
|
+
backgroundColor: 'var(--documents-el-surface)',
|
|
532
532
|
}}
|
|
533
533
|
>
|
|
534
534
|
{ZOOM_PRESETS.map(({ label, value }) => (
|
|
@@ -543,8 +543,8 @@ export function DocsTiptapToolbar({
|
|
|
543
543
|
style={{
|
|
544
544
|
color:
|
|
545
545
|
Math.abs(canvasZoom - value) < 0.001
|
|
546
|
-
? 'var(--
|
|
547
|
-
: 'var(--
|
|
546
|
+
? 'var(--documents-el-accent)'
|
|
547
|
+
: 'var(--documents-el-text)',
|
|
548
548
|
fontWeight: Math.abs(canvasZoom - value) < 0.001 ? 600 : 400,
|
|
549
549
|
}}
|
|
550
550
|
>
|
|
@@ -75,7 +75,7 @@ function renderCollaborationCaret(user: CollaborationUser): HTMLElement {
|
|
|
75
75
|
|
|
76
76
|
const label = document.createElement('span')
|
|
77
77
|
label.classList.add('collaboration-carets__label')
|
|
78
|
-
label.style.backgroundColor = `color-mix(in srgb, ${color} 16%, var(--
|
|
78
|
+
label.style.backgroundColor = `color-mix(in srgb, ${color} 16%, var(--documents-editor-paper))`
|
|
79
79
|
label.style.color = color
|
|
80
80
|
label.textContent = user.name || 'Collaborator'
|
|
81
81
|
cursor.appendChild(label)
|
|
@@ -144,7 +144,7 @@ export function useDocEditor({
|
|
|
144
144
|
Color,
|
|
145
145
|
Highlight.configure({
|
|
146
146
|
multicolor: true,
|
|
147
|
-
HTMLAttributes: { class: '
|
|
147
|
+
HTMLAttributes: { class: 'documents-text-highlight' },
|
|
148
148
|
}),
|
|
149
149
|
Subscript,
|
|
150
150
|
Superscript,
|
|
@@ -184,8 +184,8 @@ export function useDocEditor({
|
|
|
184
184
|
editorProps: {
|
|
185
185
|
transformPastedHTML: stripCollaborationArtifactsFromHTML,
|
|
186
186
|
attributes: {
|
|
187
|
-
class: '
|
|
188
|
-
'data-testid': '
|
|
187
|
+
class: 'documents-tiptap-editor',
|
|
188
|
+
'data-testid': 'documents-tiptap-editor',
|
|
189
189
|
},
|
|
190
190
|
},
|
|
191
191
|
},
|