@@ -8,7 +8,7 @@ import { WhiteLoading } from "lowcoder-design";
8
8
import { useContext , useState } from "react" ;
9
9
import { useMount } from "react-use" ;
10
10
import styled from "styled-components" ;
11
- import { RemoteCompInfo , RemoteCompLoader } from "types/remoteComp" ;
11
+ import { RemoteCompInfo , RemoteCompLoader , RemoteCompSource } from "types/remoteComp" ;
12
12
import { loaders } from "./loaders" ;
13
13
import { withErrorBoundary } from "comps/generators/withErrorBoundary" ;
14
14
import { EditorContext } from "@lowcoder-ee/comps/editorState" ;
@@ -54,10 +54,11 @@ interface RemoteCompViewProps {
54
54
loadComp : ( packageVersion ?: string ) => Promise < void > ;
55
55
loadingElement ?: ( ) => React . ReactNode ;
56
56
errorElement ?: ( error : any ) => React . ReactNode ;
57
+ source ?: RemoteCompSource ;
57
58
}
58
59
59
60
const RemoteCompView = React . memo ( ( props : React . PropsWithChildren < RemoteCompViewProps > ) => {
60
- const { loadComp, loadingElement, errorElement, isLowcoderComp } = props ;
61
+ const { loadComp, loadingElement, errorElement, isLowcoderComp, source } = props ;
61
62
const [ error , setError ] = useState < any > ( "" ) ;
62
63
const editorState = useContext ( EditorContext ) ;
63
64
const compState = useContext ( CompContext ) ;
@@ -66,7 +67,7 @@ const RemoteCompView = React.memo((props: React.PropsWithChildren<RemoteCompView
66
67
67
68
let packageVersion = 'latest' ;
68
69
// lowcoder-comps's package version
69
- if ( isLowcoderComp ) {
70
+ if ( isLowcoderComp && source !== 'bundle' ) {
70
71
packageVersion = lowcoderCompPackageVersion === 'latest' && Boolean ( latestLowcoderCompsVersion )
71
72
? latestLowcoderCompsVersion
72
73
: lowcoderCompPackageVersion ;
@@ -160,6 +161,7 @@ export function remoteComp<T extends RemoteCompInfo = RemoteCompInfo>(
160
161
isLowcoderComp = { remoteInfo ?. packageName === 'lowcoder-comps' }
161
162
loadComp = { ( packageVersion ?: string ) => this . load ( packageVersion ) }
162
163
loadingElement = { loadingElement }
164
+ source = { remoteInfo ?. source }
163
165
/>
164
166
) ;
165
167
}
0 commit comments