calmlens 0.29.2 → 0.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/calmlens.js +17 -45
- package/{esm/BrowserUpload-CeGsM9h1.d.ts → cjs/BrowserUpload-BAH54V1q.d.ts} +2 -2
- package/cjs/{BrowserUpload-CCXt4DAY.js → BrowserUpload-IiRDbL85.js} +1 -1
- package/cjs/{CalmLensAppClient-ea-qXkmD.js → CalmLensAppClient-BBcq6pJg.js} +10 -10
- package/cjs/{CalmLensAppClient-D-BD_Ny1.d.ts → CalmLensAppClient-CdlcDd5l.d.ts} +1 -1
- package/cjs/{ModerationContextLimits-1XP4ZTQk.js → CalmLensCdn-2VbArrj-.js} +2 -52
- package/cjs/{CalmLensConnection-BrySN2M3.js → CalmLensConnection-CpnDGa8W.js} +15 -22
- package/cjs/{CalmLensError-DPHJaVjX.js → CalmLensError-ifj5rLmk.js} +5 -0
- package/{esm/CalmLensServerClient-BYN_N0lt.d.ts → cjs/CalmLensServerClient-CtS66dCU.d.ts} +12 -8
- package/cjs/{CalmLensServerClient-FD7H7KvL.js → CalmLensServerClient-DbemlDXj.js} +38 -37
- package/cjs/{CalmLensTestInputArguments-BXDBAOg_.js → CalmLensTestInputArguments-PYuRmE0j.js} +1 -1
- package/cjs/{CalmLensTypes-C2blKgTu.d.ts → CalmLensTypes-87kiUg0H.d.ts} +208 -10
- package/cjs/{Classification-CMM2tZpJ-IdIh63n0.d.ts → Classification-C3pkrGYS-B7EygpJn.d.ts} +16 -50
- package/cjs/{Core-CNmoxDCW.d.ts → Core-Ccy4-_sN.d.ts} +2 -2
- package/cjs/{Core-DMFa3EUp.js → Core-xy9aV1ED.js} +8 -8
- package/cjs/{ReactUpload-gaeiPSeH.js → ReactUpload-BX3XOVfb.js} +1 -1
- package/{esm/ReactUpload-kqEe6gcN.d.ts → cjs/ReactUpload-DBhppuxM.d.ts} +1 -1
- package/cjs/{TestTriggers-CFnel6a9.d.ts → TestTriggers-Daxebd0V.d.ts} +1 -1
- package/cjs/{UploadController-CyPTBuZg.js → UploadController-CmTjpOfp.js} +2 -2
- package/{esm/WebhookPayload-DZWlnvcY.d.ts → cjs/WebhookPayload-B4rA_Dvm.d.ts} +13 -7
- package/cjs/app.d.ts +6 -6
- package/cjs/app.js +8 -11
- package/cjs/elements.d.ts +4 -4
- package/cjs/elements.js +4 -4
- package/cjs/{index-Dl2qwS8L.d.ts → index-CWUnLKoF.d.ts} +8 -4
- package/cjs/index.d.ts +5 -5
- package/cjs/index.js +7 -10
- package/cjs/react-native.d.ts +2 -2
- package/cjs/react-native.js +7 -7
- package/cjs/react.d.ts +4 -4
- package/cjs/react.js +5 -5
- package/cjs/server.d.ts +12 -12
- package/cjs/server.js +9 -12
- package/cjs/test-inputs.d.ts +1 -1
- package/cjs/test-inputs.js +1 -1
- package/cjs/testing.d.ts +12 -8
- package/cjs/testing.js +89 -37
- package/cjs/{ui-DNP1uWQy.js → ui-BJKh49aM.js} +3 -3
- package/cjs/{ui-BtmJC-f9.d.ts → ui-sjnJhloQ.d.ts} +2 -2
- package/cjs/ui.d.ts +2 -2
- package/cjs/ui.js +3 -3
- package/cjs/vue.d.ts +5 -5
- package/cjs/vue.js +4 -4
- package/{cjs/BrowserUpload-CeGsM9h1.d.ts → esm/BrowserUpload-BAH54V1q.d.ts} +2 -2
- package/esm/{BrowserUpload-Bu6eWqQS.js → BrowserUpload-C5aXj6QC.js} +1 -1
- package/esm/{CalmLensAppClient-D-BD_Ny1.d.ts → CalmLensAppClient-CdlcDd5l.d.ts} +1 -1
- package/esm/{CalmLensAppClient-xp-fH6Lz.js → CalmLensAppClient-gAd0C_Q_.js} +3 -3
- package/esm/{ModerationContextLimits-CtAyz60h.js → CalmLensCdn-CcxEY6wB.js} +3 -35
- package/esm/{CalmLensConnection-DwG5yBk2.js → CalmLensConnection-CfGVp95D.js} +2 -9
- package/esm/{CalmLensError-BDWThPCr.js → CalmLensError-C15tWu8W.js} +5 -0
- package/esm/{CalmLensServerClient-CKlNBBo3.js → CalmLensServerClient-CPWeRVWO.js} +18 -17
- package/{cjs/CalmLensServerClient-BYN_N0lt.d.ts → esm/CalmLensServerClient-CtS66dCU.d.ts} +12 -8
- package/esm/{CalmLensTestInputArguments-Xh4GIadS.js → CalmLensTestInputArguments-CqPADTkl.js} +1 -1
- package/esm/{CalmLensTypes-C2blKgTu.d.ts → CalmLensTypes-87kiUg0H.d.ts} +208 -10
- package/esm/{Classification-CMM2tZpJ-IdIh63n0.d.ts → Classification-C3pkrGYS-B7EygpJn.d.ts} +16 -50
- package/esm/{Core-CNmoxDCW.d.ts → Core-Ccy4-_sN.d.ts} +2 -2
- package/esm/{Core-DnCeTmvS.js → Core-DTcxpv3O.js} +3 -3
- package/{cjs/ReactUpload-kqEe6gcN.d.ts → esm/ReactUpload-DBhppuxM.d.ts} +1 -1
- package/esm/{ReactUpload-D30YlRui.js → ReactUpload-Dg7MtjbJ.js} +1 -1
- package/esm/{TestTriggers-CFnel6a9.d.ts → TestTriggers-Daxebd0V.d.ts} +1 -1
- package/esm/{UploadController-DENryQ8H.js → UploadController-DVsTVJVv.js} +2 -2
- package/{cjs/WebhookPayload-DZWlnvcY.d.ts → esm/WebhookPayload-B4rA_Dvm.d.ts} +13 -7
- package/esm/app.d.ts +6 -6
- package/esm/app.js +4 -4
- package/esm/elements.d.ts +4 -4
- package/esm/elements.js +4 -4
- package/esm/{index-Dl2qwS8L.d.ts → index-CWUnLKoF.d.ts} +8 -4
- package/esm/index.d.ts +5 -5
- package/esm/index.js +3 -3
- package/esm/react-native.d.ts +2 -2
- package/esm/react-native.js +4 -4
- package/esm/react.d.ts +4 -4
- package/esm/react.js +5 -5
- package/esm/server.d.ts +12 -12
- package/esm/server.js +4 -4
- package/esm/test-inputs.d.ts +1 -1
- package/esm/test-inputs.js +1 -1
- package/esm/testing.d.ts +12 -8
- package/esm/testing.js +74 -22
- package/esm/{ui-DUEBbRJ0.js → ui-DUao8UY0.js} +2 -2
- package/esm/{ui-BtmJC-f9.d.ts → ui-sjnJhloQ.d.ts} +2 -2
- package/esm/ui.d.ts +2 -2
- package/esm/ui.js +3 -3
- package/esm/vue.d.ts +5 -5
- package/esm/vue.js +4 -4
- package/package.json +1 -1
package/esm/test-inputs.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as TEST_FACE_AGE_PRESETS, c as TestDetections, d as detectTestTrigger, f as getImageTestCategories, i as TEST_FACE_AGE_MAX, l as TestInput, m as testInputForSignal, n as TEST_DETECTIONS_MAX, o as TEST_INPUT_KEY_PATTERN, p as paintTestImage$1, r as TEST_DETECTION_BOX_MAX, s as TEST_INPUT_PRESETS, t as ClassificationTestSignal, u as detectTestImage } from "./TestTriggers-
|
|
1
|
+
import { a as TEST_FACE_AGE_PRESETS, c as TestDetections, d as detectTestTrigger, f as getImageTestCategories, i as TEST_FACE_AGE_MAX, l as TestInput, m as testInputForSignal, n as TEST_DETECTIONS_MAX, o as TEST_INPUT_KEY_PATTERN, p as paintTestImage$1, r as TEST_DETECTION_BOX_MAX, s as TEST_INPUT_PRESETS, t as ClassificationTestSignal, u as detectTestImage } from "./TestTriggers-Daxebd0V.js";
|
|
2
2
|
/** A text code for `scenario`, signed with the project's test input key. */
|
|
3
3
|
export declare const generateTestTextCode: (scenario: TestInput | ClassificationTestSignal, key: string) => Promise<string>;
|
|
4
4
|
/** An RGBA test image for `scenario`, signed with the project's test input key. */
|
package/esm/test-inputs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as TEST_FACE_AGE_PRESETS, c as detectTestImage, d as getImageTestCategories, i as TEST_FACE_AGE_MAX, l as detectTestTrigger, m as testInputForSignal, n as TEST_DETECTIONS_MAX, o as TEST_INPUT_KEY_PATTERN, p as paintTestImage$1, r as TEST_DETECTION_BOX_MAX, s as TEST_INPUT_PRESETS, t as withValidTestInputArguments, u as generateTestTextCode$1 } from "./CalmLensTestInputArguments-
|
|
1
|
+
import { a as TEST_FACE_AGE_PRESETS, c as detectTestImage, d as getImageTestCategories, i as TEST_FACE_AGE_MAX, l as detectTestTrigger, m as testInputForSignal, n as TEST_DETECTIONS_MAX, o as TEST_INPUT_KEY_PATTERN, p as paintTestImage$1, r as TEST_DETECTION_BOX_MAX, s as TEST_INPUT_PRESETS, t as withValidTestInputArguments, u as generateTestTextCode$1 } from "./CalmLensTestInputArguments-CqPADTkl.js";
|
|
2
2
|
// src/test-inputs.ts
|
|
3
3
|
/**
|
|
4
4
|
* Portable test inputs: presets and custom instances share one authenticated format. CalmLens
|
package/esm/testing.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as CalmLensAppClient } from "./CalmLensAppClient-
|
|
3
|
-
import { I as ApiErrorCode, n as WebhookEventPayload } from "./WebhookPayload-
|
|
4
|
-
import { t as CalmLensServerClient } from "./CalmLensServerClient-
|
|
5
|
-
import { t as ClassificationTestSignal } from "./TestTriggers-
|
|
1
|
+
import { Lt as SignUploadTokenOptions, O as CalmLensAppClientOptions, Xt as UploadPresetDefinition, bn as PermissionGrant, fn as TypedEvent, k as CalmLensServerClientOptions, m as AssetModeration, r as Asset, xn as Folder, zn as AssetBinaryPayloadInput, zt as SignedUploadToken } from "./CalmLensTypes-87kiUg0H.js";
|
|
2
|
+
import { t as CalmLensAppClient } from "./CalmLensAppClient-CdlcDd5l.js";
|
|
3
|
+
import { I as ApiErrorCode, n as WebhookEventPayload } from "./WebhookPayload-B4rA_Dvm.js";
|
|
4
|
+
import { t as CalmLensServerClient } from "./CalmLensServerClient-CtS66dCU.js";
|
|
5
|
+
import { t as ClassificationTestSignal } from "./TestTriggers-Daxebd0V.js";
|
|
6
6
|
import "zod";
|
|
7
7
|
/**
|
|
8
8
|
* Signs a single-use upload token with `apiKey`, locally. `CalmLensServerClient` and
|
|
@@ -300,10 +300,14 @@ interface MockServedUrl {
|
|
|
300
300
|
/** The `Content-Type` the URL answers with, such as `image/png`. */
|
|
301
301
|
type: string;
|
|
302
302
|
}
|
|
303
|
-
/**
|
|
304
|
-
|
|
305
|
-
|
|
303
|
+
/**
|
|
304
|
+
* An event to add to the mock feed; omitted fields get defaults. With `assetId` it is about that
|
|
305
|
+
* asset, and its `resource` takes the asset's next number like the API's; without, it is about no
|
|
306
|
+
* resource.
|
|
307
|
+
*/
|
|
308
|
+
type MockEventInput = Partial<Omit<TypedEvent, "type" | "resource">> & {
|
|
306
309
|
type: TypedEvent["type"];
|
|
310
|
+
assetId?: string | null;
|
|
307
311
|
};
|
|
308
312
|
/**
|
|
309
313
|
* The upload preset settings a `MockCalmLensAppClient` applies, as the API would, with the same
|
package/esm/testing.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { C as invalidConfig, S as invalidArgument, T as API_ERROR_DEFINITIONS, l as CalmLensError, w as API_ERROR_CODES, x as SDK_ERROR_CODES } from "./CalmLensError-
|
|
2
|
-
import { A as
|
|
3
|
-
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-
|
|
4
|
-
import { _ as validateAssetPayload, g as assetToData, h as assetDataToUint8Array, n as MOCK_HOOKS } from "./CalmLensConnection-
|
|
1
|
+
import { C as invalidConfig, S as invalidArgument, T as API_ERROR_DEFINITIONS, l as CalmLensError, w as API_ERROR_CODES, x as SDK_ERROR_CODES } from "./CalmLensError-C15tWu8W.js";
|
|
2
|
+
import { A as normalizeUploadMimeType, D as MAX_IMAGE_UPLOAD_BYTES, M as sleep, S as validateAppClientOptions, _ as randomUuid, f as checkTransformOptions, h as parseTransformSelector, k as getRejectedUploadMimeTypeError, m as isAcceptedUploadMimeType, t as ASSET_RESOURCE_PATHS, w as validateServerClientOptions } from "./CalmLensCdn-CcxEY6wB.js";
|
|
3
|
+
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-CPWeRVWO.js";
|
|
4
|
+
import { _ as validateAssetPayload, g as assetToData, h as assetDataToUint8Array, n as MOCK_HOOKS } from "./CalmLensConnection-CfGVp95D.js";
|
|
5
5
|
import { t as hmacSha256Hex } from "./CryptoUtils-BLCa-oZe-DKr3LmN6.js";
|
|
6
|
-
import { t as CalmLensAppClient } from "./CalmLensAppClient-
|
|
7
|
-
import { o as placeholderHashToDataURL, r as isFileAccepted } from "./UploadController-
|
|
8
|
-
import { f as getTestInputTag, g as CLASSIFICATION_CATEGORIES, h as lazySchema, t as withValidTestInputArguments } from "./CalmLensTestInputArguments-
|
|
6
|
+
import { t as CalmLensAppClient } from "./CalmLensAppClient-gAd0C_Q_.js";
|
|
7
|
+
import { o as placeholderHashToDataURL, r as isFileAccepted } from "./UploadController-DVsTVJVv.js";
|
|
8
|
+
import { f as getTestInputTag, g as CLASSIFICATION_CATEGORIES, h as lazySchema, t as withValidTestInputArguments } from "./CalmLensTestInputArguments-CqPADTkl.js";
|
|
9
9
|
import * as zod from "zod";
|
|
10
10
|
// src/contract/MediaTestTriggers.js
|
|
11
11
|
const MEDIA_TEST_SIGNALS = [...CLASSIFICATION_CATEGORIES, "violence.graphic"];
|
|
@@ -8143,6 +8143,34 @@ const getMockApiKeyGrants = (apiKey) => {
|
|
|
8143
8143
|
* where CalmLens gives your key's own ID.
|
|
8144
8144
|
*/
|
|
8145
8145
|
const MOCK_API_KEY_ID = "key_mock0000000000000000";
|
|
8146
|
+
// src/contract/ModerationContextLimits-ooIiAjJB.js
|
|
8147
|
+
/** The most characters of one earlier post's text CalmLens reads. */
|
|
8148
|
+
const MODERATION_CONTEXT_MAX_ITEM_CHARACTERS = 2e3;
|
|
8149
|
+
/** Unicode code points, as every SDK counts characters. */
|
|
8150
|
+
const countModerationContextCharacters = (text) => {
|
|
8151
|
+
let count = 0;
|
|
8152
|
+
for (const _ of text) count++;
|
|
8153
|
+
return count;
|
|
8154
|
+
};
|
|
8155
|
+
/**
|
|
8156
|
+
* The earlier posts CalmLens uses: the most recent ones, newest first, while at most
|
|
8157
|
+
* `MODERATION_CONTEXT_USED_ITEMS` and `MODERATION_CONTEXT_USED_CHARACTERS` allow, returned oldest
|
|
8158
|
+
* first. `textOf` gives the text each post contributes, read from its asset. The newest post is
|
|
8159
|
+
* always kept.
|
|
8160
|
+
*/
|
|
8161
|
+
const selectModerationContextItems = (items, textOf) => {
|
|
8162
|
+
const selected = [];
|
|
8163
|
+
let characters = 0;
|
|
8164
|
+
for (let index = items.length - 1; index >= 0; index--) {
|
|
8165
|
+
if (selected.length === 5) break;
|
|
8166
|
+
const item = items[index];
|
|
8167
|
+
const length = countModerationContextCharacters(textOf(item));
|
|
8168
|
+
if (selected.length && characters + length > 2e3) break;
|
|
8169
|
+
selected.unshift(item);
|
|
8170
|
+
characters += length;
|
|
8171
|
+
}
|
|
8172
|
+
return selected;
|
|
8173
|
+
};
|
|
8146
8174
|
// src/testing/MockClassification.ts
|
|
8147
8175
|
/** The parent categories, in the API's order. */
|
|
8148
8176
|
const MOCK_CATEGORIES = [
|
|
@@ -9842,7 +9870,7 @@ var MockCalmLensApi = class {
|
|
|
9842
9870
|
this.waitedMs = 0;
|
|
9843
9871
|
this.publishAssets = (_key, value) => isStoredAsset(value) ? {
|
|
9844
9872
|
...value,
|
|
9845
|
-
|
|
9873
|
+
sequence: this.eventSequenceOf(value.id)
|
|
9846
9874
|
} : value;
|
|
9847
9875
|
this.policies = /* @__PURE__ */ new Map();
|
|
9848
9876
|
this.hashLists = /* @__PURE__ */ new Map();
|
|
@@ -9912,32 +9940,35 @@ var MockCalmLensApi = class {
|
|
|
9912
9940
|
return this.pushEvent(input);
|
|
9913
9941
|
}
|
|
9914
9942
|
/** Adds an event to the feed, filling the fields the API always sets. */
|
|
9915
|
-
pushEvent(input) {
|
|
9943
|
+
pushEvent({ assetId, ...input }) {
|
|
9916
9944
|
const now = this.now();
|
|
9945
|
+
const sequence = assetId ? (this.assetEventSequences.get(assetId) ?? 0) + 1 : null;
|
|
9946
|
+
if (assetId && sequence !== null) this.assetEventSequences.set(assetId, sequence);
|
|
9917
9947
|
const event = {
|
|
9918
9948
|
id: this.createId("evt"),
|
|
9919
9949
|
projectId: this.projectId,
|
|
9920
9950
|
severity: "low",
|
|
9921
9951
|
title: input.type,
|
|
9922
9952
|
description: null,
|
|
9923
|
-
assetId: null,
|
|
9924
9953
|
actor: MOCK_API_KEY_ACTOR,
|
|
9925
9954
|
facts: [],
|
|
9926
9955
|
createdAt: now,
|
|
9927
|
-
...input
|
|
9956
|
+
...input,
|
|
9957
|
+
resource: assetId && sequence !== null ? {
|
|
9958
|
+
kind: "asset",
|
|
9959
|
+
id: assetId,
|
|
9960
|
+
sequence
|
|
9961
|
+
} : null
|
|
9928
9962
|
};
|
|
9929
|
-
const sequence = event.assetId ? (this.assetEventSequences.get(event.assetId) ?? 0) + 1 : null;
|
|
9930
|
-
if (event.assetId && sequence !== null) this.assetEventSequences.set(event.assetId, sequence);
|
|
9931
|
-
event.assetSequence = sequence;
|
|
9932
9963
|
this.eventFeed.push(event);
|
|
9933
9964
|
return event;
|
|
9934
9965
|
}
|
|
9935
|
-
/** The `
|
|
9966
|
+
/** The `resource.sequence` of the latest event about an asset, or 0 before its first. */
|
|
9936
9967
|
eventSequenceOf(assetId) {
|
|
9937
9968
|
return this.assetEventSequences.get(assetId) ?? 0;
|
|
9938
9969
|
}
|
|
9939
9970
|
/**
|
|
9940
|
-
* A copy of a stored asset as the API returns it, with its `
|
|
9971
|
+
* A copy of a stored asset as the API returns it, with its `sequence` as it is now. The
|
|
9941
9972
|
* mock keeps each asset's sequence itself rather than in `databaseStorage`, whose
|
|
9942
9973
|
* implementations needn't know about it, so every asset leaving the mock passes through here
|
|
9943
9974
|
* or `publishAssets`.
|
|
@@ -9945,7 +9976,7 @@ var MockCalmLensApi = class {
|
|
|
9945
9976
|
toPublished(asset) {
|
|
9946
9977
|
return {
|
|
9947
9978
|
...structuredClone(asset),
|
|
9948
|
-
|
|
9979
|
+
sequence: this.eventSequenceOf(asset.id)
|
|
9949
9980
|
};
|
|
9950
9981
|
}
|
|
9951
9982
|
/** Applies a reviewer's decision to a stored asset (see `MockCalmLensServerClient.decide`). */
|
|
@@ -11042,7 +11073,7 @@ var MockCalmLensApi = class {
|
|
|
11042
11073
|
const keepContent = processingOptions.retainContent === true;
|
|
11043
11074
|
this.processingOptions.set(id, processingOptions);
|
|
11044
11075
|
const hasContent = fields.url === void 0 || fetched !== void 0;
|
|
11045
|
-
const contextItems =
|
|
11076
|
+
const contextItems = await this.selectContext(fields.context?.items ?? []);
|
|
11046
11077
|
const asset = {
|
|
11047
11078
|
id,
|
|
11048
11079
|
projectId: this.projectId,
|
|
@@ -11062,7 +11093,7 @@ var MockCalmLensApi = class {
|
|
|
11062
11093
|
context: contextItems.length ? { items: contextItems } : null,
|
|
11063
11094
|
tags: fields.tags ?? [],
|
|
11064
11095
|
visibility: fields.visibility ?? "private",
|
|
11065
|
-
|
|
11096
|
+
sequence: 0,
|
|
11066
11097
|
content: {
|
|
11067
11098
|
status: keepContent ? "stored" : "temporary",
|
|
11068
11099
|
removalReason: null,
|
|
@@ -11230,6 +11261,28 @@ var MockCalmLensApi = class {
|
|
|
11230
11261
|
};
|
|
11231
11262
|
}
|
|
11232
11263
|
/** An asset's stored content, its parts in order, or `null` once it is removed. */
|
|
11264
|
+
/**
|
|
11265
|
+
* Like the API, a reply's context references the project's own assets, each read for its text:
|
|
11266
|
+
* a text asset's own text or the text found in it. Only the references CalmLens uses are kept.
|
|
11267
|
+
*/
|
|
11268
|
+
async selectContext(items) {
|
|
11269
|
+
const posts = await Promise.all(items.map(async (item) => {
|
|
11270
|
+
const asset = await this.databaseStorage.getAsset(item.assetId);
|
|
11271
|
+
if (!asset || asset.projectId !== this.projectId) throw fail(API_ERROR_CODES.CONTEXT_ASSET_NOT_FOUND, { details: { assetId: item.assetId } });
|
|
11272
|
+
return {
|
|
11273
|
+
item,
|
|
11274
|
+
text: await this.contextText(asset)
|
|
11275
|
+
};
|
|
11276
|
+
}));
|
|
11277
|
+
return selectModerationContextItems(posts, (post) => post.text).map((post) => post.item);
|
|
11278
|
+
}
|
|
11279
|
+
/** An earlier post's text, to the most CalmLens reads of one post; empty once its content is gone. */
|
|
11280
|
+
async contextText(asset) {
|
|
11281
|
+
const extracted = asset.content.extractedText;
|
|
11282
|
+
const bytes = asset.type === "plaintext-document" && await this.storedBytes(asset);
|
|
11283
|
+
const text = (bytes ? new TextDecoder().decode(bytes) : extracted?.type === "string" ? extracted.content : "").trim();
|
|
11284
|
+
return Array.from(text).slice(0, MODERATION_CONTEXT_MAX_ITEM_CHARACTERS).join("");
|
|
11285
|
+
}
|
|
11233
11286
|
async storedBytes(asset) {
|
|
11234
11287
|
if (asset.content.status === "removed") return null;
|
|
11235
11288
|
const stored = await this.imageStorage.getContent(asset.id);
|
|
@@ -11645,7 +11698,7 @@ var MockCalmLensApi = class {
|
|
|
11645
11698
|
const assetId = query.get("assetId");
|
|
11646
11699
|
if (assetId !== null && !isId(assetId, "asset")) throw invalidField("validation/invalid-format", "assetId");
|
|
11647
11700
|
const filter = btoa(JSON.stringify([[...new Set(types)].sort(), assetId]));
|
|
11648
|
-
const matches = (event) => (!types.length || types.includes(event.type)) && (assetId === null || event.
|
|
11701
|
+
const matches = (event) => (!types.length || types.includes(event.type)) && (assetId === null || event.resource?.id === assetId);
|
|
11649
11702
|
const cursor = query.get("cursor");
|
|
11650
11703
|
if (!cursor) return {
|
|
11651
11704
|
items: [],
|
|
@@ -12511,8 +12564,7 @@ const toWebhookEventPayload = (event) => ({
|
|
|
12511
12564
|
severity: event.severity,
|
|
12512
12565
|
title: event.title,
|
|
12513
12566
|
description: event.description ?? null,
|
|
12514
|
-
|
|
12515
|
-
assetSequence: event.assetSequence ?? null,
|
|
12567
|
+
resource: event.resource ?? null,
|
|
12516
12568
|
facts: event.facts,
|
|
12517
12569
|
createdAt: event.createdAt
|
|
12518
12570
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./Core-
|
|
1
|
+
import { r as appendAssetLocation } from "./CalmLensCdn-CcxEY6wB.js";
|
|
2
|
+
import "./Core-DTcxpv3O.js";
|
|
3
3
|
// src/ui/viewers/PdfLoader.ts
|
|
4
4
|
let loading;
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./CalmLensTypes-
|
|
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-
|
|
1
|
+
import "./CalmLensTypes-87kiUg0H.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-Ccy4-_sN.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> {
|
package/esm/ui.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
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, _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, h as UploaderProps, ht as getAssetViewerKind, i as CALMLENS_STYLES, it as getPlayedPercent, j as CustomUploadResult, k as CalmLensUpload, 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, z as createUploadController } from "./Core-
|
|
2
|
-
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-
|
|
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, _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, h as UploaderProps, ht as getAssetViewerKind, i as CALMLENS_STYLES, it as getPlayedPercent, j as CustomUploadResult, k as CalmLensUpload, 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, z as createUploadController } from "./Core-Ccy4-_sN.js";
|
|
2
|
+
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-sjnJhloQ.js";
|
|
3
3
|
export { ASSET_FILE_ICON_SIZE, ASSET_VIEWERS, type AssetDisplay, type AssetDisplayOptions, type AssetDocumentOptions, type AssetEventHandlers, type AssetImageOptions, type AssetImageSource, type AssetOptions, type AssetProps, AssetSession, type AssetSessionState, type AssetSpreadsheetOptions, type AssetVideoOptions, type AssetView, type AssetViewer, type AssetViewerKind, AssetViewerMount, AssetViewerName, AssetViewerOptionsByKind, CALMLENS_STYLES, CALMLENS_THEME, type CalmLensMessages, type CalmLensProvidedOptions, type CalmLensTheme, type CalmLensUpload, type CustomUploadContext, type CustomUploadResult, DEFAULT_MESSAGES, DEFAULT_VIEWER_MESSAGES, type DocumentViewerOptions, ICONS, ICON_ATTRIBUTES, 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, 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/ui.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
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-
|
|
2
|
-
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, 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-
|
|
3
|
-
import { a as createProgressFetch, i as withProvidedOptions, n as createUploadController, r as isFileAccepted, t as UploadController } from "./UploadController-
|
|
1
|
+
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-DUao8UY0.js";
|
|
2
|
+
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, 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-DTcxpv3O.js";
|
|
3
|
+
import { a as createProgressFetch, i as withProvidedOptions, n as createUploadController, r as isFileAccepted, t as UploadController } from "./UploadController-DVsTVJVv.js";
|
|
4
4
|
export { ASSET_FILE_ICON_SIZE, ASSET_VIEWERS, AssetSession, AssetViewerMount, CALMLENS_STYLES, CALMLENS_THEME, 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, withProvidedOptions };
|
package/esm/vue.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { O as CalmLensAppClientOptions, g as AssetModerationStatus, i as AssetAvailability, nn as ViewerClaims } from "./CalmLensTypes-
|
|
2
|
-
import "./index-
|
|
3
|
-
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-
|
|
4
|
-
import { a as UploaderProps, i as UploadSnapshot, n as UploadControllerOptions, r as UploadItem, s as createUploadController, t as CalmLensUpload } from "./BrowserUpload-
|
|
5
|
-
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-
|
|
1
|
+
import { O as CalmLensAppClientOptions, g as AssetModerationStatus, i as AssetAvailability, nn as ViewerClaims } from "./CalmLensTypes-87kiUg0H.js";
|
|
2
|
+
import "./index-CWUnLKoF.js";
|
|
3
|
+
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-Ccy4-_sN.js";
|
|
4
|
+
import { a as UploaderProps, i as UploadSnapshot, n as UploadControllerOptions, r as UploadItem, s as createUploadController, t as CalmLensUpload } from "./BrowserUpload-BAH54V1q.js";
|
|
5
|
+
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-sjnJhloQ.js";
|
|
6
6
|
import { App, MaybeRefOrGetter, PropType, ShallowRef } from "vue";
|
|
7
7
|
/** Shows a text asset's text, escaped, in a scrolling region. */
|
|
8
8
|
export declare const CalmLensTextViewer: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
package/esm/vue.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
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-
|
|
2
|
-
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, 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-
|
|
3
|
-
import { a as createProgressFetch, i as withProvidedOptions, n as createUploadController$1, r as isFileAccepted, t as UploadController } from "./UploadController-
|
|
1
|
+
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-DUao8UY0.js";
|
|
2
|
+
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, 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-DTcxpv3O.js";
|
|
3
|
+
import { a as createProgressFetch, i as withProvidedOptions, n as createUploadController$1, r as isFileAccepted, t as UploadController } from "./UploadController-DVsTVJVv.js";
|
|
4
4
|
import { c as renderFileIconSvg } from "./FileIcons-M6dzjFxd.js";
|
|
5
|
-
import { t as createUploadController } from "./BrowserUpload-
|
|
5
|
+
import { t as createUploadController } from "./BrowserUpload-C5aXj6QC.js";
|
|
6
6
|
import { computed, defineComponent, h, inject, onBeforeUnmount, onMounted, onScopeDispose, provide, ref, shallowRef, toValue, watch, watchEffect } from "vue";
|
|
7
7
|
// src/viewers/Vue.ts
|
|
8
8
|
const optional$1 = (type) => ({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "calmlens",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.31.0",
|
|
4
4
|
"description": "Official CalmLens SDK for JavaScript and TypeScript: content moderation, asset storage and CDN delivery.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://calmlens.com/docs/sdk/javascript",
|