@ordergroove/offers 2.27.23 → 2.28.0
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 +21 -0
- package/README.md +24 -1
- package/dist/bundle-report.html +40 -37
- package/dist/offers.js +54 -54
- package/dist/offers.js.map +3 -3
- package/karma-shopify.conf.js +79 -0
- package/karma.conf.js +1 -1
- package/package.json +5 -3
- package/src/components/Offer.js +1 -0
- package/src/components/OptinButton.js +25 -5
- package/src/components/OptinSelect.js +2 -4
- package/src/components/OptinStatus.js +5 -1
- package/src/components/OptinToggle.js +9 -2
- package/src/components/__tests__/OG.fspec.js +84 -2
- package/src/core/__tests__/utils.spec.js +26 -0
- package/src/core/selectors.js +18 -1
- package/src/core/store.js +3 -2
- package/src/core/utils.ts +45 -6
- package/src/core/waitUntilOffersReady.js +66 -0
- package/src/index.js +6 -2
- package/src/init-shopify-tests.js +7 -0
- package/src/make-api.js +5 -15
- package/src/shopify/__tests__/shopifyReducer.spec.js +915 -122
- package/src/shopify/shopifyMiddleware.ts +4 -3
- package/src/shopify/shopifyReducer.js +169 -34
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,27 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [2.28.0](https://github.com/ordergroove/plush-toys/compare/@ordergroove/offers@2.27.23...@ordergroove/offers@2.28.0) (2022-10-07)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **offers:** Buttons only template should dispatch the selling plan on click ([69be723](https://github.com/ordergroove/plush-toys/commit/69be723ce07cfb296bebb5c8941a20d4ca31945c))
|
|
12
|
+
* **offers:** Buttons only template should use attribute as first option ([2c72b61](https://github.com/ordergroove/plush-toys/commit/2c72b6172880ab019f78e22c711a05154468176b))
|
|
13
|
+
* **offers:** elements with name=id not in form do not enter getOrCreateHidden ([0e59df5](https://github.com/ordergroove/plush-toys/commit/0e59df559733990ca4051162353c4e92555e59cf))
|
|
14
|
+
* **offers:** Reflect selling plan as default frequency ([82fdf2a](https://github.com/ordergroove/plush-toys/commit/82fdf2af9ea427c4191bd230c17710a8ccc45d29))
|
|
15
|
+
* **offers:** Set psdf on optins upon receive offer in shopify reducer ([6c2cfac](https://github.com/ordergroove/plush-toys/commit/6c2cfac3780933394de4ab5d9fe066a1d241c2af))
|
|
16
|
+
* **offers:** update offer element to convert default frequency to selling plan if selling plans ([542b64c](https://github.com/ordergroove/plush-toys/commit/542b64c85b13acd4cb26baad90d6aa30d62d4b6d))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
* **offers:** Local auto initialization now pulls configs from s-o-s ([15be9fb](https://github.com/ordergroove/plush-toys/commit/15be9fbf029ed52523d446775e710f9cbada70b8))
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
6
27
|
## [2.27.23](https://github.com/ordergroove/plush-toys/compare/@ordergroove/offers@2.27.22...@ordergroove/offers@2.27.23) (2022-10-05)
|
|
7
28
|
|
|
8
29
|
**Note:** Version bump only for package @ordergroove/offers
|
package/README.md
CHANGED
|
@@ -8,9 +8,32 @@ Ordergroove's offers library allows you to display and track subscription optins
|
|
|
8
8
|
npm install --save @ordergroove/offers
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
|
|
12
|
+
## Local Development
|
|
13
|
+
|
|
14
|
+
To start local development server you can do
|
|
15
|
+
```sh
|
|
16
|
+
cd packages/offers
|
|
17
|
+
npm start
|
|
18
|
+
```
|
|
19
|
+
Browse http://localhost:8080
|
|
20
|
+
|
|
21
|
+
### Merchant specific local development
|
|
22
|
+
You need to use [http redirector chrome extension](https://chrome.google.com/webstore/detail/redirector/ocgpenflpmgnfapjedencafcfakcekcd?hl=en). And configure it to redirect staging/prod main.js to localhost:8080.
|
|
23
|
+
|
|
24
|
+
**main.js**
|
|
25
|
+
```
|
|
26
|
+
Pattern: https?://(staging\.)?static.ordergroove.com/\w+/main.js$
|
|
27
|
+
Redirect to: http://localhost:8080/dist/offers.js
|
|
28
|
+
```
|
|
12
29
|
|
|
13
30
|
|
|
31
|
+
**soucemap**
|
|
32
|
+
Pattern: https?://(staging\.)?static.ordergroove.com/\w+/offers.js.map
|
|
33
|
+
Redirect to: http://localhost:8080/dist/offers.js.map
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
## Configuration
|
|
14
37
|
|
|
15
38
|
## Add og-offer elements
|
|
16
39
|
|
package/dist/bundle-report.html
CHANGED
|
@@ -4,56 +4,56 @@
|
|
|
4
4
|
│ └ examples/index.js
|
|
5
5
|
└ examples/index.js ───────────────────────────────────────── 8.5kb ─── 3.3%
|
|
6
6
|
|
|
7
|
-
dist/offers.js ─────────────────────────────────────────────
|
|
8
|
-
├ src/components/Offer.js ─────────────────────────────────── 8.1kb ─── 6.
|
|
7
|
+
dist/offers.js ───────────────────────────────────────────── 126.8kb ─ 100.0%
|
|
8
|
+
├ src/components/Offer.js ─────────────────────────────────── 8.1kb ─── 6.4%
|
|
9
9
|
│ └ src/make-api.js
|
|
10
10
|
│ └ src/index.js
|
|
11
|
-
├ node_modules/redux/es/redux.js ──────────────────────────── 6.7kb ─── 5.
|
|
11
|
+
├ node_modules/redux/es/redux.js ──────────────────────────── 6.7kb ─── 5.3%
|
|
12
12
|
│ └ src/shopify/shopifyReducer.js
|
|
13
13
|
│ └ src/index.js
|
|
14
|
-
├ src/core/reducer.js ─────────────────────────────────────── 6.1kb ───
|
|
14
|
+
├ src/core/reducer.js ─────────────────────────────────────── 6.1kb ─── 4.8%
|
|
15
15
|
│ └ src/index.js
|
|
16
|
-
├ src/
|
|
16
|
+
├ src/shopify/shopifyReducer.js ───────────────────────────── 5.6kb ─── 4.4%
|
|
17
|
+
│ └ src/index.js
|
|
18
|
+
├ src/components/TestWizard.js ────────────────────────────── 5.5kb ─── 4.3%
|
|
17
19
|
│ └ src/run-tests.js
|
|
18
20
|
│ └ src/test-mode.js
|
|
19
21
|
│ └ src/make-api.js
|
|
20
22
|
│ └ src/index.js
|
|
21
|
-
├ node_modules/lit-element/lib/updating-element.js ────────── 5.4kb ─── 4.
|
|
23
|
+
├ node_modules/lit-element/lib/updating-element.js ────────── 5.4kb ─── 4.2%
|
|
22
24
|
│ └ node_modules/lit-element/lit-element.js
|
|
23
25
|
│ └ src/components/Price.js
|
|
24
26
|
│ └ src/make-api.js
|
|
25
27
|
│ └ src/index.js
|
|
26
|
-
├ src/shopify/shopifyMiddleware.ts ────────────────────────── 5.
|
|
28
|
+
├ src/shopify/shopifyMiddleware.ts ────────────────────────── 5.2kb ─── 4.1%
|
|
27
29
|
│ └ src/index.js
|
|
28
|
-
├ node_modules/lit-html/lib/parts.js ──────────────────────── 5.0kb ───
|
|
30
|
+
├ node_modules/lit-html/lib/parts.js ──────────────────────── 5.0kb ─── 3.9%
|
|
29
31
|
│ └ node_modules/lit-html/lit-html.js
|
|
30
32
|
│ └ node_modules/lit-element/lit-element.js
|
|
31
33
|
│ └ src/components/Price.js
|
|
32
34
|
│ └ src/make-api.js
|
|
33
35
|
│ └ src/index.js
|
|
34
|
-
├ src/components/Modal.js ─────────────────────────────────── 4.7kb ─── 3.
|
|
36
|
+
├ src/components/Modal.js ─────────────────────────────────── 4.7kb ─── 3.7%
|
|
35
37
|
│ └ src/make-api.js
|
|
36
38
|
│ └ src/index.js
|
|
37
|
-
├ src/components/Tooltip.js ───────────────────────────────── 4.4kb ─── 3.
|
|
39
|
+
├ src/components/Tooltip.js ───────────────────────────────── 4.4kb ─── 3.4%
|
|
38
40
|
│ └ src/make-api.js
|
|
39
41
|
│ └ src/index.js
|
|
40
|
-
├
|
|
41
|
-
│ └ src/index.js
|
|
42
|
-
├ node_modules/lodash.memoize/index.js ────────────────────── 4.0kb ─── 3.2%
|
|
42
|
+
├ node_modules/lodash.memoize/index.js ────────────────────── 4.0kb ─── 3.1%
|
|
43
43
|
│ └ src/shopify/shopifyMiddleware.ts
|
|
44
44
|
│ └ src/index.js
|
|
45
45
|
├ src/core/actions.js ─────────────────────────────────────── 3.8kb ─── 3.0%
|
|
46
46
|
│ └ src/shopify/shopifyBootstrap.ts
|
|
47
47
|
│ └ src/index.js
|
|
48
|
-
├ src/
|
|
49
|
-
│ └ src/index.js
|
|
50
|
-
├ src/core/api.js ─────────────────────────────────────────── 2.6kb ─── 2.1%
|
|
48
|
+
├ src/core/api.js ─────────────────────────────────────────── 2.6kb ─── 2.0%
|
|
51
49
|
│ └ src/core/reducer.js
|
|
52
50
|
│ └ src/index.js
|
|
53
|
-
├ src/components/
|
|
51
|
+
├ src/components/OptinStatus.js ───────────────────────────── 2.5kb ─── 2.0%
|
|
54
52
|
│ └ src/make-api.js
|
|
55
53
|
│ └ src/index.js
|
|
56
|
-
├ src/
|
|
54
|
+
├ src/make-api.js ─────────────────────────────────────────── 2.5kb ─── 1.9%
|
|
55
|
+
│ └ src/index.js
|
|
56
|
+
├ src/components/UpsellModal.js ───────────────────────────── 2.4kb ─── 1.9%
|
|
57
57
|
│ └ src/make-api.js
|
|
58
58
|
│ └ src/index.js
|
|
59
59
|
├ src/core/actions-preview.js ─────────────────────────────── 2.3kb ─── 1.8%
|
|
@@ -65,13 +65,15 @@
|
|
|
65
65
|
│ └ src/components/Price.js
|
|
66
66
|
│ └ src/make-api.js
|
|
67
67
|
│ └ src/index.js
|
|
68
|
+
├ src/core/utils.ts ───────────────────────────────────────── 2.0kb ─── 1.6%
|
|
69
|
+
│ └ src/index.js
|
|
68
70
|
├ src/components/SelectFrequency.js ───────────────────────── 2.0kb ─── 1.6%
|
|
69
71
|
│ └ src/make-api.js
|
|
70
72
|
│ └ src/index.js
|
|
71
73
|
├ src/components/IncentiveText.js ─────────────────────────── 1.9kb ─── 1.5%
|
|
72
74
|
│ └ src/make-api.js
|
|
73
75
|
│ └ src/index.js
|
|
74
|
-
├ node_modules/lit-html/lib/template.js ───────────────────── 1.8kb ─── 1.
|
|
76
|
+
├ node_modules/lit-html/lib/template.js ───────────────────── 1.8kb ─── 1.4%
|
|
75
77
|
│ └ node_modules/lit-html/lit-html.js
|
|
76
78
|
│ └ node_modules/lit-element/lit-element.js
|
|
77
79
|
│ └ src/components/Price.js
|
|
@@ -81,10 +83,13 @@
|
|
|
81
83
|
│ └ src/components/Price.js
|
|
82
84
|
│ └ src/make-api.js
|
|
83
85
|
│ └ src/index.js
|
|
86
|
+
├ src/core/selectors.js ───────────────────────────────────── 1.7kb ─── 1.3%
|
|
87
|
+
│ └ src/shopify/shopifyMiddleware.ts
|
|
88
|
+
│ └ src/index.js
|
|
84
89
|
├ src/components/Select.js ────────────────────────────────── 1.6kb ─── 1.3%
|
|
85
90
|
│ └ src/make-api.js
|
|
86
91
|
│ └ src/index.js
|
|
87
|
-
├ src/components/FrequencyStatus.js ───────────────────────── 1.6kb ─── 1.
|
|
92
|
+
├ src/components/FrequencyStatus.js ───────────────────────── 1.6kb ─── 1.2%
|
|
88
93
|
│ └ src/make-api.js
|
|
89
94
|
│ └ src/index.js
|
|
90
95
|
├ src/components/OptinToggle.js ───────────────────────────── 1.5kb ─── 1.2%
|
|
@@ -93,9 +98,6 @@
|
|
|
93
98
|
├ src/components/OptinSelect.js ───────────────────────────── 1.4kb ─── 1.1%
|
|
94
99
|
│ └ src/make-api.js
|
|
95
100
|
│ └ src/index.js
|
|
96
|
-
├ src/core/selectors.js ───────────────────────────────────── 1.3kb ─── 1.1%
|
|
97
|
-
│ └ src/shopify/shopifyMiddleware.ts
|
|
98
|
-
│ └ src/index.js
|
|
99
101
|
├ node_modules/reselect/es/index.js ───────────────────────── 1.3kb ─── 1.0%
|
|
100
102
|
│ └ src/core/selectors.js
|
|
101
103
|
│ └ src/shopify/shopifyMiddleware.ts
|
|
@@ -108,17 +110,15 @@
|
|
|
108
110
|
│ └ src/components/When.js
|
|
109
111
|
│ └ src/make-api.js
|
|
110
112
|
│ └ src/index.js
|
|
111
|
-
├ src/core/utils.ts ───────────────────────────────────────── 1.2kb ─── 1.0%
|
|
112
|
-
│ └ src/index.js
|
|
113
113
|
├ src/shopify/shopifyBootstrap.ts ─────────────────────────── 1.1kb ─── 0.9%
|
|
114
114
|
│ └ src/index.js
|
|
115
115
|
├ src/core/constants.js ───────────────────────────────────── 1.1kb ─── 0.9%
|
|
116
116
|
│ └ src/core/utils.ts
|
|
117
117
|
│ └ src/index.js
|
|
118
|
+
├ src/index.js ────────────────────────────────────────────── 1.1kb ─── 0.9%
|
|
118
119
|
├ src/components/UpsellButton.js ──────────────────────────── 1.1kb ─── 0.9%
|
|
119
120
|
│ └ src/make-api.js
|
|
120
121
|
│ └ src/index.js
|
|
121
|
-
├ src/index.js ────────────────────────────────────────────── 1.1kb ─── 0.9%
|
|
122
122
|
├ node_modules/lit-html/lib/modify-template.js ────────────── 1.0kb ─── 0.8%
|
|
123
123
|
│ └ node_modules/lit-html/lib/shady-render.js
|
|
124
124
|
│ └ node_modules/lit-element/lit-element.js
|
|
@@ -144,12 +144,15 @@
|
|
|
144
144
|
│ └ src/components/Price.js
|
|
145
145
|
│ └ src/make-api.js
|
|
146
146
|
│ └ src/index.js
|
|
147
|
+
├ src/components/OptinButton.js ──────────────────────────── 1005b ──── 0.8%
|
|
148
|
+
│ └ src/make-api.js
|
|
149
|
+
│ └ src/index.js
|
|
147
150
|
├ node_modules/lit-element/lib/css-tag.js ─────────────────── 978b ──── 0.8%
|
|
148
151
|
│ └ node_modules/lit-element/lit-element.js
|
|
149
152
|
│ └ src/components/Price.js
|
|
150
153
|
│ └ src/make-api.js
|
|
151
154
|
│ └ src/index.js
|
|
152
|
-
├ src/core/middleware.js ──────────────────────────────────── 951b ──── 0.
|
|
155
|
+
├ src/core/middleware.js ──────────────────────────────────── 951b ──── 0.7%
|
|
153
156
|
│ └ src/core/store.js
|
|
154
157
|
│ └ src/index.js
|
|
155
158
|
├ ../offers-live-editor/dist/offers-live-editor.js ────────── 921b ──── 0.7%
|
|
@@ -170,9 +173,6 @@
|
|
|
170
173
|
├ src/core/connect.js ─────────────────────────────────────── 794b ──── 0.6%
|
|
171
174
|
│ └ src/make-api.js
|
|
172
175
|
│ └ src/index.js
|
|
173
|
-
├ src/components/OptinButton.js ───────────────────────────── 690b ──── 0.5%
|
|
174
|
-
│ └ src/make-api.js
|
|
175
|
-
│ └ src/index.js
|
|
176
176
|
├ node_modules/lit-html/lib/template-result.js ────────────── 639b ──── 0.5%
|
|
177
177
|
│ └ node_modules/lit-html/lit-html.js
|
|
178
178
|
│ └ node_modules/lit-element/lit-element.js
|
|
@@ -190,14 +190,17 @@
|
|
|
190
190
|
├ src/core/adapters.js ────────────────────────────────────── 555b ──── 0.4%
|
|
191
191
|
│ └ src/make-api.js
|
|
192
192
|
│ └ src/index.js
|
|
193
|
-
├ src/components/OptoutButton.js ────────────────────────────
|
|
193
|
+
├ src/components/OptoutButton.js ──────────────────────────── 546b ──── 0.4%
|
|
194
194
|
│ └ src/make-api.js
|
|
195
195
|
│ └ src/index.js
|
|
196
196
|
├ src/core/dateUtils.js ───────────────────────────────────── 541b ──── 0.4%
|
|
197
197
|
│ └ src/components/NextUpcomingOrder.js
|
|
198
198
|
│ └ src/make-api.js
|
|
199
199
|
│ └ src/index.js
|
|
200
|
-
├ src/core/
|
|
200
|
+
├ src/core/waitUntilOffersReady.js ────────────────────────── 537b ──── 0.4%
|
|
201
|
+
│ └ src/core/store.js
|
|
202
|
+
│ └ src/index.js
|
|
203
|
+
├ src/core/store.js ───────────────────────────────────────── 419b ──── 0.3%
|
|
201
204
|
│ └ src/index.js
|
|
202
205
|
├ node_modules/lit-html/lib/template-factory.js ───────────── 388b ──── 0.3%
|
|
203
206
|
│ └ node_modules/lit-html/lit-html.js
|
|
@@ -217,7 +220,7 @@
|
|
|
217
220
|
│ └ src/components/FrequencyStatus.js
|
|
218
221
|
│ └ src/make-api.js
|
|
219
222
|
│ └ src/index.js
|
|
220
|
-
├ node_modules/lit-html/lib/default-template-processor.js ───
|
|
223
|
+
├ node_modules/lit-html/lib/default-template-processor.js ─── 312b ──── 0.2%
|
|
221
224
|
│ └ node_modules/lit-html/lit-html.js
|
|
222
225
|
│ └ node_modules/lit-element/lit-element.js
|
|
223
226
|
│ └ src/components/Price.js
|
|
@@ -241,7 +244,7 @@
|
|
|
241
244
|
│ └ src/components/Price.js
|
|
242
245
|
│ └ src/make-api.js
|
|
243
246
|
│ └ src/index.js
|
|
244
|
-
├ node_modules/lit-html/lib/render.js ───────────────────────
|
|
247
|
+
├ node_modules/lit-html/lib/render.js ─────────────────────── 226b ──── 0.2%
|
|
245
248
|
│ └ node_modules/lit-html/lit-html.js
|
|
246
249
|
│ └ node_modules/lit-element/lit-element.js
|
|
247
250
|
│ └ src/components/Price.js
|
|
@@ -252,17 +255,17 @@
|
|
|
252
255
|
│ └ src/components/Price.js
|
|
253
256
|
│ └ src/make-api.js
|
|
254
257
|
│ └ src/index.js
|
|
255
|
-
├ src/platform.ts ───────────────────────────────────────────
|
|
258
|
+
├ src/platform.ts ─────────────────────────────────────────── 203b ──── 0.2%
|
|
256
259
|
│ └ src/index.js
|
|
257
260
|
├ node_modules/logical-expression-parser/index.js ─────────── 196b ──── 0.2%
|
|
258
261
|
│ └ src/components/When.js
|
|
259
262
|
│ └ src/make-api.js
|
|
260
263
|
│ └ src/index.js
|
|
261
|
-
├ src/run-tests.js ────────────────────────────────────────── 194b ──── 0.
|
|
264
|
+
├ src/run-tests.js ────────────────────────────────────────── 194b ──── 0.1%
|
|
262
265
|
│ └ src/test-mode.js
|
|
263
266
|
│ └ src/make-api.js
|
|
264
267
|
│ └ src/index.js
|
|
265
|
-
├ node_modules/symbol-observable/es/index.js ──────────────── 191b ──── 0.
|
|
268
|
+
├ node_modules/symbol-observable/es/index.js ──────────────── 191b ──── 0.1%
|
|
266
269
|
│ └ node_modules/redux/es/redux.js
|
|
267
270
|
│ └ src/shopify/shopifyReducer.js
|
|
268
271
|
│ └ src/index.js
|