@rpg-engine/long-bow 0.1.76 → 0.1.79

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 (60) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +181 -181
  3. package/dist/components/ScrollList.d.ts +15 -0
  4. package/dist/components/store/UI.store.d.ts +3 -0
  5. package/dist/index.d.ts +1 -0
  6. package/dist/long-bow.cjs.development.js +164 -10
  7. package/dist/long-bow.cjs.development.js.map +1 -1
  8. package/dist/long-bow.cjs.production.min.js +1 -1
  9. package/dist/long-bow.cjs.production.min.js.map +1 -1
  10. package/dist/long-bow.esm.js +164 -11
  11. package/dist/long-bow.esm.js.map +1 -1
  12. package/dist/mocks/skills.mocks.d.ts +6 -0
  13. package/package.json +96 -96
  14. package/src/components/Abstractions/SlotsContainer.tsx +42 -42
  15. package/src/components/Button.tsx +29 -29
  16. package/src/components/Chat/Chat.tsx +193 -193
  17. package/src/components/CheckButton.tsx +65 -65
  18. package/src/components/DraggableContainer.tsx +150 -150
  19. package/src/components/Dropdown.tsx +57 -57
  20. package/src/components/Equipment/EquipmentSet.tsx +179 -179
  21. package/src/components/Input.tsx +11 -11
  22. package/src/components/Item/Cards/ItemCard.tsx +36 -36
  23. package/src/components/Item/Inventory/ItemContainer.tsx +113 -113
  24. package/src/components/Item/Inventory/ItemSlot.tsx +158 -158
  25. package/src/components/Item/Inventory/itemContainerHelper.ts +81 -81
  26. package/src/components/ListMenu.tsx +65 -65
  27. package/src/components/Multitab/Tab.tsx +57 -57
  28. package/src/components/Multitab/TabBody.tsx +13 -13
  29. package/src/components/Multitab/TabsContainer.tsx +97 -99
  30. package/src/components/NPCDialog/NPCDialog.tsx +145 -145
  31. package/src/components/NPCDialog/NPCDialogText.tsx +53 -53
  32. package/src/components/NPCDialog/QuestionDialog/QuestionDialog.tsx +242 -242
  33. package/src/components/ProgressBar.tsx +91 -91
  34. package/src/components/RPGUIContainer.tsx +47 -47
  35. package/src/components/RPGUIRoot.tsx +14 -14
  36. package/src/components/RadioButton.tsx +53 -53
  37. package/src/components/RangeSlider.tsx +68 -68
  38. package/src/components/ScrollList.tsx +77 -0
  39. package/src/components/SimpleProgressBar.tsx +62 -62
  40. package/src/components/SkillProgressBar.tsx +124 -124
  41. package/src/components/SkillsContainer.tsx +235 -235
  42. package/src/components/TextArea.tsx +11 -11
  43. package/src/components/Truncate.tsx +25 -25
  44. package/src/components/shared/Column.tsx +16 -16
  45. package/src/components/shared/SpriteFromAtlas.tsx +99 -99
  46. package/src/components/shared/SpriteIcon.tsx +67 -67
  47. package/src/components/store/UI.store.ts +205 -192
  48. package/src/components/typography/DynamicText.tsx +49 -49
  49. package/src/constants/uiColors.ts +10 -10
  50. package/src/hooks/useEventListener.ts +21 -21
  51. package/src/hooks/useOutsideAlerter.ts +25 -25
  52. package/src/index.tsx +25 -24
  53. package/src/libs/StringHelpers.ts +3 -3
  54. package/src/mocks/atlas/icons/icons.json +303 -303
  55. package/src/mocks/atlas/items/items.json +5195 -5195
  56. package/src/mocks/equipmentSet.mocks.ts +347 -347
  57. package/src/mocks/itemContainer.mocks.ts +249 -249
  58. package/src/mocks/skills.mocks.ts +122 -116
  59. package/src/types/eventTypes.ts +4 -4
  60. package/src/types/index.d.ts +2 -2
@@ -1,99 +1,99 @@
1
- import { GRID_HEIGHT, GRID_WIDTH } from '@rpg-engine/shared';
2
- import React from 'react';
3
- import styled from 'styled-components';
4
-
5
- interface IProps {
6
- atlasJSON: any;
7
- atlasIMG: any;
8
- spriteKey: string;
9
- width?: number;
10
- height?: number;
11
- grayScale?: boolean;
12
- opacity?: number;
13
- onClick?: () => void;
14
- containerStyle?: any;
15
- imgStyle?: any;
16
- imgScale?: number;
17
- }
18
-
19
- export const SpriteFromAtlas: React.FC<IProps> = ({
20
- atlasJSON,
21
- atlasIMG,
22
- spriteKey,
23
- width = GRID_WIDTH,
24
- height = GRID_HEIGHT,
25
- imgScale = 2,
26
- imgStyle,
27
- onClick,
28
- containerStyle,
29
- grayScale = false,
30
- opacity = 1,
31
- }) => {
32
- //! If an item is not showing, remember that you MUST run yarn atlas:copy everytime you add a new item to the atlas (it will sync our public folder atlas with src/atlas).
33
- //!Due to React's limitations, we cannot import it from the public folder directly!
34
-
35
- const spriteData = atlasJSON.frames[spriteKey];
36
-
37
- return (
38
- <Container
39
- width={width}
40
- height={height}
41
- hasHover={grayScale}
42
- onClick={onClick}
43
- style={containerStyle}
44
- >
45
- <ImgSprite
46
- className="sprite-from-atlas-img"
47
- atlasIMG={atlasIMG}
48
- frame={spriteData.frame}
49
- scale={imgScale}
50
- grayScale={grayScale}
51
- opacity={opacity}
52
- style={imgStyle}
53
- />
54
- </Container>
55
- );
56
- };
57
-
58
- interface IImgSpriteProps {
59
- atlasIMG: any;
60
- frame: {
61
- x: number;
62
- y: number;
63
- w: number;
64
- h: number;
65
- };
66
- scale: number;
67
- grayScale: boolean;
68
- opacity: number;
69
- }
70
-
71
- interface IContainerProps {
72
- width: number;
73
- height: number;
74
- hasHover: boolean;
75
- }
76
-
77
- const Container = styled.div`
78
- width: ${(props: IContainerProps) => props.width}px;
79
- height: ${(props: IContainerProps) => props.height}px;
80
- ${(props: IContainerProps) =>
81
- !props.hasHover
82
- ? `&:hover {
83
- filter: sepia(100%) saturate(300%) brightness(70%) hue-rotate(180deg);
84
- }`
85
- : ``}
86
- `;
87
-
88
- const ImgSprite = styled.div<IImgSpriteProps>`
89
- width: ${props => props.frame.w}px;
90
- height: ${props => props.frame.h}px;
91
- background-image: url(${props => props.atlasIMG});
92
- background-position: -${props => props.frame.x}px -${props => props.frame.y}px;
93
- transform: scale(${props => props.scale});
94
- position: relative;
95
- top: 8px;
96
- left: 8px;
97
- filter: ${props => (props.grayScale ? 'grayscale(100%)' : 'none')};
98
- opacity: ${props => props.opacity};
99
- `;
1
+ import { GRID_HEIGHT, GRID_WIDTH } from '@rpg-engine/shared';
2
+ import React from 'react';
3
+ import styled from 'styled-components';
4
+
5
+ interface IProps {
6
+ atlasJSON: any;
7
+ atlasIMG: any;
8
+ spriteKey: string;
9
+ width?: number;
10
+ height?: number;
11
+ grayScale?: boolean;
12
+ opacity?: number;
13
+ onClick?: () => void;
14
+ containerStyle?: any;
15
+ imgStyle?: any;
16
+ imgScale?: number;
17
+ }
18
+
19
+ export const SpriteFromAtlas: React.FC<IProps> = ({
20
+ atlasJSON,
21
+ atlasIMG,
22
+ spriteKey,
23
+ width = GRID_WIDTH,
24
+ height = GRID_HEIGHT,
25
+ imgScale = 2,
26
+ imgStyle,
27
+ onClick,
28
+ containerStyle,
29
+ grayScale = false,
30
+ opacity = 1,
31
+ }) => {
32
+ //! If an item is not showing, remember that you MUST run yarn atlas:copy everytime you add a new item to the atlas (it will sync our public folder atlas with src/atlas).
33
+ //!Due to React's limitations, we cannot import it from the public folder directly!
34
+
35
+ const spriteData = atlasJSON.frames[spriteKey];
36
+
37
+ return (
38
+ <Container
39
+ width={width}
40
+ height={height}
41
+ hasHover={grayScale}
42
+ onClick={onClick}
43
+ style={containerStyle}
44
+ >
45
+ <ImgSprite
46
+ className="sprite-from-atlas-img"
47
+ atlasIMG={atlasIMG}
48
+ frame={spriteData.frame}
49
+ scale={imgScale}
50
+ grayScale={grayScale}
51
+ opacity={opacity}
52
+ style={imgStyle}
53
+ />
54
+ </Container>
55
+ );
56
+ };
57
+
58
+ interface IImgSpriteProps {
59
+ atlasIMG: any;
60
+ frame: {
61
+ x: number;
62
+ y: number;
63
+ w: number;
64
+ h: number;
65
+ };
66
+ scale: number;
67
+ grayScale: boolean;
68
+ opacity: number;
69
+ }
70
+
71
+ interface IContainerProps {
72
+ width: number;
73
+ height: number;
74
+ hasHover: boolean;
75
+ }
76
+
77
+ const Container = styled.div`
78
+ width: ${(props: IContainerProps) => props.width}px;
79
+ height: ${(props: IContainerProps) => props.height}px;
80
+ ${(props: IContainerProps) =>
81
+ !props.hasHover
82
+ ? `&:hover {
83
+ filter: sepia(100%) saturate(300%) brightness(70%) hue-rotate(180deg);
84
+ }`
85
+ : ``}
86
+ `;
87
+
88
+ const ImgSprite = styled.div<IImgSpriteProps>`
89
+ width: ${props => props.frame.w}px;
90
+ height: ${props => props.frame.h}px;
91
+ background-image: url(${props => props.atlasIMG});
92
+ background-position: -${props => props.frame.x}px -${props => props.frame.y}px;
93
+ transform: scale(${props => props.scale});
94
+ position: relative;
95
+ top: 8px;
96
+ left: 8px;
97
+ filter: ${props => (props.grayScale ? 'grayscale(100%)' : 'none')};
98
+ opacity: ${props => props.opacity};
99
+ `;
@@ -1,67 +1,67 @@
1
- import React from 'react';
2
- import styled from 'styled-components';
3
- import iconsAtlasJSON from '../../mocks/atlas/icons/icons.json';
4
- import iconsAtlasIMG from '../../mocks/atlas/icons/icons.png';
5
- import { SpriteFromAtlas } from './SpriteFromAtlas';
6
-
7
- interface IProps {
8
- onClick?: () => void;
9
- spriteKey: string;
10
- baseSpriteKey?: string;
11
- imgStyle?: any;
12
- }
13
-
14
- export const SpriteIcon: React.FC<IProps> = ({
15
- onClick,
16
- spriteKey,
17
- baseSpriteKey,
18
- imgStyle,
19
- }) => {
20
- return (
21
- <Container>
22
- {baseSpriteKey && (
23
- <Slot>
24
- <SpriteFromAtlas
25
- onClick={onClick}
26
- atlasJSON={iconsAtlasJSON}
27
- atlasIMG={iconsAtlasIMG}
28
- spriteKey={baseSpriteKey}
29
- width={32}
30
- height={32}
31
- containerStyle={{
32
- zIndex: -1,
33
- }}
34
- />
35
- </Slot>
36
- )}
37
- <Slot>
38
- <SpriteFromAtlas
39
- onClick={onClick}
40
- atlasJSON={iconsAtlasJSON}
41
- atlasIMG={iconsAtlasIMG}
42
- spriteKey={spriteKey}
43
- width={28}
44
- height={28}
45
- containerStyle={{
46
- zIndex: 0,
47
- }}
48
- imgScale={baseSpriteKey ? 1.5 : 2}
49
- imgStyle={imgStyle}
50
- />
51
- </Slot>
52
- </Container>
53
- );
54
- };
55
-
56
- const Container = styled.div`
57
- position: relative;
58
- width: 32px;
59
- height: 32px;
60
- display: flex;
61
- justify-content: center;
62
- align-items: center;
63
- `;
64
-
65
- const Slot = styled.div`
66
- position: absolute;
67
- `;
1
+ import React from 'react';
2
+ import styled from 'styled-components';
3
+ import iconsAtlasJSON from '../../mocks/atlas/icons/icons.json';
4
+ import iconsAtlasIMG from '../../mocks/atlas/icons/icons.png';
5
+ import { SpriteFromAtlas } from './SpriteFromAtlas';
6
+
7
+ interface IProps {
8
+ onClick?: () => void;
9
+ spriteKey: string;
10
+ baseSpriteKey?: string;
11
+ imgStyle?: any;
12
+ }
13
+
14
+ export const SpriteIcon: React.FC<IProps> = ({
15
+ onClick,
16
+ spriteKey,
17
+ baseSpriteKey,
18
+ imgStyle,
19
+ }) => {
20
+ return (
21
+ <Container>
22
+ {baseSpriteKey && (
23
+ <Slot>
24
+ <SpriteFromAtlas
25
+ onClick={onClick}
26
+ atlasJSON={iconsAtlasJSON}
27
+ atlasIMG={iconsAtlasIMG}
28
+ spriteKey={baseSpriteKey}
29
+ width={32}
30
+ height={32}
31
+ containerStyle={{
32
+ zIndex: -1,
33
+ }}
34
+ />
35
+ </Slot>
36
+ )}
37
+ <Slot>
38
+ <SpriteFromAtlas
39
+ onClick={onClick}
40
+ atlasJSON={iconsAtlasJSON}
41
+ atlasIMG={iconsAtlasIMG}
42
+ spriteKey={spriteKey}
43
+ width={28}
44
+ height={28}
45
+ containerStyle={{
46
+ zIndex: 0,
47
+ }}
48
+ imgScale={baseSpriteKey ? 1.5 : 2}
49
+ imgStyle={imgStyle}
50
+ />
51
+ </Slot>
52
+ </Container>
53
+ );
54
+ };
55
+
56
+ const Container = styled.div`
57
+ position: relative;
58
+ width: 32px;
59
+ height: 32px;
60
+ display: flex;
61
+ justify-content: center;
62
+ align-items: center;
63
+ `;
64
+
65
+ const Slot = styled.div`
66
+ position: absolute;
67
+ `;