calmlens 0.38.0 → 0.38.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.
Files changed (82) hide show
  1. package/bin/calmlens.js +79 -15
  2. package/cjs/{BrowserUpload-BO_ZukUM.js → BrowserUpload-DS0lxg5C.js} +1 -1
  3. package/{esm/BrowserUpload-BuTS7yTy.d.ts → cjs/BrowserUpload-_iMX_nq0.d.ts} +2 -2
  4. package/{esm/CalmLensAppClient-L5x_sMOI.d.ts → cjs/CalmLensAppClient-CQpnc4JZ.d.ts} +1 -1
  5. package/cjs/{CalmLensAppClient-DoNMg8Dh.js → CalmLensAppClient-Diu1QtBz.js} +2 -2
  6. package/cjs/{CalmLensCdn-B_Tbwq10.js → CalmLensCdn-DCj0AfoS.js} +1 -1
  7. package/cjs/{CalmLensConnection-Dhg1amnb.js → CalmLensConnection-BpBq0nQR.js} +13 -3
  8. package/cjs/{CalmLensServerClient-2H0ZpJlr.d.ts → CalmLensServerClient-CeTsE5Jx.d.ts} +2 -2
  9. package/cjs/{CalmLensServerClient-D0wCcQNn.js → CalmLensServerClient-vdHfH0Nf.js} +2 -2
  10. package/cjs/{CalmLensTypes-CCsoVr39.d.ts → CalmLensTypes-jond9q6a.d.ts} +24 -5
  11. package/cjs/{Core-iNgZ8Cij.js → Core-BHQSo7rY.js} +2 -2
  12. package/cjs/{Core-B110Ug8_.d.ts → Core-C6_Q5ZME.d.ts} +2 -2
  13. package/cjs/{ReactUpload-BS8bYIhv.js → ReactUpload-bbHMmEUQ.js} +1 -1
  14. package/{esm/ReactUpload-CbtQtN6v.d.ts → cjs/ReactUpload-fy6zhY8M.d.ts} +1 -1
  15. package/cjs/{UploadController-CVKtUCK0.js → UploadController-C1tiTTRR.js} +1 -1
  16. package/{esm/WebhookPayload-_fvY2eu8.d.ts → cjs/WebhookPayload-DdpKjQGw.d.ts} +1 -1
  17. package/cjs/app.d.ts +4 -4
  18. package/cjs/app.js +2 -2
  19. package/cjs/elements.d.ts +4 -4
  20. package/cjs/elements.js +4 -4
  21. package/cjs/{index-Dk3I5YXf.d.ts → index-CgAztQdX.d.ts} +2 -2
  22. package/cjs/index.d.ts +3 -3
  23. package/cjs/index.js +1 -1
  24. package/cjs/react-native.d.ts +2 -2
  25. package/cjs/react-native.js +4 -4
  26. package/cjs/react.d.ts +4 -4
  27. package/cjs/react.js +5 -5
  28. package/cjs/server.d.ts +4 -4
  29. package/cjs/server.js +2 -2
  30. package/cjs/{test-inputs-BVJZjtFd.js → test-inputs-DJnupsBH.js} +79 -10
  31. package/cjs/{test-inputs-JaZaV9Up.d.ts → test-inputs-fugEK0py.d.ts} +17 -142
  32. package/cjs/test-inputs.d.ts +2 -2
  33. package/cjs/test-inputs.js +3 -1
  34. package/cjs/testing.d.ts +5 -5
  35. package/cjs/testing.js +9 -8
  36. package/cjs/{ui-CuO37F4u.js → ui-2jJvTcCP.js} +2 -2
  37. package/cjs/{ui--E_s-cDd.d.ts → ui-Cp18fGXG.d.ts} +2 -2
  38. package/cjs/ui.d.ts +2 -2
  39. package/cjs/ui.js +3 -3
  40. package/cjs/vue.d.ts +5 -5
  41. package/cjs/vue.js +4 -4
  42. package/esm/{BrowserUpload-DxgiUXC2.js → BrowserUpload-C4YF17a3.js} +1 -1
  43. package/{cjs/BrowserUpload-BuTS7yTy.d.ts → esm/BrowserUpload-_iMX_nq0.d.ts} +2 -2
  44. package/esm/{CalmLensAppClient-C7ScAfRx.js → CalmLensAppClient-B2H7x_SJ.js} +2 -2
  45. package/{cjs/CalmLensAppClient-L5x_sMOI.d.ts → esm/CalmLensAppClient-CQpnc4JZ.d.ts} +1 -1
  46. package/esm/{CalmLensCdn-CW5Fn3ph.js → CalmLensCdn-Dh546rXe.js} +1 -1
  47. package/esm/{CalmLensConnection-Blv8JyLF.js → CalmLensConnection-BbFlVAdl.js} +13 -3
  48. package/esm/{CalmLensServerClient-2H0ZpJlr.d.ts → CalmLensServerClient-CeTsE5Jx.d.ts} +2 -2
  49. package/esm/{CalmLensServerClient-C7n6EzVd.js → CalmLensServerClient-CqH-tqcC.js} +2 -2
  50. package/esm/{CalmLensTypes-CCsoVr39.d.ts → CalmLensTypes-jond9q6a.d.ts} +24 -5
  51. package/esm/{Core-B110Ug8_.d.ts → Core-C6_Q5ZME.d.ts} +2 -2
  52. package/esm/{Core-BRrPxS4i.js → Core-VNBTpvrG.js} +2 -2
  53. package/esm/{ReactUpload-BGPktblV.js → ReactUpload-CRH6rSaX.js} +1 -1
  54. package/{cjs/ReactUpload-CbtQtN6v.d.ts → esm/ReactUpload-fy6zhY8M.d.ts} +1 -1
  55. package/esm/{UploadController-CQ4NouIU.js → UploadController-BYxiONcw.js} +1 -1
  56. package/{cjs/WebhookPayload-_fvY2eu8.d.ts → esm/WebhookPayload-DdpKjQGw.d.ts} +1 -1
  57. package/esm/app.d.ts +4 -4
  58. package/esm/app.js +2 -2
  59. package/esm/elements.d.ts +4 -4
  60. package/esm/elements.js +4 -4
  61. package/esm/{index-Dk3I5YXf.d.ts → index-CgAztQdX.d.ts} +2 -2
  62. package/esm/index.d.ts +3 -3
  63. package/esm/index.js +1 -1
  64. package/esm/react-native.d.ts +2 -2
  65. package/esm/react-native.js +4 -4
  66. package/esm/react.d.ts +4 -4
  67. package/esm/react.js +5 -5
  68. package/esm/server.d.ts +4 -4
  69. package/esm/server.js +2 -2
  70. package/esm/{test-inputs-DizPp8_w.js → test-inputs-BLlkOmNC.js} +68 -11
  71. package/esm/{test-inputs-JaZaV9Up.d.ts → test-inputs-fugEK0py.d.ts} +17 -142
  72. package/esm/test-inputs.d.ts +2 -2
  73. package/esm/test-inputs.js +1 -1
  74. package/esm/testing.d.ts +5 -5
  75. package/esm/testing.js +9 -8
  76. package/esm/{ui--E_s-cDd.d.ts → ui-Cp18fGXG.d.ts} +2 -2
  77. package/esm/{ui-B-QOHuVI.js → ui-siBYiNJZ.js} +2 -2
  78. package/esm/ui.d.ts +2 -2
  79. package/esm/ui.js +3 -3
  80. package/esm/vue.d.ts +5 -5
  81. package/esm/vue.js +4 -4
  82. package/package.json +1 -1
@@ -135,7 +135,7 @@ Object.keys(JURISDICTIONS).filter((code) => !JURISDICTIONS[code].optional);
135
135
  Object.keys(JURISDICTIONS).filter((code) => JURISDICTIONS[code].optional);
136
136
  new Set("AD AE AF AG AI AL AM AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BJ BL BM BN BO BQ BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CW CX CY CZ DE DJ DK DM DO DZ EC EE EG EH ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR SS ST SV SX SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS YE YT ZA ZM ZW".split(" "));
137
137
  const EU_COUNTRIES = new Set("AT BE BG HR CY CZ DK EE FI FR DE GR HU IE IT LV LT LU MT NL PL PT RO SK SI ES SE".split(" "));
138
- // src/contract/TestRegionalActions-Ce8EVv4q.js
138
+ // src/contract/TestRegionalActions-BAzqFJfV.js
139
139
  /**
140
140
  * Marks English text in shared, backend and data modules that the portal shows, so the app's
141
141
  * message catalog (packages/app/vite/messageCatalog.ts) extracts it and the portal can translate it
@@ -1150,13 +1150,15 @@ const MODERATION_QUALIFIER_INFO = {
1150
1150
  }
1151
1151
  };
1152
1152
  const MODERATION_QUALIFIERS = Object.keys(MODERATION_QUALIFIER_INFO);
1153
- MODERATION_QUALIFIERS.reduce((groups, qualifier) => {
1153
+ const MODERATION_QUALIFIERS_BY_CATEGORY = MODERATION_QUALIFIERS.reduce((groups, qualifier) => {
1154
1154
  (groups[MODERATION_QUALIFIER_INFO[qualifier].category] ??= []).push(qualifier);
1155
1155
  return groups;
1156
1156
  }, {});
1157
- function getModerationQualifierInfo(qualifier) {
1158
- return MODERATION_QUALIFIER_INFO[qualifier];
1157
+ /** A qualifier the input type sets (`fromInput`), which no model is asked about. */
1158
+ function isInputQualifier(qualifier) {
1159
+ return MODERATION_QUALIFIER_INFO[qualifier].fromInput === true;
1159
1160
  }
1161
+ const getModerationQualifiers = (category) => MODERATION_QUALIFIERS_BY_CATEGORY[category] ?? [];
1160
1162
  /** Authenticated test inputs can add regional delivery restrictions without inventing evidence. */
1161
1163
  const TEST_REGIONAL_ACTIONS_SCHEMA = /* @__PURE__ */ lazySchema(() => z.array(z.object({
1162
1164
  region: JURISDICTION_SCHEMA.exclude(["global"]),
@@ -1166,7 +1168,7 @@ const TEST_REGIONAL_ACTIONS_SCHEMA = /* @__PURE__ */ lazySchema(() => z.array(z.
1166
1168
  "block"
1167
1169
  ])
1168
1170
  }).strict()).max(7).refine((entries) => new Set(entries.map((entry) => entry.region)).size === entries.length, "Choose each region once"));
1169
- // src/contract/TestTriggers-uL2Ec8Vt.js
1171
+ // src/contract/TestTriggers-ByQZ27Zp.js
1170
1172
  /**
1171
1173
  * The visual encoding of test images (shared by images and video frames), independent of what the
1172
1174
  * bytes mean. An odd N×N grid of square cells fills the image. Its outer ring alternates black and
@@ -1652,6 +1654,22 @@ const TEST_DETECTIONS_SCHEMA = /* @__PURE__ */ lazySchema(() => z.object({
1652
1654
  people: z.union([z.array(TEST_DETECTED_PERSON_SCHEMA).max(32), z.literal("unavailable")]).optional(),
1653
1655
  faces: z.union([z.array(TEST_DETECTED_FACE_SCHEMA).max(32), z.literal("unavailable")]).optional()
1654
1656
  }).strict());
1657
+ /**
1658
+ * Why a test input's qualifier is refused: each zod issue's `params` carry the `category`,
1659
+ * `qualifier` and `reason`, and `allowed` (the category's qualifiers) for an unknown one.
1660
+ */
1661
+ const TEST_INPUT_QUALIFIER_ERRORS = {
1662
+ /** Not a qualifier of the instance's category. */
1663
+ unknown: "unknown-qualifier",
1664
+ /** A qualifier the input type sets, such as `sexual-text`. */
1665
+ automatic: "input-type-qualifier",
1666
+ /** Given more than once in one instance. */
1667
+ repeated: "repeated-qualifier"
1668
+ };
1669
+ const isKnownQualifier = (qualifier) => MODERATION_QUALIFIERS.includes(qualifier);
1670
+ const isCategoryQualifier = (category, qualifier) => getModerationQualifiers(category).includes(qualifier);
1671
+ /** The qualifiers a test input may give for `category`: its own, less those the input type sets. */
1672
+ const getTestInputQualifiers = (category) => getModerationQualifiers(category).filter((qualifier) => !isInputQualifier(qualifier));
1655
1673
  /** Each row is one qualifying instance. Unselected qualifiers are explicitly absent. */
1656
1674
  const TEST_INPUT_SCHEMA = /* @__PURE__ */ lazySchema(() => z.object({
1657
1675
  regionalActions: TEST_REGIONAL_ACTIONS_SCHEMA.optional(),
@@ -1664,11 +1682,46 @@ const TEST_INPUT_SCHEMA = /* @__PURE__ */ lazySchema(() => z.object({
1664
1682
  "age-restrict",
1665
1683
  "block"
1666
1684
  ]).optional(),
1667
- qualifiers: z.array(z.enum(MODERATION_QUALIFIERS)).max(64)
1685
+ qualifiers: z.array(z.custom((value) => typeof value === "string", { message: "A qualifier is a string, such as harassment-abuse." })).max(64)
1668
1686
  }).strict().superRefine((instance, context) => {
1669
- if (new Set(instance.qualifiers).size !== instance.qualifiers.length || instance.qualifiers.some((q) => getModerationQualifierInfo(q).category !== instance.category || "fromInput" in getModerationQualifierInfo(q))) context.addIssue({
1670
- code: "custom",
1671
- message: "Choose unique content qualifiers from this category; input-type facts are automatic."
1687
+ const seen = /* @__PURE__ */ new Set();
1688
+ instance.qualifiers.forEach((qualifier, index) => {
1689
+ const path = ["qualifiers", index];
1690
+ const details = {
1691
+ category: instance.category,
1692
+ qualifier
1693
+ };
1694
+ if (isKnownQualifier(qualifier) && isInputQualifier(qualifier)) context.addIssue({
1695
+ code: "custom",
1696
+ path,
1697
+ params: {
1698
+ ...details,
1699
+ reason: TEST_INPUT_QUALIFIER_ERRORS.automatic
1700
+ },
1701
+ message: `"${qualifier}" is set by the input type: leave it out.`
1702
+ });
1703
+ else if (!isCategoryQualifier(instance.category, qualifier)) {
1704
+ const allowed = getTestInputQualifiers(instance.category);
1705
+ context.addIssue({
1706
+ code: "custom",
1707
+ path,
1708
+ params: {
1709
+ ...details,
1710
+ reason: TEST_INPUT_QUALIFIER_ERRORS.unknown,
1711
+ allowed
1712
+ },
1713
+ message: `Unknown ${instance.category} qualifier "${qualifier}": choose from ${allowed.join(", ")}.`
1714
+ });
1715
+ } else if (seen.has(qualifier)) context.addIssue({
1716
+ code: "custom",
1717
+ path,
1718
+ params: {
1719
+ ...details,
1720
+ reason: TEST_INPUT_QUALIFIER_ERRORS.repeated
1721
+ },
1722
+ message: `"${qualifier}" is repeated: give each qualifier once.`
1723
+ });
1724
+ seen.add(qualifier);
1672
1725
  });
1673
1726
  })).max(128),
1674
1727
  detections: TEST_DETECTIONS_SCHEMA.optional()
@@ -1972,7 +2025,11 @@ async function withValidTestInputArguments(key, generate) {
1972
2025
  if (error instanceof z.ZodError) {
1973
2026
  const [issue] = error.issues;
1974
2027
  const path = (issue?.path ?? []).map((segment) => typeof segment === "number" ? segment : String(segment));
1975
- throw invalidArgument(`Invalid test scenario at ${path.length ? path.join(".") : "scenario"}: ${issue?.message ?? error.message}`, { path });
2028
+ const qualifier = issue?.code === "custom" && typeof issue.params?.reason === "string" ? issue.params : {};
2029
+ throw invalidArgument(`Invalid test scenario at ${path.length ? path.join(".") : "scenario"}: ${issue?.message ?? error.message}`, {
2030
+ path,
2031
+ ...qualifier
2032
+ });
1976
2033
  }
1977
2034
  if (error instanceof RangeError) throw invalidArgument(error.message);
1978
2035
  throw error;
@@ -2118,4 +2175,4 @@ const paintTestImage = async (scenario, key) => {
2118
2175
  png: encodeTestImagePng(image.width, image.height, image.rgba)
2119
2176
  };
2120
2177
  };
2121
- export { CLASSIFICATION_CATEGORIES as _, TEST_DETECTIONS_MAX as a, TEST_FACE_AGE_PRESETS as c, detectTestImage as d, detectTestTrigger as f, lazySchema as g, EU_COUNTRIES as h, MEDIA_TEST_SIGNALS as i, TEST_INPUT_KEY_PATTERN as l, testInputForSignal as m, generateTestTextCode as n, TEST_DETECTION_BOX_MAX as o, getImageTestCategories as p, paintTestImage as r, TEST_FACE_AGE_MAX as s, generateMediaTestCode as t, TEST_INPUT_PRESETS as u };
2178
+ export { EU_COUNTRIES as _, TEST_DETECTIONS_MAX as a, TEST_FACE_AGE_PRESETS as c, TEST_INPUT_QUALIFIER_ERRORS as d, detectTestImage as f, testInputForSignal as g, getTestInputQualifiers as h, MEDIA_TEST_SIGNALS as i, TEST_INPUT_KEY_PATTERN as l, getImageTestCategories as m, generateTestTextCode as n, TEST_DETECTION_BOX_MAX as o, detectTestTrigger as p, paintTestImage as r, TEST_FACE_AGE_MAX as s, generateMediaTestCode as t, TEST_INPUT_PRESETS as u, lazySchema as v, CLASSIFICATION_CATEGORIES as y };
@@ -1,4 +1,4 @@
1
- import { n as ClassificationCategory } from "./Classification-C3pkrGYS-B7EygpJn.js";
1
+ import { n as ClassificationCategory, s as ModerationQualifier } from "./Classification-C3pkrGYS-B7EygpJn.js";
2
2
  import * as z from "zod";
3
3
  interface RgbaImage {
4
4
  width: number;
@@ -46,6 +46,20 @@ declare const TEST_DETECTIONS_SCHEMA: z.ZodObject<{
46
46
  }, z.core.$strict>>, z.ZodLiteral<"unavailable">]>>;
47
47
  }, z.core.$strict>;
48
48
  type TestDetections = z.infer<typeof TEST_DETECTIONS_SCHEMA>;
49
+ /**
50
+ * Why a test input's qualifier is refused: each zod issue's `params` carry the `category`,
51
+ * `qualifier` and `reason`, and `allowed` (the category's qualifiers) for an unknown one.
52
+ */
53
+ declare const TEST_INPUT_QUALIFIER_ERRORS: {
54
+ /** Not a qualifier of the instance's category. */
55
+ readonly unknown: "unknown-qualifier";
56
+ /** A qualifier the input type sets, such as `sexual-text`. */
57
+ readonly automatic: "input-type-qualifier";
58
+ /** Given more than once in one instance. */
59
+ readonly repeated: "repeated-qualifier";
60
+ };
61
+ /** The qualifiers a test input may give for `category`: its own, less those the input type sets. */
62
+ declare const getTestInputQualifiers: (category: string) => ModerationQualifier[];
49
63
  /** Each row is one qualifying instance. Unselected qualifiers are explicitly absent. */
50
64
  declare const TEST_INPUT_SCHEMA: z.ZodObject<{
51
65
  regionalActions: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -91,146 +105,7 @@ declare const TEST_INPUT_SCHEMA: z.ZodObject<{
91
105
  block: "block";
92
106
  limit: "limit";
93
107
  }>>;
94
- qualifiers: z.ZodArray<z.ZodEnum<{
95
- "criminal-activity-alcohol": "criminal-activity-alcohol";
96
- "criminal-activity-coded-incitement": "criminal-activity-coded-incitement";
97
- "criminal-activity-csam": "criminal-activity-csam";
98
- "criminal-activity-demonstration": "criminal-activity-demonstration";
99
- "criminal-activity-discussion": "criminal-activity-discussion";
100
- "criminal-activity-documentary": "criminal-activity-documentary";
101
- "criminal-activity-educational": "criminal-activity-educational";
102
- "criminal-activity-fictional": "criminal-activity-fictional";
103
- "criminal-activity-fraud": "criminal-activity-fraud";
104
- "criminal-activity-gambling": "criminal-activity-gambling";
105
- "criminal-activity-graffiti": "criminal-activity-graffiti";
106
- "criminal-activity-grooming": "criminal-activity-grooming";
107
- "criminal-activity-historical": "criminal-activity-historical";
108
- "criminal-activity-instructions": "criminal-activity-instructions";
109
- "criminal-activity-preparation": "criminal-activity-preparation";
110
- "criminal-activity-promotion": "criminal-activity-promotion";
111
- "criminal-activity-request": "criminal-activity-request";
112
- "criminal-activity-sexual-solicitation": "criminal-activity-sexual-solicitation";
113
- "criminal-activity-substances": "criminal-activity-substances";
114
- "criminal-activity-support-prevention": "criminal-activity-support-prevention";
115
- "criminal-activity-tobacco": "criminal-activity-tobacco";
116
- "harassment-abuse": "harassment-abuse";
117
- "harassment-bullying": "harassment-bullying";
118
- "harassment-documentary": "harassment-documentary";
119
- "harassment-educational": "harassment-educational";
120
- "harassment-encouragement": "harassment-encouragement";
121
- "harassment-fictional": "harassment-fictional";
122
- "harassment-historical": "harassment-historical";
123
- "harassment-mild": "harassment-mild";
124
- "harassment-public-target": "harassment-public-target";
125
- "harassment-sexual": "harassment-sexual";
126
- "harassment-support-prevention": "harassment-support-prevention";
127
- "harassment-threat": "harassment-threat";
128
- "hate-abuse": "hate-abuse";
129
- "hate-adjudicated-nazi-crimes-denial": "hate-adjudicated-nazi-crimes-denial";
130
- "hate-counterspeech": "hate-counterspeech";
131
- "hate-dehumanization": "hate-dehumanization";
132
- "hate-documentary": "hate-documentary";
133
- "hate-educational": "hate-educational";
134
- "hate-exclusion": "hate-exclusion";
135
- "hate-fictional": "hate-fictional";
136
- "hate-historical": "hate-historical";
137
- "hate-hostility": "hate-hostility";
138
- "hate-inferiority": "hate-inferiority";
139
- "hate-nazi-genocide-denial-or-approval": "hate-nazi-genocide-denial-or-approval";
140
- "hate-nazi-genocide-public-peace": "hate-nazi-genocide-public-peace";
141
- "hate-nazi-insignia-public-display": "hate-nazi-insignia-public-display";
142
- "hate-nazi-symbols-public-display": "hate-nazi-symbols-public-display";
143
- "hate-personal": "hate-personal";
144
- "hate-slurs": "hate-slurs";
145
- "hate-support-prevention": "hate-support-prevention";
146
- "hate-symbol": "hate-symbol";
147
- "hate-threat": "hate-threat";
148
- "personal-information-contact": "personal-information-contact";
149
- "personal-information-credentials": "personal-information-credentials";
150
- "personal-information-documentary": "personal-information-documentary";
151
- "personal-information-educational": "personal-information-educational";
152
- "personal-information-email": "personal-information-email";
153
- "personal-information-fictional": "personal-information-fictional";
154
- "personal-information-financial": "personal-information-financial";
155
- "personal-information-government-id": "personal-information-government-id";
156
- "personal-information-historical": "personal-information-historical";
157
- "personal-information-identifiers": "personal-information-identifiers";
158
- "personal-information-location": "personal-information-location";
159
- "personal-information-phone": "personal-information-phone";
160
- "personal-information-request": "personal-information-request";
161
- "personal-information-self-disclosure": "personal-information-self-disclosure";
162
- "personal-information-support-prevention": "personal-information-support-prevention";
163
- "personal-information-third-party": "personal-information-third-party";
164
- "profanity-documentary": "profanity-documentary";
165
- "profanity-educational": "profanity-educational";
166
- "profanity-fictional": "profanity-fictional";
167
- "profanity-historical": "profanity-historical";
168
- "profanity-mild": "profanity-mild";
169
- "profanity-obfuscated": "profanity-obfuscated";
170
- "profanity-slurs": "profanity-slurs";
171
- "profanity-strong": "profanity-strong";
172
- "profanity-support-prevention": "profanity-support-prevention";
173
- "self-harm-act": "self-harm-act";
174
- "self-harm-age-restricted": "self-harm-age-restricted";
175
- "self-harm-documentary": "self-harm-documentary";
176
- "self-harm-educational": "self-harm-educational";
177
- "self-harm-encouragement": "self-harm-encouragement";
178
- "self-harm-fictional": "self-harm-fictional";
179
- "self-harm-historical": "self-harm-historical";
180
- "self-harm-methods": "self-harm-methods";
181
- "self-harm-preparation": "self-harm-preparation";
182
- "self-harm-support-prevention": "self-harm-support-prevention";
183
- "self-harm-thoughts": "self-harm-thoughts";
184
- "sexual-activity": "sexual-activity";
185
- "sexual-adult-promotion": "sexual-adult-promotion";
186
- "sexual-artistic": "sexual-artistic";
187
- "sexual-assault-media": "sexual-assault-media";
188
- "sexual-discussion": "sexual-discussion";
189
- "sexual-documentary": "sexual-documentary";
190
- "sexual-educational": "sexual-educational";
191
- "sexual-explicit-language": "sexual-explicit-language";
192
- "sexual-extreme": "sexual-extreme";
193
- "sexual-fictional": "sexual-fictional";
194
- "sexual-historical": "sexual-historical";
195
- "sexual-incest": "sexual-incest";
196
- "sexual-intimate-image-abuse": "sexual-intimate-image-abuse";
197
- "sexual-minors": "sexual-minors";
198
- "sexual-non-consensual": "sexual-non-consensual";
199
- "sexual-non-erotic-nudity": "sexual-non-erotic-nudity";
200
- "sexual-nudity": "sexual-nudity";
201
- "sexual-paid": "sexual-paid";
202
- "sexual-pornographic-media": "sexual-pornographic-media";
203
- "sexual-revealing-clothing": "sexual-revealing-clothing";
204
- "sexual-solicitation": "sexual-solicitation";
205
- "sexual-strangulation": "sexual-strangulation";
206
- "sexual-suggestive": "sexual-suggestive";
207
- "sexual-support-prevention": "sexual-support-prevention";
208
- "sexual-text": "sexual-text";
209
- "violence-attack": "violence-attack";
210
- "violence-coded-incitement": "violence-coded-incitement";
211
- "violence-decapitation-act": "violence-decapitation-act";
212
- "violence-discussion": "violence-discussion";
213
- "violence-documentary": "violence-documentary";
214
- "violence-educational": "violence-educational";
215
- "violence-encouragement": "violence-encouragement";
216
- "violence-extremism": "violence-extremism";
217
- "violence-fantasy": "violence-fantasy";
218
- "violence-fictional": "violence-fictional";
219
- "violence-gore": "violence-gore";
220
- "violence-graphic": "violence-graphic";
221
- "violence-high-impact": "violence-high-impact";
222
- "violence-historical": "violence-historical";
223
- "violence-injury": "violence-injury";
224
- "violence-natural-death": "violence-natural-death";
225
- "violence-preparation": "violence-preparation";
226
- "violence-sport": "violence-sport";
227
- "violence-support-prevention": "violence-support-prevention";
228
- "violence-text": "violence-text";
229
- "violence-threat": "violence-threat";
230
- "violence-violent-death": "violence-violent-death";
231
- "violence-weapon": "violence-weapon";
232
- "violence-wish": "violence-wish";
233
- }>>;
108
+ qualifiers: z.ZodArray<z.ZodCustom<"criminal-activity-alcohol" | "criminal-activity-coded-incitement" | "criminal-activity-csam" | "criminal-activity-demonstration" | "criminal-activity-discussion" | "criminal-activity-documentary" | "criminal-activity-educational" | "criminal-activity-fictional" | "criminal-activity-fraud" | "criminal-activity-gambling" | "criminal-activity-graffiti" | "criminal-activity-grooming" | "criminal-activity-historical" | "criminal-activity-instructions" | "criminal-activity-preparation" | "criminal-activity-promotion" | "criminal-activity-request" | "criminal-activity-sexual-solicitation" | "criminal-activity-substances" | "criminal-activity-support-prevention" | "criminal-activity-tobacco" | "harassment-abuse" | "harassment-bullying" | "harassment-documentary" | "harassment-educational" | "harassment-encouragement" | "harassment-fictional" | "harassment-historical" | "harassment-mild" | "harassment-public-target" | "harassment-sexual" | "harassment-support-prevention" | "harassment-threat" | "hate-abuse" | "hate-adjudicated-nazi-crimes-denial" | "hate-counterspeech" | "hate-dehumanization" | "hate-documentary" | "hate-educational" | "hate-exclusion" | "hate-fictional" | "hate-historical" | "hate-hostility" | "hate-inferiority" | "hate-nazi-genocide-denial-or-approval" | "hate-nazi-genocide-public-peace" | "hate-nazi-insignia-public-display" | "hate-nazi-symbols-public-display" | "hate-personal" | "hate-slurs" | "hate-support-prevention" | "hate-symbol" | "hate-threat" | "personal-information-contact" | "personal-information-credentials" | "personal-information-documentary" | "personal-information-educational" | "personal-information-email" | "personal-information-fictional" | "personal-information-financial" | "personal-information-government-id" | "personal-information-historical" | "personal-information-identifiers" | "personal-information-location" | "personal-information-phone" | "personal-information-request" | "personal-information-self-disclosure" | "personal-information-support-prevention" | "personal-information-third-party" | "profanity-documentary" | "profanity-educational" | "profanity-fictional" | "profanity-historical" | "profanity-mild" | "profanity-obfuscated" | "profanity-slurs" | "profanity-strong" | "profanity-support-prevention" | "self-harm-act" | "self-harm-age-restricted" | "self-harm-documentary" | "self-harm-educational" | "self-harm-encouragement" | "self-harm-fictional" | "self-harm-historical" | "self-harm-methods" | "self-harm-preparation" | "self-harm-support-prevention" | "self-harm-thoughts" | "sexual-activity" | "sexual-adult-promotion" | "sexual-artistic" | "sexual-assault-media" | "sexual-discussion" | "sexual-documentary" | "sexual-educational" | "sexual-explicit-language" | "sexual-extreme" | "sexual-fictional" | "sexual-historical" | "sexual-incest" | "sexual-intimate-image-abuse" | "sexual-minors" | "sexual-non-consensual" | "sexual-non-erotic-nudity" | "sexual-nudity" | "sexual-paid" | "sexual-pornographic-media" | "sexual-revealing-clothing" | "sexual-solicitation" | "sexual-strangulation" | "sexual-suggestive" | "sexual-support-prevention" | "sexual-text" | "violence-attack" | "violence-coded-incitement" | "violence-decapitation-act" | "violence-discussion" | "violence-documentary" | "violence-educational" | "violence-encouragement" | "violence-extremism" | "violence-fantasy" | "violence-fictional" | "violence-gore" | "violence-graphic" | "violence-high-impact" | "violence-historical" | "violence-injury" | "violence-natural-death" | "violence-preparation" | "violence-sport" | "violence-support-prevention" | "violence-text" | "violence-threat" | "violence-violent-death" | "violence-weapon" | "violence-wish", "criminal-activity-alcohol" | "criminal-activity-coded-incitement" | "criminal-activity-csam" | "criminal-activity-demonstration" | "criminal-activity-discussion" | "criminal-activity-documentary" | "criminal-activity-educational" | "criminal-activity-fictional" | "criminal-activity-fraud" | "criminal-activity-gambling" | "criminal-activity-graffiti" | "criminal-activity-grooming" | "criminal-activity-historical" | "criminal-activity-instructions" | "criminal-activity-preparation" | "criminal-activity-promotion" | "criminal-activity-request" | "criminal-activity-sexual-solicitation" | "criminal-activity-substances" | "criminal-activity-support-prevention" | "criminal-activity-tobacco" | "harassment-abuse" | "harassment-bullying" | "harassment-documentary" | "harassment-educational" | "harassment-encouragement" | "harassment-fictional" | "harassment-historical" | "harassment-mild" | "harassment-public-target" | "harassment-sexual" | "harassment-support-prevention" | "harassment-threat" | "hate-abuse" | "hate-adjudicated-nazi-crimes-denial" | "hate-counterspeech" | "hate-dehumanization" | "hate-documentary" | "hate-educational" | "hate-exclusion" | "hate-fictional" | "hate-historical" | "hate-hostility" | "hate-inferiority" | "hate-nazi-genocide-denial-or-approval" | "hate-nazi-genocide-public-peace" | "hate-nazi-insignia-public-display" | "hate-nazi-symbols-public-display" | "hate-personal" | "hate-slurs" | "hate-support-prevention" | "hate-symbol" | "hate-threat" | "personal-information-contact" | "personal-information-credentials" | "personal-information-documentary" | "personal-information-educational" | "personal-information-email" | "personal-information-fictional" | "personal-information-financial" | "personal-information-government-id" | "personal-information-historical" | "personal-information-identifiers" | "personal-information-location" | "personal-information-phone" | "personal-information-request" | "personal-information-self-disclosure" | "personal-information-support-prevention" | "personal-information-third-party" | "profanity-documentary" | "profanity-educational" | "profanity-fictional" | "profanity-historical" | "profanity-mild" | "profanity-obfuscated" | "profanity-slurs" | "profanity-strong" | "profanity-support-prevention" | "self-harm-act" | "self-harm-age-restricted" | "self-harm-documentary" | "self-harm-educational" | "self-harm-encouragement" | "self-harm-fictional" | "self-harm-historical" | "self-harm-methods" | "self-harm-preparation" | "self-harm-support-prevention" | "self-harm-thoughts" | "sexual-activity" | "sexual-adult-promotion" | "sexual-artistic" | "sexual-assault-media" | "sexual-discussion" | "sexual-documentary" | "sexual-educational" | "sexual-explicit-language" | "sexual-extreme" | "sexual-fictional" | "sexual-historical" | "sexual-incest" | "sexual-intimate-image-abuse" | "sexual-minors" | "sexual-non-consensual" | "sexual-non-erotic-nudity" | "sexual-nudity" | "sexual-paid" | "sexual-pornographic-media" | "sexual-revealing-clothing" | "sexual-solicitation" | "sexual-strangulation" | "sexual-suggestive" | "sexual-support-prevention" | "sexual-text" | "violence-attack" | "violence-coded-incitement" | "violence-decapitation-act" | "violence-discussion" | "violence-documentary" | "violence-educational" | "violence-encouragement" | "violence-extremism" | "violence-fantasy" | "violence-fictional" | "violence-gore" | "violence-graphic" | "violence-high-impact" | "violence-historical" | "violence-injury" | "violence-natural-death" | "violence-preparation" | "violence-sport" | "violence-support-prevention" | "violence-text" | "violence-threat" | "violence-violent-death" | "violence-weapon" | "violence-wish">>;
234
109
  }, z.core.$strict>>;
235
110
  detections: z.ZodOptional<z.ZodObject<{
236
111
  people: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{
@@ -421,4 +296,4 @@ interface TestImage {
421
296
  * image, optionally on a plain single-colour border.
422
297
  */
423
298
  declare const paintTestImage: (scenario: TestInput | ClassificationTestSignal, key: string) => Promise<TestImage>;
424
- export { getImageTestCategories as _, MEDIA_TEST_SIGNALS as a, TEST_DETECTION_BOX_MAX as c, TEST_INPUT_KEY_PATTERN as d, TEST_INPUT_PRESETS as f, detectTestTrigger as g, detectTestImage as h, paintTestImage as i, TEST_FACE_AGE_MAX as l, TestInput as m, generateMediaTestCode as n, ClassificationTestSignal as o, TestDetections as p, generateTestTextCode as r, TEST_DETECTIONS_MAX as s, TestImage as t, TEST_FACE_AGE_PRESETS as u, testInputForSignal as v };
299
+ export { detectTestTrigger as _, MEDIA_TEST_SIGNALS as a, testInputForSignal as b, TEST_DETECTION_BOX_MAX as c, TEST_INPUT_KEY_PATTERN as d, TEST_INPUT_PRESETS as f, detectTestImage as g, TestInput as h, paintTestImage as i, TEST_FACE_AGE_MAX as l, TestDetections as m, generateMediaTestCode as n, ClassificationTestSignal as o, TEST_INPUT_QUALIFIER_ERRORS as p, generateTestTextCode as r, TEST_DETECTIONS_MAX as s, TestImage as t, TEST_FACE_AGE_PRESETS as u, getImageTestCategories as v, getTestInputQualifiers as y };
@@ -1,2 +1,2 @@
1
- import { _ as getImageTestCategories, a as MEDIA_TEST_SIGNALS, c as TEST_DETECTION_BOX_MAX, d as TEST_INPUT_KEY_PATTERN, f as TEST_INPUT_PRESETS, g as detectTestTrigger, h as detectTestImage, i as paintTestImage, l as TEST_FACE_AGE_MAX, m as TestInput, n as generateMediaTestCode, o as ClassificationTestSignal, p as TestDetections, r as generateTestTextCode, s as TEST_DETECTIONS_MAX, t as TestImage, u as TEST_FACE_AGE_PRESETS, v as testInputForSignal } from "./test-inputs-JaZaV9Up.js";
2
- export { type ClassificationTestSignal, MEDIA_TEST_SIGNALS, TEST_DETECTIONS_MAX, TEST_DETECTION_BOX_MAX, TEST_FACE_AGE_MAX, TEST_FACE_AGE_PRESETS, TEST_INPUT_KEY_PATTERN, TEST_INPUT_PRESETS, type TestDetections, TestImage, type TestInput, detectTestImage, detectTestTrigger, generateMediaTestCode, generateTestTextCode, getImageTestCategories, paintTestImage, testInputForSignal };
1
+ import { _ as detectTestTrigger, a as MEDIA_TEST_SIGNALS, b as testInputForSignal, c as TEST_DETECTION_BOX_MAX, d as TEST_INPUT_KEY_PATTERN, f as TEST_INPUT_PRESETS, g as detectTestImage, h as TestInput, i as paintTestImage, l as TEST_FACE_AGE_MAX, m as TestDetections, n as generateMediaTestCode, o as ClassificationTestSignal, p as TEST_INPUT_QUALIFIER_ERRORS, r as generateTestTextCode, s as TEST_DETECTIONS_MAX, t as TestImage, u as TEST_FACE_AGE_PRESETS, v as getImageTestCategories, y as getTestInputQualifiers } from "./test-inputs-fugEK0py.js";
2
+ export { type ClassificationTestSignal, MEDIA_TEST_SIGNALS, TEST_DETECTIONS_MAX, TEST_DETECTION_BOX_MAX, TEST_FACE_AGE_MAX, TEST_FACE_AGE_PRESETS, TEST_INPUT_KEY_PATTERN, TEST_INPUT_PRESETS, TEST_INPUT_QUALIFIER_ERRORS, type TestDetections, TestImage, type TestInput, detectTestImage, detectTestTrigger, generateMediaTestCode, generateTestTextCode, getImageTestCategories, getTestInputQualifiers, paintTestImage, testInputForSignal };
@@ -1 +1 @@
1
- export { i as MEDIA_TEST_SIGNALS, a as TEST_DETECTIONS_MAX, o as TEST_DETECTION_BOX_MAX, s as TEST_FACE_AGE_MAX, c as TEST_FACE_AGE_PRESETS, l as TEST_INPUT_KEY_PATTERN, u as TEST_INPUT_PRESETS, d as detectTestImage, f as detectTestTrigger, t as generateMediaTestCode, n as generateTestTextCode, p as getImageTestCategories, r as paintTestImage, m as testInputForSignal } from "./test-inputs-DizPp8_w.js";
1
+ export { i as MEDIA_TEST_SIGNALS, a as TEST_DETECTIONS_MAX, o as TEST_DETECTION_BOX_MAX, s as TEST_FACE_AGE_MAX, c as TEST_FACE_AGE_PRESETS, l as TEST_INPUT_KEY_PATTERN, u as TEST_INPUT_PRESETS, d as TEST_INPUT_QUALIFIER_ERRORS, f as detectTestImage, p as detectTestTrigger, t as generateMediaTestCode, n as generateTestTextCode, m as getImageTestCategories, h as getTestInputQualifiers, r as paintTestImage, g as testInputForSignal } from "./test-inputs-BLlkOmNC.js";
package/esm/testing.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { Jt as SignedUploadToken, Kt as SignUploadTokenOptions, Ln as PermissionGrant, Nn as TypedEvent, O as CalmLensAppClientOptions, Rn as Folder, Vn as AssetBinaryPayloadInput, k as CalmLensServerClientOptions, m as AssetModeration, on as UploadPresetDefinition, r as Asset } from "./CalmLensTypes-CCsoVr39.js";
2
- import { t as CalmLensAppClient } from "./CalmLensAppClient-L5x_sMOI.js";
3
- import { I as ApiErrorCode, n as WebhookEventPayload } from "./WebhookPayload-_fvY2eu8.js";
4
- import { t as CalmLensServerClient } from "./CalmLensServerClient-2H0ZpJlr.js";
5
- import { a as MEDIA_TEST_SIGNALS, n as generateMediaTestCode } from "./test-inputs-JaZaV9Up.js";
1
+ import { Jt as SignedUploadToken, Kt as SignUploadTokenOptions, Ln as PermissionGrant, Nn as TypedEvent, O as CalmLensAppClientOptions, Rn as Folder, Vn as AssetBinaryPayloadInput, k as CalmLensServerClientOptions, m as AssetModeration, on as UploadPresetDefinition, r as Asset } from "./CalmLensTypes-jond9q6a.js";
2
+ import { t as CalmLensAppClient } from "./CalmLensAppClient-CQpnc4JZ.js";
3
+ import { I as ApiErrorCode, n as WebhookEventPayload } from "./WebhookPayload-DdpKjQGw.js";
4
+ import { t as CalmLensServerClient } from "./CalmLensServerClient-CeTsE5Jx.js";
5
+ import { a as MEDIA_TEST_SIGNALS, n as generateMediaTestCode } from "./test-inputs-fugEK0py.js";
6
6
  import "zod";
7
7
  /**
8
8
  * Signs a single-use upload token with `apiKey`, locally. `CalmLensServerClient` and
package/esm/testing.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import { C as invalidConfig, S as invalidArgument, T as API_ERROR_DEFINITIONS, l as CalmLensError, w as API_ERROR_CODES, x as SDK_ERROR_CODES } from "./CalmLensError-DjkibkdI.js";
2
- import { F as sleep, M as getRejectedUploadMimeTypeError, N as normalizeUploadMimeType, O as MAX_IMAGE_UPLOAD_BYTES, S as validateAppClientOptions, _ as randomUuid, f as checkTransformOptions, h as parseTransformSelector, m as isAcceptedUploadMimeType, t as ASSET_RESOURCE_PATHS, w as validateServerClientOptions } from "./CalmLensCdn-CW5Fn3ph.js";
3
- import { a as WEBHOOK_TIMESTAMP_HEADER, f as signUploadTokenWithApiKey, m as stringifyJsonCanonical, n as WEBHOOK_DELIVERY_HEADER, p as decodeUploadToken, r as WEBHOOK_SIGNATURE_HEADER, t as CalmLensServerClient } from "./CalmLensServerClient-C7n6EzVd.js";
4
- import { _ as validateAssetPayload, g as assetToData, h as assetDataToUint8Array, n as MOCK_HOOKS } from "./CalmLensConnection-Blv8JyLF.js";
2
+ import { F as sleep, M as getRejectedUploadMimeTypeError, N as normalizeUploadMimeType, O as MAX_IMAGE_UPLOAD_BYTES, S as validateAppClientOptions, _ as randomUuid, f as checkTransformOptions, h as parseTransformSelector, m as isAcceptedUploadMimeType, t as ASSET_RESOURCE_PATHS, w as validateServerClientOptions } from "./CalmLensCdn-Dh546rXe.js";
3
+ import { a as WEBHOOK_TIMESTAMP_HEADER, f as signUploadTokenWithApiKey, m as stringifyJsonCanonical, n as WEBHOOK_DELIVERY_HEADER, p as decodeUploadToken, r as WEBHOOK_SIGNATURE_HEADER, t as CalmLensServerClient } from "./CalmLensServerClient-CqH-tqcC.js";
4
+ import { _ as validateAssetPayload, g as assetToData, h as assetDataToUint8Array, n as MOCK_HOOKS } from "./CalmLensConnection-BbFlVAdl.js";
5
5
  import { t as hmacSha256Hex } from "./CryptoUtils-BLCa-oZe-DKr3LmN6.js";
6
- import { t as CalmLensAppClient } from "./CalmLensAppClient-C7ScAfRx.js";
7
- import { o as placeholderHashToDataURL, r as isFileAccepted } from "./UploadController-CQ4NouIU.js";
8
- import { _ as CLASSIFICATION_CATEGORIES, g as lazySchema, h as EU_COUNTRIES, i as MEDIA_TEST_SIGNALS, t as generateMediaTestCode } from "./test-inputs-DizPp8_w.js";
6
+ import { t as CalmLensAppClient } from "./CalmLensAppClient-B2H7x_SJ.js";
7
+ import { o as placeholderHashToDataURL, r as isFileAccepted } from "./UploadController-BYxiONcw.js";
8
+ import { _ as EU_COUNTRIES, i as MEDIA_TEST_SIGNALS, t as generateMediaTestCode, v as lazySchema, y as CLASSIFICATION_CATEGORIES } from "./test-inputs-BLlkOmNC.js";
9
9
  import * as zod from "zod";
10
10
  /**
11
11
  * The character an asset ID starts with (after `asset_`) to say the region it lives in: the asset
@@ -11020,10 +11020,11 @@ var MockCalmLensApi = class {
11020
11020
  const { content, part, sizeInBytes: _size, totalSizeInBytes, ...fields } = body;
11021
11021
  const text = content ?? part;
11022
11022
  if (text === void 0) return fields;
11023
- if (typeof text.plainText !== "string" || typeof text.type !== "string") throw invalidField("validation/invalid-type", content ? "content" : "part");
11023
+ const type = content && text.type === void 0 ? "text/plain" : text.type;
11024
+ if (typeof text.plainText !== "string" || typeof type !== "string") throw invalidField("validation/invalid-type", content ? "content" : "part");
11024
11025
  return {
11025
11026
  ...fields,
11026
- contentType: text.type,
11027
+ contentType: type,
11027
11028
  bytes: new TextEncoder().encode(text.plainText),
11028
11029
  part: part ? {
11029
11030
  partNumber: typeof part.partNumber === "number" ? part.partNumber : 1,
@@ -1,5 +1,5 @@
1
- import "./CalmLensTypes-CCsoVr39.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-B110Ug8_.js";
1
+ import "./CalmLensTypes-jond9q6a.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-C6_Q5ZME.js";
3
3
  import "pdfjs-dist";
4
4
  /** A viewer mounted into an element, which it owns the children of. */
5
5
  interface AssetViewer<O extends ViewerOptions = ViewerOptions> {
@@ -1,5 +1,5 @@
1
- import { a as assetUrlOf, r as appendAssetLocation } from "./CalmLensCdn-CW5Fn3ph.js";
2
- import "./Core-BRrPxS4i.js";
1
+ import { a as assetUrlOf, r as appendAssetLocation } from "./CalmLensCdn-Dh546rXe.js";
2
+ import "./Core-VNBTpvrG.js";
3
3
  // src/ui/viewers/PdfLoader.ts
4
4
  let loading;
5
5
  /**
package/esm/ui.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { $ as MediaPlayback, A as CustomUploadContext, B as isFileAccepted, C as formatMessage, D as resolveMessages, E as getUploadItemOutcome, F as UploadFile, G as AssetImageSource, H as AssetDisplay, I as UploadItem, J as AssetSessionState, K as AssetOptions, L as UploadSnapshot, M as UploadClient, N as UploadController, O as CalmLensProvidedOptions, P as UploadControllerOptions, Q as INSTANT_LOAD_MS, R as UploadStage, S as formatBytes, T as getUploadItemMessage, U as AssetDocumentOptions, V as withProvidedOptions, W as AssetImageOptions, X as AssetVideoOptions, Y as AssetSpreadsheetOptions, Z as AssetView, _ as DEFAULT_MESSAGES, _t as DEFAULT_VIEWER_MESSAGES, a as ProgressFetchOptions, at as isImageReady, b as describeUploadItem, bt as resolveViewerMessages, c as ICON_ATTRIBUTES, ct as DocumentViewerOptions, d as AssetDisplayOptions, dt as TextViewerOptions, et as getAssetAspectRatio, f as AssetEventHandlers, ft as ViewerAsset, g as CalmLensMessages, gt as isSpreadsheetFormat, h as UploaderProps, ht as getAssetViewerKind, i as CALMLENS_STYLES, it as getPlayedPercent, j as CustomUploadResult, k as CalmLensUpload, l as IconName, lt as PdfAssetOptions, m as UploaderDisplayOptions, mt as ViewerTextOptions, n as CalmLensTheme, nt as getAssetViewKey, o as createProgressFetch, ot as pickAssetSource, p as AssetProps, pt as ViewerOptions, q as AssetSession, r as resolveTheme, rt as getPeakHeights, s as ICONS, st as AssetViewerKind, t as CALMLENS_THEME, tt as getAssetView, u as ASSET_FILE_ICON_SIZE, ut as SpreadsheetViewerOptions, v as UploadItemView, vt as ViewerMessages, w as getDropzoneHint, x as describeUploader, y as UploaderView, yt as formatViewerMessage, z as createUploadController } from "./Core-B110Ug8_.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--E_s-cDd.js";
1
+ import { $ as MediaPlayback, A as CustomUploadContext, B as isFileAccepted, C as formatMessage, D as resolveMessages, E as getUploadItemOutcome, F as UploadFile, G as AssetImageSource, H as AssetDisplay, I as UploadItem, J as AssetSessionState, K as AssetOptions, L as UploadSnapshot, M as UploadClient, N as UploadController, O as CalmLensProvidedOptions, P as UploadControllerOptions, Q as INSTANT_LOAD_MS, R as UploadStage, S as formatBytes, T as getUploadItemMessage, U as AssetDocumentOptions, V as withProvidedOptions, W as AssetImageOptions, X as AssetVideoOptions, Y as AssetSpreadsheetOptions, Z as AssetView, _ as DEFAULT_MESSAGES, _t as DEFAULT_VIEWER_MESSAGES, a as ProgressFetchOptions, at as isImageReady, b as describeUploadItem, bt as resolveViewerMessages, c as ICON_ATTRIBUTES, ct as DocumentViewerOptions, d as AssetDisplayOptions, dt as TextViewerOptions, et as getAssetAspectRatio, f as AssetEventHandlers, ft as ViewerAsset, g as CalmLensMessages, gt as isSpreadsheetFormat, h as UploaderProps, ht as getAssetViewerKind, i as CALMLENS_STYLES, it as getPlayedPercent, j as CustomUploadResult, k as CalmLensUpload, l as IconName, lt as PdfAssetOptions, m as UploaderDisplayOptions, mt as ViewerTextOptions, n as CalmLensTheme, nt as getAssetViewKey, o as createProgressFetch, ot as pickAssetSource, p as AssetProps, pt as ViewerOptions, q as AssetSession, r as resolveTheme, rt as getPeakHeights, s as ICONS, st as AssetViewerKind, t as CALMLENS_THEME, tt as getAssetView, u as ASSET_FILE_ICON_SIZE, ut as SpreadsheetViewerOptions, v as UploadItemView, vt as ViewerMessages, w as getDropzoneHint, x as describeUploader, y as UploaderView, yt as formatViewerMessage, z as createUploadController } from "./Core-C6_Q5ZME.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-Cp18fGXG.js";
3
3
  export { ASSET_FILE_ICON_SIZE, ASSET_VIEWERS, type AssetDisplay, type AssetDisplayOptions, type AssetDocumentOptions, type AssetEventHandlers, type AssetImageOptions, type AssetImageSource, type AssetOptions, type AssetProps, AssetSession, type AssetSessionState, type AssetSpreadsheetOptions, type AssetVideoOptions, type AssetView, type AssetViewer, type AssetViewerKind, AssetViewerMount, AssetViewerName, AssetViewerOptionsByKind, CALMLENS_STYLES, CALMLENS_THEME, type CalmLensMessages, type CalmLensProvidedOptions, type CalmLensTheme, type CalmLensUpload, type CustomUploadContext, type CustomUploadResult, DEFAULT_MESSAGES, DEFAULT_VIEWER_MESSAGES, type DocumentViewerOptions, ICONS, ICON_ATTRIBUTES, INSTANT_LOAD_MS, type IconName, type MediaPlayback, MediaStreamPlayer, type MountedViewerKind, type PdfAssetOptions, type ProgressFetchOptions, type SpreadsheetCell, type SpreadsheetRow, type SpreadsheetSheet, type SpreadsheetViewerOptions, type TextViewerOptions, type UploadClient, UploadController, type UploadControllerOptions, type UploadFile, type UploadItem, type UploadItemView, type UploadSnapshot, type UploadStage, type UploaderDisplayOptions, type UploaderProps, type UploaderView, VIEWER_STYLES, type ViewerAsset, type ViewerMessages, type ViewerOptions, type ViewerState, type ViewerTextOptions, createDocumentViewer, createProgressFetch, createSpreadsheetViewer, createTextViewer, createUploadController, describeUploadItem, describeUploader, formatBytes, formatMessage, formatViewerMessage, getAssetAspectRatio, getAssetView, getAssetViewKey, getAssetViewerKind, getDropzoneHint, getMountedViewerOptions, getPeakHeights, getPlayedPercent, getSpreadsheetPage, getUploadItemMessage, getUploadItemOutcome, isFileAccepted, isImageReady, isMountedViewerKind, isSpreadsheetFormat, loadPdfJs, parseSpreadsheetText, pickAssetSource, resolveMessages, resolveTheme, resolveViewerMessages, spreadsheetColumnIndex, withProvidedOptions };
package/esm/ui.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as ASSET_VIEWERS, c as getSpreadsheetPage, d as createDocumentViewer, f as DEFAULT_VIEWER_MESSAGES, h as loadPdfJs, i as isMountedViewerKind, l as parseSpreadsheetText, m as resolveViewerMessages, n as AssetViewerMount, o as createSpreadsheetViewer, p as formatViewerMessage, r as getMountedViewerOptions, s as createTextViewer, t as MediaStreamPlayer, u as spreadsheetColumnIndex } from "./ui-B-QOHuVI.js";
2
- import { C as pickAssetSource, D as getAssetViewerKind, E as resolveTheme, O as isSpreadsheetFormat, S as isImageReady, T as CALMLENS_THEME, _ as getAssetAspectRatio, a as describeUploadItem, b as getPeakHeights, c as formatMessage, d as getUploadItemOutcome, f as resolveMessages, g as INSTANT_LOAD_MS, h as AssetSession, i as DEFAULT_MESSAGES, l as getDropzoneHint, m as ICON_ATTRIBUTES, o as describeUploader, p as ICONS, r as ASSET_FILE_ICON_SIZE, s as formatBytes, t as CALMLENS_STYLES, u as getUploadItemMessage, v as getAssetView, w as VIEWER_STYLES, x as getPlayedPercent, y as getAssetViewKey } from "./Core-BRrPxS4i.js";
3
- import { a as createProgressFetch, i as withProvidedOptions, n as createUploadController, r as isFileAccepted, t as UploadController } from "./UploadController-CQ4NouIU.js";
1
+ import { a as ASSET_VIEWERS, c as getSpreadsheetPage, d as createDocumentViewer, f as DEFAULT_VIEWER_MESSAGES, h as loadPdfJs, i as isMountedViewerKind, l as parseSpreadsheetText, m as resolveViewerMessages, n as AssetViewerMount, o as createSpreadsheetViewer, p as formatViewerMessage, r as getMountedViewerOptions, s as createTextViewer, t as MediaStreamPlayer, u as spreadsheetColumnIndex } from "./ui-siBYiNJZ.js";
2
+ import { C as pickAssetSource, D as getAssetViewerKind, E as resolveTheme, O as isSpreadsheetFormat, S as isImageReady, T as CALMLENS_THEME, _ as getAssetAspectRatio, a as describeUploadItem, b as getPeakHeights, c as formatMessage, d as getUploadItemOutcome, f as resolveMessages, g as INSTANT_LOAD_MS, h as AssetSession, i as DEFAULT_MESSAGES, l as getDropzoneHint, m as ICON_ATTRIBUTES, o as describeUploader, p as ICONS, r as ASSET_FILE_ICON_SIZE, s as formatBytes, t as CALMLENS_STYLES, u as getUploadItemMessage, v as getAssetView, w as VIEWER_STYLES, x as getPlayedPercent, y as getAssetViewKey } from "./Core-VNBTpvrG.js";
3
+ import { a as createProgressFetch, i as withProvidedOptions, n as createUploadController, r as isFileAccepted, t as UploadController } from "./UploadController-BYxiONcw.js";
4
4
  export { ASSET_FILE_ICON_SIZE, ASSET_VIEWERS, AssetSession, AssetViewerMount, CALMLENS_STYLES, CALMLENS_THEME, DEFAULT_MESSAGES, DEFAULT_VIEWER_MESSAGES, ICONS, ICON_ATTRIBUTES, INSTANT_LOAD_MS, MediaStreamPlayer, UploadController, VIEWER_STYLES, createDocumentViewer, createProgressFetch, createSpreadsheetViewer, createTextViewer, createUploadController, describeUploadItem, describeUploader, formatBytes, formatMessage, formatViewerMessage, getAssetAspectRatio, getAssetView, getAssetViewKey, getAssetViewerKind, getDropzoneHint, getMountedViewerOptions, getPeakHeights, getPlayedPercent, getSpreadsheetPage, getUploadItemMessage, getUploadItemOutcome, isFileAccepted, isImageReady, isMountedViewerKind, isSpreadsheetFormat, loadPdfJs, parseSpreadsheetText, pickAssetSource, resolveMessages, resolveTheme, resolveViewerMessages, spreadsheetColumnIndex, withProvidedOptions };
package/esm/vue.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { O as CalmLensAppClientOptions, fn as ViewerClaims, g as AssetModerationStatus, i as AssetAvailability } from "./CalmLensTypes-CCsoVr39.js";
2
- import "./index-Dk3I5YXf.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-B110Ug8_.js";
4
- import { a as UploaderProps, i as UploadSnapshot, n as UploadControllerOptions, r as UploadItem, s as createUploadController, t as CalmLensUpload } from "./BrowserUpload-BuTS7yTy.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--E_s-cDd.js";
1
+ import { O as CalmLensAppClientOptions, fn as ViewerClaims, g as AssetModerationStatus, i as AssetAvailability } from "./CalmLensTypes-jond9q6a.js";
2
+ import "./index-CgAztQdX.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-C6_Q5ZME.js";
4
+ import { a as UploaderProps, i as UploadSnapshot, n as UploadControllerOptions, r as UploadItem, s as createUploadController, t as CalmLensUpload } from "./BrowserUpload-_iMX_nq0.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-Cp18fGXG.js";
6
6
  import { App, MaybeRefOrGetter, PropType, ShallowRef } from "vue";
7
7
  /** Shows a text asset's text, escaped, in a scrolling region. */
8
8
  export declare const CalmLensTextViewer: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
package/esm/vue.js CHANGED
@@ -1,8 +1,8 @@
1
- import { a as ASSET_VIEWERS, c as getSpreadsheetPage, d as createDocumentViewer, f as DEFAULT_VIEWER_MESSAGES, h as loadPdfJs, i as isMountedViewerKind, l as parseSpreadsheetText, m as resolveViewerMessages, n as AssetViewerMount, o as createSpreadsheetViewer, p as formatViewerMessage, r as getMountedViewerOptions, s as createTextViewer, t as MediaStreamPlayer, u as spreadsheetColumnIndex } from "./ui-B-QOHuVI.js";
2
- import { C as pickAssetSource, D as getAssetViewerKind, E as resolveTheme, O as isSpreadsheetFormat, S as isImageReady, T as CALMLENS_THEME, _ as getAssetAspectRatio, a as describeUploadItem, b as getPeakHeights, c as formatMessage, d as getUploadItemOutcome, f as resolveMessages, g as INSTANT_LOAD_MS, h as AssetSession, i as DEFAULT_MESSAGES, l as getDropzoneHint, m as ICON_ATTRIBUTES, o as describeUploader, p as ICONS, r as ASSET_FILE_ICON_SIZE, s as formatBytes, t as CALMLENS_STYLES, u as getUploadItemMessage, v as getAssetView, w as VIEWER_STYLES, x as getPlayedPercent, y as getAssetViewKey } from "./Core-BRrPxS4i.js";
3
- import { a as createProgressFetch, i as withProvidedOptions, n as createUploadController$1, r as isFileAccepted, t as UploadController } from "./UploadController-CQ4NouIU.js";
1
+ import { a as ASSET_VIEWERS, c as getSpreadsheetPage, d as createDocumentViewer, f as DEFAULT_VIEWER_MESSAGES, h as loadPdfJs, i as isMountedViewerKind, l as parseSpreadsheetText, m as resolveViewerMessages, n as AssetViewerMount, o as createSpreadsheetViewer, p as formatViewerMessage, r as getMountedViewerOptions, s as createTextViewer, t as MediaStreamPlayer, u as spreadsheetColumnIndex } from "./ui-siBYiNJZ.js";
2
+ import { C as pickAssetSource, D as getAssetViewerKind, E as resolveTheme, O as isSpreadsheetFormat, S as isImageReady, T as CALMLENS_THEME, _ as getAssetAspectRatio, a as describeUploadItem, b as getPeakHeights, c as formatMessage, d as getUploadItemOutcome, f as resolveMessages, g as INSTANT_LOAD_MS, h as AssetSession, i as DEFAULT_MESSAGES, l as getDropzoneHint, m as ICON_ATTRIBUTES, o as describeUploader, p as ICONS, r as ASSET_FILE_ICON_SIZE, s as formatBytes, t as CALMLENS_STYLES, u as getUploadItemMessage, v as getAssetView, w as VIEWER_STYLES, x as getPlayedPercent, y as getAssetViewKey } from "./Core-VNBTpvrG.js";
3
+ import { a as createProgressFetch, i as withProvidedOptions, n as createUploadController$1, r as isFileAccepted, t as UploadController } from "./UploadController-BYxiONcw.js";
4
4
  import { c as renderFileIconSvg } from "./FileIcons-M6dzjFxd.js";
5
- import { t as createUploadController } from "./BrowserUpload-DxgiUXC2.js";
5
+ import { t as createUploadController } from "./BrowserUpload-C4YF17a3.js";
6
6
  import { computed, defineComponent, h, inject, onBeforeUnmount, onMounted, onScopeDispose, provide, ref, shallowRef, toValue, watch, watchEffect } from "vue";
7
7
  // src/viewers/Vue.ts
8
8
  const optional$1 = (type) => ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "calmlens",
3
- "version": "0.38.0",
3
+ "version": "0.38.1",
4
4
  "description": "Official CalmLens SDK for JavaScript and TypeScript: content moderation, asset storage and CDN delivery.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://calmlens.com/docs/sdk/javascript",