calmlens 0.19.0 → 0.21.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 (108) hide show
  1. package/README.md +13 -9
  2. package/bin/calmlens.js +1646 -706
  3. package/cjs/{BrowserUpload-CJ4Xc9bR.js → BrowserUpload-CeSwiMo5.js} +1 -1
  4. package/{esm/BrowserUpload-RkxV_Vv7.d.ts → cjs/BrowserUpload-D-NnAN7g.d.ts} +2 -2
  5. package/cjs/{CalmLensAppClient-LHMEQ-UZ.js → CalmLensAppClient-0UVCuNqW.js} +30 -10
  6. package/cjs/{CalmLensAppClient-B5gfOB6J.d.ts → CalmLensAppClient-gG16T2py.d.ts} +13 -3
  7. package/cjs/{CalmLensOptionKeys-BUj7v5AG.js → CalmLensOptionKeys-CYY6elxg.js} +242 -345
  8. package/cjs/{CalmLensServerClient-DCSbwIBs.d.ts → CalmLensServerClient-BHx3x_nZ.d.ts} +107 -49
  9. package/cjs/{CalmLensServerClient-BVOEUT_v.js → CalmLensServerClient-nfu6_YEW.js} +297 -92
  10. package/cjs/{CalmLensTypes-DpU-hXq2.d.ts → CalmLensTypes-CUB0YYVz.d.ts} +26601 -27354
  11. package/cjs/{Classification-D3SkprrQ-CMnQKW13.d.ts → Classification-Q5zGpR8l-CEWjnE39.d.ts} +731 -607
  12. package/cjs/Core-C82YmjjX.d.ts +823 -0
  13. package/cjs/Core-Dc3cteU7.js +998 -0
  14. package/cjs/FileIcons-4qSX7DW2.d.ts +67 -0
  15. package/cjs/{ModerationContextLimits-FDpQmw_T.js → ModerationContextLimits-BxOmeSqq.js} +970 -278
  16. package/cjs/{ReactUpload-BvpW4hJi.js → ReactUpload-BK2O3dnK.js} +1 -1
  17. package/cjs/{ReactUpload-huIMnOJ4.d.ts → ReactUpload-DiiXfKvj.d.ts} +1 -1
  18. package/cjs/{TestTriggers-CMwMrbjy-K0YBzu2a.js → TestTriggers-BTyXtX0Q-ATuFDhLX.js} +343 -35
  19. package/{esm/TestTriggers-D-fwfhEP-hlaP1oW2.d.ts → cjs/TestTriggers-D0pYHbkr-D5T0VdSn.d.ts} +146 -8
  20. package/cjs/{UploadController-D4qOZZc3.js → UploadController-DLyiLDTB.js} +34 -14
  21. package/cjs/{WebhookPayload-CQg8BBZQ.d.ts → WebhookPayload-BLT2y_Jy.d.ts} +93 -86
  22. package/cjs/app.d.ts +6 -7
  23. package/cjs/app.js +4 -3
  24. package/cjs/elements.d.ts +123 -22
  25. package/cjs/elements.js +553 -156
  26. package/cjs/file-icons.d.ts +2 -67
  27. package/cjs/index-CKRgjV16.d.ts +16 -0
  28. package/cjs/index.d.ts +5 -6
  29. package/cjs/index.js +3 -2
  30. package/cjs/react-native.d.ts +52 -11
  31. package/cjs/react-native.js +231 -99
  32. package/cjs/react.d.ts +42 -9
  33. package/cjs/react.js +381 -118
  34. package/cjs/server.d.ts +48 -7
  35. package/cjs/server.js +7 -3
  36. package/cjs/test-inputs.d.ts +2 -2
  37. package/cjs/test-inputs.js +13 -9
  38. package/cjs/testing.d.ts +29 -16
  39. package/cjs/testing.js +1511 -397
  40. package/cjs/ui-CTBUxnVp.d.ts +139 -0
  41. package/cjs/ui-CZ8exACq.js +1359 -0
  42. package/cjs/ui.d.ts +3 -2
  43. package/cjs/ui.js +45 -22
  44. package/cjs/vue.d.ts +802 -199
  45. package/cjs/vue.js +359 -127
  46. package/{cjs/BrowserUpload-RkxV_Vv7.d.ts → esm/BrowserUpload-D-NnAN7g.d.ts} +2 -2
  47. package/esm/{BrowserUpload-DpzS2bbj.js → BrowserUpload-i9OhCzMJ.js} +1 -1
  48. package/esm/{CalmLensAppClient-BjlvBweS.js → CalmLensAppClient-CK4_Py0c.js} +30 -10
  49. package/esm/{CalmLensAppClient-B5gfOB6J.d.ts → CalmLensAppClient-gG16T2py.d.ts} +13 -3
  50. package/esm/{CalmLensOptionKeys-BKez0Wiw.js → CalmLensOptionKeys-BGZlIsT2.js} +235 -338
  51. package/esm/{CalmLensServerClient-DCSbwIBs.d.ts → CalmLensServerClient-BHx3x_nZ.d.ts} +107 -49
  52. package/esm/{CalmLensServerClient-DemxbNMn.js → CalmLensServerClient-dAQUcDWb.js} +274 -93
  53. package/esm/{CalmLensTypes-DpU-hXq2.d.ts → CalmLensTypes-CUB0YYVz.d.ts} +26601 -27354
  54. package/esm/{Classification-D3SkprrQ-CMnQKW13.d.ts → Classification-Q5zGpR8l-CEWjnE39.d.ts} +731 -607
  55. package/esm/Core-BxeIud_S.js +843 -0
  56. package/esm/Core-C82YmjjX.d.ts +823 -0
  57. package/esm/FileIcons-4qSX7DW2.d.ts +67 -0
  58. package/esm/{ModerationContextLimits-lLfmyLni.js → ModerationContextLimits-B6_RalCQ.js} +911 -261
  59. package/esm/{ReactUpload-huIMnOJ4.d.ts → ReactUpload-DiiXfKvj.d.ts} +1 -1
  60. package/esm/{ReactUpload-6klucehl.js → ReactUpload-DxwVqfX1.js} +1 -1
  61. package/esm/{TestTriggers-CMwMrbjy-bdowBBKw.js → TestTriggers-BTyXtX0Q-GRB9jQwo.js} +320 -36
  62. package/{cjs/TestTriggers-D-fwfhEP-hlaP1oW2.d.ts → esm/TestTriggers-D0pYHbkr-D5T0VdSn.d.ts} +146 -8
  63. package/esm/{UploadController-UxP6gj7A.js → UploadController-D9Z-h00Q.js} +34 -14
  64. package/esm/{WebhookPayload-CQg8BBZQ.d.ts → WebhookPayload-BLT2y_Jy.d.ts} +93 -86
  65. package/esm/app.d.ts +6 -7
  66. package/esm/app.js +3 -3
  67. package/esm/elements.d.ts +123 -22
  68. package/esm/elements.js +497 -128
  69. package/esm/file-icons.d.ts +2 -67
  70. package/esm/index-CKRgjV16.d.ts +16 -0
  71. package/esm/index.d.ts +5 -6
  72. package/esm/index.js +1 -1
  73. package/esm/react-native.d.ts +52 -11
  74. package/esm/react-native.js +205 -75
  75. package/esm/react.d.ts +42 -9
  76. package/esm/react.js +327 -91
  77. package/esm/server.d.ts +48 -7
  78. package/esm/server.js +3 -3
  79. package/esm/styles.css +142 -22
  80. package/esm/svelte/AssetViewer.svelte +25 -0
  81. package/esm/svelte/CalmLensAsset.svelte +318 -0
  82. package/esm/svelte/CalmLensDocumentViewer.svelte +7 -0
  83. package/esm/svelte/CalmLensImageViewer.svelte +7 -0
  84. package/esm/svelte/CalmLensSpreadsheetViewer.svelte +7 -0
  85. package/esm/svelte/CalmLensTextViewer.svelte +7 -0
  86. package/esm/svelte/CalmLensWebsiteViewer.svelte +7 -0
  87. package/esm/svelte/index.d.ts +29 -6
  88. package/esm/svelte/index.js +7 -2
  89. package/esm/test-inputs.d.ts +2 -2
  90. package/esm/test-inputs.js +1 -1
  91. package/esm/testing.d.ts +29 -16
  92. package/esm/testing.js +1507 -393
  93. package/esm/ui-CTBUxnVp.d.ts +139 -0
  94. package/esm/ui-Cr7s6JHm.js +1258 -0
  95. package/esm/ui.d.ts +3 -2
  96. package/esm/ui.js +4 -3
  97. package/esm/vue.d.ts +802 -199
  98. package/esm/vue.js +308 -103
  99. package/package.json +3 -1
  100. package/cjs/ModerationContext-9lGm-Mna-CcmbRnOy.d.ts +0 -67
  101. package/cjs/index-BcDDQJF2.d.ts +0 -253
  102. package/cjs/ui-B23r8BvW.d.ts +0 -539
  103. package/cjs/ui-Dq-cm6Rx.js +0 -586
  104. package/esm/ModerationContext-9lGm-Mna-CcmbRnOy.d.ts +0 -67
  105. package/esm/index-BcDDQJF2.d.ts +0 -253
  106. package/esm/svelte/CalmLensMedia.svelte +0 -134
  107. package/esm/ui-B23r8BvW.d.ts +0 -539
  108. package/esm/ui-Bn29rfAi.js +0 -461
@@ -1,67 +1,2 @@
1
- /**
2
- * File-type icons for files without an image preview: a file outline in the family's colour with
3
- * the family's symbol and an extension label, drawn the same way by every framework. The symbols are
4
- * Tabler icons (MIT) as 24×24 stroke paths.
5
- */
6
- type FileIconFamily = "documents" | "spreadsheets" | "presentations" | "images" | "audio" | "video" | "archives" | "code" | "data" | "design" | "applications" | "fonts" | "maps" | "games" | "system" | "security" | "unknown";
7
- /** The families `getFileIcon` finds from a file's name and MIME type. */
8
- type UploadFileIconFamily = Exclude<FileIconFamily, "applications" | "maps" | "games" | "system" | "security" | "unknown">;
9
- /** The file outline every family's icon is drawn on. */
10
- export declare const FILE_ICON_OUTLINE = "M14 3v4a1 1 0 0 0 1 1h4 M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2";
11
- /** The symbols of the families `getFileIcon` finds, which the upload widget draws. */
12
- export declare const FILE_ICON_SYMBOLS: Record<UploadFileIconFamily, string>;
13
- /**
14
- * The symbols of the families only an app's own file detection finds, kept apart so the upload
15
- * widget doesn't bundle them.
16
- */
17
- export declare const MORE_FILE_ICON_SYMBOLS: Record<Exclude<FileIconFamily, UploadFileIconFamily | "unknown">, string>;
18
- export declare const FILE_ICON_COLORS: Record<FileIconFamily, string>;
19
- /** A file's icon family and the extension its label shows, such as `pdf`. */
20
- export declare const getFileIcon: (file: {
21
- name: string;
22
- type: string;
23
- }) => {
24
- family: UploadFileIconFamily;
25
- extension: string;
26
- };
27
- /**
28
- * Where each part of the icon goes in its 24×24 box: the symbol inside the outline, above a band
29
- * holding the extension. Icons 32 pixels or smaller leave the band out and centre the symbol.
30
- */
31
- export declare const getFileIconLayout: (size: number) => {
32
- compact: boolean;
33
- symbol: {
34
- x: number;
35
- y: number;
36
- width: number;
37
- height: number;
38
- };
39
- outlineStroke: number;
40
- /** The band and its label, in a half-scale group: `transform="scale(0.5)"`. */
41
- band: {
42
- x: number;
43
- y: number;
44
- width: number;
45
- height: number;
46
- rx: number;
47
- };
48
- label: {
49
- x: number;
50
- y: number;
51
- };
52
- };
53
- /** The label's font size, and a squeezed width for long extensions. */
54
- export declare const getFileIconLabel: (extension: string) => {
55
- text: string;
56
- fontSize: number;
57
- textLength: number | undefined;
58
- };
59
- /**
60
- * The icon as SVG markup, for the components to insert as it is. `extension` must come from
61
- * `getFileIcon`, which keeps only letters and digits.
62
- */
63
- export declare const renderFileIconSvg: ({ family, extension }: {
64
- family: UploadFileIconFamily | "unknown";
65
- extension: string;
66
- }, size: number) => string;
67
- export type { FileIconFamily, UploadFileIconFamily };
1
+ import { a as MORE_FILE_ICON_SYMBOLS, c as getFileIconLabel, i as FileIconFamily, l as getFileIconLayout, n as FILE_ICON_OUTLINE, o as UploadFileIconFamily, r as FILE_ICON_SYMBOLS, s as getFileIcon, t as FILE_ICON_COLORS, u as renderFileIconSvg } from "./FileIcons-4qSX7DW2.js";
2
+ export { FILE_ICON_COLORS, FILE_ICON_OUTLINE, FILE_ICON_SYMBOLS, type FileIconFamily, MORE_FILE_ICON_SYMBOLS, type UploadFileIconFamily, getFileIcon, getFileIconLabel, getFileIconLayout, renderFileIconSvg };
@@ -0,0 +1,16 @@
1
+ import "./Classification-Q5zGpR8l-CEWjnE39.js";
2
+ import { M as CdnResource, Y as GetAssetInfoOptions, kn as AssetInfo } from "./CalmLensTypes-CUB0YYVz.js";
3
+ import "./WebhookPayload-BLT2y_Jy.js";
4
+ /** Every CDN resource beneath an asset URL, as `getAssetUrl` and `signAssetUrl` accept them. */
5
+ declare const CDN_RESOURCES: CdnResource[];
6
+ /**
7
+ * The display info of an asset URL (public or signed): `{url}/info`, an allowlist of the asset's
8
+ * public fields and whether this viewer can see it now (`availability`). Viewer claims come from
9
+ * `viewerClaims`, else from the URL. A refusal throws `CalmLensError` with the CDN's code, such as
10
+ * `signed-url/expired` or `asset/not-found`.
11
+ */
12
+ declare const getAssetInfo: (url: string, options?: GetAssetInfoOptions) => Promise<AssetInfo>;
13
+ declare const DEFAULT_CDN_BASE_URL = "https://cdn.calmlens.com/v1";
14
+ /** This SDK's version, from its package.json. */
15
+ declare const SDK_VERSION: string;
16
+ export { getAssetInfo as i, DEFAULT_CDN_BASE_URL as n, CDN_RESOURCES as r, SDK_VERSION as t };
package/cjs/index.d.ts CHANGED
@@ -1,6 +1,5 @@
1
- import { a as selectModerationContextItems, i as ModerationContextItem, n as MODERATION_CONTEXT_USED_CHARACTERS, o as HashList, r as MODERATION_CONTEXT_USED_ITEMS, s as HashListEntry, t as ModerationContext } from "./ModerationContext-9lGm-Mna-CcmbRnOy.js";
2
- import { $ as ImageTransformOptions, $t as AssetSearchMatchField, A as CdnServeOptions, At as UploadedAsset, B as DeleteAssetContentOptions, Bt as TypedEvent, C as AssignPolicyOptions, Ct as SubmitAssetOptions, D as CalmLensServerClientOptions, Dt as UpdatePolicyOptions, E as CalmLensAppClientOptions, Et as UpdateHashListOptions, F as CreateFolderOptions, Ft as WebhookPayloadInput, G as FolderIdOptions, Gt as EventSeverity, H as EnsureLensOptions, Ht as EventFact, I as CreateHashListOptions, It as AssetBatchOperation, J as HashListEntryIdOptions, Jt as Folder, Kt as EventType, L as CreateMultipartUploadPartOptions, Lt as GetEventsResponse, M as ClassifyTextOptions, Mt as ViewerClaims, N as ConnectionOptions, Nt as WaitForAssetDecisionOptions, O as CdnAssetUrlOptions, Ot as UploadAssetPartOptions, P as CreateAssetSignedUrlOptions, Pt as WebhookHeadersInput, Q as IdempotencyOptions, Qt as LensType, R as CreatePolicyOptions, S as AssetVisibility, St as SignedUrl, T as BatchAssetsResponse, Tt as UpdateFolderOptions, U as EnsureLensesOptions, Ut as EventFactValues, V as DeleteAssetOptions, Vt as EventCategory, W as ExplainAssetOptions, Wt as EventFacts, X as HashListIdOptions, Xt as CursorPage, Y as HashListEntryPage, Yt as Policy, Z as HashListPage, Zt as Order, _ as AssetSearchResponse, _t as RetryAssetOptions, a as AssetChildrenPage, an as ExtractedText, at as ListEventsOptions, b as AssetUpload, bt as SignUploadTokenOptions, c as AssetClassificationStatus, cn as ProcessingOptions, ct as ListHashListsOptions, d as AssetContentRemovalReason, dt as MultipartUploadOptions, en as AssetSearchQuery, et as IterateAssetChildrenOptions, f as AssetContentStatus, ft as MultipartUploadPartOptions, g as AssetPage, gt as RetrieveAssetOptions, h as AssetModerationStatus, ht as RequestOptions, i as AssetChecksums, in as AssetSafetyHoldReason, it as ListAssetsOptions, j as CdnTransform, jt as VerifyWebhookSignatureOptions, k as CdnResource, kt as UploadPresetSubmitAssetOptions, l as AssetContent, lt as MoveAssetOptions, m as AssetModerationDecision, mt as PolicyList, n as ApplyPolicyPresetOptions, nn as AssetImage, nt as Lens, o as AssetClassification, on as FileMetadata, p as AssetModeration, pt as PolicyIdOptions, q as GetAssetUrlOptions, r as Asset, rn as AssetSafetyHold, rt as ListAssetChildrenOptions, s as AssetClassificationFailureReason, sn as MetadataItem, st as ListHashListEntriesOptions, t as AddHashListEntryOptions, tt as IterateAssetsOptions, u as AssetContentOptions, ut as MoveFolderOptions, v as AssetSearchResult, vt as SearchAssetsOptions, w as BatchAssetsOptions, wt as UpdateAssetOptions, x as AssetUploadStatus, xt as SignedUploadToken, y as AssetType, yt as SetPolicyAutomaticUpdatesOptions, z as DecideAssetOptions, zt as EventAsset } from "./CalmLensTypes-DpU-hXq2.js";
3
- 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-CQg8BBZQ.js";
4
- import { a as ProcessingFeatureId, c as ProcessingFeatures, d as getAssetUrl, i as DetectedPerson, l as SDK_VERSION, n as BoundingBox, o as ProcessingFeatureResults, r as DetectedFace, s as ProcessingFeatureStage, t as AgeRange, u as DEFAULT_CDN_BASE_URL } from "./index-BcDDQJF2.js";
5
- import { a as ClassificationNotEvaluatedReason, c as ModerationQualifier, i as ClassificationLabel, l as PolicyAction, n as ClassificationCategory, o as ClassificationQualifierResults, r as ClassificationCategoryReport, s as Likelihood, t as ClassificationCategories } from "./Classification-D3SkprrQ-CMnQKW13.js";
6
- export { type AddHashListEntryOptions, type AgeRange, type ApiErrorCode, type ApplyPolicyPresetOptions, type Asset, type AssetBatchOperation, type AssetChecksums, type AssetChildrenPage, type AssetClassification, type AssetClassificationFailureReason, type AssetClassificationStatus, type AssetContent, type AssetContentOptions, type AssetContentRemovalReason, type AssetContentStatus, type AssetImage, type AssetModeration, type AssetModerationDecision, type AssetModerationStatus, type AssetPage, type AssetSafetyHold, type AssetSafetyHoldReason, type AssetSearchMatchField, type AssetSearchQuery, type AssetSearchResponse, type AssetSearchResult, type AssetType, type AssetUpload, type AssetUploadStatus, type AssetVisibility, type AssignPolicyOptions, type BatchAssetsOptions, type BatchAssetsResponse, type BoundingBox, CALMLENS_ERROR_CODES, type CalmLensAppClientOptions, CalmLensError, type CalmLensErrorCode, type CalmLensErrorDetails, type CalmLensErrorOptions, type CalmLensServerClientOptions, type CdnAssetUrlOptions, type CdnResource, type CdnServeOptions, type CdnTransform, type ClassificationCategories, type ClassificationCategory, type ClassificationCategoryReport, type ClassificationLabel, type ClassificationNotEvaluatedReason, type ClassificationQualifierResults, type ClassifyTextOptions, type ConnectionOptions, type CreateAssetSignedUrlOptions, type CreateFolderOptions, type CreateHashListOptions, type CreateMultipartUploadPartOptions, type CreatePolicyOptions, type CursorPage, DEFAULT_CDN_BASE_URL, type DecideAssetOptions, type DeleteAssetContentOptions, type DeleteAssetOptions, type DetectedFace, type DetectedPerson, type EnsureLensOptions, type EnsureLensesOptions, 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 GetAssetUrlOptions, type HashList, type HashListEntry, type HashListEntryIdOptions, type HashListEntryPage, type HashListIdOptions, type HashListPage, type IdempotencyOptions, type ImageTransformOptions, type IterateAssetChildrenOptions, type IterateAssetsOptions, type Lens, type LensType, type Likelihood, type ListAssetChildrenOptions, type ListAssetsOptions, type ListEventsOptions, type ListHashListEntriesOptions, type ListHashListsOptions, MODERATION_CONTEXT_USED_CHARACTERS, MODERATION_CONTEXT_USED_ITEMS, type MetadataItem, type ModerationContext, type ModerationContextItem, type ModerationQualifier, type MoveAssetOptions, type MoveFolderOptions, type MultipartUploadOptions, type MultipartUploadPartOptions, type Order, type Policy, type PolicyAction, type PolicyIdOptions, type PolicyList, type ProcessingFeatureId, type ProcessingFeatureResults, type ProcessingFeatureStage, type ProcessingFeatures, type ProcessingOptions, type RequestOptions, type RetrieveAssetOptions, type RetryAssetOptions, SDK_VERSION, type SdkErrorCode, type SearchAssetsOptions, type SetPolicyAutomaticUpdatesOptions, type SignUploadTokenOptions, type SignedUploadToken, type SignedUrl, type SubmitAssetOptions, type TypedEvent, type UpdateAssetOptions, type UpdateFolderOptions, type UpdateHashListOptions, type UpdatePolicyOptions, type UploadAssetPartOptions, type UploadPresetSubmitAssetOptions, type UploadedAsset, type VerifyWebhookSignatureOptions, type ViewerClaims, type WaitForAssetDecisionOptions, type ReceivedWebhookEventPayload as WebhookEventPayload, type WebhookHeadersInput, type WebhookPayloadInput, getAssetUrl, selectModerationContextItems };
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-Q5zGpR8l-CEWjnE39.js";
2
+ import { $ as HashListPage, $t as WebhookHeadersInput, A as CdnAssetReference, An as AssetHls, At as ResetPolicyOptions, B as CreateMultipartUploadPartOptions, Bn as ProcessingOptions, Bt as SubmitAssetOptions, C as AssetVisibility, Cn as Policy, Ct as MoveFolderOptions, D as CalmLensAppClientOptions, Dn as AssetSearchQuery, Dt as PolicyPage, E as BatchAssetsResponse, En as AssetSearchMatchField, Et as PolicyIdOptions, F as ClassifyTextOptions, Fn as AssetSafetyHold, Ft as SignAssetUrlOptions, G as EnsureLensesOptions, Gt as UpdatePolicyOptions, H as DecideAssetOptions, Ht as UpdateFolderOptions, I as ConnectionOptions, In as AssetSafetyHoldReason, It as SignUploadTokenOptions, J as FolderPage, Jt as UploadPresetSubmitAssetOptions, K as ExplainAssetOptions, Kt as UpgradePolicyOptions, L as CreateFolderOptions, Ln as ExtractedText, Lt as SignedAssetUrl, M as CdnResource, Mn as AssetPreview, Mt as RetryAssetOptions, N as CdnServeOptions, Nn as AssetRendered, Nt as SearchAssetsOptions, O as CalmLensServerClientOptions, Ot as RemoveAssetContentOptions, P as CdnTransform, Pn as AssetRenderedKind, Pt as SetPolicyAutomaticUpdatesOptions, Q as HashListIdOptions, Qt as WaitForAssetDecisionOptions, R as CreateHashListOptions, Rn as FileMetadata, Rt as SignedUploadToken, S as AssetUploadStatus, Sn as ProcessingFeatures, St as MoveAssetOptions, T as BatchAssetsOptions, Tn as LensType, Tt as MultipartUploadPartOptions, U as DeleteAssetOptions, Ut as UpdateHashListOptions, V as CreatePolicyOptions, Vt as UpdateAssetOptions, W as EnsureLensOptions, Wt as UpdateLensOptions, X as HashListEntryIdOptions, Xt as VerifyWebhookSignatureOptions, Y as GetAssetInfoOptions, Yt as UploadedAsset, Z as HashListEntryPage, Zt as ViewerClaims, _ as AssetSearchResponse, _n as DetectedFace, _t as ListFoldersOptions, a as AssetChildrenPage, an as EventAsset, at as IterateFoldersOptions, b as AssetType, bn as ProcessingFeatureResults, bt as ListLensesOptions, c as AssetClassificationStatus, cn as EventFact, ct as IterateLensesOptions, d as AssetContentRemovalReason, dn as EventSeverity, dt as LensIdOptions, en as WebhookPayloadInput, et as IdempotencyOptions, f as AssetContentStatus, fn as EventType, ft as LensPage, g as AssetPage, gn as BoundingBox, gt as ListEventsOptions, h as AssetModerationStatus, hn as AgeRange, ht as ListAssetsOptions, i as AssetChecksums, it as IterateAssetsOptions, j as CdnAssetUrlOptions, jn as AssetHlsRendition, jt as RetrieveAssetOptions, k as CdnAssetLocation, kn as AssetInfo, kt as RequestOptions, l as AssetContent, ln as EventFactValues, lt as IteratePoliciesOptions, m as AssetModerationDecision, mn as Folder, mt as ListAssetTimelineOptions, n as Asset, nn as AssetTimelineSegment, nt as IterateAssetChildrenOptions, o as AssetClassification, on as TypedEvent, ot as IterateHashListEntriesOptions, p as AssetModeration, pt as ListAssetChildrenOptions, q as FolderIdOptions, qt as UploadAssetPartOptions, r as AssetAvailability, rn as GetEventsResponse, rt as IterateAssetTimelineOptions, s as AssetClassificationFailureReason, sn as EventCategory, st as IterateHashListsOptions, t as AddHashListEntryOptions, tn as AssetBatchOperation, tt as ImageTransformOptions, u as AssetContentOptions, un as EventFacts, ut as Lens, v as AssetSearchResult, vn as DetectedPerson, vt as ListHashListEntriesOptions, w as AssignPolicyOptions, wn as CursorPage, wt as MultipartUploadOptions, x as AssetUpload, xn as ProcessingFeatureStage, xt as ListPoliciesOptions, y as AssetTimelinePage, yn as ProcessingFeatureId, yt as ListHashListsOptions, z as CreateLensOptions, zn as MetadataItem, zt as StreamingFeatureOptions } from "./CalmLensTypes-CUB0YYVz.js";
3
+ import { i as getAssetInfo, n as DEFAULT_CDN_BASE_URL, r as CDN_RESOURCES, t as SDK_VERSION } from "./index-CKRgjV16.js";
4
+ 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-BLT2y_Jy.js";
5
+ 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, 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 DetectedFace, type DetectedPerson, type EnsureLensOptions, type EnsureLensesOptions, 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 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, MODERATION_CONTEXT_USED_CHARACTERS, MODERATION_CONTEXT_USED_ITEMS, 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 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 UpgradePolicyOptions, type UploadAssetPartOptions, type UploadPresetSubmitAssetOptions, type UploadedAsset, type VerifyWebhookSignatureOptions, type ViewerClaims, type WaitForAssetDecisionOptions, type ReceivedWebhookEventPayload as WebhookEventPayload, type WebhookHeadersInput, type WebhookPayloadInput, getAssetInfo, selectModerationContextItems };
package/cjs/index.js CHANGED
@@ -1,10 +1,11 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_ModerationContextLimits = require("./ModerationContextLimits-FDpQmw_T.js");
2
+ const require_ModerationContextLimits = require("./ModerationContextLimits-BxOmeSqq.js");
3
3
  exports.CALMLENS_ERROR_CODES = require_ModerationContextLimits.CALMLENS_ERROR_CODES;
4
+ exports.CDN_RESOURCES = require_ModerationContextLimits.CDN_RESOURCES;
4
5
  exports.CalmLensError = require_ModerationContextLimits.CalmLensError;
5
6
  exports.DEFAULT_CDN_BASE_URL = require_ModerationContextLimits.DEFAULT_CDN_BASE_URL;
6
7
  exports.MODERATION_CONTEXT_USED_CHARACTERS = require_ModerationContextLimits.MODERATION_CONTEXT_USED_CHARACTERS;
7
8
  exports.MODERATION_CONTEXT_USED_ITEMS = require_ModerationContextLimits.MODERATION_CONTEXT_USED_ITEMS;
8
9
  exports.SDK_VERSION = require_ModerationContextLimits.SDK_VERSION;
9
- exports.getAssetUrl = require_ModerationContextLimits.getAssetUrl;
10
+ exports.getAssetInfo = require_ModerationContextLimits.getAssetInfo;
10
11
  exports.selectModerationContextItems = require_ModerationContextLimits.selectModerationContextItems;
@@ -1,5 +1,5 @@
1
- import { A as CustomUploadContext, B as isFileAccepted, C as formatMessage, D as getUploadItemOutcome, E as getUploadItemMessage, F as UploadFile, G as MediaSource, H as MediaImageSource, I as UploadItem, J as pickMediaSource, K as MediaState, L as UploadSnapshot, M as UploadClient, N as UploadController, O as resolveMessages, P as UploadControllerOptions, R as UploadStage, S as formatBytes, T as getMediaUnavailableMessage, U as MediaOptions, V as MediaAsset, W as MediaSettings, Y as resolveMediaProps, _ as DEFAULT_MESSAGES, a as ProgressFetchOptions, b as describeUploadItem, c as ICON_ATTRIBUTES, d as MediaProps, f as UploaderDisplayOptions, g as CalmLensMessages, h as getMediaLoadKey, i as CALMLENS_STYLES, j as CustomUploadResult, k as CalmLensUpload, l as IconName, m as getMediaAspectRatio, n as CalmLensTheme, o as createProgressFetch, p as UploaderProps, q as getMediaState, r as resolveTheme, s as ICONS, t as CALMLENS_THEME, u as MediaDisplayOptions, v as UploadItemView, w as getDropzoneHint, x as describeUploader, y as UploaderView, z as createUploadController } from "./ui-B23r8BvW.js";
2
- import { n as useCalmLensUpload, t as UseCalmLensUploadResult } from "./ReactUpload-huIMnOJ4.js";
1
+ import { $ as getAssetViewKey, A as CustomUploadResult, B as AssetDisplay, C as formatMessage, D as resolveMessages, E as getUploadItemOutcome, F as UploadItem, G as AssetSession, H as AssetImageOptions, I as UploadSnapshot, J as AssetVideoOptions, K as AssetSessionState, L as UploadStage, M as UploadController, N as UploadControllerOptions, O as CalmLensUpload, P as UploadFile, Q as getAssetView, R as createUploadController, 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, a as ProgressFetchOptions, b as describeUploadItem, c as ICON_ATTRIBUTES, d as AssetDisplayOptions, et as getPeakHeights, f as AssetEventHandlers, g as CalmLensMessages, h as UploaderProps, i as CALMLENS_STYLES, j as UploadClient, k as CustomUploadContext, l as IconName, m as UploaderDisplayOptions, n as CalmLensTheme, nt as pickAssetSource, o as createProgressFetch, p as AssetProps, q as AssetSpreadsheetOptions, r as resolveTheme, s as ICONS, t as CALMLENS_THEME, tt as getPlayedPercent, u as ASSET_FILE_ICON_SIZE, v as UploadItemView, w as getDropzoneHint, x as describeUploader, y as UploaderView, z as isFileAccepted } from "./Core-C82YmjjX.js";
2
+ import { n as useCalmLensUpload, t as UseCalmLensUploadResult } from "./ReactUpload-DiiXfKvj.js";
3
3
  import { ReactNode } from "react";
4
4
  import { StyleProp, ViewStyle } from "react-native";
5
5
  /** What the uploader asks your picker for. */
@@ -31,26 +31,67 @@ export declare const CHOOSE_TEST_ID = "calmlens-choose";
31
31
  * picker, such as `expo-image-picker`.
32
32
  */
33
33
  export declare function CalmLensUploader<F extends UploadFile = UploadFile>({ pick, disabled, messages: overrides, controller: external, theme: themeOverrides, style, ...options }: CalmLensUploaderProps<F>): import("react").JSX.Element;
34
- /** A video or audio file for your app's player to play. */
34
+ /** A video or audio file or stream for your app's player to play. */
35
35
  export interface MediaPlayerSource {
36
36
  kind: "video" | "audio";
37
- /** The asset's original file. */
37
+ /**
38
+ * What to play: the asset's adaptive stream (an HLS playlist, which AVPlayer and ExoPlayer play)
39
+ * when it has one, or its rendered file, which plays in every browser and on phones. If the
40
+ * stream fails, the component renders the player again with the file.
41
+ */
38
42
  src: string;
43
+ /**
44
+ * Whether `src` is the HLS stream, for players that are told the source's type, such as
45
+ * `expo-video`'s `contentType: "hls"`.
46
+ */
47
+ streaming: boolean;
48
+ /** The preview still, if the asset has one: a video's poster or an audio waveform. */
49
+ poster?: string;
50
+ /** Audio's waveform peaks from 0 to 1, for drawing its progress. */
51
+ peaks?: readonly number[];
39
52
  /** Describes the media, from the component's `alt`. */
40
53
  alt: string;
54
+ autoPlay?: boolean;
55
+ muted?: boolean;
56
+ loop?: boolean;
57
+ controls: boolean;
58
+ /** Where to resume after `onError` fetched a fresh asset URL, which is now `src`. */
59
+ resumeFrom?: MediaPlayback;
60
+ /**
61
+ * Call when the player fails, with where it was. A stream gives way to the rendered file (with
62
+ * `resumeFrom`); a file is retried once beneath a fresh asset URL from `onExpired`, and
63
+ * otherwise, or when that fails too, the CDN decides between the unavailable and age notices.
64
+ */
65
+ onError: (playback?: MediaPlayback) => void;
66
+ /** Call once the player has loaded `src`, so a later expiry can fetch a fresh URL again. */
67
+ onLoad: () => void;
68
+ onPlay?: () => void;
69
+ onEnded?: () => void;
70
+ onTimeUpdate?: (currentTime: number) => void;
41
71
  }
42
- export type CalmLensMediaProps = MediaOptions & Omit<MediaDisplayOptions, "sizes" | "lazy" | "fetchPriority" | "position" | "controls"> & ThemeOptions & {
72
+ export type CalmLensAssetProps = Omit<AssetOptions, "document" | "spreadsheet"> & Omit<AssetDisplayOptions, "lazy" | "fetchPriority"> & AssetEventHandlers & ThemeOptions & {
43
73
  /**
44
74
  * Renders video and audio, which React Native has no built-in player for, such as `expo-video`.
45
- * Without it, video and audio assets show their placeholder.
75
+ * Without it, video and audio show their preview still with a button that opens the file in
76
+ * the device's player.
46
77
  */
47
78
  renderPlayer?: (source: MediaPlayerSource) => ReactNode;
79
+ /** Replaces the unavailable notice. */
80
+ renderUnavailable?: () => ReactNode;
81
+ /** Replaces the age notice; call `confirm` from your own reveal button. */
82
+ renderAgeGate?: (props: {
83
+ placeholderUrl?: string;
84
+ confirm?: () => void;
85
+ }) => ReactNode;
48
86
  style?: StyleProp<ViewStyle>;
49
87
  };
50
88
  /**
51
- * Shows an asset from the CalmLens CDN, at the width in `widths` that covers its measured size,
52
- * with a blurred placeholder while it loads. Age-restricted assets stay behind the placeholder and
53
- * a reveal button until `ageConfirmed` is set; blocked and purged assets show an unavailable notice.
89
+ * Shows an asset from its asset URL (public, or signed by your server) with React Native's own
90
+ * views: images at the width in `image.widths` that covers their measured size, over a blurred
91
+ * placeholder; video and audio in `renderPlayer`'s player; and for documents, text, spreadsheets
92
+ * and websites, their preview still with a button that opens them. It reads `{src}/info` once
93
+ * mounted, unless `info` is given. Age-restricted content stays behind its placeholder and a
94
+ * reveal button; content the CDN refuses shows the unavailable notice.
54
95
  */
55
- export declare function CalmLensMedia(input: CalmLensMediaProps): import("react").JSX.Element;
56
- export { CALMLENS_STYLES, CALMLENS_THEME, type CalmLensMessages, type CalmLensTheme, type CalmLensUpload, type CustomUploadContext, type CustomUploadResult, DEFAULT_MESSAGES, ICONS, ICON_ATTRIBUTES, type IconName, type MediaAsset, type MediaDisplayOptions, type MediaImageSource, type MediaOptions, type MediaProps, type MediaSettings, type MediaSource, type MediaState, type ProgressFetchOptions, type UploadClient, UploadController, type UploadControllerOptions, type UploadFile, type UploadItem, type UploadItemView, type UploadSnapshot, type UploadStage, type UploaderDisplayOptions, type UploaderProps, type UploaderView, type UseCalmLensUploadResult, createProgressFetch, createUploadController, describeUploadItem, describeUploader, formatBytes, formatMessage, getDropzoneHint, getMediaAspectRatio, getMediaLoadKey, getMediaState, getMediaUnavailableMessage, getUploadItemMessage, getUploadItemOutcome, isFileAccepted, pickMediaSource, resolveMediaProps, resolveMessages, resolveTheme, useCalmLensUpload };
96
+ export declare function CalmLensAsset(props: CalmLensAssetProps): import("react").JSX.Element;
97
+ export { ASSET_FILE_ICON_SIZE, 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, CALMLENS_STYLES, CALMLENS_THEME, type CalmLensMessages, type CalmLensTheme, type CalmLensUpload, type CustomUploadContext, type CustomUploadResult, DEFAULT_MESSAGES, ICONS, ICON_ATTRIBUTES, type IconName, type MediaPlayback, type ProgressFetchOptions, type UploadClient, UploadController, type UploadControllerOptions, type UploadFile, type UploadItem, type UploadItemView, type UploadSnapshot, type UploadStage, type UploaderDisplayOptions, type UploaderProps, type UploaderView, type UseCalmLensUploadResult, createProgressFetch, createUploadController, describeUploadItem, describeUploader, formatBytes, formatMessage, getAssetAspectRatio, getAssetView, getAssetViewKey, getDropzoneHint, getPeakHeights, getPlayedPercent, getUploadItemMessage, getUploadItemOutcome, isFileAccepted, pickAssetSource, resolveMessages, resolveTheme, useCalmLensUpload };