loyalty-protocol 1.0.5 → 1.0.7

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/dist/index.cjs CHANGED
@@ -27,13 +27,17 @@ module.exports = __toCommonJS(index_exports);
27
27
 
28
28
  // src/hooks/useLoyaltyChannel.ts
29
29
  var useLoyaltyChannel = () => {
30
- const sendInformationToLoyaltyProtocol = ({ url }) => {
30
+ const sendInformationToLoyaltyProtocol = ({
31
+ data,
32
+ url
33
+ }) => {
34
+ console.log("\u{1F680} ~ data, url,:", data, url);
31
35
  const iframe = document.getElementById(
32
36
  "loyalty-protocol"
33
37
  );
34
38
  if (!iframe || typeof iframe.contentWindow === "undefined")
35
39
  throw new Error(`Element with ID: loyalty-protocol is not iframe window`);
36
- iframe.contentWindow?.postMessage(url, "https://stage.kstore.global/");
40
+ iframe.contentWindow?.postMessage(data, url);
37
41
  };
38
42
  return { sendInformationToLoyaltyProtocol };
39
43
  };
package/dist/index.d.cts CHANGED
@@ -1,8 +1,9 @@
1
1
  interface SendInformationArgs {
2
+ data: string;
2
3
  url: string;
3
4
  }
4
5
  declare const useLoyaltyChannel: () => {
5
- sendInformationToLoyaltyProtocol: ({ url }: SendInformationArgs) => void;
6
+ sendInformationToLoyaltyProtocol: ({ data, url, }: SendInformationArgs) => void;
6
7
  };
7
8
 
8
9
  export { useLoyaltyChannel as default, useLoyaltyChannel };
package/dist/index.d.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  interface SendInformationArgs {
2
+ data: string;
2
3
  url: string;
3
4
  }
4
5
  declare const useLoyaltyChannel: () => {
5
- sendInformationToLoyaltyProtocol: ({ url }: SendInformationArgs) => void;
6
+ sendInformationToLoyaltyProtocol: ({ data, url, }: SendInformationArgs) => void;
6
7
  };
7
8
 
8
9
  export { useLoyaltyChannel as default, useLoyaltyChannel };
package/dist/index.js CHANGED
@@ -1,12 +1,16 @@
1
1
  // src/hooks/useLoyaltyChannel.ts
2
2
  var useLoyaltyChannel = () => {
3
- const sendInformationToLoyaltyProtocol = ({ url }) => {
3
+ const sendInformationToLoyaltyProtocol = ({
4
+ data,
5
+ url
6
+ }) => {
7
+ console.log("\u{1F680} ~ data, url,:", data, url);
4
8
  const iframe = document.getElementById(
5
9
  "loyalty-protocol"
6
10
  );
7
11
  if (!iframe || typeof iframe.contentWindow === "undefined")
8
12
  throw new Error(`Element with ID: loyalty-protocol is not iframe window`);
9
- iframe.contentWindow?.postMessage(url, "https://stage.kstore.global/");
13
+ iframe.contentWindow?.postMessage(data, url);
10
14
  };
11
15
  return { sendInformationToLoyaltyProtocol };
12
16
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "loyalty-protocol",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "exports": {