bnstooltips 1.18.16 → 1.18.18

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
@@ -137,6 +137,16 @@ function __generator(thisArg, body) {
137
137
  } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
138
138
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
139
139
  }
140
+ }
141
+
142
+ function __spreadArray(to, from, pack) {
143
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
144
+ if (ar || !(i in from)) {
145
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
146
+ ar[i] = from[i];
147
+ }
148
+ }
149
+ return to.concat(ar || Array.prototype.slice.call(from));
140
150
  }
141
151
 
142
152
  var css_248z$e = ".TooltipBase_bns_upgradeRed_color {\n color: #FF2818;\n}\n\n.TooltipBase_bns_downgradeBlue_color {\n color: #28A9F0;\n}\n\n.ItemTooltip_itemIconLoading {\n width: 50px;\n padding: 0.22rem 0;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.ItemTooltip_jobstyleToggleContainer {\n display: flex;\n}\n.ItemTooltip_optionPadding {\n margin: 0.2rem 0 0.5rem 0;\n}\n.ItemTooltip_showButton {\n flex: 1;\n border: none;\n padding: 0.33rem 0.5rem;\n border-radius: 0;\n background-color: rgba(233, 233, 233, 0.2);\n color: #fff;\n opacity: 0.8;\n cursor: pointer;\n transition: background-color 0.1s;\n}\n.ItemTooltip_showButton:hover {\n background-color: rgba(255, 255, 255, 0.3);\n opacity: 1;\n}\n.ItemTooltip_showButton-active {\n background-color: rgba(255, 255, 255, 0.4) !important;\n color: #fff;\n opacity: 1;\n}\n.ItemTooltip_jobstyleButton {\n flex: 1;\n border: none;\n padding: 0.33rem 0.5rem;\n border-radius: 0;\n background-color: rgba(233, 233, 233, 0.1);\n color: #fff;\n opacity: 0.8;\n cursor: pointer;\n transition: background-color 0.1s;\n}\n.ItemTooltip_jobstyleButton:hover {\n background-color: rgba(255, 255, 255, 0.2);\n opacity: 1;\n}\n.ItemTooltip_jobstyleButton-active {\n background-color: rgba(255, 255, 255, 0.3) !important;\n color: #fff;\n opacity: 1;\n}\n.ItemTooltip_itemiconnamedivspan {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.ItemTooltip_cooldown {\n font-weight: 400;\n font-size: 12px;\n}\n.ItemTooltip_subInfo {\n font-size: 14px;\n}\n.ItemTooltip_stats_mainstat {\n font-size: 16px;\n margin-bottom: 0.05rem;\n}\n.ItemTooltip_stats_substat {\n font-size: 14px;\n}\n.ItemTooltip_itemIconInline {\n width: 18px !important;\n height: 18px !important;\n margin: 0 1px;\n top: 3px;\n position: relative;\n}\n.ItemTooltip_itemIconRandom {\n width: 36px !important;\n top: 6px;\n margin: 0 1px 0 2px;\n}\n.ItemTooltip_itemIconSmall {\n width: 20px !important;\n height: 20px !important;\n margin-right: 0.33rem;\n}\n.ItemTooltip_itemIconSlate {\n width: 24px !important;\n height: 24px !important;\n margin-right: 0.11rem;\n}\n.ItemTooltip_setBonus {\n margin-bottom: 0.8rem !important;\n}\n.ItemTooltip_setContainer {\n padding-left: 0.33rem;\n padding-top: 0.22rem;\n}\n.ItemTooltip_setStageContainer {\n display: flex;\n margin: 0.25rem 0 0.35rem 0;\n}\n.ItemTooltip_setStageNumber {\n margin-top: 0.2rem;\n padding-top: 0.1rem;\n line-height: 16px;\n width: 16px;\n height: 16px;\n max-height: 16px;\n font-weight: 500;\n display: flex;\n justify-content: center;\n align-items: center;\n color: rgba(88, 255, 119, 0.8);\n border: 1px solid rgba(88, 255, 119, 0.9);\n border-radius: 3px;\n}\n.ItemTooltip_setStageContent {\n padding-top: 0.2rem;\n flex-grow: 2;\n padding-left: 0.55rem;\n max-width: 90%;\n color: #58ff77;\n}\n.ItemTooltip_itemiconnamediv {\n display: flex;\n align-items: center;\n padding: 0.15rem 0 0.15rem 0.33rem;\n line-height: 20px;\n}\n.ItemTooltip_slateIconNameStatsDiv {\n display: flex;\n justify-content: space-between;\n padding: 0.15rem 0;\n border-bottom: solid 1px rgba(233, 233, 233, 0.3);\n}\n.ItemTooltip_slateIconNameDiv {\n display: flex;\n justify-content: start;\n align-items: center;\n flex: 1;\n}\n.ItemTooltip_slateItemNameSmall {\n font-size: 14px;\n}\n.ItemTooltip_slateStatsDiv {\n display: flex;\n flex-direction: column;\n align-items: end;\n justify-content: center;\n flex: 1;\n}\n.ItemTooltip_setItemIconNameDiv {\n display: flex;\n align-items: center;\n padding: 0.11rem 0 0.11rem 0.33rem;\n line-height: 20px;\n}\n.ItemTooltip_setItemsContainer {\n display: flex;\n font-size: 12px;\n}\n.ItemTooltip_setItemsSubContainer {\n flex: 1;\n}\n.ItemTooltip_itemNameRandomDiv {\n display: flex;\n align-items: center;\n}\n\n@media only screen and (max-width: 380px) {\n .ItemTooltip_jobstyleButton {\n padding: 0.5rem;\n }\n}\n/**\n * ==============================================\n * Dot Elastic\n * ==============================================\n */\n.dot-elastic {\n position: relative;\n width: 10px;\n height: 10px;\n border-radius: 5px;\n background-color: rgba(127, 127, 127, 0.8);\n color: rgba(127, 127, 127, 0.8);\n animation: dotElastic 1s infinite linear;\n}\n\n.dot-elastic::before,\n.dot-elastic::after {\n content: \"\";\n display: inline-block;\n position: absolute;\n top: 0;\n}\n\n.dot-elastic::before {\n left: -15px;\n width: 10px;\n height: 10px;\n border-radius: 5px;\n background-color: rgba(127, 127, 127, 0.8);\n color: rgba(127, 127, 127, 0.8);\n animation: dotElasticBefore 1s infinite linear;\n}\n\n.dot-elastic::after {\n left: 15px;\n width: 10px;\n height: 10px;\n border-radius: 5px;\n background-color: rgba(127, 127, 127, 0.8);\n color: rgba(127, 127, 127, 0.8);\n animation: dotElasticAfter 1s infinite linear;\n}\n\n@keyframes dotElasticBefore {\n 0% {\n transform: scale(1, 1);\n }\n 25% {\n transform: scale(1, 1.5);\n }\n 50% {\n transform: scale(1, 0.67);\n }\n 75% {\n transform: scale(1, 1);\n }\n 100% {\n transform: scale(1, 1);\n }\n}\n@keyframes dotElastic {\n 0% {\n transform: scale(1, 1);\n }\n 25% {\n transform: scale(1, 1);\n }\n 50% {\n transform: scale(1, 1.5);\n }\n 75% {\n transform: scale(1, 1);\n }\n 100% {\n transform: scale(1, 1);\n }\n}\n@keyframes dotElasticAfter {\n 0% {\n transform: scale(1, 1);\n }\n 25% {\n transform: scale(1, 1);\n }\n 50% {\n transform: scale(1, 0.67);\n }\n 75% {\n transform: scale(1, 1.5);\n }\n 100% {\n transform: scale(1, 1);\n }\n}";
@@ -8173,10 +8183,13 @@ function ItemUpgradeEffects(props) {
8173
8183
 
8174
8184
  function ItemTooltip(_a) {
8175
8185
  var _this = this;
8176
- var _b, _c, _d;
8177
- var data = _a.data, region = _a.region, _e = _a.debug, debug = _e === void 0 ? false : _e, _f = _a.offline, offline = _f === void 0 ? false : _f, clientProp = _a.client, jobstyleOverride = _a.jobstyleOverride, _g = _a.showUpgrade, showUpgrade = _g === void 0 ? false : _g, _h = _a.showUpgradeEffects, showUpgradeEffects = _h === void 0 ? false : _h, _j = _a.fullHeight, fullHeight = _j === void 0 ? false : _j;
8178
- var _k = React.useState("advanced-1"), jobstyle = _k[0], setJobstyle = _k[1];
8179
- var _l = React.useState(), client = _l[0], setClient = _l[1];
8186
+ var data = _a.data, region = _a.region, _b = _a.debug, debug = _b === void 0 ? false : _b, _c = _a.offline, offline = _c === void 0 ? false : _c, clientProp = _a.client, jobstyleOverride = _a.jobstyleOverride, _d = _a.showUpgrade, showUpgrade = _d === void 0 ? false : _d, _e = _a.showUpgradeEffects, showUpgradeEffects = _e === void 0 ? false : _e, _f = _a.fullHeight, fullHeight = _f === void 0 ? false : _f;
8187
+ var _g = React.useState("advanced-1"), jobstyle = _g[0], setJobstyle = _g[1];
8188
+ var _h = React.useState(), client = _h[0], setClient = _h[1];
8189
+ var _j = React.useState(false), setHasSkillModifiers = _j[0], setSetHasSkillModifiers = _j[1];
8190
+ var _k = React.useState([]), jobstyles = _k[0], setJobstyles = _k[1];
8191
+ var _l = React.useState(false), itemCombats = _l[0], setItemCombats = _l[1];
8192
+ var item = data;
8180
8193
  React.useEffect(function () {
8181
8194
  if (offline && !showUpgradeEffects)
8182
8195
  return;
@@ -8197,46 +8210,35 @@ function ItemTooltip(_a) {
8197
8210
  setJobstyle(jobstyleOverride);
8198
8211
  }
8199
8212
  }, [jobstyleOverride]);
8200
- var item = data;
8201
- var itemCategory = (_c = (_b = item.categories) === null || _b === void 0 ? void 0 : _b.sort(function (a, b) { return b.index - a.index; })[0].localizedName) !== null && _c !== void 0 ? _c : "";
8202
- if (itemCategory == "none")
8203
- itemCategory = "";
8213
+ React.useEffect(function () {
8214
+ var _a, _b, _c, _d, _e, _f, _g;
8215
+ var setHasSkillModifiers_i = ((_a = item.skills) === null || _a === void 0 ? void 0 : _a.some(function (skill) { return skill.jobstyle != null; })) || ((_c = (_b = item.setBonus) === null || _b === void 0 ? void 0 : _b.setBonusStages) === null || _c === void 0 ? void 0 : _c.some(function (stage) { var _a; return ((_a = stage.skillModifiers) === null || _a === void 0 ? void 0 : _a.length) > 0; })) || false;
8216
+ var jobstyles_i = Array.from(new Set(__spreadArray(__spreadArray([], (((_d = item.skills) === null || _d === void 0 ? void 0 : _d.map(function (skill) { return skill.jobstyle; })) || []), true), (((_f = (_e = item.setBonus) === null || _e === void 0 ? void 0 : _e.setBonusStages) === null || _f === void 0 ? void 0 : _f.flatMap(function (stage) { var _a; return ((_a = stage.skillModifiers) === null || _a === void 0 ? void 0 : _a.map(function (modifier) { return modifier.jobstyle; })) || []; })) || []), true).filter(Boolean)));
8217
+ var itemCombats_i = ((_g = item.skills) === null || _g === void 0 ? void 0 : _g.some(function (skill) { return skill.jobstyle != null; })) || false;
8218
+ setSetHasSkillModifiers(setHasSkillModifiers_i);
8219
+ setJobstyles(jobstyles_i);
8220
+ setItemCombats(itemCombats_i);
8221
+ }, [item]);
8222
+ React.useEffect(function () {
8223
+ if (jobstyles.length > 0 && !jobstyles.includes(jobstyle)) {
8224
+ setJobstyle(jobstyles[0]);
8225
+ }
8226
+ }, [jobstyle, jobstyles]);
8227
+ var itemCategory = React.useMemo(function () {
8228
+ var _a, _b, _c;
8229
+ var category = (_c = (_b = (_a = item.categories) === null || _a === void 0 ? void 0 : _a.sort(function (a, b) { return b.index - a.index; })[0]) === null || _b === void 0 ? void 0 : _b.localizedName) !== null && _c !== void 0 ? _c : "";
8230
+ return category === "none" ? "" : category;
8231
+ }, [item]);
8204
8232
  var tooltipBaseProps = {
8205
8233
  title: item.name,
8206
8234
  grade: item.grade,
8207
- id: item.id + "-" + item.level,
8235
+ id: "".concat(item.id, "-").concat(item.level),
8208
8236
  icon: item.icon ? BuildIconPath(item.icon.iconPath) : "",
8209
8237
  subtitle: itemCategory,
8210
8238
  mainInfos: [],
8211
8239
  subInfoGroups: [],
8212
8240
  fullHeight: fullHeight,
8213
8241
  };
8214
- var setHasSkillModifiers = false;
8215
- var jobstyles = [];
8216
- var itemCombats = false;
8217
- if (item.skills != null && item.skills.length > 0) {
8218
- item.skills.forEach(function (itemSkill) {
8219
- if (itemSkill.jobstyle != null) {
8220
- setHasSkillModifiers = true;
8221
- itemCombats = true;
8222
- if (!jobstyles.includes(itemSkill.jobstyle)) {
8223
- jobstyles.push(itemSkill.jobstyle);
8224
- }
8225
- }
8226
- });
8227
- }
8228
- if (((_d = item.setBonus) === null || _d === void 0 ? void 0 : _d.setBonusStages) != null) {
8229
- item.setBonus.setBonusStages.forEach(function (stage) {
8230
- if (stage.skillModifiers != null && stage.skillModifiers.length > 0) {
8231
- setHasSkillModifiers = true;
8232
- stage.skillModifiers.forEach(function (modifier) {
8233
- if (!jobstyles.includes(modifier.jobstyle)) {
8234
- jobstyles.push(modifier.jobstyle);
8235
- }
8236
- });
8237
- }
8238
- });
8239
- }
8240
8242
  //top part
8241
8243
  AddMainInfo(tooltipBaseProps.mainInfos, item);
8242
8244
  AddSubInfo(tooltipBaseProps.mainInfos, item);
@@ -8246,7 +8248,9 @@ function ItemTooltip(_a) {
8246
8248
  AddItemRandomStats(tooltipBaseProps.mainInfos, item);
8247
8249
  //bottom part
8248
8250
  AddGearScore(tooltipBaseProps.subInfoGroups, item, debug);
8249
- AddJobstyleToggles(setHasSkillModifiers, tooltipBaseProps.subInfoGroups, jobstyles, jobstyle, setJobstyle);
8251
+ if (jobstyles.length > 1) {
8252
+ AddJobstyleToggles(setHasSkillModifiers, tooltipBaseProps.subInfoGroups, jobstyles, jobstyle, setJobstyle);
8253
+ }
8250
8254
  AddTopText(tooltipBaseProps.subInfoGroups, item);
8251
8255
  AddSkillDescriptions(tooltipBaseProps.subInfoGroups, item, itemCombats, jobstyle);
8252
8256
  AddSkillModifiers(tooltipBaseProps.subInfoGroups, item, false, jobstyle);
@@ -8816,6 +8820,7 @@ function AddBreakValue(subInfoGroups, skill) {
8816
8820
  function AddSkillMastery(subInfoGroups, masteryPoints, masteryValue, masteryIsPercentage) {
8817
8821
  if (masteryPoints == null || masteryPoints == 0 || masteryValue == null || masteryValue == 0)
8818
8822
  return;
8823
+ var formattedMasteryValue = Number.isInteger(masteryValue) ? masteryValue.toString() : masteryValue.toFixed(2).replace(',', '.');
8819
8824
  subInfoGroups.push({
8820
8825
  title: "",
8821
8826
  texts: [
@@ -8828,13 +8833,13 @@ function AddSkillMastery(subInfoGroups, masteryPoints, masteryValue, masteryIsPe
8828
8833
  React__default["default"].createElement("div", null,
8829
8834
  "Damage increase:\u00A0",
8830
8835
  React__default["default"].createElement("span", { className: "tooltipArg" },
8831
- masteryValue.toString().replace(',', '.'),
8836
+ formattedMasteryValue,
8832
8837
  "%"))
8833
8838
  :
8834
8839
  React__default["default"].createElement("div", null,
8835
8840
  "Cooldown reduction:\u00A0",
8836
8841
  React__default["default"].createElement("span", { className: "tooltipArg" },
8837
- masteryValue.toString().replace(',', '.'),
8842
+ formattedMasteryValue,
8838
8843
  " sec."))),
8839
8844
  ],
8840
8845
  });