@optifye/dashboard-core 6.9.4 → 6.9.5

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
@@ -6245,6 +6245,7 @@ interface WorkspaceGridProps {
6245
6245
  workspaceHlsUrls?: Record<string, string>;
6246
6246
  mp4VideoMapping?: Record<string, string>;
6247
6247
  };
6248
+ displayNames?: Record<string, string>;
6248
6249
  onWorkspaceHover?: (workspaceId: string) => void;
6249
6250
  onWorkspaceHoverEnd?: (workspaceId: string) => void;
6250
6251
  }
@@ -6302,6 +6303,7 @@ interface VideoGridViewProps {
6302
6303
  defaultHlsUrl?: string;
6303
6304
  workspaceHlsUrls?: Record<string, string>;
6304
6305
  };
6306
+ displayNames?: Record<string, string>;
6305
6307
  onWorkspaceHover?: (workspaceId: string) => void;
6306
6308
  onWorkspaceHoverEnd?: (workspaceId: string) => void;
6307
6309
  }
@@ -6313,6 +6315,7 @@ declare const VideoGridView: React__default.FC<VideoGridViewProps>;
6313
6315
  interface MapGridViewProps {
6314
6316
  workspaces: WorkspaceMetrics[];
6315
6317
  className?: string;
6318
+ displayNames?: Record<string, string>;
6316
6319
  onWorkspaceHover?: (workspaceId: string) => void;
6317
6320
  onWorkspaceHoverEnd?: (workspaceId: string) => void;
6318
6321
  }
@@ -6334,6 +6337,7 @@ interface VideoCardProps {
6334
6337
  useRAF?: boolean;
6335
6338
  className?: string;
6336
6339
  compact?: boolean;
6340
+ displayName?: string;
6337
6341
  onMouseEnter?: () => void;
6338
6342
  onMouseLeave?: () => void;
6339
6343
  }
package/dist/index.d.ts CHANGED
@@ -6245,6 +6245,7 @@ interface WorkspaceGridProps {
6245
6245
  workspaceHlsUrls?: Record<string, string>;
6246
6246
  mp4VideoMapping?: Record<string, string>;
6247
6247
  };
6248
+ displayNames?: Record<string, string>;
6248
6249
  onWorkspaceHover?: (workspaceId: string) => void;
6249
6250
  onWorkspaceHoverEnd?: (workspaceId: string) => void;
6250
6251
  }
@@ -6302,6 +6303,7 @@ interface VideoGridViewProps {
6302
6303
  defaultHlsUrl?: string;
6303
6304
  workspaceHlsUrls?: Record<string, string>;
6304
6305
  };
6306
+ displayNames?: Record<string, string>;
6305
6307
  onWorkspaceHover?: (workspaceId: string) => void;
6306
6308
  onWorkspaceHoverEnd?: (workspaceId: string) => void;
6307
6309
  }
@@ -6313,6 +6315,7 @@ declare const VideoGridView: React__default.FC<VideoGridViewProps>;
6313
6315
  interface MapGridViewProps {
6314
6316
  workspaces: WorkspaceMetrics[];
6315
6317
  className?: string;
6318
+ displayNames?: Record<string, string>;
6316
6319
  onWorkspaceHover?: (workspaceId: string) => void;
6317
6320
  onWorkspaceHoverEnd?: (workspaceId: string) => void;
6318
6321
  }
@@ -6334,6 +6337,7 @@ interface VideoCardProps {
6334
6337
  useRAF?: boolean;
6335
6338
  className?: string;
6336
6339
  compact?: boolean;
6340
+ displayName?: string;
6337
6341
  onMouseEnter?: () => void;
6338
6342
  onMouseLeave?: () => void;
6339
6343
  }
package/dist/index.js CHANGED
@@ -24362,6 +24362,7 @@ var VideoCard = React23__namespace.default.memo(({
24362
24362
  useRAF = true,
24363
24363
  className = "",
24364
24364
  compact = false,
24365
+ displayName,
24365
24366
  onMouseEnter,
24366
24367
  onMouseLeave
24367
24368
  }) => {
@@ -24383,7 +24384,7 @@ var VideoCard = React23__namespace.default.memo(({
24383
24384
  onFatalError: onFatalError ?? (() => throttledReloadDashboard())
24384
24385
  });
24385
24386
  }
24386
- const displayName = getWorkspaceDisplayName(workspace.workspace_name, workspace.line_id);
24387
+ const workspaceDisplayName = displayName || getWorkspaceDisplayName(workspace.workspace_name, workspace.line_id);
24387
24388
  const getEfficiencyOverlayColor = (efficiency) => {
24388
24389
  if (efficiency >= 80) {
24389
24390
  return "bg-[#00D654]/25";
@@ -24476,7 +24477,7 @@ var VideoCard = React23__namespace.default.memo(({
24476
24477
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `absolute bottom-0 left-0 right-0 bg-black bg-opacity-60 p-1.5 sm:${compact ? "p-1" : "p-1.5"} flex justify-between items-center z-10`, children: [
24477
24478
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5", children: [
24478
24479
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Camera, { size: compact ? 10 : 12, className: "text-white" }),
24479
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: `text-white text-[11px] sm:${compact ? "text-[10px]" : "text-xs"} font-medium tracking-wide`, children: displayName })
24480
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: `text-white text-[11px] sm:${compact ? "text-[10px]" : "text-xs"} font-medium tracking-wide`, children: workspaceDisplayName })
24480
24481
  ] }),
24481
24482
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `flex items-center ${compact ? "gap-1" : "gap-1.5"}`, children: [
24482
24483
  trendInfo && /* @__PURE__ */ jsxRuntime.jsx(
@@ -24513,6 +24514,7 @@ var VideoGridView = React23__namespace.default.memo(({
24513
24514
  selectedLine,
24514
24515
  className = "",
24515
24516
  videoSources = {},
24517
+ displayNames = {},
24516
24518
  onWorkspaceHover,
24517
24519
  onWorkspaceHoverEnd
24518
24520
  }) => {
@@ -24727,6 +24729,7 @@ var VideoGridView = React23__namespace.default.memo(({
24727
24729
  isVeryLowEfficiency,
24728
24730
  cropping: workspaceCropping,
24729
24731
  canvasFps: canvasConfig?.fps,
24732
+ displayName: displayNames[workspace.workspace_name] || workspace.workspace_name,
24730
24733
  useRAF: canvasConfig?.useRAF,
24731
24734
  compact: !selectedLine,
24732
24735
  onMouseEnter: onWorkspaceHover ? () => onWorkspaceHover(workspaceId) : void 0,
@@ -24744,6 +24747,7 @@ VideoGridView.displayName = "VideoGridView";
24744
24747
  var MapGridView = React23__namespace.default.memo(({
24745
24748
  workspaces,
24746
24749
  className = "",
24750
+ displayNames = {},
24747
24751
  onWorkspaceHover,
24748
24752
  onWorkspaceHoverEnd
24749
24753
  }) => {
@@ -24774,10 +24778,10 @@ var MapGridView = React23__namespace.default.memo(({
24774
24778
  efficiency: workspace.efficiency,
24775
24779
  action_count: workspace.action_count
24776
24780
  });
24777
- const displayName = getWorkspaceDisplayName(workspace.workspace_name, workspace.line_id);
24781
+ const displayName = displayNames[workspace.workspace_name] || getWorkspaceDisplayName(workspace.workspace_name, workspace.line_id);
24778
24782
  const navParams = getWorkspaceNavigationParams(workspaceId, displayName, workspace.line_id);
24779
24783
  router$1.push(`/workspace/${workspaceId}${navParams}`);
24780
- }, [router$1]);
24784
+ }, [router$1, displayNames]);
24781
24785
  const activePositions = React23.useMemo(() => {
24782
24786
  return workspacePositions.filter((pos) => {
24783
24787
  const wsKey = pos.id.toUpperCase();
@@ -24803,7 +24807,7 @@ var MapGridView = React23__namespace.default.memo(({
24803
24807
  if (!workspace) return null;
24804
24808
  const workspaceId = workspace.workspace_uuid || workspace.workspace_name;
24805
24809
  getPerformanceColor(workspace.efficiency);
24806
- const displayName = getWorkspaceDisplayName(workspace.workspace_name, workspace.line_id);
24810
+ const workspaceDisplayName = displayNames[workspace.workspace_name] || getWorkspaceDisplayName(workspace.workspace_name, workspace.line_id);
24807
24811
  return /* @__PURE__ */ jsxRuntime.jsx(
24808
24812
  motion.div,
24809
24813
  {
@@ -24829,7 +24833,7 @@ var MapGridView = React23__namespace.default.memo(({
24829
24833
  ${position.size === "conveyor" ? "w-32 h-24" : position.size === "large" ? "w-40 h-32" : "w-36 h-28"}
24830
24834
  `,
24831
24835
  children: [
24832
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute top-0 left-0 right-0 px-2 py-1.5 border-b border-gray-200", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs font-bold text-gray-800 truncate text-center leading-tight", children: displayName }) }),
24836
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute top-0 left-0 right-0 px-2 py-1.5 border-b border-gray-200", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs font-bold text-gray-800 truncate text-center leading-tight", children: workspaceDisplayName }) }),
24833
24837
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute bottom-0 left-0 right-0 px-2 py-2", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col items-center", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-2xl font-bold text-gray-900", children: [
24834
24838
  Math.round(workspace.efficiency),
24835
24839
  "%"
@@ -34857,6 +34861,7 @@ var WorkspaceGrid = React23__namespace.default.memo(({
34857
34861
  line2Uuid = "line-2",
34858
34862
  className = "",
34859
34863
  videoSources = {},
34864
+ displayNames = {},
34860
34865
  onWorkspaceHover,
34861
34866
  onWorkspaceHoverEnd
34862
34867
  }) => {
@@ -34922,6 +34927,7 @@ var WorkspaceGrid = React23__namespace.default.memo(({
34922
34927
  {
34923
34928
  workspaces,
34924
34929
  videoSources,
34930
+ displayNames,
34925
34931
  onWorkspaceHover,
34926
34932
  onWorkspaceHoverEnd
34927
34933
  }
@@ -34940,6 +34946,7 @@ var WorkspaceGrid = React23__namespace.default.memo(({
34940
34946
  MapGridViewComponent,
34941
34947
  {
34942
34948
  workspaces,
34949
+ displayNames,
34943
34950
  onWorkspaceHover,
34944
34951
  onWorkspaceHoverEnd
34945
34952
  }
@@ -41534,7 +41541,7 @@ function HomeView({
41534
41541
  displayNames: workspaceDisplayNames,
41535
41542
  loading: displayNamesLoading,
41536
41543
  error: displayNamesError
41537
- } = useWorkspaceDisplayNames(void 0, selectedLineId);
41544
+ } = useWorkspaceDisplayNames(selectedLineId, void 0);
41538
41545
  React23.useCallback(() => {
41539
41546
  console.log("Refetching KPIs after line metrics update");
41540
41547
  }, []);
@@ -41898,7 +41905,7 @@ function HomeView({
41898
41905
  /* @__PURE__ */ jsxRuntime.jsx(SelectContent, { className: "z-50 bg-white shadow-lg border border-gray-200 rounded-md text-xs sm:text-sm", children: availableLineIds.map((id3) => /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: id3, children: lineNames[id3] || (id3 === factoryViewId ? "All Lines" : `Line ${id3.substring(0, 4)}`) }, id3)) })
41899
41906
  ] });
41900
41907
  }, [availableLineIds, handleLineChange, selectedLineId, lineNames, factoryViewId, allLineIds.length]);
41901
- const isInitialLoading = !isHydrated || !displayNamesInitialized && displayNamesLoading;
41908
+ const isInitialLoading = !isHydrated || displayNamesLoading || !displayNamesInitialized && displayNamesLoading;
41902
41909
  const isDataLoading = metricsLoading || kpisLoading;
41903
41910
  if (isInitialLoading) {
41904
41911
  return /* @__PURE__ */ jsxRuntime.jsx(LoadingPageCmp, { message: "Loading Dashboard..." });
@@ -41943,6 +41950,7 @@ function HomeView({
41943
41950
  lineNames,
41944
41951
  factoryView: factoryViewId,
41945
41952
  videoSources,
41953
+ displayNames: workspaceDisplayNames,
41946
41954
  className: "h-full",
41947
41955
  onWorkspaceHover: handleWorkspaceHover,
41948
41956
  onWorkspaceHoverEnd: handleWorkspaceHoverEnd
@@ -41970,6 +41978,7 @@ function HomeView({
41970
41978
  lineNames,
41971
41979
  factoryView: factoryViewId,
41972
41980
  videoSources,
41981
+ displayNames: workspaceDisplayNames,
41973
41982
  className: "h-full",
41974
41983
  onWorkspaceHover: handleWorkspaceHover,
41975
41984
  onWorkspaceHoverEnd: handleWorkspaceHoverEnd
package/dist/index.mjs CHANGED
@@ -24332,6 +24332,7 @@ var VideoCard = React23__default.memo(({
24332
24332
  useRAF = true,
24333
24333
  className = "",
24334
24334
  compact = false,
24335
+ displayName,
24335
24336
  onMouseEnter,
24336
24337
  onMouseLeave
24337
24338
  }) => {
@@ -24353,7 +24354,7 @@ var VideoCard = React23__default.memo(({
24353
24354
  onFatalError: onFatalError ?? (() => throttledReloadDashboard())
24354
24355
  });
24355
24356
  }
24356
- const displayName = getWorkspaceDisplayName(workspace.workspace_name, workspace.line_id);
24357
+ const workspaceDisplayName = displayName || getWorkspaceDisplayName(workspace.workspace_name, workspace.line_id);
24357
24358
  const getEfficiencyOverlayColor = (efficiency) => {
24358
24359
  if (efficiency >= 80) {
24359
24360
  return "bg-[#00D654]/25";
@@ -24446,7 +24447,7 @@ var VideoCard = React23__default.memo(({
24446
24447
  /* @__PURE__ */ jsxs("div", { className: `absolute bottom-0 left-0 right-0 bg-black bg-opacity-60 p-1.5 sm:${compact ? "p-1" : "p-1.5"} flex justify-between items-center z-10`, children: [
24447
24448
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
24448
24449
  /* @__PURE__ */ jsx(Camera, { size: compact ? 10 : 12, className: "text-white" }),
24449
- /* @__PURE__ */ jsx("p", { className: `text-white text-[11px] sm:${compact ? "text-[10px]" : "text-xs"} font-medium tracking-wide`, children: displayName })
24450
+ /* @__PURE__ */ jsx("p", { className: `text-white text-[11px] sm:${compact ? "text-[10px]" : "text-xs"} font-medium tracking-wide`, children: workspaceDisplayName })
24450
24451
  ] }),
24451
24452
  /* @__PURE__ */ jsxs("div", { className: `flex items-center ${compact ? "gap-1" : "gap-1.5"}`, children: [
24452
24453
  trendInfo && /* @__PURE__ */ jsx(
@@ -24483,6 +24484,7 @@ var VideoGridView = React23__default.memo(({
24483
24484
  selectedLine,
24484
24485
  className = "",
24485
24486
  videoSources = {},
24487
+ displayNames = {},
24486
24488
  onWorkspaceHover,
24487
24489
  onWorkspaceHoverEnd
24488
24490
  }) => {
@@ -24697,6 +24699,7 @@ var VideoGridView = React23__default.memo(({
24697
24699
  isVeryLowEfficiency,
24698
24700
  cropping: workspaceCropping,
24699
24701
  canvasFps: canvasConfig?.fps,
24702
+ displayName: displayNames[workspace.workspace_name] || workspace.workspace_name,
24700
24703
  useRAF: canvasConfig?.useRAF,
24701
24704
  compact: !selectedLine,
24702
24705
  onMouseEnter: onWorkspaceHover ? () => onWorkspaceHover(workspaceId) : void 0,
@@ -24714,6 +24717,7 @@ VideoGridView.displayName = "VideoGridView";
24714
24717
  var MapGridView = React23__default.memo(({
24715
24718
  workspaces,
24716
24719
  className = "",
24720
+ displayNames = {},
24717
24721
  onWorkspaceHover,
24718
24722
  onWorkspaceHoverEnd
24719
24723
  }) => {
@@ -24744,10 +24748,10 @@ var MapGridView = React23__default.memo(({
24744
24748
  efficiency: workspace.efficiency,
24745
24749
  action_count: workspace.action_count
24746
24750
  });
24747
- const displayName = getWorkspaceDisplayName(workspace.workspace_name, workspace.line_id);
24751
+ const displayName = displayNames[workspace.workspace_name] || getWorkspaceDisplayName(workspace.workspace_name, workspace.line_id);
24748
24752
  const navParams = getWorkspaceNavigationParams(workspaceId, displayName, workspace.line_id);
24749
24753
  router.push(`/workspace/${workspaceId}${navParams}`);
24750
- }, [router]);
24754
+ }, [router, displayNames]);
24751
24755
  const activePositions = useMemo(() => {
24752
24756
  return workspacePositions.filter((pos) => {
24753
24757
  const wsKey = pos.id.toUpperCase();
@@ -24773,7 +24777,7 @@ var MapGridView = React23__default.memo(({
24773
24777
  if (!workspace) return null;
24774
24778
  const workspaceId = workspace.workspace_uuid || workspace.workspace_name;
24775
24779
  getPerformanceColor(workspace.efficiency);
24776
- const displayName = getWorkspaceDisplayName(workspace.workspace_name, workspace.line_id);
24780
+ const workspaceDisplayName = displayNames[workspace.workspace_name] || getWorkspaceDisplayName(workspace.workspace_name, workspace.line_id);
24777
24781
  return /* @__PURE__ */ jsx(
24778
24782
  motion.div,
24779
24783
  {
@@ -24799,7 +24803,7 @@ var MapGridView = React23__default.memo(({
24799
24803
  ${position.size === "conveyor" ? "w-32 h-24" : position.size === "large" ? "w-40 h-32" : "w-36 h-28"}
24800
24804
  `,
24801
24805
  children: [
24802
- /* @__PURE__ */ jsx("div", { className: "absolute top-0 left-0 right-0 px-2 py-1.5 border-b border-gray-200", children: /* @__PURE__ */ jsx("div", { className: "text-xs font-bold text-gray-800 truncate text-center leading-tight", children: displayName }) }),
24806
+ /* @__PURE__ */ jsx("div", { className: "absolute top-0 left-0 right-0 px-2 py-1.5 border-b border-gray-200", children: /* @__PURE__ */ jsx("div", { className: "text-xs font-bold text-gray-800 truncate text-center leading-tight", children: workspaceDisplayName }) }),
24803
24807
  /* @__PURE__ */ jsx("div", { className: "absolute bottom-0 left-0 right-0 px-2 py-2", children: /* @__PURE__ */ jsx("div", { className: "flex flex-col items-center", children: /* @__PURE__ */ jsxs("div", { className: "text-2xl font-bold text-gray-900", children: [
24804
24808
  Math.round(workspace.efficiency),
24805
24809
  "%"
@@ -34827,6 +34831,7 @@ var WorkspaceGrid = React23__default.memo(({
34827
34831
  line2Uuid = "line-2",
34828
34832
  className = "",
34829
34833
  videoSources = {},
34834
+ displayNames = {},
34830
34835
  onWorkspaceHover,
34831
34836
  onWorkspaceHoverEnd
34832
34837
  }) => {
@@ -34892,6 +34897,7 @@ var WorkspaceGrid = React23__default.memo(({
34892
34897
  {
34893
34898
  workspaces,
34894
34899
  videoSources,
34900
+ displayNames,
34895
34901
  onWorkspaceHover,
34896
34902
  onWorkspaceHoverEnd
34897
34903
  }
@@ -34910,6 +34916,7 @@ var WorkspaceGrid = React23__default.memo(({
34910
34916
  MapGridViewComponent,
34911
34917
  {
34912
34918
  workspaces,
34919
+ displayNames,
34913
34920
  onWorkspaceHover,
34914
34921
  onWorkspaceHoverEnd
34915
34922
  }
@@ -41504,7 +41511,7 @@ function HomeView({
41504
41511
  displayNames: workspaceDisplayNames,
41505
41512
  loading: displayNamesLoading,
41506
41513
  error: displayNamesError
41507
- } = useWorkspaceDisplayNames(void 0, selectedLineId);
41514
+ } = useWorkspaceDisplayNames(selectedLineId, void 0);
41508
41515
  useCallback(() => {
41509
41516
  console.log("Refetching KPIs after line metrics update");
41510
41517
  }, []);
@@ -41868,7 +41875,7 @@ function HomeView({
41868
41875
  /* @__PURE__ */ jsx(SelectContent, { className: "z-50 bg-white shadow-lg border border-gray-200 rounded-md text-xs sm:text-sm", children: availableLineIds.map((id3) => /* @__PURE__ */ jsx(SelectItem, { value: id3, children: lineNames[id3] || (id3 === factoryViewId ? "All Lines" : `Line ${id3.substring(0, 4)}`) }, id3)) })
41869
41876
  ] });
41870
41877
  }, [availableLineIds, handleLineChange, selectedLineId, lineNames, factoryViewId, allLineIds.length]);
41871
- const isInitialLoading = !isHydrated || !displayNamesInitialized && displayNamesLoading;
41878
+ const isInitialLoading = !isHydrated || displayNamesLoading || !displayNamesInitialized && displayNamesLoading;
41872
41879
  const isDataLoading = metricsLoading || kpisLoading;
41873
41880
  if (isInitialLoading) {
41874
41881
  return /* @__PURE__ */ jsx(LoadingPageCmp, { message: "Loading Dashboard..." });
@@ -41913,6 +41920,7 @@ function HomeView({
41913
41920
  lineNames,
41914
41921
  factoryView: factoryViewId,
41915
41922
  videoSources,
41923
+ displayNames: workspaceDisplayNames,
41916
41924
  className: "h-full",
41917
41925
  onWorkspaceHover: handleWorkspaceHover,
41918
41926
  onWorkspaceHoverEnd: handleWorkspaceHoverEnd
@@ -41940,6 +41948,7 @@ function HomeView({
41940
41948
  lineNames,
41941
41949
  factoryView: factoryViewId,
41942
41950
  videoSources,
41951
+ displayNames: workspaceDisplayNames,
41943
41952
  className: "h-full",
41944
41953
  onWorkspaceHover: handleWorkspaceHover,
41945
41954
  onWorkspaceHoverEnd: handleWorkspaceHoverEnd
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optifye/dashboard-core",
3
- "version": "6.9.4",
3
+ "version": "6.9.5",
4
4
  "description": "Reusable UI & logic for Optifye dashboard",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",