calmlens 0.24.0 → 0.26.1

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 (84) hide show
  1. package/README.md +14 -14
  2. package/bin/calmlens.js +2202 -521
  3. package/cjs/{BrowserUpload-DB-G4tjH.js → BrowserUpload-DdkcoZLH.js} +1 -1
  4. package/{esm/BrowserUpload-nyagMGlJ.d.ts → cjs/BrowserUpload-zYWKtFSs.d.ts} +2 -2
  5. package/cjs/{CalmLensAppClient-CmikPp9x.js → CalmLensAppClient-Gu9mU_66.js} +22 -15
  6. package/{esm/CalmLensAppClient-8qOu4bIX.d.ts → cjs/CalmLensAppClient-mTTjqpRc.d.ts} +5 -11
  7. package/cjs/{CalmLensOptionKeys-BbMF4k44.js → CalmLensOptionKeys-BCITGsr9.js} +138 -90
  8. package/cjs/CalmLensServerClient-D5-njsNk.d.ts +357 -0
  9. package/cjs/{CalmLensServerClient-DJyULgDN.js → CalmLensServerClient-DHmAPT1u.js} +283 -303
  10. package/cjs/{CalmLensTypes-D3eKASff.d.ts → CalmLensTypes-Df8eBgWB.d.ts} +228 -59
  11. package/cjs/{Core-dsHfSHt3.d.ts → Core-CREGGR0L.d.ts} +10 -3
  12. package/cjs/{Core-DnXZJjWN.js → Core-DAf9lqe2.js} +30 -12
  13. package/{esm/ModerationContextLimits-BFILRYw_.js → cjs/ModerationContextLimits-D4iwqoN_.js} +858 -28
  14. package/cjs/{ReactUpload-DWnJElAd.js → ReactUpload-BNIbpxIH.js} +38 -2
  15. package/cjs/ReactUpload-D4htIz8X.d.ts +27 -0
  16. package/cjs/{UploadController-CEHCQar2.js → UploadController-B_lKxvpM.js} +16 -3
  17. package/cjs/{WebhookPayload-DiBh-W7_.d.ts → WebhookPayload-DMa6ihHr.d.ts} +152 -3
  18. package/cjs/app.d.ts +5 -5
  19. package/cjs/app.js +20 -2
  20. package/cjs/elements.d.ts +5 -5
  21. package/cjs/elements.js +102 -67
  22. package/{esm/index-L7S6-AX8.d.ts → cjs/index-CtpQldn_.d.ts} +2 -2
  23. package/cjs/index.d.ts +4 -4
  24. package/cjs/index.js +19 -1
  25. package/cjs/react-native.d.ts +3 -3
  26. package/cjs/react-native.js +6 -4
  27. package/cjs/react.d.ts +5 -4
  28. package/cjs/react.js +10 -14
  29. package/cjs/server.d.ts +5 -5
  30. package/cjs/server.js +20 -2
  31. package/cjs/testing.d.ts +11 -9
  32. package/cjs/testing.js +73 -41
  33. package/cjs/{ui-DJPSG8nD.d.ts → ui-BwFPFrno.d.ts} +2 -2
  34. package/cjs/{ui-DjX32iuB.js → ui-CvlJmRYM.js} +6 -4
  35. package/cjs/ui.d.ts +3 -3
  36. package/cjs/ui.js +4 -3
  37. package/cjs/vue.d.ts +15 -8
  38. package/cjs/vue.js +29 -16
  39. package/esm/{BrowserUpload-B9IJOAOn.js → BrowserUpload-BAWYEBd7.js} +1 -1
  40. package/{cjs/BrowserUpload-nyagMGlJ.d.ts → esm/BrowserUpload-zYWKtFSs.d.ts} +2 -2
  41. package/esm/{CalmLensAppClient-DKDX61Ip.js → CalmLensAppClient-DNkIZb6x.js} +22 -15
  42. package/{cjs/CalmLensAppClient-8qOu4bIX.d.ts → esm/CalmLensAppClient-mTTjqpRc.d.ts} +5 -11
  43. package/esm/{CalmLensOptionKeys-CEX6GvWi.js → CalmLensOptionKeys-CYHJo3nV.js} +133 -91
  44. package/esm/{CalmLensServerClient-DM147w2r.js → CalmLensServerClient-B1AiR4nv.js} +283 -303
  45. package/esm/CalmLensServerClient-D5-njsNk.d.ts +357 -0
  46. package/esm/{CalmLensTypes-D3eKASff.d.ts → CalmLensTypes-Df8eBgWB.d.ts} +228 -59
  47. package/esm/{Core-dsHfSHt3.d.ts → Core-CREGGR0L.d.ts} +10 -3
  48. package/esm/{Core-ix7mc07M.js → Core-xNBQxZWH.js} +30 -12
  49. package/{cjs/ModerationContextLimits-CPNFkp0P.js → esm/ModerationContextLimits-DxuPP4uM.js} +475 -285
  50. package/esm/{ReactUpload-CW1v2fmH.js → ReactUpload-BWifQdLv.js} +34 -4
  51. package/esm/ReactUpload-D4htIz8X.d.ts +27 -0
  52. package/esm/{UploadController-4wdF7tKa.js → UploadController-jlJdddyI.js} +11 -4
  53. package/esm/{WebhookPayload-DiBh-W7_.d.ts → WebhookPayload-DMa6ihHr.d.ts} +152 -3
  54. package/esm/app.d.ts +5 -5
  55. package/esm/app.js +3 -3
  56. package/esm/elements.d.ts +5 -5
  57. package/esm/elements.js +102 -68
  58. package/{cjs/index-L7S6-AX8.d.ts → esm/index-CtpQldn_.d.ts} +2 -2
  59. package/esm/index.d.ts +4 -4
  60. package/esm/index.js +1 -1
  61. package/esm/react-native.d.ts +3 -3
  62. package/esm/react-native.js +5 -5
  63. package/esm/react.d.ts +5 -4
  64. package/esm/react.js +9 -15
  65. package/esm/server.d.ts +5 -5
  66. package/esm/server.js +3 -3
  67. package/esm/styles.css +28 -10
  68. package/esm/svelte/CalmLensUploader.svelte +17 -17
  69. package/esm/svelte/context.js +21 -0
  70. package/esm/svelte/index.d.ts +12 -0
  71. package/esm/svelte/index.js +1 -0
  72. package/esm/testing.d.ts +11 -9
  73. package/esm/testing.js +73 -41
  74. package/esm/{ui-eVZ1gGuL.js → ui-BXzzqh7M.js} +6 -4
  75. package/esm/{ui-DJPSG8nD.d.ts → ui-BwFPFrno.d.ts} +2 -2
  76. package/esm/ui.d.ts +3 -3
  77. package/esm/ui.js +4 -4
  78. package/esm/vue.d.ts +15 -8
  79. package/esm/vue.js +29 -18
  80. package/package.json +16 -6
  81. package/cjs/CalmLensServerClient-CDhey01B.d.ts +0 -353
  82. package/cjs/ReactUpload-B_zmKB9X.d.ts +0 -17
  83. package/esm/CalmLensServerClient-CDhey01B.d.ts +0 -353
  84. package/esm/ReactUpload-B_zmKB9X.d.ts +0 -17
@@ -1,6 +1,35 @@
1
- import { n as createUploadController } from "./UploadController-4wdF7tKa.js";
2
- import { useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
1
+ import { i as withProvidedOptions, n as createUploadController } from "./UploadController-jlJdddyI.js";
2
+ import { createContext, createElement, useContext, useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
3
3
  // src/ui/ReactUpload.ts
4
+ const CalmLensContext = createContext(void 0);
5
+ /**
6
+ * Gives every `CalmLensUploader` and `useCalmLensUpload` beneath it these upload options, such as
7
+ * `uploadPresetId` and `tokenUrl`, so they needn't be passed to each one. An option a component
8
+ * sets itself wins. A provider inside another adds to the outer one's options.
9
+ */
10
+ function CalmLensProvider({ children, ...options }) {
11
+ const outer = useContext(CalmLensContext);
12
+ const { uploadPresetId, token, tokenUrl, baseUrl, createClient, upload, checkStatus } = options;
13
+ const value = useMemo(() => withProvidedOptions(outer, {
14
+ uploadPresetId,
15
+ token,
16
+ tokenUrl,
17
+ baseUrl,
18
+ createClient,
19
+ upload,
20
+ checkStatus
21
+ }), [
22
+ outer,
23
+ uploadPresetId,
24
+ token,
25
+ tokenUrl,
26
+ baseUrl,
27
+ createClient,
28
+ upload,
29
+ checkStatus
30
+ ]);
31
+ return createElement(CalmLensContext.Provider, { value }, children);
32
+ }
4
33
  /** Re-renders with a controller's snapshot. */
5
34
  const useUploadSnapshot = (controller) => {
6
35
  const snapshot = useSyncExternalStore(controller.subscribe, controller.getSnapshot, controller.getSnapshot);
@@ -16,7 +45,8 @@ const useUploadSnapshot = (controller) => {
16
45
  }), [snapshot, controller]);
17
46
  };
18
47
  /** A controller this component owns: it takes the latest options and cancels on unmount. */
19
- const useOwnController = (options, active = true) => {
48
+ const useOwnController = (own, active = true) => {
49
+ const options = withProvidedOptions(useContext(CalmLensContext), own);
20
50
  const [controller] = useState(() => createUploadController(options));
21
51
  if (active) controller.setOptions(options);
22
52
  const pendingClear = useRef(void 0);
@@ -34,4 +64,4 @@ const useOwnController = (options, active = true) => {
34
64
  * the component unmounts are cancelled.
35
65
  */
36
66
  const useCalmLensUpload = (options) => useUploadSnapshot(useOwnController(options));
37
- export { useOwnController as n, useUploadSnapshot as r, useCalmLensUpload as t };
67
+ export { useUploadSnapshot as i, useCalmLensUpload as n, useOwnController as r, CalmLensProvider as t };
@@ -0,0 +1,27 @@
1
+ import { F as UploadFile, L as UploadSnapshot, N as UploadController, O as CalmLensProvidedOptions, P as UploadControllerOptions } from "./Core-CREGGR0L.js";
2
+ import { ReactNode } from "react";
3
+ type CalmLensProviderProps<F extends UploadFile = File> = CalmLensProvidedOptions<F> & {
4
+ children?: ReactNode;
5
+ };
6
+ /**
7
+ * Gives every `CalmLensUploader` and `useCalmLensUpload` beneath it these upload options, such as
8
+ * `uploadPresetId` and `tokenUrl`, so they needn't be passed to each one. An option a component
9
+ * sets itself wins. A provider inside another adds to the outer one's options.
10
+ */
11
+ declare function CalmLensProvider<F extends UploadFile = File>({ children, ...options }: CalmLensProviderProps<F>): import("react").FunctionComponentElement<import("react").ProviderProps<CalmLensProvidedOptions<any> | undefined>>;
12
+ interface UseCalmLensUploadResult<F extends UploadFile = UploadFile> extends UploadSnapshot<F> {
13
+ controller: UploadController<F>;
14
+ addFiles: UploadController<F>["addFiles"];
15
+ retry: UploadController<F>["retry"];
16
+ cancel: UploadController<F>["cancel"];
17
+ remove: UploadController<F>["remove"];
18
+ clear: UploadController<F>["clear"];
19
+ start: UploadController<F>["start"];
20
+ }
21
+ /**
22
+ * Uploads files through an upload preset and re-renders as each one uploads and is checked. Use
23
+ * it to build your own upload UI; `CalmLensUploader` is built on it. Uploads still running when
24
+ * the component unmounts are cancelled.
25
+ */
26
+ declare const useCalmLensUpload: <F extends UploadFile = UploadFile>(options: UploadControllerOptions<F>) => UseCalmLensUploadResult<F>;
27
+ export { useCalmLensUpload as i, CalmLensProviderProps as n, UseCalmLensUploadResult as r, CalmLensProvider as t };
@@ -1,5 +1,5 @@
1
- import { R as CalmLensError, z as SDK_ERROR_CODES } from "./ModerationContextLimits-BFILRYw_.js";
2
- import { t as CalmLensAppClient } from "./CalmLensAppClient-DKDX61Ip.js";
1
+ import { Y as CalmLensError, ot as SDK_ERROR_CODES } from "./ModerationContextLimits-DxuPP4uM.js";
2
+ import { t as CalmLensAppClient } from "./CalmLensAppClient-DNkIZb6x.js";
3
3
  // src/contract/PlaceholderHashDecode.js
4
4
  /**
5
5
  * Decodes a ThumbHash to an RGBA image. RGB is not be premultiplied by A.
@@ -319,7 +319,7 @@ const checkedCustomUpload = (id, status) => ({
319
319
  */
320
320
  const checkedPresetUpload = ({ id, classification }) => ({
321
321
  id,
322
- status: classification.moderation?.status,
322
+ status: classification.moderation ? classification.moderation.decision ?? "pending" : void 0,
323
323
  settled: classification.status === "completed" || classification.status === "failed",
324
324
  failed: classification.status === "failed"
325
325
  });
@@ -618,4 +618,11 @@ var UploadController = class {
618
618
  }
619
619
  };
620
620
  const createUploadController = (options) => new UploadController(options);
621
- export { placeholderHashToDataURL as a, createProgressFetch as i, createUploadController as n, isFileAccepted as r, UploadController as t };
621
+ /** `options` over what a provider gives: an option an uploader sets (not `undefined`) wins. */
622
+ const withProvidedOptions = (provided, options) => {
623
+ if (!provided) return options;
624
+ const merged = { ...provided };
625
+ for (const [key, value] of Object.entries(options)) if (value !== void 0) merged[key] = value;
626
+ return merged;
627
+ };
628
+ export { createProgressFetch as a, withProvidedOptions as i, createUploadController as n, placeholderHashToDataURL as o, isFileAccepted as r, UploadController as t };
@@ -1,4 +1,4 @@
1
- import { gn as TypedEvent, hn as EventAsset, mn as Actor } from "./CalmLensTypes-D3eKASff.js";
1
+ import { cn as Actor, ln as EventAsset, un as TypedEvent } from "./CalmLensTypes-Df8eBgWB.js";
2
2
  import * as zod from "zod";
3
3
  /** Error codes the CalmLens API documents, by name. */
4
4
  declare const API_ERROR_CODES: {
@@ -312,7 +312,14 @@ interface CalmLensErrorOptions {
312
312
  headers?: Headers;
313
313
  /** Seconds to wait before retrying, from the `Retry-After` response header. */
314
314
  retryAfter?: number;
315
+ /** The response body as text, cut to its first 4 KiB, for API errors. */
316
+ body?: string;
315
317
  }
318
+ /**
319
+ * What went wrong, from the most general: every kind is also its parent kind (`not-found` is an
320
+ * `api` error, `configuration` an `invalid-argument` error). Each has its own error class.
321
+ */
322
+ type CalmLensErrorKind = "error" | "api" | "bad-request" | "authentication" | "permission-denied" | "not-found" | "conflict" | "payload-too-large" | "unprocessable-entity" | "rate-limit" | "server" | "connection" | "timeout" | "cancelled" | "invalid-argument" | "configuration" | "invalid-response" | "webhook-verification";
316
323
  /**
317
324
  * Every failure the SDK reports, whether the API returned an error or the request never
318
325
  * completed. Branch on `code`; `status`, `requestId`, `headers` and `retryAfter` describe the
@@ -322,6 +329,12 @@ interface CalmLensErrorOptions {
322
329
  * from any copy of the SDK, so they work when ESM and CommonJS builds are loaded side by side.
323
330
  */
324
331
  declare class CalmLensError extends Error {
332
+ /** The kind this class is for; each kind's class sets its own. */
333
+ static readonly kind: CalmLensErrorKind;
334
+ /** What went wrong: one of `CalmLensErrorKind`, also its ancestors' (see `isKind`). */
335
+ readonly kind: CalmLensErrorKind;
336
+ /** The response body as text, cut to its first 4 KiB, for an API error; a proxy's HTML stays visible. */
337
+ readonly body?: string;
325
338
  /** A stable identifier such as `asset/not-found` or `sdk/timeout`. */
326
339
  readonly code: CalmLensErrorCode | (string & {});
327
340
  /** The HTTP status, when the API responded. */
@@ -340,7 +353,15 @@ declare class CalmLensError extends Error {
340
353
  }, options?: CalmLensErrorOptions);
341
354
  /** True for any `CalmLensError`, including one created by another copy or build of the SDK. */
342
355
  static isCalmLensError(value: unknown): value is CalmLensError;
343
- static [Symbol.hasInstance](value: unknown): boolean;
356
+ /**
357
+ * `error instanceof CalmLensNotFoundError` (or any kind's class) is true for errors of that kind
358
+ * and its descendants, from any copy of the SDK.
359
+ */
360
+ static [Symbol.hasInstance](this: {
361
+ kind: CalmLensErrorKind;
362
+ }, value: unknown): boolean;
363
+ /** Whether this error is of `kind` or a kind beneath it, such as `api` for a `not-found` error. */
364
+ isKind(kind: CalmLensErrorKind): boolean;
344
365
  /**
345
366
  * Whether the SDK raised this error itself, with no HTTP response: before sending (an invalid
346
367
  * argument or option, or content it checks first, such as `upload/unsupported-type`), or because
@@ -358,6 +379,134 @@ declare class CalmLensError extends Error {
358
379
  */
359
380
  isRetryable(): boolean;
360
381
  }
382
+ /** The API, or a proxy in front of it, answered with a non-2xx status. */
383
+ declare class CalmLensApiError extends CalmLensError {
384
+ static readonly kind: CalmLensErrorKind;
385
+ }
386
+ /** HTTP 400: the request was invalid. */
387
+ declare class CalmLensBadRequestError extends CalmLensApiError {
388
+ static readonly kind: CalmLensErrorKind;
389
+ }
390
+ /** HTTP 401: the API key is missing or invalid. */
391
+ declare class CalmLensAuthenticationError extends CalmLensApiError {
392
+ static readonly kind: CalmLensErrorKind;
393
+ }
394
+ /** HTTP 403: the API key lacks a grant, or the viewer can't see the asset. */
395
+ declare class CalmLensPermissionDeniedError extends CalmLensApiError {
396
+ static readonly kind: CalmLensErrorKind;
397
+ }
398
+ /** HTTP 404: the resource doesn't exist or isn't visible to the API key. */
399
+ declare class CalmLensNotFoundError extends CalmLensApiError {
400
+ static readonly kind: CalmLensErrorKind;
401
+ }
402
+ /** HTTP 409: the request conflicts with the resource's state, such as a changed revision. */
403
+ declare class CalmLensConflictError extends CalmLensApiError {
404
+ static readonly kind: CalmLensErrorKind;
405
+ }
406
+ /** HTTP 413: the content is over a size limit. */
407
+ declare class CalmLensPayloadTooLargeError extends CalmLensApiError {
408
+ static readonly kind: CalmLensErrorKind;
409
+ }
410
+ /** HTTP 422: the content can't be processed. */
411
+ declare class CalmLensUnprocessableEntityError extends CalmLensApiError {
412
+ static readonly kind: CalmLensErrorKind;
413
+ }
414
+ /** HTTP 429: too many requests; `retryAfter` says how long to wait. */
415
+ declare class CalmLensRateLimitError extends CalmLensApiError {
416
+ static readonly kind: CalmLensErrorKind;
417
+ }
418
+ /** HTTP 500 or above: the API failed. */
419
+ declare class CalmLensServerError extends CalmLensApiError {
420
+ static readonly kind: CalmLensErrorKind;
421
+ }
422
+ /** No complete response: the connection failed or was cut (`sdk/transport-error`). */
423
+ declare class CalmLensConnectionError extends CalmLensError {
424
+ static readonly kind: CalmLensErrorKind;
425
+ }
426
+ /** A request took longer than its timeout, or a wait reached its deadline (`sdk/timeout`). */
427
+ declare class CalmLensTimeoutError extends CalmLensError {
428
+ static readonly kind: CalmLensErrorKind;
429
+ }
430
+ /** The caller cancelled the call through a signal (`sdk/cancelled`). */
431
+ declare class CalmLensCancelledError extends CalmLensError {
432
+ static readonly kind: CalmLensErrorKind;
433
+ }
434
+ /** The SDK refused the call before sending anything. */
435
+ declare class CalmLensInvalidArgumentError extends CalmLensError {
436
+ static readonly kind: CalmLensErrorKind;
437
+ }
438
+ /** The client's configuration is invalid (`sdk/invalid-config`, `sdk/no-fetch`). */
439
+ declare class CalmLensConfigurationError extends CalmLensInvalidArgumentError {
440
+ static readonly kind: CalmLensErrorKind;
441
+ }
442
+ /** A response wasn't what the operation returns (`sdk/invalid-response`, `sdk/response-too-large`). */
443
+ declare class CalmLensInvalidResponseError extends CalmLensError {
444
+ static readonly kind: CalmLensErrorKind;
445
+ }
446
+ /** A webhook delivery couldn't be verified or parsed. */
447
+ declare class CalmLensWebhookVerificationError extends CalmLensError {
448
+ static readonly kind: CalmLensErrorKind;
449
+ }
450
+ /** The HTTP response a successful call's result came from. */
451
+ interface CalmLensLastResponse {
452
+ /** The HTTP status, such as 200 or 201. */
453
+ readonly status: number;
454
+ /** The `x-request-id` header: quote it when you contact support about this request. */
455
+ readonly requestId?: string;
456
+ /** The response headers. */
457
+ readonly headers: Headers;
458
+ /** The `Idempotency-Key` the request was sent with, if any. */
459
+ readonly idempotencyKey?: string;
460
+ }
461
+ /**
462
+ * A call's result with the response it came from as `lastResponse`. `lastResponse` is not
463
+ * enumerable, so `JSON.stringify`, spreading and `Object.keys` leave it out.
464
+ */
465
+ type CalmLensResponse<T> = T & {
466
+ readonly lastResponse: CalmLensLastResponse;
467
+ };
468
+ /** The most items `autoPagingToArray` collects; iterate with `for await` for more. */
469
+ declare const AUTO_PAGING_TO_ARRAY_MAX = 10000;
470
+ interface AutoPagingToArrayOptions {
471
+ /** How many items to collect at most, from 1 to 10,000. */
472
+ limit: number;
473
+ }
474
+ /** The fields every cursor-paginated list response has. */
475
+ interface CursorPageData<Item> {
476
+ items: Item[];
477
+ nextCursor: string | null;
478
+ hasMore: boolean;
479
+ }
480
+ /** Walking from a page: every item of it and of the pages after it. */
481
+ interface AutoPaging<Item> extends AsyncIterable<Item> {
482
+ /** Collects items from this page onward, fetching pages as needed, until `limit` are found. */
483
+ autoPagingToArray(options: AutoPagingToArrayOptions): Promise<Item[]>;
484
+ }
485
+ /**
486
+ * One page of a list, as the API returned it, with page navigation. `for await` over the page
487
+ * yields its items and every item after them, fetching pages as needed.
488
+ */
489
+ type ListPage<Page extends CursorPageData<unknown>> = CalmLensResponse<Page> & AutoPaging<Page["items"][number]> & {
490
+ /** Whether a page follows this one. */
491
+ hasNextPage(): boolean;
492
+ /** Fetches the page after this one; fails with `sdk/invalid-argument` when there is none. */
493
+ getNextPage(): ListPromise<Page>;
494
+ };
495
+ /**
496
+ * What `list` methods return: await it for the first page, or `for await` over it for every item
497
+ * across pages. The cursor keeps the position stable when items are inserted or deleted.
498
+ */
499
+ interface ListPromise<Page extends CursorPageData<unknown>> extends Promise<ListPage<Page>>, AutoPaging<Page["items"][number]> {}
500
+ /** Pixel dimensions of the representation served by the CDN. */
501
+ interface ServedAssetInfo {
502
+ readonly width: number;
503
+ readonly height: number;
504
+ }
505
+ interface CdnResponse extends Response {
506
+ /** Reads the served image dimensions from the headers without consuming the body. */
507
+ getAssetInfo(): ServedAssetInfo | undefined;
508
+ clone(): CdnResponse;
509
+ }
361
510
  /** A webhook body; narrow on `type` to get typed `facts`. */
362
511
  type WebhookEventPayload = TypedEvent;
363
512
  /** Consumer boundary: future event types, facts and fields must not break installed clients. */
@@ -409,4 +558,4 @@ interface ReceivedWebhookEventPayload {
409
558
  facts?: ReceivedFact;
410
559
  [key: string]: unknown;
411
560
  }
412
- export { CalmLensErrorCode as a, SdkErrorCode as c, CalmLensError as i, ApiErrorCode as l, WebhookEventPayload as n, CalmLensErrorDetails as o, CALMLENS_ERROR_CODES as r, CalmLensErrorOptions as s, ReceivedWebhookEventPayload as t };
561
+ export { CalmLensRateLimitError as A, CalmLensErrorKind as C, CalmLensNotFoundError as D, CalmLensInvalidResponseError as E, SdkErrorCode as F, ApiErrorCode as I, CalmLensTimeoutError as M, CalmLensUnprocessableEntityError as N, CalmLensPayloadTooLargeError as O, CalmLensWebhookVerificationError as P, CalmLensErrorDetails as S, CalmLensInvalidArgumentError as T, CalmLensConfigurationError as _, AUTO_PAGING_TO_ARRAY_MAX as a, CalmLensError as b, CalmLensLastResponse as c, ListPromise as d, CALMLENS_ERROR_CODES as f, CalmLensCancelledError as g, CalmLensBadRequestError as h, ServedAssetInfo as i, CalmLensServerError as j, CalmLensPermissionDeniedError as k, CalmLensResponse as l, CalmLensAuthenticationError as m, WebhookEventPayload as n, AutoPaging as o, CalmLensApiError as p, CdnResponse as r, AutoPagingToArrayOptions as s, ReceivedWebhookEventPayload as t, ListPage as u, CalmLensConflictError as v, CalmLensErrorOptions as w, CalmLensErrorCode as x, CalmLensConnectionError as y };
package/esm/app.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { a as ClassificationNotEvaluatedReason, c as ModerationQualifier, d as HashListEntry, f as ModerationContext, g as selectModerationContextItems, h as ModerationContextItem, i as ClassificationCategoryReport, l as PolicyAction, m as MODERATION_CONTEXT_USED_ITEMS, n as ClassificationCategories, o as ClassificationQualifierResults, p as MODERATION_CONTEXT_USED_CHARACTERS, r as ClassificationCategory, s as Likelihood, u as HashList } from "./Classification-CxRedzgH-C9qlYW_J.js";
2
- import { $ as GetAssetInfoOptions, $n as MetadataItem, $t as UpgradePolicyOptions, A as CdnAssetReference, An as BoundingBox, At as MultipartUploadOptions, B as CreateMultipartUploadPartOptions, Bn as AssetSearchMatchField, Bt as SetPolicyAutomaticUpdatesOptions, C as AssetVisibility, Ct as ListHashListEntriesOptions, D as CalmLensAppClientOptions, Dn as PublicProjectSettings, Dt as ListUploadPresetsOptions, E as BatchAssetsResponse, En as ProjectSettingsResource, Et as ListPoliciesOptions, F as ClassifyTextOptions, Fn as ProcessingFeatureStage, Ft as RequestOptions, G as EnsureLensOptions, Gn as AssetHlsRendition, Gt as StreamingFeatureOptions, H as DecideAssetOptions, Ht as SignUploadTokenOptions, I as ConnectionOptions, In as ProcessingFeatures, It as ResetPolicyOptions, J as EnsureUploadPresetsOptions, Jn as AssetRenderedKind, Jt as UpdateFolderOptions, K as EnsureLensesOptions, Kn as AssetPreview, Kt as SubmitAssetOptions, L as CreateFolderOptions, Ln as Policy, Lt as RetrieveAssetOptions, M as CdnResource, Mn as DetectedPerson, Mt as PolicyIdOptions, N as CdnServeOptions, Nn as ProcessingFeatureId, Nt as PolicyPage, O as CalmLensServerClientOptions, On as UploadPreset, Ot as MoveAssetOptions, P as CdnTransform, Pn as ProcessingFeatureResults, Pt as RemoveAssetContentOptions, Q as FolderPage, Qn as FileMetadata, Qt as UpdateProjectSettingsOptions, R as CreateHashListOptions, Rn as CursorPage, Rt as RetryAssetOptions, S as AssetUploadStatus, Sn as EventType, St as ListFoldersOptions, T as BatchAssetsOptions, Tn as MetadataFieldsResource, Tt as ListLensesOptions, U as DeleteAssetOptions, Un as AssetInfo, Ut as SignedAssetUrl, V as CreatePolicyOptions, Vn as AssetSearchQuery, Vt as SignAssetUrlOptions, W as DeleteMetadataFieldOptions, Wn as AssetHls, Wt as SignedUploadToken, X as ExplainAssetOptions, Xn as AssetSafetyHoldReason, Xt as UpdateLensOptions, Y as EnsureUploadPresetsResponse, Yn as AssetSafetyHold, Yt as UpdateHashListOptions, Z as FolderIdOptions, Zn as ExtractedText, Zt as UpdatePolicyOptions, _ as AssetSearchResponse, _n as EventCategory, _t as LensPage, a as AssetChildrenPage, an as UploadedAsset, at as ImageTransformOptions, b as AssetType, bn as EventFacts, bt as ListAssetsOptions, c as AssetClassificationStatus, cn as WaitForAssetDecisionOptions, ct as IterateAssetsOptions, d as AssetContentRemovalReason, dn as AssetBatchOperation, dt as IterateHashListsOptions, en as UploadAssetPartOptions, er as ProcessingOptions, et as HashListEntryIdOptions, f as AssetContentStatus, fn as AssetTimelineSegment, ft as IterateLensesOptions, g as AssetPage, gn as TypedEvent, gt as LensIdOptions, h as AssetModerationStatus, hn as EventAsset, ht as Lens, i as AssetChecksums, in as UploadPresetSubmitAssetOptions, it as IdempotencyOptions, j as CdnAssetUrlOptions, jn as DetectedFace, jt as MultipartUploadPartOptions, k as CdnAssetLocation, kn as AgeRange, kt as MoveFolderOptions, l as AssetContent, ln as WebhookHeadersInput, lt as IterateFoldersOptions, m as AssetModerationDecision, mt as IterateUploadPresetsOptions, n as Asset, nn as UploadPresetIdOptions, nt as HashListIdOptions, o as AssetClassification, on as VerifyWebhookSignatureOptions, ot as IterateAssetChildrenOptions, p as AssetModeration, pn as GetEventsResponse, pt as IteratePoliciesOptions, q as EnsureMetadataFieldsOptions, qn as AssetRendered, qt as UpdateAssetOptions, r as AssetAvailability, rn as UploadPresetPage, rt as HashListPage, s as AssetClassificationFailureReason, sn as ViewerClaims, st as IterateAssetTimelineOptions, t as AddHashListEntryOptions, tn as UploadPresetDefinition, tt as HashListEntryPage, u as AssetContentOptions, un as WebhookPayloadInput, ut as IterateHashListEntriesOptions, v as AssetSearchResult, vn as EventFact, vt as ListAssetChildrenOptions, w as AssignPolicyOptions, wn as Folder, wt as ListHashListsOptions, x as AssetUpload, xn as EventSeverity, xt as ListEventsOptions, y as AssetTimelinePage, yn as EventFactValues, yt as ListAssetTimelineOptions, z as CreateLensOptions, zn as LensType, zt as SearchAssetsOptions } from "./CalmLensTypes-D3eKASff.js";
3
- import { t as CalmLensAppClient } from "./CalmLensAppClient-8qOu4bIX.js";
4
- import { i as getAssetInfo, n as DEFAULT_CDN_BASE_URL, r as CDN_RESOURCES, t as SDK_VERSION } from "./index-L7S6-AX8.js";
5
- import { a as CalmLensErrorCode, c as SdkErrorCode, i as CalmLensError, l as ApiErrorCode, o as CalmLensErrorDetails, r as CALMLENS_ERROR_CODES, s as CalmLensErrorOptions, t as ReceivedWebhookEventPayload } from "./WebhookPayload-DiBh-W7_.js";
6
- export { type AddHashListEntryOptions, type AgeRange, type ApiErrorCode, type Asset, type AssetAvailability, type AssetBatchOperation, type AssetChecksums, type AssetChildrenPage, type AssetClassification, type AssetClassificationFailureReason, type AssetClassificationStatus, type AssetContent, type AssetContentOptions, type AssetContentRemovalReason, type AssetContentStatus, type AssetHls, type AssetHlsRendition, type AssetInfo, type AssetModeration, type AssetModerationDecision, type AssetModerationStatus, type AssetPage, type AssetPreview, type AssetRendered, type AssetRenderedKind, type AssetSafetyHold, type AssetSafetyHoldReason, type AssetSearchMatchField, type AssetSearchQuery, type AssetSearchResponse, type AssetSearchResult, type AssetTimelinePage, type AssetTimelineSegment, type AssetType, type AssetUpload, type AssetUploadStatus, type AssetVisibility, type AssignPolicyOptions, type BatchAssetsOptions, type BatchAssetsResponse, type BoundingBox, CALMLENS_ERROR_CODES, CDN_RESOURCES, CalmLensAppClient, type CalmLensAppClientOptions, CalmLensError, type CalmLensErrorCode, type CalmLensErrorDetails, type CalmLensErrorOptions, type CalmLensServerClientOptions, type CdnAssetLocation, type CdnAssetReference, type CdnAssetUrlOptions, type CdnResource, type CdnServeOptions, type CdnTransform, type ClassificationCategories, type ClassificationCategory, type ClassificationCategoryReport, type ClassificationNotEvaluatedReason, type ClassificationQualifierResults, type ClassifyTextOptions, type ConnectionOptions, type CreateFolderOptions, type CreateHashListOptions, type CreateLensOptions, type CreateMultipartUploadPartOptions, type CreatePolicyOptions, type CursorPage, DEFAULT_CDN_BASE_URL, type DecideAssetOptions, type DeleteAssetOptions, type DeleteMetadataFieldOptions, type DetectedFace, type DetectedPerson, type EnsureLensOptions, type EnsureLensesOptions, type EnsureMetadataFieldsOptions, type EnsureUploadPresetsOptions, type EnsureUploadPresetsResponse, type EventAsset, type EventCategory, type EventFact, type EventFactValues, type EventFacts, type EventSeverity, type EventType, type GetEventsResponse as EventsPage, type ExplainAssetOptions, type ExtractedText, type FileMetadata, type Folder, type FolderIdOptions, type FolderPage, type GetAssetInfoOptions, type HashList, type HashListEntry, type HashListEntryIdOptions, type HashListEntryPage, type HashListIdOptions, type HashListPage, type IdempotencyOptions, type ImageTransformOptions, type IterateAssetChildrenOptions, type IterateAssetTimelineOptions, type IterateAssetsOptions, type IterateFoldersOptions, type IterateHashListEntriesOptions, type IterateHashListsOptions, type IterateLensesOptions, type IteratePoliciesOptions, type IterateUploadPresetsOptions, type Lens, type LensIdOptions, type LensPage, type LensType, type Likelihood, type ListAssetChildrenOptions, type ListAssetTimelineOptions, type ListAssetsOptions, type ListEventsOptions, type ListFoldersOptions, type ListHashListEntriesOptions, type ListHashListsOptions, type ListLensesOptions, type ListPoliciesOptions, type ListUploadPresetsOptions, MODERATION_CONTEXT_USED_CHARACTERS, MODERATION_CONTEXT_USED_ITEMS, type MetadataFieldsResource, type MetadataItem, type ModerationContext, type ModerationContextItem, type ModerationQualifier, type MoveAssetOptions, type MoveFolderOptions, type MultipartUploadOptions, type MultipartUploadPartOptions, type Policy, type PolicyAction, type PolicyIdOptions, type PolicyPage, type ProcessingFeatureId, type ProcessingFeatureResults, type ProcessingFeatureStage, type ProcessingFeatures, type ProcessingOptions, type ProjectSettingsResource, type PublicProjectSettings, type RemoveAssetContentOptions, type RequestOptions, type ResetPolicyOptions, type RetrieveAssetOptions, type RetryAssetOptions, SDK_VERSION, type SdkErrorCode, type SearchAssetsOptions, type SetPolicyAutomaticUpdatesOptions, type SignAssetUrlOptions, type SignUploadTokenOptions, type SignedAssetUrl, type SignedUploadToken, type StreamingFeatureOptions, type SubmitAssetOptions, type TypedEvent, type UpdateAssetOptions, type UpdateFolderOptions, type UpdateHashListOptions, type UpdateLensOptions, type UpdatePolicyOptions, type UpdateProjectSettingsOptions, type UpgradePolicyOptions, type UploadAssetPartOptions, type UploadPreset, type UploadPresetDefinition, type UploadPresetIdOptions, type UploadPresetPage, type UploadPresetSubmitAssetOptions, type UploadedAsset, type VerifyWebhookSignatureOptions, type ViewerClaims, type WaitForAssetDecisionOptions, type ReceivedWebhookEventPayload as WebhookEventPayload, type WebhookHeadersInput, type WebhookPayloadInput, getAssetInfo, selectModerationContextItems };
2
+ import { $ as FolderIdOptions, $t as UploadedAsset, A as CdnAssetLocation, An as ProcessingFeatures, At as ResetPolicyOptions, B as CreateHashListOptions, Bn as AssetPreview, Bt as SubmitAssetOptions, C as AssetUploadStatus, Cn as AgeRange, Ct as MultipartUploadOptions, D as BatchAssetsResponse, Dn as ProcessingFeatureId, Dt as RemoveAssetContentOptions, E as BatchAssetsOptions, En as DetectedPerson, Et as PolicyPage, F as CdnTransform, Fn as AssetSearchQuery, Ft as SignAssetUrlOptions, G as DeleteAssetOptions, Gn as ExtractedText, Gt as UpdatePolicyOptions, H as CreateMultipartUploadPartOptions, Hn as AssetRenderedKind, Ht as UpdateFolderOptions, I as ClassifyTextOptions, It as SignUploadTokenOptions, J as EnsureLensesOptions, Jn as ProcessingOptions, Jt as UploadAssetPartOptions, K as DeleteMetadataFieldOptions, Kn as FileMetadata, Kt as UpdateProjectSettingsOptions, L as ClientRequestDefaults, Ln as AssetInfo, Lt as SignedAssetUrl, M as CdnAssetUrlOptions, Mn as CursorPage, Mt as RetryAssetOptions, N as CdnResource, Nn as LensType, Nt as SearchAssetsOptions, O as CalmLensAppClientOptions, On as ProcessingFeatureResults, Ot as RequestAttempt, P as CdnServeOptions, Pn as AssetSearchMatchField, Pt as SetPolicyAutomaticUpdatesOptions, Q as ExplainAssetOptions, Qt as UploadPresetSubmitAssetOptions, R as ConnectionOptions, Rn as AssetHls, Rt as SignedUploadToken, S as AssetUpload, Sn as UploadPreset, St as MoveFolderOptions, T as AssignPolicyOptions, Tn as DetectedFace, Tt as PolicyIdOptions, U as CreatePolicyOptions, Un as AssetSafetyHold, Ut as UpdateHashListOptions, V as CreateLensOptions, Vn as AssetRendered, Vt as UpdateAssetOptions, W as DecideAssetOptions, Wn as AssetSafetyHoldReason, Wt as UpdateLensOptions, X as EnsureUploadPresetsOptions, Xt as UploadPresetIdOptions, Y as EnsureMetadataFieldsOptions, Yt as UploadPresetDefinition, Z as EnsureUploadPresetsResponse, Zt as UploadPresetPage, _ as AssetPage, _t as ListHashListsOptions, a as AssetChecksums, an as AssetBatchOperation, at as HashListPage, b as AssetTimelinePage, bn as ProjectSettingsResource, bt as ListUploadPresetsOptions, c as AssetClassificationFailureReason, ct as Lens, d as AssetContentOptions, dn as EventCategory, dt as ListAssetChildrenOptions, en as VerifyWebhookSignatureOptions, et as FolderPage, f as AssetContentRemovalReason, fn as EventFact, ft as ListAssetTimelineOptions, g as AssetModerationStatus, gn as EventType, gt as ListHashListEntriesOptions, h as AssetModerationDecision, hn as EventSeverity, ht as ListFoldersOptions, i as AssetAvailability, in as WebhookPayloadInput, it as HashListIdOptions, j as CdnAssetReference, jn as Policy, jt as RetrieveAssetOptions, k as CalmLensServerClientOptions, kn as ProcessingFeatureStage, kt as RequestOptions, l as AssetClassificationStatus, ln as EventAsset, lt as LensIdOptions, m as AssetModeration, mn as EventFacts, mt as ListEventsOptions, n as AppInfo, nn as WaitForAssetDecisionOptions, nt as HashListEntryIdOptions, o as AssetChildrenPage, on as AssetTimelineSegment, ot as IdempotencyOptions, p as AssetContentStatus, pn as EventFactValues, pt as ListAssetsOptions, q as EnsureLensOptions, qn as MetadataItem, qt as UpgradePolicyOptions, r as Asset, rn as WebhookHeadersInput, rt as HashListEntryPage, s as AssetClassification, sn as GetEventsResponse, st as ImageTransformOptions, t as AddHashListEntryOptions, tn as ViewerClaims, tt as GetAssetInfoOptions, u as AssetContent, un as TypedEvent, ut as LensPage, v as AssetSearchResponse, vn as Folder, vt as ListLensesOptions, w as AssetVisibility, wn as BoundingBox, wt as MultipartUploadPartOptions, x as AssetType, xn as PublicProjectSettings, xt as MoveAssetOptions, y as AssetSearchResult, yn as MetadataFieldsResource, yt as ListPoliciesOptions, z as CreateFolderOptions, zn as AssetHlsRendition, zt as StreamingFeatureOptions } from "./CalmLensTypes-Df8eBgWB.js";
3
+ import { t as CalmLensAppClient } from "./CalmLensAppClient-mTTjqpRc.js";
4
+ import { i as getAssetInfo, n as DEFAULT_CDN_BASE_URL, r as CDN_RESOURCES, t as SDK_VERSION } from "./index-CtpQldn_.js";
5
+ import { A as CalmLensRateLimitError, C as CalmLensErrorKind, D as CalmLensNotFoundError, E as CalmLensInvalidResponseError, F as SdkErrorCode, I as ApiErrorCode, M as CalmLensTimeoutError, N as CalmLensUnprocessableEntityError, O as CalmLensPayloadTooLargeError, P as CalmLensWebhookVerificationError, S as CalmLensErrorDetails, T as CalmLensInvalidArgumentError, _ as CalmLensConfigurationError, a as AUTO_PAGING_TO_ARRAY_MAX, b as CalmLensError, c as CalmLensLastResponse, d as ListPromise, f as CALMLENS_ERROR_CODES, g as CalmLensCancelledError, h as CalmLensBadRequestError, i as ServedAssetInfo, j as CalmLensServerError, k as CalmLensPermissionDeniedError, l as CalmLensResponse, m as CalmLensAuthenticationError, o as AutoPaging, p as CalmLensApiError, r as CdnResponse, s as AutoPagingToArrayOptions, t as ReceivedWebhookEventPayload, u as ListPage, v as CalmLensConflictError, w as CalmLensErrorOptions, x as CalmLensErrorCode, y as CalmLensConnectionError } from "./WebhookPayload-DMa6ihHr.js";
6
+ export { AUTO_PAGING_TO_ARRAY_MAX, type AddHashListEntryOptions, type AgeRange, type ApiErrorCode, type AppInfo, type Asset, type AssetAvailability, type AssetBatchOperation, type AssetChecksums, type AssetChildrenPage, type AssetClassification, type AssetClassificationFailureReason, type AssetClassificationStatus, type AssetContent, type AssetContentOptions, type AssetContentRemovalReason, type AssetContentStatus, type AssetHls, type AssetHlsRendition, type AssetInfo, type AssetModeration, type AssetModerationDecision, type AssetModerationStatus, type AssetPage, type AssetPreview, type AssetRendered, type AssetRenderedKind, type AssetSafetyHold, type AssetSafetyHoldReason, type AssetSearchMatchField, type AssetSearchQuery, type AssetSearchResponse, type AssetSearchResult, type AssetTimelinePage, type AssetTimelineSegment, type AssetType, type AssetUpload, type AssetUploadStatus, type AssetVisibility, type AssignPolicyOptions, type AutoPaging, type AutoPagingToArrayOptions, type BatchAssetsOptions, type BatchAssetsResponse, type BoundingBox, CALMLENS_ERROR_CODES, CDN_RESOURCES, CalmLensApiError, CalmLensAppClient, type CalmLensAppClientOptions, CalmLensAuthenticationError, CalmLensBadRequestError, CalmLensCancelledError, CalmLensConfigurationError, CalmLensConflictError, CalmLensConnectionError, CalmLensError, type CalmLensErrorCode, type CalmLensErrorDetails, type CalmLensErrorKind, type CalmLensErrorOptions, CalmLensInvalidArgumentError, CalmLensInvalidResponseError, type CalmLensLastResponse, CalmLensNotFoundError, CalmLensPayloadTooLargeError, CalmLensPermissionDeniedError, CalmLensRateLimitError, type CalmLensResponse, type CalmLensServerClientOptions, CalmLensServerError, CalmLensTimeoutError, CalmLensUnprocessableEntityError, CalmLensWebhookVerificationError, type CdnAssetLocation, type CdnAssetReference, type CdnAssetUrlOptions, type CdnResource, type CdnResponse, type CdnServeOptions, type CdnTransform, type ClassificationCategories, type ClassificationCategory, type ClassificationCategoryReport, type ClassificationNotEvaluatedReason, type ClassificationQualifierResults, type ClassifyTextOptions, type ClientRequestDefaults, type ConnectionOptions, type CreateFolderOptions, type CreateHashListOptions, type CreateLensOptions, type CreateMultipartUploadPartOptions, type CreatePolicyOptions, type CursorPage, DEFAULT_CDN_BASE_URL, type DecideAssetOptions, type DeleteAssetOptions, type DeleteMetadataFieldOptions, type DetectedFace, type DetectedPerson, type EnsureLensOptions, type EnsureLensesOptions, type EnsureMetadataFieldsOptions, type EnsureUploadPresetsOptions, type EnsureUploadPresetsResponse, type EventAsset, type EventCategory, type EventFact, type EventFactValues, type EventFacts, type EventSeverity, type EventType, type GetEventsResponse as EventsPage, type ExplainAssetOptions, type ExtractedText, type FileMetadata, type Folder, type FolderIdOptions, type FolderPage, type GetAssetInfoOptions, type HashList, type HashListEntry, type HashListEntryIdOptions, type HashListEntryPage, type HashListIdOptions, type HashListPage, type IdempotencyOptions, type ImageTransformOptions, type Lens, type LensIdOptions, type LensPage, type LensType, type Likelihood, type ListAssetChildrenOptions, type ListAssetTimelineOptions, type ListAssetsOptions, type ListEventsOptions, type ListFoldersOptions, type ListHashListEntriesOptions, type ListHashListsOptions, type ListLensesOptions, type ListPage, type ListPoliciesOptions, type ListPromise, type ListUploadPresetsOptions, MODERATION_CONTEXT_USED_CHARACTERS, MODERATION_CONTEXT_USED_ITEMS, type MetadataFieldsResource, type MetadataItem, type ModerationContext, type ModerationContextItem, type ModerationQualifier, type MoveAssetOptions, type MoveFolderOptions, type MultipartUploadOptions, type MultipartUploadPartOptions, type Policy, type PolicyAction, type PolicyIdOptions, type PolicyPage, type ProcessingFeatureId, type ProcessingFeatureResults, type ProcessingFeatureStage, type ProcessingFeatures, type ProcessingOptions, type ProjectSettingsResource, type PublicProjectSettings, type RemoveAssetContentOptions, type RequestAttempt, type RequestOptions, type ResetPolicyOptions, type RetrieveAssetOptions, type RetryAssetOptions, SDK_VERSION, type SdkErrorCode, type SearchAssetsOptions, type ServedAssetInfo, type SetPolicyAutomaticUpdatesOptions, type SignAssetUrlOptions, type SignUploadTokenOptions, type SignedAssetUrl, type SignedUploadToken, type StreamingFeatureOptions, type SubmitAssetOptions, type TypedEvent, type UpdateAssetOptions, type UpdateFolderOptions, type UpdateHashListOptions, type UpdateLensOptions, type UpdatePolicyOptions, type UpdateProjectSettingsOptions, type UpgradePolicyOptions, type UploadAssetPartOptions, type UploadPreset, type UploadPresetDefinition, type UploadPresetIdOptions, type UploadPresetPage, type UploadPresetSubmitAssetOptions, type UploadedAsset, type VerifyWebhookSignatureOptions, type ViewerClaims, type WaitForAssetDecisionOptions, type ReceivedWebhookEventPayload as WebhookEventPayload, type WebhookHeadersInput, type WebhookPayloadInput, getAssetInfo, selectModerationContextItems };
package/esm/app.js CHANGED
@@ -1,4 +1,4 @@
1
- import { L as CALMLENS_ERROR_CODES, P as SDK_VERSION, R as CalmLensError, i as CDN_RESOURCES, n as MODERATION_CONTEXT_USED_ITEMS, r as selectModerationContextItems, s as getAssetInfo, t as MODERATION_CONTEXT_USED_CHARACTERS, u as DEFAULT_CDN_BASE_URL } from "./ModerationContextLimits-BFILRYw_.js";
1
+ import { $ as CalmLensPayloadTooLargeError, G as CalmLensCancelledError, H as CalmLensApiError, I as AUTO_PAGING_TO_ARRAY_MAX, J as CalmLensConnectionError, K as CalmLensConfigurationError, N as SDK_VERSION, Q as CalmLensNotFoundError, U as CalmLensAuthenticationError, V as CALMLENS_ERROR_CODES, W as CalmLensBadRequestError, X as CalmLensInvalidArgumentError, Y as CalmLensError, Z as CalmLensInvalidResponseError, at as CalmLensWebhookVerificationError, et as CalmLensPermissionDeniedError, i as CDN_RESOURCES, it as CalmLensUnprocessableEntityError, n as MODERATION_CONTEXT_USED_ITEMS, nt as CalmLensServerError, q as CalmLensConflictError, r as selectModerationContextItems, rt as CalmLensTimeoutError, s as getAssetInfo, t as MODERATION_CONTEXT_USED_CHARACTERS, tt as CalmLensRateLimitError, u as DEFAULT_CDN_BASE_URL } from "./ModerationContextLimits-DxuPP4uM.js";
2
2
  import "./index.js";
3
- import { t as CalmLensAppClient } from "./CalmLensAppClient-DKDX61Ip.js";
4
- export { CALMLENS_ERROR_CODES, CDN_RESOURCES, CalmLensAppClient, CalmLensError, DEFAULT_CDN_BASE_URL, MODERATION_CONTEXT_USED_CHARACTERS, MODERATION_CONTEXT_USED_ITEMS, SDK_VERSION, getAssetInfo, selectModerationContextItems };
3
+ import { t as CalmLensAppClient } from "./CalmLensAppClient-DNkIZb6x.js";
4
+ export { AUTO_PAGING_TO_ARRAY_MAX, CALMLENS_ERROR_CODES, CDN_RESOURCES, CalmLensApiError, CalmLensAppClient, CalmLensAuthenticationError, CalmLensBadRequestError, CalmLensCancelledError, CalmLensConfigurationError, CalmLensConflictError, CalmLensConnectionError, CalmLensError, CalmLensInvalidArgumentError, CalmLensInvalidResponseError, CalmLensNotFoundError, CalmLensPayloadTooLargeError, CalmLensPermissionDeniedError, CalmLensRateLimitError, CalmLensServerError, CalmLensTimeoutError, CalmLensUnprocessableEntityError, CalmLensWebhookVerificationError, DEFAULT_CDN_BASE_URL, MODERATION_CONTEXT_USED_CHARACTERS, MODERATION_CONTEXT_USED_ITEMS, SDK_VERSION, getAssetInfo, selectModerationContextItems };
package/esm/elements.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { r as AssetAvailability } from "./CalmLensTypes-D3eKASff.js";
2
- import { $ as getAssetViewKey, A as CustomUploadResult, B as AssetDisplay, C as formatMessage, D as resolveMessages, E as getUploadItemOutcome, G as AssetSession, H as AssetImageOptions, J as AssetVideoOptions, K as AssetSessionState, L as UploadStage, M as UploadController, P as UploadFile, Q as getAssetView, S as formatBytes, T as getUploadItemMessage, U as AssetImageSource, V as AssetDocumentOptions, W as AssetOptions, X as MediaPlayback, Y as AssetView, Z as getAssetAspectRatio, _ as DEFAULT_MESSAGES, _t as formatViewerMessage, a as ProgressFetchOptions, at as ImageViewerOptions, b as describeUploadItem, c as ICON_ATTRIBUTES, ct as TextViewerOptions, d as AssetDisplayOptions, dt as ViewerTextOptions, et as getPeakHeights, f as AssetEventHandlers, ft as WebsiteViewerOptions, g as CalmLensMessages, gt as ViewerMessages, ht as DEFAULT_VIEWER_MESSAGES, i as CALMLENS_STYLES, it as DocumentViewerOptions, j as UploadClient, k as CustomUploadContext, l as IconName, lt as ViewerAsset, m as UploaderDisplayOptions, mt as isSpreadsheetFormat, n as CalmLensTheme, nt as pickAssetSource, o as createProgressFetch, ot as PdfAssetOptions, p as AssetProps, pt as getAssetViewerKind, q as AssetSpreadsheetOptions, r as resolveTheme, rt as AssetViewerKind, s as ICONS, st as SpreadsheetViewerOptions, t as CALMLENS_THEME, tt as getPlayedPercent, u as ASSET_FILE_ICON_SIZE, ut as ViewerOptions, v as UploadItemView, vt as resolveViewerMessages, w as getDropzoneHint, x as describeUploader, y as UploaderView, z as isFileAccepted } from "./Core-dsHfSHt3.js";
3
- import { a as UploaderProps, i as UploadSnapshot, n as UploadControllerOptions, r as UploadItem, s as createUploadController, t as CalmLensUpload } from "./BrowserUpload-nyagMGlJ.js";
4
- import { C as ViewerState, S as AssetViewer, _ as spreadsheetColumnIndex, a as isMountedViewerKind, b as createWebsiteViewer, c as AssetViewerOptionsByKind, d as createTextViewer, f as SpreadsheetCell, g as parseSpreadsheetText, h as getSpreadsheetPage, i as getMountedViewerOptions, l as VIEWER_STYLES, m as SpreadsheetSheet, n as AssetViewerMount, o as ASSET_VIEWERS, p as SpreadsheetRow, r as MountedViewerKind, s as AssetViewerName, t as MediaStreamPlayer, u as createSpreadsheetViewer, v as loadPdfJs, x as createDocumentViewer, y as createImageViewer } from "./ui-DJPSG8nD.js";
1
+ import { i as AssetAvailability } from "./CalmLensTypes-Df8eBgWB.js";
2
+ import { $ as getAssetAspectRatio, A as CustomUploadContext, B as isFileAccepted, C as formatMessage, D as resolveMessages, E as getUploadItemOutcome, F as UploadFile, G as AssetImageSource, H as AssetDisplay, J as AssetSessionState, K as AssetOptions, M as UploadClient, N as UploadController, O as CalmLensProvidedOptions, Q as MediaPlayback, R as UploadStage, S as formatBytes, T as getUploadItemMessage, U as AssetDocumentOptions, V as withProvidedOptions, W as AssetImageOptions, X as AssetVideoOptions, Y as AssetSpreadsheetOptions, Z as AssetView, _ as DEFAULT_MESSAGES, _t as DEFAULT_VIEWER_MESSAGES, a as ProgressFetchOptions, at as AssetViewerKind, b as describeUploadItem, bt as resolveViewerMessages, c as ICON_ATTRIBUTES, ct as PdfAssetOptions, d as AssetDisplayOptions, dt as ViewerAsset, et as getAssetView, f as AssetEventHandlers, ft as ViewerOptions, g as CalmLensMessages, gt as isSpreadsheetFormat, ht as getAssetViewerKind, i as CALMLENS_STYLES, it as pickAssetSource, j as CustomUploadResult, l as IconName, lt as SpreadsheetViewerOptions, m as UploaderDisplayOptions, mt as WebsiteViewerOptions, n as CalmLensTheme, nt as getPeakHeights, o as createProgressFetch, ot as DocumentViewerOptions, p as AssetProps, pt as ViewerTextOptions, q as AssetSession, r as resolveTheme, rt as getPlayedPercent, s as ICONS, st as ImageViewerOptions, t as CALMLENS_THEME, tt as getAssetViewKey, u as ASSET_FILE_ICON_SIZE, ut as TextViewerOptions, v as UploadItemView, vt as ViewerMessages, w as getDropzoneHint, x as describeUploader, y as UploaderView, yt as formatViewerMessage } from "./Core-CREGGR0L.js";
3
+ import { a as UploaderProps, i as UploadSnapshot, n as UploadControllerOptions, r as UploadItem, s as createUploadController, t as CalmLensUpload } from "./BrowserUpload-zYWKtFSs.js";
4
+ import { C as ViewerState, S as AssetViewer, _ as spreadsheetColumnIndex, a as isMountedViewerKind, b as createWebsiteViewer, c as AssetViewerOptionsByKind, d as createTextViewer, f as SpreadsheetCell, g as parseSpreadsheetText, h as getSpreadsheetPage, i as getMountedViewerOptions, l as VIEWER_STYLES, m as SpreadsheetSheet, n as AssetViewerMount, o as ASSET_VIEWERS, p as SpreadsheetRow, r as MountedViewerKind, s as AssetViewerName, t as MediaStreamPlayer, u as createSpreadsheetViewer, v as loadPdfJs, x as createDocumentViewer, y as createImageViewer } from "./ui-BwFPFrno.js";
5
5
  declare const BaseElement$1: typeof HTMLElement;
6
6
  /**
7
7
  * An asset viewer element. Set the `src` attribute to the asset URL (public or signed) and the
@@ -186,4 +186,4 @@ declare global {
186
186
  "calmlens-timeupdate": CustomEvent<number>;
187
187
  }
188
188
  }
189
- export { ASSET_FILE_ICON_SIZE, ASSET_VIEWERS, type AssetDisplay, type AssetDisplayOptions, type AssetDocumentOptions, type AssetEventHandlers, type AssetImageOptions, type AssetImageSource, type AssetOptions, type AssetProps, AssetSession, type AssetSessionState, type AssetSpreadsheetOptions, type AssetVideoOptions, type AssetView, type AssetViewer, type AssetViewerKind, AssetViewerMount, AssetViewerName, AssetViewerOptionsByKind, CALMLENS_STYLES, CALMLENS_THEME, type CalmLensMessages, type CalmLensTheme, type CalmLensUpload, type CustomUploadContext, type CustomUploadResult, DEFAULT_MESSAGES, DEFAULT_VIEWER_MESSAGES, type DocumentViewerOptions, ICONS, ICON_ATTRIBUTES, type IconName, type ImageViewerOptions, type MediaPlayback, MediaStreamPlayer, type MountedViewerKind, type PdfAssetOptions, type ProgressFetchOptions, type SpreadsheetCell, type SpreadsheetRow, type SpreadsheetSheet, type SpreadsheetViewerOptions, type TextViewerOptions, type UploadClient, UploadController, type UploadControllerOptions, type UploadFile, type UploadItem, type UploadItemView, type UploadSnapshot, type UploadStage, type UploaderDisplayOptions, type UploaderProps, type UploaderView, VIEWER_STYLES, type ViewerAsset, type ViewerMessages, type ViewerOptions, type ViewerState, type ViewerTextOptions, type WebsiteViewerOptions, createDocumentViewer, createImageViewer, createProgressFetch, createSpreadsheetViewer, createTextViewer, createUploadController, createWebsiteViewer, describeUploadItem, describeUploader, formatBytes, formatMessage, formatViewerMessage, getAssetAspectRatio, getAssetView, getAssetViewKey, getAssetViewerKind, getDropzoneHint, getMountedViewerOptions, getPeakHeights, getPlayedPercent, getSpreadsheetPage, getUploadItemMessage, getUploadItemOutcome, isFileAccepted, isMountedViewerKind, isSpreadsheetFormat, loadPdfJs, parseSpreadsheetText, pickAssetSource, resolveMessages, resolveTheme, resolveViewerMessages, spreadsheetColumnIndex };
189
+ export { ASSET_FILE_ICON_SIZE, ASSET_VIEWERS, type AssetDisplay, type AssetDisplayOptions, type AssetDocumentOptions, type AssetEventHandlers, type AssetImageOptions, type AssetImageSource, type AssetOptions, type AssetProps, AssetSession, type AssetSessionState, type AssetSpreadsheetOptions, type AssetVideoOptions, type AssetView, type AssetViewer, type AssetViewerKind, AssetViewerMount, AssetViewerName, AssetViewerOptionsByKind, CALMLENS_STYLES, CALMLENS_THEME, type CalmLensMessages, type CalmLensProvidedOptions, type CalmLensTheme, type CalmLensUpload, type CustomUploadContext, type CustomUploadResult, DEFAULT_MESSAGES, DEFAULT_VIEWER_MESSAGES, type DocumentViewerOptions, ICONS, ICON_ATTRIBUTES, type IconName, type ImageViewerOptions, type MediaPlayback, MediaStreamPlayer, type MountedViewerKind, type PdfAssetOptions, type ProgressFetchOptions, type SpreadsheetCell, type SpreadsheetRow, type SpreadsheetSheet, type SpreadsheetViewerOptions, type TextViewerOptions, type UploadClient, UploadController, type UploadControllerOptions, type UploadFile, type UploadItem, type UploadItemView, type UploadSnapshot, type UploadStage, type UploaderDisplayOptions, type UploaderProps, type UploaderView, VIEWER_STYLES, type ViewerAsset, type ViewerMessages, type ViewerOptions, type ViewerState, type ViewerTextOptions, type WebsiteViewerOptions, createDocumentViewer, createImageViewer, createProgressFetch, createSpreadsheetViewer, createTextViewer, createUploadController, createWebsiteViewer, describeUploadItem, describeUploader, formatBytes, formatMessage, formatViewerMessage, getAssetAspectRatio, getAssetView, getAssetViewKey, getAssetViewerKind, getDropzoneHint, getMountedViewerOptions, getPeakHeights, getPlayedPercent, getSpreadsheetPage, getUploadItemMessage, getUploadItemOutcome, isFileAccepted, isMountedViewerKind, isSpreadsheetFormat, loadPdfJs, parseSpreadsheetText, pickAssetSource, resolveMessages, resolveTheme, resolveViewerMessages, spreadsheetColumnIndex, withProvidedOptions };
package/esm/elements.js CHANGED
@@ -1,8 +1,8 @@
1
- import { _ as loadPdfJs, a as ASSET_VIEWERS, c as getSpreadsheetPage, d as createImageViewer, f as createWebsiteViewer, g as resolveViewerMessages, h as formatViewerMessage, i as isMountedViewerKind, l as parseSpreadsheetText, m as DEFAULT_VIEWER_MESSAGES, n as AssetViewerMount, o as createSpreadsheetViewer, p as createDocumentViewer, r as getMountedViewerOptions, s as createTextViewer, t as MediaStreamPlayer, u as spreadsheetColumnIndex } from "./ui-eVZ1gGuL.js";
2
- import { i as createProgressFetch, n as createUploadController$1, r as isFileAccepted, t as UploadController } from "./UploadController-4wdF7tKa.js";
3
- import { C as CALMLENS_THEME, E as isSpreadsheetFormat, S as VIEWER_STYLES, T as getAssetViewerKind, _ as getAssetView, a as describeUploadItem, b as getPlayedPercent, c as formatMessage, d as getUploadItemOutcome, f as resolveMessages, g as getAssetAspectRatio, h as AssetSession, i as DEFAULT_MESSAGES, l as getDropzoneHint, m as ICON_ATTRIBUTES, o as describeUploader, p as ICONS, r as ASSET_FILE_ICON_SIZE, s as formatBytes, t as CALMLENS_STYLES, u as getUploadItemMessage, v as getAssetViewKey, w as resolveTheme, x as pickAssetSource, y as getPeakHeights } from "./Core-ix7mc07M.js";
1
+ import { _ as loadPdfJs, a as ASSET_VIEWERS, c as getSpreadsheetPage, d as createImageViewer, f as createWebsiteViewer, g as resolveViewerMessages, h as formatViewerMessage, i as isMountedViewerKind, l as parseSpreadsheetText, m as DEFAULT_VIEWER_MESSAGES, n as AssetViewerMount, o as createSpreadsheetViewer, p as createDocumentViewer, r as getMountedViewerOptions, s as createTextViewer, t as MediaStreamPlayer, u as spreadsheetColumnIndex } from "./ui-BXzzqh7M.js";
2
+ import { a as createProgressFetch, i as withProvidedOptions, n as createUploadController$1, r as isFileAccepted, t as UploadController } from "./UploadController-jlJdddyI.js";
3
+ import { C as CALMLENS_THEME, E as isSpreadsheetFormat, S as VIEWER_STYLES, T as getAssetViewerKind, _ as getAssetView, a as describeUploadItem, b as getPlayedPercent, c as formatMessage, d as getUploadItemOutcome, f as resolveMessages, g as getAssetAspectRatio, h as AssetSession, i as DEFAULT_MESSAGES, l as getDropzoneHint, m as ICON_ATTRIBUTES, o as describeUploader, p as ICONS, r as ASSET_FILE_ICON_SIZE, s as formatBytes, t as CALMLENS_STYLES, u as getUploadItemMessage, v as getAssetViewKey, w as resolveTheme, x as pickAssetSource, y as getPeakHeights } from "./Core-xNBQxZWH.js";
4
4
  import { c as renderFileIconSvg } from "./FileIcons-M6dzjFxd.js";
5
- import { t as createUploadController } from "./BrowserUpload-B9IJOAOn.js";
5
+ import { t as createUploadController } from "./BrowserUpload-BAWYEBd7.js";
6
6
  // src/viewers/Elements.ts
7
7
  const BaseElement$1 = typeof HTMLElement === "undefined" ? class {} : HTMLElement;
8
8
  const PROPERTIES = [
@@ -255,6 +255,7 @@ var CalmLensUploaderElement = class extends BaseElement {
255
255
  #unsubscribe;
256
256
  #dragging = false;
257
257
  #input;
258
+ #rows = /* @__PURE__ */ new Map();
258
259
  /** The upload token, or a function returning one per file, instead of `token-url`. */
259
260
  get token() {
260
261
  return this.#token;
@@ -430,6 +431,7 @@ var CalmLensUploaderElement = class extends BaseElement {
430
431
  const files = event.clipboardData?.files;
431
432
  if (!this.hasAttribute("disabled") && files?.length) this.controller.addFiles(files);
432
433
  });
434
+ this.#rows.clear();
433
435
  this.replaceChildren(zone, input, el("ul", {
434
436
  class: "calmlens-uploads",
435
437
  hidden: true
@@ -439,80 +441,112 @@ var CalmLensUploaderElement = class extends BaseElement {
439
441
  #openPicker() {
440
442
  if (!this.hasAttribute("disabled")) this.#input?.click();
441
443
  }
442
- #renderItems() {
443
- const list = this.querySelector(":scope > .calmlens-uploads");
444
- const zone = this.querySelector(":scope > .calmlens-dropzone");
445
- if (!list || !zone) return;
446
- const messages = resolveMessages(this.#messages);
447
- const snapshot = this.controller.getSnapshot();
448
- const { items } = snapshot;
449
- const view = describeUploader(snapshot, this.controller.options, messages);
450
- zone.hidden = !view.showDropzone;
451
- list.hidden = items.length === 0;
452
- const thumbnails = new Map([...list.querySelectorAll(".calmlens-upload")].map((row) => [row.dataset.key, row.querySelector(".calmlens-upload__thumb")]));
453
- const disabled = this.hasAttribute("disabled");
454
- list.replaceChildren(...items.map((item) => {
455
- const itemView = describeUploadItem(item, messages);
456
- const thumbnail = thumbnails.get(item.key) ?? (item.previewUrl ? el("img", {
457
- class: "calmlens-upload__thumb",
458
- src: item.previewUrl,
459
- alt: ""
460
- }) : fileThumbnail(itemView.fileIcon));
461
- const bar = el("div", { class: "calmlens-progress__bar" });
462
- if (itemView.progressPercent !== void 0) bar.style.width = `${itemView.progressPercent}%`;
463
- const chooseAnother = !view.showDropzone && el("button", {
464
- type: "button",
465
- class: "calmlens-button",
466
- "data-variant": "outline",
467
- "data-size": "small",
468
- disabled
469
- }, [messages.chooseAnother]);
470
- if (chooseAnother) chooseAnother.addEventListener("click", () => this.#openPicker());
471
- const retry = itemView.canRetry && el("button", {
472
- type: "button",
473
- class: "calmlens-icon-button",
474
- "aria-label": messages.retry,
475
- title: messages.retry
476
- }, [icon("retry")]);
477
- if (retry) retry.addEventListener("click", () => this.controller.retry(item.key));
478
- const remove = el("button", {
479
- type: "button",
480
- class: "calmlens-icon-button",
481
- "aria-label": itemView.removeLabel,
482
- title: itemView.removeLabel
483
- }, [icon("remove")]);
484
- remove.addEventListener("click", () => this.controller.remove(item.key));
485
- const row = el("li", {
444
+ #createRow(item, view) {
445
+ const thumbnail = item.previewUrl ? el("img", {
446
+ class: "calmlens-upload__thumb",
447
+ src: item.previewUrl,
448
+ alt: ""
449
+ }) : fileThumbnail(view.fileIcon);
450
+ const progress = el("progress", {
451
+ class: "calmlens-progress",
452
+ max: 100
453
+ });
454
+ const status = el("p", {
455
+ class: "calmlens-upload__message",
456
+ role: "status"
457
+ });
458
+ const chooseAnother = el("button", {
459
+ type: "button",
460
+ class: "calmlens-button",
461
+ "data-variant": "outline",
462
+ "data-size": "small"
463
+ });
464
+ chooseAnother.addEventListener("click", () => this.#openPicker());
465
+ const retry = el("button", {
466
+ type: "button",
467
+ class: "calmlens-icon-button"
468
+ }, [icon("retry")]);
469
+ retry.addEventListener("click", () => this.controller.retry(item.key));
470
+ const remove = el("button", {
471
+ type: "button",
472
+ class: "calmlens-icon-button"
473
+ }, [icon("remove")]);
474
+ remove.addEventListener("click", () => this.controller.remove(item.key));
475
+ return {
476
+ element: el("li", {
486
477
  class: "calmlens-upload",
487
- "data-stage": item.stage,
488
- "data-outcome": itemView.outcome
478
+ "data-key": item.key
489
479
  }, [
490
480
  thumbnail,
491
481
  el("div", { class: "calmlens-upload__body" }, [
492
482
  el("span", { class: "calmlens-upload__name" }, [item.file.name]),
493
- el("span", { class: "calmlens-upload__size" }, [itemView.size]),
494
- itemView.busy && el("div", {
495
- class: "calmlens-progress",
496
- role: "progressbar",
497
- "aria-label": itemView.message,
498
- "aria-valuemin": 0,
499
- "aria-valuemax": 100,
500
- "aria-valuenow": itemView.progressPercent
501
- }, [bar]),
502
- itemView.message && el("p", {
503
- class: "calmlens-upload__message",
504
- role: "status"
505
- }, [itemView.message])
483
+ el("span", { class: "calmlens-upload__size" }, [view.size]),
484
+ progress,
485
+ status
506
486
  ]),
507
487
  el("div", { class: "calmlens-upload__actions" }, [
508
488
  chooseAnother,
509
489
  retry,
510
490
  remove
511
491
  ])
512
- ]);
513
- row.dataset.key = item.key;
514
- return row;
515
- }));
492
+ ]),
493
+ progress,
494
+ status,
495
+ chooseAnother,
496
+ retry,
497
+ remove
498
+ };
499
+ }
500
+ #renderItems() {
501
+ const list = this.querySelector(":scope > .calmlens-uploads");
502
+ const zone = this.querySelector(":scope > .calmlens-dropzone");
503
+ if (!list || !zone) return;
504
+ const messages = resolveMessages(this.#messages);
505
+ const snapshot = this.controller.getSnapshot();
506
+ const view = describeUploader(snapshot, this.controller.options, messages);
507
+ const disabled = this.hasAttribute("disabled");
508
+ const active = this.ownerDocument.activeElement;
509
+ const focusIndex = [...this.#rows.values()].findIndex((row) => row.element.contains(active));
510
+ const pickerFocused = zone.contains(active);
511
+ zone.hidden = !view.showDropzone;
512
+ list.hidden = snapshot.items.length === 0;
513
+ const keys = new Set(snapshot.items.map((item) => item.key));
514
+ for (const [key, row] of this.#rows) {
515
+ if (keys.has(key)) continue;
516
+ row.element.remove();
517
+ this.#rows.delete(key);
518
+ }
519
+ for (const item of snapshot.items) {
520
+ const itemView = describeUploadItem(item, messages);
521
+ let row = this.#rows.get(item.key);
522
+ if (!row) {
523
+ row = this.#createRow(item, itemView);
524
+ this.#rows.set(item.key, row);
525
+ list.append(row.element);
526
+ }
527
+ row.element.dataset.stage = item.stage;
528
+ if (itemView.outcome) row.element.dataset.outcome = itemView.outcome;
529
+ else delete row.element.dataset.outcome;
530
+ row.progress.hidden = !itemView.busy;
531
+ row.progress.setAttribute("aria-label", itemView.message);
532
+ if (itemView.progressPercent === void 0) row.progress.removeAttribute("value");
533
+ else row.progress.value = itemView.progressPercent;
534
+ row.status.hidden = !itemView.message;
535
+ if (row.status.textContent !== itemView.message) row.status.textContent = itemView.message;
536
+ row.chooseAnother.hidden = view.showDropzone;
537
+ row.chooseAnother.disabled = disabled;
538
+ if (row.chooseAnother.textContent !== messages.chooseAnother) row.chooseAnother.textContent = messages.chooseAnother;
539
+ row.retry.hidden = !itemView.canRetry;
540
+ row.retry.setAttribute("aria-label", messages.retry);
541
+ row.retry.title = messages.retry;
542
+ row.remove.setAttribute("aria-label", itemView.removeLabel);
543
+ row.remove.title = itemView.removeLabel;
544
+ }
545
+ if (pickerFocused && zone.hidden) this.#rows.values().next().value?.chooseAnother.focus();
546
+ else if (focusIndex >= 0 && active instanceof HTMLButtonElement && (!list.contains(active) || active.hidden || active.disabled)) {
547
+ const rows = [...this.#rows.values()];
548
+ (rows[Math.min(focusIndex, rows.length - 1)]?.remove ?? zone.querySelector("button"))?.focus();
549
+ }
516
550
  }
517
551
  };
518
552
  /**
@@ -894,4 +928,4 @@ const defineCalmLensElements = () => {
894
928
  if (!customElements.get("calmlens-asset")) customElements.define("calmlens-asset", CalmLensAssetElement);
895
929
  };
896
930
  defineCalmLensElements();
897
- export { ASSET_FILE_ICON_SIZE, ASSET_VIEWERS, AssetSession, AssetViewerMount, CALMLENS_STYLES, CALMLENS_THEME, CalmLensAssetElement, CalmLensDocumentViewerElement, CalmLensImageViewerElement, CalmLensSpreadsheetViewerElement, CalmLensTextViewerElement, CalmLensUploaderElement, CalmLensWebsiteViewerElement, DEFAULT_MESSAGES, DEFAULT_VIEWER_MESSAGES, ICONS, ICON_ATTRIBUTES, MediaStreamPlayer, UploadController, VIEWER_STYLES, createDocumentViewer, createImageViewer, createProgressFetch, createSpreadsheetViewer, createTextViewer, createUploadController, createWebsiteViewer, defineCalmLensElements, defineCalmLensViewerElements, describeUploadItem, describeUploader, formatBytes, formatMessage, formatViewerMessage, getAssetAspectRatio, getAssetView, getAssetViewKey, getAssetViewerKind, getDropzoneHint, getMountedViewerOptions, getPeakHeights, getPlayedPercent, getSpreadsheetPage, getUploadItemMessage, getUploadItemOutcome, isFileAccepted, isMountedViewerKind, isSpreadsheetFormat, loadPdfJs, parseSpreadsheetText, pickAssetSource, resolveMessages, resolveTheme, resolveViewerMessages, spreadsheetColumnIndex };
931
+ export { ASSET_FILE_ICON_SIZE, ASSET_VIEWERS, AssetSession, AssetViewerMount, CALMLENS_STYLES, CALMLENS_THEME, CalmLensAssetElement, CalmLensDocumentViewerElement, CalmLensImageViewerElement, CalmLensSpreadsheetViewerElement, CalmLensTextViewerElement, CalmLensUploaderElement, CalmLensWebsiteViewerElement, DEFAULT_MESSAGES, DEFAULT_VIEWER_MESSAGES, ICONS, ICON_ATTRIBUTES, MediaStreamPlayer, UploadController, VIEWER_STYLES, createDocumentViewer, createImageViewer, createProgressFetch, createSpreadsheetViewer, createTextViewer, createUploadController, createWebsiteViewer, defineCalmLensElements, defineCalmLensViewerElements, describeUploadItem, describeUploader, formatBytes, formatMessage, formatViewerMessage, getAssetAspectRatio, getAssetView, getAssetViewKey, getAssetViewerKind, getDropzoneHint, getMountedViewerOptions, getPeakHeights, getPlayedPercent, getSpreadsheetPage, getUploadItemMessage, getUploadItemOutcome, isFileAccepted, isMountedViewerKind, isSpreadsheetFormat, loadPdfJs, parseSpreadsheetText, pickAssetSource, resolveMessages, resolveTheme, resolveViewerMessages, spreadsheetColumnIndex, withProvidedOptions };