@ordergroove/offers 2.26.4-alpha-PR-605-1.6 → 2.26.6
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/CHANGELOG.md +24 -0
- package/dist/bundle-report.html +17 -17
- package/dist/examples.js +169 -31
- package/dist/examples.js.map +2 -2
- package/dist/offers.js +52 -20
- package/dist/offers.js.map +2 -2
- package/examples/index.js +12 -0
- package/package.json +3 -3
- package/src/components/OptinToggle.js +37 -1
- package/src/core/__tests__/api.spec.js +1 -3
- package/src/core/api.js +1 -2
package/examples/index.js
CHANGED
|
@@ -105,6 +105,18 @@ const exampleTemplates = [
|
|
|
105
105
|
textCopy: { ...textCopy }
|
|
106
106
|
}
|
|
107
107
|
},
|
|
108
|
+
{
|
|
109
|
+
name: 'cart',
|
|
110
|
+
selector: 'og-offer[location="cart"]',
|
|
111
|
+
defaultPreviewMode: 'subscribed',
|
|
112
|
+
config: {
|
|
113
|
+
settings: {
|
|
114
|
+
...settings,
|
|
115
|
+
offerType: 'cart'
|
|
116
|
+
},
|
|
117
|
+
textCopy: { ...textCopy }
|
|
118
|
+
}
|
|
119
|
+
},
|
|
108
120
|
{
|
|
109
121
|
name: 'side-by-side',
|
|
110
122
|
selector: 'og-offer[location="side-by-side"]',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ordergroove/offers",
|
|
3
|
-
"version": "2.26.
|
|
3
|
+
"version": "2.26.6",
|
|
4
4
|
"description": "offer state component",
|
|
5
5
|
"author": "Eugenio Lattanzio <eugenio63@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/ordergroove/plush-toys#readme",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"throttle-debounce": "^2.1.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@ordergroove/offers-templates": "^0.4.
|
|
46
|
+
"@ordergroove/offers-templates": "^0.4.8"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "b5fb97c05098fd061373711d02f03b0c4d16019a"
|
|
49
49
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { html } from 'lit-element';
|
|
1
|
+
import { html, css } from 'lit-element';
|
|
2
2
|
|
|
3
3
|
import { optinProduct, optoutProduct } from '../core/actions';
|
|
4
4
|
import { OptinStatus, mapStateToProps } from './OptinStatus';
|
|
@@ -12,6 +12,42 @@ export class OptinToggle extends OptinStatus {
|
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
static get styles() {
|
|
16
|
+
return css`
|
|
17
|
+
:host {
|
|
18
|
+
cursor: default;
|
|
19
|
+
display: inline-block;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.btn {
|
|
23
|
+
position: relative;
|
|
24
|
+
width: var(--og-radio-width, 1.4em);
|
|
25
|
+
height: var(--og-radio-height, 1.4em);
|
|
26
|
+
margin: var(--og-radio-margin, 0);
|
|
27
|
+
padding: 0;
|
|
28
|
+
border: 1px solid var(--og-primary-color, black);
|
|
29
|
+
background: #fff;
|
|
30
|
+
vertical-align: middle;
|
|
31
|
+
color: var(--og-primary-color, black);
|
|
32
|
+
display: inline-flex;
|
|
33
|
+
justify-content: center;
|
|
34
|
+
align-items: center;
|
|
35
|
+
border-radius: 3px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.btn.active {
|
|
39
|
+
background: #090909;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.btn.active:after {
|
|
43
|
+
content: '✓';
|
|
44
|
+
color: #fff;
|
|
45
|
+
transform: scale(1.6);
|
|
46
|
+
margin-left: 2px;
|
|
47
|
+
}
|
|
48
|
+
`;
|
|
49
|
+
}
|
|
50
|
+
|
|
15
51
|
handleClick(ev) {
|
|
16
52
|
if (this.subscribed) this.optoutProduct(this.product);
|
|
17
53
|
else this.optinProduct(this.product, this.frequency || this.defaultFrequency);
|
|
@@ -221,9 +221,7 @@ describe('api.fetchOrders', () => {
|
|
|
221
221
|
|
|
222
222
|
it('should call endpoint default params', async () => {
|
|
223
223
|
await underTest('https://host.com', { some: 'auth' }, 2, 'foo');
|
|
224
|
-
expect(fetchMock.lastUrl(MATCHED)).toEqual(
|
|
225
|
-
'https://host.com/orders/?status=2&ordering=foo&exclude_prepaid_orders=true'
|
|
226
|
-
);
|
|
224
|
+
expect(fetchMock.lastUrl(MATCHED)).toEqual('https://host.com/orders/?status=2&ordering=foo');
|
|
227
225
|
});
|
|
228
226
|
});
|
|
229
227
|
|
package/src/core/api.js
CHANGED