@weaverse/react 0.7.47 → 0.7.50
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.ts +216 -0
- package/package.json +2 -2
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { WeaverseType, Weaverse, ElementCSS, WeaverseItemStore, WeaverseElement } from '@weaverse/core';
|
|
2
|
+
export * from '@weaverse/core';
|
|
3
|
+
import * as React$1 from 'react';
|
|
4
|
+
import React__default, { HTMLAttributes, ReactElement, ReactNode, CSSProperties } from 'react';
|
|
5
|
+
import * as _radix_ui_react_dialog from '@radix-ui/react-dialog';
|
|
6
|
+
import { DialogContentProps, DialogProps, DialogTitleProps, DialogCloseProps } from '@radix-ui/react-dialog';
|
|
7
|
+
|
|
8
|
+
declare let createRootContext: (configs: WeaverseType) => Weaverse;
|
|
9
|
+
declare let WeaverseContext: React$1.Context<Weaverse>;
|
|
10
|
+
declare let WeaverseContextProvider: React$1.Provider<Weaverse>;
|
|
11
|
+
declare let WeaverseContextConsumer: React$1.Consumer<Weaverse>;
|
|
12
|
+
|
|
13
|
+
declare let CircleNotch: (props: HTMLAttributes<SVGElement>) => JSX.Element;
|
|
14
|
+
declare let X: (props: HTMLAttributes<SVGElement>) => JSX.Element;
|
|
15
|
+
declare let Minus: (props: HTMLAttributes<SVGElement>) => JSX.Element;
|
|
16
|
+
declare let Plus: (props: HTMLAttributes<SVGElement>) => JSX.Element;
|
|
17
|
+
declare let ArrowLeft: (props: HTMLAttributes<SVGElement>) => JSX.Element;
|
|
18
|
+
declare let ArrowRight: (props: HTMLAttributes<SVGElement>) => JSX.Element;
|
|
19
|
+
declare let Image: (props: HTMLAttributes<SVGElement>) => JSX.Element;
|
|
20
|
+
declare let ShoppingCart: (props: HTMLAttributes<SVGElement>) => JSX.Element;
|
|
21
|
+
declare let Eye: (props: HTMLAttributes<SVGElement>) => JSX.Element;
|
|
22
|
+
|
|
23
|
+
declare const PhosphorIcons_CircleNotch: typeof CircleNotch;
|
|
24
|
+
declare const PhosphorIcons_X: typeof X;
|
|
25
|
+
declare const PhosphorIcons_Minus: typeof Minus;
|
|
26
|
+
declare const PhosphorIcons_Plus: typeof Plus;
|
|
27
|
+
declare const PhosphorIcons_ArrowLeft: typeof ArrowLeft;
|
|
28
|
+
declare const PhosphorIcons_ArrowRight: typeof ArrowRight;
|
|
29
|
+
declare const PhosphorIcons_Image: typeof Image;
|
|
30
|
+
declare const PhosphorIcons_ShoppingCart: typeof ShoppingCart;
|
|
31
|
+
declare const PhosphorIcons_Eye: typeof Eye;
|
|
32
|
+
declare namespace PhosphorIcons {
|
|
33
|
+
export {
|
|
34
|
+
PhosphorIcons_CircleNotch as CircleNotch,
|
|
35
|
+
PhosphorIcons_X as X,
|
|
36
|
+
PhosphorIcons_Minus as Minus,
|
|
37
|
+
PhosphorIcons_Plus as Plus,
|
|
38
|
+
PhosphorIcons_ArrowLeft as ArrowLeft,
|
|
39
|
+
PhosphorIcons_ArrowRight as ArrowRight,
|
|
40
|
+
PhosphorIcons_Image as Image,
|
|
41
|
+
PhosphorIcons_ShoppingCart as ShoppingCart,
|
|
42
|
+
PhosphorIcons_Eye as Eye,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
interface ModalContentProps extends DialogContentProps {
|
|
47
|
+
size?: 'auto' | 'fullscreen';
|
|
48
|
+
portal?: boolean;
|
|
49
|
+
}
|
|
50
|
+
type WeaverseIcon = keyof typeof PhosphorIcons;
|
|
51
|
+
interface WeaverseIconProps extends HTMLAttributes<SVGElement> {
|
|
52
|
+
name: WeaverseIcon;
|
|
53
|
+
}
|
|
54
|
+
interface TooltipProps {
|
|
55
|
+
children: React.ReactNode;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
interface WeaverseElementProps extends Partial<ReactElement> {
|
|
59
|
+
css?: ElementCSS;
|
|
60
|
+
children?: ReactElement | ReactElement[] | ReactNode | ReactNode[];
|
|
61
|
+
className?: string;
|
|
62
|
+
}
|
|
63
|
+
type WeaverseRootPropsType = {
|
|
64
|
+
context: Weaverse;
|
|
65
|
+
};
|
|
66
|
+
type ItemComponentProps = {
|
|
67
|
+
instance: InstanceType<typeof WeaverseItemStore>;
|
|
68
|
+
};
|
|
69
|
+
interface PlaceholderProps {
|
|
70
|
+
element: string;
|
|
71
|
+
children: ReactElement | ReactElement[] | ReactNode | ReactNode[];
|
|
72
|
+
style?: CSSProperties;
|
|
73
|
+
}
|
|
74
|
+
interface ButtonElementProps extends WeaverseElementProps {
|
|
75
|
+
type: 'button' | 'submit' | 'reset';
|
|
76
|
+
text: string;
|
|
77
|
+
clickAction: 'none' | 'openLink';
|
|
78
|
+
linkTo: string;
|
|
79
|
+
openInNewTab: boolean;
|
|
80
|
+
}
|
|
81
|
+
interface ContainerElementProps extends WeaverseElementProps {
|
|
82
|
+
[key: string]: any;
|
|
83
|
+
}
|
|
84
|
+
interface ImageElementProps extends WeaverseElementProps {
|
|
85
|
+
src: string;
|
|
86
|
+
alt: string;
|
|
87
|
+
objectFit: 'contain' | 'cover';
|
|
88
|
+
objectPosition: 'left' | 'right' | 'top' | 'bottom' | 'center' | 'center left' | 'center right' | 'top left' | 'top right' | 'bottom left' | 'bottom right';
|
|
89
|
+
clickAction: 'none' | 'openLightbox' | 'openLink';
|
|
90
|
+
linkTo?: string;
|
|
91
|
+
openLinkInNewTab?: boolean;
|
|
92
|
+
}
|
|
93
|
+
interface GridContentElementProps extends WeaverseElementProps {
|
|
94
|
+
rows: number;
|
|
95
|
+
columns: number;
|
|
96
|
+
gap: number;
|
|
97
|
+
rowSize: number;
|
|
98
|
+
}
|
|
99
|
+
interface BackgroundDataProps {
|
|
100
|
+
backgroundColor?: string;
|
|
101
|
+
backgroundImage?: string;
|
|
102
|
+
objectFit?: 'contain' | 'cover' | 'fill' | 'none' | 'scale-down';
|
|
103
|
+
objectPosition?: string;
|
|
104
|
+
}
|
|
105
|
+
interface LayoutElementProps extends BackgroundDataProps, WeaverseElementProps {
|
|
106
|
+
contentSize: number;
|
|
107
|
+
gridSize: number;
|
|
108
|
+
rows: number;
|
|
109
|
+
columns: number;
|
|
110
|
+
gap: number;
|
|
111
|
+
rowSize: number;
|
|
112
|
+
enableOverlay: boolean;
|
|
113
|
+
overlayOpacity: number;
|
|
114
|
+
}
|
|
115
|
+
interface LayoutBackgroundProps {
|
|
116
|
+
imgUrl?: string;
|
|
117
|
+
bgColor?: string;
|
|
118
|
+
objectFit?: CSSProperties['objectFit'];
|
|
119
|
+
objectPosition?: CSSProperties['objectPosition'];
|
|
120
|
+
}
|
|
121
|
+
interface MapElementProps extends WeaverseElementProps {
|
|
122
|
+
place: string;
|
|
123
|
+
zoom: number;
|
|
124
|
+
}
|
|
125
|
+
interface TextElementProps extends WeaverseElementProps {
|
|
126
|
+
value: string;
|
|
127
|
+
}
|
|
128
|
+
interface VideoCommonProps {
|
|
129
|
+
src: string;
|
|
130
|
+
type?: string;
|
|
131
|
+
poster: string;
|
|
132
|
+
loop: boolean;
|
|
133
|
+
controls: boolean;
|
|
134
|
+
autoPlay: boolean;
|
|
135
|
+
muted: boolean;
|
|
136
|
+
}
|
|
137
|
+
type VideoElementProps = VideoCommonProps & WeaverseElementProps;
|
|
138
|
+
interface YoutubeElementProps extends VideoCommonProps {
|
|
139
|
+
youtubeId: string;
|
|
140
|
+
}
|
|
141
|
+
interface VimeoElementProps extends VideoCommonProps {
|
|
142
|
+
vimeoId: string;
|
|
143
|
+
}
|
|
144
|
+
type CountdownTimeKey = 'days' | 'hours' | 'minutes' | 'seconds';
|
|
145
|
+
type CountdownTimerType = 'fixed-time' | 'evergreen';
|
|
146
|
+
interface CountdownElementProps extends WeaverseElementProps {
|
|
147
|
+
timerType: CountdownTimerType;
|
|
148
|
+
startTime: number;
|
|
149
|
+
endTime: number;
|
|
150
|
+
periods: number;
|
|
151
|
+
redirectWhenTimerStops: boolean;
|
|
152
|
+
redirectUrl: string;
|
|
153
|
+
openInNewTab: boolean;
|
|
154
|
+
showLabel: boolean;
|
|
155
|
+
showColon: boolean;
|
|
156
|
+
}
|
|
157
|
+
type TimerBlockProps = {
|
|
158
|
+
label: string;
|
|
159
|
+
value: string | number;
|
|
160
|
+
};
|
|
161
|
+
interface InstagramElementProps extends WeaverseElementProps {
|
|
162
|
+
token: string;
|
|
163
|
+
username: string;
|
|
164
|
+
numberOfImages: number;
|
|
165
|
+
imagesPerRow: number;
|
|
166
|
+
gap: number;
|
|
167
|
+
}
|
|
168
|
+
type InstagramMedia = {
|
|
169
|
+
id: string;
|
|
170
|
+
media_type: 'IMAGE' | 'CAROUSEL_ALBUM' | 'VIDEO';
|
|
171
|
+
media_url: string;
|
|
172
|
+
permalink: string;
|
|
173
|
+
caption: string;
|
|
174
|
+
thumbnail_url: string;
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
declare let Modal: (props: DialogProps) => JSX.Element;
|
|
178
|
+
declare let ModalTrigger: React__default.ForwardRefExoticComponent<_radix_ui_react_dialog.DialogTriggerProps & React__default.RefAttributes<HTMLButtonElement>>;
|
|
179
|
+
declare let ModalHeader: React__default.ForwardRefExoticComponent<DialogTitleProps & React__default.RefAttributes<HTMLHeadingElement>>;
|
|
180
|
+
declare let ModalContent: React__default.ForwardRefExoticComponent<ModalContentProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
181
|
+
declare let ModalClose: React__default.ForwardRefExoticComponent<DialogCloseProps & React__default.RefAttributes<HTMLButtonElement>>;
|
|
182
|
+
|
|
183
|
+
declare const ModalComponents_Modal: typeof Modal;
|
|
184
|
+
declare const ModalComponents_ModalTrigger: typeof ModalTrigger;
|
|
185
|
+
declare const ModalComponents_ModalHeader: typeof ModalHeader;
|
|
186
|
+
declare const ModalComponents_ModalContent: typeof ModalContent;
|
|
187
|
+
declare const ModalComponents_ModalClose: typeof ModalClose;
|
|
188
|
+
declare namespace ModalComponents {
|
|
189
|
+
export {
|
|
190
|
+
ModalComponents_Modal as Modal,
|
|
191
|
+
ModalComponents_ModalTrigger as ModalTrigger,
|
|
192
|
+
ModalComponents_ModalHeader as ModalHeader,
|
|
193
|
+
ModalComponents_ModalContent as ModalContent,
|
|
194
|
+
ModalComponents_ModalClose as ModalClose,
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
declare function Spinner(): JSX.Element;
|
|
199
|
+
|
|
200
|
+
declare function Icon({ name, className, ...props }: WeaverseIconProps): JSX.Element;
|
|
201
|
+
|
|
202
|
+
declare function Tooltip({ children }: TooltipProps): JSX.Element;
|
|
203
|
+
|
|
204
|
+
declare let Components: {
|
|
205
|
+
Placeholder: React$1.ForwardRefExoticComponent<PlaceholderProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
206
|
+
Spinner: typeof Spinner;
|
|
207
|
+
ModalComponents: typeof ModalComponents;
|
|
208
|
+
Icon: typeof Icon;
|
|
209
|
+
Tooltip: typeof Tooltip;
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
declare const Elements: Record<string, WeaverseElement>;
|
|
213
|
+
|
|
214
|
+
declare let WeaverseRoot: ({ context }: WeaverseRootPropsType) => JSX.Element | null;
|
|
215
|
+
|
|
216
|
+
export { ButtonElementProps, Components, ContainerElementProps, CountdownElementProps, CountdownTimeKey, CountdownTimerType, Elements, GridContentElementProps, ImageElementProps, InstagramElementProps, InstagramMedia, ItemComponentProps, LayoutBackgroundProps, LayoutElementProps, MapElementProps, ModalContentProps, PlaceholderProps, TextElementProps, TimerBlockProps, TooltipProps, VideoCommonProps, VideoElementProps, VimeoElementProps, WeaverseContext, WeaverseContextConsumer, WeaverseContextProvider, WeaverseElementProps, WeaverseIcon, WeaverseIconProps, WeaverseRoot, WeaverseRootPropsType, YoutubeElementProps, createRootContext };
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.7.
|
|
2
|
+
"version": "0.7.50",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"typings": "dist/index.d.ts",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@radix-ui/react-dialog": "^1.0.2",
|
|
36
36
|
"@stitches/react": "^1.2.8",
|
|
37
|
-
"@weaverse/core": "0.7.
|
|
37
|
+
"@weaverse/core": "0.7.50",
|
|
38
38
|
"clsx": "^1.2.1"
|
|
39
39
|
}
|
|
40
40
|
}
|