calmlens 0.27.5 → 0.27.6

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.
Files changed (81) hide show
  1. package/README.md +2 -2
  2. package/bin/calmlens.js +26 -15
  3. package/cjs/{BrowserUpload-DJZY1LSU.d.ts → BrowserUpload-CdOfuIcV.d.ts} +2 -2
  4. package/cjs/{BrowserUpload-DhruIgFN.js → BrowserUpload-GQtZti-D.js} +1 -1
  5. package/{esm/CalmLensAppClient-DzoSqUgG.d.ts → cjs/CalmLensAppClient-Btp8f-34.d.ts} +2 -2
  6. package/cjs/{CalmLensAppClient-BA_xaNHY.js → CalmLensAppClient-Bwt3gP0C.js} +3 -3
  7. package/cjs/{CalmLensOptionKeys-BvLQghl-.js → CalmLensOptionKeys--gTpTkwt.js} +1 -1
  8. package/cjs/{CalmLensServerClient-D55xDZm4.js → CalmLensServerClient-BYMzGkQK.js} +7 -7
  9. package/cjs/{CalmLensServerClient-D3K5HS9v.d.ts → CalmLensServerClient-C3kaPLUZ.d.ts} +2 -2
  10. package/cjs/{CalmLensTypes-OWZsGvBX.d.ts → CalmLensTypes-DxxyZt2L.d.ts} +73 -5
  11. package/cjs/{Core-kKGmyk5V.js → Core-52DVaX7d.js} +2 -2
  12. package/{esm/Core-CTO_Eh0l.d.ts → cjs/Core-Dhijt6JU.d.ts} +2 -2
  13. package/cjs/{CryptoUtils-B_x8lMIx-YBW1-bvL.js → CryptoUtils-BLCa-oZe-leCkr1ko.js} +1 -2
  14. package/cjs/{ModerationContextLimits-Cxaob3tc.js → ModerationContextLimits-DJyIjzIn.js} +21 -3
  15. package/cjs/{ReactUpload-BDXV4aHT.d.ts → ReactUpload-BuqLPgNr.d.ts} +1 -1
  16. package/cjs/{ReactUpload-Cx3Hi7xt.js → ReactUpload-DHuhGYsr.js} +1 -1
  17. package/cjs/{TestTriggers-Cvi7e2KA-DcT1pc_W.js → TestTriggers-DP4m92jg-C0HD-A4r.js} +14 -14
  18. package/cjs/{UploadController-CC1afxmL.js → UploadController-ChzDPMmm.js} +2 -2
  19. package/cjs/{WebhookPayload-CrMU6lg0.d.ts → WebhookPayload-D_yWJA9M.d.ts} +5 -1
  20. package/cjs/app.d.ts +4 -4
  21. package/cjs/app.js +2 -2
  22. package/cjs/elements.d.ts +4 -4
  23. package/cjs/elements.js +4 -4
  24. package/cjs/{index-BDxmVi-G.d.ts → index-CUA-HDNu.d.ts} +2 -2
  25. package/cjs/index.d.ts +3 -3
  26. package/cjs/index.js +1 -1
  27. package/cjs/react-native.d.ts +2 -2
  28. package/cjs/react-native.js +4 -4
  29. package/cjs/react.d.ts +4 -4
  30. package/cjs/react.js +5 -5
  31. package/cjs/server.d.ts +4 -4
  32. package/cjs/server.js +2 -2
  33. package/cjs/test-inputs.js +13 -13
  34. package/cjs/testing.d.ts +4 -4
  35. package/cjs/testing.js +54 -32
  36. package/cjs/{ui-DAbpyM2Z.d.ts → ui-BSm_qphN.d.ts} +2 -2
  37. package/cjs/{ui-I75EvP9r.js → ui-C1_SDSiq.js} +2 -2
  38. package/cjs/ui.d.ts +2 -2
  39. package/cjs/ui.js +3 -3
  40. package/cjs/vue.d.ts +5 -5
  41. package/cjs/vue.js +4 -4
  42. package/esm/{BrowserUpload-CejeWw5r.js → BrowserUpload-BaKFKEBz.js} +1 -1
  43. package/esm/{BrowserUpload-DJZY1LSU.d.ts → BrowserUpload-CdOfuIcV.d.ts} +2 -2
  44. package/{cjs/CalmLensAppClient-DzoSqUgG.d.ts → esm/CalmLensAppClient-Btp8f-34.d.ts} +2 -2
  45. package/esm/{CalmLensAppClient-BxkCVPCl.js → CalmLensAppClient-DM6c3pGC.js} +3 -3
  46. package/esm/{CalmLensOptionKeys-DC9FUO43.js → CalmLensOptionKeys-CKZs8i3_.js} +1 -1
  47. package/esm/{CalmLensServerClient-D3K5HS9v.d.ts → CalmLensServerClient-C3kaPLUZ.d.ts} +2 -2
  48. package/esm/{CalmLensServerClient-D-TIIQp2.js → CalmLensServerClient-Da2UfUo4.js} +3 -3
  49. package/esm/{CalmLensTypes-OWZsGvBX.d.ts → CalmLensTypes-DxxyZt2L.d.ts} +73 -5
  50. package/{cjs/Core-CTO_Eh0l.d.ts → esm/Core-Dhijt6JU.d.ts} +2 -2
  51. package/esm/{Core-B85V5dxv.js → Core-kYMRW5C1.js} +2 -2
  52. package/esm/{CryptoUtils-B_x8lMIx-DhuWGzqn.js → CryptoUtils-BLCa-oZe-DKr3LmN6.js} +1 -2
  53. package/esm/{ModerationContextLimits-Tev2lxE0.js → ModerationContextLimits-ZIlK9n2X.js} +21 -3
  54. package/esm/{ReactUpload-BDXV4aHT.d.ts → ReactUpload-BuqLPgNr.d.ts} +1 -1
  55. package/esm/{ReactUpload-B7QXMSWJ.js → ReactUpload-CipY3cmO.js} +1 -1
  56. package/esm/{TestTriggers-Cvi7e2KA-BA83CRJb.js → TestTriggers-DP4m92jg-DhOI4S1V.js} +11 -11
  57. package/esm/{UploadController-D7XmzO-p.js → UploadController-D-14HWII.js} +2 -2
  58. package/esm/{WebhookPayload-CrMU6lg0.d.ts → WebhookPayload-D_yWJA9M.d.ts} +5 -1
  59. package/esm/app.d.ts +4 -4
  60. package/esm/app.js +2 -2
  61. package/esm/elements.d.ts +4 -4
  62. package/esm/elements.js +4 -4
  63. package/esm/{index-BDxmVi-G.d.ts → index-CUA-HDNu.d.ts} +2 -2
  64. package/esm/index.d.ts +3 -3
  65. package/esm/index.js +1 -1
  66. package/esm/react-native.d.ts +2 -2
  67. package/esm/react-native.js +4 -4
  68. package/esm/react.d.ts +4 -4
  69. package/esm/react.js +5 -5
  70. package/esm/server.d.ts +4 -4
  71. package/esm/server.js +2 -2
  72. package/esm/test-inputs.js +1 -1
  73. package/esm/testing.d.ts +4 -4
  74. package/esm/testing.js +45 -23
  75. package/esm/{ui-DAbpyM2Z.d.ts → ui-BSm_qphN.d.ts} +2 -2
  76. package/esm/{ui-cE1lyljs.js → ui-CgIG3knW.js} +2 -2
  77. package/esm/ui.d.ts +2 -2
  78. package/esm/ui.js +3 -3
  79. package/esm/vue.d.ts +5 -5
  80. package/esm/vue.js +4 -4
  81. package/package.json +1 -1
package/esm/testing.js CHANGED
@@ -1,10 +1,10 @@
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
- import { t as hmacSha256Hex } from "./CryptoUtils-B_x8lMIx-DhuWGzqn.js";
5
- import { t as CalmLensAppClient } from "./CalmLensAppClient-BxkCVPCl.js";
6
- import { o as placeholderHashToDataURL, r as isFileAccepted } from "./UploadController-D7XmzO-p.js";
7
- import { d as getTestInputTag, h as CLASSIFICATION_CATEGORIES, m as lazySchema } from "./TestTriggers-Cvi7e2KA-BA83CRJb.js";
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-ZIlK9n2X.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-Da2UfUo4.js";
3
+ import { _ as validateAssetPayload, a as MOCK_HOOKS, g as assetToData, h as assetDataToUint8Array } from "./CalmLensOptionKeys-CKZs8i3_.js";
4
+ import { t as hmacSha256Hex } from "./CryptoUtils-BLCa-oZe-DKr3LmN6.js";
5
+ import { t as CalmLensAppClient } from "./CalmLensAppClient-DM6c3pGC.js";
6
+ import { o as placeholderHashToDataURL, r as isFileAccepted } from "./UploadController-D-14HWII.js";
7
+ import { d as getTestInputTag, h as CLASSIFICATION_CATEGORIES, m as lazySchema } from "./TestTriggers-DP4m92jg-DhOI4S1V.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
- // src/contract/Ids-C2cLdFM0.js
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
- /** A new random ID, such as `newId("proj")` → `proj_8fK2mQx7Lp4NvB3tRz9Y`. */
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: "asset_5Gm2Rk8XqT3wLp9VbN4c",
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-CzuRcPMS.js
8032
- const ACTION_SCHEMA = /* @__PURE__ */ lazySchema(() => zod.enum([
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
- [...ACTION_SCHEMA.options.filter((a) => !isProjectAction(a))];
8087
- [...ACTION_SCHEMA.options.filter((a) => !isProjectAction(a))];
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;
@@ -11631,7 +11654,7 @@ var MockCalmLensApi = class {
11631
11654
  }, url);
11632
11655
  if (resource === "embed") return this.cdnResponse(isHead, new TextEncoder().encode(MOCK_EMBED_HTML), url, {
11633
11656
  "Content-Type": "text/html; charset=utf-8",
11634
- "Cache-Control": Object.keys(claims).length ? "private, no-store" : `${isPrivate ? "private" : "public"}, max-age=3600`,
11657
+ "Cache-Control": "private, no-store",
11635
11658
  "Cache-Tag": `asset-${asset.id}`,
11636
11659
  "X-Content-Type-Options": "nosniff"
11637
11660
  });
@@ -11663,15 +11686,14 @@ var MockCalmLensApi = class {
11663
11686
  bytes = mockPlaceholderPng(preview?.thumbhash ?? MOCK_THUMBHASH);
11664
11687
  contentType = "image/png";
11665
11688
  }
11666
- const immutable = stillImage || resource === "original" && asset.type === "image";
11689
+ const imageResponse = stillImage || resource === "original" && asset.type === "image";
11690
+ const maxAge = grant ? Math.max(0, Math.min(86400, Math.floor((grant.expiresAt - this.now()) / 1e3))) : 86400;
11691
+ 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
11692
  return this.cdnResponse(isHead, bytes, url, {
11668
11693
  "Content-Type": contentType,
11669
- "Cache-Control": Object.keys(claims).length ? "private, no-store" : `${isPrivate ? "private" : "public"}, ${immutable ? "max-age=31536000, immutable" : "max-age=3600"}`,
11694
+ "Cache-Control": cacheControl,
11670
11695
  "Cache-Tag": `asset-${asset.id}`,
11671
- ...immutable ? {
11672
- ETag: `"${asset.id}"`,
11673
- Expires: new Date(this.now() + 31536e6).toUTCString()
11674
- } : {},
11696
+ ...imageResponse ? { ETag: `"${asset.id}"` } : {},
11675
11697
  "X-Content-Type-Options": "nosniff",
11676
11698
  "Content-Security-Policy": "sandbox; default-src 'none'",
11677
11699
  ...isActiveContentType(contentType) ? { "Content-Disposition": "attachment" } : {}
@@ -11872,7 +11894,7 @@ var MockCalmLensServerClient = class extends CalmLensServerClient {
11872
11894
  grants: getMockApiKeyGrants(options.apiKey),
11873
11895
  databaseStorage: mockOptions.databaseStorage ?? new InMemoryMockDatabaseStorage(),
11874
11896
  imageStorage: mockOptions.imageStorage ?? new InMemoryMockImageStorage(),
11875
- createId: mockOptions.createId ?? newId,
11897
+ createId: mockOptions.createId ?? ((prefix) => prefix === "asset" ? newAssetId("aws-eu-west-2") : newId(prefix)),
11876
11898
  now: mockOptions.now ?? createMonotonicClock(),
11877
11899
  moderate: mockOptions.moderate ?? defaultModerate
11878
11900
  });
@@ -1,5 +1,5 @@
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";
1
+ import "./CalmLensTypes-DxxyZt2L.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-Dhijt6JU.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> {
@@ -1,5 +1,5 @@
1
- import { a as appendAssetLocation } from "./ModerationContextLimits-Tev2lxE0.js";
2
- import "./Core-B85V5dxv.js";
1
+ import { a as appendAssetLocation } from "./ModerationContextLimits-ZIlK9n2X.js";
2
+ import "./Core-kYMRW5C1.js";
3
3
  // src/ui/viewers/PdfLoader.ts
4
4
  let loading;
5
5
  /**
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-CTO_Eh0l.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-DAbpyM2Z.js";
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-Dhijt6JU.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-BSm_qphN.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-cE1lyljs.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-B85V5dxv.js";
3
- import { a as createProgressFetch, i as withProvidedOptions, n as createUploadController, r as isFileAccepted, t as UploadController } from "./UploadController-D7XmzO-p.js";
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-CgIG3knW.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-kYMRW5C1.js";
3
+ import { a as createProgressFetch, i as withProvidedOptions, n as createUploadController, r as isFileAccepted, t as UploadController } from "./UploadController-D-14HWII.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-OWZsGvBX.js";
2
- import "./index-BDxmVi-G.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-CTO_Eh0l.js";
4
- import { a as UploaderProps, i as UploadSnapshot, n as UploadControllerOptions, r as UploadItem, s as createUploadController, t as CalmLensUpload } from "./BrowserUpload-DJZY1LSU.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-DAbpyM2Z.js";
1
+ import { O as CalmLensAppClientOptions, en as ViewerClaims, g as AssetModerationStatus, i as AssetAvailability } from "./CalmLensTypes-DxxyZt2L.js";
2
+ import "./index-CUA-HDNu.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-Dhijt6JU.js";
4
+ import { a as UploaderProps, i as UploadSnapshot, n as UploadControllerOptions, r as UploadItem, s as createUploadController, t as CalmLensUpload } from "./BrowserUpload-CdOfuIcV.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-BSm_qphN.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-cE1lyljs.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-B85V5dxv.js";
3
- import { a as createProgressFetch, i as withProvidedOptions, n as createUploadController$1, r as isFileAccepted, t as UploadController } from "./UploadController-D7XmzO-p.js";
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-CgIG3knW.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-kYMRW5C1.js";
3
+ import { a as createProgressFetch, i as withProvidedOptions, n as createUploadController$1, r as isFileAccepted, t as UploadController } from "./UploadController-D-14HWII.js";
4
4
  import { c as renderFileIconSvg } from "./FileIcons-M6dzjFxd.js";
5
- import { t as createUploadController } from "./BrowserUpload-CejeWw5r.js";
5
+ import { t as createUploadController } from "./BrowserUpload-BaKFKEBz.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.27.5",
3
+ "version": "0.27.6",
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",