@aseity/idocs-preview 0.3.0 → 0.5.0

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