@zuilib/text-editor 0.10.0 → 0.11.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/dist/styles.css CHANGED
@@ -369,10 +369,11 @@
369
369
  * Floating table controls (positioned within .zui-text-editor-main, so they
370
370
  * scroll with the document; TableControlsPlugin.tsx).
371
371
  *
372
- * The toolbar — layout presets and row actions straddles the top-right
373
- * corner of the table the caret is in. It stays inside the table's own top
374
- * margin so it never covers the previous paragraph. The settings
375
- * themselves are an inline style on the <table> (see tableSettings.ts).
372
+ * The layout presets sit above the table the caret is in, aligned with
373
+ * its right edge and stacked above the column rail (the plugin sets `top`
374
+ * to the rail's top; the transform lifts the toolbar clear of it). The
375
+ * settings themselves are an inline style on the <table> (see
376
+ * tableSettings.ts).
376
377
  */
377
378
  .zui-table-settings {
378
379
  position: absolute;
@@ -386,44 +387,52 @@
386
387
  background: var(--popover, #ffffff);
387
388
  color: var(--popover-foreground, inherit);
388
389
  box-shadow: var(--shadow-medium, 0 1px 4px rgba(0, 0, 0, 0.08));
389
- transform: translateY(-70%);
390
- }
391
-
392
- .zui-table-settings > .zui-text-editor-toolbar-divider {
393
- margin: 0 0.125rem;
390
+ transform: translateY(calc(-100% - 0.25rem));
394
391
  }
395
392
 
396
393
  /*
397
- * The row rail hugs the table's left edge, inside the pane gutter. A bar
398
- * marks the caret's row and slides with it; the `+` handle rests under the
399
- * last row and, while the rail is hovered, snaps to the nearest row
400
- * boundary. Hovering the handle previews the insertion as a line across
401
- * the table. Motion is short and eased so the controls feel attached to
402
- * the table rather than popping in.
394
+ * Rails: the row rail hugs the table's left edge (inside the pane gutter),
395
+ * the column rail its top edge (inside the block margin). A bar marks the
396
+ * caret's row / column and slides with it. One handle rests after the last
397
+ * lane as a `+` and, while the rail is hovered, follows the pointer: a `+`
398
+ * near a boundary (hover previews the insertion line), a `−` over a lane
399
+ * (hover tints the lane it will remove). Motion is short and eased so the
400
+ * controls feel attached to the table rather than popping in.
403
401
  */
404
402
  .zui-table-rail {
405
403
  position: absolute;
406
404
  z-index: 4;
407
405
  --zui-table-rail-accent: var(--primary, #6965db);
408
406
  --zui-table-rail-accent-foreground: var(--primary-foreground, #ffffff);
407
+ --zui-table-rail-danger: var(--destructive, #dc2626);
408
+ --zui-table-rail-danger-foreground: var(--destructive-foreground, #ffffff);
409
409
  }
410
410
 
411
411
  .zui-table-rail-marker {
412
412
  position: absolute;
413
- right: 5px;
414
- width: 3px;
415
413
  border-radius: 999px;
416
414
  background: var(--zui-table-rail-accent);
417
415
  opacity: 0.55;
418
416
  pointer-events: none;
419
417
  transition:
420
418
  top 140ms cubic-bezier(0.2, 0, 0, 1),
419
+ left 140ms cubic-bezier(0.2, 0, 0, 1),
420
+ width 140ms cubic-bezier(0.2, 0, 0, 1),
421
421
  height 140ms cubic-bezier(0.2, 0, 0, 1);
422
422
  }
423
423
 
424
- .zui-table-rail-add {
424
+ .zui-table-rail.is-row .zui-table-rail-marker {
425
+ right: 5px;
426
+ width: 3px;
427
+ }
428
+
429
+ .zui-table-rail.is-column .zui-table-rail-marker {
430
+ bottom: 5px;
431
+ height: 3px;
432
+ }
433
+
434
+ .zui-table-rail-handle {
425
435
  position: absolute;
426
- left: 2px;
427
436
  display: inline-flex;
428
437
  align-items: center;
429
438
  justify-content: center;
@@ -436,9 +445,9 @@
436
445
  color: var(--popover-foreground, inherit);
437
446
  box-shadow: var(--shadow-medium, 0 1px 4px rgba(0, 0, 0, 0.08));
438
447
  cursor: pointer;
439
- transform: translateY(-50%);
440
448
  transition:
441
449
  top 140ms cubic-bezier(0.2, 0, 0, 1),
450
+ left 140ms cubic-bezier(0.2, 0, 0, 1),
442
451
  opacity 140ms ease,
443
452
  background-color 120ms ease,
444
453
  color 120ms ease,
@@ -446,17 +455,27 @@
446
455
  scale 120ms ease;
447
456
  }
448
457
 
449
- .zui-table-rail-add.is-resting {
458
+ .zui-table-rail.is-row .zui-table-rail-handle {
459
+ left: 2px;
460
+ transform: translateY(-50%);
461
+ }
462
+
463
+ .zui-table-rail.is-column .zui-table-rail-handle {
464
+ top: 2px;
465
+ transform: translateX(-50%);
466
+ }
467
+
468
+ .zui-table-rail-handle.is-resting {
450
469
  opacity: 0.4;
451
470
  }
452
471
 
453
- .zui-table-rail:hover .zui-table-rail-add,
454
- .zui-table-rail-add:focus-visible {
472
+ .zui-table-rail:hover .zui-table-rail-handle,
473
+ .zui-table-rail-handle:focus-visible {
455
474
  opacity: 1;
456
475
  }
457
476
 
458
- .zui-table-rail-add:hover,
459
- .zui-table-rail-add:focus-visible {
477
+ .zui-table-rail-handle:hover,
478
+ .zui-table-rail-handle:focus-visible {
460
479
  border-color: var(--zui-table-rail-accent);
461
480
  background: var(--zui-table-rail-accent);
462
481
  color: var(--zui-table-rail-accent-foreground);
@@ -464,28 +483,53 @@
464
483
  outline: none;
465
484
  }
466
485
 
467
- .zui-table-rail-line {
486
+ .zui-table-rail-handle.is-delete:hover,
487
+ .zui-table-rail-handle.is-delete:focus-visible {
488
+ border-color: var(--zui-table-rail-danger);
489
+ background: var(--zui-table-rail-danger);
490
+ color: var(--zui-table-rail-danger-foreground);
491
+ }
492
+
493
+ /* Insertion line, or the tinted row / column about to be removed */
494
+ .zui-table-rail-preview {
468
495
  position: absolute;
469
- height: 2px;
470
- border-radius: 1px;
471
- background: var(--zui-table-rail-accent);
472
496
  opacity: 0;
473
497
  pointer-events: none;
474
- transform: translateY(-50%);
475
498
  transition:
476
499
  top 140ms cubic-bezier(0.2, 0, 0, 1),
500
+ left 140ms cubic-bezier(0.2, 0, 0, 1),
477
501
  opacity 120ms ease;
478
502
  }
479
503
 
480
- .zui-table-rail-add:hover + .zui-table-rail-line,
481
- .zui-table-rail-add:focus-visible + .zui-table-rail-line {
504
+ .zui-table-rail-preview.is-insert {
505
+ border-radius: 1px;
506
+ background: var(--zui-table-rail-accent);
507
+ }
508
+
509
+ .zui-table-rail.is-row .zui-table-rail-preview.is-insert {
510
+ height: 2px;
511
+ transform: translateY(-50%);
512
+ }
513
+
514
+ .zui-table-rail.is-column .zui-table-rail-preview.is-insert {
515
+ width: 2px;
516
+ transform: translateX(-50%);
517
+ }
518
+
519
+ .zui-table-rail-preview.is-delete {
520
+ background: color-mix(in srgb, var(--zui-table-rail-danger) 10%, transparent);
521
+ box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--zui-table-rail-danger) 45%, transparent);
522
+ }
523
+
524
+ .zui-table-rail-handle:hover + .zui-table-rail-preview,
525
+ .zui-table-rail-handle:focus-visible + .zui-table-rail-preview {
482
526
  opacity: 1;
483
527
  }
484
528
 
485
529
  @media (prefers-reduced-motion: reduce) {
486
530
  .zui-table-rail-marker,
487
- .zui-table-rail-add,
488
- .zui-table-rail-line {
531
+ .zui-table-rail-handle,
532
+ .zui-table-rail-preview {
489
533
  transition: none;
490
534
  }
491
535
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zuilib/text-editor",
3
- "version": "0.10.0",
4
- "description": "ZUI A markdown editor component wrapping Lexical",
3
+ "version": "0.11.0",
4
+ "description": "ZUI \u2014 A markdown editor component wrapping Lexical",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
@@ -34,12 +34,15 @@
34
34
  "@lexical/rich-text": "^0.35.0",
35
35
  "@lexical/table": "^0.35.0",
36
36
  "@lexical/utils": "^0.35.0",
37
+ "@zuilib/tokens": "^0.0.1",
37
38
  "lexical": "^0.35.0",
38
39
  "react": "^18.0.0 || ^19.0.0",
39
40
  "react-dom": "^18.0.0 || ^19.0.0"
40
41
  },
41
- "dependencies": {
42
- "@zuilib/core": "^0.0.0"
42
+ "peerDependenciesMeta": {
43
+ "@zuilib/tokens": {
44
+ "optional": true
45
+ }
43
46
  },
44
47
  "devDependencies": {
45
48
  "@lexical/code": "^0.35.0",
@@ -55,7 +58,8 @@
55
58
  "@types/react-dom": "^18.0.0 || ^19.0.0",
56
59
  "lexical": "^0.35.0",
57
60
  "react": "^18.0.0 || ^19.0.0",
58
- "react-dom": "^18.0.0 || ^19.0.0"
61
+ "react-dom": "^18.0.0 || ^19.0.0",
62
+ "@zuilib/tokens": "workspace:^"
59
63
  },
60
64
  "keywords": [
61
65
  "lexical",