@@ -55,7 +55,6 @@ import {
5555  $instances , 
5656  $pages , 
5757  $project , 
58-   $propsIndex , 
5958  $publishedOrigin , 
6059  $userPlanFeatures , 
6160}  from  "~/shared/nano-states" ; 
@@ -78,7 +77,6 @@ import { AddDomain } from "./add-domain";
7877import  {  humanizeString  }  from  "~/shared/string-utils" ; 
7978import  {  trpcClient ,  nativeClient  }  from  "~/shared/trpc/trpc-client" ; 
8079import  { 
81-   findTreeInstanceIds , 
8280  isPathnamePattern , 
8381  parseComponentName , 
8482  type  Templates , 
@@ -87,10 +85,6 @@ import { DomainCheckbox, domainToPublishName } from "./domain-checkbox";
8785import  {  CopyToClipboard  }  from  "~/builder/shared/copy-to-clipboard" ; 
8886import  {  $openProjectSettings  }  from  "~/shared/nano-states/project-settings" ; 
8987import  {  RelativeTime  }  from  "~/builder/shared/relative-time" ; 
90- import  {  showAttribute  }  from  "@webstudio-is/react-sdk" ; 
91- import  {  type  CssProperty  }  from  "@webstudio-is/css-engine" ; 
92- import  {  getComputedStyleDecl  }  from  "~/shared/style-object-model" ; 
93- import  {  $styleObjectModel  }  from  "../style-panel/shared/model" ; 
9488import  cmsUpgradeBanner  from  "../settings-panel/cms-upgrade-banner.svg?url" ; 
9589
9690type  ChangeProjectDomainProps  =  { 
@@ -243,8 +237,8 @@ const ChangeProjectDomain = ({
243237} ; 
244238
245239const  $usedProFeatures  =  computed ( 
246-   [ $pages ,  $dataSources ,  $instances ,   $propsIndex ,   $styleObjectModel ] , 
247-   ( pages ,  dataSources ,  instances ,   propsIndex ,   styleObjectModel )  =>  { 
240+   [ $pages ,  $dataSources ,  $instances ] , 
241+   ( pages ,  dataSources ,  instances )  =>  { 
248242    const  features  =  new  Map < 
249243      string , 
250244      |  undefined 
@@ -291,90 +285,9 @@ const $usedProFeatures = computed(
291285      } 
292286    } 
293287
294-     const  badgeFeature  =  'No "Built with Webstudio" badge' ; 
295-     // Badge should be rendered on free sites on every page. 
296-     features . set ( badgeFeature ,  { 
297-       info : ( 
298-         < Text > 
299-           Adding the badge to your "home" page helps us offer a free version of
300-           the service. Please open the Components panel by clicking the “+” icon
301-           on the left, and add the “Built with Webstudio” component to your
302-           page.
303-           < br  /> 
304-           - Feel free to adjust the badge's style to match your design - after
305-           all, it's just a link, and you can place it wherever you like.
306-           < br  /> 
307-           - Please don’t add that badge to every page, because search engines
308-           will view it negatively.
309-           < br  /> - Hiding the link in any way is considered a violation of the
310-           terms.
311-         </ Text > 
312-       ) , 
313-     } ) ; 
314-     // We want to check the badge only on the home page 
315-     const  homePageInstanceIds  =  findTreeInstanceIds ( 
316-       instances , 
317-       pages . homePage . rootInstanceId 
318-     ) ; 
319-     for  ( const  instanceId  of  homePageInstanceIds )  { 
320-       const  instance  =  instances . get ( instanceId ) ; 
321-       // Find a potential link that looks like a badge. 
322-       if  ( instance ?. tag  ===  "a" )  { 
323-         const  props  =  propsIndex . propsByInstanceId . get ( instance . id ) ; 
324-         let  hasWsHref  =  false ; 
325-         let  highTrust  =  true ; 
326-         let  show  =  true ; 
327- 
328-         for  ( const  prop  of  props  ??  [ ] )  { 
329-           if  ( 
330-             prop . name  ===  "href"  && 
331-             prop . type  ===  "string"  && 
332-             prop . value . includes ( "https://webstudio.is" ) 
333-           )  { 
334-             hasWsHref  =  true ; 
335-           } 
336-           if  ( prop . name  ===  "rel"  &&  prop . type  ===  "string" )  { 
337-             if  ( 
338-               prop . value . includes ( "nofollow" )  || 
339-               prop . value . includes ( "ugc" )  || 
340-               prop . value . includes ( "sponsored" ) 
341-             )  { 
342-               highTrust  =  false ; 
343-             } 
344-           } 
345-           if  ( prop . name  ===  showAttribute )  { 
346-             show  =  prop . type  ===  "boolean"  &&  prop . value ; 
347-           } 
348-         } 
349- 
350-         const  getValue  =  ( property : CssProperty )  =>  { 
351-           const  value  =  getComputedStyleDecl ( { 
352-             model : styleObjectModel , 
353-             instanceSelector : [ instance . id ] , 
354-             property, 
355-           } ) . usedValue ; 
356-           return  "value"  in  value  ? value . value  : undefined ; 
357-         } ; 
358- 
359-         // Check styles. 
360-         if  ( 
361-           getValue ( "display" )  ===  "none"  || 
362-           getValue ( "visibility" )  ===  "hidden"  || 
363-           getValue ( "opacity" )  ===  0  || 
364-           getValue ( "width" )  ===  0  || 
365-           getValue ( "height" )  ===  0 
366-         )  { 
367-           show  =  false ; 
368-         } 
369- 
370-         // @todo  check all parents 
371-         if  ( hasWsHref  &&  highTrust  &&  show )  { 
372-           features . delete ( badgeFeature ) ; 
373-           break ; 
374-         } 
375-       } 
376-     } 
377-     return  features ; 
288+     // temporary ignore features checks 
289+     // return features; 
290+     return  new  Map ( )  as  typeof  features ; 
378291  } 
379292) ; 
380293
@@ -792,7 +705,7 @@ const buttonLinkClass = css({
792705
793706const  UpgradeBanner  =  ( )  =>  { 
794707  const  usedProFeatures  =  useStore ( $usedProFeatures ) ; 
795-   const  {  canAddDomain,  maxDomainsAllowedPerUser  }  =  useCanAddDomain ( ) ; 
708+   const  {  canAddDomain }  =  useCanAddDomain ( ) ; 
796709  const  {  userPublishCount,  maxPublishesAllowedPerUser }  = 
797710    useUserPublishCount ( ) ; 
798711
@@ -875,24 +788,22 @@ const UpgradeBanner = () => {
875788  if  ( canAddDomain  ===  false )  { 
876789    return  ( 
877790      < PanelBanner > 
878-         < Text  variant = "regularBold" > Free domains limit reached</ Text > 
879791        < Text  variant = "regular" > 
880-           You have reached the limit of { maxDomainsAllowedPerUser }  custom
881-           domains on your account.{ " " } 
882792          < Text  variant = "regularBold"  inline > 
883793            Upgrade to a Pro account
884794          </ Text > { " " } 
885795          to add unlimited domains and publish to each domain individually.
886796        </ Text > 
887-         < Link 
888-           className = { buttonStyle ( {  color : "gradient"  } ) } 
889-           color = "contrast" 
890-           underline = "none" 
891-           href = "https://webstudio.is/pricing" 
892-           target = "_blank" 
893-         > 
894-           Upgrade
895-         </ Link > 
797+         < Flex  align = "center"  gap = { 1 } > 
798+           < UpgradeIcon  /> 
799+           < Link 
800+             color = "inherit" 
801+             target = "_blank" 
802+             href = "https://webstudio.is/pricing" 
803+           > 
804+             Upgrade to Pro
805+           </ Link > 
806+         </ Flex > 
896807      </ PanelBanner > 
897808    ) ; 
898809  } 
0 commit comments