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.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: "#000000",
450
- white: "#ffffff",
451
- red: "#ff0000",
452
- green: "#008000",
453
- blue: "#0000ff",
454
- yellow: "#ffff00",
455
- cyan: "#00ffff",
456
- magenta: "#ff00ff",
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: "#ffa500",
459
- pink: "#ffc0cb",
460
- purple: "#800080",
461
- violet: "#ee82ee",
462
- brown: "#a52a2a",
463
- gray: "#808080",
464
- grey: "#808080",
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: "#add8e6",
467
- lightgreen: "#90ee90",
468
- lightgray: "#d3d3d3",
469
- lightgrey: "#d3d3d3",
470
- lightpink: "#ffb6c1",
471
- lightyellow: "#ffffe0",
468
+ lightblue: "add8e6",
469
+ lightgreen: "90ee90",
470
+ lightgray: "d3d3d3",
471
+ lightgrey: "d3d3d3",
472
+ lightpink: "ffb6c1",
473
+ lightyellow: "ffffe0",
472
474
  // Dark variants
473
- darkblue: "#00008b",
474
- darkgreen: "#006400",
475
- darkgray: "#a9a9a9",
476
- darkgrey: "#a9a9a9",
477
- darkred: "#8b0000",
475
+ darkblue: "00008b",
476
+ darkgreen: "006400",
477
+ darkgray: "a9a9a9",
478
+ darkgrey: "a9a9a9",
479
+ darkred: "8b0000",
478
480
  // Other common colors
479
- navy: "#000080",
480
- teal: "#008080",
481
- maroon: "#800000",
482
- olive: "#808000",
483
- silver: "#c0c0c0",
484
- aqua: "#00ffff",
485
- fuchsia: "#ff00ff",
486
- lime: "#00ff00",
487
- coral: "#ff7f50",
488
- salmon: "#fa8072",
489
- gold: "#ffd700",
490
- indigo: "#4b0082",
491
- crimson: "#dc143c",
492
- tomato: "#ff6347",
493
- chocolate: "#d2691e",
494
- tan: "#d2b48c",
495
- beige: "#f5f5dc",
496
- ivory: "#fffff0",
497
- khaki: "#f0e68c",
498
- lavender: "#e6e6fa",
499
- plum: "#dda0dd",
500
- orchid: "#da70d6",
501
- turquoise: "#40e0d0",
502
- skyblue: "#87ceeb",
503
- steelblue: "#4682b4",
504
- slategray: "#708090",
505
- slategrey: "#708090"
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;