calmlens 0.20.0 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -10
- package/bin/calmlens.js +1848 -679
- package/cjs/{BrowserUpload-C07aL9Vq.d.ts → BrowserUpload-BWjZ9ntu.d.ts} +2 -2
- package/cjs/{BrowserUpload-CjSHjx3C.js → BrowserUpload-Bwlib4Zc.js} +1 -1
- package/cjs/{CalmLensAppClient-DDLojj0P.d.ts → CalmLensAppClient-BaW3ddUR.d.ts} +13 -3
- package/cjs/{CalmLensAppClient-NaCxOVlM.js → CalmLensAppClient-DUYMo9PZ.js} +30 -10
- package/cjs/{CalmLensOptionKeys-p2QK687A.js → CalmLensOptionKeys-YvgV995V.js} +318 -374
- package/cjs/{CalmLensServerClient-BDzTthxE.js → CalmLensServerClient-3N-gdsxC.js} +346 -89
- package/cjs/CalmLensServerClient-BKzn8zmp.d.ts +353 -0
- package/cjs/{CalmLensTypes-COJbOuiv.d.ts → CalmLensTypes-BDKwThbO.d.ts} +26993 -27187
- package/cjs/{Classification-D3SkprrQ-CMnQKW13.d.ts → Classification-Q5zGpR8l-CEWjnE39.d.ts} +731 -607
- package/cjs/Core-C33pkBmf.d.ts +826 -0
- package/cjs/Core-Cm5Z1oJ9.js +1001 -0
- package/cjs/FileIcons-4qSX7DW2.d.ts +67 -0
- package/cjs/{ModerationContextLimits-2nIv7Zh3.js → ModerationContextLimits-ud1xpZRK.js} +727 -268
- package/cjs/{ReactUpload-BdTRCTGA.js → ReactUpload-DQ0BYISX.js} +1 -1
- package/cjs/{ReactUpload-CRJNPB5T.d.ts → ReactUpload-DhF8mm51.d.ts} +1 -1
- package/{esm/TestTriggers-D-fwfhEP-hlaP1oW2.d.ts → cjs/TestTriggers-D0pYHbkr-D5T0VdSn.d.ts} +146 -8
- package/cjs/{TestTriggers-DbhsNPdg-DjvVuc2h.js → TestTriggers-D29T_R0M-D6Bu-Mln.js} +355 -47
- package/cjs/{UploadController-MLVs97Zt.js → UploadController-l8fZM2qT.js} +34 -14
- package/{esm/WebhookPayload-DkukERKE.d.ts → cjs/WebhookPayload-Dt6DttS0.d.ts} +120 -86
- package/cjs/app.d.ts +6 -7
- package/cjs/app.js +4 -3
- package/cjs/elements.d.ts +123 -22
- package/cjs/elements.js +553 -156
- package/cjs/file-icons.d.ts +2 -67
- package/cjs/index-Bde1wjiw.d.ts +16 -0
- package/cjs/index.d.ts +5 -6
- package/cjs/index.js +3 -2
- package/cjs/react-native.d.ts +52 -11
- package/cjs/react-native.js +231 -99
- package/cjs/react.d.ts +42 -9
- package/cjs/react.js +381 -118
- package/cjs/server.d.ts +48 -7
- package/cjs/server.js +7 -3
- package/cjs/test-inputs.d.ts +2 -2
- package/cjs/test-inputs.js +13 -9
- package/cjs/testing.d.ts +29 -15
- package/cjs/testing.js +1722 -433
- package/cjs/ui-BRA4HQ8r.js +1359 -0
- package/cjs/ui-YQuvbidU.d.ts +139 -0
- package/cjs/ui.d.ts +3 -2
- package/cjs/ui.js +45 -22
- package/cjs/vue.d.ts +802 -199
- package/cjs/vue.js +359 -127
- package/esm/{BrowserUpload-C07aL9Vq.d.ts → BrowserUpload-BWjZ9ntu.d.ts} +2 -2
- package/esm/{BrowserUpload-CAVkRotw.js → BrowserUpload-GRZVB0G_.js} +1 -1
- package/esm/{CalmLensAppClient-PQ9VBvlW.js → CalmLensAppClient-B5QIJ6KS.js} +30 -10
- package/esm/{CalmLensAppClient-DDLojj0P.d.ts → CalmLensAppClient-BaW3ddUR.d.ts} +13 -3
- package/esm/{CalmLensOptionKeys-Do2mPP6w.js → CalmLensOptionKeys-BG7Qrh8-.js} +317 -367
- package/esm/CalmLensServerClient-BKzn8zmp.d.ts +353 -0
- package/esm/{CalmLensServerClient-C_H5aAsV.js → CalmLensServerClient-bRUAebi-.js} +323 -90
- package/esm/{CalmLensTypes-COJbOuiv.d.ts → CalmLensTypes-BDKwThbO.d.ts} +26993 -27187
- package/esm/{Classification-D3SkprrQ-CMnQKW13.d.ts → Classification-Q5zGpR8l-CEWjnE39.d.ts} +731 -607
- package/esm/Core-BvQe4moS.js +846 -0
- package/esm/Core-C33pkBmf.d.ts +826 -0
- package/esm/FileIcons-4qSX7DW2.d.ts +67 -0
- package/esm/{ModerationContextLimits-Chw-AzgL.js → ModerationContextLimits-CrxSnVZ3.js} +682 -253
- package/esm/{ReactUpload-CMmL0R5Q.js → ReactUpload-BMO8saxT.js} +1 -1
- package/esm/{ReactUpload-CRJNPB5T.d.ts → ReactUpload-DhF8mm51.d.ts} +1 -1
- package/{cjs/TestTriggers-D-fwfhEP-hlaP1oW2.d.ts → esm/TestTriggers-D0pYHbkr-D5T0VdSn.d.ts} +146 -8
- package/esm/{TestTriggers-DbhsNPdg-CUdrv8Nm.js → TestTriggers-D29T_R0M-Ztc74ucs.js} +332 -48
- package/esm/{UploadController-BJZghJpg.js → UploadController-DnJrWiE4.js} +34 -14
- package/{cjs/WebhookPayload-DkukERKE.d.ts → esm/WebhookPayload-Dt6DttS0.d.ts} +120 -86
- package/esm/app.d.ts +6 -7
- package/esm/app.js +3 -3
- package/esm/elements.d.ts +123 -22
- package/esm/elements.js +497 -128
- package/esm/file-icons.d.ts +2 -67
- package/esm/index-Bde1wjiw.d.ts +16 -0
- package/esm/index.d.ts +5 -6
- package/esm/index.js +1 -1
- package/esm/react-native.d.ts +52 -11
- package/esm/react-native.js +205 -75
- package/esm/react.d.ts +42 -9
- package/esm/react.js +327 -91
- package/esm/server.d.ts +48 -7
- package/esm/server.js +3 -3
- package/esm/styles.css +142 -22
- package/esm/svelte/AssetViewer.svelte +25 -0
- package/esm/svelte/CalmLensAsset.svelte +318 -0
- package/esm/svelte/CalmLensDocumentViewer.svelte +7 -0
- package/esm/svelte/CalmLensImageViewer.svelte +7 -0
- package/esm/svelte/CalmLensSpreadsheetViewer.svelte +7 -0
- package/esm/svelte/CalmLensTextViewer.svelte +7 -0
- package/esm/svelte/CalmLensWebsiteViewer.svelte +7 -0
- package/esm/svelte/index.d.ts +29 -6
- package/esm/svelte/index.js +7 -2
- package/esm/test-inputs.d.ts +2 -2
- package/esm/test-inputs.js +1 -1
- package/esm/testing.d.ts +29 -15
- package/esm/testing.js +1718 -429
- package/esm/ui-YQuvbidU.d.ts +139 -0
- package/esm/ui-heryDd6g.js +1258 -0
- package/esm/ui.d.ts +3 -2
- package/esm/ui.js +4 -3
- package/esm/vue.d.ts +802 -199
- package/esm/vue.js +308 -103
- package/package.json +4 -2
- package/cjs/CalmLensServerClient-C-jsjn8m.d.ts +0 -259
- package/cjs/ModerationContext-9lGm-Mna-CcmbRnOy.d.ts +0 -67
- package/cjs/index-DxbJ_Xaa.d.ts +0 -253
- package/cjs/ui-BSqPGKrZ.d.ts +0 -539
- package/cjs/ui-CX1z2pD9.js +0 -586
- package/esm/CalmLensServerClient-C-jsjn8m.d.ts +0 -259
- package/esm/ModerationContext-9lGm-Mna-CcmbRnOy.d.ts +0 -67
- package/esm/index-DxbJ_Xaa.d.ts +0 -253
- package/esm/svelte/CalmLensMedia.svelte +0 -134
- package/esm/ui-BSqPGKrZ.d.ts +0 -539
- package/esm/ui-CXH7xJpb.js +0 -461
package/cjs/file-icons.d.ts
CHANGED
|
@@ -1,67 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 { $ as GetAssetInfoOptions, M as CdnResource, Un as AssetInfo } from "./CalmLensTypes-BDKwThbO.js";
|
|
3
|
+
import "./WebhookPayload-Dt6DttS0.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,
|
|
2
|
-
import { $ as
|
|
3
|
-
import {
|
|
4
|
-
import { a as
|
|
5
|
-
|
|
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 GetAssetInfoOptions, $n as FileMetadata, $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 AssetRendered, Jt as UpdateFolderOptions, K as EnsureLensesOptions, Kn as AssetHlsStatus, 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 ExtractedText, 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 AssetSafetyHold, Xt as UpdateLensOptions, Y as EnsureUploadPresetsResponse, Yn as AssetRenderedKind, Yt as UpdateHashListOptions, Z as FolderIdOptions, Zn as AssetSafetyHoldReason, 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 MetadataItem, 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 AssetPreview, 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, tr as ProcessingOptions, 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-BDKwThbO.js";
|
|
3
|
+
import { i as getAssetInfo, n as DEFAULT_CDN_BASE_URL, r as CDN_RESOURCES, t as SDK_VERSION } from "./index-Bde1wjiw.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-Dt6DttS0.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 AssetHlsStatus, 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 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 };
|
package/cjs/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_ModerationContextLimits = require("./ModerationContextLimits-
|
|
2
|
+
const require_ModerationContextLimits = require("./ModerationContextLimits-ud1xpZRK.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.
|
|
10
|
+
exports.getAssetInfo = require_ModerationContextLimits.getAssetInfo;
|
|
10
11
|
exports.selectModerationContextItems = require_ModerationContextLimits.selectModerationContextItems;
|
package/cjs/react-native.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { n as useCalmLensUpload, t as UseCalmLensUploadResult } from "./ReactUpload-
|
|
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-C33pkBmf.js";
|
|
2
|
+
import { n as useCalmLensUpload, t as UseCalmLensUploadResult } from "./ReactUpload-DhF8mm51.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
|
-
/**
|
|
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
|
|
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
|
|
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
|
|
52
|
-
*
|
|
53
|
-
*
|
|
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
|
|
56
|
-
export {
|
|
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 };
|