@micromag/core 0.3.832 → 0.4.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/assets/css/styles.css +31 -31
- package/assets/css/vendor.css +4 -3
- package/es/components.d.ts +628 -0
- package/es/components.js +947 -2301
- package/es/contexts.d.ts +297 -0
- package/es/contexts.js +154 -341
- package/es/hooks.d.ts +333 -0
- package/es/hooks.js +22 -17
- package/es/index.d.ts +665 -0
- package/es/index.js +2 -772
- package/es/styles.css +35 -0
- package/es/utils.d.ts +214 -0
- package/lib/components.js +955 -2309
- package/lib/contexts.js +153 -340
- package/lib/hooks.js +21 -16
- package/lib/index.js +0 -771
- package/lib/styles.css +35 -0
- package/package.json +39 -46
- package/styles/bootstrap-overrides.css +111 -0
- package/styles/bootstrap-patches.css +486 -0
- package/styles/breadcrumb.module.css +5 -0
- package/styles/button.module.css +82 -0
- package/styles/buttons.module.css +3 -0
- package/styles/clear.module.css +23 -0
- package/styles/collapsable-panel.module.css +31 -0
- package/styles/conversation.module.css +37 -0
- package/styles/dialog.module.css +13 -0
- package/styles/empty.module.css +22 -0
- package/styles/form-panel.module.css +3 -0
- package/styles/form.module.css +22 -0
- package/styles/link.module.css +9 -0
- package/styles/map.module.css +43 -0
- package/styles/media.module.css +3 -0
- package/styles/modal.module.css +22 -0
- package/styles/modals.module.css +12 -0
- package/styles/navbar.module.css +9 -0
- package/styles/pagination.module.css +3 -0
- package/styles/panel.module.css +3 -0
- package/styles/panels.module.css +3 -0
- package/styles/placeholder-block.module.css +29 -0
- package/styles/placeholder-text.module.css +17 -0
- package/styles/placeholders.module.css +3 -0
- package/styles/preview.module.css +34 -0
- package/styles/quiz-answer.module.css +29 -0
- package/styles/screen-placeholder.module.css +5 -0
- package/styles/screen-sizer.module.css +14 -0
- package/styles/screen.module.css +52 -0
- package/styles/screens.module.css +16 -0
- package/styles/share-options.module.css +27 -0
- package/{scss/_placeholders.scss → styles/shared.module.css} +103 -97
- package/styles/slideshow.module.css +28 -0
- package/styles/spinner.module.css +43 -0
- package/styles/styles.css +1 -0
- package/styles/survey-answer.module.css +18 -0
- package/styles/tabs.module.css +4 -0
- package/styles/theme.css +84 -0
- package/styles/transition.module.css +9 -0
- package/{scss/vendor.scss → styles/vendor.css} +16 -30
- package/styles/video-360.module.css +15 -0
- package/scss/_mixins.scss +0 -34
- package/scss/_theme.scss +0 -114
- package/scss/_variables.scss +0 -12
- package/scss/styles.scss +0 -1
- package/scss/upload.scss +0 -1
package/es/index.d.ts
ADDED
|
@@ -0,0 +1,665 @@
|
|
|
1
|
+
import { ReactNode, Ref as Ref$1 } from 'react';
|
|
2
|
+
import EventEmitter from 'wolfy87-eventemitter';
|
|
3
|
+
import { Tracking as Tracking$1 } from '@folklore/tracking';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Core
|
|
7
|
+
*/
|
|
8
|
+
interface History {
|
|
9
|
+
listen: (...args: unknown[]) => void;
|
|
10
|
+
push: (path: string, state?: unknown) => void;
|
|
11
|
+
}
|
|
12
|
+
interface Location {
|
|
13
|
+
pathname?: string;
|
|
14
|
+
search?: string;
|
|
15
|
+
}
|
|
16
|
+
interface Intl {
|
|
17
|
+
locale: string;
|
|
18
|
+
formatMessage: (...args: unknown[]) => string;
|
|
19
|
+
}
|
|
20
|
+
interface DefaultMessageContent {
|
|
21
|
+
type?: number;
|
|
22
|
+
value?: string;
|
|
23
|
+
}
|
|
24
|
+
type DefaultMessage = string | DefaultMessageContent[];
|
|
25
|
+
interface Message {
|
|
26
|
+
id?: string;
|
|
27
|
+
defaultMessage: DefaultMessage;
|
|
28
|
+
description?: string;
|
|
29
|
+
}
|
|
30
|
+
type Text = Message | string;
|
|
31
|
+
type Label = Message | ReactNode;
|
|
32
|
+
type StatusCode = 401 | 403 | 404 | 500;
|
|
33
|
+
type Ref<T = unknown> = Ref$1<T>;
|
|
34
|
+
type Target = '_blank' | '_self' | '_parent';
|
|
35
|
+
type Interaction = 'tap' | 'swipe';
|
|
36
|
+
type TrackingVariables = Record<string, string | number | unknown[]>;
|
|
37
|
+
interface Progress {
|
|
38
|
+
currentTime?: number;
|
|
39
|
+
duration?: number;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Site
|
|
43
|
+
*/
|
|
44
|
+
interface User {
|
|
45
|
+
id?: number;
|
|
46
|
+
firstname?: string;
|
|
47
|
+
lastname?: string;
|
|
48
|
+
email?: string;
|
|
49
|
+
gender?: string;
|
|
50
|
+
birthdate?: string;
|
|
51
|
+
}
|
|
52
|
+
interface MenuItem {
|
|
53
|
+
id?: number | string;
|
|
54
|
+
label?: Label;
|
|
55
|
+
url?: string;
|
|
56
|
+
external?: boolean;
|
|
57
|
+
active?: boolean;
|
|
58
|
+
}
|
|
59
|
+
interface Breadcrumb {
|
|
60
|
+
label?: Label;
|
|
61
|
+
url?: string;
|
|
62
|
+
}
|
|
63
|
+
interface Device {
|
|
64
|
+
id: string;
|
|
65
|
+
}
|
|
66
|
+
interface Modal {
|
|
67
|
+
id: string;
|
|
68
|
+
}
|
|
69
|
+
interface Panel {
|
|
70
|
+
id: string;
|
|
71
|
+
}
|
|
72
|
+
interface Button {
|
|
73
|
+
label?: Label;
|
|
74
|
+
onClick?: (...args: unknown[]) => void;
|
|
75
|
+
}
|
|
76
|
+
type BootstrapTheme = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'light' | 'dark';
|
|
77
|
+
type ButtonTheme = BootstrapTheme | 'outline-primary' | 'outline-secondary' | 'outline-success' | 'outline-danger' | 'outline-warning' | 'outline-info' | 'outline-light' | 'outline-dark' | 'outline-link' | null;
|
|
78
|
+
type ButtonSize = 'lg' | 'sm' | null;
|
|
79
|
+
type FormControlSize = 'lg' | 'sm' | null;
|
|
80
|
+
type DropdownAlign = 'start' | 'end';
|
|
81
|
+
type Component = Record<string, unknown> | ((...args: unknown[]) => unknown);
|
|
82
|
+
/**
|
|
83
|
+
* Forms
|
|
84
|
+
*/
|
|
85
|
+
type Errors = string | string[];
|
|
86
|
+
type FormErrors = Record<string, Errors>;
|
|
87
|
+
type SelectOption = string | {
|
|
88
|
+
value: unknown;
|
|
89
|
+
label?: Label;
|
|
90
|
+
};
|
|
91
|
+
interface FormField {
|
|
92
|
+
name?: string;
|
|
93
|
+
component?: Component;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Medias
|
|
97
|
+
*/
|
|
98
|
+
interface MediaMetadata {
|
|
99
|
+
filename?: string;
|
|
100
|
+
size?: number;
|
|
101
|
+
mime?: string;
|
|
102
|
+
}
|
|
103
|
+
interface MediaFile {
|
|
104
|
+
id?: string;
|
|
105
|
+
handle?: string;
|
|
106
|
+
type?: string;
|
|
107
|
+
mime?: string;
|
|
108
|
+
url?: string;
|
|
109
|
+
}
|
|
110
|
+
interface Media {
|
|
111
|
+
id?: string;
|
|
112
|
+
type: string;
|
|
113
|
+
url?: string;
|
|
114
|
+
thumbnail_url?: string;
|
|
115
|
+
name?: string;
|
|
116
|
+
metadata?: MediaMetadata;
|
|
117
|
+
files?: Record<string, MediaFile>;
|
|
118
|
+
}
|
|
119
|
+
type MediaType = 'image' | 'video' | 'audio' | 'closed-captions' | 'font';
|
|
120
|
+
interface ImageMedia extends Omit<Media, 'type' | 'metadata'> {
|
|
121
|
+
type?: 'image' | 'video';
|
|
122
|
+
metadata?: MediaMetadata & {
|
|
123
|
+
width?: number;
|
|
124
|
+
height?: number;
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
interface FontMedia extends Omit<Media, 'type'> {
|
|
128
|
+
type?: 'font';
|
|
129
|
+
}
|
|
130
|
+
interface VideoMedia extends Omit<Media, 'type' | 'metadata'> {
|
|
131
|
+
type?: 'video';
|
|
132
|
+
metadata?: MediaMetadata & {
|
|
133
|
+
width?: number;
|
|
134
|
+
height?: number;
|
|
135
|
+
duration?: number;
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
interface AudioMedia extends Omit<Media, 'type' | 'metadata'> {
|
|
139
|
+
type?: 'audio';
|
|
140
|
+
metadata?: MediaMetadata & {
|
|
141
|
+
duration?: number;
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
interface ClosedCaptionsMedia extends Omit<Media, 'type'> {
|
|
145
|
+
type?: 'closed-captions';
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Style
|
|
149
|
+
*/
|
|
150
|
+
interface CustomFont {
|
|
151
|
+
type?: 'system' | 'google' | 'custom';
|
|
152
|
+
name?: string;
|
|
153
|
+
media?: FontMedia;
|
|
154
|
+
}
|
|
155
|
+
type Font = Record<string, unknown> | string;
|
|
156
|
+
type TextAlign = 'left' | 'right' | 'center';
|
|
157
|
+
interface ColorObject {
|
|
158
|
+
color?: string;
|
|
159
|
+
alpha?: number;
|
|
160
|
+
}
|
|
161
|
+
type Color = ColorObject | string;
|
|
162
|
+
interface FontStyle {
|
|
163
|
+
bold?: boolean;
|
|
164
|
+
italic?: boolean;
|
|
165
|
+
underline?: boolean;
|
|
166
|
+
upperCase?: boolean;
|
|
167
|
+
}
|
|
168
|
+
interface TextStyle {
|
|
169
|
+
fontFamily?: Font;
|
|
170
|
+
fontSize?: number;
|
|
171
|
+
fontStyle?: FontStyle;
|
|
172
|
+
align?: TextAlign;
|
|
173
|
+
color?: Color;
|
|
174
|
+
letterSpacing?: number;
|
|
175
|
+
lineHeight?: number;
|
|
176
|
+
}
|
|
177
|
+
type BorderType = 'dotted' | 'dashed' | 'solid' | 'double' | 'groove' | 'ridge' | 'inset' | 'outset' | 'hidden';
|
|
178
|
+
interface ShadowType {
|
|
179
|
+
shadowDistance?: number;
|
|
180
|
+
shadowBlur?: number;
|
|
181
|
+
shadowColor?: Color;
|
|
182
|
+
}
|
|
183
|
+
interface BorderStyle {
|
|
184
|
+
width?: number;
|
|
185
|
+
style?: BorderType;
|
|
186
|
+
radius?: number;
|
|
187
|
+
color?: Color;
|
|
188
|
+
}
|
|
189
|
+
interface BoxStyle {
|
|
190
|
+
backgroundColor?: Color;
|
|
191
|
+
borderRadius?: number;
|
|
192
|
+
borderWidth?: number;
|
|
193
|
+
borderColor?: Color;
|
|
194
|
+
borderStyle?: BorderType;
|
|
195
|
+
shadow?: ShadowType;
|
|
196
|
+
}
|
|
197
|
+
interface Margin {
|
|
198
|
+
top?: number;
|
|
199
|
+
bottom?: number;
|
|
200
|
+
}
|
|
201
|
+
interface GridLayoutItem {
|
|
202
|
+
rows?: number | number[];
|
|
203
|
+
columns?: number | number[];
|
|
204
|
+
}
|
|
205
|
+
type GridLayout = GridLayoutItem[];
|
|
206
|
+
type ObjectFitSize = 'cover' | 'contain' | null;
|
|
207
|
+
interface ObjectFit {
|
|
208
|
+
fit?: ObjectFitSize;
|
|
209
|
+
horizontalPosition?: 'left' | 'center' | 'right';
|
|
210
|
+
verticalPosition?: 'top' | 'center' | 'bottom';
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Elements
|
|
214
|
+
*/
|
|
215
|
+
interface TextElement {
|
|
216
|
+
body?: string;
|
|
217
|
+
textStyle?: TextStyle;
|
|
218
|
+
}
|
|
219
|
+
type HeadingElement = TextElement;
|
|
220
|
+
interface InputElement {
|
|
221
|
+
label?: string;
|
|
222
|
+
textStyle?: TextStyle;
|
|
223
|
+
}
|
|
224
|
+
interface ImageElement {
|
|
225
|
+
media?: ImageMedia;
|
|
226
|
+
}
|
|
227
|
+
interface VideoElement {
|
|
228
|
+
media?: VideoMedia;
|
|
229
|
+
autoPlay?: boolean;
|
|
230
|
+
loop?: boolean;
|
|
231
|
+
closedCaptions?: ClosedCaptionsMedia;
|
|
232
|
+
withSeekBar?: boolean;
|
|
233
|
+
withControls?: boolean;
|
|
234
|
+
}
|
|
235
|
+
interface VisualElement {
|
|
236
|
+
media?: ImageMedia;
|
|
237
|
+
}
|
|
238
|
+
interface AudioElement {
|
|
239
|
+
media?: AudioMedia;
|
|
240
|
+
autoPlay?: boolean;
|
|
241
|
+
loop?: boolean;
|
|
242
|
+
closedCaptions?: ClosedCaptionsMedia;
|
|
243
|
+
withPlayPause?: boolean;
|
|
244
|
+
}
|
|
245
|
+
interface ClosedCaptionsElement {
|
|
246
|
+
media?: ClosedCaptionsMedia;
|
|
247
|
+
}
|
|
248
|
+
interface BackgroundElement {
|
|
249
|
+
color?: Color;
|
|
250
|
+
image?: ImageMedia;
|
|
251
|
+
video?: VideoMedia;
|
|
252
|
+
}
|
|
253
|
+
interface ImageElementWithCaption {
|
|
254
|
+
image?: ImageMedia;
|
|
255
|
+
caption?: TextElement;
|
|
256
|
+
}
|
|
257
|
+
type StackDirection = 'horizontal' | 'vertical';
|
|
258
|
+
type StackAlign = 'start' | 'center' | 'end';
|
|
259
|
+
type StackSpacing = number | 'between' | 'evenly' | 'around';
|
|
260
|
+
interface StackElement {
|
|
261
|
+
direction?: StackDirection;
|
|
262
|
+
align?: StackAlign;
|
|
263
|
+
width?: number;
|
|
264
|
+
height?: number;
|
|
265
|
+
spacing?: StackSpacing;
|
|
266
|
+
reverse?: boolean;
|
|
267
|
+
}
|
|
268
|
+
interface GridElement {
|
|
269
|
+
layout?: string[];
|
|
270
|
+
spacing?: number;
|
|
271
|
+
}
|
|
272
|
+
interface GeoPosition {
|
|
273
|
+
lat?: number;
|
|
274
|
+
lng?: number;
|
|
275
|
+
}
|
|
276
|
+
interface Marker {
|
|
277
|
+
id?: number;
|
|
278
|
+
geoPosition?: GeoPosition;
|
|
279
|
+
title?: HeadingElement;
|
|
280
|
+
subtitle?: HeadingElement;
|
|
281
|
+
description?: TextElement;
|
|
282
|
+
}
|
|
283
|
+
interface MarkerWithImage extends Marker {
|
|
284
|
+
image?: ImageMedia;
|
|
285
|
+
}
|
|
286
|
+
interface Answer {
|
|
287
|
+
id?: string;
|
|
288
|
+
label?: TextElement;
|
|
289
|
+
}
|
|
290
|
+
interface QuizAnswer extends Answer {
|
|
291
|
+
good?: boolean;
|
|
292
|
+
}
|
|
293
|
+
type CallToActionType = 'swipe-up' | 'button';
|
|
294
|
+
interface CallToAction {
|
|
295
|
+
active?: boolean;
|
|
296
|
+
type?: CallToActionType;
|
|
297
|
+
url?: string;
|
|
298
|
+
label?: TextElement;
|
|
299
|
+
buttonStyle?: BoxStyle;
|
|
300
|
+
}
|
|
301
|
+
interface ShareIncentive {
|
|
302
|
+
active?: boolean;
|
|
303
|
+
label?: TextElement;
|
|
304
|
+
boxStyle?: BoxStyle;
|
|
305
|
+
}
|
|
306
|
+
interface ActiveForm {
|
|
307
|
+
active?: boolean;
|
|
308
|
+
}
|
|
309
|
+
interface Speaker {
|
|
310
|
+
id?: string;
|
|
311
|
+
name?: string;
|
|
312
|
+
avatar?: ImageMedia;
|
|
313
|
+
side?: 'left' | 'right';
|
|
314
|
+
color?: Color;
|
|
315
|
+
}
|
|
316
|
+
interface TimingOverrides {
|
|
317
|
+
enabled?: boolean;
|
|
318
|
+
appearDelay?: number;
|
|
319
|
+
writingStateDuration?: number;
|
|
320
|
+
}
|
|
321
|
+
interface ConversationMessage {
|
|
322
|
+
speaker?: string;
|
|
323
|
+
message?: string;
|
|
324
|
+
image?: ImageMedia;
|
|
325
|
+
audio?: AudioMedia;
|
|
326
|
+
timingOverrides?: TimingOverrides;
|
|
327
|
+
}
|
|
328
|
+
interface Conversation {
|
|
329
|
+
speakers?: Speaker[];
|
|
330
|
+
textStyle?: TextStyle;
|
|
331
|
+
messages?: ConversationMessage[];
|
|
332
|
+
}
|
|
333
|
+
interface Alternatives {
|
|
334
|
+
audio?: AudioElement;
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* Definitions
|
|
338
|
+
*/
|
|
339
|
+
interface Field {
|
|
340
|
+
name?: string;
|
|
341
|
+
type: string;
|
|
342
|
+
label?: Text;
|
|
343
|
+
isSection?: boolean;
|
|
344
|
+
fields?: Field[];
|
|
345
|
+
}
|
|
346
|
+
interface ScreenDefinition {
|
|
347
|
+
id: string;
|
|
348
|
+
type: 'screen';
|
|
349
|
+
title: Text;
|
|
350
|
+
layouts?: string[];
|
|
351
|
+
fields?: Field[];
|
|
352
|
+
}
|
|
353
|
+
interface FieldDefinition {
|
|
354
|
+
id: string;
|
|
355
|
+
type: 'field';
|
|
356
|
+
title: Text;
|
|
357
|
+
fields?: Field[];
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* Components
|
|
361
|
+
*/
|
|
362
|
+
interface StoryComponent {
|
|
363
|
+
type: string;
|
|
364
|
+
[key: string]: unknown;
|
|
365
|
+
}
|
|
366
|
+
type ScreenComponent = StoryComponent;
|
|
367
|
+
/**
|
|
368
|
+
* Theme
|
|
369
|
+
*/
|
|
370
|
+
interface Theme {
|
|
371
|
+
id?: string;
|
|
372
|
+
textStyles?: Record<string, TextStyle>;
|
|
373
|
+
background?: BackgroundElement;
|
|
374
|
+
colors?: Record<string, Color>;
|
|
375
|
+
components?: ScreenComponent[];
|
|
376
|
+
}
|
|
377
|
+
interface ViewerTheme extends Theme {
|
|
378
|
+
logo?: ImageMedia;
|
|
379
|
+
}
|
|
380
|
+
/**
|
|
381
|
+
* Metadata
|
|
382
|
+
*/
|
|
383
|
+
interface Metadata {
|
|
384
|
+
description?: string;
|
|
385
|
+
shareUrl?: string;
|
|
386
|
+
shareImage?: ImageMedia;
|
|
387
|
+
favIcon?: ImageMedia;
|
|
388
|
+
}
|
|
389
|
+
interface Tag {
|
|
390
|
+
label?: string;
|
|
391
|
+
value?: number | string;
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* Story
|
|
395
|
+
*/
|
|
396
|
+
interface Story {
|
|
397
|
+
id?: string;
|
|
398
|
+
theme?: Theme;
|
|
399
|
+
components?: ScreenComponent[];
|
|
400
|
+
metadata?: Metadata;
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* Render
|
|
404
|
+
*/
|
|
405
|
+
interface DeviceScreen {
|
|
406
|
+
name: string;
|
|
407
|
+
mediaQuery?: string;
|
|
408
|
+
}
|
|
409
|
+
interface ScreenSize {
|
|
410
|
+
screen?: string;
|
|
411
|
+
screens?: string[];
|
|
412
|
+
width?: number;
|
|
413
|
+
height?: number;
|
|
414
|
+
landscape?: boolean;
|
|
415
|
+
}
|
|
416
|
+
type RenderContext = 'view' | 'placeholder' | 'edit' | 'preview' | 'static' | 'capture';
|
|
417
|
+
/**
|
|
418
|
+
* Screens
|
|
419
|
+
*/
|
|
420
|
+
interface AdFormats {
|
|
421
|
+
width?: number;
|
|
422
|
+
height?: number;
|
|
423
|
+
}
|
|
424
|
+
interface AdFormat {
|
|
425
|
+
width?: number;
|
|
426
|
+
height?: number;
|
|
427
|
+
url?: string;
|
|
428
|
+
target?: Target;
|
|
429
|
+
iframe?: string;
|
|
430
|
+
image?: ImageMedia;
|
|
431
|
+
}
|
|
432
|
+
interface AudioComponent {
|
|
433
|
+
src?: string;
|
|
434
|
+
track?: string;
|
|
435
|
+
trackLng?: number;
|
|
436
|
+
controls?: boolean;
|
|
437
|
+
}
|
|
438
|
+
interface Slide {
|
|
439
|
+
image?: ImageMedia;
|
|
440
|
+
text?: string;
|
|
441
|
+
}
|
|
442
|
+
type ContainerStyle = Record<string, unknown>;
|
|
443
|
+
/**
|
|
444
|
+
* Transitions
|
|
445
|
+
*/
|
|
446
|
+
type TransitionName = 'fade' | 'scale' | 'slide';
|
|
447
|
+
type TransitionEasing = 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear';
|
|
448
|
+
interface TransitionConfig {
|
|
449
|
+
name: TransitionName;
|
|
450
|
+
duration?: number;
|
|
451
|
+
easing?: TransitionEasing;
|
|
452
|
+
}
|
|
453
|
+
type Transition = TransitionName | TransitionConfig;
|
|
454
|
+
interface Transitions {
|
|
455
|
+
in?: Transition;
|
|
456
|
+
out?: Transition;
|
|
457
|
+
}
|
|
458
|
+
/**
|
|
459
|
+
* Search
|
|
460
|
+
*/
|
|
461
|
+
interface SearchFilter {
|
|
462
|
+
type?: string;
|
|
463
|
+
value?: string | number;
|
|
464
|
+
}
|
|
465
|
+
/**
|
|
466
|
+
* Payments
|
|
467
|
+
*/
|
|
468
|
+
interface PaymentItem {
|
|
469
|
+
id?: string | number;
|
|
470
|
+
date?: string;
|
|
471
|
+
type?: string;
|
|
472
|
+
invoice_link?: string;
|
|
473
|
+
amount?: string | number;
|
|
474
|
+
}
|
|
475
|
+
/**
|
|
476
|
+
* Page Metadata
|
|
477
|
+
*/
|
|
478
|
+
interface PageMetadata {
|
|
479
|
+
canonical?: string;
|
|
480
|
+
description?: string;
|
|
481
|
+
keywords?: string | string[];
|
|
482
|
+
image?: {
|
|
483
|
+
url?: string;
|
|
484
|
+
};
|
|
485
|
+
favicon?: {
|
|
486
|
+
url?: string;
|
|
487
|
+
};
|
|
488
|
+
rssUrl?: string;
|
|
489
|
+
atomUrl?: string;
|
|
490
|
+
microformats?: Record<string, unknown>[];
|
|
491
|
+
}
|
|
492
|
+
interface AuthorElement {
|
|
493
|
+
name?: TextElement;
|
|
494
|
+
avatar?: {
|
|
495
|
+
url?: string;
|
|
496
|
+
};
|
|
497
|
+
}
|
|
498
|
+
interface Visitor {
|
|
499
|
+
id?: string | number;
|
|
500
|
+
name?: string;
|
|
501
|
+
}
|
|
502
|
+
interface Badge {
|
|
503
|
+
label?: TextElement;
|
|
504
|
+
buttonStyle?: BoxStyle;
|
|
505
|
+
}
|
|
506
|
+
interface CustomAnswer {
|
|
507
|
+
active?: boolean;
|
|
508
|
+
placeholder?: TextElement;
|
|
509
|
+
textStyle?: TextStyle;
|
|
510
|
+
boxStyle?: BoxStyle;
|
|
511
|
+
}
|
|
512
|
+
interface Header {
|
|
513
|
+
badge?: Badge;
|
|
514
|
+
}
|
|
515
|
+
interface Footer {
|
|
516
|
+
callToAction?: CallToAction;
|
|
517
|
+
}
|
|
518
|
+
type Reload = Record<string, unknown>;
|
|
519
|
+
interface ClosedCaptions {
|
|
520
|
+
file?: ClosedCaptionsMedia;
|
|
521
|
+
textStyle?: TextStyle;
|
|
522
|
+
boxStyle?: BoxStyle;
|
|
523
|
+
}
|
|
524
|
+
type ButtonLayout = 'label-bottom' | 'label-top' | 'no-label' | 'label-over' | 'label-left' | 'label-right';
|
|
525
|
+
|
|
526
|
+
declare class ColorsParser {
|
|
527
|
+
constructor({ fieldsManager, screensManager }: {
|
|
528
|
+
fieldsManager: any;
|
|
529
|
+
screensManager: any;
|
|
530
|
+
});
|
|
531
|
+
parse(story: any): any;
|
|
532
|
+
getColorFieldPatterns(fields: any, namePrefix?: any): any;
|
|
533
|
+
static fieldIsColor({ id }: {
|
|
534
|
+
id?: any;
|
|
535
|
+
}): boolean;
|
|
536
|
+
static getColorsFromPath(data: any, patterns: any, colors?: any, keyPrefix?: any): any;
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
declare class ComponentsManager extends EventEmitter {
|
|
540
|
+
constructor(components?: {});
|
|
541
|
+
addComponent(name: any, component: any, namespace?: any): this;
|
|
542
|
+
addComponents(components: any, namespace?: any): this;
|
|
543
|
+
merge(manager: any, namespace?: any): this;
|
|
544
|
+
addNamespace(namespace: any): this;
|
|
545
|
+
getComponent(name: any, namespace?: any): any;
|
|
546
|
+
getComponents(namespace?: any): any;
|
|
547
|
+
hasComponent(name: any, namespace?: any): boolean;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
declare class DefinitionsManager extends EventEmitter {
|
|
551
|
+
constructor(definitions?: any[]);
|
|
552
|
+
addDefinition(definition: any): this;
|
|
553
|
+
addDefinitions(definitions: any): this;
|
|
554
|
+
merge(manager: any): this;
|
|
555
|
+
filter(filter: any): DefinitionsManager;
|
|
556
|
+
getDefinition(id: any): any;
|
|
557
|
+
getDefinitions(): any;
|
|
558
|
+
hasDefinition(id: any): boolean;
|
|
559
|
+
getComponent(id: any): any;
|
|
560
|
+
getComponents(): any;
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
declare class EventsManager extends EventEmitter {
|
|
564
|
+
constructor(element: any);
|
|
565
|
+
subscribe(event: any, callback: any): void;
|
|
566
|
+
unsubscribe(event: any, callback: any): void;
|
|
567
|
+
addEventListener(event: any): void;
|
|
568
|
+
removeEventListener(event: any): void;
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
declare class FieldsManager extends DefinitionsManager {
|
|
572
|
+
filter(filter: any): FieldsManager;
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
declare class MediasParser {
|
|
576
|
+
constructor({ fieldsManager, screensManager, fieldsPattern }: {
|
|
577
|
+
fieldsManager: any;
|
|
578
|
+
screensManager: any;
|
|
579
|
+
fieldsPattern?: {};
|
|
580
|
+
});
|
|
581
|
+
getParsedStoryTheme(storyId: any, theme: any): any;
|
|
582
|
+
getFieldsPatternByScreen(type: any): any;
|
|
583
|
+
toPath(story: any): any;
|
|
584
|
+
fromPath(story: any, defaultMedias?: any): any;
|
|
585
|
+
getFieldsPattern(fields: any, namePrefix?: any): any;
|
|
586
|
+
static fieldIsMedia({ media }: {
|
|
587
|
+
media?: boolean;
|
|
588
|
+
}): boolean;
|
|
589
|
+
static fieldIsFontFamily({ id }: {
|
|
590
|
+
id?: any;
|
|
591
|
+
}): boolean;
|
|
592
|
+
static replacePathsWithMedias(data: any, medias: any, patterns: any, keyPrefix?: any): any;
|
|
593
|
+
static getMediaPath({ id }: {
|
|
594
|
+
id?: any;
|
|
595
|
+
}): string;
|
|
596
|
+
static replaceMediasWithPaths(data: any, patterns: any, medias?: any, keyPrefix?: any): any;
|
|
597
|
+
static getMediaPatternsFromData(obj: any): RegExp[];
|
|
598
|
+
static dot(obj: any): any;
|
|
599
|
+
static keys(obj: any): any[];
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
declare class ScreensManager extends DefinitionsManager {
|
|
603
|
+
constructor(definitions?: any[]);
|
|
604
|
+
getFields(id: any): any;
|
|
605
|
+
getLayouts(id: any): any;
|
|
606
|
+
getFieldsPattern(): any;
|
|
607
|
+
setFieldsPattern(fieldsPattern: any): void;
|
|
608
|
+
filter(filter: any): ScreensManager;
|
|
609
|
+
merge(manager: any): this;
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
declare class StoryParser {
|
|
613
|
+
constructor({ screensManager, fieldsManager, fieldsPattern }: {
|
|
614
|
+
screensManager: any;
|
|
615
|
+
fieldsManager: any;
|
|
616
|
+
fieldsPattern: any;
|
|
617
|
+
});
|
|
618
|
+
parse(story: any, { withTheme, withMedias, withFonts, withMigrations }?: {
|
|
619
|
+
withTheme?: boolean;
|
|
620
|
+
withMedias?: boolean;
|
|
621
|
+
withFonts?: boolean;
|
|
622
|
+
withMigrations?: boolean;
|
|
623
|
+
}): any;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
declare class ThemeParser {
|
|
627
|
+
constructor({ screensManager }: {
|
|
628
|
+
screensManager: any;
|
|
629
|
+
});
|
|
630
|
+
getDefinitionByScreen(type: any, themeComponents: any): any;
|
|
631
|
+
getFieldsForDefinition(definition: any): any;
|
|
632
|
+
parse(story: any): any;
|
|
633
|
+
parseScreen(definition: any, value: any, themeValue: any, themeBackground: any, themeColors: any, themeTextStyles: any, themeBoxStyles: any): any;
|
|
634
|
+
parseField(value: any, fieldDefinition: any, themeValue: any, themeColors: any, themeTextStyles: any, themeBoxStyles: any): any;
|
|
635
|
+
parseInnerFields(value: any, fieldsOrDefinition: any, themeValue: any, themeColors: any, themeTextStyles: any, themeBoxStyles: any): {};
|
|
636
|
+
parseValue(initialValue: any, fieldTheme: any, themeValue: any, themeColors: any, themeTextStyles: any, themeBoxStyles: any): any;
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
declare class FontsParser {
|
|
640
|
+
constructor({ fieldsManager, screensManager, fieldsPattern }: {
|
|
641
|
+
fieldsManager: any;
|
|
642
|
+
screensManager: any;
|
|
643
|
+
fieldsPattern?: {};
|
|
644
|
+
});
|
|
645
|
+
getFieldsPatternByScreen(type: any): any;
|
|
646
|
+
parse(story: any): any;
|
|
647
|
+
getFieldsPattern(fields: any, namePrefix?: any): any;
|
|
648
|
+
static fieldIsFontFamily({ id }: {
|
|
649
|
+
id?: any;
|
|
650
|
+
}): boolean;
|
|
651
|
+
static valueIsFont({ type }: {
|
|
652
|
+
type?: any;
|
|
653
|
+
}): boolean;
|
|
654
|
+
static extractFontsWithPaths(data: any, patterns: any, keyPrefix?: any): any;
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
declare class Tracking extends Tracking$1 {
|
|
658
|
+
constructor(opts?: {});
|
|
659
|
+
trackScreenView(screen: any, screenIndex: any): void;
|
|
660
|
+
trackEvent(category?: any, action?: any, label?: any, opts?: any): void;
|
|
661
|
+
trackMedia(type?: any, media?: any, action?: any, opts?: any): void;
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
export { ColorsParser, ComponentsManager, DefinitionsManager, EventsManager, FieldsManager, FontsParser, MediasParser, ScreensManager, StoryParser, ThemeParser, Tracking };
|
|
665
|
+
export type { ActiveForm, AdFormat, AdFormats, Alternatives, Answer, AudioComponent, AudioElement, AudioMedia, AuthorElement, BackgroundElement, Badge, BootstrapTheme, BorderStyle, BorderType, BoxStyle, Breadcrumb, Button, ButtonLayout, ButtonSize, ButtonTheme, CallToAction, CallToActionType, ClosedCaptions, ClosedCaptionsElement, ClosedCaptionsMedia, Color, ColorObject, Component, ContainerStyle, Conversation, ConversationMessage, CustomAnswer, CustomFont, DefaultMessage, DefaultMessageContent, Device, DeviceScreen, DropdownAlign, Errors, Field, FieldDefinition, Font, FontMedia, FontStyle, Footer, FormControlSize, FormErrors, FormField, GeoPosition, GridElement, GridLayout, GridLayoutItem, Header, HeadingElement, History, ImageElement, ImageElementWithCaption, ImageMedia, InputElement, Interaction, Intl, Label, Location, Margin, Marker, MarkerWithImage, Media, MediaFile, MediaMetadata, MediaType, MenuItem, Message, Metadata, Modal, ObjectFit, ObjectFitSize, PageMetadata, Panel, PaymentItem, Progress, QuizAnswer, Ref, Reload, RenderContext, ScreenComponent, ScreenDefinition, ScreenSize, SearchFilter, SelectOption, ShadowType, ShareIncentive, Slide, Speaker, StackAlign, StackDirection, StackElement, StackSpacing, StatusCode, Story, StoryComponent, Tag, Target, Text, TextAlign, TextElement, TextStyle, Theme, TimingOverrides, TrackingVariables, Transition, TransitionConfig, TransitionEasing, TransitionName, Transitions, User, VideoElement, VideoMedia, ViewerTheme, Visitor, VisualElement };
|