bnstooltips 1.8.0 → 1.8.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.
package/build/index.js CHANGED
@@ -5607,6 +5607,8 @@ function ItemWithText(_a) {
5607
5607
  var borderClass = _a.borderClass, itemProp = _a.item, itemLevel = _a.itemLevel, itemId = _a.itemId, client = _a.client, region = _a.region, tooltip = _a.tooltip, _d = _a.small, small = _d === void 0 ? false : _d;
5608
5608
  var _e = React.useState(), item = _e[0], setItem = _e[1];
5609
5609
  React.useEffect(function () {
5610
+ if (client == null)
5611
+ return;
5610
5612
  if (itemProp == null) {
5611
5613
  (function () { return __awaiter(_this, void 0, void 0, function () {
5612
5614
  var _a;
@@ -5625,7 +5627,7 @@ function ItemWithText(_a) {
5625
5627
  else {
5626
5628
  setItem(itemProp);
5627
5629
  }
5628
- }, [itemProp, itemId, itemLevel]);
5630
+ }, [itemProp, itemId, itemLevel, client]);
5629
5631
  if (item == null)
5630
5632
  return null;
5631
5633
  return (React__default["default"].createElement("div", { className: "ItemImproveTooltip_ItemWithText" },
@@ -5901,7 +5903,7 @@ function ItemImproveTooltip(_a) {
5901
5903
  var _k = React.useState([]), steps = _k[0], setSteps = _k[1];
5902
5904
  var _l = React.useState([]), allPossibleUpgrades = _l[0], setAllPossibleUpgrades = _l[1];
5903
5905
  React.useEffect(function () {
5904
- if (data == null || client == null)
5906
+ if (data == null || client == null || offline)
5905
5907
  return;
5906
5908
  (function () { return __awaiter(_this, void 0, void 0, function () {
5907
5909
  var existing, _a, existing, _b, foundIndex, _c;
@@ -6052,7 +6054,7 @@ function AddUpgradeCost(subInfoGroups, item, nextItem, steps, client, region) {
6052
6054
  }
6053
6055
 
6054
6056
  var ItemImproveTooltipWrapper = function (_a) {
6055
- var data = _a.data, region = _a.region, children = _a.children, client = _a.client, _b = _a.offline, offline = _b === void 0 ? false : _b, _c = _a.interactive, interactive = _c === void 0 ? true : _c, _d = _a.placement, placement = _d === void 0 ? "right" : _d, _e = _a.debug, debug = _e === void 0 ? false : _e, _f = _a.followCursor, followCursor$1 = _f === void 0 ? false : _f, _g = _a.trigger, trigger = _g === void 0 ? "mouseenter focus" : _g; _a.showArrow;
6057
+ var data = _a.data, region = _a.region, children = _a.children, client = _a.client, _b = _a.offline, offline = _b === void 0 ? false : _b, _c = _a.interactive, interactive = _c === void 0 ? true : _c, _d = _a.placement, placement = _d === void 0 ? "right" : _d, _e = _a.debug, debug = _e === void 0 ? false : _e, _f = _a.followCursor, followCursor$1 = _f === void 0 ? false : _f, _g = _a.trigger, trigger = _g === void 0 ? "mouseenter focus" : _g, _h = _a.showArrow, showArrow = _h === void 0 ? true : _h;
6056
6058
  var spanRef = React.useRef(null);
6057
6059
  var _j = React.useState(null), childRef = _j[0], setChildRef = _j[1];
6058
6060
  /**
@@ -6068,7 +6070,7 @@ var ItemImproveTooltipWrapper = function (_a) {
6068
6070
  var _k = React.useState(true), isOffline = _k[0], setIsOffline = _k[1];
6069
6071
  return (React__default["default"].createElement(React__default["default"].Fragment, null,
6070
6072
  children,
6071
- childRef ? (React__default["default"].createElement(Tippy, { arrow: false, trigger: trigger, plugins: [followCursor], followCursor: followCursor$1 && !interactive, appendTo: document.body, onMount: function () { return setIsOffline(offline); }, placement: placement, animation: "fade", interactive: interactive, content: React__default["default"].createElement(ItemImproveTooltip, { region: region, data: data, offline: isOffline, client: client, debug: debug }), theme: "grade" + data.grade, reference: childRef })) : (React__default["default"].createElement("span", { "data-testid": "TooltipWrapper", ref: spanRef, style: { display: "none" } }))));
6073
+ childRef ? (React__default["default"].createElement(Tippy, { arrow: showArrow, trigger: trigger, plugins: [followCursor], followCursor: followCursor$1 && !interactive, appendTo: document.body, onMount: function () { return setIsOffline(offline); }, placement: placement, animation: "fade", interactive: interactive, content: React__default["default"].createElement(ItemImproveTooltip, { region: region, data: data, offline: isOffline, client: client, debug: debug }), theme: "grade" + data.grade, reference: childRef })) : (React__default["default"].createElement("span", { "data-testid": "TooltipWrapper", ref: spanRef, style: { display: "none" } }))));
6072
6074
  };
6073
6075
 
6074
6076
  function ItemMainInfo(item) {