docx-diff-editor 1.0.50 → 1.0.51
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/index.js +66 -122
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +66 -122
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -452,66 +452,76 @@ var TIMEOUTS = {
|
|
|
452
452
|
/** Cleanup delay (ms) */
|
|
453
453
|
CLEANUP_DELAY: 100
|
|
454
454
|
};
|
|
455
|
+
|
|
456
|
+
// src/services/colorUtils.ts
|
|
455
457
|
var CSS_NAMED_COLORS = {
|
|
456
458
|
// Basic colors
|
|
457
|
-
black: "
|
|
458
|
-
white: "
|
|
459
|
-
red: "
|
|
460
|
-
green: "
|
|
461
|
-
blue: "
|
|
462
|
-
yellow: "
|
|
463
|
-
cyan: "
|
|
464
|
-
magenta: "
|
|
459
|
+
black: "000000",
|
|
460
|
+
white: "ffffff",
|
|
461
|
+
red: "ff0000",
|
|
462
|
+
green: "008000",
|
|
463
|
+
blue: "0000ff",
|
|
464
|
+
yellow: "ffff00",
|
|
465
|
+
cyan: "00ffff",
|
|
466
|
+
magenta: "ff00ff",
|
|
465
467
|
// Extended colors
|
|
466
|
-
orange: "
|
|
467
|
-
pink: "
|
|
468
|
-
purple: "
|
|
469
|
-
violet: "
|
|
470
|
-
brown: "
|
|
471
|
-
gray: "
|
|
472
|
-
grey: "
|
|
468
|
+
orange: "ffa500",
|
|
469
|
+
pink: "ffc0cb",
|
|
470
|
+
purple: "800080",
|
|
471
|
+
violet: "ee82ee",
|
|
472
|
+
brown: "a52a2a",
|
|
473
|
+
gray: "808080",
|
|
474
|
+
grey: "808080",
|
|
473
475
|
// Light variants
|
|
474
|
-
lightblue: "
|
|
475
|
-
lightgreen: "
|
|
476
|
-
lightgray: "
|
|
477
|
-
lightgrey: "
|
|
478
|
-
lightpink: "
|
|
479
|
-
lightyellow: "
|
|
476
|
+
lightblue: "add8e6",
|
|
477
|
+
lightgreen: "90ee90",
|
|
478
|
+
lightgray: "d3d3d3",
|
|
479
|
+
lightgrey: "d3d3d3",
|
|
480
|
+
lightpink: "ffb6c1",
|
|
481
|
+
lightyellow: "ffffe0",
|
|
480
482
|
// Dark variants
|
|
481
|
-
darkblue: "
|
|
482
|
-
darkgreen: "
|
|
483
|
-
darkgray: "
|
|
484
|
-
darkgrey: "
|
|
485
|
-
darkred: "
|
|
483
|
+
darkblue: "00008b",
|
|
484
|
+
darkgreen: "006400",
|
|
485
|
+
darkgray: "a9a9a9",
|
|
486
|
+
darkgrey: "a9a9a9",
|
|
487
|
+
darkred: "8b0000",
|
|
486
488
|
// Other common colors
|
|
487
|
-
navy: "
|
|
488
|
-
teal: "
|
|
489
|
-
maroon: "
|
|
490
|
-
olive: "
|
|
491
|
-
silver: "
|
|
492
|
-
aqua: "
|
|
493
|
-
fuchsia: "
|
|
494
|
-
lime: "
|
|
495
|
-
coral: "
|
|
496
|
-
salmon: "
|
|
497
|
-
gold: "
|
|
498
|
-
indigo: "
|
|
499
|
-
crimson: "
|
|
500
|
-
tomato: "
|
|
501
|
-
chocolate: "
|
|
502
|
-
tan: "
|
|
503
|
-
beige: "
|
|
504
|
-
ivory: "
|
|
505
|
-
khaki: "
|
|
506
|
-
lavender: "
|
|
507
|
-
plum: "
|
|
508
|
-
orchid: "
|
|
509
|
-
turquoise: "
|
|
510
|
-
skyblue: "
|
|
511
|
-
steelblue: "
|
|
512
|
-
slategray: "
|
|
513
|
-
slategrey: "
|
|
489
|
+
navy: "000080",
|
|
490
|
+
teal: "008080",
|
|
491
|
+
maroon: "800000",
|
|
492
|
+
olive: "808000",
|
|
493
|
+
silver: "c0c0c0",
|
|
494
|
+
aqua: "00ffff",
|
|
495
|
+
fuchsia: "ff00ff",
|
|
496
|
+
lime: "00ff00",
|
|
497
|
+
coral: "ff7f50",
|
|
498
|
+
salmon: "fa8072",
|
|
499
|
+
gold: "ffd700",
|
|
500
|
+
indigo: "4b0082",
|
|
501
|
+
crimson: "dc143c",
|
|
502
|
+
tomato: "ff6347",
|
|
503
|
+
chocolate: "d2691e",
|
|
504
|
+
tan: "d2b48c",
|
|
505
|
+
beige: "f5f5dc",
|
|
506
|
+
ivory: "fffff0",
|
|
507
|
+
khaki: "f0e68c",
|
|
508
|
+
lavender: "e6e6fa",
|
|
509
|
+
plum: "dda0dd",
|
|
510
|
+
orchid: "da70d6",
|
|
511
|
+
turquoise: "40e0d0",
|
|
512
|
+
skyblue: "87ceeb",
|
|
513
|
+
steelblue: "4682b4",
|
|
514
|
+
slategray: "708090",
|
|
515
|
+
slategrey: "708090"
|
|
514
516
|
};
|
|
517
|
+
function colorToHexWithoutHash(color) {
|
|
518
|
+
const trimmed = color.trim();
|
|
519
|
+
const lowerColor = trimmed.toLowerCase();
|
|
520
|
+
if (CSS_NAMED_COLORS[lowerColor]) {
|
|
521
|
+
return CSS_NAMED_COLORS[lowerColor];
|
|
522
|
+
}
|
|
523
|
+
return trimmed.replace(/^#/, "");
|
|
524
|
+
}
|
|
515
525
|
function ensureValidCssColor(color) {
|
|
516
526
|
if (typeof color !== "string" || !color) {
|
|
517
527
|
return void 0;
|
|
@@ -519,7 +529,7 @@ function ensureValidCssColor(color) {
|
|
|
519
529
|
const trimmed = color.trim();
|
|
520
530
|
const lowerColor = trimmed.toLowerCase();
|
|
521
531
|
if (CSS_NAMED_COLORS[lowerColor]) {
|
|
522
|
-
return CSS_NAMED_COLORS[lowerColor]
|
|
532
|
+
return `#${CSS_NAMED_COLORS[lowerColor]}`;
|
|
523
533
|
}
|
|
524
534
|
if (/^[0-9a-fA-F]{6}$/.test(trimmed)) {
|
|
525
535
|
return `#${trimmed}`;
|
|
@@ -529,6 +539,8 @@ function ensureValidCssColor(color) {
|
|
|
529
539
|
}
|
|
530
540
|
return trimmed;
|
|
531
541
|
}
|
|
542
|
+
|
|
543
|
+
// src/services/trackChangeInjector.ts
|
|
532
544
|
function normalizeMark(mark) {
|
|
533
545
|
const attrs = { ...mark.attrs || {} };
|
|
534
546
|
if (attrs.color !== void 0) {
|
|
@@ -588,77 +600,9 @@ function createTrackFormatMark(before, after, author = DEFAULT_AUTHOR) {
|
|
|
588
600
|
|
|
589
601
|
// src/services/runPropertiesSync.ts
|
|
590
602
|
var PT_TO_TWIPS = 20;
|
|
591
|
-
var CSS_NAMED_COLORS_HEX = {
|
|
592
|
-
// Basic colors
|
|
593
|
-
black: "000000",
|
|
594
|
-
white: "ffffff",
|
|
595
|
-
red: "ff0000",
|
|
596
|
-
green: "008000",
|
|
597
|
-
blue: "0000ff",
|
|
598
|
-
yellow: "ffff00",
|
|
599
|
-
cyan: "00ffff",
|
|
600
|
-
magenta: "ff00ff",
|
|
601
|
-
// Extended colors
|
|
602
|
-
orange: "ffa500",
|
|
603
|
-
pink: "ffc0cb",
|
|
604
|
-
purple: "800080",
|
|
605
|
-
violet: "ee82ee",
|
|
606
|
-
brown: "a52a2a",
|
|
607
|
-
gray: "808080",
|
|
608
|
-
grey: "808080",
|
|
609
|
-
// Light variants
|
|
610
|
-
lightblue: "add8e6",
|
|
611
|
-
lightgreen: "90ee90",
|
|
612
|
-
lightgray: "d3d3d3",
|
|
613
|
-
lightgrey: "d3d3d3",
|
|
614
|
-
lightpink: "ffb6c1",
|
|
615
|
-
lightyellow: "ffffe0",
|
|
616
|
-
// Dark variants
|
|
617
|
-
darkblue: "00008b",
|
|
618
|
-
darkgreen: "006400",
|
|
619
|
-
darkgray: "a9a9a9",
|
|
620
|
-
darkgrey: "a9a9a9",
|
|
621
|
-
darkred: "8b0000",
|
|
622
|
-
// Other common colors
|
|
623
|
-
navy: "000080",
|
|
624
|
-
teal: "008080",
|
|
625
|
-
maroon: "800000",
|
|
626
|
-
olive: "808000",
|
|
627
|
-
silver: "c0c0c0",
|
|
628
|
-
aqua: "00ffff",
|
|
629
|
-
fuchsia: "ff00ff",
|
|
630
|
-
lime: "00ff00",
|
|
631
|
-
coral: "ff7f50",
|
|
632
|
-
salmon: "fa8072",
|
|
633
|
-
gold: "ffd700",
|
|
634
|
-
indigo: "4b0082",
|
|
635
|
-
crimson: "dc143c",
|
|
636
|
-
tomato: "ff6347",
|
|
637
|
-
chocolate: "d2691e",
|
|
638
|
-
tan: "d2b48c",
|
|
639
|
-
beige: "f5f5dc",
|
|
640
|
-
ivory: "fffff0",
|
|
641
|
-
khaki: "f0e68c",
|
|
642
|
-
lavender: "e6e6fa",
|
|
643
|
-
plum: "dda0dd",
|
|
644
|
-
orchid: "da70d6",
|
|
645
|
-
turquoise: "40e0d0",
|
|
646
|
-
skyblue: "87ceeb",
|
|
647
|
-
steelblue: "4682b4",
|
|
648
|
-
slategray: "708090",
|
|
649
|
-
slategrey: "708090"
|
|
650
|
-
};
|
|
651
603
|
function ptToTwips(ptValue) {
|
|
652
604
|
return Math.round(ptValue * PT_TO_TWIPS);
|
|
653
605
|
}
|
|
654
|
-
function colorToHexWithoutHash(color) {
|
|
655
|
-
const trimmed = color.trim();
|
|
656
|
-
const lowerColor = trimmed.toLowerCase();
|
|
657
|
-
if (CSS_NAMED_COLORS_HEX[lowerColor]) {
|
|
658
|
-
return CSS_NAMED_COLORS_HEX[lowerColor];
|
|
659
|
-
}
|
|
660
|
-
return trimmed.replace(/^#/, "");
|
|
661
|
-
}
|
|
662
606
|
function parseFontSizeToPoints(fontSize) {
|
|
663
607
|
if (typeof fontSize === "number") {
|
|
664
608
|
return fontSize;
|