@prosopo/procaptcha-common 2.13.2 → 2.14.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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @prosopo/procaptcha-common@2.13.2 build:cjs
2
+ > @prosopo/procaptcha-common@2.14.0 build:cjs
3
3
  > NODE_ENV=${NODE_ENV:-development}; vite build --config vite.cjs.config.ts --mode $NODE_ENV
4
4
 
5
5
  ViteCommonJSConfig: .
@@ -57,7 +57,7 @@ dist/cjs/index.cjs 2.45 kB │ gzip: 0.63 kB
57
57
  dist/cjs/reactComponents/Reload.cjs 2.94 kB │ gzip: 1.30 kB
58
58
  dist/cjs/state/builder.cjs 3.13 kB │ gzip: 0.84 kB
59
59
  dist/cjs/callbacks/defaultCallbacks.cjs 3.84 kB │ gzip: 1.03 kB
60
- dist/cjs/reactComponents/Checkbox.cjs 5.39 kB │ gzip: 2.12 kB
61
- dist/cjs/reactComponents/ChallengeSurface.cjs 5.84 kB │ gzip: 2.07 kB
60
+ dist/cjs/reactComponents/Checkbox.cjs 6.21 kB │ gzip: 2.42 kB
61
+ dist/cjs/reactComponents/ChallengeSurface.cjs 6.72 kB │ gzip: 2.29 kB
62
62
 
63
- ✓ built in 87ms
63
+ ✓ built in 97ms
@@ -1,8 +1,8 @@
1
1
 
2
- > @prosopo/procaptcha-common@2.13.2 build:tsc
2
+ > @prosopo/procaptcha-common@2.14.0 build:tsc
3
3
  > tsc --build --verbose
4
4
 
5
- 7:31:57 PM - Projects in this build:
5
+ 5:39:09 AM - Projects in this build:
6
6
  * ../../dev/config/tsconfig.json
7
7
  * ../locale/tsconfig.json
8
8
  * ../util/tsconfig.json
@@ -18,35 +18,35 @@
18
18
  * ../account/tsconfig.json
19
19
  * tsconfig.json
20
20
 
21
- 7:31:57 PM - Project '../../dev/config/tsconfig.json' is up to date because newest input '../../dev/config/src/webpack/webpack.config.ts' is older than output '../../dev/config/tsconfig.tsbuildinfo'
21
+ 5:39:09 AM - Project '../../dev/config/tsconfig.json' is up to date because newest input '../../dev/config/src/webpack/webpack.config.ts' is older than output '../../dev/config/tsconfig.tsbuildinfo'
22
22
 
23
- 7:31:57 PM - Project '../locale/tsconfig.json' is up to date because newest input '../locale/src/translationKey.ts' is older than output '../locale/tsconfig.tsbuildinfo'
23
+ 5:39:09 AM - Project '../locale/tsconfig.json' is up to date because newest input '../locale/src/translationKey.ts' is older than output '../locale/tsconfig.tsbuildinfo'
24
24
 
25
- 7:31:57 PM - Project '../util/tsconfig.json' is up to date because newest input '../util/src/util.ts' is older than output '../util/tsconfig.tsbuildinfo'
25
+ 5:39:09 AM - Project '../util/tsconfig.json' is up to date because newest input '../util/src/url.ts' is older than output '../util/tsconfig.tsbuildinfo'
26
26
 
27
- 7:31:57 PM - Project '../logger/tsconfig.json' is up to date because newest input '../logger/src/tests/loggerBrowser.unit.test.ts' is older than output '../logger/tsconfig.tsbuildinfo'
27
+ 5:39:09 AM - Project '../logger/tsconfig.json' is up to date because newest input '../logger/src/index.ts' is older than output '../logger/tsconfig.tsbuildinfo'
28
28
 
29
- 7:31:57 PM - Project '../util-crypto/tsconfig.json' is up to date because newest input '../util-crypto/src/types.ts' is older than output '../util-crypto/tsconfig.tsbuildinfo'
29
+ 5:39:09 AM - Project '../util-crypto/tsconfig.json' is up to date because newest input '../util-crypto/src/types.ts' is older than output '../util-crypto/tsconfig.tsbuildinfo'
30
30
 
31
- 7:31:57 PM - Project '../types/tsconfig.json' is up to date because newest input '../types/src/types.test-d.ts' is older than output '../types/tsconfig.tsbuildinfo'
31
+ 5:39:09 AM - Project '../types/tsconfig.json' is up to date because newest input '../types/src/types.test-d.ts' is older than output '../types/tsconfig.tsbuildinfo'
32
32
 
33
- 7:31:57 PM - Project '../common/tsconfig.json' is up to date because newest input '../common/src/tests/utils/objectUtils.unit.test.ts' is older than output '../common/tsconfig.tsbuildinfo'
33
+ 5:39:09 AM - Project '../common/tsconfig.json' is up to date because newest input '../common/src/index.ts' is older than output '../common/tsconfig.tsbuildinfo'
34
34
 
35
- 7:31:57 PM - Project '../load-balancer/tsconfig.json' is up to date because newest input '../load-balancer/src/balancer.ts' is older than output '../load-balancer/tsconfig.tsbuildinfo'
35
+ 5:39:09 AM - Project '../load-balancer/tsconfig.json' is up to date because newest input '../load-balancer/src/tests/productionProviderList.unit.test.ts' is older than output '../load-balancer/tsconfig.tsbuildinfo'
36
36
 
37
- 7:31:57 PM - Project '../widget-skeleton/tsconfig.json' is up to date because newest input '../widget-skeleton/src/webComponent/createWidget.ts' is older than output '../widget-skeleton/tsconfig.tsbuildinfo'
37
+ 5:39:09 AM - Project '../widget-skeleton/tsconfig.json' is up to date because newest input '../widget-skeleton/src/webComponent/createWidget.ts' is older than output '../widget-skeleton/tsconfig.tsbuildinfo'
38
38
 
39
- 7:31:57 PM - Project '../fingerprintjs/tsconfig.json' is up to date because newest input '../fingerprintjs/src/utils/browser.ts' is older than output '../fingerprintjs/tsconfig.tsbuildinfo'
39
+ 5:39:09 AM - Project '../fingerprintjs/tsconfig.json' is up to date because newest input '../fingerprintjs/src/utils/browser.ts' is older than output '../fingerprintjs/tsconfig.tsbuildinfo'
40
40
 
41
- 7:31:57 PM - Project '../fingerprint/tsconfig.json' is up to date because newest input '../fingerprint/src/index.ts' is older than output '../fingerprint/tsconfig.tsbuildinfo'
41
+ 5:39:09 AM - Project '../fingerprint/tsconfig.json' is up to date because newest input '../fingerprint/src/index.ts' is older than output '../fingerprint/tsconfig.tsbuildinfo'
42
42
 
43
- 7:31:57 PM - Project '../keyring/tsconfig.json' is up to date because newest input '../keyring/src/keyring/keyring.test.ts' is older than output '../keyring/tsconfig.tsbuildinfo'
43
+ 5:39:09 AM - Project '../keyring/tsconfig.json' is up to date because newest input '../keyring/src/keyring/keyring.test.ts' is older than output '../keyring/tsconfig.tsbuildinfo'
44
44
 
45
- 7:31:57 PM - Project '../account/tsconfig.json' is out of date because output file '../account/tsconfig.tsbuildinfo' does not exist
45
+ 5:39:09 AM - Project '../account/tsconfig.json' is out of date because output file '../account/tsconfig.tsbuildinfo' does not exist
46
46
 
47
- 7:31:57 PM - Building project '/home/runner/work/captcha/captcha/packages/account/tsconfig.json'...
47
+ 5:39:09 AM - Building project '/home/runner/work/captcha/captcha/packages/account/tsconfig.json'...
48
48
 
49
- 7:32:00 PM - Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist
49
+ 5:39:12 AM - Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist
50
50
 
51
- 7:32:00 PM - Building project '/home/runner/work/captcha/captcha/packages/procaptcha-common/tsconfig.json'...
51
+ 5:39:12 AM - Building project '/home/runner/work/captcha/captcha/packages/procaptcha-common/tsconfig.json'...
52
52
 
@@ -1,9 +1,9 @@
1
1
 
2
- > @prosopo/procaptcha-common@2.13.2 build
2
+ > @prosopo/procaptcha-common@2.14.0 build
3
3
  > npm run build:cross-env -- --mode ${NODE_ENV:-development}
4
4
 
5
5
 
6
- > @prosopo/procaptcha-common@2.13.2 build:cross-env
6
+ > @prosopo/procaptcha-common@2.14.0 build:cross-env
7
7
  > vite build --config vite.esm.config.ts --mode production
8
8
 
9
9
  ViteEsmConfig: .
@@ -61,7 +61,7 @@ dist/reactComponents/Honeypot.js 1.86 kB │ gzip: 0.89 kB
61
61
  dist/reactComponents/Reload.js 2.69 kB │ gzip: 1.26 kB
62
62
  dist/state/builder.js 3.09 kB │ gzip: 0.84 kB
63
63
  dist/callbacks/defaultCallbacks.js 3.64 kB │ gzip: 1.00 kB
64
- dist/reactComponents/Checkbox.js 4.87 kB │ gzip: 2.04 kB
65
- dist/reactComponents/ChallengeSurface.js 5.52 kB │ gzip: 1.99 kB
64
+ dist/reactComponents/Checkbox.js 5.66 kB │ gzip: 2.34 kB
65
+ dist/reactComponents/ChallengeSurface.js 6.39 kB │ gzip: 2.21 kB
66
66
 
67
- ✓ built in 90ms
67
+ ✓ built in 75ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,90 @@
1
1
  # @prosopo/procaptcha-common
2
2
 
3
+ ## 2.14.0
4
+ ### Minor Changes
5
+
6
+ - 864ddde: Make the challenges usable with a keyboard and a screen reader.
7
+
8
+ The puzzle could only be solved by dragging with a mouse or a finger. The piece
9
+ was a plain `div`, so it could not be tabbed to, had no name or role, and a
10
+ screen reader announced nothing at all — a user on assistive tech could tick "I
11
+ am human", get a silent overlay, and have no way forward. The image captcha had
12
+ the same problem in its tiles.
13
+
14
+ What changed:
15
+
16
+ - The puzzle piece can now be focused and moved with the arrow keys (hold shift
17
+ for smaller steps, Home to start over, Enter or Space to submit). It has a
18
+ name, a role, and a visible focus ring.
19
+ - The puzzle announces its state as you go: where the piece is, as a percentage
20
+ across and down the board; that an answer is being checked; and that a failed
21
+ go has been replaced by a fresh puzzle.
22
+ - The image captcha tiles are now buttons rather than clickable `div`s, so they
23
+ can be tabbed to and activated with Enter or Space, and they report whether
24
+ they are selected instead of only looking selected.
25
+ - Both challenges now open as a proper dialog: it takes focus when it opens,
26
+ keeps Tab inside itself, and gives focus back to the checkbox on close.
27
+ - The spinner that replaces the checkbox while a check runs used to drop focus
28
+ to the top of the page without saying why. It now takes focus in the
29
+ checkbox's place, names itself, and hands focus back when the check finishes.
30
+ This affects the pow, image and puzzle flows.
31
+ - The puzzle's on-screen text was hardcoded English. It now goes through the
32
+ locale package, and the new strings are translated into all 32 locales.
33
+
34
+ A visual puzzle still cannot be solved by someone who cannot see it — the widget
35
+ is never told where the target is, so there is nothing it could describe. Sites
36
+ that need a challenge a blind user can complete should use the pow captcha type,
37
+ which needs no interaction beyond the checkbox.
38
+
39
+ ### Patch Changes
40
+
41
+ - 028a158: Stop the widget taking focus off the form the user is filling in.
42
+
43
+ While the widget checks a user, its checkbox is replaced by a spinner, and the
44
+ box takes focus back when the check finishes so a keyboard user is not left
45
+ stranded at the top of the page. It did that unconditionally, so if the user
46
+ spent the wait typing into the page's own form, the box grabbed focus off
47
+ whatever field they were in — and the keystroke that arrived with it went
48
+ nowhere. It now only claims focus back when nothing else holds it, which is
49
+ where removing the spinner leaves it.
50
+
51
+ This is what made the `puzzle` cypress spec flaky: it fills the signup form as
52
+ soon as the puzzle is solved, and lost the race with the widget often enough to
53
+ fail CI.
54
+
55
+ Covered by a new unit test in `procaptcha-react` that focuses an element outside
56
+ the widget mid-check and asserts focus is still there afterwards.
57
+ - Updated dependencies [028a158]
58
+ - Updated dependencies [3958046]
59
+ - Updated dependencies [028a158]
60
+ - @prosopo/types@5.8.3
61
+ - @prosopo/account@2.8.92
62
+ - @prosopo/load-balancer@2.10.44
63
+
64
+ ## 2.13.3
65
+ ### Patch Changes
66
+
67
+ - 124784f: Stop the image captcha losing its instruction line and top row of images on mobile.
68
+
69
+ On iOS the challenge panel was being shifted up by 100% of its own height, so
70
+ anything taller than half the screen ran off the top with no way to scroll back
71
+ to it. Users saw nine images and a Next button but no "Select all containing
72
+ ..." prompt, which made the challenge unsolvable.
73
+
74
+ The lift was compensating for the layer underneath it being sized with
75
+ `100vh` — on iOS Safari that is the height the page would have if the browser
76
+ toolbars retracted, so the centring box was taller than the visible area and
77
+ pushed the panel down under the bottom bar. Sizing that box with `100dvh`
78
+ instead centres correctly on its own, so the lift is gone. The panel is now
79
+ centred as a flex item and capped at the viewport height, scrolling when it
80
+ does not fit rather than overflowing off both edges.
81
+ - Updated dependencies [0d479f9]
82
+ - Updated dependencies [477b4e7]
83
+ - Updated dependencies [e4d6f06]
84
+ - @prosopo/load-balancer@2.10.43
85
+ - @prosopo/types@5.8.2
86
+ - @prosopo/account@2.8.91
87
+
3
88
  ## 2.13.2
4
89
  ### Patch Changes
5
90
 
@@ -5,27 +5,18 @@ react = require_runtime.__toESM(react, 1);
5
5
  let _emotion_react_jsx_runtime = require("@emotion/react/jsx-runtime");
6
6
  let react_dom = require("react-dom");
7
7
  //#region src/reactComponents/ChallengeSurface.tsx
8
+ var FOCUSABLE_SELECTOR = [
9
+ "a[href]",
10
+ "button:not([disabled])",
11
+ "input:not([disabled])",
12
+ "select:not([disabled])",
13
+ "textarea:not([disabled])",
14
+ "[tabindex]:not([tabindex=\"-1\"])"
15
+ ].join(",");
16
+ var focusableWithin = (root) => Array.from(root.querySelectorAll(FOCUSABLE_SELECTOR));
8
17
  var SURFACE_Z_INDEX = 2147483646;
9
18
  var CONTENT_Z_INDEX = 2147483647;
10
- var IOS_LIFT_STYLE_ID = "prosopo-challenge-surface-ios-lift";
11
- var IOS_LIFT_CSS = `
12
- .prosopo-challenge-content--ios-lift {
13
- transform: translate(-50%, -50%);
14
- }
15
- @supports (-webkit-touch-callout: none) {
16
- .prosopo-challenge-content--ios-lift {
17
- transform: translate(-50%, -100%);
18
- }
19
- }
20
- `;
21
- var ensureIosLiftStyles = () => {
22
- if (typeof document === "undefined") return;
23
- if (document.getElementById(IOS_LIFT_STYLE_ID)) return;
24
- const style = document.createElement("style");
25
- style.id = IOS_LIFT_STYLE_ID;
26
- style.textContent = IOS_LIFT_CSS;
27
- document.head.appendChild(style);
28
- };
19
+ var POPUP_EDGE_GAP_PX = 8;
29
20
  var FLOAT_GAP_PX = 8;
30
21
  var useIsomorphicLayoutEffect = typeof window === "undefined" ? react.useEffect : react.useLayoutEffect;
31
22
  /**
@@ -42,7 +33,7 @@ var computeFloatPosition = (anchorRect, panelHeight, scrollX, scrollY) => ({
42
33
  left: anchorRect.left + scrollX
43
34
  });
44
35
  var ChallengeSurface = react.default.memo((props) => {
45
- const { show, children, placement = _prosopo_types.PlacementEnum.popup, anchor, scrim = "none", onDismiss, popupIosLift = false, className } = props;
36
+ const { show, children, placement = _prosopo_types.PlacementEnum.popup, anchor, scrim = "none", onDismiss, className, dialogLabel } = props;
46
37
  const contentRef = (0, react.useRef)(null);
47
38
  const [floatPosition, setFloatPosition] = (0, react.useState)(null);
48
39
  const isFloating = placement === _prosopo_types.PlacementEnum.float && !!anchor;
@@ -87,6 +78,36 @@ var ChallengeSurface = react.default.memo((props) => {
87
78
  document.addEventListener("keydown", onKeyDown);
88
79
  return () => document.removeEventListener("keydown", onKeyDown);
89
80
  }, [show, onDismiss]);
81
+ (0, react.useEffect)(() => {
82
+ if (!show || !dialogLabel) return;
83
+ const content = contentRef.current;
84
+ if (!content) return;
85
+ const opener = document.activeElement instanceof HTMLElement ? document.activeElement : null;
86
+ (focusableWithin(content)[0] ?? content).focus();
87
+ return () => opener?.focus();
88
+ }, [show, dialogLabel]);
89
+ (0, react.useEffect)(() => {
90
+ if (!show || !dialogLabel) return;
91
+ const onKeyDown = (event) => {
92
+ if (event.key !== "Tab") return;
93
+ const content = contentRef.current;
94
+ if (!content) return;
95
+ const focusable = focusableWithin(content);
96
+ const first = focusable[0] ?? content;
97
+ const last = focusable[focusable.length - 1] ?? content;
98
+ const active = document.activeElement;
99
+ const outside = !content.contains(active);
100
+ if (event.shiftKey && (outside || active === first)) {
101
+ event.preventDefault();
102
+ last.focus();
103
+ } else if (!event.shiftKey && (outside || active === last)) {
104
+ event.preventDefault();
105
+ first.focus();
106
+ }
107
+ };
108
+ document.addEventListener("keydown", onKeyDown);
109
+ return () => document.removeEventListener("keydown", onKeyDown);
110
+ }, [show, dialogLabel]);
90
111
  (0, react.useEffect)(() => {
91
112
  if (!show || !isFloating || !onDismiss) return;
92
113
  const onPointerDown = (event) => {
@@ -104,9 +125,6 @@ var ChallengeSurface = react.default.memo((props) => {
104
125
  anchor,
105
126
  onDismiss
106
127
  ]);
107
- (0, react.useEffect)(() => {
108
- if (popupIosLift && !isFloating) ensureIosLiftStyles();
109
- }, [popupIosLift, isFloating]);
110
128
  if (typeof document === "undefined") return null;
111
129
  const layerStyle = isFloating ? {
112
130
  position: "absolute",
@@ -124,7 +142,9 @@ var ChallengeSurface = react.default.memo((props) => {
124
142
  display: show ? "flex" : "none",
125
143
  alignItems: "center",
126
144
  justifyContent: "center",
127
- minHeight: "100vh",
145
+ minHeight: "100dvh",
146
+ padding: `${POPUP_EDGE_GAP_PX}px`,
147
+ boxSizing: "border-box",
128
148
  backgroundColor: scrim === "dim" && show ? "rgba(0, 0, 0, 0.4)" : "transparent",
129
149
  transition: "background-color 0.3s ease"
130
150
  };
@@ -136,12 +156,13 @@ var ChallengeSurface = react.default.memo((props) => {
136
156
  left: `${floatPosition?.left ?? 0}px`,
137
157
  visibility: floatPosition ? "visible" : "hidden"
138
158
  } : {
139
- position: "absolute",
140
- top: "50%",
141
- left: "50%",
142
- transform: popupIosLift ? void 0 : "translate(-50%, -50%)",
159
+ position: "relative",
143
160
  zIndex: CONTENT_Z_INDEX,
144
- boxSizing: "border-box"
161
+ boxSizing: "border-box",
162
+ maxWidth: "100%",
163
+ maxHeight: "100%",
164
+ overflowY: "auto",
165
+ overscrollBehavior: "contain"
145
166
  };
146
167
  return (0, react_dom.createPortal)(/* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)("div", {
147
168
  className: [
@@ -152,8 +173,12 @@ var ChallengeSurface = react.default.memo((props) => {
152
173
  style: layerStyle,
153
174
  children: /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)("div", {
154
175
  ref: contentRef,
155
- className: popupIosLift && !isFloating ? "prosopo-challenge-content prosopo-challenge-content--ios-lift" : "prosopo-challenge-content",
176
+ className: "prosopo-challenge-content",
156
177
  style: contentStyle,
178
+ role: dialogLabel ? "dialog" : void 0,
179
+ "aria-modal": dialogLabel ? true : void 0,
180
+ "aria-label": dialogLabel,
181
+ tabIndex: dialogLabel ? -1 : void 0,
157
182
  children
158
183
  })
159
184
  }), document.body);
@@ -37,12 +37,29 @@ var baseStyle = {
37
37
  borderWidth: "2px"
38
38
  };
39
39
  var ID_LETTERS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
40
+ /**
41
+ * Whether nothing on the page holds focus, which is where the browser leaves it
42
+ * when the focused element is removed.
43
+ */
44
+ var focusIsStranded = (element) => {
45
+ const { activeElement, body } = element.ownerDocument;
46
+ return activeElement === null || activeElement === body;
47
+ };
40
48
  var FAQ_LINK = process.env.PROSOPO_DOCS_URL ? `${new URL(`${process.env.PROSOPO_DOCS_URL}/en/basics/faq/`).href}/` : "https://docs.prosopo.io/en/basics/faq/";
41
49
  var generateRandomId = () => {
42
50
  return Array.from({ length: 8 }, () => ID_LETTERS[Math.floor(Math.random() * ID_LETTERS.length)]).join("");
43
51
  };
44
- var Checkbox = ({ theme, onChange, checked, labelText, error, loading }) => {
52
+ var Checkbox = ({ theme, onChange, checked, labelText, error, loading, loadingText = "Checking that you are human" }) => {
45
53
  const [hover, setHover] = (0, react.useState)(false);
54
+ const inputRef = (0, react.useRef)(null);
55
+ const spinnerRef = (0, react.useRef)(null);
56
+ const hadFocus = (0, react.useRef)(false);
57
+ (0, react.useEffect)(() => {
58
+ if (!hadFocus.current) return;
59
+ const target = loading ? spinnerRef.current : inputRef.current;
60
+ if (!target || !focusIsStranded(target)) return;
61
+ target.focus();
62
+ }, [loading]);
46
63
  const checkboxFocus = (0, react.useMemo)(() => _emotion_react.css`
47
64
  &:focus-visible {
48
65
  outline: 3px solid ${theme.palette.primary.main};
@@ -104,20 +121,29 @@ var Checkbox = ({ theme, onChange, checked, labelText, error, loading }) => {
104
121
  minHeight: "58px"
105
122
  },
106
123
  children: [loading ? /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)("div", {
124
+ ref: spinnerRef,
107
125
  className: _prosopo_widget_skeleton.WIDGET_CHECKBOX_SPINNER_CSS_CLASS,
108
- "aria-label": "Loading spinner"
126
+ role: "status",
127
+ tabIndex: -1,
128
+ "aria-label": loadingText
109
129
  }) : /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)("input", {
130
+ ref: inputRef,
110
131
  name: id,
111
132
  id,
112
133
  onMouseEnter: () => setHover(true),
113
134
  onMouseLeave: () => setHover(false),
135
+ onFocus: () => {
136
+ hadFocus.current = true;
137
+ },
138
+ onBlur: () => {
139
+ hadFocus.current = false;
140
+ },
114
141
  css: [
115
142
  checkboxBefore,
116
143
  checkboxForcedColors,
117
144
  checkboxFocus
118
145
  ],
119
146
  type: "checkbox",
120
- "aria-live": "assertive",
121
147
  "aria-label": labelText,
122
148
  onKeyDown: (e) => {
123
149
  if (!require_trust.isEventTrusted(e)) return;
@@ -8,8 +8,8 @@ interface ChallengeSurfaceProps {
8
8
  anchor?: HTMLElement | null;
9
9
  scrim?: SurfaceScrim;
10
10
  onDismiss?: () => void;
11
- popupIosLift?: boolean;
12
11
  className?: string;
12
+ dialogLabel?: string;
13
13
  }
14
14
  interface FloatPosition {
15
15
  top: number;
@@ -1 +1 @@
1
- {"version":3,"file":"ChallengeSurface.d.ts","sourceRoot":"","sources":["../../src/reactComponents/ChallengeSurface.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAiB,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,KAAK,EAAE,EAEb,KAAK,SAAS,EAMd,MAAM,OAAO,CAAC;AAUf,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,KAAK,CAAC;AAE1C,UAAU,qBAAqB;IAC9B,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,aAAa,CAAC;IAE1B,MAAM,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAC5B,KAAK,CAAC,EAAE,YAAY,CAAC;IAErB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IAEvB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAkCD,UAAU,aAAa;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACb;AAWD,QAAA,MAAM,oBAAoB,eACb,OAAO,eACN,MAAM,WACV,MAAM,WACN,MAAM,KACb,aAKD,CAAC;AAEH,QAAA,MAAM,gBAAgB,oCAAsB,qBAAqB,8BA6K/D,CAAC;AAIH,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,CAAC"}
1
+ {"version":3,"file":"ChallengeSurface.d.ts","sourceRoot":"","sources":["../../src/reactComponents/ChallengeSurface.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAiB,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,KAAK,EAAE,EAEb,KAAK,SAAS,EAMd,MAAM,OAAO,CAAC;AAUf,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,KAAK,CAAC;AAE1C,UAAU,qBAAqB;IAC9B,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,aAAa,CAAC;IAE1B,MAAM,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAC5B,KAAK,CAAC,EAAE,YAAY,CAAC;IAErB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IAOnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB;AAwBD,UAAU,aAAa;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACb;AAWD,QAAA,MAAM,oBAAoB,eACb,OAAO,eACN,MAAM,WACV,MAAM,WACN,MAAM,KACb,aAKD,CAAC;AAEH,QAAA,MAAM,gBAAgB,oCAAsB,qBAAqB,8BAoO/D,CAAC;AAIH,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,CAAC"}
@@ -3,27 +3,18 @@ import React, { useCallback, useEffect, useLayoutEffect, useRef, useState } from
3
3
  import { jsx } from "@emotion/react/jsx-runtime";
4
4
  import { createPortal } from "react-dom";
5
5
  //#region src/reactComponents/ChallengeSurface.tsx
6
+ var FOCUSABLE_SELECTOR = [
7
+ "a[href]",
8
+ "button:not([disabled])",
9
+ "input:not([disabled])",
10
+ "select:not([disabled])",
11
+ "textarea:not([disabled])",
12
+ "[tabindex]:not([tabindex=\"-1\"])"
13
+ ].join(",");
14
+ var focusableWithin = (root) => Array.from(root.querySelectorAll(FOCUSABLE_SELECTOR));
6
15
  var SURFACE_Z_INDEX = 2147483646;
7
16
  var CONTENT_Z_INDEX = 2147483647;
8
- var IOS_LIFT_STYLE_ID = "prosopo-challenge-surface-ios-lift";
9
- var IOS_LIFT_CSS = `
10
- .prosopo-challenge-content--ios-lift {
11
- transform: translate(-50%, -50%);
12
- }
13
- @supports (-webkit-touch-callout: none) {
14
- .prosopo-challenge-content--ios-lift {
15
- transform: translate(-50%, -100%);
16
- }
17
- }
18
- `;
19
- var ensureIosLiftStyles = () => {
20
- if (typeof document === "undefined") return;
21
- if (document.getElementById(IOS_LIFT_STYLE_ID)) return;
22
- const style = document.createElement("style");
23
- style.id = IOS_LIFT_STYLE_ID;
24
- style.textContent = IOS_LIFT_CSS;
25
- document.head.appendChild(style);
26
- };
17
+ var POPUP_EDGE_GAP_PX = 8;
27
18
  var FLOAT_GAP_PX = 8;
28
19
  var useIsomorphicLayoutEffect = typeof window === "undefined" ? useEffect : useLayoutEffect;
29
20
  /**
@@ -40,7 +31,7 @@ var computeFloatPosition = (anchorRect, panelHeight, scrollX, scrollY) => ({
40
31
  left: anchorRect.left + scrollX
41
32
  });
42
33
  var ChallengeSurface = React.memo((props) => {
43
- const { show, children, placement = PlacementEnum.popup, anchor, scrim = "none", onDismiss, popupIosLift = false, className } = props;
34
+ const { show, children, placement = PlacementEnum.popup, anchor, scrim = "none", onDismiss, className, dialogLabel } = props;
44
35
  const contentRef = useRef(null);
45
36
  const [floatPosition, setFloatPosition] = useState(null);
46
37
  const isFloating = placement === PlacementEnum.float && !!anchor;
@@ -85,6 +76,36 @@ var ChallengeSurface = React.memo((props) => {
85
76
  document.addEventListener("keydown", onKeyDown);
86
77
  return () => document.removeEventListener("keydown", onKeyDown);
87
78
  }, [show, onDismiss]);
79
+ useEffect(() => {
80
+ if (!show || !dialogLabel) return;
81
+ const content = contentRef.current;
82
+ if (!content) return;
83
+ const opener = document.activeElement instanceof HTMLElement ? document.activeElement : null;
84
+ (focusableWithin(content)[0] ?? content).focus();
85
+ return () => opener?.focus();
86
+ }, [show, dialogLabel]);
87
+ useEffect(() => {
88
+ if (!show || !dialogLabel) return;
89
+ const onKeyDown = (event) => {
90
+ if (event.key !== "Tab") return;
91
+ const content = contentRef.current;
92
+ if (!content) return;
93
+ const focusable = focusableWithin(content);
94
+ const first = focusable[0] ?? content;
95
+ const last = focusable[focusable.length - 1] ?? content;
96
+ const active = document.activeElement;
97
+ const outside = !content.contains(active);
98
+ if (event.shiftKey && (outside || active === first)) {
99
+ event.preventDefault();
100
+ last.focus();
101
+ } else if (!event.shiftKey && (outside || active === last)) {
102
+ event.preventDefault();
103
+ first.focus();
104
+ }
105
+ };
106
+ document.addEventListener("keydown", onKeyDown);
107
+ return () => document.removeEventListener("keydown", onKeyDown);
108
+ }, [show, dialogLabel]);
88
109
  useEffect(() => {
89
110
  if (!show || !isFloating || !onDismiss) return;
90
111
  const onPointerDown = (event) => {
@@ -102,9 +123,6 @@ var ChallengeSurface = React.memo((props) => {
102
123
  anchor,
103
124
  onDismiss
104
125
  ]);
105
- useEffect(() => {
106
- if (popupIosLift && !isFloating) ensureIosLiftStyles();
107
- }, [popupIosLift, isFloating]);
108
126
  if (typeof document === "undefined") return null;
109
127
  const layerStyle = isFloating ? {
110
128
  position: "absolute",
@@ -122,7 +140,9 @@ var ChallengeSurface = React.memo((props) => {
122
140
  display: show ? "flex" : "none",
123
141
  alignItems: "center",
124
142
  justifyContent: "center",
125
- minHeight: "100vh",
143
+ minHeight: "100dvh",
144
+ padding: `${POPUP_EDGE_GAP_PX}px`,
145
+ boxSizing: "border-box",
126
146
  backgroundColor: scrim === "dim" && show ? "rgba(0, 0, 0, 0.4)" : "transparent",
127
147
  transition: "background-color 0.3s ease"
128
148
  };
@@ -134,12 +154,13 @@ var ChallengeSurface = React.memo((props) => {
134
154
  left: `${floatPosition?.left ?? 0}px`,
135
155
  visibility: floatPosition ? "visible" : "hidden"
136
156
  } : {
137
- position: "absolute",
138
- top: "50%",
139
- left: "50%",
140
- transform: popupIosLift ? void 0 : "translate(-50%, -50%)",
157
+ position: "relative",
141
158
  zIndex: CONTENT_Z_INDEX,
142
- boxSizing: "border-box"
159
+ boxSizing: "border-box",
160
+ maxWidth: "100%",
161
+ maxHeight: "100%",
162
+ overflowY: "auto",
163
+ overscrollBehavior: "contain"
143
164
  };
144
165
  return createPortal(/* @__PURE__ */ jsx("div", {
145
166
  className: [
@@ -150,8 +171,12 @@ var ChallengeSurface = React.memo((props) => {
150
171
  style: layerStyle,
151
172
  children: /* @__PURE__ */ jsx("div", {
152
173
  ref: contentRef,
153
- className: popupIosLift && !isFloating ? "prosopo-challenge-content prosopo-challenge-content--ios-lift" : "prosopo-challenge-content",
174
+ className: "prosopo-challenge-content",
154
175
  style: contentStyle,
176
+ role: dialogLabel ? "dialog" : void 0,
177
+ "aria-modal": dialogLabel ? true : void 0,
178
+ "aria-label": dialogLabel,
179
+ tabIndex: dialogLabel ? -1 : void 0,
155
180
  children
156
181
  })
157
182
  }), document.body);
@@ -1 +1 @@
1
- {"version":3,"file":"ChallengeSurface.js","sourceRoot":"","sources":["../../src/reactComponents/ChallengeSurface.tsx"],"names":[],"mappings":";AAcA,OAAO,EAAE,aAAa,EAAsB,MAAM,gBAAgB,CAAC;AACnE,OAAO,KAAK,EAAE,EAGb,WAAW,EACX,SAAS,EACT,eAAe,EACf,MAAM,EACN,QAAQ,GACR,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAyBzC,MAAM,eAAe,GAAG,UAAU,CAAC;AACnC,MAAM,eAAe,GAAG,UAAU,CAAC;AAGnC,MAAM,iBAAiB,GAAG,oCAAoC,CAAC;AAE/D,MAAM,YAAY,GAAG;;;;;;;;;CASpB,CAAC;AAEF,MAAM,mBAAmB,GAAG,GAAS,EAAE;IACtC,IAAI,OAAO,QAAQ,KAAK,WAAW;QAAE,OAAO;IAC5C,IAAI,QAAQ,CAAC,cAAc,CAAC,iBAAiB,CAAC;QAAE,OAAO;IAEvD,MAAM,KAAK,GAAG,QAAQ,CAAC,aAA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AC,SAAS,CAAC,CAAC,CAAC,QAAQ;SAChD;QACF,CAAC,CAAC;YACA,QAAQ,EAAE,UAAU;YACpB,GAAG,EAAE,KAAK;YACV,IAAI,EAAE,KAAK;YAEX,SAAS,EAAE,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,uBAAuB;YAC7D,MAAM,EAAE,eAAe;YACvB,SAAS,EAAE,YAAY;SACvB,CAAC;IAEJ,OAAO,YAAY,CAClB,cACC,SAAS,EAAE;YACV,2BAA2B;YAC3B,8BAA8B,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,EAAE;YAC9D,SAAS;SACT;aACC,MAAM,CAAC,OAAO,CAAC;aACf,IAAI,CAAC,GAAG,CAAC,EACX,KAAK,EAAE,UAAU,YAEjB,cACC,GAAG,EAAE,UAAU,EACf,SAAS,EACR,YAAY,IAAI,CAAC,UAAU;gBAC1B,CAAC,CAAC,+DAA+D;gBACjE,CAAC,CAAC,2BAA2B,EAE/B,KAAK,EAAE,YAAY,YAElB,QAAQ,GACJ,GACD,EACN,QAAQ,CAAC,IAAI,CACb,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,gBAAgB,CAAC,WAAW,GAAG,kBAAkB,CAAC;AAElD,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,CAAC"}
1
+ {"version":3,"file":"ChallengeSurface.js","sourceRoot":"","sources":["../../src/reactComponents/ChallengeSurface.tsx"],"names":[],"mappings":";AAcA,OAAO,EAAE,aAAa,EAAsB,MAAM,gBAAgB,CAAC;AACnE,OAAO,KAAK,EAAE,EAGb,WAAW,EACX,SAAS,EACT,eAAe,EACf,MAAM,EACN,QAAQ,GACR,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AA8BzC,MAAM,kBAAkB,GAAG;IAC1B,SAAS;IACT,wBAAwB;IACxB,uBAAuB;IACvB,wBAAwB;IACxB,0BAA0B;IAC1B,iCAAi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AAC,CAAC,CAAC,CAAC,SAAS,YAErC,QAAQ,GACJ,GACD,EACN,QAAQ,CAAC,IAAI,CACb,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,gBAAgB,CAAC,WAAW,GAAG,kBAAkB,CAAC;AAElD,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,CAAC"}
@@ -7,6 +7,7 @@ interface CheckboxProps extends ButtonHTMLAttributes<HTMLButtonElement> {
7
7
  labelText: string;
8
8
  error?: string;
9
9
  loading: boolean;
10
+ loadingText?: string;
10
11
  }
11
12
  export declare const Checkbox: FC<CheckboxProps>;
12
13
  export default Checkbox;
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../src/reactComponents/Checkbox.tsx"],"names":[],"mappings":"AAgBA,OAAO,EACN,KAAK,KAAK,EAGV,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACN,KAAK,oBAAoB,EAEzB,KAAK,EAAE,EAGP,MAAM,OAAO,CAAC;AAGf,UAAU,aAAc,SAAQ,oBAAoB,CAAC,iBAAiB,CAAC;IACtE,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IAEjB,QAAQ,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;CACjB;AA0DD,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CA0JtC,CAAC;AACF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../src/reactComponents/Checkbox.tsx"],"names":[],"mappings":"AAgBA,OAAO,EACN,KAAK,KAAK,EAGV,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACN,KAAK,oBAAoB,EAEzB,KAAK,EAAE,EAKP,MAAM,OAAO,CAAC;AAGf,UAAU,aAAc,SAAQ,oBAAoB,CAAC,iBAAiB,CAAC;IACtE,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IAEjB,QAAQ,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IAEjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB;AAmED,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CA8LtC,CAAC;AACF,eAAe,QAAQ,CAAC"}