calmlens 0.27.4 → 0.27.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/bin/calmlens.js +26 -15
- package/cjs/{BrowserUpload-CFtjSpBI.d.ts → BrowserUpload-CdOfuIcV.d.ts} +2 -2
- package/cjs/{BrowserUpload-Ch9y2ZDx.js → BrowserUpload-GQtZti-D.js} +1 -1
- package/{esm/CalmLensAppClient-DzoSqUgG.d.ts → cjs/CalmLensAppClient-Btp8f-34.d.ts} +2 -2
- package/cjs/{CalmLensAppClient-DGtj1vUV.js → CalmLensAppClient-Bwt3gP0C.js} +3 -3
- package/cjs/{CalmLensOptionKeys-DbL03fZj.js → CalmLensOptionKeys--gTpTkwt.js} +1 -1
- package/cjs/{CalmLensServerClient-D62AeRAi.js → CalmLensServerClient-BYMzGkQK.js} +7 -7
- package/cjs/{CalmLensServerClient-D3K5HS9v.d.ts → CalmLensServerClient-C3kaPLUZ.d.ts} +2 -2
- package/cjs/{CalmLensTypes-OWZsGvBX.d.ts → CalmLensTypes-DxxyZt2L.d.ts} +73 -5
- package/cjs/{Core-Cv2zLAJ-.js → Core-52DVaX7d.js} +63 -21
- package/{esm/Core-BXeXyiNv.d.ts → cjs/Core-Dhijt6JU.d.ts} +13 -14
- package/cjs/{CryptoUtils-B_x8lMIx-YBW1-bvL.js → CryptoUtils-BLCa-oZe-leCkr1ko.js} +1 -2
- package/cjs/{ModerationContextLimits-DjacyIkw.js → ModerationContextLimits-DJyIjzIn.js} +21 -3
- package/cjs/{ReactUpload-C47UrgH2.d.ts → ReactUpload-BuqLPgNr.d.ts} +1 -1
- package/cjs/{ReactUpload-CytoQTh_.js → ReactUpload-DHuhGYsr.js} +1 -1
- package/cjs/{TestTriggers-Cvi7e2KA-DcT1pc_W.js → TestTriggers-DP4m92jg-C0HD-A4r.js} +14 -14
- package/cjs/{UploadController-fpTC5TUO.js → UploadController-ChzDPMmm.js} +2 -2
- package/{esm/WebhookPayload-CrMU6lg0.d.ts → cjs/WebhookPayload-D_yWJA9M.d.ts} +5 -1
- package/cjs/app.d.ts +4 -4
- package/cjs/app.js +2 -2
- package/cjs/elements.d.ts +8 -19
- package/cjs/elements.js +45 -53
- package/cjs/{index-BDxmVi-G.d.ts → index-CUA-HDNu.d.ts} +2 -2
- package/cjs/index.d.ts +3 -3
- package/cjs/index.js +1 -1
- package/cjs/react-native.d.ts +3 -3
- package/cjs/react-native.js +6 -4
- package/cjs/react.d.ts +5 -11
- package/cjs/react.js +29 -36
- package/cjs/server.d.ts +4 -4
- package/cjs/server.js +2 -2
- package/cjs/test-inputs.js +13 -13
- package/cjs/testing.d.ts +4 -4
- package/cjs/testing.js +54 -32
- package/cjs/{ui-5IdEYYpC.d.ts → ui-BSm_qphN.d.ts} +3 -9
- package/cjs/{ui-BvyDbJBb.js → ui-C1_SDSiq.js} +2 -201
- package/cjs/ui.d.ts +3 -3
- package/cjs/ui.js +5 -5
- package/cjs/vue.d.ts +6 -319
- package/cjs/vue.js +27 -17
- package/esm/{BrowserUpload-BE8OVeBC.js → BrowserUpload-BaKFKEBz.js} +1 -1
- package/esm/{BrowserUpload-CFtjSpBI.d.ts → BrowserUpload-CdOfuIcV.d.ts} +2 -2
- package/{cjs/CalmLensAppClient-DzoSqUgG.d.ts → esm/CalmLensAppClient-Btp8f-34.d.ts} +2 -2
- package/esm/{CalmLensAppClient-C1cpQEYR.js → CalmLensAppClient-DM6c3pGC.js} +3 -3
- package/esm/{CalmLensOptionKeys-DoCKKuLT.js → CalmLensOptionKeys-CKZs8i3_.js} +1 -1
- package/esm/{CalmLensServerClient-D3K5HS9v.d.ts → CalmLensServerClient-C3kaPLUZ.d.ts} +2 -2
- package/esm/{CalmLensServerClient-CSCrJ7wX.js → CalmLensServerClient-Da2UfUo4.js} +3 -3
- package/esm/{CalmLensTypes-OWZsGvBX.d.ts → CalmLensTypes-DxxyZt2L.d.ts} +73 -5
- package/{cjs/Core-BXeXyiNv.d.ts → esm/Core-Dhijt6JU.d.ts} +13 -14
- package/esm/{Core-Df2PSa1n.js → Core-kYMRW5C1.js} +52 -22
- package/esm/{CryptoUtils-B_x8lMIx-DhuWGzqn.js → CryptoUtils-BLCa-oZe-DKr3LmN6.js} +1 -2
- package/esm/{ModerationContextLimits-tu_PY4fn.js → ModerationContextLimits-ZIlK9n2X.js} +21 -3
- package/esm/{ReactUpload-C47UrgH2.d.ts → ReactUpload-BuqLPgNr.d.ts} +1 -1
- package/esm/{ReactUpload-BsbisXS6.js → ReactUpload-CipY3cmO.js} +1 -1
- package/esm/{TestTriggers-Cvi7e2KA-BA83CRJb.js → TestTriggers-DP4m92jg-DhOI4S1V.js} +11 -11
- package/esm/{UploadController-Dqjf23bS.js → UploadController-D-14HWII.js} +2 -2
- package/{cjs/WebhookPayload-CrMU6lg0.d.ts → esm/WebhookPayload-D_yWJA9M.d.ts} +5 -1
- package/esm/app.d.ts +4 -4
- package/esm/app.js +2 -2
- package/esm/elements.d.ts +8 -19
- package/esm/elements.js +44 -50
- package/esm/{index-BDxmVi-G.d.ts → index-CUA-HDNu.d.ts} +2 -2
- package/esm/index.d.ts +3 -3
- package/esm/index.js +1 -1
- package/esm/react-native.d.ts +3 -3
- package/esm/react-native.js +5 -5
- package/esm/react.d.ts +5 -11
- package/esm/react.js +29 -34
- package/esm/server.d.ts +4 -4
- package/esm/server.js +2 -2
- package/esm/styles.css +12 -16
- package/esm/svelte/CalmLensAsset.svelte +22 -4
- package/esm/svelte/index.d.ts +0 -6
- package/esm/svelte/index.js +0 -2
- package/esm/test-inputs.js +1 -1
- package/esm/testing.d.ts +4 -4
- package/esm/testing.js +45 -23
- package/esm/{ui-5IdEYYpC.d.ts → ui-BSm_qphN.d.ts} +3 -9
- package/esm/{ui-DF7-9mB3.js → ui-CgIG3knW.js} +3 -190
- package/esm/ui.d.ts +3 -3
- package/esm/ui.js +4 -4
- package/esm/vue.d.ts +6 -319
- package/esm/vue.js +26 -14
- package/package.json +1 -1
- package/esm/svelte/CalmLensImageViewer.svelte +0 -7
- package/esm/svelte/CalmLensWebsiteViewer.svelte +0 -7
package/cjs/test-inputs.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const
|
|
3
|
-
exports.TEST_DETECTIONS_MAX =
|
|
4
|
-
exports.TEST_DETECTION_BOX_MAX =
|
|
5
|
-
exports.TEST_FACE_AGE_MAX =
|
|
6
|
-
exports.TEST_FACE_AGE_PRESETS =
|
|
7
|
-
exports.TEST_INPUT_KEY_PATTERN =
|
|
8
|
-
exports.TEST_INPUT_PRESETS =
|
|
9
|
-
exports.detectTestImage =
|
|
10
|
-
exports.detectTestTrigger =
|
|
11
|
-
exports.generateTestTextCode =
|
|
12
|
-
exports.getImageTestCategories =
|
|
13
|
-
exports.paintTestImage =
|
|
14
|
-
exports.testInputForSignal =
|
|
2
|
+
const require_TestTriggers_DP4m92jg = require("./TestTriggers-DP4m92jg-C0HD-A4r.js");
|
|
3
|
+
exports.TEST_DETECTIONS_MAX = require_TestTriggers_DP4m92jg.TEST_DETECTIONS_MAX;
|
|
4
|
+
exports.TEST_DETECTION_BOX_MAX = require_TestTriggers_DP4m92jg.TEST_DETECTION_BOX_MAX;
|
|
5
|
+
exports.TEST_FACE_AGE_MAX = require_TestTriggers_DP4m92jg.TEST_FACE_AGE_MAX;
|
|
6
|
+
exports.TEST_FACE_AGE_PRESETS = require_TestTriggers_DP4m92jg.TEST_FACE_AGE_PRESETS;
|
|
7
|
+
exports.TEST_INPUT_KEY_PATTERN = require_TestTriggers_DP4m92jg.TEST_INPUT_KEY_PATTERN;
|
|
8
|
+
exports.TEST_INPUT_PRESETS = require_TestTriggers_DP4m92jg.TEST_INPUT_PRESETS;
|
|
9
|
+
exports.detectTestImage = require_TestTriggers_DP4m92jg.detectTestImage;
|
|
10
|
+
exports.detectTestTrigger = require_TestTriggers_DP4m92jg.detectTestTrigger;
|
|
11
|
+
exports.generateTestTextCode = require_TestTriggers_DP4m92jg.generateTestTextCode;
|
|
12
|
+
exports.getImageTestCategories = require_TestTriggers_DP4m92jg.getImageTestCategories;
|
|
13
|
+
exports.paintTestImage = require_TestTriggers_DP4m92jg.paintTestImage;
|
|
14
|
+
exports.testInputForSignal = require_TestTriggers_DP4m92jg.testInputForSignal;
|
package/cjs/testing.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Fn as AssetBinaryPayloadInput, Ft as SignUploadTokenOptions, Lt as SignedUploadToken, O as CalmLensAppClientOptions, _n as Folder, gn as PermissionGrant, k as CalmLensServerClientOptions, ln as TypedEvent, m as AssetModeration, r as Asset } from "./CalmLensTypes-
|
|
2
|
-
import { t as CalmLensAppClient } from "./CalmLensAppClient-
|
|
3
|
-
import { I as ApiErrorCode, n as WebhookEventPayload } from "./WebhookPayload-
|
|
4
|
-
import { t as CalmLensServerClient } from "./CalmLensServerClient-
|
|
1
|
+
import { Fn as AssetBinaryPayloadInput, Ft as SignUploadTokenOptions, Lt as SignedUploadToken, O as CalmLensAppClientOptions, _n as Folder, gn as PermissionGrant, k as CalmLensServerClientOptions, ln as TypedEvent, m as AssetModeration, r as Asset } from "./CalmLensTypes-DxxyZt2L.js";
|
|
2
|
+
import { t as CalmLensAppClient } from "./CalmLensAppClient-Btp8f-34.js";
|
|
3
|
+
import { I as ApiErrorCode, n as WebhookEventPayload } from "./WebhookPayload-D_yWJA9M.js";
|
|
4
|
+
import { t as CalmLensServerClient } from "./CalmLensServerClient-C3kaPLUZ.js";
|
|
5
5
|
import { t as ClassificationTestSignal } from "./TestTriggers-Dnukm-jm-DoEB7jJc.js";
|
|
6
6
|
import "zod";
|
|
7
7
|
/**
|
package/cjs/testing.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const
|
|
3
|
-
const require_ModerationContextLimits = require("./ModerationContextLimits-
|
|
4
|
-
const require_CalmLensServerClient = require("./CalmLensServerClient-
|
|
5
|
-
const require_CalmLensOptionKeys = require("./CalmLensOptionKeys
|
|
6
|
-
const
|
|
7
|
-
const require_CalmLensAppClient = require("./CalmLensAppClient-
|
|
8
|
-
const require_UploadController = require("./UploadController-
|
|
2
|
+
const require_TestTriggers_DP4m92jg = require("./TestTriggers-DP4m92jg-C0HD-A4r.js");
|
|
3
|
+
const require_ModerationContextLimits = require("./ModerationContextLimits-DJyIjzIn.js");
|
|
4
|
+
const require_CalmLensServerClient = require("./CalmLensServerClient-BYMzGkQK.js");
|
|
5
|
+
const require_CalmLensOptionKeys = require("./CalmLensOptionKeys--gTpTkwt.js");
|
|
6
|
+
const require_CryptoUtils_BLCa_oZe = require("./CryptoUtils-BLCa-oZe-leCkr1ko.js");
|
|
7
|
+
const require_CalmLensAppClient = require("./CalmLensAppClient-Bwt3gP0C.js");
|
|
8
|
+
const require_UploadController = require("./UploadController-ChzDPMmm.js");
|
|
9
9
|
let zod = require("zod");
|
|
10
|
-
zod =
|
|
10
|
+
zod = require_TestTriggers_DP4m92jg.__toESM(zod, 1);
|
|
11
11
|
// src/contract/MediaTestTriggers.js
|
|
12
|
-
const MEDIA_TEST_SIGNALS = [...
|
|
12
|
+
const MEDIA_TEST_SIGNALS = [...require_TestTriggers_DP4m92jg.CLASSIFICATION_CATEGORIES, "violence.graphic"];
|
|
13
13
|
const HEX_WORDS = [
|
|
14
14
|
"zero",
|
|
15
15
|
"one",
|
|
@@ -31,9 +31,21 @@ const HEX_WORDS = [
|
|
|
31
31
|
/** Read this aloud, or render it as large, high-contrast text in a video frame. */
|
|
32
32
|
async function generateMediaTestCode(signal, testInputKey) {
|
|
33
33
|
if (!MEDIA_TEST_SIGNALS.includes(signal)) throw new RangeError("Unsupported media test signal");
|
|
34
|
-
return `Calm Lens test ${[...await
|
|
34
|
+
return `Calm Lens test ${[...await require_TestTriggers_DP4m92jg.getTestInputTag("media", signal, testInputKey)].map((character) => HEX_WORDS[Number.parseInt(character, 16)]).join(" ")} ${signal.replace(/[.-]/g, " ")} end test`;
|
|
35
35
|
}
|
|
36
|
-
|
|
36
|
+
/**
|
|
37
|
+
* The character an asset ID starts with (after `asset_`) to say the region it lives in: the asset
|
|
38
|
+
* table computes each row's region from it (`AssetTable`), so an ID is only ever in one region and
|
|
39
|
+
* a lookup by ID goes straight there. A code is never reused for another region.
|
|
40
|
+
*/
|
|
41
|
+
const ASSET_ID_REGION_CODES = {
|
|
42
|
+
"aws-ap-southeast-1": "a",
|
|
43
|
+
"aws-eu-west-2": "e",
|
|
44
|
+
"aws-eu-central-1": "f",
|
|
45
|
+
"aws-us-east-2": "u"
|
|
46
|
+
};
|
|
47
|
+
new Map(Object.entries(ASSET_ID_REGION_CODES).map(([region, code]) => [code, region]));
|
|
48
|
+
// src/contract/Ids-BBz_iuDy.js
|
|
37
49
|
var __defProp = Object.defineProperty;
|
|
38
50
|
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod, mod.exports), cb = null), mod.exports);
|
|
39
51
|
var __exportAll = (all, no_symbols) => {
|
|
@@ -7927,6 +7939,7 @@ createMetaType({
|
|
|
7927
7939
|
createMetaType({ id: "updatedAt" });
|
|
7928
7940
|
createMetaType({ id: "monotonicTimestamp" });
|
|
7929
7941
|
createMetaType({ id: "backfill" });
|
|
7942
|
+
createMetaType({ id: "computed" });
|
|
7930
7943
|
/**
|
|
7931
7944
|
* The prefix of every kind of object customers can see, so an ID says what it identifies:
|
|
7932
7945
|
* `proj_8fK2mQx7Lp4NvB3tRz9Y` is a project. Rows that never leave the backend (usage meters, upload
|
|
@@ -7989,15 +8002,23 @@ const randomBase62 = (length) => {
|
|
|
7989
8002
|
}
|
|
7990
8003
|
return result;
|
|
7991
8004
|
};
|
|
7992
|
-
/**
|
|
8005
|
+
/**
|
|
8006
|
+
* A new random ID, such as `newId("proj")` → `proj_8fK2mQx7Lp4NvB3tRz9Y`. Assets take theirs from
|
|
8007
|
+
* `newAssetId`, which names their region.
|
|
8008
|
+
*/
|
|
7993
8009
|
const newId = (prefix) => `${prefix}_${randomBase62(20)}`;
|
|
8010
|
+
/**
|
|
8011
|
+
* A new asset ID for an asset that lives in `region`: its first character after `asset_` is the
|
|
8012
|
+
* region's code (`ASSET_ID_REGION_CODES`), then 19 random characters (about 113 bits).
|
|
8013
|
+
*/
|
|
8014
|
+
const newAssetId = (region) => `asset_${ASSET_ID_REGION_CODES[region]}${randomBase62(19)}`;
|
|
7994
8015
|
/** Whether `value` is an ID with `prefix` (or with any registered prefix). */
|
|
7995
8016
|
const isId = (value, prefix) => typeof value === "string" && idPattern(prefix).test(value);
|
|
7996
8017
|
/** Example IDs for docs, OpenAPI and SDK fixtures: fixed, so generated output stays stable. */
|
|
7997
8018
|
const EXAMPLE_IDS = {
|
|
7998
8019
|
org: "org_3hQ7tLk2Vb9XpR4mWc8N",
|
|
7999
8020
|
proj: "proj_8fK2mQx7Lp4NvB3tRz9Y",
|
|
8000
|
-
asset: "
|
|
8021
|
+
asset: "asset_e5Gm2Rk8XqT3wLp9VbN4",
|
|
8001
8022
|
fldr: "fldr_7Nc4Wq2Lm8Xt5Rk9Bv3P",
|
|
8002
8023
|
lens: "lens_2Xr9Lp4Vm7Qk3Tb8Nw5C",
|
|
8003
8024
|
key: "key_9Pt3Wm6Rk2Lx8Qv4Nb7C",
|
|
@@ -8030,8 +8051,9 @@ const EXAMPLE_IDS = {
|
|
|
8030
8051
|
* across the packages that build records from plain strings).
|
|
8031
8052
|
*/
|
|
8032
8053
|
const idField = (prefix) => zod.string().regex(idPattern(prefix), { message: `Must be a valid ID: "${prefix}_" followed by 20 letters or digits` }).meta({ examples: [EXAMPLE_IDS[prefix]] });
|
|
8033
|
-
// src/contract/Permissions-
|
|
8034
|
-
|
|
8054
|
+
// src/contract/Permissions-Dwk78TtG.js
|
|
8055
|
+
/** Every permission action, in the order the docs and the portal list them. */
|
|
8056
|
+
const PERMISSION_ACTIONS = [
|
|
8035
8057
|
"assets:read",
|
|
8036
8058
|
"assets:download",
|
|
8037
8059
|
"assets:create",
|
|
@@ -8063,7 +8085,8 @@ const ACTION_SCHEMA = /* @__PURE__ */ require_TestTriggers_Cvi7e2KA.lazySchema((
|
|
|
8063
8085
|
"reviews:read",
|
|
8064
8086
|
"reviews:write",
|
|
8065
8087
|
"project:manage"
|
|
8066
|
-
]
|
|
8088
|
+
];
|
|
8089
|
+
const ACTION_SCHEMA = /* @__PURE__ */ require_TestTriggers_DP4m92jg.lazySchema(() => zod.enum(PERMISSION_ACTIONS));
|
|
8067
8090
|
const PROJECT_ACTIONS = [...[
|
|
8068
8091
|
"settings",
|
|
8069
8092
|
"members",
|
|
@@ -8079,14 +8102,14 @@ const PROJECT_ACTIONS = [...[
|
|
|
8079
8102
|
const isProjectAction = (action) => PROJECT_ACTIONS.includes(action);
|
|
8080
8103
|
/** The actions that include `action`: its feature's write action and project:manage. */
|
|
8081
8104
|
const actionsImplying = (action) => !isProjectAction(action) || action === "project:manage" ? [] : action.endsWith(":read") ? [action.replace(/:read$/, ":write"), "project:manage"] : ["project:manage"];
|
|
8082
|
-
const GRANT_SCHEMA = /* @__PURE__ */
|
|
8105
|
+
const GRANT_SCHEMA = /* @__PURE__ */ require_TestTriggers_DP4m92jg.lazySchema(() => zod.object({
|
|
8083
8106
|
actions: zod.array(ACTION_SCHEMA),
|
|
8084
8107
|
folderId: idField("fldr").nullable(),
|
|
8085
8108
|
includeSubfolders: zod.boolean()
|
|
8086
8109
|
}).strict().refine((g) => g.folderId === null || !g.actions.some(isProjectAction), "Project configuration permissions require project scope"));
|
|
8087
|
-
const GRANTS_SCHEMA = /* @__PURE__ */
|
|
8088
|
-
[...
|
|
8089
|
-
[...
|
|
8110
|
+
const GRANTS_SCHEMA = /* @__PURE__ */ require_TestTriggers_DP4m92jg.lazySchema(() => zod.array(GRANT_SCHEMA).max(100));
|
|
8111
|
+
[...PERMISSION_ACTIONS.filter((a) => !isProjectAction(a))];
|
|
8112
|
+
[...PERMISSION_ACTIONS.filter((a) => !isProjectAction(a))];
|
|
8090
8113
|
const permits = (grants, action, folderId, folders) => grants.some((grant) => {
|
|
8091
8114
|
if (![action, ...actionsImplying(action)].some((held) => grant.actions.includes(held))) return false;
|
|
8092
8115
|
if (grant.folderId === null) return true;
|
|
@@ -9534,7 +9557,7 @@ const MOCK_PRESET_NAMES = {
|
|
|
9534
9557
|
* personal information and profanity, `block` otherwise) and no rules. The mock holds no built-in
|
|
9535
9558
|
* preset settings, and uploads are never decided by a policy.
|
|
9536
9559
|
*/
|
|
9537
|
-
const mockPresetSettings = () => ({ categorySettings: Object.fromEntries(
|
|
9560
|
+
const mockPresetSettings = () => ({ categorySettings: Object.fromEntries(require_TestTriggers_DP4m92jg.CLASSIFICATION_CATEGORIES.map((category) => [category, {
|
|
9538
9561
|
action: category === "personal-information" || category === "profanity" ? "allow" : "block",
|
|
9539
9562
|
allowances: [],
|
|
9540
9563
|
restrictions: []
|
|
@@ -9546,13 +9569,13 @@ const mockPresetSettings = () => ({ categorySettings: Object.fromEntries(require
|
|
|
9546
9569
|
const checkPolicySettings = (settings) => {
|
|
9547
9570
|
const categories = settings?.categorySettings;
|
|
9548
9571
|
if (!categories || typeof categories !== "object") throw invalidField("validation/invalid-type", "settings.categorySettings");
|
|
9549
|
-
for (const category of
|
|
9572
|
+
for (const category of require_TestTriggers_DP4m92jg.CLASSIFICATION_CATEGORIES) {
|
|
9550
9573
|
const value = categories[category];
|
|
9551
9574
|
if (!value || typeof value !== "object") throw invalidField("validation/invalid-type", `settings.categorySettings.${category}`);
|
|
9552
9575
|
for (const key of ["allowances", "restrictions"]) if (!Array.isArray(value[key])) throw invalidField("validation/invalid-type", `settings.categorySettings.${category}.${key}`);
|
|
9553
9576
|
if (typeof value.action !== "string") throw invalidField("validation/invalid-value", `settings.categorySettings.${category}.action`);
|
|
9554
9577
|
}
|
|
9555
|
-
for (const key of Object.keys(categories)) if (!
|
|
9578
|
+
for (const key of Object.keys(categories)) if (!require_TestTriggers_DP4m92jg.CLASSIFICATION_CATEGORIES.includes(key)) throw invalidField("validation/unknown-field", `settings.categorySettings.${key}`);
|
|
9556
9579
|
};
|
|
9557
9580
|
/** The client methods that send a request, the one it is recorded under first. */
|
|
9558
9581
|
const operationsOf = (request) => {
|
|
@@ -11633,7 +11656,7 @@ var MockCalmLensApi = class {
|
|
|
11633
11656
|
}, url);
|
|
11634
11657
|
if (resource === "embed") return this.cdnResponse(isHead, new TextEncoder().encode(MOCK_EMBED_HTML), url, {
|
|
11635
11658
|
"Content-Type": "text/html; charset=utf-8",
|
|
11636
|
-
"Cache-Control":
|
|
11659
|
+
"Cache-Control": "private, no-store",
|
|
11637
11660
|
"Cache-Tag": `asset-${asset.id}`,
|
|
11638
11661
|
"X-Content-Type-Options": "nosniff"
|
|
11639
11662
|
});
|
|
@@ -11665,15 +11688,14 @@ var MockCalmLensApi = class {
|
|
|
11665
11688
|
bytes = mockPlaceholderPng(preview?.thumbhash ?? MOCK_THUMBHASH);
|
|
11666
11689
|
contentType = "image/png";
|
|
11667
11690
|
}
|
|
11668
|
-
const
|
|
11691
|
+
const imageResponse = stillImage || resource === "original" && asset.type === "image";
|
|
11692
|
+
const maxAge = grant ? Math.max(0, Math.min(86400, Math.floor((grant.expiresAt - this.now()) / 1e3))) : 86400;
|
|
11693
|
+
const cacheControl = query.has("viewerClaims") || request.headers.has("X-CalmLens-Viewer-Claims") ? "private, no-store" : isPrivate && !grant ? "private, no-cache" : `${isPrivate ? "private" : "public"}, max-age=${maxAge}, must-revalidate`;
|
|
11669
11694
|
return this.cdnResponse(isHead, bytes, url, {
|
|
11670
11695
|
"Content-Type": contentType,
|
|
11671
|
-
"Cache-Control":
|
|
11696
|
+
"Cache-Control": cacheControl,
|
|
11672
11697
|
"Cache-Tag": `asset-${asset.id}`,
|
|
11673
|
-
...
|
|
11674
|
-
ETag: `"${asset.id}"`,
|
|
11675
|
-
Expires: new Date(this.now() + 31536e6).toUTCString()
|
|
11676
|
-
} : {},
|
|
11698
|
+
...imageResponse ? { ETag: `"${asset.id}"` } : {},
|
|
11677
11699
|
"X-Content-Type-Options": "nosniff",
|
|
11678
11700
|
"Content-Security-Policy": "sandbox; default-src 'none'",
|
|
11679
11701
|
...isActiveContentType(contentType) ? { "Content-Disposition": "attachment" } : {}
|
|
@@ -11874,7 +11896,7 @@ var MockCalmLensServerClient = class extends require_CalmLensServerClient.CalmLe
|
|
|
11874
11896
|
grants: getMockApiKeyGrants(options.apiKey),
|
|
11875
11897
|
databaseStorage: mockOptions.databaseStorage ?? new InMemoryMockDatabaseStorage(),
|
|
11876
11898
|
imageStorage: mockOptions.imageStorage ?? new InMemoryMockImageStorage(),
|
|
11877
|
-
createId: mockOptions.createId ?? newId,
|
|
11899
|
+
createId: mockOptions.createId ?? ((prefix) => prefix === "asset" ? newAssetId("aws-eu-west-2") : newId(prefix)),
|
|
11878
11900
|
now: mockOptions.now ?? createMonotonicClock(),
|
|
11879
11901
|
moderate: mockOptions.moderate ?? defaultModerate
|
|
11880
11902
|
});
|
|
@@ -12042,7 +12064,7 @@ const toWebhookEventPayload = (event) => ({
|
|
|
12042
12064
|
createdAt: event.createdAt
|
|
12043
12065
|
});
|
|
12044
12066
|
/** `v1=<hex HMAC-SHA256 of "<timestamp>.<body>">`, the `x-calmlens-signature` header value. */
|
|
12045
|
-
const createWebhookSignatureHeader = async (secret, timestamp, body) => `v1=${await
|
|
12067
|
+
const createWebhookSignatureHeader = async (secret, timestamp, body) => `v1=${await require_CryptoUtils_BLCa_oZe.hmacSha256Hex(secret, `${timestamp}.${body}`)}`;
|
|
12046
12068
|
/** Headers for one signed delivery of `body`, as CalmLens sends them. */
|
|
12047
12069
|
const createWebhookHeaders = async (options) => {
|
|
12048
12070
|
const timestamp = options.timestampSeconds ?? Math.floor(Date.now() / 1e3);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./CalmLensTypes-
|
|
2
|
-
import { K as AssetOptions, Z as AssetView, ct as
|
|
1
|
+
import "./CalmLensTypes-DxxyZt2L.js";
|
|
2
|
+
import { K as AssetOptions, Z as AssetView, ct as DocumentViewerOptions, dt as TextViewerOptions, lt as PdfAssetOptions, pt as ViewerOptions, q as AssetSession, ut as SpreadsheetViewerOptions } from "./Core-Dhijt6JU.js";
|
|
3
3
|
import "pdfjs-dist";
|
|
4
4
|
/** A viewer mounted into an element, which it owns the children of. */
|
|
5
5
|
interface AssetViewer<O extends ViewerOptions = ViewerOptions> {
|
|
@@ -11,10 +11,6 @@ interface AssetViewer<O extends ViewerOptions = ViewerOptions> {
|
|
|
11
11
|
type ViewerState = "loading" | "loaded" | "error";
|
|
12
12
|
/** Shows a PDF, or a document rendered as one, in `root`. */
|
|
13
13
|
declare const createDocumentViewer: (root: HTMLElement, options: DocumentViewerOptions) => AssetViewer<DocumentViewerOptions>;
|
|
14
|
-
/** Shows an image asset's rendered file in `root`. */
|
|
15
|
-
declare const createImageViewer: (root: HTMLElement, options: ImageViewerOptions) => AssetViewer<ImageViewerOptions>;
|
|
16
|
-
/** Shows a website asset's screenshot and a link to the page in `root`. */
|
|
17
|
-
declare const createWebsiteViewer: (root: HTMLElement, options: WebsiteViewerOptions) => AssetViewer<WebsiteViewerOptions>;
|
|
18
14
|
type PdfJs = typeof import("pdfjs-dist");
|
|
19
15
|
/**
|
|
20
16
|
* Loads pdf.js, the first time a document viewer needs it: never at import, so pages without
|
|
@@ -83,8 +79,6 @@ declare const createSpreadsheetViewer: (root: HTMLElement, options: SpreadsheetV
|
|
|
83
79
|
declare const VIEWER_STYLES: string;
|
|
84
80
|
/** Each viewer's options, by the kind of viewer `getAssetViewerKind` names. */
|
|
85
81
|
interface AssetViewerOptionsByKind {
|
|
86
|
-
image: ImageViewerOptions;
|
|
87
|
-
website: WebsiteViewerOptions;
|
|
88
82
|
text: TextViewerOptions;
|
|
89
83
|
document: DocumentViewerOptions;
|
|
90
84
|
spreadsheet: SpreadsheetViewerOptions;
|
|
@@ -136,4 +130,4 @@ declare class MediaStreamPlayer {
|
|
|
136
130
|
/** Stops the stream, when the component unmounts. */
|
|
137
131
|
stop(): void;
|
|
138
132
|
}
|
|
139
|
-
export {
|
|
133
|
+
export { spreadsheetColumnIndex as _, isMountedViewerKind as a, AssetViewer as b, AssetViewerOptionsByKind as c, createTextViewer as d, SpreadsheetCell as f, parseSpreadsheetText as g, getSpreadsheetPage as h, getMountedViewerOptions as i, VIEWER_STYLES as l, SpreadsheetSheet as m, AssetViewerMount as n, ASSET_VIEWERS as o, SpreadsheetRow as p, MountedViewerKind as r, AssetViewerName as s, MediaStreamPlayer as t, createSpreadsheetViewer as u, loadPdfJs as v, ViewerState as x, createDocumentViewer as y };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
const require_ModerationContextLimits = require("./ModerationContextLimits-
|
|
2
|
-
|
|
3
|
-
require("./Core-Cv2zLAJ-.js");
|
|
1
|
+
const require_ModerationContextLimits = require("./ModerationContextLimits-DJyIjzIn.js");
|
|
2
|
+
require("./Core-52DVaX7d.js");
|
|
4
3
|
// src/ui/viewers/PdfLoader.ts
|
|
5
4
|
let loading;
|
|
6
5
|
/**
|
|
@@ -38,9 +37,6 @@ const openPdfDocument = async (url, options = {}) => {
|
|
|
38
37
|
// src/ui/viewers/ViewerMessages.ts
|
|
39
38
|
const DEFAULT_VIEWER_MESSAGES = {
|
|
40
39
|
loading: "Loading…",
|
|
41
|
-
imageFailed: "This image can't be shown.",
|
|
42
|
-
openWebsite: "Open {host}",
|
|
43
|
-
websiteLabel: "Website screenshot",
|
|
44
40
|
textLabel: "Text",
|
|
45
41
|
textFailed: "This text can't be shown.",
|
|
46
42
|
documentLabel: "Document",
|
|
@@ -576,187 +572,6 @@ const createDocumentViewer = (root, options) => {
|
|
|
576
572
|
viewer.update(options);
|
|
577
573
|
return viewer;
|
|
578
574
|
};
|
|
579
|
-
// src/ui/viewers/ImageViewers.ts
|
|
580
|
-
/** Widths offered for a public image, so the browser fetches the smallest that fills the frame. */
|
|
581
|
-
const IMAGE_WIDTHS = [
|
|
582
|
-
320,
|
|
583
|
-
640,
|
|
584
|
-
960,
|
|
585
|
-
1280,
|
|
586
|
-
1920,
|
|
587
|
-
2560
|
|
588
|
-
];
|
|
589
|
-
/** The blurred placeholder shown while the image loads: the stored ThumbHash, or the CDN's. */
|
|
590
|
-
const placeholderFor = (asset, urls) => {
|
|
591
|
-
const hash = asset.content?.preview?.thumbhash;
|
|
592
|
-
if (hash) try {
|
|
593
|
-
return require_UploadController.placeholderHashToDataURL(hash);
|
|
594
|
-
} catch {}
|
|
595
|
-
return asset.content?.rendered || asset.content?.preview ? urls.url("placeholder") : void 0;
|
|
596
|
-
};
|
|
597
|
-
/**
|
|
598
|
-
* Loads the rendered image into `image` at responsive widths, asking once for a fresh asset URL
|
|
599
|
-
* when it fails to load (as an expired signed one does).
|
|
600
|
-
*/
|
|
601
|
-
const loadRenderedImage = async (urls, image, { sizes, width }, signal, done) => {
|
|
602
|
-
const widths = IMAGE_WIDTHS.filter((candidate) => !width || candidate < width);
|
|
603
|
-
const setSources = (src) => {
|
|
604
|
-
if (widths.length) {
|
|
605
|
-
image.srcset = [...widths, ...width ? [width] : []].map((candidate) => `${urls.url("rendered", { width: candidate })} ${candidate}w`).join(", ");
|
|
606
|
-
image.sizes = sizes;
|
|
607
|
-
}
|
|
608
|
-
image.src = src;
|
|
609
|
-
};
|
|
610
|
-
image.addEventListener("load", () => {
|
|
611
|
-
urls.loaded("rendered");
|
|
612
|
-
done("loaded");
|
|
613
|
-
});
|
|
614
|
-
image.addEventListener("error", () => {
|
|
615
|
-
const fresh = urls.refresh("rendered");
|
|
616
|
-
if (!fresh) return done("error");
|
|
617
|
-
fresh.then((url) => {
|
|
618
|
-
if (!signal.aborted) setSources(url);
|
|
619
|
-
}, () => done("error"));
|
|
620
|
-
});
|
|
621
|
-
const url = await urls.get("rendered");
|
|
622
|
-
if (!signal.aborted) setSources(url);
|
|
623
|
-
};
|
|
624
|
-
/**
|
|
625
|
-
* Shows an image asset's rendered file, fitted inside the element (the whole frame, for an embed
|
|
626
|
-
* page), over its blurred placeholder until it loads.
|
|
627
|
-
*/
|
|
628
|
-
var ImageViewer = class extends ViewerBase {
|
|
629
|
-
constructor(root) {
|
|
630
|
-
super(root, "image");
|
|
631
|
-
}
|
|
632
|
-
describe({ asset, sizes }) {
|
|
633
|
-
return [
|
|
634
|
-
asset.content?.rendered,
|
|
635
|
-
asset.content?.preview?.thumbhash,
|
|
636
|
-
sizes
|
|
637
|
-
];
|
|
638
|
-
}
|
|
639
|
-
async load(signal) {
|
|
640
|
-
const { asset, label = "", sizes = "100vw" } = this.options;
|
|
641
|
-
const rendered = asset.content?.rendered;
|
|
642
|
-
if (rendered?.width && rendered.height) this.root.style.setProperty("--calmlens-viewer-ratio", `${rendered.width} / ${rendered.height}`);
|
|
643
|
-
const placeholderUrl = placeholderFor(asset, this.urls);
|
|
644
|
-
const placeholder = placeholderUrl && el("img", {
|
|
645
|
-
class: "calmlens-viewer__placeholder",
|
|
646
|
-
src: placeholderUrl,
|
|
647
|
-
alt: "",
|
|
648
|
-
"aria-hidden": "true"
|
|
649
|
-
});
|
|
650
|
-
const image = el("img", {
|
|
651
|
-
class: "calmlens-viewer__image",
|
|
652
|
-
alt: label,
|
|
653
|
-
width: rendered?.width ?? void 0,
|
|
654
|
-
height: rendered?.height ?? void 0,
|
|
655
|
-
decoding: "async"
|
|
656
|
-
});
|
|
657
|
-
this.frame.replaceChildren(...[placeholder, image].filter((node) => !!node));
|
|
658
|
-
await loadRenderedImage(this.urls, image, {
|
|
659
|
-
sizes,
|
|
660
|
-
width: rendered?.width
|
|
661
|
-
}, signal, (outcome) => {
|
|
662
|
-
if (signal.aborted) return;
|
|
663
|
-
if (outcome === "error") return this.fail();
|
|
664
|
-
this.state = "loaded";
|
|
665
|
-
if (placeholder) placeholder.remove();
|
|
666
|
-
});
|
|
667
|
-
}
|
|
668
|
-
fail() {
|
|
669
|
-
this.state = "error";
|
|
670
|
-
this.frame.replaceChildren(this.notice(this.messages.imageFailed));
|
|
671
|
-
}
|
|
672
|
-
};
|
|
673
|
-
/** The page's address, if it is a web address the viewer may link to. */
|
|
674
|
-
const websiteUrl = (asset) => {
|
|
675
|
-
if (!asset.externalUrl) return void 0;
|
|
676
|
-
try {
|
|
677
|
-
const url = new URL(asset.externalUrl);
|
|
678
|
-
return url.protocol === "https:" || url.protocol === "http:" ? url : void 0;
|
|
679
|
-
} catch {
|
|
680
|
-
return;
|
|
681
|
-
}
|
|
682
|
-
};
|
|
683
|
-
/**
|
|
684
|
-
* Shows a website asset: a link to the original page, then its screenshot at the element's width,
|
|
685
|
-
* scrolling down the page.
|
|
686
|
-
*/
|
|
687
|
-
var WebsiteViewer = class extends ViewerBase {
|
|
688
|
-
constructor(root) {
|
|
689
|
-
super(root, "website");
|
|
690
|
-
}
|
|
691
|
-
describe({ asset }) {
|
|
692
|
-
return [
|
|
693
|
-
asset.content?.rendered,
|
|
694
|
-
asset.content?.preview?.thumbhash,
|
|
695
|
-
asset.externalUrl
|
|
696
|
-
];
|
|
697
|
-
}
|
|
698
|
-
#link() {
|
|
699
|
-
const url = websiteUrl(this.options.asset);
|
|
700
|
-
return url ? el("div", { class: "calmlens-viewer__bar" }, [el("a", {
|
|
701
|
-
class: "calmlens-button calmlens-viewer__link",
|
|
702
|
-
href: url.href,
|
|
703
|
-
target: "_blank",
|
|
704
|
-
rel: "noopener noreferrer nofollow"
|
|
705
|
-
}, [formatViewerMessage(this.messages.openWebsite, { host: url.host })])]) : void 0;
|
|
706
|
-
}
|
|
707
|
-
async load(signal) {
|
|
708
|
-
const { asset, label } = this.options;
|
|
709
|
-
const rendered = asset.content?.rendered;
|
|
710
|
-
if (!rendered) return this.fail();
|
|
711
|
-
const name = label || this.messages.websiteLabel;
|
|
712
|
-
const placeholderUrl = placeholderFor(asset, this.urls);
|
|
713
|
-
const placeholder = placeholderUrl && el("img", {
|
|
714
|
-
class: "calmlens-viewer__placeholder",
|
|
715
|
-
src: placeholderUrl,
|
|
716
|
-
alt: "",
|
|
717
|
-
"aria-hidden": "true"
|
|
718
|
-
});
|
|
719
|
-
const image = el("img", {
|
|
720
|
-
class: "calmlens-viewer__image",
|
|
721
|
-
alt: name,
|
|
722
|
-
width: rendered.width ?? void 0,
|
|
723
|
-
height: rendered.height ?? void 0,
|
|
724
|
-
decoding: "async"
|
|
725
|
-
});
|
|
726
|
-
const page = el("div", {
|
|
727
|
-
class: "calmlens-viewer__scroll",
|
|
728
|
-
role: "region",
|
|
729
|
-
"aria-label": name,
|
|
730
|
-
tabindex: 0
|
|
731
|
-
}, [placeholder, image]);
|
|
732
|
-
this.frame.replaceChildren(...[this.#link(), page].filter((node) => !!node));
|
|
733
|
-
await loadRenderedImage(this.urls, image, {
|
|
734
|
-
sizes: "100vw",
|
|
735
|
-
width: rendered.width
|
|
736
|
-
}, signal, (outcome) => {
|
|
737
|
-
if (signal.aborted) return;
|
|
738
|
-
if (outcome === "error") return this.fail();
|
|
739
|
-
this.state = "loaded";
|
|
740
|
-
if (placeholder) placeholder.remove();
|
|
741
|
-
});
|
|
742
|
-
}
|
|
743
|
-
fail() {
|
|
744
|
-
this.state = "error";
|
|
745
|
-
this.frame.replaceChildren(...[this.#link(), this.notice(this.messages.imageFailed)].filter((node) => !!node));
|
|
746
|
-
}
|
|
747
|
-
};
|
|
748
|
-
/** Shows an image asset's rendered file in `root`. */
|
|
749
|
-
const createImageViewer = (root, options) => {
|
|
750
|
-
const viewer = new ImageViewer(root);
|
|
751
|
-
viewer.update(options);
|
|
752
|
-
return viewer;
|
|
753
|
-
};
|
|
754
|
-
/** Shows a website asset's screenshot and a link to the page in `root`. */
|
|
755
|
-
const createWebsiteViewer = (root, options) => {
|
|
756
|
-
const viewer = new WebsiteViewer(root);
|
|
757
|
-
viewer.update(options);
|
|
758
|
-
return viewer;
|
|
759
|
-
};
|
|
760
575
|
// src/ui/viewers/Spreadsheet.ts
|
|
761
576
|
const SHEET_LINE = /^# Sheet "((?:[^"\\]|\\.)*)"( \(hidden\))?$/;
|
|
762
577
|
const ROW_LINE = /^Row (\d+)( \(hidden\))?: (.*)$/;
|
|
@@ -1074,8 +889,6 @@ const createSpreadsheetViewer = (root, options) => {
|
|
|
1074
889
|
// src/ui/viewers/index.ts
|
|
1075
890
|
/** Mounts each viewer, by kind, for the bindings. */
|
|
1076
891
|
const ASSET_VIEWERS = {
|
|
1077
|
-
image: createImageViewer,
|
|
1078
|
-
website: createWebsiteViewer,
|
|
1079
892
|
text: createTextViewer,
|
|
1080
893
|
document: createDocumentViewer,
|
|
1081
894
|
spreadsheet: createSpreadsheetViewer
|
|
@@ -1287,12 +1100,6 @@ Object.defineProperty(exports, "createDocumentViewer", {
|
|
|
1287
1100
|
return createDocumentViewer;
|
|
1288
1101
|
}
|
|
1289
1102
|
});
|
|
1290
|
-
Object.defineProperty(exports, "createImageViewer", {
|
|
1291
|
-
enumerable: true,
|
|
1292
|
-
get: function() {
|
|
1293
|
-
return createImageViewer;
|
|
1294
|
-
}
|
|
1295
|
-
});
|
|
1296
1103
|
Object.defineProperty(exports, "createSpreadsheetViewer", {
|
|
1297
1104
|
enumerable: true,
|
|
1298
1105
|
get: function() {
|
|
@@ -1305,12 +1112,6 @@ Object.defineProperty(exports, "createTextViewer", {
|
|
|
1305
1112
|
return createTextViewer;
|
|
1306
1113
|
}
|
|
1307
1114
|
});
|
|
1308
|
-
Object.defineProperty(exports, "createWebsiteViewer", {
|
|
1309
|
-
enumerable: true,
|
|
1310
|
-
get: function() {
|
|
1311
|
-
return createWebsiteViewer;
|
|
1312
|
-
}
|
|
1313
|
-
});
|
|
1314
1115
|
Object.defineProperty(exports, "formatViewerMessage", {
|
|
1315
1116
|
enumerable: true,
|
|
1316
1117
|
get: function() {
|
package/cjs/ui.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import {
|
|
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,
|
|
1
|
+
import { $ as MediaPlayback, A as CustomUploadContext, B as isFileAccepted, C as formatMessage, D as resolveMessages, E as getUploadItemOutcome, F as UploadFile, G as AssetImageSource, H as AssetDisplay, I as UploadItem, J as AssetSessionState, K as AssetOptions, L as UploadSnapshot, M as UploadClient, N as UploadController, O as CalmLensProvidedOptions, P as UploadControllerOptions, Q as INSTANT_LOAD_MS, R as UploadStage, S as formatBytes, T as getUploadItemMessage, U as AssetDocumentOptions, V as withProvidedOptions, W as AssetImageOptions, X as AssetVideoOptions, Y as AssetSpreadsheetOptions, Z as AssetView, _ as DEFAULT_MESSAGES, _t as DEFAULT_VIEWER_MESSAGES, a as ProgressFetchOptions, at as isImageReady, b as describeUploadItem, bt as resolveViewerMessages, c as ICON_ATTRIBUTES, ct as DocumentViewerOptions, d as AssetDisplayOptions, dt as TextViewerOptions, et as getAssetAspectRatio, f as AssetEventHandlers, ft as ViewerAsset, g as CalmLensMessages, gt as isSpreadsheetFormat, h as UploaderProps, ht as getAssetViewerKind, i as CALMLENS_STYLES, it as getPlayedPercent, j as CustomUploadResult, k as CalmLensUpload, l as IconName, lt as PdfAssetOptions, m as UploaderDisplayOptions, mt as ViewerTextOptions, n as CalmLensTheme, nt as getAssetViewKey, o as createProgressFetch, ot as pickAssetSource, p as AssetProps, pt as ViewerOptions, q as AssetSession, r as resolveTheme, rt as getPeakHeights, s as ICONS, st as AssetViewerKind, t as CALMLENS_THEME, tt as getAssetView, u as ASSET_FILE_ICON_SIZE, ut as SpreadsheetViewerOptions, v as UploadItemView, vt as ViewerMessages, w as getDropzoneHint, x as describeUploader, y as UploaderView, yt as formatViewerMessage, z as createUploadController } from "./Core-Dhijt6JU.js";
|
|
2
|
+
import { _ as spreadsheetColumnIndex, a as isMountedViewerKind, b as AssetViewer, c as AssetViewerOptionsByKind, d as createTextViewer, f as SpreadsheetCell, g as parseSpreadsheetText, h as getSpreadsheetPage, i as getMountedViewerOptions, l as VIEWER_STYLES, m as SpreadsheetSheet, n as AssetViewerMount, o as ASSET_VIEWERS, p as SpreadsheetRow, r as MountedViewerKind, s as AssetViewerName, t as MediaStreamPlayer, u as createSpreadsheetViewer, v as loadPdfJs, x as ViewerState, y as createDocumentViewer } from "./ui-BSm_qphN.js";
|
|
3
|
+
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
|
|
4
|
-
const
|
|
2
|
+
const require_ui = require("./ui-C1_SDSiq.js");
|
|
3
|
+
const require_Core = require("./Core-52DVaX7d.js");
|
|
4
|
+
const require_UploadController = require("./UploadController-ChzDPMmm.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;
|
|
@@ -12,16 +12,15 @@ exports.DEFAULT_MESSAGES = require_Core.DEFAULT_MESSAGES;
|
|
|
12
12
|
exports.DEFAULT_VIEWER_MESSAGES = require_ui.DEFAULT_VIEWER_MESSAGES;
|
|
13
13
|
exports.ICONS = require_Core.ICONS;
|
|
14
14
|
exports.ICON_ATTRIBUTES = require_Core.ICON_ATTRIBUTES;
|
|
15
|
+
exports.INSTANT_LOAD_MS = require_Core.INSTANT_LOAD_MS;
|
|
15
16
|
exports.MediaStreamPlayer = require_ui.MediaStreamPlayer;
|
|
16
17
|
exports.UploadController = require_UploadController.UploadController;
|
|
17
18
|
exports.VIEWER_STYLES = require_Core.VIEWER_STYLES;
|
|
18
19
|
exports.createDocumentViewer = require_ui.createDocumentViewer;
|
|
19
|
-
exports.createImageViewer = require_ui.createImageViewer;
|
|
20
20
|
exports.createProgressFetch = require_UploadController.createProgressFetch;
|
|
21
21
|
exports.createSpreadsheetViewer = require_ui.createSpreadsheetViewer;
|
|
22
22
|
exports.createTextViewer = require_ui.createTextViewer;
|
|
23
23
|
exports.createUploadController = require_UploadController.createUploadController;
|
|
24
|
-
exports.createWebsiteViewer = require_ui.createWebsiteViewer;
|
|
25
24
|
exports.describeUploadItem = require_Core.describeUploadItem;
|
|
26
25
|
exports.describeUploader = require_Core.describeUploader;
|
|
27
26
|
exports.formatBytes = require_Core.formatBytes;
|
|
@@ -39,6 +38,7 @@ exports.getSpreadsheetPage = require_ui.getSpreadsheetPage;
|
|
|
39
38
|
exports.getUploadItemMessage = require_Core.getUploadItemMessage;
|
|
40
39
|
exports.getUploadItemOutcome = require_Core.getUploadItemOutcome;
|
|
41
40
|
exports.isFileAccepted = require_UploadController.isFileAccepted;
|
|
41
|
+
exports.isImageReady = require_Core.isImageReady;
|
|
42
42
|
exports.isMountedViewerKind = require_ui.isMountedViewerKind;
|
|
43
43
|
exports.isSpreadsheetFormat = require_Core.isSpreadsheetFormat;
|
|
44
44
|
exports.loadPdfJs = require_ui.loadPdfJs;
|