@buddy-technology/offer-component 0.3.2 → 0.3.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/API.md +10 -0
- package/CHANGELOG.md +7 -0
- package/dist/index.js +6 -0
- package/lib/types.d.ts +7 -0
- package/package.json +1 -1
package/API.md
CHANGED
|
@@ -16,6 +16,9 @@
|
|
|
16
16
|
<dt><a href="#RemoveFromCartFunction">RemoveFromCartFunction</a> ⇒ <code><a href="#DataObject">DataObject</a></code></dt>
|
|
17
17
|
<dd><p>A callback to be called with a payload object when users opt out of the offer.</p>
|
|
18
18
|
</dd>
|
|
19
|
+
<dt><a href="#ScrollToTopFunction">ScrollToTopFunction</a> : <code>function</code></dt>
|
|
20
|
+
<dd><p>A function to override the default scroll to top of offer element behavior when navigating between screens</p>
|
|
21
|
+
</dd>
|
|
19
22
|
<dt><a href="#OverridesObject">OverridesObject</a> : <code>Object</code></dt>
|
|
20
23
|
<dd></dd>
|
|
21
24
|
<dt><a href="#ThemeObject">ThemeObject</a> : <code>Object</code></dt>
|
|
@@ -64,6 +67,12 @@ A callback to be called with a payload object when users opt out of the offer.
|
|
|
64
67
|
|
|
65
68
|
**Kind**: global typedef
|
|
66
69
|
**Returns**: [<code>DataObject</code>](#DataObject) - the policy payload
|
|
70
|
+
<a name="ScrollToTopFunction"></a>
|
|
71
|
+
|
|
72
|
+
## ScrollToTopFunction : <code>function</code>
|
|
73
|
+
A function to override the default scroll to top of offer element behavior when navigating between screens
|
|
74
|
+
|
|
75
|
+
**Kind**: global typedef
|
|
67
76
|
<a name="OverridesObject"></a>
|
|
68
77
|
|
|
69
78
|
## OverridesObject : <code>Object</code>
|
|
@@ -169,6 +178,7 @@ const theme = {
|
|
|
169
178
|
| [onUserEvent] | [<code>OnUserEventCallback</code>](#OnUserEventCallback) | | callback function for tracking user behavioral data. Triggers on user interactions such as input focus/blur, in-app navigation, etc. Refer to the docs for more details. |
|
|
170
179
|
| [onAddToCart] | [<code>AddToCartFunction</code>](#AddToCartFunction) | | callback function triggered when users opt into an offer-only offer. |
|
|
171
180
|
| [onRemoveFromCart] | [<code>RemoveFromCartFunction</code>](#RemoveFromCartFunction) | | callback function triggered when users opt out of an offer-only offer. |
|
|
181
|
+
| [overrideScrollToTop] | [<code>ScrollToTopFunction</code>](#ScrollToTopFunction) | | When present, this overrides the default scroll to top of offer element behavior when navigating between screens. |
|
|
172
182
|
| [includeCheckout] | <code>boolean</code> | | toggles whether or not to display the card capture checkout view. Defaults to true. When false, an AddToCart callback must be provided. |
|
|
173
183
|
| [logoOverride] | [<code>LogoOverride</code>](#LogoOverride) | | object for overriding Buddy's trust badge. |
|
|
174
184
|
|
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -37,6 +37,11 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
37
37
|
* @returns {DataObject} the policy payload
|
|
38
38
|
*/
|
|
39
39
|
|
|
40
|
+
/**
|
|
41
|
+
* @typedef {Function} ScrollToTopFunction
|
|
42
|
+
* @description A function to override the default scroll to top of offer element behavior when navigating between screens
|
|
43
|
+
*/
|
|
44
|
+
|
|
40
45
|
/**
|
|
41
46
|
* @typedef {Object} OverridesObject
|
|
42
47
|
* @property {Array<String>} [webFonts] - array of url strings linking to web fonts.
|
|
@@ -111,6 +116,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
111
116
|
* @property {OnUserEventCallback} [onUserEvent] - callback function for tracking user behavioral data. Triggers on user interactions such as input focus/blur, in-app navigation, etc. Refer to the docs for more details.
|
|
112
117
|
* @property {AddToCartFunction} [onAddToCart] - callback function triggered when users opt into an offer-only offer.
|
|
113
118
|
* @property {RemoveFromCartFunction} [onRemoveFromCart] - callback function triggered when users opt out of an offer-only offer.
|
|
119
|
+
* @property {ScrollToTopFunction} [overrideScrollToTop] - When present, this overrides the default scroll to top of offer element behavior when navigating between screens.
|
|
114
120
|
* @property {boolean} [includeCheckout] - toggles whether or not to display the card capture checkout view. Defaults to true. When false, an AddToCart callback must be provided.
|
|
115
121
|
* @property {LogoOverride} [logoOverride] - object for overriding Buddy's trust badge.
|
|
116
122
|
*/
|
package/lib/types.d.ts
CHANGED
|
@@ -19,6 +19,11 @@ declare type AddToCartFunction = () => DataObject;
|
|
|
19
19
|
*/
|
|
20
20
|
declare type RemoveFromCartFunction = () => DataObject;
|
|
21
21
|
|
|
22
|
+
/**
|
|
23
|
+
* A function to override the default scroll to top of offer element behavior when navigating between screens
|
|
24
|
+
*/
|
|
25
|
+
declare type ScrollToTopFunction = () => void;
|
|
26
|
+
|
|
22
27
|
/**
|
|
23
28
|
* @property [webFonts] - array of url strings linking to web fonts.
|
|
24
29
|
* @property [styles] - Object Styles object for overriding any css.
|
|
@@ -103,6 +108,7 @@ declare type OnUserEventCallback = (type: EventObject) => void;
|
|
|
103
108
|
* @property [onUserEvent] - callback function for tracking user behavioral data. Triggers on user interactions such as input focus/blur, in-app navigation, etc. Refer to the docs for more details.
|
|
104
109
|
* @property [onAddToCart] - callback function triggered when users opt into an offer-only offer.
|
|
105
110
|
* @property [onRemoveFromCart] - callback function triggered when users opt out of an offer-only offer.
|
|
111
|
+
* @property [overrideScrollToTop] - When present, this overrides the default scroll to top of offer element behavior when navigating between screens.
|
|
106
112
|
* @property [includeCheckout] - toggles whether or not to display the card capture checkout view. Defaults to true. When false, an AddToCart callback must be provided.
|
|
107
113
|
* @property [logoOverride] - object for overriding Buddy's trust badge.
|
|
108
114
|
*/
|
|
@@ -116,6 +122,7 @@ declare type BuddyOfferElementProps = {
|
|
|
116
122
|
onUserEvent?: OnUserEventCallback;
|
|
117
123
|
onAddToCart?: AddToCartFunction;
|
|
118
124
|
onRemoveFromCart?: RemoveFromCartFunction;
|
|
125
|
+
overrideScrollToTop?: ScrollToTopFunction;
|
|
119
126
|
includeCheckout?: boolean;
|
|
120
127
|
logoOverride?: LogoOverride;
|
|
121
128
|
};
|