Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/application-starter/api/create-worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,7 @@ type GeneratedAddOnMetadata = Omit<
| 'partner'
| 'packageAdditions'
> &
GeneratedAddOnFields & {
packageAdditions?: GeneratedAddOnPackageAdditions
}
GeneratedAddOnFields

type GeneratedWorkerAddOnManifestModule = GeneratedWorkerManifestModule & {
addOn: GeneratedAddOnManifest
Expand Down Expand Up @@ -365,7 +363,6 @@ function getAddOnMetadata(
envVars: getAddOnEnvVars(addOn.envVars),
options: getAddOnOptions(addOn.options),
partner: getAddOnPartner(addOn.partner),
packageAdditions: getPackageAdditions(addOn.packageAdditions),
}
}

Expand Down
3 changes: 0 additions & 3 deletions src/application-starter/api/feature-artifacts.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { type AddOnCompiled } from './compile'
import { compileWithAttributionHandler, type ProjectDefinition } from './compile'
import { type FrameworkId } from './config'

Expand All @@ -8,7 +7,6 @@ export interface FeatureArtifactsRequest {
framework?: FrameworkId
tailwind?: boolean
featureOptions?: Record<string, Record<string, unknown>>
customIntegrations?: Array<AddOnCompiled>
}

export interface FeatureArtifact {
Expand Down Expand Up @@ -44,7 +42,6 @@ export async function featureArtifactsHandler(
tailwind,
features: request.features,
featureOptions: request.featureOptions ?? {},
customIntegrations: request.customIntegrations,
}

const output = await compileWithAttributionHandler(definition)
Expand Down
12 changes: 1 addition & 11 deletions src/auth/oauth.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,23 +269,13 @@ export async function exchangeGitHubCode(
code: string,
clientId: string,
clientSecret: string,
redirectUri?: string,
): Promise<GitHubTokenResult> {
const body: {
client_id: string
client_secret: string
code: string
redirect_uri?: string
} = {
const body = {
client_id: clientId,
client_secret: clientSecret,
code,
}

if (redirectUri) {
body.redirect_uri = redirectUri
}

const tokenResponse = await fetch(
'https://github.com/login/oauth/access_token',
{
Expand Down
2 changes: 1 addition & 1 deletion src/chat/components/projects/Loading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export function BuilderEditorSkeleton({
headerActions = true,
subtitle,
title,
}: BuilderEditorSkeletonProps = {}) {
}: BuilderEditorSkeletonProps) {
return (
<main
data-builder-loading="editor"
Expand Down
3 changes: 0 additions & 3 deletions src/components/ApplicationStarter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ export interface ApplicationStarterProps {
secondaryActionLabel?: string
showCliExportActions?: boolean
showPromptPreview?: boolean
suggestionContext?: ApplicationStarterContext
submitButton?: React.ReactNode
title?: React.ReactNode
tone?: StarterTone
Expand Down Expand Up @@ -161,7 +160,6 @@ export function ApplicationStarter({
secondaryActionLabel = 'Build with Netlify',
showCliExportActions = true,
showPromptPreview = true,
suggestionContext,
submitButton,
title = 'What would you like to build?',
tone = 'cyan',
Expand Down Expand Up @@ -214,7 +212,6 @@ export function ApplicationStarter({
onDirtyStateChange,
onResolvedResult,
revealOptionsImmediately,
suggestionContext,
})

const palette = toneClasses[tone]
Expand Down
7 changes: 2 additions & 5 deletions src/components/AvatarCropModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@ interface AvatarCropModalProps {
onCropComplete: (croppedBlob: Blob) => void
}

async function getCroppedImg(
imageSrc: string,
pixelCrop: Area,
outputSize: number = 256,
): Promise<Blob> {
async function getCroppedImg(imageSrc: string, pixelCrop: Area): Promise<Blob> {
const outputSize = 256
const image = new Image()
image.crossOrigin = 'anonymous'

Expand Down
39 changes: 6 additions & 33 deletions src/components/BlogCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,9 @@ export type { BlogCardPost } from '~/utils/blog-format'
type BlogCardProps = {
post: BlogCardPost
showLibraryBadges?: boolean
/** Hero treatment: side-by-side on wider screens with larger type. Used for
* the single latest post at the top of the blog index. */
featured?: boolean
}

export function BlogCard({
post,
showLibraryBadges = true,
featured = false,
}: BlogCardProps) {
export function BlogCard({ post, showLibraryBadges = true }: BlogCardProps) {
const {
slug,
title,
Expand All @@ -40,12 +33,9 @@ export function BlogCard({
const blogLibraries = showLibraryBadges ? getBlogLibraries(library) : []
const cardClassName = twMerge(
'relative flex flex-col justify-between overflow-hidden transition-all hover:shadow-sm hover:border-blue-500',
// Featured: image and copy sit side-by-side once there's room.
featured && 'md:flex-row md:justify-start',
)
const mediaClassName = twMerge(
'aspect-video w-full overflow-hidden bg-background-subtle',
featured && 'md:aspect-auto md:w-1/2',
)

const content = (
Expand All @@ -69,10 +59,10 @@ export function BlogCard({
fit: 'cover',
format: 'auto',
quality: 80,
width: featured ? 1200 : 800,
width: 800,
})}
alt=""
loading={featured ? 'eager' : 'lazy'}
loading="lazy"
decoding="async"
className="w-full h-full object-cover"
/>
Expand All @@ -84,21 +74,9 @@ export function BlogCard({
className={mediaClassName}
/>
)}
<div
className={twMerge(
'p-4 md:p-8 flex flex-col gap-4 flex-1 justify-between',
featured && 'md:w-1/2 md:justify-center md:p-10',
)}
>
<div className="p-4 md:p-8 flex flex-col gap-4 flex-1 justify-between">
<div>
<h2
className={twMerge(
'text-lg font-extrabold',
featured && 'text-2xl md:text-3xl leading-tight',
)}
>
{title}
</h2>
<h2 className="text-lg font-extrabold">{title}</h2>
<div className="text-xs italic font-light mt-1">
by {formatAuthors(authors)}
{published ? (
Expand All @@ -109,12 +87,7 @@ export function BlogCard({
) : null}
</div>
{excerpt ? (
<p
className={twMerge(
'text-sm mt-4 text-text-secondary leading-7 line-clamp-2',
featured && 'md:text-base line-clamp-3',
)}
>
<p className="text-sm mt-4 text-text-secondary leading-7 line-clamp-2">
{excerpt}
</p>
) : null}
Expand Down
15 changes: 2 additions & 13 deletions src/components/ButtonGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ type SegmentedControlProps<TValue extends string> = {
/** Labels the group for assistive tech (the control has no visible label). */
'aria-label': string
size?: SegmentSize
/** Stretch to fill the container, splitting width evenly across options. */
fullWidth?: boolean
className?: string
}

Expand All @@ -79,18 +77,13 @@ export function SegmentedControl<TValue extends string>({
onValueChange,
'aria-label': ariaLabel,
size = 'md',
fullWidth = false,
className,
}: SegmentedControlProps<TValue>) {
return (
<div
role="group"
aria-label={ariaLabel}
className={twMerge(
segmentTrackClasses(size),
fullWidth && 'flex w-full',
className,
)}
className={twMerge(segmentTrackClasses(size), className)}
>
{options.map((option) => {
const selected = value === option.value
Expand All @@ -102,11 +95,7 @@ export function SegmentedControl<TValue extends string>({
aria-label={option['aria-label']}
disabled={option.disabled}
onClick={() => onValueChange(option.value)}
className={segmentClasses(
size,
selected,
fullWidth ? 'flex-1' : undefined,
)}
className={segmentClasses(size, selected)}
>
{option.label}
</button>
Expand Down
2 changes: 1 addition & 1 deletion src/components/CopyPageDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export function CopyPageDropdown({
currentFramework,
content: rawContent,
label = 'Copy page',
}: CopyPageDropdownProps = {}) {
}: CopyPageDropdownProps) {
const [open, setOpen] = React.useState(false)
const copied = useTemporaryFlag()
const { notify } = useToast()
Expand Down
5 changes: 1 addition & 4 deletions src/components/Doc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ type DocProps = {
// Breadcrumb props (optional)
config?: ConfigSchema
breadcrumbItems?: Array<BreadcrumbItem>
// Footer content rendered after markdown
footer?: React.ReactNode
// Optional framework to use (overrides URL and local storage)
framework?: string
}
Expand All @@ -61,7 +59,6 @@ export function Doc({
pagePath,
config,
breadcrumbItems,
footer,
framework: frameworkProp,
}: DocProps) {
const { groups: startHostingPartnerGroups } = useStartHostingPartners()
Expand Down Expand Up @@ -219,7 +216,7 @@ export function Doc({
) : null}
</div>
) : null}
{footer ?? <DocNavigation />}
<DocNavigation />
<div className="h-4" />
</div>

Expand Down
45 changes: 18 additions & 27 deletions src/components/Dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@ type DropdownContentProps = {
className?: string
align?: 'start' | 'center' | 'end'
sideOffset?: number
portal?: boolean
onFocus?: React.FocusEventHandler<HTMLDivElement>
onPointerEnter?: React.PointerEventHandler<HTMLDivElement>
onPointerLeave?: React.PointerEventHandler<HTMLDivElement>
}

type DropdownItemProps = {
Expand Down Expand Up @@ -67,35 +65,28 @@ export function DropdownContent({
className,
align = 'end',
sideOffset = 6,
portal = true,
onFocus,
onPointerEnter,
onPointerLeave,
}: DropdownContentProps) {
const content = (
<DropdownMenu.Content
align={align}
sideOffset={sideOffset}
onFocus={onFocus}
onPointerEnter={onPointerEnter}
onPointerLeave={onPointerLeave}
className={twMerge(
'dropdown-content z-[1200] min-w-48 rounded-lg p-1.5',
'border border-gray-200 dark:border-gray-700',
'bg-white dark:bg-gray-800',
'shadow-lg',
className,
)}
>
{children}
</DropdownMenu.Content>
return (
<DropdownMenu.Portal>
<DropdownMenu.Content
align={align}
sideOffset={sideOffset}
onFocus={onFocus}
onPointerEnter={onPointerEnter}
className={twMerge(
'dropdown-content z-[1200] min-w-48 rounded-lg p-1.5',
'border border-gray-200 dark:border-gray-700',
'bg-white dark:bg-gray-800',
'shadow-lg',
className,
)}
>
{children}
</DropdownMenu.Content>
</DropdownMenu.Portal>
)

if (!portal) {
return content
}

return <DropdownMenu.Portal>{content}</DropdownMenu.Portal>
}

export function DropdownItem({
Expand Down
Loading
Loading