@rpg-engine/long-bow 0.2.99 → 0.3.23
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.
- package/dist/components/Chat/Chat.d.ts +4 -0
- package/dist/components/Chatdeprecated/ChatDeprecated.d.ts +13 -0
- package/dist/index.d.ts +5 -4
- package/dist/long-bow.cjs.development.js +263 -133
- package/dist/long-bow.cjs.development.js.map +1 -1
- package/dist/long-bow.cjs.production.min.js +1 -1
- package/dist/long-bow.cjs.production.min.js.map +1 -1
- package/dist/long-bow.esm.js +263 -134
- package/dist/long-bow.esm.js.map +1 -1
- package/dist/stories/ChatDeprecated.stories.d.ts +5 -0
- package/package.json +3 -1
- package/src/.DS_Store +0 -0
- package/src/components/Chat/Chat.tsx +82 -105
- package/src/components/Chatdeprecated/ChatDeprecated.tsx +200 -0
- package/src/components/CraftBook/CraftBook.tsx +1 -1
- package/src/components/NPCDialog/.DS_Store +0 -0
- package/src/components/NPCDialog/img/.DS_Store +0 -0
- package/src/index.tsx +5 -4
- package/src/mocks/.DS_Store +0 -0
- package/src/mocks/atlas/.DS_Store +0 -0
- package/src/stories/Chat.stories.tsx +17 -2
- package/src/stories/ChatDeprecated.stories.tsx +170 -0
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { ChatMessageType, IChatMessage } from '@rpg-engine/shared';
|
|
2
|
+
import { Meta, Story } from '@storybook/react';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { ChatDeprecated } from '../components/Chatdeprecated/ChatDeprecated';
|
|
5
|
+
import { RPGUIRoot } from '../components/RPGUIRoot';
|
|
6
|
+
|
|
7
|
+
const meta: Meta = {
|
|
8
|
+
title: 'ChatDeprecated',
|
|
9
|
+
component: ChatDeprecated,
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default meta;
|
|
13
|
+
|
|
14
|
+
const chatMessagesMock = [
|
|
15
|
+
{
|
|
16
|
+
_id: 'test-id-1',
|
|
17
|
+
message: 'test message',
|
|
18
|
+
emitter: {
|
|
19
|
+
_id: 'someid',
|
|
20
|
+
name: 'Guilherme',
|
|
21
|
+
},
|
|
22
|
+
type: ChatMessageType.Global,
|
|
23
|
+
x: 128,
|
|
24
|
+
y: 128,
|
|
25
|
+
scene: 'MainScene',
|
|
26
|
+
createdAt: '2020-08-20T16:00:00.000Z',
|
|
27
|
+
updatedAt: '2020-08-20T16:00:00.000Z',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
_id: 'test-id-1',
|
|
31
|
+
message: 'test message',
|
|
32
|
+
emitter: {
|
|
33
|
+
_id: 'someid',
|
|
34
|
+
name: 'Guilherme',
|
|
35
|
+
},
|
|
36
|
+
type: ChatMessageType.Global,
|
|
37
|
+
x: 128,
|
|
38
|
+
y: 128,
|
|
39
|
+
scene: 'MainScene',
|
|
40
|
+
createdAt: '2020-08-20T16:00:00.000Z',
|
|
41
|
+
updatedAt: '2020-08-20T16:00:00.000Z',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
_id: 'test-id-2',
|
|
45
|
+
message: 'Good morning!',
|
|
46
|
+
emitter: {
|
|
47
|
+
_id: 'someid',
|
|
48
|
+
name: 'Guilherme',
|
|
49
|
+
},
|
|
50
|
+
type: ChatMessageType.Global,
|
|
51
|
+
x: 128,
|
|
52
|
+
y: 128,
|
|
53
|
+
scene: 'MainScene',
|
|
54
|
+
createdAt: '2020-08-20T16:00:00.000Z',
|
|
55
|
+
updatedAt: '2020-08-20T16:00:00.000Z',
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
_id: 'test-id-3',
|
|
59
|
+
message: 'How are you doing?',
|
|
60
|
+
emitter: {
|
|
61
|
+
_id: 'someid',
|
|
62
|
+
name: 'Guilherme',
|
|
63
|
+
},
|
|
64
|
+
type: ChatMessageType.Global,
|
|
65
|
+
x: 128,
|
|
66
|
+
y: 128,
|
|
67
|
+
scene: 'MainScene',
|
|
68
|
+
createdAt: '2020-08-20T16:00:00.000Z',
|
|
69
|
+
updatedAt: '2020-08-20T16:00:00.000Z',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
_id: 'test-id-4',
|
|
73
|
+
message: 'Hey hey hey!!!',
|
|
74
|
+
emitter: {
|
|
75
|
+
_id: 'someid',
|
|
76
|
+
name: 'Guilherme',
|
|
77
|
+
},
|
|
78
|
+
type: ChatMessageType.Global,
|
|
79
|
+
x: 128,
|
|
80
|
+
y: 128,
|
|
81
|
+
scene: 'MainScene',
|
|
82
|
+
createdAt: '2020-08-20T16:00:00.000Z',
|
|
83
|
+
updatedAt: '2020-08-20T16:00:00.000Z',
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
_id: 'test-id-5',
|
|
87
|
+
message: 'BITCONNEEEEEEEEECT!',
|
|
88
|
+
emitter: {
|
|
89
|
+
_id: 'someid',
|
|
90
|
+
name: 'Guilherme',
|
|
91
|
+
},
|
|
92
|
+
type: ChatMessageType.Global,
|
|
93
|
+
x: 128,
|
|
94
|
+
y: 128,
|
|
95
|
+
scene: 'MainScene',
|
|
96
|
+
createdAt: '2020-08-20T16:00:00.000Z',
|
|
97
|
+
updatedAt: '2020-08-20T16:00:00.000Z',
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
_id: 'test-id-6',
|
|
101
|
+
message: 'BITCONNEEEEEEEEECT!',
|
|
102
|
+
emitter: {
|
|
103
|
+
_id: 'someid',
|
|
104
|
+
name: 'Guilherme',
|
|
105
|
+
},
|
|
106
|
+
type: ChatMessageType.Global,
|
|
107
|
+
x: 128,
|
|
108
|
+
y: 128,
|
|
109
|
+
scene: 'MainScene',
|
|
110
|
+
createdAt: '2020-08-20T16:00:00.000Z',
|
|
111
|
+
updatedAt: '2020-08-20T16:00:00.000Z',
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
_id: 'test-id-7',
|
|
115
|
+
message: 'BITCONNEEEEEEEEECT!',
|
|
116
|
+
emitter: {
|
|
117
|
+
_id: 'someid',
|
|
118
|
+
name: 'Guilherme',
|
|
119
|
+
},
|
|
120
|
+
type: ChatMessageType.Global,
|
|
121
|
+
x: 128,
|
|
122
|
+
y: 128,
|
|
123
|
+
scene: 'MainScene',
|
|
124
|
+
createdAt: '2020-08-20T16:00:00.000Z',
|
|
125
|
+
updatedAt: '2020-08-20T16:00:00.000Z',
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
_id: 'test-id-8',
|
|
129
|
+
message: 'BITCONNEEEEEEEEECT!',
|
|
130
|
+
emitter: {
|
|
131
|
+
_id: 'someid',
|
|
132
|
+
name: 'Guilherme',
|
|
133
|
+
},
|
|
134
|
+
type: ChatMessageType.Global,
|
|
135
|
+
x: 128,
|
|
136
|
+
y: 128,
|
|
137
|
+
scene: 'MainScene',
|
|
138
|
+
createdAt: '2020-08-20T16:00:00.000Z',
|
|
139
|
+
updatedAt: '2020-08-20T16:00:00.000Z',
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
_id: 'test-id-9',
|
|
143
|
+
message: 'BITCONNEEEEEEEEECT!',
|
|
144
|
+
emitter: {
|
|
145
|
+
_id: 'someid',
|
|
146
|
+
name: 'Guilherme',
|
|
147
|
+
},
|
|
148
|
+
type: ChatMessageType.Global,
|
|
149
|
+
x: 128,
|
|
150
|
+
y: 128,
|
|
151
|
+
scene: 'MainScene',
|
|
152
|
+
createdAt: '2020-08-20T16:00:00.000Z',
|
|
153
|
+
updatedAt: '2020-08-20T16:00:00.000Z',
|
|
154
|
+
},
|
|
155
|
+
];
|
|
156
|
+
|
|
157
|
+
const Template: Story<IChatMessage> = args => (
|
|
158
|
+
<RPGUIRoot>
|
|
159
|
+
<ChatDeprecated
|
|
160
|
+
onSendChatMessage={msg => console.log(msg)}
|
|
161
|
+
chatMessages={chatMessagesMock}
|
|
162
|
+
opacity={0.5}
|
|
163
|
+
height={'200px'}
|
|
164
|
+
onCloseButton={() => console.log('closing chat...')}
|
|
165
|
+
{...args}
|
|
166
|
+
/>
|
|
167
|
+
</RPGUIRoot>
|
|
168
|
+
);
|
|
169
|
+
|
|
170
|
+
export const Default = Template.bind({});
|