@ordergroove/offers 2.30.2 → 2.30.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/CHANGELOG.md +11 -0
- package/dist/bundle-report.html +27 -27
- package/dist/examples.js +1 -1
- package/dist/examples.js.map +2 -2
- package/dist/offers.js +31 -31
- package/dist/offers.js.map +2 -2
- package/examples/index.html +1 -0
- package/examples/index.js +9 -8
- package/package.json +3 -3
- package/src/components/Offer.js +1 -0
- package/src/core/__tests__/actions-preview.spec.js +187 -0
- package/src/core/actions-preview.js +147 -1
- package/src/core/constants.js +1 -0
- package/src/core/reducer.js +9 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
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.3](https://github.com/ordergroove/plush-toys/compare/@ordergroove/offers@2.30.2...@ordergroove/offers@2.30.3) (2023-02-07)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* adds prepaid preview ([da5671a](https://github.com/ordergroove/plush-toys/commit/da5671a2cae4f3e646c60e56194edca28b332369))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [2.30.2](https://github.com/ordergroove/plush-toys/compare/@ordergroove/offers@2.30.1...@ordergroove/offers@2.30.2) (2023-02-07)
|
|
7
18
|
|
|
8
19
|
|
package/dist/bundle-report.html
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
<pre id="esbuild-metadata">
|
|
2
|
-
dist/examples.js ─────────────────────────────────────────── 266.
|
|
3
|
-
├ ../offers-templates/dist/main.js ──────────────────────── 256.
|
|
2
|
+
dist/examples.js ─────────────────────────────────────────── 266.2kb ─ 100.0%
|
|
3
|
+
├ ../offers-templates/dist/main.js ──────────────────────── 256.3kb ── 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 ───────────────────────────────────────────── 138.8kb ─ 100.0%
|
|
8
|
+
├ src/components/Offer.js ─────────────────────────────────── 8.2kb ─── 5.9%
|
|
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.8%
|
|
12
12
|
│ └ src/shopify/shopifyReducer.js
|
|
13
13
|
│ └ src/index.js
|
|
14
|
-
├ src/core/reducer.js ─────────────────────────────────────── 6.
|
|
14
|
+
├ src/core/reducer.js ─────────────────────────────────────── 6.5kb ─── 4.6%
|
|
15
15
|
│ └ src/index.js
|
|
16
|
-
├ src/shopify/shopifyReducer.js ───────────────────────────── 6.0kb ─── 4.
|
|
16
|
+
├ src/shopify/shopifyReducer.js ───────────────────────────── 6.0kb ─── 4.3%
|
|
17
17
|
│ └ src/index.js
|
|
18
|
-
├ src/components/TestWizard.js ────────────────────────────── 5.5kb ───
|
|
18
|
+
├ src/components/TestWizard.js ────────────────────────────── 5.5kb ─── 3.9%
|
|
19
19
|
│ └ src/run-tests.js
|
|
20
20
|
│ └ src/test-mode.js
|
|
21
21
|
│ └ src/make-api.js
|
|
@@ -34,9 +34,13 @@
|
|
|
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.3%
|
|
38
38
|
│ └ src/index.js
|
|
39
|
-
├ src/
|
|
39
|
+
├ src/core/actions-preview.js ─────────────────────────────── 4.4kb ─── 3.2%
|
|
40
|
+
│ └ src/components/Offer.js
|
|
41
|
+
│ └ src/make-api.js
|
|
42
|
+
│ └ src/index.js
|
|
43
|
+
├ src/components/Tooltip.js ───────────────────────────────── 4.4kb ─── 3.1%
|
|
40
44
|
│ └ src/make-api.js
|
|
41
45
|
│ └ src/index.js
|
|
42
46
|
├ node_modules/lodash.memoize/index.js ────────────────────── 4.0kb ─── 2.9%
|
|
@@ -51,24 +55,20 @@
|
|
|
51
55
|
├ src/components/OptinStatus.js ───────────────────────────── 2.6kb ─── 1.9%
|
|
52
56
|
│ └ src/make-api.js
|
|
53
57
|
│ └ src/index.js
|
|
54
|
-
├ src/make-api.js ─────────────────────────────────────────── 2.
|
|
58
|
+
├ src/make-api.js ─────────────────────────────────────────── 2.5kb ─── 1.8%
|
|
55
59
|
│ └ src/index.js
|
|
56
60
|
├ src/components/UpsellModal.js ───────────────────────────── 2.4kb ─── 1.8%
|
|
57
61
|
│ └ src/make-api.js
|
|
58
62
|
│ └ src/index.js
|
|
59
63
|
├ src/core/utils.ts ───────────────────────────────────────── 2.3kb ─── 1.7%
|
|
60
64
|
│ └ src/index.js
|
|
61
|
-
├ src/
|
|
62
|
-
│ └ src/components/Offer.js
|
|
63
|
-
│ └ src/make-api.js
|
|
64
|
-
│ └ src/index.js
|
|
65
|
-
├ src/shopify/reducers/productPlans.ts ────────────────────── 2.3kb ─── 1.7%
|
|
65
|
+
├ src/shopify/reducers/productPlans.ts ────────────────────── 2.3kb ─── 1.6%
|
|
66
66
|
│ └ src/shopify/shopifyReducer.js
|
|
67
67
|
│ └ src/index.js
|
|
68
68
|
├ src/core/selectors.js ───────────────────────────────────── 2.2kb ─── 1.6%
|
|
69
69
|
│ └ src/core/utils.ts
|
|
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.5%
|
|
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.4%
|
|
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.2%
|
|
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.0%
|
|
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 ───
|
|
114
|
+
├ node_modules/reselect/es/index.js ───────────────────────── 1.3kb ─── 0.9%
|
|
115
115
|
│ └ src/core/selectors.js
|
|
116
116
|
│ └ src/core/utils.ts
|
|
117
117
|
│ └ src/index.js
|
|
@@ -119,12 +119,12 @@
|
|
|
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
|
|
122
125
|
├ src/components/OptinButton.js ───────────────────────────── 1.2kb ─── 0.9%
|
|
123
126
|
│ └ src/make-api.js
|
|
124
127
|
│ └ src/index.js
|
|
125
|
-
├ src/core/constants.js ───────────────────────────────────── 1.2kb ─── 0.8%
|
|
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%
|
|
@@ -136,7 +136,7 @@
|
|
|
136
136
|
│ └ src/index.js
|
|
137
137
|
├ src/shopify/shopifyTrackingMiddleware.ts ────────────────── 1.1kb ─── 0.8%
|
|
138
138
|
│ └ src/index.js
|
|
139
|
-
├ node_modules/lit-html/lib/modify-template.js ────────────── 1.0kb ─── 0.
|
|
139
|
+
├ node_modules/lit-html/lib/modify-template.js ────────────── 1.0kb ─── 0.7%
|
|
140
140
|
│ └ node_modules/lit-html/lib/shady-render.js
|
|
141
141
|
│ └ node_modules/lit-element/lit-element.js
|
|
142
142
|
│ └ src/components/Price.js
|
|
@@ -169,7 +169,7 @@
|
|
|
169
169
|
├ src/core/middleware.js ──────────────────────────────────── 955b ──── 0.7%
|
|
170
170
|
│ └ src/core/store.js
|
|
171
171
|
│ └ src/index.js
|
|
172
|
-
├ ../offers-live-editor/dist/offers-live-editor.js ────────── 921b ──── 0.
|
|
172
|
+
├ ../offers-live-editor/dist/offers-live-editor.js ────────── 921b ──── 0.6%
|
|
173
173
|
│ └ src/make-api.js
|
|
174
174
|
│ └ src/index.js
|
|
175
175
|
├ node_modules/throttle-debounce/index.umd.js ─────────────── 880b ──── 0.6%
|
|
@@ -222,7 +222,7 @@
|
|
|
222
222
|
├ src/components/NextUpcomingOrder.js ─────────────────────── 381b ──── 0.3%
|
|
223
223
|
│ └ src/make-api.js
|
|
224
224
|
│ └ src/index.js
|
|
225
|
-
├ node_modules/logical-expression-parser/tokenizer.js ─────── 355b ──── 0.
|
|
225
|
+
├ node_modules/logical-expression-parser/tokenizer.js ─────── 355b ──── 0.2%
|
|
226
226
|
│ └ node_modules/logical-expression-parser/index.js
|
|
227
227
|
│ └ src/components/When.js
|
|
228
228
|
│ └ src/make-api.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"}};return Ta})();return ae})});var ir=Su(Ga());window.og_settings={product_discounts:{
|
|
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",defaultPreviewMode:"prepaid"}};return Ta})();return ae})});var ir=Su(Ga());window.og_settings={product_discounts:{UD728:{"3_1":["30.00","10%","$27.00"],"1_2":["30.00","20%","$24.00"]},UD729:[{frequency:"1_3",prepaidShipments:null,regularPrice:"$15.00",subscriptionPrice:"$13.50",discountRate:"10%"},{frequency:"2_3",prepaidShipments:null,regularPrice:"$15.00",subscriptionPrice:"$13.50",discountRate:"10%"}]}};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",defaultPreviewMode:"prepaid",selector:'og-offer[location="prepaid-pdp"]',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>
|