@zuilib/text-editor 0.8.0 → 0.10.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 +29 -0
- package/README.md +33 -1
- package/dist/index.d.ts +213 -99
- package/dist/index.js +1270 -472
- package/dist/styles.css +126 -5
- package/package.json +1 -1
package/dist/styles.css
CHANGED
|
@@ -366,16 +366,19 @@
|
|
|
366
366
|
}
|
|
367
367
|
|
|
368
368
|
/*
|
|
369
|
-
* Floating table
|
|
370
|
-
*
|
|
371
|
-
*
|
|
372
|
-
*
|
|
373
|
-
*
|
|
369
|
+
* Floating table controls (positioned within .zui-text-editor-main, so they
|
|
370
|
+
* scroll with the document; TableControlsPlugin.tsx).
|
|
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).
|
|
374
376
|
*/
|
|
375
377
|
.zui-table-settings {
|
|
376
378
|
position: absolute;
|
|
377
379
|
z-index: 5;
|
|
378
380
|
display: flex;
|
|
381
|
+
align-items: center;
|
|
379
382
|
gap: 0.125rem;
|
|
380
383
|
padding: 0.125rem;
|
|
381
384
|
border: 1px solid var(--border, color-mix(in srgb, currentColor 12%, transparent));
|
|
@@ -386,6 +389,107 @@
|
|
|
386
389
|
transform: translateY(-70%);
|
|
387
390
|
}
|
|
388
391
|
|
|
392
|
+
.zui-table-settings > .zui-text-editor-toolbar-divider {
|
|
393
|
+
margin: 0 0.125rem;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
/*
|
|
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.
|
|
403
|
+
*/
|
|
404
|
+
.zui-table-rail {
|
|
405
|
+
position: absolute;
|
|
406
|
+
z-index: 4;
|
|
407
|
+
--zui-table-rail-accent: var(--primary, #6965db);
|
|
408
|
+
--zui-table-rail-accent-foreground: var(--primary-foreground, #ffffff);
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
.zui-table-rail-marker {
|
|
412
|
+
position: absolute;
|
|
413
|
+
right: 5px;
|
|
414
|
+
width: 3px;
|
|
415
|
+
border-radius: 999px;
|
|
416
|
+
background: var(--zui-table-rail-accent);
|
|
417
|
+
opacity: 0.55;
|
|
418
|
+
pointer-events: none;
|
|
419
|
+
transition:
|
|
420
|
+
top 140ms cubic-bezier(0.2, 0, 0, 1),
|
|
421
|
+
height 140ms cubic-bezier(0.2, 0, 0, 1);
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
.zui-table-rail-add {
|
|
425
|
+
position: absolute;
|
|
426
|
+
left: 2px;
|
|
427
|
+
display: inline-flex;
|
|
428
|
+
align-items: center;
|
|
429
|
+
justify-content: center;
|
|
430
|
+
width: 20px;
|
|
431
|
+
height: 20px;
|
|
432
|
+
padding: 0;
|
|
433
|
+
border: 1px solid var(--border, color-mix(in srgb, currentColor 14%, transparent));
|
|
434
|
+
border-radius: 999px;
|
|
435
|
+
background: var(--popover, #ffffff);
|
|
436
|
+
color: var(--popover-foreground, inherit);
|
|
437
|
+
box-shadow: var(--shadow-medium, 0 1px 4px rgba(0, 0, 0, 0.08));
|
|
438
|
+
cursor: pointer;
|
|
439
|
+
transform: translateY(-50%);
|
|
440
|
+
transition:
|
|
441
|
+
top 140ms cubic-bezier(0.2, 0, 0, 1),
|
|
442
|
+
opacity 140ms ease,
|
|
443
|
+
background-color 120ms ease,
|
|
444
|
+
color 120ms ease,
|
|
445
|
+
border-color 120ms ease,
|
|
446
|
+
scale 120ms ease;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
.zui-table-rail-add.is-resting {
|
|
450
|
+
opacity: 0.4;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
.zui-table-rail:hover .zui-table-rail-add,
|
|
454
|
+
.zui-table-rail-add:focus-visible {
|
|
455
|
+
opacity: 1;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
.zui-table-rail-add:hover,
|
|
459
|
+
.zui-table-rail-add:focus-visible {
|
|
460
|
+
border-color: var(--zui-table-rail-accent);
|
|
461
|
+
background: var(--zui-table-rail-accent);
|
|
462
|
+
color: var(--zui-table-rail-accent-foreground);
|
|
463
|
+
scale: 1.1;
|
|
464
|
+
outline: none;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
.zui-table-rail-line {
|
|
468
|
+
position: absolute;
|
|
469
|
+
height: 2px;
|
|
470
|
+
border-radius: 1px;
|
|
471
|
+
background: var(--zui-table-rail-accent);
|
|
472
|
+
opacity: 0;
|
|
473
|
+
pointer-events: none;
|
|
474
|
+
transform: translateY(-50%);
|
|
475
|
+
transition:
|
|
476
|
+
top 140ms cubic-bezier(0.2, 0, 0, 1),
|
|
477
|
+
opacity 120ms ease;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
.zui-table-rail-add:hover + .zui-table-rail-line,
|
|
481
|
+
.zui-table-rail-add:focus-visible + .zui-table-rail-line {
|
|
482
|
+
opacity: 1;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
@media (prefers-reduced-motion: reduce) {
|
|
486
|
+
.zui-table-rail-marker,
|
|
487
|
+
.zui-table-rail-add,
|
|
488
|
+
.zui-table-rail-line {
|
|
489
|
+
transition: none;
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
|
|
389
493
|
/*
|
|
390
494
|
* Drawing canvas.
|
|
391
495
|
*
|
|
@@ -884,3 +988,20 @@
|
|
|
884
988
|
.zui-token-meta { color: var(--zui-code-meta); }
|
|
885
989
|
.zui-token-inserted { color: var(--zui-code-inserted); background: var(--zui-code-inserted-background); }
|
|
886
990
|
.zui-token-deleted { color: var(--zui-code-deleted); background: var(--zui-code-deleted-background); }
|
|
991
|
+
|
|
992
|
+
/*
|
|
993
|
+
* Ink drawing style (`drawingStyle="ink"`). Geometry is handled by the
|
|
994
|
+
* renderer (drawing/ink.ts); the stylesheet only switches the face: Recursive
|
|
995
|
+
* on its casual/cursive axes when the host loads it, the regular font
|
|
996
|
+
* otherwise. Load it with e.g.
|
|
997
|
+
* https://fonts.googleapis.com/css2?family=Recursive:slnt,wght,CASL,CRSV,MONO@-15..0,300..1000,0..1,0..1,0..1
|
|
998
|
+
*/
|
|
999
|
+
.zui-drawing-canvas.is-ink {
|
|
1000
|
+
--zui-drawing-font: 'Recursive', ui-sans-serif, system-ui, sans-serif;
|
|
1001
|
+
--zui-drawing-grid: rgba(0, 0, 0, 0.06);
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
.zui-drawing-canvas.is-ink :is(.zui-drawing-surface text, .zui-drawing-text-input) {
|
|
1005
|
+
font-variation-settings: 'CASL' 1, 'CRSV' 1, 'MONO' 0, 'wght' 440, 'slnt' -3;
|
|
1006
|
+
letter-spacing: 0.01em;
|
|
1007
|
+
}
|