repo
stringlengths
7
64
file_url
stringlengths
81
338
file_path
stringlengths
5
257
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:25:31
2026-01-05 01:50:38
truncated
bool
2 classes
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/collections/(ecommerce)/Orders/components/inpost-pickup/PickupShipmentMenu.tsx
src/collections/(ecommerce)/Orders/components/inpost-pickup/PickupShipmentMenu.tsx
import { type Order } from "@/payload-types"; import { PickupShipmentMenuClient } from "./PickupShipmentMenu.client"; export const PickupShipmentMenu = ({ data }: { data: Order }) => { return <PickupShipmentMenuClient orderID={data.id} />; };
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/collections/(ecommerce)/Orders/components/OrderTotalWithShippingField/index.tsx
src/collections/(ecommerce)/Orders/components/OrderTotalWithShippingField/index.tsx
"use client"; import { NumberField, useField, useFormFields } from "@payloadcms/ui"; import { type NumberFieldClientComponent } from "payload"; import { useEffect } from "react"; export const OrderTotalWithShippingField: NumberFieldClientComponent = (props) => { const { path } = props; const { setValue } = useFie...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/collections/(ecommerce)/Orders/utils/getShippingLabel.ts
src/collections/(ecommerce)/Orders/utils/getShippingLabel.ts
import axios, { isAxiosError } from "axios"; import { type SetStateAction } from "react"; export const getShippingLabel = async ({ setIsDownloading, setError, orderID, }: { setIsDownloading: (value: SetStateAction<boolean>) => void; setError: (value: SetStateAction<string>) => void; orderID: string; }) => ...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/collections/(ecommerce)/Customers/index.ts
src/collections/(ecommerce)/Customers/index.ts
import { revalidateTag } from "next/cache"; import { type CollectionConfig } from "payload"; import { countryList } from "@/globals/(ecommerce)/Couriers/utils/countryList"; import { createTokenAndSendEmail } from "./hooks/createTokenAndSendEmail"; export const Customers: CollectionConfig = { slug: "customers", a...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/collections/(ecommerce)/Customers/hooks/createTokenAndSendEmail.ts
src/collections/(ecommerce)/Customers/hooks/createTokenAndSendEmail.ts
import { render } from "@react-email/components"; import { getLocale, getTranslations } from "next-intl/server"; import { VerifyAccountEmail } from "@/components/Emails/VerifyAccountEmail"; import { type Locale } from "@/i18n/config"; import { sendEmail } from "@/utilities/nodemailer"; import type { CollectionAfterOp...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/collections/(ecommerce)/Customers/hooks/sendWelcomeEmail.ts
src/collections/(ecommerce)/Customers/hooks/sendWelcomeEmail.ts
import { render } from "@react-email/components"; import { getLocale, getTranslations } from "next-intl/server"; import { WelcomeEmail } from "@/components/Emails/WelcomeEmail"; import { type Locale } from "@/i18n/config"; import { type Customer } from "@/payload-types"; import { sendEmail } from "@/utilities/nodemail...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/collections/(ecommerce)/Customers/ui/RowLabels/ShippingAddressRowLabel/index.tsx
src/collections/(ecommerce)/Customers/ui/RowLabels/ShippingAddressRowLabel/index.tsx
"use client"; import { useRowLabel } from "@payloadcms/ui"; export const ShippingAddressRowLabel = () => { const { data } = useRowLabel<{ name?: string; address?: string; city?: string; postalCode?: string; phone?: string; email?: string; }>(); return ( <p> {data?.name}, {data...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/collections/(ecommerce)/ProductReviews/index.ts
src/collections/(ecommerce)/ProductReviews/index.ts
import { type CollectionConfig } from "payload"; export const ProductReviews: CollectionConfig = { slug: "productReviews", access: {}, admin: { group: { en: "Products", pl: "Produkty", }, }, labels: { singular: { en: "Product Review", pl: "Opinia o produkcie", }, p...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/collections/(ecommerce)/ProductCategories/index.ts
src/collections/(ecommerce)/ProductCategories/index.ts
import { type CollectionConfig } from "payload"; import { anyone } from "@/access/anyone"; import { slugField } from "@/fields/slug"; export const ProductCategories: CollectionConfig = { slug: "productCategories", admin: { useAsTitle: "title", group: { en: "Products", pl: "Produkty", }, ...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/collections/Pages/index.ts
src/collections/Pages/index.ts
import { MetaDescriptionField, MetaImageField, MetaTitleField, OverviewField, PreviewField, } from "@payloadcms/plugin-seo/fields"; import { authenticated } from "@/access/authenticated"; import { authenticatedOrPublished } from "@/access/authenticatedOrPublished"; import { Hotspot } from "@/blocks/(ecommerc...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/collections/Pages/hooks/revalidatePage.ts
src/collections/Pages/hooks/revalidatePage.ts
import { revalidatePath, revalidateTag } from "next/cache"; import type { Page } from "@/payload-types"; import type { CollectionAfterChangeHook, CollectionAfterDeleteHook } from "payload"; export const revalidatePage: CollectionAfterChangeHook<Page> = ({ doc, previousDoc, req: { payload, context }, }) => { i...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/collections/Administrators/index.ts
src/collections/Administrators/index.ts
import { authenticated } from "@/access/authenticated"; import type { CollectionConfig } from "payload"; export const Administrators: CollectionConfig = { slug: "administrators", labels: { singular: { en: "Administrator", pl: "Administrator", }, plural: { en: "Administrators", ...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/collections/Posts/index.ts
src/collections/Posts/index.ts
/* eslint-disable */ import { MetaDescriptionField, MetaImageField, MetaTitleField, OverviewField, PreviewField, } from "@payloadcms/plugin-seo/fields"; import { BlocksFeature, FixedToolbarFeature, HeadingFeature, HorizontalRuleFeature, InlineToolbarFeature, lexicalEditor, } from "@payloadcms/rich...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/collections/Posts/hooks/revalidatePost.ts
src/collections/Posts/hooks/revalidatePost.ts
import { revalidatePath, revalidateTag } from "next/cache"; import type { Post } from "@/payload-types"; import type { CollectionAfterChangeHook, CollectionAfterDeleteHook } from "payload"; export const revalidatePost: CollectionAfterChangeHook<Post> = ({ doc, previousDoc, req: { payload, context }, }) => { i...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/collections/Posts/hooks/populateAuthors.ts
src/collections/Posts/hooks/populateAuthors.ts
/* eslint-disable */ import { type Administrator } from "@/payload-types"; import type { CollectionAfterReadHook } from "payload"; // The `user` collection has access control locked so that users are not publicly accessible // This means that we need to populate the authors manually here to protect user privacy // Gr...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/lib/getFilledProducts.ts
src/lib/getFilledProducts.ts
import { type Product } from "@/payload-types"; type BaseProduct = { id: string; choosenVariantSlug?: string; }; type CartProduct = BaseProduct & { quantity: number; }; type WishlistProduct = BaseProduct; export const getFilledProducts = <T extends CartProduct | WishlistProduct>( products: Product[], items...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/lib/getTotalWeight.ts
src/lib/getTotalWeight.ts
import { type Cart } from "@/stores/CartStore/types"; import { type FilledProduct } from "./getFilledProducts"; export const getTotalWeight = (filledProducts: FilledProduct[], cart: Cart) => filledProducts.reduce((acc, product) => { if (product.enableVariantWeights && product.variants) { const variantWeig...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/lib/getTotal.ts
src/lib/getTotal.ts
import { type FilledProduct } from "./getFilledProducts"; type Total = Record<string, number>; export const getTotal = (filledProducts: FilledProduct[]) => { const total = filledProducts.reduce<Total>((acc, product) => { if (!product) return acc; if (!product.enableVariantPrices) { product.pricing?.fo...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/lib/paywalls/getStripePaymentURL.ts
src/lib/paywalls/getStripePaymentURL.ts
import Stripe from "stripe"; import { type Locale } from "@/i18n/config"; import { type Currency } from "@/stores/Currency/types"; import { type FilledProduct } from "../getFilledProducts"; export const getStripePaymentURL = async ({ filledProducts, shippingCost, shippingLabel, currency, locale, apiKey, ...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/lib/paywalls/getP24PaymentURL.ts
src/lib/paywalls/getP24PaymentURL.ts
import { createHash } from "crypto"; import axios, { isAxiosError } from "axios"; import { type Locale } from "@/i18n/config"; import { type Customer } from "@/payload-types"; import { type Currency } from "@/stores/Currency/types"; export const getP24PaymentURL = async ({ secretId, posId, crc, endpoint, s...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/lib/paywalls/getAutopayPaymentURL.ts
src/lib/paywalls/getAutopayPaymentURL.ts
import { createHash } from "crypto"; import axios from "axios"; import { type Paywall } from "@/payload-types"; import { type Currency } from "@/stores/Currency/types"; export const getAutopayPaymentURL = async ({ total, autopay, orderID, currency, customerEmail, }: { total: number; autopay: Paywall["a...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/lib/couriers/labels/getInpostLabel.ts
src/lib/couriers/labels/getInpostLabel.ts
import axios from "axios"; import { getLocale } from "next-intl/server"; import { type Locale } from "@/i18n/config"; import { getCachedGlobal } from "@/utilities/getGlobals"; export const getInpostLabel = async ( packageID: string, courierSlug: "inpost-pickup" | "inpost-courier" | "inpost-courier-cod", ) => { ...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/lib/couriers/packages/createInpostCODCourierPackage.ts
src/lib/couriers/packages/createInpostCODCourierPackage.ts
import axios from "axios"; import { getLocale } from "next-intl/server"; import { getPayload } from "payload"; import { type Dimensions } from "@/app/(frontend)/next/package/route"; import { type Locale } from "@/i18n/config"; import { type Order } from "@/payload-types"; import { getCachedGlobal } from "@/utilities/g...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/lib/couriers/packages/createInpostCourierPackage.ts
src/lib/couriers/packages/createInpostCourierPackage.ts
import axios from "axios"; import { getLocale } from "next-intl/server"; import { getPayload } from "payload"; import { type Dimensions } from "@/app/(frontend)/next/package/route"; import { type Locale } from "@/i18n/config"; import { type Order } from "@/payload-types"; import { getCachedGlobal } from "@/utilities/g...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/lib/couriers/packages/createInpostPickupPackage.ts
src/lib/couriers/packages/createInpostPickupPackage.ts
import axios from "axios"; import { getLocale } from "next-intl/server"; import { getPayload } from "payload"; import { type Locale } from "@/i18n/config"; import { type Order } from "@/payload-types"; import { getCachedGlobal } from "@/utilities/getGlobals"; import config from "@payload-config"; const wait = (ms: nu...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/utilities/cn.ts
src/utilities/cn.ts
import { type ClassValue, clsx } from "clsx"; import { twMerge } from "tailwind-merge"; export function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs)); }
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/utilities/canUseDOM.ts
src/utilities/canUseDOM.ts
/* eslint-disable */ export default !!(typeof window !== "undefined" && window.document && window.document.createElement);
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/utilities/nodemailer.ts
src/utilities/nodemailer.ts
import nodemailer from "nodemailer"; import { getCachedGlobal } from "./getGlobals"; type EmailPayload = { to: string; subject: string; html: string; }; type EmailResponse = { success: boolean; messageId: string; }; const createEmailTransporter = async () => { const { smtp } = await getCachedGlobal("ema...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/utilities/getRedirects.ts
src/utilities/getRedirects.ts
import { unstable_cache } from "next/cache"; import { getPayload } from "payload"; import configPromise from "@payload-config"; export async function getRedirects(depth = 1) { const payload = await getPayload({ config: configPromise }); const { docs: redirects } = await payload.find({ collection: "redirects"...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/utilities/mergeOpenGraph.ts
src/utilities/mergeOpenGraph.ts
import { getServerSideURL } from "./getURL"; import type { Metadata } from "next"; const defaultOpenGraph: Metadata["openGraph"] = { type: "website", description: "An open-source website built with Payload and Next.js.", images: [ { url: `${getServerSideURL()}/website-template-OG.webp`, }, ], ...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/utilities/generatePreviewPath.ts
src/utilities/generatePreviewPath.ts
import { type PayloadRequest, type CollectionSlug } from "payload"; import { type Locale } from "@/i18n/config"; const collectionPrefixMap: Partial<Record<CollectionSlug, string>> = { posts: "/posts", pages: "", }; type Props = { collection: keyof typeof collectionPrefixMap; slug: string; req: PayloadReque...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/utilities/useClickableCard.ts
src/utilities/useClickableCard.ts
"use client"; import { useRouter } from "next/navigation"; import { useCallback, useEffect, useRef, type RefObject } from "react"; type UseClickableCardType<T extends HTMLElement> = { cardRef: RefObject<T | null>; linkRef: RefObject<HTMLAnchorElement | null>; }; type Props = { external?: boolean; newTab?: bo...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/utilities/getDocument.ts
src/utilities/getDocument.ts
import { unstable_cache } from "next/cache"; import { getPayload } from "payload"; import configPromise from "@payload-config"; import type { Config } from "@/payload-types"; type Collection = keyof Config["collections"]; async function getDocument(collection: Collection, slug: string, depth = 0) { const payload ...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/utilities/generateMeta.ts
src/utilities/generateMeta.ts
import { getServerSideURL } from "./getURL"; import { mergeOpenGraph } from "./mergeOpenGraph"; import type { Media, Page, Post, Config } from "@/payload-types"; import type { Metadata } from "next"; const getImageURL = (image?: Media | Config["db"]["defaultIDType"] | null) => { const serverUrl = getServerSideURL()...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/utilities/toKebabCase.ts
src/utilities/toKebabCase.ts
export const toKebabCase = (string: string): string => string ?.replace(/([a-z])([A-Z])/g, "$1-$2") .replace(/\s+/g, "-") .toLowerCase();
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/utilities/getMeUser.ts
src/utilities/getMeUser.ts
import { cookies } from "next/headers"; import { type Locale } from "@/i18n/config"; import { redirect } from "@/i18n/routing"; import { getClientSideURL } from "./getURL"; import type { Administrator } from "@/payload-types"; export const getMeUser = async (args?: { nullUserRedirect?: string; locale?: Locale; ...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/utilities/formatAuthors.ts
src/utilities/formatAuthors.ts
import { type Post } from "@/payload-types"; /** * Formats an array of populatedAuthors from Posts into a prettified string. * @param authors - The populatedAuthors array from a Post. * @returns A prettified string of authors. * @example * * [Author1, Author2] becomes 'Author1 and Author2' * [Author1, Author2, ...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/utilities/getOrderProducts.ts
src/utilities/getOrderProducts.ts
import { getPayload } from "payload"; import { type Locale } from "@/i18n/config"; import { type Order } from "@/payload-types"; import config from "@/payload.config"; export const getOrderProducts = async (orderProducts: Order["products"] | null, locale: Locale) => { try { const payload = await getPayload({ co...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/utilities/formatDateTime.ts
src/utilities/formatDateTime.ts
export const formatDateTime = (timestamp: string, format?: "EU" | "US"): string => { const now = new Date(); let date = now; if (timestamp) date = new Date(timestamp); const months = date.getMonth(); const days = date.getDate(); // const hours = date.getHours(); // const minutes = date.getMinutes(); // ...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/utilities/useDebounce.ts
src/utilities/useDebounce.ts
import { useState, useEffect } from "react"; export function useDebounce<T>(value: T, delay = 200): T { const [debouncedValue, setDebouncedValue] = useState<T>(value); useEffect(() => { const handler = setTimeout(() => { setDebouncedValue(value); }, delay); return () => { clearTimeout(han...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/utilities/getPriceRange.ts
src/utilities/getPriceRange.ts
import { type Product } from "@/payload-types"; import { type Currency } from "@/stores/Currency/types"; export const getPriceRange = (variants: Product["variants"], enableVariantPrices: boolean) => { if (!variants || !enableVariantPrices) return null; const allPrices = variants.flatMap((variant) => variant.prici...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/utilities/formatPrices.ts
src/utilities/formatPrices.ts
/** * Function that formats a price using Intl.NumberFormat * @param price - Price to format * @param currency - Currency to format * @param locale - Locale to format * @returns - Formatted price */ export const formatPrice = (price: number, currency: string, locale: string) => { const formattedPrice = new Intl...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/utilities/getURL.ts
src/utilities/getURL.ts
import canUseDOM from "./canUseDOM"; export const getServerSideURL = () => { let url = process.env.NEXT_PUBLIC_SERVER_URL; if (!url && process.env.VERCEL_PROJECT_PRODUCTION_URL) { return `https://${process.env.VERCEL_PROJECT_PRODUCTION_URL}`; } if (!url) { url = "http://localhost:3000"; } return...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/utilities/deepMerge.ts
src/utilities/deepMerge.ts
/* eslint-disable */ // @ts-nocheck /** * Simple object check. * @param item * @returns {boolean} */ export function isObject(item: unknown): boolean { return item && typeof item === "object" && !Array.isArray(item); } /** * Deep merge two objects. * @param target * @param ...sources */ export default funct...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/utilities/getGlobals.ts
src/utilities/getGlobals.ts
import { unstable_cache } from "next/cache"; import { type DataFromGlobalSlug, getPayload } from "payload"; import { type Locale } from "@/i18n/config"; import configPromise from "@payload-config"; import type { Config } from "@/payload-types"; type Global = keyof Config["globals"]; async function getGlobal(slug: G...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/utilities/getCustomer.ts
src/utilities/getCustomer.ts
"use server"; import { unstable_cache } from "next/cache"; import { headers as getHeaders, cookies } from "next/headers"; import { getPayload } from "payload"; import config from "@payload-config"; export const getCustomer = async () => { const headers = await getHeaders(); const cookieStore = await cookies(); ...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/fields/noBlocksLexical.ts
src/fields/noBlocksLexical.ts
import { LinkFeature, lexicalEditor, BlocksFeature } from "@payloadcms/richtext-lexical"; import { type Config } from "payload"; // import { // BgColorFeature, // HighlightColorFeature, // TextColorFeature, // YoutubeFeature, // VimeoFeature, // } from "payloadcms-lexical-ext"; import { Carousel } from "@/bl...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/fields/linkGroup.ts
src/fields/linkGroup.ts
import deepMerge from "@/utilities/deepMerge"; import { link, type LinkAppearances } from "./link"; import type { ArrayField, Field } from "payload"; type LinkGroupType = (options?: { appearances?: LinkAppearances[] | false; overrides?: Partial<ArrayField>; }) => Field; export const linkGroup: LinkGroupType = (...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/fields/link.ts
src/fields/link.ts
import deepMerge from "@/utilities/deepMerge"; import type { Field } from "payload"; export type LinkAppearances = "default" | "outline"; export const appearanceOptions: Record<LinkAppearances, { label: string; value: string }> = { default: { label: "Default", value: "default", }, outline: { label:...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/fields/defaultLexical.ts
src/fields/defaultLexical.ts
import { LinkFeature, lexicalEditor } from "@payloadcms/richtext-lexical"; import { type Config } from "payload"; export const defaultLexical: Config["editor"] = lexicalEditor({ features: ({ defaultFeatures }) => { return [ ...defaultFeatures, LinkFeature({ enabledCollections: ["pages", "post...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/fields/radiusFields.ts
src/fields/radiusFields.ts
import { type Field } from "payload"; export const radiusFields: Field[] = [ { name: "radius", label: "Border Radius", type: "checkbox", defaultValue: false, }, { name: "specifiedRadius", label: "Specify Border Radius", type: "checkbox", defaultValue: false, admin: { con...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/fields/currencyField.ts
src/fields/currencyField.ts
import { type Field } from "payload"; export const currencyField: Field = { name: "currency", type: "text", required: true, admin: { components: { Field: "@/components/(ecommerce)/CurrencySelect#CurrencySelect", }, }, };
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/fields/courierSettingsFields.ts
src/fields/courierSettingsFields.ts
import { type Field } from "payload"; export const courierSettingsFields: Field[] = [ { name: "label", type: "text", label: { en: "Label", pl: "Etykieta" }, localized: true, required: true }, { name: "description", type: "text", label: { en: "Short description", pl: "Krótki opis" }, localized: true...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/fields/alignmentField.ts
src/fields/alignmentField.ts
import { type Field } from "payload"; export const AlignmentField: Field = { name: "alignment", label: "Alignment", type: "select", defaultValue: "center", options: [ { label: "Center", value: "center", }, { label: "Left", value: "left", }, { label: "Right", ...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/fields/freeShippingField.ts
src/fields/freeShippingField.ts
import { type Field } from "payload"; import { currencyField } from "./currencyField"; export const freeShippingField: Field = { name: "freeShipping", type: "array", label: { en: "Free shipping from", pl: "Darmowa dostawa od", }, labels: { singular: { en: "Price", pl: "Cena", }, ...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/fields/courierFields.ts
src/fields/courierFields.ts
import { type Field } from "payload"; import { countryPickerField } from "./countryPickerField"; import { courierSettingsFields } from "./courierSettingsFields"; import { freeShippingField } from "./freeShippingField"; import { weightRangesField } from "./weightRangesField"; export const courierFields: Field[] = [ ...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/fields/backgroundPicker.ts
src/fields/backgroundPicker.ts
import { type Field } from "payload"; export const backgroundPicker: Field = { name: "background", label: "Background", type: "text", admin: { components: { Field: "@/components/AdminColorPicker#AdminColorPicker", }, }, };
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/fields/countryPickerField.ts
src/fields/countryPickerField.ts
import { type Field } from "payload"; import { countryList } from "@/globals/(ecommerce)/Couriers/utils/countryList"; export const countryPickerField: Field = { name: "countries", type: "select", label: { en: "Countries", pl: "Kraje", }, hasMany: true, options: [...countryList], required: true, ...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/fields/spacingFields.ts
src/fields/spacingFields.ts
import { type Field } from "payload"; export const marginFields: Field = { type: "row", fields: [ { name: "spacingBottom", label: "Margin Bottom", type: "select", defaultValue: "none", options: [ { label: "None", value: "none", }, { ...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/fields/weightRangesField.ts
src/fields/weightRangesField.ts
import { type Field } from "payload"; import { currencyField } from "./currencyField"; export const weightRangesField: Field = { name: "range", type: "array", label: { en: "Weight ranges", pl: "Zakresy wagowe", }, labels: { plural: { en: "Weight ranges", pl: "Zakresy wagowe", }, ...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/fields/slug/SlugComponent.tsx
src/fields/slug/SlugComponent.tsx
"use client"; import { useField, Button, TextInput, FieldLabel, useFormFields, useForm } from "@payloadcms/ui"; import { type TextFieldClientProps } from "payload"; import { type MouseEvent, useCallback, useEffect } from "react"; import { formatSlug } from "./formatSlug"; import "./index.scss"; type SlugComponentProp...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/fields/slug/formatSlug.ts
src/fields/slug/formatSlug.ts
/* eslint-disable */ import type { FieldHook } from "payload"; export const formatSlug = (val: string): string => val .replace(/ /g, "-") .replace(/[^\w-]+/g, "") .toLowerCase(); export const formatSlugHook = (fallback: string): FieldHook => ({ data, operation, value }) => { if (typeof value ===...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
Mandala-Software-House/payload-ecommerce-template
https://github.com/Mandala-Software-House/payload-ecommerce-template/blob/2e26afe62722a058eb7004397be20e7f067676c0/src/fields/slug/index.ts
src/fields/slug/index.ts
import { formatSlugHook } from "./formatSlug"; import type { CheckboxField, TextField } from "payload"; type Overrides = { slugOverrides?: Partial<TextField>; checkboxOverrides?: Partial<CheckboxField>; }; type Slug = (fieldToUse?: string, overrides?: Overrides, localized?: boolean) => [TextField, CheckboxField]...
typescript
MIT
2e26afe62722a058eb7004397be20e7f067676c0
2026-01-05T05:00:59.033803Z
false
github/task-lists-element
https://github.com/github/task-lists-element/blob/cc4dc9219ec80409b8c27a7add98e192c110f783/src/task-lists-element.ts
src/task-lists-element.ts
import {SortEndArgs, isDragging, sortable} from './sortable' const observers = new WeakMap() export default class TaskListsElement extends HTMLElement { connectedCallback(): void { this.addEventListener('change', (event: Event) => { const checkbox = event.target if (!(checkbox instanceof HTMLInputEl...
typescript
MIT
cc4dc9219ec80409b8c27a7add98e192c110f783
2026-01-05T05:00:59.624565Z
false
github/task-lists-element
https://github.com/github/task-lists-element/blob/cc4dc9219ec80409b8c27a7add98e192c110f783/src/sortable.ts
src/sortable.ts
export interface SortEndArgs { src: {list: Element; index: number} dst: {list: Element; index: number} } type SortStartHandler = (srcList: Element) => unknown type SortEndHandler = (srcOrDst: SortEndArgs) => unknown interface DragState { didDrop: boolean dragging: Element dropzone: Element sourceList: Elem...
typescript
MIT
cc4dc9219ec80409b8c27a7add98e192c110f783
2026-01-05T05:00:59.624565Z
false
Xe/praise-me
https://github.com/Xe/praise-me/blob/802b82a43083408302fc3396c65c62f40912ba09/tailwind.config.ts
tailwind.config.ts
import { type Config } from "tailwindcss"; export default { content: [ "{routes,islands,components}/**/*.{ts,tsx}", ], theme: { extend: { fontFamily: { sans: ["Iosevka Aile Iaso", "sans-serif"], mono: ["Iosevka Curly Iaso", "monospace"], serif: ["Podkova", "serif"], },...
typescript
MIT
802b82a43083408302fc3396c65c62f40912ba09
2026-01-05T05:01:02.527812Z
false
Xe/praise-me
https://github.com/Xe/praise-me/blob/802b82a43083408302fc3396c65c62f40912ba09/dev.ts
dev.ts
#!/usr/bin/env -S deno run -A --watch=static/,routes/ import dev from "$fresh/dev.ts"; import config from "./fresh.config.ts"; import "$std/dotenv/load.ts"; await dev(import.meta.url, "./main.ts", config);
typescript
MIT
802b82a43083408302fc3396c65c62f40912ba09
2026-01-05T05:01:02.527812Z
false
Xe/praise-me
https://github.com/Xe/praise-me/blob/802b82a43083408302fc3396c65c62f40912ba09/fresh.gen.ts
fresh.gen.ts
// DO NOT EDIT. This file is generated by Fresh. // This file SHOULD be checked into source version control. // This file is automatically updated during development when running `dev.ts`. import * as $_404 from "./routes/_404.tsx"; import * as $_app from "./routes/_app.tsx"; import * as $api_joke from "./routes/api/j...
typescript
MIT
802b82a43083408302fc3396c65c62f40912ba09
2026-01-05T05:01:02.527812Z
false
Xe/praise-me
https://github.com/Xe/praise-me/blob/802b82a43083408302fc3396c65c62f40912ba09/fresh.config.ts
fresh.config.ts
import { defineConfig } from "$fresh/server.ts"; import tailwind from "$fresh/plugins/tailwind.ts"; export default defineConfig({ plugins: [tailwind()], });
typescript
MIT
802b82a43083408302fc3396c65c62f40912ba09
2026-01-05T05:01:02.527812Z
false
Xe/praise-me
https://github.com/Xe/praise-me/blob/802b82a43083408302fc3396c65c62f40912ba09/main.ts
main.ts
/// <reference no-default-lib="true" /> /// <reference lib="dom" /> /// <reference lib="dom.iterable" /> /// <reference lib="dom.asynciterable" /> /// <reference lib="deno.ns" /> /// <reference lib="deno.unstable" /> import "$std/dotenv/load.ts"; import { start } from "$fresh/server.ts"; import manifest from "./fresh...
typescript
MIT
802b82a43083408302fc3396c65c62f40912ba09
2026-01-05T05:01:02.527812Z
false
Xe/praise-me
https://github.com/Xe/praise-me/blob/802b82a43083408302fc3396c65c62f40912ba09/routes/_404.tsx
routes/_404.tsx
import { Head } from "$fresh/runtime.ts"; export default function Error404() { return ( <> <Head> <title>404 - Page not found</title> </Head> <div class="px-4 py-8 mx-auto bg-[#86efac]"> <div class="max-w-screen-md mx-auto flex flex-col items-center justify-center"> <h...
typescript
MIT
802b82a43083408302fc3396c65c62f40912ba09
2026-01-05T05:01:02.527812Z
false
Xe/praise-me
https://github.com/Xe/praise-me/blob/802b82a43083408302fc3396c65c62f40912ba09/routes/_app.tsx
routes/_app.tsx
import { type PageProps } from "$fresh/server.ts"; import Footer from "@/components/Footer.jsx"; export default function App({ Component }: PageProps) { return ( <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Pra...
typescript
MIT
802b82a43083408302fc3396c65c62f40912ba09
2026-01-05T05:01:02.527812Z
false
Xe/praise-me
https://github.com/Xe/praise-me/blob/802b82a43083408302fc3396c65c62f40912ba09/routes/delete.tsx
routes/delete.tsx
import DeleteBox from "@/islands/DeleteBox.tsx"; export default function DeletePage() { return ( <> <h1 class="pb-4 font-semibold text-2xl"> Remove my information </h1> <p class="pb-4"> This service stores any personal information in Canada. Personal information include...
typescript
MIT
802b82a43083408302fc3396c65c62f40912ba09
2026-01-05T05:01:02.527812Z
false
Xe/praise-me
https://github.com/Xe/praise-me/blob/802b82a43083408302fc3396c65c62f40912ba09/routes/index.tsx
routes/index.tsx
import PraiseBox from "@/islands/PraiseBox.tsx"; export default function Home() { return ( <> <PraiseBox /> <p class="py-4">Powered by Llama 3.1 70b and Fly.io GPUs.</p> { /* <h1 className="text-4xl pb-4">Oopsie whoopsie! UWU!!!</h1> <p> This is way more popular th...
typescript
MIT
802b82a43083408302fc3396c65c62f40912ba09
2026-01-05T05:01:02.527812Z
false
Xe/praise-me
https://github.com/Xe/praise-me/blob/802b82a43083408302fc3396c65c62f40912ba09/routes/api/joke.ts
routes/api/joke.ts
import { FreshContext } from "$fresh/server.ts"; // Jokes courtesy of https://punsandoneliners.com/randomness/programmer-jokes/ const JOKES = [ "Why do Java developers often wear glasses? They can't C#.", "A SQL query walks into a bar, goes up to two tables and says “can I join you?”", "Wasn't hard to crack Forr...
typescript
MIT
802b82a43083408302fc3396c65c62f40912ba09
2026-01-05T05:01:02.527812Z
false
Xe/praise-me
https://github.com/Xe/praise-me/blob/802b82a43083408302fc3396c65c62f40912ba09/routes/api/praise/[name].ts
routes/api/praise/[name].ts
import { FreshContext } from "$fresh/server.ts"; import { Client as OllamaClient } from "@/lib/ollama.ts"; import { Data, Repository } from "@/lib/praise.ts"; import { render } from "https://deno.land/x/gfm@0.6.0/mod.ts"; const kv = await Deno.openKv(); const ollama = new OllamaClient("http://praise-me-gpu.flycast"); ...
typescript
MIT
802b82a43083408302fc3396c65c62f40912ba09
2026-01-05T05:01:02.527812Z
false
Xe/praise-me
https://github.com/Xe/praise-me/blob/802b82a43083408302fc3396c65c62f40912ba09/components/Button.tsx
components/Button.tsx
import { JSX } from "preact"; import { IS_BROWSER } from "$fresh/runtime.ts"; export const BUTTON_CLASS = "px-2 py-1 border-gray-500 border-2 rounded bg-white dark:bg-black hover:bg-gray-200 dark:hover:bg-gray-800 transition-colors"; export function Button(props: JSX.HTMLAttributes<HTMLButtonElement>) { return ( ...
typescript
MIT
802b82a43083408302fc3396c65c62f40912ba09
2026-01-05T05:01:02.527812Z
false
Xe/praise-me
https://github.com/Xe/praise-me/blob/802b82a43083408302fc3396c65c62f40912ba09/islands/PraiseBox.tsx
islands/PraiseBox.tsx
import { useEffect, useState } from "preact/hooks"; import type { JSX } from "preact/jsx-runtime"; import { Button, BUTTON_CLASS } from "@/components/Button.tsx"; import { Data } from "@/lib/praise.ts"; import { convert } from "npm:html-to-text"; interface ServerResponse { data: Data; praise: string; } export def...
typescript
MIT
802b82a43083408302fc3396c65c62f40912ba09
2026-01-05T05:01:02.527812Z
false
Xe/praise-me
https://github.com/Xe/praise-me/blob/802b82a43083408302fc3396c65c62f40912ba09/islands/DeleteBox.tsx
islands/DeleteBox.tsx
import { useEffect, useState } from "preact/hooks"; import type { JSX } from "preact/jsx-runtime"; import { Button } from "@/components/Button.tsx"; export default function DeleteBox() { const [loading, setLoading] = useState<boolean>(false); const [username, setUsername] = useState<string>(""); const [error, se...
typescript
MIT
802b82a43083408302fc3396c65c62f40912ba09
2026-01-05T05:01:02.527812Z
false
Xe/praise-me
https://github.com/Xe/praise-me/blob/802b82a43083408302fc3396c65c62f40912ba09/islands/Counter.tsx
islands/Counter.tsx
import type { Signal } from "@preact/signals"; import { Button } from "../components/Button.tsx"; interface CounterProps { count: Signal<number>; } export default function Counter(props: CounterProps) { return ( <div class="flex gap-8 py-6"> <Button onClick={() => props.count.value -= 1}>-1</Button> ...
typescript
MIT
802b82a43083408302fc3396c65c62f40912ba09
2026-01-05T05:01:02.527812Z
false
Xe/praise-me
https://github.com/Xe/praise-me/blob/802b82a43083408302fc3396c65c62f40912ba09/lib/ollama.ts
lib/ollama.ts
export interface GenerateRequest { model: string; prompt: string; stream: boolean; format?: "json"; // Unused option // deno-lint-ignore no-explicit-any options?: any; system?: string; template?: string; context?: number[]; raw?: boolean; keep_alive: string; } export interface GenerateResponse ...
typescript
MIT
802b82a43083408302fc3396c65c62f40912ba09
2026-01-05T05:01:02.527812Z
false
Xe/praise-me
https://github.com/Xe/praise-me/blob/802b82a43083408302fc3396c65c62f40912ba09/lib/praise.ts
lib/praise.ts
export interface Data { username: string; avatar_url: string; name: string; bio: string; company: string; location: string; followers: number; following: number; readme: string; repositories: string; } export interface Repository { name: string, description: string, stargazers: number, lang...
typescript
MIT
802b82a43083408302fc3396c65c62f40912ba09
2026-01-05T05:01:02.527812Z
false
tomzorz/obsidian-link-archive
https://github.com/tomzorz/obsidian-link-archive/blob/e74aad2505fd9cb26e7728f454820587678876f4/main.ts
main.ts
import { MarkdownView, Notice, Plugin, request } from "obsidian"; import { waybackSaveUrl, waybackUrl } from "./constants"; import { defaultSettings as DEFAULT_SETTINGS, LinkArchivePluginSettings as LinkArchivePluginSettings, LinkArchiveSettingTab } from "./settings"; const urlRegex =/(\b(https?|file):\/\/[-A-Z0-9+&@#...
typescript
MIT
e74aad2505fd9cb26e7728f454820587678876f4
2026-01-05T05:01:03.232594Z
false
tomzorz/obsidian-link-archive
https://github.com/tomzorz/obsidian-link-archive/blob/e74aad2505fd9cb26e7728f454820587678876f4/settings.ts
settings.ts
import { App, PluginSettingTab, Setting } from "obsidian"; import ObsidianLinkArchivePlugin from "./main"; import { defaultArchiveText } from "./constants"; export const enum ArchiveOptions { Wayback, Archiveis, Both } // ReSharper disable once InconsistentNaming export interface LinkArchivePluginSettings { archi...
typescript
MIT
e74aad2505fd9cb26e7728f454820587678876f4
2026-01-05T05:01:03.232594Z
false
tomzorz/obsidian-link-archive
https://github.com/tomzorz/obsidian-link-archive/blob/e74aad2505fd9cb26e7728f454820587678876f4/constants.ts
constants.ts
export const defaultArchiveText = "(Archived)"; export const waybackUrl = "https://web.archive.org/web/"; export const waybackSaveUrl = "https://web.archive.org/save/";
typescript
MIT
e74aad2505fd9cb26e7728f454820587678876f4
2026-01-05T05:01:03.232594Z
false
mints-components/ui
https://github.com/mints-components/ui/blob/d4fe34f45d66639b8958b933eafa9949030b4f7e/vite.config.ts
vite.config.ts
import { resolve } from 'path'; import tailwindcss from '@tailwindcss/vite'; import react from '@vitejs/plugin-react'; import { visualizer } from 'rollup-plugin-visualizer'; import { defineConfig } from 'vite'; import { dependencies, peerDependencies } from './package.json'; // https://vitejs.dev/config/ export defa...
typescript
MIT
d4fe34f45d66639b8958b933eafa9949030b4f7e
2026-01-05T05:01:02.350684Z
false
mints-components/ui
https://github.com/mints-components/ui/blob/d4fe34f45d66639b8958b933eafa9949030b4f7e/.storybook/preview.tsx
.storybook/preview.tsx
import type { Preview, Decorator } from '@storybook/react-vite'; import './index.css'; export const globalTypes = { theme: { name: 'Theme', description: 'Global theme for components', defaultValue: 'light', toolbar: { items: [ { value: 'light', title: '🌞 Light' }, { value: 'da...
typescript
MIT
d4fe34f45d66639b8958b933eafa9949030b4f7e
2026-01-05T05:01:02.350684Z
false
mints-components/ui
https://github.com/mints-components/ui/blob/d4fe34f45d66639b8958b933eafa9949030b4f7e/.storybook/main.ts
.storybook/main.ts
import type { StorybookConfig } from '@storybook/react-vite'; const config: StorybookConfig = { stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'], addons: ['@storybook/addon-docs', '@chromatic-com/storybook'], framework: { name: '@storybook/react-vite', options: {}, }, }; export ...
typescript
MIT
d4fe34f45d66639b8958b933eafa9949030b4f7e
2026-01-05T05:01:02.350684Z
false
mints-components/ui
https://github.com/mints-components/ui/blob/d4fe34f45d66639b8958b933eafa9949030b4f7e/src/arrow.tsx
src/arrow.tsx
import clsx from 'clsx'; export type ArrowPlacement = 'top' | 'bottom' | 'left' | 'right'; export interface ArrowProps { placement?: ArrowPlacement; size?: number; className?: string; } export function Arrow({ placement = 'top', size = 6, className }: ArrowProps) { const rotation = { top: 'rotate-180', ...
typescript
MIT
d4fe34f45d66639b8958b933eafa9949030b4f7e
2026-01-05T05:01:02.350684Z
false
mints-components/ui
https://github.com/mints-components/ui/blob/d4fe34f45d66639b8958b933eafa9949030b4f7e/src/vite-env.d.ts
src/vite-env.d.ts
/// <reference types="vite/client" />
typescript
MIT
d4fe34f45d66639b8958b933eafa9949030b4f7e
2026-01-05T05:01:02.350684Z
false
mints-components/ui
https://github.com/mints-components/ui/blob/d4fe34f45d66639b8958b933eafa9949030b4f7e/src/index.ts
src/index.ts
export * from './auto-complete'; export * from './avatar'; export * from './badge'; export * from './button'; export * from './callout'; export * from './card'; export * from './checkbox'; export * from './collapse'; export * from './datepicker'; export * from './dialog'; export * from './divider'; export * from './dro...
typescript
MIT
d4fe34f45d66639b8958b933eafa9949030b4f7e
2026-01-05T05:01:02.350684Z
false
mints-components/ui
https://github.com/mints-components/ui/blob/d4fe34f45d66639b8958b933eafa9949030b4f7e/src/textarea/textarea.tsx
src/textarea/textarea.tsx
import clsx from 'clsx'; import React from 'react'; export type TextAreaSize = 'xs' | 'sm' | 'default' | 'lg'; export type TextAreaResize = 'none' | 'both' | 'x' | 'y'; type NativeTextAreaProps = Omit< React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'size' >; export interface TextAreaProps extends NativeTextA...
typescript
MIT
d4fe34f45d66639b8958b933eafa9949030b4f7e
2026-01-05T05:01:02.350684Z
false
mints-components/ui
https://github.com/mints-components/ui/blob/d4fe34f45d66639b8958b933eafa9949030b4f7e/src/textarea/textarea.stories.tsx
src/textarea/textarea.stories.tsx
import type { Meta, StoryObj } from '@storybook/react-vite'; import { TextArea } from './textarea'; const meta: Meta<typeof TextArea> = { title: 'Components/TextArea', component: TextArea, tags: ['autodocs'], parameters: { layout: 'centered', docs: { description: { component: '...
typescript
MIT
d4fe34f45d66639b8958b933eafa9949030b4f7e
2026-01-05T05:01:02.350684Z
false
mints-components/ui
https://github.com/mints-components/ui/blob/d4fe34f45d66639b8958b933eafa9949030b4f7e/src/textarea/index.ts
src/textarea/index.ts
export * from './textarea';
typescript
MIT
d4fe34f45d66639b8958b933eafa9949030b4f7e
2026-01-05T05:01:02.350684Z
false
mints-components/ui
https://github.com/mints-components/ui/blob/d4fe34f45d66639b8958b933eafa9949030b4f7e/src/auto-complete/auto-complete.stories.tsx
src/auto-complete/auto-complete.stories.tsx
import type { Meta, StoryObj } from '@storybook/react-vite'; import React from 'react'; import { AutoComplete } from './auto-complete'; function Input(props: React.InputHTMLAttributes<HTMLInputElement>) { return ( <input {...props} style={{ border: '1px solid #d97706', borderRadius: ...
typescript
MIT
d4fe34f45d66639b8958b933eafa9949030b4f7e
2026-01-05T05:01:02.350684Z
false
mints-components/ui
https://github.com/mints-components/ui/blob/d4fe34f45d66639b8958b933eafa9949030b4f7e/src/auto-complete/auto-complete.tsx
src/auto-complete/auto-complete.tsx
import clsx from 'clsx'; import React, { useRef, useState, useEffect } from 'react'; import { Button } from '../button'; import { Close } from '../icons'; import { Input, InputProps } from '../input'; import { Spinner } from '../spinner'; export interface AutoCompleteOption { label: React.ReactNode; value: string...
typescript
MIT
d4fe34f45d66639b8958b933eafa9949030b4f7e
2026-01-05T05:01:02.350684Z
false
mints-components/ui
https://github.com/mints-components/ui/blob/d4fe34f45d66639b8958b933eafa9949030b4f7e/src/auto-complete/index.ts
src/auto-complete/index.ts
export * from './auto-complete';
typescript
MIT
d4fe34f45d66639b8958b933eafa9949030b4f7e
2026-01-05T05:01:02.350684Z
false
mints-components/ui
https://github.com/mints-components/ui/blob/d4fe34f45d66639b8958b933eafa9949030b4f7e/src/tooltip/tooltip.stories.tsx
src/tooltip/tooltip.stories.tsx
import type { Meta, StoryObj } from '@storybook/react-vite'; import { Tooltip } from './tooltip'; const meta: Meta<typeof Tooltip> = { title: 'Components/Tooltip', component: Tooltip, tags: ['autodocs'], parameters: { layout: 'centered', docs: { description: { component: 'A Too...
typescript
MIT
d4fe34f45d66639b8958b933eafa9949030b4f7e
2026-01-05T05:01:02.350684Z
false
mints-components/ui
https://github.com/mints-components/ui/blob/d4fe34f45d66639b8958b933eafa9949030b4f7e/src/tooltip/tooltip.tsx
src/tooltip/tooltip.tsx
import clsx from 'clsx'; import React, { useRef, useState } from 'react'; import { Arrow } from '../arrow'; export type TooltipPlacement = 'top' | 'bottom' | 'left' | 'right'; export interface TooltipProps { content: React.ReactNode; placement?: TooltipPlacement; delay?: number; className?: string; childre...
typescript
MIT
d4fe34f45d66639b8958b933eafa9949030b4f7e
2026-01-05T05:01:02.350684Z
false
mints-components/ui
https://github.com/mints-components/ui/blob/d4fe34f45d66639b8958b933eafa9949030b4f7e/src/tooltip/index.ts
src/tooltip/index.ts
export * from './tooltip';
typescript
MIT
d4fe34f45d66639b8958b933eafa9949030b4f7e
2026-01-05T05:01:02.350684Z
false