bnstooltips 1.19.1 → 1.19.2
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/SkillTooltip/SkillTooltip.d.ts +1 -1
- package/build/SkillTooltip/SkillTooltip.types.d.ts +1 -2
- package/build/SkillTooltipWrapper/SkillTooltipWrapper.types.d.ts +1 -2
- package/build/Utilities/Helpers.d.ts +1 -0
- package/build/index.es.js +59 -9
- package/build/index.es.js.map +1 -1
- package/build/index.js +59 -9
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -324,6 +324,53 @@ function getMoneyObj(money) {
|
|
|
324
324
|
Gold: gold,
|
|
325
325
|
Silver: silver
|
|
326
326
|
};
|
|
327
|
+
}
|
|
328
|
+
function GetSkillMasteryValue(points, isCd) {
|
|
329
|
+
if (points <= 0)
|
|
330
|
+
return 0;
|
|
331
|
+
return isCd ? GetSkillMasteryCdValueForPoints(points) : GetSkillMasteryValueForPoints(points);
|
|
332
|
+
}
|
|
333
|
+
function GetSkillMasteryCdValueForPoints(points) {
|
|
334
|
+
var value = 0;
|
|
335
|
+
if (points >= 4) {
|
|
336
|
+
value += 1;
|
|
337
|
+
}
|
|
338
|
+
if (points >= 12) {
|
|
339
|
+
value += 2;
|
|
340
|
+
}
|
|
341
|
+
if (points >= 24) {
|
|
342
|
+
value += 2;
|
|
343
|
+
}
|
|
344
|
+
return 0 - value;
|
|
345
|
+
}
|
|
346
|
+
function GetSkillMasteryValueForPoints(points) {
|
|
347
|
+
var value = 0;
|
|
348
|
+
if (points > 0) {
|
|
349
|
+
var firstRange = Math.min(points, 15);
|
|
350
|
+
value += firstRange * 1.9;
|
|
351
|
+
points -= firstRange;
|
|
352
|
+
}
|
|
353
|
+
if (points > 0) {
|
|
354
|
+
var secondRange = Math.min(points, 35 - 15);
|
|
355
|
+
value += secondRange * 1.5;
|
|
356
|
+
points -= secondRange;
|
|
357
|
+
}
|
|
358
|
+
if (points > 0) {
|
|
359
|
+
var thirdRange = Math.min(points, 100 - 35);
|
|
360
|
+
value += thirdRange * 1.1;
|
|
361
|
+
points -= thirdRange;
|
|
362
|
+
}
|
|
363
|
+
if (points > 0) {
|
|
364
|
+
var fourthRange = Math.min(points, 165 - 100);
|
|
365
|
+
value += fourthRange * 0.7;
|
|
366
|
+
points -= fourthRange;
|
|
367
|
+
}
|
|
368
|
+
if (points > 0) {
|
|
369
|
+
var fifthRange = Math.min(points, 1000 - 165);
|
|
370
|
+
value += fifthRange * 0.3;
|
|
371
|
+
points -= fifthRange;
|
|
372
|
+
}
|
|
373
|
+
return value;
|
|
327
374
|
}
|
|
328
375
|
|
|
329
376
|
//----------------------
|
|
@@ -8680,7 +8727,7 @@ function JsonArrayToJsxArray(stringArray) {
|
|
|
8680
8727
|
return jsxArray;
|
|
8681
8728
|
}
|
|
8682
8729
|
|
|
8683
|
-
var css_248z$6 = ".TooltipBase_bns_upgradeRed_color {\n color: #FF2818;\n}\n\n.TooltipBase_bns_downgradeBlue_color {\n color: #28A9F0;\n}\n\n.SkillTooltip_skillIconContainer {\n width: 60px;\n height: 60px;\n padding: 0;\n float: left;\n position: relative;\n}\n.SkillTooltip_skillIcon {\n width: 60px;\n height: 60px;\n position: relative;\n}\n.SkillTooltip_skillIconCanvas {\n width: 60px;\n height: 60px;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n filter: blur(30px);\n opacity: 0.5;\n}\n.SkillTooltip_buttonIcon {\n position: absolute;\n right: 1px;\n bottom: 1px;\n height: 18px;\n opacity: 0.9;\n}\n.SkillTooltip_buttonIconMouse {\n background-color: rgba(0, 0, 0, 0.8);\n}\n.SkillTooltip_mainText {\n font-weight: 500;\n}\n.SkillTooltip_smallText {\n font-size: 12px;\n}\n.SkillTooltip_subTextMargin {\n margin-bottom: 0.3rem;\n}\n.SkillTooltip_boundaryContainer {\n display: flex;\n width: 100%;\n margin-bottom: 0.5rem;\n line-height: 17px;\n}\n.SkillTooltip_boundary {\n flex: 1;\n flex-basis: 0px;\n min-width: 0;\n display: flex;\n flex-direction: column;\n color: black;\n margin: 0.15rem;\n}\n.SkillTooltip_boundary:first-of-type > .SkillTooltip_boundaryHead {\n border-radius: 3px 0 0 0;\n}\n.SkillTooltip_boundary:last-of-type > .SkillTooltip_boundaryHead {\n border-radius: 0 3px 0 0;\n}\n.SkillTooltip_boundary:first-of-type > .SkillTooltip_boundaryBody {\n border-radius: 0 0 0 3px;\n}\n.SkillTooltip_boundary:last-of-type > .SkillTooltip_boundaryBody {\n border-radius: 0 0 3px 0;\n}\n.SkillTooltip_boundaryHead {\n color: white;\n font-weight: 500;\n font-size: 12px;\n text-overflow: ellipsis;\n overflow: hidden;\n padding: 0.3rem;\n text-align: center;\n flex: 1;\n min-height: 26px;\n background-color: rgba(127, 127, 127, 0.4);\n}\n.SkillTooltip_boundaryBody {\n color: white;\n padding: 0.5rem 0.3rem;\n margin-top: 0.15rem;\n text-align: center;\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 40px;\n flex: 2;\n background-color: rgba(127, 127, 127, 0.4);\n}\n.SkillTooltip_boundaryBodyModifier {\n min-height: 33px !important;\n}\n.SkillTooltip_boundaryHasIcon {\n min-height: 50px !important;\n}\n.SkillTooltip_conditionRow {\n display: flex;\n align-items: center;\n font-size: 12px;\n}\n.SkillTooltip_conditionRow:not(:last-of-type) {\n margin-bottom: 0.1rem;\n}\n.SkillTooltip_conditionIcon {\n width: 20px;\n height: 20px;\n margin-right: 0.33rem;\n}\n.SkillTooltip_conditionIconSmall {\n width: 12px;\n height: 12px;\n margin-right: 0.22rem;\n}\n\n.tooltipArg {\n color: #00D9FF;\n font-weight: 600;\n}\n\n.wordbreakall {\n word-break: break-all;\n}\n\n.wordbreakword {\n word-break: break-word;\n}\n\n.target-360 {\n background-image: url(\"./360.png\");\n background-repeat: no-repeat;\n background-position: 50% 60%;\n background-size: auto 64px;\n}\n\n.target-front-180 {\n background-image: url(\"./180.png\");\n background-repeat: no-repeat;\n background-position: 50% 70%;\n background-size: auto 64px;\n}\n\n.laser {\n background-image: url(\"./laser.png\");\n background-repeat: no-repeat;\n background-position: 50% 50%;\n background-size: auto 64px;\n}\n\n.arcanemark {\n background-image: url(\"./arcanemark.png\");\n width: 24px;\n height: 24px;\n background-position: 50% 50%;\n background-size: auto 24px;\n margin-left: 0.
|
|
8730
|
+
var css_248z$6 = ".TooltipBase_bns_upgradeRed_color {\n color: #FF2818;\n}\n\n.TooltipBase_bns_downgradeBlue_color {\n color: #28A9F0;\n}\n\n.SkillTooltip_skillIconContainer {\n width: 60px;\n height: 60px;\n padding: 0;\n float: left;\n position: relative;\n}\n.SkillTooltip_skillIcon {\n width: 60px;\n height: 60px;\n position: relative;\n}\n.SkillTooltip_skillIconCanvas {\n width: 60px;\n height: 60px;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n filter: blur(30px);\n opacity: 0.5;\n}\n.SkillTooltip_buttonIcon {\n position: absolute;\n right: 1px;\n bottom: 1px;\n height: 18px;\n opacity: 0.9;\n}\n.SkillTooltip_buttonIconMouse {\n background-color: rgba(0, 0, 0, 0.8);\n}\n.SkillTooltip_mainText {\n font-weight: 500;\n}\n.SkillTooltip_smallText {\n font-size: 12px;\n}\n.SkillTooltip_subTextMargin {\n margin-bottom: 0.3rem;\n}\n.SkillTooltip_boundaryContainer {\n display: flex;\n width: 100%;\n margin-bottom: 0.5rem;\n line-height: 17px;\n}\n.SkillTooltip_boundary {\n flex: 1;\n flex-basis: 0px;\n min-width: 0;\n display: flex;\n flex-direction: column;\n color: black;\n margin: 0.15rem;\n}\n.SkillTooltip_boundary:first-of-type > .SkillTooltip_boundaryHead {\n border-radius: 3px 0 0 0;\n}\n.SkillTooltip_boundary:last-of-type > .SkillTooltip_boundaryHead {\n border-radius: 0 3px 0 0;\n}\n.SkillTooltip_boundary:first-of-type > .SkillTooltip_boundaryBody {\n border-radius: 0 0 0 3px;\n}\n.SkillTooltip_boundary:last-of-type > .SkillTooltip_boundaryBody {\n border-radius: 0 0 3px 0;\n}\n.SkillTooltip_boundaryHead {\n color: white;\n font-weight: 500;\n font-size: 12px;\n text-overflow: ellipsis;\n overflow: hidden;\n padding: 0.3rem;\n text-align: center;\n flex: 1;\n min-height: 26px;\n background-color: rgba(127, 127, 127, 0.4);\n}\n.SkillTooltip_boundaryBody {\n color: white;\n padding: 0.5rem 0.3rem;\n margin-top: 0.15rem;\n text-align: center;\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 40px;\n flex: 2;\n background-color: rgba(127, 127, 127, 0.4);\n}\n.SkillTooltip_boundaryBodyModifier {\n min-height: 33px !important;\n}\n.SkillTooltip_boundaryHasIcon {\n min-height: 50px !important;\n}\n.SkillTooltip_conditionRow {\n display: flex;\n align-items: center;\n font-size: 12px;\n}\n.SkillTooltip_conditionRow:not(:last-of-type) {\n margin-bottom: 0.1rem;\n}\n.SkillTooltip_conditionIcon {\n width: 20px;\n height: 20px;\n margin-right: 0.33rem;\n}\n.SkillTooltip_conditionIconSmall {\n width: 12px;\n height: 12px;\n margin-right: 0.22rem;\n}\n\n.tooltipArg {\n color: #00D9FF;\n font-weight: 600;\n}\n\n.wordbreakall {\n word-break: break-all;\n}\n\n.wordbreakword {\n word-break: break-word;\n}\n\n.target-360 {\n background-image: url(\"./360.png\");\n background-repeat: no-repeat;\n background-position: 50% 60%;\n background-size: auto 64px;\n}\n\n.target-front-180 {\n background-image: url(\"./180.png\");\n background-repeat: no-repeat;\n background-position: 50% 70%;\n background-size: auto 64px;\n}\n\n.laser {\n background-image: url(\"./laser.png\");\n background-repeat: no-repeat;\n background-position: 50% 50%;\n background-size: auto 64px;\n}\n\n.arcanemark {\n background-image: url(\"./arcanemark.png\");\n width: 24px;\n height: 24px;\n background-position: 50% 50%;\n background-size: auto 24px;\n margin-left: 0.25rem;\n}";
|
|
8684
8731
|
styleInject(css_248z$6);
|
|
8685
8732
|
|
|
8686
8733
|
function getButtonIconPath(button) {
|
|
@@ -8846,7 +8893,7 @@ function SkillConditions(_a) {
|
|
|
8846
8893
|
}
|
|
8847
8894
|
|
|
8848
8895
|
function SkillTooltip(_a) {
|
|
8849
|
-
var data = _a.data, _b = _a.debug, debug = _b === void 0 ? false : _b, _c = _a.masteryPoints, masteryPoints = _c === void 0 ? 0 : _c, _d = _a.
|
|
8896
|
+
var data = _a.data, _b = _a.debug, debug = _b === void 0 ? false : _b, _c = _a.masteryPoints, masteryPoints = _c === void 0 ? 0 : _c, _d = _a.masteryIsCooldown, masteryIsCooldown = _d === void 0 ? false : _d;
|
|
8850
8897
|
var skill = data;
|
|
8851
8898
|
var tooltipBaseProps = {
|
|
8852
8899
|
title: skill.Name,
|
|
@@ -8866,7 +8913,7 @@ function SkillTooltip(_a) {
|
|
|
8866
8913
|
//bottomPart
|
|
8867
8914
|
AddSubTexts(tooltipBaseProps.subInfoGroups, skill);
|
|
8868
8915
|
AddBreakValue(tooltipBaseProps.subInfoGroups, skill);
|
|
8869
|
-
AddSkillMastery(tooltipBaseProps.subInfoGroups, masteryPoints,
|
|
8916
|
+
AddSkillMastery(tooltipBaseProps.subInfoGroups, masteryPoints, masteryIsCooldown);
|
|
8870
8917
|
AddPvpModifiers(tooltipBaseProps.subInfoGroups, skill);
|
|
8871
8918
|
AddBoundaries(tooltipBaseProps.subInfoGroups, skill);
|
|
8872
8919
|
AddConditions(tooltipBaseProps.subInfoGroups, skill);
|
|
@@ -8918,8 +8965,11 @@ function AddBreakValue(subInfoGroups, skill) {
|
|
|
8918
8965
|
});
|
|
8919
8966
|
}
|
|
8920
8967
|
}
|
|
8921
|
-
function AddSkillMastery(subInfoGroups, masteryPoints,
|
|
8922
|
-
if (masteryPoints == null || masteryPoints == 0
|
|
8968
|
+
function AddSkillMastery(subInfoGroups, masteryPoints, masteryIsCooldown) {
|
|
8969
|
+
if (masteryPoints == null || masteryPoints == 0)
|
|
8970
|
+
return;
|
|
8971
|
+
var masteryValue = GetSkillMasteryValue(masteryPoints, masteryIsCooldown);
|
|
8972
|
+
if (masteryValue == null || masteryValue == 0)
|
|
8923
8973
|
return;
|
|
8924
8974
|
var formattedMasteryValue = Number.isInteger(masteryValue) ? masteryValue.toString() : masteryValue.toFixed(2).replace(',', '.');
|
|
8925
8975
|
subInfoGroups.push({
|
|
@@ -8930,7 +8980,7 @@ function AddSkillMastery(subInfoGroups, masteryPoints, masteryValue, masteryIsPe
|
|
|
8930
8980
|
React__default["default"].createElement("span", { className: "tooltipArg", style: { fontSize: "14px" } }, "Skill Grandmaster"),
|
|
8931
8981
|
React__default["default"].createElement("div", { className: "arcanemark" }),
|
|
8932
8982
|
React__default["default"].createElement("span", { className: "tooltipArg", style: { fontSize: "14px" } }, masteryPoints)),
|
|
8933
|
-
|
|
8983
|
+
!masteryIsCooldown ?
|
|
8934
8984
|
React__default["default"].createElement("div", null,
|
|
8935
8985
|
"Damage increase:\u00A0",
|
|
8936
8986
|
React__default["default"].createElement("span", { className: "tooltipArg" },
|
|
@@ -9153,9 +9203,9 @@ var css_248z$5 = ".TooltipBase_bns_upgradeRed_color {\n color: #FF2818;\n}\n\n.
|
|
|
9153
9203
|
styleInject(css_248z$5);
|
|
9154
9204
|
|
|
9155
9205
|
var SkillTooltipWrapper = function (_a) {
|
|
9156
|
-
var data = _a.data, children = _a.children, _b = _a.interactive, interactive = _b === void 0 ? false : _b, _c = _a.placement, placement = _c === void 0 ? "right" : _c, _d = _a.followCursor, followCursor$1 = _d === void 0 ? false : _d, _e = _a.trigger, trigger = _e === void 0 ? "mouseenter focus" : _e, _f = _a.showArrow, showArrow = _f === void 0 ? true : _f, _g = _a.debug, debug = _g === void 0 ? false : _g, _h = _a.masteryPoints, masteryPoints = _h === void 0 ? 0 : _h, _j = _a.
|
|
9206
|
+
var data = _a.data, children = _a.children, _b = _a.interactive, interactive = _b === void 0 ? false : _b, _c = _a.placement, placement = _c === void 0 ? "right" : _c, _d = _a.followCursor, followCursor$1 = _d === void 0 ? false : _d, _e = _a.trigger, trigger = _e === void 0 ? "mouseenter focus" : _e, _f = _a.showArrow, showArrow = _f === void 0 ? true : _f, _g = _a.debug, debug = _g === void 0 ? false : _g, _h = _a.masteryPoints, masteryPoints = _h === void 0 ? 0 : _h, _j = _a.masteryIsCooldown, masteryIsCooldown = _j === void 0 ? false : _j;
|
|
9157
9207
|
var spanRef = React.useRef(null);
|
|
9158
|
-
var
|
|
9208
|
+
var _k = React.useState(null), childRef = _k[0], setChildRef = _k[1];
|
|
9159
9209
|
/**
|
|
9160
9210
|
* Mount the temporary span element.
|
|
9161
9211
|
* retrieve and store the target element's reference.
|
|
@@ -9168,7 +9218,7 @@ var SkillTooltipWrapper = function (_a) {
|
|
|
9168
9218
|
}, []);
|
|
9169
9219
|
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
9170
9220
|
children,
|
|
9171
|
-
childRef ? (React__default["default"].createElement(Tippy, { arrow: showArrow, trigger: trigger, plugins: [followCursor], followCursor: followCursor$1 && (!interactive && !debug), appendTo: document.body, placement: placement, animation: "fade", interactive: interactive || debug, content: React__default["default"].createElement(SkillTooltip, { data: data, debug: debug, masteryPoints: masteryPoints,
|
|
9221
|
+
childRef ? (React__default["default"].createElement(Tippy, { arrow: showArrow, trigger: trigger, plugins: [followCursor], followCursor: followCursor$1 && (!interactive && !debug), appendTo: document.body, placement: placement, animation: "fade", interactive: interactive || debug, content: React__default["default"].createElement(SkillTooltip, { data: data, debug: debug, masteryPoints: masteryPoints, masteryIsCooldown: masteryIsCooldown }), theme: "grade" + 4, reference: childRef })) : (React__default["default"].createElement("span", { "data-testid": "TooltipWrapper", ref: spanRef, style: { display: "none" } }))));
|
|
9172
9222
|
};
|
|
9173
9223
|
|
|
9174
9224
|
exports.ServerRegion = void 0;
|