@@ -54,7 +54,8 @@ import {
54
54
import { isAggregationApp } from "util/appUtils" ;
55
55
import EditorSkeletonView from "./editorSkeletonView" ;
56
56
import { getCommonSettings } from "@lowcoder-ee/redux/selectors/commonSettingSelectors" ;
57
- import { isEqual } from "lodash" ;
57
+ import { isEqual , noop } from "lodash" ;
58
+ import { BottomSkeleton } from "./bottom/BottomContent" ;
58
59
59
60
const LeftContent = lazy (
60
61
( ) => import ( './LeftContent' )
@@ -374,6 +375,23 @@ function EditorView(props: EditorViewProps) {
374
375
375
376
const hideBodyHeader = useTemplateViewMode ( ) || ( isViewMode && ( ! showHeaderInPublic || ! commonSettings . showHeaderInPublicApps ) ) ;
376
377
378
+ const uiCompView = useMemo ( ( ) => {
379
+ if ( showAppSnapshot ) {
380
+ return (
381
+ < ViewBody $hideBodyHeader = { hideBodyHeader } $height = { height } >
382
+ < EditorContainer > { uiComp . getView ( ) } </ EditorContainer >
383
+ </ ViewBody >
384
+ ) ;
385
+ }
386
+
387
+ return uiComp . getView ( ) ;
388
+ } , [
389
+ showAppSnapshot ,
390
+ hideBodyHeader ,
391
+ height ,
392
+ uiComp ,
393
+ ] ) ;
394
+
377
395
// we check if we are on the public cloud
378
396
const isLowCoderDomain = window . location . hostname === 'app.lowcoder.cloud' ;
379
397
const isLocalhost = window . location . hostname === 'localhost' ;
@@ -425,16 +443,6 @@ function EditorView(props: EditorViewProps) {
425
443
426
444
// history mode, display with the right panel, a little trick
427
445
const showRight = panelStatus . right || showAppSnapshot ;
428
- let uiCompView ;
429
- if ( showAppSnapshot ) {
430
- uiCompView = (
431
- < ViewBody $hideBodyHeader = { hideBodyHeader } $height = { height } >
432
- < EditorContainer > { uiComp . getView ( ) } </ EditorContainer >
433
- </ ViewBody >
434
- ) ;
435
- } else {
436
- uiCompView = uiComp . getView ( ) ;
437
- }
438
446
439
447
const clickMenu = ( params : { key : string } ) => {
440
448
let left = true ;
@@ -514,46 +522,47 @@ function EditorView(props: EditorViewProps) {
514
522
) }
515
523
</ Sider >
516
524
</ SiderWrapper >
517
-
518
- { panelStatus . left && editorModeStatus !== "layout" && (
519
- < LeftPanel >
520
- { menuKey === SiderKey . State && < LeftContent uiComp = { uiComp } /> }
521
- { menuKey === SiderKey . Setting && (
522
- < SettingsDiv >
523
- < ScrollBar >
524
- { application &&
525
- ! isAggregationApp (
526
- AppUILayoutType [ application . applicationType ]
527
- ) && (
528
- < >
529
- { appSettingsComp . getPropertyView ( ) }
530
- < Divider />
531
- </ >
532
- ) }
533
- < TitleDiv > { trans ( "leftPanel.toolbarTitle" ) } </ TitleDiv >
534
- { props . preloadComp . getPropertyView ( ) }
535
- < PreloadDiv
536
- onClick = { ( ) => dispatch (
537
- setEditorExternalStateAction ( {
538
- showScriptsAndStyleModal : true ,
539
- } )
540
- ) }
541
- >
542
- < LeftPreloadIcon />
543
- { trans ( "leftPanel.toolbarPreload" ) }
544
- </ PreloadDiv >
545
- </ ScrollBar >
546
-
547
- { props . preloadComp . getJSLibraryPropertyView ( ) }
548
- </ SettingsDiv >
549
- ) }
550
-
551
- { menuKey === SiderKey . Layout && (
552
- < LeftLayersContent uiComp = { uiComp } />
553
- ) }
554
-
555
- </ LeftPanel >
556
- ) }
525
+ < Suspense fallback = { null } >
526
+ { panelStatus . left && editorModeStatus !== "layout" && (
527
+ < LeftPanel >
528
+ { menuKey === SiderKey . State && < LeftContent uiComp = { uiComp } /> }
529
+ { menuKey === SiderKey . Setting && (
530
+ < SettingsDiv >
531
+ < ScrollBar >
532
+ { application &&
533
+ ! isAggregationApp (
534
+ AppUILayoutType [ application . applicationType ]
535
+ ) && (
536
+ < >
537
+ { appSettingsComp . getPropertyView ( ) }
538
+ < Divider />
539
+ </ >
540
+ ) }
541
+ < TitleDiv > { trans ( "leftPanel.toolbarTitle" ) } </ TitleDiv >
542
+ { props . preloadComp . getPropertyView ( ) }
543
+ < PreloadDiv
544
+ onClick = { ( ) => dispatch (
545
+ setEditorExternalStateAction ( {
546
+ showScriptsAndStyleModal : true ,
547
+ } )
548
+ ) }
549
+ >
550
+ < LeftPreloadIcon />
551
+ { trans ( "leftPanel.toolbarPreload" ) }
552
+ </ PreloadDiv >
553
+ </ ScrollBar >
554
+
555
+ { props . preloadComp . getJSLibraryPropertyView ( ) }
556
+ </ SettingsDiv >
557
+ ) }
558
+
559
+ { menuKey === SiderKey . Layout && (
560
+ < LeftLayersContent uiComp = { uiComp } />
561
+ ) }
562
+
563
+ </ LeftPanel >
564
+ ) }
565
+ </ Suspense >
557
566
< MiddlePanel >
558
567
< EditorWrapper className = { editorContentClassName } >
559
568
< EditorHotKeys disabled = { readOnly } >
@@ -563,15 +572,19 @@ function EditorView(props: EditorViewProps) {
563
572
</ EditorContainerWithViewMode >
564
573
</ EditorHotKeys >
565
574
</ EditorWrapper >
566
- { panelStatus . bottom && editorModeStatus !== "layout" && < Bottom /> }
575
+ < Suspense fallback = { < BottomSkeleton /> } >
576
+ { panelStatus . bottom && editorModeStatus !== "layout" && < Bottom /> }
577
+ </ Suspense >
567
578
</ MiddlePanel >
568
- { showRight && (
569
- < RightPanel
570
- uiComp = { uiComp }
571
- onCompDrag = { onCompDrag }
572
- showPropertyPane = { editorState . showPropertyPane }
573
- onTabChange = { setShowPropertyPane } />
574
- ) }
579
+ < Suspense fallback = { null } >
580
+ { showRight && (
581
+ < RightPanel
582
+ uiComp = { uiComp }
583
+ onCompDrag = { onCompDrag }
584
+ showPropertyPane = { editorState . showPropertyPane }
585
+ onTabChange = { setShowPropertyPane } />
586
+ ) }
587
+ </ Suspense >
575
588
</ Body >
576
589
</ EditorGlobalHotKeys >
577
590
</ Height100Div > </ >
0 commit comments