@ordergroove/offers 2.34.3 → 2.34.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/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.34.4](https://github.com/ordergroove/plush-toys/compare/@ordergroove/offers@2.34.3...@ordergroove/offers@2.34.4) (2023-11-09)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **offers:** set aria-current to reflect opt-in status ([2849145](https://github.com/ordergroove/plush-toys/commit/2849145cd0b6957efca6f516e0e0d2734925182b))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [2.34.3](https://github.com/ordergroove/plush-toys/compare/@ordergroove/offers@2.34.2...@ordergroove/offers@2.34.3) (2023-11-08)
7
18
 
8
19
 
@@ -4,7 +4,7 @@
4
4
  │ └ examples/index.js
5
5
  └ examples/index.js ───────────────────────────────────────── 9.7kb ─── 3.4%
6
6
 
7
- dist/offers.js ───────────────────────────────────────────── 144.7kb ─ 100.0%
7
+ dist/offers.js ───────────────────────────────────────────── 144.9kb ─ 100.0%
8
8
  ├ src/components/Offer.js ─────────────────────────────────── 8.2kb ─── 5.7%
9
9
  │ └ src/make-api.js
10
10
  │ └ src/index.js
@@ -121,6 +121,9 @@
121
121
  │ └ src/core/selectors.js
122
122
  │ └ src/core/utils.ts
123
123
  │ └ src/index.js
124
+ ├ src/components/OptinButton.js ───────────────────────────── 1.3kb ─── 0.9%
125
+ │ └ src/make-api.js
126
+ │ └ src/index.js
124
127
  ├ src/core/resolveProperties.js ───────────────────────────── 1.3kb ─── 0.9%
125
128
  │ └ src/components/Price.js
126
129
  │ └ src/make-api.js
@@ -128,9 +131,6 @@
128
131
  ├ src/core/constants.js ───────────────────────────────────── 1.2kb ─── 0.8%
129
132
  │ └ src/shopify/shopifyTrackingMiddleware.ts
130
133
  │ └ src/index.js
131
- ├ src/components/OptinButton.js ───────────────────────────── 1.2kb ─── 0.8%
132
- │ └ src/make-api.js
133
- │ └ src/index.js
134
134
  ├ src/components/PrepaidSelect.js ─────────────────────────── 1.2kb ─── 0.8%
135
135
  │ └ src/make-api.js
136
136
  │ └ src/index.js
@@ -200,6 +200,9 @@
200
200
  ├ src/components/SubscriptionButton.js ────────────────────── 770b ──── 0.5%
201
201
  │ └ src/make-api.js
202
202
  │ └ src/index.js
203
+ ├ src/components/OptoutButton.js ──────────────────────────── 662b ──── 0.4%
204
+ │ └ src/make-api.js
205
+ │ └ src/index.js
203
206
  ├ node_modules/lit-html/lib/template-result.js ────────────── 642b ──── 0.4%
204
207
  │ └ node_modules/lit-html/lit-html.js
205
208
  │ └ node_modules/lit-element/lit-element.js
@@ -214,9 +217,6 @@
214
217
  │ └ src/components/When.js
215
218
  │ └ src/make-api.js
216
219
  │ └ src/index.js
217
- ├ src/components/OptoutButton.js ──────────────────────────── 565b ──── 0.4%
218
- │ └ src/make-api.js
219
- │ └ src/index.js
220
220
  ├ src/core/dateUtils.js ───────────────────────────────────── 541b ──── 0.4%
221
221
  │ └ src/components/NextUpcomingOrder.js
222
222
  │ └ src/make-api.js
package/dist/offers.js CHANGED
@@ -185,7 +185,12 @@ var lib=(()=>{var ja=Object.create;var yt=Object.defineProperty;var Va=Object.ge
185
185
  <slot name="not-subscribed"></slot>
186
186
  `}};n(Y,"OptinStatus");var Q=n((t,e={})=>({subscribed:te(e.product)(t),frequency:oe(e.product)(t),productDefaultFrequency:Ze((e.product||{}).id)(t),prepaidShipmentsOptedIn:H(e.product)(t),...G(t,e,"defaultFrequency"),...G(t,e,"frequencies"),...Xe(t,e)}),"mapStateToProps"),js=g(Q)(Y);q();At();var ht=class extends Y{static get properties(){return{...super.properties,frequency:{type:String,reflect:!0},defaultFrequency:Te,optinButtonLabel:{type:String}}}updated(e){if(e.has("subscribed")||e.has("frequencies")){if(L.shopify_selling_plans&&this.store){let r=this.getAttribute("default-frequency");r=To(r,this.store.getState().config),this.sellingPlanFreq=r}this.frequencyMatch=this.frequency===this.optinFrequency}}get optinFrequency(){let e;return this.sellingPlanFreq?e=this.sellingPlanFreq:this.hasAttribute("default-frequency")?e=this.getAttribute("default-frequency"):e=this.offer?this.offer.defaultFrequency:this.defaultFrequency,L.shopify_selling_plans&&this.store&&(e=To(e,this.store.getState().config)),e}handleClick(e){this.optinProduct(Mt(this),this.optinFrequency,this.offer),e.preventDefault()}render(){return u`
187
187
  <slot name="default">
188
- <button aria-labelledby="ogOfferOptInLabel" class="btn radio ${this.subscribed?"active":""}"></button>
188
+ <button
189
+ aria-labelledby="ogOfferOptInLabel"
190
+ role="radio"
191
+ aria-checked="${!!this.subscribed}"
192
+ class="btn radio ${this.subscribed?"active":""}"
193
+ ></button>
189
194
  <label id="ogOfferOptInLabel">
190
195
  <slot>
191
196
  <slot name="label"><og-text key="offerOptInLabel"></og-text></slot>
@@ -194,7 +199,12 @@ var lib=(()=>{var ja=Object.create;var yt=Object.defineProperty;var Va=Object.ge
194
199
  </slot>
195
200
  `}};n(ht,"OptinButton");var Vs=g(Q,{optinProduct:K})(ht);E();A();var Mr=class extends Y{static get properties(){return{...super.properties,label:{type:String}}}handleClick(e){this.optoutProduct(this.product,this.offer),e.preventDefault()}render(){return u`
196
201
  <slot name="default">
197
- <button aria-labelledby="ogOfferOptOutLabel" class="btn radio ${this.subscribed?"":"active"}"></button>
202
+ <button
203
+ aria-labelledby="ogOfferOptOutLabel"
204
+ role="radio"
205
+ aria-checked="${!this.subscribed}"
206
+ class="btn radio ${this.subscribed?"":"active"}"
207
+ ></button>
198
208
  <label id="ogOfferOptOutLabel">
199
209
  <slot>
200
210
  <og-text key="offerOptOutLabel"></og-text>