Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.
TypeScript accessibilityalternativecloudflarecloudflare-workersdesignfreefrontendopen-sourceradix-uireactremixweb-developmentwebflowwebsite-builderwebsite-developmentwebsiteswebstudio
chore: Disable marketplace resource (#3799)
Oleg Isonen1f435cc7f989
diff --git a/apps/builder/app/builder/features/settings-panel/cms-upgrade-banner.svg b/apps/builder/app/builder/features/settings-panel/cms-upgrade-banner.svgnew file mode 100644index 0000000000..d53790fda9--- /dev/null+++ b/apps/builder/app/builder/features/settings-panel/cms-upgrade-banner.svg@@ -0,0 +1,270 @@+<svg+ width="1271"+ height="310"+ viewBox="0 0 1271 310"+ fill="none"+ xmlns="http://www.w3.org/2000/svg"+>+ <g clip-path="url(#clip0_4187_3687)">+ <mask+ id="mask0_4187_3687"+ style="mask-type: alpha"+ maskUnits="userSpaceOnUse"+ x="0"+ y="0"+ width="1271"+ height="310"+ >+ <rect width="1271" height="310" fill="url(#paint0_linear_4187_3687)" />+ </mask>+ <g mask="url(#mask0_4187_3687)">+ <rect+ x="2.5"+ y="2.5"+ width="305.007"+ height="305"+ rx="152.5"+ fill="#F8F8F8"+ />+ <rect+ x="2.5"+ y="2.5"+ width="305.007"+ height="305"+ rx="152.5"+ stroke="#F8F8F8"+ stroke-width="5"+ />+ <path+ d="M69.2148 154.997C69.2148 188.953 88.9483 218.297 117.563 232.203L76.642 120.084C71.8821 130.753 69.2148 142.56 69.2148 154.997Z"+ fill="#21759B"+ />+ <path+ d="M212.913 150.669C212.913 140.067 209.105 132.725 205.838 127.01C201.49 119.943 197.414 113.959 197.414 106.893C197.414 99.0068 203.395 91.6661 211.819 91.6661C212.2 91.6661 212.56 91.7135 212.931 91.7347C197.668 77.752 177.334 69.2148 155.001 69.2148C125.031 69.2148 98.6634 84.5915 83.3242 107.882C85.3369 107.942 87.2337 107.985 88.8448 107.985C97.8178 107.985 111.707 106.896 111.707 106.896C116.332 106.623 116.877 113.416 112.258 113.962C112.258 113.962 107.61 114.509 102.439 114.78L133.679 207.701L152.452 151.397L139.087 114.777C134.467 114.506 130.091 113.959 130.091 113.959C125.468 113.688 126.01 106.62 130.633 106.893C130.633 106.893 144.8 107.981 153.229 107.981C162.201 107.981 176.092 106.893 176.092 106.893C180.72 106.62 181.263 113.412 176.642 113.959C176.642 113.959 171.985 114.506 166.824 114.777L197.825 206.995L206.382 178.401C210.091 166.535 212.913 158.013 212.913 150.669Z"+ fill="#21759B"+ />+ <path+ d="M156.504 162.502L130.766 237.294C138.451 239.554 146.578 240.789 154.999 240.789C164.989 240.789 174.57 239.062 183.487 235.927C183.257 235.559 183.048 235.169 182.877 234.745L156.504 162.502Z"+ fill="#21759B"+ />+ <path+ d="M230.274 113.84C230.643 116.572 230.852 119.506 230.852 122.661C230.852 131.366 229.226 141.152 224.329 153.388L198.125 229.15C223.629 214.278 240.783 186.647 240.783 154.999C240.785 140.085 236.975 126.06 230.274 113.84Z"+ fill="#21759B"+ />+ <path+ d="M155.001 55C99.8618 55 55 99.8585 55 154.998C55 210.143 99.8618 255 155.001 255C210.138 255 255.007 210.143 255.007 154.998C255.005 99.8585 210.138 55 155.001 55ZM155.001 250.416C102.39 250.416 59.5853 207.611 59.5853 154.998C59.5853 102.387 102.389 59.5853 155.001 59.5853C207.61 59.5853 250.411 102.387 250.411 154.998C250.411 207.611 207.61 250.416 155.001 250.416Z"+ fill="#21759B"+ />+ <rect+ x="242.508"+ y="2.5"+ width="313.09"+ height="305"+ rx="152.5"+ fill="#F8F8F8"+ />+ <rect+ x="242.508"+ y="2.5"+ width="313.09"+ height="305"+ rx="152.5"+ stroke="#E0F0FF"+ stroke-width="5"+ />+ <g clip-path="url(#clip1_4187_3687)">+ <path+ d="M387.93 58.1784L310.384 94.812C306.073 96.8509 306.116 103.844 310.457 105.808L388.326 141.064C395.168 144.162 402.787 144.162 409.629 141.064L487.499 105.808C491.838 103.844 491.883 96.8509 487.57 94.8133L410.026 58.1784C402.952 54.8364 395.005 54.8364 387.93 58.1784Z"+ fill="#FCB400"+ />+ <path+ d="M405.883 160.316V248.392C405.883 252.58 409.583 255.45 412.993 253.906L499.763 215.452C500.731 215.014 501.561 214.254 502.146 213.271C502.731 212.288 503.043 211.127 503.043 209.938V121.863C503.043 117.674 499.344 114.805 495.933 116.349L409.163 154.803C408.195 155.241 407.365 156.001 406.78 156.984C406.196 157.967 405.883 159.127 405.883 160.316Z"+ fill="#18BFFF"+ />+ <path+ d="M385.625 164.861L359.873 179.057L357.258 180.5L302.899 210.238C299.454 212.136 295.055 209.269 295.055 204.899V122.233C295.055 120.652 295.765 119.286 296.717 118.26C297.107 117.815 297.551 117.436 298.034 117.132C299.332 116.242 301.185 116.005 302.76 116.716L385.192 154.007C389.382 155.905 389.711 162.607 385.625 164.861Z"+ fill="#F82B60"+ />+ <path+ d="M385.626 164.861L359.875 179.057L296.719 118.258C297.109 117.814 297.553 117.435 298.035 117.132C299.333 116.242 301.186 116.005 302.762 116.716L385.194 154.007C389.384 155.905 389.713 162.607 385.626 164.861Z"+ fill="black"+ fill-opacity="0.25"+ />+ </g>+ <rect+ x="490.594"+ y="2.5"+ width="305.007"+ height="305"+ rx="152.5"+ fill="#F8F8F8"+ />+ <rect+ x="490.594"+ y="2.5"+ width="305.007"+ height="305"+ rx="152.5"+ stroke="#E0F0FF"+ stroke-width="5"+ />+ <g clip-path="url(#clip2_4187_3687)">+ <path+ d="M548.094 125.56C548.094 94.1834 548.094 78.495 557.74 68.7475C567.386 59 582.912 59 613.963 59H672.231C703.282 59 718.807 59 728.454 68.7475C738.1 78.495 738.1 94.1834 738.1 125.56V184.44C738.1 215.817 738.1 231.505 728.454 241.252C718.807 251 703.282 251 672.231 251H613.963C582.912 251 567.386 251 557.74 241.252C548.094 231.505 548.094 215.817 548.094 184.44V125.56Z"+ fill="#4945FF"+ />+ <path+ fill-rule="evenodd"+ clip-rule="evenodd"+ d="M679.195 117.24H615.227V150.2H647.844V183.16H680.462V118.52C680.462 117.813 679.895 117.24 679.195 117.24Z"+ fill="white"+ />+ <path+ d="M647.845 150.199H646.578V151.479H647.845V150.199Z"+ fill="white"+ />+ <path+ d="M615.227 150.199H646.578C647.277 150.199 647.844 150.772 647.844 151.479V183.159H616.493C615.794 183.159 615.227 182.586 615.227 181.879V150.199Z"+ fill="#9593FF"+ />+ <path+ d="M647.844 183.16H680.461L648.925 215.028C648.526 215.431 647.844 215.145 647.844 214.575V183.16Z"+ fill="#9593FF"+ />+ <path+ d="M615.231 150.2H584.142C583.578 150.2 583.296 149.511 583.695 149.108L615.231 117.24V150.2Z"+ fill="#9593FF"+ />+ </g>+ <rect+ x="732.602"+ y="4.5"+ width="293.92"+ height="301"+ rx="146.96"+ fill="#F8F8F8"+ />+ <rect+ x="732.602"+ y="4.5"+ width="293.92"+ height="301"+ rx="146.96"+ stroke="#E0F0FF"+ />+ <g clip-path="url(#clip3_4187_3687)">+ <path+ d="M895.861 250.194C890.8 256.567 880.538 253.075 880.416 244.937L878.633 125.908H958.668C973.164 125.908 981.249 142.652 972.235 154.005L895.861 250.194Z"+ fill="url(#paint1_linear_4187_3687)"+ />+ <path+ d="M895.861 250.194C890.8 256.567 880.538 253.075 880.416 244.937L878.633 125.908H958.668C973.164 125.908 981.249 142.652 972.235 154.005L895.861 250.194Z"+ fill="url(#paint2_linear_4187_3687)"+ fill-opacity="0.2"+ />+ <path+ d="M863.312 58.6648C868.373 52.2907 878.635 55.7832 878.757 63.9214L879.538 182.95H800.505C786.008 182.95 777.923 166.207 786.938 154.853L863.312 58.6648Z"+ fill="#3ECF8E"+ />+ </g>+ <rect+ x="963.523"+ y="2.5"+ width="305.007"+ height="305"+ rx="152.5"+ fill="#F8F8F8"+ />+ <rect+ x="963.523"+ y="2.5"+ width="305.007"+ height="305"+ rx="152.5"+ stroke="#E0F0FF"+ stroke-width="5"+ />+ <g clip-path="url(#clip4_4187_3687)">+ <path+ d="M1032.52 63.6104L1142.96 55.4537C1156.53 54.2895 1160.02 55.0746 1168.55 61.2753L1203.8 86.1126C1209.62 90.3835 1211.55 91.5485 1211.55 96.1992V232.413C1211.55 240.95 1208.45 245.999 1197.6 246.772L1069.34 254.536C1061.2 254.922 1057.32 253.757 1053.06 248.322L1027.09 214.563C1022.44 208.348 1020.51 203.697 1020.51 198.261V77.1835C1020.51 70.2044 1023.61 64.3828 1032.52 63.6104Z"+ fill="white"+ />+ <path+ d="M1142.96 55.4537L1032.52 63.6104C1023.61 64.3828 1020.51 70.2044 1020.51 77.1835V198.262C1020.51 203.698 1022.44 208.348 1027.09 214.563L1053.06 248.322C1057.32 253.757 1061.2 254.922 1069.34 254.536L1197.6 246.772C1208.45 245.999 1211.55 240.95 1211.55 232.413V96.1992C1211.55 91.788 1209.81 90.5171 1204.68 86.7514L1203.8 86.1126L1168.55 61.2753C1160.02 55.0746 1156.53 54.2895 1142.96 55.4537ZM1072.24 93.9701C1061.77 94.6753 1059.4 94.835 1053.45 89.9977L1038.33 77.9686C1036.79 76.4119 1037.56 74.4686 1041.43 74.0828L1147.61 66.3253C1156.52 65.547 1161.17 68.6537 1164.65 71.3686L1182.86 84.5626C1183.64 84.9544 1185.58 87.2768 1183.25 87.2768L1073.6 93.8768L1072.24 93.9701ZM1060.04 231.249V115.613C1060.04 110.563 1061.59 108.235 1066.23 107.842L1192.16 100.47C1196.44 100.084 1198.37 102.798 1198.37 107.842V222.706C1198.37 227.756 1197.59 232.027 1190.61 232.413L1070.1 239.399C1063.13 239.785 1060.04 237.463 1060.04 231.249ZM1179 121.813C1179.77 125.307 1179 128.8 1175.5 129.199L1169.7 130.35V215.726C1164.65 218.44 1160.01 219.991 1156.13 219.991C1149.93 219.991 1148.38 218.048 1143.73 212.233L1105.75 152.472V210.29L1117.77 213.011C1117.77 213.011 1117.77 219.998 1108.07 219.998L1081.35 221.548C1080.57 219.991 1081.35 216.112 1084.05 215.34L1091.03 213.404V136.957L1081.35 136.172C1080.57 132.68 1082.5 127.636 1087.93 127.243L1116.61 125.314L1156.13 185.846V132.294L1146.06 131.136C1145.28 126.857 1148.38 123.751 1152.25 123.372L1179 121.814L1179 121.813Z"+ fill="black"+ />+ </g>+ </g>+ </g>+ <defs>+ <linearGradient+ id="paint0_linear_4187_3687"+ x1="0"+ y1="155"+ x2="1271"+ y2="155"+ gradientUnits="userSpaceOnUse"+ >+ <stop offset="0.105" stop-color="white" />+ <stop offset="0.83" stop-color="white" stop-opacity="0.8" />+ <stop offset="0.96" stop-color="white" stop-opacity="0" />+ </linearGradient>+ <linearGradient+ id="paint1_linear_4187_3687"+ x1="878.633"+ y1="152.3"+ x2="949.765"+ y2="182.133"+ gradientUnits="userSpaceOnUse"+ >+ <stop stop-color="#249361" />+ <stop offset="1" stop-color="#3ECF8E" />+ </linearGradient>+ <linearGradient+ id="paint2_linear_4187_3687"+ x1="847.097"+ y1="109.121"+ x2="879.537"+ y2="170.188"+ gradientUnits="userSpaceOnUse"+ >+ <stop />+ <stop offset="1" stop-opacity="0" />+ </linearGradient>+ <clipPath id="clip0_4187_3687">+ <rect width="1271" height="310" fill="white" />+ </clipPath>+ <clipPath id="clip1_4187_3687">+ <rect+ width="208.09"+ height="200"+ fill="white"+ transform="translate(295.008 55)"+ />+ </clipPath>+ <clipPath id="clip2_4187_3687">+ <rect+ width="190.006"+ height="192"+ fill="white"+ transform="translate(548.094 59)"+ />+ </clipPath>+ <clipPath id="clip3_4187_3687">+ <rect+ width="192.92"+ height="200"+ fill="white"+ transform="translate(783.102 55)"+ />+ </clipPath>+ <clipPath id="clip4_4187_3687">+ <rect+ width="191.045"+ height="200"+ fill="white"+ transform="translate(1020.51 55)"+ />+ </clipPath>+ </defs>+</svg>diff --git a/apps/builder/app/builder/features/settings-panel/settings-panel.tsx b/apps/builder/app/builder/features/settings-panel/settings-panel.tsxindex 0ba8fd7ca1..ab75ecb8cc 100644--- a/apps/builder/app/builder/features/settings-panel/settings-panel.tsx+++ b/apps/builder/app/builder/features/settings-panel/settings-panel.tsx@@ -2,17 +2,54 @@ import type { Instance } from "@webstudio-is/sdk";import { SettingsSection } from "./settings-section";import { PropsSectionContainer } from "./props-section/props-section";import { VariablesSection } from "./variables-section";+import {+ Flex,+ Link,+ PanelBanner,+ Text,+ rawTheme,+} from "@webstudio-is/design-system";+import { UploadIcon } from "@webstudio-is/icons";+import { useStore } from "@nanostores/react";+import { $userPlanFeatures } from "~/builder/shared/nano-states";+import cmsUpgradeBanner from "./cms-upgrade-banner.svg?url";export const SettingsPanelContainer = ({selectedInstance,}: {selectedInstance: Instance;}) => {+ const { allowDynamicData } = useStore($userPlanFeatures);return (<><SettingsSection /><PropsSectionContainer selectedInstance={selectedInstance} /><VariablesSection />+ {allowDynamicData === false && (+ <PanelBanner>+ <img+ src={cmsUpgradeBanner}+ alt="Upgrade for CMS"+ width={rawTheme.spacing[28]}+ style={{ aspectRatio: "4.1" }}+ />+ <Text variant="regularBold">Upgrade for CMS</Text>+ <Text>+ Integrate content from other tools to create blogs, directories, and+ any other structured content.+ </Text>+ <Flex align="center" gap={1}>+ <UploadIcon />+ <Link+ color="inherit"+ target="_blank"+ href="https://webstudio.is/pricing"+ >+ Upgrade to Pro+ </Link>+ </Flex>+ </PanelBanner>+ )}</>);};diff --git a/apps/builder/app/builder/features/settings-panel/variable-popover.tsx b/apps/builder/app/builder/features/settings-panel/variable-popover.tsxindex 59fbba49b3..614665dabf 100644--- a/apps/builder/app/builder/features/settings-panel/variable-popover.tsx+++ b/apps/builder/app/builder/features/settings-panel/variable-popover.tsx@@ -15,7 +15,7 @@ import {useEffect,} from "react";import { mergeRefs } from "@react-aria/utils";-import { CopyIcon, RefreshIcon } from "@webstudio-is/icons";+import { CopyIcon, RefreshIcon, UploadIcon } from "@webstudio-is/icons";import {Box,Button,@@ -28,10 +28,13 @@ import {InputErrorsTooltip,InputField,Label,+ Link,+ PanelBanner,ProBadge,ScrollArea,Select,Switch,+ Text,TextArea,Tooltip,theme,@@ -148,7 +151,6 @@ const TypeField = ({},{value: "resource",- disabled: allowDynamicData === false,label: (<Flex direction="row" gap="2" align="center">Resource@@ -160,7 +162,6 @@ const TypeField = ({},{value: "graphql-resource",- disabled: allowDynamicData === false,label: (<Flex direction="row" gap="2" align="center">GraphQL@@ -172,7 +173,6 @@ const TypeField = ({},{value: "system-resource",- disabled: allowDynamicData === false,label: (<Flex direction="row" gap="2" align="center">System Resource@@ -199,6 +199,7 @@ const TypeField = ({</Box>)}value={value}+ name="type"onChange={onChange}/></Grid>@@ -634,6 +635,9 @@ export const VariablePopoverTrigger = forwardRef<const panelRef = useRef<undefined | PanelApi>();const formRef = useRef<HTMLFormElement>(null);const resources = useStore($resources);+ const { allowDynamicData } = useStore($userPlanFeatures);+ const [isResource, setIsResource] = useState(variable?.type === "resource");+ const requiresUpgrade = allowDynamicData === false && isResource;return (<FloatingPanelPopover@@ -676,18 +680,41 @@ export const VariablePopoverTrigger = forwardRef<css={{overflow: "hidden",gap: theme.spacing[9],- pt: theme.spacing[5],- px: theme.spacing[9],- pb: theme.spacing[9],+ p: theme.spacing[9],}}>+ {requiresUpgrade && (+ <PanelBanner>+ <Text>Resource fetching is part of the CMS functionality.</Text>+ <Flex align="center" gap={1}>+ <UploadIcon />+ <Link+ color="inherit"+ target="_blank"+ href="https://webstudio.is/pricing"+ >+ Upgrade to Pro+ </Link>+ </Flex>+ </PanelBanner>+ )}<formref={formRef}noValidate={true}// exclude from the flowstyle={{ display: "contents" }}+ onChange={(event) => {+ const { name, value } = event.target as HTMLSelectElement;+ // When type is changing, we need to show the upgrade banner.+ if (name === "type") {+ setIsResource(value.includes("resource"));+ }+ }}onSubmit={(event) => {event.preventDefault();+ if (requiresUpgrade) {+ return;+ }if (event.currentTarget.checkValidity()) {const formData = new FormData(event.currentTarget);panelRef.current?.save(formData);