@commercebuild/extension 0.0.1 → 0.0.3
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/config/tsconfig.extension.json +1 -1
- package/package.json +1 -2
- package/types/global.d.ts +83 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercebuild/extension",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"types": "./types/index.d.ts",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -23,7 +23,6 @@
|
|
|
23
23
|
"chalk": "^5.4.1",
|
|
24
24
|
"esbuild": "^0.20.0",
|
|
25
25
|
"lucide-react": "^0.525.0",
|
|
26
|
-
"next": "^15.3.5",
|
|
27
26
|
"react": "^19.1.0",
|
|
28
27
|
"react-dom": "^19.1.0",
|
|
29
28
|
"tailwindcss": "^4.1.11",
|
package/types/global.d.ts
CHANGED
|
@@ -1,15 +1,91 @@
|
|
|
1
|
-
import NextLink from "next/link";
|
|
2
|
-
import NextImage from "next/image";
|
|
3
|
-
import * as uis from "@commercebuild/ui";
|
|
4
|
-
import * as icons from "lucide-react";
|
|
5
|
-
import * as React from "react";
|
|
6
1
|
import {
|
|
7
2
|
Disclosure,
|
|
8
3
|
DisclosureButton,
|
|
9
4
|
DisclosurePanel,
|
|
10
5
|
} from "@headlessui/react";
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
import * as uis from "@commercebuild/ui";
|
|
7
|
+
import * as icons from "lucide-react";
|
|
8
|
+
import * as React from "react";
|
|
9
|
+
import type { UrlObject } from "url";
|
|
10
|
+
|
|
11
|
+
// === Link and Image from nextjs =============================================
|
|
12
|
+
type Url = string | UrlObject;
|
|
13
|
+
type OnNavigateEventHandler = (event: { preventDefault: () => void }) => void;
|
|
14
|
+
type InternalLinkProps = {
|
|
15
|
+
href: Url;
|
|
16
|
+
as?: Url;
|
|
17
|
+
replace?: boolean;
|
|
18
|
+
scroll?: boolean;
|
|
19
|
+
shallow?: boolean;
|
|
20
|
+
passHref?: boolean;
|
|
21
|
+
prefetch?: boolean | null;
|
|
22
|
+
locale?: string | false;
|
|
23
|
+
legacyBehavior?: boolean;
|
|
24
|
+
onMouseEnter?: React.MouseEventHandler<HTMLAnchorElement>;
|
|
25
|
+
onTouchStart?: React.TouchEventHandler<HTMLAnchorElement>;
|
|
26
|
+
onClick?: React.MouseEventHandler<HTMLAnchorElement>;
|
|
27
|
+
children?: React.ReactNode | undefined;
|
|
28
|
+
onNavigate?: OnNavigateEventHandler;
|
|
29
|
+
} & React.RefAttributes<HTMLAnchorElement>;
|
|
30
|
+
|
|
31
|
+
declare const NextLink: React.ForwardRefExoticComponent<
|
|
32
|
+
Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, keyof InternalLinkProps> &
|
|
33
|
+
InternalLinkProps & {
|
|
34
|
+
children?: React.ReactNode | undefined;
|
|
35
|
+
} & React.RefAttributes<HTMLAnchorElement>
|
|
36
|
+
>;
|
|
37
|
+
|
|
38
|
+
export interface StaticImageData {
|
|
39
|
+
src: string;
|
|
40
|
+
height: number;
|
|
41
|
+
width: number;
|
|
42
|
+
blurDataURL?: string;
|
|
43
|
+
blurWidth?: number;
|
|
44
|
+
blurHeight?: number;
|
|
45
|
+
}
|
|
46
|
+
export interface StaticRequire {
|
|
47
|
+
default: StaticImageData;
|
|
48
|
+
}
|
|
49
|
+
export type StaticImport = StaticRequire | StaticImageData;
|
|
50
|
+
export type ImageLoaderProps = {
|
|
51
|
+
src: string;
|
|
52
|
+
width: number;
|
|
53
|
+
quality?: number;
|
|
54
|
+
};
|
|
55
|
+
export type ImageLoader = (p: ImageLoaderProps) => string;
|
|
56
|
+
export type PlaceholderValue = "blur" | "empty" | `data:image/${string}`;
|
|
57
|
+
export type OnLoadingComplete = (img: HTMLImageElement) => void;
|
|
58
|
+
declare const NextImage: React.ForwardRefExoticComponent<
|
|
59
|
+
Omit<
|
|
60
|
+
React.DetailedHTMLProps<
|
|
61
|
+
React.ImgHTMLAttributes<HTMLImageElement>,
|
|
62
|
+
HTMLImageElement
|
|
63
|
+
>,
|
|
64
|
+
"height" | "width" | "loading" | "ref" | "alt" | "src" | "srcSet"
|
|
65
|
+
> & {
|
|
66
|
+
src: string | StaticImport;
|
|
67
|
+
alt: string;
|
|
68
|
+
width?: number | `${number}`;
|
|
69
|
+
height?: number | `${number}`;
|
|
70
|
+
fill?: boolean;
|
|
71
|
+
loader?: ImageLoader;
|
|
72
|
+
quality?: number | `${number}`;
|
|
73
|
+
priority?: boolean;
|
|
74
|
+
loading?: "eager" | "lazy" | undefined;
|
|
75
|
+
placeholder?: PlaceholderValue;
|
|
76
|
+
blurDataURL?: string;
|
|
77
|
+
unoptimized?: boolean;
|
|
78
|
+
overrideSrc?: string;
|
|
79
|
+
onLoadingComplete?: OnLoadingComplete;
|
|
80
|
+
layout?: string;
|
|
81
|
+
objectFit?: string;
|
|
82
|
+
objectPosition?: string;
|
|
83
|
+
lazyBoundary?: string;
|
|
84
|
+
lazyRoot?: string;
|
|
85
|
+
} & React.RefAttributes<HTMLImageElement | null>
|
|
86
|
+
>;
|
|
87
|
+
|
|
88
|
+
// ============================================================================
|
|
13
89
|
|
|
14
90
|
declare global {
|
|
15
91
|
const cb: {
|