calmlens 0.30.0 → 0.31.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/calmlens.js +2 -29
- package/{esm/BrowserUpload-DS6KT6o_.d.ts → cjs/BrowserUpload-BAH54V1q.d.ts} +2 -2
- package/cjs/{BrowserUpload-BNeTp6eF.js → BrowserUpload-BwBE37LM.js} +1 -1
- package/cjs/{CalmLensAppClient-B4vzxEzg.d.ts → CalmLensAppClient-CdlcDd5l.d.ts} +1 -1
- package/cjs/{CalmLensAppClient-ClqGwUbl.js → CalmLensAppClient-D6Y7MgH_.js} +10 -10
- package/cjs/{ModerationContextLimits-BVBkcgSU.js → CalmLensCdn-Q68faCEE.js} +2 -52
- package/cjs/{CalmLensConnection-og0jh-Fw.js → CalmLensConnection-j2aBsuNx.js} +15 -22
- package/cjs/{CalmLensError-DPHJaVjX.js → CalmLensError-ifj5rLmk.js} +5 -0
- package/cjs/{CalmLensServerClient-KsXM77rO.js → CalmLensServerClient-CjK691kq.js} +22 -22
- package/{esm/CalmLensServerClient-BJl2Hsxr.d.ts → cjs/CalmLensServerClient-CtS66dCU.d.ts} +3 -3
- package/cjs/{CalmLensTestInputArguments-BXDBAOg_.js → CalmLensTestInputArguments-PYuRmE0j.js} +1 -1
- package/cjs/{CalmLensTypes-fAgF0_lq.d.ts → CalmLensTypes-87kiUg0H.d.ts} +3 -5
- package/cjs/{Classification-DbXUPSvH-C0o2t4mg.d.ts → Classification-C3pkrGYS-B7EygpJn.d.ts} +2 -21
- package/cjs/{Core-DL531ZPG.d.ts → Core-Ccy4-_sN.d.ts} +2 -2
- package/cjs/{Core-eDiPpil9.js → Core-Dsj4tRNP.js} +8 -8
- package/cjs/{ReactUpload-DAPAzAwY.js → ReactUpload-B7SdNAel.js} +1 -1
- package/cjs/{ReactUpload-BoS0lr7U.d.ts → ReactUpload-DBhppuxM.d.ts} +1 -1
- package/{esm/TestTriggers-CLjF01NU.d.ts → cjs/TestTriggers-Daxebd0V.d.ts} +1 -1
- package/cjs/{UploadController-BElzwMic.js → UploadController-DsIENVY1.js} +2 -2
- package/{esm/WebhookPayload-DlGoY_db.d.ts → cjs/WebhookPayload-B4rA_Dvm.d.ts} +3 -1
- package/cjs/app.d.ts +6 -6
- package/cjs/app.js +8 -11
- package/cjs/elements.d.ts +4 -4
- package/cjs/elements.js +4 -4
- package/cjs/{index-ChrzzIRt.d.ts → index-CWUnLKoF.d.ts} +8 -4
- package/cjs/index.d.ts +5 -5
- package/cjs/index.js +7 -10
- package/cjs/react-native.d.ts +2 -2
- package/cjs/react-native.js +7 -7
- package/cjs/react.d.ts +4 -4
- package/cjs/react.js +5 -5
- package/cjs/server.d.ts +6 -6
- package/cjs/server.js +8 -11
- package/cjs/test-inputs.d.ts +1 -1
- package/cjs/test-inputs.js +1 -1
- package/cjs/testing.d.ts +5 -5
- package/cjs/testing.js +82 -25
- package/cjs/{ui-COjb2Hx6.js → ui-BC70R8KT.js} +3 -3
- package/cjs/{ui-DpZOLeVs.d.ts → ui-sjnJhloQ.d.ts} +2 -2
- package/cjs/ui.d.ts +2 -2
- package/cjs/ui.js +3 -3
- package/cjs/vue.d.ts +5 -5
- package/cjs/vue.js +4 -4
- package/{cjs/BrowserUpload-DS6KT6o_.d.ts → esm/BrowserUpload-BAH54V1q.d.ts} +2 -2
- package/esm/{BrowserUpload-BCmj5eGu.js → BrowserUpload-DSLCpWgz.js} +1 -1
- package/esm/{CalmLensAppClient-DcPVLn2y.js → CalmLensAppClient-BKanqwYL.js} +3 -3
- package/esm/{CalmLensAppClient-B4vzxEzg.d.ts → CalmLensAppClient-CdlcDd5l.d.ts} +1 -1
- package/esm/{ModerationContextLimits-DmjWgTBa.js → CalmLensCdn-CL1P1v2t.js} +3 -35
- package/esm/{CalmLensConnection-Pm-g6a1l.js → CalmLensConnection-CHNNULpg.js} +2 -9
- package/esm/{CalmLensError-BDWThPCr.js → CalmLensError-C15tWu8W.js} +5 -0
- package/esm/{CalmLensServerClient-C2HGsjkT.js → CalmLensServerClient-CBjSqROz.js} +3 -3
- package/{cjs/CalmLensServerClient-BJl2Hsxr.d.ts → esm/CalmLensServerClient-CtS66dCU.d.ts} +3 -3
- package/esm/{CalmLensTestInputArguments-Xh4GIadS.js → CalmLensTestInputArguments-CqPADTkl.js} +1 -1
- package/esm/{CalmLensTypes-fAgF0_lq.d.ts → CalmLensTypes-87kiUg0H.d.ts} +3 -5
- package/esm/{Classification-DbXUPSvH-C0o2t4mg.d.ts → Classification-C3pkrGYS-B7EygpJn.d.ts} +2 -21
- package/esm/{Core-DL531ZPG.d.ts → Core-Ccy4-_sN.d.ts} +2 -2
- package/esm/{Core-KYgLJ0eb.js → Core-WxPuobo_.js} +3 -3
- package/esm/{ReactUpload-BoS0lr7U.d.ts → ReactUpload-DBhppuxM.d.ts} +1 -1
- package/esm/{ReactUpload-QW_RNxFp.js → ReactUpload-U49veoZl.js} +1 -1
- package/{cjs/TestTriggers-CLjF01NU.d.ts → esm/TestTriggers-Daxebd0V.d.ts} +1 -1
- package/esm/{UploadController-Civ7QPwT.js → UploadController-X2gEFMGy.js} +2 -2
- package/{cjs/WebhookPayload-DlGoY_db.d.ts → esm/WebhookPayload-B4rA_Dvm.d.ts} +3 -1
- package/esm/app.d.ts +6 -6
- package/esm/app.js +4 -4
- package/esm/elements.d.ts +4 -4
- package/esm/elements.js +4 -4
- package/esm/{index-ChrzzIRt.d.ts → index-CWUnLKoF.d.ts} +8 -4
- package/esm/index.d.ts +5 -5
- package/esm/index.js +3 -3
- package/esm/react-native.d.ts +2 -2
- package/esm/react-native.js +4 -4
- package/esm/react.d.ts +4 -4
- package/esm/react.js +5 -5
- package/esm/server.d.ts +6 -6
- package/esm/server.js +4 -4
- package/esm/test-inputs.d.ts +1 -1
- package/esm/test-inputs.js +1 -1
- package/esm/testing.d.ts +5 -5
- package/esm/testing.js +67 -10
- package/esm/{ui-BVXgDCO2.js → ui-DS85DGfi.js} +2 -2
- package/esm/{ui-DpZOLeVs.d.ts → ui-sjnJhloQ.d.ts} +2 -2
- package/esm/ui.d.ts +2 -2
- package/esm/ui.js +3 -3
- package/esm/vue.d.ts +5 -5
- package/esm/vue.js +4 -4
- package/package.json +1 -1
package/cjs/testing.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_CalmLensTestInputArguments = require("./CalmLensTestInputArguments-
|
|
3
|
-
const require_CalmLensError = require("./CalmLensError-
|
|
4
|
-
const
|
|
5
|
-
const require_CalmLensServerClient = require("./CalmLensServerClient-
|
|
6
|
-
const require_CalmLensConnection = require("./CalmLensConnection-
|
|
2
|
+
const require_CalmLensTestInputArguments = require("./CalmLensTestInputArguments-PYuRmE0j.js");
|
|
3
|
+
const require_CalmLensError = require("./CalmLensError-ifj5rLmk.js");
|
|
4
|
+
const require_CalmLensCdn = require("./CalmLensCdn-Q68faCEE.js");
|
|
5
|
+
const require_CalmLensServerClient = require("./CalmLensServerClient-CjK691kq.js");
|
|
6
|
+
const require_CalmLensConnection = require("./CalmLensConnection-j2aBsuNx.js");
|
|
7
7
|
const require_CryptoUtils_BLCa_oZe = require("./CryptoUtils-BLCa-oZe-leCkr1ko.js");
|
|
8
|
-
const require_CalmLensAppClient = require("./CalmLensAppClient-
|
|
9
|
-
const require_UploadController = require("./UploadController-
|
|
8
|
+
const require_CalmLensAppClient = require("./CalmLensAppClient-D6Y7MgH_.js");
|
|
9
|
+
const require_UploadController = require("./UploadController-DsIENVY1.js");
|
|
10
10
|
let zod = require("zod");
|
|
11
11
|
let zod$1 = require_CalmLensTestInputArguments.__toESM(zod, 1);
|
|
12
12
|
zod = require_CalmLensTestInputArguments.__toESM(zod);
|
|
@@ -8146,6 +8146,34 @@ const getMockApiKeyGrants = (apiKey) => {
|
|
|
8146
8146
|
* where CalmLens gives your key's own ID.
|
|
8147
8147
|
*/
|
|
8148
8148
|
const MOCK_API_KEY_ID = "key_mock0000000000000000";
|
|
8149
|
+
// src/contract/ModerationContextLimits-ooIiAjJB.js
|
|
8150
|
+
/** The most characters of one earlier post's text CalmLens reads. */
|
|
8151
|
+
const MODERATION_CONTEXT_MAX_ITEM_CHARACTERS = 2e3;
|
|
8152
|
+
/** Unicode code points, as every SDK counts characters. */
|
|
8153
|
+
const countModerationContextCharacters = (text) => {
|
|
8154
|
+
let count = 0;
|
|
8155
|
+
for (const _ of text) count++;
|
|
8156
|
+
return count;
|
|
8157
|
+
};
|
|
8158
|
+
/**
|
|
8159
|
+
* The earlier posts CalmLens uses: the most recent ones, newest first, while at most
|
|
8160
|
+
* `MODERATION_CONTEXT_USED_ITEMS` and `MODERATION_CONTEXT_USED_CHARACTERS` allow, returned oldest
|
|
8161
|
+
* first. `textOf` gives the text each post contributes, read from its asset. The newest post is
|
|
8162
|
+
* always kept.
|
|
8163
|
+
*/
|
|
8164
|
+
const selectModerationContextItems = (items, textOf) => {
|
|
8165
|
+
const selected = [];
|
|
8166
|
+
let characters = 0;
|
|
8167
|
+
for (let index = items.length - 1; index >= 0; index--) {
|
|
8168
|
+
if (selected.length === 5) break;
|
|
8169
|
+
const item = items[index];
|
|
8170
|
+
const length = countModerationContextCharacters(textOf(item));
|
|
8171
|
+
if (selected.length && characters + length > 2e3) break;
|
|
8172
|
+
selected.unshift(item);
|
|
8173
|
+
characters += length;
|
|
8174
|
+
}
|
|
8175
|
+
return selected;
|
|
8176
|
+
};
|
|
8149
8177
|
// src/testing/MockClassification.ts
|
|
8150
8178
|
/** The parent categories, in the API's order. */
|
|
8151
8179
|
const MOCK_CATEGORIES = [
|
|
@@ -9443,7 +9471,7 @@ const SPREADSHEET_MIME_TYPES = [
|
|
|
9443
9471
|
"application/vnd.oasis.opendocument.spreadsheet"
|
|
9444
9472
|
];
|
|
9445
9473
|
/** Whether browsers play an audio or video upload's format as it is, so it is served as stored. */
|
|
9446
|
-
const isBrowserSafeMediaFormat = (format) => BROWSER_SAFE_MEDIA_FORMATS.includes(
|
|
9474
|
+
const isBrowserSafeMediaFormat = (format) => BROWSER_SAFE_MEDIA_FORMATS.includes(require_CalmLensCdn.normalizeUploadMimeType(format ?? ""));
|
|
9447
9475
|
/**
|
|
9448
9476
|
* The rendered file and preview the API reports for an asset with its content held (Asset.ts,
|
|
9449
9477
|
* getAssetRendered and getAssetPreview). Once uploaded, an image renders as itself with a preview
|
|
@@ -9456,7 +9484,7 @@ const isBrowserSafeMediaFormat = (format) => BROWSER_SAFE_MEDIA_FORMATS.includes
|
|
|
9456
9484
|
*/
|
|
9457
9485
|
const mockRendering = (asset, processed) => {
|
|
9458
9486
|
const format = asset.content.format;
|
|
9459
|
-
const mimeType =
|
|
9487
|
+
const mimeType = require_CalmLensCdn.normalizeUploadMimeType(format ?? "");
|
|
9460
9488
|
const browserSafe = isBrowserSafeMediaFormat(format);
|
|
9461
9489
|
const preview = (size) => ({
|
|
9462
9490
|
...size,
|
|
@@ -10000,7 +10028,11 @@ var MockCalmLensApi = class {
|
|
|
10000
10028
|
if (asset.upload.status === "uploading" || asset.classification.status === "processing") throw fail(require_CalmLensError.API_ERROR_CODES.ASSET_PROCESSING);
|
|
10001
10029
|
const status = asset.classification.moderation.decision;
|
|
10002
10030
|
if (decision !== "purged" && decision !== "blocked" && status === null) throw fail(require_CalmLensError.API_ERROR_CODES.ASSET_DECISION_NOT_ALLOWED);
|
|
10003
|
-
if (status === decision)
|
|
10031
|
+
if (status === decision) {
|
|
10032
|
+
if (!asset.classification.moderation.pendingReview) throw fail(require_CalmLensError.API_ERROR_CODES.ASSET_DECISION_UNCHANGED);
|
|
10033
|
+
asset.classification.moderation.pendingReview = null;
|
|
10034
|
+
return this.databaseStorage.updateAsset(asset);
|
|
10035
|
+
}
|
|
10004
10036
|
if (decision !== "purged" && decision !== "blocked" && status === "purged") throw fail(require_CalmLensError.API_ERROR_CODES.ASSET_CONTENT_PURGED);
|
|
10005
10037
|
return this.recordDecision(asset, decision, { note });
|
|
10006
10038
|
}
|
|
@@ -10012,7 +10044,7 @@ var MockCalmLensApi = class {
|
|
|
10012
10044
|
async recordDecision(asset, decision, review) {
|
|
10013
10045
|
const decided = await this.applyOutcome(asset, decision, "requested");
|
|
10014
10046
|
const now = this.now();
|
|
10015
|
-
|
|
10047
|
+
decided.classification.moderation.pendingReview = null;
|
|
10016
10048
|
decided.classification.moderation.manualReviews = [...decided.classification.moderation.manualReviews ?? [], {
|
|
10017
10049
|
id: this.createId("rev"),
|
|
10018
10050
|
decision,
|
|
@@ -10804,7 +10836,7 @@ var MockCalmLensApi = class {
|
|
|
10804
10836
|
if (expiresIn < 1) throw invalidField("validation/too-small", "expiresIn");
|
|
10805
10837
|
if (expiresIn > 86400) throw invalidField("validation/too-big", "expiresIn");
|
|
10806
10838
|
const { resource } = body;
|
|
10807
|
-
if (resource !== void 0 && (typeof resource !== "string" || !Object.hasOwn(
|
|
10839
|
+
if (resource !== void 0 && (typeof resource !== "string" || !Object.hasOwn(require_CalmLensCdn.ASSET_RESOURCE_PATHS, resource))) throw invalidField("validation/invalid-value", "resource");
|
|
10808
10840
|
let asset;
|
|
10809
10841
|
if (externalId !== void 0) {
|
|
10810
10842
|
asset = (await this.databaseStorage.listAssets(this.projectId)).find((candidate) => candidate.externalId === externalId);
|
|
@@ -10817,7 +10849,7 @@ var MockCalmLensApi = class {
|
|
|
10817
10849
|
original: resource === "original",
|
|
10818
10850
|
expiresAt
|
|
10819
10851
|
});
|
|
10820
|
-
const path = resource === void 0 ? "" : `/${
|
|
10852
|
+
const path = resource === void 0 ? "" : `/${require_CalmLensCdn.ASSET_RESOURCE_PATHS[resource]}`;
|
|
10821
10853
|
return {
|
|
10822
10854
|
url: `${this.cdnBaseUrl}/assets/${encodeURIComponent(this.projectId)}/${grant}${path}`,
|
|
10823
10855
|
expiresAt
|
|
@@ -11010,8 +11042,8 @@ var MockCalmLensApi = class {
|
|
|
11010
11042
|
const { part } = fields;
|
|
11011
11043
|
const contentType = fetched ? fetched.type : fields.contentType;
|
|
11012
11044
|
const bytes = fetched?.bytes ?? fields.bytes ?? /* @__PURE__ */ new Uint8Array(0);
|
|
11013
|
-
if (contentType !== void 0 && !
|
|
11014
|
-
message:
|
|
11045
|
+
if (contentType !== void 0 && !require_CalmLensCdn.isAcceptedUploadMimeType(contentType)) throw fail(require_CalmLensError.API_ERROR_CODES.UNSUPPORTED_UPLOAD_TYPE, {
|
|
11046
|
+
message: require_CalmLensCdn.getRejectedUploadMimeTypeError(contentType),
|
|
11015
11047
|
details: {
|
|
11016
11048
|
mimeType: contentType,
|
|
11017
11049
|
source: "calmlens"
|
|
@@ -11048,7 +11080,7 @@ var MockCalmLensApi = class {
|
|
|
11048
11080
|
const keepContent = processingOptions.retainContent === true;
|
|
11049
11081
|
this.processingOptions.set(id, processingOptions);
|
|
11050
11082
|
const hasContent = fields.url === void 0 || fetched !== void 0;
|
|
11051
|
-
const contextItems =
|
|
11083
|
+
const contextItems = await this.selectContext(fields.context?.items ?? []);
|
|
11052
11084
|
const asset = {
|
|
11053
11085
|
id,
|
|
11054
11086
|
projectId: this.projectId,
|
|
@@ -11204,12 +11236,12 @@ var MockCalmLensApi = class {
|
|
|
11204
11236
|
/** Like the API: image uploads in parts total at most 20 MiB, at any size below that. */
|
|
11205
11237
|
multipartImageSizeError(type, sizeInBytes) {
|
|
11206
11238
|
if (type !== "image") return void 0;
|
|
11207
|
-
if (sizeInBytes >
|
|
11239
|
+
if (sizeInBytes > require_CalmLensCdn.MAX_IMAGE_UPLOAD_BYTES) return require_CalmLensError.API_ERROR_CODES.UPLOAD_TOO_LARGE;
|
|
11208
11240
|
}
|
|
11209
11241
|
/** The failure for a size error code, with the limit `upload/too-large` carries. */
|
|
11210
11242
|
sizeFailure(code) {
|
|
11211
11243
|
return fail(code, code === require_CalmLensError.API_ERROR_CODES.UPLOAD_TOO_LARGE ? { details: {
|
|
11212
|
-
limitBytes:
|
|
11244
|
+
limitBytes: require_CalmLensCdn.MAX_IMAGE_UPLOAD_BYTES,
|
|
11213
11245
|
source: "plan"
|
|
11214
11246
|
} } : {});
|
|
11215
11247
|
}
|
|
@@ -11236,6 +11268,31 @@ var MockCalmLensApi = class {
|
|
|
11236
11268
|
};
|
|
11237
11269
|
}
|
|
11238
11270
|
/** An asset's stored content, its parts in order, or `null` once it is removed. */
|
|
11271
|
+
/**
|
|
11272
|
+
* Like the API, a reply's context references the project's own assets, each read for its text:
|
|
11273
|
+
* a text asset's own text or the text found in it. Only the references CalmLens uses are kept.
|
|
11274
|
+
*/
|
|
11275
|
+
async selectContext(items) {
|
|
11276
|
+
items.forEach((item, index) => {
|
|
11277
|
+
if (!isId(item.assetId, "asset")) throw invalidField("validation/invalid-format", `context.items.${index}.assetId`);
|
|
11278
|
+
});
|
|
11279
|
+
const posts = await Promise.all(items.map(async (item) => {
|
|
11280
|
+
const asset = await this.databaseStorage.getAsset(item.assetId);
|
|
11281
|
+
if (!asset || asset.projectId !== this.projectId) throw fail(require_CalmLensError.API_ERROR_CODES.CONTEXT_ASSET_NOT_FOUND, { details: { assetId: item.assetId } });
|
|
11282
|
+
return {
|
|
11283
|
+
item,
|
|
11284
|
+
text: await this.contextText(asset)
|
|
11285
|
+
};
|
|
11286
|
+
}));
|
|
11287
|
+
return selectModerationContextItems(posts, (post) => post.text).map((post) => post.item);
|
|
11288
|
+
}
|
|
11289
|
+
/** An earlier post's text, to the most CalmLens reads of one post; empty once its content is gone. */
|
|
11290
|
+
async contextText(asset) {
|
|
11291
|
+
const extracted = asset.content.extractedText;
|
|
11292
|
+
const bytes = asset.type === "plaintext-document" && await this.storedBytes(asset);
|
|
11293
|
+
const text = (bytes ? new TextDecoder().decode(bytes) : extracted?.type === "string" ? extracted.content : "").trim();
|
|
11294
|
+
return Array.from(text).slice(0, MODERATION_CONTEXT_MAX_ITEM_CHARACTERS).join("");
|
|
11295
|
+
}
|
|
11239
11296
|
async storedBytes(asset) {
|
|
11240
11297
|
if (asset.content.status === "removed") return null;
|
|
11241
11298
|
const stored = await this.imageStorage.getContent(asset.id);
|
|
@@ -12010,7 +12067,7 @@ var MockCalmLensApi = class {
|
|
|
12010
12067
|
const isHls = resource === "hls";
|
|
12011
12068
|
let selector;
|
|
12012
12069
|
try {
|
|
12013
|
-
selector =
|
|
12070
|
+
selector = require_CalmLensCdn.parseTransformSelector(isHls ? "" : selectorPath.join("/"));
|
|
12014
12071
|
} catch {
|
|
12015
12072
|
return invalidTransform();
|
|
12016
12073
|
}
|
|
@@ -12098,7 +12155,7 @@ var MockCalmLensApi = class {
|
|
|
12098
12155
|
const stillImage = resource === "preview" || resource === "rendered" && rendered?.kind === "image";
|
|
12099
12156
|
if (!stillImage && hasSelector) return invalidTransform();
|
|
12100
12157
|
if (selector.options) {
|
|
12101
|
-
const { unknownKeys, invalidKeys } =
|
|
12158
|
+
const { unknownKeys, invalidKeys } = require_CalmLensCdn.checkTransformOptions(selector.options);
|
|
12102
12159
|
if (unknownKeys.length || invalidKeys.length) return this.jsonResponse(400, {
|
|
12103
12160
|
code: "transform-options/invalid",
|
|
12104
12161
|
message: `Invalid transform options: ${[...unknownKeys, ...invalidKeys].join(", ")}`
|
|
@@ -12282,14 +12339,14 @@ const mockClientOptions = (api, endpoints, session) => {
|
|
|
12282
12339
|
const { useTimers } = api;
|
|
12283
12340
|
const fetch = api.createFetch(endpoints, session);
|
|
12284
12341
|
const hooks = {
|
|
12285
|
-
sleep: useTimers ?
|
|
12286
|
-
await
|
|
12342
|
+
sleep: useTimers ? require_CalmLensCdn.sleep : async (ms, signal) => {
|
|
12343
|
+
await require_CalmLensCdn.sleep(0, signal);
|
|
12287
12344
|
api.waitedMs += ms;
|
|
12288
12345
|
},
|
|
12289
12346
|
now: useTimers ? () => Date.now() : () => api.waitedMs,
|
|
12290
12347
|
uploadTokenTime: () => ({
|
|
12291
12348
|
now: api.now(),
|
|
12292
|
-
nonce:
|
|
12349
|
+
nonce: require_CalmLensCdn.randomUuid()
|
|
12293
12350
|
}),
|
|
12294
12351
|
deferUploadChecks: true,
|
|
12295
12352
|
defaultCdnBaseUrl: "mock://calmlens/v1"
|
|
@@ -12321,7 +12378,7 @@ var MockCalmLensServerClient = class extends require_CalmLensServerClient.CalmLe
|
|
|
12321
12378
|
...input,
|
|
12322
12379
|
projectId: input.projectId ?? "project-1"
|
|
12323
12380
|
};
|
|
12324
|
-
|
|
12381
|
+
require_CalmLensCdn.validateServerClientOptions(options);
|
|
12325
12382
|
const { mockOptions = {}, ...clientOptions } = options;
|
|
12326
12383
|
const api = new MockCalmLensApi({
|
|
12327
12384
|
projectId: options.projectId,
|
|
@@ -12467,7 +12524,7 @@ var MockCalmLensServerClient = class extends require_CalmLensServerClient.CalmLe
|
|
|
12467
12524
|
var MockCalmLensAppClient = class extends require_CalmLensAppClient.CalmLensAppClient {
|
|
12468
12525
|
#uploadPresetId;
|
|
12469
12526
|
constructor(options) {
|
|
12470
|
-
|
|
12527
|
+
require_CalmLensCdn.validateAppClientOptions(options);
|
|
12471
12528
|
const { mockOptions = {}, ...clientOptions } = options;
|
|
12472
12529
|
if (mockOptions.preset) checkMockUploadPreset(mockOptions.preset);
|
|
12473
12530
|
const server = mockOptions.server ?? new MockCalmLensServerClient({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const
|
|
2
|
-
require("./Core-
|
|
1
|
+
const require_CalmLensCdn = require("./CalmLensCdn-Q68faCEE.js");
|
|
2
|
+
require("./Core-Dsj4tRNP.js");
|
|
3
3
|
// src/ui/viewers/PdfLoader.ts
|
|
4
4
|
let loading;
|
|
5
5
|
/**
|
|
@@ -112,7 +112,7 @@ var ViewerUrls = class {
|
|
|
112
112
|
/** A resource's URL beneath the asset URL. The placeholder is never age-gated, so it needs no age claim. */
|
|
113
113
|
url(resource, transform) {
|
|
114
114
|
const { viewerClaims } = this.#options;
|
|
115
|
-
return
|
|
115
|
+
return require_CalmLensCdn.appendAssetLocation(this.#src, {
|
|
116
116
|
resource,
|
|
117
117
|
transform,
|
|
118
118
|
viewerClaims: resource === "placeholder" && viewerClaims ? { region: viewerClaims.region } : viewerClaims
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./CalmLensTypes-
|
|
2
|
-
import { K as AssetOptions, Z as AssetView, ct as DocumentViewerOptions, dt as TextViewerOptions, lt as PdfAssetOptions, pt as ViewerOptions, q as AssetSession, ut as SpreadsheetViewerOptions } from "./Core-
|
|
1
|
+
import "./CalmLensTypes-87kiUg0H.js";
|
|
2
|
+
import { K as AssetOptions, Z as AssetView, ct as DocumentViewerOptions, dt as TextViewerOptions, lt as PdfAssetOptions, pt as ViewerOptions, q as AssetSession, ut as SpreadsheetViewerOptions } from "./Core-Ccy4-_sN.js";
|
|
3
3
|
import "pdfjs-dist";
|
|
4
4
|
/** A viewer mounted into an element, which it owns the children of. */
|
|
5
5
|
interface AssetViewer<O extends ViewerOptions = ViewerOptions> {
|
package/cjs/ui.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as MediaPlayback, A as CustomUploadContext, B as isFileAccepted, C as formatMessage, D as resolveMessages, E as getUploadItemOutcome, F as UploadFile, G as AssetImageSource, H as AssetDisplay, I as UploadItem, J as AssetSessionState, K as AssetOptions, L as UploadSnapshot, M as UploadClient, N as UploadController, O as CalmLensProvidedOptions, P as UploadControllerOptions, Q as INSTANT_LOAD_MS, R as UploadStage, S as formatBytes, T as getUploadItemMessage, U as AssetDocumentOptions, V as withProvidedOptions, W as AssetImageOptions, X as AssetVideoOptions, Y as AssetSpreadsheetOptions, Z as AssetView, _ as DEFAULT_MESSAGES, _t as DEFAULT_VIEWER_MESSAGES, a as ProgressFetchOptions, at as isImageReady, b as describeUploadItem, bt as resolveViewerMessages, c as ICON_ATTRIBUTES, ct as DocumentViewerOptions, d as AssetDisplayOptions, dt as TextViewerOptions, et as getAssetAspectRatio, f as AssetEventHandlers, ft as ViewerAsset, g as CalmLensMessages, gt as isSpreadsheetFormat, h as UploaderProps, ht as getAssetViewerKind, i as CALMLENS_STYLES, it as getPlayedPercent, j as CustomUploadResult, k as CalmLensUpload, l as IconName, lt as PdfAssetOptions, m as UploaderDisplayOptions, mt as ViewerTextOptions, n as CalmLensTheme, nt as getAssetViewKey, o as createProgressFetch, ot as pickAssetSource, p as AssetProps, pt as ViewerOptions, q as AssetSession, r as resolveTheme, rt as getPeakHeights, s as ICONS, st as AssetViewerKind, t as CALMLENS_THEME, tt as getAssetView, u as ASSET_FILE_ICON_SIZE, ut as SpreadsheetViewerOptions, v as UploadItemView, vt as ViewerMessages, w as getDropzoneHint, x as describeUploader, y as UploaderView, yt as formatViewerMessage, z as createUploadController } from "./Core-
|
|
2
|
-
import { _ as spreadsheetColumnIndex, a as isMountedViewerKind, b as AssetViewer, c as AssetViewerOptionsByKind, d as createTextViewer, f as SpreadsheetCell, g as parseSpreadsheetText, h as getSpreadsheetPage, i as getMountedViewerOptions, l as VIEWER_STYLES, m as SpreadsheetSheet, n as AssetViewerMount, o as ASSET_VIEWERS, p as SpreadsheetRow, r as MountedViewerKind, s as AssetViewerName, t as MediaStreamPlayer, u as createSpreadsheetViewer, v as loadPdfJs, x as ViewerState, y as createDocumentViewer } from "./ui-
|
|
1
|
+
import { $ as MediaPlayback, A as CustomUploadContext, B as isFileAccepted, C as formatMessage, D as resolveMessages, E as getUploadItemOutcome, F as UploadFile, G as AssetImageSource, H as AssetDisplay, I as UploadItem, J as AssetSessionState, K as AssetOptions, L as UploadSnapshot, M as UploadClient, N as UploadController, O as CalmLensProvidedOptions, P as UploadControllerOptions, Q as INSTANT_LOAD_MS, R as UploadStage, S as formatBytes, T as getUploadItemMessage, U as AssetDocumentOptions, V as withProvidedOptions, W as AssetImageOptions, X as AssetVideoOptions, Y as AssetSpreadsheetOptions, Z as AssetView, _ as DEFAULT_MESSAGES, _t as DEFAULT_VIEWER_MESSAGES, a as ProgressFetchOptions, at as isImageReady, b as describeUploadItem, bt as resolveViewerMessages, c as ICON_ATTRIBUTES, ct as DocumentViewerOptions, d as AssetDisplayOptions, dt as TextViewerOptions, et as getAssetAspectRatio, f as AssetEventHandlers, ft as ViewerAsset, g as CalmLensMessages, gt as isSpreadsheetFormat, h as UploaderProps, ht as getAssetViewerKind, i as CALMLENS_STYLES, it as getPlayedPercent, j as CustomUploadResult, k as CalmLensUpload, l as IconName, lt as PdfAssetOptions, m as UploaderDisplayOptions, mt as ViewerTextOptions, n as CalmLensTheme, nt as getAssetViewKey, o as createProgressFetch, ot as pickAssetSource, p as AssetProps, pt as ViewerOptions, q as AssetSession, r as resolveTheme, rt as getPeakHeights, s as ICONS, st as AssetViewerKind, t as CALMLENS_THEME, tt as getAssetView, u as ASSET_FILE_ICON_SIZE, ut as SpreadsheetViewerOptions, v as UploadItemView, vt as ViewerMessages, w as getDropzoneHint, x as describeUploader, y as UploaderView, yt as formatViewerMessage, z as createUploadController } from "./Core-Ccy4-_sN.js";
|
|
2
|
+
import { _ as spreadsheetColumnIndex, a as isMountedViewerKind, b as AssetViewer, c as AssetViewerOptionsByKind, d as createTextViewer, f as SpreadsheetCell, g as parseSpreadsheetText, h as getSpreadsheetPage, i as getMountedViewerOptions, l as VIEWER_STYLES, m as SpreadsheetSheet, n as AssetViewerMount, o as ASSET_VIEWERS, p as SpreadsheetRow, r as MountedViewerKind, s as AssetViewerName, t as MediaStreamPlayer, u as createSpreadsheetViewer, v as loadPdfJs, x as ViewerState, y as createDocumentViewer } from "./ui-sjnJhloQ.js";
|
|
3
3
|
export { ASSET_FILE_ICON_SIZE, ASSET_VIEWERS, type AssetDisplay, type AssetDisplayOptions, type AssetDocumentOptions, type AssetEventHandlers, type AssetImageOptions, type AssetImageSource, type AssetOptions, type AssetProps, AssetSession, type AssetSessionState, type AssetSpreadsheetOptions, type AssetVideoOptions, type AssetView, type AssetViewer, type AssetViewerKind, AssetViewerMount, AssetViewerName, AssetViewerOptionsByKind, CALMLENS_STYLES, CALMLENS_THEME, type CalmLensMessages, type CalmLensProvidedOptions, type CalmLensTheme, type CalmLensUpload, type CustomUploadContext, type CustomUploadResult, DEFAULT_MESSAGES, DEFAULT_VIEWER_MESSAGES, type DocumentViewerOptions, ICONS, ICON_ATTRIBUTES, INSTANT_LOAD_MS, type IconName, type MediaPlayback, MediaStreamPlayer, type MountedViewerKind, type PdfAssetOptions, type ProgressFetchOptions, type SpreadsheetCell, type SpreadsheetRow, type SpreadsheetSheet, type SpreadsheetViewerOptions, type TextViewerOptions, type UploadClient, UploadController, type UploadControllerOptions, type UploadFile, type UploadItem, type UploadItemView, type UploadSnapshot, type UploadStage, type UploaderDisplayOptions, type UploaderProps, type UploaderView, VIEWER_STYLES, type ViewerAsset, type ViewerMessages, type ViewerOptions, type ViewerState, type ViewerTextOptions, createDocumentViewer, createProgressFetch, createSpreadsheetViewer, createTextViewer, createUploadController, describeUploadItem, describeUploader, formatBytes, formatMessage, formatViewerMessage, getAssetAspectRatio, getAssetView, getAssetViewKey, getAssetViewerKind, getDropzoneHint, getMountedViewerOptions, getPeakHeights, getPlayedPercent, getSpreadsheetPage, getUploadItemMessage, getUploadItemOutcome, isFileAccepted, isImageReady, isMountedViewerKind, isSpreadsheetFormat, loadPdfJs, parseSpreadsheetText, pickAssetSource, resolveMessages, resolveTheme, resolveViewerMessages, spreadsheetColumnIndex, withProvidedOptions };
|
package/cjs/ui.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_ui = require("./ui-
|
|
3
|
-
const require_Core = require("./Core-
|
|
4
|
-
const require_UploadController = require("./UploadController-
|
|
2
|
+
const require_ui = require("./ui-BC70R8KT.js");
|
|
3
|
+
const require_Core = require("./Core-Dsj4tRNP.js");
|
|
4
|
+
const require_UploadController = require("./UploadController-DsIENVY1.js");
|
|
5
5
|
exports.ASSET_FILE_ICON_SIZE = require_Core.ASSET_FILE_ICON_SIZE;
|
|
6
6
|
exports.ASSET_VIEWERS = require_ui.ASSET_VIEWERS;
|
|
7
7
|
exports.AssetSession = require_Core.AssetSession;
|
package/cjs/vue.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { O as CalmLensAppClientOptions, g as AssetModerationStatus, i as AssetAvailability, nn as ViewerClaims } from "./CalmLensTypes-
|
|
2
|
-
import "./index-
|
|
3
|
-
import { $ as MediaPlayback, A as CustomUploadContext, B as isFileAccepted, C as formatMessage, D as resolveMessages, E as getUploadItemOutcome, F as UploadFile, G as AssetImageSource, H as AssetDisplay, J as AssetSessionState, K as AssetOptions, M as UploadClient, N as UploadController, O as CalmLensProvidedOptions, Q as INSTANT_LOAD_MS, R as UploadStage, S as formatBytes, T as getUploadItemMessage, U as AssetDocumentOptions, V as withProvidedOptions, W as AssetImageOptions, X as AssetVideoOptions, Y as AssetSpreadsheetOptions, Z as AssetView, _ as DEFAULT_MESSAGES, _t as DEFAULT_VIEWER_MESSAGES, a as ProgressFetchOptions, at as isImageReady, b as describeUploadItem, bt as resolveViewerMessages, c as ICON_ATTRIBUTES, ct as DocumentViewerOptions, d as AssetDisplayOptions, dt as TextViewerOptions, et as getAssetAspectRatio, f as AssetEventHandlers, ft as ViewerAsset, g as CalmLensMessages, gt as isSpreadsheetFormat, ht as getAssetViewerKind, i as CALMLENS_STYLES, it as getPlayedPercent, j as CustomUploadResult, l as IconName, lt as PdfAssetOptions, m as UploaderDisplayOptions, mt as ViewerTextOptions, n as CalmLensTheme, nt as getAssetViewKey, o as createProgressFetch, ot as pickAssetSource, p as AssetProps, pt as ViewerOptions, q as AssetSession, r as resolveTheme, rt as getPeakHeights, s as ICONS, st as AssetViewerKind, t as CALMLENS_THEME, tt as getAssetView, u as ASSET_FILE_ICON_SIZE, ut as SpreadsheetViewerOptions, v as UploadItemView, vt as ViewerMessages, w as getDropzoneHint, x as describeUploader, y as UploaderView, yt as formatViewerMessage } from "./Core-
|
|
4
|
-
import { a as UploaderProps, i as UploadSnapshot, n as UploadControllerOptions, r as UploadItem, s as createUploadController, t as CalmLensUpload } from "./BrowserUpload-
|
|
5
|
-
import { _ as spreadsheetColumnIndex, a as isMountedViewerKind, b as AssetViewer, c as AssetViewerOptionsByKind, d as createTextViewer, f as SpreadsheetCell, g as parseSpreadsheetText, h as getSpreadsheetPage, i as getMountedViewerOptions, l as VIEWER_STYLES, m as SpreadsheetSheet, n as AssetViewerMount, o as ASSET_VIEWERS, p as SpreadsheetRow, r as MountedViewerKind, s as AssetViewerName, t as MediaStreamPlayer, u as createSpreadsheetViewer, v as loadPdfJs, x as ViewerState, y as createDocumentViewer } from "./ui-
|
|
1
|
+
import { O as CalmLensAppClientOptions, g as AssetModerationStatus, i as AssetAvailability, nn as ViewerClaims } from "./CalmLensTypes-87kiUg0H.js";
|
|
2
|
+
import "./index-CWUnLKoF.js";
|
|
3
|
+
import { $ as MediaPlayback, A as CustomUploadContext, B as isFileAccepted, C as formatMessage, D as resolveMessages, E as getUploadItemOutcome, F as UploadFile, G as AssetImageSource, H as AssetDisplay, J as AssetSessionState, K as AssetOptions, M as UploadClient, N as UploadController, O as CalmLensProvidedOptions, Q as INSTANT_LOAD_MS, R as UploadStage, S as formatBytes, T as getUploadItemMessage, U as AssetDocumentOptions, V as withProvidedOptions, W as AssetImageOptions, X as AssetVideoOptions, Y as AssetSpreadsheetOptions, Z as AssetView, _ as DEFAULT_MESSAGES, _t as DEFAULT_VIEWER_MESSAGES, a as ProgressFetchOptions, at as isImageReady, b as describeUploadItem, bt as resolveViewerMessages, c as ICON_ATTRIBUTES, ct as DocumentViewerOptions, d as AssetDisplayOptions, dt as TextViewerOptions, et as getAssetAspectRatio, f as AssetEventHandlers, ft as ViewerAsset, g as CalmLensMessages, gt as isSpreadsheetFormat, ht as getAssetViewerKind, i as CALMLENS_STYLES, it as getPlayedPercent, j as CustomUploadResult, l as IconName, lt as PdfAssetOptions, m as UploaderDisplayOptions, mt as ViewerTextOptions, n as CalmLensTheme, nt as getAssetViewKey, o as createProgressFetch, ot as pickAssetSource, p as AssetProps, pt as ViewerOptions, q as AssetSession, r as resolveTheme, rt as getPeakHeights, s as ICONS, st as AssetViewerKind, t as CALMLENS_THEME, tt as getAssetView, u as ASSET_FILE_ICON_SIZE, ut as SpreadsheetViewerOptions, v as UploadItemView, vt as ViewerMessages, w as getDropzoneHint, x as describeUploader, y as UploaderView, yt as formatViewerMessage } from "./Core-Ccy4-_sN.js";
|
|
4
|
+
import { a as UploaderProps, i as UploadSnapshot, n as UploadControllerOptions, r as UploadItem, s as createUploadController, t as CalmLensUpload } from "./BrowserUpload-BAH54V1q.js";
|
|
5
|
+
import { _ as spreadsheetColumnIndex, a as isMountedViewerKind, b as AssetViewer, c as AssetViewerOptionsByKind, d as createTextViewer, f as SpreadsheetCell, g as parseSpreadsheetText, h as getSpreadsheetPage, i as getMountedViewerOptions, l as VIEWER_STYLES, m as SpreadsheetSheet, n as AssetViewerMount, o as ASSET_VIEWERS, p as SpreadsheetRow, r as MountedViewerKind, s as AssetViewerName, t as MediaStreamPlayer, u as createSpreadsheetViewer, v as loadPdfJs, x as ViewerState, y as createDocumentViewer } from "./ui-sjnJhloQ.js";
|
|
6
6
|
import { App, MaybeRefOrGetter, PropType, ShallowRef } from "vue";
|
|
7
7
|
/** Shows a text asset's text, escaped, in a scrolling region. */
|
|
8
8
|
export declare const CalmLensTextViewer: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
package/cjs/vue.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_ui = require("./ui-
|
|
3
|
-
const require_Core = require("./Core-
|
|
4
|
-
const require_UploadController = require("./UploadController-
|
|
2
|
+
const require_ui = require("./ui-BC70R8KT.js");
|
|
3
|
+
const require_Core = require("./Core-Dsj4tRNP.js");
|
|
4
|
+
const require_UploadController = require("./UploadController-DsIENVY1.js");
|
|
5
5
|
const require_FileIcons = require("./FileIcons-Ob003MdS.js");
|
|
6
|
-
const require_BrowserUpload = require("./BrowserUpload-
|
|
6
|
+
const require_BrowserUpload = require("./BrowserUpload-BwBE37LM.js");
|
|
7
7
|
let vue = require("vue");
|
|
8
8
|
// src/viewers/Vue.ts
|
|
9
9
|
const optional$1 = (type) => ({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as UploadFile, I as UploadItem$1, L as UploadSnapshot$1, N as UploadController, P as UploadControllerOptions$1, h as UploaderProps$1, k as CalmLensUpload$1 } from "./Core-
|
|
2
|
-
import { r as UseCalmLensUploadResult$1 } from "./ReactUpload-
|
|
1
|
+
import { F as UploadFile, I as UploadItem$1, L as UploadSnapshot$1, N as UploadController, P as UploadControllerOptions$1, h as UploaderProps$1, k as CalmLensUpload$1 } from "./Core-Ccy4-_sN.js";
|
|
2
|
+
import { r as UseCalmLensUploadResult$1 } from "./ReactUpload-DBhppuxM.js";
|
|
3
3
|
type UploadItem<F extends UploadFile = File> = UploadItem$1<F>;
|
|
4
4
|
type CalmLensUpload<F extends UploadFile = File> = CalmLensUpload$1<F>;
|
|
5
5
|
type UploadSnapshot<F extends UploadFile = File> = UploadSnapshot$1<F>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as createUploadController$1 } from "./UploadController-
|
|
1
|
+
import { n as createUploadController$1 } from "./UploadController-X2gEFMGy.js";
|
|
2
2
|
// src/ui/BrowserUpload.ts
|
|
3
3
|
/** Creates an upload queue for the browser components, such as one a form starts on submit. */
|
|
4
4
|
const createUploadController = (options) => createUploadController$1(options);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as invalidConfig, S as invalidArgument } from "./CalmLensError-
|
|
2
|
-
import {
|
|
3
|
-
import { c as prepareSubmitAssetOptions, f as APP_OPTION_KEYS, i as expectUploadedAsset, l as resolveConnectionOptions, t as CalmLensConnection, u as splitsIntoParts } from "./CalmLensConnection-
|
|
1
|
+
import { C as invalidConfig, S as invalidArgument } from "./CalmLensError-C15tWu8W.js";
|
|
2
|
+
import { S as validateAppClientOptions, d as checkOptionKeys, o as buildAssetUrl, p as encodePathSegment, u as DEFAULT_CDN_BASE_URL } from "./CalmLensCdn-CL1P1v2t.js";
|
|
3
|
+
import { c as prepareSubmitAssetOptions, f as APP_OPTION_KEYS, i as expectUploadedAsset, l as resolveConnectionOptions, t as CalmLensConnection, u as splitsIntoParts } from "./CalmLensConnection-CHNNULpg.js";
|
|
4
4
|
// src/client/CalmLensAppClient.ts
|
|
5
5
|
const inspectSymbol = Symbol.for("nodejs.util.inspect.custom");
|
|
6
6
|
/** `options`, once `checkOptionKeys` finds only keys `operation` takes. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $t as UploadPresetSubmitAssetOptions, M as CdnAssetUrlOptions, Mt as RetrieveAssetOptions, O as CalmLensAppClientOptions, Yt as UploadAssetPartOptions, en as UploadedAsset, kt as RequestOptions } from "./CalmLensTypes-
|
|
1
|
+
import { $t as UploadPresetSubmitAssetOptions, M as CdnAssetUrlOptions, Mt as RetrieveAssetOptions, O as CalmLensAppClientOptions, Yt as UploadAssetPartOptions, en as UploadedAsset, kt as RequestOptions } from "./CalmLensTypes-87kiUg0H.js";
|
|
2
2
|
declare const inspectSymbol: unique symbol;
|
|
3
3
|
/**
|
|
4
4
|
* The CalmLens client for browsers and React Native apps. It uploads through an upload preset,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as invalidConfig, S as invalidArgument, b as MAX_ERROR_BODY_LENGTH, l as CalmLensError, x as SDK_ERROR_CODES } from "./CalmLensError-
|
|
1
|
+
import { C as invalidConfig, S as invalidArgument, b as MAX_ERROR_BODY_LENGTH, l as CalmLensError, x as SDK_ERROR_CODES } from "./CalmLensError-C15tWu8W.js";
|
|
2
2
|
// src/client/CalmLensLogging.ts
|
|
3
3
|
const LOG_LEVELS = [
|
|
4
4
|
"off",
|
|
@@ -152,7 +152,7 @@ const listPages = (fetchPage, { cursor, feed = false } = {}) => {
|
|
|
152
152
|
};
|
|
153
153
|
// src/client/CalmLensVersion.ts
|
|
154
154
|
/** This SDK's version, from its package.json. */
|
|
155
|
-
const SDK_VERSION = "0.
|
|
155
|
+
const SDK_VERSION = "0.31.1";
|
|
156
156
|
const runtimeName = () => {
|
|
157
157
|
const runtime = globalThis;
|
|
158
158
|
if (isReactNativeRuntime()) return "react-native";
|
|
@@ -1483,36 +1483,4 @@ const getAssetInfo = async (url, options = {}) => {
|
|
|
1483
1483
|
});
|
|
1484
1484
|
return data;
|
|
1485
1485
|
};
|
|
1486
|
-
|
|
1487
|
-
/** The most recent earlier posts CalmLens uses. */
|
|
1488
|
-
const MODERATION_CONTEXT_USED_ITEMS = 5;
|
|
1489
|
-
/**
|
|
1490
|
-
* The most characters of earlier posts CalmLens uses. The newest post always fits, since no post
|
|
1491
|
-
* may be longer.
|
|
1492
|
-
*/
|
|
1493
|
-
const MODERATION_CONTEXT_USED_CHARACTERS = 2e3;
|
|
1494
|
-
/** Unicode code points, as every SDK counts characters. */
|
|
1495
|
-
const countModerationContextCharacters = (text) => {
|
|
1496
|
-
let count = 0;
|
|
1497
|
-
for (const _ of text) count++;
|
|
1498
|
-
return count;
|
|
1499
|
-
};
|
|
1500
|
-
/**
|
|
1501
|
-
* The earlier posts CalmLens uses: the most recent ones, newest first, while at most
|
|
1502
|
-
* `MODERATION_CONTEXT_USED_ITEMS` and `MODERATION_CONTEXT_USED_CHARACTERS` allow, returned oldest
|
|
1503
|
-
* first. The newest post is always kept, so an over-long one is left for validation to reject.
|
|
1504
|
-
*/
|
|
1505
|
-
const selectModerationContextItems = (items) => {
|
|
1506
|
-
const selected = [];
|
|
1507
|
-
let characters = 0;
|
|
1508
|
-
for (let index = items.length - 1; index >= 0; index--) {
|
|
1509
|
-
if (selected.length === 5) break;
|
|
1510
|
-
const item = items[index];
|
|
1511
|
-
const length = countModerationContextCharacters(item.text);
|
|
1512
|
-
if (selected.length && characters + length > 2e3) break;
|
|
1513
|
-
selected.unshift(item);
|
|
1514
|
-
characters += length;
|
|
1515
|
-
}
|
|
1516
|
-
return selected;
|
|
1517
|
-
};
|
|
1518
|
-
export { MAX_IMAGE_UPLOAD_BYTES as A, copyLastResponse as B, toTextAssetOptions as C, validateServerClientOptions as D, validateBatchAssetsOptions as E, sleep as F, readEnv as H, SDK_VERSION as I, isBrowserRuntime as L, getRejectedUploadMimeTypeError as M, normalizeUploadMimeType as N, DOMAIN as O, CalmLensTransport as P, isReactNativeRuntime as R, stringifyQuery as S, validateAppClientOptions as T, resolveLogLevel as U, listPages as V, isAcceptedUploadMimeType as _, CDN_RESOURCES as a, randomUuid as b, assetUrlOf as c, toUrlViewerClaims as d, validateSignAssetUrlOptions as f, encodePathSegment as g, checkTransformOptions as h, ASSET_RESOURCE_PATHS as i, MAX_NON_IMAGE_UPLOAD_BYTES as j, MAX_DIRECT_IMAGE_UPLOAD_BYTES as k, buildAssetUrl as l, checkOptionKeys as m, MODERATION_CONTEXT_USED_ITEMS as n, appendAssetLocation as o, DEFAULT_CDN_BASE_URL as p, selectModerationContextItems as r, appendSignedLocation as s, MODERATION_CONTEXT_USED_CHARACTERS as t, getAssetInfo as u, parseTransformSelector as v, transformSelector as w, serializeTransform as x, pollForDecision as y, AUTO_PAGING_TO_ARRAY_MAX as z };
|
|
1486
|
+
export { normalizeUploadMimeType as A, resolveLogLevel as B, validateBatchAssetsOptions as C, MAX_IMAGE_UPLOAD_BYTES as D, MAX_DIRECT_IMAGE_UPLOAD_BYTES as E, isReactNativeRuntime as F, AUTO_PAGING_TO_ARRAY_MAX as I, copyLastResponse as L, sleep as M, SDK_VERSION as N, MAX_NON_IMAGE_UPLOAD_BYTES as O, isBrowserRuntime as P, listPages as R, validateAppClientOptions as S, DOMAIN as T, randomUuid as _, assetUrlOf as a, toTextAssetOptions as b, toUrlViewerClaims as c, checkOptionKeys as d, checkTransformOptions as f, pollForDecision as g, parseTransformSelector as h, appendSignedLocation as i, CalmLensTransport as j, getRejectedUploadMimeTypeError as k, validateSignAssetUrlOptions as l, isAcceptedUploadMimeType as m, CDN_RESOURCES as n, buildAssetUrl as o, encodePathSegment as p, appendAssetLocation as r, getAssetInfo as s, ASSET_RESOURCE_PATHS as t, DEFAULT_CDN_BASE_URL as u, serializeTransform as v, validateServerClientOptions as w, transformSelector as x, stringifyQuery as y, readEnv as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as invalidArgument, l as CalmLensError, w as API_ERROR_CODES, x as SDK_ERROR_CODES } from "./CalmLensError-
|
|
2
|
-
import {
|
|
1
|
+
import { S as invalidArgument, l as CalmLensError, w as API_ERROR_CODES, x as SDK_ERROR_CODES } from "./CalmLensError-C15tWu8W.js";
|
|
2
|
+
import { B as resolveLogLevel, D as MAX_IMAGE_UPLOAD_BYTES, E as MAX_DIRECT_IMAGE_UPLOAD_BYTES, M as sleep, O as MAX_NON_IMAGE_UPLOAD_BYTES, _ as randomUuid, j as CalmLensTransport, k as getRejectedUploadMimeTypeError, m as isAcceptedUploadMimeType, y as stringifyQuery } from "./CalmLensCdn-CL1P1v2t.js";
|
|
3
3
|
// src/contract/AssetPayload.js
|
|
4
4
|
const bufferInputToBytes = (value) => {
|
|
5
5
|
if (value instanceof ArrayBuffer) return new Uint8Array(value);
|
|
@@ -681,13 +681,6 @@ const prepareSubmitAssetOptions = (input, { deferUploadChecks = false, partSizeB
|
|
|
681
681
|
});
|
|
682
682
|
if (!validation.ok) throw invalidPayload(validation.error);
|
|
683
683
|
}
|
|
684
|
-
if (options.context !== void 0) {
|
|
685
|
-
if (!options.context || !Array.isArray(options.context.items)) throw invalidArgument("context.items must be an array of earlier posts");
|
|
686
|
-
return {
|
|
687
|
-
...options,
|
|
688
|
-
context: { items: selectModerationContextItems(options.context.items) }
|
|
689
|
-
};
|
|
690
|
-
}
|
|
691
684
|
return options;
|
|
692
685
|
};
|
|
693
686
|
const newIdempotencyKey = () => randomUuid();
|
|
@@ -115,6 +115,7 @@ const API_ERROR_CODES = {
|
|
|
115
115
|
REMOTE_URL_UNAVAILABLE: "remote-url/unavailable",
|
|
116
116
|
APPEAL_NOT_FOUND: "appeal/not-found",
|
|
117
117
|
APPEAL_JUDGMENT_NOT_FOUND: "appeal/judgment-not-found",
|
|
118
|
+
CONTEXT_ASSET_NOT_FOUND: "context/asset-not-found",
|
|
118
119
|
APPEAL_ASSET_NOT_FOUND: "appeal/asset-not-found",
|
|
119
120
|
APPEAL_PERMISSION_DENIED: "appeal/permission-denied",
|
|
120
121
|
APPEAL_ALREADY_REVIEWED: "appeal/already-reviewed",
|
|
@@ -580,6 +581,10 @@ const API_ERROR_DEFINITIONS = {
|
|
|
580
581
|
status: 404,
|
|
581
582
|
message: "The judgment event is unavailable, belongs to another project or cannot supply an asset decision. Supply explicit context instead."
|
|
582
583
|
},
|
|
584
|
+
"context/asset-not-found": {
|
|
585
|
+
status: 400,
|
|
586
|
+
message: "A context item names an asset this project doesn't have. Reference an earlier post uploaded to the same project."
|
|
587
|
+
},
|
|
583
588
|
"appeal/asset-not-found": {
|
|
584
589
|
status: 404,
|
|
585
590
|
message: "The linked asset does not exist in this project."
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as invalidConfig, S as invalidArgument, l as CalmLensError, x as SDK_ERROR_CODES } from "./CalmLensError-
|
|
2
|
-
import {
|
|
3
|
-
import { a as getMockHooks, c as prepareSubmitAssetOptions, d as validateCallOptions, l as resolveConnectionOptions, m as SERVER_OPTION_KEYS, o as invalidPayload, p as NULLABLE_OPTION_KEYS, r as expectAsset, s as newIdempotencyKey, t as CalmLensConnection, u as splitsIntoParts } from "./CalmLensConnection-
|
|
1
|
+
import { C as invalidConfig, S as invalidArgument, l as CalmLensError, x as SDK_ERROR_CODES } from "./CalmLensError-C15tWu8W.js";
|
|
2
|
+
import { C as validateBatchAssetsOptions, F as isReactNativeRuntime, L as copyLastResponse, P as isBrowserRuntime, R as listPages, b as toTextAssetOptions, d as checkOptionKeys, g as pollForDecision, i as appendSignedLocation, l as validateSignAssetUrlOptions, o as buildAssetUrl, p as encodePathSegment, s as getAssetInfo, u as DEFAULT_CDN_BASE_URL, w as validateServerClientOptions, y as stringifyQuery, z as readEnv } from "./CalmLensCdn-CL1P1v2t.js";
|
|
3
|
+
import { a as getMockHooks, c as prepareSubmitAssetOptions, d as validateCallOptions, l as resolveConnectionOptions, m as SERVER_OPTION_KEYS, o as invalidPayload, p as NULLABLE_OPTION_KEYS, r as expectAsset, s as newIdempotencyKey, t as CalmLensConnection, u as splitsIntoParts } from "./CalmLensConnection-CHNNULpg.js";
|
|
4
4
|
import { n as sha256Hex, r as timingSafeEqual, t as hmacSha256Hex } from "./CryptoUtils-BLCa-oZe-DKr3LmN6.js";
|
|
5
5
|
// src/contract/JsonUtils.js
|
|
6
6
|
const stringifyJsonCanonical = (value) => JSON.stringify(value, (_key, nestedValue) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { c as HashList, l as HashListEntry } from "./Classification-
|
|
2
|
-
import { $ as FolderPage, At as ResetPolicyOptions, B as CreateHashListOptions, Bn as AssetInfo, Cn as ProjectSettingsResource, D as BatchAssetsResponse, Dt as RequestAssetReviewOptions, E as BatchAssetsOptions, Et as RemoveAssetContentOptions, Ft as SetPolicyAutomaticUpdatesOptions, G as DeleteAssetOptions, Gt as UpdateLensOptions, Ht as UpdateAssetOptions, I as ClassifyTextOptions, It as SignAssetUrlOptions, J as EnsureLensesOptions, Jt as UpgradePolicyOptions, K as DeleteMetadataFieldOptions, Kt as UpdatePolicyOptions, Lt as SignUploadTokenOptions, M as CdnAssetUrlOptions, Mt as RetrieveAssetOptions, Nt as RetryAssetOptions, P as CdnServeOptions, Pn as Policy, Q as FolderIdOptions, Qt as UploadPresetPage, Rn as AssetSearchQuery, Rt as SignedAssetUrl, Sn as MetadataFieldsResource, T as AssignPolicyOptions, Tt as PolicyPage, U as CreatePolicyOptions, Ut as UpdateFolderOptions, V as CreateLensOptions, Vt as SubmitAssetOptions, W as DecideAssetOptions, Wt as UpdateHashListOptions, X as EnsureUploadPresetsOptions, Y as EnsureMetadataFieldsOptions, Yt as UploadAssetPartOptions, Z as EnsureUploadPresetsResponse, Zt as UploadPresetIdOptions, _ as AssetPage, _t as ListLensesOptions, b as AssetTimelinePage, bt as MoveAssetOptions, ct as LensIdOptions, dt as ListAssetTimelineOptions, et as GetAssetInfoOptions, ft as ListAssetsOptions, gt as ListHashListsOptions, ht as ListHashListEntriesOptions, it as HashListPage, jt as RetrieveAssetByExternalIdOptions, k as CalmLensServerClientOptions, kt as RequestOptions, ln as GetEventsResponse, lt as LensPage, mt as ListFoldersOptions, nt as HashListEntryPage, o as AssetChildrenPage, pt as ListEventsOptions, q as EnsureLensOptions, qt as UpdateProjectSettingsOptions, r as Asset, rn as WaitForAssetDecisionOptions, rt as HashListIdOptions, sn as AssetReviewRequest, st as Lens, t as AddHashListEntryOptions, tn as VerifyWebhookSignatureOptions, tt as HashListEntryIdOptions, ut as ListAssetChildrenOptions, v as AssetSearchResponse, vt as ListPoliciesOptions, wt as PolicyIdOptions, xn as Folder, xt as MoveFolderOptions, yt as ListUploadPresetsOptions, z as CreateFolderOptions, zt as SignedUploadToken } from "./CalmLensTypes-
|
|
3
|
-
import { d as ListPromise, l as CalmLensResponse, r as CdnResponse } from "./WebhookPayload-
|
|
1
|
+
import { c as HashList, l as HashListEntry } from "./Classification-C3pkrGYS-B7EygpJn.js";
|
|
2
|
+
import { $ as FolderPage, At as ResetPolicyOptions, B as CreateHashListOptions, Bn as AssetInfo, Cn as ProjectSettingsResource, D as BatchAssetsResponse, Dt as RequestAssetReviewOptions, E as BatchAssetsOptions, Et as RemoveAssetContentOptions, Ft as SetPolicyAutomaticUpdatesOptions, G as DeleteAssetOptions, Gt as UpdateLensOptions, Ht as UpdateAssetOptions, I as ClassifyTextOptions, It as SignAssetUrlOptions, J as EnsureLensesOptions, Jt as UpgradePolicyOptions, K as DeleteMetadataFieldOptions, Kt as UpdatePolicyOptions, Lt as SignUploadTokenOptions, M as CdnAssetUrlOptions, Mt as RetrieveAssetOptions, Nt as RetryAssetOptions, P as CdnServeOptions, Pn as Policy, Q as FolderIdOptions, Qt as UploadPresetPage, Rn as AssetSearchQuery, Rt as SignedAssetUrl, Sn as MetadataFieldsResource, T as AssignPolicyOptions, Tt as PolicyPage, U as CreatePolicyOptions, Ut as UpdateFolderOptions, V as CreateLensOptions, Vt as SubmitAssetOptions, W as DecideAssetOptions, Wt as UpdateHashListOptions, X as EnsureUploadPresetsOptions, Y as EnsureMetadataFieldsOptions, Yt as UploadAssetPartOptions, Z as EnsureUploadPresetsResponse, Zt as UploadPresetIdOptions, _ as AssetPage, _t as ListLensesOptions, b as AssetTimelinePage, bt as MoveAssetOptions, ct as LensIdOptions, dt as ListAssetTimelineOptions, et as GetAssetInfoOptions, ft as ListAssetsOptions, gt as ListHashListsOptions, ht as ListHashListEntriesOptions, it as HashListPage, jt as RetrieveAssetByExternalIdOptions, k as CalmLensServerClientOptions, kt as RequestOptions, ln as GetEventsResponse, lt as LensPage, mt as ListFoldersOptions, nt as HashListEntryPage, o as AssetChildrenPage, pt as ListEventsOptions, q as EnsureLensOptions, qt as UpdateProjectSettingsOptions, r as Asset, rn as WaitForAssetDecisionOptions, rt as HashListIdOptions, sn as AssetReviewRequest, st as Lens, t as AddHashListEntryOptions, tn as VerifyWebhookSignatureOptions, tt as HashListEntryIdOptions, ut as ListAssetChildrenOptions, v as AssetSearchResponse, vt as ListPoliciesOptions, wt as PolicyIdOptions, xn as Folder, xt as MoveFolderOptions, yt as ListUploadPresetsOptions, z as CreateFolderOptions, zt as SignedUploadToken } from "./CalmLensTypes-87kiUg0H.js";
|
|
3
|
+
import { d as ListPromise, l as CalmLensResponse, r as CdnResponse } from "./WebhookPayload-B4rA_Dvm.js";
|
|
4
4
|
interface TransportRequest {
|
|
5
5
|
/** The client method sending the request, such as `assets.retrieve`, for hooks and logs. */
|
|
6
6
|
operation?: string;
|
package/esm/{CalmLensTestInputArguments-Xh4GIadS.js → CalmLensTestInputArguments-CqPADTkl.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as invalidArgument } from "./CalmLensError-
|
|
1
|
+
import { S as invalidArgument } from "./CalmLensError-C15tWu8W.js";
|
|
2
2
|
import { r as timingSafeEqual, t as hmacSha256Hex } from "./CryptoUtils-BLCa-oZe-DKr3LmN6.js";
|
|
3
3
|
import * as z from "zod";
|
|
4
4
|
import { globalRegistry } from "zod";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as HashList, d as ModerationContext, l as HashListEntry } from "./Classification-
|
|
1
|
+
import { c as HashList, d as ModerationContext, l as HashListEntry } from "./Classification-C3pkrGYS-B7EygpJn.js";
|
|
2
2
|
import * as zod from "zod";
|
|
3
3
|
/**
|
|
4
4
|
* Where the asset is in the pipeline: waiting for its content or its turn (`queued`), being
|
|
@@ -10095,8 +10095,7 @@ declare const ASSET_SCHEMA: zod.ZodObject<{
|
|
|
10095
10095
|
authorId: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
|
|
10096
10096
|
context: zod.ZodOptional<zod.ZodNullable<zod.ZodObject<{
|
|
10097
10097
|
items: zod.ZodArray<zod.ZodObject<{
|
|
10098
|
-
|
|
10099
|
-
authorId: zod.ZodOptional<zod.ZodString>;
|
|
10098
|
+
assetId: zod.ZodString;
|
|
10100
10099
|
}, zod.core.$strict>>;
|
|
10101
10100
|
}, zod.core.$strip>>>;
|
|
10102
10101
|
type: zod.ZodEnum<{
|
|
@@ -15368,8 +15367,7 @@ declare const ASSET_SEARCH_RESULT_SCHEMA: zod.ZodObject<{
|
|
|
15368
15367
|
authorId: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
|
|
15369
15368
|
context: zod.ZodOptional<zod.ZodNullable<zod.ZodObject<{
|
|
15370
15369
|
items: zod.ZodArray<zod.ZodObject<{
|
|
15371
|
-
|
|
15372
|
-
authorId: zod.ZodOptional<zod.ZodString>;
|
|
15370
|
+
assetId: zod.ZodString;
|
|
15373
15371
|
}, zod.core.$strict>>;
|
|
15374
15372
|
}, zod.core.$strip>>>;
|
|
15375
15373
|
type: zod.ZodEnum<{
|
|
@@ -1,27 +1,8 @@
|
|
|
1
1
|
import * as zod from "zod";
|
|
2
|
-
/** The most recent earlier posts CalmLens uses. */
|
|
3
|
-
declare const MODERATION_CONTEXT_USED_ITEMS = 5;
|
|
4
|
-
/**
|
|
5
|
-
* The most characters of earlier posts CalmLens uses. The newest post always fits, since no post
|
|
6
|
-
* may be longer.
|
|
7
|
-
*/
|
|
8
|
-
declare const MODERATION_CONTEXT_USED_CHARACTERS = 2000;
|
|
9
|
-
/** An earlier post in the conversation. */
|
|
10
|
-
interface ModerationContextItem {
|
|
11
|
-
text: string;
|
|
12
|
-
authorId?: string;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* The earlier posts CalmLens uses: the most recent ones, newest first, while at most
|
|
16
|
-
* `MODERATION_CONTEXT_USED_ITEMS` and `MODERATION_CONTEXT_USED_CHARACTERS` allow, returned oldest
|
|
17
|
-
* first. The newest post is always kept, so an over-long one is left for validation to reject.
|
|
18
|
-
*/
|
|
19
|
-
declare const selectModerationContextItems: <Item extends ModerationContextItem>(items: readonly Item[]) => Item[];
|
|
20
2
|
/** The context a request may send: up to 20 earlier posts, oldest first. */
|
|
21
3
|
declare const MODERATION_CONTEXT_SCHEMA: zod.ZodObject<{
|
|
22
4
|
items: zod.ZodArray<zod.ZodObject<{
|
|
23
|
-
|
|
24
|
-
authorId: zod.ZodOptional<zod.ZodString>;
|
|
5
|
+
assetId: zod.ZodString;
|
|
25
6
|
}, zod.core.$strict>>;
|
|
26
7
|
}, zod.core.$strict>;
|
|
27
8
|
type ModerationContext = zod.infer<typeof MODERATION_CONTEXT_SCHEMA>;
|
|
@@ -6013,4 +5994,4 @@ declare const CATEGORIES_SCHEMA: zod.ZodObject<{
|
|
|
6013
5994
|
}, zod.core.$strict>], "status">;
|
|
6014
5995
|
}, zod.core.$strict>;
|
|
6015
5996
|
type ClassificationCategories = zod.infer<typeof CATEGORIES_SCHEMA>;
|
|
6016
|
-
export { ClassificationQualifierResults as a, HashList as c, ModerationContext as d,
|
|
5997
|
+
export { ClassificationQualifierResults as a, HashList as c, ModerationContext as d, ClassificationNotEvaluatedReason as i, HashListEntry as l, ClassificationCategory as n, Likelihood as o, ClassificationCategoryReport as r, ModerationQualifier as s, ClassificationCategories as t, PolicyAction as u };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as CdnTransform, O as CalmLensAppClientOptions, g as AssetModerationStatus, i as AssetAvailability, nn as ViewerClaims } from "./CalmLensTypes-
|
|
2
|
-
import { t as CalmLensAppClient } from "./CalmLensAppClient-
|
|
1
|
+
import { F as CdnTransform, O as CalmLensAppClientOptions, g as AssetModerationStatus, i as AssetAvailability, nn as ViewerClaims } from "./CalmLensTypes-87kiUg0H.js";
|
|
2
|
+
import { t as CalmLensAppClient } from "./CalmLensAppClient-CdlcDd5l.js";
|
|
3
3
|
import { o as UploadFileIconFamily } from "./FileIcons-4qSX7DW2.js";
|
|
4
4
|
/**
|
|
5
5
|
* The text the asset viewers show, keyed by name. `{name}` placeholders are filled in when shown.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { l as CalmLensError } from "./CalmLensError-
|
|
2
|
-
import {
|
|
3
|
-
import { o as placeholderHashToDataURL } from "./UploadController-
|
|
1
|
+
import { l as CalmLensError } from "./CalmLensError-C15tWu8W.js";
|
|
2
|
+
import { a as assetUrlOf, c as toUrlViewerClaims, r as appendAssetLocation, s as getAssetInfo, v as serializeTransform, x as transformSelector } from "./CalmLensCdn-CL1P1v2t.js";
|
|
3
|
+
import { o as placeholderHashToDataURL } from "./UploadController-X2gEFMGy.js";
|
|
4
4
|
import { a as getFileIcon, c as renderFileIconSvg } from "./FileIcons-M6dzjFxd.js";
|
|
5
5
|
// src/ui/viewers/ViewerAsset.ts
|
|
6
6
|
/** Spreadsheet MIME types, as `content.format` reports them (compared lower-cased). */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as UploadFile, L as UploadSnapshot, N as UploadController, O as CalmLensProvidedOptions, P as UploadControllerOptions } from "./Core-
|
|
1
|
+
import { F as UploadFile, L as UploadSnapshot, N as UploadController, O as CalmLensProvidedOptions, P as UploadControllerOptions } from "./Core-Ccy4-_sN.js";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
3
|
type CalmLensProviderProps<F extends UploadFile = File> = CalmLensProvidedOptions<F> & {
|
|
4
4
|
children?: ReactNode;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as withProvidedOptions, n as createUploadController } from "./UploadController-
|
|
1
|
+
import { i as withProvidedOptions, n as createUploadController } from "./UploadController-X2gEFMGy.js";
|
|
2
2
|
import { createContext, createElement, useContext, useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
3
3
|
// src/ui/ReactUpload.ts
|
|
4
4
|
const CalmLensContext = createContext(void 0);
|