@lvce-editor/problems-view 1.34.0 → 1.34.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.
@@ -2351,7 +2351,7 @@ const getProblems = async (workspaceUri, activeUri) => {
2351
2351
  };
2352
2352
  } catch (error) {
2353
2353
  return {
2354
- error: `${error}`,
2354
+ error: String(error),
2355
2355
  problems: []
2356
2356
  };
2357
2357
  }
@@ -2852,6 +2852,34 @@ const handleWheel = (state, deltaMode, deltaY) => {
2852
2852
  return setDeltaY(state, currentDeltaY + deltaY);
2853
2853
  };
2854
2854
 
2855
+ const handleWorkspaceChange = (state, newWorkspaceUri) => {
2856
+ const {
2857
+ workspaceUri
2858
+ } = state;
2859
+ if (newWorkspaceUri === workspaceUri) {
2860
+ return state;
2861
+ }
2862
+ return {
2863
+ ...state,
2864
+ activeUri: '',
2865
+ collapsedUris: [],
2866
+ deltaY: 0,
2867
+ fileIconCache: {},
2868
+ filteredProblems: [],
2869
+ finalDeltaY: 0,
2870
+ focusedIndex: -2,
2871
+ handleOffset: 0,
2872
+ listItems: [],
2873
+ maxLineY: 0,
2874
+ message: getMessage(0),
2875
+ minLineY: 0,
2876
+ problems: [],
2877
+ scrollBarActive: false,
2878
+ scrollBarHeight: 0,
2879
+ workspaceUri: newWorkspaceUri
2880
+ };
2881
+ };
2882
+
2855
2883
  const initialize = async () => {
2856
2884
  // function is not needed anymore
2857
2885
  };
@@ -3219,7 +3247,7 @@ const getBadgeVirtualDom = (className, count) => {
3219
3247
  childCount: 1,
3220
3248
  className: mergeClassNames('Badge', className) + (''),
3221
3249
  type: Div
3222
- }, text(`${count}`)];
3250
+ }, text(String(count))];
3223
3251
  };
3224
3252
 
3225
3253
  const getChevronDownVirtualDom = (extraClassName = '') => {
@@ -3269,7 +3297,7 @@ const getProblemsIconVirtualDom = type => {
3269
3297
  const getProblemSourceDetail = (source, code) => {
3270
3298
  let message = '';
3271
3299
  if (source) {
3272
- message += `${source}`;
3300
+ message += source;
3273
3301
  }
3274
3302
  if (code) {
3275
3303
  message += `(${code})`;
@@ -3326,17 +3354,18 @@ const getProblemVirtualDom = problem => {
3326
3354
  className = mergeClassNames(className, ProblemSelected);
3327
3355
  }
3328
3356
  if (listItemType === Expanded || listItemType === Collapsed) {
3357
+ const fileIconDom = icon ? [getFileIconVirtualDom(icon)] : [];
3329
3358
  return [{
3330
3359
  ariaExpanded: !isCollapsed,
3331
3360
  ariaLevel: level,
3332
3361
  ariaPosInSet: posInSet,
3333
3362
  ariaSelected: isActive,
3334
3363
  ariaSetSize: setSize,
3335
- childCount: 5,
3364
+ childCount: 4 + fileIconDom.length,
3336
3365
  className,
3337
3366
  role: TreeItem,
3338
3367
  type: Div
3339
- }, listItemType === Collapsed ? getChevronRightVirtualDom() : getChevronDownVirtualDom(), getFileIconVirtualDom(icon), {
3368
+ }, listItemType === Collapsed ? getChevronRightVirtualDom() : getChevronDownVirtualDom(), ...fileIconDom, {
3340
3369
  ...labelNode,
3341
3370
  'data-uri': uri,
3342
3371
  onClick: HandleFileNameClick
@@ -3841,6 +3870,7 @@ const commandMap = {
3841
3870
  'Problems.handleScrollBarClick': wrapCommand(handleScrollBarClick),
3842
3871
  'Problems.handleScrollBarMove': wrapCommand(handleScrollBarMove),
3843
3872
  'Problems.handleWheel': wrapCommand(handleWheel),
3873
+ 'Problems.handleWorkspaceChange': wrapCommand(handleWorkspaceChange),
3844
3874
  'Problems.initialize': initialize,
3845
3875
  'Problems.loadContent': wrapCommand(loadContent),
3846
3876
  'Problems.render2': render2,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/problems-view",
3
- "version": "1.34.0",
3
+ "version": "1.34.2",
4
4
  "description": "Problems View Worker",
5
5
  "repository": {
6
6
  "type": "git",