calmlens 0.27.5 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/bin/calmlens.js +48 -26
- package/cjs/{BrowserUpload-DJZY1LSU.d.ts → BrowserUpload-CRbCsX7a.d.ts} +2 -2
- package/cjs/{BrowserUpload-DhruIgFN.js → BrowserUpload-Dz4UwTTJ.js} +1 -1
- package/cjs/{CalmLensAppClient-BA_xaNHY.js → CalmLensAppClient-B0QZ1oJV.js} +3 -3
- package/{esm/CalmLensAppClient-DzoSqUgG.d.ts → cjs/CalmLensAppClient-B3u6BlP5.d.ts} +2 -2
- package/cjs/{CalmLensOptionKeys-BvLQghl-.js → CalmLensOptionKeys-Cat8CgOn.js} +2 -2
- package/cjs/{CalmLensServerClient-D3K5HS9v.d.ts → CalmLensServerClient-B8ntjNL3.d.ts} +6 -6
- package/cjs/{CalmLensServerClient-D55xDZm4.js → CalmLensServerClient-CQdvhCGg.js} +14 -14
- package/cjs/{CalmLensTypes-OWZsGvBX.d.ts → CalmLensTypes-CtO4Dieu.d.ts} +79 -8
- package/{esm/Core-CTO_Eh0l.d.ts → cjs/Core-BJaLU71Q.d.ts} +2 -2
- package/cjs/{Core-kKGmyk5V.js → Core-DCnnUsgF.js} +7 -4
- package/cjs/{CryptoUtils-B_x8lMIx-YBW1-bvL.js → CryptoUtils-BLCa-oZe-leCkr1ko.js} +1 -2
- package/cjs/{ModerationContextLimits-Cxaob3tc.js → ModerationContextLimits-_knOVCH0.js} +63 -8
- package/cjs/{ReactUpload-BDXV4aHT.d.ts → ReactUpload-BGUkcMpg.d.ts} +1 -1
- package/cjs/{ReactUpload-Cx3Hi7xt.js → ReactUpload-BtmIrdky.js} +1 -1
- package/{esm/TestTriggers-Dnukm-jm-DoEB7jJc.d.ts → cjs/TestTriggers-dognME9k-PWyIfHMI.d.ts} +1 -2
- package/cjs/{TestTriggers-Cvi7e2KA-DcT1pc_W.js → TestTriggers-uL2Ec8Vt-cPmmKvYd.js} +14 -15
- package/cjs/{UploadController-CC1afxmL.js → UploadController-CEL3N4Ae.js} +2 -2
- package/cjs/{WebhookPayload-CrMU6lg0.d.ts → WebhookPayload-DZadhbAJ.d.ts} +5 -1
- package/cjs/app.d.ts +4 -4
- package/cjs/app.js +2 -2
- package/cjs/elements.d.ts +4 -4
- package/cjs/elements.js +4 -4
- package/cjs/{index-BDxmVi-G.d.ts → index-DQUZYLVY.d.ts} +2 -2
- package/cjs/index.d.ts +3 -3
- package/cjs/index.js +1 -1
- package/cjs/react-native.d.ts +2 -2
- package/cjs/react-native.js +5 -5
- package/cjs/react.d.ts +4 -4
- package/cjs/react.js +5 -5
- package/cjs/server.d.ts +4 -4
- package/cjs/server.js +2 -2
- package/cjs/test-inputs.d.ts +1 -1
- package/cjs/test-inputs.js +13 -13
- package/cjs/testing.d.ts +36 -7
- package/cjs/testing.js +112 -43
- package/cjs/{ui-DAbpyM2Z.d.ts → ui-BGywTQ2M.d.ts} +2 -2
- package/cjs/{ui-I75EvP9r.js → ui-DVQm0TFJ.js} +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/esm/{BrowserUpload-DJZY1LSU.d.ts → BrowserUpload-CRbCsX7a.d.ts} +2 -2
- package/esm/{BrowserUpload-CejeWw5r.js → BrowserUpload-DSq5Ezo1.js} +1 -1
- package/esm/{CalmLensAppClient-BxkCVPCl.js → CalmLensAppClient-B1QpSXYm.js} +3 -3
- package/{cjs/CalmLensAppClient-DzoSqUgG.d.ts → esm/CalmLensAppClient-B3u6BlP5.d.ts} +2 -2
- package/esm/{CalmLensOptionKeys-DC9FUO43.js → CalmLensOptionKeys-BYqFZ0FP.js} +2 -2
- package/esm/{CalmLensServerClient-D3K5HS9v.d.ts → CalmLensServerClient-B8ntjNL3.d.ts} +6 -6
- package/esm/{CalmLensServerClient-D-TIIQp2.js → CalmLensServerClient-D2Vr_jTR.js} +10 -10
- package/esm/{CalmLensTypes-OWZsGvBX.d.ts → CalmLensTypes-CtO4Dieu.d.ts} +79 -8
- package/{cjs/Core-CTO_Eh0l.d.ts → esm/Core-BJaLU71Q.d.ts} +2 -2
- package/esm/{Core-B85V5dxv.js → Core-Dz7BAias.js} +7 -4
- package/esm/{CryptoUtils-B_x8lMIx-DhuWGzqn.js → CryptoUtils-BLCa-oZe-DKr3LmN6.js} +1 -2
- package/esm/{ModerationContextLimits-Tev2lxE0.js → ModerationContextLimits-DaFaXt45.js} +46 -9
- package/esm/{ReactUpload-BDXV4aHT.d.ts → ReactUpload-BGUkcMpg.d.ts} +1 -1
- package/esm/{ReactUpload-B7QXMSWJ.js → ReactUpload-kSzn3SOj.js} +1 -1
- package/{cjs/TestTriggers-Dnukm-jm-DoEB7jJc.d.ts → esm/TestTriggers-dognME9k-PWyIfHMI.d.ts} +1 -2
- package/esm/{TestTriggers-Cvi7e2KA-BA83CRJb.js → TestTriggers-uL2Ec8Vt-DYbTEJWm.js} +11 -12
- package/esm/{UploadController-D7XmzO-p.js → UploadController--Qz3DP2W.js} +2 -2
- package/esm/{WebhookPayload-CrMU6lg0.d.ts → WebhookPayload-DZadhbAJ.d.ts} +5 -1
- package/esm/app.d.ts +4 -4
- package/esm/app.js +2 -2
- package/esm/elements.d.ts +4 -4
- package/esm/elements.js +4 -4
- package/esm/{index-BDxmVi-G.d.ts → index-DQUZYLVY.d.ts} +2 -2
- package/esm/index.d.ts +3 -3
- package/esm/index.js +1 -1
- package/esm/react-native.d.ts +2 -2
- package/esm/react-native.js +5 -5
- package/esm/react.d.ts +4 -4
- package/esm/react.js +5 -5
- package/esm/server.d.ts +4 -4
- package/esm/server.js +2 -2
- package/esm/test-inputs.d.ts +1 -1
- package/esm/test-inputs.js +1 -1
- package/esm/testing.d.ts +36 -7
- package/esm/testing.js +103 -34
- package/esm/{ui-cE1lyljs.js → ui-B951EpwC.js} +2 -2
- package/esm/{ui-DAbpyM2Z.d.ts → ui-BGywTQ2M.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/testing.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { A as
|
|
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-
|
|
4
|
-
import { t as hmacSha256Hex } from "./CryptoUtils-
|
|
5
|
-
import { t as CalmLensAppClient } from "./CalmLensAppClient-
|
|
6
|
-
import { o as placeholderHashToDataURL, r as isFileAccepted } from "./UploadController
|
|
7
|
-
import { d as getTestInputTag, h as CLASSIFICATION_CATEGORIES, m as lazySchema } from "./TestTriggers-
|
|
1
|
+
import { A as MAX_IMAGE_UPLOAD_BYTES, D as validateServerClientOptions, F as sleep, M as getRejectedUploadMimeTypeError, N as normalizeUploadMimeType, Q as CalmLensError, T as validateAppClientOptions, _ as isAcceptedUploadMimeType, b as randomUuid, dt as invalidConfig, ft as API_ERROR_CODES, h as checkTransformOptions, i as ASSET_RESOURCE_PATHS, lt as SDK_ERROR_CODES, pt as API_ERROR_DEFINITIONS, r as selectModerationContextItems, ut as invalidArgument, v as parseTransformSelector } from "./ModerationContextLimits-DaFaXt45.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-D2Vr_jTR.js";
|
|
3
|
+
import { _ as validateAssetPayload, a as MOCK_HOOKS, g as assetToData, h as assetDataToUint8Array } from "./CalmLensOptionKeys-BYqFZ0FP.js";
|
|
4
|
+
import { t as hmacSha256Hex } from "./CryptoUtils-BLCa-oZe-DKr3LmN6.js";
|
|
5
|
+
import { t as CalmLensAppClient } from "./CalmLensAppClient-B1QpSXYm.js";
|
|
6
|
+
import { o as placeholderHashToDataURL, r as isFileAccepted } from "./UploadController--Qz3DP2W.js";
|
|
7
|
+
import { d as getTestInputTag, h as CLASSIFICATION_CATEGORIES, m as lazySchema } from "./TestTriggers-uL2Ec8Vt-DYbTEJWm.js";
|
|
8
8
|
import * as zod from "zod";
|
|
9
9
|
// src/contract/MediaTestTriggers.js
|
|
10
10
|
const MEDIA_TEST_SIGNALS = [...CLASSIFICATION_CATEGORIES, "violence.graphic"];
|
|
@@ -31,7 +31,19 @@ async function generateMediaTestCode(signal, testInputKey) {
|
|
|
31
31
|
if (!MEDIA_TEST_SIGNALS.includes(signal)) throw new RangeError("Unsupported media test signal");
|
|
32
32
|
return `Calm Lens test ${[...await getTestInputTag("media", signal, testInputKey)].map((character) => HEX_WORDS[Number.parseInt(character, 16)]).join(" ")} ${signal.replace(/[.-]/g, " ")} end test`;
|
|
33
33
|
}
|
|
34
|
-
|
|
34
|
+
/**
|
|
35
|
+
* The character an asset ID starts with (after `asset_`) to say the region it lives in: the asset
|
|
36
|
+
* table computes each row's region from it (`AssetTable`), so an ID is only ever in one region and
|
|
37
|
+
* a lookup by ID goes straight there. A code is never reused for another region.
|
|
38
|
+
*/
|
|
39
|
+
const ASSET_ID_REGION_CODES = {
|
|
40
|
+
"aws-ap-southeast-1": "a",
|
|
41
|
+
"aws-eu-west-2": "e",
|
|
42
|
+
"aws-eu-central-1": "f",
|
|
43
|
+
"aws-us-east-2": "u"
|
|
44
|
+
};
|
|
45
|
+
new Map(Object.entries(ASSET_ID_REGION_CODES).map(([region, code]) => [code, region]));
|
|
46
|
+
// src/contract/Ids-BBz_iuDy.js
|
|
35
47
|
var __defProp = Object.defineProperty;
|
|
36
48
|
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod, mod.exports), cb = null), mod.exports);
|
|
37
49
|
var __exportAll = (all, no_symbols) => {
|
|
@@ -7925,6 +7937,7 @@ createMetaType({
|
|
|
7925
7937
|
createMetaType({ id: "updatedAt" });
|
|
7926
7938
|
createMetaType({ id: "monotonicTimestamp" });
|
|
7927
7939
|
createMetaType({ id: "backfill" });
|
|
7940
|
+
createMetaType({ id: "computed" });
|
|
7928
7941
|
/**
|
|
7929
7942
|
* The prefix of every kind of object customers can see, so an ID says what it identifies:
|
|
7930
7943
|
* `proj_8fK2mQx7Lp4NvB3tRz9Y` is a project. Rows that never leave the backend (usage meters, upload
|
|
@@ -7987,15 +8000,23 @@ const randomBase62 = (length) => {
|
|
|
7987
8000
|
}
|
|
7988
8001
|
return result;
|
|
7989
8002
|
};
|
|
7990
|
-
/**
|
|
8003
|
+
/**
|
|
8004
|
+
* A new random ID, such as `newId("proj")` → `proj_8fK2mQx7Lp4NvB3tRz9Y`. Assets take theirs from
|
|
8005
|
+
* `newAssetId`, which names their region.
|
|
8006
|
+
*/
|
|
7991
8007
|
const newId = (prefix) => `${prefix}_${randomBase62(20)}`;
|
|
8008
|
+
/**
|
|
8009
|
+
* A new asset ID for an asset that lives in `region`: its first character after `asset_` is the
|
|
8010
|
+
* region's code (`ASSET_ID_REGION_CODES`), then 19 random characters (about 113 bits).
|
|
8011
|
+
*/
|
|
8012
|
+
const newAssetId = (region) => `asset_${ASSET_ID_REGION_CODES[region]}${randomBase62(19)}`;
|
|
7992
8013
|
/** Whether `value` is an ID with `prefix` (or with any registered prefix). */
|
|
7993
8014
|
const isId = (value, prefix) => typeof value === "string" && idPattern(prefix).test(value);
|
|
7994
8015
|
/** Example IDs for docs, OpenAPI and SDK fixtures: fixed, so generated output stays stable. */
|
|
7995
8016
|
const EXAMPLE_IDS = {
|
|
7996
8017
|
org: "org_3hQ7tLk2Vb9XpR4mWc8N",
|
|
7997
8018
|
proj: "proj_8fK2mQx7Lp4NvB3tRz9Y",
|
|
7998
|
-
asset: "
|
|
8019
|
+
asset: "asset_e5Gm2Rk8XqT3wLp9VbN4",
|
|
7999
8020
|
fldr: "fldr_7Nc4Wq2Lm8Xt5Rk9Bv3P",
|
|
8000
8021
|
lens: "lens_2Xr9Lp4Vm7Qk3Tb8Nw5C",
|
|
8001
8022
|
key: "key_9Pt3Wm6Rk2Lx8Qv4Nb7C",
|
|
@@ -8028,8 +8049,9 @@ const EXAMPLE_IDS = {
|
|
|
8028
8049
|
* across the packages that build records from plain strings).
|
|
8029
8050
|
*/
|
|
8030
8051
|
const idField = (prefix) => zod.string().regex(idPattern(prefix), { message: `Must be a valid ID: "${prefix}_" followed by 20 letters or digits` }).meta({ examples: [EXAMPLE_IDS[prefix]] });
|
|
8031
|
-
// src/contract/Permissions-
|
|
8032
|
-
|
|
8052
|
+
// src/contract/Permissions-Dwk78TtG.js
|
|
8053
|
+
/** Every permission action, in the order the docs and the portal list them. */
|
|
8054
|
+
const PERMISSION_ACTIONS = [
|
|
8033
8055
|
"assets:read",
|
|
8034
8056
|
"assets:download",
|
|
8035
8057
|
"assets:create",
|
|
@@ -8061,7 +8083,8 @@ const ACTION_SCHEMA = /* @__PURE__ */ lazySchema(() => zod.enum([
|
|
|
8061
8083
|
"reviews:read",
|
|
8062
8084
|
"reviews:write",
|
|
8063
8085
|
"project:manage"
|
|
8064
|
-
]
|
|
8086
|
+
];
|
|
8087
|
+
const ACTION_SCHEMA = /* @__PURE__ */ lazySchema(() => zod.enum(PERMISSION_ACTIONS));
|
|
8065
8088
|
const PROJECT_ACTIONS = [...[
|
|
8066
8089
|
"settings",
|
|
8067
8090
|
"members",
|
|
@@ -8083,8 +8106,8 @@ const GRANT_SCHEMA = /* @__PURE__ */ lazySchema(() => zod.object({
|
|
|
8083
8106
|
includeSubfolders: zod.boolean()
|
|
8084
8107
|
}).strict().refine((g) => g.folderId === null || !g.actions.some(isProjectAction), "Project configuration permissions require project scope"));
|
|
8085
8108
|
const GRANTS_SCHEMA = /* @__PURE__ */ lazySchema(() => zod.array(GRANT_SCHEMA).max(100));
|
|
8086
|
-
[...
|
|
8087
|
-
[...
|
|
8109
|
+
[...PERMISSION_ACTIONS.filter((a) => !isProjectAction(a))];
|
|
8110
|
+
[...PERMISSION_ACTIONS.filter((a) => !isProjectAction(a))];
|
|
8088
8111
|
const permits = (grants, action, folderId, folders) => grants.some((grant) => {
|
|
8089
8112
|
if (![action, ...actionsImplying(action)].some((held) => grant.actions.includes(held))) return false;
|
|
8090
8113
|
if (grant.folderId === null) return true;
|
|
@@ -8314,6 +8337,8 @@ var MockDecision = class {
|
|
|
8314
8337
|
#flags = /* @__PURE__ */ new Map();
|
|
8315
8338
|
#notEvaluated = /* @__PURE__ */ new Set();
|
|
8316
8339
|
#pendingReview;
|
|
8340
|
+
#ocr;
|
|
8341
|
+
#linkDetection;
|
|
8317
8342
|
constructor(status) {
|
|
8318
8343
|
if (!OUTCOMES.includes(status)) throw invalidArgument(`status must be one of ${OUTCOMES.join(", ")}`);
|
|
8319
8344
|
this.status = status;
|
|
@@ -8363,6 +8388,36 @@ var MockDecision = class {
|
|
|
8363
8388
|
};
|
|
8364
8389
|
return this;
|
|
8365
8390
|
}
|
|
8391
|
+
/**
|
|
8392
|
+
* The text OCR finds in an image, for an upload that turns OCR on: `classification.ocr` reports
|
|
8393
|
+
* `textRegions`, and `content.extractedText` holds `text` when the upload keeps its content.
|
|
8394
|
+
*/
|
|
8395
|
+
withOcr(text, textRegions = []) {
|
|
8396
|
+
this.#ocr = {
|
|
8397
|
+
text,
|
|
8398
|
+
textRegions: structuredClone(textRegions)
|
|
8399
|
+
};
|
|
8400
|
+
return this;
|
|
8401
|
+
}
|
|
8402
|
+
/**
|
|
8403
|
+
* The QR codes and links link detection finds in an image, reported as
|
|
8404
|
+
* `classification.linkDetection` unless the upload turns link detection off.
|
|
8405
|
+
*/
|
|
8406
|
+
withLinkDetection(qrCodes = [], links = []) {
|
|
8407
|
+
this.#linkDetection = {
|
|
8408
|
+
qrCodes: structuredClone(qrCodes),
|
|
8409
|
+
links: structuredClone(links)
|
|
8410
|
+
};
|
|
8411
|
+
return this;
|
|
8412
|
+
}
|
|
8413
|
+
/** @internal What `withOcr` set, if anything. */
|
|
8414
|
+
get ocrFindings() {
|
|
8415
|
+
return this.#ocr && structuredClone(this.#ocr);
|
|
8416
|
+
}
|
|
8417
|
+
/** @internal What `withLinkDetection` set, if anything. */
|
|
8418
|
+
get linkFindings() {
|
|
8419
|
+
return this.#linkDetection && structuredClone(this.#linkDetection);
|
|
8420
|
+
}
|
|
8366
8421
|
#checkCategory(category) {
|
|
8367
8422
|
if (!MOCK_CATEGORIES.includes(category)) throw invalidArgument(`${category} is not a CalmLens category`);
|
|
8368
8423
|
}
|
|
@@ -10446,17 +10501,21 @@ var MockCalmLensApi = class {
|
|
|
10446
10501
|
}
|
|
10447
10502
|
/**
|
|
10448
10503
|
* Signs an asset URL like the API (`POST /projects/:projectId/signed-asset-urls`): a grant to one
|
|
10449
|
-
* asset, by ID or external ID, until it expires,
|
|
10504
|
+
* asset, by ID or external ID, until it expires, ending in the resource it was signed for and
|
|
10505
|
+
* serving the original only when signed for it. The mock's
|
|
10450
10506
|
* grant is readable (its asset, original access and expiry), unlike the CDN's, and only the
|
|
10451
10507
|
* mock's CDN accepts it.
|
|
10452
10508
|
*/
|
|
10453
10509
|
async signAssetUrl(body) {
|
|
10454
|
-
|
|
10510
|
+
const fields = [
|
|
10455
10511
|
"assetId",
|
|
10456
10512
|
"externalId",
|
|
10457
10513
|
"expiresIn",
|
|
10458
|
-
"
|
|
10459
|
-
]
|
|
10514
|
+
"resource"
|
|
10515
|
+
];
|
|
10516
|
+
const unknown = Object.keys(body).find((key) => !fields.includes(key));
|
|
10517
|
+
if (unknown !== void 0) throw invalidField("validation/unknown-field", unknown);
|
|
10518
|
+
for (const key of fields) if (body[key] === null) throw invalidField("validation/invalid-type", key);
|
|
10460
10519
|
const { assetId, externalId } = body;
|
|
10461
10520
|
if (assetId === void 0 === (externalId === void 0)) throw new ApiFailure(400, API_ERROR_CODES.INVALID_REQUEST, "Send either assetId or externalId", { issues: [{
|
|
10462
10521
|
path: "",
|
|
@@ -10467,8 +10526,8 @@ var MockCalmLensApi = class {
|
|
|
10467
10526
|
if (typeof expiresIn !== "number" || !Number.isInteger(expiresIn)) throw invalidField("validation/invalid-type", "expiresIn");
|
|
10468
10527
|
if (expiresIn < 1) throw invalidField("validation/too-small", "expiresIn");
|
|
10469
10528
|
if (expiresIn > 86400) throw invalidField("validation/too-big", "expiresIn");
|
|
10470
|
-
const
|
|
10471
|
-
if (typeof
|
|
10529
|
+
const { resource } = body;
|
|
10530
|
+
if (resource !== void 0 && (typeof resource !== "string" || !Object.hasOwn(ASSET_RESOURCE_PATHS, resource))) throw invalidField("validation/invalid-value", "resource");
|
|
10472
10531
|
let asset;
|
|
10473
10532
|
if (externalId !== void 0) {
|
|
10474
10533
|
asset = (await this.databaseStorage.listAssets(this.projectId)).find((candidate) => candidate.externalId === externalId);
|
|
@@ -10478,11 +10537,12 @@ var MockCalmLensApi = class {
|
|
|
10478
10537
|
const expiresAt = this.now() + expiresIn * 1e3;
|
|
10479
10538
|
const grant = encodeMockGrant({
|
|
10480
10539
|
assetId: asset.id,
|
|
10481
|
-
original,
|
|
10540
|
+
original: resource === "original",
|
|
10482
10541
|
expiresAt
|
|
10483
10542
|
});
|
|
10543
|
+
const path = resource === void 0 ? "" : `/${ASSET_RESOURCE_PATHS[resource]}`;
|
|
10484
10544
|
return {
|
|
10485
|
-
url: `${this.cdnBaseUrl}/assets/${encodeURIComponent(this.projectId)}/${grant}`,
|
|
10545
|
+
url: `${this.cdnBaseUrl}/assets/${encodeURIComponent(this.projectId)}/${grant}${path}`,
|
|
10486
10546
|
expiresAt
|
|
10487
10547
|
};
|
|
10488
10548
|
}
|
|
@@ -10904,18 +10964,28 @@ var MockCalmLensApi = class {
|
|
|
10904
10964
|
const next = await this.applyOutcome(asset, decision.status, "policy", decision.report(this.now()));
|
|
10905
10965
|
const features = this.processingOptions.get(asset.id)?.features;
|
|
10906
10966
|
if (next.classification.status !== "completed" || asset.type !== "image") return next;
|
|
10967
|
+
const ocr = features?.ocr?.enabled === true ? decision.ocrFindings : void 0;
|
|
10907
10968
|
return {
|
|
10908
10969
|
...next,
|
|
10970
|
+
...ocr?.text != null && next.content.status === "stored" && { content: {
|
|
10971
|
+
...next.content,
|
|
10972
|
+
extractedText: {
|
|
10973
|
+
type: "string",
|
|
10974
|
+
content: ocr.text
|
|
10975
|
+
}
|
|
10976
|
+
} },
|
|
10909
10977
|
classification: {
|
|
10910
10978
|
...next.classification,
|
|
10911
10979
|
...features?.ocr?.enabled === true && { ocr: {
|
|
10912
10980
|
status: "evaluated",
|
|
10913
|
-
textRegions: []
|
|
10981
|
+
textRegions: ocr?.textRegions ?? []
|
|
10914
10982
|
} },
|
|
10915
10983
|
...features?.linkDetection?.enabled !== false && { linkDetection: {
|
|
10916
10984
|
status: "evaluated",
|
|
10917
|
-
|
|
10918
|
-
|
|
10985
|
+
...decision.linkFindings ?? {
|
|
10986
|
+
qrCodes: [],
|
|
10987
|
+
links: []
|
|
10988
|
+
}
|
|
10919
10989
|
} },
|
|
10920
10990
|
...features?.personDetection?.enabled === true && { personDetection: {
|
|
10921
10991
|
status: "evaluated",
|
|
@@ -11631,7 +11701,7 @@ var MockCalmLensApi = class {
|
|
|
11631
11701
|
}, url);
|
|
11632
11702
|
if (resource === "embed") return this.cdnResponse(isHead, new TextEncoder().encode(MOCK_EMBED_HTML), url, {
|
|
11633
11703
|
"Content-Type": "text/html; charset=utf-8",
|
|
11634
|
-
"Cache-Control":
|
|
11704
|
+
"Cache-Control": "private, no-store",
|
|
11635
11705
|
"Cache-Tag": `asset-${asset.id}`,
|
|
11636
11706
|
"X-Content-Type-Options": "nosniff"
|
|
11637
11707
|
});
|
|
@@ -11663,15 +11733,14 @@ var MockCalmLensApi = class {
|
|
|
11663
11733
|
bytes = mockPlaceholderPng(preview?.thumbhash ?? MOCK_THUMBHASH);
|
|
11664
11734
|
contentType = "image/png";
|
|
11665
11735
|
}
|
|
11666
|
-
const
|
|
11736
|
+
const imageResponse = stillImage || resource === "original" && asset.type === "image";
|
|
11737
|
+
const maxAge = grant ? Math.max(0, Math.min(86400, Math.floor((grant.expiresAt - this.now()) / 1e3))) : 86400;
|
|
11738
|
+
const cacheControl = query.has("viewerClaims") || request.headers.has("X-CalmLens-Viewer-Claims") ? "private, no-store" : isPrivate && !grant ? "private, no-cache" : `${isPrivate ? "private" : "public"}, max-age=${maxAge}, must-revalidate`;
|
|
11667
11739
|
return this.cdnResponse(isHead, bytes, url, {
|
|
11668
11740
|
"Content-Type": contentType,
|
|
11669
|
-
"Cache-Control":
|
|
11741
|
+
"Cache-Control": cacheControl,
|
|
11670
11742
|
"Cache-Tag": `asset-${asset.id}`,
|
|
11671
|
-
...
|
|
11672
|
-
ETag: `"${asset.id}"`,
|
|
11673
|
-
Expires: new Date(this.now() + 31536e6).toUTCString()
|
|
11674
|
-
} : {},
|
|
11743
|
+
...imageResponse ? { ETag: `"${asset.id}"` } : {},
|
|
11675
11744
|
"X-Content-Type-Options": "nosniff",
|
|
11676
11745
|
"Content-Security-Policy": "sandbox; default-src 'none'",
|
|
11677
11746
|
...isActiveContentType(contentType) ? { "Content-Disposition": "attachment" } : {}
|
|
@@ -11872,7 +11941,7 @@ var MockCalmLensServerClient = class extends CalmLensServerClient {
|
|
|
11872
11941
|
grants: getMockApiKeyGrants(options.apiKey),
|
|
11873
11942
|
databaseStorage: mockOptions.databaseStorage ?? new InMemoryMockDatabaseStorage(),
|
|
11874
11943
|
imageStorage: mockOptions.imageStorage ?? new InMemoryMockImageStorage(),
|
|
11875
|
-
createId: mockOptions.createId ?? newId,
|
|
11944
|
+
createId: mockOptions.createId ?? ((prefix) => prefix === "asset" ? newAssetId("aws-eu-west-2") : newId(prefix)),
|
|
11876
11945
|
now: mockOptions.now ?? createMonotonicClock(),
|
|
11877
11946
|
moderate: mockOptions.moderate ?? defaultModerate
|
|
11878
11947
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./Core-
|
|
1
|
+
import { o as appendAssetLocation } from "./ModerationContextLimits-DaFaXt45.js";
|
|
2
|
+
import "./Core-Dz7BAias.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-CtO4Dieu.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-BJaLU71Q.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-BJaLU71Q.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-BGywTQ2M.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-B951EpwC.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-Dz7BAias.js";
|
|
3
|
+
import { a as createProgressFetch, i as withProvidedOptions, n as createUploadController, r as isFileAccepted, t as UploadController } from "./UploadController--Qz3DP2W.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, en as ViewerClaims, g as AssetModerationStatus, i as AssetAvailability } 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, en as ViewerClaims, g as AssetModerationStatus, i as AssetAvailability } from "./CalmLensTypes-CtO4Dieu.js";
|
|
2
|
+
import "./index-DQUZYLVY.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-BJaLU71Q.js";
|
|
4
|
+
import { a as UploaderProps, i as UploadSnapshot, n as UploadControllerOptions, r as UploadItem, s as createUploadController, t as CalmLensUpload } from "./BrowserUpload-CRbCsX7a.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-BGywTQ2M.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-B951EpwC.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-Dz7BAias.js";
|
|
3
|
+
import { a as createProgressFetch, i as withProvidedOptions, n as createUploadController$1, r as isFileAccepted, t as UploadController } from "./UploadController--Qz3DP2W.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-DSq5Ezo1.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.28.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",
|