@weaverse/react 1.0.47 → 1.0.49
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 +8 -327
- package/dist/index.js +54 -2512
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +51 -2511
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -6
package/dist/index.d.ts
CHANGED
|
@@ -1,188 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Weaverse, ElementCSS, WeaverseItemStore } from '@weaverse/core';
|
|
2
2
|
export * from '@weaverse/core';
|
|
3
|
-
import * as
|
|
4
|
-
import
|
|
5
|
-
import * as keen_slider_react from 'keen-slider/react';
|
|
6
|
-
import { KeenSliderPlugin } from 'keen-slider/react';
|
|
7
|
-
import * as _radix_ui_react_dialog from '@radix-ui/react-dialog';
|
|
8
|
-
import { DialogContentProps, DialogProps, DialogTitleProps, DialogCloseProps } from '@radix-ui/react-dialog';
|
|
9
|
-
import { KeenSliderInstance } from 'keen-slider';
|
|
3
|
+
import * as react from 'react';
|
|
4
|
+
import react__default, { ReactElement, ReactNode } from 'react';
|
|
10
5
|
|
|
11
|
-
declare let
|
|
12
|
-
declare let
|
|
13
|
-
declare let
|
|
14
|
-
declare let WeaverseContextConsumer: React$1.Consumer<Weaverse>;
|
|
15
|
-
|
|
16
|
-
declare let Circle: (props: HTMLAttributes<SVGElement>) => React__default.JSX.Element;
|
|
17
|
-
declare let CircleNotch: (props: HTMLAttributes<SVGElement>) => React__default.JSX.Element;
|
|
18
|
-
declare let X: (props: HTMLAttributes<SVGElement>) => React__default.JSX.Element;
|
|
19
|
-
declare let Minus: (props: HTMLAttributes<SVGElement>) => React__default.JSX.Element;
|
|
20
|
-
declare let Plus: (props: HTMLAttributes<SVGElement>) => React__default.JSX.Element;
|
|
21
|
-
declare let CaretLeft: (props: HTMLAttributes<SVGElement>) => React__default.JSX.Element;
|
|
22
|
-
declare let CaretRight: (props: HTMLAttributes<SVGElement>) => React__default.JSX.Element;
|
|
23
|
-
declare let ArrowLeft: (props: HTMLAttributes<SVGElement>) => React__default.JSX.Element;
|
|
24
|
-
declare let ArrowRight: (props: HTMLAttributes<SVGElement>) => React__default.JSX.Element;
|
|
25
|
-
declare let Image: (props: HTMLAttributes<SVGElement>) => React__default.JSX.Element;
|
|
26
|
-
declare let ShoppingCart: (props: HTMLAttributes<SVGElement>) => React__default.JSX.Element;
|
|
27
|
-
declare let Storefront: (props: HTMLAttributes<SVGElement>) => React__default.JSX.Element;
|
|
28
|
-
declare let Package: (props: HTMLAttributes<SVGElement>) => React__default.JSX.Element;
|
|
29
|
-
declare let HandBag: (props: HTMLAttributes<SVGElement>) => React__default.JSX.Element;
|
|
30
|
-
declare let Tag: (props: HTMLAttributes<SVGElement>) => React__default.JSX.Element;
|
|
31
|
-
declare let Backpack: (props: HTMLAttributes<SVGElement>) => React__default.JSX.Element;
|
|
32
|
-
declare let Newspaper: (props: HTMLAttributes<SVGElement>) => React__default.JSX.Element;
|
|
33
|
-
declare let Eye: (props: HTMLAttributes<SVGElement>) => React__default.JSX.Element;
|
|
34
|
-
|
|
35
|
-
declare const PhosphorIcons_ArrowLeft: typeof ArrowLeft;
|
|
36
|
-
declare const PhosphorIcons_ArrowRight: typeof ArrowRight;
|
|
37
|
-
declare const PhosphorIcons_Backpack: typeof Backpack;
|
|
38
|
-
declare const PhosphorIcons_CaretLeft: typeof CaretLeft;
|
|
39
|
-
declare const PhosphorIcons_CaretRight: typeof CaretRight;
|
|
40
|
-
declare const PhosphorIcons_Circle: typeof Circle;
|
|
41
|
-
declare const PhosphorIcons_CircleNotch: typeof CircleNotch;
|
|
42
|
-
declare const PhosphorIcons_Eye: typeof Eye;
|
|
43
|
-
declare const PhosphorIcons_HandBag: typeof HandBag;
|
|
44
|
-
declare const PhosphorIcons_Image: typeof Image;
|
|
45
|
-
declare const PhosphorIcons_Minus: typeof Minus;
|
|
46
|
-
declare const PhosphorIcons_Newspaper: typeof Newspaper;
|
|
47
|
-
declare const PhosphorIcons_Package: typeof Package;
|
|
48
|
-
declare const PhosphorIcons_Plus: typeof Plus;
|
|
49
|
-
declare const PhosphorIcons_ShoppingCart: typeof ShoppingCart;
|
|
50
|
-
declare const PhosphorIcons_Storefront: typeof Storefront;
|
|
51
|
-
declare const PhosphorIcons_Tag: typeof Tag;
|
|
52
|
-
declare const PhosphorIcons_X: typeof X;
|
|
53
|
-
declare namespace PhosphorIcons {
|
|
54
|
-
export {
|
|
55
|
-
PhosphorIcons_ArrowLeft as ArrowLeft,
|
|
56
|
-
PhosphorIcons_ArrowRight as ArrowRight,
|
|
57
|
-
PhosphorIcons_Backpack as Backpack,
|
|
58
|
-
PhosphorIcons_CaretLeft as CaretLeft,
|
|
59
|
-
PhosphorIcons_CaretRight as CaretRight,
|
|
60
|
-
PhosphorIcons_Circle as Circle,
|
|
61
|
-
PhosphorIcons_CircleNotch as CircleNotch,
|
|
62
|
-
PhosphorIcons_Eye as Eye,
|
|
63
|
-
PhosphorIcons_HandBag as HandBag,
|
|
64
|
-
PhosphorIcons_Image as Image,
|
|
65
|
-
PhosphorIcons_Minus as Minus,
|
|
66
|
-
PhosphorIcons_Newspaper as Newspaper,
|
|
67
|
-
PhosphorIcons_Package as Package,
|
|
68
|
-
PhosphorIcons_Plus as Plus,
|
|
69
|
-
PhosphorIcons_ShoppingCart as ShoppingCart,
|
|
70
|
-
PhosphorIcons_Storefront as Storefront,
|
|
71
|
-
PhosphorIcons_Tag as Tag,
|
|
72
|
-
PhosphorIcons_X as X,
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
interface ModalContentProps extends DialogContentProps {
|
|
77
|
-
size?: 'auto' | 'fullscreen';
|
|
78
|
-
portal?: boolean;
|
|
79
|
-
}
|
|
80
|
-
type WeaverseIcon = keyof typeof PhosphorIcons;
|
|
81
|
-
interface WeaverseIconProps extends HTMLAttributes<SVGElement> {
|
|
82
|
-
name: WeaverseIcon;
|
|
83
|
-
}
|
|
84
|
-
interface TooltipProps {
|
|
85
|
-
children: React.ReactNode;
|
|
86
|
-
}
|
|
87
|
-
interface SliderProps {
|
|
88
|
-
children: React.ReactNode;
|
|
89
|
-
className?: string;
|
|
90
|
-
gap?: number;
|
|
91
|
-
arrowOffset: number;
|
|
92
|
-
slidesPerView: number;
|
|
93
|
-
}
|
|
94
|
-
interface SliderArrowsProps {
|
|
95
|
-
currentSlide: number;
|
|
96
|
-
instanceRef: React.MutableRefObject<KeenSliderInstance | null>;
|
|
97
|
-
offset: number;
|
|
98
|
-
icon: 'caret' | 'arrow';
|
|
99
|
-
className?: string;
|
|
100
|
-
}
|
|
101
|
-
interface SliderDotsProps {
|
|
102
|
-
currentSlide: number;
|
|
103
|
-
instanceRef: React.MutableRefObject<KeenSliderInstance | null>;
|
|
104
|
-
className?: string;
|
|
105
|
-
absolute?: boolean;
|
|
106
|
-
position?: 'top' | 'bottom' | 'left' | 'right';
|
|
107
|
-
color: 'light' | 'dark';
|
|
108
|
-
}
|
|
109
|
-
interface OverlayProps {
|
|
110
|
-
enableOverlay: boolean;
|
|
111
|
-
overlayOpacity: number;
|
|
112
|
-
className?: string;
|
|
113
|
-
}
|
|
114
|
-
interface BackgroundProps {
|
|
115
|
-
backgroundColor?: string;
|
|
116
|
-
backgroundImage?: string;
|
|
117
|
-
backgroundFit?: CSSProperties['objectFit'];
|
|
118
|
-
backgroundPosition?: CSSProperties['objectPosition'];
|
|
119
|
-
className?: string;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
declare let Modal: (props: DialogProps) => React__default.JSX.Element;
|
|
123
|
-
declare let ModalTrigger: React__default.ForwardRefExoticComponent<_radix_ui_react_dialog.DialogTriggerProps & React__default.RefAttributes<HTMLButtonElement>>;
|
|
124
|
-
declare let ModalHeader: React__default.ForwardRefExoticComponent<DialogTitleProps & React__default.RefAttributes<HTMLHeadingElement>>;
|
|
125
|
-
declare let ModalContent: React__default.ForwardRefExoticComponent<ModalContentProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
126
|
-
declare let ModalClose: React__default.ForwardRefExoticComponent<DialogCloseProps & React__default.RefAttributes<HTMLButtonElement>>;
|
|
127
|
-
|
|
128
|
-
declare const ModalComponents_Modal: typeof Modal;
|
|
129
|
-
declare const ModalComponents_ModalClose: typeof ModalClose;
|
|
130
|
-
declare const ModalComponents_ModalContent: typeof ModalContent;
|
|
131
|
-
declare const ModalComponents_ModalHeader: typeof ModalHeader;
|
|
132
|
-
declare const ModalComponents_ModalTrigger: typeof ModalTrigger;
|
|
133
|
-
declare namespace ModalComponents {
|
|
134
|
-
export {
|
|
135
|
-
ModalComponents_Modal as Modal,
|
|
136
|
-
ModalComponents_ModalClose as ModalClose,
|
|
137
|
-
ModalComponents_ModalContent as ModalContent,
|
|
138
|
-
ModalComponents_ModalHeader as ModalHeader,
|
|
139
|
-
ModalComponents_ModalTrigger as ModalTrigger,
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
declare function Spinner(): React__default.JSX.Element;
|
|
144
|
-
|
|
145
|
-
declare function Icon({ name, className, ...props }: WeaverseIconProps): React__default.JSX.Element;
|
|
146
|
-
|
|
147
|
-
declare function Tooltip({ children }: TooltipProps): React__default.JSX.Element;
|
|
148
|
-
|
|
149
|
-
declare function Slider(props: SliderProps): React__default.JSX.Element;
|
|
150
|
-
|
|
151
|
-
declare function Background(props: BackgroundProps): React__default.JSX.Element | null;
|
|
152
|
-
|
|
153
|
-
declare function Overlay(props: OverlayProps): React__default.JSX.Element | null;
|
|
154
|
-
|
|
155
|
-
declare function Arrows(props: SliderArrowsProps): React__default.JSX.Element;
|
|
156
|
-
|
|
157
|
-
declare function Dots(props: SliderDotsProps): React__default.JSX.Element;
|
|
158
|
-
|
|
159
|
-
declare function AutoplayPlugin(changeSlidesEvery: number): KeenSliderPlugin;
|
|
160
|
-
|
|
161
|
-
type NoHydrateProps = {
|
|
162
|
-
id: string;
|
|
163
|
-
getHTML?: () => string;
|
|
164
|
-
} & JSX.IntrinsicElements['div'];
|
|
165
|
-
declare function NoHydrate({ id, getHTML, ...rest }: NoHydrateProps): React__default.JSX.Element;
|
|
166
|
-
|
|
167
|
-
declare let Components: {
|
|
168
|
-
Background: typeof Background;
|
|
169
|
-
Icon: typeof Icon;
|
|
170
|
-
ModalComponents: typeof ModalComponents;
|
|
171
|
-
Overlay: typeof Overlay;
|
|
172
|
-
Placeholder: React$1.ForwardRefExoticComponent<PlaceholderProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
173
|
-
Spinner: typeof Spinner;
|
|
174
|
-
Slider: typeof Slider;
|
|
175
|
-
Tooltip: typeof Tooltip;
|
|
176
|
-
NoHydrate: typeof NoHydrate;
|
|
177
|
-
};
|
|
178
|
-
declare let SliderComponents: {
|
|
179
|
-
Arrows: typeof Arrows;
|
|
180
|
-
Dots: typeof Dots;
|
|
181
|
-
ResizePlugin: keen_slider_react.KeenSliderPlugin;
|
|
182
|
-
AutoplayPlugin: typeof AutoplayPlugin;
|
|
183
|
-
};
|
|
184
|
-
|
|
185
|
-
declare const Elements: Record<string, WeaverseElement>;
|
|
6
|
+
declare let WeaverseContext: react.Context<Weaverse>;
|
|
7
|
+
declare let WeaverseContextProvider: react.Provider<Weaverse>;
|
|
8
|
+
declare let WeaverseContextConsumer: react.Consumer<Weaverse>;
|
|
186
9
|
|
|
187
10
|
interface WeaverseElementProps extends Partial<ReactElement> {
|
|
188
11
|
css?: ElementCSS;
|
|
@@ -196,149 +19,7 @@ type WeaverseRootPropsType = {
|
|
|
196
19
|
type ItemComponentProps = {
|
|
197
20
|
instance: InstanceType<typeof WeaverseItemStore>;
|
|
198
21
|
};
|
|
199
|
-
interface PlaceholderProps {
|
|
200
|
-
element: string;
|
|
201
|
-
children: ReactElement | ReactElement[] | ReactNode | ReactNode[];
|
|
202
|
-
style?: CSSProperties;
|
|
203
|
-
className?: string;
|
|
204
|
-
}
|
|
205
|
-
interface ButtonElementProps extends WeaverseElementProps {
|
|
206
|
-
type: 'button' | 'submit' | 'reset';
|
|
207
|
-
text: string;
|
|
208
|
-
clickAction: 'none' | 'openLink';
|
|
209
|
-
linkTo: string;
|
|
210
|
-
openInNewTab: boolean;
|
|
211
|
-
}
|
|
212
|
-
interface ContainerElementProps extends WeaverseElementProps {
|
|
213
|
-
[key: string]: any;
|
|
214
|
-
}
|
|
215
|
-
interface ImageElementProps extends WeaverseElementProps {
|
|
216
|
-
src: string;
|
|
217
|
-
alt: string;
|
|
218
|
-
objectFit: CSSProperties['objectFit'];
|
|
219
|
-
objectPosition: CSSProperties['objectPosition'];
|
|
220
|
-
clickAction: 'none' | 'openLightbox' | 'openLink';
|
|
221
|
-
linkTo?: string;
|
|
222
|
-
openLinkInNewTab?: boolean;
|
|
223
|
-
}
|
|
224
|
-
interface GridContentElementProps extends WeaverseElementProps {
|
|
225
|
-
rows: number;
|
|
226
|
-
columns: number;
|
|
227
|
-
gap: number;
|
|
228
|
-
rowSize: number;
|
|
229
|
-
}
|
|
230
|
-
interface BackgroundDataProps {
|
|
231
|
-
backgroundColor?: string;
|
|
232
|
-
backgroundImage?: string;
|
|
233
|
-
objectFit?: CSSProperties['objectFit'];
|
|
234
|
-
objectPosition?: CSSProperties['objectPosition'];
|
|
235
|
-
/** @deprecated no more use but still reserved for old element */
|
|
236
|
-
backgroundPosition?: CSSProperties['backgroundPosition'];
|
|
237
|
-
/** @deprecated no more use but still reserved for old element */
|
|
238
|
-
backgroundFit?: CSSProperties['objectFit'];
|
|
239
|
-
}
|
|
240
|
-
interface LayoutElementProps extends BackgroundDataProps, WeaverseElementProps {
|
|
241
|
-
contentSize: number;
|
|
242
|
-
gridSize: number;
|
|
243
|
-
rows: number;
|
|
244
|
-
columns: number;
|
|
245
|
-
gap: number;
|
|
246
|
-
rowSize: number;
|
|
247
|
-
enableOverlay: boolean;
|
|
248
|
-
overlayOpacity: number;
|
|
249
|
-
}
|
|
250
|
-
interface LayoutBackgroundProps {
|
|
251
|
-
imgUrl?: string;
|
|
252
|
-
bgColor?: string;
|
|
253
|
-
objectFit?: CSSProperties['objectFit'];
|
|
254
|
-
objectPosition?: CSSProperties['objectPosition'];
|
|
255
|
-
}
|
|
256
|
-
interface MapElementProps extends WeaverseElementProps {
|
|
257
|
-
place: string;
|
|
258
|
-
zoom: number;
|
|
259
|
-
}
|
|
260
|
-
interface TextElementProps extends WeaverseElementProps {
|
|
261
|
-
value: string;
|
|
262
|
-
}
|
|
263
|
-
interface ScrollingTextElementProps extends WeaverseElementProps {
|
|
264
|
-
value: string;
|
|
265
|
-
gap: number;
|
|
266
|
-
speed: number;
|
|
267
|
-
pauseOnHover: boolean;
|
|
268
|
-
}
|
|
269
|
-
interface VideoCommonProps {
|
|
270
|
-
src: string;
|
|
271
|
-
type?: string;
|
|
272
|
-
poster: string;
|
|
273
|
-
loop: boolean;
|
|
274
|
-
controls: boolean;
|
|
275
|
-
autoPlay: boolean;
|
|
276
|
-
muted: boolean;
|
|
277
|
-
}
|
|
278
|
-
type VideoElementProps = VideoCommonProps & WeaverseElementProps;
|
|
279
|
-
interface YoutubeElementProps extends VideoCommonProps {
|
|
280
|
-
youtubeId: string;
|
|
281
|
-
}
|
|
282
|
-
interface VimeoElementProps extends VideoCommonProps {
|
|
283
|
-
vimeoId: string;
|
|
284
|
-
}
|
|
285
|
-
type CountdownTimeKey = 'days' | 'hours' | 'minutes' | 'seconds';
|
|
286
|
-
type CountdownTimerType = 'fixed-time' | 'evergreen';
|
|
287
|
-
interface CountdownElementProps extends WeaverseElementProps {
|
|
288
|
-
timerType: CountdownTimerType;
|
|
289
|
-
startTime: number;
|
|
290
|
-
endTime: number;
|
|
291
|
-
periods: number;
|
|
292
|
-
redirectWhenTimerStops: boolean;
|
|
293
|
-
redirectUrl: string;
|
|
294
|
-
openInNewTab: boolean;
|
|
295
|
-
showLabel: boolean;
|
|
296
|
-
showColon: boolean;
|
|
297
|
-
}
|
|
298
|
-
type TimerBlockProps = {
|
|
299
|
-
label: string;
|
|
300
|
-
value: string | number;
|
|
301
|
-
};
|
|
302
|
-
interface InstagramElementProps extends WeaverseElementProps {
|
|
303
|
-
token: string;
|
|
304
|
-
username: string;
|
|
305
|
-
numberOfImages: number;
|
|
306
|
-
imagesPerRow: number;
|
|
307
|
-
gap: number;
|
|
308
|
-
}
|
|
309
|
-
type InstagramMedia = {
|
|
310
|
-
id: string;
|
|
311
|
-
media_type: 'IMAGE' | 'CAROUSEL_ALBUM' | 'VIDEO';
|
|
312
|
-
media_url: string;
|
|
313
|
-
permalink: string;
|
|
314
|
-
caption: string;
|
|
315
|
-
thumbnail_url: string;
|
|
316
|
-
};
|
|
317
|
-
interface SlideshowProps extends WeaverseElementProps {
|
|
318
|
-
animation: 'slide' | 'fade';
|
|
319
|
-
slidesPerView: number;
|
|
320
|
-
spacing: number;
|
|
321
|
-
showArrows: boolean;
|
|
322
|
-
showArrowsOnHover: boolean;
|
|
323
|
-
arrowIcon: 'caret' | 'arrow';
|
|
324
|
-
arrowsColor: 'light' | 'dark';
|
|
325
|
-
showDots: boolean;
|
|
326
|
-
dotsPosition: 'top' | 'bottom' | 'left' | 'right';
|
|
327
|
-
dotsColor: 'light' | 'dark';
|
|
328
|
-
loop: boolean;
|
|
329
|
-
autoRotate: boolean;
|
|
330
|
-
changeSlidesEvery: number;
|
|
331
|
-
}
|
|
332
|
-
interface SlideProps extends WeaverseElementProps, BackgroundDataProps, OverlayProps {
|
|
333
|
-
contentPosition: string;
|
|
334
|
-
children: ReactElement[];
|
|
335
|
-
}
|
|
336
|
-
declare global {
|
|
337
|
-
interface Window {
|
|
338
|
-
weaverseSlideshowInstances: Record<string, KeenSliderInstance>;
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
22
|
|
|
342
|
-
declare let WeaverseRoot:
|
|
23
|
+
declare let WeaverseRoot: react__default.MemoExoticComponent<({ context }: WeaverseRootPropsType) => react__default.JSX.Element | null>;
|
|
343
24
|
|
|
344
|
-
export {
|
|
25
|
+
export { ItemComponentProps, WeaverseContext, WeaverseContextConsumer, WeaverseContextProvider, WeaverseElementProps, WeaverseRoot, WeaverseRootPropsType };
|