@10x-media/fields 4.0.0-alpha.1 → 4.0.0-alpha.3
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 +12 -0
- package/README.md +1 -1
- package/dist/fields/color/server/ColorCell.d.ts +1 -1
- package/dist/fields/color/server/ColorFieldServer.d.ts +1 -1
- package/dist/fields/encrypted/components/ProtectedCell.d.ts +1 -1
- package/dist/fields/encrypted/components/ProtectedRichText.d.ts +1 -1
- package/dist/fields/measurement/client/editModel.js +12 -3
- package/dist/fields/measurement/client/editModel.js.map +1 -1
- package/dist/fields/measurement/server/MeasurementCellServer.d.ts +1 -1
- package/dist/fields/measurement/server/MeasurementFieldServer.d.ts +1 -1
- package/dist/fields/phoneNumber/server/PhoneNumberCellServer.d.ts +1 -1
- package/dist/fields/phoneNumber/server/PhoneNumberFieldServer.d.ts +1 -1
- package/package.json +15 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @10x-media/fields
|
|
2
2
|
|
|
3
|
+
## 4.0.0-alpha.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Requires Payload `4.0.0-beta.10`: the `payload` and `@payloadcms/*` peers are `^4.0.0-beta.10`, and the plugins are built and tested against it.
|
|
8
|
+
|
|
9
|
+
## 4.0.0-alpha.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Measurement: an empty major part next to a typed minor part of a compound unit now reads as zero, so inches typed into an empty `ft in` field (or pounds into an empty `st lb` field) commit on blur. `5` in the inches input saves as `0 ft 5 in` instead of being dropped while the form turned dirty. Clearing the feet of a stored value while its inches are still shown likewise keeps those inches. Clearing both parts still clears the value.
|
|
14
|
+
|
|
3
15
|
## 4.0.0-alpha.1
|
|
4
16
|
|
|
5
17
|
### Major Changes
|
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
Reusable fields for Payload that look and behave native: a full color picker in a constant-height row, a searchable icon picker over pluggable icon libraries, encrypted fields with key rotation and opt-in exact-match querying, and a unit-aware measurement field. Built from `@payloadcms/ui` primitives on Payload design tokens, indistinguishable from Payload's own fields.
|
|
11
11
|
|
|
12
|
-
[](https://www.npmjs.com/package/@10x-media/fields)
|
|
12
|
+
[](https://www.npmjs.com/package/@10x-media/fields)
|
|
13
13
|
|
|
14
14
|
Part of the [@10x-media Payload plugins](https://github.com/10x-media/payload-plugins) collection. In alpha on this branch: published under the `alpha` dist-tag until Payload 4 is stable.
|
|
15
15
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DefaultServerCellComponentProps } from "payload";
|
|
2
2
|
//#region src/fields/color/server/ColorCell.d.ts
|
|
3
|
-
declare const ColorCell: (props: DefaultServerCellComponentProps) => import("react
|
|
3
|
+
declare const ColorCell: (props: DefaultServerCellComponentProps) => import("react").JSX.Element | null;
|
|
4
4
|
//#endregion
|
|
5
5
|
export { ColorCell };
|
|
6
6
|
//# sourceMappingURL=ColorCell.d.ts.map
|
|
@@ -12,7 +12,7 @@ type ColorFieldServerComponentProps = {
|
|
|
12
12
|
* as serverProps; they reflect the doc at render time, so data-dependent
|
|
13
13
|
* resolvers refresh on save/reload, not live with sibling edits.
|
|
14
14
|
*/
|
|
15
|
-
declare const ColorFieldServer: (props: ColorFieldServerComponentProps) => Promise<import("react
|
|
15
|
+
declare const ColorFieldServer: (props: ColorFieldServerComponentProps) => Promise<import("react").JSX.Element>;
|
|
16
16
|
//#endregion
|
|
17
17
|
export { ColorFieldServer };
|
|
18
18
|
//# sourceMappingURL=ColorFieldServer.d.ts.map
|
|
@@ -22,7 +22,7 @@ declare const ProtectedCell: ({
|
|
|
22
22
|
hintName?: string;
|
|
23
23
|
maskDots?: number;
|
|
24
24
|
setName?: string;
|
|
25
|
-
}) => import("react
|
|
25
|
+
}) => import("react").JSX.Element;
|
|
26
26
|
//#endregion
|
|
27
27
|
export { ProtectedCell };
|
|
28
28
|
//# sourceMappingURL=ProtectedCell.d.ts.map
|
|
@@ -15,7 +15,7 @@ type ProtectedRichTextProps = RichTextFieldServerProps & {
|
|
|
15
15
|
* file never enters a client bundle (the lexical editor loads via the app import
|
|
16
16
|
* map like any richText field).
|
|
17
17
|
*/
|
|
18
|
-
declare const ProtectedRichText: (props: ProtectedRichTextProps) => import("react
|
|
18
|
+
declare const ProtectedRichText: (props: ProtectedRichTextProps) => import("react").JSX.Element;
|
|
19
19
|
//#endregion
|
|
20
20
|
export { ProtectedRichText };
|
|
21
21
|
//# sourceMappingURL=ProtectedRichText.d.ts.map
|
|
@@ -8,6 +8,15 @@ const parseDraft = (raw) => {
|
|
|
8
8
|
const parsed = Number(raw);
|
|
9
9
|
return Number.isFinite(parsed) ? parsed : null;
|
|
10
10
|
};
|
|
11
|
+
/**
|
|
12
|
+
* The major part of a compound draft. An empty major beside a minor that holds a number
|
|
13
|
+
* reads as zero (`'' ft 5 in` is 5 in), so typing only the minor part commits; with both
|
|
14
|
+
* parts empty, or an unparseable major, there is nothing to commit.
|
|
15
|
+
*/
|
|
16
|
+
const parseMajorDraft = (drafts) => {
|
|
17
|
+
if (drafts.primary.trim() === "" && parseDraft(drafts.minor) !== null) return 0;
|
|
18
|
+
return parseDraft(drafts.primary);
|
|
19
|
+
};
|
|
11
20
|
const ALL_DIRTY = {
|
|
12
21
|
primary: true,
|
|
13
22
|
minor: true
|
|
@@ -22,7 +31,7 @@ const commitDrafts = (drafts, opts) => {
|
|
|
22
31
|
const exact = engine.decompose(storedValue, storageUnit, displayUnit, storageDigits);
|
|
23
32
|
const exactTotal = exact.major * compound.ratio + exact.minor;
|
|
24
33
|
if (dirty.primary) {
|
|
25
|
-
let typedMajor =
|
|
34
|
+
let typedMajor = parseMajorDraft(drafts);
|
|
26
35
|
if (typedMajor === null) return null;
|
|
27
36
|
if (entry === "quantize") typedMajor = roundTo(typedMajor, engine.precisionFor(compound.major, precision));
|
|
28
37
|
const paintedMajor = parseDraft(paintedDrafts.primary) ?? exact.major;
|
|
@@ -42,9 +51,9 @@ const commitDrafts = (drafts, opts) => {
|
|
|
42
51
|
const stored = hasStored ? engine.decompose(storedValue, storageUnit, displayUnit, storageDigits) : null;
|
|
43
52
|
let major;
|
|
44
53
|
if (dirty.primary) {
|
|
45
|
-
major =
|
|
54
|
+
major = parseMajorDraft(drafts);
|
|
46
55
|
if (major !== null && entry === "quantize") major = roundTo(major, engine.precisionFor(compound.major, precision));
|
|
47
|
-
} else major = stored ? stored.major :
|
|
56
|
+
} else major = stored ? stored.major : parseMajorDraft(drafts);
|
|
48
57
|
if (major === null) return null;
|
|
49
58
|
let minor;
|
|
50
59
|
if (dirty.minor) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editModel.js","names":[],"sources":["../../../../src/fields/measurement/client/editModel.ts"],"sourcesContent":["import { roundTo } from '../engine/convert'\nimport type { MeasurementEngine } from '../engine/registry'\nimport { COMPOUNDS, type MeasurementUnitId, STORAGE_FRACTION_DIGITS } from '../engine/units'\n\n/** Re-exported so MeasurementField/MeasurementCell keep one import site for the edit model. */\nexport { resolveDisplayUnit } from '../engine/locale'\n\nexport type MeasurementDrafts = { primary: string; minor: string }\n\n/** Which inputs the viewer has actually typed into since the last resync. */\nexport type DirtyDrafts = { primary: boolean; minor: boolean }\n\ntype UnitContext = {\n\t/** Bound over the field's custom units, so custom ids convert and format like built-ins. */\n\tengine: MeasurementEngine\n\tstorageUnit: MeasurementUnitId\n\tdisplayUnit: MeasurementUnitId\n\tprecision?: Partial<Record<MeasurementUnitId, number>>\n\t/**\n\t * Draft-repaint policy: 'faithful' (default) escalates fraction digits until the\n\t * draft round-trips to the stored value; 'display' renders straight at display\n\t * digits, so a stored value can print shorter than it is stored.\n\t */\n\tdraft?: 'display' | 'faithful'\n\t/** Fraction digits kept in the storage unit. Defaults to STORAGE_FRACTION_DIGITS. */\n\tstorageDigits?: number\n}\n\ntype CommitOptions = UnitContext & {\n\t/**\n\t * Entry-unit typing behavior: 'quantize' rounds a dirty part at its own display\n\t * digits, in the unit it was typed in, before converting; 'free' (default) keeps\n\t * the typed value exact.\n\t */\n\tentry?: 'quantize' | 'free'\n\t/** An untouched part never commits its displayed string; only a dirty one does. */\n\tdirty?: DirtyDrafts\n\t/** Current stored value, used to derive an untouched part's exact contribution. */\n\tstoredValue?: number | null\n\t/**\n\t * The compound drafts as painted on screen immediately before this edit (not the\n\t * post-keystroke `drafts`). A display-digit repaint can carry (182.5 cm storage\n\t * splits exactly to 5 ft 11.850394 in but paints as 6 ft 0 in), so when exactly\n\t * one part is dirty, the edited part's contribution is computed as a delta off\n\t * this baseline rather than a full replace, which would otherwise bake the\n\t * painted carry into storage.\n\t */\n\tpaintedDrafts?: MeasurementDrafts\n}\n\nconst numberToDraft = (value: number): string => String(value)\n\nconst parseDraft = (raw: string): number | null => {\n\tif (raw.trim() === '') return null\n\tconst parsed = Number(raw)\n\treturn Number.isFinite(parsed) ? parsed : null\n}\n\n// draftsFor/commitDrafts default to 'faithful'/'free'/ALL_DIRTY when a caller omits\n// them, i.e. the shape of 'exact' mode, not the engine's own 'readable' default: the\n// component always threads its resolved precision explicitly, so these bare defaults\n// exist only for a caller invoking editModel directly (tests, or an embedder outside\n// the component), and preserve the single behavior this module had before precision\n// modes existed.\nconst ALL_DIRTY: DirtyDrafts = { primary: true, minor: true }\n\nexport const commitDrafts = (drafts: MeasurementDrafts, opts: CommitOptions): number | null => {\n\tconst {\n\t\tdisplayUnit,\n\t\tdirty = ALL_DIRTY,\n\t\tengine,\n\t\tentry = 'free',\n\t\tpaintedDrafts,\n\t\tprecision,\n\t\tstorageDigits = STORAGE_FRACTION_DIGITS,\n\t\tstorageUnit,\n\t\tstoredValue = null,\n\t} = opts\n\n\tif (engine.isCompoundUnit(displayUnit)) {\n\t\tconst compound = COMPOUNDS[displayUnit]\n\t\tconst hasStored = typeof storedValue === 'number'\n\t\tconst dirtyCount = (dirty.primary ? 1 : 0) + (dirty.minor ? 1 : 0)\n\n\t\t// Delta path: exactly one part was touched and a painted baseline exists, so\n\t\t// the untouched part's contribution comes entirely from the exact stored\n\t\t// total (never its carried, display-precision draft), and the touched part\n\t\t// contributes only the change the viewer actually typed, in minor units.\n\t\tif (hasStored && dirtyCount === 1 && paintedDrafts) {\n\t\t\tconst exact = engine.decompose(storedValue as number, storageUnit, displayUnit, storageDigits)\n\t\t\tconst exactTotal = exact.major * compound.ratio + exact.minor\n\n\t\t\tif (dirty.primary) {\n\t\t\t\tlet typedMajor = parseDraft(drafts.primary)\n\t\t\t\tif (typedMajor === null) return null\n\t\t\t\tif (entry === 'quantize') {\n\t\t\t\t\ttypedMajor = roundTo(typedMajor, engine.precisionFor(compound.major, precision))\n\t\t\t\t}\n\t\t\t\tconst paintedMajor = parseDraft(paintedDrafts.primary) ?? exact.major\n\t\t\t\tconst newTotal = exactTotal + (typedMajor - paintedMajor) * compound.ratio\n\t\t\t\treturn roundTo(\n\t\t\t\t\tengine.compose({ major: 0, minor: newTotal }, displayUnit, storageUnit),\n\t\t\t\t\tstorageDigits\n\t\t\t\t)\n\t\t\t}\n\n\t\t\tconst rawMinor = parseDraft(drafts.minor) ?? 0\n\t\t\tconst typedMinor =\n\t\t\t\tentry === 'quantize'\n\t\t\t\t\t? roundTo(rawMinor, engine.precisionFor(displayUnit, precision))\n\t\t\t\t\t: rawMinor\n\t\t\tconst paintedMinor = parseDraft(paintedDrafts.minor) ?? 0\n\t\t\tconst newTotal = exactTotal + (typedMinor - paintedMinor)\n\t\t\treturn roundTo(\n\t\t\t\tengine.compose({ major: 0, minor: newTotal }, displayUnit, storageUnit),\n\t\t\t\tstorageDigits\n\t\t\t)\n\t\t}\n\n\t\t// Both parts dirty (an explicit full replace) or no baseline to diff\n\t\t// against: compose the two parts directly, as before.\n\t\tconst stored = hasStored\n\t\t\t? engine.decompose(storedValue as number, storageUnit, displayUnit, storageDigits)\n\t\t\t: null\n\n\t\tlet major: number | null\n\t\tif (dirty.primary) {\n\t\t\tmajor = parseDraft(drafts.primary)\n\t\t\tif (major !== null && entry === 'quantize') {\n\t\t\t\tmajor = roundTo(major, engine.precisionFor(compound.major, precision))\n\t\t\t}\n\t\t} else {\n\t\t\tmajor = stored ? stored.major : parseDraft(drafts.primary)\n\t\t}\n\t\tif (major === null) return null\n\n\t\tlet minor: number\n\t\tif (dirty.minor) {\n\t\t\tconst rawMinor = parseDraft(drafts.minor) ?? 0\n\t\t\tconst maxMinor = compound.ratio - 0.001\n\t\t\t// Clamp the raw typed magnitude (bounds a literal 24) before quantizing:\n\t\t\t// a quantized value landing exactly on the ratio (11.96 -> 12) must be\n\t\t\t// free to carry into the major via compose, matching decompose's own\n\t\t\t// carry contract, so nothing clamps it back down afterward.\n\t\t\tconst clampedRaw = Math.sign(rawMinor) * Math.min(Math.abs(rawMinor), maxMinor)\n\t\t\tminor =\n\t\t\t\tentry === 'quantize'\n\t\t\t\t\t? roundTo(clampedRaw, engine.precisionFor(displayUnit, precision))\n\t\t\t\t\t: clampedRaw\n\t\t} else {\n\t\t\t// No stored value to derive an exact minor from (a brand new, never-saved\n\t\t\t// field): fall back to the painted baseline, matching major's own fallback,\n\t\t\t// never a bare 0 (a cleared-then-retyped major would otherwise commit with\n\t\t\t// its minor silently zeroed).\n\t\t\tminor = stored ? stored.minor : (parseDraft(paintedDrafts?.minor ?? '') ?? 0)\n\t\t}\n\n\t\treturn roundTo(engine.compose({ major, minor }, displayUnit, storageUnit), storageDigits)\n\t}\n\n\tif (!dirty.primary) return storedValue\n\tconst parsed = parseDraft(drafts.primary)\n\tif (parsed === null) return null\n\tconst value =\n\t\tentry === 'quantize' ? roundTo(parsed, engine.precisionFor(displayUnit, precision)) : parsed\n\treturn roundTo(engine.convert(value, displayUnit, storageUnit), storageDigits)\n}\n\n/**\n * Drafts for repainting from a stored value. 'faithful' (default) is the shortest\n * draft that commits back to the stored value: display precision first, then one\n * more fraction digit at a time up to storage precision, since a draft that\n * silently truncates the stored value would write the truncation back on the next\n * save. 'display' skips escalation and renders straight at display digits\n * (compound parts each at their own digits), trading faithfulness for a value that\n * always matches what the unit picker promises.\n */\nexport const draftsFor = (value: number | null, opts: UnitContext): MeasurementDrafts => {\n\tif (typeof value !== 'number' || Number.isNaN(value)) return { minor: '', primary: '' }\n\tconst {\n\t\tdisplayUnit,\n\t\tdraft = 'faithful',\n\t\tengine,\n\t\tprecision,\n\t\tstorageDigits = STORAGE_FRACTION_DIGITS,\n\t\tstorageUnit,\n\t} = opts\n\tconst draftAt = (digits: number): MeasurementDrafts => {\n\t\tif (engine.isCompoundUnit(displayUnit)) {\n\t\t\tconst parts = engine.decompose(value, storageUnit, displayUnit, digits)\n\t\t\treturn { minor: numberToDraft(parts.minor), primary: numberToDraft(parts.major) }\n\t\t}\n\t\tconst converted = roundTo(engine.convert(value, storageUnit, displayUnit), digits)\n\t\treturn { minor: '', primary: numberToDraft(converted) }\n\t}\n\n\tconst displayDigits = engine.precisionFor(displayUnit, precision)\n\tif (draft === 'display') return draftAt(displayDigits)\n\n\t// Digits past storage precision never survive a save, so that is where escalation stops.\n\tconst maxDigits = Math.max(displayDigits, storageDigits)\n\tconst target = roundTo(value, storageDigits)\n\t// A bare probe: never forward `opts` itself, so an entry/dirty/storedValue field\n\t// a future CommitOptions caller happens to carry can never poison this check.\n\tconst probeOpts: UnitContext = { displayUnit, engine, precision, storageDigits, storageUnit }\n\tfor (let digits = displayDigits; digits < maxDigits; digits++) {\n\t\tconst candidate = draftAt(digits)\n\t\tif (commitDrafts(candidate, probeOpts) === target) return candidate\n\t}\n\treturn draftAt(maxDigits)\n}\n"],"mappings":";;;;AAkDA,MAAM,iBAAiB,UAA0B,OAAO,KAAK;AAE7D,MAAM,cAAc,QAA+B;CAClD,IAAI,IAAI,KAAK,MAAM,IAAI,OAAO;CAC9B,MAAM,SAAS,OAAO,GAAG;CACzB,OAAO,OAAO,SAAS,MAAM,IAAI,SAAS;AAC3C;AAQA,MAAM,YAAyB;CAAE,SAAS;CAAM,OAAO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O;GAAI,SAAS,cADX,QAAQ,OAAO,QAAQ,OAAO,aAAa,WAAW,GAAG,MACxB,CAAC;EAAE;CACvD;CAEA,MAAM,gBAAgB,OAAO,aAAa,aAAa,SAAS;CAChE,IAAI,UAAU,WAAW,OAAO,QAAQ,aAAa;CAGrD,MAAM,YAAY,KAAK,IAAI,eAAe,aAAa;CACvD,MAAM,SAAS,QAAQ,OAAO,aAAa;CAG3C,MAAM,YAAyB;EAAE;EAAa;EAAQ;EAAW;EAAe;CAAY;CAC5F,KAAK,IAAI,SAAS,eAAe,SAAS,WAAW,UAAU;EAC9D,MAAM,YAAY,QAAQ,MAAM;EAChC,IAAI,aAAa,WAAW,SAAS,MAAM,QAAQ,OAAO;CAC3D;CACA,OAAO,QAAQ,SAAS;AACzB"}
|
|
1
|
+
{"version":3,"file":"editModel.js","names":[],"sources":["../../../../src/fields/measurement/client/editModel.ts"],"sourcesContent":["import { roundTo } from '../engine/convert'\nimport type { MeasurementEngine } from '../engine/registry'\nimport { COMPOUNDS, type MeasurementUnitId, STORAGE_FRACTION_DIGITS } from '../engine/units'\n\n/** Re-exported so MeasurementField/MeasurementCell keep one import site for the edit model. */\nexport { resolveDisplayUnit } from '../engine/locale'\n\nexport type MeasurementDrafts = { primary: string; minor: string }\n\n/** Which inputs the viewer has actually typed into since the last resync. */\nexport type DirtyDrafts = { primary: boolean; minor: boolean }\n\ntype UnitContext = {\n\t/** Bound over the field's custom units, so custom ids convert and format like built-ins. */\n\tengine: MeasurementEngine\n\tstorageUnit: MeasurementUnitId\n\tdisplayUnit: MeasurementUnitId\n\tprecision?: Partial<Record<MeasurementUnitId, number>>\n\t/**\n\t * Draft-repaint policy: 'faithful' (default) escalates fraction digits until the\n\t * draft round-trips to the stored value; 'display' renders straight at display\n\t * digits, so a stored value can print shorter than it is stored.\n\t */\n\tdraft?: 'display' | 'faithful'\n\t/** Fraction digits kept in the storage unit. Defaults to STORAGE_FRACTION_DIGITS. */\n\tstorageDigits?: number\n}\n\ntype CommitOptions = UnitContext & {\n\t/**\n\t * Entry-unit typing behavior: 'quantize' rounds a dirty part at its own display\n\t * digits, in the unit it was typed in, before converting; 'free' (default) keeps\n\t * the typed value exact.\n\t */\n\tentry?: 'quantize' | 'free'\n\t/** An untouched part never commits its displayed string; only a dirty one does. */\n\tdirty?: DirtyDrafts\n\t/** Current stored value, used to derive an untouched part's exact contribution. */\n\tstoredValue?: number | null\n\t/**\n\t * The compound drafts as painted on screen immediately before this edit (not the\n\t * post-keystroke `drafts`). A display-digit repaint can carry (182.5 cm storage\n\t * splits exactly to 5 ft 11.850394 in but paints as 6 ft 0 in), so when exactly\n\t * one part is dirty, the edited part's contribution is computed as a delta off\n\t * this baseline rather than a full replace, which would otherwise bake the\n\t * painted carry into storage.\n\t */\n\tpaintedDrafts?: MeasurementDrafts\n}\n\nconst numberToDraft = (value: number): string => String(value)\n\nconst parseDraft = (raw: string): number | null => {\n\tif (raw.trim() === '') return null\n\tconst parsed = Number(raw)\n\treturn Number.isFinite(parsed) ? parsed : null\n}\n\n/**\n * The major part of a compound draft. An empty major beside a minor that holds a number\n * reads as zero (`'' ft 5 in` is 5 in), so typing only the minor part commits; with both\n * parts empty, or an unparseable major, there is nothing to commit.\n */\nconst parseMajorDraft = (drafts: MeasurementDrafts): number | null => {\n\tif (drafts.primary.trim() === '' && parseDraft(drafts.minor) !== null) return 0\n\treturn parseDraft(drafts.primary)\n}\n\n// draftsFor/commitDrafts default to 'faithful'/'free'/ALL_DIRTY when a caller omits\n// them, i.e. the shape of 'exact' mode, not the engine's own 'readable' default: the\n// component always threads its resolved precision explicitly, so these bare defaults\n// exist only for a caller invoking editModel directly (tests, or an embedder outside\n// the component), and preserve the single behavior this module had before precision\n// modes existed.\nconst ALL_DIRTY: DirtyDrafts = { primary: true, minor: true }\n\nexport const commitDrafts = (drafts: MeasurementDrafts, opts: CommitOptions): number | null => {\n\tconst {\n\t\tdisplayUnit,\n\t\tdirty = ALL_DIRTY,\n\t\tengine,\n\t\tentry = 'free',\n\t\tpaintedDrafts,\n\t\tprecision,\n\t\tstorageDigits = STORAGE_FRACTION_DIGITS,\n\t\tstorageUnit,\n\t\tstoredValue = null,\n\t} = opts\n\n\tif (engine.isCompoundUnit(displayUnit)) {\n\t\tconst compound = COMPOUNDS[displayUnit]\n\t\tconst hasStored = typeof storedValue === 'number'\n\t\tconst dirtyCount = (dirty.primary ? 1 : 0) + (dirty.minor ? 1 : 0)\n\n\t\t// Delta path: exactly one part was touched and a painted baseline exists, so\n\t\t// the untouched part's contribution comes entirely from the exact stored\n\t\t// total (never its carried, display-precision draft), and the touched part\n\t\t// contributes only the change the viewer actually typed, in minor units.\n\t\tif (hasStored && dirtyCount === 1 && paintedDrafts) {\n\t\t\tconst exact = engine.decompose(storedValue as number, storageUnit, displayUnit, storageDigits)\n\t\t\tconst exactTotal = exact.major * compound.ratio + exact.minor\n\n\t\t\tif (dirty.primary) {\n\t\t\t\tlet typedMajor = parseMajorDraft(drafts)\n\t\t\t\tif (typedMajor === null) return null\n\t\t\t\tif (entry === 'quantize') {\n\t\t\t\t\ttypedMajor = roundTo(typedMajor, engine.precisionFor(compound.major, precision))\n\t\t\t\t}\n\t\t\t\tconst paintedMajor = parseDraft(paintedDrafts.primary) ?? exact.major\n\t\t\t\tconst newTotal = exactTotal + (typedMajor - paintedMajor) * compound.ratio\n\t\t\t\treturn roundTo(\n\t\t\t\t\tengine.compose({ major: 0, minor: newTotal }, displayUnit, storageUnit),\n\t\t\t\t\tstorageDigits\n\t\t\t\t)\n\t\t\t}\n\n\t\t\tconst rawMinor = parseDraft(drafts.minor) ?? 0\n\t\t\tconst typedMinor =\n\t\t\t\tentry === 'quantize'\n\t\t\t\t\t? roundTo(rawMinor, engine.precisionFor(displayUnit, precision))\n\t\t\t\t\t: rawMinor\n\t\t\tconst paintedMinor = parseDraft(paintedDrafts.minor) ?? 0\n\t\t\tconst newTotal = exactTotal + (typedMinor - paintedMinor)\n\t\t\treturn roundTo(\n\t\t\t\tengine.compose({ major: 0, minor: newTotal }, displayUnit, storageUnit),\n\t\t\t\tstorageDigits\n\t\t\t)\n\t\t}\n\n\t\t// Both parts dirty (an explicit full replace) or no baseline to diff\n\t\t// against: compose the two parts directly, as before.\n\t\tconst stored = hasStored\n\t\t\t? engine.decompose(storedValue as number, storageUnit, displayUnit, storageDigits)\n\t\t\t: null\n\n\t\tlet major: number | null\n\t\tif (dirty.primary) {\n\t\t\tmajor = parseMajorDraft(drafts)\n\t\t\tif (major !== null && entry === 'quantize') {\n\t\t\t\tmajor = roundTo(major, engine.precisionFor(compound.major, precision))\n\t\t\t}\n\t\t} else {\n\t\t\tmajor = stored ? stored.major : parseMajorDraft(drafts)\n\t\t}\n\t\tif (major === null) return null\n\n\t\tlet minor: number\n\t\tif (dirty.minor) {\n\t\t\tconst rawMinor = parseDraft(drafts.minor) ?? 0\n\t\t\tconst maxMinor = compound.ratio - 0.001\n\t\t\t// Clamp the raw typed magnitude (bounds a literal 24) before quantizing:\n\t\t\t// a quantized value landing exactly on the ratio (11.96 -> 12) must be\n\t\t\t// free to carry into the major via compose, matching decompose's own\n\t\t\t// carry contract, so nothing clamps it back down afterward.\n\t\t\tconst clampedRaw = Math.sign(rawMinor) * Math.min(Math.abs(rawMinor), maxMinor)\n\t\t\tminor =\n\t\t\t\tentry === 'quantize'\n\t\t\t\t\t? roundTo(clampedRaw, engine.precisionFor(displayUnit, precision))\n\t\t\t\t\t: clampedRaw\n\t\t} else {\n\t\t\t// No stored value to derive an exact minor from (a brand new, never-saved\n\t\t\t// field): fall back to the painted baseline, matching major's own fallback,\n\t\t\t// never a bare 0 (a cleared-then-retyped major would otherwise commit with\n\t\t\t// its minor silently zeroed).\n\t\t\tminor = stored ? stored.minor : (parseDraft(paintedDrafts?.minor ?? '') ?? 0)\n\t\t}\n\n\t\treturn roundTo(engine.compose({ major, minor }, displayUnit, storageUnit), storageDigits)\n\t}\n\n\tif (!dirty.primary) return storedValue\n\tconst parsed = parseDraft(drafts.primary)\n\tif (parsed === null) return null\n\tconst value =\n\t\tentry === 'quantize' ? roundTo(parsed, engine.precisionFor(displayUnit, precision)) : parsed\n\treturn roundTo(engine.convert(value, displayUnit, storageUnit), storageDigits)\n}\n\n/**\n * Drafts for repainting from a stored value. 'faithful' (default) is the shortest\n * draft that commits back to the stored value: display precision first, then one\n * more fraction digit at a time up to storage precision, since a draft that\n * silently truncates the stored value would write the truncation back on the next\n * save. 'display' skips escalation and renders straight at display digits\n * (compound parts each at their own digits), trading faithfulness for a value that\n * always matches what the unit picker promises.\n */\nexport const draftsFor = (value: number | null, opts: UnitContext): MeasurementDrafts => {\n\tif (typeof value !== 'number' || Number.isNaN(value)) return { minor: '', primary: '' }\n\tconst {\n\t\tdisplayUnit,\n\t\tdraft = 'faithful',\n\t\tengine,\n\t\tprecision,\n\t\tstorageDigits = STORAGE_FRACTION_DIGITS,\n\t\tstorageUnit,\n\t} = opts\n\tconst draftAt = (digits: number): MeasurementDrafts => {\n\t\tif (engine.isCompoundUnit(displayUnit)) {\n\t\t\tconst parts = engine.decompose(value, storageUnit, displayUnit, digits)\n\t\t\treturn { minor: numberToDraft(parts.minor), primary: numberToDraft(parts.major) }\n\t\t}\n\t\tconst converted = roundTo(engine.convert(value, storageUnit, displayUnit), digits)\n\t\treturn { minor: '', primary: numberToDraft(converted) }\n\t}\n\n\tconst displayDigits = engine.precisionFor(displayUnit, precision)\n\tif (draft === 'display') return draftAt(displayDigits)\n\n\t// Digits past storage precision never survive a save, so that is where escalation stops.\n\tconst maxDigits = Math.max(displayDigits, storageDigits)\n\tconst target = roundTo(value, storageDigits)\n\t// A bare probe: never forward `opts` itself, so an entry/dirty/storedValue field\n\t// a future CommitOptions caller happens to carry can never poison this check.\n\tconst probeOpts: UnitContext = { displayUnit, engine, precision, storageDigits, storageUnit }\n\tfor (let digits = displayDigits; digits < maxDigits; digits++) {\n\t\tconst candidate = draftAt(digits)\n\t\tif (commitDrafts(candidate, probeOpts) === target) return candidate\n\t}\n\treturn draftAt(maxDigits)\n}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AAsB,SAAyC;CACxF,IAAI,OAAO,UAAU,YAAY,OAAO,MAAM,KAAK,GAAG,OAAO;EAAE,OAAO;EAAI,SAAS;CAAG;CACtF,MAAM,EACL,aACA,QAAQ,YACR,QACA,WACA,gBAAA,GACA,gBACG;CACJ,MAAM,WAAW,WAAsC;EACtD,IAAI,OAAO,eAAe,WAAW,GAAG;GACvC,MAAM,QAAQ,OAAO,UAAU,OAAO,aAAa,aAAa,MAAM;GACtE,OAAO;IAAE,OAAO,cAAc,MAAM,KAAK;IAAG,SAAS,cAAc,MAAM,KAAK;GAAE;EACjF;EAEA,OAAO;GAAE,OAAO;GAAI,SAAS,cADX,QAAQ,OAAO,QAAQ,OAAO,aAAa,WAAW,GAAG,MACxB,CAAC;EAAE;CACvD;CAEA,MAAM,gBAAgB,OAAO,aAAa,aAAa,SAAS;CAChE,IAAI,UAAU,WAAW,OAAO,QAAQ,aAAa;CAGrD,MAAM,YAAY,KAAK,IAAI,eAAe,aAAa;CACvD,MAAM,SAAS,QAAQ,OAAO,aAAa;CAG3C,MAAM,YAAyB;EAAE;EAAa;EAAQ;EAAW;EAAe;CAAY;CAC5F,KAAK,IAAI,SAAS,eAAe,SAAS,WAAW,UAAU;EAC9D,MAAM,YAAY,QAAQ,MAAM;EAChC,IAAI,aAAa,WAAW,SAAS,MAAM,QAAQ,OAAO;CAC3D;CACA,OAAO,QAAQ,SAAS;AACzB"}
|
|
@@ -15,7 +15,7 @@ type MeasurementCellServerComponentProps = {
|
|
|
15
15
|
* server Field carries functions (our hooks/validate, Payload's own sanitize-installed
|
|
16
16
|
* validate), and React's flight serializer throws on functions in client props.
|
|
17
17
|
*/
|
|
18
|
-
declare const MeasurementCellServer: (props: MeasurementCellServerComponentProps) => import("react
|
|
18
|
+
declare const MeasurementCellServer: (props: MeasurementCellServerComponentProps) => import("react").JSX.Element;
|
|
19
19
|
//#endregion
|
|
20
20
|
export { MeasurementCellServer };
|
|
21
21
|
//# sourceMappingURL=MeasurementCellServer.d.ts.map
|
|
@@ -10,7 +10,7 @@ type MeasurementFieldServerComponentProps = {
|
|
|
10
10
|
* then renders the client field with only serializable props, so the edit view
|
|
11
11
|
* first-paints in the right unit.
|
|
12
12
|
*/
|
|
13
|
-
declare const MeasurementFieldServer: (props: MeasurementFieldServerComponentProps) => Promise<import("react
|
|
13
|
+
declare const MeasurementFieldServer: (props: MeasurementFieldServerComponentProps) => Promise<import("react").JSX.Element>;
|
|
14
14
|
//#endregion
|
|
15
15
|
export { MeasurementFieldServer };
|
|
16
16
|
//# sourceMappingURL=MeasurementFieldServer.d.ts.map
|
|
@@ -13,7 +13,7 @@ type PhoneNumberCellServerComponentProps = {
|
|
|
13
13
|
* Formats entirely server-side: unlike measurement's cell, phone has no viewer
|
|
14
14
|
* preference to react to, so this ships zero client JS for the list column.
|
|
15
15
|
*/
|
|
16
|
-
declare const PhoneNumberCellServer: (props: PhoneNumberCellServerComponentProps) => Promise<import("react
|
|
16
|
+
declare const PhoneNumberCellServer: (props: PhoneNumberCellServerComponentProps) => Promise<import("react").JSX.Element | null>;
|
|
17
17
|
//#endregion
|
|
18
18
|
export { PhoneNumberCellServer };
|
|
19
19
|
//# sourceMappingURL=PhoneNumberCellServer.d.ts.map
|
|
@@ -10,7 +10,7 @@ type PhoneNumberFieldServerComponentProps = {
|
|
|
10
10
|
* so this is the one place a registry default and a field override are both visible
|
|
11
11
|
* together: resolution has to happen here, per request, not at config-build time.
|
|
12
12
|
*/
|
|
13
|
-
declare const PhoneNumberFieldServer: (props: PhoneNumberFieldServerComponentProps) => Promise<import("react
|
|
13
|
+
declare const PhoneNumberFieldServer: (props: PhoneNumberFieldServerComponentProps) => Promise<import("react").JSX.Element>;
|
|
14
14
|
//#endregion
|
|
15
15
|
export { PhoneNumberFieldServer };
|
|
16
16
|
//# sourceMappingURL=PhoneNumberFieldServer.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@10x-media/fields",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.3",
|
|
4
4
|
"description": "Reusable admin fields for Payload: color picker, icon picker, encrypted fields, and more",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -124,12 +124,12 @@
|
|
|
124
124
|
"LICENSE"
|
|
125
125
|
],
|
|
126
126
|
"peerDependencies": {
|
|
127
|
-
"@payloadcms/richtext-lexical": "^4.0.0-beta.
|
|
128
|
-
"@payloadcms/ui": "^4.0.0-beta.
|
|
127
|
+
"@payloadcms/richtext-lexical": "^4.0.0-beta.10",
|
|
128
|
+
"@payloadcms/ui": "^4.0.0-beta.10",
|
|
129
129
|
"@radix-ui/react-icons": "^1.3.0",
|
|
130
130
|
"@tabler/icons-react": "^3.0.0",
|
|
131
131
|
"lucide-react": ">=0.500.0",
|
|
132
|
-
"payload": "^4.0.0-beta.
|
|
132
|
+
"payload": "^4.0.0-beta.10",
|
|
133
133
|
"react": "^19.0.0",
|
|
134
134
|
"react-dom": "^19.0.0"
|
|
135
135
|
},
|
|
@@ -155,10 +155,10 @@
|
|
|
155
155
|
},
|
|
156
156
|
"devDependencies": {
|
|
157
157
|
"@axe-core/playwright": "^4.11.3",
|
|
158
|
-
"@payloadcms/db-mongodb": "4.0.0-beta.
|
|
159
|
-
"@payloadcms/db-postgres": "4.0.0-beta.
|
|
160
|
-
"@payloadcms/richtext-lexical": "4.0.0-beta.
|
|
161
|
-
"@payloadcms/ui": "4.0.0-beta.
|
|
158
|
+
"@payloadcms/db-mongodb": "4.0.0-beta.10",
|
|
159
|
+
"@payloadcms/db-postgres": "4.0.0-beta.10",
|
|
160
|
+
"@payloadcms/richtext-lexical": "4.0.0-beta.10",
|
|
161
|
+
"@payloadcms/ui": "4.0.0-beta.10",
|
|
162
162
|
"@playwright/test": "1.60.0",
|
|
163
163
|
"@radix-ui/react-icons": "1.3.2",
|
|
164
164
|
"@tabler/icons": "3.31.0",
|
|
@@ -167,24 +167,24 @@
|
|
|
167
167
|
"@types/jsdom": "^21.1.7",
|
|
168
168
|
"@types/json-schema": "^7.0.15",
|
|
169
169
|
"@types/node": "24.19.2",
|
|
170
|
-
"@types/react": "19.
|
|
171
|
-
"@types/react-dom": "19.
|
|
170
|
+
"@types/react": "19.3.0",
|
|
171
|
+
"@types/react-dom": "19.3.0",
|
|
172
172
|
"axe-core": "^4.12.1",
|
|
173
173
|
"jsdom": "^25.0.1",
|
|
174
174
|
"lucide-react": "0.561.0",
|
|
175
175
|
"lucide-static": "0.561.0",
|
|
176
|
-
"payload": "4.0.0-beta.
|
|
176
|
+
"payload": "4.0.0-beta.10",
|
|
177
177
|
"playwright": "1.60.0",
|
|
178
|
-
"react": "19.
|
|
179
|
-
"react-dom": "19.
|
|
178
|
+
"react": "19.3.1",
|
|
179
|
+
"react-dom": "19.3.1",
|
|
180
180
|
"tsdown": "0.22.1",
|
|
181
181
|
"tsx": "^4.19.2",
|
|
182
182
|
"typescript": "5.9.3",
|
|
183
183
|
"vitest": "4.1.7",
|
|
184
184
|
"@10x-media/payload-test-harness": "0.0.0",
|
|
185
|
+
"@10x-media/tsconfig": "0.0.0",
|
|
185
186
|
"@10x-media/tsdown-config": "0.0.0",
|
|
186
|
-
"@10x-media/vitest-config": "0.0.0"
|
|
187
|
-
"@10x-media/tsconfig": "0.0.0"
|
|
187
|
+
"@10x-media/vitest-config": "0.0.0"
|
|
188
188
|
},
|
|
189
189
|
"publishConfig": {
|
|
190
190
|
"access": "public"
|