bnstooltips 1.18.17 → 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.es.js +41 -37
- package/build/index.es.js.map +1 -1
- package/build/index.js +40 -36
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/build/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState, cloneElement, forwardRef as forwardRef$1, useLayoutEffect, useEffect, useRef } from 'react';
|
|
1
|
+
import React, { useState, cloneElement, forwardRef as forwardRef$1, useLayoutEffect, useEffect, useRef, useMemo } from 'react';
|
|
2
2
|
import { createPortal } from 'react-dom';
|
|
3
3
|
|
|
4
4
|
function styleInject(css, ref) {
|
|
@@ -129,6 +129,16 @@ function __generator(thisArg, body) {
|
|
|
129
129
|
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
130
130
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
131
131
|
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function __spreadArray(to, from, pack) {
|
|
135
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
136
|
+
if (ar || !(i in from)) {
|
|
137
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
138
|
+
ar[i] = from[i];
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
132
142
|
}
|
|
133
143
|
|
|
134
144
|
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}";
|
|
@@ -8165,10 +8175,13 @@ function ItemUpgradeEffects(props) {
|
|
|
8165
8175
|
|
|
8166
8176
|
function ItemTooltip(_a) {
|
|
8167
8177
|
var _this = this;
|
|
8168
|
-
var _b, _c, _d;
|
|
8169
|
-
var
|
|
8170
|
-
var
|
|
8171
|
-
var
|
|
8178
|
+
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;
|
|
8179
|
+
var _g = useState("advanced-1"), jobstyle = _g[0], setJobstyle = _g[1];
|
|
8180
|
+
var _h = useState(), client = _h[0], setClient = _h[1];
|
|
8181
|
+
var _j = useState(false), setHasSkillModifiers = _j[0], setSetHasSkillModifiers = _j[1];
|
|
8182
|
+
var _k = useState([]), jobstyles = _k[0], setJobstyles = _k[1];
|
|
8183
|
+
var _l = useState(false), itemCombats = _l[0], setItemCombats = _l[1];
|
|
8184
|
+
var item = data;
|
|
8172
8185
|
useEffect(function () {
|
|
8173
8186
|
if (offline && !showUpgradeEffects)
|
|
8174
8187
|
return;
|
|
@@ -8189,46 +8202,35 @@ function ItemTooltip(_a) {
|
|
|
8189
8202
|
setJobstyle(jobstyleOverride);
|
|
8190
8203
|
}
|
|
8191
8204
|
}, [jobstyleOverride]);
|
|
8192
|
-
|
|
8193
|
-
|
|
8194
|
-
|
|
8195
|
-
|
|
8205
|
+
useEffect(function () {
|
|
8206
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
8207
|
+
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;
|
|
8208
|
+
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)));
|
|
8209
|
+
var itemCombats_i = ((_g = item.skills) === null || _g === void 0 ? void 0 : _g.some(function (skill) { return skill.jobstyle != null; })) || false;
|
|
8210
|
+
setSetHasSkillModifiers(setHasSkillModifiers_i);
|
|
8211
|
+
setJobstyles(jobstyles_i);
|
|
8212
|
+
setItemCombats(itemCombats_i);
|
|
8213
|
+
}, [item]);
|
|
8214
|
+
useEffect(function () {
|
|
8215
|
+
if (jobstyles.length > 0 && !jobstyles.includes(jobstyle)) {
|
|
8216
|
+
setJobstyle(jobstyles[0]);
|
|
8217
|
+
}
|
|
8218
|
+
}, [jobstyle, jobstyles]);
|
|
8219
|
+
var itemCategory = useMemo(function () {
|
|
8220
|
+
var _a, _b, _c;
|
|
8221
|
+
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 : "";
|
|
8222
|
+
return category === "none" ? "" : category;
|
|
8223
|
+
}, [item]);
|
|
8196
8224
|
var tooltipBaseProps = {
|
|
8197
8225
|
title: item.name,
|
|
8198
8226
|
grade: item.grade,
|
|
8199
|
-
id: item.id
|
|
8227
|
+
id: "".concat(item.id, "-").concat(item.level),
|
|
8200
8228
|
icon: item.icon ? BuildIconPath(item.icon.iconPath) : "",
|
|
8201
8229
|
subtitle: itemCategory,
|
|
8202
8230
|
mainInfos: [],
|
|
8203
8231
|
subInfoGroups: [],
|
|
8204
8232
|
fullHeight: fullHeight,
|
|
8205
8233
|
};
|
|
8206
|
-
var setHasSkillModifiers = false;
|
|
8207
|
-
var jobstyles = [];
|
|
8208
|
-
var itemCombats = false;
|
|
8209
|
-
if (item.skills != null && item.skills.length > 0) {
|
|
8210
|
-
item.skills.forEach(function (itemSkill) {
|
|
8211
|
-
if (itemSkill.jobstyle != null) {
|
|
8212
|
-
setHasSkillModifiers = true;
|
|
8213
|
-
itemCombats = true;
|
|
8214
|
-
if (!jobstyles.includes(itemSkill.jobstyle)) {
|
|
8215
|
-
jobstyles.push(itemSkill.jobstyle);
|
|
8216
|
-
}
|
|
8217
|
-
}
|
|
8218
|
-
});
|
|
8219
|
-
}
|
|
8220
|
-
if (((_d = item.setBonus) === null || _d === void 0 ? void 0 : _d.setBonusStages) != null) {
|
|
8221
|
-
item.setBonus.setBonusStages.forEach(function (stage) {
|
|
8222
|
-
if (stage.skillModifiers != null && stage.skillModifiers.length > 0) {
|
|
8223
|
-
setHasSkillModifiers = true;
|
|
8224
|
-
stage.skillModifiers.forEach(function (modifier) {
|
|
8225
|
-
if (!jobstyles.includes(modifier.jobstyle)) {
|
|
8226
|
-
jobstyles.push(modifier.jobstyle);
|
|
8227
|
-
}
|
|
8228
|
-
});
|
|
8229
|
-
}
|
|
8230
|
-
});
|
|
8231
|
-
}
|
|
8232
8234
|
//top part
|
|
8233
8235
|
AddMainInfo(tooltipBaseProps.mainInfos, item);
|
|
8234
8236
|
AddSubInfo(tooltipBaseProps.mainInfos, item);
|
|
@@ -8238,7 +8240,9 @@ function ItemTooltip(_a) {
|
|
|
8238
8240
|
AddItemRandomStats(tooltipBaseProps.mainInfos, item);
|
|
8239
8241
|
//bottom part
|
|
8240
8242
|
AddGearScore(tooltipBaseProps.subInfoGroups, item, debug);
|
|
8241
|
-
|
|
8243
|
+
if (jobstyles.length > 1) {
|
|
8244
|
+
AddJobstyleToggles(setHasSkillModifiers, tooltipBaseProps.subInfoGroups, jobstyles, jobstyle, setJobstyle);
|
|
8245
|
+
}
|
|
8242
8246
|
AddTopText(tooltipBaseProps.subInfoGroups, item);
|
|
8243
8247
|
AddSkillDescriptions(tooltipBaseProps.subInfoGroups, item, itemCombats, jobstyle);
|
|
8244
8248
|
AddSkillModifiers(tooltipBaseProps.subInfoGroups, item, false, jobstyle);
|