@optifye/dashboard-core 6.10.10 → 6.10.12

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.d.mts CHANGED
@@ -4816,6 +4816,7 @@ declare class WorkspaceHealthService {
4816
4816
  private getFromCache;
4817
4817
  private setCache;
4818
4818
  private getShiftTiming;
4819
+ private getShiftTimingForDateShift;
4819
4820
  private normalizeHourBucket;
4820
4821
  private normalizeOutputHourly;
4821
4822
  private interpretUptimeValue;
package/dist/index.d.ts CHANGED
@@ -4816,6 +4816,7 @@ declare class WorkspaceHealthService {
4816
4816
  private getFromCache;
4817
4817
  private setCache;
4818
4818
  private getShiftTiming;
4819
+ private getShiftTimingForDateShift;
4819
4820
  private normalizeHourBucket;
4820
4821
  private normalizeOutputHourly;
4821
4822
  private interpretUptimeValue;
package/dist/index.js CHANGED
@@ -536,8 +536,13 @@ var memoizedOutputArrayAggregation = createMemoizedFunction(
536
536
  var getOperationalDate = (timezone, date = /* @__PURE__ */ new Date(), shiftStartTime = "06:00") => {
537
537
  const zonedDate = dateFnsTz.toZonedTime(date, timezone);
538
538
  const hours = zonedDate.getHours();
539
- const [startHour = 6] = shiftStartTime.split(":").map(Number);
540
- const operationalDate = hours < startHour ? dateFns.subDays(zonedDate, 1) : zonedDate;
539
+ const minutes = zonedDate.getMinutes();
540
+ const [startHourRaw, startMinuteRaw] = shiftStartTime.split(":").map(Number);
541
+ const startHour = Number.isFinite(startHourRaw) ? startHourRaw : 6;
542
+ const startMinute = Number.isFinite(startMinuteRaw) ? startMinuteRaw : 0;
543
+ const currentTotalMinutes = hours * 60 + minutes;
544
+ const shiftStartTotalMinutes = startHour * 60 + startMinute;
545
+ const operationalDate = currentTotalMinutes < shiftStartTotalMinutes ? dateFns.subDays(zonedDate, 1) : zonedDate;
541
546
  return dateFns.format(operationalDate, "yyyy-MM-dd");
542
547
  };
543
548
  function formatTimeInZone(time2, timezone, formatString = "HH:mm:ss") {
@@ -2457,6 +2462,39 @@ var WorkspaceHealthService = class _WorkspaceHealthService {
2457
2462
  pendingMinutes
2458
2463
  };
2459
2464
  }
2465
+ getShiftTimingForDateShift(shiftConfig, queryDate, queryShiftId) {
2466
+ const targetShiftConfig = shiftConfig?.shifts?.find((s) => s.shiftId === queryShiftId);
2467
+ const startTime = targetShiftConfig?.startTime || "06:00";
2468
+ const endTime = targetShiftConfig?.endTime || "18:00";
2469
+ const [year, month, day] = queryDate.split("-").map(Number);
2470
+ const [startHour = 0, startMin = 0] = startTime.split(":").map(Number);
2471
+ const [endHour = 0, endMin = 0] = endTime.split(":").map(Number);
2472
+ const shiftStartDate = new Date(year, month - 1, day, startHour, startMin, 0);
2473
+ let shiftEndDate;
2474
+ if (endHour < startHour || endHour === startHour && endMin < startMin) {
2475
+ shiftEndDate = new Date(year, month - 1, day + 1, endHour, endMin, 0);
2476
+ } else {
2477
+ shiftEndDate = new Date(year, month - 1, day, endHour, endMin, 0);
2478
+ }
2479
+ const totalMinutes = Math.floor((shiftEndDate.getTime() - shiftStartDate.getTime()) / (1e3 * 60));
2480
+ const now2 = /* @__PURE__ */ new Date();
2481
+ let completedMinutes;
2482
+ if (shiftEndDate < now2) {
2483
+ completedMinutes = totalMinutes;
2484
+ } else if (shiftStartDate > now2) {
2485
+ completedMinutes = 0;
2486
+ } else {
2487
+ completedMinutes = Math.floor((now2.getTime() - shiftStartDate.getTime()) / (1e3 * 60));
2488
+ }
2489
+ const pendingMinutes = totalMinutes - completedMinutes;
2490
+ return {
2491
+ shiftStartDate,
2492
+ shiftEndDate,
2493
+ totalMinutes,
2494
+ completedMinutes,
2495
+ pendingMinutes
2496
+ };
2497
+ }
2460
2498
  normalizeHourBucket(bucket) {
2461
2499
  if (Array.isArray(bucket)) return bucket;
2462
2500
  if (bucket && Array.isArray(bucket.values)) return bucket.values;
@@ -2926,14 +2964,22 @@ var WorkspaceHealthService = class _WorkspaceHealthService {
2926
2964
  if (!passedShiftConfig) {
2927
2965
  console.warn("[workspaceHealthService.calculateWorkspaceUptime] \u26A0\uFE0F No shiftConfig passed! Falling back to static config. This may cause incorrect shift_id queries.");
2928
2966
  }
2929
- const {
2930
- shiftId: currentShiftId,
2931
- date: currentDate,
2932
- shiftStartDate,
2933
- completedMinutes
2934
- } = this.getShiftTiming(effectiveTimezone, shiftConfig);
2935
- const queryDate = overrideDate ?? currentDate;
2936
- const queryShiftId = overrideShiftId ?? currentShiftId;
2967
+ const currentTiming = this.getShiftTiming(effectiveTimezone, shiftConfig);
2968
+ const queryDate = overrideDate ?? currentTiming.date;
2969
+ const queryShiftId = overrideShiftId ?? currentTiming.shiftId;
2970
+ let shiftStartDate = currentTiming.shiftStartDate;
2971
+ let completedMinutes = currentTiming.completedMinutes;
2972
+ const isHistoricalDate = overrideDate && overrideDate !== currentTiming.date;
2973
+ const isDifferentShift = overrideShiftId !== void 0 && overrideShiftId !== currentTiming.shiftId;
2974
+ if (isHistoricalDate || isDifferentShift) {
2975
+ const overrideTiming = this.getShiftTimingForDateShift(
2976
+ shiftConfig,
2977
+ queryDate,
2978
+ queryShiftId
2979
+ );
2980
+ shiftStartDate = overrideTiming.shiftStartDate;
2981
+ completedMinutes = overrideTiming.completedMinutes;
2982
+ }
2937
2983
  const tableName = `performance_metrics_${companyId.replace(/-/g, "_")}`;
2938
2984
  try {
2939
2985
  const { data: queryData, error } = await supabase.from(tableName).select("workspace_id, workspace_display_name, output_hourly, output_array, line_id").eq("date", queryDate).eq("shift_id", queryShiftId);
@@ -3008,12 +3054,27 @@ var WorkspaceHealthService = class _WorkspaceHealthService {
3008
3054
  const queryConfigs = [];
3009
3055
  lineShiftConfigs.forEach((config, lineId) => {
3010
3056
  const timing = this.getShiftTiming(timezone, config);
3057
+ const queryDate = overrideDate ?? timing.date;
3058
+ const queryShiftId = overrideShiftId ?? timing.shiftId;
3059
+ let shiftStartDate = timing.shiftStartDate;
3060
+ let completedMinutes = timing.completedMinutes;
3061
+ const isHistoricalDate = overrideDate && overrideDate !== timing.date;
3062
+ const isDifferentShift = overrideShiftId !== void 0 && overrideShiftId !== timing.shiftId;
3063
+ if (isHistoricalDate || isDifferentShift) {
3064
+ const overrideTiming = this.getShiftTimingForDateShift(
3065
+ config,
3066
+ queryDate,
3067
+ queryShiftId
3068
+ );
3069
+ shiftStartDate = overrideTiming.shiftStartDate;
3070
+ completedMinutes = overrideTiming.completedMinutes;
3071
+ }
3011
3072
  queryConfigs.push({
3012
3073
  lineId,
3013
- date: overrideDate ?? timing.date,
3014
- shiftId: overrideShiftId ?? timing.shiftId,
3015
- shiftStartDate: timing.shiftStartDate,
3016
- completedMinutes: timing.completedMinutes
3074
+ date: queryDate,
3075
+ shiftId: queryShiftId,
3076
+ shiftStartDate,
3077
+ completedMinutes
3017
3078
  });
3018
3079
  });
3019
3080
  const uniqueQueries = /* @__PURE__ */ new Map();
@@ -3038,7 +3099,12 @@ var WorkspaceHealthService = class _WorkspaceHealthService {
3038
3099
  });
3039
3100
  const queryPromises = Array.from(uniqueQueries.entries()).map(async ([key, { date, shiftId, lineConfigs }]) => {
3040
3101
  try {
3041
- const { data, error } = await supabase.from(tableName).select("workspace_id, workspace_display_name, output_hourly, output_array, line_id").eq("date", date).eq("shift_id", shiftId);
3102
+ const lineIds = Array.from(new Set(lineConfigs.map((lc) => lc.lineId).filter(Boolean)));
3103
+ let query = supabase.from(tableName).select("workspace_id, workspace_display_name, output_hourly, output_array, line_id").eq("date", date).eq("shift_id", shiftId);
3104
+ if (lineIds.length > 0) {
3105
+ query = query.in("line_id", lineIds);
3106
+ }
3107
+ const { data, error } = await query;
3042
3108
  if (error) {
3043
3109
  console.error(`[calculateWorkspaceUptimeMultiLine] Error fetching metrics for ${key}:`, error);
3044
3110
  return { records: [], lineConfigs };
@@ -3059,11 +3125,16 @@ var WorkspaceHealthService = class _WorkspaceHealthService {
3059
3125
  recordWorkspaceDisplayName: record.workspace_display_name,
3060
3126
  availableLineIds: lineConfigs.map((lc) => lc.lineId),
3061
3127
  matchFound: !!lineConfig,
3062
- matchedLineId: lineConfig?.lineId || "FALLBACK to " + lineConfigs[0]?.lineId
3128
+ matchedLineId: lineConfig?.lineId || "none"
3063
3129
  });
3064
- const effectiveLineConfig = lineConfig || lineConfigs[0];
3065
- if (!effectiveLineConfig) continue;
3066
- const { shiftStartDate, completedMinutes } = effectiveLineConfig;
3130
+ if (!lineConfig) {
3131
+ console.warn("[calculateWorkspaceUptimeMultiLine] No line config match for record, skipping", {
3132
+ recordLineId: record.line_id,
3133
+ recordWorkspaceId: record.workspace_id
3134
+ });
3135
+ continue;
3136
+ }
3137
+ const { shiftStartDate, completedMinutes } = lineConfig;
3067
3138
  const outputHourly = this.normalizeOutputHourly(record.output_hourly || {});
3068
3139
  const outputArray = Array.isArray(record.output_array) ? record.output_array : [];
3069
3140
  let uptimeMinutes = 0;
@@ -58039,6 +58110,8 @@ var ClipVideoCarousel = ({ clips, clipsService }) => {
58039
58110
  const [videos, setVideos] = React24.useState([]);
58040
58111
  const [loading, setLoading] = React24.useState(false);
58041
58112
  const [error, setError] = React24.useState(null);
58113
+ const currentVideo = videos[currentIndex];
58114
+ const { crop: workspaceCrop } = useWorkspaceCrop(currentVideo?.workspace_id || null);
58042
58115
  React24.useEffect(() => {
58043
58116
  let cancelled = false;
58044
58117
  const load = async () => {
@@ -58058,7 +58131,8 @@ var ClipVideoCarousel = ({ clips, clipsService }) => {
58058
58131
  const cycleTime = typeof c.cycle_time_seconds === "number" ? c.cycle_time_seconds : typeof c.cycle_sec === "number" ? c.cycle_sec : void 0;
58059
58132
  return {
58060
58133
  ...video,
58061
- cycle_time_seconds: cycleTime ?? video.cycle_time_seconds
58134
+ cycle_time_seconds: cycleTime ?? video.cycle_time_seconds,
58135
+ workspace_id: c.workspace_id
58062
58136
  };
58063
58137
  })
58064
58138
  );
@@ -58089,17 +58163,17 @@ var ClipVideoCarousel = ({ clips, clipsService }) => {
58089
58163
  setCurrentIndex((prev) => (prev - 1 + Math.max(videos.length, 1)) % Math.max(videos.length, 1));
58090
58164
  };
58091
58165
  if (!clips || clips.length === 0) return null;
58092
- const currentVideo = videos[currentIndex];
58093
58166
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative group bg-gray-900 rounded-lg overflow-hidden aspect-video", children: [
58094
58167
  loading && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 flex items-center justify-center text-sm text-white/80", children: "Loading clips\u2026" }),
58095
58168
  !loading && error && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 flex items-center justify-center text-sm text-white/80", children: error }),
58096
58169
  !loading && !error && currentVideo?.src && /* @__PURE__ */ jsxRuntime.jsx(
58097
- VideoPlayer,
58170
+ CroppedVideoPlayer,
58098
58171
  {
58099
58172
  src: currentVideo.src,
58100
58173
  className: "w-full h-full object-cover opacity-90 group-hover:opacity-100 transition-opacity",
58101
58174
  controls: true,
58102
- playsInline: true
58175
+ playsInline: true,
58176
+ crop: workspaceCrop?.crop || null
58103
58177
  },
58104
58178
  currentVideo.src
58105
58179
  ),
package/dist/index.mjs CHANGED
@@ -507,8 +507,13 @@ var memoizedOutputArrayAggregation = createMemoizedFunction(
507
507
  var getOperationalDate = (timezone, date = /* @__PURE__ */ new Date(), shiftStartTime = "06:00") => {
508
508
  const zonedDate = toZonedTime(date, timezone);
509
509
  const hours = zonedDate.getHours();
510
- const [startHour = 6] = shiftStartTime.split(":").map(Number);
511
- const operationalDate = hours < startHour ? subDays(zonedDate, 1) : zonedDate;
510
+ const minutes = zonedDate.getMinutes();
511
+ const [startHourRaw, startMinuteRaw] = shiftStartTime.split(":").map(Number);
512
+ const startHour = Number.isFinite(startHourRaw) ? startHourRaw : 6;
513
+ const startMinute = Number.isFinite(startMinuteRaw) ? startMinuteRaw : 0;
514
+ const currentTotalMinutes = hours * 60 + minutes;
515
+ const shiftStartTotalMinutes = startHour * 60 + startMinute;
516
+ const operationalDate = currentTotalMinutes < shiftStartTotalMinutes ? subDays(zonedDate, 1) : zonedDate;
512
517
  return format(operationalDate, "yyyy-MM-dd");
513
518
  };
514
519
  function formatTimeInZone(time2, timezone, formatString = "HH:mm:ss") {
@@ -2428,6 +2433,39 @@ var WorkspaceHealthService = class _WorkspaceHealthService {
2428
2433
  pendingMinutes
2429
2434
  };
2430
2435
  }
2436
+ getShiftTimingForDateShift(shiftConfig, queryDate, queryShiftId) {
2437
+ const targetShiftConfig = shiftConfig?.shifts?.find((s) => s.shiftId === queryShiftId);
2438
+ const startTime = targetShiftConfig?.startTime || "06:00";
2439
+ const endTime = targetShiftConfig?.endTime || "18:00";
2440
+ const [year, month, day] = queryDate.split("-").map(Number);
2441
+ const [startHour = 0, startMin = 0] = startTime.split(":").map(Number);
2442
+ const [endHour = 0, endMin = 0] = endTime.split(":").map(Number);
2443
+ const shiftStartDate = new Date(year, month - 1, day, startHour, startMin, 0);
2444
+ let shiftEndDate;
2445
+ if (endHour < startHour || endHour === startHour && endMin < startMin) {
2446
+ shiftEndDate = new Date(year, month - 1, day + 1, endHour, endMin, 0);
2447
+ } else {
2448
+ shiftEndDate = new Date(year, month - 1, day, endHour, endMin, 0);
2449
+ }
2450
+ const totalMinutes = Math.floor((shiftEndDate.getTime() - shiftStartDate.getTime()) / (1e3 * 60));
2451
+ const now2 = /* @__PURE__ */ new Date();
2452
+ let completedMinutes;
2453
+ if (shiftEndDate < now2) {
2454
+ completedMinutes = totalMinutes;
2455
+ } else if (shiftStartDate > now2) {
2456
+ completedMinutes = 0;
2457
+ } else {
2458
+ completedMinutes = Math.floor((now2.getTime() - shiftStartDate.getTime()) / (1e3 * 60));
2459
+ }
2460
+ const pendingMinutes = totalMinutes - completedMinutes;
2461
+ return {
2462
+ shiftStartDate,
2463
+ shiftEndDate,
2464
+ totalMinutes,
2465
+ completedMinutes,
2466
+ pendingMinutes
2467
+ };
2468
+ }
2431
2469
  normalizeHourBucket(bucket) {
2432
2470
  if (Array.isArray(bucket)) return bucket;
2433
2471
  if (bucket && Array.isArray(bucket.values)) return bucket.values;
@@ -2897,14 +2935,22 @@ var WorkspaceHealthService = class _WorkspaceHealthService {
2897
2935
  if (!passedShiftConfig) {
2898
2936
  console.warn("[workspaceHealthService.calculateWorkspaceUptime] \u26A0\uFE0F No shiftConfig passed! Falling back to static config. This may cause incorrect shift_id queries.");
2899
2937
  }
2900
- const {
2901
- shiftId: currentShiftId,
2902
- date: currentDate,
2903
- shiftStartDate,
2904
- completedMinutes
2905
- } = this.getShiftTiming(effectiveTimezone, shiftConfig);
2906
- const queryDate = overrideDate ?? currentDate;
2907
- const queryShiftId = overrideShiftId ?? currentShiftId;
2938
+ const currentTiming = this.getShiftTiming(effectiveTimezone, shiftConfig);
2939
+ const queryDate = overrideDate ?? currentTiming.date;
2940
+ const queryShiftId = overrideShiftId ?? currentTiming.shiftId;
2941
+ let shiftStartDate = currentTiming.shiftStartDate;
2942
+ let completedMinutes = currentTiming.completedMinutes;
2943
+ const isHistoricalDate = overrideDate && overrideDate !== currentTiming.date;
2944
+ const isDifferentShift = overrideShiftId !== void 0 && overrideShiftId !== currentTiming.shiftId;
2945
+ if (isHistoricalDate || isDifferentShift) {
2946
+ const overrideTiming = this.getShiftTimingForDateShift(
2947
+ shiftConfig,
2948
+ queryDate,
2949
+ queryShiftId
2950
+ );
2951
+ shiftStartDate = overrideTiming.shiftStartDate;
2952
+ completedMinutes = overrideTiming.completedMinutes;
2953
+ }
2908
2954
  const tableName = `performance_metrics_${companyId.replace(/-/g, "_")}`;
2909
2955
  try {
2910
2956
  const { data: queryData, error } = await supabase.from(tableName).select("workspace_id, workspace_display_name, output_hourly, output_array, line_id").eq("date", queryDate).eq("shift_id", queryShiftId);
@@ -2979,12 +3025,27 @@ var WorkspaceHealthService = class _WorkspaceHealthService {
2979
3025
  const queryConfigs = [];
2980
3026
  lineShiftConfigs.forEach((config, lineId) => {
2981
3027
  const timing = this.getShiftTiming(timezone, config);
3028
+ const queryDate = overrideDate ?? timing.date;
3029
+ const queryShiftId = overrideShiftId ?? timing.shiftId;
3030
+ let shiftStartDate = timing.shiftStartDate;
3031
+ let completedMinutes = timing.completedMinutes;
3032
+ const isHistoricalDate = overrideDate && overrideDate !== timing.date;
3033
+ const isDifferentShift = overrideShiftId !== void 0 && overrideShiftId !== timing.shiftId;
3034
+ if (isHistoricalDate || isDifferentShift) {
3035
+ const overrideTiming = this.getShiftTimingForDateShift(
3036
+ config,
3037
+ queryDate,
3038
+ queryShiftId
3039
+ );
3040
+ shiftStartDate = overrideTiming.shiftStartDate;
3041
+ completedMinutes = overrideTiming.completedMinutes;
3042
+ }
2982
3043
  queryConfigs.push({
2983
3044
  lineId,
2984
- date: overrideDate ?? timing.date,
2985
- shiftId: overrideShiftId ?? timing.shiftId,
2986
- shiftStartDate: timing.shiftStartDate,
2987
- completedMinutes: timing.completedMinutes
3045
+ date: queryDate,
3046
+ shiftId: queryShiftId,
3047
+ shiftStartDate,
3048
+ completedMinutes
2988
3049
  });
2989
3050
  });
2990
3051
  const uniqueQueries = /* @__PURE__ */ new Map();
@@ -3009,7 +3070,12 @@ var WorkspaceHealthService = class _WorkspaceHealthService {
3009
3070
  });
3010
3071
  const queryPromises = Array.from(uniqueQueries.entries()).map(async ([key, { date, shiftId, lineConfigs }]) => {
3011
3072
  try {
3012
- const { data, error } = await supabase.from(tableName).select("workspace_id, workspace_display_name, output_hourly, output_array, line_id").eq("date", date).eq("shift_id", shiftId);
3073
+ const lineIds = Array.from(new Set(lineConfigs.map((lc) => lc.lineId).filter(Boolean)));
3074
+ let query = supabase.from(tableName).select("workspace_id, workspace_display_name, output_hourly, output_array, line_id").eq("date", date).eq("shift_id", shiftId);
3075
+ if (lineIds.length > 0) {
3076
+ query = query.in("line_id", lineIds);
3077
+ }
3078
+ const { data, error } = await query;
3013
3079
  if (error) {
3014
3080
  console.error(`[calculateWorkspaceUptimeMultiLine] Error fetching metrics for ${key}:`, error);
3015
3081
  return { records: [], lineConfigs };
@@ -3030,11 +3096,16 @@ var WorkspaceHealthService = class _WorkspaceHealthService {
3030
3096
  recordWorkspaceDisplayName: record.workspace_display_name,
3031
3097
  availableLineIds: lineConfigs.map((lc) => lc.lineId),
3032
3098
  matchFound: !!lineConfig,
3033
- matchedLineId: lineConfig?.lineId || "FALLBACK to " + lineConfigs[0]?.lineId
3099
+ matchedLineId: lineConfig?.lineId || "none"
3034
3100
  });
3035
- const effectiveLineConfig = lineConfig || lineConfigs[0];
3036
- if (!effectiveLineConfig) continue;
3037
- const { shiftStartDate, completedMinutes } = effectiveLineConfig;
3101
+ if (!lineConfig) {
3102
+ console.warn("[calculateWorkspaceUptimeMultiLine] No line config match for record, skipping", {
3103
+ recordLineId: record.line_id,
3104
+ recordWorkspaceId: record.workspace_id
3105
+ });
3106
+ continue;
3107
+ }
3108
+ const { shiftStartDate, completedMinutes } = lineConfig;
3038
3109
  const outputHourly = this.normalizeOutputHourly(record.output_hourly || {});
3039
3110
  const outputArray = Array.isArray(record.output_array) ? record.output_array : [];
3040
3111
  let uptimeMinutes = 0;
@@ -58010,6 +58081,8 @@ var ClipVideoCarousel = ({ clips, clipsService }) => {
58010
58081
  const [videos, setVideos] = useState([]);
58011
58082
  const [loading, setLoading] = useState(false);
58012
58083
  const [error, setError] = useState(null);
58084
+ const currentVideo = videos[currentIndex];
58085
+ const { crop: workspaceCrop } = useWorkspaceCrop(currentVideo?.workspace_id || null);
58013
58086
  useEffect(() => {
58014
58087
  let cancelled = false;
58015
58088
  const load = async () => {
@@ -58029,7 +58102,8 @@ var ClipVideoCarousel = ({ clips, clipsService }) => {
58029
58102
  const cycleTime = typeof c.cycle_time_seconds === "number" ? c.cycle_time_seconds : typeof c.cycle_sec === "number" ? c.cycle_sec : void 0;
58030
58103
  return {
58031
58104
  ...video,
58032
- cycle_time_seconds: cycleTime ?? video.cycle_time_seconds
58105
+ cycle_time_seconds: cycleTime ?? video.cycle_time_seconds,
58106
+ workspace_id: c.workspace_id
58033
58107
  };
58034
58108
  })
58035
58109
  );
@@ -58060,17 +58134,17 @@ var ClipVideoCarousel = ({ clips, clipsService }) => {
58060
58134
  setCurrentIndex((prev) => (prev - 1 + Math.max(videos.length, 1)) % Math.max(videos.length, 1));
58061
58135
  };
58062
58136
  if (!clips || clips.length === 0) return null;
58063
- const currentVideo = videos[currentIndex];
58064
58137
  return /* @__PURE__ */ jsxs("div", { className: "relative group bg-gray-900 rounded-lg overflow-hidden aspect-video", children: [
58065
58138
  loading && /* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-center justify-center text-sm text-white/80", children: "Loading clips\u2026" }),
58066
58139
  !loading && error && /* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-center justify-center text-sm text-white/80", children: error }),
58067
58140
  !loading && !error && currentVideo?.src && /* @__PURE__ */ jsx(
58068
- VideoPlayer,
58141
+ CroppedVideoPlayer,
58069
58142
  {
58070
58143
  src: currentVideo.src,
58071
58144
  className: "w-full h-full object-cover opacity-90 group-hover:opacity-100 transition-opacity",
58072
58145
  controls: true,
58073
- playsInline: true
58146
+ playsInline: true,
58147
+ crop: workspaceCrop?.crop || null
58074
58148
  },
58075
58149
  currentVideo.src
58076
58150
  ),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optifye/dashboard-core",
3
- "version": "6.10.10",
3
+ "version": "6.10.12",
4
4
  "description": "Reusable UI & logic for Optifye dashboard",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",