@lvce-editor/activity-bar-worker 1.2.0 → 1.3.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.
@@ -388,11 +388,11 @@ const remove = id => {
388
388
  delete callbacks[id];
389
389
  };
390
390
  let id = 0;
391
- const create$3 = () => {
391
+ const create$3$1 = () => {
392
392
  return ++id;
393
393
  };
394
394
  const registerPromise = () => {
395
- const id = create$3();
395
+ const id = create$3$1();
396
396
  const {
397
397
  resolve,
398
398
  promise
@@ -822,7 +822,7 @@ const listen$1 = async (module, options) => {
822
822
  const ipc = module.wrap(rawIpc);
823
823
  return ipc;
824
824
  };
825
- const create$2 = async ({
825
+ const create$3 = async ({
826
826
  commandMap
827
827
  }) => {
828
828
  // TODO create a commandMap per rpc instance
@@ -834,7 +834,7 @@ const create$2 = async ({
834
834
  };
835
835
  const WebWorkerRpcClient = {
836
836
  __proto__: null,
837
- create: create$2
837
+ create: create$3
838
838
  };
839
839
  const createMockRpc = ({
840
840
  commandMap
@@ -860,7 +860,7 @@ const toCommandId = key => {
860
860
  const dotIndex = key.indexOf('.');
861
861
  return key.slice(dotIndex + 1);
862
862
  };
863
- const create$1 = () => {
863
+ const create$2 = () => {
864
864
  const states = Object.create(null);
865
865
  const commandMapRef = {};
866
866
  return {
@@ -947,7 +947,27 @@ const {
947
947
  getCommandIds,
948
948
  wrapGetter,
949
949
  wrapCommand
950
- } = create$1();
950
+ } = create$2();
951
+
952
+ // TODO parentUid might ot be needed
953
+ const create$1 = (id, uri, x, y, width, height, args, parentUid, platform = 0) => {
954
+ const state = {
955
+ currentViewletId: '',
956
+ uid: id,
957
+ focus: 0,
958
+ focused: false,
959
+ focusedIndex: -1,
960
+ scrollBarHeight: 0,
961
+ width: 0,
962
+ x: 0,
963
+ y: 0,
964
+ sideBarVisible: false,
965
+ activityBarItems: [],
966
+ selectedIndex: -1
967
+ };
968
+ set$3(state.uid, state, state);
969
+ return state;
970
+ };
951
971
 
952
972
  const List = 1;
953
973
 
@@ -1518,6 +1538,12 @@ const handleSideBarViewletChange = (state, id, ...args) => {
1518
1538
  };
1519
1539
  };
1520
1540
 
1541
+ const loadContent = async (state, savedState) => {
1542
+ return {
1543
+ ...state
1544
+ };
1545
+ };
1546
+
1521
1547
  const applyRender = (oldState, newState, diffResult) => {
1522
1548
  const commands = [];
1523
1549
  return commands;
@@ -1627,6 +1653,7 @@ const commandMap = {
1627
1653
  'ActivityBar.focus': wrapCommand(focus),
1628
1654
  'ActivityBar.focusFirst': wrapCommand(focusFirst),
1629
1655
  'ActivityBar.focusIndex': wrapCommand(focusIndex),
1656
+ 'ActivityBar.loadContent': wrapCommand(loadContent),
1630
1657
  'ActivityBar.focusLast': wrapCommand(focusLast),
1631
1658
  'ActivityBar.focusNext': wrapCommand(focusNext),
1632
1659
  'ActivityBar.handleBlur': wrapCommand(handleBlur),
@@ -1638,7 +1665,8 @@ const commandMap = {
1638
1665
  'ActivityBar.render2': render2,
1639
1666
  'ActivityBar.renderEventListeners': renderEventListeners,
1640
1667
  'ActivityBar.saveState': wrapGetter(saveState),
1641
- 'ActivityBar.terminate': terminate
1668
+ 'ActivityBar.terminate': terminate,
1669
+ 'ActivityBar.create': create$1
1642
1670
  };
1643
1671
 
1644
1672
  const listen = async () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/activity-bar-worker",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "Explorer Worker",
5
5
  "repository": {
6
6
  "type": "git",