@pinerohit11/testwidget 0.1.11 → 0.1.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. package/.next/cache/webpack/client-development/1.pack.gz +0 -0
  2. package/.next/cache/webpack/client-development/2.pack.gz +0 -0
  3. package/.next/cache/webpack/client-development/3.pack.gz +0 -0
  4. package/.next/cache/webpack/client-development/4.pack.gz +0 -0
  5. package/.next/cache/webpack/client-development/index.pack.gz +0 -0
  6. package/.next/cache/webpack/client-development/index.pack.gz.old +0 -0
  7. package/.next/cache/webpack/server-development/0.pack.gz +0 -0
  8. package/.next/cache/webpack/server-development/1.pack.gz +0 -0
  9. package/.next/cache/webpack/server-development/2.pack.gz +0 -0
  10. package/.next/cache/webpack/server-development/3.pack.gz +0 -0
  11. package/.next/cache/webpack/server-development/4.pack.gz +0 -0
  12. package/.next/cache/webpack/server-development/5.pack.gz +0 -0
  13. package/.next/cache/webpack/server-development/index.pack.gz +0 -0
  14. package/.next/cache/webpack/server-development/index.pack.gz.old +0 -0
  15. package/.next/server/app/page.js +1 -1
  16. package/.next/server/webpack-runtime.js +1 -1
  17. package/.next/static/chunks/app/layout.js +2 -2
  18. package/.next/static/chunks/app/page.js +1 -1
  19. package/.next/static/chunks/webpack.js +1 -1
  20. package/.next/static/webpack/2e7b4aa2b22e65d9.webpack.hot-update.json +1 -0
  21. package/.next/static/webpack/2f388e6b66349419.webpack.hot-update.json +1 -0
  22. package/.next/static/webpack/548fbaf72ba2981b.webpack.hot-update.json +1 -0
  23. package/.next/static/webpack/7f3be6888ceaa76c.webpack.hot-update.json +1 -0
  24. package/.next/static/webpack/7f6a8530b9acce84.webpack.hot-update.json +1 -0
  25. package/.next/static/webpack/8407cf02bdf4864d.webpack.hot-update.json +1 -0
  26. package/.next/static/webpack/app/layout.2f388e6b66349419.hot-update.js +31 -0
  27. package/.next/static/webpack/app/layout.8407cf02bdf4864d.hot-update.js +31 -0
  28. package/.next/static/webpack/app/layout.b62381d4132a6544.hot-update.js +31 -0
  29. package/.next/static/webpack/app/page.2e7b4aa2b22e65d9.hot-update.js +22 -0
  30. package/.next/static/webpack/app/page.548fbaf72ba2981b.hot-update.js +62 -0
  31. package/.next/static/webpack/app/page.7f3be6888ceaa76c.hot-update.js +22 -0
  32. package/.next/static/webpack/app/page.7f6a8530b9acce84.hot-update.js +22 -0
  33. package/.next/static/webpack/app/page.bb7fb7004da6fd3f.hot-update.js +22 -0
  34. package/.next/static/webpack/b62381d4132a6544.webpack.hot-update.json +1 -0
  35. package/.next/static/webpack/bb7fb7004da6fd3f.webpack.hot-update.json +1 -0
  36. package/.next/static/webpack/webpack.2e7b4aa2b22e65d9.hot-update.js +18 -0
  37. package/.next/static/webpack/webpack.2f388e6b66349419.hot-update.js +18 -0
  38. package/.next/static/webpack/webpack.548fbaf72ba2981b.hot-update.js +18 -0
  39. package/.next/static/webpack/webpack.7f3be6888ceaa76c.hot-update.js +18 -0
  40. package/.next/static/webpack/webpack.7f6a8530b9acce84.hot-update.js +18 -0
  41. package/.next/static/webpack/webpack.8407cf02bdf4864d.hot-update.js +18 -0
  42. package/.next/static/webpack/webpack.b62381d4132a6544.hot-update.js +18 -0
  43. package/.next/static/webpack/webpack.bb7fb7004da6fd3f.hot-update.js +18 -0
  44. package/.next/trace +10 -0
  45. package/dist/index.cjs +27 -3
  46. package/dist/index.js +28 -4
  47. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -57,7 +57,7 @@ var import_react = __toESM(require("react"), 1);
57
57
  function PaywithFractal({ name, amount, orderId, fractalPayClientKey }) {
58
58
  const baseUrl = "http://192.168.1.52:8082/";
59
59
  const masterBaseUrl = "http://192.168.1.52:8081/";
60
- console.log(name, "name");
60
+ console.log(name, "name", window == null ? void 0 : window.DatacapWebToken);
61
61
  const [dcToken, setDcToken] = (0, import_react.useState)("");
62
62
  const [error, setError] = (0, import_react.useState)({});
63
63
  const [toggleQr, setToggleQr] = (0, import_react.useState)(false);
@@ -231,7 +231,31 @@ function PaywithFractal({ name, amount, orderId, fractalPayClientKey }) {
231
231
  const handlePay = () => {
232
232
  console.log("pay", name, baseUrl, masterBaseUrl);
233
233
  };
234
- return /* @__PURE__ */ import_react.default.createElement("div", { className: "bg-black" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "container bg-black" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "row bg-light no-gutters" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "col-sm-12" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "bd-example bd-example-tabs right-tabs mttabs m-3 " }, /* @__PURE__ */ import_react.default.createElement("div", { className: "payment-popup" }, /* @__PURE__ */ import_react.default.createElement("button", { className: "close-pop", style: { display: "none" } }, /* @__PURE__ */ import_react.default.createElement(
234
+ (0, import_react.useEffect)(() => {
235
+ const scriptId = "my-script";
236
+ const existingScript = document.getElementById(scriptId);
237
+ if (!existingScript) {
238
+ const script = document.createElement("script");
239
+ script.src = "https://token-cert.dcap.com/v1/client";
240
+ script.id = scriptId;
241
+ script.async = true;
242
+ script.onload = () => {
243
+ if (typeof window !== "undefined" && window.DatacapWebToken) {
244
+ console.log("DatacapWebToken", window.DatacapWebToken);
245
+ } else {
246
+ console.log("DatacapWebToken is not loaded yet.");
247
+ }
248
+ };
249
+ document.head.appendChild(script);
250
+ }
251
+ return () => {
252
+ const script = document.getElementById(scriptId);
253
+ if (script) {
254
+ document.head.removeChild(script);
255
+ }
256
+ };
257
+ }, []);
258
+ return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "bg-black" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "container bg-black" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "row bg-light no-gutters" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "col-sm-12" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "bd-example bd-example-tabs right-tabs mttabs m-3 " }, /* @__PURE__ */ import_react.default.createElement("div", { className: "payment-popup" }, /* @__PURE__ */ import_react.default.createElement("button", { className: "close-pop", style: { display: "none" } }, /* @__PURE__ */ import_react.default.createElement(
235
259
  "svg",
236
260
  {
237
261
  xmlns: "http://www.w3.org/2000/svg",
@@ -448,7 +472,7 @@ function PaywithFractal({ name, amount, orderId, fractalPayClientKey }) {
448
472
  alt: "Fractal logo",
449
473
  className: "powered-logo"
450
474
  }
451
- )))))))))));
475
+ ))))))))))));
452
476
  }
453
477
  // Annotate the CommonJS export names for ESM import in node:
454
478
  0 && (module.exports = {
package/dist/index.js CHANGED
@@ -20,11 +20,11 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
 
21
21
  // src/app/components/Greet.tsx
22
22
  import axios from "axios";
23
- import React, { useState } from "react";
23
+ import React, { useEffect, useState } from "react";
24
24
  function PaywithFractal({ name, amount, orderId, fractalPayClientKey }) {
25
25
  const baseUrl = "http://192.168.1.52:8082/";
26
26
  const masterBaseUrl = "http://192.168.1.52:8081/";
27
- console.log(name, "name");
27
+ console.log(name, "name", window == null ? void 0 : window.DatacapWebToken);
28
28
  const [dcToken, setDcToken] = useState("");
29
29
  const [error, setError] = useState({});
30
30
  const [toggleQr, setToggleQr] = useState(false);
@@ -198,7 +198,31 @@ function PaywithFractal({ name, amount, orderId, fractalPayClientKey }) {
198
198
  const handlePay = () => {
199
199
  console.log("pay", name, baseUrl, masterBaseUrl);
200
200
  };
201
- return /* @__PURE__ */ React.createElement("div", { className: "bg-black" }, /* @__PURE__ */ React.createElement("div", { className: "container bg-black" }, /* @__PURE__ */ React.createElement("div", { className: "row bg-light no-gutters" }, /* @__PURE__ */ React.createElement("div", { className: "col-sm-12" }, /* @__PURE__ */ React.createElement("div", { className: "bd-example bd-example-tabs right-tabs mttabs m-3 " }, /* @__PURE__ */ React.createElement("div", { className: "payment-popup" }, /* @__PURE__ */ React.createElement("button", { className: "close-pop", style: { display: "none" } }, /* @__PURE__ */ React.createElement(
201
+ useEffect(() => {
202
+ const scriptId = "my-script";
203
+ const existingScript = document.getElementById(scriptId);
204
+ if (!existingScript) {
205
+ const script = document.createElement("script");
206
+ script.src = "https://token-cert.dcap.com/v1/client";
207
+ script.id = scriptId;
208
+ script.async = true;
209
+ script.onload = () => {
210
+ if (typeof window !== "undefined" && window.DatacapWebToken) {
211
+ console.log("DatacapWebToken", window.DatacapWebToken);
212
+ } else {
213
+ console.log("DatacapWebToken is not loaded yet.");
214
+ }
215
+ };
216
+ document.head.appendChild(script);
217
+ }
218
+ return () => {
219
+ const script = document.getElementById(scriptId);
220
+ if (script) {
221
+ document.head.removeChild(script);
222
+ }
223
+ };
224
+ }, []);
225
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { className: "bg-black" }, /* @__PURE__ */ React.createElement("div", { className: "container bg-black" }, /* @__PURE__ */ React.createElement("div", { className: "row bg-light no-gutters" }, /* @__PURE__ */ React.createElement("div", { className: "col-sm-12" }, /* @__PURE__ */ React.createElement("div", { className: "bd-example bd-example-tabs right-tabs mttabs m-3 " }, /* @__PURE__ */ React.createElement("div", { className: "payment-popup" }, /* @__PURE__ */ React.createElement("button", { className: "close-pop", style: { display: "none" } }, /* @__PURE__ */ React.createElement(
202
226
  "svg",
203
227
  {
204
228
  xmlns: "http://www.w3.org/2000/svg",
@@ -415,7 +439,7 @@ function PaywithFractal({ name, amount, orderId, fractalPayClientKey }) {
415
439
  alt: "Fractal logo",
416
440
  className: "powered-logo"
417
441
  }
418
- )))))))))));
442
+ ))))))))))));
419
443
  }
420
444
  export {
421
445
  PaywithFractal
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pinerohit11/testwidget",
3
- "version": "0.1.11",
3
+ "version": "0.1.13",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "next dev",