@copart/ops-tool-kit 1.12.3-alpha.1 → 1.12.3-alpha.3

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.
@@ -47,7 +47,7 @@ var React__namespace = /*#__PURE__*/_interopNamespace(React);
47
47
  var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
48
48
 
49
49
  const name$r = "@copart/ops-tool-kit";
50
- const version$8 = "1.12.3-alpha.1";
50
+ const version$8 = "1.12.3-alpha.3";
51
51
  const main$1 = "dist/ops-tool-kit.js";
52
52
  const style = "dist/ops-tool-kit.css";
53
53
  const files = [
@@ -35098,6 +35098,13 @@ var getUserData = function getUserData() {
35098
35098
  appScopes: storage$1.userAppScopes
35099
35099
  };
35100
35100
  };
35101
+ var userHasChatBotAccess = function userHasChatBotAccess(appFunction) {
35102
+ if (!appFunction) return true;
35103
+ var coreAppPermissions = storage$1.coreAppPermissions;
35104
+ return !isEmpty$2(coreAppPermissions) && !isNil$1(coreAppPermissions.find(function (permission) {
35105
+ return permission.name === appFunction;
35106
+ }));
35107
+ };
35101
35108
  var userHasAccess = function userHasAccess(tile) {
35102
35109
  var user = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : getUserData();
35103
35110
  return allAreTruthy([stackIsAllowed(tile.stack), yardNumberAllowed(user.activeYardNumber, tile), securityLevelAllowed(user.securityLevel, tile), emailAddressAllowed(user.emailAddress, tile), appFunctionIdAllowed(user.coreAppPermissions, user.allPermissionIds, user.permissionIds, user.appScopes, tile), casAccessAllowed(user.hasCasAccess, tile.requireCasAccess)]);
@@ -35111,6 +35118,7 @@ var accessHelpers = /*#__PURE__*/Object.freeze({
35111
35118
  appFunctionIdAllowed: appFunctionIdAllowed,
35112
35119
  stackIsAllowed: stackIsAllowed,
35113
35120
  casAccessAllowed: casAccessAllowed,
35121
+ userHasChatBotAccess: userHasChatBotAccess,
35114
35122
  userHasAccess: userHasAccess,
35115
35123
  'default': userHasAccess
35116
35124
  });
@@ -68841,6 +68849,11 @@ var NavigationMenuLevel1 = function NavigationMenuLevel1(_ref4) {
68841
68849
  });
68842
68850
  }) : null));
68843
68851
  };
68852
+ var statusColors = {
68853
+ 1: '#C50F1F',
68854
+ 2: '#FFAA44',
68855
+ 3: '#6BB700'
68856
+ };
68844
68857
  var NavigationMenuLevel2 = function NavigationMenuLevel2(_ref5) {
68845
68858
  var navItem = _ref5.navItem,
68846
68859
  isHover = _ref5.isHover,
@@ -68935,11 +68948,20 @@ var NavigationMenuLevel2 = function NavigationMenuLevel2(_ref5) {
68935
68948
  } else if (allowMultipleNavItemsOpen) {
68936
68949
  highlight = selected === navItem.fullRoute;
68937
68950
  }
68951
+
68952
+ // Check if highlightMenu prop is true and highlight is false
68953
+ var shouldShowHighlightBackground = navItem.highlightMenu === true && !highlight;
68954
+
68955
+ // Use highlightMenuColor if it's a string, otherwise use default red color
68956
+ var backgroundColor = shouldShowHighlightBackground ? typeof navItem.highlightMenuColor === 'string' ? navItem.highlightMenuColor : statusColors[1] : '';
68938
68957
  return /*#__PURE__*/React__default["default"].createElement("div", {
68939
68958
  className: "utilities_ops-app-frame_NavigationBar_NavigationBar--NavMenuLevel2",
68940
68959
  animate: isMenuExpanded ? 'open' : 'closed'
68941
68960
  }, /*#__PURE__*/React__default["default"].createElement("div", {
68942
68961
  onClick: handleItemClick,
68962
+ style: {
68963
+ backgroundColor: backgroundColor
68964
+ },
68943
68965
  className: _getClassName("NavItem ".concat(highlight ? 'expandedMenu' : '', " ").concat(selected === navItem.fullRoute && navItem !== null && navItem !== void 0 && navItem.subMenuItems ? 'NavItemSelected' : '', " ").concat(isDisabled ? 'disabled' : ''), _styleModuleImportMap$1, {
68944
68966
  "handleMissingStyleName": "warn"
68945
68967
  })
@@ -68966,6 +68988,15 @@ var NavigationMenuLevel2 = function NavigationMenuLevel2(_ref5) {
68966
68988
  });
68967
68989
  }
68968
68990
  },
68991
+ leave: {
68992
+ animation: 'slideUp',
68993
+ duration: 200,
68994
+ complete: function complete(elements) {
68995
+ elements.forEach(function (el) {
68996
+ el.style.removeProperty("height");
68997
+ });
68998
+ }
68999
+ },
68969
69000
  style: {
68970
69001
  marginLeft: '10px',
68971
69002
  marginTop: '3px',
@@ -68988,11 +69019,6 @@ var NavigationMenuLevel2 = function NavigationMenuLevel2(_ref5) {
68988
69019
  });
68989
69020
  }) : null));
68990
69021
  };
68991
- var statusColors = {
68992
- 1: '#C50F1F',
68993
- 2: '#FFAA44',
68994
- 3: '#6BB700'
68995
- };
68996
69022
  var NavigationMenuLevel3 = function NavigationMenuLevel3(_ref6) {
68997
69023
  var navItem = _ref6.navItem,
68998
69024
  count = _ref6.count,
@@ -69096,9 +69122,11 @@ var AppFrame = function AppFrame(props) {
69096
69122
  var setChatBotEnableStatus = function setChatBotEnableStatus() {
69097
69123
  var coreAppConfig = storage$1.getLocalItem('opsportal-core:config');
69098
69124
  var tileData = findAppData(coreAppConfig.tiles, coreAppConfig.tileOverrides) || {};
69099
- var enableChatBot = coreAppConfig.enableChatBot;
69125
+ var enableChatBot = coreAppConfig.enableChatBot,
69126
+ chatBotAppFunctionId = coreAppConfig.chatBotAppFunctionId;
69100
69127
  var isCoreRoute = ['settings', 'home', 'webChat', 'embedded', ''].includes(getRouteName());
69101
- var chatBotEnabled = isCoreRoute && !window.location.pathname.includes('embedded') ? enableChatBot : tileData === null || tileData === void 0 ? void 0 : tileData.enableChatBot;
69128
+ var hasChatBotAccess = userHasChatBotAccess(chatBotAppFunctionId);
69129
+ var chatBotEnabled = isCoreRoute && !window.location.pathname.includes('embedded') ? enableChatBot && hasChatBotAccess : (tileData === null || tileData === void 0 ? void 0 : tileData.enableChatBot) && hasChatBotAccess;
69102
69130
  console.log("***chatBotEnabled=", chatBotEnabled, coreAppConfig);
69103
69131
  console.log("***isCoreRoute=", isCoreRoute, enableChatBot, window.location.pathname, !window.location.pathname.includes('embedded'));
69104
69132
  setChatBotEnabled(chatBotEnabled);
@@ -82818,10 +82846,10 @@ var sharedStore = createCommonjsModule(function (module) {
82818
82846
  var SHARED = '__core-js_shared__';
82819
82847
  var store = module.exports = globalThis_1[SHARED] || defineGlobalProperty(SHARED, {});
82820
82848
  (store.versions || (store.versions = [])).push({
82821
- version: '3.44.0',
82849
+ version: '3.45.1',
82822
82850
  mode: 'global',
82823
82851
  copyright: '© 2014-2025 Denis Pushkarev (zloirock.ru)',
82824
- license: 'https://github.com/zloirock/core-js/blob/v3.44.0/LICENSE',
82852
+ license: 'https://github.com/zloirock/core-js/blob/v3.45.1/LICENSE',
82825
82853
  source: 'https://github.com/zloirock/core-js'
82826
82854
  });
82827
82855
  });