@rpg-engine/long-bow 0.6.83 → 0.6.86

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.
@@ -31944,7 +31944,7 @@ var QuestList = function QuestList(_ref) {
31944
31944
  style: {
31945
31945
  color: getStatusColor(quest.status)
31946
31946
  }
31947
- }, (_formatStatus = formatStatus(quest.status)) != null ? _formatStatus : 'Unknown')), React.createElement(QuestItem, null, React.createElement(Label, null, "Description:"), React.createElement(Value, null, quest.description)), quest.objectives && quest.objectives.length > 0 && React.createElement(QuestItem, null, React.createElement(Label, null, "Objectives:"), React.createElement(Value, null, formatObjectives(quest.objectives))), quest.rewards && quest.rewards.length > 0 && React.createElement(QuestItem, null, React.createElement(Label, null, "Rewards:"), React.createElement(Value, null, formatRewards(quest.rewards))));
31947
+ }, (_formatStatus = formatStatus(quest.status)) != null ? _formatStatus : 'Unknown')), React.createElement(QuestItem, null, React.createElement(Label, null, "Description:"), React.createElement(Value, null, quest.description)));
31948
31948
  }) : React.createElement(NoQuestContainer, null, React.createElement("p", null, "There are no ongoing quests")));
31949
31949
  };
31950
31950
  var QuestListContainer = /*#__PURE__*/styled.div.withConfig({
@@ -31971,47 +31971,71 @@ var NoQuestContainer = /*#__PURE__*/styled.div.withConfig({
31971
31971
  displayName: "QuestList__NoQuestContainer",
31972
31972
  componentId: "sc-1c1y8sp-5"
31973
31973
  })(["text-align:center;p{margin-top:5px;color:", ";}"], uiColors.lightGray);
31974
- var formatObjectives = function formatObjectives(objectives) {
31975
- try {
31976
- if (!objectives || !Array.isArray(objectives)) return '';
31977
- return objectives.map(function (objective) {
31978
- if ('killCountTarget' in objective) {
31979
- var _killObjective$creatu, _killObjective$creatu2, _killObjective$killCo, _killObjective$killCo2;
31980
- var killObjective = objective;
31981
- return "Kill " + formatText((_killObjective$creatu = (_killObjective$creatu2 = killObjective.creatureKeys) == null ? void 0 : _killObjective$creatu2.join(', ')) != null ? _killObjective$creatu : '') + ": " + ((_killObjective$killCo = killObjective.killCount) != null ? _killObjective$killCo : 0) + "/" + ((_killObjective$killCo2 = killObjective.killCountTarget) != null ? _killObjective$killCo2 : 0);
31982
- } else if ('targetNPCkey' in objective) {
31983
- var _interactionObjective;
31984
- var interactionObjective = objective;
31985
- return "Interact with NPC: " + formatText((_interactionObjective = interactionObjective.targetNPCkey) != null ? _interactionObjective : '');
31986
- } else {
31987
- return '';
31988
- }
31989
- }).filter(Boolean).join('; ');
31990
- } catch (error) {
31991
- console.error('Error formatting objectives:', error);
31992
- return '';
31993
- }
31994
- };
31995
- var formatRewards = function formatRewards(rewards) {
31996
- try {
31997
- if (!rewards || !Array.isArray(rewards)) return '';
31998
- return rewards.map(function (reward) {
31999
- var _reward$itemKeys, _reward$spellKeys;
32000
- var itemKeysFormatted = reward == null ? void 0 : (_reward$itemKeys = reward.itemKeys) == null ? void 0 : _reward$itemKeys.map(function (itemKey) {
32001
- return itemKey && (reward == null ? void 0 : reward.qty) !== undefined ? itemKey + " x" + reward.qty : '';
32002
- }).filter(Boolean).join(', ');
32003
- var spellKeysFormatted = reward == null ? void 0 : (_reward$spellKeys = reward.spellKeys) == null ? void 0 : _reward$spellKeys.filter(Boolean).join(', ');
32004
- var formattedReward = itemKeysFormatted ? "" + formatText(itemKeysFormatted) : '';
32005
- if (spellKeysFormatted) {
32006
- return formattedReward ? formattedReward + ", Spells: " + formatText(spellKeysFormatted) : "Spells: " + formatText(spellKeysFormatted);
32007
- }
32008
- return formattedReward || '';
32009
- }).filter(Boolean).join('; ');
32010
- } catch (error) {
32011
- console.error("Error formatting rewards: " + JSON.stringify(rewards) + ":", error);
32012
- return '';
32013
- }
32014
- };
31974
+ // const formatObjectives = (
31975
+ // objectives: (IQuestObjectiveKill | IQuestObjectiveInteraction)[]
31976
+ // ) => {
31977
+ // try {
31978
+ // if (!objectives || !Array.isArray(objectives)) return '';
31979
+ // return objectives
31980
+ // .map(objective => {
31981
+ // if ('killCountTarget' in objective) {
31982
+ // const killObjective = objective as IQuestObjectiveKill;
31983
+ // return `Kill ${formatText(
31984
+ // killObjective.creatureKeys?.join(', ') ?? ''
31985
+ // )}: ${killObjective.killCount ?? 0}/${killObjective.killCountTarget ??
31986
+ // 0}`;
31987
+ // } else if ('targetNPCkey' in objective) {
31988
+ // const interactionObjective = objective as IQuestObjectiveInteraction;
31989
+ // return `Interact with NPC: ${formatText(
31990
+ // interactionObjective.targetNPCkey ?? ''
31991
+ // )}`;
31992
+ // } else {
31993
+ // return '';
31994
+ // }
31995
+ // })
31996
+ // .filter(Boolean)
31997
+ // .join('; ');
31998
+ // } catch (error) {
31999
+ // console.error('Error formatting objectives:', error);
32000
+ // return '';
32001
+ // }
32002
+ // };
32003
+ // const formatRewards = (rewards: IQuest['rewards']) => {
32004
+ // try {
32005
+ // if (!rewards || !Array.isArray(rewards)) return '';
32006
+ // return rewards
32007
+ // .map(reward => {
32008
+ // const itemKeysFormatted = reward?.itemKeys
32009
+ // ?.map(itemKey =>
32010
+ // itemKey && reward?.qty !== undefined
32011
+ // ? `${itemKey} x${reward.qty}`
32012
+ // : ''
32013
+ // )
32014
+ // .filter(Boolean)
32015
+ // .join(', ');
32016
+ // const spellKeysFormatted = reward?.spellKeys
32017
+ // ?.filter(Boolean)
32018
+ // .join(', ');
32019
+ // const formattedReward = itemKeysFormatted
32020
+ // ? `${formatText(itemKeysFormatted)}`
32021
+ // : '';
32022
+ // if (spellKeysFormatted) {
32023
+ // return formattedReward
32024
+ // ? `${formattedReward}, Spells: ${formatText(spellKeysFormatted)}`
32025
+ // : `Spells: ${formatText(spellKeysFormatted)}`;
32026
+ // }
32027
+ // return formattedReward || '';
32028
+ // })
32029
+ // .filter(Boolean)
32030
+ // .join('; ');
32031
+ // } catch (error) {
32032
+ // console.error(
32033
+ // `Error formatting rewards: ${JSON.stringify(rewards)}:`,
32034
+ // error
32035
+ // );
32036
+ // return '';
32037
+ // }
32038
+ // };
32015
32039
  var formatText = function formatText(text) {
32016
32040
  if (!text) return '';
32017
32041
  return text.split('-').map(function (word) {
@@ -32678,22 +32702,35 @@ var Container$v = /*#__PURE__*/styled.div.withConfig({
32678
32702
  var SpellInfoWrapper = function SpellInfoWrapper(_ref) {
32679
32703
  var children = _ref.children,
32680
32704
  spell = _ref.spell,
32681
- scale = _ref.scale;
32705
+ scale = _ref.scale,
32706
+ _ref$holdTouchDuratio = _ref.holdTouchDuration,
32707
+ holdTouchDuration = _ref$holdTouchDuratio === void 0 ? 500 : _ref$holdTouchDuratio;
32682
32708
  var _useState = useState(false),
32683
32709
  isTooltipVisible = _useState[0],
32684
32710
  setIsTooltipVisible = _useState[1];
32685
32711
  var _useState2 = useState(false),
32686
32712
  isTooltipMobileVisible = _useState2[0],
32687
32713
  setIsTooltipMobileVisible = _useState2[1];
32714
+ var touchTimeoutRef = useRef(null);
32715
+ var handleTouchStart = function handleTouchStart() {
32716
+ touchTimeoutRef.current = setTimeout(function () {
32717
+ setIsTooltipMobileVisible(true);
32718
+ setIsTooltipVisible(false);
32719
+ }, holdTouchDuration);
32720
+ };
32721
+ var handleTouchEnd = function handleTouchEnd() {
32722
+ if (touchTimeoutRef.current) {
32723
+ clearTimeout(touchTimeoutRef.current);
32724
+ touchTimeoutRef.current = null;
32725
+ }
32726
+ };
32688
32727
  return React.createElement("div", {
32689
32728
  onMouseEnter: function onMouseEnter() {
32690
32729
  if (!isTooltipMobileVisible) setIsTooltipVisible(true);
32691
32730
  },
32692
32731
  onMouseLeave: setIsTooltipVisible.bind(null, false),
32693
- onTouchEnd: function onTouchEnd() {
32694
- setIsTooltipMobileVisible(true);
32695
- setIsTooltipVisible(false);
32696
- }
32732
+ onTouchStart: handleTouchStart,
32733
+ onTouchEnd: handleTouchEnd
32697
32734
  }, children, isTooltipVisible && !isTooltipMobileVisible && React.createElement(MagicTooltip, {
32698
32735
  spell: spell
32699
32736
  }), isTooltipMobileVisible && React.createElement(MobileSpellTooltip, {