calmlens 0.25.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.
- package/README.md +14 -14
- package/bin/calmlens.js +2202 -521
- package/cjs/{BrowserUpload-AO2-2U5Z.js → BrowserUpload-DdkcoZLH.js} +1 -1
- package/{esm/BrowserUpload-D2lemMIU.d.ts → cjs/BrowserUpload-zYWKtFSs.d.ts} +2 -2
- package/cjs/{CalmLensAppClient-nv6qwja0.js → CalmLensAppClient-Gu9mU_66.js} +22 -15
- package/{esm/CalmLensAppClient-Dt0t9Bk6.d.ts → cjs/CalmLensAppClient-mTTjqpRc.d.ts} +5 -11
- package/cjs/{CalmLensOptionKeys-BvCac9NO.js → CalmLensOptionKeys-BCITGsr9.js} +138 -90
- package/cjs/CalmLensServerClient-D5-njsNk.d.ts +357 -0
- package/cjs/{CalmLensServerClient-B60kCBCR.js → CalmLensServerClient-DHmAPT1u.js} +283 -303
- package/cjs/{CalmLensTypes-BhR7LFDu.d.ts → CalmLensTypes-Df8eBgWB.d.ts} +127 -59
- package/cjs/{Core-DSMxC2GL.d.ts → Core-CREGGR0L.d.ts} +10 -3
- package/cjs/{Core-Cw4IxFUq.js → Core-DAf9lqe2.js} +30 -12
- package/{esm/ModerationContextLimits-Bqr0duav.js → cjs/ModerationContextLimits-D4iwqoN_.js} +858 -28
- package/cjs/{ReactUpload--oDFltw2.js → ReactUpload-BNIbpxIH.js} +38 -2
- package/cjs/ReactUpload-D4htIz8X.d.ts +27 -0
- package/cjs/{UploadController-ObdgTaBl.js → UploadController-B_lKxvpM.js} +16 -3
- package/cjs/{WebhookPayload-DLGGOGW6.d.ts → WebhookPayload-DMa6ihHr.d.ts} +152 -3
- package/cjs/app.d.ts +5 -5
- package/cjs/app.js +20 -2
- package/cjs/elements.d.ts +5 -5
- package/cjs/elements.js +102 -67
- package/cjs/{index-AAWuerkU.d.ts → index-CtpQldn_.d.ts} +2 -2
- package/cjs/index.d.ts +4 -4
- package/cjs/index.js +19 -1
- package/cjs/react-native.d.ts +3 -3
- package/cjs/react-native.js +6 -4
- package/cjs/react.d.ts +5 -4
- package/cjs/react.js +10 -14
- package/cjs/server.d.ts +5 -5
- package/cjs/server.js +20 -2
- package/cjs/testing.d.ts +11 -9
- package/cjs/testing.js +72 -41
- package/cjs/{ui-CcuGKTcL.d.ts → ui-BwFPFrno.d.ts} +2 -2
- package/cjs/{ui-CA16jyfZ.js → ui-CvlJmRYM.js} +6 -4
- package/cjs/ui.d.ts +3 -3
- package/cjs/ui.js +4 -3
- package/cjs/vue.d.ts +15 -8
- package/cjs/vue.js +29 -16
- package/esm/{BrowserUpload-Co4T6uGk.js → BrowserUpload-BAWYEBd7.js} +1 -1
- package/{cjs/BrowserUpload-D2lemMIU.d.ts → esm/BrowserUpload-zYWKtFSs.d.ts} +2 -2
- package/esm/{CalmLensAppClient-BRzy4dwn.js → CalmLensAppClient-DNkIZb6x.js} +22 -15
- package/{cjs/CalmLensAppClient-Dt0t9Bk6.d.ts → esm/CalmLensAppClient-mTTjqpRc.d.ts} +5 -11
- package/esm/{CalmLensOptionKeys-bE3rb5PN.js → CalmLensOptionKeys-CYHJo3nV.js} +133 -91
- package/esm/{CalmLensServerClient-_PRi90wI.js → CalmLensServerClient-B1AiR4nv.js} +283 -303
- package/esm/CalmLensServerClient-D5-njsNk.d.ts +357 -0
- package/esm/{CalmLensTypes-BhR7LFDu.d.ts → CalmLensTypes-Df8eBgWB.d.ts} +127 -59
- package/esm/{Core-DSMxC2GL.d.ts → Core-CREGGR0L.d.ts} +10 -3
- package/esm/{Core-CtbYmeXG.js → Core-xNBQxZWH.js} +30 -12
- package/{cjs/ModerationContextLimits-Cn9RvnZH.js → esm/ModerationContextLimits-DxuPP4uM.js} +475 -285
- package/esm/{ReactUpload-B5itHBSF.js → ReactUpload-BWifQdLv.js} +34 -4
- package/esm/ReactUpload-D4htIz8X.d.ts +27 -0
- package/esm/{UploadController-C7fL3Iz9.js → UploadController-jlJdddyI.js} +11 -4
- package/esm/{WebhookPayload-DLGGOGW6.d.ts → WebhookPayload-DMa6ihHr.d.ts} +152 -3
- package/esm/app.d.ts +5 -5
- package/esm/app.js +3 -3
- package/esm/elements.d.ts +5 -5
- package/esm/elements.js +102 -68
- package/esm/{index-AAWuerkU.d.ts → index-CtpQldn_.d.ts} +2 -2
- package/esm/index.d.ts +4 -4
- package/esm/index.js +1 -1
- package/esm/react-native.d.ts +3 -3
- package/esm/react-native.js +5 -5
- package/esm/react.d.ts +5 -4
- package/esm/react.js +9 -15
- package/esm/server.d.ts +5 -5
- package/esm/server.js +3 -3
- package/esm/styles.css +28 -10
- package/esm/svelte/CalmLensUploader.svelte +17 -17
- package/esm/svelte/context.js +21 -0
- package/esm/svelte/index.d.ts +12 -0
- package/esm/svelte/index.js +1 -0
- package/esm/testing.d.ts +11 -9
- package/esm/testing.js +72 -41
- package/esm/{ui-B98AucZA.js → ui-BXzzqh7M.js} +6 -4
- package/esm/{ui-CcuGKTcL.d.ts → ui-BwFPFrno.d.ts} +2 -2
- package/esm/ui.d.ts +3 -3
- package/esm/ui.js +4 -4
- package/esm/vue.d.ts +15 -8
- package/esm/vue.js +29 -18
- package/package.json +16 -6
- package/cjs/CalmLensServerClient-7XjQaeKu.d.ts +0 -353
- package/cjs/ReactUpload-CW4NzAsh.d.ts +0 -17
- package/esm/CalmLensServerClient-7XjQaeKu.d.ts +0 -353
- package/esm/ReactUpload-CW4NzAsh.d.ts +0 -17
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./Classification-CxRedzgH-C9qlYW_J.js";
|
|
2
|
-
import {
|
|
3
|
-
import "./WebhookPayload-
|
|
2
|
+
import { Ln as AssetInfo, N as CdnResource, tt as GetAssetInfoOptions } from "./CalmLensTypes-Df8eBgWB.js";
|
|
3
|
+
import "./WebhookPayload-DMa6ihHr.js";
|
|
4
4
|
/** Every CDN resource beneath an asset URL, as `getAssetUrl` and `signAssetUrl` accept them. */
|
|
5
5
|
declare const CDN_RESOURCES: CdnResource[];
|
|
6
6
|
/**
|
package/esm/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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
|
|
3
|
-
import { i as getAssetInfo, n as DEFAULT_CDN_BASE_URL, r as CDN_RESOURCES, t as SDK_VERSION } from "./index-
|
|
4
|
-
import { a as
|
|
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 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
|
|
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 { i as getAssetInfo, n as DEFAULT_CDN_BASE_URL, r as CDN_RESOURCES, t as SDK_VERSION } from "./index-CtpQldn_.js";
|
|
4
|
+
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";
|
|
5
|
+
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, 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/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { I as AUTO_PAGING_TO_ARRAY_MAX, V as CALMLENS_ERROR_CODES, i as CDN_RESOURCES, H as CalmLensApiError, U as CalmLensAuthenticationError, W as CalmLensBadRequestError, G as CalmLensCancelledError, K as CalmLensConfigurationError, q as CalmLensConflictError, J as CalmLensConnectionError, Y as CalmLensError, X as CalmLensInvalidArgumentError, Z as CalmLensInvalidResponseError, Q as CalmLensNotFoundError, $ as CalmLensPayloadTooLargeError, et as CalmLensPermissionDeniedError, tt as CalmLensRateLimitError, nt as CalmLensServerError, rt as CalmLensTimeoutError, it as CalmLensUnprocessableEntityError, at as CalmLensWebhookVerificationError, u as DEFAULT_CDN_BASE_URL, t as MODERATION_CONTEXT_USED_CHARACTERS, n as MODERATION_CONTEXT_USED_ITEMS, N as SDK_VERSION, s as getAssetInfo, r as selectModerationContextItems } from "./ModerationContextLimits-DxuPP4uM.js";
|
package/esm/react-native.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import {
|
|
1
|
+
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, I as UploadItem, J as AssetSessionState, K as AssetOptions, L as UploadSnapshot, M as UploadClient, N as UploadController, O as CalmLensProvidedOptions, P as UploadControllerOptions, 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, a as ProgressFetchOptions, b as describeUploadItem, c as ICON_ATTRIBUTES, d as AssetDisplayOptions, et as getAssetView, f as AssetEventHandlers, g as CalmLensMessages, h as UploaderProps, i as CALMLENS_STYLES, it as pickAssetSource, j as CustomUploadResult, k as CalmLensUpload, l as IconName, m as UploaderDisplayOptions, n as CalmLensTheme, nt as getPeakHeights, o as createProgressFetch, p as AssetProps, q as AssetSession, r as resolveTheme, rt as getPlayedPercent, s as ICONS, t as CALMLENS_THEME, tt as getAssetViewKey, u as ASSET_FILE_ICON_SIZE, v as UploadItemView, w as getDropzoneHint, x as describeUploader, y as UploaderView, z as createUploadController } from "./Core-CREGGR0L.js";
|
|
2
|
+
import { i as useCalmLensUpload, n as CalmLensProviderProps, r as UseCalmLensUploadResult, t as CalmLensProvider } from "./ReactUpload-D4htIz8X.js";
|
|
3
3
|
import { ReactNode } from "react";
|
|
4
4
|
import { StyleProp, ViewStyle } from "react-native";
|
|
5
5
|
/** What the uploader asks your picker for. */
|
|
@@ -94,4 +94,4 @@ export type CalmLensAssetProps = Omit<AssetOptions, "document" | "spreadsheet">
|
|
|
94
94
|
* reveal button; content the CDN refuses shows the unavailable notice.
|
|
95
95
|
*/
|
|
96
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 };
|
|
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 CalmLensProvidedOptions, CalmLensProvider, type CalmLensProviderProps, 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, withProvidedOptions };
|
package/esm/react-native.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as appendAssetLocation } from "./ModerationContextLimits-
|
|
2
|
-
import {
|
|
3
|
-
import { C as CALMLENS_THEME, _ 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-
|
|
1
|
+
import { a as appendAssetLocation } from "./ModerationContextLimits-DxuPP4uM.js";
|
|
2
|
+
import { a as createProgressFetch, i as withProvidedOptions, n as createUploadController, r as isFileAccepted, t as UploadController } from "./UploadController-jlJdddyI.js";
|
|
3
|
+
import { C as CALMLENS_THEME, _ 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 { a as getFileIcon, o as getFileIconLabel, t as FILE_ICON_COLORS } from "./FileIcons-M6dzjFxd.js";
|
|
5
|
-
import { n as
|
|
5
|
+
import { i as useUploadSnapshot, n as useCalmLensUpload, r as useOwnController, t as CalmLensProvider } from "./ReactUpload-BWifQdLv.js";
|
|
6
6
|
import { useEffect, useMemo, useRef, useState } from "react";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import { Image, Linking, PixelRatio, Pressable, StyleSheet, Text, View } from "react-native";
|
|
@@ -594,4 +594,4 @@ function CalmLensAsset(props) {
|
|
|
594
594
|
]
|
|
595
595
|
});
|
|
596
596
|
}
|
|
597
|
-
export { ASSET_FILE_ICON_SIZE, AssetSession, CALMLENS_STYLES, CALMLENS_THEME, CHOOSE_TEST_ID, CalmLensAsset, CalmLensUploader, DEFAULT_MESSAGES, ICONS, ICON_ATTRIBUTES, UploadController, createProgressFetch, createUploadController, describeUploadItem, describeUploader, formatBytes, formatMessage, getAssetAspectRatio, getAssetView, getAssetViewKey, getDropzoneHint, getPeakHeights, getPlayedPercent, getUploadItemMessage, getUploadItemOutcome, isFileAccepted, pickAssetSource, resolveMessages, resolveTheme, useCalmLensUpload };
|
|
597
|
+
export { ASSET_FILE_ICON_SIZE, AssetSession, CALMLENS_STYLES, CALMLENS_THEME, CHOOSE_TEST_ID, CalmLensAsset, CalmLensProvider, CalmLensUploader, DEFAULT_MESSAGES, ICONS, ICON_ATTRIBUTES, UploadController, createProgressFetch, createUploadController, describeUploadItem, describeUploader, formatBytes, formatMessage, getAssetAspectRatio, getAssetView, getAssetViewKey, getDropzoneHint, getPeakHeights, getPlayedPercent, getUploadItemMessage, getUploadItemOutcome, isFileAccepted, pickAssetSource, resolveMessages, resolveTheme, useCalmLensUpload, withProvidedOptions };
|
package/esm/react.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
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";
|
|
2
|
+
import { n as CalmLensProviderProps, t as CalmLensProvider } from "./ReactUpload-D4htIz8X.js";
|
|
3
|
+
import { a as UploaderProps, i as UploadSnapshot, n as UploadControllerOptions, o as UseCalmLensUploadResult, 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";
|
|
4
5
|
import { CSSProperties, HTMLAttributes, ReactNode } from "react";
|
|
5
6
|
type ElementProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
6
7
|
/** Leaves out the stylesheet the viewers render, so you can style the `calmlens-*` classes. */
|
|
@@ -60,4 +61,4 @@ export type CalmLensAssetProps = AssetProps & StyleOptions & Omit<HTMLAttributes
|
|
|
60
61
|
* and a reveal button; content the CDN refuses shows the unavailable notice.
|
|
61
62
|
*/
|
|
62
63
|
export declare function CalmLensAsset(props: CalmLensAssetProps): import("react").JSX.Element;
|
|
63
|
-
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, type UseCalmLensUploadResult, 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 };
|
|
64
|
+
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, CalmLensProvider, type CalmLensProviderProps, 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, type UseCalmLensUploadResult, 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/react.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
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-
|
|
3
|
-
import {
|
|
4
|
-
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, n as CALMLENS_STYLES_ID, 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-
|
|
2
|
+
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";
|
|
3
|
+
import { a as createProgressFetch, i as withProvidedOptions, r as isFileAccepted, t as UploadController } from "./UploadController-jlJdddyI.js";
|
|
4
|
+
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, n as CALMLENS_STYLES_ID, 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";
|
|
5
5
|
import { c as renderFileIconSvg } from "./FileIcons-M6dzjFxd.js";
|
|
6
|
-
import { n as
|
|
7
|
-
import { t as createUploadController } from "./BrowserUpload-
|
|
6
|
+
import { i as useUploadSnapshot, n as useCalmLensUpload$1, r as useOwnController, t as CalmLensProvider } from "./ReactUpload-BWifQdLv.js";
|
|
7
|
+
import { t as createUploadController } from "./BrowserUpload-BAWYEBd7.js";
|
|
8
8
|
import { useEffect, useMemo, useRef, useState } from "react";
|
|
9
9
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
const OPTION_NAMES = /* @__PURE__ */ new Set([
|
|
@@ -237,17 +237,11 @@ function CalmLensUploader({ disabled, capture, messages: overrides, unstyled, co
|
|
|
237
237
|
className: "calmlens-upload__size",
|
|
238
238
|
children: itemView.size
|
|
239
239
|
}),
|
|
240
|
-
itemView.busy && /* @__PURE__ */ jsx("
|
|
240
|
+
itemView.busy && /* @__PURE__ */ jsx("progress", {
|
|
241
241
|
className: "calmlens-progress",
|
|
242
|
-
role: "progressbar",
|
|
243
242
|
"aria-label": itemView.message,
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
"aria-valuenow": itemView.progressPercent,
|
|
247
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
248
|
-
className: "calmlens-progress__bar",
|
|
249
|
-
style: itemView.progressPercent === void 0 ? void 0 : { width: `${itemView.progressPercent}%` }
|
|
250
|
-
})
|
|
243
|
+
max: 100,
|
|
244
|
+
value: itemView.progressPercent
|
|
251
245
|
}),
|
|
252
246
|
itemView.message && /* @__PURE__ */ jsx("p", {
|
|
253
247
|
className: "calmlens-upload__message",
|
|
@@ -576,4 +570,4 @@ function CalmLensAsset(props) {
|
|
|
576
570
|
]
|
|
577
571
|
});
|
|
578
572
|
}
|
|
579
|
-
export { ASSET_FILE_ICON_SIZE, ASSET_VIEWERS, AssetSession, AssetViewerMount, CALMLENS_STYLES, CALMLENS_THEME, CalmLensAsset, CalmLensDocumentViewer, CalmLensImageViewer, CalmLensSpreadsheetViewer, CalmLensTextViewer, CalmLensUploader, CalmLensWebsiteViewer, DEFAULT_MESSAGES, DEFAULT_VIEWER_MESSAGES, ICONS, ICON_ATTRIBUTES, MediaStreamPlayer, UploadController, VIEWER_STYLES, 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, useCalmLensUpload };
|
|
573
|
+
export { ASSET_FILE_ICON_SIZE, ASSET_VIEWERS, AssetSession, AssetViewerMount, CALMLENS_STYLES, CALMLENS_THEME, CalmLensAsset, CalmLensDocumentViewer, CalmLensImageViewer, CalmLensProvider, CalmLensSpreadsheetViewer, CalmLensTextViewer, CalmLensUploader, CalmLensWebsiteViewer, DEFAULT_MESSAGES, DEFAULT_VIEWER_MESSAGES, ICONS, ICON_ATTRIBUTES, MediaStreamPlayer, UploadController, VIEWER_STYLES, 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, useCalmLensUpload, withProvidedOptions };
|
package/esm/server.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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
|
|
3
|
-
import { i as getAssetInfo, n as DEFAULT_CDN_BASE_URL, r as CDN_RESOURCES, t as SDK_VERSION } from "./index-
|
|
4
|
-
import { a as
|
|
5
|
-
import { t as CalmLensServerClient } from "./CalmLensServerClient-
|
|
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 { i as getAssetInfo, n as DEFAULT_CDN_BASE_URL, r as CDN_RESOURCES, t as SDK_VERSION } from "./index-CtpQldn_.js";
|
|
4
|
+
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";
|
|
5
|
+
import { t as CalmLensServerClient } from "./CalmLensServerClient-D5-njsNk.js";
|
|
6
6
|
export declare const WEBHOOK_DELIVERY_HEADER = "x-calmlens-delivery";
|
|
7
7
|
export declare const WEBHOOK_TIMESTAMP_HEADER = "x-calmlens-timestamp";
|
|
8
8
|
export declare const WEBHOOK_SIGNATURE_HEADER = "x-calmlens-signature";
|
|
@@ -71,4 +71,4 @@ export declare const isTestWebhookEvent: (event: Pick<ReceivedWebhookEventPayloa
|
|
|
71
71
|
* new. Store the event's `assetSequence` per `assetId` once you have applied it.
|
|
72
72
|
*/
|
|
73
73
|
export declare const isNewerAssetEvent: (event: Pick<ReceivedWebhookEventPayload, "assetSequence">, lastSequence: number | null | undefined) => boolean;
|
|
74
|
-
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, CalmLensServerClient, 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
|
|
74
|
+
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, 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, CalmLensServerClient, 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/server.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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 { a as WEBHOOK_TIMESTAMP_HEADER, c as isNewerAssetEvent, d as verifyWebhookSignature, i as WEBHOOK_SIGNATURE_TOLERANCE_SECONDS, l as isTestWebhookEvent, n as WEBHOOK_DELIVERY_HEADER, o as getEventFact, r as WEBHOOK_SIGNATURE_HEADER, s as getEventFacts, t as CalmLensServerClient, u as parseWebhookEvent } from "./CalmLensServerClient-
|
|
4
|
-
export { CALMLENS_ERROR_CODES, CDN_RESOURCES, CalmLensError, CalmLensServerClient, DEFAULT_CDN_BASE_URL, MODERATION_CONTEXT_USED_CHARACTERS, MODERATION_CONTEXT_USED_ITEMS, SDK_VERSION, WEBHOOK_DELIVERY_HEADER, WEBHOOK_SIGNATURE_HEADER, WEBHOOK_SIGNATURE_TOLERANCE_SECONDS, WEBHOOK_TIMESTAMP_HEADER, getAssetInfo, getEventFact, getEventFacts, isNewerAssetEvent, isTestWebhookEvent, parseWebhookEvent, selectModerationContextItems, verifyWebhookSignature };
|
|
3
|
+
import { a as WEBHOOK_TIMESTAMP_HEADER, c as isNewerAssetEvent, d as verifyWebhookSignature, i as WEBHOOK_SIGNATURE_TOLERANCE_SECONDS, l as isTestWebhookEvent, n as WEBHOOK_DELIVERY_HEADER, o as getEventFact, r as WEBHOOK_SIGNATURE_HEADER, s as getEventFacts, t as CalmLensServerClient, u as parseWebhookEvent } from "./CalmLensServerClient-B1AiR4nv.js";
|
|
4
|
+
export { AUTO_PAGING_TO_ARRAY_MAX, CALMLENS_ERROR_CODES, CDN_RESOURCES, CalmLensApiError, CalmLensAuthenticationError, CalmLensBadRequestError, CalmLensCancelledError, CalmLensConfigurationError, CalmLensConflictError, CalmLensConnectionError, CalmLensError, CalmLensInvalidArgumentError, CalmLensInvalidResponseError, CalmLensNotFoundError, CalmLensPayloadTooLargeError, CalmLensPermissionDeniedError, CalmLensRateLimitError, CalmLensServerClient, CalmLensServerError, CalmLensTimeoutError, CalmLensUnprocessableEntityError, CalmLensWebhookVerificationError, DEFAULT_CDN_BASE_URL, MODERATION_CONTEXT_USED_CHARACTERS, MODERATION_CONTEXT_USED_ITEMS, SDK_VERSION, WEBHOOK_DELIVERY_HEADER, WEBHOOK_SIGNATURE_HEADER, WEBHOOK_SIGNATURE_TOLERANCE_SECONDS, WEBHOOK_TIMESTAMP_HEADER, getAssetInfo, getEventFact, getEventFacts, isNewerAssetEvent, isTestWebhookEvent, parseWebhookEvent, selectModerationContextItems, verifyWebhookSignature };
|
package/esm/styles.css
CHANGED
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
}
|
|
19
19
|
.calmlens-uploader *, .calmlens-asset * { box-sizing: border-box; }
|
|
20
20
|
.calmlens-uploader { display: grid; gap: 12px; }
|
|
21
|
-
.calmlens-uploader > [hidden]
|
|
21
|
+
.calmlens-uploader > [hidden],
|
|
22
|
+
.calmlens-uploader .calmlens-upload [hidden] { display: none; }
|
|
22
23
|
.calmlens-dropzone {
|
|
23
24
|
display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
|
|
24
25
|
padding: 40px 24px; text-align: center;
|
|
@@ -90,16 +91,31 @@
|
|
|
90
91
|
.calmlens-upload__size { font-size: 0.875em; color: var(--calmlens-muted); }
|
|
91
92
|
.calmlens-upload__message { font-size: 0.875em; margin: 0; }
|
|
92
93
|
.calmlens-progress {
|
|
93
|
-
|
|
94
|
+
appearance: none; display: block; inline-size: 100%; block-size: 4px;
|
|
95
|
+
border: 0; border-radius: 2px; overflow: clip; background: var(--calmlens-border);
|
|
96
|
+
container-type: inline-size;
|
|
94
97
|
}
|
|
95
|
-
.calmlens-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
+
.calmlens-progress::-webkit-progress-bar { background: transparent; }
|
|
99
|
+
.calmlens-progress::-webkit-progress-value {
|
|
100
|
+
background: var(--calmlens-accent); border-radius: 2px; animation: var(--calmlens-progress-animation, none);
|
|
98
101
|
}
|
|
99
|
-
.calmlens-progress
|
|
100
|
-
|
|
102
|
+
.calmlens-progress::-moz-progress-bar {
|
|
103
|
+
background: var(--calmlens-accent); border-radius: 2px; animation: var(--calmlens-progress-animation, none);
|
|
104
|
+
}
|
|
105
|
+
.calmlens-progress:indeterminate {
|
|
106
|
+
--calmlens-progress-animation: calmlens-indeterminate 1.1s ease-in-out infinite;
|
|
107
|
+
}
|
|
108
|
+
.calmlens-progress:indeterminate:where(:dir(rtl)) {
|
|
109
|
+
--calmlens-progress-animation: calmlens-indeterminate 1.1s ease-in-out infinite reverse;
|
|
110
|
+
}
|
|
111
|
+
@keyframes calmlens-indeterminate {
|
|
112
|
+
from, to { inline-size: 35%; margin-right: auto; }
|
|
113
|
+
from { translate: -100%; }
|
|
114
|
+
to { translate: 100cqi; }
|
|
115
|
+
}
|
|
116
|
+
@keyframes calmlens-indeterminate-still {
|
|
117
|
+
from, to { inline-size: 35%; margin-inline: auto; }
|
|
101
118
|
}
|
|
102
|
-
@keyframes calmlens-indeterminate { from { left: -35%; } to { left: 100%; } }
|
|
103
119
|
.calmlens-upload__actions { display: flex; gap: 8px; align-items: center; }
|
|
104
120
|
.calmlens-icon-button {
|
|
105
121
|
display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border-radius: 8px; cursor: pointer;
|
|
@@ -107,8 +123,10 @@
|
|
|
107
123
|
}
|
|
108
124
|
.calmlens-icon-button:hover { background: color-mix(in srgb, var(--calmlens-accent) 8%, transparent); border-color: var(--calmlens-border); }
|
|
109
125
|
@media (prefers-reduced-motion: reduce) {
|
|
110
|
-
.calmlens-
|
|
111
|
-
.calmlens-progress:
|
|
126
|
+
.calmlens-dropzone, .calmlens-dropzone__icon, .calmlens-asset__content { transition: none; }
|
|
127
|
+
.calmlens-progress:indeterminate {
|
|
128
|
+
--calmlens-progress-animation: calmlens-indeterminate-still 1s both;
|
|
129
|
+
}
|
|
112
130
|
}
|
|
113
131
|
|
|
114
132
|
.calmlens-asset {
|
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
describeUploadItem,
|
|
7
7
|
resolveMessages,
|
|
8
8
|
type UploaderProps,
|
|
9
|
+
withProvidedOptions,
|
|
9
10
|
} from "../ui.js";
|
|
11
|
+
import { getCalmLensContext } from "./context.js";
|
|
10
12
|
import Icon from "./Icon.svelte";
|
|
11
13
|
|
|
12
14
|
let {
|
|
@@ -17,10 +19,12 @@
|
|
|
17
19
|
...options
|
|
18
20
|
}: UploaderProps = $props();
|
|
19
21
|
|
|
22
|
+
// What a setCalmLensContext above gives, under the uploader's own options.
|
|
23
|
+
const provided = getCalmLensContext();
|
|
20
24
|
// The latest options, without restarting uploads when the parent re-renders.
|
|
21
|
-
const own = createUploadController(options);
|
|
25
|
+
const own = createUploadController(withProvidedOptions(provided, { ...options }));
|
|
22
26
|
$effect.pre(() => {
|
|
23
|
-
if (!external) own.setOptions({ ...options });
|
|
27
|
+
if (!external) own.setOptions(withProvidedOptions(provided, { ...options }));
|
|
24
28
|
});
|
|
25
29
|
onMount(() => () => own.clear());
|
|
26
30
|
|
|
@@ -114,21 +118,17 @@
|
|
|
114
118
|
<span class="calmlens-upload__name">{item.file.name}</span>
|
|
115
119
|
<span class="calmlens-upload__size">{itemView.size}</span>
|
|
116
120
|
{#if itemView.busy}
|
|
117
|
-
|
|
118
|
-
class="calmlens-progress"
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
? undefined
|
|
129
|
-
: `${itemView.progressPercent}%`}
|
|
130
|
-
></div>
|
|
131
|
-
</div>
|
|
121
|
+
{#if itemView.progressPercent === undefined}
|
|
122
|
+
<progress class="calmlens-progress" aria-label={itemView.message} max={100}
|
|
123
|
+
></progress>
|
|
124
|
+
{:else}
|
|
125
|
+
<progress
|
|
126
|
+
class="calmlens-progress"
|
|
127
|
+
aria-label={itemView.message}
|
|
128
|
+
max={100}
|
|
129
|
+
value={itemView.progressPercent}
|
|
130
|
+
></progress>
|
|
131
|
+
{/if}
|
|
132
132
|
{/if}
|
|
133
133
|
{#if itemView.message}
|
|
134
134
|
<p class="calmlens-upload__message" role="status">{itemView.message}</p>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// The upload options `setCalmLensContext` gives every `CalmLensUploader` beneath a component.
|
|
2
|
+
|
|
3
|
+
import { getContext, setContext } from "svelte";
|
|
4
|
+
import { withProvidedOptions } from "../ui.js";
|
|
5
|
+
|
|
6
|
+
const KEY = Symbol("calmlens");
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Gives every `CalmLensUploader` in this component's descendants these upload options, such as
|
|
10
|
+
* `uploadPresetId` and `tokenUrl`, so they needn't be passed to each one. Call it while the
|
|
11
|
+
* component initialises. An option an uploader sets itself wins, and a nested call adds to the
|
|
12
|
+
* outer one's options.
|
|
13
|
+
*
|
|
14
|
+
* @param {import("../ui.js").CalmLensProvidedOptions} options
|
|
15
|
+
*/
|
|
16
|
+
export const setCalmLensContext = (options) => {
|
|
17
|
+
setContext(KEY, withProvidedOptions(getContext(KEY), options));
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/** The options the nearest `setCalmLensContext` gave, if any. */
|
|
21
|
+
export const getCalmLensContext = () => getContext(KEY);
|
package/esm/svelte/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Component, Snippet } from "svelte";
|
|
2
2
|
import type {
|
|
3
3
|
AssetProps,
|
|
4
|
+
CalmLensProvidedOptions,
|
|
4
5
|
CalmLensUpload as CoreCalmLensUpload,
|
|
5
6
|
UploadControllerOptions as CoreUploadControllerOptions,
|
|
6
7
|
UploaderProps as CoreUploaderProps,
|
|
@@ -21,6 +22,17 @@ export type CalmLensUpload<F extends UploadFile = File> = CoreCalmLensUpload<F>;
|
|
|
21
22
|
export type UploadSnapshot<F extends UploadFile = File> = CoreUploadSnapshot<F>;
|
|
22
23
|
export type UploadControllerOptions<F extends UploadFile = File> = CoreUploadControllerOptions<F>;
|
|
23
24
|
export type UploaderProps<F extends UploadFile = File> = CoreUploaderProps<F>;
|
|
25
|
+
/**
|
|
26
|
+
* Gives every `CalmLensUploader` in this component's descendants these upload options, such as
|
|
27
|
+
* `uploadPresetId` and `tokenUrl`. Call it while the component initialises. An option an uploader
|
|
28
|
+
* sets itself wins, and a nested call adds to the outer one's options.
|
|
29
|
+
*/
|
|
30
|
+
export declare const setCalmLensContext: <F extends UploadFile = File>(
|
|
31
|
+
options: CalmLensProvidedOptions<F>,
|
|
32
|
+
) => void;
|
|
33
|
+
/** The options the nearest `setCalmLensContext` gave, if any. */
|
|
34
|
+
export declare const getCalmLensContext: () => CalmLensProvidedOptions<File> | undefined;
|
|
35
|
+
|
|
24
36
|
/** Creates an upload queue for the components, such as one a form starts on submit. */
|
|
25
37
|
export declare const createUploadController: <F extends UploadFile = File>(
|
|
26
38
|
options: UploadControllerOptions<F>,
|
package/esm/svelte/index.js
CHANGED
|
@@ -9,3 +9,4 @@ export { default as CalmLensSpreadsheetViewer } from "./CalmLensSpreadsheetViewe
|
|
|
9
9
|
export { default as CalmLensTextViewer } from "./CalmLensTextViewer.svelte";
|
|
10
10
|
export { default as CalmLensUploader } from "./CalmLensUploader.svelte";
|
|
11
11
|
export { default as CalmLensWebsiteViewer } from "./CalmLensWebsiteViewer.svelte";
|
|
12
|
+
export { getCalmLensContext, setCalmLensContext } from "./context.js";
|
package/esm/testing.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as CalmLensAppClient } from "./CalmLensAppClient-
|
|
3
|
-
import {
|
|
4
|
-
import { t as CalmLensServerClient } from "./CalmLensServerClient-
|
|
1
|
+
import { In as AssetBinaryPayloadInput, It as SignUploadTokenOptions, O as CalmLensAppClientOptions, Rt as SignedUploadToken, _n as PermissionGrant, k as CalmLensServerClientOptions, m as AssetModeration, r as Asset, un as TypedEvent, vn as Folder } from "./CalmLensTypes-Df8eBgWB.js";
|
|
2
|
+
import { t as CalmLensAppClient } from "./CalmLensAppClient-mTTjqpRc.js";
|
|
3
|
+
import { I as ApiErrorCode, n as WebhookEventPayload } from "./WebhookPayload-DMa6ihHr.js";
|
|
4
|
+
import { t as CalmLensServerClient } from "./CalmLensServerClient-D5-njsNk.js";
|
|
5
5
|
import { t as ClassificationTestSignal } from "./TestTriggers-BJ4B-MXR-D1tGifPU.js";
|
|
6
6
|
import "zod";
|
|
7
7
|
/**
|
|
@@ -96,7 +96,7 @@ export declare class MockDecision {
|
|
|
96
96
|
* `flaggedCategories`. `requestedAt` is when a pending review joined the queue. `undefined` for
|
|
97
97
|
* `pending` and `failed`.
|
|
98
98
|
*/
|
|
99
|
-
report(requestedAt?: number): Omit<AssetModeration, "
|
|
99
|
+
report(requestedAt?: number): Omit<AssetModeration, "decision" | "manualReviews"> | undefined;
|
|
100
100
|
}
|
|
101
101
|
/** Starts a moderation decision with this status; see `MockDecision`. */
|
|
102
102
|
export declare const mockDecision: (status: MockAssetOutcome) => MockDecision;
|
|
@@ -194,13 +194,13 @@ type MockReviewDecision = "allowed" | "limited" | "age-restricted" | "blocked" |
|
|
|
194
194
|
* method that sends it; `callsTo` and `failNextRequest` also match the others (see
|
|
195
195
|
* `MockCalmLensCall`).
|
|
196
196
|
*/
|
|
197
|
-
declare const MOCK_OPERATIONS: readonly ["assets.list", "assets.
|
|
197
|
+
declare const MOCK_OPERATIONS: readonly ["assets.list", "assets.search", "assets.retrieve", "assets.waitForDecision", "assets.update", "assets.listChildren", "assets.listTimeline", "assets.create", "assets.classify", "assets.uploadPart", "assets.move", "assets.retry", "assets.explain", "assets.decide", "assets.removeContent", "assets.delete", "assets.batch", "text.classify", "cdn.serve", "cdn.getAssetInfo", "cdn.signAssetUrl", "events.list", "folders.list", "folders.retrieve", "folders.create", "folders.update", "folders.delete", "folders.move", "hashLists.list", "hashLists.retrieve", "hashLists.create", "hashLists.update", "hashLists.delete", "hashLists.listEntries", "hashLists.addEntry", "hashLists.removeEntry", "policies.list", "policies.retrieve", "policies.create", "policies.update", "policies.reset", "policies.upgrade", "policies.setAutomaticUpdates", "policies.delete", "policies.retrieveAssigned", "policies.assign", "lenses.list", "lenses.create", "lenses.retrieve", "lenses.update", "lenses.delete", "ensureLens", "ensureLenses", "uploadPresets.list", "uploadPresets.ensure", "uploadPresets.delete", "projectSettings.get", "projectSettings.update", "metadataFields.list", "metadataFields.ensure", "metadataFields.delete"];
|
|
198
198
|
type MockCalmLensOperation = (typeof MOCK_OPERATIONS)[number];
|
|
199
199
|
/**
|
|
200
200
|
* One request a mock client sent, as the in-memory API received it. `operation` is the client
|
|
201
201
|
* method that sends it; requests several methods send are recorded under the first: `text.classify`
|
|
202
202
|
* as `assets.classify`, `ensureLens` as `ensureLenses`, `assets.waitForDecision` polls as
|
|
203
|
-
* `assets.retrieve`,
|
|
203
|
+
* `assets.retrieve`, and so on. `callsTo` matches all of
|
|
204
204
|
* them. Methods that send nothing, such as `uploadTokens.sign` or a cached `ensureLens`, are not
|
|
205
205
|
* recorded.
|
|
206
206
|
*/
|
|
@@ -252,7 +252,7 @@ interface MockUploadPreset {
|
|
|
252
252
|
/** Accepted content types, such as `["image/*"]`. Defaults to any type. */
|
|
253
253
|
allowedContentTypes?: string[];
|
|
254
254
|
maxFileSizeInBytes?: number;
|
|
255
|
-
/** Return `classification.moderation.
|
|
255
|
+
/** Return `classification.moderation.decision` to the uploader. Defaults to `true`. */
|
|
256
256
|
showDecisions?: boolean;
|
|
257
257
|
/** Defaults to `public`. */
|
|
258
258
|
visibility?: "public" | "private";
|
|
@@ -260,7 +260,9 @@ interface MockUploadPreset {
|
|
|
260
260
|
retainContent?: boolean;
|
|
261
261
|
folderId?: string | null;
|
|
262
262
|
}
|
|
263
|
-
interface MockCalmLensServerClientOptions extends Omit<CalmLensServerClientOptions, "projectId"> {
|
|
263
|
+
interface MockCalmLensServerClientOptions extends Omit<CalmLensServerClientOptions, "apiKey" | "projectId"> {
|
|
264
|
+
/** A key from `createMockApiKey`, whose grants the mock API enforces. Never read from the environment. */
|
|
265
|
+
apiKey: string;
|
|
264
266
|
/** Defaults to `project-1`. */
|
|
265
267
|
projectId?: string;
|
|
266
268
|
mockOptions?: {
|