@openartifactsai/editor-kit 0.0.0-stage → 0.23.0-rc.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.
- package/LICENSE +202 -0
- package/NOTICE +5 -0
- package/README.md +143 -2
- package/package.json +67 -4
- package/src/Announcer.d.ts +2 -0
- package/src/Announcer.js +8 -0
- package/src/FindBar.d.ts +31 -0
- package/src/FindBar.js +37 -0
- package/src/FoldToolbar.d.ts +58 -0
- package/src/FoldToolbar.js +438 -0
- package/src/PanelEdge.d.ts +20 -0
- package/src/PanelEdge.js +74 -0
- package/src/VideoShrinkNotice.d.ts +10 -0
- package/src/VideoShrinkNotice.js +81 -0
- package/src/WheelZoomItem.d.ts +12 -0
- package/src/WheelZoomItem.js +18 -0
- package/src/agent.d.ts +68 -0
- package/src/agent.js +113 -0
- package/src/announce.d.ts +21 -0
- package/src/announce.js +31 -0
- package/src/chrome.d.ts +208 -0
- package/src/chrome.js +148 -0
- package/src/clipboard.d.ts +19 -0
- package/src/clipboard.js +48 -0
- package/src/collab/CommentList.d.ts +32 -0
- package/src/collab/CommentList.js +165 -0
- package/src/collab/CommentViews.d.ts +131 -0
- package/src/collab/CommentViews.js +619 -0
- package/src/collab/HistoryViews.d.ts +38 -0
- package/src/collab/HistoryViews.js +103 -0
- package/src/collab/PresenceViews.d.ts +53 -0
- package/src/collab/PresenceViews.js +48 -0
- package/src/collab/cds/cds.d.ts +151 -0
- package/src/collab/cds/cds.js +231 -0
- package/src/collab/cds/comment-card.d.ts +113 -0
- package/src/collab/cds/comment-card.js +230 -0
- package/src/collab/cds/comment-composer.d.ts +35 -0
- package/src/collab/cds/comment-composer.js +125 -0
- package/src/collab/cds/comments-css.d.ts +2 -0
- package/src/collab/cds/comments-css.js +3 -0
- package/src/collab/cds/comments.css +504 -0
- package/src/collab/cds/edge-piles.d.ts +69 -0
- package/src/collab/cds/edge-piles.js +178 -0
- package/src/collab/cds/layer.d.ts +41 -0
- package/src/collab/cds/layer.js +144 -0
- package/src/collab/cds/markdown.d.ts +20 -0
- package/src/collab/cds/markdown.js +534 -0
- package/src/collab/cds/shield.d.ts +28 -0
- package/src/collab/cds/shield.js +114 -0
- package/src/collab/cds/time.d.ts +2 -0
- package/src/collab/cds/time.js +41 -0
- package/src/collab/collab.d.ts +102 -0
- package/src/collab/collab.js +121 -0
- package/src/collab/comments.d.ts +272 -0
- package/src/collab/comments.js +596 -0
- package/src/collab/history-wiring.d.ts +32 -0
- package/src/collab/history-wiring.js +53 -0
- package/src/collab/history.d.ts +59 -0
- package/src/collab/history.js +96 -0
- package/src/collab/mentions/mention-list.d.ts +63 -0
- package/src/collab/mentions/mention-list.js +257 -0
- package/src/collab/mentions.d.ts +112 -0
- package/src/collab/mentions.js +164 -0
- package/src/collab/peer-colors.d.ts +123 -0
- package/src/collab/peer-colors.js +273 -0
- package/src/collab/pins.d.ts +70 -0
- package/src/collab/pins.js +44 -0
- package/src/collab/presence.d.ts +92 -0
- package/src/collab/presence.js +158 -0
- package/src/design-systems.d.ts +46 -0
- package/src/design-systems.js +61 -0
- package/src/downloads.d.ts +31 -0
- package/src/downloads.js +46 -0
- package/src/file-drop.d.ts +33 -0
- package/src/file-drop.js +36 -0
- package/src/find.d.ts +64 -0
- package/src/find.js +147 -0
- package/src/follow.d.ts +141 -0
- package/src/follow.js +389 -0
- package/src/index.d.ts +32 -0
- package/src/index.js +32 -0
- package/src/keys.d.ts +18 -0
- package/src/keys.js +42 -0
- package/src/menu-fit.d.ts +12 -0
- package/src/menu-fit.js +9 -0
- package/src/merge.d.ts +23 -0
- package/src/merge.js +116 -0
- package/src/page-link.d.ts +33 -0
- package/src/page-link.js +75 -0
- package/src/project-sync.d.ts +161 -0
- package/src/project-sync.js +319 -0
- package/src/react.d.ts +20 -0
- package/src/react.js +20 -0
- package/src/read-retries.d.ts +55 -0
- package/src/read-retries.js +125 -0
- package/src/right-drag-pan.d.ts +128 -0
- package/src/right-drag-pan.js +253 -0
- package/src/roles.d.ts +39 -0
- package/src/roles.js +27 -0
- package/src/session.d.ts +56 -0
- package/src/session.js +57 -0
- package/src/shell.d.ts +60 -0
- package/src/shell.js +111 -0
- package/src/stash.d.ts +26 -0
- package/src/stash.js +69 -0
- package/src/styles.css +17 -0
- package/src/toolbar-fold.d.ts +106 -0
- package/src/toolbar-fold.js +130 -0
- package/src/video-shrink/index.d.ts +8 -0
- package/src/video-shrink/index.js +7 -0
- package/src/video-shrink/plan.d.ts +92 -0
- package/src/video-shrink/plan.js +133 -0
- package/src/video-shrink/protocol.d.ts +29 -0
- package/src/video-shrink/protocol.js +2 -0
- package/src/video-shrink/queue.d.ts +69 -0
- package/src/video-shrink/queue.js +287 -0
- package/src/video-shrink/worker.d.ts +8 -0
- package/src/video-shrink/worker.js +223 -0
- package/src/wheel-zoom.d.ts +14 -0
- package/src/wheel-zoom.js +48 -0
|
@@ -0,0 +1,504 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The comments UI's stylesheet: Open Artifacts' own tokens and component rules for the comment pins, thread cards,
|
|
3
|
+
* composer, menus and list (cds/*.tsx, CommentViews.tsx, CommentList.tsx).
|
|
4
|
+
*
|
|
5
|
+
* Those views draw in a shadow root (layer.tsx), so this sheet is all the styling they get. It is compiled with the
|
|
6
|
+
* Tailwind classes they use into comments-css.ts:
|
|
7
|
+
*
|
|
8
|
+
* node packages/editor-kit/scripts/build-comments-css.mjs
|
|
9
|
+
*
|
|
10
|
+
* Run it after changing this file or a class in those views (a test checks the output is current).
|
|
11
|
+
*
|
|
12
|
+
* Tokens live on `.cds-root` (set by layer.tsx with `data-mode` light or dark and `--cds-rem-scale`), so every size
|
|
13
|
+
* follows the page's root font size and every colour follows its theme. Utilities read them through `@theme inline`.
|
|
14
|
+
*
|
|
15
|
+
* Fonts: Inter (SIL Open Font License 1.1, from @fontsource-variable/inter, declared on the page by editor-kit's
|
|
16
|
+
* styles.css, since @font-face inside a shadow root is ignored), then the system UI font. Icons are lucide (ISC).
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
@import "tailwindcss";
|
|
20
|
+
|
|
21
|
+
/* ---------- variants ---------- */
|
|
22
|
+
|
|
23
|
+
@custom-variant dark (&:where([data-mode="dark"], [data-mode="dark"] *));
|
|
24
|
+
@custom-variant compact (&:where([data-density="compact"], [data-density="compact"] *));
|
|
25
|
+
@custom-variant comfortable (&:where([data-density="comfortable"], [data-density="comfortable"] *));
|
|
26
|
+
@custom-variant touch (@media (pointer: coarse));
|
|
27
|
+
|
|
28
|
+
/* ---------- theme: utilities read the .cds-root tokens ---------- */
|
|
29
|
+
|
|
30
|
+
@theme inline {
|
|
31
|
+
--font-sans: var(--cds-font-sans);
|
|
32
|
+
--font-mono: var(--cds-font-mono);
|
|
33
|
+
--font-weight-control: 450;
|
|
34
|
+
--font-weight-badge: 500;
|
|
35
|
+
|
|
36
|
+
--text-body: var(--cds-font-size-body);
|
|
37
|
+
--text-body--line-height: var(--cds-leading-body);
|
|
38
|
+
--text-caption: var(--cds-font-size-caption);
|
|
39
|
+
--text-caption--line-height: var(--cds-leading-caption);
|
|
40
|
+
--text-footnote: var(--cds-font-size-footnote);
|
|
41
|
+
--text-footnote--line-height: var(--cds-leading-footnote);
|
|
42
|
+
--text-code: var(--cds-font-size-code);
|
|
43
|
+
--text-code--line-height: var(--cds-leading-code);
|
|
44
|
+
|
|
45
|
+
--spacing-xs: var(--cds-pad-xs);
|
|
46
|
+
--spacing-sm: var(--cds-pad-sm);
|
|
47
|
+
--spacing-md: var(--cds-pad-md);
|
|
48
|
+
--spacing-lg: var(--cds-pad-lg);
|
|
49
|
+
--spacing-xl: var(--cds-pad-xl);
|
|
50
|
+
--spacing-pad-xs: var(--cds-pad-xs);
|
|
51
|
+
--spacing-control: var(--cds-h-control);
|
|
52
|
+
--spacing-control-nested: var(--cds-h-control-nested);
|
|
53
|
+
--spacing-icon: var(--cds-icon);
|
|
54
|
+
/* Gaps have their own, slightly larger steps. */
|
|
55
|
+
--gap-xs: var(--cds-gap-xs);
|
|
56
|
+
--gap-sm: var(--cds-gap-sm);
|
|
57
|
+
|
|
58
|
+
--radius: var(--cds-radius);
|
|
59
|
+
--radius-card: var(--cds-radius-card);
|
|
60
|
+
--radius-chip: var(--cds-radius-chip);
|
|
61
|
+
|
|
62
|
+
--ease-snap: var(--cds-ease-snap);
|
|
63
|
+
|
|
64
|
+
/* Text */
|
|
65
|
+
--color-primary: var(--cds-text-primary);
|
|
66
|
+
--color-secondary: var(--cds-text-secondary);
|
|
67
|
+
--color-muted: var(--cds-text-muted);
|
|
68
|
+
--color-accent: var(--cds-text-accent);
|
|
69
|
+
--color-danger: var(--cds-text-danger);
|
|
70
|
+
--color-on-primary: var(--cds-on-primary);
|
|
71
|
+
--color-on-accent: var(--cds-on-accent);
|
|
72
|
+
--color-on-danger: var(--cds-on-danger);
|
|
73
|
+
--color-on-brand: var(--cds-on-brand);
|
|
74
|
+
|
|
75
|
+
/* Surfaces and fills */
|
|
76
|
+
--color-surface-1: var(--cds-surface-1);
|
|
77
|
+
--color-surface-2: var(--cds-surface-2);
|
|
78
|
+
--color-surface-3: var(--cds-surface-3);
|
|
79
|
+
--color-surface-popover: var(--cds-surface-popover);
|
|
80
|
+
--color-fill-primary: var(--cds-fill-primary);
|
|
81
|
+
--color-fill-primary-hover: var(--cds-fill-primary-hover);
|
|
82
|
+
--color-fill-secondary: var(--cds-fill-secondary);
|
|
83
|
+
--color-fill-secondary-hover: var(--cds-fill-secondary-hover);
|
|
84
|
+
--color-fill-ghost-hover: var(--cds-fill-ghost-hover);
|
|
85
|
+
--color-fill-danger: var(--cds-fill-danger);
|
|
86
|
+
--color-fill-danger-hover: var(--cds-fill-danger-hover);
|
|
87
|
+
--color-fill-accent: var(--cds-fill-accent);
|
|
88
|
+
--color-fill-accent-hover: var(--cds-fill-accent-hover);
|
|
89
|
+
--color-fill-brand: var(--cds-fill-brand);
|
|
90
|
+
--color-fill-control: var(--cds-fill-control);
|
|
91
|
+
--color-fill-field: var(--cds-fill-field);
|
|
92
|
+
--color-fill-disabled: var(--cds-fill-disabled);
|
|
93
|
+
--color-tint-blue: var(--cds-tint-accent);
|
|
94
|
+
--color-alpha-1: var(--cds-alpha-1);
|
|
95
|
+
--color-neutral: var(--cds-neutral);
|
|
96
|
+
|
|
97
|
+
/* Lines */
|
|
98
|
+
--color-border: var(--cds-border);
|
|
99
|
+
--color-strong: var(--cds-border-strong);
|
|
100
|
+
--color-stronger: var(--cds-border-stronger);
|
|
101
|
+
|
|
102
|
+
--shadow-panel: var(--cds-shadow-panel);
|
|
103
|
+
--shadow-panel-sm: var(--cds-shadow-panel-sm);
|
|
104
|
+
--shadow-field: var(--cds-shadow-field);
|
|
105
|
+
--shadow-field-pressed: var(--cds-shadow-field-pressed);
|
|
106
|
+
--shadow-field-ring: var(--cds-shadow-field);
|
|
107
|
+
--shadow-field-hover: var(--cds-shadow-field-hover);
|
|
108
|
+
--shadow-field-invalid: var(--cds-shadow-field-invalid);
|
|
109
|
+
--shadow-focus: var(--cds-focus-shadow);
|
|
110
|
+
--shadow-focus-danger: var(--cds-focus-shadow-danger);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/* ---------- utilities with no theme scale ---------- */
|
|
114
|
+
|
|
115
|
+
@utility duration-fast {
|
|
116
|
+
transition-duration: var(--cds-dur-fast);
|
|
117
|
+
}
|
|
118
|
+
@utility duration-snap {
|
|
119
|
+
transition-duration: var(--cds-dur-snap);
|
|
120
|
+
}
|
|
121
|
+
@utility opacity-disabled {
|
|
122
|
+
opacity: 0.45;
|
|
123
|
+
}
|
|
124
|
+
@utility cursor-interactive {
|
|
125
|
+
cursor: var(--cds-cursor-interactive);
|
|
126
|
+
}
|
|
127
|
+
@utility draggable-none {
|
|
128
|
+
-webkit-user-drag: none;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/* A scroller whose edges fade while there is more to scroll that way (scroll-driven, where supported). */
|
|
132
|
+
@property --cds-fade-top {
|
|
133
|
+
syntax: "<length>";
|
|
134
|
+
inherits: false;
|
|
135
|
+
initial-value: 0px;
|
|
136
|
+
}
|
|
137
|
+
@property --cds-fade-bottom {
|
|
138
|
+
syntax: "<length>";
|
|
139
|
+
inherits: false;
|
|
140
|
+
initial-value: 0px;
|
|
141
|
+
}
|
|
142
|
+
@utility scroll-fade-y {
|
|
143
|
+
@supports (animation-timeline: scroll()) {
|
|
144
|
+
mask-image: linear-gradient(
|
|
145
|
+
to bottom,
|
|
146
|
+
transparent,
|
|
147
|
+
#000 calc(var(--cds-fade-top) * var(--cds-fade-top-on, 1)),
|
|
148
|
+
#000 calc(100% - var(--cds-fade-bottom)),
|
|
149
|
+
transparent
|
|
150
|
+
);
|
|
151
|
+
animation-name: cds-fade-top, cds-fade-bottom;
|
|
152
|
+
animation-timing-function: linear;
|
|
153
|
+
animation-fill-mode: both;
|
|
154
|
+
animation-timeline: scroll(self y);
|
|
155
|
+
animation-range:
|
|
156
|
+
0 var(--cds-fade-size, 0.75rem),
|
|
157
|
+
calc(100% - var(--cds-fade-size, 0.75rem)) 100%;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
@utility scroll-fade-hide-top {
|
|
161
|
+
--cds-fade-top-on: 0;
|
|
162
|
+
}
|
|
163
|
+
@utility scroll-fade-size-4 {
|
|
164
|
+
--cds-fade-size: calc(var(--spacing) * 4);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/* A text box that has reached its height cap: it scrolls, with a thin bar, and does not scroll the card behind it. */
|
|
168
|
+
@utility scroll-thin {
|
|
169
|
+
overflow-y: auto;
|
|
170
|
+
overscroll-behavior: contain;
|
|
171
|
+
scrollbar-width: thin;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/* ---------- tokens ---------- */
|
|
175
|
+
|
|
176
|
+
@layer base {
|
|
177
|
+
.cds-root {
|
|
178
|
+
--cds-font-sans:
|
|
179
|
+
"Inter Variable", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
|
|
180
|
+
"PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
|
|
181
|
+
--cds-font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
|
|
182
|
+
|
|
183
|
+
/* Sizes, all scaled with the page's root font size. */
|
|
184
|
+
--cds-font-size-body: calc(0.8125rem * var(--cds-rem-scale, 1));
|
|
185
|
+
--cds-leading-body: calc(1.25rem * var(--cds-rem-scale, 1));
|
|
186
|
+
--cds-font-size-caption: calc(0.6875rem * var(--cds-rem-scale, 1));
|
|
187
|
+
--cds-leading-caption: calc(1rem * var(--cds-rem-scale, 1));
|
|
188
|
+
--cds-font-size-footnote: calc(0.75rem * var(--cds-rem-scale, 1));
|
|
189
|
+
--cds-leading-footnote: calc(1rem * var(--cds-rem-scale, 1));
|
|
190
|
+
--cds-font-size-code: calc(0.75rem * var(--cds-rem-scale, 1));
|
|
191
|
+
--cds-leading-code: calc(1.125rem * var(--cds-rem-scale, 1));
|
|
192
|
+
|
|
193
|
+
--cds-pad-xs: calc(0.25rem * var(--cds-rem-scale, 1));
|
|
194
|
+
--cds-pad-sm: calc(0.375rem * var(--cds-rem-scale, 1));
|
|
195
|
+
--cds-pad-md: calc(0.5rem * var(--cds-rem-scale, 1));
|
|
196
|
+
--cds-pad-lg: calc(0.75rem * var(--cds-rem-scale, 1));
|
|
197
|
+
--cds-pad-xl: calc(1.25rem * var(--cds-rem-scale, 1));
|
|
198
|
+
--cds-gap-xs: calc(0.375rem * var(--cds-rem-scale, 1));
|
|
199
|
+
--cds-gap-sm: calc(0.5rem * var(--cds-rem-scale, 1));
|
|
200
|
+
|
|
201
|
+
--cds-h-control: calc(1.75rem * var(--cds-rem-scale, 1));
|
|
202
|
+
--cds-h-control-nested: calc(1.25rem * var(--cds-rem-scale, 1));
|
|
203
|
+
--cds-icon: calc(1rem * var(--cds-rem-scale, 1));
|
|
204
|
+
--cds-avatar-sm: calc(1.25rem * var(--cds-rem-scale, 1));
|
|
205
|
+
--cds-avatar-md: calc(1.75rem * var(--cds-rem-scale, 1));
|
|
206
|
+
--cds-checkbox: calc(1rem * var(--cds-rem-scale, 1));
|
|
207
|
+
--cds-checkbox--sm: calc(1rem * var(--cds-rem-scale, 1));
|
|
208
|
+
--cds-checkbox-glyph: calc(0.75rem * var(--cds-rem-scale, 1));
|
|
209
|
+
--cds-checkbox-radius: calc(0.25rem * var(--cds-rem-scale, 1));
|
|
210
|
+
--cds-radius: calc(0.4375rem * var(--cds-rem-scale, 1));
|
|
211
|
+
--cds-radius-card: calc(0.75rem * var(--cds-rem-scale, 1));
|
|
212
|
+
--cds-radius-chip: calc(0.3125rem * var(--cds-rem-scale, 1));
|
|
213
|
+
--cds-menu-gutter: calc(0.25rem * var(--cds-rem-scale, 1));
|
|
214
|
+
--cds-ring-inner: 1px;
|
|
215
|
+
|
|
216
|
+
--cds-cursor-interactive: pointer;
|
|
217
|
+
--cds-dur-fast: 90ms;
|
|
218
|
+
--cds-dur-snap: 160ms;
|
|
219
|
+
--cds-dur-base: 220ms;
|
|
220
|
+
--cds-dur-slow: 320ms;
|
|
221
|
+
--cds-ease-out: cubic-bezier(0.22, 0.8, 0.3, 1);
|
|
222
|
+
--cds-ease-snap: cubic-bezier(0.3, 0.7, 0.25, 1);
|
|
223
|
+
|
|
224
|
+
/* Colours: light. */
|
|
225
|
+
color-scheme: light;
|
|
226
|
+
--cds-text-primary: #1c1c1a;
|
|
227
|
+
--cds-text-secondary: #4a4a45;
|
|
228
|
+
--cds-text-muted: #7a7a73;
|
|
229
|
+
--cds-text-accent: #2563eb;
|
|
230
|
+
--cds-text-danger: #c8302c;
|
|
231
|
+
--cds-on-primary: #ffffff;
|
|
232
|
+
--cds-on-accent: #ffffff;
|
|
233
|
+
--cds-on-danger: #ffffff;
|
|
234
|
+
--cds-on-brand: #ffffff;
|
|
235
|
+
|
|
236
|
+
--cds-surface-1: #ffffff;
|
|
237
|
+
--cds-surface-2: #ffffff;
|
|
238
|
+
--cds-surface-3: #ffffff;
|
|
239
|
+
--cds-surface-popover: #ffffff;
|
|
240
|
+
--cds-page-bg: var(--cds-surface-2);
|
|
241
|
+
|
|
242
|
+
--cds-alpha-1: rgb(0 0 0 / 0.04);
|
|
243
|
+
--cds-neutral: rgb(0 0 0 / 0.045);
|
|
244
|
+
--cds-border: rgb(0 0 0 / 0.1);
|
|
245
|
+
--cds-border-strong: rgb(0 0 0 / 0.24);
|
|
246
|
+
--cds-border-stronger: rgb(0 0 0 / 0.38);
|
|
247
|
+
|
|
248
|
+
--cds-fill-primary: #2563eb;
|
|
249
|
+
--cds-fill-primary-hover: #1d4fd6;
|
|
250
|
+
--cds-fill-secondary: rgb(0 0 0 / 0.045);
|
|
251
|
+
--cds-fill-secondary-hover: rgb(0 0 0 / 0.08);
|
|
252
|
+
--cds-fill-ghost-hover: rgb(0 0 0 / 0.06);
|
|
253
|
+
--cds-fill-danger: #dc2f2a;
|
|
254
|
+
--cds-fill-danger-hover: #bf2622;
|
|
255
|
+
--cds-fill-accent: #2563eb;
|
|
256
|
+
--cds-fill-accent-hover: #1d4fd6;
|
|
257
|
+
--cds-fill-brand: #6d5cf6;
|
|
258
|
+
--cds-fill-control: rgb(0 0 0 / 0.07);
|
|
259
|
+
--cds-fill-field: #ffffff;
|
|
260
|
+
--cds-fill-disabled: rgb(0 0 0 / 0.06);
|
|
261
|
+
--cds-tint-accent: rgb(37 99 235 / 0.12);
|
|
262
|
+
--cds-tint-danger: rgb(220 47 42 / 0.1);
|
|
263
|
+
|
|
264
|
+
--cds-tooltip-bg: #1f1f1d;
|
|
265
|
+
--cds-tooltip-fg: #f7f7f5;
|
|
266
|
+
|
|
267
|
+
--cds-shadow-panel: 0 0 0 1px rgb(0 0 0 / 0.07), 0 2px 6px rgb(0 0 0 / 0.05), 0 12px 32px -8px rgb(0 0 0 / 0.18);
|
|
268
|
+
--cds-shadow-panel-sm: 0 0 0 1px rgb(0 0 0 / 0.08), 0 2px 8px -2px rgb(0 0 0 / 0.12);
|
|
269
|
+
--cds-shadow-field: inset 0 0 0 1px var(--cds-border);
|
|
270
|
+
--cds-shadow-field-hover: inset 0 0 0 1px var(--cds-border-strong);
|
|
271
|
+
--cds-shadow-field-pressed: inset 0 0 0 1px color-mix(in srgb, var(--cds-fill-accent) 45%, transparent);
|
|
272
|
+
--cds-shadow-field-invalid: inset 0 0 0 1px var(--cds-fill-danger);
|
|
273
|
+
--cds-focus-shadow:
|
|
274
|
+
inset 0 0 0 1px var(--cds-page-bg), 0 0 0 1px var(--cds-fill-accent),
|
|
275
|
+
0 0 0 3px color-mix(in srgb, var(--cds-fill-accent) 28%, transparent);
|
|
276
|
+
--cds-focus-shadow-danger:
|
|
277
|
+
inset 0 0 0 1px var(--cds-page-bg), 0 0 0 1px var(--cds-fill-danger),
|
|
278
|
+
0 0 0 3px color-mix(in srgb, var(--cds-fill-danger) 28%, transparent);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.cds-root[data-mode="dark"] {
|
|
282
|
+
color-scheme: dark;
|
|
283
|
+
--cds-text-primary: #ededea;
|
|
284
|
+
--cds-text-secondary: #c4c4be;
|
|
285
|
+
--cds-text-muted: #94948d;
|
|
286
|
+
--cds-text-accent: #7aa7ff;
|
|
287
|
+
--cds-text-danger: #ff8a80;
|
|
288
|
+
--cds-on-primary: #ffffff;
|
|
289
|
+
--cds-on-accent: #ffffff;
|
|
290
|
+
--cds-on-danger: #ffffff;
|
|
291
|
+
--cds-on-brand: #ffffff;
|
|
292
|
+
|
|
293
|
+
--cds-surface-1: #1f1f1d;
|
|
294
|
+
--cds-surface-2: #262624;
|
|
295
|
+
--cds-surface-3: #2d2d2a;
|
|
296
|
+
--cds-surface-popover: #2d2d2a;
|
|
297
|
+
|
|
298
|
+
--cds-alpha-1: rgb(255 255 255 / 0.05);
|
|
299
|
+
--cds-neutral: rgb(255 255 255 / 0.06);
|
|
300
|
+
--cds-border: rgb(255 255 255 / 0.11);
|
|
301
|
+
--cds-border-strong: rgb(255 255 255 / 0.26);
|
|
302
|
+
--cds-border-stronger: rgb(255 255 255 / 0.4);
|
|
303
|
+
|
|
304
|
+
--cds-fill-primary: #3b74f0;
|
|
305
|
+
--cds-fill-primary-hover: #5288f5;
|
|
306
|
+
--cds-fill-secondary: rgb(255 255 255 / 0.07);
|
|
307
|
+
--cds-fill-secondary-hover: rgb(255 255 255 / 0.11);
|
|
308
|
+
--cds-fill-ghost-hover: rgb(255 255 255 / 0.08);
|
|
309
|
+
--cds-fill-danger: #e0403a;
|
|
310
|
+
--cds-fill-danger-hover: #ec5751;
|
|
311
|
+
--cds-fill-accent: #3b74f0;
|
|
312
|
+
--cds-fill-accent-hover: #5288f5;
|
|
313
|
+
--cds-fill-brand: #8b7cff;
|
|
314
|
+
--cds-fill-control: rgb(255 255 255 / 0.1);
|
|
315
|
+
--cds-fill-field: rgb(255 255 255 / 0.04);
|
|
316
|
+
--cds-fill-disabled: rgb(255 255 255 / 0.07);
|
|
317
|
+
--cds-tint-accent: rgb(96 145 255 / 0.18);
|
|
318
|
+
--cds-tint-danger: rgb(255 110 100 / 0.16);
|
|
319
|
+
|
|
320
|
+
--cds-tooltip-bg: #f2f2ef;
|
|
321
|
+
--cds-tooltip-fg: #1c1c1a;
|
|
322
|
+
|
|
323
|
+
--cds-shadow-panel: 0 0 0 1px rgb(255 255 255 / 0.09), 0 2px 6px rgb(0 0 0 / 0.3), 0 14px 36px -8px rgb(0 0 0 / 0.6);
|
|
324
|
+
--cds-shadow-panel-sm: 0 0 0 1px rgb(255 255 255 / 0.1), 0 2px 10px -2px rgb(0 0 0 / 0.5);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
.cds-root {
|
|
328
|
+
font-family: var(--cds-font-sans);
|
|
329
|
+
-webkit-font-smoothing: antialiased;
|
|
330
|
+
-moz-osx-font-smoothing: grayscale;
|
|
331
|
+
font-synthesis: none;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
/* The default line colour (`border` with no colour). */
|
|
335
|
+
.cds-root,
|
|
336
|
+
.cds-root *,
|
|
337
|
+
.cds-root ::before,
|
|
338
|
+
.cds-root ::after {
|
|
339
|
+
border-color: var(--cds-border);
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
/* ---------- component rules ---------- */
|
|
344
|
+
|
|
345
|
+
@layer components {
|
|
346
|
+
:where(.cds-root) .cds-reset:focus,
|
|
347
|
+
:where(.cds-root) .cds-reset:focus-visible {
|
|
348
|
+
outline: none;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
/* An icon: a lucide SVG in a box one font-size square. */
|
|
352
|
+
[data-cds="Icon"] {
|
|
353
|
+
display: inline-flex;
|
|
354
|
+
flex-shrink: 0;
|
|
355
|
+
align-items: center;
|
|
356
|
+
justify-content: center;
|
|
357
|
+
width: 1em;
|
|
358
|
+
height: 1em;
|
|
359
|
+
line-height: 1;
|
|
360
|
+
user-select: none;
|
|
361
|
+
}
|
|
362
|
+
[data-cds="Icon"] > svg {
|
|
363
|
+
display: block;
|
|
364
|
+
width: 100%;
|
|
365
|
+
height: 100%;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
/* Buttons give a little under a press. */
|
|
369
|
+
.btn-squish {
|
|
370
|
+
transition: transform var(--cds-dur-slow) var(--cds-ease-out);
|
|
371
|
+
}
|
|
372
|
+
.group\/btn:not([disabled]):is(:active, :has(:active)) .btn-squish {
|
|
373
|
+
transform: scale(0.97);
|
|
374
|
+
transition-duration: var(--cds-dur-fast);
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
/* The agent's working dot breathes. */
|
|
378
|
+
.cds-root .cds-working-dot-halo {
|
|
379
|
+
opacity: 0;
|
|
380
|
+
animation: cds-working-halo 2.5s ease-in-out infinite;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
/* Resolving: the box draws itself, fills, then the tick turns white. */
|
|
384
|
+
.cds-root .cds-resolve-square {
|
|
385
|
+
fill: var(--cds-fill-accent);
|
|
386
|
+
stroke: var(--cds-fill-accent);
|
|
387
|
+
stroke-width: 1.5px;
|
|
388
|
+
stroke-linecap: round;
|
|
389
|
+
stroke-linejoin: round;
|
|
390
|
+
stroke-dasharray: 56;
|
|
391
|
+
animation: cds-resolve-draw calc(2 * var(--cds-dur-snap)) ease-out both;
|
|
392
|
+
}
|
|
393
|
+
.cds-root .cds-resolve-check {
|
|
394
|
+
animation: cds-resolve-ink calc(2 * var(--cds-dur-snap)) step-end both;
|
|
395
|
+
}
|
|
396
|
+
.cds-root [data-cds-part="resolve"][data-resolving="true"] [data-cds-part="paint"] {
|
|
397
|
+
background-color: transparent;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
/* Text entry on touch screens: at least 16px, so the browser does not zoom in. */
|
|
401
|
+
@media (pointer: coarse) {
|
|
402
|
+
.cds-root .cds-text-entry-floored {
|
|
403
|
+
font-size: max(16px, var(--cds-font-size-body));
|
|
404
|
+
line-height: max(1.375em, var(--cds-leading-body));
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
/* Links in comment text. */
|
|
409
|
+
:where(.cds-root) .cds-text-link {
|
|
410
|
+
color: var(--cds-text-accent);
|
|
411
|
+
border-radius: 2px;
|
|
412
|
+
text-decoration-line: none;
|
|
413
|
+
transition: color var(--cds-dur-fast) var(--cds-ease-out), box-shadow var(--cds-dur-fast) var(--cds-ease-out);
|
|
414
|
+
}
|
|
415
|
+
:where(.cds-root) .cds-text-link:focus-visible {
|
|
416
|
+
outline: none;
|
|
417
|
+
box-shadow: var(--cds-focus-shadow);
|
|
418
|
+
}
|
|
419
|
+
:where(.cds-root) .cds-text-link-underline {
|
|
420
|
+
text-decoration-line: underline;
|
|
421
|
+
text-underline-offset: 3px;
|
|
422
|
+
text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
|
|
423
|
+
}
|
|
424
|
+
:where(.cds-root) .cds-text-link-underline:is(:hover, :focus-visible) {
|
|
425
|
+
text-decoration-color: currentColor;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
/* An edge pile takes presses a little beyond its edges. */
|
|
429
|
+
[data-comment-edge-pile]::before {
|
|
430
|
+
content: "";
|
|
431
|
+
position: absolute;
|
|
432
|
+
inset: -8px;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
@media (prefers-reduced-motion: reduce) {
|
|
436
|
+
.btn-squish,
|
|
437
|
+
.group\/btn:not([disabled]):is(:active, :has(:active)) .btn-squish {
|
|
438
|
+
transition: none;
|
|
439
|
+
}
|
|
440
|
+
.cds-root .cds-working-dot-halo,
|
|
441
|
+
.cds-root .cds-resolve-square,
|
|
442
|
+
.cds-root .cds-resolve-check {
|
|
443
|
+
animation: none;
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
/* ---------- keyframes ---------- */
|
|
449
|
+
|
|
450
|
+
@keyframes cds-fade-in {
|
|
451
|
+
from {
|
|
452
|
+
opacity: 0;
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
@keyframes cds-fade-top {
|
|
456
|
+
from {
|
|
457
|
+
--cds-fade-top: 0px;
|
|
458
|
+
}
|
|
459
|
+
to {
|
|
460
|
+
--cds-fade-top: var(--cds-fade-size, 0.75rem);
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
@keyframes cds-fade-bottom {
|
|
464
|
+
from {
|
|
465
|
+
--cds-fade-bottom: var(--cds-fade-size, 0.75rem);
|
|
466
|
+
}
|
|
467
|
+
to {
|
|
468
|
+
--cds-fade-bottom: 0px;
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
@keyframes cds-working-halo {
|
|
472
|
+
0%,
|
|
473
|
+
100% {
|
|
474
|
+
opacity: 0;
|
|
475
|
+
transform: scale(1);
|
|
476
|
+
}
|
|
477
|
+
50% {
|
|
478
|
+
opacity: 0.35;
|
|
479
|
+
transform: scale(2);
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
@keyframes cds-resolve-draw {
|
|
483
|
+
0% {
|
|
484
|
+
stroke-dashoffset: 56;
|
|
485
|
+
fill-opacity: 0;
|
|
486
|
+
}
|
|
487
|
+
55% {
|
|
488
|
+
stroke-dashoffset: 0;
|
|
489
|
+
fill-opacity: 0;
|
|
490
|
+
}
|
|
491
|
+
100% {
|
|
492
|
+
stroke-dashoffset: 0;
|
|
493
|
+
fill-opacity: 1;
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
@keyframes cds-resolve-ink {
|
|
497
|
+
0% {
|
|
498
|
+
color: inherit;
|
|
499
|
+
}
|
|
500
|
+
80%,
|
|
501
|
+
100% {
|
|
502
|
+
color: var(--cds-on-accent);
|
|
503
|
+
}
|
|
504
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Edge piles: a thread whose pin is out of view (the page scrolled past it, the canvas panned it off, it is under the
|
|
3
|
+
* toolbar) gets no pin. Instead a tab hangs at that edge of the window, "More comments" and how many; a click shows the
|
|
4
|
+
* nearest one (controller.showThread: the runtime brings it into view and opens its card). A side whose edge has no room
|
|
5
|
+
* for a tab keeps its pins (out of view, as before).
|
|
6
|
+
*
|
|
7
|
+
* Left out: right-to-left layout (the reserve and the tab order flip), the lift for the comment sidebar's tab
|
|
8
|
+
* and comment regions (`commentRegionsEnabled`: the layer has no regions).
|
|
9
|
+
*
|
|
10
|
+
* Pin stack: pins that would overlap in a row (two comments on the same spot) are laid out side by side, 6px over each
|
|
11
|
+
* other, leftwards when the row would run past the window's right edge.
|
|
12
|
+
*/
|
|
13
|
+
import type { CSSProperties } from 'react';
|
|
14
|
+
export type PileSide = 'above' | 'below' | 'left' | 'right';
|
|
15
|
+
type Side = PileSide | 'in';
|
|
16
|
+
/** A box in viewport px. */
|
|
17
|
+
export interface Box {
|
|
18
|
+
left: number;
|
|
19
|
+
top: number;
|
|
20
|
+
width: number;
|
|
21
|
+
height: number;
|
|
22
|
+
}
|
|
23
|
+
/** Which edge a point (viewport px) is past, if any. */
|
|
24
|
+
export declare function sideOf(box: Box, point: {
|
|
25
|
+
x: number;
|
|
26
|
+
y: number;
|
|
27
|
+
}, top: number): Side;
|
|
28
|
+
export interface PileInput {
|
|
29
|
+
/** The threads that have pins: id and point (viewport px). */
|
|
30
|
+
points: readonly {
|
|
31
|
+
id: string;
|
|
32
|
+
x: number;
|
|
33
|
+
y: number;
|
|
34
|
+
}[];
|
|
35
|
+
/** The thread whose card is open: it stays a pin wherever it is. */
|
|
36
|
+
openId: string | null;
|
|
37
|
+
box: Box;
|
|
38
|
+
/** The bar over the page (header), px from the box's top: what is under it is out of view. */
|
|
39
|
+
top: number;
|
|
40
|
+
/** The page's toolbar at the top: the top tab hangs from its bottom. */
|
|
41
|
+
floor: number;
|
|
42
|
+
/** The page's toolbar at the bottom, px from the box's bottom: the bottom tab sits that far up, all rounded. */
|
|
43
|
+
foot: number;
|
|
44
|
+
/** Room the top tab keeps clear at the right (the open "All comments" panel). */
|
|
45
|
+
reserveRight: number;
|
|
46
|
+
}
|
|
47
|
+
export interface Piles {
|
|
48
|
+
/** Per side: the threads past that edge, nearest first, and where its tab goes (null: no room, they keep pins). */
|
|
49
|
+
sides: Record<PileSide, {
|
|
50
|
+
ids: string[];
|
|
51
|
+
style: CSSProperties | null;
|
|
52
|
+
}>;
|
|
53
|
+
/** The bottom tab is lifted over a toolbar. */
|
|
54
|
+
floating: boolean;
|
|
55
|
+
/** Threads drawn as a tab, not a pin. */
|
|
56
|
+
piled: ReadonlySet<string>;
|
|
57
|
+
}
|
|
58
|
+
export declare function edgePiles({ points, openId, box, top, floor, foot, reserveRight }: PileInput): Piles;
|
|
59
|
+
export declare function EdgePiles({ piles, onOpen }: {
|
|
60
|
+
piles: Piles;
|
|
61
|
+
onOpen: (id: string) => void;
|
|
62
|
+
}): (import("react/jsx-runtime").JSX.Element | null)[];
|
|
63
|
+
export declare function stackPins(pins: readonly {
|
|
64
|
+
id: string;
|
|
65
|
+
x: number;
|
|
66
|
+
y: number;
|
|
67
|
+
w: number;
|
|
68
|
+
}[], right: number, size: number): Map<string, number>;
|
|
69
|
+
export {};
|