awesome-timeline-react 0.12.0 → 0.13.1

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
@@ -573,9 +573,20 @@ var drawTimeBar = (ctx, {
573
573
  bottomBlocks,
574
574
  font,
575
575
  borderColor = DEFAULT_THEME.timeBarBorder,
576
- textColor = DEFAULT_THEME.timeBarTextColor
576
+ textColor = DEFAULT_THEME.timeBarTextColor,
577
+ topBackground,
578
+ bottomBackground,
579
+ bottomTextColor = textColor
577
580
  }) => {
578
581
  const mid = height / 2;
582
+ if (topBackground) {
583
+ ctx.fillStyle = topBackground;
584
+ ctx.fillRect(0, 0, width, Math.round(mid));
585
+ }
586
+ if (bottomBackground) {
587
+ ctx.fillStyle = bottomBackground;
588
+ ctx.fillRect(0, Math.round(mid), width, height - Math.round(mid));
589
+ }
579
590
  ctx.strokeStyle = borderColor;
580
591
  ctx.lineWidth = 1;
581
592
  ctx.beginPath();
@@ -607,6 +618,7 @@ var drawTimeBar = (ctx, {
607
618
  block.width - inset
608
619
  );
609
620
  }
621
+ ctx.fillStyle = bottomTextColor;
610
622
  for (const block of bottomBlocks) {
611
623
  ctx.fillText(
612
624
  block.label,
@@ -632,7 +644,7 @@ var CanvasTimeBar = ({
632
644
  const canvasRef = useRef3(null);
633
645
  const header = theme != null ? theme : DEFAULT_THEME;
634
646
  useEffect3(() => {
635
- var _a2;
647
+ var _a2, _b;
636
648
  const canvas = canvasRef.current;
637
649
  if (!canvas || !contentWidth) return;
638
650
  const ctx = sizeCanvas(
@@ -650,6 +662,9 @@ var CanvasTimeBar = ({
650
662
  font: (_a2 = theme == null ? void 0 : theme.font) != null ? _a2 : getComputedStyle(canvas).font,
651
663
  borderColor: theme == null ? void 0 : theme.timeBarBorder,
652
664
  textColor: theme == null ? void 0 : theme.timeBarTextColor,
665
+ topBackground: theme == null ? void 0 : theme.timeBarTopBackground,
666
+ bottomBackground: theme == null ? void 0 : theme.timeBarBottomBackground,
667
+ bottomTextColor: (_b = theme == null ? void 0 : theme.timeBarBottomTextColor) != null ? _b : theme == null ? void 0 : theme.timeBarTextColor,
653
668
  topBlocks: generateUnitBlocks(__spreadProps(__spreadValues({}, topRow), { windowStart, windowEnd, tick })),
654
669
  bottomBlocks: generateUnitBlocks(__spreadProps(__spreadValues({}, bottomRow), {
655
670
  windowStart,
@@ -1094,6 +1109,7 @@ var drawEvents = (ctx, view, scene, font, animator) => {
1094
1109
  defaultDrawEvent(ctx, event, rect, view, font, geometry.barRadius);
1095
1110
  }
1096
1111
  if (view.stripeOverlap && rowStatics.length > 0) {
1112
+ ctx.shadowColor = "transparent";
1097
1113
  paintOverlapStripes(
1098
1114
  ctx,
1099
1115
  event,