@docx-editor.dev/core 2.1.1 → 2.1.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/dist/editor.css CHANGED
@@ -964,6 +964,29 @@
964
964
  --doc-focus-ring: rgba(26, 115, 232, 0.4);
965
965
  --doc-selection: rgba(26, 115, 232, 0.3);
966
966
 
967
+ /* ----------------------------------------------------------------------
968
+ * Chrome layering.
969
+ *
970
+ * Two bands, and the order between them is the whole point: something the
971
+ * user just OPENED must paint over furniture that was already there. Before
972
+ * these tokens the popups sat at 30 and the gutter at 40, so the File menu
973
+ * opened underneath the navigation toggle.
974
+ *
975
+ * --doc-z-chrome ambient furniture that is always on screen: the
976
+ * navigation gutter, table chrome, the outline toggle.
977
+ * --doc-z-overlay anything transient the user summoned: menus, popovers,
978
+ * colour pickers, the toolbar overflow panel.
979
+ * --doc-z-context the context menu, which is raised over a selection
980
+ * that may already have an overlay open, so it outranks
981
+ * every other overlay.
982
+ *
983
+ * Add a new floating surface by picking the band, never a fresh number.
984
+ * `chrome-layering.test.ts` fails the build if a band inverts.
985
+ * -------------------------------------------------------------------- */
986
+ --doc-z-chrome: 40;
987
+ --doc-z-overlay: 50;
988
+ --doc-z-context: 55;
989
+
967
990
  /* The page sheet itself — the paper.
968
991
  *
969
992
  * Declared here for the DEFAULT theme, which it was not: `--doc-page-bg` existed only
@@ -1520,7 +1543,7 @@ a.docx-hyperlink:focus-visible {
1520
1543
  }
1521
1544
 
1522
1545
  /* Transient paragraph flash used by scrollToParaId({ highlight }). */
1523
- .layout-paragraph.docx-paragraph-flash {
1546
+ .docx-editor .layout-paragraph.docx-paragraph-flash {
1524
1547
  animation: docx-paragraph-flash-fade var(--docx-paragraph-flash-duration, 1200ms) ease-out both;
1525
1548
  }
1526
1549
 
@@ -2013,7 +2036,7 @@ a.docx-hyperlink:focus-visible {
2013
2036
  cursor: pointer;
2014
2037
  }
2015
2038
 
2016
- .paged-editor--readonly .docx-table-furniture {
2039
+ .docx-editor .paged-editor--readonly .docx-table-furniture {
2017
2040
  display: none !important;
2018
2041
  }
2019
2042
 
@@ -2027,7 +2050,7 @@ a.docx-hyperlink:focus-visible {
2027
2050
 
2028
2051
  .docx-table-chrome__panel {
2029
2052
  position: absolute;
2030
- z-index: 40;
2053
+ z-index: var(--doc-z-chrome);
2031
2054
  top: calc(100% + 6px);
2032
2055
  right: 0;
2033
2056
  min-width: 150px;
@@ -2203,13 +2226,13 @@ a.docx-hyperlink:focus-visible {
2203
2226
  * TABLE CELL SELECTION (visible layout table cells)
2204
2227
  * ============================================================================ */
2205
2228
 
2206
- .layout-table-cell-selected {
2229
+ .docx-editor .layout-table-cell-selected {
2207
2230
  position: relative;
2208
2231
  outline: 2px solid var(--doc-selection);
2209
2232
  outline-offset: -2px;
2210
2233
  }
2211
2234
 
2212
- .layout-table-cell-selected::after {
2235
+ .docx-editor .layout-table-cell-selected::after {
2213
2236
  content: '';
2214
2237
  position: absolute;
2215
2238
  inset: 0;
@@ -2217,17 +2240,17 @@ a.docx-hyperlink:focus-visible {
2217
2240
  pointer-events: none;
2218
2241
  }
2219
2242
 
2220
- .layout-table-resize-handle {
2243
+ .docx-editor .layout-table-resize-handle {
2221
2244
  background-color: transparent;
2222
2245
  transition: background-color 0.15s;
2223
2246
  }
2224
2247
 
2225
- .layout-table-resize-handle[data-active='true'] {
2248
+ .docx-editor .layout-table-resize-handle[data-active='true'] {
2226
2249
  background-color: transparent;
2227
2250
  }
2228
2251
 
2229
- .layout-table-resize-handle[data-active='true']::after,
2230
- .layout-table-edge-handle-right[data-active='true']::after {
2252
+ .docx-editor .layout-table-resize-handle[data-active='true']::after,
2253
+ .docx-editor .layout-table-edge-handle-right[data-active='true']::after {
2231
2254
  content: '';
2232
2255
  position: absolute;
2233
2256
  top: 0;
@@ -2240,24 +2263,24 @@ a.docx-hyperlink:focus-visible {
2240
2263
  transform: translateX(-50%);
2241
2264
  }
2242
2265
 
2243
- .layout-table-resize-handle:hover,
2244
- .layout-table-resize-handle.dragging {
2266
+ .docx-editor .layout-table-resize-handle:hover,
2267
+ .docx-editor .layout-table-resize-handle.dragging {
2245
2268
  background-color: transparent;
2246
2269
  }
2247
2270
 
2248
- .layout-table-resize-handle:hover::after,
2249
- .layout-table-resize-handle.dragging::after {
2271
+ .docx-editor .layout-table-resize-handle:hover::after,
2272
+ .docx-editor .layout-table-resize-handle.dragging::after {
2250
2273
  opacity: 1;
2251
2274
  }
2252
2275
 
2253
2276
  /* Row resize handles */
2254
- .layout-table-row-resize-handle,
2255
- .layout-table-edge-handle-bottom {
2277
+ .docx-editor .layout-table-row-resize-handle,
2278
+ .docx-editor .layout-table-edge-handle-bottom {
2256
2279
  background-color: transparent;
2257
2280
  transition: background-color 0.15s;
2258
2281
  }
2259
2282
 
2260
- .layout-table-row-resize-handle[data-active='true']::after {
2283
+ .docx-editor .layout-table-row-resize-handle[data-active='true']::after {
2261
2284
  content: '';
2262
2285
  position: absolute;
2263
2286
  top: 50%;
@@ -2270,35 +2293,35 @@ a.docx-hyperlink:focus-visible {
2270
2293
  transform: translateY(-50%);
2271
2294
  }
2272
2295
 
2273
- .layout-table-row-resize-handle:hover,
2274
- .layout-table-row-resize-handle.dragging,
2275
- .layout-table-edge-handle-bottom:hover,
2276
- .layout-table-edge-handle-bottom.dragging {
2296
+ .docx-editor .layout-table-row-resize-handle:hover,
2297
+ .docx-editor .layout-table-row-resize-handle.dragging,
2298
+ .docx-editor .layout-table-edge-handle-bottom:hover,
2299
+ .docx-editor .layout-table-edge-handle-bottom.dragging {
2277
2300
  background-color: transparent;
2278
2301
  }
2279
2302
 
2280
- .layout-table-row-resize-handle:hover::after,
2281
- .layout-table-row-resize-handle.dragging::after {
2303
+ .docx-editor .layout-table-row-resize-handle:hover::after,
2304
+ .docx-editor .layout-table-row-resize-handle.dragging::after {
2282
2305
  opacity: 1;
2283
2306
  }
2284
2307
 
2285
2308
  /* Right edge handle */
2286
- .layout-table-edge-handle-right {
2309
+ .docx-editor .layout-table-edge-handle-right {
2287
2310
  background-color: transparent;
2288
2311
  transition: background-color 0.15s;
2289
2312
  }
2290
2313
 
2291
- .layout-table-edge-handle-right[data-active='true'] {
2314
+ .docx-editor .layout-table-edge-handle-right[data-active='true'] {
2292
2315
  background-color: transparent;
2293
2316
  }
2294
2317
 
2295
- .layout-table-edge-handle-right:hover,
2296
- .layout-table-edge-handle-right.dragging {
2318
+ .docx-editor .layout-table-edge-handle-right:hover,
2319
+ .docx-editor .layout-table-edge-handle-right.dragging {
2297
2320
  background-color: transparent;
2298
2321
  }
2299
2322
 
2300
- .layout-table-edge-handle-right:hover::after,
2301
- .layout-table-edge-handle-right.dragging::after {
2323
+ .docx-editor .layout-table-edge-handle-right:hover::after,
2324
+ .docx-editor .layout-table-edge-handle-right.dragging::after {
2302
2325
  opacity: 1;
2303
2326
  }
2304
2327
 
@@ -2307,22 +2330,22 @@ a.docx-hyperlink:focus-visible {
2307
2330
  * ============================================================================ */
2308
2331
 
2309
2332
  /* Hide table resize handles */
2310
- .paged-editor--readonly .layout-table-resize-handle,
2311
- .paged-editor--readonly .layout-table-row-resize-handle,
2312
- .paged-editor--readonly .layout-table-edge-handle-bottom,
2313
- .paged-editor--readonly .layout-table-edge-handle-right {
2333
+ .docx-editor .paged-editor--readonly .layout-table-resize-handle,
2334
+ .docx-editor .paged-editor--readonly .layout-table-row-resize-handle,
2335
+ .docx-editor .paged-editor--readonly .layout-table-edge-handle-bottom,
2336
+ .docx-editor .paged-editor--readonly .layout-table-edge-handle-right {
2314
2337
  display: none !important;
2315
2338
  }
2316
2339
 
2317
2340
  /* Remove header/footer hover effects and edit hints */
2318
- .paged-editor--readonly .layout-page-header,
2319
- .paged-editor--readonly .layout-page-footer {
2341
+ .docx-editor .paged-editor--readonly .layout-page-header,
2342
+ .docx-editor .paged-editor--readonly .layout-page-footer {
2320
2343
  cursor: default;
2321
2344
  pointer-events: none;
2322
2345
  }
2323
2346
 
2324
2347
  /* Remove text cursor from page content */
2325
- .paged-editor--readonly .layout-page-content {
2348
+ .docx-editor .paged-editor--readonly .layout-page-content {
2326
2349
  cursor: default;
2327
2350
  }
2328
2351
 
@@ -2385,7 +2408,7 @@ a.docx-hyperlink:focus-visible {
2385
2408
  * ============================================================================ */
2386
2409
 
2387
2410
  /* Page content area — show text cursor when hovering over editable content */
2388
- .layout-page-content {
2411
+ .docx-editor .layout-page-content {
2389
2412
  cursor: text;
2390
2413
  }
2391
2414
 
@@ -2396,7 +2419,7 @@ a.docx-hyperlink:focus-visible {
2396
2419
  like Word, with a corner label chip revealed on hover/focus. The box is
2397
2420
  non-interactive so it never steals clicks from the editable content under it.
2398
2421
  Nested controls each draw their own (slightly inset) box. */
2399
- .layout-block-sdt-box {
2422
+ .docx-editor .layout-block-sdt-box {
2400
2423
  pointer-events: none;
2401
2424
  border: 1px solid transparent;
2402
2425
  border-radius: 4px;
@@ -2404,12 +2427,12 @@ a.docx-hyperlink:focus-visible {
2404
2427
  transition: border-color 0.1s ease;
2405
2428
  z-index: 1;
2406
2429
  }
2407
- .layout-block-sdt-box.is-active,
2408
- .layout-block-sdt-box.is-focused {
2430
+ .docx-editor .layout-block-sdt-box.is-active,
2431
+ .docx-editor .layout-block-sdt-box.is-focused {
2409
2432
  border-color: rgba(25, 103, 210, 0.5);
2410
2433
  }
2411
2434
  /* Corner label chip — hidden until its control is hovered/active. */
2412
- .layout-block-sdt-label {
2435
+ .docx-editor .layout-block-sdt-label {
2413
2436
  position: absolute;
2414
2437
  left: -1px;
2415
2438
  bottom: 100%;
@@ -2426,8 +2449,8 @@ a.docx-hyperlink:focus-visible {
2426
2449
  border-radius: 4px 4px 0 0;
2427
2450
  display: none;
2428
2451
  }
2429
- .layout-block-sdt-box.is-active .layout-block-sdt-label,
2430
- .layout-block-sdt-box.is-focused .layout-block-sdt-label {
2452
+ .docx-editor .layout-block-sdt-box.is-active .layout-block-sdt-label,
2453
+ .docx-editor .layout-block-sdt-box.is-focused .layout-block-sdt-label {
2431
2454
  display: inline-flex;
2432
2455
  align-items: center;
2433
2456
  gap: 2px;
@@ -2441,30 +2464,30 @@ a.docx-hyperlink:focus-visible {
2441
2464
  stays the double-click-to-edit target; only its content is passed through.
2442
2465
  Kept here (not only in prosemirror/editor.css) so the React adapter's
2443
2466
  styles.css build — which compiles this file — ships the rule. */
2444
- .layout-page-header > *,
2445
- .layout-page-footer > * {
2467
+ .docx-editor .layout-page-header > *,
2468
+ .docx-editor .layout-page-footer > * {
2446
2469
  pointer-events: none;
2447
2470
  }
2448
2471
 
2449
2472
  /* While editing a region, its content must be hittable again so clicks map to
2450
2473
  header/footer caret positions. */
2451
- .paged-editor--editing-header .layout-page-header > *,
2452
- .paged-editor--editing-footer .layout-page-footer > * {
2474
+ .docx-editor .paged-editor--editing-header .layout-page-header > *,
2475
+ .docx-editor .paged-editor--editing-footer .layout-page-footer > * {
2453
2476
  pointer-events: auto;
2454
2477
  }
2455
2478
 
2456
2479
  /* Header/footer areas — double-click hint */
2457
- .layout-page-header,
2458
- .layout-page-footer {
2480
+ .docx-editor .layout-page-header,
2481
+ .docx-editor .layout-page-footer {
2459
2482
  cursor: pointer;
2460
2483
  transition: background-color 0.15s ease;
2461
2484
  }
2462
- .layout-page-header:hover,
2463
- .layout-page-footer:hover {
2485
+ .docx-editor .layout-page-header:hover,
2486
+ .docx-editor .layout-page-footer:hover {
2464
2487
  background-color: rgba(37, 99, 235, 0.06);
2465
2488
  }
2466
2489
  /* Show "Double-click to edit" hint on hover when area is empty */
2467
- .layout-page-header:empty:hover::after {
2490
+ .docx-editor .layout-page-header:empty:hover::after {
2468
2491
  content: 'Double-click to add header';
2469
2492
  display: block;
2470
2493
  text-align: center;
@@ -2472,7 +2495,7 @@ a.docx-hyperlink:focus-visible {
2472
2495
  font-size: 11px;
2473
2496
  padding: 4px 0;
2474
2497
  }
2475
- .layout-page-footer:empty:hover::after {
2498
+ .docx-editor .layout-page-footer:empty:hover::after {
2476
2499
  content: 'Double-click to add footer';
2477
2500
  display: block;
2478
2501
  text-align: center;
@@ -2490,7 +2513,7 @@ a.docx-hyperlink:focus-visible {
2490
2513
  */
2491
2514
 
2492
2515
  /* Dim body content when editing header/footer */
2493
- .paged-editor--hf-editing .layout-page-content {
2516
+ .docx-editor .paged-editor--hf-editing .layout-page-content {
2494
2517
  opacity: 0.4;
2495
2518
  pointer-events: none;
2496
2519
  transition: opacity 0.15s ease;
@@ -2499,19 +2522,19 @@ a.docx-hyperlink:focus-visible {
2499
2522
  /* While editing one HF region, the sibling region (and the non-edited area)
2500
2523
  shows a normal arrow, not the double-click "pointer" hint. The active
2501
2524
  region's `cursor: text` below wins via later source order. */
2502
- .paged-editor--hf-editing .layout-page-header,
2503
- .paged-editor--hf-editing .layout-page-footer {
2525
+ .docx-editor .paged-editor--hf-editing .layout-page-header,
2526
+ .docx-editor .paged-editor--hf-editing .layout-page-footer {
2504
2527
  cursor: default;
2505
2528
  }
2506
2529
 
2507
2530
  /* Dotted border on active header area; text caret since it's being edited */
2508
- .paged-editor--editing-header .layout-page-header {
2531
+ .docx-editor .paged-editor--editing-header .layout-page-header {
2509
2532
  border-bottom: 1px dotted var(--doc-primary);
2510
2533
  cursor: text;
2511
2534
  }
2512
2535
 
2513
2536
  /* Dotted border on active footer area; text caret since it's being edited */
2514
- .paged-editor--editing-footer .layout-page-footer {
2537
+ .docx-editor .paged-editor--editing-footer .layout-page-footer {
2515
2538
  border-top: 1px dotted var(--doc-primary);
2516
2539
  cursor: text;
2517
2540
  }
@@ -2523,8 +2546,8 @@ a.docx-hyperlink:focus-visible {
2523
2546
  */
2524
2547
 
2525
2548
  /* Remove hover effect on header/footer when in editing mode */
2526
- .paged-editor--hf-editing .layout-page-header:hover,
2527
- .paged-editor--hf-editing .layout-page-footer:hover {
2549
+ .docx-editor .paged-editor--hf-editing .layout-page-header:hover,
2550
+ .docx-editor .paged-editor--hf-editing .layout-page-footer:hover {
2528
2551
  background-color: transparent;
2529
2552
  }
2530
2553
 
@@ -2590,7 +2613,7 @@ a.docx-hyperlink:focus-visible {
2590
2613
  * z-index: 11 — one above SelectionOverlay (10) so cursor name labels render
2591
2614
  * above the local caret.
2592
2615
  * ============================================================================= */
2593
- .paged-editor__decoration-overlay {
2616
+ .docx-editor .paged-editor__decoration-overlay {
2594
2617
  position: absolute;
2595
2618
  inset: 0;
2596
2619
  pointer-events: none;
@@ -2598,8 +2621,12 @@ a.docx-hyperlink:focus-visible {
2598
2621
  }
2599
2622
 
2600
2623
  /* Default styles for y-prosemirror remote cursor decorations. Consumers can
2601
- * override by providing their own `.ProseMirror-yjs-cursor` rules. */
2602
- .ProseMirror-yjs-cursor {
2624
+ * override by providing their own `.ProseMirror-yjs-cursor` rules.
2625
+ *
2626
+ * Scoped, because `.ProseMirror-yjs-cursor` is y-prosemirror's class name and
2627
+ * not ours: unscoped, these rules restyled the remote cursors of a HOST's own
2628
+ * ProseMirror + Yjs editor sharing the page. */
2629
+ .docx-editor .ProseMirror-yjs-cursor {
2603
2630
  position: relative;
2604
2631
  margin-left: -1px;
2605
2632
  margin-right: -1px;
@@ -2608,7 +2635,7 @@ a.docx-hyperlink:focus-visible {
2608
2635
  word-break: normal;
2609
2636
  pointer-events: none;
2610
2637
  }
2611
- .ProseMirror-yjs-cursor > div {
2638
+ .docx-editor .ProseMirror-yjs-cursor > div {
2612
2639
  position: absolute;
2613
2640
  top: -1.05em;
2614
2641
  left: -1px;
@@ -2631,7 +2658,7 @@ a.docx-hyperlink:focus-visible {
2631
2658
  /* Interactive trigger for typed controls (checkbox/dropdown/date). The box is
2632
2659
  pointer-events:none; the trigger re-enables them so it is clickable. Sits at
2633
2660
  the top-right corner of the control box. */
2634
- .layout-sdt-widget {
2661
+ .docx-editor .layout-sdt-widget {
2635
2662
  position: absolute;
2636
2663
  top: 1px;
2637
2664
  right: 1px;
@@ -2652,16 +2679,16 @@ a.docx-hyperlink:focus-visible {
2652
2679
  opacity: 0.55;
2653
2680
  transition: opacity 0.1s ease;
2654
2681
  }
2655
- .layout-block-sdt-box.is-active .layout-sdt-widget,
2656
- .layout-block-sdt-box.is-focused .layout-sdt-widget,
2657
- .layout-sdt-widget:focus {
2682
+ .docx-editor .layout-block-sdt-box.is-active .layout-sdt-widget,
2683
+ .docx-editor .layout-block-sdt-box.is-focused .layout-sdt-widget,
2684
+ .docx-editor .layout-sdt-widget:focus {
2658
2685
  opacity: 1;
2659
2686
  }
2660
- .layout-sdt-widget:hover {
2687
+ .docx-editor .layout-sdt-widget:hover {
2661
2688
  background: var(--doc-primary-light);
2662
2689
  }
2663
2690
 
2664
- .layout-inline-sdt-widget {
2691
+ .docx-editor .layout-inline-sdt-widget {
2665
2692
  cursor: pointer;
2666
2693
  pointer-events: auto;
2667
2694
  border-radius: 2px;
@@ -2670,14 +2697,14 @@ a.docx-hyperlink:focus-visible {
2670
2697
  -moz-user-select: none;
2671
2698
  user-select: none;
2672
2699
  }
2673
- .layout-inline-sdt-widget:hover,
2674
- .layout-inline-sdt-widget:focus {
2700
+ .docx-editor .layout-inline-sdt-widget:hover,
2701
+ .docx-editor .layout-inline-sdt-widget:focus {
2675
2702
  background: var(--doc-primary-light);
2676
2703
  outline: 1px solid rgba(25, 103, 210, 0.55);
2677
2704
  }
2678
2705
 
2679
2706
  /* Popup for dropdown/date content-control widgets (rendered by the adapter). */
2680
- .layout-sdt-widget-popup {
2707
+ .docx-editor .layout-sdt-widget-popup {
2681
2708
  min-width: 120px;
2682
2709
  max-height: 240px;
2683
2710
  overflow-y: auto;
@@ -2688,7 +2715,7 @@ a.docx-hyperlink:focus-visible {
2688
2715
  padding: 4px;
2689
2716
  font-size: 13px;
2690
2717
  }
2691
- .layout-sdt-widget-option {
2718
+ .docx-editor .layout-sdt-widget-option {
2692
2719
  display: block;
2693
2720
  width: 100%;
2694
2721
  text-align: left;
@@ -2699,26 +2726,26 @@ a.docx-hyperlink:focus-visible {
2699
2726
  cursor: pointer;
2700
2727
  color: var(--doc-text);
2701
2728
  }
2702
- .layout-sdt-widget-option:hover {
2729
+ .docx-editor .layout-sdt-widget-option:hover {
2703
2730
  background: var(--doc-primary-light);
2704
2731
  }
2705
- .layout-sdt-widget-empty {
2732
+ .docx-editor .layout-sdt-widget-empty {
2706
2733
  padding: 6px 10px;
2707
2734
  color: var(--doc-text-muted);
2708
2735
  }
2709
- .layout-sdt-widget-date {
2736
+ .docx-editor .layout-sdt-widget-date {
2710
2737
  font: inherit;
2711
2738
  padding: 4px 6px;
2712
2739
  border: 1px solid var(--doc-border-light);
2713
2740
  border-radius: 4px;
2714
2741
  }
2715
- .layout-sdt-widget-option.is-selected {
2742
+ .docx-editor .layout-sdt-widget-option.is-selected {
2716
2743
  font-weight: 600;
2717
2744
  background: var(--doc-bg-hover);
2718
2745
  }
2719
2746
 
2720
2747
  /* Repeating-section item add/remove affordances (bottom-right of the item box). */
2721
- .layout-sdt-repeat-controls {
2748
+ .docx-editor .layout-sdt-repeat-controls {
2722
2749
  position: absolute;
2723
2750
  bottom: 1px;
2724
2751
  right: 1px;
@@ -2727,11 +2754,11 @@ a.docx-hyperlink:focus-visible {
2727
2754
  opacity: 0.55;
2728
2755
  pointer-events: none;
2729
2756
  }
2730
- .layout-block-sdt-box.is-active .layout-sdt-repeat-controls,
2731
- .layout-block-sdt-box.is-focused .layout-sdt-repeat-controls {
2757
+ .docx-editor .layout-block-sdt-box.is-active .layout-sdt-repeat-controls,
2758
+ .docx-editor .layout-block-sdt-box.is-focused .layout-sdt-repeat-controls {
2732
2759
  opacity: 1;
2733
2760
  }
2734
- .layout-sdt-repeat-btn {
2761
+ .docx-editor .layout-sdt-repeat-btn {
2735
2762
  min-width: 16px;
2736
2763
  height: 16px;
2737
2764
  padding: 0 3px;
@@ -2744,7 +2771,7 @@ a.docx-hyperlink:focus-visible {
2744
2771
  cursor: pointer;
2745
2772
  pointer-events: auto;
2746
2773
  }
2747
- .layout-sdt-repeat-btn:hover {
2774
+ .docx-editor .layout-sdt-repeat-btn:hover {
2748
2775
  background: var(--doc-primary-light);
2749
2776
  }
2750
2777
 
@@ -2753,24 +2780,24 @@ a.docx-hyperlink:focus-visible {
2753
2780
  * Visible painter cues live here so React and Vue stay in lockstep.
2754
2781
  * ========================================================================== */
2755
2782
 
2756
- .layout-revision-bars {
2783
+ .docx-editor .layout-revision-bars {
2757
2784
  position: absolute;
2758
2785
  inset: 0;
2759
2786
  pointer-events: none;
2760
2787
  }
2761
2788
 
2762
- .layout-revision-change-bar {
2789
+ .docx-editor .layout-revision-change-bar {
2763
2790
  position: absolute;
2764
2791
  left: -10px;
2765
2792
  width: 2px;
2766
2793
  pointer-events: none;
2767
2794
  }
2768
2795
 
2769
- .layout-revision-change-bar.layout-revision-ins {
2796
+ .docx-editor .layout-revision-change-bar.layout-revision-ins {
2770
2797
  background-color: var(--doc-revision-insertion);
2771
2798
  }
2772
2799
 
2773
- .layout-revision-change-bar.layout-revision-del {
2800
+ .docx-editor .layout-revision-change-bar.layout-revision-del {
2774
2801
  background-color: var(--doc-revision-deletion);
2775
2802
  }
2776
2803
 
@@ -2826,11 +2853,11 @@ a.docx-hyperlink:focus-visible {
2826
2853
  text-decoration-color: var(--doc-revision-format);
2827
2854
  }
2828
2855
 
2829
- .layout-revision-pmark {
2856
+ .docx-editor .layout-revision-pmark {
2830
2857
  position: relative;
2831
2858
  }
2832
2859
 
2833
- .layout-revision-pmark-glyph {
2860
+ .docx-editor .layout-revision-pmark-glyph {
2834
2861
  display: inline;
2835
2862
  margin-left: 2px;
2836
2863
  font-weight: normal;
@@ -2838,11 +2865,11 @@ a.docx-hyperlink:focus-visible {
2838
2865
  pointer-events: none;
2839
2866
  }
2840
2867
 
2841
- .layout-revision-pmark-glyph.layout-revision-ins {
2868
+ .docx-editor .layout-revision-pmark-glyph.layout-revision-ins {
2842
2869
  color: var(--doc-revision-insertion);
2843
2870
  }
2844
2871
 
2845
- .layout-revision-pmark-glyph.layout-revision-del {
2872
+ .docx-editor .layout-revision-pmark-glyph.layout-revision-del {
2846
2873
  color: var(--doc-revision-deletion);
2847
2874
  text-decoration: line-through;
2848
2875
  }
@@ -2864,24 +2891,24 @@ a.docx-hyperlink:focus-visible {
2864
2891
  background-color: color-mix(in srgb, var(--doc-text-muted) 8%, transparent);
2865
2892
  }
2866
2893
 
2867
- .layout-run-image.docx-insertion,
2868
- .layout-run-image-wrapper.docx-insertion > .layout-run-image,
2869
- .layout-block-image.docx-insertion,
2870
- .layout-image.docx-insertion,
2871
- .layout-page-floating-image.docx-insertion > img,
2872
- .layout-cell-floating-image.docx-insertion > img,
2873
- .layout-header-footer-floating-image.docx-insertion > img {
2894
+ .docx-editor .layout-run-image.docx-insertion,
2895
+ .docx-editor .layout-run-image-wrapper.docx-insertion > .layout-run-image,
2896
+ .docx-editor .layout-block-image.docx-insertion,
2897
+ .docx-editor .layout-image.docx-insertion,
2898
+ .docx-editor .layout-page-floating-image.docx-insertion > img,
2899
+ .docx-editor .layout-cell-floating-image.docx-insertion > img,
2900
+ .docx-editor .layout-header-footer-floating-image.docx-insertion > img {
2874
2901
  outline: 2px solid var(--doc-revision-insertion);
2875
2902
  outline-offset: 1px;
2876
2903
  }
2877
2904
 
2878
- .layout-run-image.docx-deletion,
2879
- .layout-run-image-wrapper.docx-deletion > .layout-run-image,
2880
- .layout-block-image.docx-deletion,
2881
- .layout-image.docx-deletion,
2882
- .layout-page-floating-image.docx-deletion > img,
2883
- .layout-cell-floating-image.docx-deletion > img,
2884
- .layout-header-footer-floating-image.docx-deletion > img {
2905
+ .docx-editor .layout-run-image.docx-deletion,
2906
+ .docx-editor .layout-run-image-wrapper.docx-deletion > .layout-run-image,
2907
+ .docx-editor .layout-block-image.docx-deletion,
2908
+ .docx-editor .layout-image.docx-deletion,
2909
+ .docx-editor .layout-page-floating-image.docx-deletion > img,
2910
+ .docx-editor .layout-cell-floating-image.docx-deletion > img,
2911
+ .docx-editor .layout-header-footer-floating-image.docx-deletion > img {
2885
2912
  outline: 2px solid var(--doc-revision-deletion);
2886
2913
  outline-offset: 1px;
2887
2914
  opacity: 0.6;
@@ -3731,7 +3758,7 @@ a.docx-hyperlink:focus-visible {
3731
3758
  position: absolute;
3732
3759
  left: 26px;
3733
3760
  top: 44px;
3734
- z-index: 31;
3761
+ z-index: var(--doc-z-chrome);
3735
3762
  display: inline-flex;
3736
3763
  align-items: center;
3737
3764
  justify-content: center;
@@ -4167,7 +4194,7 @@ a.docx-hyperlink:focus-visible {
4167
4194
  position: absolute;
4168
4195
  top: calc(100% + 6px);
4169
4196
  inset-inline-end: 0;
4170
- z-index: 60;
4197
+ z-index: var(--doc-z-overlay);
4171
4198
  box-sizing: border-box;
4172
4199
  inline-size: min(340px, calc(100vw - 16px));
4173
4200
  min-inline-size: min(260px, calc(100vw - 16px));
@@ -4576,7 +4603,7 @@ a.docx-hyperlink:focus-visible {
4576
4603
  position: absolute;
4577
4604
  top: 100%;
4578
4605
  left: 0;
4579
- z-index: 30;
4606
+ z-index: var(--doc-z-overlay);
4580
4607
  margin-top: 4px;
4581
4608
  min-width: 72px;
4582
4609
  max-height: 280px;
@@ -4607,7 +4634,7 @@ a.docx-hyperlink:focus-visible {
4607
4634
  position: absolute;
4608
4635
  top: 100%;
4609
4636
  left: 0;
4610
- z-index: 30;
4637
+ z-index: var(--doc-z-overlay);
4611
4638
  margin-top: 4px;
4612
4639
  min-width: 232px;
4613
4640
  }
@@ -4644,7 +4671,7 @@ a.docx-hyperlink:focus-visible {
4644
4671
  position: absolute;
4645
4672
  top: 100%;
4646
4673
  left: 0;
4647
- z-index: 30;
4674
+ z-index: var(--doc-z-overlay);
4648
4675
  margin-top: 4px;
4649
4676
  min-width: 96px;
4650
4677
  }
@@ -4667,7 +4694,7 @@ a.docx-hyperlink:focus-visible {
4667
4694
  position: absolute;
4668
4695
  top: 100%;
4669
4696
  left: 0;
4670
- z-index: 30;
4697
+ z-index: var(--doc-z-overlay);
4671
4698
  margin-top: 4px;
4672
4699
  display: flex;
4673
4700
  gap: 2px;
@@ -4742,7 +4769,7 @@ a.docx-hyperlink:focus-visible {
4742
4769
  position: absolute;
4743
4770
  top: 100%;
4744
4771
  left: 0;
4745
- z-index: 30;
4772
+ z-index: var(--doc-z-overlay);
4746
4773
  margin-top: 4px;
4747
4774
  padding: 10px;
4748
4775
  display: flex;
@@ -5265,7 +5292,7 @@ a.docx-hyperlink:focus-visible {
5265
5292
  position: absolute;
5266
5293
  top: 100%;
5267
5294
  left: 0;
5268
- z-index: 30;
5295
+ z-index: var(--doc-z-overlay);
5269
5296
  margin-top: 4px;
5270
5297
  display: flex;
5271
5298
  gap: 2px;
@@ -5335,7 +5362,7 @@ a.docx-hyperlink:focus-visible {
5335
5362
  */
5336
5363
  .docx-hyperlink-popup {
5337
5364
  position: absolute;
5338
- z-index: 30;
5365
+ z-index: var(--doc-z-overlay);
5339
5366
  display: flex;
5340
5367
  align-items: center;
5341
5368
  gap: 4px;
@@ -5616,7 +5643,7 @@ a.docx-hyperlink:focus-visible {
5616
5643
  inset-block: 0;
5617
5644
  inset-inline-start: 0;
5618
5645
  width: var(--docx-nav-reservation, 328px);
5619
- z-index: 40;
5646
+ z-index: var(--doc-z-chrome);
5620
5647
  pointer-events: none;
5621
5648
  font-size: 13px;
5622
5649
  color: var(--doc-text);
@@ -6336,7 +6363,7 @@ a.docx-hyperlink:focus-visible {
6336
6363
  position: absolute;
6337
6364
  top: calc(100% + 4px);
6338
6365
  right: 0;
6339
- z-index: 40;
6366
+ z-index: var(--doc-z-overlay);
6340
6367
  display: flex;
6341
6368
  min-width: 260px;
6342
6369
  flex-direction: column;
@@ -6549,7 +6576,7 @@ a.docx-hyperlink:focus-visible {
6549
6576
  position: absolute;
6550
6577
  top: 100%;
6551
6578
  left: 0;
6552
- z-index: 30;
6579
+ z-index: var(--doc-z-overlay);
6553
6580
  margin-top: 4px;
6554
6581
  min-width: 220px;
6555
6582
  }
@@ -6697,7 +6724,7 @@ a.docx-hyperlink:focus-visible {
6697
6724
  * and dropdowns (z-index 40) because it is opened ON them as often as on the page. */
6698
6725
  .docx-editor .docx-contextmenu,
6699
6726
  .docx-contextmenu {
6700
- z-index: 45;
6727
+ z-index: var(--doc-z-context);
6701
6728
  min-width: 240px;
6702
6729
  /* A menu longer than the window scrolls rather than overflowing it. The flip in
6703
6730
  * `DocxEditorContextMenu` clamps the panel to the top inset when it cannot fit; without
@@ -6821,7 +6848,7 @@ a.docx-hyperlink:focus-visible {
6821
6848
  position: absolute;
6822
6849
  top: calc(100% + 4px);
6823
6850
  left: 0;
6824
- z-index: 40;
6851
+ z-index: var(--doc-z-overlay);
6825
6852
  min-width: 220px;
6826
6853
  padding: 4px 0;
6827
6854
  background: var(--doc-surface);
@@ -6859,7 +6886,7 @@ a.docx-hyperlink:focus-visible {
6859
6886
  position: absolute;
6860
6887
  top: calc(100% + 4px);
6861
6888
  right: 0;
6862
- z-index: 40;
6889
+ z-index: var(--doc-z-overlay);
6863
6890
  width: 280px;
6864
6891
  padding: 12px;
6865
6892
  background: var(--doc-surface);