kopia lustrzana https://github.com/cloudflare/wildebeest
				
				
				
			
						commit
						9cc290ecc7
					
				| 
						 | 
					@ -13,8 +13,8 @@
 | 
				
			||||||
		"watch": "concurrently \"vite build -w\" \"vite build -w -c adaptors/cloudflare-pages/vite.config.ts\""
 | 
							"watch": "concurrently \"vite build -w\" \"vite build -w -c adaptors/cloudflare-pages/vite.config.ts\""
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	"devDependencies": {
 | 
						"devDependencies": {
 | 
				
			||||||
		"@builder.io/qwik": "0.16.2",
 | 
							"@builder.io/qwik": "0.18.1",
 | 
				
			||||||
		"@builder.io/qwik-city": "0.1.0-beta8",
 | 
							"@builder.io/qwik-city": "0.2.1",
 | 
				
			||||||
		"@types/eslint": "8.4.10",
 | 
							"@types/eslint": "8.4.10",
 | 
				
			||||||
		"@types/jest": "^29.2.4",
 | 
							"@types/jest": "^29.2.4",
 | 
				
			||||||
		"@types/node": "^18.11.16",
 | 
							"@types/node": "^18.11.16",
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -9,7 +9,7 @@ import { getPersonByEmail } from 'wildebeest/backend/src/activitypub/actors'
 | 
				
			||||||
import { getErrorHtml } from '~/utils/getErrorHtml/getErrorHtml'
 | 
					import { getErrorHtml } from '~/utils/getErrorHtml/getErrorHtml'
 | 
				
			||||||
import { buildRedirect } from 'wildebeest/functions/oauth/authorize'
 | 
					import { buildRedirect } from 'wildebeest/functions/oauth/authorize'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const clientLoader = loader$<{ DATABASE: D1Database }, Promise<Client>>(async ({ platform, query, html }) => {
 | 
					export const clientLoader = loader$<Promise<Client>, { DATABASE: D1Database }>(async ({ platform, query, html }) => {
 | 
				
			||||||
	const client_id = query.get('client_id') || ''
 | 
						const client_id = query.get('client_id') || ''
 | 
				
			||||||
	let client: Client | null = null
 | 
						let client: Client | null = null
 | 
				
			||||||
	try {
 | 
						try {
 | 
				
			||||||
| 
						 | 
					@ -24,8 +24,8 @@ export const clientLoader = loader$<{ DATABASE: D1Database }, Promise<Client>>(a
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const userLoader = loader$<
 | 
					export const userLoader = loader$<
 | 
				
			||||||
	{ DATABASE: D1Database; domain: string },
 | 
						Promise<{ email: string; avatar: URL; name: string; url: URL }>,
 | 
				
			||||||
	Promise<{ email: string; avatar: URL; name: string; url: URL }>
 | 
						{ DATABASE: D1Database; domain: string }
 | 
				
			||||||
>(async ({ cookie, platform, html, request, redirect, text }) => {
 | 
					>(async ({ cookie, platform, html, request, redirect, text }) => {
 | 
				
			||||||
	const jwt = cookie.get('CF_Authorization')
 | 
						const jwt = cookie.get('CF_Authorization')
 | 
				
			||||||
	if (jwt === null) {
 | 
						if (jwt === null) {
 | 
				
			||||||
| 
						 | 
					@ -68,8 +68,8 @@ export const userLoader = loader$<
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export default component$(() => {
 | 
					export default component$(() => {
 | 
				
			||||||
	const client = clientLoader.use().value
 | 
						const client = clientLoader().value
 | 
				
			||||||
	const { email, avatar, name: display_name, url } = userLoader.use().value
 | 
						const { email, avatar, name: display_name, url } = userLoader().value
 | 
				
			||||||
	return (
 | 
						return (
 | 
				
			||||||
		<div class="flex flex-col p-4 items-center">
 | 
							<div class="flex flex-col p-4 items-center">
 | 
				
			||||||
			<h1 class="text-center mt-3 mb-5 flex items-center">
 | 
								<h1 class="text-center mt-3 mb-5 flex items-center">
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -7,6 +7,6 @@ export const loader = loader$(({ html }) => {
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export default component$(() => {
 | 
					export default component$(() => {
 | 
				
			||||||
	loader.use()
 | 
						loader()
 | 
				
			||||||
	return <></>
 | 
						return <></>
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -15,8 +15,8 @@ import { StatusAccountCard } from '~/components/StatusAccountCard/StatusAccountC
 | 
				
			||||||
import { HtmlContent } from '~/components/HtmlContent/HtmlContent'
 | 
					import { HtmlContent } from '~/components/HtmlContent/HtmlContent'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const statusLoader = loader$<
 | 
					export const statusLoader = loader$<
 | 
				
			||||||
	{ DATABASE: D1Database },
 | 
						Promise<{ status: MastodonStatus; statusTextContent: string; context: StatusContext }>,
 | 
				
			||||||
	Promise<{ status: MastodonStatus; statusTextContent: string; context: StatusContext }>
 | 
						{ DATABASE: D1Database }
 | 
				
			||||||
>(async ({ request, html, platform, params }) => {
 | 
					>(async ({ request, html, platform, params }) => {
 | 
				
			||||||
	const domain = new URL(request.url).hostname
 | 
						const domain = new URL(request.url).hostname
 | 
				
			||||||
	let statusText = ''
 | 
						let statusText = ''
 | 
				
			||||||
| 
						 | 
					@ -46,7 +46,7 @@ export const statusLoader = loader$<
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export default component$(() => {
 | 
					export default component$(() => {
 | 
				
			||||||
	const loaderData = statusLoader.use().value
 | 
						const loaderData = statusLoader().value
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return (
 | 
						return (
 | 
				
			||||||
		<>
 | 
							<>
 | 
				
			||||||
| 
						 | 
					@ -111,8 +111,8 @@ export const Info = component$<{ href: string | null }>(({ href }) => {
 | 
				
			||||||
	)
 | 
						)
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const head: DocumentHead = ({ getData }) => {
 | 
					export const head: DocumentHead = ({ resolveValue }) => {
 | 
				
			||||||
	const { status, statusTextContent } = getData(statusLoader)
 | 
						const { status, statusTextContent } = resolveValue(statusLoader)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	const title = `${status.account.display_name}: ${statusTextContent.substring(0, 30)}${
 | 
						const title = `${status.account.display_name}: ${statusTextContent.substring(0, 30)}${
 | 
				
			||||||
		statusTextContent.length > 30 ? '…' : ''
 | 
							statusTextContent.length > 30 ? '…' : ''
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -7,11 +7,11 @@ import { getLocalStatuses } from 'wildebeest/functions/api/v1/accounts/[id]/stat
 | 
				
			||||||
import { parseHandle } from 'wildebeest/backend/src/utils/parse'
 | 
					import { parseHandle } from 'wildebeest/backend/src/utils/parse'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const statusesLoader = loader$<
 | 
					export const statusesLoader = loader$<
 | 
				
			||||||
	{ DATABASE: D1Database },
 | 
					 | 
				
			||||||
	Promise<{
 | 
						Promise<{
 | 
				
			||||||
		accountId: string
 | 
							accountId: string
 | 
				
			||||||
		statuses: MastodonStatus[]
 | 
							statuses: MastodonStatus[]
 | 
				
			||||||
	}>
 | 
						}>,
 | 
				
			||||||
 | 
						{ DATABASE: D1Database }
 | 
				
			||||||
>(async ({ platform, request, html }) => {
 | 
					>(async ({ platform, request, html }) => {
 | 
				
			||||||
	let statuses: MastodonStatus[] = []
 | 
						let statuses: MastodonStatus[] = []
 | 
				
			||||||
	let accountId = ''
 | 
						let accountId = ''
 | 
				
			||||||
| 
						 | 
					@ -34,7 +34,7 @@ export const statusesLoader = loader$<
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export default component$(() => {
 | 
					export default component$(() => {
 | 
				
			||||||
	const { accountId, statuses } = statusesLoader.use().value
 | 
						const { accountId, statuses } = statusesLoader().value
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return (
 | 
						return (
 | 
				
			||||||
		<div data-testid="account-posts">
 | 
							<div data-testid="account-posts">
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -13,8 +13,8 @@ import * as statusAPI from 'wildebeest/functions/api/v1/statuses/[id]'
 | 
				
			||||||
import { useAccountUrl } from '~/utils/useAccountUrl'
 | 
					import { useAccountUrl } from '~/utils/useAccountUrl'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const accountPageLoader = loader$<
 | 
					export const accountPageLoader = loader$<
 | 
				
			||||||
	{ DATABASE: D1Database },
 | 
						Promise<{ account: MastodonAccount; accountHandle: string; isValidStatus: boolean }>,
 | 
				
			||||||
	Promise<{ account: MastodonAccount; accountHandle: string; isValidStatus: boolean }>
 | 
						{ DATABASE: D1Database }
 | 
				
			||||||
>(async ({ platform, params, request, html }) => {
 | 
					>(async ({ platform, params, request, html }) => {
 | 
				
			||||||
	let isValidStatus = false
 | 
						let isValidStatus = false
 | 
				
			||||||
	let account: MastodonAccount | null = null
 | 
						let account: MastodonAccount | null = null
 | 
				
			||||||
| 
						 | 
					@ -53,7 +53,7 @@ export const accountPageLoader = loader$<
 | 
				
			||||||
export default component$(() => {
 | 
					export default component$(() => {
 | 
				
			||||||
	useStyles$(styles)
 | 
						useStyles$(styles)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	const pageDetails = accountPageLoader.use().value
 | 
						const pageDetails = accountPageLoader().value
 | 
				
			||||||
	const showAccountInfo = !pageDetails.isValidStatus
 | 
						const showAccountInfo = !pageDetails.isValidStatus
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	const location = useLocation()
 | 
						const location = useLocation()
 | 
				
			||||||
| 
						 | 
					@ -160,8 +160,8 @@ export function getAccountDomain(account: MastodonAccount): string | null {
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const head: DocumentHead = ({ getData, head }) => {
 | 
					export const head: DocumentHead = ({ resolveValue, head }) => {
 | 
				
			||||||
	const { account, accountHandle } = getData(accountPageLoader)
 | 
						const { account, accountHandle } = resolveValue(accountPageLoader)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return getDocumentHead(
 | 
						return getDocumentHead(
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -8,11 +8,11 @@ import { getLocalStatuses } from 'wildebeest/functions/api/v1/accounts/[id]/stat
 | 
				
			||||||
import { parseHandle } from 'wildebeest/backend/src/utils/parse'
 | 
					import { parseHandle } from 'wildebeest/backend/src/utils/parse'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const statusesLoader = loader$<
 | 
					export const statusesLoader = loader$<
 | 
				
			||||||
	{ DATABASE: D1Database },
 | 
					 | 
				
			||||||
	Promise<{
 | 
						Promise<{
 | 
				
			||||||
		accountId: string
 | 
							accountId: string
 | 
				
			||||||
		statuses: MastodonStatus[]
 | 
							statuses: MastodonStatus[]
 | 
				
			||||||
	}>
 | 
						}>,
 | 
				
			||||||
 | 
						{ DATABASE: D1Database }
 | 
				
			||||||
>(async ({ platform, request, html }) => {
 | 
					>(async ({ platform, request, html }) => {
 | 
				
			||||||
	let statuses: MastodonStatus[] = []
 | 
						let statuses: MastodonStatus[] = []
 | 
				
			||||||
	let accountId = ''
 | 
						let accountId = ''
 | 
				
			||||||
| 
						 | 
					@ -37,7 +37,7 @@ export const statusesLoader = loader$<
 | 
				
			||||||
export default component$(() => {
 | 
					export default component$(() => {
 | 
				
			||||||
	useStyles$(styles)
 | 
						useStyles$(styles)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	const { accountId, statuses } = statusesLoader.use().value
 | 
						const { accountId, statuses } = statusesLoader().value
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return (
 | 
						return (
 | 
				
			||||||
		<div data-testid="account-posts-and-replies">
 | 
							<div data-testid="account-posts-and-replies">
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,13 +1,12 @@
 | 
				
			||||||
import { $, component$ } from '@builder.io/qwik'
 | 
					import { $, component$ } from '@builder.io/qwik'
 | 
				
			||||||
import { DocumentHead, loader$ } from '@builder.io/qwik-city'
 | 
					import { DocumentHead, loader$ } from '@builder.io/qwik-city'
 | 
				
			||||||
import { RequestContext } from '@builder.io/qwik-city/middleware/request-handler'
 | 
					 | 
				
			||||||
import * as timelines from 'wildebeest/functions/api/v1/timelines/public'
 | 
					import * as timelines from 'wildebeest/functions/api/v1/timelines/public'
 | 
				
			||||||
import { StatusesPanel } from '~/components/StatusesPanel/StatusesPanel'
 | 
					import { StatusesPanel } from '~/components/StatusesPanel/StatusesPanel'
 | 
				
			||||||
import type { MastodonStatus } from '~/types'
 | 
					import type { MastodonStatus } from '~/types'
 | 
				
			||||||
import { getDocumentHead } from '~/utils/getDocumentHead'
 | 
					import { getDocumentHead } from '~/utils/getDocumentHead'
 | 
				
			||||||
import { getErrorHtml } from '~/utils/getErrorHtml/getErrorHtml'
 | 
					import { getErrorHtml } from '~/utils/getErrorHtml/getErrorHtml'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const statusesLoader = loader$<{ DATABASE: D1Database; domain: string }, Promise<MastodonStatus[]>>(
 | 
					export const statusesLoader = loader$<Promise<MastodonStatus[]>, { DATABASE: D1Database; domain: string }>(
 | 
				
			||||||
	async ({ platform, html }) => {
 | 
						async ({ platform, html }) => {
 | 
				
			||||||
		try {
 | 
							try {
 | 
				
			||||||
			// TODO: use the "trending" API endpoint here.
 | 
								// TODO: use the "trending" API endpoint here.
 | 
				
			||||||
| 
						 | 
					@ -24,7 +23,7 @@ export const statusesLoader = loader$<{ DATABASE: D1Database; domain: string },
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export default component$(() => {
 | 
					export default component$(() => {
 | 
				
			||||||
	const statuses = statusesLoader.use().value
 | 
						const statuses = statusesLoader().value
 | 
				
			||||||
	return (
 | 
						return (
 | 
				
			||||||
		<StatusesPanel
 | 
							<StatusesPanel
 | 
				
			||||||
			initialStatuses={statuses}
 | 
								initialStatuses={statuses}
 | 
				
			||||||
| 
						 | 
					@ -47,11 +46,11 @@ export default component$(() => {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const requestLoader = loader$(async ({ request }) => {
 | 
					export const requestLoader = loader$(async ({ request }) => {
 | 
				
			||||||
	// Manually parse the JSON to ensure that Qwik finds the resulting objects serializable.
 | 
						// Manually parse the JSON to ensure that Qwik finds the resulting objects serializable.
 | 
				
			||||||
	return JSON.parse(JSON.stringify(request)) as RequestContext
 | 
						return JSON.parse(JSON.stringify(request)) as Request
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const head: DocumentHead = ({ getData }) => {
 | 
					export const head: DocumentHead = ({ resolveValue }) => {
 | 
				
			||||||
	const { url } = getData(requestLoader)
 | 
						const { url } = resolveValue(requestLoader)
 | 
				
			||||||
	return getDocumentHead({
 | 
						return getDocumentHead({
 | 
				
			||||||
		title: 'Explore - Wildebeest',
 | 
							title: 'Explore - Wildebeest',
 | 
				
			||||||
		og: {
 | 
							og: {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -11,8 +11,8 @@ import { InstanceConfigContext } from '~/utils/instanceConfig'
 | 
				
			||||||
import { getDocumentHead } from '~/utils/getDocumentHead'
 | 
					import { getDocumentHead } from '~/utils/getDocumentHead'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const instanceLoader = loader$<
 | 
					export const instanceLoader = loader$<
 | 
				
			||||||
	{ DATABASE: D1Database; INSTANCE_TITLE: string; INSTANCE_DESCR: string; ADMIN_EMAIL: string },
 | 
						Promise<InstanceConfig>,
 | 
				
			||||||
	Promise<InstanceConfig>
 | 
						{ DATABASE: D1Database; INSTANCE_TITLE: string; INSTANCE_DESCR: string; ADMIN_EMAIL: string }
 | 
				
			||||||
>(async ({ platform, html }) => {
 | 
					>(async ({ platform, html }) => {
 | 
				
			||||||
	const env = {
 | 
						const env = {
 | 
				
			||||||
		INSTANCE_DESCR: platform.INSTANCE_DESCR,
 | 
							INSTANCE_DESCR: platform.INSTANCE_DESCR,
 | 
				
			||||||
| 
						 | 
					@ -30,7 +30,7 @@ export const instanceLoader = loader$<
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export default component$(() => {
 | 
					export default component$(() => {
 | 
				
			||||||
	useContextProvider(InstanceConfigContext, instanceLoader.use().value)
 | 
						useContextProvider(InstanceConfigContext, instanceLoader().value)
 | 
				
			||||||
	const commitHash = getCommitHash()
 | 
						const commitHash = getCommitHash()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return (
 | 
						return (
 | 
				
			||||||
| 
						 | 
					@ -64,8 +64,8 @@ export default component$(() => {
 | 
				
			||||||
	)
 | 
						)
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const head: DocumentHead = ({ getData, head }) => {
 | 
					export const head: DocumentHead = ({ resolveValue, head }) => {
 | 
				
			||||||
	const instance = getData(instanceLoader)
 | 
						const instance = resolveValue(instanceLoader)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return getDocumentHead(
 | 
						return getDocumentHead(
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -4,10 +4,9 @@ import * as timelines from 'wildebeest/functions/api/v1/timelines/public'
 | 
				
			||||||
import { DocumentHead, loader$ } from '@builder.io/qwik-city'
 | 
					import { DocumentHead, loader$ } from '@builder.io/qwik-city'
 | 
				
			||||||
import StickyHeader from '~/components/StickyHeader/StickyHeader'
 | 
					import StickyHeader from '~/components/StickyHeader/StickyHeader'
 | 
				
			||||||
import { getDocumentHead } from '~/utils/getDocumentHead'
 | 
					import { getDocumentHead } from '~/utils/getDocumentHead'
 | 
				
			||||||
import { RequestContext } from '@builder.io/qwik-city/middleware/request-handler'
 | 
					 | 
				
			||||||
import { StatusesPanel } from '~/components/StatusesPanel/StatusesPanel'
 | 
					import { StatusesPanel } from '~/components/StatusesPanel/StatusesPanel'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const statusesLoader = loader$<{ DATABASE: D1Database; domain: string }, Promise<MastodonStatus[]>>(
 | 
					export const statusesLoader = loader$<Promise<MastodonStatus[]>, { DATABASE: D1Database; domain: string }>(
 | 
				
			||||||
	async ({ platform, html }) => {
 | 
						async ({ platform, html }) => {
 | 
				
			||||||
		try {
 | 
							try {
 | 
				
			||||||
			// TODO: use the "trending" API endpoint here.
 | 
								// TODO: use the "trending" API endpoint here.
 | 
				
			||||||
| 
						 | 
					@ -22,7 +21,7 @@ export const statusesLoader = loader$<{ DATABASE: D1Database; domain: string },
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export default component$(() => {
 | 
					export default component$(() => {
 | 
				
			||||||
	const statuses = statusesLoader.use().value
 | 
						const statuses = statusesLoader().value
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return (
 | 
						return (
 | 
				
			||||||
		<>
 | 
							<>
 | 
				
			||||||
| 
						 | 
					@ -54,11 +53,11 @@ export default component$(() => {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const requestLoader = loader$(async ({ request }) => {
 | 
					export const requestLoader = loader$(async ({ request }) => {
 | 
				
			||||||
	// Manually parse the JSON to ensure that Qwik finds the resulting objects serializable.
 | 
						// Manually parse the JSON to ensure that Qwik finds the resulting objects serializable.
 | 
				
			||||||
	return JSON.parse(JSON.stringify(request)) as RequestContext
 | 
						return JSON.parse(JSON.stringify(request)) as Request
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const head: DocumentHead = ({ getData }) => {
 | 
					export const head: DocumentHead = ({ resolveValue }) => {
 | 
				
			||||||
	const { url } = getData(requestLoader)
 | 
						const { url } = resolveValue(requestLoader)
 | 
				
			||||||
	return getDocumentHead({
 | 
						return getDocumentHead({
 | 
				
			||||||
		title: 'Federated timeline - Wildebeest',
 | 
							title: 'Federated timeline - Wildebeest',
 | 
				
			||||||
		og: {
 | 
							og: {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -4,10 +4,9 @@ import * as timelines from 'wildebeest/functions/api/v1/timelines/public'
 | 
				
			||||||
import { DocumentHead, loader$ } from '@builder.io/qwik-city'
 | 
					import { DocumentHead, loader$ } from '@builder.io/qwik-city'
 | 
				
			||||||
import StickyHeader from '~/components/StickyHeader/StickyHeader'
 | 
					import StickyHeader from '~/components/StickyHeader/StickyHeader'
 | 
				
			||||||
import { getDocumentHead } from '~/utils/getDocumentHead'
 | 
					import { getDocumentHead } from '~/utils/getDocumentHead'
 | 
				
			||||||
import { RequestContext } from '@builder.io/qwik-city/middleware/request-handler'
 | 
					 | 
				
			||||||
import { StatusesPanel } from '~/components/StatusesPanel/StatusesPanel'
 | 
					import { StatusesPanel } from '~/components/StatusesPanel/StatusesPanel'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const statusesLoader = loader$<{ DATABASE: D1Database; domain: string }, Promise<MastodonStatus[]>>(
 | 
					export const statusesLoader = loader$<Promise<MastodonStatus[]>, { DATABASE: D1Database; domain: string }>(
 | 
				
			||||||
	async ({ platform, html }) => {
 | 
						async ({ platform, html }) => {
 | 
				
			||||||
		try {
 | 
							try {
 | 
				
			||||||
			// TODO: use the "trending" API endpoint here.
 | 
								// TODO: use the "trending" API endpoint here.
 | 
				
			||||||
| 
						 | 
					@ -22,7 +21,7 @@ export const statusesLoader = loader$<{ DATABASE: D1Database; domain: string },
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export default component$(() => {
 | 
					export default component$(() => {
 | 
				
			||||||
	const statuses = statusesLoader.use().value
 | 
						const statuses = statusesLoader().value
 | 
				
			||||||
	return (
 | 
						return (
 | 
				
			||||||
		<>
 | 
							<>
 | 
				
			||||||
			<StickyHeader>
 | 
								<StickyHeader>
 | 
				
			||||||
| 
						 | 
					@ -53,11 +52,11 @@ export default component$(() => {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const requestLoader = loader$(async ({ request }) => {
 | 
					export const requestLoader = loader$(async ({ request }) => {
 | 
				
			||||||
	// Manually parse the JSON to ensure that Qwik finds the resulting objects serializable.
 | 
						// Manually parse the JSON to ensure that Qwik finds the resulting objects serializable.
 | 
				
			||||||
	return JSON.parse(JSON.stringify(request)) as RequestContext
 | 
						return JSON.parse(JSON.stringify(request)) as Request
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const head: DocumentHead = ({ getData }) => {
 | 
					export const head: DocumentHead = ({ resolveValue }) => {
 | 
				
			||||||
	const { url } = getData(requestLoader)
 | 
						const { url } = resolveValue(requestLoader)
 | 
				
			||||||
	return getDocumentHead({
 | 
						return getDocumentHead({
 | 
				
			||||||
		title: 'Local timeline - Wildebeest',
 | 
							title: 'Local timeline - Wildebeest',
 | 
				
			||||||
		og: {
 | 
							og: {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -6,6 +6,6 @@ export const loader = loader$(({ redirect }) => {
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export default component$(() => {
 | 
					export default component$(() => {
 | 
				
			||||||
	loader.use()
 | 
						loader()
 | 
				
			||||||
	return <></>
 | 
						return <></>
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -297,20 +297,21 @@
 | 
				
			||||||
  resolved "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz"
 | 
					  resolved "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz"
 | 
				
			||||||
  integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
 | 
					  integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
 | 
				
			||||||
 | 
					
 | 
				
			||||||
"@builder.io/qwik-city@0.1.0-beta8":
 | 
					"@builder.io/qwik-city@0.2.1":
 | 
				
			||||||
  version "0.1.0-beta8"
 | 
					  version "0.2.1"
 | 
				
			||||||
  resolved "https://registry.yarnpkg.com/@builder.io/qwik-city/-/qwik-city-0.1.0-beta8.tgz#9b94fe568c24e4a3676e36ab27f0c961e3ffcbac"
 | 
					  resolved "https://registry.yarnpkg.com/@builder.io/qwik-city/-/qwik-city-0.2.1.tgz#c57f481a75534ff54ddb0f38403acc66b5d02f41"
 | 
				
			||||||
  integrity sha512-yDazkJ5wj5Fxl5FiYVopRkDABScZS83m7JWC2Z3MgrzaYn/PNr8V0D6kUTT18pLrQBSXMcAPug6qyapDEUWSgw==
 | 
					  integrity sha512-g+ZC4Neo1XYQ/8uquUp6GKwr0eagpuCyQ3LkAtFhaIARaO67+cZfR6EFLJzf9wz5AVSt8/0QSD7wJEpni1i4IA==
 | 
				
			||||||
  dependencies:
 | 
					  dependencies:
 | 
				
			||||||
    "@mdx-js/mdx" "2.2.1"
 | 
					    "@mdx-js/mdx" "2.3.0"
 | 
				
			||||||
    "@types/mdx" "2.0.3"
 | 
					    "@types/mdx" "2.0.3"
 | 
				
			||||||
    source-map "0.7.4"
 | 
					    source-map "0.7.4"
 | 
				
			||||||
    vfile "5.3.6"
 | 
					    vfile "5.3.7"
 | 
				
			||||||
 | 
					    zod "^3.20.6"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
"@builder.io/qwik@0.16.2":
 | 
					"@builder.io/qwik@0.18.1":
 | 
				
			||||||
  version "0.16.2"
 | 
					  version "0.18.1"
 | 
				
			||||||
  resolved "https://registry.yarnpkg.com/@builder.io/qwik/-/qwik-0.16.2.tgz#e29d2c001043ed40260eae309948c8d91bae091c"
 | 
					  resolved "https://registry.yarnpkg.com/@builder.io/qwik/-/qwik-0.18.1.tgz#341d01c5749a07230c700a5e4df859b857654cd0"
 | 
				
			||||||
  integrity sha512-yq+WXx54PVDJkTse7C7zYcTVIn2g5qHD2buH/iy7nux+fVLd2Qpui7UK1nuioK2Kpf75JfEAH9ZSWIHQl32FKQ==
 | 
					  integrity sha512-11qx5Wh6WRxgvHDJDppJORhykzkACUYuu9qRKEGdS3vTkBQ2Rr8NFDjYon2x6+8Wu9WukHk84ANywWnS91gS/w==
 | 
				
			||||||
 | 
					
 | 
				
			||||||
"@cush/relative@^1.0.0":
 | 
					"@cush/relative@^1.0.0":
 | 
				
			||||||
  version "1.0.0"
 | 
					  version "1.0.0"
 | 
				
			||||||
| 
						 | 
					@ -709,10 +710,10 @@
 | 
				
			||||||
    "@jridgewell/resolve-uri" "3.1.0"
 | 
					    "@jridgewell/resolve-uri" "3.1.0"
 | 
				
			||||||
    "@jridgewell/sourcemap-codec" "1.4.14"
 | 
					    "@jridgewell/sourcemap-codec" "1.4.14"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
"@mdx-js/mdx@2.2.1":
 | 
					"@mdx-js/mdx@2.3.0":
 | 
				
			||||||
  version "2.2.1"
 | 
					  version "2.3.0"
 | 
				
			||||||
  resolved "https://registry.npmjs.org/@mdx-js/mdx/-/mdx-2.2.1.tgz"
 | 
					  resolved "https://registry.yarnpkg.com/@mdx-js/mdx/-/mdx-2.3.0.tgz#d65d8c3c28f3f46bb0e7cb3bf7613b39980671a9"
 | 
				
			||||||
  integrity sha512-hZ3ex7exYLJn6FfReq8yTvA6TE53uW9UHJQM9IlSauOuS55J9y8RtA7W+dzp6Yrzr00/U1sd7q+Wf61q6SfiTQ==
 | 
					  integrity sha512-jLuwRlz8DQfQNiUCJR50Y09CGPq3fLtmtUQfVrj79E0JWu3dvsVcxVIcfhR5h0iXu+/z++zDrYeiJqifRynJkA==
 | 
				
			||||||
  dependencies:
 | 
					  dependencies:
 | 
				
			||||||
    "@types/estree-jsx" "^1.0.0"
 | 
					    "@types/estree-jsx" "^1.0.0"
 | 
				
			||||||
    "@types/mdx" "^2.0.0"
 | 
					    "@types/mdx" "^2.0.0"
 | 
				
			||||||
| 
						 | 
					@ -4260,7 +4261,17 @@ vfile-message@^3.0.0:
 | 
				
			||||||
    "@types/unist" "^2.0.0"
 | 
					    "@types/unist" "^2.0.0"
 | 
				
			||||||
    unist-util-stringify-position "^3.0.0"
 | 
					    unist-util-stringify-position "^3.0.0"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
vfile@5.3.6, vfile@^5.0.0:
 | 
					vfile@5.3.7:
 | 
				
			||||||
 | 
					  version "5.3.7"
 | 
				
			||||||
 | 
					  resolved "https://registry.yarnpkg.com/vfile/-/vfile-5.3.7.tgz#de0677e6683e3380fafc46544cfe603118826ab7"
 | 
				
			||||||
 | 
					  integrity sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==
 | 
				
			||||||
 | 
					  dependencies:
 | 
				
			||||||
 | 
					    "@types/unist" "^2.0.0"
 | 
				
			||||||
 | 
					    is-buffer "^2.0.0"
 | 
				
			||||||
 | 
					    unist-util-stringify-position "^3.0.0"
 | 
				
			||||||
 | 
					    vfile-message "^3.0.0"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					vfile@^5.0.0:
 | 
				
			||||||
  version "5.3.6"
 | 
					  version "5.3.6"
 | 
				
			||||||
  resolved "https://registry.npmjs.org/vfile/-/vfile-5.3.6.tgz"
 | 
					  resolved "https://registry.npmjs.org/vfile/-/vfile-5.3.6.tgz"
 | 
				
			||||||
  integrity sha512-ADBsmerdGBs2WYckrLBEmuETSPyTD4TuLxTrw0DvjirxW1ra4ZwkbzG8ndsv3Q57smvHxo677MHaQrY9yxH8cA==
 | 
					  integrity sha512-ADBsmerdGBs2WYckrLBEmuETSPyTD4TuLxTrw0DvjirxW1ra4ZwkbzG8ndsv3Q57smvHxo677MHaQrY9yxH8cA==
 | 
				
			||||||
| 
						 | 
					@ -4381,6 +4392,11 @@ yocto-queue@^0.1.0:
 | 
				
			||||||
  resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz"
 | 
					  resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz"
 | 
				
			||||||
  integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==
 | 
					  integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					zod@^3.20.6:
 | 
				
			||||||
 | 
					  version "3.20.6"
 | 
				
			||||||
 | 
					  resolved "https://registry.yarnpkg.com/zod/-/zod-3.20.6.tgz#2f2f08ff81291d47d99e86140fedb4e0db08361a"
 | 
				
			||||||
 | 
					  integrity sha512-oyu0m54SGCtzh6EClBVqDDlAYRz4jrVtKwQ7ZnsEmMI9HnzuZFj8QFwAY1M5uniIYACdGvv0PBWPF2kO0aNofA==
 | 
				
			||||||
 | 
					
 | 
				
			||||||
zwitch@^2.0.0:
 | 
					zwitch@^2.0.0:
 | 
				
			||||||
  version "2.0.4"
 | 
					  version "2.0.4"
 | 
				
			||||||
  resolved "https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz"
 | 
					  resolved "https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,13 @@
 | 
				
			||||||
import { test, expect } from '@playwright/test'
 | 
					import { test, expect } from '@playwright/test'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test('View of custom emojis in an toots author display name', async ({ page, browserName }) => {
 | 
					test('View of custom emojis in an toots author display name', async ({ page, browserName }) => {
 | 
				
			||||||
 | 
						test.skip(
 | 
				
			||||||
 | 
							true,
 | 
				
			||||||
 | 
							'Qwik does no longer provide a way to mock the q-data request' +
 | 
				
			||||||
 | 
								' so this test needs to be skipped until we either come up with a way to mock the q-data' +
 | 
				
			||||||
 | 
								' or the custom emojis are implemented in the backend'
 | 
				
			||||||
 | 
						)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// this page.route is a hack to mock the custom emojis since they haven't
 | 
						// this page.route is a hack to mock the custom emojis since they haven't
 | 
				
			||||||
	// yet been implemented in the backend (this should be not needed and removed
 | 
						// yet been implemented in the backend (this should be not needed and removed
 | 
				
			||||||
	// when those are implemented)
 | 
						// when those are implemented)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Ładowanie…
	
		Reference in New Issue