@jetthai/cuora 1.1.40 → 1.1.41

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,6 +2,8 @@
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.41](https://github.com/jetthai/cuora-module/compare/v1.1.40...v1.1.41) (2023-01-19)
6
+
5
7
  ### [1.1.40](https://github.com/jetthai/cuora-module/compare/v1.1.34-2...v1.1.40) (2023-01-16)
6
8
 
7
9
  ### [1.1.39](https://github.com/jetthai/cuora-module/compare/v1.1.38...v1.1.39) (2023-01-16)
package/dist/bundle.mjs CHANGED
@@ -13404,6 +13404,7 @@ function side_v2 (request) {
13404
13404
  menuItemStack: [],
13405
13405
  previousMenuItemStack: [],
13406
13406
  historyStack: [],
13407
+ defaultMenuItemStack: [],
13407
13408
  },
13408
13409
  states: {
13409
13410
  loading: {
@@ -13454,6 +13455,9 @@ function side_v2 (request) {
13454
13455
  POP: {
13455
13456
  actions: 'popHistoryStack',
13456
13457
  },
13458
+ RESET: {
13459
+ actions: 'resetMenuItemStack',
13460
+ },
13457
13461
  },
13458
13462
  },
13459
13463
  },
@@ -13469,7 +13473,7 @@ function side_v2 (request) {
13469
13473
  const menu = event.data;
13470
13474
  if (menu.data.length > 0) {
13471
13475
  const menuItemStack = getDefaultItem(menu.data[0]);
13472
- return { menuItemStack }
13476
+ return { menuItemStack, defaultMenuItemStack: menuItemStack }
13473
13477
  }
13474
13478
  }),
13475
13479
  setMenuItemStack: assign((context, event) => {
@@ -13510,7 +13514,7 @@ function side_v2 (request) {
13510
13514
  const menu = event.data;
13511
13515
  if (menu.data.length) {
13512
13516
  addLevelProperty(menu.data, 0);
13513
- return { menu }
13517
+ return { menu, defaultMenuItemStack: getDefaultItem(menu.data[0]) }
13514
13518
  }
13515
13519
  }),
13516
13520
  pushHistoryStack: assign((context, event) => {
@@ -13525,6 +13529,10 @@ function side_v2 (request) {
13525
13529
  historyStack: historyStack.slice(0, -1),
13526
13530
  }
13527
13531
  }),
13532
+ resetMenuItemStack: assign((context, event) => {
13533
+ const { defaultMenuItemStack } = context;
13534
+ return { menuItemStack: defaultMenuItemStack }
13535
+ }),
13528
13536
  },
13529
13537
  guards: {
13530
13538
  isInMenu: (context, event) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.40",
3
+ "version": "1.1.41",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -11,6 +11,7 @@ export default function (request) {
11
11
  menuItemStack: [],
12
12
  previousMenuItemStack: [],
13
13
  historyStack: [],
14
+ defaultMenuItemStack: [],
14
15
  },
15
16
  states: {
16
17
  loading: {
@@ -61,6 +62,9 @@ export default function (request) {
61
62
  POP: {
62
63
  actions: 'popHistoryStack',
63
64
  },
65
+ RESET: {
66
+ actions: 'resetMenuItemStack',
67
+ },
64
68
  },
65
69
  },
66
70
  },
@@ -76,7 +80,7 @@ export default function (request) {
76
80
  const menu = event.data
77
81
  if (menu.data.length > 0) {
78
82
  const menuItemStack = getDefaultItem(menu.data[0])
79
- return { menuItemStack }
83
+ return { menuItemStack, defaultMenuItemStack: menuItemStack }
80
84
  }
81
85
  }),
82
86
  setMenuItemStack: assign((context, event) => {
@@ -117,7 +121,7 @@ export default function (request) {
117
121
  const menu = event.data
118
122
  if (menu.data.length) {
119
123
  addLevelProperty(menu.data, 0)
120
- return { menu }
124
+ return { menu, defaultMenuItemStack: getDefaultItem(menu.data[0]) }
121
125
  }
122
126
  }),
123
127
  pushHistoryStack: assign((context, event) => {
@@ -132,6 +136,10 @@ export default function (request) {
132
136
  historyStack: historyStack.slice(0, -1),
133
137
  }
134
138
  }),
139
+ resetMenuItemStack: assign((context, event) => {
140
+ const { defaultMenuItemStack } = context
141
+ return { menuItemStack: defaultMenuItemStack }
142
+ }),
135
143
  },
136
144
  guards: {
137
145
  isInMenu: (context, event) => {