@rpg-engine/long-bow 0.1.26 → 0.1.29

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 (30) hide show
  1. package/dist/components/Button.d.ts +10 -0
  2. package/dist/components/ListMenu.d.ts +6 -4
  3. package/dist/{NPCDialog → components/NPCDialog}/NPCDialog.d.ts +2 -2
  4. package/dist/{NPCDialog → components/NPCDialog}/NPCDialogText.d.ts +0 -0
  5. package/dist/{NPCDialog → components/NPCDialog}/QuestionDialog/QuestionDialog.d.ts +0 -0
  6. package/dist/components/RPGUIContainer.d.ts +14 -0
  7. package/dist/{RPGUI → components}/RPGUIRoot.d.ts +0 -0
  8. package/dist/{RPGUI/RPGUISlider.d.ts → components/RangeSlider.d.ts} +4 -4
  9. package/dist/{typography → components/typography}/DynamicText.d.ts +0 -0
  10. package/dist/index.d.ts +7 -6
  11. package/dist/long-bow.cjs.development.js +94 -49
  12. package/dist/long-bow.cjs.development.js.map +1 -1
  13. package/dist/long-bow.cjs.production.min.js +1 -1
  14. package/dist/long-bow.cjs.production.min.js.map +1 -1
  15. package/dist/long-bow.esm.js +95 -48
  16. package/dist/long-bow.esm.js.map +1 -1
  17. package/package.json +1 -1
  18. package/src/components/Button.tsx +26 -0
  19. package/src/components/ListMenu.tsx +13 -9
  20. package/src/{NPCDialog → components/NPCDialog}/NPCDialog.tsx +10 -6
  21. package/src/{NPCDialog → components/NPCDialog}/NPCDialogText.tsx +1 -1
  22. package/src/{NPCDialog → components/NPCDialog}/QuestionDialog/QuestionDialog.tsx +1 -1
  23. package/src/{NPCDialog → components/NPCDialog}/img/npcDialog/npcThumbnails/alice.png +0 -0
  24. package/src/{NPCDialog → components/NPCDialog}/img/space.gif +0 -0
  25. package/src/{RPGUI → components}/RPGUIContainer.tsx +10 -3
  26. package/src/{RPGUI → components}/RPGUIRoot.tsx +0 -0
  27. package/src/{RPGUI/RPGUISlider.tsx → components/RangeSlider.tsx} +7 -8
  28. package/src/{typography → components/typography}/DynamicText.tsx +0 -0
  29. package/src/index.tsx +7 -6
  30. package/dist/RPGUI/RPGUIContainer.d.ts +0 -9
@@ -1,16 +1,16 @@
1
1
  import React from 'react';
2
2
  import styled from 'styled-components';
3
- import { RPGUIRoot } from '../RPGUI/RPGUIRoot';
3
+ import { RPGUIRoot } from './RPGUIRoot';
4
+
5
+ interface IListMenuOption {
6
+ id: string;
7
+ text: string;
8
+ }
4
9
 
5
10
  export interface IListMenuProps {
6
11
  x: number;
7
12
  y: number;
8
- options: [
9
- {
10
- id: string;
11
- text: string;
12
- }
13
- ];
13
+ options: IListMenuOption[];
14
14
  onSelected: (selectedOptionId: string) => void;
15
15
  }
16
16
 
@@ -25,14 +25,14 @@ export const ListMenu: React.FC<IListMenuProps> = ({
25
25
  <Container x={x} y={y}>
26
26
  <ul className="rpgui-list-imp" style={{ overflow: 'hidden' }}>
27
27
  {options.map((params) => (
28
- <li
28
+ <ListElement
29
29
  key={params.text}
30
30
  onClick={() => {
31
31
  onSelected(params.id);
32
32
  }}
33
33
  >
34
34
  {params.text}
35
- </li>
35
+ </ListElement>
36
36
  ))}
37
37
  </ul>
38
38
  </Container>
@@ -55,3 +55,7 @@ const Container = styled.div<IContainerProps>`
55
55
  top: ${(props) => props.y || 0}px;
56
56
  left: ${(props) => props.x || 0}px;
57
57
  `;
58
+
59
+ const ListElement = styled.li`
60
+ margin-right: 0.5rem;
61
+ `;
@@ -1,12 +1,16 @@
1
1
  import React, { useState } from 'react';
2
2
  import styled from 'styled-components';
3
- import { IQuestionDialog, IQuestionDialogAnswer } from '..';
4
- import { RPGUIContainer } from '../RPGUI/RPGUIContainer';
5
- import { RPGUIRoot } from '../RPGUI/RPGUIRoot';
3
+ import { RPGUIContainer, RPGUIContainerTypes } from '../RPGUIContainer';
4
+ import { RPGUIRoot } from '../RPGUIRoot';
6
5
  import aliceDefaultThumbnail from './img/npcDialog/npcThumbnails/alice.png';
7
6
  import pressSpaceGif from './img/space.gif';
8
7
  import { NPCDialogText } from './NPCDialogText';
9
- import { QuestionDialog } from './QuestionDialog/QuestionDialog';
8
+ import {
9
+ IQuestionDialog,
10
+ IQuestionDialogAnswer,
11
+ QuestionDialog,
12
+ } from './QuestionDialog/QuestionDialog';
13
+
10
14
  export enum NPCDialogType {
11
15
  TextOnly = 'TextOnly',
12
16
  TextAndThumbnail = 'TextAndThumbnail',
@@ -17,7 +21,7 @@ export interface INPCDialogProps {
17
21
  type: NPCDialogType;
18
22
  imagePath?: string;
19
23
  onClose?: () => void;
20
- isQuestionDialog: boolean;
24
+ isQuestionDialog?: boolean;
21
25
  answers?: IQuestionDialogAnswer[];
22
26
  questions?: IQuestionDialog[];
23
27
  }
@@ -37,7 +41,7 @@ export const NPCDialog: React.FC<INPCDialogProps> = ({
37
41
  return (
38
42
  <RPGUIRoot>
39
43
  <RPGUIContainer
40
- type="framed-golden"
44
+ type={RPGUIContainerTypes.FramedGold}
41
45
  width={isQuestionDialog ? '600px' : '50%'}
42
46
  height={'180px'}
43
47
  >
@@ -1,6 +1,6 @@
1
1
  import React, { useEffect, useState } from 'react';
2
2
  import styled from 'styled-components';
3
- import { chunkString } from '../libs/StringHelpers';
3
+ import { chunkString } from '../../libs/StringHelpers';
4
4
  import { DynamicText } from '../typography/DynamicText';
5
5
 
6
6
  interface IProps {
@@ -1,6 +1,6 @@
1
1
  import React, { useEffect, useState } from 'react';
2
2
  import styled from 'styled-components';
3
- import { useEventListener } from '../../hooks/useEventListener';
3
+ import { useEventListener } from '../../../hooks/useEventListener';
4
4
  import { DynamicText } from '../../typography/DynamicText';
5
5
 
6
6
  export interface IQuestionDialogAnswer {
@@ -1,14 +1,20 @@
1
1
  import React from 'react';
2
2
  import styled from 'styled-components';
3
3
 
4
- interface IProps {
5
- type: 'framed' | 'framed-golden' | 'framed-golden-2' | 'framed-grey';
4
+ export enum RPGUIContainerTypes {
5
+ Framed = 'framed',
6
+ FramedGold = 'framed-golden',
7
+ FramedGold2 = 'framed-golden-2',
8
+ FramedGrey = 'framed-grey',
9
+ }
10
+ export interface IRPGUIContainerProps {
11
+ type: RPGUIContainerTypes;
6
12
  children: React.ReactNode;
7
13
  width?: string;
8
14
  height?: string;
9
15
  }
10
16
 
11
- export const RPGUIContainer: React.FC<IProps> = ({
17
+ export const RPGUIContainer: React.FC<IRPGUIContainerProps> = ({
12
18
  children,
13
19
  type,
14
20
  width = '50%',
@@ -35,4 +41,5 @@ const Container = styled.div<IContainerProps>`
35
41
  width: ${({ width }) => width};
36
42
  display: flex;
37
43
  flex-wrap: wrap;
44
+ image-rendering: pixelated;
38
45
  `;
File without changes
@@ -4,21 +4,20 @@ import { v4 as uuidv4 } from 'uuid';
4
4
  import { useEventListener } from '../hooks/useEventListener';
5
5
  import { RPGUIRoot, _RPGUI } from './RPGUIRoot';
6
6
 
7
- export enum SliderType {
7
+ export enum RangeSliderType {
8
8
  Slider = 'rpgui-slider',
9
9
  GoldSlider = 'rpgui-slider golden',
10
10
  }
11
11
 
12
- export interface ISliderProps {
13
- type: SliderType;
12
+ export interface IRangeSliderProps {
13
+ type: RangeSliderType;
14
14
  valueMin: number;
15
15
  valueMax: number;
16
16
  width: string;
17
-
18
17
  onChange: (value: number) => void;
19
18
  }
20
19
 
21
- export const RPGUISlider: React.FC<ISliderProps> = ({
20
+ export const RangeSlider: React.FC<IRangeSliderProps> = ({
22
21
  type,
23
22
  valueMin,
24
23
  valueMax,
@@ -51,9 +50,9 @@ export const RPGUISlider: React.FC<ISliderProps> = ({
51
50
  >
52
51
  <Input
53
52
  className={
54
- type === SliderType.Slider
55
- ? SliderType.Slider
56
- : SliderType.GoldSlider
53
+ type === RangeSliderType.Slider
54
+ ? RangeSliderType.Slider
55
+ : RangeSliderType.GoldSlider
57
56
  }
58
57
  type="range"
59
58
  style={{ width: width }}
package/src/index.tsx CHANGED
@@ -1,8 +1,9 @@
1
+ export * from './components/Button';
1
2
  export * from './components/ListMenu';
3
+ export * from './components/NPCDialog/NPCDialog';
4
+ export * from './components/NPCDialog/QuestionDialog/QuestionDialog';
5
+ export * from './components/RangeSlider';
6
+ export * from './components/RPGUIContainer';
7
+ export * from './components/RPGUIRoot';
8
+ export * from './components/typography/DynamicText';
2
9
  export { useEventListener } from './hooks/useEventListener';
3
- export * from './NPCDialog/NPCDialog';
4
- export * from './NPCDialog/QuestionDialog/QuestionDialog';
5
- export * from './RPGUI/RPGUIContainer';
6
- export * from './RPGUI/RPGUIRoot';
7
- export * from './RPGUI/RPGUISlider';
8
- export * from './typography/DynamicText';
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- interface IProps {
3
- type: 'framed' | 'framed-golden' | 'framed-golden-2' | 'framed-grey';
4
- children: React.ReactNode;
5
- width?: string;
6
- height?: string;
7
- }
8
- export declare const RPGUIContainer: React.FC<IProps>;
9
- export {};