@jetthai/cuora 1.1.66-sabai-5 → 1.1.66

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/CHANGELOG.md CHANGED
@@ -2,20 +2,6 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
- ### [1.1.66-sabai-5](https://github.com/jetthai/cuora-module/compare/v1.1.66-sabai-4...v1.1.66-sabai-5) (2024-12-25)
6
-
7
- ### [1.1.66-sabai-4](https://github.com/jetthai/cuora-module/compare/v1.1.66-sabai-3...v1.1.66-sabai-4) (2024-12-25)
8
-
9
- ### [1.1.66-sabai-3](https://github.com/jetthai/cuora-module/compare/v1.1.66-sabai-2...v1.1.66-sabai-3) (2024-10-02)
10
-
11
- ### [1.1.66-sabai-2](https://github.com/jetthai/cuora-module/compare/v1.0.66-sabai-2...v1.1.66-sabai-2) (2024-09-12)
12
-
13
- ### [1.0.66-sabai-2](https://github.com/jetthai/cuora-module/compare/v1.1.66-sabai-1...v1.0.66-sabai-2) (2024-09-12)
14
-
15
- ### [1.1.66-sabai-1](https://github.com/jetthai/cuora-module/compare/v1.1.66-sabai...v1.1.66-sabai-1) (2024-09-03)
16
-
17
- ### [1.1.66-sabai](https://github.com/jetthai/cuora-module/compare/v1.1.66...v1.1.66-sabai) (2024-09-02)
18
-
19
5
  ### [1.1.66](https://github.com/jetthai/cuora-module/compare/v1.1.65...v1.1.66) (2023-03-28)
20
6
 
21
7
  ### [1.1.65](https://github.com/jetthai/cuora-module/compare/v1.1.64...v1.1.65) (2023-03-15)
package/dist/bundle.mjs CHANGED
@@ -17775,7 +17775,6 @@ function game_v2_1 (request) {
17775
17775
  lang: 'en_US',
17776
17776
  isMobile: new UAParser().getResult().device.type,
17777
17777
  gameURL: null,
17778
- inGaming: false,
17779
17778
  ...oldContext,
17780
17779
  },
17781
17780
  states: {
@@ -17864,12 +17863,15 @@ function game_v2_1 (request) {
17864
17863
  states: {
17865
17864
  pending: {
17866
17865
  after: {
17867
- 20000: [{ target: 'inGaming', cond: 'isInGaming' }, { target: 'updating', cond: 'hasRoom' }, { target: 'pending' }],
17868
- },
17869
- },
17870
- inGaming: {
17871
- after: {
17872
- 3000: [{ target: 'inGaming', cond: 'isInGaming' }, { target: 'updating', cond: 'hasRoom' }, { target: 'pending' }],
17866
+ 20000: [
17867
+ {
17868
+ target: 'updating',
17869
+ cond: 'hasRoom',
17870
+ },
17871
+ {
17872
+ target: 'pending',
17873
+ },
17874
+ ],
17873
17875
  },
17874
17876
  },
17875
17877
  updating: {
@@ -17909,7 +17911,7 @@ function game_v2_1 (request) {
17909
17911
  src: 'fetchStatus',
17910
17912
  onDone: {
17911
17913
  target: 'updatingOption',
17912
- actions: 'setStatus',
17914
+ actions: ['setStatus'],
17913
17915
  },
17914
17916
  onError: {
17915
17917
  target: 'pending',
@@ -17930,25 +17932,14 @@ function game_v2_1 (request) {
17930
17932
  },
17931
17933
  pending: {
17932
17934
  after: {
17933
- 20000: [{ target: 'inGaming', cond: 'isInGaming' }, { target: 'fetchingGameSHA' }],
17934
- },
17935
- },
17936
- inGaming: {
17937
- after: {
17938
- 3000: [{ target: 'inGaming', cond: 'isInGaming' }, { target: 'fetchingGameSHA' }],
17935
+ 20000: {
17936
+ target: 'fetchingGameSHA',
17937
+ },
17939
17938
  },
17940
17939
  },
17941
17940
  },
17942
17941
  },
17943
17942
  },
17944
- on: {
17945
- SET_IN_GAME: {
17946
- actions: 'setInGaming',
17947
- },
17948
- SET_LEAVE_GAME: {
17949
- actions: 'setLeaveGame',
17950
- },
17951
- },
17952
17943
  },
17953
17944
  {
17954
17945
  actions: {
@@ -17965,9 +17956,15 @@ function game_v2_1 (request) {
17965
17956
  setLastPage: assign((context, event) => {
17966
17957
  const { index, content } = context;
17967
17958
  return {
17959
+ loadable: false,
17968
17960
  isLastPage: index >= content?.totalPage - 1,
17969
17961
  }
17970
17962
  }),
17963
+ setFavoriteList: assign((context, event) => {
17964
+ return {
17965
+ favoriteList: event.data.data || [],
17966
+ }
17967
+ }),
17971
17968
  setRoom: assign((context, event) => {
17972
17969
  return {
17973
17970
  room: event.data,
@@ -18052,12 +18049,6 @@ function game_v2_1 (request) {
18052
18049
  const lang = event.data.locale.replace('-', '_');
18053
18050
  return { lang }
18054
18051
  }),
18055
- setInGaming: assign((context, event) => {
18056
- return { inGaming: true }
18057
- }),
18058
- setLeaveGame: assign((context, event) => {
18059
- return { inGaming: false }
18060
- }),
18061
18052
  ...oldActions,
18062
18053
  },
18063
18054
  guards: {
@@ -18066,12 +18057,7 @@ function game_v2_1 (request) {
18066
18057
  const { loadable, isLastPage } = context;
18067
18058
  return loadable && !isLastPage
18068
18059
  },
18069
- hasRoom: (context, event) => {
18070
- return context.room?.categoryId
18071
- },
18072
- isInGaming: (context, event) => {
18073
- return context.inGaming
18074
- },
18060
+ hasRoom: (context, event) => context.room?.categoryId,
18075
18061
  ...oldGuards,
18076
18062
  },
18077
18063
  services: {
@@ -18324,26 +18310,11 @@ function game_favorite_v2 (request) {
18324
18310
  list: [],
18325
18311
  },
18326
18312
  states: {
18327
- idle: {
18328
- on: {
18329
- ADD: {
18330
- target: 'operation.adding.enable',
18331
- actions: 'addToList',
18332
- cond: 'isNotExist',
18333
- },
18334
- REMOVE: {
18335
- target: 'operation.removing.enable',
18336
- actions: 'removeFromList',
18337
- cond: 'isExist',
18338
- },
18339
- },
18340
- },
18341
18313
  fetching: {
18342
18314
  invoke: {
18343
18315
  src: 'fetchList',
18344
18316
  onDone: {
18345
18317
  actions: 'setList',
18346
- target: '#favorite.idle',
18347
18318
  },
18348
18319
  onError: {
18349
18320
  actions: assign({ list: [] }),
@@ -18360,12 +18331,9 @@ function game_favorite_v2 (request) {
18360
18331
  enable: {
18361
18332
  invoke: {
18362
18333
  src: 'add',
18363
- onDone: {
18364
- target: '#favorite.idle',
18365
- },
18334
+ onDone: {},
18366
18335
  onError: {
18367
18336
  actions: 'removeFromList',
18368
- target: '#favorite.idle',
18369
18337
  },
18370
18338
  },
18371
18339
  },
@@ -18378,12 +18346,9 @@ function game_favorite_v2 (request) {
18378
18346
  enable: {
18379
18347
  invoke: {
18380
18348
  src: 'remove',
18381
- onDone: {
18382
- target: '#favorite.idle',
18383
- },
18349
+ onDone: {},
18384
18350
  onError: {
18385
18351
  actions: 'addToList',
18386
- target: '#favorite.idle',
18387
18352
  },
18388
18353
  },
18389
18354
  },
@@ -18392,6 +18357,18 @@ function game_favorite_v2 (request) {
18392
18357
  },
18393
18358
  },
18394
18359
  },
18360
+ on: {
18361
+ ADD: {
18362
+ target: 'operation.adding.enable',
18363
+ actions: 'addToList',
18364
+ cond: 'isNotExist',
18365
+ },
18366
+ REMOVE: {
18367
+ target: 'operation.removing.enable',
18368
+ actions: 'removeFromList',
18369
+ cond: 'isExist',
18370
+ },
18371
+ },
18395
18372
  },
18396
18373
  {
18397
18374
  actions: {
@@ -19992,7 +19969,6 @@ function side_v2 (request) {
19992
19969
  previousMenuItemStack: [],
19993
19970
  historyStack: [],
19994
19971
  defaultMenuItemStack: [],
19995
- inGaming: false,
19996
19972
  },
19997
19973
  states: {
19998
19974
  loading: {
@@ -20009,12 +19985,15 @@ function side_v2 (request) {
20009
19985
  states: {
20010
19986
  pending: {
20011
19987
  after: {
20012
- 20000: [{ target: 'inGaming', cond: 'isInGaming' }, { target: 'updating', cond: 'isInMenu' }, { target: 'pending' }],
20013
- },
20014
- },
20015
- inGaming: {
20016
- after: {
20017
- 3000: [{ target: 'inGaming', cond: 'isInGaming' }, { target: 'updating', cond: 'isInMenu' }, { target: 'pending' }],
19988
+ 20000: [
19989
+ {
19990
+ target: 'updating',
19991
+ cond: 'isInMenu',
19992
+ },
19993
+ {
19994
+ target: 'pending',
19995
+ },
19996
+ ],
20018
19997
  },
20019
19998
  },
20020
19999
  updating: {
@@ -20043,12 +20022,6 @@ function side_v2 (request) {
20043
20022
  RESET: {
20044
20023
  actions: 'resetMenuItemStack',
20045
20024
  },
20046
- SET_IN_GAME: {
20047
- actions: 'setInGame',
20048
- },
20049
- SET_LEAVE_GAME: {
20050
- actions: 'setLeaveGame',
20051
- },
20052
20025
  },
20053
20026
  },
20054
20027
  },
@@ -20070,8 +20043,8 @@ function side_v2 (request) {
20070
20043
  setMenuItemStack: assign((context, event) => {
20071
20044
  const { menuItemStack } = context;
20072
20045
  const inputItem = event.data;
20073
- const isTopItem = inputItem.level ? inputItem.level === 0 : true;
20074
- const hasSubMenu = inputItem.sub?.length || 0;
20046
+ const isTopItem = inputItem.level === 0;
20047
+ const hasSubMenu = inputItem.sub.length;
20075
20048
 
20076
20049
  if (isTopItem) {
20077
20050
  if (hasSubMenu) {
@@ -20124,24 +20097,13 @@ function side_v2 (request) {
20124
20097
  const { defaultMenuItemStack } = context;
20125
20098
  return { menuItemStack: defaultMenuItemStack }
20126
20099
  }),
20127
- setInGame: assign((context, event) => {
20128
- return { inGaming: true }
20129
- }),
20130
- setLeaveGame: assign((context, event) => {
20131
- return { inGaming: false }
20132
- }),
20133
20100
  },
20134
20101
  guards: {
20135
20102
  isInMenu: (context, event) => {
20136
20103
  const { menuItemStack, menu } = context;
20137
- if (!menuItemStack || menuItemStack.length === 0) return false
20138
20104
  const menuItem = menuItemStack.slice(-1)[0];
20139
- if (!menuItem || !menuItem.categoryId) return false
20140
20105
  return isItemInMenu(menuItem, menu.data)
20141
20106
  },
20142
- isInGaming: (context, event) => {
20143
- return context.inGaming
20144
- },
20145
20107
  },
20146
20108
  services: {
20147
20109
  getMenu: async (context, event) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.66-sabai-5",
3
+ "version": "1.1.66",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -20,10 +20,10 @@
20
20
  "@rollup/plugin-commonjs": "^22.0.2",
21
21
  "@rollup/plugin-node-resolve": "^13.3.0",
22
22
  "@rollup/plugin-replace": "^4.0.0",
23
- "husky": "^8.0.0",
24
23
  "prettier": "^2.3.0",
25
- "rollup": "^2.79.1",
26
- "standard-version": "^9.3.1"
24
+ "rollup": "^2.78.1",
25
+ "standard-version": "^9.3.1",
26
+ "husky": "^8.0.0"
27
27
  },
28
28
  "dependencies": {
29
29
  "lodash": "^4.17.21",
@@ -10,26 +10,11 @@ export default function (request) {
10
10
  list: [],
11
11
  },
12
12
  states: {
13
- idle: {
14
- on: {
15
- ADD: {
16
- target: 'operation.adding.enable',
17
- actions: 'addToList',
18
- cond: 'isNotExist',
19
- },
20
- REMOVE: {
21
- target: 'operation.removing.enable',
22
- actions: 'removeFromList',
23
- cond: 'isExist',
24
- },
25
- },
26
- },
27
13
  fetching: {
28
14
  invoke: {
29
15
  src: 'fetchList',
30
16
  onDone: {
31
17
  actions: 'setList',
32
- target: '#favorite.idle',
33
18
  },
34
19
  onError: {
35
20
  actions: assign({ list: [] }),
@@ -46,12 +31,9 @@ export default function (request) {
46
31
  enable: {
47
32
  invoke: {
48
33
  src: 'add',
49
- onDone: {
50
- target: '#favorite.idle',
51
- },
34
+ onDone: {},
52
35
  onError: {
53
36
  actions: 'removeFromList',
54
- target: '#favorite.idle',
55
37
  },
56
38
  },
57
39
  },
@@ -64,12 +46,9 @@ export default function (request) {
64
46
  enable: {
65
47
  invoke: {
66
48
  src: 'remove',
67
- onDone: {
68
- target: '#favorite.idle',
69
- },
49
+ onDone: {},
70
50
  onError: {
71
51
  actions: 'addToList',
72
- target: '#favorite.idle',
73
52
  },
74
53
  },
75
54
  },
@@ -78,6 +57,18 @@ export default function (request) {
78
57
  },
79
58
  },
80
59
  },
60
+ on: {
61
+ ADD: {
62
+ target: 'operation.adding.enable',
63
+ actions: 'addToList',
64
+ cond: 'isNotExist',
65
+ },
66
+ REMOVE: {
67
+ target: 'operation.removing.enable',
68
+ actions: 'removeFromList',
69
+ cond: 'isExist',
70
+ },
71
+ },
81
72
  },
82
73
  {
83
74
  actions: {
@@ -37,7 +37,6 @@ export default function (request) {
37
37
  lang: 'en_US',
38
38
  isMobile: new UAParser().getResult().device.type,
39
39
  gameURL: null,
40
- inGaming: false,
41
40
  ...oldContext,
42
41
  },
43
42
  states: {
@@ -126,12 +125,15 @@ export default function (request) {
126
125
  states: {
127
126
  pending: {
128
127
  after: {
129
- 20000: [{ target: 'inGaming', cond: 'isInGaming' }, { target: 'updating', cond: 'hasRoom' }, { target: 'pending' }],
130
- },
131
- },
132
- inGaming: {
133
- after: {
134
- 3000: [{ target: 'inGaming', cond: 'isInGaming' }, { target: 'updating', cond: 'hasRoom' }, { target: 'pending' }],
128
+ 20000: [
129
+ {
130
+ target: 'updating',
131
+ cond: 'hasRoom',
132
+ },
133
+ {
134
+ target: 'pending',
135
+ },
136
+ ],
135
137
  },
136
138
  },
137
139
  updating: {
@@ -171,7 +173,7 @@ export default function (request) {
171
173
  src: 'fetchStatus',
172
174
  onDone: {
173
175
  target: 'updatingOption',
174
- actions: 'setStatus',
176
+ actions: ['setStatus'],
175
177
  },
176
178
  onError: {
177
179
  target: 'pending',
@@ -192,25 +194,14 @@ export default function (request) {
192
194
  },
193
195
  pending: {
194
196
  after: {
195
- 20000: [{ target: 'inGaming', cond: 'isInGaming' }, { target: 'fetchingGameSHA' }],
196
- },
197
- },
198
- inGaming: {
199
- after: {
200
- 3000: [{ target: 'inGaming', cond: 'isInGaming' }, { target: 'fetchingGameSHA' }],
197
+ 20000: {
198
+ target: 'fetchingGameSHA',
199
+ },
201
200
  },
202
201
  },
203
202
  },
204
203
  },
205
204
  },
206
- on: {
207
- SET_IN_GAME: {
208
- actions: 'setInGaming',
209
- },
210
- SET_LEAVE_GAME: {
211
- actions: 'setLeaveGame',
212
- },
213
- },
214
205
  },
215
206
  {
216
207
  actions: {
@@ -227,9 +218,15 @@ export default function (request) {
227
218
  setLastPage: assign((context, event) => {
228
219
  const { index, content } = context
229
220
  return {
221
+ loadable: false,
230
222
  isLastPage: index >= content?.totalPage - 1,
231
223
  }
232
224
  }),
225
+ setFavoriteList: assign((context, event) => {
226
+ return {
227
+ favoriteList: event.data.data || [],
228
+ }
229
+ }),
233
230
  setRoom: assign((context, event) => {
234
231
  return {
235
232
  room: event.data,
@@ -314,12 +311,6 @@ export default function (request) {
314
311
  const lang = event.data.locale.replace('-', '_')
315
312
  return { lang }
316
313
  }),
317
- setInGaming: assign((context, event) => {
318
- return { inGaming: true }
319
- }),
320
- setLeaveGame: assign((context, event) => {
321
- return { inGaming: false }
322
- }),
323
314
  ...oldActions,
324
315
  },
325
316
  guards: {
@@ -328,12 +319,7 @@ export default function (request) {
328
319
  const { loadable, isLastPage } = context
329
320
  return loadable && !isLastPage
330
321
  },
331
- hasRoom: (context, event) => {
332
- return context.room?.categoryId
333
- },
334
- isInGaming: (context, event) => {
335
- return context.inGaming
336
- },
322
+ hasRoom: (context, event) => context.room?.categoryId,
337
323
  ...oldGuards,
338
324
  },
339
325
  services: {
@@ -12,7 +12,6 @@ export default function (request) {
12
12
  previousMenuItemStack: [],
13
13
  historyStack: [],
14
14
  defaultMenuItemStack: [],
15
- inGaming: false,
16
15
  },
17
16
  states: {
18
17
  loading: {
@@ -29,12 +28,15 @@ export default function (request) {
29
28
  states: {
30
29
  pending: {
31
30
  after: {
32
- 20000: [{ target: 'inGaming', cond: 'isInGaming' }, { target: 'updating', cond: 'isInMenu' }, { target: 'pending' }],
33
- },
34
- },
35
- inGaming: {
36
- after: {
37
- 3000: [{ target: 'inGaming', cond: 'isInGaming' }, { target: 'updating', cond: 'isInMenu' }, { target: 'pending' }],
31
+ 20000: [
32
+ {
33
+ target: 'updating',
34
+ cond: 'isInMenu',
35
+ },
36
+ {
37
+ target: 'pending',
38
+ },
39
+ ],
38
40
  },
39
41
  },
40
42
  updating: {
@@ -63,12 +65,6 @@ export default function (request) {
63
65
  RESET: {
64
66
  actions: 'resetMenuItemStack',
65
67
  },
66
- SET_IN_GAME: {
67
- actions: 'setInGame',
68
- },
69
- SET_LEAVE_GAME: {
70
- actions: 'setLeaveGame',
71
- },
72
68
  },
73
69
  },
74
70
  },
@@ -90,8 +86,8 @@ export default function (request) {
90
86
  setMenuItemStack: assign((context, event) => {
91
87
  const { menuItemStack } = context
92
88
  const inputItem = event.data
93
- const isTopItem = inputItem.level ? inputItem.level === 0 : true
94
- const hasSubMenu = inputItem.sub?.length || 0
89
+ const isTopItem = inputItem.level === 0
90
+ const hasSubMenu = inputItem.sub.length
95
91
 
96
92
  if (isTopItem) {
97
93
  if (hasSubMenu) {
@@ -144,24 +140,13 @@ export default function (request) {
144
140
  const { defaultMenuItemStack } = context
145
141
  return { menuItemStack: defaultMenuItemStack }
146
142
  }),
147
- setInGame: assign((context, event) => {
148
- return { inGaming: true }
149
- }),
150
- setLeaveGame: assign((context, event) => {
151
- return { inGaming: false }
152
- }),
153
143
  },
154
144
  guards: {
155
145
  isInMenu: (context, event) => {
156
146
  const { menuItemStack, menu } = context
157
- if (!menuItemStack || menuItemStack.length === 0) return false
158
147
  const menuItem = menuItemStack.slice(-1)[0]
159
- if (!menuItem || !menuItem.categoryId) return false
160
148
  return isItemInMenu(menuItem, menu.data)
161
149
  },
162
- isInGaming: (context, event) => {
163
- return context.inGaming
164
- },
165
150
  },
166
151
  services: {
167
152
  getMenu: async (context, event) => {