bnstooltips 1.7.0 → 1.7.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/build/index.es.js CHANGED
@@ -5844,32 +5844,47 @@ function ItemImproveTooltip(_a) {
5844
5844
  fullHeight: fullHeight,
5845
5845
  };
5846
5846
  if (!offline) {
5847
- if (data.itemResult != null) {
5848
- // if (data.useMileageSave != null && data.useMileageSave === true)
5849
- // tooltipBaseProps.mainInfos.push(
5850
- // <div>The upgrade change is 100% when the mileage meter is filled.</div>
5851
- // );
5847
+ if (data.itemNext != null && data.upgradeOptions != null && data.upgradeOptions.length > 0) {
5848
+ if (data.useMileageSave != null && data.useMileageSave === true && data.upgradeOptions.find(function (x) { return x.isRandom; }) != null)
5849
+ tooltipBaseProps.mainInfos.push(React.createElement("div", null, "The upgrade chance is 100% when the pity meter is filled."));
5850
+ // if (data.itemPrev != null) {
5851
+ // tooltipBaseProps.subInfoGroups.push({
5852
+ // title: "Previous Upgrade:",
5853
+ // texts: [
5854
+ // <ItemIconNameDiv showUpgrade={true} client={client} region={region} item={data.itemPrev} interactive={true} />
5855
+ // ]
5856
+ // });
5857
+ // }
5852
5858
  tooltipBaseProps.subInfoGroups.push({
5853
5859
  title: "Next Upgrade:",
5854
5860
  texts: [
5855
- React.createElement(ItemIconNameDiv, { showUpgrade: true, client: client, region: region, item: data.itemResult, interactive: true })
5861
+ React.createElement(ItemIconNameDiv, { showUpgrade: true, client: client, region: region, item: data.itemNext, interactive: true })
5856
5862
  ]
5857
5863
  });
5858
- var costGroup = {
5859
- title: "Upgrade Cost:",
5860
- texts: []
5861
- };
5862
- if (data.itemCost != null && data.itemCost.length > 0)
5863
- costGroup.texts.push(React.createElement(DecomposeResults, { showUpgrade: false, client: client, region: region, items: data.itemCost }));
5864
- if (data.moneyCost != null && data.moneyCost > 0) {
5865
- costGroup.texts.push(React.createElement("div", { className: "TooltipBase_flex ItemImproveTooltip_moneyContainer" },
5866
- React.createElement("span", { className: "TooltipBase_grade-6" }, "Money:\u00A0"),
5867
- React.createElement(Money, { money: data.moneyCost })));
5868
- }
5869
- tooltipBaseProps.subInfoGroups.push(costGroup);
5864
+ data.upgradeOptions.forEach(function (upgradeOption, i, _) {
5865
+ var costGroup = {
5866
+ title: "Upgrade option " + (i + 1) + ":",
5867
+ texts: []
5868
+ };
5869
+ if (upgradeOption.isRandom != null && upgradeOption.isRandom === true) {
5870
+ costGroup.texts.push(React.createElement("div", { className: "TooltipBase_flex ItemImproveTooltip_moneyContainer" },
5871
+ React.createElement("span", { className: "TooltipBase_grade-8" }, "This option has a chance to fail!")));
5872
+ }
5873
+ if (upgradeOption.mainItemCost != null)
5874
+ costGroup.texts.push(React.createElement(ItemIconNameDiv, { showUpgrade: false, client: client, region: region, item: upgradeOption.mainItemCost, interactive: true }));
5875
+ if (upgradeOption.subItemCost != null && upgradeOption.subItemCost.length > 0) {
5876
+ costGroup.texts.push(React.createElement(DecomposeResults, { client: client, region: region, showUpgrade: false, items: upgradeOption.subItemCost }));
5877
+ }
5878
+ if (upgradeOption.moneyCost != null && upgradeOption.moneyCost > 0) {
5879
+ costGroup.texts.push(React.createElement("div", { className: "TooltipBase_flex ItemImproveTooltip_moneyContainer" },
5880
+ React.createElement("span", { className: "TooltipBase_grade-6" }, "Money:\u00A0"),
5881
+ React.createElement(Money, { money: upgradeOption.moneyCost })));
5882
+ }
5883
+ tooltipBaseProps.subInfoGroups.push(costGroup);
5884
+ });
5870
5885
  }
5871
5886
  }
5872
- if (data.options != null && data.options.length > 0) {
5887
+ if (data.bonusEffectOptions != null && data.bonusEffectOptions.length > 0) {
5873
5888
  tooltipBaseProps.mainInfos.push(React.createElement("div", null, "Random effects can be obtained when upgrading."));
5874
5889
  var subInfoGroupStats_1 = {
5875
5890
  title: "Possible Stats:",
@@ -5879,7 +5894,7 @@ function ItemImproveTooltip(_a) {
5879
5894
  title: "Possible Effects:",
5880
5895
  texts: []
5881
5896
  };
5882
- data.options.forEach(function (option) {
5897
+ data.bonusEffectOptions.forEach(function (option) {
5883
5898
  if (option.isEffect) {
5884
5899
  subInfoGroupEffects_1.texts.push(React.createElement("div", { className: "ItemImproveTooltip_option", dangerouslySetInnerHTML: { __html: option.effectDescription } }));
5885
5900
  }
@@ -5913,7 +5928,7 @@ var ItemImproveTooltipWrapper = function (_a) {
5913
5928
  var _k = useState(true), isOffline = _k[0], setIsOffline = _k[1];
5914
5929
  return (React.createElement(React.Fragment, null,
5915
5930
  children,
5916
- childRef ? (React.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.createElement(ItemImproveTooltip, { region: region, data: data, offline: isOffline, client: client, debug: debug }), theme: "grade8", reference: childRef })) : (React.createElement("span", { "data-testid": "TooltipWrapper", ref: spanRef, style: { display: "none" } }))));
5931
+ childRef ? (React.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.createElement(ItemImproveTooltip, { region: region, data: data, offline: isOffline, client: client, debug: debug }), theme: "grade4", reference: childRef })) : (React.createElement("span", { "data-testid": "TooltipWrapper", ref: spanRef, style: { display: "none" } }))));
5917
5932
  };
5918
5933
 
5919
5934
  function ItemTooltip(_a) {