@10x-media/fields 0.1.0-beta.6 → 0.1.0-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/README.md +3 -1
- package/dist/exports/client.d.ts +4 -1
- package/dist/exports/client.js +4 -1
- package/dist/exports/measurement-utils.d.ts +9 -0
- package/dist/exports/measurement-utils.js +8 -0
- package/dist/exports/measurement.d.ts +11 -0
- package/dist/exports/measurement.js +10 -0
- package/dist/exports/rsc.d.ts +3 -1
- package/dist/exports/rsc.js +3 -1
- package/dist/fields/icon/client/icon-field.css +4 -2
- package/dist/fields/measurement/client/MeasurementCell.d.ts +18 -0
- package/dist/fields/measurement/client/MeasurementCell.js +47 -0
- package/dist/fields/measurement/client/MeasurementCell.js.map +1 -0
- package/dist/fields/measurement/client/MeasurementField.d.ts +11 -0
- package/dist/fields/measurement/client/MeasurementField.js +386 -0
- package/dist/fields/measurement/client/MeasurementField.js.map +1 -0
- package/dist/fields/measurement/client/MeasurementUnitsProvider.d.ts +24 -0
- package/dist/fields/measurement/client/MeasurementUnitsProvider.js +61 -0
- package/dist/fields/measurement/client/MeasurementUnitsProvider.js.map +1 -0
- package/dist/fields/measurement/client/editModel.js +115 -0
- package/dist/fields/measurement/client/editModel.js.map +1 -0
- package/dist/fields/measurement/client/measurementCell.css +4 -0
- package/dist/fields/measurement/client/measurementField.css +215 -0
- package/dist/fields/measurement/engine/convert.d.ts +8 -0
- package/dist/fields/measurement/engine/convert.js +21 -0
- package/dist/fields/measurement/engine/convert.js.map +1 -0
- package/dist/fields/measurement/engine/format.d.ts +37 -0
- package/dist/fields/measurement/engine/format.js +156 -0
- package/dist/fields/measurement/engine/format.js.map +1 -0
- package/dist/fields/measurement/engine/locale.d.ts +25 -0
- package/dist/fields/measurement/engine/locale.js +79 -0
- package/dist/fields/measurement/engine/locale.js.map +1 -0
- package/dist/fields/measurement/engine/precision.d.ts +34 -0
- package/dist/fields/measurement/engine/precision.js +63 -0
- package/dist/fields/measurement/engine/precision.js.map +1 -0
- package/dist/fields/measurement/engine/registry.d.ts +55 -0
- package/dist/fields/measurement/engine/registry.js +117 -0
- package/dist/fields/measurement/engine/registry.js.map +1 -0
- package/dist/fields/measurement/engine/units.d.ts +178 -0
- package/dist/fields/measurement/engine/units.js +198 -0
- package/dist/fields/measurement/engine/units.js.map +1 -0
- package/dist/fields/measurement/measurementField.d.ts +17 -0
- package/dist/fields/measurement/measurementField.js +139 -0
- package/dist/fields/measurement/measurementField.js.map +1 -0
- package/dist/fields/measurement/options.d.ts +76 -0
- package/dist/fields/measurement/options.js +9 -0
- package/dist/fields/measurement/options.js.map +1 -0
- package/dist/fields/measurement/presets.d.ts +117 -0
- package/dist/fields/measurement/presets.js +136 -0
- package/dist/fields/measurement/presets.js.map +1 -0
- package/dist/fields/measurement/server/MeasurementCellServer.d.ts +21 -0
- package/dist/fields/measurement/server/MeasurementCellServer.js +53 -0
- package/dist/fields/measurement/server/MeasurementCellServer.js.map +1 -0
- package/dist/fields/measurement/server/MeasurementFieldServer.d.ts +16 -0
- package/dist/fields/measurement/server/MeasurementFieldServer.js +45 -0
- package/dist/fields/measurement/server/MeasurementFieldServer.js.map +1 -0
- package/dist/fields/measurement/server/getUserUnits.js +39 -0
- package/dist/fields/measurement/server/getUserUnits.js.map +1 -0
- package/dist/fields/measurement/server/resolvePrecisionSafe.js +24 -0
- package/dist/fields/measurement/server/resolvePrecisionSafe.js.map +1 -0
- package/dist/fields/measurement/server/resolveRegistryDefault.js +26 -0
- package/dist/fields/measurement/server/resolveRegistryDefault.js.map +1 -0
- package/dist/index.d.ts +4 -3
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -1
- package/dist/translations/ar.js +4 -1
- package/dist/translations/ar.js.map +1 -1
- package/dist/translations/de.js +4 -1
- package/dist/translations/de.js.map +1 -1
- package/dist/translations/en.js +4 -1
- package/dist/translations/en.js.map +1 -1
- package/dist/translations/es.js +4 -1
- package/dist/translations/es.js.map +1 -1
- package/dist/translations/fr.js +4 -1
- package/dist/translations/fr.js.map +1 -1
- package/dist/translations/id.js +4 -1
- package/dist/translations/id.js.map +1 -1
- package/dist/translations/keys.d.ts +3 -0
- package/dist/translations/keys.js +4 -1
- package/dist/translations/keys.js.map +1 -1
- package/dist/translations/ko.js +4 -1
- package/dist/translations/ko.js.map +1 -1
- package/dist/translations/pt.js +4 -1
- package/dist/translations/pt.js.map +1 -1
- package/dist/translations/ru.js +4 -1
- package/dist/translations/ru.js.map +1 -1
- package/dist/translations/uk.js +4 -1
- package/dist/translations/uk.js.map +1 -1
- package/dist/translations/zh.js +4 -1
- package/dist/translations/zh.js.map +1 -1
- package/dist/types.d.ts +20 -1
- package/package.json +13 -3
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
//#region src/fields/measurement/presets.ts
|
|
2
|
+
/**
|
|
3
|
+
* Curated starting points, spread into measurementField() and overridden per field.
|
|
4
|
+
* The preference keys are data: renaming one orphans every unit a user already saved.
|
|
5
|
+
*/
|
|
6
|
+
const presets = {
|
|
7
|
+
bodyWeight: {
|
|
8
|
+
storageUnit: "kg",
|
|
9
|
+
units: [
|
|
10
|
+
"kg",
|
|
11
|
+
"lb",
|
|
12
|
+
"st-lb"
|
|
13
|
+
],
|
|
14
|
+
preferenceKey: "bodyWeight",
|
|
15
|
+
name: "weight",
|
|
16
|
+
localeDefaults: {
|
|
17
|
+
metric: "kg",
|
|
18
|
+
us: "lb",
|
|
19
|
+
uk: "st-lb"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
personHeight: {
|
|
23
|
+
storageUnit: "cm",
|
|
24
|
+
units: [
|
|
25
|
+
"cm",
|
|
26
|
+
"m",
|
|
27
|
+
"in",
|
|
28
|
+
"ft-in"
|
|
29
|
+
],
|
|
30
|
+
preferenceKey: "personHeight",
|
|
31
|
+
name: "height",
|
|
32
|
+
localeDefaults: {
|
|
33
|
+
metric: "cm",
|
|
34
|
+
us: "ft-in",
|
|
35
|
+
uk: "ft-in"
|
|
36
|
+
},
|
|
37
|
+
precision: { display: { cm: 1 } }
|
|
38
|
+
},
|
|
39
|
+
distance: {
|
|
40
|
+
storageUnit: "km",
|
|
41
|
+
units: [
|
|
42
|
+
"m",
|
|
43
|
+
"km",
|
|
44
|
+
"mi"
|
|
45
|
+
],
|
|
46
|
+
preferenceKey: "distance",
|
|
47
|
+
name: "distance",
|
|
48
|
+
localeDefaults: {
|
|
49
|
+
metric: "km",
|
|
50
|
+
us: "mi",
|
|
51
|
+
uk: "mi"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
mass: {
|
|
55
|
+
storageUnit: "kg",
|
|
56
|
+
units: [
|
|
57
|
+
"g",
|
|
58
|
+
"kg",
|
|
59
|
+
"oz",
|
|
60
|
+
"lb"
|
|
61
|
+
],
|
|
62
|
+
preferenceKey: "mass",
|
|
63
|
+
name: "mass",
|
|
64
|
+
localeDefaults: {
|
|
65
|
+
metric: "kg",
|
|
66
|
+
us: "lb",
|
|
67
|
+
uk: "lb"
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
length: {
|
|
71
|
+
storageUnit: "cm",
|
|
72
|
+
units: [
|
|
73
|
+
"mm",
|
|
74
|
+
"cm",
|
|
75
|
+
"m",
|
|
76
|
+
"km",
|
|
77
|
+
"in",
|
|
78
|
+
"ft",
|
|
79
|
+
"yd",
|
|
80
|
+
"mi"
|
|
81
|
+
],
|
|
82
|
+
preferenceKey: "length",
|
|
83
|
+
name: "length",
|
|
84
|
+
localeDefaults: {
|
|
85
|
+
metric: "cm",
|
|
86
|
+
us: "in",
|
|
87
|
+
uk: "in"
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
volume: {
|
|
91
|
+
storageUnit: "l",
|
|
92
|
+
units: [
|
|
93
|
+
"ml",
|
|
94
|
+
"l",
|
|
95
|
+
"fl-oz",
|
|
96
|
+
"gal"
|
|
97
|
+
],
|
|
98
|
+
preferenceKey: "volume",
|
|
99
|
+
name: "volume",
|
|
100
|
+
localeDefaults: {
|
|
101
|
+
metric: "l",
|
|
102
|
+
us: "fl-oz",
|
|
103
|
+
uk: "l"
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
temperature: {
|
|
107
|
+
storageUnit: "c",
|
|
108
|
+
units: ["c", "f"],
|
|
109
|
+
preferenceKey: "temperature",
|
|
110
|
+
name: "temperature",
|
|
111
|
+
localeDefaults: {
|
|
112
|
+
metric: "c",
|
|
113
|
+
us: "f",
|
|
114
|
+
uk: "c"
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
speed: {
|
|
118
|
+
storageUnit: "km/h",
|
|
119
|
+
units: [
|
|
120
|
+
"km/h",
|
|
121
|
+
"mph",
|
|
122
|
+
"m/s"
|
|
123
|
+
],
|
|
124
|
+
preferenceKey: "speed",
|
|
125
|
+
name: "speed",
|
|
126
|
+
localeDefaults: {
|
|
127
|
+
metric: "km/h",
|
|
128
|
+
us: "mph",
|
|
129
|
+
uk: "mph"
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
//#endregion
|
|
134
|
+
export { presets };
|
|
135
|
+
|
|
136
|
+
//# sourceMappingURL=presets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presets.js","names":[],"sources":["../../../src/fields/measurement/presets.ts"],"sourcesContent":["import type { MeasurementSystem } from './engine/locale'\nimport type { MeasurementPrecision } from './engine/precision'\nimport type { ScalarUnitId, UnitId } from './engine/units'\n\n/** Spreadable bundle of measurementField options: storage, offered units, preference bucket, name. */\nexport type MeasurementPreset = {\n\tstorageUnit: ScalarUnitId\n\tunits: readonly UnitId[]\n\t/** Preference bucket every field spreading this preset shares. */\n\tpreferenceKey: string\n\tname: string\n\tlocaleDefaults: Partial<Record<MeasurementSystem, UnitId>>\n\tprecision?: MeasurementPrecision\n}\n\n/**\n * Curated starting points, spread into measurementField() and overridden per field.\n * The preference keys are data: renaming one orphans every unit a user already saved.\n */\nexport const presets = {\n\tbodyWeight: {\n\t\tstorageUnit: 'kg',\n\t\tunits: ['kg', 'lb', 'st-lb'],\n\t\tpreferenceKey: 'bodyWeight',\n\t\tname: 'weight',\n\t\tlocaleDefaults: { metric: 'kg', us: 'lb', uk: 'st-lb' },\n\t},\n\tpersonHeight: {\n\t\tstorageUnit: 'cm',\n\t\tunits: ['cm', 'm', 'in', 'ft-in'],\n\t\tpreferenceKey: 'personHeight',\n\t\tname: 'height',\n\t\tlocaleDefaults: { metric: 'cm', us: 'ft-in', uk: 'ft-in' },\n\t\t// Readable mode's default cm display is 0 digits; a half-centimetre entry\n\t\t// (182.5) needs 1 to survive entry quantization without rounding to a whole cm.\n\t\tprecision: { display: { cm: 1 } },\n\t},\n\tdistance: {\n\t\tstorageUnit: 'km',\n\t\tunits: ['m', 'km', 'mi'],\n\t\tpreferenceKey: 'distance',\n\t\tname: 'distance',\n\t\tlocaleDefaults: { metric: 'km', us: 'mi', uk: 'mi' },\n\t},\n\tmass: {\n\t\tstorageUnit: 'kg',\n\t\tunits: ['g', 'kg', 'oz', 'lb'],\n\t\tpreferenceKey: 'mass',\n\t\tname: 'mass',\n\t\tlocaleDefaults: { metric: 'kg', us: 'lb', uk: 'lb' },\n\t},\n\tlength: {\n\t\tstorageUnit: 'cm',\n\t\tunits: ['mm', 'cm', 'm', 'km', 'in', 'ft', 'yd', 'mi'],\n\t\tpreferenceKey: 'length',\n\t\tname: 'length',\n\t\tlocaleDefaults: { metric: 'cm', us: 'in', uk: 'in' },\n\t},\n\tvolume: {\n\t\tstorageUnit: 'l',\n\t\tunits: ['ml', 'l', 'fl-oz', 'gal'],\n\t\tpreferenceKey: 'volume',\n\t\tname: 'volume',\n\t\tlocaleDefaults: { metric: 'l', us: 'fl-oz', uk: 'l' },\n\t},\n\ttemperature: {\n\t\tstorageUnit: 'c',\n\t\tunits: ['c', 'f'],\n\t\tpreferenceKey: 'temperature',\n\t\tname: 'temperature',\n\t\tlocaleDefaults: { metric: 'c', us: 'f', uk: 'c' },\n\t},\n\tspeed: {\n\t\tstorageUnit: 'km/h',\n\t\tunits: ['km/h', 'mph', 'm/s'],\n\t\tpreferenceKey: 'speed',\n\t\tname: 'speed',\n\t\tlocaleDefaults: { metric: 'km/h', us: 'mph', uk: 'mph' },\n\t},\n} as const satisfies Record<string, MeasurementPreset>\n\nexport type MeasurementUsage = keyof typeof presets\n"],"mappings":";;;;;AAmBA,MAAa,UAAU;CACtB,YAAY;EACX,aAAa;EACb,OAAO;GAAC;GAAM;GAAM;EAAO;EAC3B,eAAe;EACf,MAAM;EACN,gBAAgB;GAAE,QAAQ;GAAM,IAAI;GAAM,IAAI;EAAQ;CACvD;CACA,cAAc;EACb,aAAa;EACb,OAAO;GAAC;GAAM;GAAK;GAAM;EAAO;EAChC,eAAe;EACf,MAAM;EACN,gBAAgB;GAAE,QAAQ;GAAM,IAAI;GAAS,IAAI;EAAQ;EAGzD,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE;CACjC;CACA,UAAU;EACT,aAAa;EACb,OAAO;GAAC;GAAK;GAAM;EAAI;EACvB,eAAe;EACf,MAAM;EACN,gBAAgB;GAAE,QAAQ;GAAM,IAAI;GAAM,IAAI;EAAK;CACpD;CACA,MAAM;EACL,aAAa;EACb,OAAO;GAAC;GAAK;GAAM;GAAM;EAAI;EAC7B,eAAe;EACf,MAAM;EACN,gBAAgB;GAAE,QAAQ;GAAM,IAAI;GAAM,IAAI;EAAK;CACpD;CACA,QAAQ;EACP,aAAa;EACb,OAAO;GAAC;GAAM;GAAM;GAAK;GAAM;GAAM;GAAM;GAAM;EAAI;EACrD,eAAe;EACf,MAAM;EACN,gBAAgB;GAAE,QAAQ;GAAM,IAAI;GAAM,IAAI;EAAK;CACpD;CACA,QAAQ;EACP,aAAa;EACb,OAAO;GAAC;GAAM;GAAK;GAAS;EAAK;EACjC,eAAe;EACf,MAAM;EACN,gBAAgB;GAAE,QAAQ;GAAK,IAAI;GAAS,IAAI;EAAI;CACrD;CACA,aAAa;EACZ,aAAa;EACb,OAAO,CAAC,KAAK,GAAG;EAChB,eAAe;EACf,MAAM;EACN,gBAAgB;GAAE,QAAQ;GAAK,IAAI;GAAK,IAAI;EAAI;CACjD;CACA,OAAO;EACN,aAAa;EACb,OAAO;GAAC;GAAQ;GAAO;EAAK;EAC5B,eAAe;EACf,MAAM;EACN,gBAAgB;GAAE,QAAQ;GAAQ,IAAI;GAAO,IAAI;EAAM;CACxD;AACD"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { MeasurementClientOptions } from "../options.js";
|
|
2
|
+
import { DefaultServerCellComponentProps } from "payload";
|
|
3
|
+
|
|
4
|
+
//#region src/fields/measurement/server/MeasurementCellServer.d.ts
|
|
5
|
+
type MeasurementCellServerComponentProps = {
|
|
6
|
+
measurementOptions?: MeasurementClientOptions;
|
|
7
|
+
} & DefaultServerCellComponentProps;
|
|
8
|
+
/**
|
|
9
|
+
* RSC cell so the plugin registry's `defaultUnits` reaches list cells, not just
|
|
10
|
+
* the edit view. Payload's cell props carry no `req` (packages/payload/src/admin/elements/Cell.ts),
|
|
11
|
+
* so the viewer's saved preference still can't be read here; the client provider
|
|
12
|
+
* still supplies that reactively once it mounts.
|
|
13
|
+
*
|
|
14
|
+
* `field` and `onClick` are never forwarded to the client cell: the sanitized
|
|
15
|
+
* server Field carries functions (our hooks/validate, Payload's own sanitize-installed
|
|
16
|
+
* validate), and React's flight serializer throws on functions in client props.
|
|
17
|
+
*/
|
|
18
|
+
declare const MeasurementCellServer: (props: MeasurementCellServerComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { MeasurementCellServer };
|
|
21
|
+
//# sourceMappingURL=MeasurementCellServer.d.ts.map
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { MEASUREMENT_CUSTOM_KEY } from "../options.js";
|
|
2
|
+
import { MeasurementCell } from "../client/MeasurementCell.js";
|
|
3
|
+
import { resolvePrecisionSafe } from "./resolvePrecisionSafe.js";
|
|
4
|
+
import { resolveRegistryDefault } from "./resolveRegistryDefault.js";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
//#region src/fields/measurement/server/MeasurementCellServer.tsx
|
|
7
|
+
/**
|
|
8
|
+
* RSC cell so the plugin registry's `defaultUnits` reaches list cells, not just
|
|
9
|
+
* the edit view. Payload's cell props carry no `req` (packages/payload/src/admin/elements/Cell.ts),
|
|
10
|
+
* so the viewer's saved preference still can't be read here; the client provider
|
|
11
|
+
* still supplies that reactively once it mounts.
|
|
12
|
+
*
|
|
13
|
+
* `field` and `onClick` are never forwarded to the client cell: the sanitized
|
|
14
|
+
* server Field carries functions (our hooks/validate, Payload's own sanitize-installed
|
|
15
|
+
* validate), and React's flight serializer throws on functions in client props.
|
|
16
|
+
*/
|
|
17
|
+
const MeasurementCellServer = (props) => {
|
|
18
|
+
const { cellData, className, collectionSlug, columnIndex, customCellProps, field, link, linkURL, payload, rowData, viewType } = props;
|
|
19
|
+
const measurementOptions = props.measurementOptions ?? field.custom?.["@10x-media/fields"];
|
|
20
|
+
if (!measurementOptions) {
|
|
21
|
+
const name = "name" in field ? String(field.name) : "";
|
|
22
|
+
throw new Error(`MeasurementCellServer: field "${name}" has no measurementOptions clientProp and no custom['${MEASUREMENT_CUSTOM_KEY}']`);
|
|
23
|
+
}
|
|
24
|
+
const registryDefault = resolveRegistryDefault({
|
|
25
|
+
payload,
|
|
26
|
+
preferenceKey: measurementOptions.preferenceKey,
|
|
27
|
+
req: void 0
|
|
28
|
+
});
|
|
29
|
+
const precision = resolvePrecisionSafe({
|
|
30
|
+
fieldPrecision: measurementOptions.precision,
|
|
31
|
+
payload
|
|
32
|
+
});
|
|
33
|
+
return /* @__PURE__ */ jsx(MeasurementCell, {
|
|
34
|
+
cellData,
|
|
35
|
+
className,
|
|
36
|
+
collectionSlug,
|
|
37
|
+
columnIndex,
|
|
38
|
+
customCellProps,
|
|
39
|
+
link,
|
|
40
|
+
linkURL,
|
|
41
|
+
measurementOptions: {
|
|
42
|
+
...measurementOptions,
|
|
43
|
+
precision,
|
|
44
|
+
...registryDefault !== void 0 ? { registryDefault } : {}
|
|
45
|
+
},
|
|
46
|
+
rowData,
|
|
47
|
+
viewType
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
//#endregion
|
|
51
|
+
export { MeasurementCellServer };
|
|
52
|
+
|
|
53
|
+
//# sourceMappingURL=MeasurementCellServer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MeasurementCellServer.js","names":[],"sources":["../../../../src/fields/measurement/server/MeasurementCellServer.tsx"],"sourcesContent":["import type { DefaultServerCellComponentProps } from 'payload'\nimport { MeasurementCell } from '../client/MeasurementCell'\nimport { MEASUREMENT_CUSTOM_KEY, type MeasurementClientOptions } from '../options'\nimport { resolvePrecisionSafe } from './resolvePrecisionSafe'\nimport { resolveRegistryDefault } from './resolveRegistryDefault'\n\ntype MeasurementCellServerComponentProps = {\n\tmeasurementOptions?: MeasurementClientOptions\n} & DefaultServerCellComponentProps\n\n/**\n * RSC cell so the plugin registry's `defaultUnits` reaches list cells, not just\n * the edit view. Payload's cell props carry no `req` (packages/payload/src/admin/elements/Cell.ts),\n * so the viewer's saved preference still can't be read here; the client provider\n * still supplies that reactively once it mounts.\n *\n * `field` and `onClick` are never forwarded to the client cell: the sanitized\n * server Field carries functions (our hooks/validate, Payload's own sanitize-installed\n * validate), and React's flight serializer throws on functions in client props.\n */\nexport const MeasurementCellServer = (props: MeasurementCellServerComponentProps) => {\n\tconst {\n\t\tcellData,\n\t\tclassName,\n\t\tcollectionSlug,\n\t\tcolumnIndex,\n\t\tcustomCellProps,\n\t\tfield,\n\t\tlink,\n\t\tlinkURL,\n\t\tpayload,\n\t\trowData,\n\t\tviewType,\n\t} = props\n\tconst measurementOptions =\n\t\tprops.measurementOptions ??\n\t\t(field.custom?.[MEASUREMENT_CUSTOM_KEY] as MeasurementClientOptions | undefined)\n\tif (!measurementOptions) {\n\t\tconst name = 'name' in field ? String(field.name) : ''\n\t\tthrow new Error(\n\t\t\t`MeasurementCellServer: field \"${name}\" has no measurementOptions clientProp and no custom['${MEASUREMENT_CUSTOM_KEY}']`\n\t\t)\n\t}\n\tconst registryDefault = resolveRegistryDefault({\n\t\tpayload,\n\t\tpreferenceKey: measurementOptions.preferenceKey,\n\t\treq: undefined,\n\t})\n\tconst precision = resolvePrecisionSafe({ fieldPrecision: measurementOptions.precision, payload })\n\treturn (\n\t\t<MeasurementCell\n\t\t\tcellData={cellData}\n\t\t\tclassName={className}\n\t\t\tcollectionSlug={collectionSlug}\n\t\t\tcolumnIndex={columnIndex}\n\t\t\tcustomCellProps={customCellProps}\n\t\t\tlink={link}\n\t\t\tlinkURL={linkURL}\n\t\t\tmeasurementOptions={{\n\t\t\t\t...measurementOptions,\n\t\t\t\tprecision,\n\t\t\t\t...(registryDefault !== undefined ? { registryDefault } : {}),\n\t\t\t}}\n\t\t\trowData={rowData}\n\t\t\tviewType={viewType}\n\t\t/>\n\t)\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAoBA,MAAa,yBAAyB,UAA+C;CACpF,MAAM,EACL,UACA,WACA,gBACA,aACA,iBACA,OACA,MACA,SACA,SACA,SACA,aACG;CACJ,MAAM,qBACL,MAAM,sBACL,MAAM,SAAA;CACR,IAAI,CAAC,oBAAoB;EACxB,MAAM,OAAO,UAAU,QAAQ,OAAO,MAAM,IAAI,IAAI;EACpD,MAAM,IAAI,MACT,iCAAiC,KAAK,wDAAwD,uBAAuB,GACtH;CACD;CACA,MAAM,kBAAkB,uBAAuB;EAC9C;EACA,eAAe,mBAAmB;EAClC,KAAK,KAAA;CACN,CAAC;CACD,MAAM,YAAY,qBAAqB;EAAE,gBAAgB,mBAAmB;EAAW;CAAQ,CAAC;CAChG,OACC,oBAAC,iBAAD;EACW;EACC;EACK;EACH;EACI;EACX;EACG;EACT,oBAAoB;GACnB,GAAG;GACH;GACA,GAAI,oBAAoB,KAAA,IAAY,EAAE,gBAAgB,IAAI,CAAC;EAC5D;EACS;EACC;CACV,CAAA;AAEH"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { MeasurementClientOptions } from "../options.js";
|
|
2
|
+
import { NumberFieldServerProps } from "payload";
|
|
3
|
+
|
|
4
|
+
//#region src/fields/measurement/server/MeasurementFieldServer.d.ts
|
|
5
|
+
type MeasurementFieldServerComponentProps = {
|
|
6
|
+
measurementOptions?: MeasurementClientOptions;
|
|
7
|
+
} & NumberFieldServerProps;
|
|
8
|
+
/**
|
|
9
|
+
* Resolves the viewer's saved unit and the plugin registry default per request,
|
|
10
|
+
* then renders the client field with only serializable props, so the edit view
|
|
11
|
+
* first-paints in the right unit.
|
|
12
|
+
*/
|
|
13
|
+
declare const MeasurementFieldServer: (props: MeasurementFieldServerComponentProps) => Promise<import("react/jsx-runtime").JSX.Element>;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { MeasurementFieldServer };
|
|
16
|
+
//# sourceMappingURL=MeasurementFieldServer.d.ts.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { MEASUREMENT_CUSTOM_KEY } from "../options.js";
|
|
2
|
+
import { MeasurementField } from "../client/MeasurementField.js";
|
|
3
|
+
import { resolvePrecisionSafe } from "./resolvePrecisionSafe.js";
|
|
4
|
+
import { resolveRegistryDefault } from "./resolveRegistryDefault.js";
|
|
5
|
+
import { getUserMeasurementUnits } from "./getUserUnits.js";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
//#region src/fields/measurement/server/MeasurementFieldServer.tsx
|
|
8
|
+
/**
|
|
9
|
+
* Resolves the viewer's saved unit and the plugin registry default per request,
|
|
10
|
+
* then renders the client field with only serializable props, so the edit view
|
|
11
|
+
* first-paints in the right unit.
|
|
12
|
+
*/
|
|
13
|
+
const MeasurementFieldServer = async (props) => {
|
|
14
|
+
const { clientField, field, path, permissions, readOnly, req } = props;
|
|
15
|
+
const measurementOptions = props.measurementOptions ?? field.custom?.["@10x-media/fields"];
|
|
16
|
+
if (!measurementOptions) throw new Error(`MeasurementFieldServer: field "${field.name}" has no measurementOptions clientProp and no custom['${MEASUREMENT_CUSTOM_KEY}']`);
|
|
17
|
+
const userUnits = await getUserMeasurementUnits(req);
|
|
18
|
+
const { preferenceKey } = measurementOptions;
|
|
19
|
+
const registryDefault = resolveRegistryDefault({
|
|
20
|
+
payload: req.payload,
|
|
21
|
+
preferenceKey,
|
|
22
|
+
req
|
|
23
|
+
});
|
|
24
|
+
const initialUnit = userUnits?.[preferenceKey];
|
|
25
|
+
const precision = resolvePrecisionSafe({
|
|
26
|
+
fieldPrecision: measurementOptions.precision,
|
|
27
|
+
payload: req.payload
|
|
28
|
+
});
|
|
29
|
+
return /* @__PURE__ */ jsx(MeasurementField, {
|
|
30
|
+
field: clientField,
|
|
31
|
+
measurementOptions: {
|
|
32
|
+
...measurementOptions,
|
|
33
|
+
precision,
|
|
34
|
+
...registryDefault !== void 0 ? { registryDefault } : {},
|
|
35
|
+
...initialUnit !== void 0 ? { initialUnit } : {}
|
|
36
|
+
},
|
|
37
|
+
path,
|
|
38
|
+
permissions,
|
|
39
|
+
readOnly
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
//#endregion
|
|
43
|
+
export { MeasurementFieldServer };
|
|
44
|
+
|
|
45
|
+
//# sourceMappingURL=MeasurementFieldServer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MeasurementFieldServer.js","names":[],"sources":["../../../../src/fields/measurement/server/MeasurementFieldServer.tsx"],"sourcesContent":["import type { NumberFieldServerProps } from 'payload'\nimport { MeasurementField } from '../client/MeasurementField'\nimport { MEASUREMENT_CUSTOM_KEY, type MeasurementClientOptions } from '../options'\nimport { getUserMeasurementUnits } from './getUserUnits'\nimport { resolvePrecisionSafe } from './resolvePrecisionSafe'\nimport { resolveRegistryDefault } from './resolveRegistryDefault'\n\ntype MeasurementFieldServerComponentProps = {\n\tmeasurementOptions?: MeasurementClientOptions\n} & NumberFieldServerProps\n\n/**\n * Resolves the viewer's saved unit and the plugin registry default per request,\n * then renders the client field with only serializable props, so the edit view\n * first-paints in the right unit.\n */\nexport const MeasurementFieldServer = async (props: MeasurementFieldServerComponentProps) => {\n\tconst { clientField, field, path, permissions, readOnly, req } = props\n\t// Hand-authored fields (not built through measurementField()) may set only\n\t// field.custom, with no clientProps; fall back to the stamped config.\n\tconst measurementOptions =\n\t\tprops.measurementOptions ??\n\t\t(field.custom?.[MEASUREMENT_CUSTOM_KEY] as MeasurementClientOptions | undefined)\n\tif (!measurementOptions) {\n\t\tthrow new Error(\n\t\t\t`MeasurementFieldServer: field \"${field.name}\" has no measurementOptions clientProp and no custom['${MEASUREMENT_CUSTOM_KEY}']`\n\t\t)\n\t}\n\tconst userUnits = await getUserMeasurementUnits(req)\n\tconst { preferenceKey } = measurementOptions\n\tconst registryDefault = resolveRegistryDefault({ payload: req.payload, preferenceKey, req })\n\tconst initialUnit = userUnits?.[preferenceKey]\n\tconst precision = resolvePrecisionSafe({\n\t\tfieldPrecision: measurementOptions.precision,\n\t\tpayload: req.payload,\n\t})\n\treturn (\n\t\t<MeasurementField\n\t\t\tfield={clientField}\n\t\t\tmeasurementOptions={{\n\t\t\t\t...measurementOptions,\n\t\t\t\tprecision,\n\t\t\t\t...(registryDefault !== undefined ? { registryDefault } : {}),\n\t\t\t\t...(initialUnit !== undefined ? { initialUnit } : {}),\n\t\t\t}}\n\t\t\tpath={path}\n\t\t\tpermissions={permissions}\n\t\t\treadOnly={readOnly}\n\t\t/>\n\t)\n}\n"],"mappings":";;;;;;;;;;;;AAgBA,MAAa,yBAAyB,OAAO,UAAgD;CAC5F,MAAM,EAAE,aAAa,OAAO,MAAM,aAAa,UAAU,QAAQ;CAGjE,MAAM,qBACL,MAAM,sBACL,MAAM,SAAA;CACR,IAAI,CAAC,oBACJ,MAAM,IAAI,MACT,kCAAkC,MAAM,KAAK,wDAAwD,uBAAuB,GAC7H;CAED,MAAM,YAAY,MAAM,wBAAwB,GAAG;CACnD,MAAM,EAAE,kBAAkB;CAC1B,MAAM,kBAAkB,uBAAuB;EAAE,SAAS,IAAI;EAAS;EAAe;CAAI,CAAC;CAC3F,MAAM,cAAc,YAAY;CAChC,MAAM,YAAY,qBAAqB;EACtC,gBAAgB,mBAAmB;EACnC,SAAS,IAAI;CACd,CAAC;CACD,OACC,oBAAC,kBAAD;EACC,OAAO;EACP,oBAAoB;GACnB,GAAG;GACH;GACA,GAAI,oBAAoB,KAAA,IAAY,EAAE,gBAAgB,IAAI,CAAC;GAC3D,GAAI,gBAAgB,KAAA,IAAY,EAAE,YAAY,IAAI,CAAC;EACpD;EACM;EACO;EACH;CACV,CAAA;AAEH"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { memoForRequest } from "../../../utils/memoForRequest.js";
|
|
2
|
+
import { MEASUREMENT_PREFERENCE_KEY } from "../options.js";
|
|
3
|
+
//#region src/fields/measurement/server/getUserUnits.ts
|
|
4
|
+
const USER_UNITS_MEMO = Symbol("measurementField:userUnits");
|
|
5
|
+
const isPreference = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
6
|
+
/**
|
|
7
|
+
* The viewer's saved unit map, one query per request however many measurement
|
|
8
|
+
* fields the document renders. Mirrors Payload's own server-side preference
|
|
9
|
+
* lookup (packages/next getPreferences): find on payload-preferences by key
|
|
10
|
+
* and polymorphic user.
|
|
11
|
+
*/
|
|
12
|
+
const getUserMeasurementUnits = (req) => {
|
|
13
|
+
const { user } = req;
|
|
14
|
+
if (!user) return Promise.resolve(null);
|
|
15
|
+
return memoForRequest(req, USER_UNITS_MEMO, async () => {
|
|
16
|
+
try {
|
|
17
|
+
const value = (await req.payload.find({
|
|
18
|
+
collection: "payload-preferences",
|
|
19
|
+
depth: 0,
|
|
20
|
+
limit: 1,
|
|
21
|
+
pagination: false,
|
|
22
|
+
sort: "-updatedAt",
|
|
23
|
+
where: { and: [
|
|
24
|
+
{ key: { equals: MEASUREMENT_PREFERENCE_KEY } },
|
|
25
|
+
{ "user.value": { equals: user.id } },
|
|
26
|
+
{ "user.relationTo": { equals: user.collection } }
|
|
27
|
+
] }
|
|
28
|
+
})).docs[0]?.value;
|
|
29
|
+
return isPreference(value) ? value : null;
|
|
30
|
+
} catch (error) {
|
|
31
|
+
req.payload.logger.error({ err: error }, "[fields] measurement preference read failed");
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
//#endregion
|
|
37
|
+
export { getUserMeasurementUnits };
|
|
38
|
+
|
|
39
|
+
//# sourceMappingURL=getUserUnits.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getUserUnits.js","names":[],"sources":["../../../../src/fields/measurement/server/getUserUnits.ts"],"sourcesContent":["import type { PayloadRequest } from 'payload'\nimport { memoForRequest } from '../../../utils/memoForRequest'\nimport { MEASUREMENT_PREFERENCE_KEY, type MeasurementUnitsPreference } from '../options'\n\nconst USER_UNITS_MEMO = Symbol('measurementField:userUnits')\n\nconst isPreference = (value: unknown): value is MeasurementUnitsPreference =>\n\ttypeof value === 'object' && value !== null && !Array.isArray(value)\n\n/**\n * The viewer's saved unit map, one query per request however many measurement\n * fields the document renders. Mirrors Payload's own server-side preference\n * lookup (packages/next getPreferences): find on payload-preferences by key\n * and polymorphic user.\n */\nexport const getUserMeasurementUnits = (\n\treq: PayloadRequest\n): Promise<MeasurementUnitsPreference | null> => {\n\tconst { user } = req\n\tif (!user) return Promise.resolve(null)\n\treturn memoForRequest(req, USER_UNITS_MEMO, async () => {\n\t\ttry {\n\t\t\tconst result = await req.payload.find({\n\t\t\t\tcollection: 'payload-preferences',\n\t\t\t\tdepth: 0,\n\t\t\t\tlimit: 1,\n\t\t\t\tpagination: false,\n\t\t\t\tsort: '-updatedAt',\n\t\t\t\twhere: {\n\t\t\t\t\tand: [\n\t\t\t\t\t\t{ key: { equals: MEASUREMENT_PREFERENCE_KEY } },\n\t\t\t\t\t\t{ 'user.value': { equals: user.id } },\n\t\t\t\t\t\t{ 'user.relationTo': { equals: user.collection } },\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t})\n\t\t\tconst value = result.docs[0]?.value\n\t\t\treturn isPreference(value) ? value : null\n\t\t} catch (error) {\n\t\t\treq.payload.logger.error({ err: error }, '[fields] measurement preference read failed')\n\t\t\treturn null\n\t\t}\n\t})\n}\n"],"mappings":";;;AAIA,MAAM,kBAAkB,OAAO,4BAA4B;AAE3D,MAAM,gBAAgB,UACrB,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;;;;;;;AAQpE,MAAa,2BACZ,QACgD;CAChD,MAAM,EAAE,SAAS;CACjB,IAAI,CAAC,MAAM,OAAO,QAAQ,QAAQ,IAAI;CACtC,OAAO,eAAe,KAAK,iBAAiB,YAAY;EACvD,IAAI;GAeH,MAAM,SAAQ,MAdO,IAAI,QAAQ,KAAK;IACrC,YAAY;IACZ,OAAO;IACP,OAAO;IACP,YAAY;IACZ,MAAM;IACN,OAAO,EACN,KAAK;KACJ,EAAE,KAAK,EAAE,QAAQ,2BAA2B,EAAE;KAC9C,EAAE,cAAc,EAAE,QAAQ,KAAK,GAAG,EAAE;KACpC,EAAE,mBAAmB,EAAE,QAAQ,KAAK,WAAW,EAAE;IAClD,EACD;GACD,CAAC,GACoB,KAAK,IAAI;GAC9B,OAAO,aAAa,KAAK,IAAI,QAAQ;EACtC,SAAS,OAAO;GACf,IAAI,QAAQ,OAAO,MAAM,EAAE,KAAK,MAAM,GAAG,6CAA6C;GACtF,OAAO;EACR;CACD,CAAC;AACF"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { getFieldsRegistry } from "../../../plugin/registry.js";
|
|
2
|
+
import { resolvePrecision } from "../engine/precision.js";
|
|
3
|
+
//#region src/fields/measurement/server/resolvePrecisionSafe.ts
|
|
4
|
+
/**
|
|
5
|
+
* Merges the plugin registry's precision layer with a field's own, degrading to
|
|
6
|
+
* the field-only layer (and logging) when the registry layer is malformed. The
|
|
7
|
+
* plugin's init already rejects a bad `measurement.precision` at boot, before any
|
|
8
|
+
* field can run against it; this is the fallback for a config mutated after
|
|
9
|
+
* `fields()` ran, or assembled without the plugin at all.
|
|
10
|
+
*/
|
|
11
|
+
const resolvePrecisionSafe = (args) => {
|
|
12
|
+
const { fieldPrecision, payload } = args;
|
|
13
|
+
const registryPrecision = getFieldsRegistry(payload.config)?.measurement?.precision;
|
|
14
|
+
try {
|
|
15
|
+
return resolvePrecision([registryPrecision, fieldPrecision]);
|
|
16
|
+
} catch (error) {
|
|
17
|
+
payload.logger.error({ err: error }, "[fields] measurement precision registry default is invalid");
|
|
18
|
+
return resolvePrecision([void 0, fieldPrecision]);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
//#endregion
|
|
22
|
+
export { resolvePrecisionSafe };
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=resolvePrecisionSafe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolvePrecisionSafe.js","names":[],"sources":["../../../../src/fields/measurement/server/resolvePrecisionSafe.ts"],"sourcesContent":["import type { Payload } from 'payload'\nimport { getFieldsRegistry } from '../../../plugin/registry'\nimport {\n\ttype MeasurementPrecision,\n\ttype PrecisionMode,\n\ttype ResolvedPrecision,\n\tresolvePrecision,\n} from '../engine/precision'\n\n/**\n * Merges the plugin registry's precision layer with a field's own, degrading to\n * the field-only layer (and logging) when the registry layer is malformed. The\n * plugin's init already rejects a bad `measurement.precision` at boot, before any\n * field can run against it; this is the fallback for a config mutated after\n * `fields()` ran, or assembled without the plugin at all.\n */\nexport const resolvePrecisionSafe = (args: {\n\tpayload: Payload\n\tfieldPrecision: MeasurementPrecision | PrecisionMode | undefined\n}): ResolvedPrecision => {\n\tconst { fieldPrecision, payload } = args\n\tconst registryPrecision = getFieldsRegistry(payload.config)?.measurement?.precision\n\ttry {\n\t\treturn resolvePrecision([registryPrecision, fieldPrecision])\n\t} catch (error) {\n\t\tpayload.logger.error(\n\t\t\t{ err: error },\n\t\t\t'[fields] measurement precision registry default is invalid'\n\t\t)\n\t\treturn resolvePrecision([undefined, fieldPrecision])\n\t}\n}\n"],"mappings":";;;;;;;;;;AAgBA,MAAa,wBAAwB,SAGZ;CACxB,MAAM,EAAE,gBAAgB,YAAY;CACpC,MAAM,oBAAoB,kBAAkB,QAAQ,MAAM,GAAG,aAAa;CAC1E,IAAI;EACH,OAAO,iBAAiB,CAAC,mBAAmB,cAAc,CAAC;CAC5D,SAAS,OAAO;EACf,QAAQ,OAAO,MACd,EAAE,KAAK,MAAM,GACb,4DACD;EACA,OAAO,iBAAiB,CAAC,KAAA,GAAW,cAAc,CAAC;CACpD;AACD"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { getFieldsRegistry } from "../../../plugin/registry.js";
|
|
2
|
+
//#region src/fields/measurement/server/resolveRegistryDefault.ts
|
|
3
|
+
/**
|
|
4
|
+
* Shared by the edit view (has `req`) and the list cell (does not, per Payload's
|
|
5
|
+
* Cell component props) so both resolve the registry's `defaultUnits` the same
|
|
6
|
+
* way, whether it's a plain map or a per-request resolver function.
|
|
7
|
+
*/
|
|
8
|
+
const resolveRegistryDefault = (args) => {
|
|
9
|
+
const { payload, preferenceKey, req } = args;
|
|
10
|
+
const defaultUnits = getFieldsRegistry(payload.config)?.measurement?.defaultUnits;
|
|
11
|
+
if (!defaultUnits) return void 0;
|
|
12
|
+
if (typeof defaultUnits === "function") try {
|
|
13
|
+
return defaultUnits({
|
|
14
|
+
preferenceKey,
|
|
15
|
+
req
|
|
16
|
+
});
|
|
17
|
+
} catch (error) {
|
|
18
|
+
payload.logger.error({ err: error }, "[fields] measurement defaultUnits resolver failed");
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
return defaultUnits[preferenceKey];
|
|
22
|
+
};
|
|
23
|
+
//#endregion
|
|
24
|
+
export { resolveRegistryDefault };
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=resolveRegistryDefault.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveRegistryDefault.js","names":[],"sources":["../../../../src/fields/measurement/server/resolveRegistryDefault.ts"],"sourcesContent":["import type { Payload, PayloadRequest } from 'payload'\nimport { getFieldsRegistry } from '../../../plugin/registry'\nimport type { MeasurementUnitId } from '../engine/units'\n\n/**\n * Shared by the edit view (has `req`) and the list cell (does not, per Payload's\n * Cell component props) so both resolve the registry's `defaultUnits` the same\n * way, whether it's a plain map or a per-request resolver function.\n */\nexport const resolveRegistryDefault = (args: {\n\tpayload: Payload\n\tpreferenceKey: string\n\treq: PayloadRequest | undefined\n}): MeasurementUnitId | undefined => {\n\tconst { payload, preferenceKey, req } = args\n\tconst defaultUnits = getFieldsRegistry(payload.config)?.measurement?.defaultUnits\n\tif (!defaultUnits) return undefined\n\tif (typeof defaultUnits === 'function') {\n\t\ttry {\n\t\t\treturn defaultUnits({ preferenceKey, req })\n\t\t} catch (error) {\n\t\t\tpayload.logger.error({ err: error }, '[fields] measurement defaultUnits resolver failed')\n\t\t\treturn undefined\n\t\t}\n\t}\n\treturn defaultUnits[preferenceKey]\n}\n"],"mappings":";;;;;;;AASA,MAAa,0BAA0B,SAIF;CACpC,MAAM,EAAE,SAAS,eAAe,QAAQ;CACxC,MAAM,eAAe,kBAAkB,QAAQ,MAAM,GAAG,aAAa;CACrE,IAAI,CAAC,cAAc,OAAO,KAAA;CAC1B,IAAI,OAAO,iBAAiB,YAC3B,IAAI;EACH,OAAO,aAAa;GAAE;GAAe;EAAI,CAAC;CAC3C,SAAS,OAAO;EACf,QAAQ,OAAO,MAAM,EAAE,KAAK,MAAM,GAAG,mDAAmD;EACxF;CACD;CAED,OAAO,aAAa;AACrB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ColorFormat, ColorGlobalConfig, ColorPreset, DecryptFailurePolicy, EncryptedGlobalConfig, FieldsPluginRegistry, FieldsResolverArgs, IconAdapter, IconCanvas, IconGlobalConfig, IconLayer, IconLayerCache, IconLayerContext, IconManifest, IconMeta, IconRenderStrategy, KeysConfig } from "./types.js";
|
|
1
|
+
import { ColorFormat, ColorGlobalConfig, ColorPreset, DecryptFailurePolicy, EncryptedGlobalConfig, FieldsPluginRegistry, FieldsResolverArgs, IconAdapter, IconCanvas, IconGlobalConfig, IconLayer, IconLayerCache, IconLayerContext, IconManifest, IconMeta, IconRenderStrategy, KeysConfig, MeasurementDefaultUnitsResolver, MeasurementGlobalConfig } from "./types.js";
|
|
2
2
|
import { TranslationsOption } from "./translations/index.js";
|
|
3
3
|
import { getFieldsRegistry } from "./plugin/registry.js";
|
|
4
4
|
|
|
@@ -18,7 +18,8 @@ type FieldsPluginOptions = {
|
|
|
18
18
|
translations?: TranslationsOption; /** Global defaults for colorField(). Per-field options always win. */
|
|
19
19
|
color?: ColorGlobalConfig; /** Global defaults for iconField(). Per-field options always win. */
|
|
20
20
|
icon?: IconGlobalConfig; /** Global defaults for encryptedField(). Per-field options always win. */
|
|
21
|
-
encrypted?: EncryptedGlobalConfig;
|
|
21
|
+
encrypted?: EncryptedGlobalConfig; /** Global defaults for measurementField(). Per-field options always win. */
|
|
22
|
+
measurement?: MeasurementGlobalConfig;
|
|
22
23
|
};
|
|
23
24
|
declare module 'payload' {
|
|
24
25
|
interface RegisteredPlugins {
|
|
@@ -35,5 +36,5 @@ declare module 'payload' {
|
|
|
35
36
|
*/
|
|
36
37
|
declare const fields: (options: FieldsPluginOptions) => import("payload").Plugin;
|
|
37
38
|
//#endregion
|
|
38
|
-
export { type ColorFormat, type ColorGlobalConfig, type ColorPreset, type DecryptFailurePolicy, type EncryptedGlobalConfig, FieldsPluginOptions, type FieldsPluginOptions as PluginOptions, type FieldsPluginRegistry, type FieldsResolverArgs, type IconAdapter, type IconCanvas, type IconGlobalConfig, type IconLayer, type IconLayerCache, type IconLayerContext, type IconManifest, type IconMeta, type IconRenderStrategy, type KeysConfig, fields, getFieldsRegistry };
|
|
39
|
+
export { type ColorFormat, type ColorGlobalConfig, type ColorPreset, type DecryptFailurePolicy, type EncryptedGlobalConfig, FieldsPluginOptions, type FieldsPluginOptions as PluginOptions, type FieldsPluginRegistry, type FieldsResolverArgs, type IconAdapter, type IconCanvas, type IconGlobalConfig, type IconLayer, type IconLayerCache, type IconLayerContext, type IconManifest, type IconMeta, type IconRenderStrategy, type KeysConfig, type MeasurementDefaultUnitsResolver, type MeasurementGlobalConfig, fields, getFieldsRegistry };
|
|
39
40
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,7 @@ import { validateEncryptedBoot } from "./fields/encrypted/boot.js";
|
|
|
2
2
|
import { getFieldsRegistry, setFieldsRegistry } from "./plugin/registry.js";
|
|
3
3
|
import { withEncryptedQueryRewrite, withEncryptedResponseStrip } from "./fields/encrypted/queryRewrite.js";
|
|
4
4
|
import { registerIcon } from "./fields/icon/plugin.js";
|
|
5
|
+
import { resolvePrecision } from "./fields/measurement/engine/precision.js";
|
|
5
6
|
import { registerTranslations } from "./plugin/registerTranslations.js";
|
|
6
7
|
import { definePlugin } from "payload";
|
|
7
8
|
//#region src/index.ts
|
|
@@ -9,6 +10,14 @@ const normalizeRegistry = (options) => {
|
|
|
9
10
|
const registry = {};
|
|
10
11
|
if (options.color) registry.color = options.color;
|
|
11
12
|
if (options.encrypted) registry.encrypted = options.encrypted;
|
|
13
|
+
if (options.measurement) {
|
|
14
|
+
if (options.measurement.precision !== void 0) try {
|
|
15
|
+
resolvePrecision([options.measurement.precision]);
|
|
16
|
+
} catch (error) {
|
|
17
|
+
throw new Error(`fields plugin: measurement.precision is invalid: ${error.message}`);
|
|
18
|
+
}
|
|
19
|
+
registry.measurement = options.measurement;
|
|
20
|
+
}
|
|
12
21
|
return registry;
|
|
13
22
|
};
|
|
14
23
|
/**
|
|
@@ -26,6 +35,13 @@ const fields = definePlugin({
|
|
|
26
35
|
registerTranslations(config, options.translations);
|
|
27
36
|
setFieldsRegistry(config, normalizeRegistry(options));
|
|
28
37
|
registerIcon(config, options.icon);
|
|
38
|
+
config.admin = config.admin ?? {};
|
|
39
|
+
config.admin.components = config.admin.components ?? {};
|
|
40
|
+
config.admin.components.providers = config.admin.components.providers ?? [];
|
|
41
|
+
config.admin.components.providers.push({
|
|
42
|
+
clientProps: { persist: options.measurement?.persistPreferences !== false },
|
|
43
|
+
path: "@10x-media/fields/client#MeasurementUnitsProvider"
|
|
44
|
+
});
|
|
29
45
|
config.collections = (config.collections ?? []).map(withEncryptedQueryRewrite);
|
|
30
46
|
config.globals = (config.globals ?? []).map(withEncryptedResponseStrip);
|
|
31
47
|
const priorOnInit = config.onInit;
|
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 {\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":"
|
|
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 { resolvePrecision } from './fields/measurement/engine/precision'\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\tMeasurementGlobalConfig,\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\t/** Global defaults for measurementField(). Per-field options always win. */\n\tmeasurement?: MeasurementGlobalConfig\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\tif (options.measurement) {\n\t\t// Fails fast at plugin build, before any field's beforeValidate hook can run\n\t\t// against it, instead of throwing on every write once the app is live.\n\t\tif (options.measurement.precision !== undefined) {\n\t\t\ttry {\n\t\t\t\tresolvePrecision([options.measurement.precision])\n\t\t\t} catch (error) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`fields plugin: measurement.precision is invalid: ${(error as Error).message}`\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t\tregistry.measurement = options.measurement\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\tconfig.admin = config.admin ?? {}\n\t\tconfig.admin.components = config.admin.components ?? {}\n\t\tconfig.admin.components.providers = config.admin.components.providers ?? []\n\t\tconfig.admin.components.providers.push({\n\t\t\tclientProps: { persist: options.measurement?.persistPreferences !== false },\n\t\t\tpath: '@10x-media/fields/client#MeasurementUnitsProvider',\n\t\t})\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\tMeasurementDefaultUnitsResolver,\n\tMeasurementGlobalConfig,\n} from './types'\nexport type { FieldsPluginOptions as PluginOptions }\n"],"mappings":";;;;;;;;AAiDA,MAAM,qBAAqB,YAAuD;CACjF,MAAM,WAAiC,CAAC;CACxC,IAAI,QAAQ,OACX,SAAS,QAAQ,QAAQ;CAI1B,IAAI,QAAQ,WACX,SAAS,YAAY,QAAQ;CAE9B,IAAI,QAAQ,aAAa;EAGxB,IAAI,QAAQ,YAAY,cAAc,KAAA,GACrC,IAAI;GACH,iBAAiB,CAAC,QAAQ,YAAY,SAAS,CAAC;EACjD,SAAS,OAAO;GACf,MAAM,IAAI,MACT,oDAAqD,MAAgB,SACtE;EACD;EAED,SAAS,cAAc,QAAQ;CAChC;CACA,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;EACjC,OAAO,QAAQ,OAAO,SAAS,CAAC;EAChC,OAAO,MAAM,aAAa,OAAO,MAAM,cAAc,CAAC;EACtD,OAAO,MAAM,WAAW,YAAY,OAAO,MAAM,WAAW,aAAa,CAAC;EAC1E,OAAO,MAAM,WAAW,UAAU,KAAK;GACtC,aAAa,EAAE,SAAS,QAAQ,aAAa,uBAAuB,MAAM;GAC1E,MAAM;EACP,CAAC;EAID,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"}
|
package/dist/translations/ar.js
CHANGED
|
@@ -43,7 +43,10 @@ const ar = {
|
|
|
43
43
|
[keys.clearedOnSave]: "سيتم حذفها عند الحفظ",
|
|
44
44
|
[keys.generateValue]: "إنشاء قيمة جديدة",
|
|
45
45
|
[keys.writeOnlyValue]: "قيمة مشفرة للكتابة فقط",
|
|
46
|
-
[keys.secretNotSet]: "غير محدد"
|
|
46
|
+
[keys.secretNotSet]: "غير محدد",
|
|
47
|
+
[keys.selectUnit]: "اختيار الوحدة",
|
|
48
|
+
[keys.measurementBelowMin]: "يجب ألا يقل عن {{min}}",
|
|
49
|
+
[keys.measurementAboveMax]: "يجب ألا يزيد عن {{max}}"
|
|
47
50
|
};
|
|
48
51
|
//#endregion
|
|
49
52
|
export { ar };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ar.js","names":[],"sources":["../../src/translations/ar.ts"],"sourcesContent":["import { keys, type TranslationKey } from './keys'\n\nexport const ar: Record<TranslationKey, string> = {\n\t[keys.pluginName]: 'Fields',\n\t[keys.presets]: 'الإعدادات المسبقة',\n\t[keys.fieldIconLabel]: 'أيقونة',\n\t[keys.fieldIconLibraryLabel]: 'مكتبة الأيقونات',\n\t[keys.selectIcon]: 'اختر أيقونة',\n\t[keys.clearIcon]: 'مسح الأيقونة',\n\t[keys.resultsCount]: '{{count}} أيقونات',\n\t[keys.textInputPlaceholder]: 'library:icon-name',\n\t[keys.invalidIconLibrary]: 'مكتبة الأيقونات غير معروفة: {{library}}',\n\t[keys.invalidIconName]: 'أيقونة غير معروفة \"{{name}}\" في مكتبة {{library}}',\n\t[keys.invalidIconLibraryValue]: 'ليست مكتبة أيقونات مسجلة: {{value}}',\n\t[keys.searchIcons]: 'ابحث عن الأيقونات',\n\t[keys.noIconsFound]: 'لم يتم العثور على أيقونات',\n\t[keys.browseAll]: 'تصفح الكل',\n\t[keys.recent]: 'الأخيرة',\n\t[keys.allIcons]: 'جميع الأيقونات',\n\t[keys.iconCategories]: 'فئات الأيقونات',\n\t[keys.iconGrid]: 'أيقونات',\n\t[keys.libraryUnavailable]: 'لم تعد هذه مكتبة الأيقونات متوفرة. اختر بديلاً.',\n\t[keys.iconUnavailable]: 'غير متوفر',\n\t[keys.missingPreset]: 'الإعداد المسبق مفقود',\n\t[keys.preset]: 'إعداد مسبق',\n\t[keys.missingPresetHint]: 'هذا الإعداد المسبق لم يعد موجودًا. اختر بديلاً.',\n\t[keys.invalidColor]: 'لون غير صالح',\n\t[keys.pickColor]: 'اختر لوناً',\n\t[keys.clearColor]: 'مسح اللون',\n\t[keys.eyedropperPick]: 'اختيار لون من الشاشة',\n\t[keys.hue]: 'تدرج اللون',\n\t[keys.opacity]: 'التعتيم',\n\t[keys.saturationBrightness]: 'التشبع والسطوع',\n\t[keys.format]: 'التنسيق',\n\t[keys.reveal]: 'إظهار',\n\t[keys.conceal]: 'إخفاء',\n\t[keys.showValue]: 'عرض القيمة',\n\t[keys.hideValue]: 'إخفاء القيمة',\n\t[keys.encryptedValue]: 'قيمة مشفرة',\n\t[keys.replaceValue]: 'استبدال القيمة',\n\t[keys.clearValue]: 'مسح القيمة',\n\t[keys.undoClear]: 'التراجع عن المسح',\n\t[keys.clearedOnSave]: 'سيتم حذفها عند الحفظ',\n\t[keys.generateValue]: 'إنشاء قيمة جديدة',\n\t[keys.writeOnlyValue]: 'قيمة مشفرة للكتابة فقط',\n\t[keys.secretNotSet]: 'غير محدد',\n}\n"],"mappings":";;AAEA,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;
|
|
1
|
+
{"version":3,"file":"ar.js","names":[],"sources":["../../src/translations/ar.ts"],"sourcesContent":["import { keys, type TranslationKey } from './keys'\n\nexport const ar: Record<TranslationKey, string> = {\n\t[keys.pluginName]: 'Fields',\n\t[keys.presets]: 'الإعدادات المسبقة',\n\t[keys.fieldIconLabel]: 'أيقونة',\n\t[keys.fieldIconLibraryLabel]: 'مكتبة الأيقونات',\n\t[keys.selectIcon]: 'اختر أيقونة',\n\t[keys.clearIcon]: 'مسح الأيقونة',\n\t[keys.resultsCount]: '{{count}} أيقونات',\n\t[keys.textInputPlaceholder]: 'library:icon-name',\n\t[keys.invalidIconLibrary]: 'مكتبة الأيقونات غير معروفة: {{library}}',\n\t[keys.invalidIconName]: 'أيقونة غير معروفة \"{{name}}\" في مكتبة {{library}}',\n\t[keys.invalidIconLibraryValue]: 'ليست مكتبة أيقونات مسجلة: {{value}}',\n\t[keys.searchIcons]: 'ابحث عن الأيقونات',\n\t[keys.noIconsFound]: 'لم يتم العثور على أيقونات',\n\t[keys.browseAll]: 'تصفح الكل',\n\t[keys.recent]: 'الأخيرة',\n\t[keys.allIcons]: 'جميع الأيقونات',\n\t[keys.iconCategories]: 'فئات الأيقونات',\n\t[keys.iconGrid]: 'أيقونات',\n\t[keys.libraryUnavailable]: 'لم تعد هذه مكتبة الأيقونات متوفرة. اختر بديلاً.',\n\t[keys.iconUnavailable]: 'غير متوفر',\n\t[keys.missingPreset]: 'الإعداد المسبق مفقود',\n\t[keys.preset]: 'إعداد مسبق',\n\t[keys.missingPresetHint]: 'هذا الإعداد المسبق لم يعد موجودًا. اختر بديلاً.',\n\t[keys.invalidColor]: 'لون غير صالح',\n\t[keys.pickColor]: 'اختر لوناً',\n\t[keys.clearColor]: 'مسح اللون',\n\t[keys.eyedropperPick]: 'اختيار لون من الشاشة',\n\t[keys.hue]: 'تدرج اللون',\n\t[keys.opacity]: 'التعتيم',\n\t[keys.saturationBrightness]: 'التشبع والسطوع',\n\t[keys.format]: 'التنسيق',\n\t[keys.reveal]: 'إظهار',\n\t[keys.conceal]: 'إخفاء',\n\t[keys.showValue]: 'عرض القيمة',\n\t[keys.hideValue]: 'إخفاء القيمة',\n\t[keys.encryptedValue]: 'قيمة مشفرة',\n\t[keys.replaceValue]: 'استبدال القيمة',\n\t[keys.clearValue]: 'مسح القيمة',\n\t[keys.undoClear]: 'التراجع عن المسح',\n\t[keys.clearedOnSave]: 'سيتم حذفها عند الحفظ',\n\t[keys.generateValue]: 'إنشاء قيمة جديدة',\n\t[keys.writeOnlyValue]: 'قيمة مشفرة للكتابة فقط',\n\t[keys.secretNotSet]: 'غير محدد',\n\t[keys.selectUnit]: 'اختيار الوحدة',\n\t[keys.measurementBelowMin]: 'يجب ألا يقل عن {{min}}',\n\t[keys.measurementAboveMax]: 'يجب ألا يزيد عن {{max}}',\n}\n"],"mappings":";;AAEA,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;EACpB,KAAK,aAAa;EAClB,KAAK,sBAAsB;EAC3B,KAAK,sBAAsB;AAC7B"}
|
package/dist/translations/de.js
CHANGED
|
@@ -48,7 +48,10 @@ const de = {
|
|
|
48
48
|
[keys.clearedOnSave]: "Wird beim Speichern entfernt",
|
|
49
49
|
[keys.generateValue]: "Neuen Wert generieren",
|
|
50
50
|
[keys.writeOnlyValue]: "Nur schreibbarer verschlüsselter Wert",
|
|
51
|
-
[keys.secretNotSet]: "Nicht gesetzt"
|
|
51
|
+
[keys.secretNotSet]: "Nicht gesetzt",
|
|
52
|
+
[keys.selectUnit]: "Einheit wählen",
|
|
53
|
+
[keys.measurementBelowMin]: "Muss mindestens {{min}} sein",
|
|
54
|
+
[keys.measurementAboveMax]: "Darf höchstens {{max}} sein"
|
|
52
55
|
};
|
|
53
56
|
//#endregion
|
|
54
57
|
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\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;
|
|
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\t[keys.selectUnit]: 'Einheit wählen',\n\t[keys.measurementBelowMin]: 'Muss mindestens {{min}} sein',\n\t[keys.measurementAboveMax]: 'Darf höchstens {{max}} sein',\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;EACpB,KAAK,aAAa;EAClB,KAAK,sBAAsB;EAC3B,KAAK,sBAAsB;AAC7B"}
|
package/dist/translations/en.js
CHANGED
|
@@ -48,7 +48,10 @@ const en = {
|
|
|
48
48
|
[keys.clearedOnSave]: "Will be removed on save",
|
|
49
49
|
[keys.generateValue]: "Generate new value",
|
|
50
50
|
[keys.writeOnlyValue]: "Write-only encrypted value",
|
|
51
|
-
[keys.secretNotSet]: "Not set"
|
|
51
|
+
[keys.secretNotSet]: "Not set",
|
|
52
|
+
[keys.selectUnit]: "Select unit",
|
|
53
|
+
[keys.measurementBelowMin]: "Must be at least {{min}}",
|
|
54
|
+
[keys.measurementAboveMax]: "Must be no more than {{max}}"
|
|
52
55
|
};
|
|
53
56
|
//#endregion
|
|
54
57
|
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\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;
|
|
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\t[keys.selectUnit]: 'Select unit',\n\t[keys.measurementBelowMin]: 'Must be at least {{min}}',\n\t[keys.measurementAboveMax]: 'Must be no more than {{max}}',\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;EACpB,KAAK,aAAa;EAClB,KAAK,sBAAsB;EAC3B,KAAK,sBAAsB;AAC7B"}
|
package/dist/translations/es.js
CHANGED
|
@@ -43,7 +43,10 @@ const es = {
|
|
|
43
43
|
[keys.clearedOnSave]: "Se eliminará al guardar",
|
|
44
44
|
[keys.generateValue]: "Generar un valor nuevo",
|
|
45
45
|
[keys.writeOnlyValue]: "Valor cifrado de solo escritura",
|
|
46
|
-
[keys.secretNotSet]: "No definido"
|
|
46
|
+
[keys.secretNotSet]: "No definido",
|
|
47
|
+
[keys.selectUnit]: "Seleccionar unidad",
|
|
48
|
+
[keys.measurementBelowMin]: "Debe ser al menos {{min}}",
|
|
49
|
+
[keys.measurementAboveMax]: "No debe superar {{max}}"
|
|
47
50
|
};
|
|
48
51
|
//#endregion
|
|
49
52
|
export { es };
|