@eveshipfit/ui-ingame 1.11.0 → 1.11.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/dist/index.d.mts CHANGED
@@ -343,7 +343,7 @@ interface FittingWindowProps {
343
343
  browser?: ReactNode;
344
344
  /** Like `ShipStatistics`; slid out by the Statistics button, which is only there with it. */
345
345
  statistics?: ReactNode;
346
- /** Shows the fit without its name, warnings, history or anything to change it. */
346
+ /** Shows the fit without its warnings, history or anything to change it. */
347
347
  preview?: boolean;
348
348
  /** Shows an empty wheel with this text, and nothing of the fit. */
349
349
  placeholder?: string;
package/dist/index.mjs CHANGED
@@ -8020,6 +8020,10 @@ const byRule = {
8020
8020
  skill: "skill",
8021
8021
  slots: "error",
8022
8022
  wrong_slot: "error",
8023
+ not_a_module: "error",
8024
+ not_a_drone: "error",
8025
+ not_a_fighter: "error",
8026
+ not_an_implant: "error",
8023
8027
  slot_taken: "error",
8024
8028
  wrong_slot_index: "error",
8025
8029
  subsystem_taken: "error",
@@ -8030,6 +8034,9 @@ const byRule = {
8030
8034
  ship_item: "error",
8031
8035
  max_group: "error",
8032
8036
  max_type: "error",
8037
+ not_a_hull: "error",
8038
+ not_a_mode: "error",
8039
+ not_a_skill: "error",
8033
8040
  charge_group: "error",
8034
8041
  charge_size: "error"
8035
8042
  };
@@ -8116,6 +8123,10 @@ function violationText({ target, rule }, fit, names) {
8116
8123
  case "slots": return `Too many ${rackItems[rule.slot]}`;
8117
8124
  case "skill": return `${names.type(rule.type_id)} ${romanLevels[rule.required - 1]}`;
8118
8125
  case "wrong_slot": return `${subject}: goes in ${slotNames[rule.expected]}`;
8126
+ case "not_a_module": return `${subject}: not a module`;
8127
+ case "not_a_drone": return `${subject}: not a drone`;
8128
+ case "not_an_implant": return `${subject}: not an implant`;
8129
+ case "not_a_fighter": return `${subject}: not a fighter`;
8119
8130
  case "slot_taken": return `${subject}: slot already taken`;
8120
8131
  case "wrong_slot_index": return `${subject}: goes in ${item?.slot.type} slot ${rule.expected}`;
8121
8132
  case "subsystem_taken": return `${subject}: another subsystem covers the same part of the ship`;
@@ -8126,6 +8137,9 @@ function violationText({ target, rule }, fit, names) {
8126
8137
  case "ship_item": return `${subject}: does not fit on a structure`;
8127
8138
  case "max_group": return `${subject}: only ${rule.allowed} ${names.group(rule.group_id)} can be ${rule.limit}`;
8128
8139
  case "max_type": return `${subject}: only ${rule.allowed} can be fitted`;
8140
+ case "not_a_hull": return `${names.type(fit.ship.type_id)}: not a ship, structure or container`;
8141
+ case "not_a_mode": return `${fit.ship.mode === void 0 ? "" : names.type(fit.ship.mode)}: not a mode of this ship`;
8142
+ case "not_a_skill": return `${names.type(rule.type_id)}: not a skill`;
8129
8143
  case "charge_group": return `${charge}: cannot be loaded in ${module}`;
8130
8144
  case "charge_size": return `${charge}: wrong size for ${module}`;
8131
8145
  }
@@ -8196,6 +8210,7 @@ function FittingWindow({ label = "Fitting Window", browser, statistics: givenSta
8196
8210
  })
8197
8211
  })
8198
8212
  }),
8213
+ preview && placeholder === void 0 && /* @__PURE__ */ jsx(PreviewName, {}),
8199
8214
  !preview && placeholder === void 0 && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(FitName, {}), /* @__PURE__ */ jsx(Violations, {})] }),
8200
8215
  !preview && browser !== void 0 && /* @__PURE__ */ jsx("div", {
8201
8216
  className: FittingWindow_module_default.tools,
@@ -8443,6 +8458,25 @@ function FitName() {
8443
8458
  function _temp$7(event_0) {
8444
8459
  return event_0.currentTarget.select();
8445
8460
  }
8461
+ function PreviewName() {
8462
+ const $ = c(2);
8463
+ const shown = useShownSnapshot().fit;
8464
+ const ship = useType(shown.ship.type_id);
8465
+ const t0 = shown.name || ship?.name;
8466
+ let t1;
8467
+ if ($[0] !== t0) {
8468
+ t1 = /* @__PURE__ */ jsx("div", {
8469
+ className: FittingWindow_module_default.name,
8470
+ children: /* @__PURE__ */ jsx("span", {
8471
+ className: FittingWindow_module_default.fitName,
8472
+ children: t0
8473
+ })
8474
+ });
8475
+ $[0] = t0;
8476
+ $[1] = t1;
8477
+ } else t1 = $[1];
8478
+ return t1;
8479
+ }
8446
8480
  const violationKinds = [
8447
8481
  {
8448
8482
  kind: "error",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eveshipfit/ui-ingame",
3
- "version": "1.11.0",
3
+ "version": "1.11.2",
4
4
  "description": "EVE Online ship fitting UI that looks like the in-game one",
5
5
  "license": "MIT",
6
6
  "author": "EVEShipFit Team <info@eveship.fit>",
@@ -27,8 +27,8 @@
27
27
  "access": "public"
28
28
  },
29
29
  "dependencies": {
30
- "@eveshipfit/fitting": "2.5.0",
31
- "@eveshipfit/react-hooks": "2.5.0"
30
+ "@eveshipfit/fitting": "2.5.1",
31
+ "@eveshipfit/react-hooks": "2.5.1"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@babel/core": "^8.0.9",