@aseity/idocs-preview 0.2.0 → 0.4.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/CHANGELOG.md +12 -0
- package/README.md +70 -3
- package/dist/core/display.d.ts +67 -0
- package/dist/core/editor.d.ts +172 -0
- package/dist/core/editor.js +527 -0
- package/dist/core/engine.js +136 -29
- package/dist/core/index.d.ts +8 -19
- package/dist/core/index.js +35 -22
- package/dist/core/protocol.d.ts +96 -0
- package/dist/core/protocol.js +13 -1
- package/dist/view/edit-selection.d.ts +80 -0
- package/dist/view/edit-selection.js +841 -0
- package/dist/view/editor.d.ts +77 -0
- package/dist/view/editor.js +1477 -0
- package/dist/view/find.d.ts +2 -1
- package/dist/view/find.js +7 -0
- package/dist/view/ime.d.ts +63 -0
- package/dist/view/ime.js +352 -0
- package/dist/view/index.d.ts +4 -0
- package/dist/view/index.js +3 -0
- package/dist/view/selection-layer.d.ts +1 -0
- package/dist/view/selection-layer.js +4 -4
- package/dist/view/workspace-styles.d.ts +1 -0
- package/dist/view/workspace-styles.js +879 -0
- package/dist/view/workspace.d.ts +70 -0
- package/dist/view/workspace.js +1028 -0
- package/package.json +2 -2
- package/wasm/idocs_wasm.d.ts +33 -0
- package/wasm/idocs_wasm.js +163 -0
- package/wasm/idocs_wasm_bg.wasm +0 -0
- package/wasm/idocs_wasm_bg.wasm.d.ts +14 -0
|
@@ -0,0 +1,879 @@
|
|
|
1
|
+
const STYLE_ATTR = 'data-idocs-workspace-styles';
|
|
2
|
+
const DARK_TOKENS = `
|
|
3
|
+
--ws-bg: var(--idocs-canvas-bg, #1b1d22);
|
|
4
|
+
--ws-surface: var(--idocs-surface, #2c2c2e);
|
|
5
|
+
--ws-segment: var(--idocs-segment, #48484a);
|
|
6
|
+
--ws-popover: var(--idocs-popover, #363638);
|
|
7
|
+
--ws-toolbar-bg: var(--idocs-toolbar-bg, #242428);
|
|
8
|
+
--ws-rail-bg: var(--idocs-rail-bg, #242428);
|
|
9
|
+
--ws-ink: var(--idocs-ink, #f5f5f7);
|
|
10
|
+
--ws-ink-2: var(--idocs-ink-secondary, rgba(245, 245, 247, 0.75));
|
|
11
|
+
--ws-muted: var(--idocs-muted, #98989d);
|
|
12
|
+
--ws-border: var(--idocs-border, rgba(255, 255, 255, 0.1));
|
|
13
|
+
--ws-border-strong: var(--idocs-border-strong, rgba(255, 255, 255, 0.14));
|
|
14
|
+
--ws-hover: var(--idocs-hover-fill, rgba(120, 120, 128, 0.24));
|
|
15
|
+
--ws-muted-fill: var(--idocs-muted-fill, rgba(120, 120, 128, 0.2));
|
|
16
|
+
--ws-accent: var(--idocs-accent, #0a84ff);
|
|
17
|
+
--ws-accent-soft: var(--idocs-accent-soft, rgba(10, 132, 255, 0.18));
|
|
18
|
+
--ws-accent-ring: var(--idocs-accent-ring, rgba(10, 132, 255, 0.45));
|
|
19
|
+
--ws-scrollbar-thumb: var(--idocs-scrollbar-thumb, var(--scrollbar-thumb, rgba(152, 152, 157, 0.4)));
|
|
20
|
+
--ws-warn-bg: rgba(180, 83, 9, 0.2);
|
|
21
|
+
--ws-warn-border: rgba(251, 191, 36, 0.35);
|
|
22
|
+
--ws-warn-ink: #fcd34d;
|
|
23
|
+
--ws-danger: #ff6961;
|
|
24
|
+
--ws-menu-shadow: var(--idocs-menu-shadow, 0 12px 32px rgba(0, 0, 0, 0.36), 0 2px 6px rgba(0, 0, 0, 0.2), 0 0 0 0.5px rgba(255, 255, 255, 0.16));
|
|
25
|
+
--ws-dock-shadow: var(--idocs-dock-shadow, 0 3px 6px rgba(0, 0, 0, 0.14), 0 4px 80px 8px rgba(0, 0, 0, 0.14), 0 0 1px rgba(255, 255, 255, 0.2));
|
|
26
|
+
color-scheme: dark;
|
|
27
|
+
`;
|
|
28
|
+
const WORKSPACE_CSS = `
|
|
29
|
+
.idocs-ws {
|
|
30
|
+
--ws-bg: var(--idocs-canvas-bg, #eff0f3);
|
|
31
|
+
--ws-surface: var(--idocs-surface, #ffffff);
|
|
32
|
+
--ws-segment: var(--idocs-segment, #ffffff);
|
|
33
|
+
--ws-popover: var(--idocs-popover, var(--ws-surface));
|
|
34
|
+
--ws-toolbar-bg: var(--idocs-toolbar-bg, #ffffff);
|
|
35
|
+
--ws-rail-bg: var(--idocs-rail-bg, #ffffff);
|
|
36
|
+
--ws-ink: var(--idocs-ink, #1d1d1f);
|
|
37
|
+
--ws-ink-2: var(--idocs-ink-secondary, #515763);
|
|
38
|
+
--ws-muted: var(--idocs-muted, #86868b);
|
|
39
|
+
--ws-border: var(--idocs-border, rgba(0, 0, 0, 0.08));
|
|
40
|
+
--ws-border-strong: var(--idocs-border-strong, rgba(0, 0, 0, 0.12));
|
|
41
|
+
--ws-hover: var(--idocs-hover-fill, rgba(120, 120, 128, 0.12));
|
|
42
|
+
--ws-muted-fill: var(--idocs-muted-fill, rgba(120, 120, 128, 0.12));
|
|
43
|
+
--ws-accent: var(--idocs-accent, #0071e3);
|
|
44
|
+
--ws-accent-soft: var(--idocs-accent-soft, rgba(0, 113, 227, 0.12));
|
|
45
|
+
--ws-accent-ring: var(--idocs-accent-ring, rgba(0, 113, 227, 0.4));
|
|
46
|
+
--ws-scrollbar-thumb: var(--idocs-scrollbar-thumb, var(--scrollbar-thumb, rgba(120, 120, 128, 0.32)));
|
|
47
|
+
--ws-warn-bg: #fffbeb;
|
|
48
|
+
--ws-warn-border: #fde68a;
|
|
49
|
+
--ws-warn-ink: #92400e;
|
|
50
|
+
--ws-danger: #b91c1c;
|
|
51
|
+
--ws-menu-shadow: var(--idocs-menu-shadow, 0 8px 28px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06), 0 0 0 0.5px rgba(0, 0, 0, 0.1));
|
|
52
|
+
--ws-dock-shadow: var(--idocs-dock-shadow, 0 3px 6px rgba(0, 0, 0, 0.03), 0 4px 80px 8px rgba(0, 0, 0, 0.03), 0 0 1px rgba(0, 0, 0, 0.22));
|
|
53
|
+
color-scheme: light;
|
|
54
|
+
|
|
55
|
+
display: flex;
|
|
56
|
+
flex-direction: column;
|
|
57
|
+
width: 100%;
|
|
58
|
+
height: 100%;
|
|
59
|
+
min-height: 0;
|
|
60
|
+
background: var(--ws-bg);
|
|
61
|
+
color: var(--ws-ink);
|
|
62
|
+
font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
|
|
63
|
+
font-size: 13px;
|
|
64
|
+
-webkit-font-smoothing: antialiased;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
:is(.dark, [data-theme="dark"], [data-brand-preview="dark"]) .idocs-ws,
|
|
68
|
+
.idocs-ws[data-theme="dark"] {
|
|
69
|
+
${DARK_TOKENS}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@media (prefers-color-scheme: dark) {
|
|
73
|
+
:root:not(.light):not(.dark):not([data-theme]):not([style*="color-scheme: light"]) .idocs-ws:not([data-theme="light"]) {
|
|
74
|
+
${DARK_TOKENS}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.idocs-ws *,
|
|
79
|
+
.idocs-ws *::before,
|
|
80
|
+
.idocs-ws *::after {
|
|
81
|
+
box-sizing: border-box;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.idocs-ws [hidden] {
|
|
85
|
+
display: none !important;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
:where(.idocs-ws) :is(button, select) {
|
|
89
|
+
font: inherit;
|
|
90
|
+
color: inherit;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.idocs-ws button {
|
|
94
|
+
cursor: pointer;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.idocs-ws button:disabled,
|
|
98
|
+
.idocs-ws select:disabled {
|
|
99
|
+
cursor: not-allowed;
|
|
100
|
+
opacity: 0.5;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.idocs-ws button:focus-visible,
|
|
104
|
+
.idocs-ws select:focus-visible {
|
|
105
|
+
outline: 2px solid var(--ws-accent-ring);
|
|
106
|
+
outline-offset: 1px;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.idocs-ws-toolbar {
|
|
110
|
+
min-height: 52px;
|
|
111
|
+
height: 52px;
|
|
112
|
+
flex-shrink: 0;
|
|
113
|
+
display: flex;
|
|
114
|
+
align-items: center;
|
|
115
|
+
justify-content: space-between;
|
|
116
|
+
gap: 8px;
|
|
117
|
+
padding: 0 12px;
|
|
118
|
+
background: var(--ws-toolbar-bg);
|
|
119
|
+
border-bottom: 1px solid var(--ws-border);
|
|
120
|
+
user-select: none;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.idocs-ws-tb-left,
|
|
124
|
+
.idocs-ws-tb-right,
|
|
125
|
+
.idocs-ws-tb-center {
|
|
126
|
+
display: flex;
|
|
127
|
+
align-items: center;
|
|
128
|
+
gap: 4px;
|
|
129
|
+
min-width: 0;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.idocs-ws-tb-left {
|
|
133
|
+
gap: 6px;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.idocs-ws-tb-right {
|
|
137
|
+
gap: 2px;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.idocs-ws-tb-center {
|
|
141
|
+
flex: 1;
|
|
142
|
+
justify-content: center;
|
|
143
|
+
overflow: visible;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.idocs-ws-ctx {
|
|
147
|
+
display: inline-flex;
|
|
148
|
+
align-items: center;
|
|
149
|
+
gap: 4px;
|
|
150
|
+
max-width: 100%;
|
|
151
|
+
flex-wrap: nowrap;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.idocs-ws-icon-btn {
|
|
155
|
+
width: 28px;
|
|
156
|
+
height: 28px;
|
|
157
|
+
display: inline-flex;
|
|
158
|
+
align-items: center;
|
|
159
|
+
justify-content: center;
|
|
160
|
+
border: 0;
|
|
161
|
+
border-radius: 6px;
|
|
162
|
+
background: transparent;
|
|
163
|
+
color: var(--ws-ink-2);
|
|
164
|
+
padding: 0;
|
|
165
|
+
flex-shrink: 0;
|
|
166
|
+
transition: background 120ms ease, color 120ms ease;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.idocs-ws-tb-left .idocs-ws-icon-btn {
|
|
170
|
+
width: 32px;
|
|
171
|
+
height: 32px;
|
|
172
|
+
border-radius: 8px;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.idocs-ws-tb-right .idocs-ws-icon-btn {
|
|
176
|
+
border-radius: 7px;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.idocs-ws-icon-btn:hover:not(:disabled) {
|
|
180
|
+
background: var(--ws-hover);
|
|
181
|
+
color: var(--ws-ink);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.idocs-ws-icon-btn[aria-expanded='true'] {
|
|
185
|
+
background: var(--ws-hover);
|
|
186
|
+
color: var(--ws-ink);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.idocs-ws-icon-btn[aria-pressed='true'] {
|
|
190
|
+
background: var(--ws-accent-soft);
|
|
191
|
+
color: var(--ws-accent);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.idocs-ws-pill-btn {
|
|
195
|
+
height: 28px;
|
|
196
|
+
padding: 0 9px;
|
|
197
|
+
border: 0;
|
|
198
|
+
border-radius: 7px;
|
|
199
|
+
background: transparent;
|
|
200
|
+
color: var(--ws-ink-2);
|
|
201
|
+
font-size: 12.5px;
|
|
202
|
+
font-weight: 500;
|
|
203
|
+
display: inline-flex;
|
|
204
|
+
align-items: center;
|
|
205
|
+
gap: 4px;
|
|
206
|
+
white-space: nowrap;
|
|
207
|
+
flex-shrink: 0;
|
|
208
|
+
transition: background 120ms ease, color 120ms ease;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.idocs-ws-pill-btn:hover:not(:disabled) {
|
|
212
|
+
background: var(--ws-hover);
|
|
213
|
+
color: var(--ws-ink);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.idocs-ws-pill-btn.is-danger:hover:not(:disabled) {
|
|
217
|
+
color: var(--ws-danger);
|
|
218
|
+
background: rgba(255, 59, 48, 0.1);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.idocs-ws-select-trigger {
|
|
222
|
+
height: 28px;
|
|
223
|
+
min-width: 88px;
|
|
224
|
+
padding: 0 8px 0 10px;
|
|
225
|
+
border: 0;
|
|
226
|
+
border-radius: 7px;
|
|
227
|
+
background: transparent;
|
|
228
|
+
box-shadow: none;
|
|
229
|
+
color: var(--ws-ink-2);
|
|
230
|
+
font-size: 13px;
|
|
231
|
+
font-weight: 400;
|
|
232
|
+
display: inline-flex;
|
|
233
|
+
align-items: center;
|
|
234
|
+
justify-content: space-between;
|
|
235
|
+
gap: 6px;
|
|
236
|
+
white-space: nowrap;
|
|
237
|
+
transition: background 120ms ease, color 120ms ease;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.idocs-ws-select-trigger:hover:not(:disabled),
|
|
241
|
+
.idocs-ws-select-trigger[aria-expanded='true'] {
|
|
242
|
+
background: var(--ws-hover);
|
|
243
|
+
color: var(--ws-ink);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.idocs-ws-select-value {
|
|
247
|
+
flex: 1;
|
|
248
|
+
text-align: left;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.idocs-ws-select-chevron {
|
|
252
|
+
flex-shrink: 0;
|
|
253
|
+
color: var(--ws-muted);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.idocs-ws-divider {
|
|
257
|
+
width: 1px;
|
|
258
|
+
height: 18px;
|
|
259
|
+
background: var(--ws-border-strong);
|
|
260
|
+
margin: 0 4px;
|
|
261
|
+
flex-shrink: 0;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.idocs-ws-seg {
|
|
265
|
+
display: inline-flex;
|
|
266
|
+
align-items: center;
|
|
267
|
+
padding: 2px;
|
|
268
|
+
border-radius: 7px;
|
|
269
|
+
background: var(--ws-muted-fill);
|
|
270
|
+
gap: 2px;
|
|
271
|
+
flex-shrink: 0;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.idocs-ws-seg-btn {
|
|
275
|
+
height: 22px;
|
|
276
|
+
padding: 0 8px;
|
|
277
|
+
border: 0;
|
|
278
|
+
border-radius: 5px;
|
|
279
|
+
background: transparent;
|
|
280
|
+
color: var(--ws-ink-2);
|
|
281
|
+
font-size: 12px;
|
|
282
|
+
font-weight: 500;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.idocs-ws-seg-btn[aria-pressed='true'] {
|
|
286
|
+
background: var(--ws-surface);
|
|
287
|
+
color: var(--ws-ink);
|
|
288
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.idocs-ws-badge {
|
|
292
|
+
height: 22px;
|
|
293
|
+
padding: 0 8px;
|
|
294
|
+
border-radius: 999px;
|
|
295
|
+
background: var(--ws-muted-fill);
|
|
296
|
+
color: var(--ws-ink-2);
|
|
297
|
+
font-size: 11.5px;
|
|
298
|
+
font-weight: 600;
|
|
299
|
+
display: inline-flex;
|
|
300
|
+
align-items: center;
|
|
301
|
+
gap: 4px;
|
|
302
|
+
white-space: nowrap;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.idocs-ws-badge.is-warn {
|
|
306
|
+
background: var(--ws-warn-bg);
|
|
307
|
+
border: 1px solid var(--ws-warn-border);
|
|
308
|
+
color: var(--ws-warn-ink);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
.idocs-ws-note {
|
|
312
|
+
font-size: 12px;
|
|
313
|
+
color: var(--ws-muted);
|
|
314
|
+
white-space: nowrap;
|
|
315
|
+
overflow: hidden;
|
|
316
|
+
text-overflow: ellipsis;
|
|
317
|
+
max-width: 280px;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
.idocs-ws-zoom-label {
|
|
321
|
+
min-width: 44px;
|
|
322
|
+
text-align: center;
|
|
323
|
+
font-size: 12px;
|
|
324
|
+
font-variant-numeric: tabular-nums;
|
|
325
|
+
color: var(--ws-ink-2);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
.idocs-ws-processing-indicator {
|
|
329
|
+
width: 28px;
|
|
330
|
+
height: 28px;
|
|
331
|
+
display: inline-flex;
|
|
332
|
+
align-items: center;
|
|
333
|
+
justify-content: center;
|
|
334
|
+
color: var(--ws-muted);
|
|
335
|
+
flex-shrink: 0;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
.idocs-ws-spinner {
|
|
339
|
+
width: 15px;
|
|
340
|
+
height: 15px;
|
|
341
|
+
border-radius: 999px;
|
|
342
|
+
display: inline-block;
|
|
343
|
+
background: conic-gradient(from 0deg, color-mix(in srgb, currentColor 16%, transparent) 0deg 210deg, currentColor 360deg);
|
|
344
|
+
-webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 1.75px), #000 calc(100% - 1.25px));
|
|
345
|
+
mask: radial-gradient(farthest-side, transparent calc(100% - 1.75px), #000 calc(100% - 1.25px));
|
|
346
|
+
animation: idocs-ws-spin 0.85s linear infinite;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
@keyframes idocs-ws-spin {
|
|
350
|
+
to {
|
|
351
|
+
transform: rotate(360deg);
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
.idocs-ws.is-readonly .idocs-preview-pages {
|
|
356
|
+
cursor: default !important;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
.idocs-ws.is-processing .idocs-preview-page::after {
|
|
360
|
+
content: "";
|
|
361
|
+
position: absolute;
|
|
362
|
+
inset: 0;
|
|
363
|
+
z-index: 5;
|
|
364
|
+
pointer-events: none;
|
|
365
|
+
background-image: linear-gradient(
|
|
366
|
+
110deg,
|
|
367
|
+
transparent 44%,
|
|
368
|
+
rgba(120, 120, 128, 0.075) 50%,
|
|
369
|
+
transparent 56%
|
|
370
|
+
);
|
|
371
|
+
background-size: 300% 100%;
|
|
372
|
+
background-repeat: no-repeat;
|
|
373
|
+
animation: idocs-ws-processing-sweep 2.8s ease-in-out infinite;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
@keyframes idocs-ws-processing-sweep {
|
|
377
|
+
0% {
|
|
378
|
+
background-position: 100% 0;
|
|
379
|
+
}
|
|
380
|
+
80%,
|
|
381
|
+
100% {
|
|
382
|
+
background-position: 0% 0;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
.idocs-ws-body {
|
|
387
|
+
--ws-rail-width: 208px;
|
|
388
|
+
--ws-rail-ease: cubic-bezier(0.22, 1, 0.36, 1);
|
|
389
|
+
--ws-rail-duration: 220ms;
|
|
390
|
+
flex: 1;
|
|
391
|
+
min-height: 0;
|
|
392
|
+
display: grid;
|
|
393
|
+
grid-template-columns: var(--ws-rail-width) minmax(0, 1fr);
|
|
394
|
+
overflow: hidden;
|
|
395
|
+
position: relative;
|
|
396
|
+
transition: grid-template-columns var(--ws-rail-duration) var(--ws-rail-ease);
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
.idocs-ws-body.is-rail-collapsed {
|
|
400
|
+
grid-template-columns: 0px minmax(0, 1fr);
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
.idocs-ws-rail-slot {
|
|
404
|
+
min-width: 0;
|
|
405
|
+
min-height: 0;
|
|
406
|
+
overflow: hidden;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
.idocs-ws-rail {
|
|
410
|
+
width: var(--ws-rail-width);
|
|
411
|
+
height: 100%;
|
|
412
|
+
background: var(--ws-rail-bg);
|
|
413
|
+
border-right: 1px solid var(--ws-border);
|
|
414
|
+
display: flex;
|
|
415
|
+
flex-direction: column;
|
|
416
|
+
min-height: 0;
|
|
417
|
+
transform: translateX(0);
|
|
418
|
+
opacity: 1;
|
|
419
|
+
visibility: visible;
|
|
420
|
+
transition:
|
|
421
|
+
transform var(--ws-rail-duration) var(--ws-rail-ease),
|
|
422
|
+
opacity 180ms ease,
|
|
423
|
+
visibility 0s;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
.idocs-ws-body.is-rail-collapsed .idocs-ws-rail {
|
|
427
|
+
transform: translateX(-100%);
|
|
428
|
+
opacity: 0;
|
|
429
|
+
visibility: hidden;
|
|
430
|
+
pointer-events: none;
|
|
431
|
+
transition:
|
|
432
|
+
transform var(--ws-rail-duration) var(--ws-rail-ease),
|
|
433
|
+
opacity 160ms ease,
|
|
434
|
+
visibility 0s var(--ws-rail-duration);
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
@media (prefers-reduced-motion: reduce) {
|
|
438
|
+
.idocs-ws-body,
|
|
439
|
+
.idocs-ws-rail {
|
|
440
|
+
transition: none !important;
|
|
441
|
+
}
|
|
442
|
+
.idocs-ws-spinner {
|
|
443
|
+
animation: none !important;
|
|
444
|
+
}
|
|
445
|
+
.idocs-ws.is-processing .idocs-preview-page::after {
|
|
446
|
+
animation: none !important;
|
|
447
|
+
background-image: none !important;
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
.idocs-ws-rail-tabs {
|
|
452
|
+
display: flex;
|
|
453
|
+
gap: 2px;
|
|
454
|
+
margin: 10px 12px 6px;
|
|
455
|
+
padding: 2px;
|
|
456
|
+
border-radius: 8px;
|
|
457
|
+
background: var(--ws-muted-fill);
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
.idocs-ws-rail-tab {
|
|
461
|
+
flex: 1;
|
|
462
|
+
height: 26px;
|
|
463
|
+
border: 0;
|
|
464
|
+
border-radius: 6px;
|
|
465
|
+
background: transparent;
|
|
466
|
+
color: var(--ws-ink-2);
|
|
467
|
+
font-size: 12px;
|
|
468
|
+
font-weight: 500;
|
|
469
|
+
transition: background-color 140ms ease, color 140ms ease;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
.idocs-ws-rail-tab[aria-selected='true'] {
|
|
473
|
+
background: var(--ws-segment);
|
|
474
|
+
color: var(--ws-ink);
|
|
475
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.04);
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
.idocs-ws-rail-list,
|
|
479
|
+
.idocs-ws .idocs-preview-scroller {
|
|
480
|
+
scrollbar-width: thin;
|
|
481
|
+
scrollbar-color: var(--ws-scrollbar-thumb) transparent;
|
|
482
|
+
overscroll-behavior: contain;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
@media (forced-colors: active) {
|
|
486
|
+
.idocs-ws-rail-list,
|
|
487
|
+
.idocs-ws .idocs-preview-scroller {
|
|
488
|
+
scrollbar-color: auto;
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
.idocs-ws-rail-list {
|
|
493
|
+
flex: 1;
|
|
494
|
+
min-height: 0;
|
|
495
|
+
overflow-y: auto;
|
|
496
|
+
scrollbar-gutter: stable;
|
|
497
|
+
padding: 8px 16px 20px;
|
|
498
|
+
display: flex;
|
|
499
|
+
flex-direction: column;
|
|
500
|
+
gap: 14px;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
.idocs-ws-rail-list.is-outline {
|
|
504
|
+
padding: 6px 10px 16px;
|
|
505
|
+
gap: 2px;
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
.idocs-ws-thumb-card {
|
|
509
|
+
position: relative;
|
|
510
|
+
width: 100%;
|
|
511
|
+
flex-shrink: 0;
|
|
512
|
+
margin: 0;
|
|
513
|
+
padding: 0;
|
|
514
|
+
border: 0;
|
|
515
|
+
border-radius: 6px;
|
|
516
|
+
background: transparent;
|
|
517
|
+
display: flex;
|
|
518
|
+
flex-direction: column;
|
|
519
|
+
align-items: center;
|
|
520
|
+
gap: 6px;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
.idocs-ws-thumb-sheet {
|
|
524
|
+
position: relative;
|
|
525
|
+
display: block;
|
|
526
|
+
width: 100%;
|
|
527
|
+
overflow: hidden;
|
|
528
|
+
border-radius: 5px;
|
|
529
|
+
background: #ffffff;
|
|
530
|
+
transition: box-shadow 160ms ease;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
.idocs-ws-thumb-sheet::after {
|
|
534
|
+
content: "";
|
|
535
|
+
position: absolute;
|
|
536
|
+
inset: 0;
|
|
537
|
+
border-radius: inherit;
|
|
538
|
+
box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.11);
|
|
539
|
+
pointer-events: none;
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
.idocs-ws-thumb-card:hover .idocs-ws-thumb-sheet {
|
|
543
|
+
box-shadow: 0 3px 10px rgba(15, 23, 42, 0.12);
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
.idocs-ws-thumb-card.is-active .idocs-ws-thumb-sheet::after {
|
|
547
|
+
box-shadow: inset 0 0 0 2px var(--ws-accent);
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
.idocs-ws-thumb-canvas {
|
|
551
|
+
display: block;
|
|
552
|
+
width: 100%;
|
|
553
|
+
height: auto;
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
.idocs-ws-thumb-label {
|
|
557
|
+
font-size: 11px;
|
|
558
|
+
line-height: 1;
|
|
559
|
+
font-variant-numeric: tabular-nums;
|
|
560
|
+
color: var(--ws-muted);
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
.idocs-ws-thumb-card.is-active .idocs-ws-thumb-label {
|
|
564
|
+
color: var(--ws-accent);
|
|
565
|
+
font-weight: 600;
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
.idocs-ws-outline-item {
|
|
569
|
+
width: 100%;
|
|
570
|
+
flex-shrink: 0;
|
|
571
|
+
border: 0;
|
|
572
|
+
border-radius: 6px;
|
|
573
|
+
background: transparent;
|
|
574
|
+
text-align: left;
|
|
575
|
+
padding: 5px 8px;
|
|
576
|
+
font-size: 12.5px;
|
|
577
|
+
line-height: 1.35;
|
|
578
|
+
color: var(--ws-ink-2);
|
|
579
|
+
overflow: hidden;
|
|
580
|
+
text-overflow: ellipsis;
|
|
581
|
+
white-space: nowrap;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
.idocs-ws-outline-item.is-active {
|
|
585
|
+
background: var(--ws-accent-soft);
|
|
586
|
+
color: var(--ws-accent);
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
.idocs-ws-outline-item:hover {
|
|
590
|
+
background: var(--ws-hover);
|
|
591
|
+
color: var(--ws-ink);
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
.idocs-ws-outline-item.level-1 {
|
|
595
|
+
font-weight: 600;
|
|
596
|
+
color: var(--ws-ink);
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
.idocs-ws-outline-item.level-2 {
|
|
600
|
+
padding-left: 18px;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
.idocs-ws-outline-item.level-3 {
|
|
604
|
+
padding-left: 28px;
|
|
605
|
+
font-size: 12px;
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
.idocs-ws-empty {
|
|
609
|
+
padding: 18px 8px;
|
|
610
|
+
text-align: center;
|
|
611
|
+
font-size: 12px;
|
|
612
|
+
color: var(--ws-muted);
|
|
613
|
+
line-height: 1.5;
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
.idocs-ws-stage {
|
|
617
|
+
flex: 1;
|
|
618
|
+
min-width: 0;
|
|
619
|
+
min-height: 0;
|
|
620
|
+
position: relative;
|
|
621
|
+
display: flex;
|
|
622
|
+
flex-direction: column;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
.idocs-ws-editor-host {
|
|
626
|
+
flex: 1;
|
|
627
|
+
min-height: 0;
|
|
628
|
+
position: relative;
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
.idocs-ws-sel-pill {
|
|
632
|
+
position: absolute;
|
|
633
|
+
z-index: 25;
|
|
634
|
+
display: inline-flex;
|
|
635
|
+
align-items: center;
|
|
636
|
+
padding: 0;
|
|
637
|
+
border: 0;
|
|
638
|
+
border-radius: 999px;
|
|
639
|
+
background: var(--ws-popover);
|
|
640
|
+
box-shadow: var(--ws-menu-shadow);
|
|
641
|
+
animation: idocs-ws-pop-down 130ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
.idocs-ws-sel-pill-btn {
|
|
645
|
+
height: 32px;
|
|
646
|
+
padding: 0 12px 0 10px;
|
|
647
|
+
border: 0;
|
|
648
|
+
border-radius: 999px;
|
|
649
|
+
background: transparent;
|
|
650
|
+
color: var(--ws-ink);
|
|
651
|
+
font-size: 13px;
|
|
652
|
+
font-weight: 500;
|
|
653
|
+
display: inline-flex;
|
|
654
|
+
align-items: center;
|
|
655
|
+
gap: 6px;
|
|
656
|
+
white-space: nowrap;
|
|
657
|
+
transition: background 120ms ease, color 120ms ease;
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
.idocs-ws-sel-pill-icon {
|
|
661
|
+
flex-shrink: 0;
|
|
662
|
+
color: var(--ws-ink-2);
|
|
663
|
+
transition: color 120ms ease;
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
.idocs-ws-sel-pill-btn:hover {
|
|
667
|
+
background: var(--ws-hover);
|
|
668
|
+
color: var(--ws-ink);
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
.idocs-ws-sel-pill-btn:hover .idocs-ws-sel-pill-icon {
|
|
672
|
+
color: var(--ws-ink);
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
.idocs-ws-dock {
|
|
676
|
+
position: absolute;
|
|
677
|
+
left: 50%;
|
|
678
|
+
bottom: 20px;
|
|
679
|
+
transform: translateX(-50%);
|
|
680
|
+
z-index: 20;
|
|
681
|
+
display: inline-flex;
|
|
682
|
+
align-items: center;
|
|
683
|
+
gap: 2px;
|
|
684
|
+
padding: 5px;
|
|
685
|
+
border: 0;
|
|
686
|
+
border-radius: 15px;
|
|
687
|
+
background: var(--ws-surface);
|
|
688
|
+
box-shadow: var(--ws-dock-shadow);
|
|
689
|
+
user-select: none;
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
.idocs-ws-dock-btn {
|
|
693
|
+
height: 34px;
|
|
694
|
+
padding: 0 11px;
|
|
695
|
+
border: 0;
|
|
696
|
+
border-radius: 10px;
|
|
697
|
+
background: transparent;
|
|
698
|
+
color: var(--ws-ink-2);
|
|
699
|
+
font-size: 12.5px;
|
|
700
|
+
font-weight: 500;
|
|
701
|
+
display: inline-flex;
|
|
702
|
+
align-items: center;
|
|
703
|
+
gap: 6px;
|
|
704
|
+
white-space: nowrap;
|
|
705
|
+
transition: background 140ms ease, color 140ms ease;
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
.idocs-ws-dock-btn:hover,
|
|
709
|
+
.idocs-ws-dock-btn[aria-expanded='true'] {
|
|
710
|
+
background: var(--ws-hover);
|
|
711
|
+
color: var(--ws-ink);
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
.idocs-ws-popover-anchor {
|
|
715
|
+
position: relative;
|
|
716
|
+
display: inline-flex;
|
|
717
|
+
align-items: center;
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
.idocs-ws-popover {
|
|
721
|
+
position: absolute;
|
|
722
|
+
z-index: 30;
|
|
723
|
+
min-width: 136px;
|
|
724
|
+
padding: 4px;
|
|
725
|
+
border: 0;
|
|
726
|
+
border-radius: 12px;
|
|
727
|
+
background: var(--ws-popover);
|
|
728
|
+
box-shadow: var(--ws-menu-shadow);
|
|
729
|
+
display: flex;
|
|
730
|
+
flex-direction: column;
|
|
731
|
+
gap: 1px;
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
.idocs-ws-table-popover {
|
|
735
|
+
padding: 8px 10px 10px;
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
.idocs-ws .idocs-preview-find {
|
|
739
|
+
background: var(--ws-popover) !important;
|
|
740
|
+
border: 0 !important;
|
|
741
|
+
box-shadow: var(--ws-menu-shadow) !important;
|
|
742
|
+
color: var(--ws-ink) !important;
|
|
743
|
+
border-radius: 10px !important;
|
|
744
|
+
padding: 5px 8px !important;
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
.idocs-ws .idocs-preview-find input {
|
|
748
|
+
background: transparent;
|
|
749
|
+
color: var(--ws-ink);
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
.idocs-ws .idocs-preview-find input::placeholder,
|
|
753
|
+
.idocs-ws .idocs-preview-find-count {
|
|
754
|
+
color: var(--ws-muted) !important;
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
.idocs-ws-popover.is-down {
|
|
758
|
+
top: calc(100% + 6px);
|
|
759
|
+
left: 0;
|
|
760
|
+
transform-origin: top left;
|
|
761
|
+
animation: idocs-ws-pop-down 130ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
.idocs-ws-popover.is-up {
|
|
765
|
+
bottom: calc(100% + 10px);
|
|
766
|
+
left: 50%;
|
|
767
|
+
transform: translateX(-50%);
|
|
768
|
+
transform-origin: bottom center;
|
|
769
|
+
animation: idocs-ws-pop-up 130ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
@keyframes idocs-ws-pop-down {
|
|
773
|
+
from {
|
|
774
|
+
opacity: 0;
|
|
775
|
+
transform: translateY(-3px) scale(0.97);
|
|
776
|
+
}
|
|
777
|
+
to {
|
|
778
|
+
opacity: 1;
|
|
779
|
+
transform: translateY(0) scale(1);
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
@keyframes idocs-ws-pop-up {
|
|
784
|
+
from {
|
|
785
|
+
opacity: 0;
|
|
786
|
+
transform: translateX(-50%) translateY(3px) scale(0.97);
|
|
787
|
+
}
|
|
788
|
+
to {
|
|
789
|
+
opacity: 1;
|
|
790
|
+
transform: translateX(-50%) translateY(0) scale(1);
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
@media (prefers-reduced-motion: reduce) {
|
|
795
|
+
.idocs-ws-sel-pill,
|
|
796
|
+
.idocs-ws-popover.is-down,
|
|
797
|
+
.idocs-ws-popover.is-up {
|
|
798
|
+
animation: none;
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
.idocs-ws-menu-item {
|
|
803
|
+
position: relative;
|
|
804
|
+
width: 100%;
|
|
805
|
+
border: 0;
|
|
806
|
+
border-radius: 8px;
|
|
807
|
+
background: transparent;
|
|
808
|
+
text-align: left;
|
|
809
|
+
padding: 6px 32px 6px 12px;
|
|
810
|
+
font-size: 13px;
|
|
811
|
+
line-height: 1.35;
|
|
812
|
+
color: var(--ws-ink);
|
|
813
|
+
display: flex;
|
|
814
|
+
align-items: center;
|
|
815
|
+
white-space: nowrap;
|
|
816
|
+
transition: background 100ms ease;
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
.idocs-ws-menu-item:hover,
|
|
820
|
+
.idocs-ws-menu-item[data-highlighted='true'] {
|
|
821
|
+
background: var(--ws-hover);
|
|
822
|
+
color: var(--ws-ink);
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
.idocs-ws-menu-label {
|
|
826
|
+
flex: 1;
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
.idocs-ws-menu-check {
|
|
830
|
+
position: absolute;
|
|
831
|
+
right: 8px;
|
|
832
|
+
display: inline-flex;
|
|
833
|
+
align-items: center;
|
|
834
|
+
justify-content: center;
|
|
835
|
+
color: var(--ws-accent);
|
|
836
|
+
pointer-events: none;
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
.idocs-ws-table-grid-head {
|
|
840
|
+
font-size: 12px;
|
|
841
|
+
font-weight: 500;
|
|
842
|
+
color: var(--ws-ink-2);
|
|
843
|
+
text-align: center;
|
|
844
|
+
padding: 0 0 6px;
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
.idocs-ws-table-grid {
|
|
848
|
+
display: grid;
|
|
849
|
+
grid-template-columns: repeat(6, 18px);
|
|
850
|
+
gap: 4px;
|
|
851
|
+
padding: 2px;
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
.idocs-ws-table-cell {
|
|
855
|
+
width: 18px;
|
|
856
|
+
height: 18px;
|
|
857
|
+
padding: 0;
|
|
858
|
+
border: 0;
|
|
859
|
+
border-radius: 4px;
|
|
860
|
+
background: var(--ws-surface);
|
|
861
|
+
box-shadow: inset 0 0 0 1px var(--ws-border-strong);
|
|
862
|
+
transition: background 90ms ease, box-shadow 90ms ease;
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
.idocs-ws-table-cell.is-hot {
|
|
866
|
+
background: var(--ws-accent-soft);
|
|
867
|
+
box-shadow: inset 0 0 0 1px var(--ws-accent);
|
|
868
|
+
}
|
|
869
|
+
`;
|
|
870
|
+
export function ensureWorkspaceStyles() {
|
|
871
|
+
if (typeof document === 'undefined' || !document.head)
|
|
872
|
+
return;
|
|
873
|
+
if (document.head.querySelector(`style[${STYLE_ATTR}]`))
|
|
874
|
+
return;
|
|
875
|
+
const style = document.createElement('style');
|
|
876
|
+
style.setAttribute(STYLE_ATTR, '');
|
|
877
|
+
style.textContent = WORKSPACE_CSS;
|
|
878
|
+
document.head.append(style);
|
|
879
|
+
}
|