@m1kapp/kit 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -553,178 +553,6 @@ interface DialogProps {
553
553
  */
554
554
  declare function Dialog({ open, onClose, title, size, children, persistent, className, }: DialogProps): React__default.ReactPortal | null;
555
555
 
556
- interface OGConfig {
557
- /** 앱 이름 (좌상단 로고) */
558
- appName?: string;
559
- /** 브랜드 색상 (hex) */
560
- color?: string;
561
- /** 하단 도메인 */
562
- domain?: string;
563
- /** 배경 스타일 — "dark"(기본) | "gradient"(다크 오로라) | "blend"(라이트 파스텔 블렌드) */
564
- bg?: "dark" | "gradient" | "blend";
565
- /** 로고 이미지 URL (지정 시 appName 첫 글자 대신 이미지 표시) */
566
- logoUrl?: string;
567
- }
568
- interface OGDefaultTemplate {
569
- type?: "default";
570
- title: string;
571
- sub?: string;
572
- badge?: string;
573
- }
574
- interface OGMatchTemplate {
575
- type: "match";
576
- home: string;
577
- away: string;
578
- score?: string;
579
- sub?: string;
580
- badge?: string;
581
- }
582
- interface OGSquareTemplate {
583
- type: "square";
584
- title: string;
585
- sub?: string;
586
- badge?: string;
587
- }
588
- interface OGIconTemplate {
589
- type: "icon";
590
- /** 아이콘에 표시할 글자 (기본: appName 첫 글자) */
591
- letter?: string;
592
- /** 아이콘 모서리 둥글기 (기본: 96) */
593
- radius?: number;
594
- }
595
- interface OGArticleTemplate {
596
- type: "article";
597
- title: string;
598
- /** 작성자 */
599
- author?: string;
600
- /** 날짜 또는 발행일 */
601
- date?: string;
602
- /** 카테고리 / 태그 */
603
- category?: string;
604
- sub?: string;
605
- }
606
- interface OGStatTemplate {
607
- type: "stat";
608
- /** 강조할 숫자 또는 지표 */
609
- stat: string;
610
- /** 지표 설명 */
611
- label: string;
612
- sub?: string;
613
- badge?: string;
614
- }
615
- interface OGProductTemplate {
616
- type: "product";
617
- title: string;
618
- tagline?: string;
619
- /** 핵심 특징 (최대 3개) */
620
- features?: string[];
621
- badge?: string;
622
- }
623
- type OGTemplate = OGDefaultTemplate | OGMatchTemplate | OGSquareTemplate | OGIconTemplate | OGArticleTemplate | OGStatTemplate | OGProductTemplate;
624
- type OGProps = OGTemplate & OGConfig;
625
- declare function OGImage(props: OGProps): react_jsx_runtime.JSX.Element;
626
-
627
- /** @vercel/og (Satori) fonts 옵션에 넘길 수 있는 폰트 정의 */
628
- interface OGFont {
629
- name: string;
630
- data: ArrayBuffer;
631
- weight: 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;
632
- style?: "normal" | "italic";
633
- }
634
- declare const PRETENDARD_WEIGHTS: {
635
- readonly 400: "Pretendard-Regular.otf";
636
- readonly 700: "Pretendard-Bold.otf";
637
- readonly 900: "Pretendard-Black.otf";
638
- };
639
- type PretendardWeight = keyof typeof PRETENDARD_WEIGHTS;
640
- /**
641
- * Pretendard 폰트를 CDN에서 로드합니다.
642
- *
643
- * @example
644
- * ```ts
645
- * import { OG, loadPretendard } from "@m1kapp/seo";
646
- * import { ImageResponse } from "next/og";
647
- *
648
- * export async function GET() {
649
- * const fonts = await loadPretendard();
650
- * return new ImageResponse(<OG type="default" title="Hello" />, {
651
- * width: 1200, height: 630, fonts,
652
- * });
653
- * }
654
- * ```
655
- *
656
- * @param weights 로드할 weight 배열 (기본: [700, 900])
657
- */
658
- declare function loadPretendard(weights?: PretendardWeight[]): Promise<OGFont[]>;
659
- /**
660
- * 임의의 URL에서 폰트를 로드합니다.
661
- *
662
- * @example
663
- * ```ts
664
- * const fonts = await loadFont({
665
- * name: "CustomFont",
666
- * url: "https://example.com/CustomFont-Bold.otf",
667
- * weight: 700,
668
- * });
669
- * ```
670
- */
671
- declare function loadFont(opts: {
672
- name: string;
673
- url: string;
674
- weight?: OGFont["weight"];
675
- style?: OGFont["style"];
676
- }): Promise<OGFont>;
677
- /**
678
- * Google Fonts에서 폰트를 로드합니다.
679
- * CSS 응답을 파싱해 TTF/OTF URL을 자동 추출합니다.
680
- *
681
- * @example
682
- * ```ts
683
- * const fonts = await loadGoogleFont("Noto Sans KR", [400, 700]);
684
- * return new ImageResponse(<OG ... />, { fonts });
685
- * ```
686
- */
687
- declare function loadGoogleFont(family: string, weights?: OGFont["weight"][]): Promise<OGFont[]>;
688
-
689
- /**
690
- * @vercel/og ImageResponse에서 지원하는 이모지 스타일.
691
- * ImageResponse 옵션의 `emoji` 필드에 넘기면 됩니다.
692
- */
693
- type EmojiStyle = "twemoji" | "openmoji" | "noto" | "fluent" | "fluentFlat" | "blobmoji";
694
- /**
695
- * raw Satori의 `loadAdditionalAsset` 콜백을 생성합니다.
696
- *
697
- * @example
698
- * ```ts
699
- * import satori from "satori";
700
- * import { createEmojiLoader } from "@m1kapp/seo";
701
- *
702
- * const svg = await satori(<OG ... />, {
703
- * width: 1200, height: 630,
704
- * fonts: [...],
705
- * loadAdditionalAsset: createEmojiLoader(),
706
- * });
707
- * ```
708
- */
709
- declare function createEmojiLoader(): (code: string, segment: string) => Promise<string | undefined>;
710
-
711
- /**
712
- * OG 이미지 URL의 캐시를 즉시 무효화할 버전 키를 반환합니다.
713
- *
714
- * Cache-Control로 CDN에 캐싱된 OG 이미지를 강제 갱신하고 싶을 때
715
- * URL의 `v` 파라미터에 이 값을 넣으세요.
716
- *
717
- * @example
718
- * ```ts
719
- * import { getOGVersion } from "@m1kapp/seo";
720
- *
721
- * // OG 갱신 버튼 핸들러
722
- * const freshUrl = `/og?title=${title}&v=${getOGVersion()}`;
723
- * // → /og?title=...&v=20260415152347
724
- * ```
725
- */
726
- declare function getOGVersion(): string;
727
-
728
556
  type PWAInstallState = "android-ready" | "ios-safari" | "installed" | "unsupported";
729
557
  interface UsePWAInstallReturn {
730
558
  state: PWAInstallState;
@@ -919,4 +747,4 @@ declare function formatNumber(n: number): string;
919
747
  declare function formatPrice(amount: number, currency?: string, locale?: string): string;
920
748
  declare function cn(...classes: (string | undefined | null | false | 0)[]): string;
921
749
 
922
- export { type ApiClient, type ApiClientOptions, ApiError, AppShell, AppShellContent, type AppShellContentProps, AppShellHeader, type AppShellHeaderProps, type AppShellProps, Avatar, type AvatarProps, Badge, type BadgeProps, Button, type ButtonProps, type ColorName, Dialog, type DialogProps, Divider, EmojiButton, type EmojiButtonProps, EmojiPicker, type EmojiPickerProps, type EmojiStyle, EmptyState, type EmptyStateProps, type FontName, GrassMap, type GrassMapData, type GrassMapProps, IOSInstallSheet, type OGArticleTemplate, type OGConfig, type OGDefaultTemplate, type OGFont, type OGIconTemplate, OGImage, type OGMatchTemplate, type OGProductTemplate, type OGProps, type OGSquareTemplate, type OGStatTemplate, type OGTemplate, PWAInstallButton, type PWAInstallState, Section, SectionHeader, type SectionHeaderProps, type SectionProps, ShareButton, type ShareButtonProps, Skeleton, type SkeletonProps, StatChip, type StatChipProps, THEME_SCRIPT, Tab, TabBar, type TabBarProps, type TabProps, ThemeButton, type ThemeButtonProps, ThemeDialog, type ThemeDialogProps, type ToastOptions, ToastProvider, type ToastVariant, Tooltip, type TooltipProps, Typewriter, type TypewriterProps, type UseFetchOptions, type UseFetchResult, type UseFormSubmitOptions, type UseFormSubmitResult, type UseInViewOptions, type UseInViewResult, type UsePWAInstallReturn, type UsePollingOptions, type UsePollingResult, type UseShareOptions, type UseShareReturn, Watermark, type WatermarkProps, type WatermarkSponsor, clearFetchCache, cn, colors, createApiClient, createEmojiLoader, createManifest, fontFamily, fonts, formatNumber, formatPrice, getOGVersion, loadFont, loadGoogleFont, loadPretendard, mobileViewport, relativeTime, svgIcon, useDebounce, useFetch, useFormSubmit, useInView, useLocalStorage, usePWAInstall, usePolling, useShare, useToast };
750
+ export { type ApiClient, type ApiClientOptions, ApiError, AppShell, AppShellContent, type AppShellContentProps, AppShellHeader, type AppShellHeaderProps, type AppShellProps, Avatar, type AvatarProps, Badge, type BadgeProps, Button, type ButtonProps, type ColorName, Dialog, type DialogProps, Divider, EmojiButton, type EmojiButtonProps, EmojiPicker, type EmojiPickerProps, EmptyState, type EmptyStateProps, type FontName, GrassMap, type GrassMapData, type GrassMapProps, IOSInstallSheet, PWAInstallButton, type PWAInstallState, Section, SectionHeader, type SectionHeaderProps, type SectionProps, ShareButton, type ShareButtonProps, Skeleton, type SkeletonProps, StatChip, type StatChipProps, THEME_SCRIPT, Tab, TabBar, type TabBarProps, type TabProps, ThemeButton, type ThemeButtonProps, ThemeDialog, type ThemeDialogProps, type ToastOptions, ToastProvider, type ToastVariant, Tooltip, type TooltipProps, Typewriter, type TypewriterProps, type UseFetchOptions, type UseFetchResult, type UseFormSubmitOptions, type UseFormSubmitResult, type UseInViewOptions, type UseInViewResult, type UsePWAInstallReturn, type UsePollingOptions, type UsePollingResult, type UseShareOptions, type UseShareReturn, Watermark, type WatermarkProps, type WatermarkSponsor, clearFetchCache, cn, colors, createApiClient, createManifest, fontFamily, fonts, formatNumber, formatPrice, mobileViewport, relativeTime, svgIcon, useDebounce, useFetch, useFormSubmit, useInView, useLocalStorage, usePWAInstall, usePolling, useShare, useToast };
package/dist/index.d.ts CHANGED
@@ -553,178 +553,6 @@ interface DialogProps {
553
553
  */
554
554
  declare function Dialog({ open, onClose, title, size, children, persistent, className, }: DialogProps): React__default.ReactPortal | null;
555
555
 
556
- interface OGConfig {
557
- /** 앱 이름 (좌상단 로고) */
558
- appName?: string;
559
- /** 브랜드 색상 (hex) */
560
- color?: string;
561
- /** 하단 도메인 */
562
- domain?: string;
563
- /** 배경 스타일 — "dark"(기본) | "gradient"(다크 오로라) | "blend"(라이트 파스텔 블렌드) */
564
- bg?: "dark" | "gradient" | "blend";
565
- /** 로고 이미지 URL (지정 시 appName 첫 글자 대신 이미지 표시) */
566
- logoUrl?: string;
567
- }
568
- interface OGDefaultTemplate {
569
- type?: "default";
570
- title: string;
571
- sub?: string;
572
- badge?: string;
573
- }
574
- interface OGMatchTemplate {
575
- type: "match";
576
- home: string;
577
- away: string;
578
- score?: string;
579
- sub?: string;
580
- badge?: string;
581
- }
582
- interface OGSquareTemplate {
583
- type: "square";
584
- title: string;
585
- sub?: string;
586
- badge?: string;
587
- }
588
- interface OGIconTemplate {
589
- type: "icon";
590
- /** 아이콘에 표시할 글자 (기본: appName 첫 글자) */
591
- letter?: string;
592
- /** 아이콘 모서리 둥글기 (기본: 96) */
593
- radius?: number;
594
- }
595
- interface OGArticleTemplate {
596
- type: "article";
597
- title: string;
598
- /** 작성자 */
599
- author?: string;
600
- /** 날짜 또는 발행일 */
601
- date?: string;
602
- /** 카테고리 / 태그 */
603
- category?: string;
604
- sub?: string;
605
- }
606
- interface OGStatTemplate {
607
- type: "stat";
608
- /** 강조할 숫자 또는 지표 */
609
- stat: string;
610
- /** 지표 설명 */
611
- label: string;
612
- sub?: string;
613
- badge?: string;
614
- }
615
- interface OGProductTemplate {
616
- type: "product";
617
- title: string;
618
- tagline?: string;
619
- /** 핵심 특징 (최대 3개) */
620
- features?: string[];
621
- badge?: string;
622
- }
623
- type OGTemplate = OGDefaultTemplate | OGMatchTemplate | OGSquareTemplate | OGIconTemplate | OGArticleTemplate | OGStatTemplate | OGProductTemplate;
624
- type OGProps = OGTemplate & OGConfig;
625
- declare function OGImage(props: OGProps): react_jsx_runtime.JSX.Element;
626
-
627
- /** @vercel/og (Satori) fonts 옵션에 넘길 수 있는 폰트 정의 */
628
- interface OGFont {
629
- name: string;
630
- data: ArrayBuffer;
631
- weight: 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;
632
- style?: "normal" | "italic";
633
- }
634
- declare const PRETENDARD_WEIGHTS: {
635
- readonly 400: "Pretendard-Regular.otf";
636
- readonly 700: "Pretendard-Bold.otf";
637
- readonly 900: "Pretendard-Black.otf";
638
- };
639
- type PretendardWeight = keyof typeof PRETENDARD_WEIGHTS;
640
- /**
641
- * Pretendard 폰트를 CDN에서 로드합니다.
642
- *
643
- * @example
644
- * ```ts
645
- * import { OG, loadPretendard } from "@m1kapp/seo";
646
- * import { ImageResponse } from "next/og";
647
- *
648
- * export async function GET() {
649
- * const fonts = await loadPretendard();
650
- * return new ImageResponse(<OG type="default" title="Hello" />, {
651
- * width: 1200, height: 630, fonts,
652
- * });
653
- * }
654
- * ```
655
- *
656
- * @param weights 로드할 weight 배열 (기본: [700, 900])
657
- */
658
- declare function loadPretendard(weights?: PretendardWeight[]): Promise<OGFont[]>;
659
- /**
660
- * 임의의 URL에서 폰트를 로드합니다.
661
- *
662
- * @example
663
- * ```ts
664
- * const fonts = await loadFont({
665
- * name: "CustomFont",
666
- * url: "https://example.com/CustomFont-Bold.otf",
667
- * weight: 700,
668
- * });
669
- * ```
670
- */
671
- declare function loadFont(opts: {
672
- name: string;
673
- url: string;
674
- weight?: OGFont["weight"];
675
- style?: OGFont["style"];
676
- }): Promise<OGFont>;
677
- /**
678
- * Google Fonts에서 폰트를 로드합니다.
679
- * CSS 응답을 파싱해 TTF/OTF URL을 자동 추출합니다.
680
- *
681
- * @example
682
- * ```ts
683
- * const fonts = await loadGoogleFont("Noto Sans KR", [400, 700]);
684
- * return new ImageResponse(<OG ... />, { fonts });
685
- * ```
686
- */
687
- declare function loadGoogleFont(family: string, weights?: OGFont["weight"][]): Promise<OGFont[]>;
688
-
689
- /**
690
- * @vercel/og ImageResponse에서 지원하는 이모지 스타일.
691
- * ImageResponse 옵션의 `emoji` 필드에 넘기면 됩니다.
692
- */
693
- type EmojiStyle = "twemoji" | "openmoji" | "noto" | "fluent" | "fluentFlat" | "blobmoji";
694
- /**
695
- * raw Satori의 `loadAdditionalAsset` 콜백을 생성합니다.
696
- *
697
- * @example
698
- * ```ts
699
- * import satori from "satori";
700
- * import { createEmojiLoader } from "@m1kapp/seo";
701
- *
702
- * const svg = await satori(<OG ... />, {
703
- * width: 1200, height: 630,
704
- * fonts: [...],
705
- * loadAdditionalAsset: createEmojiLoader(),
706
- * });
707
- * ```
708
- */
709
- declare function createEmojiLoader(): (code: string, segment: string) => Promise<string | undefined>;
710
-
711
- /**
712
- * OG 이미지 URL의 캐시를 즉시 무효화할 버전 키를 반환합니다.
713
- *
714
- * Cache-Control로 CDN에 캐싱된 OG 이미지를 강제 갱신하고 싶을 때
715
- * URL의 `v` 파라미터에 이 값을 넣으세요.
716
- *
717
- * @example
718
- * ```ts
719
- * import { getOGVersion } from "@m1kapp/seo";
720
- *
721
- * // OG 갱신 버튼 핸들러
722
- * const freshUrl = `/og?title=${title}&v=${getOGVersion()}`;
723
- * // → /og?title=...&v=20260415152347
724
- * ```
725
- */
726
- declare function getOGVersion(): string;
727
-
728
556
  type PWAInstallState = "android-ready" | "ios-safari" | "installed" | "unsupported";
729
557
  interface UsePWAInstallReturn {
730
558
  state: PWAInstallState;
@@ -919,4 +747,4 @@ declare function formatNumber(n: number): string;
919
747
  declare function formatPrice(amount: number, currency?: string, locale?: string): string;
920
748
  declare function cn(...classes: (string | undefined | null | false | 0)[]): string;
921
749
 
922
- export { type ApiClient, type ApiClientOptions, ApiError, AppShell, AppShellContent, type AppShellContentProps, AppShellHeader, type AppShellHeaderProps, type AppShellProps, Avatar, type AvatarProps, Badge, type BadgeProps, Button, type ButtonProps, type ColorName, Dialog, type DialogProps, Divider, EmojiButton, type EmojiButtonProps, EmojiPicker, type EmojiPickerProps, type EmojiStyle, EmptyState, type EmptyStateProps, type FontName, GrassMap, type GrassMapData, type GrassMapProps, IOSInstallSheet, type OGArticleTemplate, type OGConfig, type OGDefaultTemplate, type OGFont, type OGIconTemplate, OGImage, type OGMatchTemplate, type OGProductTemplate, type OGProps, type OGSquareTemplate, type OGStatTemplate, type OGTemplate, PWAInstallButton, type PWAInstallState, Section, SectionHeader, type SectionHeaderProps, type SectionProps, ShareButton, type ShareButtonProps, Skeleton, type SkeletonProps, StatChip, type StatChipProps, THEME_SCRIPT, Tab, TabBar, type TabBarProps, type TabProps, ThemeButton, type ThemeButtonProps, ThemeDialog, type ThemeDialogProps, type ToastOptions, ToastProvider, type ToastVariant, Tooltip, type TooltipProps, Typewriter, type TypewriterProps, type UseFetchOptions, type UseFetchResult, type UseFormSubmitOptions, type UseFormSubmitResult, type UseInViewOptions, type UseInViewResult, type UsePWAInstallReturn, type UsePollingOptions, type UsePollingResult, type UseShareOptions, type UseShareReturn, Watermark, type WatermarkProps, type WatermarkSponsor, clearFetchCache, cn, colors, createApiClient, createEmojiLoader, createManifest, fontFamily, fonts, formatNumber, formatPrice, getOGVersion, loadFont, loadGoogleFont, loadPretendard, mobileViewport, relativeTime, svgIcon, useDebounce, useFetch, useFormSubmit, useInView, useLocalStorage, usePWAInstall, usePolling, useShare, useToast };
750
+ export { type ApiClient, type ApiClientOptions, ApiError, AppShell, AppShellContent, type AppShellContentProps, AppShellHeader, type AppShellHeaderProps, type AppShellProps, Avatar, type AvatarProps, Badge, type BadgeProps, Button, type ButtonProps, type ColorName, Dialog, type DialogProps, Divider, EmojiButton, type EmojiButtonProps, EmojiPicker, type EmojiPickerProps, EmptyState, type EmptyStateProps, type FontName, GrassMap, type GrassMapData, type GrassMapProps, IOSInstallSheet, PWAInstallButton, type PWAInstallState, Section, SectionHeader, type SectionHeaderProps, type SectionProps, ShareButton, type ShareButtonProps, Skeleton, type SkeletonProps, StatChip, type StatChipProps, THEME_SCRIPT, Tab, TabBar, type TabBarProps, type TabProps, ThemeButton, type ThemeButtonProps, ThemeDialog, type ThemeDialogProps, type ToastOptions, ToastProvider, type ToastVariant, Tooltip, type TooltipProps, Typewriter, type TypewriterProps, type UseFetchOptions, type UseFetchResult, type UseFormSubmitOptions, type UseFormSubmitResult, type UseInViewOptions, type UseInViewResult, type UsePWAInstallReturn, type UsePollingOptions, type UsePollingResult, type UseShareOptions, type UseShareReturn, Watermark, type WatermarkProps, type WatermarkSponsor, clearFetchCache, cn, colors, createApiClient, createManifest, fontFamily, fonts, formatNumber, formatPrice, mobileViewport, relativeTime, svgIcon, useDebounce, useFetch, useFormSubmit, useInView, useLocalStorage, usePWAInstall, usePolling, useShare, useToast };