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
experimental: marketplace improvements (#2964)
Oleg Isonenb22e58dcdbe2
diff --git a/apps/builder/app/builder/features/sidebar-left/panels/marketplace/about.tsx b/apps/builder/app/builder/features/sidebar-left/panels/marketplace/about.tsxindex c87dcf68a8..a479c95f1b 100644--- a/apps/builder/app/builder/features/sidebar-left/panels/marketplace/about.tsx+++ b/apps/builder/app/builder/features/sidebar-left/panels/marketplace/about.tsx@@ -41,13 +41,11 @@ export const About = ({<Flexdirection="column"css={{ my: theme.spacing[5], mx: theme.spacing[8] }}- gap="2"+ gap="3"><Text>{item.description}</Text>- <Flex direction="column">- <Flex gap="1">- <Text>Author: {item.author}</Text>- </Flex>+ <Flex direction="column" gap="1">+ <Text>Author: {item.author}</Text>{item.website && (<Flex gap="1"><Text>Website:</Text>diff --git a/apps/builder/app/builder/features/sidebar-left/panels/marketplace/overview.tsx b/apps/builder/app/builder/features/sidebar-left/panels/marketplace/overview.tsxindex 713113fe84..d0ddf6f510 100644--- a/apps/builder/app/builder/features/sidebar-left/panels/marketplace/overview.tsx+++ b/apps/builder/app/builder/features/sidebar-left/panels/marketplace/overview.tsx@@ -29,21 +29,21 @@ const getItemsByCategory = (items: Array<MarketplaceOverviewItem> = []) => {Array<MarketplaceOverviewItem>>();- for (const OverviewItem of items) {+ for (const item of items) {if (- categories.some(- (category) => category.category === OverviewItem.category- ) === false+ categories.some((category) => category.category === item.category) ===+ false) {- throw new Error(`Unknown category: ${OverviewItem.category}`);+ throw new Error(`Unknown category: ${item.category}`);}- let categoryItems = itemsByCategory.get(OverviewItem.category);+ let categoryItems = itemsByCategory.get(item.category);if (categoryItems === undefined) {categoryItems = [];- itemsByCategory.set(OverviewItem.category, categoryItems);+ itemsByCategory.set(item.category, categoryItems);}- categoryItems.push(OverviewItem);+ categoryItems.push(item);}+return itemsByCategory;};diff --git a/apps/builder/app/builder/features/sidebar-left/panels/marketplace/section-templates.tsx b/apps/builder/app/builder/features/sidebar-left/panels/marketplace/section-templates.tsxindex a7ae779759..af32c33ac9 100644--- a/apps/builder/app/builder/features/sidebar-left/panels/marketplace/section-templates.tsx+++ b/apps/builder/app/builder/features/sidebar-left/panels/marketplace/section-templates.tsx@@ -195,35 +195,37 @@ export const SectionTemplates = ({</Flex><Separator /><ScrollArea>- {Array.from(templatesDataByCategory.keys()).map((category) => {- return (- <CollapsibleSection label={category} key={category} fullWidth>- <List asChild>- <Flex direction="column">- {templatesDataByCategory- .get(category)- ?.map((templateData, index) => {- return (- <ListItem- asChild- key={templateData.rootInstanceId}- index={index}- onSelect={() => {- insert({- instanceId: templateData.rootInstanceId,- data,- });- }}- >- <SectionTemplate data={templateData} />- </ListItem>- );- })}- </Flex>- </List>- </CollapsibleSection>- );- })}+ {Array.from(templatesDataByCategory.keys())+ .sort()+ .map((category) => {+ return (+ <CollapsibleSection label={category} key={category} fullWidth>+ <List asChild>+ <Flex direction="column">+ {templatesDataByCategory+ .get(category)+ ?.map((templateData, index) => {+ return (+ <ListItem+ asChild+ key={templateData.rootInstanceId}+ index={index}+ onSelect={() => {+ insert({+ instanceId: templateData.rootInstanceId,+ data,+ });+ }}+ >+ <SectionTemplate data={templateData} />+ </ListItem>+ );+ })}+ </Flex>+ </List>+ </CollapsibleSection>+ );+ })}</ScrollArea></Flex>);diff --git a/packages/asset-uploader/src/db/load.ts b/packages/asset-uploader/src/db/load.tsindex ace3b20474..70ebe9913f 100644--- a/packages/asset-uploader/src/db/load.ts+++ b/packages/asset-uploader/src/db/load.ts@@ -9,12 +9,15 @@ import { formatAsset } from "../utils/format-asset";export const loadAssetsByProject = async (projectId: Project["id"],- context: AppContext+ context: AppContext,+ { skipPermissionsCheck = false }: { skipPermissionsCheck?: boolean } = {}): Promise<Asset[]> => {- const canRead = await authorizeProject.hasProjectPermit(- { projectId, permit: "view" },- context- );+ const canRead =+ skipPermissionsCheck ||+ (await authorizeProject.hasProjectPermit(+ { projectId, permit: "view" },+ context+ ));if (canRead === false) {throw new AuthorizationError(