@@ -64,6 +64,7 @@ import { isEqual, noop } from "lodash";
6464import { AppSettingContext , AppSettingType } from "@lowcoder-ee/comps/utils/appSettingContext" ;
6565import { getBrandingSetting } from "@lowcoder-ee/redux/selectors/enterpriseSelectors" ;
6666import Flex from "antd/es/flex" ;
67+ import { getAppIconPngUrl } from "util/iconConversionUtils" ;
6768// import { BottomSkeleton } from "./bottom/BottomContent";
6869
6970const Header = lazy (
@@ -565,6 +566,28 @@ function EditorView(props: EditorViewProps) {
565566 if ( readOnly && hideHeader ) {
566567 return (
567568 < CustomShortcutWrapper >
569+ < Helmet >
570+ { application && < title > { appSettingsComp ?. children ?. title ?. getView ?.( ) || application ?. name } </ title > }
571+ { ( ( ) => {
572+ const appId = application ?. applicationId ;
573+ const themeColor = brandingSettings ?. config_set ?. mainBrandingColor || '#b480de' ;
574+ const appIcon512 = appId ? getAppIconPngUrl ( appId , 512 , themeColor ) : undefined ;
575+ const appIcon192 = appId ? getAppIconPngUrl ( appId , 192 , themeColor ) : undefined ;
576+ const appFavicon = appId ? getAppIconPngUrl ( appId , 192 ) : undefined ; // No background for favicon
577+ const manifestHref = appId ? `/api/applications/${ appId } /manifest.json` : undefined ;
578+ const appTitle = appSettingsComp ?. children ?. title ?. getView ?.( ) || application ?. name ;
579+ return [
580+ manifestHref && < link key = "app-manifest" rel = "manifest" href = { manifestHref } /> ,
581+ appFavicon && < link key = "app-favicon" rel = "icon" href = { appFavicon } /> ,
582+ appIcon512 && < link key = "apple-touch-icon" rel = "apple-touch-icon" href = { appIcon512 } /> ,
583+ appIcon512 && < link key = "apple-touch-startup-image" rel = "apple-touch-startup-image" href = { appIcon512 } /> ,
584+ appIcon512 && < meta key = "og:image" property = "og:image" content = { appIcon512 } /> ,
585+ appIcon512 && < meta key = "twitter:image" name = "twitter:image" content = { appIcon512 } /> ,
586+ < meta key = "theme-color" name = "theme-color" content = { themeColor } /> ,
587+ appTitle && < meta key = "apple-mobile-web-app-title" name = "apple-mobile-web-app-title" content = { String ( appTitle ) } /> ,
588+ ] ;
589+ } ) ( ) }
590+ </ Helmet >
568591 { uiComp . getView ( ) }
569592 < div style = { { zIndex : Layers . hooksCompContainer } } > { hookCompViews } </ div >
570593 </ CustomShortcutWrapper >
@@ -575,7 +598,26 @@ function EditorView(props: EditorViewProps) {
575598 return (
576599 < CustomShortcutWrapper >
577600 < Helmet >
578- { application && < title > { appSettingsComp ?. children ?. title ?. getView ?.( ) || application ?. name } </ title > }
601+ { application && < title > { appSettingsComp ?. children ?. title ?. getView ?.( ) || application ?. name } </ title > }
602+ { ( ( ) => {
603+ const appId = application ?. applicationId ;
604+ const themeColor = brandingSettings ?. config_set ?. mainBrandingColor || '#b480de' ;
605+ const appIcon512 = appId ? getAppIconPngUrl ( appId , 512 , themeColor ) : undefined ;
606+ const appIcon192 = appId ? getAppIconPngUrl ( appId , 192 , themeColor ) : undefined ;
607+ const appFavicon = appId ? getAppIconPngUrl ( appId , 192 ) : undefined ; // No background for favicon
608+ const manifestHref = appId ? `/api/applications/${ appId } /manifest.json` : undefined ;
609+ const appTitle = appSettingsComp ?. children ?. title ?. getView ?.( ) || application ?. name ;
610+ return [
611+ manifestHref && < link key = "app-manifest" rel = "manifest" href = { manifestHref } /> ,
612+ appFavicon && < link key = "app-favicon" rel = "icon" href = { appFavicon } /> ,
613+ appIcon512 && < link key = "apple-touch-icon" rel = "apple-touch-icon" href = { appIcon512 } /> ,
614+ appIcon512 && < link key = "apple-touch-startup-image" rel = "apple-touch-startup-image" href = { appIcon512 } /> ,
615+ appIcon512 && < meta key = "og:image" property = "og:image" content = { appIcon512 } /> ,
616+ appIcon512 && < meta key = "twitter:image" name = "twitter:image" content = { appIcon512 } /> ,
617+ < meta key = "theme-color" name = "theme-color" content = { themeColor } /> ,
618+ appTitle && < meta key = "apple-mobile-web-app-title" name = "apple-mobile-web-app-title" content = { String ( appTitle ) } /> ,
619+ ] ;
620+ } ) ( ) }
579621 { isLowCoderDomain || isLocalhost && [
580622 // Adding Support for iframely to be able to embedd apps as iframes
581623 application ?. name ? ( [
@@ -585,7 +627,7 @@ function EditorView(props: EditorViewProps) {
585627 < meta key = "iframely:title" property = "iframely:title" content = "Lowcoder 3" /> ,
586628 < meta key = "iframely:description" property = "iframely:description" content = "Lowcoder | rapid App & VideoMeeting builder for everyone." /> ,
587629 ] ) ,
588- < link rel = "iframely" type = "text/html" href = { window . location . href } media = "(aspect-ratio: 1280/720)" /> ,
630+ < link key = "iframely" rel = "iframely" type = "text/html" href = { window . location . href } media = "(aspect-ratio: 1280/720)" /> ,
589631 < link key = "preconnect-googleapis" rel = "preconnect" href = "https://fonts.googleapis.com" /> ,
590632 < link key = "preconnect-gstatic" rel = "preconnect" href = "https://fonts.gstatic.com" crossOrigin = "anonymous" /> ,
591633 < link key = "font-ubuntu" href = "https://fonts.googleapis.com/css2?family=Ubuntu:ital,wght@0,300;0,400;0,700;1,400& display = swap " rel = "stylesheet" /> ,
@@ -623,32 +665,51 @@ function EditorView(props: EditorViewProps) {
623665
624666 return (
625667 < >
626- < Helmet >
627- { application && < title > { appSettingsComp ?. children ?. title ?. getView ?.( ) || application ?. name } </ title > }
628- { isLowCoderDomain || isLocalhost && [
629- // Adding Support for iframely to be able to embedd apps as iframes
630- application ?. name ? ( [
631- < meta key = "iframely:title" property = "iframely:title" content = { application . name } /> ,
632- < meta key = "iframely:description" property = "iframely:description" content = { application . description } /> ,
633- ] ) : ( [
634- < meta key = "iframely:title" property = "iframely:title" content = "Lowcoder 3" /> ,
635- < meta key = "iframely:description" property = "iframely:description" content = "Lowcoder | rapid App & VideoMeeting builder for everyone." /> ,
636- ] ) ,
637- < link key = "iframely" rel = "iframely" type = "text/html" href = { window . location . href } media = "(aspect-ratio: 1280/720)" /> ,
638- < link key = "preconnect-googleapis" rel = "preconnect" href = "https://fonts.googleapis.com" /> ,
639- < link key = "preconnect-gstatic" rel = "preconnect" href = "https://fonts.gstatic.com" crossOrigin = "anonymous" /> ,
640- < link key = "font-ubuntu" href = "https://fonts.googleapis.com/css2?family=Ubuntu:ital,wght@0,300;0,400;0,700;1,400& display = swap " rel = "stylesheet" /> ,
641- // adding Clearbit Support for Analytics
642- < script key = "hs-script-loader" async defer src = "//js-eu1.hs-scripts.com/144574215.js" type = "text/javascript" id = "hs-script-loader" > </ script >
643- ] }
644- </ Helmet >
645- < Height100Div
646- onDragEnd = { ( e ) => {
647- // log.debug("layout: onDragEnd. Height100Div");
648- editorState . setDragging ( false ) ;
649- draggingUtils . clearData ( ) ;
650- } }
651- >
668+ < Helmet >
669+ { application && < title > { appSettingsComp ?. children ?. title ?. getView ?.( ) || application ?. name } </ title > }
670+ { ( ( ) => {
671+ const appId = application ?. applicationId ;
672+ const themeColor = brandingSettings ?. config_set ?. mainBrandingColor || '#b480de' ;
673+ const appIcon512 = appId ? getAppIconPngUrl ( appId , 512 , themeColor ) : undefined ;
674+ const appIcon192 = appId ? getAppIconPngUrl ( appId , 192 , themeColor ) : undefined ;
675+ const appFavicon = appId ? getAppIconPngUrl ( appId , 192 ) : undefined ; // No background for favicon
676+ const manifestHref = appId ? `/api/applications/${ appId } /manifest.json` : undefined ;
677+ const appTitle = appSettingsComp ?. children ?. title ?. getView ?.( ) || application ?. name ;
678+ return [
679+ manifestHref && < link key = "app-manifest" rel = "manifest" href = { manifestHref } /> ,
680+ appFavicon && < link key = "app-favicon" rel = "icon" href = { appFavicon } /> ,
681+ appIcon512 && < link key = "apple-touch-icon" rel = "apple-touch-icon" href = { appIcon512 } /> ,
682+ appIcon512 && < link key = "apple-touch-startup-image" rel = "apple-touch-startup-image" href = { appIcon512 } /> ,
683+ appIcon512 && < meta key = "og:image" property = "og:image" content = { appIcon512 } /> ,
684+ appIcon512 && < meta key = "twitter:image" name = "twitter:image" content = { appIcon512 } /> ,
685+ < meta key = "theme-color" name = "theme-color" content = { themeColor } /> ,
686+ appTitle && < meta key = "apple-mobile-web-app-title" name = "apple-mobile-web-app-title" content = { String ( appTitle ) } /> ,
687+ ] ;
688+ } ) ( ) }
689+ { isLowCoderDomain || isLocalhost && [
690+ // Adding Support for iframely to be able to embedd apps as iframes
691+ application ?. name ? ( [
692+ < meta key = "iframely:title" property = "iframely:title" content = { application . name } /> ,
693+ < meta key = "iframely:description" property = "iframely:description" content = { application . description } /> ,
694+ ] ) : ( [
695+ < meta key = "iframely:title" property = "iframely:title" content = "Lowcoder 3" /> ,
696+ < meta key = "iframely:description" property = "iframely:description" content = "Lowcoder | rapid App & VideoMeeting builder for everyone." /> ,
697+ ] ) ,
698+ < link key = "iframely" rel = "iframely" type = "text/html" href = { window . location . href } media = "(aspect-ratio: 1280/720)" /> ,
699+ < link key = "preconnect-googleapis" rel = "preconnect" href = "https://fonts.googleapis.com" /> ,
700+ < link key = "preconnect-gstatic" rel = "preconnect" href = "https://fonts.gstatic.com" crossOrigin = "anonymous" /> ,
701+ < link key = "font-ubuntu" href = "https://fonts.googleapis.com/css2?family=Ubuntu:ital,wght@0,300;0,400;0,700;1,400& display = swap " rel = "stylesheet" /> ,
702+ // adding Clearbit Support for Analytics
703+ < script key = "hs-script-loader" async defer src = "//js-eu1.hs-scripts.com/144574215.js" type = "text/javascript" id = "hs-script-loader" > </ script >
704+ ] }
705+ </ Helmet >
706+ < Height100Div
707+ onDragEnd = { ( e ) => {
708+ // log.debug("layout: onDragEnd. Height100Div");
709+ editorState . setDragging ( false ) ;
710+ draggingUtils . clearData ( ) ;
711+ } }
712+ >
652713 { isPublicApp
653714 ? < PreviewHeader />
654715 : (
0 commit comments