@ordergroove/offers 2.27.3-alpha-PR-641-3.13 → 2.27.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ordergroove/offers",
3
- "version": "2.27.3-alpha-PR-641-3.13+e0c036d4",
3
+ "version": "2.27.4",
4
4
  "description": "offer state component",
5
5
  "author": "Eugenio Lattanzio <eugenio63@gmail.com>",
6
6
  "homepage": "https://github.com/ordergroove/plush-toys#readme",
@@ -34,7 +34,7 @@
34
34
  ],
35
35
  "dependencies": {
36
36
  "@ordergroove/auth": "^2.3.0",
37
- "@ordergroove/offers-live-editor": "^0.4.2",
37
+ "@ordergroove/offers-live-editor": "^0.6.0",
38
38
  "lit-element": "^2.1.0",
39
39
  "lodash.memoize": "^4.1.2",
40
40
  "logical-expression-parser": "1.0.0",
@@ -45,5 +45,5 @@
45
45
  "devDependencies": {
46
46
  "@ordergroove/offers-templates": "^0.4.12"
47
47
  },
48
- "gitHead": "e0c036d46609853d866ea91c5a36a35b260d055e"
48
+ "gitHead": "3aa25b94b2ea166d28a20395a43de993c59e65e2"
49
49
  }
@@ -5,7 +5,6 @@ import { OptinStatus, mapStateToProps as mapStateToPropsOptinStatus } from './Op
5
5
  import { mapStateToProps, frequencyText } from './FrequencyStatus';
6
6
  import { connect } from '../core/connect';
7
7
  import { defaultFrequency } from '../core/props';
8
- import { configSelector } from '../core/selectors';
9
8
 
10
9
  export class OptinSelect extends withChildOptions(OptinStatus) {
11
10
  static get properties() {
@@ -45,8 +44,8 @@ export class OptinSelect extends withChildOptions(OptinStatus) {
45
44
 
46
45
  render() {
47
46
  const { options: childOptions, isSelected } = this.childOptions;
48
- let options;
49
- if (this.frequencies?.length) {
47
+ let options = childOptions;
48
+ if (!childOptions.length) {
50
49
  options = [
51
50
  {
52
51
  value: 'optedOut',
@@ -54,16 +53,11 @@ export class OptinSelect extends withChildOptions(OptinStatus) {
54
53
  <og-text key="offerOptOutLabel"></og-text>
55
54
  `
56
55
  },
57
- ...this.frequencies.map((value, ix) => ({
56
+ ...(this.frequencies || []).map(value => ({
58
57
  value,
59
- text:
60
- this.frequenciesText && ix in this.frequenciesText
61
- ? this.frequenciesText[ix]
62
- : frequencyText(value, this.defaultFrequency)
58
+ text: frequencyText(value, this.defaultFrequency)
63
59
  }))
64
60
  ];
65
- } else {
66
- options = childOptions;
67
61
  }
68
62
 
69
63
  return html`
@@ -79,8 +73,7 @@ export class OptinSelect extends withChildOptions(OptinStatus) {
79
73
  export const ConnectedOptinSelect = connect(
80
74
  (state, ownProps) => ({
81
75
  ...mapStateToPropsOptinStatus(state, ownProps),
82
- ...mapStateToProps(state, ownProps),
83
- ...configSelector(state, ownProps, 'frequencies')
76
+ ...mapStateToProps(state, ownProps)
84
77
  }),
85
78
  { productChangeFrequency, optoutProduct }
86
79
  )(OptinSelect);
package/src/make-api.js CHANGED
@@ -189,7 +189,7 @@ export default function makeApi(store) {
189
189
  Object.assign(window.OG, offers);
190
190
  Object.assign(offers.initialize, offers);
191
191
 
192
- offersLiveEditor();
192
+ offersLiveEditor(window.opener, offers);
193
193
 
194
194
  return offers;
195
195
  }