Vendor opencode source for docker build
This commit is contained in:
72
opencode/packages/console/mail/emails/components.tsx
Normal file
72
opencode/packages/console/mail/emails/components.tsx
Normal file
@@ -0,0 +1,72 @@
|
||||
// @ts-nocheck
|
||||
import React from "react"
|
||||
import { Font, Text as JEText, type TextProps } from "@jsx-email/all"
|
||||
import { baseText } from "./styles"
|
||||
|
||||
export function Text(props: TextProps) {
|
||||
return <JEText {...props} style={{ ...baseText, ...props.style }} />
|
||||
}
|
||||
|
||||
export function Title({ children }: TitleProps) {
|
||||
return React.createElement("title", null, children)
|
||||
}
|
||||
|
||||
export function A({ children, ...props }: AProps) {
|
||||
return React.createElement("a", props, children)
|
||||
}
|
||||
|
||||
export function Span({ children, ...props }: SpanProps) {
|
||||
return React.createElement("span", props, children)
|
||||
}
|
||||
|
||||
export function Wbr({ children, ...props }: WbrProps) {
|
||||
return React.createElement("wbr", props, children)
|
||||
}
|
||||
|
||||
export function Fonts({ assetsUrl }: { assetsUrl: string }) {
|
||||
return (
|
||||
<>
|
||||
<Font
|
||||
fontFamily="JetBrains Mono"
|
||||
fallbackFontFamily="monospace"
|
||||
webFont={{
|
||||
url: `${assetsUrl}/JetBrainsMono-Regular.woff2`,
|
||||
format: "woff2",
|
||||
}}
|
||||
fontWeight="400"
|
||||
fontStyle="normal"
|
||||
/>
|
||||
<Font
|
||||
fontFamily="JetBrains Mono"
|
||||
fallbackFontFamily="monospace"
|
||||
webFont={{
|
||||
url: `${assetsUrl}/JetBrainsMono-Medium.woff2`,
|
||||
format: "woff2",
|
||||
}}
|
||||
fontWeight="500"
|
||||
fontStyle="normal"
|
||||
/>
|
||||
<Font
|
||||
fontFamily="Rubik"
|
||||
fallbackFontFamily={["Helvetica", "Arial", "sans-serif"]}
|
||||
webFont={{
|
||||
url: `${assetsUrl}/rubik-latin.woff2`,
|
||||
format: "woff2",
|
||||
}}
|
||||
fontWeight="400 500 600 700"
|
||||
fontStyle="normal"
|
||||
/>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export function SplitString({ text, split }: { text: string; split: number }) {
|
||||
const segments: JSX.Element[] = []
|
||||
for (let i = 0; i < text.length; i += split) {
|
||||
segments.push(<>{text.slice(i, i + split)}</>)
|
||||
if (i + split < text.length) {
|
||||
segments.push(<Wbr key={`${i}wbr`} />)
|
||||
}
|
||||
}
|
||||
return <>{segments}</>
|
||||
}
|
||||
91
opencode/packages/console/mail/emails/styles.ts
Normal file
91
opencode/packages/console/mail/emails/styles.ts
Normal file
@@ -0,0 +1,91 @@
|
||||
// @ts-nocheck
|
||||
export const unit = 12
|
||||
export const PRIMARY_COLOR = "#211E1E"
|
||||
export const TEXT_COLOR = "#656363"
|
||||
export const LINK_COLOR = "#007AFF"
|
||||
export const LINK_BACKGROUND_COLOR = "#F9F8F8"
|
||||
export const BACKGROUND_COLOR = "#F0F0F1"
|
||||
export const SURFACE_DIVIDER_COLOR = "#D5D5D9"
|
||||
|
||||
export const body = {
|
||||
background: BACKGROUND_COLOR,
|
||||
}
|
||||
|
||||
export const container = {
|
||||
minWidth: "600px",
|
||||
padding: "64px 0px",
|
||||
}
|
||||
|
||||
export const frame = {
|
||||
padding: `${unit * 2}px`,
|
||||
border: `1px solid ${SURFACE_DIVIDER_COLOR}`,
|
||||
background: "#FFF",
|
||||
borderRadius: "6px",
|
||||
boxShadow: `0 1px 2px rgba(0,0,0,0.03),
|
||||
0 2px 4px rgba(0,0,0,0.03),
|
||||
0 2px 6px rgba(0,0,0,0.03)`,
|
||||
}
|
||||
|
||||
export const baseText = {
|
||||
fontFamily: "JetBrains Mono, monospace",
|
||||
}
|
||||
|
||||
export const headingText = {
|
||||
color: PRIMARY_COLOR,
|
||||
fontSize: "16px",
|
||||
fontStyle: "normal",
|
||||
fontWeight: 500,
|
||||
lineHeight: "normal",
|
||||
}
|
||||
|
||||
export const contentText = {
|
||||
color: TEXT_COLOR,
|
||||
fontSize: "14px",
|
||||
fontStyle: "normal",
|
||||
fontWeight: 400,
|
||||
lineHeight: "180%",
|
||||
}
|
||||
|
||||
export const buttonText = {
|
||||
color: "#FDFCFC",
|
||||
fontSize: "16px",
|
||||
fontWeight: 500,
|
||||
margin: 0,
|
||||
padding: 0,
|
||||
display: "inline-flex",
|
||||
alignItems: "center",
|
||||
gap: "12px",
|
||||
}
|
||||
|
||||
export const linkText = {
|
||||
color: LINK_COLOR,
|
||||
fontSize: "14px",
|
||||
fontStyle: "normal",
|
||||
fontWeight: 400,
|
||||
lineHeight: "150%",
|
||||
textDecorationLine: "underline",
|
||||
textDecorationStyle: "solid" as const,
|
||||
textDecorationSkipInk: "auto" as const,
|
||||
textDecorationThickness: "auto",
|
||||
textUnderlineOffset: "auto",
|
||||
textUnderlinePosition: "from-font",
|
||||
borderRadius: "4px",
|
||||
background: LINK_BACKGROUND_COLOR,
|
||||
padding: "8px 12px",
|
||||
textAlign: "center" as const,
|
||||
}
|
||||
|
||||
export const contentHighlightText = {
|
||||
color: PRIMARY_COLOR,
|
||||
}
|
||||
|
||||
export const button = {
|
||||
display: "inline-grid",
|
||||
padding: "8px 12px 8px 20px",
|
||||
justifyContent: "center",
|
||||
alignItems: "center",
|
||||
gap: "8px",
|
||||
flexShrink: "0",
|
||||
borderRadius: "4px",
|
||||
backgroundColor: PRIMARY_COLOR,
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
// @ts-nocheck
|
||||
import React from "react"
|
||||
import { Img, Row, Html, Link, Body, Head, Button, Column, Preview, Section, Container } from "@jsx-email/all"
|
||||
import { Text, Fonts, Title, A, Span } from "../components"
|
||||
import {
|
||||
unit,
|
||||
body,
|
||||
frame,
|
||||
headingText,
|
||||
container,
|
||||
contentText,
|
||||
button,
|
||||
contentHighlightText,
|
||||
linkText,
|
||||
buttonText,
|
||||
} from "../styles"
|
||||
|
||||
const CONSOLE_URL = "https://opencode.ai/"
|
||||
|
||||
interface InviteEmailProps {
|
||||
inviter: string
|
||||
workspaceID: string
|
||||
workspaceName: string
|
||||
assetsUrl: string
|
||||
}
|
||||
export const InviteEmail = ({
|
||||
inviter = "test@anoma.ly",
|
||||
workspaceID = "wrk_01K6XFY7V53T8XN0A7X8G9BTN3",
|
||||
workspaceName = "anomaly",
|
||||
assetsUrl = `${CONSOLE_URL}email`,
|
||||
}: InviteEmailProps) => {
|
||||
const messagePlain = `${inviter} invited you to join the ${workspaceName} workspace.`
|
||||
const url = `${CONSOLE_URL}workspace/${workspaceID}`
|
||||
return (
|
||||
<Html lang="en">
|
||||
<Head>
|
||||
<Title>{`OpenCode — ${messagePlain}`}</Title>
|
||||
</Head>
|
||||
<Fonts assetsUrl={assetsUrl} />
|
||||
<Preview>{messagePlain}</Preview>
|
||||
<Body style={body} id={Math.random().toString()}>
|
||||
<Container style={container}>
|
||||
<Section style={frame}>
|
||||
<Row>
|
||||
<Column>
|
||||
<A href={`${CONSOLE_URL}zen`}>
|
||||
<Img height="32" alt="OpenCode Logo" src={`${assetsUrl}/logo.png`} />
|
||||
</A>
|
||||
</Column>
|
||||
</Row>
|
||||
|
||||
<Section style={{ padding: `${unit * 2}px 0 0 0` }}>
|
||||
<Text style={headingText}>Join your team's OpenCode workspace</Text>
|
||||
<Text style={contentText}>
|
||||
You have been invited by <Span style={contentHighlightText}>{inviter}</Span> to join the{" "}
|
||||
<Span style={contentHighlightText}>{workspaceName}</Span> workspace on OpenCode.
|
||||
</Text>
|
||||
</Section>
|
||||
|
||||
<Section style={{ padding: `${unit}px 0 0 0` }}>
|
||||
<Button style={button} href={url}>
|
||||
<Text style={buttonText}>
|
||||
Join workspace
|
||||
<Img width="24" height="24" src={`${assetsUrl}/right-arrow.png`} alt="Arrow right" />
|
||||
</Text>
|
||||
</Button>
|
||||
</Section>
|
||||
|
||||
<Section style={{ padding: `${unit}px 0 0 0` }}>
|
||||
<Text style={contentText}>Button not working? Copy the following link...</Text>
|
||||
<Link href={url}>
|
||||
<Text style={linkText}>{url}</Text>
|
||||
</Link>
|
||||
</Section>
|
||||
</Section>
|
||||
</Container>
|
||||
</Body>
|
||||
</Html>
|
||||
)
|
||||
}
|
||||
|
||||
export default InviteEmail
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
opencode/packages/console/mail/emails/templates/static/logo.png
Normal file
BIN
opencode/packages/console/mail/emails/templates/static/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 308 B |
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 8.1 KiB |
22
opencode/packages/console/mail/package.json
Normal file
22
opencode/packages/console/mail/package.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"name": "@opencode-ai/console-mail",
|
||||
"version": "1.1.53",
|
||||
"dependencies": {
|
||||
"@jsx-email/all": "2.2.3",
|
||||
"@jsx-email/cli": "1.4.3",
|
||||
"@tsconfig/bun": "1.0.9",
|
||||
"@types/react": "18.0.25",
|
||||
"react": "18.2.0",
|
||||
"solid-js": "catalog:"
|
||||
},
|
||||
"exports": {
|
||||
"./*": "./emails/templates/*"
|
||||
},
|
||||
"$schema": "https://json.schemastore.org/package.json",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "email preview emails/templates"
|
||||
},
|
||||
"type": "module",
|
||||
"license": "MIT"
|
||||
}
|
||||
9
opencode/packages/console/mail/sst-env.d.ts
vendored
Normal file
9
opencode/packages/console/mail/sst-env.d.ts
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
/* This file is auto-generated by SST. Do not edit. */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/* deno-fmt-ignore-file */
|
||||
|
||||
/// <reference path="../../../sst-env.d.ts" />
|
||||
|
||||
import "sst"
|
||||
export {}
|
||||
Reference in New Issue
Block a user