@10x-media/fields 0.1.0-beta.1 → 0.1.0-beta.10
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 +120 -0
- package/README.md +7 -3
- package/dist/exports/client.d.ts +10 -1
- package/dist/exports/client.js +9 -1
- package/dist/exports/color-utils.d.ts +2 -1
- package/dist/exports/color-utils.js +2 -1
- package/dist/exports/color.d.ts +2 -1
- package/dist/exports/color.js +2 -1
- package/dist/exports/encrypted.d.ts +7 -4
- package/dist/exports/encrypted.js +6 -3
- 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/phone-utils.d.ts +4 -0
- package/dist/exports/phone-utils.js +4 -0
- package/dist/exports/phone.d.ts +6 -0
- package/dist/exports/phone.js +3 -0
- package/dist/exports/rsc.d.ts +5 -1
- package/dist/exports/rsc.js +5 -1
- package/dist/exports/types.d.ts +3 -2
- package/dist/fields/color/client/ColorField.d.ts +2 -0
- package/dist/fields/color/client/ColorField.js +35 -293
- package/dist/fields/color/client/ColorField.js.map +1 -1
- package/dist/fields/color/client/ColorInput.d.ts +44 -0
- package/dist/fields/color/client/ColorInput.js +374 -0
- package/dist/fields/color/client/ColorInput.js.map +1 -0
- package/dist/fields/color/client/ColorPickerPanel.d.ts +3 -1
- package/dist/fields/color/client/ColorPickerPanel.js +29 -4
- package/dist/fields/color/client/ColorPickerPanel.js.map +1 -1
- package/dist/fields/color/client/colorField.css +30 -0
- package/dist/fields/color/colorField.js +36 -8
- package/dist/fields/color/colorField.js.map +1 -1
- package/dist/fields/color/presetChip.js +10 -9
- package/dist/fields/color/presetChip.js.map +1 -1
- package/dist/fields/color/presetReference.d.ts +13 -0
- package/dist/fields/color/presetReference.js +94 -0
- package/dist/fields/color/presetReference.js.map +1 -0
- package/dist/fields/color/server/ColorCell.js +7 -1
- package/dist/fields/color/server/ColorCell.js.map +1 -1
- package/dist/fields/color/server/colorCell.css +5 -0
- package/dist/fields/color/valueIssue.js +23 -0
- package/dist/fields/color/valueIssue.js.map +1 -0
- package/dist/fields/encrypted/boot.js +2 -1
- package/dist/fields/encrypted/boot.js.map +1 -1
- package/dist/fields/encrypted/components/EncryptedInput.js +4 -1
- package/dist/fields/encrypted/components/EncryptedInput.js.map +1 -1
- package/dist/fields/encrypted/components/EncryptedTextarea.js +6 -2
- package/dist/fields/encrypted/components/EncryptedTextarea.js.map +1 -1
- package/dist/fields/encrypted/components/ProtectedCell.d.ts +15 -6
- package/dist/fields/encrypted/components/ProtectedCell.js +37 -8
- package/dist/fields/encrypted/components/ProtectedCell.js.map +1 -1
- package/dist/fields/encrypted/components/ProtectedField.css +134 -39
- package/dist/fields/encrypted/components/ProtectedField.d.ts +3 -0
- package/dist/fields/encrypted/components/ProtectedField.js +14 -0
- package/dist/fields/encrypted/components/ProtectedField.js.map +1 -1
- package/dist/fields/encrypted/components/WriteOnlyActions.js +65 -0
- package/dist/fields/encrypted/components/WriteOnlyActions.js.map +1 -0
- package/dist/fields/encrypted/components/WriteOnlyField.js +286 -0
- package/dist/fields/encrypted/components/WriteOnlyField.js.map +1 -0
- package/dist/fields/encrypted/components/writeOnlyIntent.js +69 -0
- package/dist/fields/encrypted/components/writeOnlyIntent.js.map +1 -0
- package/dist/fields/encrypted/crypto/wire.d.ts +10 -1
- package/dist/fields/encrypted/crypto/wire.js +1 -1
- package/dist/fields/encrypted/encryptedField.js +63 -6
- package/dist/fields/encrypted/encryptedField.js.map +1 -1
- package/dist/fields/encrypted/generateSecret.d.ts +10 -0
- package/dist/fields/encrypted/generateSecret.js +41 -0
- package/dist/fields/encrypted/generateSecret.js.map +1 -0
- package/dist/fields/encrypted/hint.js +67 -0
- package/dist/fields/encrypted/hint.js.map +1 -0
- package/dist/fields/encrypted/hooks.js +59 -31
- package/dist/fields/encrypted/hooks.js.map +1 -1
- package/dist/fields/encrypted/queryRewrite.d.ts +10 -2
- package/dist/fields/encrypted/queryRewrite.js +34 -8
- package/dist/fields/encrypted/queryRewrite.js.map +1 -1
- package/dist/fields/encrypted/rawRead.d.ts +24 -0
- package/dist/fields/encrypted/rawRead.js +40 -0
- package/dist/fields/encrypted/rawRead.js.map +1 -0
- package/dist/fields/encrypted/scan.js +21 -4
- package/dist/fields/encrypted/scan.js.map +1 -1
- package/dist/fields/encrypted/types.d.ts +67 -2
- package/dist/fields/encrypted/types.js +8 -1
- package/dist/fields/encrypted/types.js.map +1 -1
- package/dist/fields/encrypted/utils/decryptAllData.js +2 -2
- package/dist/fields/encrypted/utils/decryptAllData.js.map +1 -1
- package/dist/fields/encrypted/utils/decryptFieldValue.d.ts +30 -0
- package/dist/fields/encrypted/utils/decryptFieldValue.js +56 -0
- package/dist/fields/encrypted/utils/decryptFieldValue.js.map +1 -0
- package/dist/fields/encrypted/utils/readEncryptedField.d.ts +51 -0
- package/dist/fields/encrypted/utils/readEncryptedField.js +96 -0
- package/dist/fields/encrypted/utils/readEncryptedField.js.map +1 -0
- package/dist/fields/icon/adapters/lucide/generated/manifest.js.map +1 -1
- package/dist/fields/icon/adapters/lucide/generated/nodes.js.map +1 -1
- package/dist/fields/icon/adapters/radix/generated/manifest.js.map +1 -1
- package/dist/fields/icon/adapters/radix/generated/nodes.js.map +1 -1
- package/dist/fields/icon/adapters/tabler/generated/manifest.js.map +1 -1
- package/dist/fields/icon/adapters/tabler/generated/nodes.js.map +1 -1
- package/dist/fields/icon/client/icon-field.css +4 -2
- package/dist/fields/icon/codegen/emit.js +2 -2
- package/dist/fields/icon/codegen/emit.js.map +1 -1
- package/dist/fields/icon/rsc/IconFieldServer.js +1 -1
- package/dist/fields/icon/rsc/IconFieldServer.js.map +1 -1
- package/dist/fields/icon/rsc/IconLibrarySelectServer.js +1 -1
- package/dist/fields/icon/rsc/IconLibrarySelectServer.js.map +1 -1
- package/dist/fields/icon/shared/iconLabel.js +1 -1
- package/dist/fields/icon/shared/iconLabel.js.map +1 -1
- 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 +13 -0
- package/dist/fields/measurement/client/MeasurementField.js +70 -0
- package/dist/fields/measurement/client/MeasurementField.js.map +1 -0
- package/dist/fields/measurement/client/MeasurementInput.d.ts +42 -0
- package/dist/fields/measurement/client/MeasurementInput.js +327 -0
- package/dist/fields/measurement/client/MeasurementInput.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 +124 -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/client/useMeasurementModel.d.ts +19 -0
- package/dist/fields/measurement/client/useMeasurementModel.js +85 -0
- package/dist/fields/measurement/client/useMeasurementModel.js.map +1 -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/fields/phoneNumber/client/CountryFlag.d.ts +16 -0
- package/dist/fields/phoneNumber/client/CountryFlag.js +40 -0
- package/dist/fields/phoneNumber/client/CountryFlag.js.map +1 -0
- package/dist/fields/phoneNumber/client/CountryPicker.d.ts +21 -0
- package/dist/fields/phoneNumber/client/CountryPicker.js +255 -0
- package/dist/fields/phoneNumber/client/CountryPicker.js.map +1 -0
- package/dist/fields/phoneNumber/client/PhoneNumberField.d.ts +26 -0
- package/dist/fields/phoneNumber/client/PhoneNumberField.js +318 -0
- package/dist/fields/phoneNumber/client/PhoneNumberField.js.map +1 -0
- package/dist/fields/phoneNumber/client/editModel.js +86 -0
- package/dist/fields/phoneNumber/client/editModel.js.map +1 -0
- package/dist/fields/phoneNumber/client/phoneNumberField.css +305 -0
- package/dist/fields/phoneNumber/engine/countries.d.ts +36 -0
- package/dist/fields/phoneNumber/engine/countries.js +68 -0
- package/dist/fields/phoneNumber/engine/countries.js.map +1 -0
- package/dist/fields/phoneNumber/engine/draft.d.ts +13 -0
- package/dist/fields/phoneNumber/engine/draft.js +72 -0
- package/dist/fields/phoneNumber/engine/draft.js.map +1 -0
- package/dist/fields/phoneNumber/engine/metadata.d.ts +11 -0
- package/dist/fields/phoneNumber/engine/metadata.js +32 -0
- package/dist/fields/phoneNumber/engine/metadata.js.map +1 -0
- package/dist/fields/phoneNumber/engine/phone.d.ts +37 -0
- package/dist/fields/phoneNumber/engine/phone.js +59 -0
- package/dist/fields/phoneNumber/engine/phone.js.map +1 -0
- package/dist/fields/phoneNumber/options.d.ts +72 -0
- package/dist/fields/phoneNumber/options.js +37 -0
- package/dist/fields/phoneNumber/options.js.map +1 -0
- package/dist/fields/phoneNumber/phoneNumberField.d.ts +14 -0
- package/dist/fields/phoneNumber/phoneNumberField.js +167 -0
- package/dist/fields/phoneNumber/phoneNumberField.js.map +1 -0
- package/dist/fields/phoneNumber/server/PhoneNumberCellServer.d.ts +19 -0
- package/dist/fields/phoneNumber/server/PhoneNumberCellServer.js +73 -0
- package/dist/fields/phoneNumber/server/PhoneNumberCellServer.js.map +1 -0
- package/dist/fields/phoneNumber/server/PhoneNumberFieldServer.d.ts +16 -0
- package/dist/fields/phoneNumber/server/PhoneNumberFieldServer.js +57 -0
- package/dist/fields/phoneNumber/server/PhoneNumberFieldServer.js.map +1 -0
- package/dist/fields/phoneNumber/server/flagsEndpoint.js +51 -0
- package/dist/fields/phoneNumber/server/flagsEndpoint.js.map +1 -0
- package/dist/fields/phoneNumber/server/readPhoneOptions.js +18 -0
- package/dist/fields/phoneNumber/server/readPhoneOptions.js.map +1 -0
- package/dist/fields/phoneNumber/server/resolvePhoneOptionsSafe.js +33 -0
- package/dist/fields/phoneNumber/server/resolvePhoneOptionsSafe.js.map +1 -0
- package/dist/index.d.ts +5 -3
- package/dist/index.js +35 -1
- package/dist/index.js.map +1 -1
- package/dist/translations/ar.js +62 -0
- package/dist/translations/ar.js.map +1 -0
- package/dist/translations/de.js +19 -1
- package/dist/translations/de.js.map +1 -1
- package/dist/translations/en.js +19 -1
- package/dist/translations/en.js.map +1 -1
- package/dist/translations/es.js +62 -0
- package/dist/translations/es.js.map +1 -0
- package/dist/translations/fr.js +62 -0
- package/dist/translations/fr.js.map +1 -0
- package/dist/translations/id.js +62 -0
- package/dist/translations/id.js.map +1 -0
- package/dist/translations/index.d.ts +10 -1
- package/dist/translations/index.js +19 -1
- package/dist/translations/index.js.map +1 -1
- package/dist/translations/keys.d.ts +19 -1
- package/dist/translations/keys.js +20 -2
- package/dist/translations/keys.js.map +1 -1
- package/dist/translations/ko.js +62 -0
- package/dist/translations/ko.js.map +1 -0
- package/dist/translations/pt.js +62 -0
- package/dist/translations/pt.js.map +1 -0
- package/dist/translations/ru.js +62 -0
- package/dist/translations/ru.js.map +1 -0
- package/dist/translations/uk.js +62 -0
- package/dist/translations/uk.js.map +1 -0
- package/dist/translations/zh.js +62 -0
- package/dist/translations/zh.js.map +1 -0
- package/dist/types.d.ts +41 -1
- package/dist/utils/resolveStaticLabel.js +13 -0
- package/dist/utils/resolveStaticLabel.js.map +1 -0
- package/package.json +28 -6
- package/dist/fields/icon/shared/resolveStaticLabel.js +0 -16
- package/dist/fields/icon/shared/resolveStaticLabel.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,125 @@
|
|
|
1
1
|
# @10x-media/fields
|
|
2
2
|
|
|
3
|
+
## 0.1.0-beta.10
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 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.
|
|
8
|
+
|
|
9
|
+
## 0.1.0-beta.9
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- `ColorInput` and `MeasurementInput` (`/client`) render the color and measurement rows without a form: controlled `value`/`onChange`, options and presets passed as props, and the same commit, salvage, preset-chip and unit-conversion behavior as the fields, which now wrap them with `useField`. Each reports its own format or bound errors unless the caller passes `error` or `showError`, and `MeasurementInput` defaults `units` and `preferenceKey` from `storageUnit` alone.
|
|
14
|
+
|
|
15
|
+
## 0.1.0-beta.8
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- Add `phoneNumberField()`: an international phone number field with a searchable country picker, live as-you-type formatting, and validation and metadata sized to the install via `libphonenumber-js`.
|
|
20
|
+
|
|
21
|
+
- Two storage shapes: `storage: 'object'` (default) is a `group` of `number` + `country`, plus five `virtual: true` subfields (`national`, `international`, `callingCode`, `uri`, `type`) recomputed on every read by a single `afterRead` hook; `storage: 'e164'` is a plain `text` field holding the E.164 string alone. Virtual subfields can't be queried or sorted; filter and sort on `number` or `country` instead.
|
|
22
|
+
- Three validation modes (`'possible'`, `'valid'`, `'mobile'`) and three metadata sets (`'max'`, `'min'`, `'mobile'`) trading bundle size for classification detail. `validation: 'mobile'` needs metadata `'max'` or `'mobile'`; pairing it with `'min'` is rejected as a configuration error rather than silently failing every number, at plugin build time when set on the plugin and at validation time when set on a field.
|
|
23
|
+
- Country handling: `countries` scopes the picker without restricting what parses, validates, and saves; `priorityCountries` pins a subset above the alphabetized rest, optionally headed by `priorityCountriesLabel` (a string or per-locale map; no label means no heading, only the picker's own group divider); `defaultCountry` seeds the picker and calling-code prefix.
|
|
24
|
+
- Flag artwork: `flags: 'svg'` (default) serves real country flags from a new, unauthenticated `/10x-fields/flags/:code` endpoint; `'emoji'` draws a Unicode regional-indicator pair instead (renders as two separate letters on Windows, which ships no flag emoji font); `'none'` shows the ISO code. `fields({ phoneNumber: { serveFlags: false } })` skips mounting the endpoint. `@10x-media/fields/phone` exports `countryFlagSrc(serverURL, apiRoute, code)` so a frontend can build the same URL without hand-rolling its lowercasing and `.svg` suffix.
|
|
25
|
+
- `fields({ phoneNumber: {...} })` sets install-wide defaults (`defaultCountry`, `countries`, `priorityCountries`, `priorityCountriesLabel`, `validation`, `flags`, `cellFormat`, `metadata`, `serveFlags`); a field's own option always wins.
|
|
26
|
+
- `@10x-media/fields/phone/utils` exports the parsing, formatting, and validation engine standalone for frontend use (`parsePhone`, `formatPhone`, `phoneUri`, `detectCountry`, `salvagePhone`, `checkPhone`, `formatAsYouType`, `countryOptions`, `callingCodeFor`, `emojiFlag`, `isKnownCountry`, `isSupported`, `loadMetadata`).
|
|
27
|
+
|
|
28
|
+
Additive: new phone number field family; no changes to any existing field, option, export, or storage shape.
|
|
29
|
+
|
|
30
|
+
## 0.1.0-beta.7
|
|
31
|
+
|
|
32
|
+
### Minor Changes
|
|
33
|
+
|
|
34
|
+
- Add `measurementField()`: a number field storing a canonical value in one storage unit while each admin edits and reads in their own preferred unit. Eight presets ship built in (body weight, person height, distance, mass, length, volume, temperature, speed) as spreadable option bundles, or declare `storageUnit`/`units`/`preferenceKey` directly for anything else; units are constrained only by dimension, and generics narrow those options to the storage unit's dimension when it's a literal. Compound entry (feet and inches, stone and pounds) stays display-only.
|
|
35
|
+
|
|
36
|
+
- Display unit resolves per viewer: a payload-preferences pick keyed by `preferenceKey` (shipped presets keep their own bucket, free-form fields default to the storage unit's dimension) that follows the viewer across devices and flips every field sharing that key at once, then the field's own `fallbackUnit`, then the plugin's `fields({ measurement: { defaultUnits } })`, then the field's `localeDefaults`, then a per-dimension locale-default table (vendored CLDR data for US/Liberia and UK/Myanmar imperial units, metric everywhere else), then the field's first unit.
|
|
37
|
+
- Custom units and dimensions: serializable linear or affine unit definitions (`custom: { units, dimensions }`) travel with the field's client props, so a frontend can rebuild the same engine with `createEngine(custom)`. A unit with no `Intl.NumberFormat` identifier (`intlUnit: null`) formats as a plain decimal plus its short label.
|
|
38
|
+
- The editable input's round-trip behavior is controlled by `precision` (see below); readable mode's default draft policy repaints at display digits, exact mode's faithful draft policy shows the shortest string that round-trips to the exact stored value.
|
|
39
|
+
- The unit affordance is now the value's adjacent chip, doubling as the popup trigger, rather than a separate far-right badge.
|
|
40
|
+
- The stored value is a plain number column: native sort, filter, and group-by, and zero-migration adoption on an existing numeric column by matching `storageUnit` to what's already there.
|
|
41
|
+
- `min`/`max` are expressed in the storage unit and enforced by Payload's native number validation; the edit view shows bounds converted to the display unit.
|
|
42
|
+
- `@10x-media/fields/measurement/utils` exports the conversion and formatting engine (`convert`, `formatMeasurement`, `decompose`/`compose`, `resolveDisplayUnit`, `systemForLocale`, `createEngine`, `unitLabel`, `unitsOfDimension`, `UNITS`) standalone for frontend use.
|
|
43
|
+
- The list view's cell is now a server component too, so `fields({ measurement: { defaultUnits } })` reaches list cells the same way it reaches the edit view; `defaultUnits` also accepts a per-request resolver function for tenant-aware policy, called with `req` undefined from cells since Payload's cell components carry no request.
|
|
44
|
+
- `fields({ measurement: { persistPreferences: false } })` makes the unit preference provider session-only, for kiosk or shared-account admins: it skips both the read on mount and every write.
|
|
45
|
+
|
|
46
|
+
`precision` controls how a value round-trips between storage and the edit view, via two modes and four knobs. Pass a bare `'readable' | 'exact'`, or a `{ mode?, storage?, entry?, draft?, display? }` object to override individual knobs on top of a mode's defaults. `storage` (integer 0-12, default 6) is the fraction digits kept in the storage unit, applied to every write path including the REST and Local API; it is the same universal granularity contract regardless of mode, and can deliberately break entered-unit round-tripping while healing import noise. `entry` (`'quantize'` default in readable mode, `'free'` in exact mode) rounds a typed value at its own display digits, in the unit it was typed in, before converting. `draft` (`'display'` in readable, `'faithful'` in exact) controls whether a saved value repaints straight at display digits or escalates digits until it round-trips exactly. `display` is the per-unit fraction-digit map the field's old top-level `precision` option used to be, now nested here. A field's own `precision` wins over `fields({ measurement: { precision } })`, which wins over the engine default (`readable`, `storage: 6`); merging is per knob, and `display` merges per unit key. A dirty guard backs readable mode's WYSIWYG contract: only an input the viewer actually typed into ever commits its displayed value, so an untouched compound part, or a field re-rendered after a display-unit switch, always commits the exact value already on disk.
|
|
47
|
+
|
|
48
|
+
Additive: new measurement field family; no changes to existing families or stored data. Precision defaults (`readable`, `storage: 6`) reproduce this changeset's originally shipped behavior for every knob except two: the draft-repaint default, which now truncates to display digits instead of always showing a faithful full-precision draft, and the entry default, which now quantizes a typed value at its own display digits instead of always keeping it free; both are new in this same unreleased change, so nothing published has to migrate.
|
|
49
|
+
|
|
50
|
+
### Patch Changes
|
|
51
|
+
|
|
52
|
+
- Fix icon drawer rail and footer text contrast to WCAG AA (elevation-600 to elevation-700). The drawer axe scan now waits for the grid to settle before analyzing, which is what surfaced the miss; the search test gains the same wait, removing a load-dependent flake.
|
|
53
|
+
|
|
54
|
+
Behavioral: the rail and footer text in the icon picker render one elevation step darker (lighter in dark mode). No API changes.
|
|
55
|
+
|
|
56
|
+
## 0.1.0-beta.6
|
|
57
|
+
|
|
58
|
+
### Minor Changes
|
|
59
|
+
|
|
60
|
+
- More built-in locales for the `fields:` strings.
|
|
61
|
+
|
|
62
|
+
- Added: `es`, `fr`, `id`, `pt`, `ru`, `zh`, `uk`, `ar`, `ko`. Every key is covered in each.
|
|
63
|
+
|
|
64
|
+
## 0.1.0-beta.5
|
|
65
|
+
|
|
66
|
+
### Minor Changes
|
|
67
|
+
|
|
68
|
+
- New `aadScope` option on `encryptedField` pins the first component of the ciphertext's AAD binding, which otherwise is the collection or global slug. The slug is the right binding until it can change: a plugin-owned collection whose slug the consumer configures, or a collection renamed with its data kept in place, turns every stored value into an authentication failure that no utility can recover, because reads resolve the binding from the current slug too. A pinned scope survives the rename.
|
|
69
|
+
|
|
70
|
+
The scope flows through every construction site (sealing, document reads, `decryptFieldValue`, `readEncryptedField`, key rotation, the removal utility), must not contain `.` (the AAD component separator; rejected at the factory), and should be unique per logical schema. Decide it before data exists: changing it later is the re-keying event it exists to prevent.
|
|
71
|
+
|
|
72
|
+
- `readEncryptedField` now takes a `req`. Given one, the read joins that request's transaction and locale, so a secret written earlier in the same operation is visible to the code that needs it; without one the read still runs on its own request, outside any transaction in progress. The request is restored exactly as it was handed over.
|
|
73
|
+
|
|
74
|
+
New `withRawEncrypted(req, read)` for recovering an encrypted field across many rows. `readEncryptedField` issues one query per document, which is the wrong shape for a hook or a job that needs the same secret on every row a query returns, and the rest of each row with it. Inside the window the write-only response strip and the decrypt-on-read step both stand down, so the caller's own `find` returns each encrypted field as its stored wire string for `decryptFieldValue`. The previous mode is restored on the way out, so windows nest, and the request's dataloader is isolated for the duration: its cache key does not include the context, so a related document pulled in at `depth > 0` would otherwise be cached as ciphertext and served that way to an ordinary read later in the same request.
|
|
75
|
+
|
|
76
|
+
`CorruptPlaintextError` is now exported alongside the other decrypt failures, so a caller can tell authenticated-but-corrupt data (non-retryable) from a wrong key or a malformed wire string.
|
|
77
|
+
|
|
78
|
+
Encrypted field scans are cached per schema. `decryptFieldValue` walks the field tree to find its marker, so decrypting a page of rows used to repeat that walk once per row.
|
|
79
|
+
|
|
80
|
+
- An encrypted field's identification `hint` may now expose up to 32 characters, up from 8. Every credential format in use carries a constant prefix (`sk_live_`, `whsec_`, `ghp_`, `xoxb-`), and a budget of 8 was spent on that prefix before reaching anything that identifies a particular key.
|
|
81
|
+
|
|
82
|
+
The cap was doing a job it cannot do, so the real guard is now the value being sliced rather than the config asking for the slice: a hint is stored only when the plaintext keeps at least as many characters hidden as the hint exposes, and at least 8 hidden characters regardless. One field can therefore serve a collection holding both long tokens and short ones, hinting the first and declining the second instead of exposing half of it. No configuration valid before this release changes behaviour, since 8 exposed already required 8 hidden.
|
|
83
|
+
|
|
84
|
+
The bullet run stays exactly `maskDots` wide, with the hint's ends added around it, so a hinted value shows the same run as every other concealed span and the count remains a pure presentation choice. A hint too wide for a narrow field clamps with an ellipsis, in the input and in the list cell, with the lock badge held at its size.
|
|
85
|
+
|
|
86
|
+
`admin.width` and `admin.style` now reach encrypted fields. A custom Field component short-circuits the path where Payload applies them, so an encrypted field in a row ignored its width while a native sibling honoured it, and the two rendered at different widths.
|
|
87
|
+
|
|
88
|
+
- Add `protection: 'writeOnly'` to `encryptedField`: a mode for credentials that are written and used server-side but never returned to any API caller. Read results (REST, GraphQL, Local API) omit the field entirely; a virtual `<name>_set` sibling exposes set-ness only. The admin renders one always-editable input at native height: a stored value is only a placeholder, typing stages a replacement, an isClearable-style `×` clears (with undo), and `clearable`/`required` govern the `×`. `queryable` and `richText` are rejected on write-only fields.
|
|
89
|
+
|
|
90
|
+
Two write-only companions: `hint` stores an identification slice (`sk_l····9d3f`) beside the ciphertext at seal time, shown in the admin, list cells, and API responses as `<name>_hint`, capped and length-guarded so it can identify a key but never reconstruct a short secret. `generate` adds a crypto-random generate/rotate action (default 32-char base62, configurable length/prefix/charset) whose value is visible and copyable exactly until the save succeeds, the GitHub-token reveal-once model.
|
|
91
|
+
|
|
92
|
+
New server-side helpers `readEncryptedField` and `decryptFieldValue` make reading a stored secret a deliberate act: fetch a handle with cacheable ciphertext and on-demand `decrypt()`, or decrypt a cached wire string given only the field path. Both work on every encrypted field, collections and globals, with locale support.
|
|
93
|
+
|
|
94
|
+
The response strip now also covers globals, closing a gap where a global's encrypted richText ciphertext sibling (and blind-index hashes) surfaced in read results. Boot key validation now scans globals too.
|
|
95
|
+
|
|
96
|
+
## 0.1.0-beta.4
|
|
97
|
+
|
|
98
|
+
### Patch Changes
|
|
99
|
+
|
|
100
|
+
- `colorField` no longer overflows its input border when squeezed by `admin.width` in a row. The chip, text entry, and format badge now live in a clipping region that fades out at the right edge when (and only when) the run actually overflows, and the clear control keeps its place inside the border at every width. The fade is a CSS mask rather than a background-colored overlay, so it renders correctly over the error, read-only, and hover backgrounds in both themes.
|
|
101
|
+
|
|
102
|
+
## 0.1.0-beta.3
|
|
103
|
+
|
|
104
|
+
### Minor Changes
|
|
105
|
+
|
|
106
|
+
- Linked color references carry opacity: `preset:<key>/<alpha>` stores a preset reference at 0-100 percent, and the picker's alpha slider rewrites the suffix instead of flattening the reference to a concrete color. Resolution applies the alpha in the field's configured format on both scheme members, the chip and list cell surface the percentage, `alpha: false` strips suffixes on commit, and the new `parsePresetReference` export (`/color` and `/color/utils`) parses stored references for presentation code.
|
|
107
|
+
|
|
108
|
+
## 0.1.0-beta.2
|
|
109
|
+
|
|
110
|
+
### Patch Changes
|
|
111
|
+
|
|
112
|
+
- Fix generated icon manifests whose data disagreed with their own type annotation.
|
|
113
|
+
|
|
114
|
+
`generateIconManifest` emitted `label` in the manifest data but the emitted annotation
|
|
115
|
+
still described the pre-label shape, so a manifest that used the field produced one TS2353
|
|
116
|
+
per labelled icon in a strict consumer. The nodes module had the same latent mismatch one
|
|
117
|
+
field over: its annotation only allowed flat tuples while glyph nodes may nest children.
|
|
118
|
+
|
|
119
|
+
Both annotations now mirror the full contract, and the emitters are covered by tests that
|
|
120
|
+
typecheck their own output with the compiler rather than inspecting strings. Regenerate
|
|
121
|
+
your manifests to pick up the corrected annotations; the data is unchanged.
|
|
122
|
+
|
|
3
123
|
## 0.1.0-beta.1
|
|
4
124
|
|
|
5
125
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
|
+

|
|
2
|
+
|
|
1
3
|
# @10x-media/fields
|
|
2
4
|
|
|
3
|
-
Reusable fields for Payload v3 that look and behave native: a full color picker in a constant-height row, a searchable icon picker over pluggable icon libraries,
|
|
5
|
+
Reusable fields for Payload v3 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.
|
|
4
6
|
|
|
5
7
|
[](https://www.npmjs.com/package/@10x-media/fields)
|
|
6
8
|
|
|
7
|
-
Part of the [@10x-media Payload plugins](https://github.com/10x-media/payload-plugins) collection. In beta:
|
|
9
|
+
Part of the [@10x-media Payload plugins](https://github.com/10x-media/payload-plugins) collection. In beta until a stable 1.0: `-beta.N` releases on the `latest` dist-tag.
|
|
8
10
|
|
|
9
11
|
## Features
|
|
10
12
|
|
|
11
13
|
- **Color field**: saturation/hue/alpha picker, eyedropper, preset palettes (static or resolved from your data), any CSS color as input, one configured stored format (`hex`/`rgb`/`hsl`/`oklch`), and an opt-in linked mode that stores preset references so palette changes propagate everywhere.
|
|
12
14
|
- **Icon field**: drawer browser with search, category rail, and keyboard navigation; Lucide, Radix, and Tabler adapters first-party; `defineIconAdapter()` plus codegen for any other library; per-icon lazy loading so no icon dataset ever enters an eager bundle; client and RSC frontend renderers; library-supplied labels for sets keyed by code; and layered libraries composing a package with a Payload upload collection editors can add to, each layer declaring its own render strategy and caching.
|
|
13
15
|
- **Encrypted fields**: AES-256-GCM with authenticated field binding, for twelve field types including `richText` and `point`; zero-config keys derived from `PAYLOAD_SECRET` or explicit multi-key config with async providers and online rotation; opt-in blind-index querying (`equals`/`in`/`unique`); masked admin UX with reveal toggle.
|
|
14
|
-
- **
|
|
16
|
+
- **Measurement field**: a plain `number` column storing one canonical unit while each viewer edits and reads in their own preferred unit; eight ready-made presets (body weight, height, distance, mass, length, volume, temperature, speed) or free-form `storageUnit`/`units`/`preferenceKey` for anything else, plus serializable custom units and dimensions; per-bucket preference follows the viewer across devices, falls back through field and plugin defaults to browser-locale detection, then metric; compound entry for feet-and-inches and stone-and-pounds; zero-migration adoption on existing numeric columns.
|
|
17
|
+
- **Native by construction**: 40px rows, Payload tokens, full `admin` prop contract, typed translations, function-form `overrides` on every factory.
|
|
15
18
|
- **Isolated bundles**: each family behind its own subpath export, isolation asserted on the built output in CI.
|
|
16
19
|
- **Plugin optional**: every factory works standalone; the `fields()` plugin adds app-wide defaults that per-field options override.
|
|
17
20
|
|
|
@@ -55,6 +58,7 @@ Full documentation at [docs.10xmedia.de](https://docs.10xmedia.de/fields):
|
|
|
55
58
|
- [Icon field](https://docs.10xmedia.de/fields/icon)
|
|
56
59
|
- [Encrypted fields](https://docs.10xmedia.de/fields/encrypted)
|
|
57
60
|
- [Key management](https://docs.10xmedia.de/fields/encrypted/key-management)
|
|
61
|
+
- [Measurement field](https://docs.10xmedia.de/fields/measurement)
|
|
58
62
|
- [Building your own](https://docs.10xmedia.de/fields/building-your-own)
|
|
59
63
|
|
|
60
64
|
## License
|
package/dist/exports/client.d.ts
CHANGED
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
import { ColorField, ColorFieldProps } from "../fields/color/client/ColorField.js";
|
|
2
|
+
import { ColorInput, ColorInputProps } from "../fields/color/client/ColorInput.js";
|
|
2
3
|
import { ColorPickerPanel } from "../fields/color/client/ColorPickerPanel.js";
|
|
3
4
|
import { ProtectedField } from "../fields/encrypted/components/ProtectedField.js";
|
|
4
5
|
import { RichTextRevealGate } from "../fields/encrypted/components/RichTextRevealGate.js";
|
|
5
6
|
import { IconField } from "../fields/icon/client/IconFieldClient.js";
|
|
6
7
|
import { IconLibrarySelect } from "../fields/icon/client/IconLibrarySelect.js";
|
|
7
|
-
|
|
8
|
+
import { MeasurementCell, MeasurementCellProps } from "../fields/measurement/client/MeasurementCell.js";
|
|
9
|
+
import { MeasurementField, MeasurementFieldProps } from "../fields/measurement/client/MeasurementField.js";
|
|
10
|
+
import { MeasurementInputOptions } from "../fields/measurement/client/useMeasurementModel.js";
|
|
11
|
+
import { MeasurementInput, MeasurementInputProps } from "../fields/measurement/client/MeasurementInput.js";
|
|
12
|
+
import { MeasurementUnitsProvider, useMeasurementUnits } from "../fields/measurement/client/MeasurementUnitsProvider.js";
|
|
13
|
+
import { CountryFlag, CountryFlagProps } from "../fields/phoneNumber/client/CountryFlag.js";
|
|
14
|
+
import { CountryOptionGroups, CountryPicker, CountryPickerProps } from "../fields/phoneNumber/client/CountryPicker.js";
|
|
15
|
+
import { PhoneNumberField, PhoneNumberFieldProps } from "../fields/phoneNumber/client/PhoneNumberField.js";
|
|
16
|
+
export { ColorField, type ColorFieldProps, ColorInput, type ColorInputProps, ColorPickerPanel, CountryFlag, type CountryFlagProps, type CountryOptionGroups, CountryPicker, type CountryPickerProps, IconField, IconLibrarySelect, MeasurementCell, type MeasurementCellProps, MeasurementField, type MeasurementFieldProps, MeasurementInput, type MeasurementInputOptions, type MeasurementInputProps, MeasurementUnitsProvider, PhoneNumberField, type PhoneNumberFieldProps, ProtectedField, RichTextRevealGate, useMeasurementUnits };
|
package/dist/exports/client.js
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { ColorPickerPanel } from "../fields/color/client/ColorPickerPanel.js";
|
|
3
|
+
import { ColorInput } from "../fields/color/client/ColorInput.js";
|
|
3
4
|
import { ColorField } from "../fields/color/client/ColorField.js";
|
|
4
5
|
import { ProtectedField } from "../fields/encrypted/components/ProtectedField.js";
|
|
5
6
|
import { RichTextRevealGate } from "../fields/encrypted/components/RichTextRevealGate.js";
|
|
6
7
|
import { IconField } from "../fields/icon/client/IconFieldClient.js";
|
|
7
8
|
import { IconLibrarySelect } from "../fields/icon/client/IconLibrarySelect.js";
|
|
8
|
-
|
|
9
|
+
import { MeasurementUnitsProvider, useMeasurementUnits } from "../fields/measurement/client/MeasurementUnitsProvider.js";
|
|
10
|
+
import { MeasurementCell } from "../fields/measurement/client/MeasurementCell.js";
|
|
11
|
+
import { MeasurementInput } from "../fields/measurement/client/MeasurementInput.js";
|
|
12
|
+
import { MeasurementField } from "../fields/measurement/client/MeasurementField.js";
|
|
13
|
+
import { CountryFlag } from "../fields/phoneNumber/client/CountryFlag.js";
|
|
14
|
+
import { CountryPicker } from "../fields/phoneNumber/client/CountryPicker.js";
|
|
15
|
+
import { PhoneNumberField } from "../fields/phoneNumber/client/PhoneNumberField.js";
|
|
16
|
+
export { ColorField, ColorInput, ColorPickerPanel, CountryFlag, CountryPicker, IconField, IconLibrarySelect, MeasurementCell, MeasurementField, MeasurementInput, MeasurementUnitsProvider, PhoneNumberField, ProtectedField, RichTextRevealGate, useMeasurementUnits };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ColorFormat, ColorSchemeValue } from "../types.js";
|
|
2
|
+
import { PresetReference, parsePresetReference } from "../fields/color/presetReference.js";
|
|
2
3
|
import { FormatColorOptions, Hsl, Hsv, OklchColor, ParsedColor, RgbColor } from "../fields/color/engine/types.js";
|
|
3
4
|
import { contrastRatio, relativeLuminance } from "../fields/color/engine/contrast.js";
|
|
4
5
|
import { hslToRgb, hsvToRgb, isInSrgbGamut, oklchToRgb, rgbToHsl, rgbToHsv, rgbToOklch, toOklch, toRgb } from "../fields/color/engine/convert.js";
|
|
@@ -7,4 +8,4 @@ import { namedColors } from "../fields/color/engine/namedColors.js";
|
|
|
7
8
|
import { parseColor } from "../fields/color/engine/parse.js";
|
|
8
9
|
import { salvageColor } from "../fields/color/engine/salvage.js";
|
|
9
10
|
import { isColorSchemeValue, lightDark } from "../fields/color/engine/scheme.js";
|
|
10
|
-
export { type ColorFormat, type ColorSchemeValue, type FormatColorOptions, type Hsl, type Hsv, type OklchColor, type ParsedColor, type RgbColor, contrastRatio, convertColor, formatColor, hslToRgb, hsvToRgb, isColorSchemeValue, isInSrgbGamut, lightDark, namedColors, oklchToRgb, parseColor, relativeLuminance, rgbToHsl, rgbToHsv, rgbToOklch, salvageColor, toOklch, toRgb };
|
|
11
|
+
export { type ColorFormat, type ColorSchemeValue, type FormatColorOptions, type Hsl, type Hsv, type OklchColor, type ParsedColor, type PresetReference, type RgbColor, contrastRatio, convertColor, formatColor, hslToRgb, hsvToRgb, isColorSchemeValue, isInSrgbGamut, lightDark, namedColors, oklchToRgb, parseColor, parsePresetReference, relativeLuminance, rgbToHsl, rgbToHsv, rgbToOklch, salvageColor, toOklch, toRgb };
|
|
@@ -5,4 +5,5 @@ import { contrastRatio, relativeLuminance } from "../fields/color/engine/contras
|
|
|
5
5
|
import { convertColor, formatColor } from "../fields/color/engine/format.js";
|
|
6
6
|
import { salvageColor } from "../fields/color/engine/salvage.js";
|
|
7
7
|
import { isColorSchemeValue, lightDark } from "../fields/color/engine/scheme.js";
|
|
8
|
-
|
|
8
|
+
import { parsePresetReference } from "../fields/color/presetReference.js";
|
|
9
|
+
export { contrastRatio, convertColor, formatColor, hslToRgb, hsvToRgb, isColorSchemeValue, isInSrgbGamut, lightDark, namedColors, oklchToRgb, parseColor, parsePresetReference, relativeLuminance, rgbToHsl, rgbToHsv, rgbToOklch, salvageColor, toOklch, toRgb };
|
package/dist/exports/color.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ColorFormat, ColorGlobalConfig, ColorPreset, ColorSchemeValue } from "../types.js";
|
|
2
2
|
import { COLOR_CUSTOM_KEY, ColorFieldClientOptions, ColorFieldOptions, ColorLinkedOptions, ColorPresetsResolver, ColorPresetsSource, PRESET_PREFIX, ResolvedColorPreset } from "../fields/color/options.js";
|
|
3
|
+
import { PresetReference, parsePresetReference } from "../fields/color/presetReference.js";
|
|
3
4
|
import { isColorSchemeValue, lightDark } from "../fields/color/engine/scheme.js";
|
|
4
5
|
import { colorField } from "../fields/color/colorField.js";
|
|
5
6
|
import { PresetsFromArrayArgs, presetsFromArray } from "../fields/color/presetsFromArray.js";
|
|
6
7
|
import { PresetsFromDocArgs, presetsFromDoc } from "../fields/color/presetsFromDoc.js";
|
|
7
8
|
import { normalizePresets, resolvePresets } from "../fields/color/resolvePresets.js";
|
|
8
|
-
export { COLOR_CUSTOM_KEY, type ColorFieldClientOptions, type ColorFieldOptions, type ColorFormat, type ColorGlobalConfig, type ColorLinkedOptions, type ColorPreset, type ColorPresetsResolver, type ColorPresetsSource, type ColorSchemeValue, PRESET_PREFIX, type PresetsFromArrayArgs, type PresetsFromDocArgs, type ResolvedColorPreset, colorField, isColorSchemeValue, lightDark, normalizePresets, presetsFromArray, presetsFromDoc, resolvePresets };
|
|
9
|
+
export { COLOR_CUSTOM_KEY, type ColorFieldClientOptions, type ColorFieldOptions, type ColorFormat, type ColorGlobalConfig, type ColorLinkedOptions, type ColorPreset, type ColorPresetsResolver, type ColorPresetsSource, type ColorSchemeValue, PRESET_PREFIX, type PresetReference, type PresetsFromArrayArgs, type PresetsFromDocArgs, type ResolvedColorPreset, colorField, isColorSchemeValue, lightDark, normalizePresets, parsePresetReference, presetsFromArray, presetsFromDoc, resolvePresets };
|
package/dist/exports/color.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { isColorSchemeValue, lightDark } from "../fields/color/engine/scheme.js";
|
|
2
2
|
import { COLOR_CUSTOM_KEY, PRESET_PREFIX } from "../fields/color/options.js";
|
|
3
|
+
import { parsePresetReference } from "../fields/color/presetReference.js";
|
|
3
4
|
import { normalizePresets, resolvePresets } from "../fields/color/resolvePresets.js";
|
|
4
5
|
import { colorField } from "../fields/color/colorField.js";
|
|
5
6
|
import { presetsFromArray } from "../fields/color/presetsFromArray.js";
|
|
6
7
|
import { presetsFromDoc } from "../fields/color/presetsFromDoc.js";
|
|
7
|
-
export { COLOR_CUSTOM_KEY, PRESET_PREFIX, colorField, isColorSchemeValue, lightDark, normalizePresets, presetsFromArray, presetsFromDoc, resolvePresets };
|
|
8
|
+
export { COLOR_CUSTOM_KEY, PRESET_PREFIX, colorField, isColorSchemeValue, lightDark, normalizePresets, parsePresetReference, presetsFromArray, presetsFromDoc, resolvePresets };
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { DecryptFailurePolicy, EncryptedGlobalConfig, KeysConfig } from "../types.js";
|
|
2
|
-
import { EncryptedFieldOptions, EncryptedProtection, EncryptedSourceField } from "../fields/encrypted/types.js";
|
|
2
|
+
import { EncryptedFieldOptions, EncryptedGenerateConfig, EncryptedHintConfig, EncryptedProtection, EncryptedSourceField } from "../fields/encrypted/types.js";
|
|
3
3
|
import { DEFAULT_KEY_ID, InvalidKeysConfigError } from "../fields/encrypted/crypto/keys.js";
|
|
4
4
|
import { validateEncryptedBoot } from "../fields/encrypted/boot.js";
|
|
5
|
-
import { AuthenticationFailedError, MalformedCiphertextError, UnknownKeyIdError, isSealed } from "../fields/encrypted/crypto/wire.js";
|
|
5
|
+
import { AuthenticationFailedError, CorruptPlaintextError, MalformedCiphertextError, UnknownKeyIdError, isSealed } from "../fields/encrypted/crypto/wire.js";
|
|
6
6
|
import { encryptedField } from "../fields/encrypted/encryptedField.js";
|
|
7
7
|
import { DecryptFailedError } from "../fields/encrypted/hooks.js";
|
|
8
|
-
import { withEncryptedQueryRewrite } from "../fields/encrypted/queryRewrite.js";
|
|
8
|
+
import { withEncryptedQueryRewrite, withEncryptedResponseStrip } from "../fields/encrypted/queryRewrite.js";
|
|
9
|
+
import { withRawEncrypted } from "../fields/encrypted/rawRead.js";
|
|
9
10
|
import { rotateEncryptedFields } from "../fields/encrypted/utils/rotateEncryptedFields.js";
|
|
10
11
|
import { decryptAllData } from "../fields/encrypted/utils/decryptAllData.js";
|
|
12
|
+
import { DecryptFieldValueArgs, EncryptedFieldTarget, decryptFieldValue } from "../fields/encrypted/utils/decryptFieldValue.js";
|
|
11
13
|
import { encryptExistingData } from "../fields/encrypted/utils/encryptExistingData.js";
|
|
12
|
-
|
|
14
|
+
import { EncryptedFieldHandle, ReadEncryptedFieldArgs, readEncryptedField } from "../fields/encrypted/utils/readEncryptedField.js";
|
|
15
|
+
export { AuthenticationFailedError, CorruptPlaintextError, DEFAULT_KEY_ID, DecryptFailedError, type DecryptFailurePolicy, type DecryptFieldValueArgs, type EncryptedFieldHandle, type EncryptedFieldOptions, type EncryptedFieldTarget, type EncryptedGenerateConfig, type EncryptedGlobalConfig, type EncryptedHintConfig, type EncryptedProtection, type EncryptedSourceField, InvalidKeysConfigError, type KeysConfig, MalformedCiphertextError, type ReadEncryptedFieldArgs, UnknownKeyIdError, decryptAllData, decryptFieldValue, encryptExistingData, encryptedField, isSealed, readEncryptedField, rotateEncryptedFields, validateEncryptedBoot, withEncryptedQueryRewrite, withEncryptedResponseStrip, withRawEncrypted };
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { DEFAULT_KEY_ID, InvalidKeysConfigError } from "../fields/encrypted/crypto/keys.js";
|
|
2
2
|
import { validateEncryptedBoot } from "../fields/encrypted/boot.js";
|
|
3
|
-
import { AuthenticationFailedError, MalformedCiphertextError, UnknownKeyIdError, isSealed } from "../fields/encrypted/crypto/wire.js";
|
|
3
|
+
import { AuthenticationFailedError, CorruptPlaintextError, MalformedCiphertextError, UnknownKeyIdError, isSealed } from "../fields/encrypted/crypto/wire.js";
|
|
4
4
|
import { DecryptFailedError } from "../fields/encrypted/hooks.js";
|
|
5
|
-
import { withEncryptedQueryRewrite } from "../fields/encrypted/queryRewrite.js";
|
|
5
|
+
import { withEncryptedQueryRewrite, withEncryptedResponseStrip } from "../fields/encrypted/queryRewrite.js";
|
|
6
6
|
import { encryptedField } from "../fields/encrypted/encryptedField.js";
|
|
7
|
+
import { withRawEncrypted } from "../fields/encrypted/rawRead.js";
|
|
7
8
|
import { decryptAllData } from "../fields/encrypted/utils/decryptAllData.js";
|
|
9
|
+
import { decryptFieldValue } from "../fields/encrypted/utils/decryptFieldValue.js";
|
|
8
10
|
import { encryptExistingData } from "../fields/encrypted/utils/encryptExistingData.js";
|
|
11
|
+
import { readEncryptedField } from "../fields/encrypted/utils/readEncryptedField.js";
|
|
9
12
|
import { rotateEncryptedFields } from "../fields/encrypted/utils/rotateEncryptedFields.js";
|
|
10
|
-
export { AuthenticationFailedError, DEFAULT_KEY_ID, DecryptFailedError, InvalidKeysConfigError, MalformedCiphertextError, UnknownKeyIdError, decryptAllData, encryptExistingData, encryptedField, isSealed, rotateEncryptedFields, validateEncryptedBoot, withEncryptedQueryRewrite };
|
|
13
|
+
export { AuthenticationFailedError, CorruptPlaintextError, DEFAULT_KEY_ID, DecryptFailedError, InvalidKeysConfigError, MalformedCiphertextError, UnknownKeyIdError, decryptAllData, decryptFieldValue, encryptExistingData, encryptedField, isSealed, readEncryptedField, rotateEncryptedFields, validateEncryptedBoot, withEncryptedQueryRewrite, withEncryptedResponseStrip, withRawEncrypted };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MeasurementPrecision, PrecisionMode, ResolvedPrecision, resolvePrecision } from "../fields/measurement/engine/precision.js";
|
|
2
|
+
import { COMPOUNDS, CompoundUnitId, CoreDimension, DISPLAY_PRECISION, DimOf, Dimension, MeasurementUnitId, STORAGE_FRACTION_DIGITS, ScalarOfDimension, ScalarUnitId, UNITS, UnitId, UnitOfDimension, dimensionOf, isCompoundUnit, isScalarUnit, precisionFor, unitsOfDimension } from "../fields/measurement/engine/units.js";
|
|
3
|
+
import { DIMENSION_LOCALE_DEFAULTS, MeasurementSystem, resolveDisplayUnit, systemForLocale } from "../fields/measurement/engine/locale.js";
|
|
4
|
+
import { FormatMeasurementOptions, LocalizedLabel, compose, decompose, formatMeasurement, resolveLocalizedLabel, unitLabel } from "../fields/measurement/engine/format.js";
|
|
5
|
+
import { CustomDimensionDef, CustomUnitDef, EngineFormatMeasurementOptions, MeasurementCustomConfig, MeasurementEngine, createEngine, defaultEngine } from "../fields/measurement/engine/registry.js";
|
|
6
|
+
import { AnyMeasurementFieldOptions, MeasurementPrecisionFor } from "../fields/measurement/options.js";
|
|
7
|
+
import { convert, roundTo } from "../fields/measurement/engine/convert.js";
|
|
8
|
+
import { MeasurementPreset, MeasurementUsage, presets } from "../fields/measurement/presets.js";
|
|
9
|
+
export { type AnyMeasurementFieldOptions, COMPOUNDS, type CompoundUnitId, type CoreDimension, type CustomDimensionDef, type CustomUnitDef, DIMENSION_LOCALE_DEFAULTS, DISPLAY_PRECISION, type DimOf, type Dimension, type EngineFormatMeasurementOptions, type FormatMeasurementOptions, type LocalizedLabel, type MeasurementCustomConfig, type MeasurementEngine, type MeasurementPrecision, type MeasurementPrecisionFor, type MeasurementPreset, type MeasurementSystem, type MeasurementUnitId, type MeasurementUsage, type PrecisionMode, type ResolvedPrecision, STORAGE_FRACTION_DIGITS, type ScalarOfDimension, type ScalarUnitId, UNITS, type UnitId, type UnitOfDimension, compose, convert, createEngine, decompose, defaultEngine, dimensionOf, formatMeasurement, isCompoundUnit, isScalarUnit, precisionFor, presets, resolveDisplayUnit, resolveLocalizedLabel, resolvePrecision, roundTo, systemForLocale, unitLabel, unitsOfDimension };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { COMPOUNDS, DISPLAY_PRECISION, STORAGE_FRACTION_DIGITS, UNITS, dimensionOf, isCompoundUnit, isScalarUnit, precisionFor, unitsOfDimension } from "../fields/measurement/engine/units.js";
|
|
2
|
+
import { resolvePrecision } from "../fields/measurement/engine/precision.js";
|
|
3
|
+
import { DIMENSION_LOCALE_DEFAULTS, resolveDisplayUnit, systemForLocale } from "../fields/measurement/engine/locale.js";
|
|
4
|
+
import { convert, roundTo } from "../fields/measurement/engine/convert.js";
|
|
5
|
+
import { compose, decompose, formatMeasurement, resolveLocalizedLabel, unitLabel } from "../fields/measurement/engine/format.js";
|
|
6
|
+
import { createEngine, defaultEngine } from "../fields/measurement/engine/registry.js";
|
|
7
|
+
import { presets } from "../fields/measurement/presets.js";
|
|
8
|
+
export { COMPOUNDS, DIMENSION_LOCALE_DEFAULTS, DISPLAY_PRECISION, STORAGE_FRACTION_DIGITS, UNITS, compose, convert, createEngine, decompose, defaultEngine, dimensionOf, formatMeasurement, isCompoundUnit, isScalarUnit, precisionFor, presets, resolveDisplayUnit, resolveLocalizedLabel, resolvePrecision, roundTo, systemForLocale, unitLabel, unitsOfDimension };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { MeasurementPrecision, PrecisionMode, ResolvedPrecision, resolvePrecision } from "../fields/measurement/engine/precision.js";
|
|
2
|
+
import { COMPOUNDS, CompoundUnitId, CoreDimension, DISPLAY_PRECISION, DimOf, Dimension, MeasurementUnitId, STORAGE_FRACTION_DIGITS, ScalarOfDimension, ScalarUnitId, UNITS, UnitId, UnitOfDimension, dimensionOf, isCompoundUnit, isScalarUnit, precisionFor, unitsOfDimension } from "../fields/measurement/engine/units.js";
|
|
3
|
+
import { MeasurementDefaultUnitsResolver, MeasurementGlobalConfig } from "../types.js";
|
|
4
|
+
import { DIMENSION_LOCALE_DEFAULTS, MeasurementSystem, resolveDisplayUnit, systemForLocale } from "../fields/measurement/engine/locale.js";
|
|
5
|
+
import { FormatMeasurementOptions, LocalizedLabel, compose, decompose, formatMeasurement, resolveLocalizedLabel, unitLabel } from "../fields/measurement/engine/format.js";
|
|
6
|
+
import { CustomDimensionDef, CustomUnitDef, EngineFormatMeasurementOptions, MeasurementCustomConfig, MeasurementEngine, createEngine, defaultEngine } from "../fields/measurement/engine/registry.js";
|
|
7
|
+
import { AnyMeasurementFieldOptions, MEASUREMENT_PREFERENCE_KEY, MeasurementClientOptions, MeasurementCustomFieldOptions, MeasurementFieldOptions, MeasurementPrecisionFor, MeasurementResolvedClientOptions, MeasurementUnitsPreference } from "../fields/measurement/options.js";
|
|
8
|
+
import { convert, roundTo } from "../fields/measurement/engine/convert.js";
|
|
9
|
+
import { MeasurementPreset, MeasurementUsage, presets } from "../fields/measurement/presets.js";
|
|
10
|
+
import { measurementField } from "../fields/measurement/measurementField.js";
|
|
11
|
+
export { type AnyMeasurementFieldOptions, COMPOUNDS, type CompoundUnitId, type CoreDimension, type CustomDimensionDef, type CustomUnitDef, DIMENSION_LOCALE_DEFAULTS, DISPLAY_PRECISION, type DimOf, type Dimension, type EngineFormatMeasurementOptions, type FormatMeasurementOptions, type LocalizedLabel, MEASUREMENT_PREFERENCE_KEY, type MeasurementClientOptions, type MeasurementCustomConfig, type MeasurementCustomFieldOptions, type MeasurementDefaultUnitsResolver, type MeasurementEngine, type MeasurementFieldOptions, type MeasurementGlobalConfig, type MeasurementPrecision, type MeasurementPrecisionFor, type MeasurementPreset, type MeasurementResolvedClientOptions, type MeasurementSystem, type MeasurementUnitId, type MeasurementUnitsPreference, type MeasurementUsage, type PrecisionMode, type ResolvedPrecision, STORAGE_FRACTION_DIGITS, type ScalarOfDimension, type ScalarUnitId, UNITS, type UnitId, type UnitOfDimension, compose, convert, createEngine, decompose, defaultEngine, dimensionOf, formatMeasurement, isCompoundUnit, isScalarUnit, measurementField, precisionFor, presets, resolveDisplayUnit, resolveLocalizedLabel, resolvePrecision, roundTo, systemForLocale, unitLabel, unitsOfDimension };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { COMPOUNDS, DISPLAY_PRECISION, STORAGE_FRACTION_DIGITS, UNITS, dimensionOf, isCompoundUnit, isScalarUnit, precisionFor, unitsOfDimension } from "../fields/measurement/engine/units.js";
|
|
2
|
+
import { resolvePrecision } from "../fields/measurement/engine/precision.js";
|
|
3
|
+
import { DIMENSION_LOCALE_DEFAULTS, resolveDisplayUnit, systemForLocale } from "../fields/measurement/engine/locale.js";
|
|
4
|
+
import { convert, roundTo } from "../fields/measurement/engine/convert.js";
|
|
5
|
+
import { compose, decompose, formatMeasurement, resolveLocalizedLabel, unitLabel } from "../fields/measurement/engine/format.js";
|
|
6
|
+
import { createEngine, defaultEngine } from "../fields/measurement/engine/registry.js";
|
|
7
|
+
import { MEASUREMENT_PREFERENCE_KEY } from "../fields/measurement/options.js";
|
|
8
|
+
import { measurementField } from "../fields/measurement/measurementField.js";
|
|
9
|
+
import { presets } from "../fields/measurement/presets.js";
|
|
10
|
+
export { COMPOUNDS, DIMENSION_LOCALE_DEFAULTS, DISPLAY_PRECISION, MEASUREMENT_PREFERENCE_KEY, STORAGE_FRACTION_DIGITS, UNITS, compose, convert, createEngine, decompose, defaultEngine, dimensionOf, formatMeasurement, isCompoundUnit, isScalarUnit, measurementField, precisionFor, presets, resolveDisplayUnit, resolveLocalizedLabel, resolvePrecision, roundTo, systemForLocale, unitLabel, unitsOfDimension };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { DEFAULT_METADATA_SET, MetadataSet, PhoneMetadata, loadMetadata } from "../fields/phoneNumber/engine/metadata.js";
|
|
2
|
+
import { CountryCode, ParsedPhone, PhoneCheck, PhoneFormat, PhoneOptions, PhoneValidationMode, checkPhone, detectCountry, formatAsYouType, formatPhone, parsePhone, phoneUri, salvagePhone } from "../fields/phoneNumber/engine/phone.js";
|
|
3
|
+
import { CountryOption, KNOWN_COUNTRY_CODES, callingCodeFor, countryOptions, emojiFlag, isKnownCountry, isSupported } from "../fields/phoneNumber/engine/countries.js";
|
|
4
|
+
export { type CountryCode, type CountryOption, DEFAULT_METADATA_SET, KNOWN_COUNTRY_CODES, type MetadataSet, type ParsedPhone, type PhoneCheck, type PhoneFormat, type PhoneMetadata, type PhoneOptions, type PhoneValidationMode, callingCodeFor, checkPhone, countryOptions, detectCountry, emojiFlag, formatAsYouType, formatPhone, isKnownCountry, isSupported, loadMetadata, parsePhone, phoneUri, salvagePhone };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { KNOWN_COUNTRY_CODES, callingCodeFor, countryOptions, emojiFlag, isKnownCountry, isSupported } from "../fields/phoneNumber/engine/countries.js";
|
|
2
|
+
import { DEFAULT_METADATA_SET, loadMetadata } from "../fields/phoneNumber/engine/metadata.js";
|
|
3
|
+
import { checkPhone, detectCountry, formatAsYouType, formatPhone, parsePhone, phoneUri, salvagePhone } from "../fields/phoneNumber/engine/phone.js";
|
|
4
|
+
export { DEFAULT_METADATA_SET, KNOWN_COUNTRY_CODES, callingCodeFor, checkPhone, countryOptions, detectCountry, emojiFlag, formatAsYouType, formatPhone, isKnownCountry, isSupported, loadMetadata, parsePhone, phoneUri, salvagePhone };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { MetadataSet } from "../fields/phoneNumber/engine/metadata.js";
|
|
2
|
+
import { CountryCode, PhoneFormat, PhoneValidationMode } from "../fields/phoneNumber/engine/phone.js";
|
|
3
|
+
import { AnyPhoneNumberFieldOptions, FLAGS_PATH, PHONE_CUSTOM_KEY, PhoneFlagMode, PhoneNumberE164FieldOptions, PhoneNumberFieldOptions, PhoneStorageMode, ResolvablePhoneFieldOptions, ResolvedPhoneOptions, countryFlagSrc } from "../fields/phoneNumber/options.js";
|
|
4
|
+
import { PhoneNumberGlobalConfig } from "../types.js";
|
|
5
|
+
import { phoneNumberField } from "../fields/phoneNumber/phoneNumberField.js";
|
|
6
|
+
export { type AnyPhoneNumberFieldOptions, type CountryCode, FLAGS_PATH, type MetadataSet, PHONE_CUSTOM_KEY, type PhoneFlagMode, type PhoneFormat, type PhoneNumberE164FieldOptions, type PhoneNumberFieldOptions, type PhoneNumberGlobalConfig, type PhoneStorageMode, type PhoneValidationMode, type ResolvablePhoneFieldOptions, type ResolvedPhoneOptions, countryFlagSrc, phoneNumberField };
|
package/dist/exports/rsc.d.ts
CHANGED
|
@@ -7,4 +7,8 @@ import { ProtectedRichText } from "../fields/encrypted/components/ProtectedRichT
|
|
|
7
7
|
import { IconCell } from "../fields/icon/rsc/IconCell.js";
|
|
8
8
|
import { IconFieldServer } from "../fields/icon/rsc/IconFieldServer.js";
|
|
9
9
|
import { IconLibrarySelectServer } from "../fields/icon/rsc/IconLibrarySelectServer.js";
|
|
10
|
-
|
|
10
|
+
import { MeasurementCellServer } from "../fields/measurement/server/MeasurementCellServer.js";
|
|
11
|
+
import { MeasurementFieldServer } from "../fields/measurement/server/MeasurementFieldServer.js";
|
|
12
|
+
import { PhoneNumberCellServer } from "../fields/phoneNumber/server/PhoneNumberCellServer.js";
|
|
13
|
+
import { PhoneNumberFieldServer } from "../fields/phoneNumber/server/PhoneNumberFieldServer.js";
|
|
14
|
+
export { ColorCell, ColorFieldServer, type FieldsPluginRegistry, IconCell, IconFieldServer, IconLibrarySelectServer, MeasurementCellServer, MeasurementFieldServer, PhoneNumberCellServer, PhoneNumberFieldServer, ProtectedCell, ProtectedRichText, createRscIcon };
|
package/dist/exports/rsc.js
CHANGED
|
@@ -6,4 +6,8 @@ import { createRscIcon } from "../fields/icon/react/createRscIcon.js";
|
|
|
6
6
|
import { IconCell } from "../fields/icon/rsc/IconCell.js";
|
|
7
7
|
import { IconFieldServer } from "../fields/icon/rsc/IconFieldServer.js";
|
|
8
8
|
import { IconLibrarySelectServer } from "../fields/icon/rsc/IconLibrarySelectServer.js";
|
|
9
|
-
|
|
9
|
+
import { MeasurementCellServer } from "../fields/measurement/server/MeasurementCellServer.js";
|
|
10
|
+
import { MeasurementFieldServer } from "../fields/measurement/server/MeasurementFieldServer.js";
|
|
11
|
+
import { PhoneNumberCellServer } from "../fields/phoneNumber/server/PhoneNumberCellServer.js";
|
|
12
|
+
import { PhoneNumberFieldServer } from "../fields/phoneNumber/server/PhoneNumberFieldServer.js";
|
|
13
|
+
export { ColorCell, ColorFieldServer, IconCell, IconFieldServer, IconLibrarySelectServer, MeasurementCellServer, MeasurementFieldServer, PhoneNumberCellServer, PhoneNumberFieldServer, ProtectedCell, ProtectedRichText, createRscIcon };
|
package/dist/exports/types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AnyPhoneNumberFieldOptions, PhoneFlagMode, PhoneNumberE164FieldOptions, PhoneNumberFieldOptions, PhoneStorageMode, ResolvablePhoneFieldOptions, ResolvedPhoneOptions } from "../fields/phoneNumber/options.js";
|
|
2
|
+
import { ColorFormat, ColorGlobalConfig, ColorPreset, DecryptFailurePolicy, EncryptedGlobalConfig, FieldsPluginRegistry, FieldsResolverArgs, IconAdapter, IconGlobalConfig, IconManifest, IconMeta, IconNode, IconNodeMap, KeysConfig, PhoneNumberGlobalConfig } from "../types.js";
|
|
2
3
|
import { ColorFieldClientOptions, ColorFieldOptions, ColorLinkedOptions, ColorPresetsResolver, ColorPresetsSource, ResolvedColorPreset } from "../fields/color/options.js";
|
|
3
4
|
import { FieldsPluginOptions } from "../index.js";
|
|
4
|
-
export type { ColorFieldClientOptions, ColorFieldOptions, ColorFormat, ColorGlobalConfig, ColorLinkedOptions, ColorPreset, ColorPresetsResolver, ColorPresetsSource, DecryptFailurePolicy, EncryptedGlobalConfig, FieldsPluginOptions, FieldsPluginRegistry, FieldsResolverArgs, IconAdapter, IconGlobalConfig, IconManifest, IconMeta, IconNode, IconNodeMap, KeysConfig, ResolvedColorPreset };
|
|
5
|
+
export type { AnyPhoneNumberFieldOptions, ColorFieldClientOptions, ColorFieldOptions, ColorFormat, ColorGlobalConfig, ColorLinkedOptions, ColorPreset, ColorPresetsResolver, ColorPresetsSource, DecryptFailurePolicy, EncryptedGlobalConfig, FieldsPluginOptions, FieldsPluginRegistry, FieldsResolverArgs, IconAdapter, IconGlobalConfig, IconManifest, IconMeta, IconNode, IconNodeMap, KeysConfig, PhoneFlagMode, PhoneNumberE164FieldOptions, PhoneNumberFieldOptions, PhoneNumberGlobalConfig, PhoneStorageMode, ResolvablePhoneFieldOptions, ResolvedColorPreset, ResolvedPhoneOptions };
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { ColorFieldClientOptions, ResolvedColorPreset } from "../options.js";
|
|
2
2
|
import { TextFieldClientProps } from "payload";
|
|
3
3
|
import React from "react";
|
|
4
|
+
|
|
4
5
|
//#region src/fields/color/client/ColorField.d.ts
|
|
5
6
|
type ColorFieldProps = {
|
|
6
7
|
colorOptions: ColorFieldClientOptions;
|
|
7
8
|
presetsLabel?: string;
|
|
8
9
|
resolvedPresets?: ResolvedColorPreset[];
|
|
9
10
|
} & TextFieldClientProps;
|
|
11
|
+
/** `ColorInput` bound to the document form through `useField`, with the field's validation. */
|
|
10
12
|
declare const ColorField: React.FC<ColorFieldProps>;
|
|
11
13
|
//#endregion
|
|
12
14
|
export { ColorField, ColorFieldProps };
|