@10x-media/fields 0.1.0-beta.4 → 0.1.0-beta.5

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 (63) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +2 -0
  3. package/dist/exports/encrypted.d.ts +7 -4
  4. package/dist/exports/encrypted.js +6 -3
  5. package/dist/fields/encrypted/boot.js +2 -1
  6. package/dist/fields/encrypted/boot.js.map +1 -1
  7. package/dist/fields/encrypted/components/EncryptedInput.js +4 -1
  8. package/dist/fields/encrypted/components/EncryptedInput.js.map +1 -1
  9. package/dist/fields/encrypted/components/EncryptedTextarea.js +6 -2
  10. package/dist/fields/encrypted/components/EncryptedTextarea.js.map +1 -1
  11. package/dist/fields/encrypted/components/ProtectedCell.d.ts +15 -6
  12. package/dist/fields/encrypted/components/ProtectedCell.js +37 -8
  13. package/dist/fields/encrypted/components/ProtectedCell.js.map +1 -1
  14. package/dist/fields/encrypted/components/ProtectedField.css +134 -39
  15. package/dist/fields/encrypted/components/ProtectedField.d.ts +3 -0
  16. package/dist/fields/encrypted/components/ProtectedField.js +14 -0
  17. package/dist/fields/encrypted/components/ProtectedField.js.map +1 -1
  18. package/dist/fields/encrypted/components/WriteOnlyActions.js +65 -0
  19. package/dist/fields/encrypted/components/WriteOnlyActions.js.map +1 -0
  20. package/dist/fields/encrypted/components/WriteOnlyField.js +286 -0
  21. package/dist/fields/encrypted/components/WriteOnlyField.js.map +1 -0
  22. package/dist/fields/encrypted/components/writeOnlyIntent.js +69 -0
  23. package/dist/fields/encrypted/components/writeOnlyIntent.js.map +1 -0
  24. package/dist/fields/encrypted/crypto/wire.d.ts +10 -1
  25. package/dist/fields/encrypted/crypto/wire.js +1 -1
  26. package/dist/fields/encrypted/encryptedField.js +63 -6
  27. package/dist/fields/encrypted/encryptedField.js.map +1 -1
  28. package/dist/fields/encrypted/generateSecret.d.ts +10 -0
  29. package/dist/fields/encrypted/generateSecret.js +41 -0
  30. package/dist/fields/encrypted/generateSecret.js.map +1 -0
  31. package/dist/fields/encrypted/hint.js +67 -0
  32. package/dist/fields/encrypted/hint.js.map +1 -0
  33. package/dist/fields/encrypted/hooks.js +59 -31
  34. package/dist/fields/encrypted/hooks.js.map +1 -1
  35. package/dist/fields/encrypted/queryRewrite.d.ts +10 -2
  36. package/dist/fields/encrypted/queryRewrite.js +34 -8
  37. package/dist/fields/encrypted/queryRewrite.js.map +1 -1
  38. package/dist/fields/encrypted/rawRead.d.ts +24 -0
  39. package/dist/fields/encrypted/rawRead.js +40 -0
  40. package/dist/fields/encrypted/rawRead.js.map +1 -0
  41. package/dist/fields/encrypted/scan.js +21 -4
  42. package/dist/fields/encrypted/scan.js.map +1 -1
  43. package/dist/fields/encrypted/types.d.ts +67 -2
  44. package/dist/fields/encrypted/types.js +8 -1
  45. package/dist/fields/encrypted/types.js.map +1 -1
  46. package/dist/fields/encrypted/utils/decryptAllData.js +2 -2
  47. package/dist/fields/encrypted/utils/decryptAllData.js.map +1 -1
  48. package/dist/fields/encrypted/utils/decryptFieldValue.d.ts +30 -0
  49. package/dist/fields/encrypted/utils/decryptFieldValue.js +56 -0
  50. package/dist/fields/encrypted/utils/decryptFieldValue.js.map +1 -0
  51. package/dist/fields/encrypted/utils/readEncryptedField.d.ts +51 -0
  52. package/dist/fields/encrypted/utils/readEncryptedField.js +96 -0
  53. package/dist/fields/encrypted/utils/readEncryptedField.js.map +1 -0
  54. package/dist/index.js +2 -1
  55. package/dist/index.js.map +1 -1
  56. package/dist/translations/de.js +8 -1
  57. package/dist/translations/de.js.map +1 -1
  58. package/dist/translations/en.js +8 -1
  59. package/dist/translations/en.js.map +1 -1
  60. package/dist/translations/keys.d.ts +7 -0
  61. package/dist/translations/keys.js +8 -1
  62. package/dist/translations/keys.js.map +1 -1
  63. package/package.json +6 -6
@@ -0,0 +1,30 @@
1
+ import { Payload } from "payload";
2
+
3
+ //#region src/fields/encrypted/utils/decryptFieldValue.d.ts
4
+ /** Which document schema an encrypted field lives in: a collection or a global. */
5
+ interface EncryptedFieldTarget {
6
+ collection?: string;
7
+ global?: string;
8
+ /** Dot path of the encrypted field within the schema, e.g. `smtp.password`. */
9
+ path: string;
10
+ /** Locale of a localized value. Omitted, every configured locale is tried. */
11
+ locale?: string;
12
+ }
13
+ interface DecryptFieldValueArgs extends EncryptedFieldTarget {
14
+ /** The raw stored wire string (`pfe1.…`), e.g. cached from `readEncryptedField`. */
15
+ value: string;
16
+ }
17
+ /**
18
+ * Decrypts one stored encrypted value outside a document read, given only its
19
+ * field path and the raw wire string. Keys and AAD resolve from the config, so
20
+ * a ciphertext cached earlier (e.g. via `readEncryptedField().ciphertext`)
21
+ * decrypts on demand without plaintext ever sitting in the cache. A non-sealed
22
+ * value (pre-adoption plaintext at rest) is returned as-is.
23
+ *
24
+ * Server-only and access-unchecked by design: calling it is the deliberate act.
25
+ * Guard call sites accordingly, and never forward the result to a client.
26
+ */
27
+ declare const decryptFieldValue: (payload: Payload, args: DecryptFieldValueArgs) => Promise<unknown>;
28
+ //#endregion
29
+ export { DecryptFieldValueArgs, EncryptedFieldTarget, decryptFieldValue };
30
+ //# sourceMappingURL=decryptFieldValue.d.ts.map
@@ -0,0 +1,56 @@
1
+ import { resolveKeys } from "../crypto/keys.js";
2
+ import { aadScopeOf } from "../types.js";
3
+ import { scanEncryptedFields } from "../scan.js";
4
+ import { getFieldsRegistry } from "../../../plugin/registry.js";
5
+ import { buildAad } from "../crypto/aad.js";
6
+ import { isSealed, unseal } from "../crypto/wire.js";
7
+ //#region src/fields/encrypted/utils/decryptFieldValue.ts
8
+ /** Resolves a target's schema slug and encrypted-field marker, or throws with the reason. */
9
+ const resolveEncryptedField = (payload, target) => {
10
+ const { collection, global, path } = target;
11
+ if (collection && global || !collection && !global) throw new Error(`@10x-media/fields: pass exactly one of 'collection' or 'global' for encrypted field '${path}'`);
12
+ const slug = collection ?? global;
13
+ const fields = collection ? payload.config.collections.find((entry) => entry.slug === collection)?.fields : payload.config.globals.find((entry) => entry.slug === global)?.fields;
14
+ if (!fields) throw new Error(`@10x-media/fields: no ${collection ? "collection" : "global"} with slug '${slug}'`);
15
+ const marker = scanEncryptedFields(fields).get(path);
16
+ if (!marker) throw new Error(`@10x-media/fields: '${slug}.${path}' is not an encrypted field`);
17
+ return {
18
+ marker,
19
+ slug
20
+ };
21
+ };
22
+ /** Read-side AAD candidates for a marker outside a document read (mirrors decryptAllData). */
23
+ const aadCandidatesFor = (payload, { locale, marker, slug }) => {
24
+ const scope = aadScopeOf(marker, slug);
25
+ if (!marker.localized) return [buildAad([scope, marker.fieldName])];
26
+ const codes = payload.config.localization ? payload.config.localization.localeCodes : [];
27
+ return (locale ? [locale, ...codes.filter((code) => code !== locale)] : codes).map((code) => buildAad([
28
+ scope,
29
+ marker.fieldName,
30
+ code
31
+ ]));
32
+ };
33
+ /**
34
+ * Decrypts one stored encrypted value outside a document read, given only its
35
+ * field path and the raw wire string. Keys and AAD resolve from the config, so
36
+ * a ciphertext cached earlier (e.g. via `readEncryptedField().ciphertext`)
37
+ * decrypts on demand without plaintext ever sitting in the cache. A non-sealed
38
+ * value (pre-adoption plaintext at rest) is returned as-is.
39
+ *
40
+ * Server-only and access-unchecked by design: calling it is the deliberate act.
41
+ * Guard call sites accordingly, and never forward the result to a client.
42
+ */
43
+ const decryptFieldValue = async (payload, args) => {
44
+ const { locale, value } = args;
45
+ const resolved = resolveEncryptedField(payload, args);
46
+ if (!isSealed(value)) return value;
47
+ const registry = getFieldsRegistry(payload.config);
48
+ return unseal(value, (await resolveKeys(resolved.marker.keys ?? registry?.encrypted?.keys, payload.config.secret)).dataKeys, aadCandidatesFor(payload, {
49
+ ...resolved,
50
+ locale
51
+ }));
52
+ };
53
+ //#endregion
54
+ export { decryptFieldValue, resolveEncryptedField };
55
+
56
+ //# sourceMappingURL=decryptFieldValue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decryptFieldValue.js","names":[],"sources":["../../../../src/fields/encrypted/utils/decryptFieldValue.ts"],"sourcesContent":["import type { Payload } from 'payload'\nimport { getFieldsRegistry } from '../../../plugin/registry'\nimport { buildAad } from '../crypto/aad'\nimport { resolveKeys } from '../crypto/keys'\nimport { isSealed, unseal } from '../crypto/wire'\nimport { scanEncryptedFields } from '../scan'\nimport { aadScopeOf, type EncryptedFieldMarker } from '../types'\n\n/** Which document schema an encrypted field lives in: a collection or a global. */\nexport interface EncryptedFieldTarget {\n\tcollection?: string\n\tglobal?: string\n\t/** Dot path of the encrypted field within the schema, e.g. `smtp.password`. */\n\tpath: string\n\t/** Locale of a localized value. Omitted, every configured locale is tried. */\n\tlocale?: string\n}\n\nexport interface DecryptFieldValueArgs extends EncryptedFieldTarget {\n\t/** The raw stored wire string (`pfe1.…`), e.g. cached from `readEncryptedField`. */\n\tvalue: string\n}\n\nexport interface ResolvedEncryptedField {\n\tmarker: EncryptedFieldMarker\n\tslug: string\n}\n\n/** Resolves a target's schema slug and encrypted-field marker, or throws with the reason. */\nexport const resolveEncryptedField = (\n\tpayload: Payload,\n\ttarget: Pick<EncryptedFieldTarget, 'collection' | 'global' | 'path'>\n): ResolvedEncryptedField => {\n\tconst { collection, global, path } = target\n\tif ((collection && global) || (!collection && !global)) {\n\t\tthrow new Error(\n\t\t\t`@10x-media/fields: pass exactly one of 'collection' or 'global' for encrypted field '${path}'`\n\t\t)\n\t}\n\tconst slug = (collection ?? global) as string\n\tconst fields = collection\n\t\t? payload.config.collections.find((entry) => entry.slug === collection)?.fields\n\t\t: payload.config.globals.find((entry) => entry.slug === global)?.fields\n\tif (!fields) {\n\t\tthrow new Error(\n\t\t\t`@10x-media/fields: no ${collection ? 'collection' : 'global'} with slug '${slug}'`\n\t\t)\n\t}\n\tconst marker = scanEncryptedFields(fields).get(path)\n\tif (!marker) {\n\t\tthrow new Error(`@10x-media/fields: '${slug}.${path}' is not an encrypted field`)\n\t}\n\treturn { marker, slug }\n}\n\n/** Read-side AAD candidates for a marker outside a document read (mirrors decryptAllData). */\nexport const aadCandidatesFor = (\n\tpayload: Payload,\n\t{ locale, marker, slug }: ResolvedEncryptedField & { locale?: string }\n): string[] => {\n\tconst scope = aadScopeOf(marker, slug)\n\tif (!marker.localized) {\n\t\treturn [buildAad([scope, marker.fieldName])]\n\t}\n\tconst codes = payload.config.localization ? payload.config.localization.localeCodes : []\n\tconst ordered = locale ? [locale, ...codes.filter((code) => code !== locale)] : codes\n\treturn ordered.map((code) => buildAad([scope, marker.fieldName, code]))\n}\n\n/**\n * Decrypts one stored encrypted value outside a document read, given only its\n * field path and the raw wire string. Keys and AAD resolve from the config, so\n * a ciphertext cached earlier (e.g. via `readEncryptedField().ciphertext`)\n * decrypts on demand without plaintext ever sitting in the cache. A non-sealed\n * value (pre-adoption plaintext at rest) is returned as-is.\n *\n * Server-only and access-unchecked by design: calling it is the deliberate act.\n * Guard call sites accordingly, and never forward the result to a client.\n */\nexport const decryptFieldValue = async (\n\tpayload: Payload,\n\targs: DecryptFieldValueArgs\n): Promise<unknown> => {\n\tconst { locale, value } = args\n\tconst resolved = resolveEncryptedField(payload, args)\n\tif (!isSealed(value)) {\n\t\treturn value\n\t}\n\tconst registry = getFieldsRegistry(payload.config)\n\tconst ring = await resolveKeys(\n\t\tresolved.marker.keys ?? registry?.encrypted?.keys,\n\t\tpayload.config.secret\n\t)\n\treturn unseal(value, ring.dataKeys, aadCandidatesFor(payload, { ...resolved, locale }))\n}\n"],"mappings":";;;;;;;;AA6BA,MAAa,yBACZ,SACA,WAC4B;CAC5B,MAAM,EAAE,YAAY,QAAQ,SAAS;CACrC,IAAK,cAAc,UAAY,CAAC,cAAc,CAAC,QAC9C,MAAM,IAAI,MACT,wFAAwF,KAAK,EAC9F;CAED,MAAM,OAAQ,cAAc;CAC5B,MAAM,SAAS,aACZ,QAAQ,OAAO,YAAY,MAAM,UAAU,MAAM,SAAS,UAAU,GAAG,SACvE,QAAQ,OAAO,QAAQ,MAAM,UAAU,MAAM,SAAS,MAAM,GAAG;CAClE,IAAI,CAAC,QACJ,MAAM,IAAI,MACT,yBAAyB,aAAa,eAAe,SAAS,cAAc,KAAK,EAClF;CAED,MAAM,SAAS,oBAAoB,MAAM,EAAE,IAAI,IAAI;CACnD,IAAI,CAAC,QACJ,MAAM,IAAI,MAAM,uBAAuB,KAAK,GAAG,KAAK,4BAA4B;CAEjF,OAAO;EAAE;EAAQ;CAAK;AACvB;;AAGA,MAAa,oBACZ,SACA,EAAE,QAAQ,QAAQ,WACJ;CACd,MAAM,QAAQ,WAAW,QAAQ,IAAI;CACrC,IAAI,CAAC,OAAO,WACX,OAAO,CAAC,SAAS,CAAC,OAAO,OAAO,SAAS,CAAC,CAAC;CAE5C,MAAM,QAAQ,QAAQ,OAAO,eAAe,QAAQ,OAAO,aAAa,cAAc,CAAC;CAEvF,QADgB,SAAS,CAAC,QAAQ,GAAG,MAAM,QAAQ,SAAS,SAAS,MAAM,CAAC,IAAI,OACjE,KAAK,SAAS,SAAS;EAAC;EAAO,OAAO;EAAW;CAAI,CAAC,CAAC;AACvE;;;;;;;;;;;AAYA,MAAa,oBAAoB,OAChC,SACA,SACsB;CACtB,MAAM,EAAE,QAAQ,UAAU;CAC1B,MAAM,WAAW,sBAAsB,SAAS,IAAI;CACpD,IAAI,CAAC,SAAS,KAAK,GAClB,OAAO;CAER,MAAM,WAAW,kBAAkB,QAAQ,MAAM;CAKjD,OAAO,OAAO,QAAO,MAJF,YAClB,SAAS,OAAO,QAAQ,UAAU,WAAW,MAC7C,QAAQ,OAAO,MAChB,GAC0B,UAAU,iBAAiB,SAAS;EAAE,GAAG;EAAU;CAAO,CAAC,CAAC;AACvF"}
@@ -0,0 +1,51 @@
1
+ import { EncryptedFieldTarget } from "./decryptFieldValue.js";
2
+ import { Payload, PayloadRequest } from "payload";
3
+
4
+ //#region src/fields/encrypted/utils/readEncryptedField.d.ts
5
+ interface ReadEncryptedFieldArgs extends EncryptedFieldTarget {
6
+ /** Document id; required with `collection`, ignored with `global`. */
7
+ id?: number | string;
8
+ /**
9
+ * Request to read on. Given one, the read joins its transaction and sees the
10
+ * caller's uncommitted writes, which is what a secret written and used inside
11
+ * the same operation needs. Omitted, the read runs on its own request and
12
+ * therefore outside any transaction in progress. The request comes back as
13
+ * it went in, except that one with no `context` at all gains an empty one,
14
+ * which the raw window needs to carry its mode.
15
+ */
16
+ req?: PayloadRequest;
17
+ }
18
+ /**
19
+ * A deliberately read encrypted value. `ciphertext` is the raw stored wire
20
+ * string (an array for `hasMany` fields), safe to hold in a cache; `decrypt()`
21
+ * resolves keys at call time, so plaintext exists only for the moment it is
22
+ * used. Rehydrate a persisted ciphertext later via `decryptFieldValue`.
23
+ */
24
+ interface EncryptedFieldHandle {
25
+ ciphertext: string | string[];
26
+ decrypt(): Promise<unknown>;
27
+ }
28
+ /**
29
+ * Fetches one encrypted field's stored ciphertext by path, bypassing the
30
+ * decrypt-on-read pipeline (and the write-only response strip). Returns null
31
+ * when the field holds no value, and throws when the document itself is
32
+ * missing. This is THE supported way to use a `protection: 'writeOnly'` secret
33
+ * server-side:
34
+ *
35
+ * ```ts
36
+ * const secret = await readEncryptedField(payload, { global: 'settings', path: 'smtp.password' })
37
+ * const password = await secret?.decrypt()
38
+ * ```
39
+ *
40
+ * One document per call. To recover a field across many documents, run your own
41
+ * query inside `withRawEncrypted` and pass each stored value to
42
+ * `decryptFieldValue`; that keeps it to a single query and gives you the rest of
43
+ * each document as well.
44
+ *
45
+ * Server-only and access-unchecked by design: calling it is the deliberate
46
+ * act. Guard call sites accordingly, and never forward the result to a client.
47
+ */
48
+ declare const readEncryptedField: (payload: Payload, args: ReadEncryptedFieldArgs) => Promise<EncryptedFieldHandle | null>;
49
+ //#endregion
50
+ export { EncryptedFieldHandle, ReadEncryptedFieldArgs, readEncryptedField };
51
+ //# sourceMappingURL=readEncryptedField.d.ts.map
@@ -0,0 +1,96 @@
1
+ import { ENCRYPTED_CONTEXT_KEY } from "../types.js";
2
+ import { withRawEncrypted } from "../rawRead.js";
3
+ import { getAtPath } from "./pageThrough.js";
4
+ import { decryptFieldValue, resolveEncryptedField } from "./decryptFieldValue.js";
5
+ //#region src/fields/encrypted/utils/readEncryptedField.ts
6
+ /**
7
+ * Which locale this read resolves at. An explicit argument wins, then the
8
+ * request's, since the read joins it.
9
+ *
10
+ * `all` is not a locale but a request for every locale at once, which hands
11
+ * back a `{ [locale]: value }` map where a handle addresses a single value. It
12
+ * falls back to the default locale, which is what this helper reads with no
13
+ * request at all: passing a `req` picks the transaction to read in, never which
14
+ * value comes back.
15
+ */
16
+ const readLocale = (payload, locale, req) => {
17
+ if (locale) return locale;
18
+ if (!req?.locale) return;
19
+ if (req.locale !== "all") return req.locale;
20
+ return payload.config.localization ? payload.config.localization.defaultLocale : void 0;
21
+ };
22
+ /**
23
+ * Fetches one encrypted field's stored ciphertext by path, bypassing the
24
+ * decrypt-on-read pipeline (and the write-only response strip). Returns null
25
+ * when the field holds no value, and throws when the document itself is
26
+ * missing. This is THE supported way to use a `protection: 'writeOnly'` secret
27
+ * server-side:
28
+ *
29
+ * ```ts
30
+ * const secret = await readEncryptedField(payload, { global: 'settings', path: 'smtp.password' })
31
+ * const password = await secret?.decrypt()
32
+ * ```
33
+ *
34
+ * One document per call. To recover a field across many documents, run your own
35
+ * query inside `withRawEncrypted` and pass each stored value to
36
+ * `decryptFieldValue`; that keeps it to a single query and gives you the rest of
37
+ * each document as well.
38
+ *
39
+ * Server-only and access-unchecked by design: calling it is the deliberate
40
+ * act. Guard call sites accordingly, and never forward the result to a client.
41
+ */
42
+ const readEncryptedField = async (payload, args) => {
43
+ const { collection, global, id, locale, path, req } = args;
44
+ resolveEncryptedField(payload, args);
45
+ if (collection && id == null) throw new Error(`@10x-media/fields: readEncryptedField needs an 'id' to read '${collection}.${path}'`);
46
+ const resolvedLocale = readLocale(payload, locale, req);
47
+ const localeArg = resolvedLocale ? { locale: resolvedLocale } : {};
48
+ const modeArg = req ? {} : { context: { [ENCRYPTED_CONTEXT_KEY]: "raw" } };
49
+ const read = () => collection ? payload.findByID({
50
+ collection,
51
+ depth: 0,
52
+ id,
53
+ overrideAccess: true,
54
+ req,
55
+ ...modeArg,
56
+ ...localeArg
57
+ }) : payload.findGlobal({
58
+ depth: 0,
59
+ overrideAccess: true,
60
+ req,
61
+ slug: global,
62
+ ...modeArg,
63
+ ...localeArg
64
+ });
65
+ const value = getAtPath(req ? await withRawEncrypted(req, read) : await read(), path);
66
+ if (value == null) return null;
67
+ const target = {
68
+ collection,
69
+ global,
70
+ locale: resolvedLocale,
71
+ path
72
+ };
73
+ if (Array.isArray(value)) {
74
+ const items = value.filter((item) => typeof item === "string");
75
+ if (items.length === 0) return null;
76
+ return {
77
+ ciphertext: items,
78
+ decrypt: () => Promise.all(items.map((item) => decryptFieldValue(payload, {
79
+ ...target,
80
+ value: item
81
+ })))
82
+ };
83
+ }
84
+ if (typeof value !== "string") throw new Error(`@10x-media/fields: expected a stored wire string at '${collection ?? global}.${path}', got ${typeof value}`);
85
+ return {
86
+ ciphertext: value,
87
+ decrypt: () => decryptFieldValue(payload, {
88
+ ...target,
89
+ value
90
+ })
91
+ };
92
+ };
93
+ //#endregion
94
+ export { readEncryptedField };
95
+
96
+ //# sourceMappingURL=readEncryptedField.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readEncryptedField.js","names":[],"sources":["../../../../src/fields/encrypted/utils/readEncryptedField.ts"],"sourcesContent":["import type { Payload, PayloadRequest } from 'payload'\nimport { withRawEncrypted } from '../rawRead'\nimport { ENCRYPTED_CONTEXT_KEY } from '../types'\nimport {\n\tdecryptFieldValue,\n\ttype EncryptedFieldTarget,\n\tresolveEncryptedField,\n} from './decryptFieldValue'\nimport { getAtPath } from './pageThrough'\n\nexport interface ReadEncryptedFieldArgs extends EncryptedFieldTarget {\n\t/** Document id; required with `collection`, ignored with `global`. */\n\tid?: number | string\n\t/**\n\t * Request to read on. Given one, the read joins its transaction and sees the\n\t * caller's uncommitted writes, which is what a secret written and used inside\n\t * the same operation needs. Omitted, the read runs on its own request and\n\t * therefore outside any transaction in progress. The request comes back as\n\t * it went in, except that one with no `context` at all gains an empty one,\n\t * which the raw window needs to carry its mode.\n\t */\n\treq?: PayloadRequest\n}\n\n/**\n * A deliberately read encrypted value. `ciphertext` is the raw stored wire\n * string (an array for `hasMany` fields), safe to hold in a cache; `decrypt()`\n * resolves keys at call time, so plaintext exists only for the moment it is\n * used. Rehydrate a persisted ciphertext later via `decryptFieldValue`.\n */\nexport interface EncryptedFieldHandle {\n\tciphertext: string | string[]\n\tdecrypt(): Promise<unknown>\n}\n\n/**\n * Which locale this read resolves at. An explicit argument wins, then the\n * request's, since the read joins it.\n *\n * `all` is not a locale but a request for every locale at once, which hands\n * back a `{ [locale]: value }` map where a handle addresses a single value. It\n * falls back to the default locale, which is what this helper reads with no\n * request at all: passing a `req` picks the transaction to read in, never which\n * value comes back.\n */\nconst readLocale = (\n\tpayload: Payload,\n\tlocale: string | undefined,\n\treq: PayloadRequest | undefined\n): string | undefined => {\n\tif (locale) {\n\t\treturn locale\n\t}\n\tif (!req?.locale) {\n\t\treturn undefined\n\t}\n\tif (req.locale !== 'all') {\n\t\treturn req.locale\n\t}\n\treturn payload.config.localization ? payload.config.localization.defaultLocale : undefined\n}\n\n/**\n * Fetches one encrypted field's stored ciphertext by path, bypassing the\n * decrypt-on-read pipeline (and the write-only response strip). Returns null\n * when the field holds no value, and throws when the document itself is\n * missing. This is THE supported way to use a `protection: 'writeOnly'` secret\n * server-side:\n *\n * ```ts\n * const secret = await readEncryptedField(payload, { global: 'settings', path: 'smtp.password' })\n * const password = await secret?.decrypt()\n * ```\n *\n * One document per call. To recover a field across many documents, run your own\n * query inside `withRawEncrypted` and pass each stored value to\n * `decryptFieldValue`; that keeps it to a single query and gives you the rest of\n * each document as well.\n *\n * Server-only and access-unchecked by design: calling it is the deliberate\n * act. Guard call sites accordingly, and never forward the result to a client.\n */\nexport const readEncryptedField = async (\n\tpayload: Payload,\n\targs: ReadEncryptedFieldArgs\n): Promise<EncryptedFieldHandle | null> => {\n\tconst { collection, global, id, locale, path, req } = args\n\tresolveEncryptedField(payload, args)\n\tif (collection && id == null) {\n\t\tthrow new Error(\n\t\t\t`@10x-media/fields: readEncryptedField needs an 'id' to read '${collection}.${path}'`\n\t\t)\n\t}\n\tconst resolvedLocale = readLocale(payload, locale, req)\n\tconst localeArg = resolvedLocale ? { locale: resolvedLocale as never } : {}\n\t// Without a request there is nothing to restore, so the mode rides on the\n\t// operation and Payload's own throwaway request carries it.\n\tconst modeArg = req ? {} : { context: { [ENCRYPTED_CONTEXT_KEY]: 'raw' } }\n\tconst read = () =>\n\t\tcollection\n\t\t\t? payload.findByID({\n\t\t\t\t\tcollection: collection as never,\n\t\t\t\t\tdepth: 0,\n\t\t\t\t\tid: id as number | string,\n\t\t\t\t\toverrideAccess: true,\n\t\t\t\t\treq,\n\t\t\t\t\t...modeArg,\n\t\t\t\t\t...localeArg,\n\t\t\t\t})\n\t\t\t: payload.findGlobal({\n\t\t\t\t\tdepth: 0,\n\t\t\t\t\toverrideAccess: true,\n\t\t\t\t\treq,\n\t\t\t\t\tslug: global as never,\n\t\t\t\t\t...modeArg,\n\t\t\t\t\t...localeArg,\n\t\t\t\t})\n\tconst doc = req ? await withRawEncrypted(req, read) : await read()\n\tconst value = getAtPath(doc as unknown as Record<string, unknown>, path)\n\tif (value == null) {\n\t\treturn null\n\t}\n\tconst target: EncryptedFieldTarget = { collection, global, locale: resolvedLocale, path }\n\tif (Array.isArray(value)) {\n\t\tconst items = value.filter((item): item is string => typeof item === 'string')\n\t\tif (items.length === 0) {\n\t\t\treturn null\n\t\t}\n\t\treturn {\n\t\t\tciphertext: items,\n\t\t\tdecrypt: () =>\n\t\t\t\tPromise.all(items.map((item) => decryptFieldValue(payload, { ...target, value: item }))),\n\t\t}\n\t}\n\tif (typeof value !== 'string') {\n\t\tthrow new Error(\n\t\t\t`@10x-media/fields: expected a stored wire string at '${(collection ?? global) as string}.${path}', got ${typeof value}`\n\t\t)\n\t}\n\treturn {\n\t\tciphertext: value,\n\t\tdecrypt: () => decryptFieldValue(payload, { ...target, value }),\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;AA6CA,MAAM,cACL,SACA,QACA,QACwB;CACxB,IAAI,QACH,OAAO;CAER,IAAI,CAAC,KAAK,QACT;CAED,IAAI,IAAI,WAAW,OAClB,OAAO,IAAI;CAEZ,OAAO,QAAQ,OAAO,eAAe,QAAQ,OAAO,aAAa,gBAAgB,KAAA;AAClF;;;;;;;;;;;;;;;;;;;;;AAsBA,MAAa,qBAAqB,OACjC,SACA,SAC0C;CAC1C,MAAM,EAAE,YAAY,QAAQ,IAAI,QAAQ,MAAM,QAAQ;CACtD,sBAAsB,SAAS,IAAI;CACnC,IAAI,cAAc,MAAM,MACvB,MAAM,IAAI,MACT,gEAAgE,WAAW,GAAG,KAAK,EACpF;CAED,MAAM,iBAAiB,WAAW,SAAS,QAAQ,GAAG;CACtD,MAAM,YAAY,iBAAiB,EAAE,QAAQ,eAAwB,IAAI,CAAC;CAG1E,MAAM,UAAU,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,wBAAwB,MAAM,EAAE;CACzE,MAAM,aACL,aACG,QAAQ,SAAS;EACL;EACZ,OAAO;EACH;EACJ,gBAAgB;EAChB;EACA,GAAG;EACH,GAAG;CACJ,CAAC,IACA,QAAQ,WAAW;EACnB,OAAO;EACP,gBAAgB;EAChB;EACA,MAAM;EACN,GAAG;EACH,GAAG;CACJ,CAAC;CAEJ,MAAM,QAAQ,UADF,MAAM,MAAM,iBAAiB,KAAK,IAAI,IAAI,MAAM,KAAK,GACE,IAAI;CACvE,IAAI,SAAS,MACZ,OAAO;CAER,MAAM,SAA+B;EAAE;EAAY;EAAQ,QAAQ;EAAgB;CAAK;CACxF,IAAI,MAAM,QAAQ,KAAK,GAAG;EACzB,MAAM,QAAQ,MAAM,QAAQ,SAAyB,OAAO,SAAS,QAAQ;EAC7E,IAAI,MAAM,WAAW,GACpB,OAAO;EAER,OAAO;GACN,YAAY;GACZ,eACC,QAAQ,IAAI,MAAM,KAAK,SAAS,kBAAkB,SAAS;IAAE,GAAG;IAAQ,OAAO;GAAK,CAAC,CAAC,CAAC;EACzF;CACD;CACA,IAAI,OAAO,UAAU,UACpB,MAAM,IAAI,MACT,wDAAyD,cAAc,OAAkB,GAAG,KAAK,SAAS,OAAO,OAClH;CAED,OAAO;EACN,YAAY;EACZ,eAAe,kBAAkB,SAAS;GAAE,GAAG;GAAQ;EAAM,CAAC;CAC/D;AACD"}
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { validateEncryptedBoot } from "./fields/encrypted/boot.js";
2
2
  import { getFieldsRegistry, setFieldsRegistry } from "./plugin/registry.js";
3
- import { withEncryptedQueryRewrite } from "./fields/encrypted/queryRewrite.js";
3
+ import { withEncryptedQueryRewrite, withEncryptedResponseStrip } from "./fields/encrypted/queryRewrite.js";
4
4
  import { registerIcon } from "./fields/icon/plugin.js";
5
5
  import { registerTranslations } from "./plugin/registerTranslations.js";
6
6
  import { definePlugin } from "payload";
@@ -27,6 +27,7 @@ const fields = definePlugin({
27
27
  setFieldsRegistry(config, normalizeRegistry(options));
28
28
  registerIcon(config, options.icon);
29
29
  config.collections = (config.collections ?? []).map(withEncryptedQueryRewrite);
30
+ config.globals = (config.globals ?? []).map(withEncryptedResponseStrip);
30
31
  const priorOnInit = config.onInit;
31
32
  config.onInit = async (payload) => {
32
33
  await validateEncryptedBoot(payload, options.encrypted?.keys);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import { type Config, definePlugin } from 'payload'\n\nimport { validateEncryptedBoot } from './fields/encrypted/boot'\nimport { withEncryptedQueryRewrite } from './fields/encrypted/queryRewrite'\nimport { registerIcon } from './fields/icon/plugin'\nimport { registerTranslations } from './plugin/registerTranslations'\nimport { setFieldsRegistry } from './plugin/registry'\nimport type { TranslationsOption } from './translations'\nimport type {\n\tColorGlobalConfig,\n\tEncryptedGlobalConfig,\n\tFieldsPluginRegistry,\n\tIconGlobalConfig,\n} from './types'\n\nexport type FieldsPluginOptions = {\n\t/**\n\t * Disable the plugin entirely (incoming config returned untouched).\n\t * Useful for opting out per environment without removing the plugin call.\n\t */\n\tdisabled?: boolean\n\t/**\n\t * Per-locale overrides for this plugin's UI strings, keyed by the typed\n\t * translation keys exported from `@10x-media/fields/i18n`. Values win over\n\t * the built-in locales key-by-key; locales the plugin does not ship are\n\t * added whole. App-level `i18n.translations` still wins over both.\n\t */\n\ttranslations?: TranslationsOption\n\t/** Global defaults for colorField(). Per-field options always win. */\n\tcolor?: ColorGlobalConfig\n\t/** Global defaults for iconField(). Per-field options always win. */\n\ticon?: IconGlobalConfig\n\t/** Global defaults for encryptedField(). Per-field options always win. */\n\tencrypted?: EncryptedGlobalConfig\n}\n\ndeclare module 'payload' {\n\tinterface RegisteredPlugins {\n\t\t'@10x-media/fields': FieldsPluginOptions\n\t}\n}\n\nconst normalizeRegistry = (options: FieldsPluginOptions): FieldsPluginRegistry => {\n\tconst registry: FieldsPluginRegistry = {}\n\tif (options.color) {\n\t\tregistry.color = options.color\n\t}\n\t// registry.icon is owned solely by registerIcon, which validates adapter\n\t// slugs and the default library before writing the normalized slice.\n\tif (options.encrypted) {\n\t\tregistry.encrypted = options.encrypted\n\t}\n\treturn registry\n}\n\n/**\n * Fields plugin for Payload v3. Registers translations and writes global field\n * defaults to `config.custom['@10x-media/fields']` for factories, hooks, and\n * server components to read at runtime via `getFieldsRegistry`. Every field\n * factory also works without this plugin; per-field options always override\n * these defaults. Authored with `definePlugin` so sibling plugins can detect\n * it by slug.\n */\nexport const fields = definePlugin<FieldsPluginOptions>({\n\tslug: '@10x-media/fields',\n\tplugin: ({ config, plugins: _plugins, ...options }): Config => {\n\t\tif (options.disabled === true) {\n\t\t\treturn config\n\t\t}\n\t\tregisterTranslations(config, options.translations)\n\t\tsetFieldsRegistry(config, normalizeRegistry(options))\n\t\t// Sole owner of registry.icon: validates adapters + default library and\n\t\t// registers their client components in admin.dependencies. A no-op when no\n\t\t// adapters are configured, leaving registry.icon unset.\n\t\tregisterIcon(config, options.icon)\n\t\t// Transparently rewrite equals/in on queryable encrypted fields to their\n\t\t// blind-index siblings; a no-op for collections that have none.\n\t\tconfig.collections = (config.collections ?? []).map(withEncryptedQueryRewrite)\n\t\t// Validate encrypted key material at boot, before any prior onInit runs, so\n\t\t// missing secrets or broken providers fail fast instead of on first write.\n\t\tconst priorOnInit = config.onInit\n\t\tconfig.onInit = async (payload) => {\n\t\t\tawait validateEncryptedBoot(payload, options.encrypted?.keys)\n\t\t\tawait priorOnInit?.(payload)\n\t\t}\n\t\treturn config\n\t},\n})\n\nexport { getFieldsRegistry } from './plugin/registry'\nexport type {\n\tColorFormat,\n\tColorGlobalConfig,\n\tColorPreset,\n\tDecryptFailurePolicy,\n\tEncryptedGlobalConfig,\n\tFieldsPluginRegistry,\n\tFieldsResolverArgs,\n\tIconAdapter,\n\tIconCanvas,\n\tIconGlobalConfig,\n\tIconLayer,\n\tIconLayerCache,\n\tIconLayerContext,\n\tIconManifest,\n\tIconMeta,\n\tIconRenderStrategy,\n\tKeysConfig,\n} from './types'\nexport type { FieldsPluginOptions as PluginOptions }\n"],"mappings":";;;;;;;AA0CA,MAAM,qBAAqB,YAAuD;CACjF,MAAM,WAAiC,CAAC;CACxC,IAAI,QAAQ,OACX,SAAS,QAAQ,QAAQ;CAI1B,IAAI,QAAQ,WACX,SAAS,YAAY,QAAQ;CAE9B,OAAO;AACR;;;;;;;;;AAUA,MAAa,SAAS,aAAkC;CACvD,MAAM;CACN,SAAS,EAAE,QAAQ,SAAS,UAAU,GAAG,cAAsB;EAC9D,IAAI,QAAQ,aAAa,MACxB,OAAO;EAER,qBAAqB,QAAQ,QAAQ,YAAY;EACjD,kBAAkB,QAAQ,kBAAkB,OAAO,CAAC;EAIpD,aAAa,QAAQ,QAAQ,IAAI;EAGjC,OAAO,eAAe,OAAO,eAAe,CAAC,GAAG,IAAI,yBAAyB;EAG7E,MAAM,cAAc,OAAO;EAC3B,OAAO,SAAS,OAAO,YAAY;GAClC,MAAM,sBAAsB,SAAS,QAAQ,WAAW,IAAI;GAC5D,MAAM,cAAc,OAAO;EAC5B;EACA,OAAO;CACR;AACD,CAAC"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import { type Config, definePlugin } from 'payload'\n\nimport { validateEncryptedBoot } from './fields/encrypted/boot'\nimport {\n\twithEncryptedQueryRewrite,\n\twithEncryptedResponseStrip,\n} from './fields/encrypted/queryRewrite'\nimport { registerIcon } from './fields/icon/plugin'\nimport { registerTranslations } from './plugin/registerTranslations'\nimport { setFieldsRegistry } from './plugin/registry'\nimport type { TranslationsOption } from './translations'\nimport type {\n\tColorGlobalConfig,\n\tEncryptedGlobalConfig,\n\tFieldsPluginRegistry,\n\tIconGlobalConfig,\n} from './types'\n\nexport type FieldsPluginOptions = {\n\t/**\n\t * Disable the plugin entirely (incoming config returned untouched).\n\t * Useful for opting out per environment without removing the plugin call.\n\t */\n\tdisabled?: boolean\n\t/**\n\t * Per-locale overrides for this plugin's UI strings, keyed by the typed\n\t * translation keys exported from `@10x-media/fields/i18n`. Values win over\n\t * the built-in locales key-by-key; locales the plugin does not ship are\n\t * added whole. App-level `i18n.translations` still wins over both.\n\t */\n\ttranslations?: TranslationsOption\n\t/** Global defaults for colorField(). Per-field options always win. */\n\tcolor?: ColorGlobalConfig\n\t/** Global defaults for iconField(). Per-field options always win. */\n\ticon?: IconGlobalConfig\n\t/** Global defaults for encryptedField(). Per-field options always win. */\n\tencrypted?: EncryptedGlobalConfig\n}\n\ndeclare module 'payload' {\n\tinterface RegisteredPlugins {\n\t\t'@10x-media/fields': FieldsPluginOptions\n\t}\n}\n\nconst normalizeRegistry = (options: FieldsPluginOptions): FieldsPluginRegistry => {\n\tconst registry: FieldsPluginRegistry = {}\n\tif (options.color) {\n\t\tregistry.color = options.color\n\t}\n\t// registry.icon is owned solely by registerIcon, which validates adapter\n\t// slugs and the default library before writing the normalized slice.\n\tif (options.encrypted) {\n\t\tregistry.encrypted = options.encrypted\n\t}\n\treturn registry\n}\n\n/**\n * Fields plugin for Payload v3. Registers translations and writes global field\n * defaults to `config.custom['@10x-media/fields']` for factories, hooks, and\n * server components to read at runtime via `getFieldsRegistry`. Every field\n * factory also works without this plugin; per-field options always override\n * these defaults. Authored with `definePlugin` so sibling plugins can detect\n * it by slug.\n */\nexport const fields = definePlugin<FieldsPluginOptions>({\n\tslug: '@10x-media/fields',\n\tplugin: ({ config, plugins: _plugins, ...options }): Config => {\n\t\tif (options.disabled === true) {\n\t\t\treturn config\n\t\t}\n\t\tregisterTranslations(config, options.translations)\n\t\tsetFieldsRegistry(config, normalizeRegistry(options))\n\t\t// Sole owner of registry.icon: validates adapters + default library and\n\t\t// registers their client components in admin.dependencies. A no-op when no\n\t\t// adapters are configured, leaving registry.icon unset.\n\t\tregisterIcon(config, options.icon)\n\t\t// Transparently rewrite equals/in on queryable encrypted fields to their\n\t\t// blind-index siblings; a no-op for collections that have none. Globals\n\t\t// take no where, so they get the response strip alone.\n\t\tconfig.collections = (config.collections ?? []).map(withEncryptedQueryRewrite)\n\t\tconfig.globals = (config.globals ?? []).map(withEncryptedResponseStrip)\n\t\t// Validate encrypted key material at boot, before any prior onInit runs, so\n\t\t// missing secrets or broken providers fail fast instead of on first write.\n\t\tconst priorOnInit = config.onInit\n\t\tconfig.onInit = async (payload) => {\n\t\t\tawait validateEncryptedBoot(payload, options.encrypted?.keys)\n\t\t\tawait priorOnInit?.(payload)\n\t\t}\n\t\treturn config\n\t},\n})\n\nexport { getFieldsRegistry } from './plugin/registry'\nexport type {\n\tColorFormat,\n\tColorGlobalConfig,\n\tColorPreset,\n\tDecryptFailurePolicy,\n\tEncryptedGlobalConfig,\n\tFieldsPluginRegistry,\n\tFieldsResolverArgs,\n\tIconAdapter,\n\tIconCanvas,\n\tIconGlobalConfig,\n\tIconLayer,\n\tIconLayerCache,\n\tIconLayerContext,\n\tIconManifest,\n\tIconMeta,\n\tIconRenderStrategy,\n\tKeysConfig,\n} from './types'\nexport type { FieldsPluginOptions as PluginOptions }\n"],"mappings":";;;;;;;AA6CA,MAAM,qBAAqB,YAAuD;CACjF,MAAM,WAAiC,CAAC;CACxC,IAAI,QAAQ,OACX,SAAS,QAAQ,QAAQ;CAI1B,IAAI,QAAQ,WACX,SAAS,YAAY,QAAQ;CAE9B,OAAO;AACR;;;;;;;;;AAUA,MAAa,SAAS,aAAkC;CACvD,MAAM;CACN,SAAS,EAAE,QAAQ,SAAS,UAAU,GAAG,cAAsB;EAC9D,IAAI,QAAQ,aAAa,MACxB,OAAO;EAER,qBAAqB,QAAQ,QAAQ,YAAY;EACjD,kBAAkB,QAAQ,kBAAkB,OAAO,CAAC;EAIpD,aAAa,QAAQ,QAAQ,IAAI;EAIjC,OAAO,eAAe,OAAO,eAAe,CAAC,GAAG,IAAI,yBAAyB;EAC7E,OAAO,WAAW,OAAO,WAAW,CAAC,GAAG,IAAI,0BAA0B;EAGtE,MAAM,cAAc,OAAO;EAC3B,OAAO,SAAS,OAAO,YAAY;GAClC,MAAM,sBAAsB,SAAS,QAAQ,WAAW,IAAI;GAC5D,MAAM,cAAc,OAAO;EAC5B;EACA,OAAO;CACR;AACD,CAAC"}
@@ -41,7 +41,14 @@ const de = {
41
41
  [keys.conceal]: "Verbergen",
42
42
  [keys.showValue]: "Wert anzeigen",
43
43
  [keys.hideValue]: "Wert verbergen",
44
- [keys.encryptedValue]: "Verschlüsselter Wert"
44
+ [keys.encryptedValue]: "Verschlüsselter Wert",
45
+ [keys.replaceValue]: "Wert ersetzen",
46
+ [keys.clearValue]: "Wert entfernen",
47
+ [keys.undoClear]: "Entfernen rückgängig machen",
48
+ [keys.clearedOnSave]: "Wird beim Speichern entfernt",
49
+ [keys.generateValue]: "Neuen Wert generieren",
50
+ [keys.writeOnlyValue]: "Nur schreibbarer verschlüsselter Wert",
51
+ [keys.secretNotSet]: "Nicht gesetzt"
45
52
  };
46
53
  //#endregion
47
54
  export { de };
@@ -1 +1 @@
1
- {"version":3,"file":"de.js","names":[],"sources":["../../src/translations/de.ts"],"sourcesContent":["import { keys, type TranslationKey } from './keys'\n\n/**\n * German values, keyed by the typed constants in `keys.ts` so the two stay in\n * lockstep. The `Record<TranslationKey, string>` annotation makes a missing or\n * unknown key a type error. `translations/index.ts` nests these for Payload.\n */\nexport const de: Record<TranslationKey, string> = {\n\t[keys.pluginName]: 'Fields',\n\t[keys.presets]: 'Voreinstellungen',\n\t[keys.fieldIconLabel]: 'Icon',\n\t[keys.fieldIconLibraryLabel]: 'Icon-Bibliothek',\n\t[keys.selectIcon]: 'Icon auswählen',\n\t[keys.clearIcon]: 'Icon entfernen',\n\t[keys.resultsCount]: '{{count}} Icons',\n\t[keys.textInputPlaceholder]: 'library:icon-name',\n\t[keys.invalidIconLibrary]: 'Unbekannte Icon-Bibliothek: {{library}}',\n\t[keys.invalidIconName]: 'Unbekanntes Icon \"{{name}}\" in Bibliothek {{library}}',\n\t[keys.invalidIconLibraryValue]: 'Keine registrierte Icon-Bibliothek: {{value}}',\n\t[keys.searchIcons]: 'Icons durchsuchen',\n\t[keys.noIconsFound]: 'Keine Icons gefunden',\n\t[keys.browseAll]: 'Alle durchsuchen',\n\t[keys.recent]: 'Zuletzt verwendet',\n\t[keys.allIcons]: 'Alle Icons',\n\t[keys.iconCategories]: 'Icon-Kategorien',\n\t[keys.iconGrid]: 'Symbole',\n\t[keys.libraryUnavailable]:\n\t\t'Diese Icon-Bibliothek ist nicht mehr verfügbar. Bitte einen Ersatz wählen.',\n\t[keys.iconUnavailable]: 'Nicht verfügbar',\n\t[keys.missingPreset]: 'Fehlende Voreinstellung',\n\t[keys.preset]: 'Voreinstellung',\n\t[keys.missingPresetHint]: 'Diese Voreinstellung existiert nicht mehr. Bitte einen Ersatz wählen.',\n\t[keys.invalidColor]: 'Ungültige Farbe',\n\t[keys.pickColor]: 'Farbe wählen',\n\t[keys.clearColor]: 'Farbe entfernen',\n\t[keys.eyedropperPick]: 'Farbe vom Bildschirm aufnehmen',\n\t[keys.hue]: 'Farbton',\n\t[keys.opacity]: 'Deckkraft',\n\t[keys.saturationBrightness]: 'Sättigung und Helligkeit',\n\t[keys.format]: 'Format',\n\t[keys.reveal]: 'Anzeigen',\n\t[keys.conceal]: 'Verbergen',\n\t[keys.showValue]: 'Wert anzeigen',\n\t[keys.hideValue]: 'Wert verbergen',\n\t[keys.encryptedValue]: 'Verschlüsselter Wert',\n}\n"],"mappings":";;;;;;;AAOA,MAAa,KAAqC;EAChD,KAAK,aAAa;EAClB,KAAK,UAAU;EACf,KAAK,iBAAiB;EACtB,KAAK,wBAAwB;EAC7B,KAAK,aAAa;EAClB,KAAK,YAAY;EACjB,KAAK,eAAe;EACpB,KAAK,uBAAuB;EAC5B,KAAK,qBAAqB;EAC1B,KAAK,kBAAkB;EACvB,KAAK,0BAA0B;EAC/B,KAAK,cAAc;EACnB,KAAK,eAAe;EACpB,KAAK,YAAY;EACjB,KAAK,SAAS;EACd,KAAK,WAAW;EAChB,KAAK,iBAAiB;EACtB,KAAK,WAAW;EAChB,KAAK,qBACL;EACA,KAAK,kBAAkB;EACvB,KAAK,gBAAgB;EACrB,KAAK,SAAS;EACd,KAAK,oBAAoB;EACzB,KAAK,eAAe;EACpB,KAAK,YAAY;EACjB,KAAK,aAAa;EAClB,KAAK,iBAAiB;EACtB,KAAK,MAAM;EACX,KAAK,UAAU;EACf,KAAK,uBAAuB;EAC5B,KAAK,SAAS;EACd,KAAK,SAAS;EACd,KAAK,UAAU;EACf,KAAK,YAAY;EACjB,KAAK,YAAY;EACjB,KAAK,iBAAiB;AACxB"}
1
+ {"version":3,"file":"de.js","names":[],"sources":["../../src/translations/de.ts"],"sourcesContent":["import { keys, type TranslationKey } from './keys'\n\n/**\n * German values, keyed by the typed constants in `keys.ts` so the two stay in\n * lockstep. The `Record<TranslationKey, string>` annotation makes a missing or\n * unknown key a type error. `translations/index.ts` nests these for Payload.\n */\nexport const de: Record<TranslationKey, string> = {\n\t[keys.pluginName]: 'Fields',\n\t[keys.presets]: 'Voreinstellungen',\n\t[keys.fieldIconLabel]: 'Icon',\n\t[keys.fieldIconLibraryLabel]: 'Icon-Bibliothek',\n\t[keys.selectIcon]: 'Icon auswählen',\n\t[keys.clearIcon]: 'Icon entfernen',\n\t[keys.resultsCount]: '{{count}} Icons',\n\t[keys.textInputPlaceholder]: 'library:icon-name',\n\t[keys.invalidIconLibrary]: 'Unbekannte Icon-Bibliothek: {{library}}',\n\t[keys.invalidIconName]: 'Unbekanntes Icon \"{{name}}\" in Bibliothek {{library}}',\n\t[keys.invalidIconLibraryValue]: 'Keine registrierte Icon-Bibliothek: {{value}}',\n\t[keys.searchIcons]: 'Icons durchsuchen',\n\t[keys.noIconsFound]: 'Keine Icons gefunden',\n\t[keys.browseAll]: 'Alle durchsuchen',\n\t[keys.recent]: 'Zuletzt verwendet',\n\t[keys.allIcons]: 'Alle Icons',\n\t[keys.iconCategories]: 'Icon-Kategorien',\n\t[keys.iconGrid]: 'Symbole',\n\t[keys.libraryUnavailable]:\n\t\t'Diese Icon-Bibliothek ist nicht mehr verfügbar. Bitte einen Ersatz wählen.',\n\t[keys.iconUnavailable]: 'Nicht verfügbar',\n\t[keys.missingPreset]: 'Fehlende Voreinstellung',\n\t[keys.preset]: 'Voreinstellung',\n\t[keys.missingPresetHint]: 'Diese Voreinstellung existiert nicht mehr. Bitte einen Ersatz wählen.',\n\t[keys.invalidColor]: 'Ungültige Farbe',\n\t[keys.pickColor]: 'Farbe wählen',\n\t[keys.clearColor]: 'Farbe entfernen',\n\t[keys.eyedropperPick]: 'Farbe vom Bildschirm aufnehmen',\n\t[keys.hue]: 'Farbton',\n\t[keys.opacity]: 'Deckkraft',\n\t[keys.saturationBrightness]: 'Sättigung und Helligkeit',\n\t[keys.format]: 'Format',\n\t[keys.reveal]: 'Anzeigen',\n\t[keys.conceal]: 'Verbergen',\n\t[keys.showValue]: 'Wert anzeigen',\n\t[keys.hideValue]: 'Wert verbergen',\n\t[keys.encryptedValue]: 'Verschlüsselter Wert',\n\t[keys.replaceValue]: 'Wert ersetzen',\n\t[keys.clearValue]: 'Wert entfernen',\n\t[keys.undoClear]: 'Entfernen rückgängig machen',\n\t[keys.clearedOnSave]: 'Wird beim Speichern entfernt',\n\t[keys.generateValue]: 'Neuen Wert generieren',\n\t[keys.writeOnlyValue]: 'Nur schreibbarer verschlüsselter Wert',\n\t[keys.secretNotSet]: 'Nicht gesetzt',\n}\n"],"mappings":";;;;;;;AAOA,MAAa,KAAqC;EAChD,KAAK,aAAa;EAClB,KAAK,UAAU;EACf,KAAK,iBAAiB;EACtB,KAAK,wBAAwB;EAC7B,KAAK,aAAa;EAClB,KAAK,YAAY;EACjB,KAAK,eAAe;EACpB,KAAK,uBAAuB;EAC5B,KAAK,qBAAqB;EAC1B,KAAK,kBAAkB;EACvB,KAAK,0BAA0B;EAC/B,KAAK,cAAc;EACnB,KAAK,eAAe;EACpB,KAAK,YAAY;EACjB,KAAK,SAAS;EACd,KAAK,WAAW;EAChB,KAAK,iBAAiB;EACtB,KAAK,WAAW;EAChB,KAAK,qBACL;EACA,KAAK,kBAAkB;EACvB,KAAK,gBAAgB;EACrB,KAAK,SAAS;EACd,KAAK,oBAAoB;EACzB,KAAK,eAAe;EACpB,KAAK,YAAY;EACjB,KAAK,aAAa;EAClB,KAAK,iBAAiB;EACtB,KAAK,MAAM;EACX,KAAK,UAAU;EACf,KAAK,uBAAuB;EAC5B,KAAK,SAAS;EACd,KAAK,SAAS;EACd,KAAK,UAAU;EACf,KAAK,YAAY;EACjB,KAAK,YAAY;EACjB,KAAK,iBAAiB;EACtB,KAAK,eAAe;EACpB,KAAK,aAAa;EAClB,KAAK,YAAY;EACjB,KAAK,gBAAgB;EACrB,KAAK,gBAAgB;EACrB,KAAK,iBAAiB;EACtB,KAAK,eAAe;AACtB"}
@@ -41,7 +41,14 @@ const en = {
41
41
  [keys.conceal]: "Conceal",
42
42
  [keys.showValue]: "Show value",
43
43
  [keys.hideValue]: "Hide value",
44
- [keys.encryptedValue]: "Encrypted value"
44
+ [keys.encryptedValue]: "Encrypted value",
45
+ [keys.replaceValue]: "Replace value",
46
+ [keys.clearValue]: "Clear value",
47
+ [keys.undoClear]: "Undo clear",
48
+ [keys.clearedOnSave]: "Will be removed on save",
49
+ [keys.generateValue]: "Generate new value",
50
+ [keys.writeOnlyValue]: "Write-only encrypted value",
51
+ [keys.secretNotSet]: "Not set"
45
52
  };
46
53
  //#endregion
47
54
  export { en };
@@ -1 +1 @@
1
- {"version":3,"file":"en.js","names":[],"sources":["../../src/translations/en.ts"],"sourcesContent":["import { keys, type TranslationKey } from './keys'\n\n/**\n * English values, keyed by the typed constants in `keys.ts` so the two stay in\n * lockstep. The `Record<TranslationKey, string>` annotation makes a missing or\n * unknown key a type error. `translations/index.ts` nests these for Payload.\n */\nexport const en: Record<TranslationKey, string> = {\n\t[keys.pluginName]: 'Fields',\n\t[keys.presets]: 'Presets',\n\t[keys.fieldIconLabel]: 'Icon',\n\t[keys.fieldIconLibraryLabel]: 'Icon library',\n\t[keys.selectIcon]: 'Select icon',\n\t[keys.clearIcon]: 'Clear icon',\n\t[keys.resultsCount]: '{{count}} icons',\n\t[keys.textInputPlaceholder]: 'library:icon-name',\n\t[keys.invalidIconLibrary]: 'Unknown icon library: {{library}}',\n\t[keys.invalidIconName]: 'Unknown icon \"{{name}}\" in library {{library}}',\n\t[keys.invalidIconLibraryValue]: 'Not a registered icon library: {{value}}',\n\t[keys.searchIcons]: 'Search icons',\n\t[keys.noIconsFound]: 'No icons found',\n\t[keys.browseAll]: 'Browse all',\n\t[keys.recent]: 'Recent',\n\t[keys.allIcons]: 'All icons',\n\t[keys.iconCategories]: 'Icon categories',\n\t[keys.iconGrid]: 'Icons',\n\t[keys.libraryUnavailable]: 'This icon library is no longer available. Choose a replacement.',\n\t[keys.iconUnavailable]: 'Unavailable',\n\t[keys.missingPreset]: 'Missing preset',\n\t[keys.preset]: 'Preset',\n\t[keys.missingPresetHint]: 'This preset no longer exists. Pick a replacement.',\n\t[keys.invalidColor]: 'Invalid color',\n\t[keys.pickColor]: 'Pick a color',\n\t[keys.clearColor]: 'Clear color',\n\t[keys.eyedropperPick]: 'Pick color from screen',\n\t[keys.hue]: 'Hue',\n\t[keys.opacity]: 'Opacity',\n\t[keys.saturationBrightness]: 'Saturation and brightness',\n\t[keys.format]: 'Format',\n\t[keys.reveal]: 'Reveal',\n\t[keys.conceal]: 'Conceal',\n\t[keys.showValue]: 'Show value',\n\t[keys.hideValue]: 'Hide value',\n\t[keys.encryptedValue]: 'Encrypted value',\n}\n"],"mappings":";;;;;;;AAOA,MAAa,KAAqC;EAChD,KAAK,aAAa;EAClB,KAAK,UAAU;EACf,KAAK,iBAAiB;EACtB,KAAK,wBAAwB;EAC7B,KAAK,aAAa;EAClB,KAAK,YAAY;EACjB,KAAK,eAAe;EACpB,KAAK,uBAAuB;EAC5B,KAAK,qBAAqB;EAC1B,KAAK,kBAAkB;EACvB,KAAK,0BAA0B;EAC/B,KAAK,cAAc;EACnB,KAAK,eAAe;EACpB,KAAK,YAAY;EACjB,KAAK,SAAS;EACd,KAAK,WAAW;EAChB,KAAK,iBAAiB;EACtB,KAAK,WAAW;EAChB,KAAK,qBAAqB;EAC1B,KAAK,kBAAkB;EACvB,KAAK,gBAAgB;EACrB,KAAK,SAAS;EACd,KAAK,oBAAoB;EACzB,KAAK,eAAe;EACpB,KAAK,YAAY;EACjB,KAAK,aAAa;EAClB,KAAK,iBAAiB;EACtB,KAAK,MAAM;EACX,KAAK,UAAU;EACf,KAAK,uBAAuB;EAC5B,KAAK,SAAS;EACd,KAAK,SAAS;EACd,KAAK,UAAU;EACf,KAAK,YAAY;EACjB,KAAK,YAAY;EACjB,KAAK,iBAAiB;AACxB"}
1
+ {"version":3,"file":"en.js","names":[],"sources":["../../src/translations/en.ts"],"sourcesContent":["import { keys, type TranslationKey } from './keys'\n\n/**\n * English values, keyed by the typed constants in `keys.ts` so the two stay in\n * lockstep. The `Record<TranslationKey, string>` annotation makes a missing or\n * unknown key a type error. `translations/index.ts` nests these for Payload.\n */\nexport const en: Record<TranslationKey, string> = {\n\t[keys.pluginName]: 'Fields',\n\t[keys.presets]: 'Presets',\n\t[keys.fieldIconLabel]: 'Icon',\n\t[keys.fieldIconLibraryLabel]: 'Icon library',\n\t[keys.selectIcon]: 'Select icon',\n\t[keys.clearIcon]: 'Clear icon',\n\t[keys.resultsCount]: '{{count}} icons',\n\t[keys.textInputPlaceholder]: 'library:icon-name',\n\t[keys.invalidIconLibrary]: 'Unknown icon library: {{library}}',\n\t[keys.invalidIconName]: 'Unknown icon \"{{name}}\" in library {{library}}',\n\t[keys.invalidIconLibraryValue]: 'Not a registered icon library: {{value}}',\n\t[keys.searchIcons]: 'Search icons',\n\t[keys.noIconsFound]: 'No icons found',\n\t[keys.browseAll]: 'Browse all',\n\t[keys.recent]: 'Recent',\n\t[keys.allIcons]: 'All icons',\n\t[keys.iconCategories]: 'Icon categories',\n\t[keys.iconGrid]: 'Icons',\n\t[keys.libraryUnavailable]: 'This icon library is no longer available. Choose a replacement.',\n\t[keys.iconUnavailable]: 'Unavailable',\n\t[keys.missingPreset]: 'Missing preset',\n\t[keys.preset]: 'Preset',\n\t[keys.missingPresetHint]: 'This preset no longer exists. Pick a replacement.',\n\t[keys.invalidColor]: 'Invalid color',\n\t[keys.pickColor]: 'Pick a color',\n\t[keys.clearColor]: 'Clear color',\n\t[keys.eyedropperPick]: 'Pick color from screen',\n\t[keys.hue]: 'Hue',\n\t[keys.opacity]: 'Opacity',\n\t[keys.saturationBrightness]: 'Saturation and brightness',\n\t[keys.format]: 'Format',\n\t[keys.reveal]: 'Reveal',\n\t[keys.conceal]: 'Conceal',\n\t[keys.showValue]: 'Show value',\n\t[keys.hideValue]: 'Hide value',\n\t[keys.encryptedValue]: 'Encrypted value',\n\t[keys.replaceValue]: 'Replace value',\n\t[keys.clearValue]: 'Clear value',\n\t[keys.undoClear]: 'Undo clear',\n\t[keys.clearedOnSave]: 'Will be removed on save',\n\t[keys.generateValue]: 'Generate new value',\n\t[keys.writeOnlyValue]: 'Write-only encrypted value',\n\t[keys.secretNotSet]: 'Not set',\n}\n"],"mappings":";;;;;;;AAOA,MAAa,KAAqC;EAChD,KAAK,aAAa;EAClB,KAAK,UAAU;EACf,KAAK,iBAAiB;EACtB,KAAK,wBAAwB;EAC7B,KAAK,aAAa;EAClB,KAAK,YAAY;EACjB,KAAK,eAAe;EACpB,KAAK,uBAAuB;EAC5B,KAAK,qBAAqB;EAC1B,KAAK,kBAAkB;EACvB,KAAK,0BAA0B;EAC/B,KAAK,cAAc;EACnB,KAAK,eAAe;EACpB,KAAK,YAAY;EACjB,KAAK,SAAS;EACd,KAAK,WAAW;EAChB,KAAK,iBAAiB;EACtB,KAAK,WAAW;EAChB,KAAK,qBAAqB;EAC1B,KAAK,kBAAkB;EACvB,KAAK,gBAAgB;EACrB,KAAK,SAAS;EACd,KAAK,oBAAoB;EACzB,KAAK,eAAe;EACpB,KAAK,YAAY;EACjB,KAAK,aAAa;EAClB,KAAK,iBAAiB;EACtB,KAAK,MAAM;EACX,KAAK,UAAU;EACf,KAAK,uBAAuB;EAC5B,KAAK,SAAS;EACd,KAAK,SAAS;EACd,KAAK,UAAU;EACf,KAAK,YAAY;EACjB,KAAK,YAAY;EACjB,KAAK,iBAAiB;EACtB,KAAK,eAAe;EACpB,KAAK,aAAa;EAClB,KAAK,YAAY;EACjB,KAAK,gBAAgB;EACrB,KAAK,gBAAgB;EACrB,KAAK,iBAAiB;EACtB,KAAK,eAAe;AACtB"}
@@ -41,6 +41,13 @@ declare const keys: {
41
41
  readonly showValue: "fields:showValue";
42
42
  readonly hideValue: "fields:hideValue";
43
43
  readonly encryptedValue: "fields:encryptedValue";
44
+ readonly replaceValue: "fields:replaceValue";
45
+ readonly clearValue: "fields:clearValue";
46
+ readonly undoClear: "fields:undoClear";
47
+ readonly clearedOnSave: "fields:clearedOnSave";
48
+ readonly generateValue: "fields:generateValue";
49
+ readonly writeOnlyValue: "fields:writeOnlyValue";
50
+ readonly secretNotSet: "fields:secretNotSet";
44
51
  };
45
52
  type TranslationKey = (typeof keys)[keyof typeof keys];
46
53
  //#endregion
@@ -40,7 +40,14 @@ const keys = {
40
40
  conceal: "fields:conceal",
41
41
  showValue: "fields:showValue",
42
42
  hideValue: "fields:hideValue",
43
- encryptedValue: "fields:encryptedValue"
43
+ encryptedValue: "fields:encryptedValue",
44
+ replaceValue: "fields:replaceValue",
45
+ clearValue: "fields:clearValue",
46
+ undoClear: "fields:undoClear",
47
+ clearedOnSave: "fields:clearedOnSave",
48
+ generateValue: "fields:generateValue",
49
+ writeOnlyValue: "fields:writeOnlyValue",
50
+ secretNotSet: "fields:secretNotSet"
44
51
  };
45
52
  //#endregion
46
53
  export { keys };
@@ -1 +1 @@
1
- {"version":3,"file":"keys.js","names":[],"sources":["../../src/translations/keys.ts"],"sourcesContent":["/**\n * Typed translation keys. Lookups must go through these constants, not string\n * literals (enforced by requireI18nKeysTyped.grit). Every key here must have a\n * value in every locale (`en.ts`, `de.ts`), or it is a type error.\n */\nexport const keys = {\n\tpluginName: 'fields:pluginName',\n\tpresets: 'fields:presets',\n\tfieldIconLabel: 'fields:fieldIconLabel',\n\tfieldIconLibraryLabel: 'fields:fieldIconLibraryLabel',\n\tselectIcon: 'fields:selectIcon',\n\tclearIcon: 'fields:clearIcon',\n\tresultsCount: 'fields:resultsCount',\n\ttextInputPlaceholder: 'fields:textInputPlaceholder',\n\tinvalidIconLibrary: 'fields:invalidIconLibrary',\n\tinvalidIconName: 'fields:invalidIconName',\n\tinvalidIconLibraryValue: 'fields:invalidIconLibraryValue',\n\tsearchIcons: 'fields:searchIcons',\n\tnoIconsFound: 'fields:noIconsFound',\n\tbrowseAll: 'fields:browseAll',\n\trecent: 'fields:recent',\n\tallIcons: 'fields:allIcons',\n\ticonCategories: 'fields:iconCategories',\n\ticonGrid: 'fields:iconGrid',\n\tlibraryUnavailable: 'fields:libraryUnavailable',\n\ticonUnavailable: 'fields:iconUnavailable',\n\tmissingPreset: 'fields:missingPreset',\n\tpreset: 'fields:preset',\n\tmissingPresetHint: 'fields:missingPresetHint',\n\tinvalidColor: 'fields:invalidColor',\n\tpickColor: 'fields:pickColor',\n\tclearColor: 'fields:clearColor',\n\teyedropperPick: 'fields:eyedropperPick',\n\thue: 'fields:hue',\n\topacity: 'fields:opacity',\n\tsaturationBrightness: 'fields:saturationBrightness',\n\tformat: 'fields:format',\n\treveal: 'fields:reveal',\n\tconceal: 'fields:conceal',\n\tshowValue: 'fields:showValue',\n\thideValue: 'fields:hideValue',\n\tencryptedValue: 'fields:encryptedValue',\n} as const\n\nexport type TranslationKey = (typeof keys)[keyof typeof keys]\n"],"mappings":";;;;;;AAKA,MAAa,OAAO;CACnB,YAAY;CACZ,SAAS;CACT,gBAAgB;CAChB,uBAAuB;CACvB,YAAY;CACZ,WAAW;CACX,cAAc;CACd,sBAAsB;CACtB,oBAAoB;CACpB,iBAAiB;CACjB,yBAAyB;CACzB,aAAa;CACb,cAAc;CACd,WAAW;CACX,QAAQ;CACR,UAAU;CACV,gBAAgB;CAChB,UAAU;CACV,oBAAoB;CACpB,iBAAiB;CACjB,eAAe;CACf,QAAQ;CACR,mBAAmB;CACnB,cAAc;CACd,WAAW;CACX,YAAY;CACZ,gBAAgB;CAChB,KAAK;CACL,SAAS;CACT,sBAAsB;CACtB,QAAQ;CACR,QAAQ;CACR,SAAS;CACT,WAAW;CACX,WAAW;CACX,gBAAgB;AACjB"}
1
+ {"version":3,"file":"keys.js","names":[],"sources":["../../src/translations/keys.ts"],"sourcesContent":["/**\n * Typed translation keys. Lookups must go through these constants, not string\n * literals (enforced by requireI18nKeysTyped.grit). Every key here must have a\n * value in every locale (`en.ts`, `de.ts`), or it is a type error.\n */\nexport const keys = {\n\tpluginName: 'fields:pluginName',\n\tpresets: 'fields:presets',\n\tfieldIconLabel: 'fields:fieldIconLabel',\n\tfieldIconLibraryLabel: 'fields:fieldIconLibraryLabel',\n\tselectIcon: 'fields:selectIcon',\n\tclearIcon: 'fields:clearIcon',\n\tresultsCount: 'fields:resultsCount',\n\ttextInputPlaceholder: 'fields:textInputPlaceholder',\n\tinvalidIconLibrary: 'fields:invalidIconLibrary',\n\tinvalidIconName: 'fields:invalidIconName',\n\tinvalidIconLibraryValue: 'fields:invalidIconLibraryValue',\n\tsearchIcons: 'fields:searchIcons',\n\tnoIconsFound: 'fields:noIconsFound',\n\tbrowseAll: 'fields:browseAll',\n\trecent: 'fields:recent',\n\tallIcons: 'fields:allIcons',\n\ticonCategories: 'fields:iconCategories',\n\ticonGrid: 'fields:iconGrid',\n\tlibraryUnavailable: 'fields:libraryUnavailable',\n\ticonUnavailable: 'fields:iconUnavailable',\n\tmissingPreset: 'fields:missingPreset',\n\tpreset: 'fields:preset',\n\tmissingPresetHint: 'fields:missingPresetHint',\n\tinvalidColor: 'fields:invalidColor',\n\tpickColor: 'fields:pickColor',\n\tclearColor: 'fields:clearColor',\n\teyedropperPick: 'fields:eyedropperPick',\n\thue: 'fields:hue',\n\topacity: 'fields:opacity',\n\tsaturationBrightness: 'fields:saturationBrightness',\n\tformat: 'fields:format',\n\treveal: 'fields:reveal',\n\tconceal: 'fields:conceal',\n\tshowValue: 'fields:showValue',\n\thideValue: 'fields:hideValue',\n\tencryptedValue: 'fields:encryptedValue',\n\treplaceValue: 'fields:replaceValue',\n\tclearValue: 'fields:clearValue',\n\tundoClear: 'fields:undoClear',\n\tclearedOnSave: 'fields:clearedOnSave',\n\tgenerateValue: 'fields:generateValue',\n\twriteOnlyValue: 'fields:writeOnlyValue',\n\tsecretNotSet: 'fields:secretNotSet',\n} as const\n\nexport type TranslationKey = (typeof keys)[keyof typeof keys]\n"],"mappings":";;;;;;AAKA,MAAa,OAAO;CACnB,YAAY;CACZ,SAAS;CACT,gBAAgB;CAChB,uBAAuB;CACvB,YAAY;CACZ,WAAW;CACX,cAAc;CACd,sBAAsB;CACtB,oBAAoB;CACpB,iBAAiB;CACjB,yBAAyB;CACzB,aAAa;CACb,cAAc;CACd,WAAW;CACX,QAAQ;CACR,UAAU;CACV,gBAAgB;CAChB,UAAU;CACV,oBAAoB;CACpB,iBAAiB;CACjB,eAAe;CACf,QAAQ;CACR,mBAAmB;CACnB,cAAc;CACd,WAAW;CACX,YAAY;CACZ,gBAAgB;CAChB,KAAK;CACL,SAAS;CACT,sBAAsB;CACtB,QAAQ;CACR,QAAQ;CACR,SAAS;CACT,WAAW;CACX,WAAW;CACX,gBAAgB;CAChB,cAAc;CACd,YAAY;CACZ,WAAW;CACX,eAAe;CACf,eAAe;CACf,gBAAgB;CAChB,cAAc;AACf"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@10x-media/fields",
3
- "version": "0.1.0-beta.4",
3
+ "version": "0.1.0-beta.5",
4
4
  "description": "Reusable admin fields for Payload: color picker, icon picker, encrypted fields, and more",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -159,10 +159,10 @@
159
159
  "tsx": "^4.19.2",
160
160
  "typescript": "5.9.3",
161
161
  "vitest": "4.1.7",
162
- "@10x-media/tsconfig": "0.0.0",
163
- "@10x-media/vitest-config": "0.0.0",
164
162
  "@10x-media/tsdown-config": "0.0.0",
165
- "@10x-media/payload-test-harness": "0.0.0"
163
+ "@10x-media/tsconfig": "0.0.0",
164
+ "@10x-media/payload-test-harness": "0.0.0",
165
+ "@10x-media/vitest-config": "0.0.0"
166
166
  },
167
167
  "publishConfig": {
168
168
  "access": "public"
@@ -176,8 +176,8 @@
176
176
  "test:unit": "vitest run src",
177
177
  "test:int": "vitest run tests/int",
178
178
  "test:dist": "REQUIRE_DIST=1 vitest run --passWithNoTests=false tests/dist",
179
- "test:matrix": "DB_MATRIX=mongo vitest run tests/int/matrix.int.spec.ts tests/int/color.int.spec.ts tests/int/color-schemes.int.spec.ts tests/int/color-format.int.spec.ts tests/int/icon.int.spec.ts tests/int/encrypted.int.spec.ts tests/int/encrypted-query.int.spec.ts && DB_MATRIX=postgres vitest run tests/int/matrix.int.spec.ts tests/int/color.int.spec.ts tests/int/color-schemes.int.spec.ts tests/int/color-format.int.spec.ts tests/int/icon.int.spec.ts tests/int/encrypted.int.spec.ts tests/int/encrypted-query.int.spec.ts",
180
- "test:container": "TEST_DB=container DB_MATRIX=mongo vitest run tests/int/matrix.int.spec.ts tests/int/color.int.spec.ts tests/int/color-schemes.int.spec.ts tests/int/color-format.int.spec.ts tests/int/icon.int.spec.ts tests/int/encrypted.int.spec.ts tests/int/encrypted-query.int.spec.ts && TEST_DB=container DB_MATRIX=postgres vitest run tests/int/matrix.int.spec.ts tests/int/color.int.spec.ts tests/int/color-schemes.int.spec.ts tests/int/color-format.int.spec.ts tests/int/icon.int.spec.ts tests/int/encrypted.int.spec.ts tests/int/encrypted-query.int.spec.ts",
179
+ "test:matrix": "bash scripts/test-int-matrix.sh",
180
+ "test:container": "TEST_DB=container bash scripts/test-int-matrix.sh",
181
181
  "test:e2e": "bash scripts/e2e.sh",
182
182
  "dev": "pnpm --filter @10x-media/fields-dev dev",
183
183
  "start": "pnpm --filter @10x-media/fields-dev start",