@zoreal/oauth2-react 0.2.23 → 0.2.24
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 +18 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +18 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { createContext, useContext, useMemo, useState as useState2 } from "react
|
|
|
5
5
|
|
|
6
6
|
// src/wire.ts
|
|
7
7
|
var WIRE_VERSION = 1;
|
|
8
|
-
var SDK_VERSION = "0.2.
|
|
8
|
+
var SDK_VERSION = "0.2.24";
|
|
9
9
|
var DEFAULT_ISSUER = "https://id.zoreal.com";
|
|
10
10
|
var POLL_INTERVAL_MS = 2e3;
|
|
11
11
|
var POLL_INTERVAL_ENROLLING_MS = 5e3;
|
|
@@ -1615,9 +1615,16 @@ var SVG_NS = "http://www.w3.org/2000/svg";
|
|
|
1615
1615
|
var TAIL = 0.3;
|
|
1616
1616
|
var STACK = Array.from({ length: 12 }, (_, i) => 12 - i);
|
|
1617
1617
|
var HALO = [3, 2, 1];
|
|
1618
|
-
function
|
|
1619
|
-
const
|
|
1620
|
-
|
|
1618
|
+
function cornerOf(radius, width, height) {
|
|
1619
|
+
const raw = radius.trim();
|
|
1620
|
+
const value = parseFloat(raw);
|
|
1621
|
+
const offset = 2;
|
|
1622
|
+
if (raw.endsWith("%") && Number.isFinite(value)) {
|
|
1623
|
+
return [width * value / 100 + offset, height * value / 100 + offset];
|
|
1624
|
+
}
|
|
1625
|
+
const px = Number.isFinite(value) ? value : /infinity/i.test(raw) ? Infinity : 8;
|
|
1626
|
+
const r = Math.min(px, width / 2, height / 2) + offset;
|
|
1627
|
+
return [r, r];
|
|
1621
1628
|
}
|
|
1622
1629
|
function holdBusy(control) {
|
|
1623
1630
|
if (typeof document === "undefined") return () => {
|
|
@@ -1638,12 +1645,11 @@ function holdBusy(control) {
|
|
|
1638
1645
|
overlay.setAttribute("aria-hidden", "true");
|
|
1639
1646
|
const svg = document.createElementNS(SVG_NS, "svg");
|
|
1640
1647
|
svg.setAttribute("class", cx("ring-svg"));
|
|
1641
|
-
const
|
|
1648
|
+
const rects = [];
|
|
1642
1649
|
const layer = (name, len, alpha) => {
|
|
1643
1650
|
const rect = document.createElementNS(SVG_NS, "rect");
|
|
1644
1651
|
rect.setAttribute("class", cx(name));
|
|
1645
|
-
|
|
1646
|
-
rect.setAttribute("ry", String(rx));
|
|
1652
|
+
rects.push(rect);
|
|
1647
1653
|
rect.style.strokeDasharray = `calc(var(--zrl-l) * ${len}) calc(var(--zrl-l) * ${1 - len})`;
|
|
1648
1654
|
rect.style.setProperty("--zrl-s", `calc(var(--zrl-l) * ${-(TAIL - len)})`);
|
|
1649
1655
|
rect.style.opacity = alpha;
|
|
@@ -1666,6 +1672,11 @@ function holdBusy(control) {
|
|
|
1666
1672
|
overlay.style.top = `${box.top}px`;
|
|
1667
1673
|
overlay.style.width = `${box.width}px`;
|
|
1668
1674
|
overlay.style.height = `${box.height}px`;
|
|
1675
|
+
const [rx, ry] = cornerOf(getComputedStyle(control).borderTopLeftRadius, box.width, box.height);
|
|
1676
|
+
for (const rect of rects) {
|
|
1677
|
+
rect.setAttribute("rx", String(rx));
|
|
1678
|
+
rect.setAttribute("ry", String(ry));
|
|
1679
|
+
}
|
|
1669
1680
|
const length = typeof measured?.getTotalLength === "function" ? measured.getTotalLength() : 0;
|
|
1670
1681
|
if (length > 0) overlay.style.setProperty("--zrl-ring-len", `${length}px`);
|
|
1671
1682
|
};
|