@lvce-editor/main-area-worker 9.64.1 → 9.64.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.
@@ -3872,6 +3872,7 @@ const HandleTabKeyDown = 29;
3872
3872
  const HandleTabsWheel = 30;
3873
3873
  const HandleTabDragOver = 31;
3874
3874
  const HandleTabsDragOver = 32;
3875
+ const HandleFocus = 33;
3875
3876
 
3876
3877
  const dragOverlayVirtualDom = {
3877
3878
  childCount: 0,
@@ -4522,6 +4523,7 @@ const renderEmptyEditorGroup = (group, groupIndex, closeButtonEnabled = true) =>
4522
4523
  className: mergeClassNames(EditorGroupEmpty, getEditorGroupClassName(group.id)),
4523
4524
  'data-groupId': String(group.id),
4524
4525
  onContextMenu: HandleContextMenu,
4526
+ onFocus: HandleFocus,
4525
4527
  tabIndex: Focusable,
4526
4528
  type: Div
4527
4529
  }, ...closeButtonDom, ...renderWaterMark(group.id)];
@@ -4755,11 +4757,42 @@ const getMenuIds = () => {
4755
4757
  return [Main$1, Tab];
4756
4758
  };
4757
4759
 
4760
+ const focusEditorGroup = (state, groupId) => {
4761
+ const {
4762
+ layout
4763
+ } = state;
4764
+ const {
4765
+ groups
4766
+ } = layout;
4767
+ const updatedGroups = groups.map(group => ({
4768
+ ...group,
4769
+ focused: group.id === groupId
4770
+ }));
4771
+ return {
4772
+ ...state,
4773
+ layout: {
4774
+ ...layout,
4775
+ activeGroupId: groupId,
4776
+ groups: updatedGroups
4777
+ }
4778
+ };
4779
+ };
4780
+
4781
+ const parseRawGroupId = rawGroupId => {
4782
+ if (!rawGroupId) {
4783
+ return undefined;
4784
+ }
4785
+ const groupId = Number(rawGroupId);
4786
+ return Number.isNaN(groupId) ? undefined : groupId;
4787
+ };
4788
+
4758
4789
  const handleClick = async (state, name) => {
4759
- if (!name) {
4790
+ const groupId = parseRawGroupId(name);
4791
+ if (groupId === undefined) {
4760
4792
  return state;
4761
4793
  }
4762
- return state;
4794
+ const hasGroup = state.layout.groups.some(group => group.id === groupId);
4795
+ return hasGroup ? focusEditorGroup(state, groupId) : state;
4763
4796
  };
4764
4797
 
4765
4798
  const getActiveGroup = (groups, activeGroupId) => {
@@ -4808,27 +4841,6 @@ const findTabByUri = (state, uri) => {
4808
4841
  return undefined;
4809
4842
  };
4810
4843
 
4811
- const focusEditorGroup = (state, groupId) => {
4812
- const {
4813
- layout
4814
- } = state;
4815
- const {
4816
- groups
4817
- } = layout;
4818
- const updatedGroups = groups.map(group => ({
4819
- ...group,
4820
- focused: group.id === groupId
4821
- }));
4822
- return {
4823
- ...state,
4824
- layout: {
4825
- ...layout,
4826
- activeGroupId: groupId,
4827
- groups: updatedGroups
4828
- }
4829
- };
4830
- };
4831
-
4832
4844
  const getActiveTabId = state => {
4833
4845
  const {
4834
4846
  layout
@@ -5663,14 +5675,6 @@ const openUriWithContext = async (context, options, focus = true, viewletContext
5663
5675
  await openInputWithContext(context, getOpenInputOptions(options, focus, viewletContext));
5664
5676
  };
5665
5677
 
5666
- const parseRawGroupId = rawGroupId => {
5667
- if (!rawGroupId) {
5668
- return undefined;
5669
- }
5670
- const groupId = Number(rawGroupId);
5671
- return Number.isNaN(groupId) ? undefined : groupId;
5672
- };
5673
-
5674
5678
  const focusGroup = (groups, groupId, activeTabId) => {
5675
5679
  return groups.map(group => {
5676
5680
  if (group.id === groupId) {
@@ -8366,6 +8370,9 @@ const renderEventListeners = () => {
8366
8370
  return [{
8367
8371
  name: HandleClick,
8368
8372
  params: ['handleClick', TargetName]
8373
+ }, {
8374
+ name: HandleFocus,
8375
+ params: ['handleClick', 'event.target.dataset.groupId']
8369
8376
  }, {
8370
8377
  name: HandleClickClose,
8371
8378
  params: ['handleClickCloseTab', 'event.currentTarget.dataset.groupIndex', 'event.currentTarget.dataset.index'],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/main-area-worker",
3
- "version": "9.64.1",
3
+ "version": "9.64.2",
4
4
  "description": "Main Area Worker",
5
5
  "repository": {
6
6
  "type": "git",