@ordergroove/offers 2.30.1-alpha-PR-714-9.8 → 2.30.1
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 +8 -0
- package/dist/bundle-report.html +28 -28
- package/dist/examples.js +1 -1
- package/dist/examples.js.map +2 -2
- package/dist/offers.js +34 -34
- package/dist/offers.js.map +2 -2
- package/examples/index.html +0 -1
- package/examples/index.js +8 -9
- package/package.json +3 -3
- package/src/components/Offer.js +0 -1
- package/src/core/__tests__/adapters.spec.js +1 -309
- package/src/core/__tests__/reducer.spec.js +1 -79
- package/src/core/actions-preview.js +0 -127
- package/src/core/adapters.js +1 -14
- package/src/core/constants.js +0 -2
- package/src/core/reducer.js +1 -12
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
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.30.1](https://github.com/ordergroove/plush-toys/compare/@ordergroove/offers@2.30.0...@ordergroove/offers@2.30.1) (2023-02-03)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @ordergroove/offers
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
# [2.30.0](https://github.com/ordergroove/plush-toys/compare/@ordergroove/offers@2.29.0...@ordergroove/offers@2.30.0) (2023-01-12)
|
|
7
15
|
|
|
8
16
|
|
package/dist/bundle-report.html
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
<pre id="esbuild-metadata">
|
|
2
|
-
dist/examples.js ─────────────────────────────────────────── 266.
|
|
3
|
-
├ ../offers-templates/dist/main.js ──────────────────────── 256.
|
|
2
|
+
dist/examples.js ─────────────────────────────────────────── 266.1kb ─ 100.0%
|
|
3
|
+
├ ../offers-templates/dist/main.js ──────────────────────── 256.2kb ── 96.3%
|
|
4
4
|
│ └ examples/index.js
|
|
5
5
|
└ examples/index.js ───────────────────────────────────────── 8.9kb ─── 3.3%
|
|
6
6
|
|
|
7
|
-
dist/offers.js ─────────────────────────────────────────────
|
|
8
|
-
├ src/components/Offer.js ─────────────────────────────────── 8.2kb ───
|
|
7
|
+
dist/offers.js ───────────────────────────────────────────── 136.3kb ─ 100.0%
|
|
8
|
+
├ src/components/Offer.js ─────────────────────────────────── 8.2kb ─── 6.0%
|
|
9
9
|
│ └ src/make-api.js
|
|
10
10
|
│ └ src/index.js
|
|
11
|
-
├ node_modules/redux/es/redux.js ──────────────────────────── 6.7kb ─── 4.
|
|
11
|
+
├ node_modules/redux/es/redux.js ──────────────────────────── 6.7kb ─── 4.9%
|
|
12
12
|
│ └ src/shopify/shopifyReducer.js
|
|
13
13
|
│ └ src/index.js
|
|
14
|
-
├ src/core/reducer.js ─────────────────────────────────────── 6.
|
|
14
|
+
├ src/core/reducer.js ─────────────────────────────────────── 6.4kb ─── 4.7%
|
|
15
15
|
│ └ src/index.js
|
|
16
|
-
├ src/shopify/shopifyReducer.js ───────────────────────────── 6.0kb ─── 4.
|
|
16
|
+
├ src/shopify/shopifyReducer.js ───────────────────────────── 6.0kb ─── 4.4%
|
|
17
17
|
│ └ src/index.js
|
|
18
|
-
├ src/components/TestWizard.js ────────────────────────────── 5.5kb ───
|
|
18
|
+
├ src/components/TestWizard.js ────────────────────────────── 5.5kb ─── 4.0%
|
|
19
19
|
│ └ src/run-tests.js
|
|
20
20
|
│ └ src/test-mode.js
|
|
21
21
|
│ └ src/make-api.js
|
|
22
22
|
│ └ src/index.js
|
|
23
|
-
├ node_modules/lit-element/lib/updating-element.js ────────── 5.4kb ───
|
|
23
|
+
├ node_modules/lit-element/lib/updating-element.js ────────── 5.4kb ─── 4.0%
|
|
24
24
|
│ └ node_modules/lit-element/lit-element.js
|
|
25
25
|
│ └ src/components/Price.js
|
|
26
26
|
│ └ src/make-api.js
|
|
@@ -34,15 +34,11 @@
|
|
|
34
34
|
├ src/components/Modal.js ─────────────────────────────────── 4.8kb ─── 3.5%
|
|
35
35
|
│ └ src/make-api.js
|
|
36
36
|
│ └ src/index.js
|
|
37
|
-
├ src/shopify/shopifyMiddleware.ts ────────────────────────── 4.6kb ─── 3.
|
|
37
|
+
├ src/shopify/shopifyMiddleware.ts ────────────────────────── 4.6kb ─── 3.4%
|
|
38
38
|
│ └ src/index.js
|
|
39
39
|
├ src/components/Tooltip.js ───────────────────────────────── 4.4kb ─── 3.2%
|
|
40
40
|
│ └ src/make-api.js
|
|
41
41
|
│ └ src/index.js
|
|
42
|
-
├ src/core/actions-preview.js ─────────────────────────────── 4.2kb ─── 3.0%
|
|
43
|
-
│ └ src/components/Offer.js
|
|
44
|
-
│ └ src/make-api.js
|
|
45
|
-
│ └ src/index.js
|
|
46
42
|
├ node_modules/lodash.memoize/index.js ────────────────────── 4.0kb ─── 2.9%
|
|
47
43
|
│ └ src/shopify/shopifyMiddleware.ts
|
|
48
44
|
│ └ src/index.js
|
|
@@ -55,20 +51,24 @@
|
|
|
55
51
|
├ src/components/OptinStatus.js ───────────────────────────── 2.6kb ─── 1.9%
|
|
56
52
|
│ └ src/make-api.js
|
|
57
53
|
│ └ src/index.js
|
|
58
|
-
├ src/make-api.js ─────────────────────────────────────────── 2.6kb ─── 1.
|
|
54
|
+
├ src/make-api.js ─────────────────────────────────────────── 2.6kb ─── 1.9%
|
|
59
55
|
│ └ src/index.js
|
|
60
56
|
├ src/components/UpsellModal.js ───────────────────────────── 2.4kb ─── 1.8%
|
|
61
57
|
│ └ src/make-api.js
|
|
62
58
|
│ └ src/index.js
|
|
63
59
|
├ src/core/utils.ts ───────────────────────────────────────── 2.3kb ─── 1.7%
|
|
64
60
|
│ └ src/index.js
|
|
61
|
+
├ src/core/actions-preview.js ─────────────────────────────── 2.3kb ─── 1.7%
|
|
62
|
+
│ └ src/components/Offer.js
|
|
63
|
+
│ └ src/make-api.js
|
|
64
|
+
│ └ src/index.js
|
|
65
65
|
├ src/core/selectors.js ───────────────────────────────────── 2.2kb ─── 1.6%
|
|
66
66
|
│ └ src/core/utils.ts
|
|
67
67
|
│ └ src/index.js
|
|
68
68
|
├ src/shopify/reducers/productPlans.ts ────────────────────── 2.2kb ─── 1.6%
|
|
69
69
|
│ └ src/shopify/shopifyReducer.js
|
|
70
70
|
│ └ src/index.js
|
|
71
|
-
├ node_modules/lit-html/lib/shady-render.js ───────────────── 2.1kb ─── 1.
|
|
71
|
+
├ node_modules/lit-html/lib/shady-render.js ───────────────── 2.1kb ─── 1.6%
|
|
72
72
|
│ └ node_modules/lit-element/lit-element.js
|
|
73
73
|
│ └ src/components/Price.js
|
|
74
74
|
│ └ src/make-api.js
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
├ src/components/PrepaidToggle.js ─────────────────────────── 2.0kb ─── 1.5%
|
|
77
77
|
│ └ src/make-api.js
|
|
78
78
|
│ └ src/index.js
|
|
79
|
-
├ src/components/SelectFrequency.js ───────────────────────── 2.0kb ─── 1.
|
|
79
|
+
├ src/components/SelectFrequency.js ───────────────────────── 2.0kb ─── 1.5%
|
|
80
80
|
│ └ src/make-api.js
|
|
81
81
|
│ └ src/index.js
|
|
82
82
|
├ src/components/IncentiveText.js ─────────────────────────── 1.9kb ─── 1.4%
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
├ src/components/PrepaidData.js ───────────────────────────── 1.7kb ─── 1.3%
|
|
96
96
|
│ └ src/make-api.js
|
|
97
97
|
│ └ src/index.js
|
|
98
|
-
├ src/components/Select.js ────────────────────────────────── 1.7kb ─── 1.
|
|
98
|
+
├ src/components/Select.js ────────────────────────────────── 1.7kb ─── 1.3%
|
|
99
99
|
│ └ src/make-api.js
|
|
100
100
|
│ └ src/index.js
|
|
101
101
|
├ src/components/FrequencyStatus.js ───────────────────────── 1.6kb ─── 1.1%
|
|
@@ -104,14 +104,14 @@
|
|
|
104
104
|
├ src/components/OptinToggle.js ───────────────────────────── 1.5kb ─── 1.1%
|
|
105
105
|
│ └ src/make-api.js
|
|
106
106
|
│ └ src/index.js
|
|
107
|
-
├ src/core/descriptors.js ─────────────────────────────────── 1.4kb ─── 1.
|
|
107
|
+
├ src/core/descriptors.js ─────────────────────────────────── 1.4kb ─── 1.1%
|
|
108
108
|
│ └ src/components/When.js
|
|
109
109
|
│ └ src/make-api.js
|
|
110
110
|
│ └ src/index.js
|
|
111
111
|
├ src/components/OptinSelect.js ───────────────────────────── 1.4kb ─── 1.0%
|
|
112
112
|
│ └ src/make-api.js
|
|
113
113
|
│ └ src/index.js
|
|
114
|
-
├ node_modules/reselect/es/index.js ───────────────────────── 1.3kb ─── 0
|
|
114
|
+
├ node_modules/reselect/es/index.js ───────────────────────── 1.3kb ─── 1.0%
|
|
115
115
|
│ └ src/core/selectors.js
|
|
116
116
|
│ └ src/core/utils.ts
|
|
117
117
|
│ └ src/index.js
|
|
@@ -119,24 +119,21 @@
|
|
|
119
119
|
│ └ src/components/Price.js
|
|
120
120
|
│ └ src/make-api.js
|
|
121
121
|
│ └ src/index.js
|
|
122
|
-
├ src/core/constants.js ───────────────────────────────────── 1.2kb ─── 0.9%
|
|
123
|
-
│ └ src/shopify/shopifyTrackingMiddleware.ts
|
|
124
|
-
│ └ src/index.js
|
|
125
122
|
├ src/components/OptinButton.js ───────────────────────────── 1.2kb ─── 0.9%
|
|
126
123
|
│ └ src/make-api.js
|
|
127
124
|
│ └ src/index.js
|
|
125
|
+
├ src/core/constants.js ───────────────────────────────────── 1.2kb ─── 0.9%
|
|
126
|
+
│ └ src/shopify/shopifyTrackingMiddleware.ts
|
|
127
|
+
│ └ src/index.js
|
|
128
128
|
├ src/shopify/shopifyBootstrap.ts ─────────────────────────── 1.1kb ─── 0.8%
|
|
129
129
|
│ └ src/index.js
|
|
130
130
|
├ src/index.js ────────────────────────────────────────────── 1.1kb ─── 0.8%
|
|
131
131
|
├ src/components/UpsellButton.js ──────────────────────────── 1.1kb ─── 0.8%
|
|
132
132
|
│ └ src/make-api.js
|
|
133
133
|
│ └ src/index.js
|
|
134
|
-
├ src/core/adapters.js ────────────────────────────────────── 1.1kb ─── 0.8%
|
|
135
|
-
│ └ src/shopify/shopifyReducer.js
|
|
136
|
-
│ └ src/index.js
|
|
137
134
|
├ src/shopify/shopifyTrackingMiddleware.ts ────────────────── 1.1kb ─── 0.8%
|
|
138
135
|
│ └ src/index.js
|
|
139
|
-
├ node_modules/lit-html/lib/modify-template.js ────────────── 1.0kb ─── 0.
|
|
136
|
+
├ node_modules/lit-html/lib/modify-template.js ────────────── 1.0kb ─── 0.8%
|
|
140
137
|
│ └ node_modules/lit-html/lib/shady-render.js
|
|
141
138
|
│ └ node_modules/lit-element/lit-element.js
|
|
142
139
|
│ └ src/components/Price.js
|
|
@@ -172,7 +169,7 @@
|
|
|
172
169
|
├ src/components/Price.js ─────────────────────────────────── 939b ──── 0.7%
|
|
173
170
|
│ └ src/make-api.js
|
|
174
171
|
│ └ src/index.js
|
|
175
|
-
├ ../offers-live-editor/dist/offers-live-editor.js ────────── 921b ──── 0.
|
|
172
|
+
├ ../offers-live-editor/dist/offers-live-editor.js ────────── 921b ──── 0.7%
|
|
176
173
|
│ └ src/make-api.js
|
|
177
174
|
│ └ src/index.js
|
|
178
175
|
├ node_modules/throttle-debounce/index.umd.js ─────────────── 880b ──── 0.6%
|
|
@@ -181,6 +178,9 @@
|
|
|
181
178
|
├ src/components/Text.js ──────────────────────────────────── 862b ──── 0.6%
|
|
182
179
|
│ └ src/make-api.js
|
|
183
180
|
│ └ src/index.js
|
|
181
|
+
├ src/core/adapters.js ────────────────────────────────────── 857b ──── 0.6%
|
|
182
|
+
│ └ src/shopify/shopifyReducer.js
|
|
183
|
+
│ └ src/index.js
|
|
184
184
|
├ src/core/localStorage.js ────────────────────────────────── 810b ──── 0.6%
|
|
185
185
|
│ └ src/make-api.js
|
|
186
186
|
│ └ src/index.js
|
package/dist/examples.js
CHANGED
|
@@ -750,7 +750,7 @@ og-prepaid-toggle {
|
|
|
750
750
|
`+((e=(s(t,"case")||r&&s(r,"case")||i).call(n,"prepaid-enabled-radio",{name:"case",hash:{},fn:l.program(16,a,0),inverse:l.noop,data:a,loc:{start:{line:9,column:4},end:{line:9,column:76}}}))!=null?e:"")+`
|
|
751
751
|
`+((e=(s(t,"default")||r&&s(r,"default")||i).call(n,"<!-- No offer configured --> ",{name:"default",hash:{},fn:l.program(18,a,0),inverse:l.noop,data:a,loc:{start:{line:10,column:4},end:{line:10,column:61}}}))!=null?e:"")+`
|
|
752
752
|
`},"2":function(l,r,t,o,a){var e,n=l.lookupProperty||function(i,s){if(Object.prototype.hasOwnProperty.call(i,s))return i[s]};return" "+((e=l.invokePartial(n(o,"radio"),r,{name:"radio",data:a,helpers:t,partials:o,decorators:l.decorators}))!=null?e:"")+" "},"4":function(l,r,t,o,a){var e,n=l.lookupProperty||function(i,s){if(Object.prototype.hasOwnProperty.call(i,s))return i[s]};return" "+((e=l.invokePartial(n(o,"cart"),r,{name:"cart",data:a,helpers:t,partials:o,decorators:l.decorators}))!=null?e:"")+" "},"6":function(l,r,t,o,a){var e,n=l.lookupProperty||function(i,s){if(Object.prototype.hasOwnProperty.call(i,s))return i[s]};return" "+((e=l.invokePartial(n(o,"select"),r,{name:"select",data:a,helpers:t,partials:o,decorators:l.decorators}))!=null?e:"")+" "},"8":function(l,r,t,o,a){var e,n=l.lookupProperty||function(i,s){if(Object.prototype.hasOwnProperty.call(i,s))return i[s]};return" "+((e=l.invokePartial(n(o,"toggle"),r,{name:"toggle",data:a,helpers:t,partials:o,decorators:l.decorators}))!=null?e:"")+" "},"10":function(l,r,t,o,a){var e,n=l.lookupProperty||function(i,s){if(Object.prototype.hasOwnProperty.call(i,s))return i[s]};return" "+((e=l.invokePartial(n(o,"side-by-side"),r,{name:"side-by-side",data:a,helpers:t,partials:o,decorators:l.decorators}))!=null?e:"")+" "},"12":function(l,r,t,o,a){var e,n=l.lookupProperty||function(i,s){if(Object.prototype.hasOwnProperty.call(i,s))return i[s]};return" "+((e=l.invokePartial(n(o,"read-only"),r,{name:"read-only",data:a,helpers:t,partials:o,decorators:l.decorators}))!=null?e:"")+" "},"14":function(l,r,t,o,a){var e,n=l.lookupProperty||function(i,s){if(Object.prototype.hasOwnProperty.call(i,s))return i[s]};return" "+((e=l.invokePartial(n(o,"buttons"),r,{name:"buttons",data:a,helpers:t,partials:o,decorators:l.decorators}))!=null?e:"")+" "},"16":function(l,r,t,o,a){var e,n=l.lookupProperty||function(i,s){if(Object.prototype.hasOwnProperty.call(i,s))return i[s]};return" "+((e=l.invokePartial(n(o,"prepaid-enabled-radio"),r,{name:"prepaid-enabled-radio",data:a,helpers:t,partials:o,decorators:l.decorators}))!=null?e:"")+" "},"18":function(l,r,t,o,a){return""},compiler:[8,">= 4.3.0"],main:function(l,r,t,o,a){var e,n=l.lookupProperty||function(i,s){if(Object.prototype.hasOwnProperty.call(i,s))return i[s]};return(e=(n(t,"switch")||r&&n(r,"switch")||l.hooks.helperMissing).call(r??(l.nullContext||{}),(e=r!=null?n(r,"settings"):r)!=null?n(e,"offerType"):e,{name:"switch",hash:{},fn:l.program(1,a,0),inverse:l.noop,data:a,loc:{start:{line:1,column:0},end:{line:11,column:11}}}))!=null?e:""},usePartial:!0,useData:!0});function La(l){return Kl(l).trim()}h(La,"ai"),c(La,"getMarkup");var Gl=sr(Xs()),$r=sr(Nl()),Jl={buttons:Ul(),cart:Hl(),"side-by-side":Bl(),radio:Vl(),"prepaid-enabled-radio":Ql()},Wl=c(l=>(0,$r.default)(Jl,(0,$r.default)(l,"settings.offerType",""),""),"getStylesheet"),Zl=c(l=>[Wl(l),"* {",...(0,Gl.mapStyles)((0,$r.default)(l,"styles",{})).map(r=>`${r.join(": ")};`),"}"].filter(r=>r).join(`
|
|
753
|
-
`),"getStyles"),Yl={radio:{isAdvanced:!1,name:"radio"},cart:{isAdvanced:!1,name:"cart"},toggle:{isAdvanced:!1,name:"toggle"},select:{isAdvanced:!1,name:"select"},"side-by-side":{isAdvanced:!1,name:"side-by-side"},buttons:{isAdvanced:!0,name:"buttons"},"read-only":{isAdvanced:!0,name:"read-only",defaultPreviewMode:"subscribed"},"prepaid-enabled-radio":{isAdvanced:!0,name:"prepaid-enabled-radio"
|
|
753
|
+
`),"getStyles"),Yl={radio:{isAdvanced:!1,name:"radio"},cart:{isAdvanced:!1,name:"cart"},toggle:{isAdvanced:!1,name:"toggle"},select:{isAdvanced:!1,name:"select"},"side-by-side":{isAdvanced:!1,name:"side-by-side"},buttons:{isAdvanced:!0,name:"buttons"},"read-only":{isAdvanced:!0,name:"read-only",defaultPreviewMode:"subscribed"},"prepaid-enabled-radio":{isAdvanced:!0,name:"prepaid-enabled-radio"}};return Ta})();return ae})});var ir=Su(Ga());window.og_settings={product_discounts:{UD729:{"3_1":["30.00","10%","$27.00"],"1_2":["30.00","20%","$24.00"]},UD728:[{frequency:"1_2",prepaidShipments:"3",regularPrice:"$15.00",subscriptionPrice:"$13.50",discountRate:"10%"},{frequency:"3_1",prepaidShipments:null,regularPrice:"$15.00",subscriptionPrice:"$12.00",discountRate:"20%"}]}};var Ja=[{every:1,period:1},{every:1,period:2},{every:1,period:3},{every:2,period:3}],Je={defaultFrequency:Ja[2],frequencies:[...Ja]},We={showTooltip:!0,offerOptInLabel:"Subscribe to save",offerIncentiveText:"Save {{ogIncentive DiscountPercent}} when you subscribe",offerOptOutLabel:"Deliver one-time only",offerEveryLabel:"Deliver every",offerTooltipTrigger:"[?]",offerTooltipContent:"Seems this is a great subscription offering. Many fun details about this program exist.",optinButtonLabel:"\u2022",optoutButtonLabel:"\u2022",optinStatusOptedInLabel:"You're opted in!",optinStatusOptedOutLabel:"You're not opted in.",optinToggleLabel:"\u2022",upsellButtonLabel:"Add item to order on ",upsellButtonPrefix:"",upsellModalContent:"Some upsell modal content",upsellModalOptInLabel:"Subscribe",upsellModalOptOutLabel:"Purchase one time",upsellModalTitle:"Impulse Upsell",upsellModalConfirmLabel:"Ok",upsellModalCancelLabel:"Cancel",defaultFrequencyCopy:"(Recommended)"},Wa=[{name:"empty",selector:"og-offer:not([location])"},{name:"built-in",selector:'og-offer[location="initial"]',config:{settings:{...Je,offerType:"radio"},textCopy:{...We}}},{name:"checkbox",selector:'og-offer[location="initial-checkbox"]',config:{settings:{...Je,offerType:"toggle"},textCopy:{...We}}},{name:"select",selector:'og-offer[location="initial-select"]',config:{settings:{...Je,offerType:"select"},textCopy:{...We}}},{name:"cart",selector:'og-offer[location="cart"]',defaultPreviewMode:"subscribed",config:{settings:{...Je,offerType:"cart"},textCopy:{...We}}},{name:"side-by-side",selector:'og-offer[location="side-by-side"]',config:{settings:{...Je,offerType:"side-by-side"},textCopy:{...We},styles:{primaryColor:"navy",defaultColor:"pink"}}},{name:"read-only",selector:'og-offer[location="read-only"]',defaultPreviewMode:"subscribed",config:{settings:{...Je,offerType:"read-only"},textCopy:{...We},styles:{primaryColor:"navy",defaultColor:"pink"}}},{name:"buttons",selector:'og-offer[location="buttons"]',config:{settings:{...Je,offerType:"buttons"},textCopy:{...We},styles:{primaryColor:"navy",defaultColor:"pink"}}},{name:"Prepaid",selector:'og-offer[location="initial"]',config:{settings:{...Je,offerType:"prepaid-enabled-radio"},textCopy:{...We}}},{name:"first-test",selector:'og-offer[location="first-test"]',config:{settings:{...Je,offerType:"toggle"},textCopy:{...We,offerOptOutLabel:"1st offerOptOutLabel"}}},{name:"second-test no tooltip",selector:'og-offer[location="second-test"]',config:{settings:{...Je,offerType:"radio"},textCopy:{...We,showTooltip:!1,offerOptOutLabel:"2st offerOptOutLabel"}}},{name:"Select mode",selector:'og-offer[location="select1"]',markup:`
|
|
754
754
|
<og-optin-select>
|
|
755
755
|
<option value="optedOut">Buy one time</option>
|
|
756
756
|
<option value="2w" selected>2 weeks (recomended)</option>
|