File tree Expand file tree Collapse file tree 5 files changed +17
-10
lines changed Expand file tree Collapse file tree 5 files changed +17
-10
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " lowcoder-sdk" ,
3- "version" : " 2.4.15 " ,
3+ "version" : " 2.4.16 " ,
44 "type" : " module" ,
55 "files" : [
66 " src" ,
Original file line number Diff line number Diff line change @@ -105,17 +105,17 @@ export class AppViewInstance<I = any, O = any> {
105105 } ) ;
106106
107107 await DatasourceApi . fetchJsDatasourceByApp ( this . appId ) . then ( ( res ) => {
108- res . data . data . forEach ( ( i ) => {
108+ res . data ? .data ? .forEach ( ( i ) => {
109109 registryDataSourcePlugin ( i . type , i . id , i . pluginDefinition ) ;
110110 } ) ;
111111 } ) ;
112112
113113 setGlobalSettings ( {
114- orgCommonSettings : data . data . orgCommonSettings ,
114+ orgCommonSettings : data ? .data ? .orgCommonSettings ,
115115 } ) ;
116116
117- finalAppDsl = data . data . applicationDSL ;
118- finalModuleDslMap = data . data . moduleDSL ;
117+ finalAppDsl = data ? .data ? .applicationDSL || { } ;
118+ finalModuleDslMap = data ? .data ? .moduleDSL || { } ;
119119 }
120120
121121 if ( this . options . moduleInputs && this . isModuleDSL ( finalAppDsl ) ) {
Original file line number Diff line number Diff line change 1- import { NPM_PLUGIN_ASSETS_BASE_URL } from "constants/npmPlugins" ;
1+ import { sdkConfig } from "@lowcoder-ee/constants/sdkConfig" ;
2+ import { ASSETS_BASE_URL , NPM_PLUGIN_ASSETS_BASE_URL } from "constants/npmPlugins" ;
23import { trans } from "i18n" ;
34import { CompConstructor } from "lowcoder-core" ;
45import {
@@ -17,7 +18,12 @@ async function npmLoader(
1718 // Falk: removed "packageVersion = "latest" as default value fir packageVersion - to ensure no automatic version jumping.
1819 const localPackageVersion = remoteInfo . packageVersion || "latest" ;
1920 const { packageName, packageVersion, compName } = remoteInfo ;
20- const entry = `${ NPM_PLUGIN_ASSETS_BASE_URL } /${ appId } /${ packageName } @${ localPackageVersion } /index.js` ;
21+
22+ const pluginBaseUrl = REACT_APP_BUNDLE_TYPE === 'sdk' && sdkConfig . baseURL
23+ ? `${ sdkConfig . baseURL } /${ ASSETS_BASE_URL } `
24+ : NPM_PLUGIN_ASSETS_BASE_URL ;
25+
26+ const entry = `${ pluginBaseUrl } /${ appId } /${ packageName } @${ localPackageVersion } /index.js` ;
2127
2228 try {
2329 const module = await import (
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ import { CompContext } from "@lowcoder-ee/comps/utils/compContext";
1616import React from "react" ;
1717import type { AppState } from "@lowcoder-ee/redux/reducers" ;
1818import { useSelector } from "react-redux" ;
19- import { useApplicationId } from "@lowcoder-ee/util/hooks " ;
19+ import { ExternalEditorContext } from "@lowcoder-ee/util/context/ExternalEditorContext " ;
2020
2121const ViewError = styled . div `
2222 display: flex;
@@ -63,7 +63,8 @@ const RemoteCompView = React.memo((props: React.PropsWithChildren<RemoteCompView
6363 const [ error , setError ] = useState < any > ( "" ) ;
6464 const editorState = useContext ( EditorContext ) ;
6565 const compState = useContext ( CompContext ) ;
66- const appId = useApplicationId ( ) ;
66+ const externalEditorState = useContext ( ExternalEditorContext ) ;
67+ const appId = externalEditorState . applicationId ;
6768 const lowcoderCompPackageVersion = editorState ?. getAppSettings ( ) . lowcoderCompVersion || 'latest' ;
6869 const latestLowcoderCompsVersion = useSelector ( ( state : AppState ) => state . npmPlugin . packageVersion [ 'lowcoder-comps' ] ) ;
6970
Original file line number Diff line number Diff line change 11// export const SERVER_HOST = `${REACT_APP_NODE_SERVICE_URL ?? ""}`;
22// export const NPM_REGISTRY_URL = `${SERVER_HOST}/node-service/api/npm/registry`;
33// export const NPM_PLUGIN_ASSETS_BASE_URL = `${SERVER_HOST}/node-service/api/npm/package`;
4-
4+ export const ASSETS_BASE_URL = `api/npm/package` ;
55export const SERVER_HOST = `${ REACT_APP_API_SERVICE_URL ?? "" } ` ;
66export const NPM_REGISTRY_URL = `${ SERVER_HOST } /api/npm/registry` ;
77export const NPM_PLUGIN_ASSETS_BASE_URL = `${ SERVER_HOST } /api/npm/package` ;
You can’t perform that action at this time.
0 commit comments