@@ -64,6 +64,7 @@ import { isEqual, noop } from "lodash";
64
64
import { AppSettingContext , AppSettingType } from "@lowcoder-ee/comps/utils/appSettingContext" ;
65
65
import { getBrandingSetting } from "@lowcoder-ee/redux/selectors/enterpriseSelectors" ;
66
66
import Flex from "antd/es/flex" ;
67
+ import { getAppIconPngUrl } from "util/iconConversionUtils" ;
67
68
// import { BottomSkeleton } from "./bottom/BottomContent";
68
69
69
70
const Header = lazy (
@@ -565,6 +566,28 @@ function EditorView(props: EditorViewProps) {
565
566
if ( readOnly && hideHeader ) {
566
567
return (
567
568
< 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 >
568
591
{ uiComp . getView ( ) }
569
592
< div style = { { zIndex : Layers . hooksCompContainer } } > { hookCompViews } </ div >
570
593
</ CustomShortcutWrapper >
@@ -575,7 +598,26 @@ function EditorView(props: EditorViewProps) {
575
598
return (
576
599
< CustomShortcutWrapper >
577
600
< 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
+ } ) ( ) }
579
621
{ isLowCoderDomain || isLocalhost && [
580
622
// Adding Support for iframely to be able to embedd apps as iframes
581
623
application ?. name ? ( [
@@ -585,7 +627,7 @@ function EditorView(props: EditorViewProps) {
585
627
< meta key = "iframely:title" property = "iframely:title" content = "Lowcoder 3" /> ,
586
628
< meta key = "iframely:description" property = "iframely:description" content = "Lowcoder | rapid App & VideoMeeting builder for everyone." /> ,
587
629
] ) ,
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)" /> ,
589
631
< link key = "preconnect-googleapis" rel = "preconnect" href = "https://fonts.googleapis.com" /> ,
590
632
< link key = "preconnect-gstatic" rel = "preconnect" href = "https://fonts.gstatic.com" crossOrigin = "anonymous" /> ,
591
633
< 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) {
623
665
624
666
return (
625
667
< >
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
+ >
652
713
{ isPublicApp
653
714
? < PreviewHeader />
654
715
: (
0 commit comments