@rpg-engine/long-bow 0.3.44 → 0.3.45

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.
Files changed (103) hide show
  1. package/dist/components/Abstractions/SlotsContainer.d.ts +1 -0
  2. package/dist/components/Button.d.ts +3 -2
  3. package/dist/components/Chat/Chat.d.ts +12 -2
  4. package/dist/components/Chatdeprecated/ChatDeprecated.d.ts +13 -0
  5. package/dist/components/CheckButton.d.ts +1 -2
  6. package/dist/components/CircularController/CircularController.d.ts +10 -0
  7. package/dist/components/CraftBook/CraftBook.d.ts +15 -0
  8. package/dist/components/CraftBook/MockItems.d.ts +2 -0
  9. package/dist/components/DraggableContainer.d.ts +1 -0
  10. package/dist/components/DropdownSelectorContainer.d.ts +13 -0
  11. package/dist/components/Equipment/EquipmentSet.d.ts +8 -0
  12. package/dist/components/Input.d.ts +1 -0
  13. package/dist/components/Item/Inventory/ItemContainer.d.ts +12 -0
  14. package/dist/components/Item/Inventory/ItemQuantitySelector.d.ts +7 -0
  15. package/dist/components/Item/Inventory/ItemSlot.d.ts +9 -0
  16. package/dist/components/NPCDialog/NPCDialogText.d.ts +4 -2
  17. package/dist/components/RadioInput/RadioButton.d.ts +8 -0
  18. package/dist/components/RadioInput/RadioInput.d.ts +13 -0
  19. package/dist/components/RadioInput/instruments.d.ts +4 -0
  20. package/dist/components/RangeSlider.d.ts +1 -0
  21. package/dist/components/Spellbook/QuickSpells.d.ts +10 -0
  22. package/dist/components/Spellbook/Spell.d.ts +11 -0
  23. package/dist/components/Spellbook/Spellbook.d.ts +15 -0
  24. package/dist/components/Spellbook/SpellbookShortcuts.d.ts +10 -0
  25. package/dist/components/Spellbook/constants.d.ts +3 -0
  26. package/dist/components/Spellbook/mockSpells.d.ts +2 -0
  27. package/dist/components/itemSelector/ItemSelector.d.ts +14 -0
  28. package/dist/constants/uiDevices.d.ts +1 -0
  29. package/dist/index.d.ts +8 -0
  30. package/dist/long-bow.cjs.development.js +7464 -515
  31. package/dist/long-bow.cjs.development.js.map +1 -1
  32. package/dist/long-bow.cjs.production.min.js +1 -1
  33. package/dist/long-bow.cjs.production.min.js.map +1 -1
  34. package/dist/long-bow.esm.js +7458 -518
  35. package/dist/long-bow.esm.js.map +1 -1
  36. package/dist/mocks/equipmentSet.mocks.d.ts +15 -2
  37. package/dist/mocks/skills.mocks.d.ts +2 -121
  38. package/dist/stories/ChatDeprecated.stories.d.ts +5 -0
  39. package/dist/stories/CircullarController.stories.d.ts +5 -0
  40. package/dist/stories/CraftBook.stories.d.ts +4 -0
  41. package/dist/stories/DropdownSelectorContainer.stories.d.ts +5 -0
  42. package/dist/stories/ItemQuantitySelector.stories.d.ts +5 -0
  43. package/dist/stories/ItemSelector.stories.d.ts +4 -0
  44. package/dist/stories/QuickSpells.stories.d.ts +5 -0
  45. package/dist/stories/RadioInput.stories.d.ts +5 -0
  46. package/dist/stories/Spellbook.stories.d.ts +5 -0
  47. package/package.json +4 -1
  48. package/src/components/Abstractions/SlotsContainer.tsx +3 -0
  49. package/src/components/Button.tsx +18 -8
  50. package/src/components/Chat/Chat.tsx +105 -105
  51. package/src/components/Chatdeprecated/ChatDeprecated.tsx +200 -0
  52. package/src/components/CheckButton.tsx +1 -1
  53. package/src/components/CircularController/CircularController.tsx +162 -0
  54. package/src/components/CraftBook/CraftBook.tsx +230 -0
  55. package/src/components/CraftBook/MockItems.ts +46 -0
  56. package/src/components/DraggableContainer.tsx +4 -1
  57. package/src/components/Dropdown.tsx +7 -1
  58. package/src/components/DropdownSelectorContainer.tsx +42 -0
  59. package/src/components/Equipment/EquipmentSet.tsx +46 -0
  60. package/src/components/Input.tsx +6 -2
  61. package/src/components/Item/Inventory/ItemContainer.tsx +104 -6
  62. package/src/components/Item/Inventory/ItemQuantitySelector.tsx +142 -0
  63. package/src/components/Item/Inventory/ItemSlot.tsx +234 -34
  64. package/src/components/NPCDialog/NPCDialog.tsx +4 -28
  65. package/src/components/NPCDialog/NPCDialogText.tsx +75 -15
  66. package/src/components/NPCDialog/img/press-button.gif +0 -0
  67. package/src/components/RadioInput/RadioButton.tsx +98 -0
  68. package/src/components/RadioInput/RadioInput.tsx +99 -0
  69. package/src/components/RadioInput/instruments.ts +16 -0
  70. package/src/components/RangeSlider.tsx +37 -14
  71. package/src/components/SkillsContainer.tsx +1 -1
  72. package/src/components/Spellbook/QuickSpells.tsx +120 -0
  73. package/src/components/Spellbook/Spell.tsx +201 -0
  74. package/src/components/Spellbook/Spellbook.tsx +144 -0
  75. package/src/components/Spellbook/SpellbookShortcuts.tsx +77 -0
  76. package/src/components/Spellbook/constants.ts +12 -0
  77. package/src/components/Spellbook/mockSpells.ts +60 -0
  78. package/src/components/TimeWidget/TimeWidget.tsx +1 -0
  79. package/src/components/TradingMenu/TradingItemRow.tsx +43 -6
  80. package/src/components/TradingMenu/TradingMenu.tsx +1 -1
  81. package/src/components/itemSelector/ItemSelector.tsx +136 -0
  82. package/src/components/shared/SpriteFromAtlas.tsx +4 -1
  83. package/src/constants/uiDevices.ts +5 -0
  84. package/src/hooks/useOutsideAlerter.ts +2 -2
  85. package/src/index.tsx +8 -0
  86. package/src/mocks/atlas/items/items.json +6086 -314
  87. package/src/mocks/atlas/items/items.png +0 -0
  88. package/src/mocks/equipmentSet.mocks.ts +49 -4
  89. package/src/mocks/itemContainer.mocks.ts +54 -6
  90. package/src/mocks/skills.mocks.ts +8 -2
  91. package/src/stories/Chat.stories.tsx +20 -3
  92. package/src/stories/ChatDeprecated.stories.tsx +170 -0
  93. package/src/stories/CircullarController.stories.tsx +33 -0
  94. package/src/stories/CraftBook.stories.tsx +40 -0
  95. package/src/stories/DropdownSelectorContainer.stories.tsx +41 -0
  96. package/src/stories/EquipmentSet.stories.tsx +10 -0
  97. package/src/stories/ItemContainer.stories.tsx +84 -15
  98. package/src/stories/ItemQuantitySelector.stories.tsx +26 -0
  99. package/src/stories/ItemSelector.stories.tsx +77 -0
  100. package/src/stories/QuickSpells.stories.tsx +38 -0
  101. package/src/stories/RadioInput.stories.tsx +35 -0
  102. package/src/stories/RangeSlider.stories.tsx +10 -9
  103. package/src/stories/Spellbook.stories.tsx +107 -0
@@ -6,6 +6,7 @@ interface IProps {
6
6
  onClose?: () => void;
7
7
  onPositionChange?: (position: IPosition) => void;
8
8
  onOutsideClick?: () => void;
9
+ initialPosition?: IPosition;
9
10
  }
10
11
  export declare const SlotsContainer: React.FC<IProps>;
11
12
  export {};
@@ -3,9 +3,10 @@ export declare enum ButtonTypes {
3
3
  RPGUIButton = "rpgui-button",
4
4
  RPGUIGoldButton = "rpgui-button golden"
5
5
  }
6
- export interface IButtonProps {
6
+ export interface IButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
7
7
  disabled?: boolean;
8
8
  children: React.ReactNode;
9
9
  buttonType: ButtonTypes;
10
+ onClick?: (e: any) => void;
10
11
  }
11
- export declare const Button: React.FC<IButtonProps & React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>>;
12
+ export declare const Button: ({ disabled, children, buttonType, onClick, ...props }: IButtonProps) => JSX.Element;
@@ -1,11 +1,21 @@
1
1
  import { IChatMessage } from '@rpg-engine/shared';
2
2
  import React from 'react';
3
+ interface IStyles {
4
+ textColor?: string;
5
+ buttonColor?: string;
6
+ buttonBackgroundColor?: string;
7
+ width?: string;
8
+ height?: string;
9
+ }
3
10
  export interface IChatProps {
4
11
  chatMessages: IChatMessage[];
5
12
  onSendChatMessage: (message: string) => void;
6
13
  onCloseButton: () => void;
14
+ onFocus?: () => void;
15
+ onBlur?: () => void;
7
16
  opacity?: number;
8
- width?: string;
9
- height?: string;
17
+ sendMessage: boolean;
18
+ styles?: IStyles;
10
19
  }
11
20
  export declare const Chat: React.FC<IChatProps>;
21
+ export {};
@@ -0,0 +1,13 @@
1
+ import { IChatMessage } from '@rpg-engine/shared';
2
+ import React from 'react';
3
+ export interface IChatDeprecatedProps {
4
+ chatMessages: IChatMessage[];
5
+ onSendChatMessage: (message: string) => void;
6
+ onCloseButton: () => void;
7
+ onFocus?: () => void;
8
+ onBlur?: () => void;
9
+ opacity?: number;
10
+ width?: string;
11
+ height?: string;
12
+ }
13
+ export declare const ChatDeprecated: React.FC<IChatDeprecatedProps>;
@@ -7,8 +7,7 @@ export interface ICheckProps {
7
7
  items: ICheckItems[];
8
8
  onChange: (selectedValues: IChecklistSelectedValues) => void;
9
9
  }
10
- interface IChecklistSelectedValues {
10
+ export interface IChecklistSelectedValues {
11
11
  [label: string]: boolean;
12
12
  }
13
13
  export declare const CheckButton: React.FC<ICheckProps>;
14
- export {};
@@ -0,0 +1,10 @@
1
+ import { IRawSpell } from '@rpg-engine/shared';
2
+ import React from 'react';
3
+ export declare type CircularControllerProps = {
4
+ onActionClick: () => void;
5
+ onCancelClick: () => void;
6
+ onSpellClick: (spellKey: string) => void;
7
+ mana: number;
8
+ spells: IRawSpell[];
9
+ };
10
+ export declare const CircularController: React.FC<CircularControllerProps>;
@@ -0,0 +1,15 @@
1
+ import { ICraftableItem } from '@rpg-engine/shared';
2
+ import React from 'react';
3
+ export interface IItemCraftSelectorProps {
4
+ atlasJSON: any;
5
+ atlasIMG: any;
6
+ onClose: () => void;
7
+ onSelect: (value: string) => void;
8
+ onCraftItem: (value: string | undefined) => void;
9
+ craftablesItems: ICraftableItem[];
10
+ }
11
+ export interface ShowMessage {
12
+ show: boolean;
13
+ index: number;
14
+ }
15
+ export declare const CraftBook: React.FC<IItemCraftSelectorProps>;
@@ -0,0 +1,2 @@
1
+ import { ICraftableItem } from '@rpg-engine/shared';
2
+ export declare const craftableItems: ICraftableItem[];
@@ -14,5 +14,6 @@ export interface IDraggableContainerProps {
14
14
  cancelDrag?: string;
15
15
  onPositionChange?: (position: IPosition) => void;
16
16
  onOutsideClick?: () => void;
17
+ initialPosition?: IPosition;
17
18
  }
18
19
  export declare const DraggableContainer: React.FC<IDraggableContainerProps>;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ interface IDropdownSelectorOption {
3
+ id: string;
4
+ name: string;
5
+ }
6
+ export interface IDropdownSelectorContainer {
7
+ onChange: (id: string) => void;
8
+ options: IDropdownSelectorOption[];
9
+ details?: string;
10
+ title: string;
11
+ }
12
+ export declare const DropdownSelectorContainer: React.FC<IDropdownSelectorContainer>;
13
+ export {};
@@ -1,9 +1,17 @@
1
1
  import { IEquipmentSet, IItem, ItemContainerType, ItemType } from '@rpg-engine/shared';
2
2
  import React from 'react';
3
+ import { IPosition } from '../../types/eventTypes';
3
4
  export interface IEquipmentSetProps {
4
5
  equipmentSet: IEquipmentSet;
5
6
  onClose?: () => void;
6
7
  onItemClick?: (ItemType: ItemType, item: IItem, itemContainerType: ItemContainerType | null) => void;
8
+ onItemDragStart?: (item: IItem, slotIndex: number, itemContainerType: ItemContainerType | null) => void;
9
+ onItemDragEnd?: (quantity?: number) => void;
10
+ onItemPlaceDrop?: (item: IItem | null, slotIndex: number, itemContainerType: ItemContainerType | null) => void;
11
+ onItemOutsideDrop?: (item: IItem, position: IPosition) => void;
12
+ dragScale?: number;
13
+ checkIfItemCanBeMoved: () => boolean;
14
+ checkIfItemShouldDragEnd?: () => boolean;
7
15
  onMouseOver?: (e: any, slotIndex: number, item: IItem | null) => void;
8
16
  onSelected?: (optionId: string) => void;
9
17
  initialPosition?: {
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
2
  export interface IInputProps extends React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> {
3
+ innerRef?: React.Ref<HTMLInputElement>;
3
4
  }
4
5
  export declare const Input: React.FC<IInputProps>;
@@ -1,14 +1,26 @@
1
1
  import { IItem, IItemContainer, ItemContainerType } from '@rpg-engine/shared';
2
2
  import React from 'react';
3
+ import { IPosition } from '../../../types/eventTypes';
3
4
  export interface IItemContainerProps {
4
5
  itemContainer: IItemContainer;
5
6
  onClose?: () => void;
6
7
  onItemClick?: (item: IItem, ItemType: IItem['type'], itemContainerType: ItemContainerType | null) => void;
8
+ onItemDragStart?: (item: IItem, slotIndex: number, itemContainerType: ItemContainerType | null) => void;
9
+ onItemDragEnd?: (quantity?: number) => void;
10
+ onOutsideDrop?: (item: IItem, position: IPosition) => void;
11
+ onItemPlaceDrop?: (item: IItem | null, slotIndex: number, itemContainerType: ItemContainerType | null) => void;
12
+ dragScale?: number;
13
+ checkIfItemCanBeMoved: () => boolean;
14
+ checkIfItemShouldDragEnd?: () => boolean;
7
15
  onMouseOver?: (e: any, slotIndex: number, item: IItem | null) => void;
8
16
  onSelected?: (optionId: string, item: IItem) => void;
9
17
  type: ItemContainerType;
10
18
  atlasJSON: any;
11
19
  atlasIMG: any;
12
20
  disableContextMenu?: boolean;
21
+ initialPosition?: {
22
+ x: number;
23
+ y: number;
24
+ };
13
25
  }
14
26
  export declare const ItemContainer: React.FC<IItemContainerProps>;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ export interface IItemQuantitySelectorProps {
3
+ quantity: number;
4
+ onConfirm: (quantity: number) => void;
5
+ onClose: () => void;
6
+ }
7
+ export declare const ItemQuantitySelector: React.FC<IItemQuantitySelectorProps>;
@@ -1,5 +1,6 @@
1
1
  import { IItem, IItemContainer, ItemContainerType, ItemSlotType, ItemType } from '@rpg-engine/shared';
2
2
  import React from 'react';
3
+ import { IPosition } from '../../../types/eventTypes';
3
4
  interface IProps {
4
5
  slotIndex: number;
5
6
  item: IItem | null;
@@ -10,6 +11,14 @@ interface IProps {
10
11
  onMouseOver: (event: any, slotIndex: number, item: IItem | null, x: number, y: number) => void;
11
12
  onMouseOut?: () => void;
12
13
  onClick: (ItemType: ItemType, itemContainerType: ItemContainerType | null, item: IItem) => void;
14
+ onDragStart: (item: IItem, slotIndex: number, itemContainerType: ItemContainerType | null) => void;
15
+ onDragEnd: (quantity?: number) => void;
16
+ onOutsideDrop?: (item: IItem, position: IPosition) => void;
17
+ dragScale?: number;
18
+ checkIfItemCanBeMoved: () => boolean;
19
+ checkIfItemShouldDragEnd?: () => boolean;
20
+ openQuantitySelector?: (maxQuantity: number, callback: () => void) => void;
21
+ onPlaceDrop: (item: IItem | null, slotIndex: number, itemContainerType: ItemContainerType | null) => void;
13
22
  atlasJSON: any;
14
23
  atlasIMG: any;
15
24
  isContextMenuDisabled?: boolean;
@@ -1,9 +1,11 @@
1
1
  import React from 'react';
2
+ import { NPCDialogType } from '../..';
2
3
  interface IProps {
3
4
  text: string;
4
5
  onClose: () => void;
5
- onEndStep: () => void;
6
- onStartStep: () => void;
6
+ onEndStep?: () => void;
7
+ onStartStep?: () => void;
8
+ type?: NPCDialogType;
7
9
  }
8
10
  export declare const NPCDialogText: React.FC<IProps>;
9
11
  export {};
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ export interface IRadioProps {
3
+ title: string;
4
+ subtitle: string;
5
+ instrument: string | null;
6
+ setInstrument: (value: string) => void;
7
+ }
8
+ export declare const RadioButton: React.FC<IRadioProps>;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ export interface IRadioItems {
3
+ title: string;
4
+ subtitle: string;
5
+ }
6
+ export interface IRadioInput {
7
+ title: string;
8
+ subtitle: string;
9
+ onSelect: (a: string) => void;
10
+ onCancel: () => void;
11
+ items: IRadioItems[];
12
+ }
13
+ export declare const RadioInput: React.FC<IRadioInput>;
@@ -0,0 +1,4 @@
1
+ export declare const Itools: {
2
+ title: string;
3
+ subtitle: string;
4
+ }[];
@@ -9,5 +9,6 @@ export interface IRangeSliderProps {
9
9
  valueMax: number;
10
10
  width: string;
11
11
  onChange: (value: number) => void;
12
+ value: number;
12
13
  }
13
14
  export declare const RangeSlider: React.FC<IRangeSliderProps>;
@@ -0,0 +1,10 @@
1
+ import { IRawSpell } from '@rpg-engine/shared';
2
+ import React from 'react';
3
+ export declare type QuickSpellsProps = {
4
+ quickSpells: IRawSpell[];
5
+ onSpellCast: (spellKey: string) => void;
6
+ mana: number;
7
+ isBlockedCastingByKeyboard?: boolean;
8
+ };
9
+ export declare const QuickSpells: React.FC<QuickSpellsProps>;
10
+ export declare const SpellShortcut: import("styled-components").StyledComponent<"button", any, {}, never>;
@@ -0,0 +1,11 @@
1
+ import { IRawSpell } from '@rpg-engine/shared';
2
+ import React from 'react';
3
+ interface Props extends IRawSpell {
4
+ charMana: number;
5
+ charMagicLevel: number;
6
+ onClick?: (spellKey: string) => void;
7
+ isSettingShortcut?: boolean;
8
+ spellKey: string;
9
+ }
10
+ export declare const Spell: React.FC<Props>;
11
+ export {};
@@ -0,0 +1,15 @@
1
+ import { IRawSpell } from '@rpg-engine/shared';
2
+ import React from 'react';
3
+ export interface ISpellbookProps {
4
+ onClose?: () => void;
5
+ onInputFocus?: () => void;
6
+ onInputBlur?: () => void;
7
+ spells: IRawSpell[];
8
+ magicLevel: number;
9
+ mana: number;
10
+ onSpellClick: (spellKey: string) => void;
11
+ setSpellShortcut: (key: string, index: number) => void;
12
+ spellShortcuts: IRawSpell[];
13
+ removeSpellShortcut: (index: number) => void;
14
+ }
15
+ export declare const Spellbook: React.FC<ISpellbookProps>;
@@ -0,0 +1,10 @@
1
+ import { IRawSpell } from '@rpg-engine/shared';
2
+ import React from 'react';
3
+ declare type Props = {
4
+ setSettingShortcutIndex: (index: number) => void;
5
+ settingShortcutIndex: number;
6
+ shortcuts: IRawSpell[];
7
+ removeShortcut: (index: number) => void;
8
+ };
9
+ export declare const SpellbookShortcuts: React.FC<Props>;
10
+ export {};
@@ -0,0 +1,3 @@
1
+ import { IRawSpell } from '@rpg-engine/shared';
2
+ export declare const SPELL_SHORTCUTS_STORAGE_KEY = "spellShortcuts";
3
+ export declare const defaultSpellShortcut: IRawSpell;
@@ -0,0 +1,2 @@
1
+ import { IRawSpell } from '@rpg-engine/shared';
2
+ export declare const mockSpells: IRawSpell[];
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ export interface IOptionsItemSelectorProps {
3
+ name: string;
4
+ description?: string;
5
+ imageKey: string;
6
+ }
7
+ export interface IItemSelectorProps {
8
+ atlasJSON: any;
9
+ atlasIMG: any;
10
+ options: IOptionsItemSelectorProps[];
11
+ onClose: () => void;
12
+ onSelect: (value: string) => void;
13
+ }
14
+ export declare const ItemSelector: React.FC<IItemSelectorProps>;
@@ -0,0 +1 @@
1
+ export declare const IS_MOBILE_OR_TABLET: boolean;
package/dist/index.d.ts CHANGED
@@ -1,14 +1,20 @@
1
1
  export * from './components/Button';
2
2
  export * from './components/Character/CharacterSelection';
3
3
  export * from './components/Chat/Chat';
4
+ export * from './components/Chatdeprecated/ChatDeprecated';
4
5
  export * from './components/CheckButton';
6
+ export * from './components/CircularController/CircularController';
7
+ export * from './components/CraftBook/CraftBook';
5
8
  export * from './components/DraggableContainer';
6
9
  export * from './components/Dropdown';
10
+ export * from './components/DropdownSelectorContainer';
7
11
  export * from './components/Equipment/EquipmentSet';
8
12
  export * from './components/HistoryDialog';
9
13
  export * from './components/Input';
14
+ export { ErrorBoundary } from './components/Item/Inventory/ErrorBoundary';
10
15
  export * from './components/Item/Inventory/ItemContainer';
11
16
  export * from './components/Item/Inventory/ItemSlot';
17
+ export * from './components/itemSelector/ItemSelector';
12
18
  export * from './components/ListMenu';
13
19
  export * from './components/NPCDialog/NPCDialog';
14
20
  export * from './components/NPCDialog/NPCMultiDialog';
@@ -24,6 +30,8 @@ export * from './components/RPGUIRoot';
24
30
  export * from './components/shared/SpriteFromAtlas';
25
31
  export * from './components/SkillProgressBar';
26
32
  export * from './components/SkillsContainer';
33
+ export * from './components/Spellbook/QuickSpells';
34
+ export * from './components/Spellbook/Spellbook';
27
35
  export * from './components/TextArea';
28
36
  export * from './components/TimeWidget/TimeWidget';
29
37
  export * from './components/TradingMenu/TradingMenu';