@sparkvault/sdk-js 14.2.2 → 14.3.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.
- package/README.md +13 -6
- package/dist/index.cjs +1702 -1118
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +118 -26
- package/dist/index.mjs +1702 -1118
- package/dist/index.mjs.map +1 -1
- package/dist/products/help-desk/client.d.ts +18 -4
- package/dist/products/help-desk/form-attachments.d.ts +1 -0
- package/dist/products/help-desk/form.d.ts +20 -1
- package/dist/products/help-desk/types.d.ts +3 -1
- package/dist/sparks/index.d.ts +20 -9
- package/dist/sparks/types.d.ts +81 -14
- package/dist/sparkvault.js +1 -1
- package/dist/sparkvault.js.map +1 -1
- package/dist/ui/modal-shell.d.ts +41 -8
- package/package.json +1 -1
package/dist/ui/modal-shell.d.ts
CHANGED
|
@@ -1,12 +1,29 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Modal shell shared by the SDK's widgets (identity and
|
|
2
|
+
* Modal shell shared by the SDK's widgets (identity, upload and the help desk
|
|
3
|
+
* form).
|
|
3
4
|
*
|
|
4
|
-
* One dialog behaviour for
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
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
|
|
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
|
}
|