@zoreal/oauth2-js 0.1.22 → 0.1.23

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
@@ -61,7 +61,7 @@ function unsafeClaims(idToken) {
61
61
 
62
62
  // src/wire.ts
63
63
  var WIRE_VERSION = 1;
64
- var SDK_VERSION = "0.1.22";
64
+ var SDK_VERSION = "0.1.23";
65
65
  var SDK_NAME = "@zoreal/oauth2-js";
66
66
  var DEFAULT_ISSUER = "https://id.zoreal.com";
67
67
  var POLL_INTERVAL_MS = 2e3;
@@ -717,9 +717,16 @@ var SVG_NS = "http://www.w3.org/2000/svg";
717
717
  var TAIL = 0.3;
718
718
  var STACK = Array.from({ length: 12 }, (_, i) => 12 - i);
719
719
  var HALO = [3, 2, 1];
720
- function radiusOf(control) {
721
- const value = parseFloat(getComputedStyle(control).borderTopLeftRadius);
722
- return Number.isFinite(value) ? value : 8;
720
+ function cornerOf(radius, width, height) {
721
+ const raw = radius.trim();
722
+ const value = parseFloat(raw);
723
+ const offset = 2;
724
+ if (raw.endsWith("%") && Number.isFinite(value)) {
725
+ return [width * value / 100 + offset, height * value / 100 + offset];
726
+ }
727
+ const px = Number.isFinite(value) ? value : /infinity/i.test(raw) ? Infinity : 8;
728
+ const r = Math.min(px, width / 2, height / 2) + offset;
729
+ return [r, r];
723
730
  }
724
731
  function holdBusy(control) {
725
732
  if (typeof document === "undefined") return () => {
@@ -740,12 +747,11 @@ function holdBusy(control) {
740
747
  overlay.setAttribute("aria-hidden", "true");
741
748
  const svg2 = document.createElementNS(SVG_NS, "svg");
742
749
  svg2.setAttribute("class", cx("ring-svg"));
743
- const rx = radiusOf(control) + 2;
750
+ const rects = [];
744
751
  const layer = (name, len, alpha) => {
745
752
  const rect = document.createElementNS(SVG_NS, "rect");
746
753
  rect.setAttribute("class", cx(name));
747
- rect.setAttribute("rx", String(rx));
748
- rect.setAttribute("ry", String(rx));
754
+ rects.push(rect);
749
755
  rect.style.strokeDasharray = `calc(var(--zrl-l) * ${len}) calc(var(--zrl-l) * ${1 - len})`;
750
756
  rect.style.setProperty("--zrl-s", `calc(var(--zrl-l) * ${-(TAIL - len)})`);
751
757
  rect.style.opacity = alpha;
@@ -768,6 +774,11 @@ function holdBusy(control) {
768
774
  overlay.style.top = `${box.top}px`;
769
775
  overlay.style.width = `${box.width}px`;
770
776
  overlay.style.height = `${box.height}px`;
777
+ const [rx, ry] = cornerOf(getComputedStyle(control).borderTopLeftRadius, box.width, box.height);
778
+ for (const rect of rects) {
779
+ rect.setAttribute("rx", String(rx));
780
+ rect.setAttribute("ry", String(ry));
781
+ }
771
782
  const length = typeof measured?.getTotalLength === "function" ? measured.getTotalLength() : 0;
772
783
  if (length > 0) overlay.style.setProperty("--zrl-ring-len", `${length}px`);
773
784
  };