bnstooltips 1.23.3 → 1.24.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.es.js CHANGED
@@ -456,6 +456,51 @@ var BnsItemApiClient = /** @class */ (function (_super) {
456
456
  }
457
457
  return Promise.resolve(null);
458
458
  };
459
+ /**
460
+ * @return Success
461
+ */
462
+ BnsItemApiClient.prototype.pet = function (pet) {
463
+ var _this = this;
464
+ var url_ = this.baseUrl + "/BnsItem/Pet?";
465
+ if (pet === undefined || pet === null)
466
+ throw new Error("The parameter 'pet' must be defined and cannot be null.");
467
+ else
468
+ url_ += "pet=" + encodeURIComponent("" + pet) + "&";
469
+ url_ = url_.replace(/[?&]$/, "");
470
+ var options_ = {
471
+ method: "GET",
472
+ headers: {
473
+ "Accept": "text/plain"
474
+ }
475
+ };
476
+ return this.transformOptions(options_).then(function (transformedOptions_) {
477
+ return _this.http.fetch(url_, transformedOptions_);
478
+ }).then(function (_response) {
479
+ return _this.processPet(_response);
480
+ });
481
+ };
482
+ BnsItemApiClient.prototype.processPet = function (response) {
483
+ var _this = this;
484
+ var status = response.status;
485
+ var _headers = {};
486
+ if (response.headers && response.headers.forEach) {
487
+ response.headers.forEach(function (v, k) { return _headers[k] = v; });
488
+ }
489
+ if (status === 200) {
490
+ return response.text().then(function (_responseText) {
491
+ var result200 = null;
492
+ var resultData200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
493
+ result200 = resultData200 !== undefined ? resultData200 : null;
494
+ return result200;
495
+ });
496
+ }
497
+ else if (status !== 200 && status !== 204) {
498
+ return response.text().then(function (_responseText) {
499
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
500
+ });
501
+ }
502
+ return Promise.resolve(null);
503
+ };
459
504
  /**
460
505
  * @param v (optional)
461
506
  * @return Success
@@ -1122,6 +1167,70 @@ var BnsItemApiClient = /** @class */ (function (_super) {
1122
1167
  }
1123
1168
  return Promise.resolve(null);
1124
1169
  };
1170
+ /**
1171
+ * @param light (optional)
1172
+ * @param patch (optional)
1173
+ * @param v (optional)
1174
+ * @return Success
1175
+ */
1176
+ BnsItemApiClient.prototype.itemByKey = function (key, region, light, patch, v) {
1177
+ var _this = this;
1178
+ var url_ = this.baseUrl + "/BnsItem/ItemByKey?";
1179
+ if (key === undefined || key === null)
1180
+ throw new Error("The parameter 'key' must be defined and cannot be null.");
1181
+ else
1182
+ url_ += "key=" + encodeURIComponent("" + key) + "&";
1183
+ if (region === undefined || region === null)
1184
+ throw new Error("The parameter 'region' must be defined and cannot be null.");
1185
+ else
1186
+ url_ += "region=" + encodeURIComponent("" + region) + "&";
1187
+ if (light === null)
1188
+ throw new Error("The parameter 'light' cannot be null.");
1189
+ else if (light !== undefined)
1190
+ url_ += "light=" + encodeURIComponent("" + light) + "&";
1191
+ if (patch === null)
1192
+ throw new Error("The parameter 'patch' cannot be null.");
1193
+ else if (patch !== undefined)
1194
+ url_ += "patch=" + encodeURIComponent("" + patch) + "&";
1195
+ if (v === null)
1196
+ throw new Error("The parameter 'v' cannot be null.");
1197
+ else if (v !== undefined)
1198
+ url_ += "v=" + encodeURIComponent("" + v) + "&";
1199
+ url_ = url_.replace(/[?&]$/, "");
1200
+ var options_ = {
1201
+ method: "GET",
1202
+ headers: {
1203
+ "Accept": "application/json"
1204
+ }
1205
+ };
1206
+ return this.transformOptions(options_).then(function (transformedOptions_) {
1207
+ return _this.http.fetch(url_, transformedOptions_);
1208
+ }).then(function (_response) {
1209
+ return _this.processItemByKey(_response);
1210
+ });
1211
+ };
1212
+ BnsItemApiClient.prototype.processItemByKey = function (response) {
1213
+ var _this = this;
1214
+ var status = response.status;
1215
+ var _headers = {};
1216
+ if (response.headers && response.headers.forEach) {
1217
+ response.headers.forEach(function (v, k) { return _headers[k] = v; });
1218
+ }
1219
+ if (status === 200) {
1220
+ return response.text().then(function (_responseText) {
1221
+ var result200 = null;
1222
+ var resultData200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
1223
+ result200 = BnsItemDto.fromJS(resultData200);
1224
+ return result200;
1225
+ });
1226
+ }
1227
+ else if (status !== 200 && status !== 204) {
1228
+ return response.text().then(function (_responseText) {
1229
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1230
+ });
1231
+ }
1232
+ return Promise.resolve(null);
1233
+ };
1125
1234
  /**
1126
1235
  * @param patch (optional)
1127
1236
  * @param v (optional)
@@ -1648,6 +1757,7 @@ var BnsItemDto = /** @class */ (function () {
1648
1757
  }
1649
1758
  }
1650
1759
  this.randomEffects = _data["randomEffects"] ? ItemRandomEffectsDto.fromJS(_data["randomEffects"]) : undefined;
1760
+ this.itemRandomSkillEnhancements = _data["itemRandomSkillEnhancements"] ? ItemRandomSkillEnhancementsDto.fromJS(_data["itemRandomSkillEnhancements"]) : undefined;
1651
1761
  }
1652
1762
  };
1653
1763
  BnsItemDto.fromJS = function (data) {
@@ -1756,6 +1866,7 @@ var BnsItemDto = /** @class */ (function () {
1756
1866
  }
1757
1867
  }
1758
1868
  data["randomEffects"] = this.randomEffects ? this.randomEffects.toJSON() : undefined;
1869
+ data["itemRandomSkillEnhancements"] = this.itemRandomSkillEnhancements ? this.itemRandomSkillEnhancements.toJSON() : undefined;
1759
1870
  return data;
1760
1871
  };
1761
1872
  return BnsItemDto;
@@ -2328,6 +2439,49 @@ var ItemRandomEffectsDto = /** @class */ (function () {
2328
2439
  };
2329
2440
  return ItemRandomEffectsDto;
2330
2441
  }());
2442
+ var ItemRandomSkillEnhancementsDto = /** @class */ (function () {
2443
+ function ItemRandomSkillEnhancementsDto(data) {
2444
+ if (data) {
2445
+ for (var property in data) {
2446
+ if (data.hasOwnProperty(property))
2447
+ this[property] = data[property];
2448
+ }
2449
+ }
2450
+ }
2451
+ ItemRandomSkillEnhancementsDto.prototype.init = function (_data) {
2452
+ if (_data) {
2453
+ if (Array.isArray(_data["groupLists"])) {
2454
+ this.groupLists = [];
2455
+ for (var _i = 0, _a = _data["groupLists"]; _i < _a.length; _i++) {
2456
+ var item = _a[_i];
2457
+ this.groupLists.push(item);
2458
+ }
2459
+ }
2460
+ this.duplicationEnabled = _data["duplicationEnabled"];
2461
+ this.unlimitedReroll = _data["unlimitedReroll"];
2462
+ }
2463
+ };
2464
+ ItemRandomSkillEnhancementsDto.fromJS = function (data) {
2465
+ data = typeof data === 'object' ? data : {};
2466
+ var result = new ItemRandomSkillEnhancementsDto();
2467
+ result.init(data);
2468
+ return result;
2469
+ };
2470
+ ItemRandomSkillEnhancementsDto.prototype.toJSON = function (data) {
2471
+ data = typeof data === 'object' ? data : {};
2472
+ if (Array.isArray(this.groupLists)) {
2473
+ data["groupLists"] = [];
2474
+ for (var _i = 0, _a = this.groupLists; _i < _a.length; _i++) {
2475
+ var item = _a[_i];
2476
+ data["groupLists"].push(item);
2477
+ }
2478
+ }
2479
+ data["duplicationEnabled"] = this.duplicationEnabled;
2480
+ data["unlimitedReroll"] = this.unlimitedReroll;
2481
+ return data;
2482
+ };
2483
+ return ItemRandomSkillEnhancementsDto;
2484
+ }());
2331
2485
  var ItemRandomStatDto = /** @class */ (function () {
2332
2486
  function ItemRandomStatDto(data) {
2333
2487
  if (data) {
@@ -8359,7 +8513,9 @@ function ItemTooltip(_a) {
8359
8513
  }, [jobstyleOverride]);
8360
8514
  useEffect(function () {
8361
8515
  var _a, _b, _c, _d, _e, _f, _g;
8362
- 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;
8516
+ var setHasSkillModifiers_i = ((_a = item.skills) === null || _a === void 0 ? void 0 : _a.some(function (skill) { return skill.jobstyle != null; })) ||
8517
+ ((_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; })) ||
8518
+ false;
8363
8519
  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)));
8364
8520
  var itemCombats_i = ((_g = item.skills) === null || _g === void 0 ? void 0 : _g.some(function (skill) { return skill.jobstyle != null; })) || false;
8365
8521
  setSetHasSkillModifiers(setHasSkillModifiers_i);
@@ -8402,6 +8558,7 @@ function ItemTooltip(_a) {
8402
8558
  AddRandomEffects(tooltipBaseProps.subInfoGroups, item);
8403
8559
  AddSkillDescriptions(tooltipBaseProps.subInfoGroups, item, itemCombats, jobstyle);
8404
8560
  AddSkillModifiers(tooltipBaseProps.subInfoGroups, item, false, jobstyle);
8561
+ AddSkillEnhancements(tooltipBaseProps.subInfoGroups, item);
8405
8562
  AddEtchingStones(tooltipBaseProps.subInfoGroups, item);
8406
8563
  AddSetBonus(tooltipBaseProps.subInfoGroups, item, jobstyle);
8407
8564
  AddRandomSubStatCount(tooltipBaseProps.subInfoGroups, item);
@@ -8474,15 +8631,18 @@ function AddTopText(subInfoGroups, item) {
8474
8631
  });
8475
8632
  }
8476
8633
  function AddRandomEffects(subInfoGroups, item) {
8477
- if (item.randomEffects == null || item.randomEffects.randomEffectCount == 0 || item.randomEffects.randomEffects == null || item.randomEffects.randomEffects.length == 0)
8634
+ if (item.randomEffects == null ||
8635
+ item.randomEffects.randomEffectCount == 0 ||
8636
+ item.randomEffects.randomEffects == null ||
8637
+ item.randomEffects.randomEffects.length == 0)
8478
8638
  return;
8479
8639
  subInfoGroups.push({
8480
8640
  title: "",
8481
8641
  texts: [
8482
8642
  React.createElement("div", null,
8483
8643
  React.createElement("div", { id: item.randomEffects.alias, dangerouslySetInnerHTML: { __html: item.randomEffects.itemSkillName } }),
8484
- item.randomEffects.randomEffects.map(function (effect) { return (React.createElement("div", { key: item.randomEffects.alias + "_" + effect.id, dangerouslySetInnerHTML: { __html: effect.text } })); }))
8485
- ]
8644
+ item.randomEffects.randomEffects.map(function (effect) { return (React.createElement("div", { key: item.randomEffects.alias + "_" + effect.id, dangerouslySetInnerHTML: { __html: effect.text } })); })),
8645
+ ],
8486
8646
  });
8487
8647
  }
8488
8648
  function AddSkillDescriptions(subInfoGroups, item, itemCombats, jobstyle) {
@@ -8505,23 +8665,72 @@ function AddSkillModifiers(subInfoGroups, item, isSetBonus, jobstyle) {
8505
8665
  ],
8506
8666
  });
8507
8667
  }
8668
+ function AddSkillEnhancements(subInfoGroups, item) {
8669
+ if (item.itemRandomSkillEnhancements == null ||
8670
+ item.itemRandomSkillEnhancements.groupLists == null ||
8671
+ item.itemRandomSkillEnhancements.groupLists.length == 0)
8672
+ return;
8673
+ subInfoGroups.push({
8674
+ title: "Skill Enhancements:",
8675
+ texts: [
8676
+ React.createElement("div", null, item.itemRandomSkillEnhancements.groupLists[0].map(function (skillenhancement, index) { return (React.createElement("div", { key: "skillEnhancement_" + index, style: {
8677
+ display: "flex",
8678
+ alignItems: "center",
8679
+ padding: ".1rem 0",
8680
+ } },
8681
+ React.createElement("span", { "data-id": skillenhancement.skillId, className: "TooltipBase_grade-7", style: { fontWeight: "500" } }, skillenhancement.skillName),
8682
+ "\u00A0",
8683
+ skillenhancement.minValue,
8684
+ " - ",
8685
+ skillenhancement.maxValue,
8686
+ " ",
8687
+ "points\u00A0",
8688
+ React.createElement("img", { style: {
8689
+ width: 36,
8690
+ height: 18,
8691
+ margin: "0 1px",
8692
+ top: 4,
8693
+ position: "relative",
8694
+ }, alt: "", src: "https://lean.bns.tools/bns/icons/00015590/Tag_Random.png" }))); })),
8695
+ ],
8696
+ });
8697
+ }
8508
8698
  function AddRandomSubStatCount(subInfoGroups, item) {
8509
8699
  if (item.randomSubStatCount != null && item.randomSubStatCount > 0)
8510
8700
  subInfoGroups.push({
8511
8701
  title: "Random stats:",
8512
- texts: [React.createElement("div", { className: "00008130.UI.Vital_LightBlue" },
8702
+ texts: [
8703
+ React.createElement("div", { className: "00008130.UI.Vital_LightBlue" },
8513
8704
  "This item has\u00A0",
8514
8705
  React.createElement("span", { className: "00008130.UI.Label_Green03_12" }, item.randomSubStatCount),
8515
- "\u00A0random secondary stat(s).")]
8706
+ "\u00A0random secondary stat(s)."),
8707
+ ],
8516
8708
  });
8517
8709
  if (item.randomEffects != null && item.randomEffects.randomEffects.length > 1)
8518
8710
  subInfoGroups.push({
8519
8711
  title: "Random effects:",
8520
- texts: [React.createElement("div", { className: "00008130.UI.Vital_LightBlue" },
8712
+ texts: [
8713
+ React.createElement("div", { className: "00008130.UI.Vital_LightBlue" },
8521
8714
  "This item has\u00A0",
8522
8715
  React.createElement("span", { className: "00008130.UI.Label_Green03_12" }, item.randomEffects.randomEffectCount),
8523
- "\u00A0random effect(s).")]
8716
+ "\u00A0random effect(s)."),
8717
+ ],
8718
+ });
8719
+ if (item.itemRandomSkillEnhancements != null &&
8720
+ item.itemRandomSkillEnhancements.groupLists != null &&
8721
+ item.itemRandomSkillEnhancements.groupLists.length > 0) {
8722
+ subInfoGroups.push({
8723
+ title: "Skill Enhancements:",
8724
+ texts: [
8725
+ React.createElement("div", null,
8726
+ React.createElement("div", { className: "00008130.UI.Vital_LightBlue" },
8727
+ "This item has\u00A0",
8728
+ React.createElement("span", { className: "00008130.UI.Label_Green03_12" }, item.itemRandomSkillEnhancements.groupLists.length),
8729
+ "\u00A0random skill enhancement(s)."),
8730
+ item.itemRandomSkillEnhancements.duplicationEnabled ? (React.createElement("div", { className: "00008130.UI.Vital_LightBlue" }, "Duplicate skills can apply.")) : (React.createElement("div", { className: "00008130.UI.Vital_LightBlue" }, "No duplicate skills will be applied."))),
8731
+ ],
8524
8732
  });
8733
+ }
8525
8734
  }
8526
8735
  function AddSetBonus(subInfoGroups, item, jobstyle) {
8527
8736
  if (item.setBonus == null)
@@ -8684,8 +8893,8 @@ function AddItemImprove(subInfoGroups, item, region, client, offline, debug) {
8684
8893
  texts: [
8685
8894
  React.createElement("div", { className: "ItemTooltip_optionPadding" },
8686
8895
  React.createElement(ItemImproveTooltipWrapper, { data: item, region: region, trigger: "click", interactive: true, offline: offline, client: client, debug: debug },
8687
- React.createElement("span", { className: "ItemTooltip_showButton" }, "Click to open")))
8688
- ]
8896
+ React.createElement("span", { className: "ItemTooltip_showButton" }, "Click to open"))),
8897
+ ],
8689
8898
  };
8690
8899
  subInfoGroups.push(subInfoGroup);
8691
8900
  }
@@ -8694,9 +8903,7 @@ function AddEtchingStones(subInfoGroups, item) {
8694
8903
  return;
8695
8904
  subInfoGroups.push({
8696
8905
  title: "Max. amount based on possible Ability and Potential",
8697
- texts: [
8698
- React.createElement(EtchingStones, { stones: item.slateStones }),
8699
- ]
8906
+ texts: [React.createElement(EtchingStones, { stones: item.slateStones })],
8700
8907
  });
8701
8908
  }
8702
8909
  function AddItemUpgradeEffects(subInfoGroups, item, client) {
@@ -8706,7 +8913,7 @@ function AddItemUpgradeEffects(subInfoGroups, item, client) {
8706
8913
  title: "",
8707
8914
  texts: [
8708
8915
  React.createElement(ItemUpgradeEffects, { id: item.id, level: item.level, client: client }),
8709
- ]
8916
+ ],
8710
8917
  });
8711
8918
  }
8712
8919