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