calmlens 0.29.1 → 0.30.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.
Files changed (86) hide show
  1. package/bin/calmlens.js +39 -18
  2. package/cjs/{BrowserUpload-CsxEB1Pr.js → BrowserUpload-BNeTp6eF.js} +1 -1
  3. package/cjs/{BrowserUpload-CeGsM9h1.d.ts → BrowserUpload-DS6KT6o_.d.ts} +2 -2
  4. package/{esm/CalmLensAppClient-D-BD_Ny1.d.ts → cjs/CalmLensAppClient-B4vzxEzg.d.ts} +1 -1
  5. package/cjs/{CalmLensAppClient-BWMcQM9v.js → CalmLensAppClient-ClqGwUbl.js} +7 -6
  6. package/cjs/{CalmLensConnection-DBgV8D1B.js → CalmLensConnection-og0jh-Fw.js} +29 -28
  7. package/cjs/CalmLensError-DPHJaVjX.js +1066 -0
  8. package/cjs/{CalmLensServerClient-BYN_N0lt.d.ts → CalmLensServerClient-BJl2Hsxr.d.ts} +12 -8
  9. package/cjs/{CalmLensServerClient-DYO3geSA.js → CalmLensServerClient-KsXM77rO.js} +37 -35
  10. package/cjs/{TestTriggers-uL2Ec8Vt-cPmmKvYd.js → CalmLensTestInputArguments-BXDBAOg_.js} +50 -22
  11. package/cjs/{CalmLensTypes-C2blKgTu.d.ts → CalmLensTypes-fAgF0_lq.d.ts} +206 -6
  12. package/cjs/{Classification-CMM2tZpJ-IdIh63n0.d.ts → Classification-DbXUPSvH-C0o2t4mg.d.ts} +15 -30
  13. package/cjs/{Core-CNmoxDCW.d.ts → Core-DL531ZPG.d.ts} +2 -2
  14. package/cjs/{Core-Bl-aESvN.js → Core-eDiPpil9.js} +4 -3
  15. package/cjs/{ModerationContextLimits-DHu2jHpo.js → ModerationContextLimits-BVBkcgSU.js} +67 -1126
  16. package/{esm/ReactUpload-kqEe6gcN.d.ts → cjs/ReactUpload-BoS0lr7U.d.ts} +1 -1
  17. package/cjs/{ReactUpload-BFVNyWoI.js → ReactUpload-DAPAzAwY.js} +1 -1
  18. package/{esm/TestTriggers-dognME9k-PWyIfHMI.d.ts → cjs/TestTriggers-CLjF01NU.d.ts} +2 -3
  19. package/cjs/{UploadController-VM1qYwNq.js → UploadController-BElzwMic.js} +6 -6
  20. package/{esm/WebhookPayload-DZWlnvcY.d.ts → cjs/WebhookPayload-DlGoY_db.d.ts} +11 -7
  21. package/cjs/app.d.ts +6 -6
  22. package/cjs/app.js +22 -21
  23. package/cjs/elements.d.ts +4 -4
  24. package/cjs/elements.js +4 -4
  25. package/cjs/{index-Dl2qwS8L.d.ts → index-ChrzzIRt.d.ts} +3 -3
  26. package/cjs/index.d.ts +5 -5
  27. package/cjs/index.js +21 -20
  28. package/cjs/react-native.d.ts +2 -2
  29. package/cjs/react-native.js +4 -4
  30. package/cjs/react.d.ts +4 -4
  31. package/cjs/react.js +5 -5
  32. package/cjs/server.d.ts +12 -12
  33. package/cjs/server.js +23 -22
  34. package/cjs/test-inputs.d.ts +6 -2
  35. package/cjs/test-inputs.js +23 -13
  36. package/cjs/testing.d.ts +14 -10
  37. package/cjs/testing.js +154 -147
  38. package/cjs/{ui-BCiLF8cU.js → ui-COjb2Hx6.js} +2 -2
  39. package/cjs/{ui-BtmJC-f9.d.ts → ui-DpZOLeVs.d.ts} +2 -2
  40. package/cjs/ui.d.ts +2 -2
  41. package/cjs/ui.js +3 -3
  42. package/cjs/vue.d.ts +5 -5
  43. package/cjs/vue.js +4 -4
  44. package/esm/{BrowserUpload-DB3WpaC1.js → BrowserUpload-BCmj5eGu.js} +1 -1
  45. package/esm/{BrowserUpload-CeGsM9h1.d.ts → BrowserUpload-DS6KT6o_.d.ts} +2 -2
  46. package/{cjs/CalmLensAppClient-D-BD_Ny1.d.ts → esm/CalmLensAppClient-B4vzxEzg.d.ts} +1 -1
  47. package/esm/{CalmLensAppClient-Dg-jPs4B.js → CalmLensAppClient-DcPVLn2y.js} +3 -2
  48. package/esm/{CalmLensConnection-Di7K7Wnl.js → CalmLensConnection-Pm-g6a1l.js} +2 -1
  49. package/esm/CalmLensError-BDWThPCr.js +917 -0
  50. package/esm/{CalmLensServerClient-BYN_N0lt.d.ts → CalmLensServerClient-BJl2Hsxr.d.ts} +12 -8
  51. package/esm/{CalmLensServerClient-Pdp7TI8y.js → CalmLensServerClient-C2HGsjkT.js} +18 -16
  52. package/esm/{TestTriggers-uL2Ec8Vt-DYbTEJWm.js → CalmLensTestInputArguments-Xh4GIadS.js} +22 -1
  53. package/esm/{CalmLensTypes-C2blKgTu.d.ts → CalmLensTypes-fAgF0_lq.d.ts} +206 -6
  54. package/esm/{Classification-CMM2tZpJ-IdIh63n0.d.ts → Classification-DbXUPSvH-C0o2t4mg.d.ts} +15 -30
  55. package/esm/{Core-CNmoxDCW.d.ts → Core-DL531ZPG.d.ts} +2 -2
  56. package/esm/{Core-CKk4teFu.js → Core-KYgLJ0eb.js} +3 -2
  57. package/esm/{ModerationContextLimits-xvxUjGfL.js → ModerationContextLimits-DmjWgTBa.js} +3 -918
  58. package/{cjs/ReactUpload-kqEe6gcN.d.ts → esm/ReactUpload-BoS0lr7U.d.ts} +1 -1
  59. package/esm/{ReactUpload-DY5qQ70s.js → ReactUpload-QW_RNxFp.js} +1 -1
  60. package/{cjs/TestTriggers-dognME9k-PWyIfHMI.d.ts → esm/TestTriggers-CLjF01NU.d.ts} +2 -3
  61. package/esm/{UploadController-wyor-5Z2.js → UploadController-Civ7QPwT.js} +2 -2
  62. package/{cjs/WebhookPayload-DZWlnvcY.d.ts → esm/WebhookPayload-DlGoY_db.d.ts} +11 -7
  63. package/esm/app.d.ts +6 -6
  64. package/esm/app.js +3 -2
  65. package/esm/elements.d.ts +4 -4
  66. package/esm/elements.js +4 -4
  67. package/esm/{index-Dl2qwS8L.d.ts → index-ChrzzIRt.d.ts} +3 -3
  68. package/esm/index.d.ts +5 -5
  69. package/esm/index.js +3 -1
  70. package/esm/react-native.d.ts +2 -2
  71. package/esm/react-native.js +4 -4
  72. package/esm/react.d.ts +4 -4
  73. package/esm/react.js +5 -5
  74. package/esm/server.d.ts +12 -12
  75. package/esm/server.js +4 -3
  76. package/esm/test-inputs.d.ts +6 -2
  77. package/esm/test-inputs.js +12 -1
  78. package/esm/testing.d.ts +14 -10
  79. package/esm/testing.js +27 -21
  80. package/esm/{ui-BqF49fSy.js → ui-BVXgDCO2.js} +2 -2
  81. package/esm/{ui-BtmJC-f9.d.ts → ui-DpZOLeVs.d.ts} +2 -2
  82. package/esm/ui.d.ts +2 -2
  83. package/esm/ui.js +3 -3
  84. package/esm/vue.d.ts +5 -5
  85. package/esm/vue.js +4 -4
  86. package/package.json +1 -1
package/esm/testing.js CHANGED
@@ -1,10 +1,11 @@
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-xvxUjGfL.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-Pdp7TI8y.js";
3
- import { _ as validateAssetPayload, g as assetToData, h as assetDataToUint8Array, n as MOCK_HOOKS } from "./CalmLensConnection-Di7K7Wnl.js";
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-BDWThPCr.js";
2
+ import { A as MAX_IMAGE_UPLOAD_BYTES, D as validateServerClientOptions, F as sleep, M as getRejectedUploadMimeTypeError, N as normalizeUploadMimeType, T as validateAppClientOptions, _ as isAcceptedUploadMimeType, b as randomUuid, h as checkTransformOptions, i as ASSET_RESOURCE_PATHS, r as selectModerationContextItems, v as parseTransformSelector } from "./ModerationContextLimits-DmjWgTBa.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-C2HGsjkT.js";
4
+ import { _ as validateAssetPayload, g as assetToData, h as assetDataToUint8Array, n as MOCK_HOOKS } from "./CalmLensConnection-Pm-g6a1l.js";
4
5
  import { t as hmacSha256Hex } from "./CryptoUtils-BLCa-oZe-DKr3LmN6.js";
5
- import { t as CalmLensAppClient } from "./CalmLensAppClient-Dg-jPs4B.js";
6
- import { o as placeholderHashToDataURL, r as isFileAccepted } from "./UploadController-wyor-5Z2.js";
7
- import { d as getTestInputTag, h as CLASSIFICATION_CATEGORIES, m as lazySchema } from "./TestTriggers-uL2Ec8Vt-DYbTEJWm.js";
6
+ import { t as CalmLensAppClient } from "./CalmLensAppClient-DcPVLn2y.js";
7
+ import { o as placeholderHashToDataURL, r as isFileAccepted } from "./UploadController-Civ7QPwT.js";
8
+ import { f as getTestInputTag, g as CLASSIFICATION_CATEGORIES, h as lazySchema, t as withValidTestInputArguments } from "./CalmLensTestInputArguments-Xh4GIadS.js";
8
9
  import * as zod from "zod";
9
10
  // src/contract/MediaTestTriggers.js
10
11
  const MEDIA_TEST_SIGNALS = [...CLASSIFICATION_CATEGORIES, "violence.graphic"];
@@ -27,7 +28,7 @@ const HEX_WORDS = [
27
28
  "foxtrot"
28
29
  ];
29
30
  /** Read this aloud, or render it as large, high-contrast text in a video frame. */
30
- async function generateMediaTestCode(signal, testInputKey) {
31
+ async function generateMediaTestCode$1(signal, testInputKey) {
31
32
  if (!MEDIA_TEST_SIGNALS.includes(signal)) throw new RangeError("Unsupported media test signal");
32
33
  return `Calm Lens test ${[...await getTestInputTag("media", signal, testInputKey)].map((character) => HEX_WORDS[Number.parseInt(character, 16)]).join(" ")} ${signal.replace(/[.-]/g, " ")} end test`;
33
34
  }
@@ -9841,7 +9842,7 @@ var MockCalmLensApi = class {
9841
9842
  this.waitedMs = 0;
9842
9843
  this.publishAssets = (_key, value) => isStoredAsset(value) ? {
9843
9844
  ...value,
9844
- eventSequence: this.eventSequenceOf(value.id)
9845
+ sequence: this.eventSequenceOf(value.id)
9845
9846
  } : value;
9846
9847
  this.policies = /* @__PURE__ */ new Map();
9847
9848
  this.hashLists = /* @__PURE__ */ new Map();
@@ -9911,32 +9912,35 @@ var MockCalmLensApi = class {
9911
9912
  return this.pushEvent(input);
9912
9913
  }
9913
9914
  /** Adds an event to the feed, filling the fields the API always sets. */
9914
- pushEvent(input) {
9915
+ pushEvent({ assetId, ...input }) {
9915
9916
  const now = this.now();
9917
+ const sequence = assetId ? (this.assetEventSequences.get(assetId) ?? 0) + 1 : null;
9918
+ if (assetId && sequence !== null) this.assetEventSequences.set(assetId, sequence);
9916
9919
  const event = {
9917
9920
  id: this.createId("evt"),
9918
9921
  projectId: this.projectId,
9919
9922
  severity: "low",
9920
9923
  title: input.type,
9921
9924
  description: null,
9922
- assetId: null,
9923
9925
  actor: MOCK_API_KEY_ACTOR,
9924
9926
  facts: [],
9925
9927
  createdAt: now,
9926
- ...input
9928
+ ...input,
9929
+ resource: assetId && sequence !== null ? {
9930
+ kind: "asset",
9931
+ id: assetId,
9932
+ sequence
9933
+ } : null
9927
9934
  };
9928
- const sequence = event.assetId ? (this.assetEventSequences.get(event.assetId) ?? 0) + 1 : null;
9929
- if (event.assetId && sequence !== null) this.assetEventSequences.set(event.assetId, sequence);
9930
- event.assetSequence = sequence;
9931
9935
  this.eventFeed.push(event);
9932
9936
  return event;
9933
9937
  }
9934
- /** The `assetSequence` of the latest event about an asset, or 0 before its first. */
9938
+ /** The `resource.sequence` of the latest event about an asset, or 0 before its first. */
9935
9939
  eventSequenceOf(assetId) {
9936
9940
  return this.assetEventSequences.get(assetId) ?? 0;
9937
9941
  }
9938
9942
  /**
9939
- * A copy of a stored asset as the API returns it, with its `eventSequence` as it is now. The
9943
+ * A copy of a stored asset as the API returns it, with its `sequence` as it is now. The
9940
9944
  * mock keeps each asset's sequence itself rather than in `databaseStorage`, whose
9941
9945
  * implementations needn't know about it, so every asset leaving the mock passes through here
9942
9946
  * or `publishAssets`.
@@ -9944,7 +9948,7 @@ var MockCalmLensApi = class {
9944
9948
  toPublished(asset) {
9945
9949
  return {
9946
9950
  ...structuredClone(asset),
9947
- eventSequence: this.eventSequenceOf(asset.id)
9951
+ sequence: this.eventSequenceOf(asset.id)
9948
9952
  };
9949
9953
  }
9950
9954
  /** Applies a reviewer's decision to a stored asset (see `MockCalmLensServerClient.decide`). */
@@ -11061,7 +11065,7 @@ var MockCalmLensApi = class {
11061
11065
  context: contextItems.length ? { items: contextItems } : null,
11062
11066
  tags: fields.tags ?? [],
11063
11067
  visibility: fields.visibility ?? "private",
11064
- eventSequence: 0,
11068
+ sequence: 0,
11065
11069
  content: {
11066
11070
  status: keepContent ? "stored" : "temporary",
11067
11071
  removalReason: null,
@@ -11644,7 +11648,7 @@ var MockCalmLensApi = class {
11644
11648
  const assetId = query.get("assetId");
11645
11649
  if (assetId !== null && !isId(assetId, "asset")) throw invalidField("validation/invalid-format", "assetId");
11646
11650
  const filter = btoa(JSON.stringify([[...new Set(types)].sort(), assetId]));
11647
- const matches = (event) => (!types.length || types.includes(event.type)) && (assetId === null || event.assetId === assetId);
11651
+ const matches = (event) => (!types.length || types.includes(event.type)) && (assetId === null || event.resource?.id === assetId);
11648
11652
  const cursor = query.get("cursor");
11649
11653
  if (!cursor) return {
11650
11654
  items: [],
@@ -12510,8 +12514,7 @@ const toWebhookEventPayload = (event) => ({
12510
12514
  severity: event.severity,
12511
12515
  title: event.title,
12512
12516
  description: event.description ?? null,
12513
- assetId: event.assetId ?? null,
12514
- assetSequence: event.assetSequence ?? null,
12517
+ resource: event.resource ?? null,
12515
12518
  facts: event.facts,
12516
12519
  createdAt: event.createdAt
12517
12520
  });
@@ -12527,4 +12530,7 @@ const createWebhookHeaders = async (options) => {
12527
12530
  [WEBHOOK_SIGNATURE_HEADER]: await createWebhookSignatureHeader(options.secret, timestamp, options.body)
12528
12531
  };
12529
12532
  };
12533
+ // src/testing.ts
12534
+ /** A spoken media test phrase for `signal`, signed with the project's test input key. */
12535
+ const generateMediaTestCode = (signal, key) => withValidTestInputArguments(key, () => generateMediaTestCode$1(signal, key));
12530
12536
  export { InMemoryMockDatabaseStorage, InMemoryMockImageStorage, MEDIA_TEST_SIGNALS, MOCK_API_KEY_ID, MOCK_API_KEY_PREFIX, MockCalmLensAppClient, MockCalmLensServerClient, MockDecision, createMockApiKey, createWebhookHeaders, createWebhookSignatureHeader, generateMediaTestCode, mockDecision, signUploadTokenWithApiKey as signUploadToken, toWebhookEventPayload };
@@ -1,5 +1,5 @@
1
- import { o as appendAssetLocation } from "./ModerationContextLimits-xvxUjGfL.js";
2
- import "./Core-CKk4teFu.js";
1
+ import { o as appendAssetLocation } from "./ModerationContextLimits-DmjWgTBa.js";
2
+ import "./Core-KYgLJ0eb.js";
3
3
  // src/ui/viewers/PdfLoader.ts
4
4
  let loading;
5
5
  /**
@@ -1,5 +1,5 @@
1
- import "./CalmLensTypes-C2blKgTu.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-CNmoxDCW.js";
1
+ import "./CalmLensTypes-fAgF0_lq.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-DL531ZPG.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-CNmoxDCW.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-BtmJC-f9.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-DL531ZPG.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-DpZOLeVs.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-BqF49fSy.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-CKk4teFu.js";
3
- import { a as createProgressFetch, i as withProvidedOptions, n as createUploadController, r as isFileAccepted, t as UploadController } from "./UploadController-wyor-5Z2.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-BVXgDCO2.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-KYgLJ0eb.js";
3
+ import { a as createProgressFetch, i as withProvidedOptions, n as createUploadController, r as isFileAccepted, t as UploadController } from "./UploadController-Civ7QPwT.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-C2blKgTu.js";
2
- import "./index-Dl2qwS8L.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-CNmoxDCW.js";
4
- import { a as UploaderProps, i as UploadSnapshot, n as UploadControllerOptions, r as UploadItem, s as createUploadController, t as CalmLensUpload } from "./BrowserUpload-CeGsM9h1.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-BtmJC-f9.js";
1
+ import { O as CalmLensAppClientOptions, g as AssetModerationStatus, i as AssetAvailability, nn as ViewerClaims } from "./CalmLensTypes-fAgF0_lq.js";
2
+ import "./index-ChrzzIRt.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-DL531ZPG.js";
4
+ import { a as UploaderProps, i as UploadSnapshot, n as UploadControllerOptions, r as UploadItem, s as createUploadController, t as CalmLensUpload } from "./BrowserUpload-DS6KT6o_.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-DpZOLeVs.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-BqF49fSy.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-CKk4teFu.js";
3
- import { a as createProgressFetch, i as withProvidedOptions, n as createUploadController$1, r as isFileAccepted, t as UploadController } from "./UploadController-wyor-5Z2.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-BVXgDCO2.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-KYgLJ0eb.js";
3
+ import { a as createProgressFetch, i as withProvidedOptions, n as createUploadController$1, r as isFileAccepted, t as UploadController } from "./UploadController-Civ7QPwT.js";
4
4
  import { c as renderFileIconSvg } from "./FileIcons-M6dzjFxd.js";
5
- import { t as createUploadController } from "./BrowserUpload-DB3WpaC1.js";
5
+ import { t as createUploadController } from "./BrowserUpload-BCmj5eGu.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.29.1",
3
+ "version": "0.30.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",