@lvce-editor/activity-bar-worker 7.27.1 → 7.27.2

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.
@@ -397,6 +397,10 @@ const focusPrevious = state => {
397
397
  return focusIndex(state, focusedIndex - 1);
398
398
  };
399
399
 
400
+ const getComponentState = uid => {
401
+ return get$2(uid).newState;
402
+ };
403
+
400
404
  const Button$3 = 'button';
401
405
  const None$1 = 'none';
402
406
  const Tab$1 = 'tab';
@@ -4111,6 +4115,23 @@ const setAccountEnabled = (state, enabled) => {
4111
4115
  };
4112
4116
  };
4113
4117
 
4118
+ const applyComponentState = (currentState, state) => {
4119
+ if (!state || typeof state !== 'object' || Array.isArray(state)) {
4120
+ throw new TypeError('Activity Bar state must be an object');
4121
+ }
4122
+ const {
4123
+ uid
4124
+ } = state;
4125
+ const {
4126
+ uid: currentUid
4127
+ } = currentState;
4128
+ if (uid !== currentUid) {
4129
+ throw new Error(`Activity Bar state uid must remain ${currentUid}`);
4130
+ }
4131
+ return state;
4132
+ };
4133
+ const setComponentState = wrapCommand(applyComponentState);
4134
+
4114
4135
  const setDragAndDropEnabled = (state, enabled) => {
4115
4136
  const {
4116
4137
  dragAndDropEnabled
@@ -4204,6 +4225,7 @@ const commandMap = {
4204
4225
  'ActivityBar.focusNone': wrapCommand(focusNone),
4205
4226
  'ActivityBar.focusPrevious': wrapCommand(focusPrevious),
4206
4227
  'ActivityBar.getCommandIds': getCommandIds,
4228
+ 'ActivityBar.getComponentState': getComponentState,
4207
4229
  'ActivityBar.getKeyBindings': getKeyBindings,
4208
4230
  'ActivityBar.getMenuEntries': wrapGetter(getMenuEntries),
4209
4231
  'ActivityBar.getMenuEntryIds': getMenuEntryIds,
@@ -4239,6 +4261,7 @@ const commandMap = {
4239
4261
  'ActivityBar.saveState': wrapGetter(saveState),
4240
4262
  'ActivityBar.selectCurrent': wrapCommand(selectCurrent),
4241
4263
  'ActivityBar.setAccountEnabled': wrapCommand(setAccountEnabled),
4264
+ 'ActivityBar.setComponentState': setComponentState,
4242
4265
  'ActivityBar.setDragAndDropEnabled': wrapCommand(setDragAndDropEnabled),
4243
4266
  'ActivityBar.setUserLoginState': wrapCommand(setUserLoginState),
4244
4267
  'ActivityBar.sleep': sleep,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/activity-bar-worker",
3
- "version": "7.27.1",
3
+ "version": "7.27.2",
4
4
  "description": "Explorer Worker",
5
5
  "repository": {
6
6
  "type": "git",