@rpg-engine/long-bow 0.3.43 → 0.3.44

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 (115) hide show
  1. package/dist/components/Abstractions/SlotsContainer.d.ts +0 -1
  2. package/dist/components/Button.d.ts +2 -3
  3. package/dist/components/Chat/Chat.d.ts +2 -12
  4. package/dist/components/CheckButton.d.ts +2 -1
  5. package/dist/components/DraggableContainer.d.ts +0 -1
  6. package/dist/components/Equipment/EquipmentSet.d.ts +0 -8
  7. package/dist/components/Input.d.ts +0 -1
  8. package/dist/components/Item/Inventory/ItemContainer.d.ts +0 -12
  9. package/dist/components/Item/Inventory/ItemSlot.d.ts +0 -9
  10. package/dist/components/NPCDialog/NPCDialogText.d.ts +2 -4
  11. package/dist/components/RangeSlider.d.ts +0 -1
  12. package/dist/index.d.ts +0 -8
  13. package/dist/long-bow.cjs.development.js +515 -7465
  14. package/dist/long-bow.cjs.development.js.map +1 -1
  15. package/dist/long-bow.cjs.production.min.js +1 -1
  16. package/dist/long-bow.cjs.production.min.js.map +1 -1
  17. package/dist/long-bow.esm.js +520 -7461
  18. package/dist/long-bow.esm.js.map +1 -1
  19. package/dist/mocks/equipmentSet.mocks.d.ts +2 -15
  20. package/dist/mocks/skills.mocks.d.ts +121 -2
  21. package/package.json +2 -5
  22. package/src/components/Abstractions/SlotsContainer.tsx +0 -3
  23. package/src/components/Button.tsx +8 -18
  24. package/src/components/Chat/Chat.tsx +105 -106
  25. package/src/components/CheckButton.tsx +1 -1
  26. package/src/components/DraggableContainer.tsx +1 -4
  27. package/src/components/Dropdown.tsx +1 -7
  28. package/src/components/Equipment/EquipmentSet.tsx +0 -46
  29. package/src/components/Input.tsx +2 -6
  30. package/src/components/Item/Inventory/ItemContainer.tsx +6 -104
  31. package/src/components/Item/Inventory/ItemSlot.tsx +34 -234
  32. package/src/components/NPCDialog/NPCDialog.tsx +28 -4
  33. package/src/components/NPCDialog/NPCDialogText.tsx +15 -75
  34. package/src/components/RangeSlider.tsx +14 -37
  35. package/src/components/SkillsContainer.tsx +1 -1
  36. package/src/components/TimeWidget/TimeWidget.tsx +0 -1
  37. package/src/components/TradingMenu/TradingItemRow.tsx +6 -43
  38. package/src/components/TradingMenu/TradingMenu.tsx +1 -1
  39. package/src/components/TradingMenu/items.mock.ts +0 -1
  40. package/src/components/shared/SpriteFromAtlas.tsx +1 -4
  41. package/src/hooks/useOutsideAlerter.ts +2 -2
  42. package/src/index.tsx +0 -8
  43. package/src/mocks/atlas/items/items.json +314 -6086
  44. package/src/mocks/atlas/items/items.png +0 -0
  45. package/src/mocks/equipmentSet.mocks.ts +4 -49
  46. package/src/mocks/itemContainer.mocks.ts +6 -54
  47. package/src/mocks/skills.mocks.ts +2 -8
  48. package/src/stories/Chat.stories.tsx +3 -20
  49. package/src/stories/EquipmentSet.stories.tsx +0 -10
  50. package/src/stories/ItemContainer.stories.tsx +15 -84
  51. package/src/stories/RangeSlider.stories.tsx +9 -10
  52. package/dist/components/CaracterStatus/CaracterStatus.d.ts +0 -9
  53. package/dist/components/Chatdeprecated/ChatDeprecated.d.ts +0 -13
  54. package/dist/components/CircularController/CircularController.d.ts +0 -10
  55. package/dist/components/CraftBook/CraftBook.d.ts +0 -15
  56. package/dist/components/CraftBook/MockItems.d.ts +0 -2
  57. package/dist/components/DropdownSelectorContainer.d.ts +0 -13
  58. package/dist/components/Item/Inventory/ItemQuantitySelector.d.ts +0 -7
  59. package/dist/components/RadioInput/RadioButton.d.ts +0 -8
  60. package/dist/components/RadioInput/RadioInput.d.ts +0 -13
  61. package/dist/components/RadioInput/instruments.d.ts +0 -4
  62. package/dist/components/Spellbook/QuickSpells.d.ts +0 -10
  63. package/dist/components/Spellbook/Spell.d.ts +0 -11
  64. package/dist/components/Spellbook/Spellbook.d.ts +0 -15
  65. package/dist/components/Spellbook/SpellbookShortcuts.d.ts +0 -10
  66. package/dist/components/Spellbook/constants.d.ts +0 -3
  67. package/dist/components/Spellbook/mockSpells.d.ts +0 -2
  68. package/dist/components/itemSelector/ItemSelector.d.ts +0 -14
  69. package/dist/constants/uiDevices.d.ts +0 -1
  70. package/dist/stories/CaracterStatus.stories.d.ts +0 -5
  71. package/dist/stories/ChatDeprecated.stories.d.ts +0 -5
  72. package/dist/stories/CircullarController.stories.d.ts +0 -5
  73. package/dist/stories/CraftBook.stories.d.ts +0 -4
  74. package/dist/stories/DropdownSelectorContainer.stories.d.ts +0 -5
  75. package/dist/stories/ItemQuantitySelector.stories.d.ts +0 -5
  76. package/dist/stories/ItemSelector.stories.d.ts +0 -4
  77. package/dist/stories/QuickSpells.stories.d.ts +0 -5
  78. package/dist/stories/RadioInput.stories.d.ts +0 -5
  79. package/dist/stories/Spellbook.stories.d.ts +0 -5
  80. package/src/.DS_Store +0 -0
  81. package/src/components/.DS_Store +0 -0
  82. package/src/components/CaracterStatus/CaracterStatus.tsx +0 -86
  83. package/src/components/CaracterStatus/Character.png +0 -0
  84. package/src/components/Chatdeprecated/ChatDeprecated.tsx +0 -200
  85. package/src/components/CircularController/CircularController.tsx +0 -162
  86. package/src/components/CraftBook/CraftBook.tsx +0 -230
  87. package/src/components/CraftBook/MockItems.ts +0 -46
  88. package/src/components/DropdownSelectorContainer.tsx +0 -42
  89. package/src/components/Item/Inventory/ItemQuantitySelector.tsx +0 -142
  90. package/src/components/NPCDialog/.DS_Store +0 -0
  91. package/src/components/NPCDialog/img/.DS_Store +0 -0
  92. package/src/components/NPCDialog/img/press-button.gif +0 -0
  93. package/src/components/RadioInput/RadioButton.tsx +0 -98
  94. package/src/components/RadioInput/RadioInput.tsx +0 -99
  95. package/src/components/RadioInput/instruments.ts +0 -16
  96. package/src/components/Spellbook/QuickSpells.tsx +0 -120
  97. package/src/components/Spellbook/Spell.tsx +0 -201
  98. package/src/components/Spellbook/Spellbook.tsx +0 -144
  99. package/src/components/Spellbook/SpellbookShortcuts.tsx +0 -77
  100. package/src/components/Spellbook/constants.ts +0 -12
  101. package/src/components/Spellbook/mockSpells.ts +0 -60
  102. package/src/components/itemSelector/ItemSelector.tsx +0 -136
  103. package/src/constants/uiDevices.ts +0 -5
  104. package/src/mocks/.DS_Store +0 -0
  105. package/src/mocks/atlas/.DS_Store +0 -0
  106. package/src/stories/CaracterStatus.stories.tsx +0 -29
  107. package/src/stories/ChatDeprecated.stories.tsx +0 -170
  108. package/src/stories/CircullarController.stories.tsx +0 -33
  109. package/src/stories/CraftBook.stories.tsx +0 -40
  110. package/src/stories/DropdownSelectorContainer.stories.tsx +0 -41
  111. package/src/stories/ItemQuantitySelector.stories.tsx +0 -26
  112. package/src/stories/ItemSelector.stories.tsx +0 -77
  113. package/src/stories/QuickSpells.stories.tsx +0 -38
  114. package/src/stories/RadioInput.stories.tsx +0 -35
  115. package/src/stories/Spellbook.stories.tsx +0 -107
@@ -1,107 +0,0 @@
1
- import { Meta, Story } from '@storybook/react';
2
- import React, { useEffect, useState } from 'react';
3
- import { RPGUIRoot } from '../components/RPGUIRoot';
4
- import {
5
- defaultSpellShortcut,
6
- SPELL_SHORTCUTS_STORAGE_KEY,
7
- } from '../components/Spellbook/constants';
8
- import { mockSpells } from '../components/Spellbook/mockSpells';
9
- import { ISpellbookProps, Spellbook } from '../components/Spellbook/Spellbook';
10
-
11
- const meta: Meta = {
12
- title: 'Spellbook',
13
- component: Spellbook,
14
- };
15
-
16
- export default meta;
17
-
18
- const Template: Story<ISpellbookProps> = args => {
19
- const [spellShortcuts, setSpellShortcuts] = useState([]);
20
-
21
- useEffect(() => {
22
- const shortcuts = localStorage.getItem(SPELL_SHORTCUTS_STORAGE_KEY);
23
- if (shortcuts) {
24
- setSpellShortcuts(JSON.parse(shortcuts));
25
- }
26
- }, []);
27
-
28
- const setSpellShortcut = (key: string, index: number) => {
29
- const spellShortcuts = JSON.parse(
30
- localStorage.getItem(SPELL_SHORTCUTS_STORAGE_KEY) as string
31
- );
32
-
33
- const spell = mockSpells.find(s => s.key === key);
34
- if (!spell) {
35
- return;
36
- }
37
-
38
- if (!spellShortcuts) {
39
- const newSpellShortcuts = [
40
- defaultSpellShortcut,
41
- defaultSpellShortcut,
42
- defaultSpellShortcut,
43
- defaultSpellShortcut,
44
- ];
45
-
46
- newSpellShortcuts[index] = spell;
47
-
48
- localStorage.setItem(
49
- SPELL_SHORTCUTS_STORAGE_KEY,
50
- JSON.stringify(newSpellShortcuts)
51
- );
52
- } else {
53
- spellShortcuts[index] = spell;
54
-
55
- localStorage.setItem(
56
- SPELL_SHORTCUTS_STORAGE_KEY,
57
- JSON.stringify(spellShortcuts)
58
- );
59
- }
60
-
61
- setSpellShortcuts(spellShortcuts);
62
- };
63
-
64
- const removeSpellShortcut = (index: number) => {
65
- const spellShortcuts = JSON.parse(
66
- localStorage.getItem(SPELL_SHORTCUTS_STORAGE_KEY) as string
67
- );
68
-
69
- if (!spellShortcuts) return;
70
-
71
- spellShortcuts[index] = defaultSpellShortcut;
72
-
73
- localStorage.setItem(
74
- SPELL_SHORTCUTS_STORAGE_KEY,
75
- JSON.stringify(spellShortcuts)
76
- );
77
-
78
- setSpellShortcuts(spellShortcuts);
79
- };
80
-
81
- return (
82
- <RPGUIRoot>
83
- <div
84
- style={{
85
- width: '50%',
86
- height: '75%',
87
- }}
88
- >
89
- <Spellbook
90
- {...args}
91
- setSpellShortcut={setSpellShortcut}
92
- removeSpellShortcut={removeSpellShortcut}
93
- spellShortcuts={spellShortcuts}
94
- />
95
- </div>
96
- </RPGUIRoot>
97
- );
98
- };
99
-
100
- export const Default = Template.bind({});
101
- Default.args = {
102
- onClose: () => console.log('close'),
103
- onSpellClick: spellKey => console.log(spellKey),
104
- spells: mockSpells,
105
- magicLevel: 3,
106
- mana: 5,
107
- };