@rebilly/instruments 11.1.0 → 11.2.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 CHANGED
@@ -1,6 +1,6 @@
1
- ## [11.1.0](https://github.com/Rebilly/rebilly/compare/instruments/core-v11.0.2...instruments/core-v11.1.0) (2024-11-19)
1
+ ## [11.2.1](https://github.com/Rebilly/rebilly/compare/instruments/core-v11.2.0...instruments/core-v11.2.1) (2024-11-25)
2
2
 
3
3
 
4
- ### Features
4
+ ### Bug Fixes
5
5
 
6
- * **api-metadata, rebilly-js-sdk:** Update resources based on latest api definitions ([#8551](https://github.com/Rebilly/rebilly/issues/8551)) ([34ed640](https://github.com/Rebilly/rebilly/commit/34ed640a778915b586b87188c163840b30297afd))
6
+ * **framepay-npm:** add the main export for the outdated build tools ([#8766](https://github.com/Rebilly/rebilly/issues/8766)) ([abcd6ea](https://github.com/Rebilly/rebilly/commit/abcd6eaec41223b964b0e71dec8a6893916359de))
package/dist/index.js CHANGED
@@ -1914,6 +1914,27 @@ const state = (() => {
1914
1914
  }
1915
1915
  };
1916
1916
  })().getInstance();
1917
+ const DEFAULT_SCRIPT_LINK = "https://framepay.rebilly.com/framepay.js";
1918
+ const DEFAULT_STYLE_LINK = "https://framepay.rebilly.com/framepay.css";
1919
+ async function loadFramepay({
1920
+ scriptLink,
1921
+ styleLink
1922
+ } = {}) {
1923
+ return new Promise((resolve) => {
1924
+ if (window.Framepay) {
1925
+ resolve(window.Framepay);
1926
+ } else {
1927
+ const framepayStyle = document.createElement("link");
1928
+ framepayStyle.setAttribute("href", styleLink ?? DEFAULT_STYLE_LINK);
1929
+ framepayStyle.setAttribute("rel", "stylesheet");
1930
+ document.head.prepend(framepayStyle);
1931
+ const framepayScript = document.createElement("script");
1932
+ framepayScript.setAttribute("src", scriptLink ?? DEFAULT_SCRIPT_LINK);
1933
+ framepayScript.onload = () => resolve(window.Framepay);
1934
+ document.head.append(framepayScript);
1935
+ }
1936
+ });
1937
+ }
1917
1938
  /**
1918
1939
  popostmate - A powerful, simple, promise-based postMessage library
1919
1940
  @version v2.0.0
@@ -6262,7 +6283,7 @@ function C$1({ options: e2 }) {
6262
6283
  }
6263
6284
  function o2() {
6264
6285
  const i = {
6265
- "REB-API-CONSUMER": `${["Rebilly", e2.appName, "js-sdk"].filter((g) => g).join("/")}@34ed640`
6286
+ "REB-API-CONSUMER": `${["Rebilly", e2.appName, "js-sdk"].filter((g) => g).join("/")}@291232a`
6266
6287
  };
6267
6288
  return e2.apiKey && (i["REB-APIKEY"] = e2.apiKey), i;
6268
6289
  }
@@ -17934,23 +17955,6 @@ const setupOptions = ({
17934
17955
  }
17935
17956
  return validOptions;
17936
17957
  };
17937
- async function setupFramepay() {
17938
- const { _dev } = state.options || {};
17939
- const urls = {
17940
- script: (_dev == null ? void 0 : _dev.framePayScriptLink) || "https://framepay.rebilly.com/framepay.js",
17941
- style: (_dev == null ? void 0 : _dev.framePayStyleLink) || "https://framepay.rebilly.com/framepay.css"
17942
- };
17943
- return new Promise((resolve) => {
17944
- const framepayStyle = document.createElement("link");
17945
- framepayStyle.setAttribute("href", urls.style);
17946
- framepayStyle.setAttribute("rel", "stylesheet");
17947
- document.head.prepend(framepayStyle);
17948
- const framepayScript = document.createElement("script");
17949
- framepayScript.setAttribute("src", urls.script);
17950
- framepayScript.onload = () => resolve();
17951
- document.head.append(framepayScript);
17952
- });
17953
- }
17954
17958
  var colorName = {
17955
17959
  "aliceblue": [240, 248, 255],
17956
17960
  "antiquewhite": [250, 235, 215],
@@ -21235,10 +21239,7 @@ function getShadowParent(element) {
21235
21239
  }
21236
21240
  return null;
21237
21241
  }
21238
- async function mount({
21239
- setupFramepay: setupFramepay$1 = setupFramepay,
21240
- ...options
21241
- } = {}) {
21242
+ async function mount({ ...options } = {}) {
21242
21243
  var _a, _b, _c, _d, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s2, _t2;
21243
21244
  try {
21244
21245
  state.data = {};
@@ -21265,7 +21266,14 @@ async function mount({
21265
21266
  id: "rebilly-instruments-summary"
21266
21267
  });
21267
21268
  state.loader.startLoading({ id: "rebilly-instruments-form" });
21268
- const [data] = await Promise.all([fetchData(), setupFramepay$1()]);
21269
+ const { _dev } = state.options || {};
21270
+ const [data] = await Promise.all([
21271
+ fetchData(),
21272
+ loadFramepay({
21273
+ scriptLink: _dev == null ? void 0 : _dev.framePayScriptLink,
21274
+ styleLink: _dev == null ? void 0 : _dev.framePayStyleLink
21275
+ })
21276
+ ]);
21269
21277
  state.data = data;
21270
21278
  events.dataReady.dispatch(state.data);
21271
21279
  state.i18n = setupI18n();