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