@inappstory/slide-api 0.0.2 → 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/dist/index.cjs +306 -210
- package/dist/index.d.cts +514 -2
- package/dist/index.d.ts +514 -2
- package/dist/index.js +306 -210
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
type WidgetRangeSliderOptions = WidgetOptionsBase & {
|
|
2
|
+
rangeClass: string;
|
|
3
|
+
activeClass: string;
|
|
4
|
+
horizontalClass: string;
|
|
5
|
+
verticalClass: string;
|
|
6
|
+
fillClass: string;
|
|
7
|
+
handleClass: string;
|
|
8
|
+
};
|
|
1
9
|
type WidgetRangeSliderSharedData = Record<string,
|
|
2
10
|
// element_id
|
|
3
11
|
{
|
|
@@ -6,6 +14,74 @@ type WidgetRangeSliderSharedData = Record<string,
|
|
|
6
14
|
}> & {
|
|
7
15
|
ts: number; // unixtimestamp
|
|
8
16
|
};
|
|
17
|
+
declare class WidgetRangeSlider extends WidgetBase<WidgetRangeSliderOptions> {
|
|
18
|
+
static DEFAULTS: WidgetRangeSliderOptions;
|
|
19
|
+
static widgetClassName: string;
|
|
20
|
+
private label;
|
|
21
|
+
private topScale;
|
|
22
|
+
private startValue;
|
|
23
|
+
private snapPosition;
|
|
24
|
+
private hasSubmitButton;
|
|
25
|
+
private elementSlider;
|
|
26
|
+
private elementAverageResult;
|
|
27
|
+
private elementAverageResultTooltip;
|
|
28
|
+
private elementAverageResultTooltipLabelView;
|
|
29
|
+
private orientation;
|
|
30
|
+
private min;
|
|
31
|
+
private max;
|
|
32
|
+
private value;
|
|
33
|
+
private step;
|
|
34
|
+
private toFixed;
|
|
35
|
+
private fill;
|
|
36
|
+
private handle;
|
|
37
|
+
private range;
|
|
38
|
+
private DIMENSION;
|
|
39
|
+
private DIRECTION;
|
|
40
|
+
private DIRECTION_STYLE;
|
|
41
|
+
private COORDINATE;
|
|
42
|
+
private isClickCapturedBySlider;
|
|
43
|
+
private handleDimension;
|
|
44
|
+
private rangeDimension;
|
|
45
|
+
private maxHandlePos;
|
|
46
|
+
private grabPos;
|
|
47
|
+
private position;
|
|
48
|
+
private prevSnapValue;
|
|
49
|
+
/**
|
|
50
|
+
* @throws Error
|
|
51
|
+
* @param element
|
|
52
|
+
* @param options
|
|
53
|
+
*/
|
|
54
|
+
constructor(element: HTMLElement, options: Partial<WidgetRangeSliderOptions>);
|
|
55
|
+
refreshUserData(localData: Record<string, any>): void;
|
|
56
|
+
private _statEventInputSave;
|
|
57
|
+
click(): boolean;
|
|
58
|
+
private completeWidget;
|
|
59
|
+
isDone(): boolean;
|
|
60
|
+
getIsClickCapturedBySlider(): boolean;
|
|
61
|
+
private displayAverageAnswer;
|
|
62
|
+
private init;
|
|
63
|
+
private update;
|
|
64
|
+
private handleDown;
|
|
65
|
+
private handleMove;
|
|
66
|
+
private handleEnd;
|
|
67
|
+
private cap;
|
|
68
|
+
private setPosition;
|
|
69
|
+
// Returns element position relative to the parent
|
|
70
|
+
private getPositionFromNode;
|
|
71
|
+
private getRelativePosition;
|
|
72
|
+
private getPercentageFromValue;
|
|
73
|
+
private getPositionFromValue;
|
|
74
|
+
private getValueFromPosition;
|
|
75
|
+
private setValue;
|
|
76
|
+
private destroy;
|
|
77
|
+
static api: {
|
|
78
|
+
initWidget: (element: HTMLElement, localData?: Record<string, any>) => void;
|
|
79
|
+
click: (element: HTMLElement) => boolean;
|
|
80
|
+
isClickCapturedBySlider: (element: HTMLElement) => boolean;
|
|
81
|
+
refreshUserData: <Widget extends WidgetBase<WidgetOptions>, WidgetOptions extends WidgetOptionsBase>(nodes: NodeListOf<HTMLElement>, localData?: Record<string, any> | undefined) => void;
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
type WidgetPollOptions = WidgetOptionsBase;
|
|
9
85
|
type WidgetPollSharedData = Record<string,
|
|
10
86
|
// element_id
|
|
11
87
|
{
|
|
@@ -14,10 +90,93 @@ type WidgetPollSharedData = Record<string,
|
|
|
14
90
|
}> & {
|
|
15
91
|
ts: number; // unixtimestamp
|
|
16
92
|
};
|
|
93
|
+
declare class WidgetPoll extends WidgetBase<WidgetPollOptions> {
|
|
94
|
+
static DEFAULTS: {
|
|
95
|
+
slide: null;
|
|
96
|
+
activateAfterCreate: boolean;
|
|
97
|
+
create: boolean;
|
|
98
|
+
localData: {};
|
|
99
|
+
};
|
|
100
|
+
static widgetClassName: string;
|
|
101
|
+
private elementRect;
|
|
102
|
+
private label;
|
|
103
|
+
private percentFillMask;
|
|
104
|
+
private maskedVariants;
|
|
105
|
+
private variantsViewGroup;
|
|
106
|
+
private variants;
|
|
107
|
+
private variantsTexts;
|
|
108
|
+
private isInvertedPercentFilledMaskDirection;
|
|
109
|
+
private getUseResponseOnFirstButton;
|
|
110
|
+
private getUseResponseOnSecondButton;
|
|
111
|
+
private showClientTotalResult;
|
|
112
|
+
private selectedVariant;
|
|
113
|
+
private nativeDialogueWasOpened;
|
|
114
|
+
private answerDuration;
|
|
115
|
+
/**
|
|
116
|
+
* @throws Error
|
|
117
|
+
* @param element
|
|
118
|
+
* @param options
|
|
119
|
+
*/
|
|
120
|
+
constructor(element: HTMLElement, options: Partial<WidgetPollOptions>);
|
|
121
|
+
refreshUserData(localData: Record<string, any>): void;
|
|
122
|
+
private _statEventPollAnswer;
|
|
123
|
+
private _statEventInputSave;
|
|
124
|
+
_selectVariant(index: number, filled?: boolean): void;
|
|
125
|
+
private _clearVariantSelection;
|
|
126
|
+
private selectVariant;
|
|
127
|
+
private _getVariantBoxInPercent;
|
|
128
|
+
displayPercents(selectedVariantIndex: number, filled?: boolean): void;
|
|
129
|
+
setUserText(text: string, buttonPosition: "first_button" | "second_button"): void;
|
|
130
|
+
private completeWidget;
|
|
131
|
+
isDone(): boolean;
|
|
132
|
+
slidePollIsDone(): boolean;
|
|
133
|
+
static api: {
|
|
134
|
+
initWidget: (element: HTMLElement, localData?: Record<string, any>) => void;
|
|
135
|
+
select: (element: HTMLElement) => boolean;
|
|
136
|
+
slidePollIsDone: (element: HTMLElement) => boolean;
|
|
137
|
+
setUserData: (id: string, text: string) => void;
|
|
138
|
+
refreshUserData: <Widget extends WidgetBase<WidgetOptions>, WidgetOptions extends WidgetOptionsBase>(nodes: NodeListOf<HTMLElement>, localData?: Record<string, any> | undefined) => void;
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
type WidgetVoteOptions = WidgetOptionsBase;
|
|
17
142
|
type WidgetVoteSharedData = Record<string, Array<number> // variant_index total count
|
|
18
143
|
> & {
|
|
19
144
|
ts: number; // unixtimestamp
|
|
20
145
|
};
|
|
146
|
+
declare class WidgetVote extends WidgetBase<WidgetVoteOptions> {
|
|
147
|
+
static DEFAULTS: WidgetVoteOptions;
|
|
148
|
+
static widgetClassName: string;
|
|
149
|
+
private question;
|
|
150
|
+
private answers;
|
|
151
|
+
private questionCount;
|
|
152
|
+
private selectedAnswer;
|
|
153
|
+
private label;
|
|
154
|
+
private variants;
|
|
155
|
+
private variantsTexts;
|
|
156
|
+
private selectedVariant;
|
|
157
|
+
private voteAllocation;
|
|
158
|
+
private hideClientTotalResult;
|
|
159
|
+
/**
|
|
160
|
+
* @throws Error
|
|
161
|
+
* @param element
|
|
162
|
+
* @param options
|
|
163
|
+
*/
|
|
164
|
+
constructor(element: HTMLElement, options: Partial<WidgetVoteOptions>);
|
|
165
|
+
refreshUserData(localData: Record<string, any>): void;
|
|
166
|
+
private _statEventVoteVariant;
|
|
167
|
+
private _selectVariant;
|
|
168
|
+
selectVariant(variant: HTMLElement): boolean;
|
|
169
|
+
private displayPercents;
|
|
170
|
+
isDone(): boolean;
|
|
171
|
+
slideVoteIsDone(): boolean;
|
|
172
|
+
static api: {
|
|
173
|
+
fallbackInitOnMultiSlide: (element: HTMLElement, localData?: Record<string, any>) => void;
|
|
174
|
+
initWidget: (element: HTMLElement, localData?: Record<string, any>) => void;
|
|
175
|
+
select: (element: HTMLElement) => boolean;
|
|
176
|
+
slideVoteIsDone: (element: HTMLElement) => boolean;
|
|
177
|
+
refreshUserData: <Widget extends WidgetBase<WidgetOptions>, WidgetOptions extends WidgetOptionsBase>(nodes: NodeListOf<HTMLElement>, localData?: Record<string, any> | undefined) => void;
|
|
178
|
+
};
|
|
179
|
+
}
|
|
21
180
|
type WidgetOptionsBase = {
|
|
22
181
|
slide: HTMLElement | null;
|
|
23
182
|
activateAfterCreate: boolean;
|
|
@@ -111,7 +270,7 @@ declare class WidgetsService {
|
|
|
111
270
|
}
|
|
112
271
|
declare class WidgetBase<WidgetOptions extends WidgetOptionsBase> {
|
|
113
272
|
/**
|
|
114
|
-
* @see https://github.com/Microsoft/TypeScript/issues/3841#issuecomment-
|
|
273
|
+
* @see https://github.com/Microsoft/TypeScript/issues/3841#issuecomment-1488919713
|
|
115
274
|
*/
|
|
116
275
|
["constructor"]: typeof WidgetBase;
|
|
117
276
|
static DEFAULTS: WidgetOptionsBase;
|
|
@@ -276,6 +435,359 @@ interface SDKInterface {
|
|
|
276
435
|
*/
|
|
277
436
|
storyShowNext(): void;
|
|
278
437
|
}
|
|
438
|
+
type WidgetCopyOptions = WidgetOptionsBase;
|
|
439
|
+
declare class WidgetCopy extends WidgetBase<WidgetCopyOptions> {
|
|
440
|
+
static DEFAULTS: WidgetCopyOptions;
|
|
441
|
+
static widgetClassName: string;
|
|
442
|
+
private button;
|
|
443
|
+
private clipboardTarget;
|
|
444
|
+
private isPromotionalCode;
|
|
445
|
+
private state;
|
|
446
|
+
private msgNetworkError;
|
|
447
|
+
private msgServiceError;
|
|
448
|
+
private msgNoMoreCodes;
|
|
449
|
+
private msgTryAgain;
|
|
450
|
+
private geometry;
|
|
451
|
+
private resultLayer;
|
|
452
|
+
private resultLayerGeometry;
|
|
453
|
+
constructor(element: HTMLElement, options: Partial<WidgetCopyOptions>);
|
|
454
|
+
refreshUserData(localData: Record<string, any>): void;
|
|
455
|
+
private isTransparentElement;
|
|
456
|
+
private changeText;
|
|
457
|
+
private fetchPromoCode;
|
|
458
|
+
getStateValue(): number | null;
|
|
459
|
+
getIsPromotionalCode(): boolean;
|
|
460
|
+
private _statEventCopyClick;
|
|
461
|
+
private _select;
|
|
462
|
+
copyToClipboard(element: HTMLElement): void;
|
|
463
|
+
private completeWidget;
|
|
464
|
+
isDone(): boolean;
|
|
465
|
+
static api: {
|
|
466
|
+
initWidget: (nodeList: NodeListOf<HTMLElement>, localData?: Record<string, any>) => void;
|
|
467
|
+
click: (element: HTMLElement) => boolean;
|
|
468
|
+
refreshUserData: <Widget extends WidgetBase<WidgetOptions>, WidgetOptions extends WidgetOptionsBase>(nodes: NodeListOf<HTMLElement>, localData?: Record<string, any> | undefined) => void;
|
|
469
|
+
};
|
|
470
|
+
}
|
|
471
|
+
type WidgetDataInputOptions = WidgetOptionsBase;
|
|
472
|
+
declare class WidgetDataInput extends WidgetBase<WidgetDataInputOptions> {
|
|
473
|
+
static DEFAULTS: {
|
|
474
|
+
slide: null;
|
|
475
|
+
activateAfterCreate: boolean;
|
|
476
|
+
create: boolean;
|
|
477
|
+
localData: {};
|
|
478
|
+
};
|
|
479
|
+
static widgetClassName: string;
|
|
480
|
+
private label;
|
|
481
|
+
private elementRect;
|
|
482
|
+
private inputElement;
|
|
483
|
+
private textElement;
|
|
484
|
+
private inputPlaceholderValue;
|
|
485
|
+
/**
|
|
486
|
+
* @throws Error
|
|
487
|
+
* @param element
|
|
488
|
+
* @param options
|
|
489
|
+
*/
|
|
490
|
+
constructor(element: HTMLElement, options: Partial<WidgetDataInputOptions>);
|
|
491
|
+
refreshUserData(localData: Record<string, any>): void;
|
|
492
|
+
private _statEventFocusIn;
|
|
493
|
+
private _statEventInputSave;
|
|
494
|
+
isDone(): boolean;
|
|
495
|
+
click(element: HTMLElement): boolean;
|
|
496
|
+
private _fillUserText;
|
|
497
|
+
setUserText(text: string): void;
|
|
498
|
+
static api: {
|
|
499
|
+
initWidget: (nodeList: NodeListOf<HTMLElement>, localData?: Record<string, any>) => void;
|
|
500
|
+
click: (element: HTMLElement) => boolean;
|
|
501
|
+
setUserData: (id: string, text: string) => void;
|
|
502
|
+
refreshUserData: <Widget extends WidgetBase<WidgetOptions>, WidgetOptions extends WidgetOptionsBase>(nodes: NodeListOf<HTMLElement>, localData?: Record<string, any> | undefined) => void;
|
|
503
|
+
};
|
|
504
|
+
}
|
|
505
|
+
type WidgetDateCountdownOptions = WidgetOptionsBase & {
|
|
506
|
+
layers: Array<HTMLElement>;
|
|
507
|
+
};
|
|
508
|
+
declare class WidgetDateCountdown extends WidgetBase<WidgetDateCountdownOptions> {
|
|
509
|
+
static DEFAULTS: WidgetDateCountdownOptions;
|
|
510
|
+
static widgetClassName: string;
|
|
511
|
+
private label;
|
|
512
|
+
private layers;
|
|
513
|
+
private messages;
|
|
514
|
+
private timestampSeconds;
|
|
515
|
+
private diff;
|
|
516
|
+
private timerInited;
|
|
517
|
+
private pendingUpdate;
|
|
518
|
+
private firstGroup1;
|
|
519
|
+
private firstGroup2;
|
|
520
|
+
private firstGroupCaption;
|
|
521
|
+
private secondGroup1;
|
|
522
|
+
private secondGroup2;
|
|
523
|
+
private secondGroupCaption;
|
|
524
|
+
private thirdGroup1;
|
|
525
|
+
private thirdGroup2;
|
|
526
|
+
private thirdGroupCaption;
|
|
527
|
+
constructor(element: HTMLElement, options: Partial<WidgetDateCountdownOptions>);
|
|
528
|
+
refreshUserData(localData: Record<string, any>): void;
|
|
529
|
+
private pause;
|
|
530
|
+
private resume;
|
|
531
|
+
private initTimer;
|
|
532
|
+
private updateTimer;
|
|
533
|
+
private _asDuration;
|
|
534
|
+
static api: {
|
|
535
|
+
initWidget: (nodeList: NodeListOf<HTMLElement>, layers: Array<HTMLElement>, localData?: Record<string, any>) => void;
|
|
536
|
+
pause: (nodeList: NodeListOf<HTMLElement>) => void;
|
|
537
|
+
resume: (nodeList: NodeListOf<HTMLElement>) => void;
|
|
538
|
+
refreshUserData: <Widget extends WidgetBase<WidgetOptions>, WidgetOptions extends WidgetOptionsBase>(nodes: NodeListOf<HTMLElement>, localData?: Record<string, any> | undefined) => void;
|
|
539
|
+
};
|
|
540
|
+
}
|
|
541
|
+
declare class WidgetMultiSlide {
|
|
542
|
+
static api: {
|
|
543
|
+
init: (slides: Array<HTMLElement>, localData?: Record<string, any>) => void;
|
|
544
|
+
};
|
|
545
|
+
}
|
|
546
|
+
type WidgetPollLayersOptions = WidgetOptionsBase & {
|
|
547
|
+
layers: Array<HTMLElement>;
|
|
548
|
+
};
|
|
549
|
+
declare class WidgetPollLayers extends WidgetBase<WidgetPollLayersOptions> {
|
|
550
|
+
static DEFAULTS: WidgetPollLayersOptions;
|
|
551
|
+
static widgetClassName: string;
|
|
552
|
+
private label;
|
|
553
|
+
private variants;
|
|
554
|
+
private variantsTexts;
|
|
555
|
+
private selectedVariant;
|
|
556
|
+
private layers;
|
|
557
|
+
constructor(element: HTMLElement, options: Partial<WidgetPollLayersOptions>);
|
|
558
|
+
refreshUserData(localData: Record<string, any>): void;
|
|
559
|
+
private _statEventPollVariant;
|
|
560
|
+
private _selectVariant;
|
|
561
|
+
selectVariant(variant: HTMLElement): boolean;
|
|
562
|
+
private completeWidget;
|
|
563
|
+
isDone(): boolean;
|
|
564
|
+
slidePollIsDone(): boolean;
|
|
565
|
+
static api: {
|
|
566
|
+
initWidget: (element: HTMLElement, layers: Array<HTMLElement>, localData?: Record<string, any>) => void;
|
|
567
|
+
select: (element: HTMLElement) => boolean;
|
|
568
|
+
refreshUserData: <Widget extends WidgetBase<WidgetOptions>, WidgetOptions extends WidgetOptionsBase>(nodes: NodeListOf<HTMLElement>, localData?: Record<string, any> | undefined) => void;
|
|
569
|
+
};
|
|
570
|
+
}
|
|
571
|
+
type WidgetQuestOptions = WidgetOptionsBase;
|
|
572
|
+
declare class WidgetQuest extends WidgetBase<WidgetQuestOptions> {
|
|
573
|
+
static DEFAULTS: WidgetQuestOptions;
|
|
574
|
+
static widgetClassName: string;
|
|
575
|
+
private selectedAnswer;
|
|
576
|
+
protected label: HTMLElement | null;
|
|
577
|
+
protected variants: Array<HTMLElement>;
|
|
578
|
+
private isWidget;
|
|
579
|
+
private slideCount;
|
|
580
|
+
private nonFinalSlide;
|
|
581
|
+
private finalSlide;
|
|
582
|
+
constructor(element: HTMLElement, options: Partial<WidgetQuestOptions>);
|
|
583
|
+
refreshUserData(localData: Record<string, any>): void;
|
|
584
|
+
private setStorySessionValue;
|
|
585
|
+
private getStorySessionValue;
|
|
586
|
+
private init;
|
|
587
|
+
private _selectAnswer;
|
|
588
|
+
selectAnswer(answer: HTMLElement): boolean;
|
|
589
|
+
isDone(): boolean;
|
|
590
|
+
slideQuestIsDone(): boolean;
|
|
591
|
+
private firstSlideWithQuestIndex;
|
|
592
|
+
private lastSlideWithQuestIndex;
|
|
593
|
+
private _getRoutes;
|
|
594
|
+
private _addNewRouteHistory;
|
|
595
|
+
private _routeMvPtrBack;
|
|
596
|
+
private getLastSlideIndexFromRouteHistory;
|
|
597
|
+
private handleRouteClick;
|
|
598
|
+
static api: {
|
|
599
|
+
initWidget: (element: HTMLElement, localData?: Record<string, any>) => Promise<boolean>;
|
|
600
|
+
select: (element: HTMLElement) => boolean;
|
|
601
|
+
slideTestIsDone: (element: HTMLElement) => boolean;
|
|
602
|
+
handleRouteClick: (element: HTMLElement, event: {
|
|
603
|
+
direction: "backward" | "forward";
|
|
604
|
+
slideIndex: number;
|
|
605
|
+
slideCount: number;
|
|
606
|
+
click: () => void;
|
|
607
|
+
}) => void;
|
|
608
|
+
refreshUserData: <Widget extends WidgetBase<WidgetOptions>, WidgetOptions extends WidgetOptionsBase>(nodes: NodeListOf<HTMLElement>, localData?: Record<string, any> | undefined) => void;
|
|
609
|
+
};
|
|
610
|
+
}
|
|
611
|
+
type WidgetQuizOptions = WidgetOptionsBase;
|
|
612
|
+
declare class WidgetQuiz extends WidgetBase<WidgetQuizOptions> {
|
|
613
|
+
static DEFAULTS: WidgetQuizOptions;
|
|
614
|
+
static widgetClassName: string;
|
|
615
|
+
private question;
|
|
616
|
+
private answers;
|
|
617
|
+
private questionCount;
|
|
618
|
+
private selectedAnswer;
|
|
619
|
+
constructor(element: HTMLElement, options: Partial<WidgetQuizOptions>);
|
|
620
|
+
refreshUserData(localData: Record<string, any>): void;
|
|
621
|
+
private _selectAnswer;
|
|
622
|
+
private _clearAnswerSelection;
|
|
623
|
+
selectAnswer(answer: HTMLElement): boolean;
|
|
624
|
+
isDone(): boolean;
|
|
625
|
+
slideQuizIsDone(): boolean;
|
|
626
|
+
static api: {
|
|
627
|
+
initWidget: (element: HTMLElement, localData?: Record<string, any>) => void;
|
|
628
|
+
select: (element: HTMLElement) => boolean;
|
|
629
|
+
slideQuizIsDone: (element: HTMLElement) => boolean;
|
|
630
|
+
refreshUserData: <Widget extends WidgetBase<WidgetOptions>, WidgetOptions extends WidgetOptionsBase>(nodes: NodeListOf<HTMLElement>, localData?: Record<string, any> | undefined) => void;
|
|
631
|
+
};
|
|
632
|
+
}
|
|
633
|
+
type WidgetQuizGroupedOptions = WidgetOptionsBase;
|
|
634
|
+
declare class WidgetQuizGrouped extends WidgetBase<WidgetQuizGroupedOptions> {
|
|
635
|
+
static DEFAULTS: {
|
|
636
|
+
slide: null;
|
|
637
|
+
activateAfterCreate: boolean;
|
|
638
|
+
create: boolean;
|
|
639
|
+
localData: {};
|
|
640
|
+
};
|
|
641
|
+
static widgetClassName: string;
|
|
642
|
+
private question;
|
|
643
|
+
private answers;
|
|
644
|
+
private questionCount;
|
|
645
|
+
private selectedAnswer;
|
|
646
|
+
/**
|
|
647
|
+
* @throws Error
|
|
648
|
+
* @param element
|
|
649
|
+
* @param options
|
|
650
|
+
*/
|
|
651
|
+
constructor(element: HTMLElement, options: Partial<WidgetQuizGroupedOptions>);
|
|
652
|
+
refreshUserData(localData: Record<string, any>): void;
|
|
653
|
+
private _selectAnswer;
|
|
654
|
+
private _clearAnswerSelection;
|
|
655
|
+
private _updateScore;
|
|
656
|
+
private selectAnswer;
|
|
657
|
+
isDone(): boolean;
|
|
658
|
+
slideQuizIsDone(): boolean;
|
|
659
|
+
static api: {
|
|
660
|
+
initWidget: (element: HTMLElement, localData?: Record<string, any>) => void;
|
|
661
|
+
select: (element: HTMLElement) => boolean;
|
|
662
|
+
slideQuizIsDone: (element: HTMLElement) => boolean;
|
|
663
|
+
refreshUserData: <Widget extends WidgetBase<WidgetOptions>, WidgetOptions extends WidgetOptionsBase>(nodes: NodeListOf<HTMLElement>, localData?: Record<string, any> | undefined) => void;
|
|
664
|
+
};
|
|
665
|
+
}
|
|
666
|
+
type WidgetRateOptions = WidgetOptionsBase;
|
|
667
|
+
declare class WidgetRate extends WidgetBase<WidgetRateOptions> {
|
|
668
|
+
static DEFAULTS: WidgetRateOptions;
|
|
669
|
+
static widgetClassName: string;
|
|
670
|
+
private elementRect;
|
|
671
|
+
private label;
|
|
672
|
+
private nativeDialogueWasOpened;
|
|
673
|
+
private stars;
|
|
674
|
+
private submitToStores;
|
|
675
|
+
private submitToStoresMin;
|
|
676
|
+
private submitToStoresMax;
|
|
677
|
+
private showDialogOnLowRate;
|
|
678
|
+
private showDialogueMin;
|
|
679
|
+
private showDialogueMax;
|
|
680
|
+
private selectedStar;
|
|
681
|
+
private answerSelectDuration;
|
|
682
|
+
constructor(element: HTMLElement, options: Partial<WidgetRateOptions>);
|
|
683
|
+
refreshUserData(localData: Record<string, any>): void;
|
|
684
|
+
private _statEventRateUsAnswer;
|
|
685
|
+
private _selectStar;
|
|
686
|
+
private _clearSelectedStar;
|
|
687
|
+
private selectStar;
|
|
688
|
+
setUserText(text: string): void;
|
|
689
|
+
private completeWidget;
|
|
690
|
+
isDone(): boolean;
|
|
691
|
+
slideRateIsDone(): boolean;
|
|
692
|
+
static api: {
|
|
693
|
+
initWidget: (nodeList: NodeListOf<HTMLElement>, localData?: Record<string, any>) => void;
|
|
694
|
+
select: (element: HTMLElement) => boolean;
|
|
695
|
+
slidePollIsDone: (element: HTMLElement) => boolean;
|
|
696
|
+
setUserData: (id: string, text: string) => void;
|
|
697
|
+
refreshUserData: <Widget extends WidgetBase<WidgetOptions>, WidgetOptions extends WidgetOptionsBase>(nodes: NodeListOf<HTMLElement>, localData?: Record<string, any> | undefined) => void;
|
|
698
|
+
};
|
|
699
|
+
}
|
|
700
|
+
type WidgetShareOptions = WidgetOptionsBase & {
|
|
701
|
+
layers: Array<HTMLElement>;
|
|
702
|
+
};
|
|
703
|
+
declare class WidgetShare extends WidgetBase<WidgetShareOptions> {
|
|
704
|
+
static DEFAULTS: WidgetShareOptions;
|
|
705
|
+
static widgetClassName: string;
|
|
706
|
+
private layers;
|
|
707
|
+
private shareType;
|
|
708
|
+
private shareTarget;
|
|
709
|
+
private withLayer;
|
|
710
|
+
private btnDisabled;
|
|
711
|
+
constructor(element: HTMLElement, options: Partial<WidgetShareOptions>);
|
|
712
|
+
refreshUserData(localData: Record<string, any>): void;
|
|
713
|
+
private _statEventShare;
|
|
714
|
+
private share;
|
|
715
|
+
_complete(isSuccess: boolean): void;
|
|
716
|
+
isDone(): boolean;
|
|
717
|
+
static api: {
|
|
718
|
+
initWidget: (nodeList: NodeListOf<HTMLElement>, layers: Array<HTMLElement>, localData?: Record<string, any>) => void;
|
|
719
|
+
click: (element: HTMLElement) => void;
|
|
720
|
+
complete: (id: string, isSuccess: boolean) => void;
|
|
721
|
+
refreshUserData: <Widget extends WidgetBase<WidgetOptions>, WidgetOptions extends WidgetOptionsBase>(nodes: NodeListOf<HTMLElement>, localData?: Record<string, any> | undefined) => void;
|
|
722
|
+
};
|
|
723
|
+
}
|
|
724
|
+
type WidgetTestOptions = WidgetOptionsBase;
|
|
725
|
+
declare class WidgetTest extends WidgetBase<WidgetTestOptions> {
|
|
726
|
+
static DEFAULTS: WidgetTestOptions;
|
|
727
|
+
static widgetClassName: string;
|
|
728
|
+
private label;
|
|
729
|
+
private variants;
|
|
730
|
+
private testCount;
|
|
731
|
+
private selectedAnswer;
|
|
732
|
+
private withTimeToAnswer;
|
|
733
|
+
private answerTimeout;
|
|
734
|
+
private tick;
|
|
735
|
+
private cancelTick;
|
|
736
|
+
private animationFrameId;
|
|
737
|
+
private startTimerAt;
|
|
738
|
+
private timeLeft;
|
|
739
|
+
private timeLeftDefault;
|
|
740
|
+
private timeline;
|
|
741
|
+
constructor(element: HTMLElement, options: Partial<WidgetTestOptions>);
|
|
742
|
+
refreshUserData(localData: Record<string, any>): void;
|
|
743
|
+
private _statEventVoteAnswer;
|
|
744
|
+
private _selectAnswer;
|
|
745
|
+
selectAnswer(answer: HTMLElement): boolean;
|
|
746
|
+
private doneWithoutAnswer;
|
|
747
|
+
// complete answer select and save local data + stat event
|
|
748
|
+
private _completeWidget;
|
|
749
|
+
isDone(): boolean;
|
|
750
|
+
slideTestIsDone(): boolean;
|
|
751
|
+
slideTestWithTimer(): boolean;
|
|
752
|
+
static api: {
|
|
753
|
+
initWidget: (element: HTMLElement, localData?: Record<string, any>) => void;
|
|
754
|
+
select: (element: HTMLElement) => boolean;
|
|
755
|
+
slideTestIsDone: (element: HTMLElement) => boolean;
|
|
756
|
+
slideTestWithTimer: (element: HTMLElement) => boolean;
|
|
757
|
+
refreshUserData: <Widget extends WidgetBase<WidgetOptions>, WidgetOptions extends WidgetOptionsBase>(nodes: NodeListOf<HTMLElement>, localData?: Record<string, any> | undefined) => void;
|
|
758
|
+
};
|
|
759
|
+
}
|
|
760
|
+
type WidgetCopyApi = typeof WidgetCopy.api;
|
|
761
|
+
type WidgetDataInputApi = typeof WidgetDataInput.api;
|
|
762
|
+
type WidgetDateCountdownApi = typeof WidgetDateCountdown.api;
|
|
763
|
+
type WidgetMultiSlideApi = typeof WidgetMultiSlide.api;
|
|
764
|
+
type WidgetPollApi = typeof WidgetPoll.api;
|
|
765
|
+
type WidgetPollLayersApi = typeof WidgetPollLayers.api;
|
|
766
|
+
type WidgetQuestApi = typeof WidgetQuest.api;
|
|
767
|
+
type WidgetQuizApi = typeof WidgetQuiz.api;
|
|
768
|
+
type WidgetQuizGroupedApi = typeof WidgetQuizGrouped.api;
|
|
769
|
+
type WidgetRangeSliderApi = typeof WidgetRangeSlider.api;
|
|
770
|
+
type WidgetRateApi = typeof WidgetRate.api;
|
|
771
|
+
type WidgetShareApi = typeof WidgetShare.api;
|
|
772
|
+
type WidgetTestApi = typeof WidgetTest.api;
|
|
773
|
+
type WidgetVoteApi = typeof WidgetVote.api;
|
|
774
|
+
type SlideApi = {
|
|
775
|
+
Animation: IAnimation;
|
|
776
|
+
WidgetCopy: WidgetCopyApi;
|
|
777
|
+
WidgetDataInput: WidgetDataInputApi;
|
|
778
|
+
WidgetDateCountdown: WidgetDateCountdownApi;
|
|
779
|
+
WidgetMultiSlide: WidgetMultiSlideApi;
|
|
780
|
+
WidgetPoll: WidgetPollApi;
|
|
781
|
+
WidgetPollLayers: WidgetPollLayersApi;
|
|
782
|
+
WidgetQuest: WidgetQuestApi;
|
|
783
|
+
WidgetQuiz: WidgetQuizApi;
|
|
784
|
+
WidgetQuizGrouped: WidgetQuizGroupedApi;
|
|
785
|
+
WidgetRangeSlider: WidgetRangeSliderApi;
|
|
786
|
+
WidgetRate: WidgetRateApi;
|
|
787
|
+
WidgetShare: WidgetShareApi;
|
|
788
|
+
WidgetTest: WidgetTestApi;
|
|
789
|
+
WidgetVote: WidgetVoteApi;
|
|
790
|
+
};
|
|
279
791
|
declare const getSlideApi: (_sdkInterface: SDKInterface) => {
|
|
280
792
|
Animation: IAnimation;
|
|
281
793
|
WidgetCopy: {
|
|
@@ -369,4 +881,4 @@ declare const getSlideApi: (_sdkInterface: SDKInterface) => {
|
|
|
369
881
|
};
|
|
370
882
|
};
|
|
371
883
|
export { getSlideApi };
|
|
372
|
-
export type { SDKInterface };
|
|
884
|
+
export type { SDKInterface, SlideApi, WidgetCopyApi, WidgetDataInputApi, WidgetDateCountdownApi, WidgetMultiSlideApi, WidgetPollApi, WidgetPollLayersApi, WidgetQuestApi, WidgetQuizApi, WidgetQuizGroupedApi, WidgetRangeSliderApi, WidgetRateApi, WidgetShareApi, WidgetTestApi, WidgetVoteApi, IAnimation };
|