calmlens 0.27.3 → 0.27.5
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/bin/calmlens.js +1 -1
- package/cjs/{BrowserUpload-Dt1zocK4.d.ts → BrowserUpload-DJZY1LSU.d.ts} +2 -2
- package/cjs/{BrowserUpload-ldUKNpff.js → BrowserUpload-DhruIgFN.js} +1 -1
- package/cjs/{CalmLensAppClient--O7TSwy3.js → CalmLensAppClient-BA_xaNHY.js} +2 -2
- package/{esm/CalmLensAppClient-CTMmq7Dx.d.ts → cjs/CalmLensAppClient-DzoSqUgG.d.ts} +1 -1
- package/cjs/{CalmLensOptionKeys-BHl-sxlg.js → CalmLensOptionKeys-BvLQghl-.js} +1 -1
- package/cjs/{CalmLensServerClient--9ScUitp.d.ts → CalmLensServerClient-D3K5HS9v.d.ts} +2 -2
- package/cjs/{CalmLensServerClient-BTN0LFs6.js → CalmLensServerClient-D55xDZm4.js} +2 -2
- package/cjs/{CalmLensTypes-CRAOkOV4.d.ts → CalmLensTypes-OWZsGvBX.d.ts} +7 -2
- package/{esm/Core-BIs7IQ84.d.ts → cjs/Core-CTO_Eh0l.d.ts} +13 -14
- package/cjs/{Core-BdyadK2Y.js → Core-kKGmyk5V.js} +63 -21
- package/cjs/{ModerationContextLimits-Cyg__fp3.js → ModerationContextLimits-Cxaob3tc.js} +1 -1
- package/{esm/ReactUpload-DsF4ahE6.d.ts → cjs/ReactUpload-BDXV4aHT.d.ts} +1 -1
- package/cjs/{ReactUpload-C7-EzsLW.js → ReactUpload-Cx3Hi7xt.js} +1 -1
- package/cjs/{UploadController-wKETVSZ8.js → UploadController-CC1afxmL.js} +2 -2
- package/{esm/WebhookPayload-Cth0Xvpz.d.ts → cjs/WebhookPayload-CrMU6lg0.d.ts} +1 -1
- package/cjs/app.d.ts +4 -4
- package/cjs/app.js +2 -2
- package/cjs/elements.d.ts +8 -19
- package/cjs/elements.js +45 -53
- package/cjs/{index-BsUWhlwp.d.ts → index-BDxmVi-G.d.ts} +2 -2
- package/cjs/index.d.ts +3 -3
- package/cjs/index.js +1 -1
- package/cjs/react-native.d.ts +3 -3
- package/cjs/react-native.js +6 -4
- package/cjs/react.d.ts +5 -11
- package/cjs/react.js +29 -36
- package/cjs/server.d.ts +4 -4
- package/cjs/server.js +2 -2
- package/cjs/testing.d.ts +4 -4
- package/cjs/testing.js +5 -5
- package/cjs/{ui-CmRjBpMv.d.ts → ui-DAbpyM2Z.d.ts} +3 -9
- package/cjs/{ui-DZHhU1_I.js → ui-I75EvP9r.js} +2 -201
- package/cjs/ui.d.ts +3 -3
- package/cjs/ui.js +5 -5
- package/cjs/vue.d.ts +6 -319
- package/cjs/vue.js +27 -17
- package/esm/{BrowserUpload-DI_N79Hf.js → BrowserUpload-CejeWw5r.js} +1 -1
- package/esm/{BrowserUpload-Dt1zocK4.d.ts → BrowserUpload-DJZY1LSU.d.ts} +2 -2
- package/esm/{CalmLensAppClient-hBV8phqu.js → CalmLensAppClient-BxkCVPCl.js} +2 -2
- package/{cjs/CalmLensAppClient-CTMmq7Dx.d.ts → esm/CalmLensAppClient-DzoSqUgG.d.ts} +1 -1
- package/esm/{CalmLensOptionKeys-Cx6zlZBW.js → CalmLensOptionKeys-DC9FUO43.js} +1 -1
- package/esm/{CalmLensServerClient-C-Y82hbC.js → CalmLensServerClient-D-TIIQp2.js} +2 -2
- package/esm/{CalmLensServerClient--9ScUitp.d.ts → CalmLensServerClient-D3K5HS9v.d.ts} +2 -2
- package/esm/{CalmLensTypes-CRAOkOV4.d.ts → CalmLensTypes-OWZsGvBX.d.ts} +7 -2
- package/esm/{Core-KP_nIj1_.js → Core-B85V5dxv.js} +52 -22
- package/{cjs/Core-BIs7IQ84.d.ts → esm/Core-CTO_Eh0l.d.ts} +13 -14
- package/esm/{ModerationContextLimits-BTzR81IP.js → ModerationContextLimits-Tev2lxE0.js} +1 -1
- package/esm/{ReactUpload-DHMtN7ap.js → ReactUpload-B7QXMSWJ.js} +1 -1
- package/{cjs/ReactUpload-DsF4ahE6.d.ts → esm/ReactUpload-BDXV4aHT.d.ts} +1 -1
- package/esm/{UploadController-BlQqCkhK.js → UploadController-D7XmzO-p.js} +2 -2
- package/{cjs/WebhookPayload-Cth0Xvpz.d.ts → esm/WebhookPayload-CrMU6lg0.d.ts} +1 -1
- package/esm/app.d.ts +4 -4
- package/esm/app.js +2 -2
- package/esm/elements.d.ts +8 -19
- package/esm/elements.js +44 -50
- package/esm/{index-BsUWhlwp.d.ts → index-BDxmVi-G.d.ts} +2 -2
- package/esm/index.d.ts +3 -3
- 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 -11
- package/esm/react.js +29 -34
- package/esm/server.d.ts +4 -4
- package/esm/server.js +2 -2
- package/esm/styles.css +12 -16
- package/esm/svelte/CalmLensAsset.svelte +22 -4
- package/esm/svelte/index.d.ts +0 -6
- package/esm/svelte/index.js +0 -2
- package/esm/testing.d.ts +4 -4
- package/esm/testing.js +5 -5
- package/esm/{ui-CmRjBpMv.d.ts → ui-DAbpyM2Z.d.ts} +3 -9
- package/esm/{ui-SnbQ4vk1.js → ui-cE1lyljs.js} +3 -190
- package/esm/ui.d.ts +3 -3
- package/esm/ui.js +4 -4
- package/esm/vue.d.ts +6 -319
- package/esm/vue.js +26 -14
- package/package.json +1 -1
- package/esm/svelte/CalmLensImageViewer.svelte +0 -7
- package/esm/svelte/CalmLensWebsiteViewer.svelte +0 -7
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-CMM2tZpJ-IdIh63n0.js";
|
|
2
|
-
import { $ as FolderPage, $t as VerifyWebhookSignatureOptions, A as CdnAssetLocation, An as Policy, At as RetrieveAssetOptions, B as CreateHashListOptions, Bn as AssetRendered, Bt as UpdateAssetOptions, C as AssetUploadStatus, Cn as BoundingBox, Ct as MultipartUploadPartOptions, D as BatchAssetsResponse, Dn as ProcessingFeatureResults, Dt as RequestAttempt, E as BatchAssetsOptions, En as ProcessingFeatureId, Et as RemoveAssetContentOptions, F as CdnTransform, Ft as SignUploadTokenOptions, G as DeleteAssetOptions, Gn as FileMetadata, Gt as UpdateProjectSettingsOptions, H as CreateMultipartUploadPartOptions, Hn as AssetSafetyHold, Ht as UpdateHashListOptions, I as ClassifyTextOptions, In as AssetInfo, It as SignedAssetUrl, J as EnsureLensesOptions, Jt as UploadPresetDefinition, K as DeleteMetadataFieldOptions, Kn as MetadataItem, Kt as UpgradePolicyOptions, L as ClientRequestDefaults, Ln as AssetHls, Lt as SignedUploadToken, M as CdnAssetUrlOptions, Mn as LensType, Mt as SearchAssetsOptions, N as CdnResource, Nn as AssetSearchMatchField, Nt as SetPolicyAutomaticUpdatesOptions, O as CalmLensAppClientOptions, On as ProcessingFeatureStage, Ot as RequestOptions, P as CdnServeOptions, Pn as AssetSearchQuery, Pt as SignAssetUrlOptions, Q as FolderIdOptions, Qt as UploadedAsset, R as ConnectionOptions, Rn as AssetHlsRendition, Rt as StreamingFeatureOptions, S as AssetUpload, Sn as AgeRange, St as MultipartUploadOptions, T as AssignPolicyOptions, Tn as DetectedPerson, Tt as PolicyPage, U as CreatePolicyOptions, Un as AssetSafetyHoldReason, Ut as UpdateLensOptions, V as CreateLensOptions, Vn as AssetRenderedKind, Vt as UpdateFolderOptions, W as DecideAssetOptions, Wn as ExtractedText, Wt as UpdatePolicyOptions, X as EnsureUploadPresetsOptions, Xt as UploadPresetPage, Y as EnsureMetadataFieldsOptions, Yt as UploadPresetIdOptions, Z as EnsureUploadPresetsResponse, Zt as UploadPresetSubmitAssetOptions, _ as AssetPage, _n as Folder, _t as ListLensesOptions, a as AssetChecksums, an as AssetTimelineSegment, at as IdempotencyOptions, b as AssetTimelinePage, bn as PublicProjectSettings, bt as MoveAssetOptions, c as AssetClassificationFailureReason, cn as EventAsset, ct as LensIdOptions, d as AssetContentOptions, dn as EventFact, dt as ListAssetTimelineOptions, en as ViewerClaims, et as GetAssetInfoOptions, f as AssetContentRemovalReason, fn as EventFactValues, ft as ListAssetsOptions, g as AssetModerationStatus, gt as ListHashListsOptions, h as AssetModerationDecision, hn as EventType, ht as ListHashListEntriesOptions, i as AssetAvailability, in as AssetBatchOperation, it as HashListPage, j as CdnAssetReference, jn as CursorPage, jt as RetryAssetOptions, k as CalmLensServerClientOptions, kn as ProcessingFeatures, kt as ResetPolicyOptions, l as AssetClassificationStatus, ln as TypedEvent, lt as LensPage, m as AssetModeration, mn as EventSeverity, mt as ListFoldersOptions, n as AppInfo, nn as WebhookHeadersInput, nt as HashListEntryPage, o as AssetChildrenPage, on as GetEventsResponse, ot as ImageTransformOptions, p as AssetContentStatus, pn as EventFacts, pt as ListEventsOptions, q as EnsureLensOptions, qn as ProcessingOptions, qt as UploadAssetPartOptions, r as Asset, rn as WebhookPayloadInput, rt as HashListIdOptions, s as AssetClassification, st as Lens, t as AddHashListEntryOptions, tn as WaitForAssetDecisionOptions, tt as HashListEntryIdOptions, u as AssetContent, un as EventCategory, ut as ListAssetChildrenOptions, v as AssetSearchResponse, vn as MetadataFieldsResource, vt as ListPoliciesOptions, w as AssetVisibility, wn as DetectedFace, wt as PolicyIdOptions, x as AssetType, xn as UploadPreset, xt as MoveFolderOptions, y as AssetSearchResult, yn as ProjectSettingsResource, yt as ListUploadPresetsOptions, z as CreateFolderOptions, zn as AssetPreview, zt as SubmitAssetOptions } from "./CalmLensTypes-
|
|
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 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-
|
|
2
|
+
import { $ as FolderPage, $t as VerifyWebhookSignatureOptions, A as CdnAssetLocation, An as Policy, At as RetrieveAssetOptions, B as CreateHashListOptions, Bn as AssetRendered, Bt as UpdateAssetOptions, C as AssetUploadStatus, Cn as BoundingBox, Ct as MultipartUploadPartOptions, D as BatchAssetsResponse, Dn as ProcessingFeatureResults, Dt as RequestAttempt, E as BatchAssetsOptions, En as ProcessingFeatureId, Et as RemoveAssetContentOptions, F as CdnTransform, Ft as SignUploadTokenOptions, G as DeleteAssetOptions, Gn as FileMetadata, Gt as UpdateProjectSettingsOptions, H as CreateMultipartUploadPartOptions, Hn as AssetSafetyHold, Ht as UpdateHashListOptions, I as ClassifyTextOptions, In as AssetInfo, It as SignedAssetUrl, J as EnsureLensesOptions, Jt as UploadPresetDefinition, K as DeleteMetadataFieldOptions, Kn as MetadataItem, Kt as UpgradePolicyOptions, L as ClientRequestDefaults, Ln as AssetHls, Lt as SignedUploadToken, M as CdnAssetUrlOptions, Mn as LensType, Mt as SearchAssetsOptions, N as CdnResource, Nn as AssetSearchMatchField, Nt as SetPolicyAutomaticUpdatesOptions, O as CalmLensAppClientOptions, On as ProcessingFeatureStage, Ot as RequestOptions, P as CdnServeOptions, Pn as AssetSearchQuery, Pt as SignAssetUrlOptions, Q as FolderIdOptions, Qt as UploadedAsset, R as ConnectionOptions, Rn as AssetHlsRendition, Rt as StreamingFeatureOptions, S as AssetUpload, Sn as AgeRange, St as MultipartUploadOptions, T as AssignPolicyOptions, Tn as DetectedPerson, Tt as PolicyPage, U as CreatePolicyOptions, Un as AssetSafetyHoldReason, Ut as UpdateLensOptions, V as CreateLensOptions, Vn as AssetRenderedKind, Vt as UpdateFolderOptions, W as DecideAssetOptions, Wn as ExtractedText, Wt as UpdatePolicyOptions, X as EnsureUploadPresetsOptions, Xt as UploadPresetPage, Y as EnsureMetadataFieldsOptions, Yt as UploadPresetIdOptions, Z as EnsureUploadPresetsResponse, Zt as UploadPresetSubmitAssetOptions, _ as AssetPage, _n as Folder, _t as ListLensesOptions, a as AssetChecksums, an as AssetTimelineSegment, at as IdempotencyOptions, b as AssetTimelinePage, bn as PublicProjectSettings, bt as MoveAssetOptions, c as AssetClassificationFailureReason, cn as EventAsset, ct as LensIdOptions, d as AssetContentOptions, dn as EventFact, dt as ListAssetTimelineOptions, en as ViewerClaims, et as GetAssetInfoOptions, f as AssetContentRemovalReason, fn as EventFactValues, ft as ListAssetsOptions, g as AssetModerationStatus, gt as ListHashListsOptions, h as AssetModerationDecision, hn as EventType, ht as ListHashListEntriesOptions, i as AssetAvailability, in as AssetBatchOperation, it as HashListPage, j as CdnAssetReference, jn as CursorPage, jt as RetryAssetOptions, k as CalmLensServerClientOptions, kn as ProcessingFeatures, kt as ResetPolicyOptions, l as AssetClassificationStatus, ln as TypedEvent, lt as LensPage, m as AssetModeration, mn as EventSeverity, mt as ListFoldersOptions, n as AppInfo, nn as WebhookHeadersInput, nt as HashListEntryPage, o as AssetChildrenPage, on as GetEventsResponse, ot as ImageTransformOptions, p as AssetContentStatus, pn as EventFacts, pt as ListEventsOptions, q as EnsureLensOptions, qn as ProcessingOptions, qt as UploadAssetPartOptions, r as Asset, rn as WebhookPayloadInput, rt as HashListIdOptions, s as AssetClassification, st as Lens, t as AddHashListEntryOptions, tn as WaitForAssetDecisionOptions, tt as HashListEntryIdOptions, u as AssetContent, un as EventCategory, ut as ListAssetChildrenOptions, v as AssetSearchResponse, vn as MetadataFieldsResource, vt as ListPoliciesOptions, w as AssetVisibility, wn as DetectedFace, wt as PolicyIdOptions, x as AssetType, xn as UploadPreset, xt as MoveFolderOptions, y as AssetSearchResult, yn as ProjectSettingsResource, yt as ListUploadPresetsOptions, z as CreateFolderOptions, zn as AssetPreview, zt as SubmitAssetOptions } from "./CalmLensTypes-OWZsGvBX.js";
|
|
3
|
+
import { i as getAssetInfo, n as DEFAULT_CDN_BASE_URL, r as CDN_RESOURCES, t as SDK_VERSION } from "./index-BDxmVi-G.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-CrMU6lg0.js";
|
|
5
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 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 { 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-
|
|
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-Tev2lxE0.js";
|
package/esm/react-native.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { i as useCalmLensUpload, n as CalmLensProviderProps, r as UseCalmLensUploadResult, t as CalmLensProvider } from "./ReactUpload-
|
|
1
|
+
import { $ as MediaPlayback, 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 INSTANT_LOAD_MS, 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, at as isImageReady, b as describeUploadItem, c as ICON_ATTRIBUTES, d as AssetDisplayOptions, et as getAssetAspectRatio, f as AssetEventHandlers, g as CalmLensMessages, h as UploaderProps, i as CALMLENS_STYLES, it as getPlayedPercent, j as CustomUploadResult, k as CalmLensUpload, l as IconName, m as UploaderDisplayOptions, n as CalmLensTheme, nt as getAssetViewKey, o as createProgressFetch, ot as pickAssetSource, p as AssetProps, q as AssetSession, r as resolveTheme, rt as getPeakHeights, s as ICONS, t as CALMLENS_THEME, tt as getAssetView, u as ASSET_FILE_ICON_SIZE, v as UploadItemView, w as getDropzoneHint, x as describeUploader, y as UploaderView, z as createUploadController } from "./Core-CTO_Eh0l.js";
|
|
2
|
+
import { i as useCalmLensUpload, n as CalmLensProviderProps, r as UseCalmLensUploadResult, t as CalmLensProvider } from "./ReactUpload-BDXV4aHT.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 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 };
|
|
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, INSTANT_LOAD_MS, 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, isImageReady, pickAssetSource, resolveMessages, resolveTheme, useCalmLensUpload, withProvidedOptions };
|
package/esm/react-native.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as appendAssetLocation } from "./ModerationContextLimits-
|
|
2
|
-
import { a as
|
|
3
|
-
import {
|
|
1
|
+
import { a as appendAssetLocation } from "./ModerationContextLimits-Tev2lxE0.js";
|
|
2
|
+
import { C as pickAssetSource, E as resolveTheme, S as isImageReady, T as CALMLENS_THEME, _ as getAssetAspectRatio, a as describeUploadItem, b as getPeakHeights, c as formatMessage, d as getUploadItemOutcome, f as resolveMessages, g as INSTANT_LOAD_MS, 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 getAssetView, x as getPlayedPercent, y as getAssetViewKey } from "./Core-B85V5dxv.js";
|
|
3
|
+
import { a as createProgressFetch, i as withProvidedOptions, n as createUploadController, r as isFileAccepted, t as UploadController } from "./UploadController-D7XmzO-p.js";
|
|
4
4
|
import { a as getFileIcon, o as getFileIconLabel, t as FILE_ICON_COLORS } from "./FileIcons-M6dzjFxd.js";
|
|
5
|
-
import { i as useUploadSnapshot, n as useCalmLensUpload, r as useOwnController, t as CalmLensProvider } from "./ReactUpload-
|
|
5
|
+
import { i as useUploadSnapshot, n as useCalmLensUpload, r as useOwnController, t as CalmLensProvider } from "./ReactUpload-B7QXMSWJ.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, 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 };
|
|
597
|
+
export { ASSET_FILE_ICON_SIZE, AssetSession, CALMLENS_STYLES, CALMLENS_THEME, CHOOSE_TEST_ID, CalmLensAsset, CalmLensProvider, CalmLensUploader, DEFAULT_MESSAGES, ICONS, ICON_ATTRIBUTES, INSTANT_LOAD_MS, UploadController, createProgressFetch, createUploadController, describeUploadItem, describeUploader, formatBytes, formatMessage, getAssetAspectRatio, getAssetView, getAssetViewKey, getDropzoneHint, getPeakHeights, getPlayedPercent, getUploadItemMessage, getUploadItemOutcome, isFileAccepted, isImageReady, pickAssetSource, resolveMessages, resolveTheme, useCalmLensUpload, withProvidedOptions };
|
package/esm/react.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { n as CalmLensProviderProps, t as CalmLensProvider } from "./ReactUpload-
|
|
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-
|
|
4
|
-
import {
|
|
1
|
+
import { $ as MediaPlayback, 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 INSTANT_LOAD_MS, 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 isImageReady, b as describeUploadItem, bt as resolveViewerMessages, c as ICON_ATTRIBUTES, ct as DocumentViewerOptions, d as AssetDisplayOptions, dt as TextViewerOptions, et as getAssetAspectRatio, f as AssetEventHandlers, ft as ViewerAsset, g as CalmLensMessages, gt as isSpreadsheetFormat, ht as getAssetViewerKind, i as CALMLENS_STYLES, it as getPlayedPercent, j as CustomUploadResult, l as IconName, lt as PdfAssetOptions, m as UploaderDisplayOptions, mt as ViewerTextOptions, n as CalmLensTheme, nt as getAssetViewKey, o as createProgressFetch, ot as pickAssetSource, p as AssetProps, pt as ViewerOptions, q as AssetSession, r as resolveTheme, rt as getPeakHeights, s as ICONS, st as AssetViewerKind, t as CALMLENS_THEME, tt as getAssetView, u as ASSET_FILE_ICON_SIZE, ut as SpreadsheetViewerOptions, v as UploadItemView, vt as ViewerMessages, w as getDropzoneHint, x as describeUploader, y as UploaderView, yt as formatViewerMessage } from "./Core-CTO_Eh0l.js";
|
|
2
|
+
import { n as CalmLensProviderProps, t as CalmLensProvider } from "./ReactUpload-BDXV4aHT.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-DJZY1LSU.js";
|
|
4
|
+
import { _ as spreadsheetColumnIndex, a as isMountedViewerKind, b as AssetViewer, 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 ViewerState, y as createDocumentViewer } from "./ui-DAbpyM2Z.js";
|
|
5
5
|
import { CSSProperties, HTMLAttributes, ReactNode } from "react";
|
|
6
6
|
type ElementProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
7
7
|
/** Leaves out the stylesheet the viewers render, so you can style the `calmlens-*` classes. */
|
|
@@ -9,15 +9,9 @@ type ElementProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
|
9
9
|
className?: string;
|
|
10
10
|
style?: CSSProperties;
|
|
11
11
|
};
|
|
12
|
-
export type CalmLensImageViewerProps = ImageViewerOptions & ElementProps;
|
|
13
|
-
export type CalmLensWebsiteViewerProps = WebsiteViewerOptions & ElementProps;
|
|
14
12
|
export type CalmLensTextViewerProps = TextViewerOptions & ElementProps;
|
|
15
13
|
export type CalmLensDocumentViewerProps = DocumentViewerOptions & ElementProps;
|
|
16
14
|
export type CalmLensSpreadsheetViewerProps = SpreadsheetViewerOptions & ElementProps;
|
|
17
|
-
/** Shows an image asset's rendered file, fitted to the element, over its placeholder. */
|
|
18
|
-
export declare function CalmLensImageViewer(props: CalmLensImageViewerProps): import("react").JSX.Element;
|
|
19
|
-
/** Shows a website asset's screenshot with a link to the original page. */
|
|
20
|
-
export declare function CalmLensWebsiteViewer(props: CalmLensWebsiteViewerProps): import("react").JSX.Element;
|
|
21
15
|
/** Shows a text asset's text, escaped, in a scrolling region. */
|
|
22
16
|
export declare function CalmLensTextViewer(props: CalmLensTextViewerProps): import("react").JSX.Element;
|
|
23
17
|
/** Shows a PDF, or a document rendered as one, a page at a time with pdf.js (loaded lazily). */
|
|
@@ -61,4 +55,4 @@ export type CalmLensAssetProps = AssetProps & StyleOptions & Omit<HTMLAttributes
|
|
|
61
55
|
* and a reveal button; content the CDN refuses shows the unavailable notice.
|
|
62
56
|
*/
|
|
63
57
|
export declare function CalmLensAsset(props: CalmLensAssetProps): import("react").JSX.Element;
|
|
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,
|
|
58
|
+
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, INSTANT_LOAD_MS, type IconName, 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, createDocumentViewer, createProgressFetch, createSpreadsheetViewer, createTextViewer, createUploadController, describeUploadItem, describeUploader, formatBytes, formatMessage, formatViewerMessage, getAssetAspectRatio, getAssetView, getAssetViewKey, getAssetViewerKind, getDropzoneHint, getMountedViewerOptions, getPeakHeights, getPlayedPercent, getSpreadsheetPage, getUploadItemMessage, getUploadItemOutcome, isFileAccepted, isImageReady, isMountedViewerKind, isSpreadsheetFormat, loadPdfJs, parseSpreadsheetText, pickAssetSource, resolveMessages, resolveTheme, resolveViewerMessages, spreadsheetColumnIndex, withProvidedOptions };
|
package/esm/react.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { a as
|
|
4
|
-
import {
|
|
2
|
+
import { a as ASSET_VIEWERS, c as getSpreadsheetPage, d as createDocumentViewer, f as DEFAULT_VIEWER_MESSAGES, h as loadPdfJs, i as isMountedViewerKind, l as parseSpreadsheetText, m as resolveViewerMessages, n as AssetViewerMount, o as createSpreadsheetViewer, p as formatViewerMessage, r as getMountedViewerOptions, s as createTextViewer, t as MediaStreamPlayer, u as spreadsheetColumnIndex } from "./ui-cE1lyljs.js";
|
|
3
|
+
import { C as pickAssetSource, D as getAssetViewerKind, E as resolveTheme, O as isSpreadsheetFormat, S as isImageReady, T as CALMLENS_THEME, _ as getAssetAspectRatio, a as describeUploadItem, b as getPeakHeights, c as formatMessage, d as getUploadItemOutcome, f as resolveMessages, g as INSTANT_LOAD_MS, 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 getAssetView, w as VIEWER_STYLES, x as getPlayedPercent, y as getAssetViewKey } from "./Core-B85V5dxv.js";
|
|
4
|
+
import { a as createProgressFetch, i as withProvidedOptions, r as isFileAccepted, t as UploadController } from "./UploadController-D7XmzO-p.js";
|
|
5
5
|
import { c as renderFileIconSvg } from "./FileIcons-M6dzjFxd.js";
|
|
6
|
-
import { i as useUploadSnapshot, n as useCalmLensUpload$1, r as useOwnController, t as CalmLensProvider } from "./ReactUpload-
|
|
7
|
-
import { t as createUploadController } from "./BrowserUpload-
|
|
8
|
-
import { useEffect, useMemo, useRef, useState } from "react";
|
|
6
|
+
import { i as useUploadSnapshot, n as useCalmLensUpload$1, r as useOwnController, t as CalmLensProvider } from "./ReactUpload-B7QXMSWJ.js";
|
|
7
|
+
import { t as createUploadController } from "./BrowserUpload-CejeWw5r.js";
|
|
8
|
+
import { useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
9
9
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
const OPTION_NAMES = /* @__PURE__ */ new Set([
|
|
11
11
|
"src",
|
|
@@ -15,7 +15,6 @@ const OPTION_NAMES = /* @__PURE__ */ new Set([
|
|
|
15
15
|
"viewerClaims",
|
|
16
16
|
"label",
|
|
17
17
|
"messages",
|
|
18
|
-
"sizes",
|
|
19
18
|
"text",
|
|
20
19
|
"getText",
|
|
21
20
|
"pageSize",
|
|
@@ -61,20 +60,6 @@ function Viewer({ kind, props }) {
|
|
|
61
60
|
"data-kind": kind
|
|
62
61
|
})] });
|
|
63
62
|
}
|
|
64
|
-
/** Shows an image asset's rendered file, fitted to the element, over its placeholder. */
|
|
65
|
-
function CalmLensImageViewer(props) {
|
|
66
|
-
return /* @__PURE__ */ jsx(Viewer, {
|
|
67
|
-
kind: "image",
|
|
68
|
-
props
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
/** Shows a website asset's screenshot with a link to the original page. */
|
|
72
|
-
function CalmLensWebsiteViewer(props) {
|
|
73
|
-
return /* @__PURE__ */ jsx(Viewer, {
|
|
74
|
-
kind: "website",
|
|
75
|
-
props
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
63
|
/** Shows a text asset's text, escaped, in a scrolling region. */
|
|
79
64
|
function CalmLensTextViewer(props) {
|
|
80
65
|
return /* @__PURE__ */ jsx(Viewer, {
|
|
@@ -287,6 +272,7 @@ function CalmLensUploader({ disabled, capture, messages: overrides, unstyled, co
|
|
|
287
272
|
]
|
|
288
273
|
});
|
|
289
274
|
}
|
|
275
|
+
const useIsomorphicLayoutEffect = typeof window !== "undefined" ? useLayoutEffect : useEffect;
|
|
290
276
|
/** Audio's waveform: the preview still, with the played part of its peaks drawn over it. */
|
|
291
277
|
const Waveform = ({ url, peaks, played }) => {
|
|
292
278
|
if (!url && !peaks) return null;
|
|
@@ -356,14 +342,17 @@ function CalmLensAsset(props) {
|
|
|
356
342
|
const loadKey = getAssetViewKey(view);
|
|
357
343
|
const [load, setLoad] = useState({
|
|
358
344
|
key: loadKey,
|
|
359
|
-
state: "loading"
|
|
345
|
+
state: "loading",
|
|
346
|
+
instant: false
|
|
360
347
|
});
|
|
361
348
|
const current = load.key === loadKey ? load : {
|
|
362
349
|
key: loadKey,
|
|
363
|
-
state: "loading"
|
|
350
|
+
state: "loading",
|
|
351
|
+
instant: false
|
|
364
352
|
};
|
|
365
353
|
const [played, setPlayed] = useState(0);
|
|
366
354
|
const imageRef = useRef(null);
|
|
355
|
+
const loadStartedAt = useRef(0);
|
|
367
356
|
const media = useRef(null);
|
|
368
357
|
const viewerRoot = useRef(null);
|
|
369
358
|
const callbacks = useRef({
|
|
@@ -378,16 +367,18 @@ function CalmLensAsset(props) {
|
|
|
378
367
|
};
|
|
379
368
|
useEffect(() => setMounted(true), []);
|
|
380
369
|
useEffect(() => session.load());
|
|
381
|
-
|
|
382
|
-
|
|
370
|
+
useIsomorphicLayoutEffect(() => {
|
|
371
|
+
loadStartedAt.current = performance.now();
|
|
372
|
+
if (isImageReady(imageRef.current)) setLoad({
|
|
383
373
|
key: loadKey,
|
|
384
|
-
state: "loaded"
|
|
374
|
+
state: "loaded",
|
|
375
|
+
instant: true
|
|
385
376
|
});
|
|
386
377
|
}, [loadKey]);
|
|
387
378
|
useEffect(() => {
|
|
388
379
|
if (current.state === "loaded") callbacks.current.onLoad?.();
|
|
389
380
|
if (current.state === "error") callbacks.current.onError?.();
|
|
390
|
-
}, [current.state]);
|
|
381
|
+
}, [current.key, current.state]);
|
|
391
382
|
const availability = view.kind === "unavailable" ? "unavailable" : view.kind === "age-restricted" ? "age-restricted" : view.kind === "pending" ? void 0 : "available";
|
|
392
383
|
useEffect(() => {
|
|
393
384
|
if (availability) callbacks.current.onAvailabilityChange?.(availability);
|
|
@@ -397,7 +388,8 @@ function CalmLensAsset(props) {
|
|
|
397
388
|
viewers.update(viewerRoot.current, viewerKind, getMountedViewerOptions(options, session), (viewerState) => {
|
|
398
389
|
if (viewerState !== "loading") setLoad({
|
|
399
390
|
key: loadKey,
|
|
400
|
-
state: viewerState
|
|
391
|
+
state: viewerState,
|
|
392
|
+
instant: false
|
|
401
393
|
});
|
|
402
394
|
});
|
|
403
395
|
});
|
|
@@ -405,7 +397,7 @@ function CalmLensAsset(props) {
|
|
|
405
397
|
useEffect(() => streams.update(media.current, view));
|
|
406
398
|
useEffect(() => () => streams.stop(), [streams]);
|
|
407
399
|
const ratio = getAssetAspectRatio(view, state.info, aspectRatio);
|
|
408
|
-
const placeholderUrl = "placeholderUrl" in view && (view.kind === "age-restricted" || view.kind === "pending" || current.state !== "loaded") ? view.placeholderUrl : void 0;
|
|
400
|
+
const placeholderUrl = "placeholderUrl" in view && (view.kind === "age-restricted" || view.kind === "pending" || current.state !== "error" && !(current.state === "loaded" && current.instant)) ? view.placeholderUrl : void 0;
|
|
409
401
|
const onMediaError = (element) => {
|
|
410
402
|
if (streams.recover(element)) return;
|
|
411
403
|
session.mediaFailed({
|
|
@@ -418,7 +410,8 @@ function CalmLensAsset(props) {
|
|
|
418
410
|
session.mediaLoaded(event.currentTarget);
|
|
419
411
|
setLoad({
|
|
420
412
|
key: loadKey,
|
|
421
|
-
state: "loaded"
|
|
413
|
+
state: "loaded",
|
|
414
|
+
instant: false
|
|
422
415
|
});
|
|
423
416
|
},
|
|
424
417
|
onError: (event) => onMediaError(event.currentTarget),
|
|
@@ -435,7 +428,7 @@ function CalmLensAsset(props) {
|
|
|
435
428
|
className: "calmlens-asset__content",
|
|
436
429
|
src: shown.src,
|
|
437
430
|
srcSet: shown.srcSet,
|
|
438
|
-
sizes: shown.srcSet ? image?.sizes : void 0,
|
|
431
|
+
sizes: shown.srcSet ? image?.sizes ?? (lazy ? "auto, 100vw" : "100vw") : void 0,
|
|
439
432
|
alt,
|
|
440
433
|
width: shown.width,
|
|
441
434
|
height: shown.height,
|
|
@@ -444,9 +437,10 @@ function CalmLensAsset(props) {
|
|
|
444
437
|
fetchPriority,
|
|
445
438
|
onLoad: () => {
|
|
446
439
|
session.loaded();
|
|
447
|
-
setLoad({
|
|
440
|
+
setLoad((prev) => prev.key === loadKey && prev.state === "loaded" ? prev : {
|
|
448
441
|
key: loadKey,
|
|
449
|
-
state: "loaded"
|
|
442
|
+
state: "loaded",
|
|
443
|
+
instant: performance.now() - loadStartedAt.current < 50
|
|
450
444
|
});
|
|
451
445
|
},
|
|
452
446
|
onError: () => session.failed()
|
|
@@ -456,6 +450,7 @@ function CalmLensAsset(props) {
|
|
|
456
450
|
className: joinClassNames("calmlens-asset", className),
|
|
457
451
|
"data-kind": view.kind,
|
|
458
452
|
"data-state": current.state,
|
|
453
|
+
"data-instant": current.instant ? "" : void 0,
|
|
459
454
|
"data-sized": ratio ? "" : void 0,
|
|
460
455
|
"aria-busy": view.kind === "pending" ? true : void 0,
|
|
461
456
|
style: {
|
|
@@ -570,4 +565,4 @@ function CalmLensAsset(props) {
|
|
|
570
565
|
]
|
|
571
566
|
});
|
|
572
567
|
}
|
|
573
|
-
export { ASSET_FILE_ICON_SIZE, ASSET_VIEWERS, AssetSession, AssetViewerMount, CALMLENS_STYLES, CALMLENS_THEME, CalmLensAsset, CalmLensDocumentViewer,
|
|
568
|
+
export { ASSET_FILE_ICON_SIZE, ASSET_VIEWERS, AssetSession, AssetViewerMount, CALMLENS_STYLES, CALMLENS_THEME, CalmLensAsset, CalmLensDocumentViewer, CalmLensProvider, CalmLensSpreadsheetViewer, CalmLensTextViewer, CalmLensUploader, DEFAULT_MESSAGES, DEFAULT_VIEWER_MESSAGES, ICONS, ICON_ATTRIBUTES, INSTANT_LOAD_MS, MediaStreamPlayer, UploadController, VIEWER_STYLES, createDocumentViewer, createProgressFetch, createSpreadsheetViewer, createTextViewer, createUploadController, describeUploadItem, describeUploader, formatBytes, formatMessage, formatViewerMessage, getAssetAspectRatio, getAssetView, getAssetViewKey, getAssetViewerKind, getDropzoneHint, getMountedViewerOptions, getPeakHeights, getPlayedPercent, getSpreadsheetPage, getUploadItemMessage, getUploadItemOutcome, isFileAccepted, isImageReady, 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-CMM2tZpJ-IdIh63n0.js";
|
|
2
|
-
import { $ as FolderPage, $t as VerifyWebhookSignatureOptions, A as CdnAssetLocation, An as Policy, At as RetrieveAssetOptions, B as CreateHashListOptions, Bn as AssetRendered, Bt as UpdateAssetOptions, C as AssetUploadStatus, Cn as BoundingBox, Ct as MultipartUploadPartOptions, D as BatchAssetsResponse, Dn as ProcessingFeatureResults, Dt as RequestAttempt, E as BatchAssetsOptions, En as ProcessingFeatureId, Et as RemoveAssetContentOptions, F as CdnTransform, Ft as SignUploadTokenOptions, G as DeleteAssetOptions, Gn as FileMetadata, Gt as UpdateProjectSettingsOptions, H as CreateMultipartUploadPartOptions, Hn as AssetSafetyHold, Ht as UpdateHashListOptions, I as ClassifyTextOptions, In as AssetInfo, It as SignedAssetUrl, J as EnsureLensesOptions, Jt as UploadPresetDefinition, K as DeleteMetadataFieldOptions, Kn as MetadataItem, Kt as UpgradePolicyOptions, L as ClientRequestDefaults, Ln as AssetHls, Lt as SignedUploadToken, M as CdnAssetUrlOptions, Mn as LensType, Mt as SearchAssetsOptions, N as CdnResource, Nn as AssetSearchMatchField, Nt as SetPolicyAutomaticUpdatesOptions, O as CalmLensAppClientOptions, On as ProcessingFeatureStage, Ot as RequestOptions, P as CdnServeOptions, Pn as AssetSearchQuery, Pt as SignAssetUrlOptions, Q as FolderIdOptions, Qt as UploadedAsset, R as ConnectionOptions, Rn as AssetHlsRendition, Rt as StreamingFeatureOptions, S as AssetUpload, Sn as AgeRange, St as MultipartUploadOptions, T as AssignPolicyOptions, Tn as DetectedPerson, Tt as PolicyPage, U as CreatePolicyOptions, Un as AssetSafetyHoldReason, Ut as UpdateLensOptions, V as CreateLensOptions, Vn as AssetRenderedKind, Vt as UpdateFolderOptions, W as DecideAssetOptions, Wn as ExtractedText, Wt as UpdatePolicyOptions, X as EnsureUploadPresetsOptions, Xt as UploadPresetPage, Y as EnsureMetadataFieldsOptions, Yt as UploadPresetIdOptions, Z as EnsureUploadPresetsResponse, Zt as UploadPresetSubmitAssetOptions, _ as AssetPage, _n as Folder, _t as ListLensesOptions, a as AssetChecksums, an as AssetTimelineSegment, at as IdempotencyOptions, b as AssetTimelinePage, bn as PublicProjectSettings, bt as MoveAssetOptions, c as AssetClassificationFailureReason, cn as EventAsset, ct as LensIdOptions, d as AssetContentOptions, dn as EventFact, dt as ListAssetTimelineOptions, en as ViewerClaims, et as GetAssetInfoOptions, f as AssetContentRemovalReason, fn as EventFactValues, ft as ListAssetsOptions, g as AssetModerationStatus, gt as ListHashListsOptions, h as AssetModerationDecision, hn as EventType, ht as ListHashListEntriesOptions, i as AssetAvailability, in as AssetBatchOperation, it as HashListPage, j as CdnAssetReference, jn as CursorPage, jt as RetryAssetOptions, k as CalmLensServerClientOptions, kn as ProcessingFeatures, kt as ResetPolicyOptions, l as AssetClassificationStatus, ln as TypedEvent, lt as LensPage, m as AssetModeration, mn as EventSeverity, mt as ListFoldersOptions, n as AppInfo, nn as WebhookHeadersInput, nt as HashListEntryPage, o as AssetChildrenPage, on as GetEventsResponse, ot as ImageTransformOptions, p as AssetContentStatus, pn as EventFacts, pt as ListEventsOptions, q as EnsureLensOptions, qn as ProcessingOptions, qt as UploadAssetPartOptions, r as Asset, rn as WebhookPayloadInput, rt as HashListIdOptions, s as AssetClassification, st as Lens, t as AddHashListEntryOptions, tn as WaitForAssetDecisionOptions, tt as HashListEntryIdOptions, u as AssetContent, un as EventCategory, ut as ListAssetChildrenOptions, v as AssetSearchResponse, vn as MetadataFieldsResource, vt as ListPoliciesOptions, w as AssetVisibility, wn as DetectedFace, wt as PolicyIdOptions, x as AssetType, xn as UploadPreset, xt as MoveFolderOptions, y as AssetSearchResult, yn as ProjectSettingsResource, yt as ListUploadPresetsOptions, z as CreateFolderOptions, zn as AssetPreview, zt as SubmitAssetOptions } from "./CalmLensTypes-
|
|
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 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-
|
|
5
|
-
import { t as CalmLensServerClient } from "./CalmLensServerClient
|
|
2
|
+
import { $ as FolderPage, $t as VerifyWebhookSignatureOptions, A as CdnAssetLocation, An as Policy, At as RetrieveAssetOptions, B as CreateHashListOptions, Bn as AssetRendered, Bt as UpdateAssetOptions, C as AssetUploadStatus, Cn as BoundingBox, Ct as MultipartUploadPartOptions, D as BatchAssetsResponse, Dn as ProcessingFeatureResults, Dt as RequestAttempt, E as BatchAssetsOptions, En as ProcessingFeatureId, Et as RemoveAssetContentOptions, F as CdnTransform, Ft as SignUploadTokenOptions, G as DeleteAssetOptions, Gn as FileMetadata, Gt as UpdateProjectSettingsOptions, H as CreateMultipartUploadPartOptions, Hn as AssetSafetyHold, Ht as UpdateHashListOptions, I as ClassifyTextOptions, In as AssetInfo, It as SignedAssetUrl, J as EnsureLensesOptions, Jt as UploadPresetDefinition, K as DeleteMetadataFieldOptions, Kn as MetadataItem, Kt as UpgradePolicyOptions, L as ClientRequestDefaults, Ln as AssetHls, Lt as SignedUploadToken, M as CdnAssetUrlOptions, Mn as LensType, Mt as SearchAssetsOptions, N as CdnResource, Nn as AssetSearchMatchField, Nt as SetPolicyAutomaticUpdatesOptions, O as CalmLensAppClientOptions, On as ProcessingFeatureStage, Ot as RequestOptions, P as CdnServeOptions, Pn as AssetSearchQuery, Pt as SignAssetUrlOptions, Q as FolderIdOptions, Qt as UploadedAsset, R as ConnectionOptions, Rn as AssetHlsRendition, Rt as StreamingFeatureOptions, S as AssetUpload, Sn as AgeRange, St as MultipartUploadOptions, T as AssignPolicyOptions, Tn as DetectedPerson, Tt as PolicyPage, U as CreatePolicyOptions, Un as AssetSafetyHoldReason, Ut as UpdateLensOptions, V as CreateLensOptions, Vn as AssetRenderedKind, Vt as UpdateFolderOptions, W as DecideAssetOptions, Wn as ExtractedText, Wt as UpdatePolicyOptions, X as EnsureUploadPresetsOptions, Xt as UploadPresetPage, Y as EnsureMetadataFieldsOptions, Yt as UploadPresetIdOptions, Z as EnsureUploadPresetsResponse, Zt as UploadPresetSubmitAssetOptions, _ as AssetPage, _n as Folder, _t as ListLensesOptions, a as AssetChecksums, an as AssetTimelineSegment, at as IdempotencyOptions, b as AssetTimelinePage, bn as PublicProjectSettings, bt as MoveAssetOptions, c as AssetClassificationFailureReason, cn as EventAsset, ct as LensIdOptions, d as AssetContentOptions, dn as EventFact, dt as ListAssetTimelineOptions, en as ViewerClaims, et as GetAssetInfoOptions, f as AssetContentRemovalReason, fn as EventFactValues, ft as ListAssetsOptions, g as AssetModerationStatus, gt as ListHashListsOptions, h as AssetModerationDecision, hn as EventType, ht as ListHashListEntriesOptions, i as AssetAvailability, in as AssetBatchOperation, it as HashListPage, j as CdnAssetReference, jn as CursorPage, jt as RetryAssetOptions, k as CalmLensServerClientOptions, kn as ProcessingFeatures, kt as ResetPolicyOptions, l as AssetClassificationStatus, ln as TypedEvent, lt as LensPage, m as AssetModeration, mn as EventSeverity, mt as ListFoldersOptions, n as AppInfo, nn as WebhookHeadersInput, nt as HashListEntryPage, o as AssetChildrenPage, on as GetEventsResponse, ot as ImageTransformOptions, p as AssetContentStatus, pn as EventFacts, pt as ListEventsOptions, q as EnsureLensOptions, qn as ProcessingOptions, qt as UploadAssetPartOptions, r as Asset, rn as WebhookPayloadInput, rt as HashListIdOptions, s as AssetClassification, st as Lens, t as AddHashListEntryOptions, tn as WaitForAssetDecisionOptions, tt as HashListEntryIdOptions, u as AssetContent, un as EventCategory, ut as ListAssetChildrenOptions, v as AssetSearchResponse, vn as MetadataFieldsResource, vt as ListPoliciesOptions, w as AssetVisibility, wn as DetectedFace, wt as PolicyIdOptions, x as AssetType, xn as UploadPreset, xt as MoveFolderOptions, y as AssetSearchResult, yn as ProjectSettingsResource, yt as ListUploadPresetsOptions, z as CreateFolderOptions, zn as AssetPreview, zt as SubmitAssetOptions } from "./CalmLensTypes-OWZsGvBX.js";
|
|
3
|
+
import { i as getAssetInfo, n as DEFAULT_CDN_BASE_URL, r as CDN_RESOURCES, t as SDK_VERSION } from "./index-BDxmVi-G.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-CrMU6lg0.js";
|
|
5
|
+
import { t as CalmLensServerClient } from "./CalmLensServerClient-D3K5HS9v.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";
|
package/esm/server.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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-
|
|
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-Tev2lxE0.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-
|
|
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-D-TIIQp2.js";
|
|
4
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
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
}
|
|
124
124
|
.calmlens-icon-button:hover { background: color-mix(in srgb, var(--calmlens-accent) 8%, transparent); border-color: var(--calmlens-border); }
|
|
125
125
|
@media (prefers-reduced-motion: reduce) {
|
|
126
|
-
.calmlens-dropzone, .calmlens-dropzone__icon
|
|
126
|
+
.calmlens-dropzone, .calmlens-dropzone__icon { transition: none; }
|
|
127
127
|
.calmlens-progress:indeterminate {
|
|
128
128
|
--calmlens-progress-animation: calmlens-indeterminate-still 1s both;
|
|
129
129
|
}
|
|
@@ -142,9 +142,17 @@
|
|
|
142
142
|
.calmlens-asset:not([data-sized]) .calmlens-asset__content { position: relative; height: auto; }
|
|
143
143
|
.calmlens-asset:not([data-sized])[data-kind="age-restricted"], .calmlens-asset:not([data-sized])[data-kind="unavailable"],
|
|
144
144
|
.calmlens-asset:not([data-sized])[data-state="error"] { min-height: 160px; }
|
|
145
|
-
.calmlens-asset__placeholder { transform: scale(1.1); filter: blur(12px); }
|
|
146
|
-
.calmlens-asset__content { opacity: 0;
|
|
145
|
+
.calmlens-asset__placeholder { transform: scale(1.1); filter: blur(12px); opacity: 1; pointer-events: none; }
|
|
146
|
+
.calmlens-asset__content { opacity: 0; }
|
|
147
147
|
.calmlens-asset[data-state="loaded"] .calmlens-asset__content { opacity: 1; }
|
|
148
|
+
.calmlens-asset[data-state="loaded"]:not([data-kind="age-restricted"]) .calmlens-asset__placeholder { opacity: 0; visibility: hidden; }
|
|
149
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
150
|
+
.calmlens-asset[data-state="loaded"]:not([data-instant]) { transition: background-color 250ms; }
|
|
151
|
+
.calmlens-asset[data-state="loaded"]:not([data-instant]) .calmlens-asset__content { transition: opacity 250ms; }
|
|
152
|
+
.calmlens-asset[data-state="loaded"]:not([data-kind="age-restricted"], [data-instant]) .calmlens-asset__placeholder {
|
|
153
|
+
transition: opacity 250ms, visibility 0s linear 250ms;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
148
156
|
.calmlens-asset[data-kind="video"] .calmlens-asset__content, .calmlens-asset[data-kind="audio"] .calmlens-asset__content { opacity: 1; }
|
|
149
157
|
/* Documents, text and spreadsheets fill the box with their viewer; a document shows its first
|
|
150
158
|
page's still and an open link until the viewer loads. */
|
|
@@ -215,7 +223,7 @@
|
|
|
215
223
|
/* An opaque surface of its own, so sticky headers and the toolbar cover what scrolls under them. */
|
|
216
224
|
background: var(--calmlens-viewer-background, Canvas); color: var(--calmlens-viewer-text, CanvasText);
|
|
217
225
|
}
|
|
218
|
-
.calmlens-viewer:is([data-kind="text"], [data-kind="document"], [data-kind="spreadsheet"]
|
|
226
|
+
.calmlens-viewer:is([data-kind="text"], [data-kind="document"], [data-kind="spreadsheet"]) > .calmlens-viewer__frame { min-height: 320px; }
|
|
219
227
|
.calmlens-viewer :focus-visible {
|
|
220
228
|
outline: 2px solid var(--calmlens-focus-ring); outline-offset: -2px;
|
|
221
229
|
}
|
|
@@ -236,18 +244,6 @@
|
|
|
236
244
|
.calmlens-viewer__spacer { flex: 1; }
|
|
237
245
|
.calmlens-viewer__link { text-decoration: none; overflow-wrap: anywhere; }
|
|
238
246
|
.calmlens-viewer__scroll { flex: 1; min-height: 0; overflow: auto; position: relative; }
|
|
239
|
-
/* Images fit inside the frame, keeping their shape; without a frame height, the box takes it. */
|
|
240
|
-
.calmlens-viewer[data-kind="image"] > .calmlens-viewer__frame { aspect-ratio: var(--calmlens-viewer-ratio, auto); max-height: 100%; }
|
|
241
|
-
.calmlens-viewer[data-kind="image"] > .calmlens-viewer__frame > img {
|
|
242
|
-
position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
|
|
243
|
-
}
|
|
244
|
-
.calmlens-viewer:not([data-kind="image"]) .calmlens-viewer__placeholder {
|
|
245
|
-
position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top;
|
|
246
|
-
}
|
|
247
|
-
.calmlens-viewer__placeholder { filter: blur(12px); transform: scale(1.05); }
|
|
248
|
-
.calmlens-viewer__image { opacity: 0; transition: opacity 250ms; }
|
|
249
|
-
.calmlens-viewer[data-state="loaded"] .calmlens-viewer__image { opacity: 1; }
|
|
250
|
-
.calmlens-viewer[data-kind="website"] .calmlens-viewer__image { position: relative; display: block; width: 100%; height: auto; }
|
|
251
247
|
.calmlens-viewer__text {
|
|
252
248
|
margin: 0 auto; padding: 20px 24px; max-width: 75ch; white-space: pre-wrap; overflow-wrap: anywhere;
|
|
253
249
|
font-family: inherit; font-size: 1rem; line-height: 1.6;
|
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
getMountedViewerOptions,
|
|
15
15
|
getPeakHeights,
|
|
16
16
|
getPlayedPercent,
|
|
17
|
+
INSTANT_LOAD_MS,
|
|
18
|
+
isImageReady,
|
|
17
19
|
isMountedViewerKind,
|
|
18
20
|
MediaStreamPlayer,
|
|
19
21
|
resolveMessages,
|
|
@@ -75,6 +77,8 @@
|
|
|
75
77
|
const loadKey = $derived(getAssetViewKey(view));
|
|
76
78
|
const ratio = $derived(getAssetAspectRatio(view, sessionState.info, aspectRatio));
|
|
77
79
|
let load: "loading" | "loaded" | "error" = $state("loading");
|
|
80
|
+
let instant = $state(false);
|
|
81
|
+
let loadStartedAt = 0;
|
|
78
82
|
let played = $state(0);
|
|
79
83
|
let mounted = $state(false);
|
|
80
84
|
let image: HTMLImageElement | undefined = $state();
|
|
@@ -109,8 +113,6 @@
|
|
|
109
113
|
});
|
|
110
114
|
onMount(() => {
|
|
111
115
|
mounted = true;
|
|
112
|
-
// An image that loaded before hydration fires no load event.
|
|
113
|
-
if (image?.complete && image.naturalWidth > 0) load = "loaded";
|
|
114
116
|
return () => {
|
|
115
117
|
streams.stop();
|
|
116
118
|
viewers.destroy();
|
|
@@ -119,6 +121,17 @@
|
|
|
119
121
|
$effect.pre(() => {
|
|
120
122
|
void loadKey;
|
|
121
123
|
load = "loading";
|
|
124
|
+
instant = false;
|
|
125
|
+
});
|
|
126
|
+
$effect(() => {
|
|
127
|
+
void loadKey;
|
|
128
|
+
if (!image) return;
|
|
129
|
+
loadStartedAt = performance.now();
|
|
130
|
+
// An image that loaded before hydration or from the browser cache shows without fading.
|
|
131
|
+
if (isImageReady(image)) {
|
|
132
|
+
instant = true;
|
|
133
|
+
load = "loaded";
|
|
134
|
+
}
|
|
122
135
|
});
|
|
123
136
|
$effect(() => {
|
|
124
137
|
if (load === "loaded") onLoad?.();
|
|
@@ -152,11 +165,15 @@
|
|
|
152
165
|
};
|
|
153
166
|
const onImageLoad = () => {
|
|
154
167
|
session.loaded();
|
|
168
|
+
if (load === "loaded") return;
|
|
169
|
+
instant = performance.now() - loadStartedAt < INSTANT_LOAD_MS;
|
|
155
170
|
load = "loaded";
|
|
156
171
|
};
|
|
157
172
|
const placeholderUrl = $derived(
|
|
158
173
|
"placeholderUrl" in view &&
|
|
159
|
-
(view.kind === "age-restricted" ||
|
|
174
|
+
(view.kind === "age-restricted" ||
|
|
175
|
+
view.kind === "pending" ||
|
|
176
|
+
(load !== "error" && !(load === "loaded" && instant)))
|
|
160
177
|
? view.placeholderUrl
|
|
161
178
|
: undefined,
|
|
162
179
|
);
|
|
@@ -172,7 +189,7 @@
|
|
|
172
189
|
class="calmlens-asset__content"
|
|
173
190
|
src={shown.src}
|
|
174
191
|
srcset={shown.srcSet}
|
|
175
|
-
sizes={shown.srcSet ? imageOptions?.sizes : undefined}
|
|
192
|
+
sizes={shown.srcSet ? (imageOptions?.sizes ?? (lazy ? "auto, 100vw" : "100vw")) : undefined}
|
|
176
193
|
{alt}
|
|
177
194
|
width={shown.width}
|
|
178
195
|
height={shown.height}
|
|
@@ -189,6 +206,7 @@
|
|
|
189
206
|
class="calmlens-asset"
|
|
190
207
|
data-kind={view.kind}
|
|
191
208
|
data-state={load}
|
|
209
|
+
data-instant={instant ? "" : undefined}
|
|
192
210
|
data-sized={ratio ? "" : undefined}
|
|
193
211
|
aria-busy={view.kind === "pending" ? "true" : undefined}
|
|
194
212
|
style:aspect-ratio={ratio}
|
package/esm/svelte/index.d.ts
CHANGED
|
@@ -8,12 +8,10 @@ import type {
|
|
|
8
8
|
UploadItem as CoreUploadItem,
|
|
9
9
|
UploadSnapshot as CoreUploadSnapshot,
|
|
10
10
|
DocumentViewerOptions,
|
|
11
|
-
ImageViewerOptions,
|
|
12
11
|
SpreadsheetViewerOptions,
|
|
13
12
|
TextViewerOptions,
|
|
14
13
|
UploadController,
|
|
15
14
|
UploadFile,
|
|
16
|
-
WebsiteViewerOptions,
|
|
17
15
|
} from "../ui.js";
|
|
18
16
|
|
|
19
17
|
// The browser's files are `File`s, so the upload types default to `File` here.
|
|
@@ -58,10 +56,6 @@ export declare const CalmLensAsset: Component<
|
|
|
58
56
|
}
|
|
59
57
|
>;
|
|
60
58
|
|
|
61
|
-
/** Shows an image asset's rendered file, fitted to the element, over its placeholder (preview). */
|
|
62
|
-
export declare const CalmLensImageViewer: Component<ImageViewerOptions>;
|
|
63
|
-
/** Shows a website asset's screenshot with a link to the original page (preview). */
|
|
64
|
-
export declare const CalmLensWebsiteViewer: Component<WebsiteViewerOptions>;
|
|
65
59
|
/** Shows a text asset's text, escaped, in a scrolling region (preview). */
|
|
66
60
|
export declare const CalmLensTextViewer: Component<TextViewerOptions>;
|
|
67
61
|
/** Shows a PDF, or a document rendered as one, a page at a time with pdf.js (preview). */
|
package/esm/svelte/index.js
CHANGED
|
@@ -4,9 +4,7 @@
|
|
|
4
4
|
export * from "../ui.js";
|
|
5
5
|
export { default as CalmLensAsset } from "./CalmLensAsset.svelte";
|
|
6
6
|
export { default as CalmLensDocumentViewer } from "./CalmLensDocumentViewer.svelte";
|
|
7
|
-
export { default as CalmLensImageViewer } from "./CalmLensImageViewer.svelte";
|
|
8
7
|
export { default as CalmLensSpreadsheetViewer } from "./CalmLensSpreadsheetViewer.svelte";
|
|
9
8
|
export { default as CalmLensTextViewer } from "./CalmLensTextViewer.svelte";
|
|
10
9
|
export { default as CalmLensUploader } from "./CalmLensUploader.svelte";
|
|
11
|
-
export { default as CalmLensWebsiteViewer } from "./CalmLensWebsiteViewer.svelte";
|
|
12
10
|
export { getCalmLensContext, setCalmLensContext } from "./context.js";
|
package/esm/testing.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Fn as AssetBinaryPayloadInput, Ft as SignUploadTokenOptions, Lt as SignedUploadToken, O as CalmLensAppClientOptions, _n as Folder, gn as PermissionGrant, k as CalmLensServerClientOptions, ln as TypedEvent, m as AssetModeration, r as Asset } from "./CalmLensTypes-
|
|
2
|
-
import { t as CalmLensAppClient } from "./CalmLensAppClient-
|
|
3
|
-
import { I as ApiErrorCode, n as WebhookEventPayload } from "./WebhookPayload-
|
|
4
|
-
import { t as CalmLensServerClient } from "./CalmLensServerClient
|
|
1
|
+
import { Fn as AssetBinaryPayloadInput, Ft as SignUploadTokenOptions, Lt as SignedUploadToken, O as CalmLensAppClientOptions, _n as Folder, gn as PermissionGrant, k as CalmLensServerClientOptions, ln as TypedEvent, m as AssetModeration, r as Asset } from "./CalmLensTypes-OWZsGvBX.js";
|
|
2
|
+
import { t as CalmLensAppClient } from "./CalmLensAppClient-DzoSqUgG.js";
|
|
3
|
+
import { I as ApiErrorCode, n as WebhookEventPayload } from "./WebhookPayload-CrMU6lg0.js";
|
|
4
|
+
import { t as CalmLensServerClient } from "./CalmLensServerClient-D3K5HS9v.js";
|
|
5
5
|
import { t as ClassificationTestSignal } from "./TestTriggers-Dnukm-jm-DoEB7jJc.js";
|
|
6
6
|
import "zod";
|
|
7
7
|
/**
|
package/esm/testing.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { A as normalizeUploadMimeType, D as MAX_IMAGE_UPLOAD_BYTES, M as sleep, S as validateAppClientOptions, Y as CalmLensError, _ as randomUuid, ct as invalidConfig, f as checkTransformOptions, h as parseTransformSelector, k as getRejectedUploadMimeTypeError, lt as API_ERROR_CODES, m as isAcceptedUploadMimeType, ot as SDK_ERROR_CODES, r as selectModerationContextItems, st as invalidArgument, ut as API_ERROR_DEFINITIONS, w as validateServerClientOptions } from "./ModerationContextLimits-
|
|
2
|
-
import { a as WEBHOOK_TIMESTAMP_HEADER, f as signUploadTokenWithApiKey, m as stringifyJsonCanonical, n as WEBHOOK_DELIVERY_HEADER, p as decodeUploadToken, r as WEBHOOK_SIGNATURE_HEADER, t as CalmLensServerClient } from "./CalmLensServerClient-
|
|
3
|
-
import { _ as validateAssetPayload, a as MOCK_HOOKS, g as assetToData, h as assetDataToUint8Array } from "./CalmLensOptionKeys-
|
|
1
|
+
import { A as normalizeUploadMimeType, D as MAX_IMAGE_UPLOAD_BYTES, M as sleep, S as validateAppClientOptions, Y as CalmLensError, _ as randomUuid, ct as invalidConfig, f as checkTransformOptions, h as parseTransformSelector, k as getRejectedUploadMimeTypeError, lt as API_ERROR_CODES, m as isAcceptedUploadMimeType, ot as SDK_ERROR_CODES, r as selectModerationContextItems, st as invalidArgument, ut as API_ERROR_DEFINITIONS, w as validateServerClientOptions } from "./ModerationContextLimits-Tev2lxE0.js";
|
|
2
|
+
import { a as WEBHOOK_TIMESTAMP_HEADER, f as signUploadTokenWithApiKey, m as stringifyJsonCanonical, n as WEBHOOK_DELIVERY_HEADER, p as decodeUploadToken, r as WEBHOOK_SIGNATURE_HEADER, t as CalmLensServerClient } from "./CalmLensServerClient-D-TIIQp2.js";
|
|
3
|
+
import { _ as validateAssetPayload, a as MOCK_HOOKS, g as assetToData, h as assetDataToUint8Array } from "./CalmLensOptionKeys-DC9FUO43.js";
|
|
4
4
|
import { t as hmacSha256Hex } from "./CryptoUtils-B_x8lMIx-DhuWGzqn.js";
|
|
5
|
-
import { t as CalmLensAppClient } from "./CalmLensAppClient-
|
|
6
|
-
import { o as placeholderHashToDataURL, r as isFileAccepted } from "./UploadController-
|
|
5
|
+
import { t as CalmLensAppClient } from "./CalmLensAppClient-BxkCVPCl.js";
|
|
6
|
+
import { o as placeholderHashToDataURL, r as isFileAccepted } from "./UploadController-D7XmzO-p.js";
|
|
7
7
|
import { d as getTestInputTag, h as CLASSIFICATION_CATEGORIES, m as lazySchema } from "./TestTriggers-Cvi7e2KA-BA83CRJb.js";
|
|
8
8
|
import * as zod from "zod";
|
|
9
9
|
// src/contract/MediaTestTriggers.js
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./CalmLensTypes-
|
|
2
|
-
import { K as AssetOptions, Z as AssetView, ct as
|
|
1
|
+
import "./CalmLensTypes-OWZsGvBX.js";
|
|
2
|
+
import { K as AssetOptions, Z as AssetView, ct as DocumentViewerOptions, dt as TextViewerOptions, lt as PdfAssetOptions, pt as ViewerOptions, q as AssetSession, ut as SpreadsheetViewerOptions } from "./Core-CTO_Eh0l.js";
|
|
3
3
|
import "pdfjs-dist";
|
|
4
4
|
/** A viewer mounted into an element, which it owns the children of. */
|
|
5
5
|
interface AssetViewer<O extends ViewerOptions = ViewerOptions> {
|
|
@@ -11,10 +11,6 @@ interface AssetViewer<O extends ViewerOptions = ViewerOptions> {
|
|
|
11
11
|
type ViewerState = "loading" | "loaded" | "error";
|
|
12
12
|
/** Shows a PDF, or a document rendered as one, in `root`. */
|
|
13
13
|
declare const createDocumentViewer: (root: HTMLElement, options: DocumentViewerOptions) => AssetViewer<DocumentViewerOptions>;
|
|
14
|
-
/** Shows an image asset's rendered file in `root`. */
|
|
15
|
-
declare const createImageViewer: (root: HTMLElement, options: ImageViewerOptions) => AssetViewer<ImageViewerOptions>;
|
|
16
|
-
/** Shows a website asset's screenshot and a link to the page in `root`. */
|
|
17
|
-
declare const createWebsiteViewer: (root: HTMLElement, options: WebsiteViewerOptions) => AssetViewer<WebsiteViewerOptions>;
|
|
18
14
|
type PdfJs = typeof import("pdfjs-dist");
|
|
19
15
|
/**
|
|
20
16
|
* Loads pdf.js, the first time a document viewer needs it: never at import, so pages without
|
|
@@ -83,8 +79,6 @@ declare const createSpreadsheetViewer: (root: HTMLElement, options: SpreadsheetV
|
|
|
83
79
|
declare const VIEWER_STYLES: string;
|
|
84
80
|
/** Each viewer's options, by the kind of viewer `getAssetViewerKind` names. */
|
|
85
81
|
interface AssetViewerOptionsByKind {
|
|
86
|
-
image: ImageViewerOptions;
|
|
87
|
-
website: WebsiteViewerOptions;
|
|
88
82
|
text: TextViewerOptions;
|
|
89
83
|
document: DocumentViewerOptions;
|
|
90
84
|
spreadsheet: SpreadsheetViewerOptions;
|
|
@@ -136,4 +130,4 @@ declare class MediaStreamPlayer {
|
|
|
136
130
|
/** Stops the stream, when the component unmounts. */
|
|
137
131
|
stop(): void;
|
|
138
132
|
}
|
|
139
|
-
export {
|
|
133
|
+
export { spreadsheetColumnIndex as _, isMountedViewerKind as a, AssetViewer as b, AssetViewerOptionsByKind as c, createTextViewer as d, SpreadsheetCell as f, parseSpreadsheetText as g, getSpreadsheetPage as h, getMountedViewerOptions as i, VIEWER_STYLES as l, SpreadsheetSheet as m, AssetViewerMount as n, ASSET_VIEWERS as o, SpreadsheetRow as p, MountedViewerKind as r, AssetViewerName as s, MediaStreamPlayer as t, createSpreadsheetViewer as u, loadPdfJs as v, ViewerState as x, createDocumentViewer as y };
|