@zoreal/oauth2-js 0.1.14 → 0.1.16

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/README.md CHANGED
@@ -140,7 +140,7 @@ is nothing to configure and nothing to draw.
140
140
 
141
141
  | | |
142
142
  | --- | --- |
143
- | **Mobile** | No QR. The pairing link opens the ZOREAL ID app and the modal never appears. Force one or the other with `display: 'qr'` / `'link'`. The choice is made before the pairing is created, because the provider binds the surface there: a link-mode pairing is claimed only by the app that opened that exact link, and has no QR at all. |
143
+ | **Mobile** | No QR and no modal. `startLogin` creates the pairing and sends the tab to the pairing link, which the ZOREAL ID app claims; with no app installed the same link is the page that installs it. That is one round trip after the tap, so disable the button you were tapped on and show it working until the promise settles. Force one or the other with `display: 'qr'` / `'link'`. The choice is made before the pairing is created, because the provider binds the surface there: a link-mode pairing is claimed only by the app that opened that exact link, and has no QR at all. |
144
144
  | **Live status** | Copy and title follow the pairing: waiting for a scan, then waiting for approval once the code is claimed (the spent QR blurs out behind a phone glyph). |
145
145
  | **Title** | Says what the scan is for, inferred from the request: "Scan to sign in" for `openid`, `email` and `profile.name`; "Scan to verify your identity" once a document attribute such as `zoreal.age` or `profile.birthdate` is requested; "Scan to prove you are a real human" for `openid` alone with `acr_values: 'zoreal.live'`. Override with `intent`, one of `'sign-in'`, `'identify'`, `'presence'`, when the scope does not say. |
146
146
  | **Countdown** | Counts down to expiry, turning amber under 20s. Reads the clock each tick rather than decrementing, so a backgrounded tab comes back honest. |
package/dist/index.cjs CHANGED
@@ -60,7 +60,7 @@ function unsafeClaims(idToken) {
60
60
 
61
61
  // src/wire.ts
62
62
  var WIRE_VERSION = 1;
63
- var SDK_VERSION = "0.1.14";
63
+ var SDK_VERSION = "0.1.16";
64
64
  var SDK_NAME = "@zoreal/oauth2-js";
65
65
  var DEFAULT_ISSUER = "https://id.zoreal.com";
66
66
  var POLL_INTERVAL_MS = 2e3;
@@ -1434,6 +1434,65 @@ var CSS = `
1434
1434
  }
1435
1435
 
1436
1436
  @keyframes ${PREFIX}-orbit { to { transform: rotate(360deg) } }
1437
+ /* THE BUSY RING. The light of the QR well, around any control that is
1438
+ waiting on the provider: the button on a phone between the tap and the
1439
+ hand-over to the app. The well's sweep is a cone from the centre, which is
1440
+ even on a square and useless on a wide button: it crawls along the long
1441
+ sides and lights two edges at once near the ends. So here the light is a
1442
+ dash on an SVG outline, which moves at one speed the whole way round
1443
+ whatever the shape, drawn with the well's tokens: its colour and head
1444
+ tint, its line width, its halo, its four second lap. pathLength makes the
1445
+ outline 100 units long, so every dash and offset is a percentage of the
1446
+ way round; the three layers share one head at 30 and differ in length
1447
+ and brightness, which is the comet's tail. Shown only while busy. */
1448
+ .${PREFIX}-ring {
1449
+ position: relative;
1450
+ display: inline-flex;
1451
+ vertical-align: middle;
1452
+ --zrl-beam-time: 4s;
1453
+ }
1454
+ .${PREFIX}-ring-svg {
1455
+ position: absolute;
1456
+ inset: -4px;
1457
+ width: calc(100% + 8px);
1458
+ height: calc(100% + 8px);
1459
+ overflow: visible;
1460
+ pointer-events: none;
1461
+ opacity: 0;
1462
+ transition: opacity 200ms ease-out;
1463
+ }
1464
+ .${PREFIX}-ring[data-busy="true"] > .${PREFIX}-ring-svg { opacity: 1; }
1465
+ .${PREFIX}-ring-svg rect {
1466
+ x: 2px;
1467
+ y: 2px;
1468
+ width: calc(100% - 4px);
1469
+ height: calc(100% - 4px);
1470
+ fill: none;
1471
+ stroke: var(--zrl-beam);
1472
+ stroke-width: var(--zrl-beam-line);
1473
+ stroke-linecap: round;
1474
+ animation: ${PREFIX}-dash var(--zrl-beam-time) linear infinite;
1475
+ }
1476
+ .${PREFIX}-ring-tail { stroke-dasharray: 30 70; stroke-dashoffset: 0; opacity: 0.35; }
1477
+ .${PREFIX}-ring-body { stroke-dasharray: 16 84; stroke-dashoffset: -14; opacity: 0.8; }
1478
+ .${PREFIX}-ring-head { stroke-dasharray: 5 95; stroke-dashoffset: -25; stroke: var(--zrl-beam-head); }
1479
+ .${PREFIX}-ring-halo {
1480
+ stroke-dasharray: 30 70;
1481
+ stroke-dashoffset: 0;
1482
+ stroke-width: calc(var(--zrl-glow-core) * 2 + var(--zrl-beam-line));
1483
+ opacity: calc(var(--zrl-glow-opacity) * 0.5);
1484
+ filter: blur(var(--zrl-glow-blur));
1485
+ }
1486
+ @keyframes ${PREFIX}-dash {
1487
+ to { stroke-dashoffset: calc(var(--zrl-dash-start, 0) - 100); }
1488
+ }
1489
+ .${PREFIX}-ring-body { --zrl-dash-start: -14; }
1490
+ .${PREFIX}-ring-head { --zrl-dash-start: -25; }
1491
+ @media (prefers-reduced-motion: reduce) {
1492
+ .${PREFIX}-ring-svg rect { animation: none; stroke-dasharray: none; opacity: 0.45; }
1493
+ .${PREFIX}-ring-halo, .${PREFIX}-ring-head { display: none; }
1494
+ }
1495
+
1437
1496
 
1438
1497
  @media (prefers-reduced-motion: reduce) {
1439
1498
  .${PREFIX}-scrim,