@rebilly/instruments 3.5.3-beta.0 → 3.6.0-beta.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rebilly/instruments",
3
- "version": "3.5.3-beta.0",
3
+ "version": "3.6.0-beta.0",
4
4
  "author": "Rebilly",
5
5
  "main": "dist/index.js",
6
6
  "unpkg": "dist/index.min.js",
@@ -2,6 +2,7 @@ import kebabCase from 'lodash.kebabcase';
2
2
  import BaseEvent from './base-event';
3
3
 
4
4
  const events = {
5
+ dataReady: new BaseEvent('data-ready'),
5
6
  instrumentReady: new BaseEvent('instrument-ready'),
6
7
  purchaseCompleted: new BaseEvent('purchase-completed'),
7
8
  setupCompleted: new BaseEvent('setup-completed')
@@ -2,6 +2,7 @@
2
2
  import { mountSummary } from '../../views/summary';
3
3
  import { mountMethodSelector } from '../../views/method-selector';
4
4
  import { fetchData } from './fetch-data';
5
+ import Events from '../../events';
5
6
  import setupElement from './setup-element';
6
7
  import setupStorefront from './setup-storefront';
7
8
  import setupOptions from './setup-options';
@@ -96,9 +97,12 @@ export async function mount({
96
97
  // Setup state
97
98
  state.options = setupOptions({ options });
98
99
  state.storefront = setupStorefront({ options });
100
+
99
101
  state.mainStyle = await setupStyles({ options });
102
+
100
103
  state.data = await fetchData({ state });
101
-
104
+ Events.dataReady.dispatch(state.data);
105
+
102
106
  state.options.themeFramepay = await setupFramepayTheme({ state, options });
103
107
  state.i18n = setupI18n({ state });
104
108
 
@@ -43,7 +43,8 @@ export default class BaseIframe {
43
43
  model: this.model
44
44
  });
45
45
 
46
- component.frame.setAttribute('allowpaymentrequest', 'allowpaymentrequest');
46
+ component.frame.setAttribute('allowpaymentrequest', true);
47
+ component.frame.setAttribute('loading', 'lazy');
47
48
  component.frame.setAttribute('allow', 'payment');
48
49
  return component;
49
50
  }