@lvce-editor/quick-pick-worker 4.5.0 → 4.5.1

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.
@@ -3642,6 +3642,15 @@ const createCustomPick = value => {
3642
3642
  uri: ''
3643
3643
  };
3644
3644
  };
3645
+ const shouldCloseBeforeSelect = (subId, pick) => {
3646
+ if (subId !== Commands$1) {
3647
+ return false;
3648
+ }
3649
+ const {
3650
+ id
3651
+ } = pick;
3652
+ return typeof id === 'string' && id.startsWith('ext.');
3653
+ };
3645
3654
  const selectIndex = async (state, index, button = /* left */0) => {
3646
3655
  const {
3647
3656
  items,
@@ -3656,6 +3665,10 @@ const selectIndex = async (state, index, button = /* left */0) => {
3656
3665
  if (!pick) {
3657
3666
  return state;
3658
3667
  }
3668
+ const closed = shouldCloseBeforeSelect(subId, pick);
3669
+ if (closed) {
3670
+ await closeWidget(state.uid);
3671
+ }
3659
3672
  const fn = getSelect(subId);
3660
3673
  const selectPickResult = await fn(pick, value);
3661
3674
  object(selectPickResult);
@@ -3665,7 +3678,9 @@ const selectIndex = async (state, index, button = /* left */0) => {
3665
3678
  } = selectPickResult;
3666
3679
  switch (command) {
3667
3680
  case Hide:
3668
- await closeWidget(state.uid);
3681
+ if (!closed) {
3682
+ await closeWidget(state.uid);
3683
+ }
3669
3684
  return state;
3670
3685
  case OpenLanguageMode:
3671
3686
  return loadContent({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/quick-pick-worker",
3
- "version": "4.5.0",
3
+ "version": "4.5.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/lvce-editor/quick-pick-worker.git"