@sparkvault/sdk-js 19.0.0 → 19.1.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.
Files changed (132) hide show
  1. package/README.md +26 -4
  2. package/dist/npm/chunks/index-BnP-2w0t.cjs +13025 -0
  3. package/dist/npm/chunks/index-BnP-2w0t.cjs.map +1 -0
  4. package/dist/npm/chunks/index-CgR08uMG.mjs +12960 -0
  5. package/dist/npm/chunks/index-CgR08uMG.mjs.map +1 -0
  6. package/dist/npm/identity.cjs +23 -0
  7. package/dist/npm/identity.cjs.map +1 -0
  8. package/dist/npm/identity.mjs +12 -0
  9. package/dist/npm/identity.mjs.map +1 -0
  10. package/dist/{index.cjs → npm/index.cjs} +799 -13755
  11. package/dist/npm/index.cjs.map +1 -0
  12. package/dist/{index.mjs → npm/index.mjs} +200 -13155
  13. package/dist/npm/index.mjs.map +1 -0
  14. package/dist/sparkvault-identity.js +2 -0
  15. package/dist/sparkvault-identity.js.map +1 -0
  16. package/dist/sparkvault.js +1 -1
  17. package/dist/types/identity.d.ts +8 -0
  18. package/dist/{index.d.ts → types/index.d.ts} +4 -790
  19. package/dist/types/shared/errors-C-gjmGBs.d.ts +800 -0
  20. package/package.json +20 -9
  21. package/dist/api-base.d.ts +0 -116
  22. package/dist/auto-init.d.ts +0 -32
  23. package/dist/config.d.ts +0 -79
  24. package/dist/entropy/index.d.ts +0 -35
  25. package/dist/entropy/types.d.ts +0 -32
  26. package/dist/errors.d.ts +0 -146
  27. package/dist/folders/index.d.ts +0 -102
  28. package/dist/folders/types.d.ts +0 -91
  29. package/dist/health.d.ts +0 -18
  30. package/dist/http.d.ts +0 -46
  31. package/dist/index.cjs.map +0 -1
  32. package/dist/index.mjs.map +0 -1
  33. package/dist/ingots/fetch-download.d.ts +0 -78
  34. package/dist/ingots/history.d.ts +0 -4
  35. package/dist/ingots/index.d.ts +0 -388
  36. package/dist/ingots/revision.d.ts +0 -4
  37. package/dist/ingots/types.d.ts +0 -556
  38. package/dist/logger.d.ts +0 -32
  39. package/dist/notify/index.d.ts +0 -154
  40. package/dist/notify/types.d.ts +0 -232
  41. package/dist/products/help-desk/client.d.ts +0 -198
  42. package/dist/products/help-desk/desk-id.d.ts +0 -2
  43. package/dist/products/help-desk/form-draft.d.ts +0 -37
  44. package/dist/products/help-desk/form-types.d.ts +0 -123
  45. package/dist/products/help-desk/form.d.ts +0 -83
  46. package/dist/products/help-desk/index.d.ts +0 -47
  47. package/dist/products/help-desk/kb-client.d.ts +0 -48
  48. package/dist/products/help-desk/kb-types.d.ts +0 -59
  49. package/dist/products/help-desk/modal.d.ts +0 -8
  50. package/dist/products/help-desk/styles.d.ts +0 -9
  51. package/dist/products/help-desk/support-analytics-types.d.ts +0 -32
  52. package/dist/products/help-desk/support-analytics.d.ts +0 -3
  53. package/dist/products/help-desk/support-brand.d.ts +0 -49
  54. package/dist/products/help-desk/support-controller.d.ts +0 -4
  55. package/dist/products/help-desk/support-history.d.ts +0 -38
  56. package/dist/products/help-desk/support-launcher.d.ts +0 -12
  57. package/dist/products/help-desk/support-styles.d.ts +0 -14
  58. package/dist/products/help-desk/support-types.d.ts +0 -66
  59. package/dist/products/help-desk/support-view.d.ts +0 -173
  60. package/dist/products/help-desk/types.d.ts +0 -285
  61. package/dist/products/help-desk/widget-identity.d.ts +0 -32
  62. package/dist/products/identity/api.d.ts +0 -237
  63. package/dist/products/identity/container.d.ts +0 -44
  64. package/dist/products/identity/dialog-launcher.d.ts +0 -133
  65. package/dist/products/identity/federation-flow.d.ts +0 -31
  66. package/dist/products/identity/handlers/otp-handler.d.ts +0 -69
  67. package/dist/products/identity/handlers/passkey-handler.d.ts +0 -105
  68. package/dist/products/identity/handlers/sparklink-handler.d.ts +0 -34
  69. package/dist/products/identity/index.d.ts +0 -296
  70. package/dist/products/identity/inline-container.d.ts +0 -53
  71. package/dist/products/identity/methods.d.ts +0 -19
  72. package/dist/products/identity/modal.d.ts +0 -51
  73. package/dist/products/identity/pending-signin.d.ts +0 -102
  74. package/dist/products/identity/popup-launcher.d.ts +0 -73
  75. package/dist/products/identity/renderer.d.ts +0 -525
  76. package/dist/products/identity/state.d.ts +0 -84
  77. package/dist/products/identity/styles.d.ts +0 -31
  78. package/dist/products/identity/types.d.ts +0 -561
  79. package/dist/products/identity/utils/cooldown-timer.d.ts +0 -73
  80. package/dist/products/identity/utils.d.ts +0 -85
  81. package/dist/products/identity/views/backup-verify.d.ts +0 -42
  82. package/dist/products/identity/views/base.d.ts +0 -51
  83. package/dist/products/identity/views/error.d.ts +0 -65
  84. package/dist/products/identity/views/icons.d.ts +0 -41
  85. package/dist/products/identity/views/identity-input.d.ts +0 -80
  86. package/dist/products/identity/views/index.d.ts +0 -20
  87. package/dist/products/identity/views/loading.d.ts +0 -23
  88. package/dist/products/identity/views/method-button.d.ts +0 -14
  89. package/dist/products/identity/views/method-select.d.ts +0 -42
  90. package/dist/products/identity/views/origin-not-allowed.d.ts +0 -25
  91. package/dist/products/identity/views/otp-verify.d.ts +0 -58
  92. package/dist/products/identity/views/passkey-auto.d.ts +0 -22
  93. package/dist/products/identity/views/passkey-prompt.d.ts +0 -25
  94. package/dist/products/identity/views/passkey.d.ts +0 -38
  95. package/dist/products/identity/views/product-not-configured.d.ts +0 -21
  96. package/dist/products/identity/views/service-unavailable.d.ts +0 -21
  97. package/dist/products/identity/views/sms-consent.d.ts +0 -16
  98. package/dist/products/identity/views/sparklink-waiting.d.ts +0 -40
  99. package/dist/products/identity/views/two-factor.d.ts +0 -37
  100. package/dist/products/index.d.ts +0 -51
  101. package/dist/products/messaging/index.d.ts +0 -38
  102. package/dist/products/messaging/types.d.ts +0 -162
  103. package/dist/products/notify/index.d.ts +0 -436
  104. package/dist/products/notify/project-types.d.ts +0 -44
  105. package/dist/products/notify/projects.d.ts +0 -15
  106. package/dist/products/notify/types.d.ts +0 -1327
  107. package/dist/products/structured-ingots/index.d.ts +0 -31
  108. package/dist/products/structured-ingots/types-client.d.ts +0 -19
  109. package/dist/products/structured-ingots/types.d.ts +0 -293
  110. package/dist/products/structured-ingots/validation.d.ts +0 -25
  111. package/dist/request-path.d.ts +0 -44
  112. package/dist/sparks/index.d.ts +0 -91
  113. package/dist/sparks/types.d.ts +0 -304
  114. package/dist/ui/chrome.d.ts +0 -16
  115. package/dist/ui/ds-tokens.d.ts +0 -59
  116. package/dist/ui/inline-shell.d.ts +0 -19
  117. package/dist/ui/live-region.d.ts +0 -15
  118. package/dist/ui/modal-shell.d.ts +0 -67
  119. package/dist/ui/target.d.ts +0 -6
  120. package/dist/utils/dom.d.ts +0 -26
  121. package/dist/vault-session.d.ts +0 -2
  122. package/dist/vaults/index.d.ts +0 -254
  123. package/dist/vaults/types.d.ts +0 -368
  124. package/dist/vaults/upload/api.d.ts +0 -310
  125. package/dist/vaults/upload/chrome.d.ts +0 -21
  126. package/dist/vaults/upload/container.d.ts +0 -37
  127. package/dist/vaults/upload/index.d.ts +0 -76
  128. package/dist/vaults/upload/inline-container.d.ts +0 -41
  129. package/dist/vaults/upload/modal.d.ts +0 -55
  130. package/dist/vaults/upload/renderer.d.ts +0 -150
  131. package/dist/vaults/upload/styles.d.ts +0 -14
  132. package/dist/vaults/upload/types.d.ts +0 -220
@@ -1,304 +0,0 @@
1
- /**
2
- * Sparks Module Types
3
- *
4
- * Sparks are ephemeral secrets scoped to the account (no vault/VAT), sealed
5
- * server-side under platform-held keys and read once. Public domain objects
6
- * are camelCase; wire shapes (snake_case) stay private to the module.
7
- */
8
- /** A spark summary as returned by list. */
9
- export interface SparkSummary {
10
- /** Spark ID */
11
- id: string;
12
- /** Content type (MIME) */
13
- contentType: string;
14
- /** Size in bytes */
15
- size: number;
16
- /**
17
- * Its state when the list answers: active while its content is live (a
18
- * spark a recipient is reading included), ash once a recipient read or
19
- * answered it or its content was recalled (past its expiry too), expired
20
- * past its expiry and never burned, deleted once its owner deleted it
21
- * (never reported ash)
22
- */
23
- status: 'active' | 'ash' | 'expired' | 'deleted';
24
- /** Creation timestamp (Unix seconds) */
25
- createdAt: number;
26
- /** Expiry timestamp (Unix seconds) */
27
- expiresAt: number;
28
- /**
29
- * When it turned ash (Unix seconds); null for every other status, deleted
30
- * included, though a delete burns the content too
31
- */
32
- burnedAt: number | null;
33
- /** Seconds remaining until expiry */
34
- timeRemaining: number;
35
- /** Optional file name (for file payloads) */
36
- filename?: string;
37
- /** Optional kindling family ID */
38
- kindling?: string;
39
- /**
40
- * Its x.sv link, while it has one: a link spark (contentType text/uri-list)
41
- * from its create, any other spark from its share until it is unshared. A
42
- * deleted spark keeps the link it had, which opens nothing.
43
- */
44
- linkUrl?: string;
45
- }
46
- /** The decrypted spark, returned by get (reading burns it). */
47
- export interface Spark {
48
- /** Spark ID */
49
- id: string;
50
- /** Decrypted payload (text, or base64 for binary content types) */
51
- payload: string;
52
- /** Content type (MIME) */
53
- contentType: string;
54
- /** Size in bytes */
55
- size: number;
56
- /** Lifecycle status after the read (ash) */
57
- status: string;
58
- /** Creation timestamp (Unix seconds) */
59
- createdAt: number;
60
- /** Burn timestamp (Unix seconds) */
61
- burnedAt: number;
62
- /** Optional file name (for file payloads) */
63
- filename?: string;
64
- /**
65
- * The name the payload saves under: `filename`, or `download` for a spark
66
- * with none, kept as it is when the first word of the extension it shows
67
- * (up to an ASCII space, in any case) is one the MIME registry knows or
68
- * holds a character none of the registry's extensions is spelled with,
69
- * which may draw as one, and otherwise completed with the extension
70
- * `contentType`'s files are named with (the first the registry lists for
71
- * it, or, for the few types whose first is not the one desktops name their
72
- * files with, the one they do: `.mp3` for `audio/mpeg`, `.mov` for
73
- * `video/quicktime`), never one a saved copy must never open as. Save a
74
- * copy under it, handed to a browser as
75
- * `application/octet-stream` unless `contentType` is a raster image, audio,
76
- * video or PDF format (never SVG, a playlist or a stream redirector): a
77
- * browser renames a saved copy by the type it is handed (Chrome saves
78
- * `Invoice` typed `application/x-msdownload` as `Invoice.exe`), and
79
- * completes or replaces no extension of a copy handed as
80
- * `application/octet-stream`.
81
- */
82
- downloadFilename: string;
83
- }
84
- /** A newly created spark. */
85
- export interface CreatedSpark {
86
- /** Spark ID */
87
- id: string;
88
- /** Size in bytes */
89
- size: number;
90
- /** Lifecycle status (active) */
91
- status: string;
92
- /** Creation timestamp (Unix seconds) */
93
- createdAt: number;
94
- /** Expiry timestamp (Unix seconds) */
95
- expiresAt: number;
96
- /** Time-to-live in minutes */
97
- ttlMinutes: number;
98
- /** Optional file name (echoed when provided) */
99
- filename?: string;
100
- /** Optional kindling family ID (echoed when provided) */
101
- kindling?: string;
102
- /**
103
- * A link spark (contentType text/uri-list) only: its x.sv link, which opens
104
- * once and redirects to the payload's URL. It is minted with the spark.
105
- */
106
- linkUrl?: string;
107
- /** A link spark only: the code in linkUrl */
108
- linkCode?: string;
109
- }
110
- /** Options for list. */
111
- export interface ListSparksOptions {
112
- /** Filter to a kindling family */
113
- kindling?: string;
114
- /**
115
- * Filter by status, matching each listed spark's `status`: `active` lists
116
- * the sparks whose content is live (not burned, not past its expiry; a spark
117
- * mid-read included), `ash` those a recipient read, recalled or answered (a
118
- * spark its owner deleted is `deleted`, in neither). The API refuses any
119
- * other value.
120
- */
121
- status?: 'active' | 'ash';
122
- /** Page size */
123
- limit?: number;
124
- /** Pagination cursor */
125
- cursor?: string;
126
- }
127
- /** A page of sparks. */
128
- export interface SparkPage {
129
- /** Sparks on this page */
130
- sparks: SparkSummary[];
131
- /** Cursor for the next page, when more results exist */
132
- nextCursor?: string;
133
- }
134
- /** Options for create. */
135
- export interface CreateSparkOptions {
136
- /** Payload (text, or base64 for binary content types) */
137
- payload: string;
138
- /** Content type (MIME). Defaults to text/plain. */
139
- contentType?: string;
140
- /**
141
- * Time-to-live: a whole number of minutes from 1 to 1440 (24h). Defaults to
142
- * 1440. A fraction is refused with a `ValidationError`.
143
- */
144
- ttlMinutes?: number;
145
- /** Join an existing kindling family by ID */
146
- kindling?: string;
147
- /** Generate a new kindling family for this spark */
148
- withKindling?: boolean;
149
- /** Optional file name (for file payloads) */
150
- filename?: string;
151
- }
152
- /** Visibility mode for a shared spark. */
153
- export type SparkVisibility = 'public' | 'authenticated' | 'invite_only';
154
- /**
155
- * Options for share. A spark already shared keeps its link: the settings are
156
- * applied to it in place, and its code never changes.
157
- */
158
- export interface ShareSparkOptions {
159
- /**
160
- * Visibility mode: public on a spark's first share; an omitted visibility
161
- * keeps the link's current one.
162
- */
163
- visibility?: SparkVisibility;
164
- /**
165
- * The identity (an email address or a phone number) invited to an
166
- * invite_only link: exactly one, which the link is delivered to. Refused
167
- * with any other visibility. An omitted list keeps the link's current
168
- * invitee.
169
- */
170
- invites?: string[];
171
- /**
172
- * Link lifetime in seconds, from 60, capped at the spark's own expiry.
173
- * Applies to a spark's first share only: a change to an existing link keeps
174
- * its lifetime.
175
- */
176
- expiresInSeconds?: number;
177
- /**
178
- * The link this change was asked of (its `linkCode`, as a share answered
179
- * it). When it is no longer the spark's link (turned off, or replaced by
180
- * another share), the change is refused with a 409 CONFLICT and changes
181
- * nothing. Omitted, the change applies to the spark's link now.
182
- */
183
- linkCode?: string;
184
- }
185
- /**
186
- * Options for resendInvite and unshare, which act on a spark's existing link.
187
- */
188
- export interface SparkLinkActionOptions {
189
- /**
190
- * The link this request was asked of (its `linkCode`, as a share answered
191
- * it). A resend asked of a link that is no longer the spark's link (turned
192
- * off, or replaced by another share) is refused with a 409 CONFLICT,
193
- * delivering nothing. An unshare is refused only when another share
194
- * replaced the link, deleting nothing; a link already turned off answers
195
- * `shared: false`, so a retried unshare is never refused. Omitted, the
196
- * request acts on the spark's link now.
197
- */
198
- linkCode?: string;
199
- }
200
- /** The result of sharing a spark. */
201
- export interface SparkShare {
202
- /** Whether the spark is shared */
203
- shared: boolean;
204
- /** Public share URL (x.sv link) */
205
- shareUrl?: string;
206
- /** Short link code */
207
- linkCode?: string;
208
- /** Visibility mode */
209
- visibility?: SparkVisibility;
210
- /** Invited identities */
211
- invites?: string[];
212
- /**
213
- * The link's status: active; consumed once it was opened (it opens once);
214
- * or expired once a link never opened opens nothing: from its `expiresAt`
215
- * on, or once its spark is burned (read by its id) or reaches its own
216
- * expiry. A change or a resend is then refused (403 FORBIDDEN).
217
- */
218
- status?: 'active' | 'consumed' | 'expired';
219
- /** Link expiry timestamp (Unix seconds) */
220
- expiresAt?: number;
221
- /** Link creation timestamp (Unix seconds) */
222
- createdAt?: number;
223
- /**
224
- * The invitees this share delivered the link to (share only): none for a
225
- * share that invites no one new. An invitee already on the link is sent it
226
- * again by resendInvite.
227
- */
228
- deliveredTo?: string[];
229
- /**
230
- * True when the spark was already shared, so the share applied its
231
- * settings to the existing link in place (share only)
232
- */
233
- alreadyShared?: boolean;
234
- }
235
- /** An invitation delivered again, as resendInvite answers it. */
236
- export interface SparkInviteResend {
237
- /** Spark ID */
238
- sparkId: string;
239
- /** The invitee the link was delivered to */
240
- identity: string;
241
- /** How it was delivered: by email or by SMS */
242
- identityType: 'email' | 'phone';
243
- /** Delivery timestamp (Unix seconds) */
244
- sentAt: number;
245
- }
246
- export interface SparkSummaryWire {
247
- spark_id: string;
248
- content_type?: string;
249
- size_bytes: number;
250
- status: SparkSummary['status'];
251
- created_at: number;
252
- expires_at: number;
253
- burned_at?: number | null;
254
- time_remaining?: number;
255
- filename?: string;
256
- kindling?: string;
257
- link_url?: string;
258
- }
259
- export interface ListSparksResponse {
260
- sparks: SparkSummaryWire[];
261
- next_cursor?: string;
262
- }
263
- export interface SparkResponse {
264
- spark_id: string;
265
- payload: string;
266
- content_type?: string;
267
- size_bytes: number;
268
- status: string;
269
- created_at: number;
270
- burned_at: number;
271
- filename?: string;
272
- download_filename: string;
273
- }
274
- export interface CreateSparkResponse {
275
- spark_id: string;
276
- size_bytes: number;
277
- status: string;
278
- created_at: number;
279
- expires_at: number;
280
- ttl_minutes: number;
281
- filename?: string;
282
- kindling?: string;
283
- link_url?: string;
284
- link_code?: string;
285
- }
286
- export interface SparkShareResponse {
287
- shared: boolean;
288
- share_url?: string;
289
- link_code?: string;
290
- visibility?: SparkVisibility;
291
- invites?: string[];
292
- status?: 'active' | 'consumed' | 'expired';
293
- expires_at?: number;
294
- created_at?: number;
295
- delivered_to?: string[];
296
- already_shared?: boolean;
297
- }
298
- export interface SparkInviteResendResponse {
299
- resent: boolean;
300
- spark_id: string;
301
- identity: string;
302
- identity_type: 'email' | 'phone';
303
- sent_at: number;
304
- }
@@ -1,16 +0,0 @@
1
- /**
2
- * Chrome pieces both SDK widgets draw the same way.
3
- */
4
- /**
5
- * The "Secured by SparkVault" footer. The link reads in the surrounding text's
6
- * colour, set inline so a host page's link styles cannot restyle it.
7
- *
8
- * @param classPrefix - The widget's CSS class prefix (`sv`, `svu`)
9
- */
10
- export declare function createSecuredByFooter(classPrefix: string): HTMLDivElement;
11
- /**
12
- * The logo for a theme: the variant drawn for it, else the other one.
13
- *
14
- * @returns The logo URL, or null when the branding has none
15
- */
16
- export declare function pickLogo(dark: boolean, lightLogo: string | null, darkLogo: string | null): string | null;
@@ -1,59 +0,0 @@
1
- /**
2
- * Design-system values for the SDK's widgets.
3
- *
4
- * The identity dialog and the vault upload widget are product-register
5
- * SparkVault surfaces, so they paint with the design system's palette
6
- * (packages/design-system/tokens): Action Blue for interaction on slate
7
- * neutrals. The published bundle cannot read those CSS files, so the values
8
- * the widgets use are mirrored here, each naming the token it mirrors.
9
- * tests/ds-tokens.test.ts holds every value to the design system's own, and
10
- * refuses a hex color anywhere else in the SDK's source and an rgba() whose
11
- * color is not the design system's. The sign-in providers' marks keep their
12
- * owners' colors, which live in @sparkvault/app-sdk/brand-marks.
13
- */
14
- /** The design-system token each mirrored value is. */
15
- export declare const DS_TOKEN_SOURCES: Readonly<{
16
- readonly white: "--color-white";
17
- readonly slate50: "--color-slate-50";
18
- readonly slate100: "--color-slate-100";
19
- readonly slate200: "--color-slate-200";
20
- readonly slate300: "--color-slate-300";
21
- readonly slate500: "--color-slate-500";
22
- readonly slate600: "--color-slate-600";
23
- readonly slate900: "--color-slate-900";
24
- readonly slate950: "--color-slate-950";
25
- readonly action: "--color-action";
26
- readonly actionHover: "--color-action-hover";
27
- readonly actionBg: "--color-action-bg";
28
- readonly btnDanger: "--color-btn-danger";
29
- readonly btnDangerHover: "--color-btn-danger-hover";
30
- readonly success: "--color-success";
31
- readonly success500: "--color-success-500";
32
- readonly error: "--color-error";
33
- readonly error500: "--color-error-500";
34
- readonly errorBg: "--color-error-bg";
35
- readonly errorText: "--color-error-text";
36
- readonly warning: "--color-warning";
37
- readonly warning500: "--color-warning-500";
38
- readonly infoBg: "--color-info-bg";
39
- readonly info500: "--color-info-500";
40
- readonly modalOverlay: "--color-modal-overlay";
41
- readonly darkText: "--dark-text";
42
- readonly darkTextMuted: "--dark-text-muted";
43
- readonly darkHairline: "--dark-hairline";
44
- readonly darkCard: "--dark-card";
45
- readonly shadowSm: "--shadow-sm";
46
- readonly shadowMd: "--shadow-md";
47
- readonly shadowPopover: "--shadow-popover";
48
- }>;
49
- export type DsToken = keyof typeof DS_TOKEN_SOURCES;
50
- /** The design system's values for {@link DS_TOKEN_SOURCES}. */
51
- export declare const DS: Readonly<Record<DsToken, string>>;
52
- /**
53
- * A design-system color at an opacity.
54
- *
55
- * @param hex - A six-digit `#rrggbb` value from {@link DS}
56
- * @param alpha - Opacity, 0 to 1
57
- * @returns The color as `rgba(r, g, b, alpha)`
58
- */
59
- export declare function withAlpha(hex: string, alpha: number): string;
@@ -1,19 +0,0 @@
1
- /**
2
- * Inline shell shared by the SDK's widgets (identity and upload): the surface
3
- * a widget renders into when it is embedded in a host page element instead of
4
- * opened as a dialog. It takes the target over (clearing what it held), holds a
5
- * body for the widget's views and an optional footer, and leaves the target
6
- * empty when destroyed.
7
- */
8
- export interface InlineShellOptions {
9
- containerClassName: string;
10
- bodyClassName: string;
11
- /** The footer to show under the body, or null for none. */
12
- footer: HTMLElement | null;
13
- }
14
- export declare class InlineShell {
15
- readonly container: HTMLDivElement;
16
- readonly body: HTMLDivElement;
17
- constructor(target: HTMLElement, options: InlineShellOptions);
18
- destroy(): void;
19
- }
@@ -1,15 +0,0 @@
1
- export interface LiveRegion {
2
- /** The region, empty until it announces; the caller places it, styled by its class. */
3
- readonly element: HTMLDivElement;
4
- /** Say `words` a moment from now, in place of any still waiting; empty words clear the region at once. */
5
- announce(words: string): void;
6
- /** Drop any words still waiting and remove the region. */
7
- destroy(): void;
8
- }
9
- /**
10
- * A polite status region for words said as a view changes. It is placed
11
- * empty and kept, and every announcement waits a moment, so the words never
12
- * land in the same change as the region or the view that holds them: a
13
- * region created with its words already in it is often never announced.
14
- */
15
- export declare function createLiveRegion(className: string): LiveRegion;
@@ -1,67 +0,0 @@
1
- /**
2
- * Modal shell shared by the SDK's widgets (identity, upload and the help desk
3
- * form).
4
- *
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.
27
- */
28
- export interface ModalShellOptions {
29
- /** id of the overlay element. */
30
- overlayId: string;
31
- /** id of the dialog element inside the overlay. */
32
- modalId: string;
33
- /** The widget's CSS class prefix: `${prefix}-overlay`, `${prefix}-blur`, `${prefix}-modal`. */
34
- classPrefix: string;
35
- /** id of the element that titles the dialog (aria-labelledby). */
36
- titleId: string;
37
- backdropBlur: boolean;
38
- /** Called on a press and release on the backdrop, or on Escape while this shell is on top. */
39
- onDismiss: () => void;
40
- }
41
- export declare class ModalShell {
42
- readonly overlay: HTMLDivElement;
43
- readonly modal: HTMLDivElement;
44
- private readonly opener;
45
- private readonly onOverlayPointerDown;
46
- private readonly onOverlayClick;
47
- private readonly onKeydown;
48
- private pressOnBackdrop;
49
- private open;
50
- constructor(options: ModalShellOptions);
51
- /** Remove the dialog, release the scroll lock, and return focus to the opener. */
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;
67
- }
@@ -1,6 +0,0 @@
1
- /**
2
- * The element a widget renders into when embedded: a CSS selector or an element.
3
- *
4
- * @throws ValidationError when the selector matches nothing, or the target is neither
5
- */
6
- export declare function resolveTarget(target: string | HTMLElement): HTMLElement;
@@ -1,26 +0,0 @@
1
- /**
2
- * DOM Utilities
3
- *
4
- * Shared utilities for DOM operations.
5
- */
6
- /**
7
- * Execute a callback when the DOM is ready.
8
- * If DOM is already ready, executes immediately.
9
- * Otherwise, waits for DOMContentLoaded.
10
- */
11
- export declare function onDomReady(callback: () => void): void;
12
- /**
13
- * Attach a click handler to every element matching `selector`: both elements
14
- * present once the DOM is ready and elements added later (observed via
15
- * MutationObserver).
16
- *
17
- * Each call is fully self-contained: the element bookkeeping lives in this
18
- * closure, so the returned cleanup removes only the listeners this call
19
- * registered. Multiple attachments (different selectors, or even the same
20
- * element attached twice) never interfere with one another.
21
- *
22
- * @param selector - CSS selector for elements to attach to
23
- * @param onClick - Click handler to register on every matching element
24
- * @returns Cleanup function that removes this call's listeners and observer
25
- */
26
- export declare function attachClickHandler(selector: string, onClick: (event: Event) => void): () => void;
@@ -1,2 +0,0 @@
1
- import type { ResolvedConfig } from './config';
2
- export declare function publishVaultSessionTiming(config: ResolvedConfig, vat: string | undefined, response: Response, requestStartedAtMs: number): void;