@lvce-editor/activity-bar-worker 1.16.0 → 1.18.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.
- package/dist/activityBarWorkerMain.js +31 -22
- package/package.json +1 -1
|
@@ -1020,7 +1020,9 @@ const create = (id, uri, x, y, width, height, args, parentUid, platform = 0) =>
|
|
|
1020
1020
|
sideBarVisible: false,
|
|
1021
1021
|
activityBarItems: [],
|
|
1022
1022
|
selectedIndex: -1,
|
|
1023
|
-
itemHeight: 48
|
|
1023
|
+
itemHeight: 48,
|
|
1024
|
+
updateState: '',
|
|
1025
|
+
updateProgress: 0
|
|
1024
1026
|
};
|
|
1025
1027
|
set(id, state, state);
|
|
1026
1028
|
return state;
|
|
@@ -1179,12 +1181,12 @@ const handleClickOther = async (state, x, y, viewletId) => {
|
|
|
1179
1181
|
if (sideBarVisible) {
|
|
1180
1182
|
if (currentViewletId === viewletId) {
|
|
1181
1183
|
await hide();
|
|
1182
|
-
|
|
1183
|
-
await show(sideBarVisible, viewletId);
|
|
1184
|
+
return state;
|
|
1184
1185
|
}
|
|
1185
|
-
|
|
1186
|
-
|
|
1186
|
+
await show(sideBarVisible, viewletId);
|
|
1187
|
+
return state;
|
|
1187
1188
|
}
|
|
1189
|
+
await show(sideBarVisible, currentViewletId);
|
|
1188
1190
|
return state;
|
|
1189
1191
|
};
|
|
1190
1192
|
|
|
@@ -1234,11 +1236,32 @@ const handleResize = state => {
|
|
|
1234
1236
|
return state;
|
|
1235
1237
|
};
|
|
1236
1238
|
|
|
1239
|
+
const Tab = 1;
|
|
1240
|
+
const Button = 1 << 1;
|
|
1241
|
+
const Progress = 1 << 2;
|
|
1242
|
+
const Enabled = 1 << 3;
|
|
1243
|
+
const Selected = 1 << 4;
|
|
1244
|
+
const Focused = 1 << 5;
|
|
1245
|
+
const MarginTop = 1 << 6;
|
|
1246
|
+
|
|
1247
|
+
const setFlag = (item, flag, enabled) => {
|
|
1248
|
+
return {
|
|
1249
|
+
...item,
|
|
1250
|
+
flags: enabled ? item.flags | flag : item.flags & ~flag
|
|
1251
|
+
};
|
|
1252
|
+
};
|
|
1253
|
+
|
|
1237
1254
|
const handleSideBarHidden = state => {
|
|
1255
|
+
const itemsCleared = state.activityBarItems.map(item => {
|
|
1256
|
+
const withoutSelected = setFlag(item, Selected, false);
|
|
1257
|
+
return setFlag(withoutSelected, Focused, false);
|
|
1258
|
+
});
|
|
1238
1259
|
return {
|
|
1239
1260
|
...state,
|
|
1261
|
+
activityBarItems: itemsCleared,
|
|
1240
1262
|
focusedIndex: -1,
|
|
1241
|
-
selectedIndex: -1
|
|
1263
|
+
selectedIndex: -1,
|
|
1264
|
+
sideBarVisible: false
|
|
1242
1265
|
};
|
|
1243
1266
|
};
|
|
1244
1267
|
|
|
@@ -1251,21 +1274,6 @@ const findIndex = (activityBarItems, id) => {
|
|
|
1251
1274
|
return -1;
|
|
1252
1275
|
};
|
|
1253
1276
|
|
|
1254
|
-
const Tab = 1;
|
|
1255
|
-
const Button = 1 << 1;
|
|
1256
|
-
const Progress = 1 << 2;
|
|
1257
|
-
const Enabled = 1 << 3;
|
|
1258
|
-
const Selected = 1 << 4;
|
|
1259
|
-
const Focused = 1 << 5;
|
|
1260
|
-
const MarginTop = 1 << 6;
|
|
1261
|
-
|
|
1262
|
-
const setFlag = (item, flag, enabled) => {
|
|
1263
|
-
return {
|
|
1264
|
-
...item,
|
|
1265
|
-
flags: enabled ? item.flags | flag : item.flags & ~flag
|
|
1266
|
-
};
|
|
1267
|
-
};
|
|
1268
|
-
|
|
1269
1277
|
const markSelected = (items, selectedIndex) => {
|
|
1270
1278
|
return items.map((item, index) => {
|
|
1271
1279
|
const isSelected = index === selectedIndex;
|
|
@@ -1283,7 +1291,8 @@ const handleSideBarViewletChange = (state, id, ...args) => {
|
|
|
1283
1291
|
...state,
|
|
1284
1292
|
selectedIndex: index,
|
|
1285
1293
|
currentViewletId: id,
|
|
1286
|
-
activityBarItems: newActivityBarItems
|
|
1294
|
+
activityBarItems: newActivityBarItems,
|
|
1295
|
+
sideBarVisible: true
|
|
1287
1296
|
};
|
|
1288
1297
|
};
|
|
1289
1298
|
|