bnstooltips 1.18.17 → 1.19.0

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}";
@@ -1571,6 +1581,7 @@ var BnsItemDto = /** @class */ (function () {
1571
1581
  this.slateStones.push(SlateStoneDto.fromJS(item));
1572
1582
  }
1573
1583
  }
1584
+ this.randomEffects = _data["randomEffects"] ? ItemRandomEffectsDto.fromJS(_data["randomEffects"]) : undefined;
1574
1585
  }
1575
1586
  };
1576
1587
  BnsItemDto.fromJS = function (data) {
@@ -1677,6 +1688,7 @@ var BnsItemDto = /** @class */ (function () {
1677
1688
  data["slateStones"].push(item.toJSON());
1678
1689
  }
1679
1690
  }
1691
+ data["randomEffects"] = this.randomEffects ? this.randomEffects.toJSON() : undefined;
1680
1692
  return data;
1681
1693
  };
1682
1694
  return BnsItemDto;
@@ -1954,6 +1966,37 @@ var ItemDescriptionDto = /** @class */ (function () {
1954
1966
  };
1955
1967
  return ItemDescriptionDto;
1956
1968
  }());
1969
+ var ItemEffectDto = /** @class */ (function () {
1970
+ function ItemEffectDto(data) {
1971
+ if (data) {
1972
+ for (var property in data) {
1973
+ if (data.hasOwnProperty(property))
1974
+ this[property] = data[property];
1975
+ }
1976
+ }
1977
+ }
1978
+ ItemEffectDto.prototype.init = function (_data) {
1979
+ if (_data) {
1980
+ this.id = _data["id"];
1981
+ this.text = _data["text"];
1982
+ this.weight = _data["weight"];
1983
+ }
1984
+ };
1985
+ ItemEffectDto.fromJS = function (data) {
1986
+ data = typeof data === 'object' ? data : {};
1987
+ var result = new ItemEffectDto();
1988
+ result.init(data);
1989
+ return result;
1990
+ };
1991
+ ItemEffectDto.prototype.toJSON = function (data) {
1992
+ data = typeof data === 'object' ? data : {};
1993
+ data["id"] = this.id;
1994
+ data["text"] = this.text;
1995
+ data["weight"] = this.weight;
1996
+ return data;
1997
+ };
1998
+ return ItemEffectDto;
1999
+ }());
1957
2000
  var ItemIconDto = /** @class */ (function () {
1958
2001
  function ItemIconDto(data) {
1959
2002
  if (data) {
@@ -2171,6 +2214,53 @@ var ItemImproveEffectOptionWithNameDto = /** @class */ (function () {
2171
2214
  };
2172
2215
  return ItemImproveEffectOptionWithNameDto;
2173
2216
  }());
2217
+ var ItemRandomEffectsDto = /** @class */ (function () {
2218
+ function ItemRandomEffectsDto(data) {
2219
+ if (data) {
2220
+ for (var property in data) {
2221
+ if (data.hasOwnProperty(property))
2222
+ this[property] = data[property];
2223
+ }
2224
+ }
2225
+ }
2226
+ ItemRandomEffectsDto.prototype.init = function (_data) {
2227
+ if (_data) {
2228
+ this.alias = _data["alias"];
2229
+ this.randomEffectCount = _data["randomEffectCount"];
2230
+ this.totalWeight = _data["totalWeight"];
2231
+ this.itemSkillName = _data["itemSkillName"];
2232
+ if (Array.isArray(_data["randomEffects"])) {
2233
+ this.randomEffects = [];
2234
+ for (var _i = 0, _a = _data["randomEffects"]; _i < _a.length; _i++) {
2235
+ var item = _a[_i];
2236
+ this.randomEffects.push(ItemEffectDto.fromJS(item));
2237
+ }
2238
+ }
2239
+ }
2240
+ };
2241
+ ItemRandomEffectsDto.fromJS = function (data) {
2242
+ data = typeof data === 'object' ? data : {};
2243
+ var result = new ItemRandomEffectsDto();
2244
+ result.init(data);
2245
+ return result;
2246
+ };
2247
+ ItemRandomEffectsDto.prototype.toJSON = function (data) {
2248
+ data = typeof data === 'object' ? data : {};
2249
+ data["alias"] = this.alias;
2250
+ data["randomEffectCount"] = this.randomEffectCount;
2251
+ data["totalWeight"] = this.totalWeight;
2252
+ data["itemSkillName"] = this.itemSkillName;
2253
+ if (Array.isArray(this.randomEffects)) {
2254
+ data["randomEffects"] = [];
2255
+ for (var _i = 0, _a = this.randomEffects; _i < _a.length; _i++) {
2256
+ var item = _a[_i];
2257
+ data["randomEffects"].push(item.toJSON());
2258
+ }
2259
+ }
2260
+ return data;
2261
+ };
2262
+ return ItemRandomEffectsDto;
2263
+ }());
2174
2264
  var ItemRandomStatDto = /** @class */ (function () {
2175
2265
  function ItemRandomStatDto(data) {
2176
2266
  if (data) {
@@ -8173,10 +8263,13 @@ function ItemUpgradeEffects(props) {
8173
8263
 
8174
8264
  function ItemTooltip(_a) {
8175
8265
  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];
8266
+ 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;
8267
+ var _g = React.useState("advanced-1"), jobstyle = _g[0], setJobstyle = _g[1];
8268
+ var _h = React.useState(), client = _h[0], setClient = _h[1];
8269
+ var _j = React.useState(false), setHasSkillModifiers = _j[0], setSetHasSkillModifiers = _j[1];
8270
+ var _k = React.useState([]), jobstyles = _k[0], setJobstyles = _k[1];
8271
+ var _l = React.useState(false), itemCombats = _l[0], setItemCombats = _l[1];
8272
+ var item = data;
8180
8273
  React.useEffect(function () {
8181
8274
  if (offline && !showUpgradeEffects)
8182
8275
  return;
@@ -8197,46 +8290,35 @@ function ItemTooltip(_a) {
8197
8290
  setJobstyle(jobstyleOverride);
8198
8291
  }
8199
8292
  }, [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 = "";
8293
+ React.useEffect(function () {
8294
+ var _a, _b, _c, _d, _e, _f, _g;
8295
+ 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;
8296
+ 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)));
8297
+ var itemCombats_i = ((_g = item.skills) === null || _g === void 0 ? void 0 : _g.some(function (skill) { return skill.jobstyle != null; })) || false;
8298
+ setSetHasSkillModifiers(setHasSkillModifiers_i);
8299
+ setJobstyles(jobstyles_i);
8300
+ setItemCombats(itemCombats_i);
8301
+ }, [item]);
8302
+ React.useEffect(function () {
8303
+ if (jobstyles.length > 0 && !jobstyles.includes(jobstyle)) {
8304
+ setJobstyle(jobstyles[0]);
8305
+ }
8306
+ }, [jobstyle, jobstyles]);
8307
+ var itemCategory = React.useMemo(function () {
8308
+ var _a, _b, _c;
8309
+ 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 : "";
8310
+ return category === "none" ? "" : category;
8311
+ }, [item]);
8204
8312
  var tooltipBaseProps = {
8205
8313
  title: item.name,
8206
8314
  grade: item.grade,
8207
- id: item.id + "-" + item.level,
8315
+ id: "".concat(item.id, "-").concat(item.level),
8208
8316
  icon: item.icon ? BuildIconPath(item.icon.iconPath) : "",
8209
8317
  subtitle: itemCategory,
8210
8318
  mainInfos: [],
8211
8319
  subInfoGroups: [],
8212
8320
  fullHeight: fullHeight,
8213
8321
  };
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
8322
  //top part
8241
8323
  AddMainInfo(tooltipBaseProps.mainInfos, item);
8242
8324
  AddSubInfo(tooltipBaseProps.mainInfos, item);
@@ -8246,8 +8328,11 @@ function ItemTooltip(_a) {
8246
8328
  AddItemRandomStats(tooltipBaseProps.mainInfos, item);
8247
8329
  //bottom part
8248
8330
  AddGearScore(tooltipBaseProps.subInfoGroups, item, debug);
8249
- AddJobstyleToggles(setHasSkillModifiers, tooltipBaseProps.subInfoGroups, jobstyles, jobstyle, setJobstyle);
8331
+ if (jobstyles.length > 1) {
8332
+ AddJobstyleToggles(setHasSkillModifiers, tooltipBaseProps.subInfoGroups, jobstyles, jobstyle, setJobstyle);
8333
+ }
8250
8334
  AddTopText(tooltipBaseProps.subInfoGroups, item);
8335
+ AddRandomEffects(tooltipBaseProps.subInfoGroups, item);
8251
8336
  AddSkillDescriptions(tooltipBaseProps.subInfoGroups, item, itemCombats, jobstyle);
8252
8337
  AddSkillModifiers(tooltipBaseProps.subInfoGroups, item, false, jobstyle);
8253
8338
  AddEtchingStones(tooltipBaseProps.subInfoGroups, item);
@@ -8321,6 +8406,18 @@ function AddTopText(subInfoGroups, item) {
8321
8406
  texts: [React__default["default"].createElement(TopText, __assign({}, item))],
8322
8407
  });
8323
8408
  }
8409
+ function AddRandomEffects(subInfoGroups, item) {
8410
+ if (item.randomEffects == null || item.randomEffects.randomEffectCount == 0 || item.randomEffects.randomEffects == null || item.randomEffects.randomEffects.length == 0)
8411
+ return;
8412
+ subInfoGroups.push({
8413
+ title: "",
8414
+ texts: [
8415
+ React__default["default"].createElement("div", null,
8416
+ React__default["default"].createElement("div", { id: item.randomEffects.alias, dangerouslySetInnerHTML: { __html: item.randomEffects.itemSkillName } }),
8417
+ item.randomEffects.randomEffects.map(function (effect) { return (React__default["default"].createElement("div", { key: item.randomEffects.alias + "_" + effect.id, dangerouslySetInnerHTML: { __html: effect.text } })); }))
8418
+ ]
8419
+ });
8420
+ }
8324
8421
  function AddSkillDescriptions(subInfoGroups, item, itemCombats, jobstyle) {
8325
8422
  if (item.skills == null || item.skills.length == 0)
8326
8423
  return;
@@ -8350,6 +8447,14 @@ function AddRandomSubStatCount(subInfoGroups, item) {
8350
8447
  React__default["default"].createElement("span", { className: "00008130.UI.Label_Green03_12" }, item.randomSubStatCount),
8351
8448
  "\u00A0random secondary stat(s).")]
8352
8449
  });
8450
+ if (item.randomEffects != null && item.randomEffects.randomEffects.length > 1)
8451
+ subInfoGroups.push({
8452
+ title: "Random effects:",
8453
+ texts: [React__default["default"].createElement("div", { className: "00008130.UI.Vital_LightBlue" },
8454
+ "This item has\u00A0",
8455
+ React__default["default"].createElement("span", { className: "00008130.UI.Label_Green03_12" }, item.randomEffects.randomEffectCount),
8456
+ "\u00A0random effect(s).")]
8457
+ });
8353
8458
  }
8354
8459
  function AddSetBonus(subInfoGroups, item, jobstyle) {
8355
8460
  if (item.setBonus == null)