@lvce-editor/panel-worker 1.8.0 → 1.9.0

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.
@@ -1181,15 +1181,17 @@ const getContentDimensions = dimensions => {
1181
1181
  const openViewlet = async (state, id, focus = false) => {
1182
1182
  const childDimensions = getContentDimensions(state);
1183
1183
  const childUid = Math.random();
1184
- const tabId = 1234;
1184
+ const tabId = Math.random();
1185
1185
  const actionsUid = Math.random();
1186
+ const index = state.views.indexOf(id);
1186
1187
  await createViewlet(id, childUid, tabId, childDimensions, '');
1187
1188
  return {
1188
1189
  ...state,
1189
1190
  actionsUid,
1190
1191
  childUid,
1191
1192
  currentViewletId: id,
1192
- initial: false
1193
+ initial: false,
1194
+ selectedIndex: index
1193
1195
  };
1194
1196
  };
1195
1197
 
@@ -1208,11 +1210,7 @@ const selectIndex = async (state, index) => {
1208
1210
  const {
1209
1211
  views
1210
1212
  } = state;
1211
- await openViewlet(state, views[index]);
1212
- return {
1213
- ...state,
1214
- selectedIndex: index
1215
- };
1213
+ return openViewlet(state, views[index]);
1216
1214
  };
1217
1215
 
1218
1216
  const selectRaw = async (state, rawIndex) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/panel-worker",
3
- "version": "1.8.0",
3
+ "version": "1.9.0",
4
4
  "description": "Panel Worker",
5
5
  "repository": {
6
6
  "type": "git",