@worldcoin/idkit 1.3.0 → 1.4.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.
|
@@ -156,11 +156,14 @@ import { jsx } from "react/jsx-runtime";
|
|
|
156
156
|
var generateMatrix = (data) => {
|
|
157
157
|
const arr = QRCodeUtil.create(data, { errorCorrectionLevel: "M" }).modules.data;
|
|
158
158
|
const sqrt = Math.sqrt(arr.length);
|
|
159
|
-
return arr.reduce(
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
159
|
+
return arr.reduce(
|
|
160
|
+
(rows, key, index) => {
|
|
161
|
+
if (index % sqrt === 0) rows.push([key]);
|
|
162
|
+
else rows[rows.length - 1].push(key);
|
|
163
|
+
return rows;
|
|
164
|
+
},
|
|
165
|
+
[]
|
|
166
|
+
);
|
|
164
167
|
};
|
|
165
168
|
var Qrcode = ({ data, size = 300 }) => {
|
|
166
169
|
const dots = useMemo(() => {
|
package/build/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
QRCode_default,
|
|
3
3
|
__,
|
|
4
4
|
idkit_default
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-YN64HCS2.js";
|
|
6
6
|
|
|
7
7
|
// src/hooks/useIDKit.ts
|
|
8
8
|
import { useEffect } from "react";
|
|
@@ -1425,6 +1425,22 @@ var SuccessState = () => {
|
|
|
1425
1425
|
};
|
|
1426
1426
|
var SuccessState_default = SuccessState;
|
|
1427
1427
|
|
|
1428
|
+
// ../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
1429
|
+
function r(e) {
|
|
1430
|
+
var t, f, n = "";
|
|
1431
|
+
if ("string" == typeof e || "number" == typeof e) n += e;
|
|
1432
|
+
else if ("object" == typeof e) if (Array.isArray(e)) {
|
|
1433
|
+
var o = e.length;
|
|
1434
|
+
for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
1435
|
+
} else for (f in e) e[f] && (n && (n += " "), n += f);
|
|
1436
|
+
return n;
|
|
1437
|
+
}
|
|
1438
|
+
function clsx() {
|
|
1439
|
+
for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
1440
|
+
return n;
|
|
1441
|
+
}
|
|
1442
|
+
var clsx_default = clsx;
|
|
1443
|
+
|
|
1428
1444
|
// src/components/IDKitWidget/States/WorldID/QRState.tsx
|
|
1429
1445
|
import copy from "copy-to-clipboard";
|
|
1430
1446
|
import { useCallback, useState as useState2 } from "react";
|
|
@@ -1553,22 +1569,6 @@ var QRPlaceholderIcon = (props) => /* @__PURE__ */ jsxs6("svg", { ...props, xmln
|
|
|
1553
1569
|
] });
|
|
1554
1570
|
var QRPlaceholderIcon_default = QRPlaceholderIcon;
|
|
1555
1571
|
|
|
1556
|
-
// ../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
1557
|
-
function r(e) {
|
|
1558
|
-
var t, f, n = "";
|
|
1559
|
-
if ("string" == typeof e || "number" == typeof e) n += e;
|
|
1560
|
-
else if ("object" == typeof e) if (Array.isArray(e)) {
|
|
1561
|
-
var o = e.length;
|
|
1562
|
-
for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
1563
|
-
} else for (f in e) e[f] && (n && (n += " "), n += f);
|
|
1564
|
-
return n;
|
|
1565
|
-
}
|
|
1566
|
-
function clsx() {
|
|
1567
|
-
for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
1568
|
-
return n;
|
|
1569
|
-
}
|
|
1570
|
-
var clsx_default = clsx;
|
|
1571
|
-
|
|
1572
1572
|
// src/components/IDKitWidget/States/WorldID/QRState.tsx
|
|
1573
1573
|
import { Fragment, jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1574
1574
|
var QRState = ({ qrData, showQR, setShowQR }) => {
|
|
@@ -1884,7 +1884,7 @@ var IDKitWidget = ({ children, ...config }) => {
|
|
|
1884
1884
|
className: "relative z-50 flex min-h-screen w-full flex-col bg-white pt-6 shadow focus:outline-none focus-visible:ring focus-visible:ring-purple-500/75 dark:bg-0d151d md:min-h-[35rem] md:max-w-md md:rounded-2xl",
|
|
1885
1885
|
children: /* @__PURE__ */ jsxs11(Toast.Provider, { children: [
|
|
1886
1886
|
/* @__PURE__ */ jsx15(Toast.Viewport, { className: "flex justify-center" }),
|
|
1887
|
-
/* @__PURE__ */ jsx15("div", { className: "mx-6 mb-12 flex items-center justify-between", children: /* @__PURE__ */ jsx15(Dialog.Close, { className: "flex items-center justify-center rounded-full dark:text-white", children: /* @__PURE__ */ jsx15(XMarkIcon_default, { className: "size-5" }) }) }),
|
|
1887
|
+
/* @__PURE__ */ jsx15("div", { className: "mx-6 mb-12 flex items-center justify-between", children: /* @__PURE__ */ jsx15(Dialog.Close, { className: "flex items-center justify-center rounded-full text-black dark:text-white", children: /* @__PURE__ */ jsx15(XMarkIcon_default, { className: "size-5" }) }) }),
|
|
1888
1888
|
/* @__PURE__ */ jsx15("div", { className: "relative mx-6 mb-6 flex flex-1 flex-col items-center justify-center", children: /* @__PURE__ */ jsx15(StageContent, {}) }),
|
|
1889
1889
|
/* @__PURE__ */ jsxs11("div", { className: "flex items-center justify-between border-t border-f5f5f7 p-7 md:rounded-b-2xl", children: [
|
|
1890
1890
|
/* @__PURE__ */ jsxs11(
|
package/build/internal.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@worldcoin/idkit",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"homepage": "https://docs.worldcoin.org/id/idkit",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"private": false,
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"qrcode": "^1.5.3",
|
|
62
62
|
"react-shadow": "^19.1.0",
|
|
63
63
|
"zustand": "^4.5.4",
|
|
64
|
-
"@worldcoin/idkit-core": "1.
|
|
64
|
+
"@worldcoin/idkit-core": "1.4.0"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@types/node": "18.11.9",
|