@sparkvault/sdk-js 14.2.1 → 14.2.3

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,12 +1,29 @@
1
1
  /**
2
- * Modal shell shared by the SDK's widgets (identity and upload).
2
+ * Modal shell shared by the SDK's widgets (identity, upload and the help desk
3
+ * form).
3
4
  *
4
- * One dialog behaviour for both: an overlay labelled as a modal dialog that
5
- * dismisses on its backdrop and on Escape, a page scroll lock held for as long
6
- * as any shell is open (and the page's own overflow given back when the last
7
- * one closes), focus moved into the dialog on open and returned to whatever
8
- * had it on close, and every listener removed on teardown. Each widget builds
9
- * its own header, body and footer inside `modal`.
5
+ * One dialog behaviour for all of them: an overlay labelled as a modal dialog;
6
+ * a page scroll lock held for as long as any shell is open (and the page's own
7
+ * overflow given back when the last one closes); focus moved into the dialog
8
+ * on open and returned to whatever had it on close; and every listener
9
+ * removed on teardown. Each widget builds its own header, body and footer
10
+ * inside `modal`.
11
+ *
12
+ * The backdrop dismisses only a press and release both on it. A browser sends
13
+ * `click` to the nearest common ancestor of the press and the release, so a
14
+ * text selection dragged out of the dialog and released over the backdrop
15
+ * clicks the overlay, and that is no dismissal.
16
+ *
17
+ * Open shells stack, and the keyboard belongs to the one opened last that is
18
+ * still in the page, so a dialog opened over another (Identity's sign-in over
19
+ * the help desk form) answers alone, and a shell whose overlay the host
20
+ * removed without destroy() answers nothing. A dialog of the host's own that
21
+ * holds focus (an `onAuthRequired` sign-in opened over the form) keeps the
22
+ * keyboard too. Escape dismisses the shell, unless the key ends an IME
23
+ * composition or another handler already took it (`defaultPrevented`). Tab
24
+ * and Shift+Tab stay inside it, wrapping from its last control to its first
25
+ * and back, as the WAI-ARIA dialog pattern asks; Escape still leaves, so it is
26
+ * no keyboard trap.
10
27
  */
11
28
  export interface ModalShellOptions {
12
29
  /** id of the overlay element. */
@@ -18,17 +35,33 @@ export interface ModalShellOptions {
18
35
  /** id of the element that titles the dialog (aria-labelledby). */
19
36
  titleId: string;
20
37
  backdropBlur: boolean;
21
- /** Called on a backdrop click or Escape. */
38
+ /** Called on a press and release on the backdrop, or on Escape while this shell is on top. */
22
39
  onDismiss: () => void;
23
40
  }
24
41
  export declare class ModalShell {
25
42
  readonly overlay: HTMLDivElement;
26
43
  readonly modal: HTMLDivElement;
27
44
  private readonly opener;
45
+ private readonly onOverlayPointerDown;
28
46
  private readonly onOverlayClick;
29
47
  private readonly onKeydown;
48
+ private pressOnBackdrop;
30
49
  private open;
31
50
  constructor(options: ModalShellOptions);
32
51
  /** Remove the dialog, release the scroll lock, and return focus to the opener. */
33
52
  destroy(): void;
53
+ /**
54
+ * Whether this shell answers the keyboard: it is the top shell still in the
55
+ * page, and focus is not inside a dialog of the host's own, which the shell
56
+ * stack does not know of. Focus in another shell is the stack's to settle.
57
+ */
58
+ private ownsKeyboard;
59
+ /**
60
+ * Wrap Tab from the dialog's last rendered control to its first, and
61
+ * Shift+Tab from its first (or from anything before it, the dialog itself
62
+ * included) to its last. Focus that has left the dialog comes back to its
63
+ * first control. A step a widget hides (`hidden`) renders no box, so its
64
+ * controls are never reached.
65
+ */
66
+ private keepFocusInside;
34
67
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sparkvault/sdk-js",
3
- "version": "14.2.1",
3
+ "version": "14.2.3",
4
4
  "description": "SparkVault JavaScript SDK - Identity, Secure Help Desk, Notifications and Encrypted Vaults",
5
5
  "type": "module",
6
6
  "exports": {