viewkitjs 0.26.0-pr-771-d13ee9b → 0.26.0
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 +65 -0
- package/MIGRATION.md +402 -3
- package/fields/dist/index.d.ts +1 -1
- package/fields/dist/index.js +1 -1
- package/fields/dist/messages.d.ts +2 -0
- package/fields/dist/messages.js +126 -0
- package/fields/docs/guides/conventions.md +1 -1
- package/fields/docs/reference/fields.md +1 -0
- package/package.json +1 -1
- package/postgres/dist/search.js +1 -1
- package/postgres/dist/value-rows.d.ts +15 -7
- package/postgres/dist/value-rows.js +30 -6
- package/postgres/docs/guides/field-map.md +2 -2
- package/views/dist/contract.d.ts +59 -1
- package/views/dist/contract.js +66 -3
- package/views/dist/controls/compound-editor/compound-editor.d.ts +3 -0
- package/views/dist/controls/compound-editor/map-parts-body.d.ts +6 -1
- package/views/dist/controls/compound-editor/map-parts-body.js +43 -3
- package/views/dist/controls/compound-editor/name-parts.js +5 -6
- package/views/dist/controls/compound-editor/place-parts.js +18 -17
- package/views/dist/controls/compound-editor/place.d.ts +9 -1
- package/views/dist/controls/compound-editor/place.js +2 -2
- package/views/dist/controls/compound-editor/range-parts.js +13 -11
- package/views/dist/controls/compound-editor/words.d.ts +41 -0
- package/views/dist/controls/compound-editor/words.js +24 -0
- package/views/dist/controls/index.d.ts +4 -2
- package/views/dist/controls/index.js +2 -0
- package/views/dist/controls/menu/map-menu.d.ts +1 -1
- package/views/dist/controls/menu/map-menu.js +12 -6
- package/views/dist/controls/menu/menu.d.ts +11 -0
- package/views/dist/controls/menu/menu.js +11 -9
- package/views/dist/controls/menu-list/menu-list.d.ts +3 -1
- package/views/dist/controls/menu-list/menu-list.js +2 -2
- package/views/dist/controls/number-field/number-field.d.ts +6 -0
- package/views/dist/controls/number-field/number-field.js +3 -3
- package/views/dist/controls/picker/picker.d.ts +9 -1
- package/views/dist/controls/picker/picker.js +19 -4
- package/views/dist/controls/select/select.d.ts +3 -1
- package/views/dist/controls/select/select.js +1 -1
- package/views/dist/controls/sheet/bottom-sheet.d.ts +6 -1
- package/views/dist/controls/sheet/bottom-sheet.js +3 -2
- package/views/dist/controls/sheet/map-sheet.js +3 -2
- package/views/dist/controls/text-editor/countries.d.ts +4 -1
- package/views/dist/controls/text-editor/countries.js +19 -4
- package/views/dist/controls/text-editor/map-text-body.d.ts +7 -1
- package/views/dist/controls/text-editor/map-text-body.js +10 -1
- package/views/dist/controls/text-editor/phone-number.d.ts +2 -2
- package/views/dist/controls/text-editor/phone-number.js +16 -3
- package/views/dist/controls/text-editor/text-editor.d.ts +5 -0
- package/views/dist/controls/text-editor/text-editor.js +7 -5
- package/views/dist/controls/text-editor/words.d.ts +12 -0
- package/views/dist/controls/text-editor/words.js +2 -0
- package/views/dist/editors/SelectEditor.js +1 -1
- package/views/dist/model/column-filters.d.ts +1 -1
- package/views/dist/model/part-rows.d.ts +1 -1
- package/views/dist/provider/components.d.ts +8 -1
- package/views/dist/styles.css +1 -1
- package/views/dist/styles.unlayered.css +1 -1
- package/views/docs/contract.md +2 -2
- package/views/docs/reference/controls.md +10 -2
- package/views/docs/reference/react.md +1 -1
- package/views/docs/reference/views.md +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,71 @@ Until 0.19.0 ViewKit shipped as three packages; their changes are in [fields/CHA
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [0.26.0] — 2026-11-27
|
|
9
|
+
|
|
10
|
+
Every word ViewKit's default controls draw is now the app's: an app that spreads `CONTROLS` and words every message key sees no English from them. `MIGRATION.md` gains a part that takes an app on the three old packages at views 0.9, fields 0.15 and postgres 0.6 to this release step by step, with every message key to word since.
|
|
11
|
+
|
|
12
|
+
Create your search indexes again. The folded text `searchIndexes` prints changed with the fold below, and Postgres serves a search only from an index on the same expression: create each trigram index it prints now, or a search reads every row. Keep the ones it printed before until the build that folds the new way is live, then drop them.
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- `viewkitjs/views/controls`: `CONTROLS.Picker` and `CONTROLS.FieldsBody`. An app that spreads `CONTROLS` picks a select, a status, several options, a person and a record, and its sort's and filter's fields, in ViewKit's Picker; its stylesheet is `viewkitjs/views/controls/picker.css` with the controls it stands on. `pickerItemsOf` reads ViewKit's rows as the Picker's.
|
|
17
|
+
- The Picker's words are a `words` prop (`PickerWords`, English by default, `PICKER_WORDS`), and ViewKit hands them from 21 new `views.picker.*` messages.
|
|
18
|
+
- `ViewsPickerProps.steps`: a status field's active steps, by value, so an app's Picker places an archived option held outside them, as its cell does.
|
|
19
|
+
- `viewkitjs/views/controls`: the Text editor (`useTextEditor`, its parts a shell pours in, with its rules for each kind and for a phone), on Base UI. `CONTROLS.TextBody` draws ViewKit's text bodies with it: a line, an email, a phone, a link, a domain and long text type into the inline input over the cell, a phone with its country, dial code and pattern. Its stylesheet is `viewkitjs/views/controls/text-editor.css`; its options and looks (`TEXT_EDITOR_LOOKS`: The box, Long text keeps on, A phone; Attio and Mihai's) are on `viewkitjs/views/looks`.
|
|
20
|
+
- An app that takes `CONTROLS.TextBody` edits long text and a line the cell cut off in the cell, not in a panel, and a record's text in the same box; Tab in a phone walks its country, then its number; a number re-typed the same saves nothing; a phone's extension is kept.
|
|
21
|
+
- `viewkitjs/views/controls`: the Date editor (`useDateEditor`, its calendar, its parts typed a box each, its words `DATE_EDITOR_WORDS` and its names `dateNames`), on Base UI. `CONTROLS.DateBody` draws ViewKit's date bodies with it, so an app that spreads `CONTROLS` edits a date or a date and time with no `Calendar`: a line to type a date into, a month of days, the year typed, the quick picks in a row, and on a phone the same at a finger's size. Its words come from the conventions' messages (new keys `date.type`, `date.none`, `date.add-time`, `date.last-month`, `date.next-month`, `date.day`, `date.month`, `date.year`, `date.months`, `date.years`, `time.hour`, `time.minute`, `date.not-a-date`, `date.no-such-day`) and its month and weekday names are in `conventions.language`. Its stylesheet is `viewkitjs/views/controls/date-editor.css`; its options and looks (`DATE_EDITOR_LOOKS`: The line, The time, The days, The year, The quick picks, The calendar; Attio and Mihai's) are on `viewkitjs/views/looks`.
|
|
22
|
+
- An app that takes `CONTROLS.DateBody`: a day pressed on a date and time keeps the editor open for its time, Enter saves and closes; No date stands among the quick picks in place of the Clear row; the time is typed in parts; a date that can't be read says why.
|
|
23
|
+
- `viewkitjs/views/controls`: the Compound editor (`CompoundEditor`, `useCompoundEditor`, with its rules for a name, a place and a range) and a country's `Flag`, on Base UI. `CONTROLS.PartsBody` draws ViewKit's name, place and range bodies with it: labelled boxes for First and Last name; a place's street (one box of several lines, under the field's word for line 1), City, State and Postal code with its Country last, its flag and a searchable list under its box; a range's From and To with its bands listed under them. Its stylesheets are `viewkitjs/views/controls/compound-editor.css` and `flag.css`; its options and looks (`COMPOUND_EDITOR_LOOKS`: The parts, Shown as, The country, Arrows; Attio and Mihai's) are on `viewkitjs/views/looks`.
|
|
24
|
+
- `country-flag-icons` 1.6.20 is a dependency, reached only by the controls part: about 560 KB of flag SVG (about 45 KB gzipped), not tree-shaken, in every app that spreads `CONTROLS`.
|
|
25
|
+
- An app that takes `CONTROLS.PartsBody` edits a name and a range in a popover under the value, not in place; a name in First and Last name only (Shown as: Shown gives the full name its box), and while its full name is hidden a name of its own ("Dr. Ana Pérez") follows its parts once one changes, so it saves as "Eva Pérez" where ViewKit's own name editor kept "Dr. Ana Pérez"; a place in one order for every country, its street one box of several lines, with no Clear row; a range's bands as a list under its ends.
|
|
26
|
+
- `viewkitjs/fields`: `FIELD_MESSAGE_KEYS`, every `FieldMessageKey` once, so an app tests that its catalog words each one, as `VIEWS_MESSAGE_KEYS` does for the views part.
|
|
27
|
+
- Twenty-one message keys, the words of the default controls that no key reached:
|
|
28
|
+
- `views.editors.name-shown-as`: "Shown as", the Compound editor's full name box.
|
|
29
|
+
- `views.editors.name-follows`: "Follows the first and last name. Type here to give it one of its own."
|
|
30
|
+
- `views.editors.name-own`: "Its own. Clear it to follow the first and last name again."
|
|
31
|
+
- `views.editors.name-own-mark`: "Its own".
|
|
32
|
+
- `views.editors.place-no-country`: "No country", the empty row of a place's country list.
|
|
33
|
+
- `views.editors.place-no-region` (`{ region }`): "No {region}", the region's word lowercased.
|
|
34
|
+
- `views.editors.place-search-for-region` (`{ region }`): "Search for a {region}", the region's word lowercased.
|
|
35
|
+
- `views.editors.place-pick`: "Select…", an empty country or region box.
|
|
36
|
+
- In the country-first look: `views.editors.place-find-country` "Find a country", `views.editors.place-find-region` (`{ region }`) "Find a {region}", `views.editors.place-choose-country` "Choose a country" and `views.editors.place-choose-region` (`{ region }`) "Choose a {region}".
|
|
37
|
+
- A place's boxes while no country is held: `views.editors.place-street` "Street address"; in the country-first look `views.editors.place-street-number` "Street and number", `views.editors.place-street-short` "Street" (a phone's row), `views.editors.place-line2-plain` "Line 2" and `views.editors.place-postcode` "Postcode".
|
|
38
|
+
- `views.editors.number-increase`: "Increase"; `views.editors.number-decrease`: "Decrease"; `views.editors.number-field`: "Number field", what a screen reader calls a number box.
|
|
39
|
+
- `views.menus.not-now`: "Not now", a menu row that can't be used and says no why.
|
|
40
|
+
- `viewkitjs/views/controls`: `words` on the Compound editor (`CompoundEditorWords`, `COMPOUND_EDITOR_WORDS`, `compoundWords`), the Text editor (`TextEditorWords`, `TEXT_EDITOR_WORDS`, `textWords`, and `language`, which names a phone's countries), the Sheet's head (`close`, `back`), the Menu (`MenuWords`), a place's boxes where no country names them (`PlaceWords`, through `wordOf`'s `words`), the number box (`increase`, `decrease`, `field`) and the Select (`pickerWords`), each English unless handed. `countryName` takes a language.
|
|
41
|
+
- `viewkitjs/fields/query`: `FOLDED_LETTERS`, the letters `foldText` maps and their plain spelling, so an adapter folds by the same table.
|
|
42
|
+
- `viewkitjs/fields/query`: `MatchOptions.exact` and a `RuleReader`'s `exact`: the field keeps decimal text, so `matchesRule` compares a number rule on it exactly. `matchesNumberRule` takes it as a fourth argument. `evaluateView`'s reader sets it from `storesDecimalText`; an adapter with a reader of its own sets it the same way.
|
|
43
|
+
- `viewkitjs/views/controls`: `DateDays`, the Date editor's days (the weekday row and a month's grid, with their keys), which the Date editor and `CONTROLS.Calendar` both draw.
|
|
44
|
+
- `viewkitjs/fields`: the message key `field.must-tick`, "This box must be ticked": the refused clear of a Required checkbox, for a host where a checkbox left off holds no value. Word it in your own `messages` like every key.
|
|
45
|
+
- `ViewsPickerProps.keyed` and `PickerProps.keyed`: the list was opened by a key (Enter or a letter on a cell). On a computer the row held is lit as it opens, and ↓ goes on from it to the next. ViewKit's select editor hands it when a key opened it, as it hands its own list the focus.
|
|
46
|
+
- `ViewsPickerProps.fromHeld` and `PickerProps.fromHeld`: before a person lights a row, ↓ and ↑ go on from the held row, to the next or the one before, round at either end, where they started from the top or the foot; nothing is drawn lit until then. ViewKit's select editors hand it always.
|
|
47
|
+
|
|
48
|
+
### Changed
|
|
49
|
+
|
|
50
|
+
- An app that spreads `CONTROLS` sees every list with its search, a held value listed first, a status at its place, a select's options plain, and a relation's fields one level in, in place of its `Command` list and ViewKit's own field lists. An app that hands no `Picker` keeps its `Command` list.
|
|
51
|
+
- The Picker's defaults are My preset's: with nothing picked, a row's second line stands below its name, the list's message at the start and a face of 24, wherever a Picker or `usePicker` draws with no frame round it. The `attio` look keeps Attio's picks (beside, centred, 32).
|
|
52
|
+
- An app's `DateBody` that calls `onDone` after a plain Enter closes the edit as Enter does (in a grid the next key lands the write first, ⌘Z included); after anything else it is a pick, as before.
|
|
53
|
+
- `viewkitjs/views/controls`: `CONTROLS.PartsBody`, `CONTROLS.TextBody`, `CONTROLS.Sheet` and `CONTROLS.Menu` say the app's messages: the older editors' keys where they had one (`views.editors.name-given`, `name-family`, `place-country`, `place-country-search`, `range-low`, `range-high`, `place-city-city`, `place-postal-postal`, `place-region-state`, `place-region`, `views.panels.close`, `views.panels.back`, `views.menus.search`, the Picker's `views.picker.*`), the keys above otherwise. A phone's countries are named in the conventions' `language`.
|
|
54
|
+
- Three keys keep their names and now say what the new editors say, in an app with no catalog of its own: `views.editors.name-given` "First name" (was "Given name"), `views.editors.name-family` "Last name" (was "Family name") and `views.editors.place-country-search` "Search for a country" (was "Search countries"). The older name and place editors and a field's part rows ("Name · First name") read them too.
|
|
55
|
+
- `viewkitjs/fields` and `viewkitjs/postgres`: text rules and search fold more. `foldText` and the SQL fold now read text by compatibility (NFKD) and map the letters that have no combining form: ł to l, ø to o, đ and ð to d, ı to i, ß to ss, æ to ae, œ to oe, þ to th. "lodz" finds Łódź, "strasse" finds Straße, "dang" finds Đặng, and a fullwidth "ACME" is "acme". NFKD also reads a ligature or a superscript as its letters: "fi" finds "fi", and "2" now finds "m²". An option typed as "Strasse" is the option "Straße" already holds. Romanian ș and ş and Turkish İ fold as before.
|
|
56
|
+
- `viewkitjs/fields` and `viewkitjs/postgres`: every negative way keeps a record whose value is empty, for every type. A number's, a percent's, a currency's and a range end's "is not" now keeps a record with no value, as "is not", "is none of" and "doesn't contain" already did for text, dates, options, people, places, links and names: "Amount is not 0" and "Stage is not Won" both keep the record that has neither. "Is empty" asks for those records alone.
|
|
57
|
+
- `viewkitjs/fields` and `viewkitjs/postgres`: a `storage: "decimal"` field is filtered and sorted exactly. In memory, its decimal text compares as digits, past 2^53 and beyond a double's range alike, and "is" rounds it half away from zero; on a database, a numeric column under such a field compares as numeric. Any other number field is still judged as a double, its text included. A value that reads as no number sorts as empty, last in either direction, never in the middle.
|
|
58
|
+
- `viewkitjs/views/controls`: the default controls take their phone form by the line the app hands `ViewsProvider` (`desktopQuery`), where ViewKit's sheets and editors already switch, not at a fixed 640 px; at ViewKit's default that is below 1024 px. On a phone a control carries `data-vk-phone` (by the line, a `PhoneHost` screen or a `ComputerHost`; a told `form` changes only its layout, never its sizes), which the stylesheets read; mark a box you show as a phone's screen with it. The stylesheets no longer read `o-phone`, and read `data-computer-host` only to keep typable words at 16px. A Field takes its phone form without `form`. A control drawn outside `ViewsProvider` reads the 1024 default unless wrapped in `PhoneLine.Provider`. New: `PhoneLine`, `usePhoneForm`, `PHONE_MARK`, `phoneMark`.
|
|
59
|
+
- `viewkitjs/postgres`: a rule or a search word on a value kept in a row of a table of values, under an `or` on a page, reads the rows that hold it as a set when few do, where the trigram index on the fold of the value column serves it (a `contains` or a search word of three characters or more, on a text). The page counts those rows once, at most 1,001, through that index: at most 1,000, the record's key is looked up in them; more, each record's row is probed as before, so a page for a common word still stops when it is full. The probe was `EXISTS (SELECT 1 FROM <rows> WHERE <record> = <key> AND … OFFSET 0)` and is now `(CASE WHEN (SELECT count(*) FROM (SELECT <record> FROM <rows> WHERE … LIMIT 1001) AS "vk_n") <= 1000 THEN (<key> IS NOT NULL AND <key> IN (SELECT <record> FROM <rows> WHERE … LIMIT 1001)) ELSE EXISTS (… OFFSET 0) END)`. Measured on a million people, a name and a text kept in a table of values, a page of 50: a word no row holds 2.7 s → 0.4 s, a word 19 records hold 2.8 s → 0.4 s, a word in 300 rows 0.75 s → 0.12 s; a common word pays for the count, about 4× slower (2.1 → 8.2 ms for a word in a tenth of the rows, 2.3 → 4.1 ms for one in a quarter), because the trigram index finds every row holding the word before the count can stop. A word under three characters, an option, a number, a date, a phone and any rule but `contains` are probed by record as before, since no index would serve their count: it would read the field's rows until 1,001 match, up to all of them. Without the trigram index a word in a few hundred rows is about 15% slower on a page (0.78 → 0.90 s at a million): make the index `searchIndexes` names.
|
|
60
|
+
- `viewkitjs/postgres`: a rule on a value kept in a row of a table of values that no empty value holds (as `matchesRule` answers on none: a `contains`, an `is`, a comparison) is its probe alone, in a page and a total: the arm for a record with no row, `OR (<rule on an empty value> AND NOT EXISTS (…))`, is written only for a rule that holds on an empty value (`does not contain`, `is not`, `is empty`). Standing alone, Postgres now reads such a rule as a join from the value's index instead of walking the list's order with the probe as a filter: a `contains` of three characters or more on a text kept in a table of values, a million people, 39–163 ms → 1.6–5.6 ms a page, and its count 51–153 ms → 1.4–40 ms; a two-letter word, which no trigram serves, keeps its page time (23.5 → 23.7 ms) and its count drops 2.2 s → 0.93 s.
|
|
61
|
+
- `viewkitjs/postgres`: a set read writes its arm's condition three times (the count, the set and the probe), so a page's rule or search word that reads a set binds three times the values it did, and fewer such arms fit under a statement's 30,000 values before the statement is refused as too big. Same rows, same order, same cursors everywhere. A total never reads a set (only its arm for a record with no row changes, as a page's does), and a relation's lead link and several values kept as rows write the same SQL as before.
|
|
62
|
+
- `viewkitjs/fields`: a Required checkbox (`type: "boolean"`, `required: true`) refused empty says `field.must-tick` instead of `field.cannot-empty`, in `fieldClearRefusal` and in the refusals of `acceptFieldCommit` and `acceptStoredFieldValue`. A field's own `edit.reasons.clearable` still comes first, and every other field, a checkbox that isn't Required included, keeps `field.cannot-empty`.
|
|
63
|
+
- `viewkitjs/views`: a select cell or field opened by a press, holding a value, goes on with ↓ to the option after it, as Atlas's own select does, where ↓ lit the list's first row (None, where it may be emptied). This reverses the Picker's at-rest rule (KIT-733) for ViewKit's select editors only (Mihai, 27 Nov 2026: "Start from the held value"): nothing is drawn lit at rest, so the list looks as before; several values, a person and a record keep the rule.
|
|
64
|
+
|
|
65
|
+
### Fixed
|
|
66
|
+
|
|
67
|
+
- `viewkitjs/views/controls`: `CONTROLS.TextBody` draws the value in its box on the server again, so a server-drawn page shows it before the page comes alive. One ⌘Z (Ctrl+Z) still takes back what was just typed, now in the phone's sheet too.
|
|
68
|
+
- An app that spreads `CONTROLS` and hands no `Calendar` opens the filter panel's date, its date ranges and its custom time scope: `CONTROLS.Calendar` is ViewKit's own month, the Date editor's days, one day a press, its words the app's and its names in the conventions' `language`. An app's own `Calendar` or `RangeCalendar` atom is kept. Before, those three threw the missing-`Calendar` error.
|
|
69
|
+
- `viewkitjs/fields`: a phone's `zodFor` schema now converts to JSON Schema with its stored shape, an object of `number` (E.164, `^\+[1-9]\d{1,14}$`) and `extension` (`^\d{1,20}$` or `null`), both required and nothing else, alone and as each item's `value` for several phones. It converted to `{}`, so a reader handed it, an agent filling a form, learned no shape. What the schema accepts is unchanged.
|
|
70
|
+
- `viewkitjs/views/controls`: a letter typed on a select cell opens the Picker with its first match lit, so Enter picks it, as ViewKit's own list does. It lit the held value where that one matched the letter, and no row where it didn't, so Enter saved nothing. A computer's `Picker` or `usePicker` handed `typed` now draws its first match lit as it opens, where it drew no row lit, as a person's typing lights it.
|
|
71
|
+
- `viewkitjs/views/controls`: Enter on a select cell holding a value, then ↓, lights the option after the held one. It lit the list's first row, None where the field may be emptied, so Enter, ↓, Enter emptied the cell.
|
|
72
|
+
|
|
8
73
|
## [0.25.0] — 2026-11-26
|
|
9
74
|
|
|
10
75
|
viewkitjs/views/controls: the Menu (the components map's default `Menu`, with `menuEntries`), its context menu and its ⋯, the Avatar and its stack, the Select, and the Picker's core (`usePicker`, `Picker`, `PickerUnder` and its rows), with the popup line's stylesheet, the phone's line (`usePhone`, `PhoneHost`, `ComputerHost`) and a list's own scrolling; their looks (`LIST_LOOKS`, `PICKER_LOOKS`, `AVATAR_LOOKS`) in viewkitjs/views/looks.
|
package/MIGRATION.md
CHANGED
|
@@ -8,9 +8,10 @@ Every name they exported is exported from the same entry of `viewkitjs`, and eac
|
|
|
8
8
|
one with `@viewkitjs/` replaced by `viewkitjs/`. So the move is one install and one find-and-replace. This page
|
|
9
9
|
is that replacement written out, every path beside its new one, for when you want to check one.
|
|
10
10
|
|
|
11
|
-
This page maps the names. What the code behaves like in each version is in the changelog: an app
|
|
12
|
-
from an older version of the three packages reads, in `CHANGELOG.md`, the notes of every version
|
|
13
|
-
its own and the one it installs.
|
|
11
|
+
This page maps the names first. What the code behaves like in each version is in the changelog: an app
|
|
12
|
+
coming from an older version of the three packages reads, in `CHANGELOG.md`, the notes of every version
|
|
13
|
+
between its own and the one it installs. For an app on `@viewkitjs/views` 0.9, `fields` 0.15 and `postgres`
|
|
14
|
+
0.6, the last part of this page gathers those notes into steps, the message keys to word among them.
|
|
14
15
|
|
|
15
16
|
## Install
|
|
16
17
|
|
|
@@ -115,3 +116,401 @@ After the replacement, nothing in your code, styles or manifest names `@viewkitj
|
|
|
115
116
|
```sh
|
|
116
117
|
git grep -n "@viewkitjs/" -- ':!*lock*'
|
|
117
118
|
```
|
|
119
|
+
|
|
120
|
+
## From `@viewkitjs/views` 0.9, `fields` 0.15 and `postgres` 0.6
|
|
121
|
+
|
|
122
|
+
An app on `@viewkitjs/views` 0.9, `@viewkitjs/fields` 0.15 and `@viewkitjs/postgres` 0.6 can come to this
|
|
123
|
+
release in one step, skipping every version in between. Take these steps in order. Each says what changed and
|
|
124
|
+
the version it came in, so you can read more in that version's notes. Views 0.10 to 0.15, fields 0.16 to 0.18
|
|
125
|
+
and postgres 0.7 to 0.12 are in the three parts' changelogs; 0.19 onward is in `CHANGELOG.md`.
|
|
126
|
+
|
|
127
|
+
### 1. Install the one package
|
|
128
|
+
|
|
129
|
+
Do the install and the path map above. `react` and `react-dom` 19 became optional peers in 0.19: only
|
|
130
|
+
`viewkitjs/views/*` needs them. `zod` `^4.1.12` stays a peer, and the three `@dnd-kit` packages are still
|
|
131
|
+
optional. From views 0.10 the panels' door loads without them, but an app that draws a dragging part still
|
|
132
|
+
installs them.
|
|
133
|
+
|
|
134
|
+
Two things are new:
|
|
135
|
+
|
|
136
|
+
- **`@base-ui/react` `^1.6.0`**, an optional peer since 0.22. Only `viewkitjs/views/controls` needs it, so
|
|
137
|
+
install it to take ViewKit's default controls (step 6). An app that hands every control itself never
|
|
138
|
+
installs it.
|
|
139
|
+
- **`country-flag-icons` 1.6.20**, a dependency of the controls part: the flags beside a place's countries
|
|
140
|
+
in the Compound editor. It adds about 560 KB of SVG (about 45 KB gzipped) to every app that spreads
|
|
141
|
+
`CONTROLS`, whether it edits a place or not, because the flags are not tree-shaken.
|
|
142
|
+
|
|
143
|
+
`tldts` moved to 7.5.5.
|
|
144
|
+
|
|
145
|
+
### 2. Change everything that names the old packages
|
|
146
|
+
|
|
147
|
+
The path map above covers imports, the `declare module` block of the names your app narrows, and the
|
|
148
|
+
`@source` line. Your repository may also name the packages in places a find-and-replace on imports misses:
|
|
149
|
+
|
|
150
|
+
- **A test runner's pre-bundle list** (Vitest's `optimizeDeps.include`, for example) naming subpaths such as
|
|
151
|
+
`@viewkitjs/views/editors/date`. Every subpath keeps its name under `viewkitjs/`.
|
|
152
|
+
- **Architecture checks or lint rules** that allow, forbid or pin the package by name. One that refuses
|
|
153
|
+
anything but an exact version of `@viewkitjs/postgres` refuses `viewkitjs` until it moves too.
|
|
154
|
+
- **Code that slices a key's prefix.** Every views key still starts with `views.`, and every fields key
|
|
155
|
+
keeps its name, so code that strips `views.` to read a catalog's namespace keeps working.
|
|
156
|
+
|
|
157
|
+
The `git grep` under "Check you're done" finds all of them.
|
|
158
|
+
|
|
159
|
+
### 3. Fix what no longer compiles
|
|
160
|
+
|
|
161
|
+
Nothing was removed except what is below.
|
|
162
|
+
|
|
163
|
+
- **`ReadyToolbar` no longer takes `showCounts` or `onShowCountsChange`** (views 0.11). Show counts is the
|
|
164
|
+
view's own: it lives in `settings.showCounts`, and is on when that is absent.
|
|
165
|
+
|
|
166
|
+
```tsx
|
|
167
|
+
// before
|
|
168
|
+
<ReadyToolbar {...list} showCounts={showCounts} onShowCountsChange={setShowCounts} />
|
|
169
|
+
// after
|
|
170
|
+
<ReadyToolbar {...list} />
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
- **`ToolbarSlotState.appFrame` is required** (views 0.10). Code that builds a whole `ToolbarSlotState`
|
|
174
|
+
adds `appFrame: false`. A partial slot handed to `ToolbarSlotProvider` is unaffected.
|
|
175
|
+
- **`FieldSpec` no longer holds `avatar`** (0.20): `defineFields({ avatar })` stamps it. `checkFieldSpec`
|
|
176
|
+
takes `unknown` and asserts a `FieldSpec`, so casts before it can go.
|
|
177
|
+
- **Lists typed over every name grew.** A record or an exhaustive `switch` over one of these needs the new
|
|
178
|
+
members:
|
|
179
|
+
- `OptionalComponentName`: `SearchField` (views 0.10) and `LinksBody` (views 0.12).
|
|
180
|
+
- `ViewsBodyKind`: `links` (views 0.12).
|
|
181
|
+
- `ATOM_STATES`: `tab` and `current`. `ATOM_SLOTS`: `vk-toolbar-chevron`, `vk-quick-filters-reminder`,
|
|
182
|
+
`vk-quick-filters-reminder-open` and `vk-quick-filters-reminder-clear` (views 0.10).
|
|
183
|
+
- `ViewsMessageKey` and `FieldMessageKey`: the keys in step 11.
|
|
184
|
+
- The postgres `RefusalCode`: `too-big` (0.19), and `no-field-list`, `not-a-field-list` and `hidden-field`
|
|
185
|
+
(0.20).
|
|
186
|
+
- **Every postgres request names what it may read** (0.20). Without `readable`, a request is refused as
|
|
187
|
+
`no-field-list`. Set it on the server, after spreading the client's request, never from it.
|
|
188
|
+
|
|
189
|
+
```ts
|
|
190
|
+
// before
|
|
191
|
+
pageQuery({ map, access, sorts, size: 50 });
|
|
192
|
+
// after
|
|
193
|
+
pageQuery({ map, access, readable: EVERY_FIELD, sorts, size: 50 });
|
|
194
|
+
// or field by field:
|
|
195
|
+
pageQuery({ map, access, readable: { deals: ["title", "stage", "company"], companies: ["name"] }, sorts, size: 50 });
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
A field the reader may not read is refused as `hidden-field` wherever a request names it: a filter, a sort,
|
|
199
|
+
a group, a count, a figure, a search or the values. A derived field is readable only when everything it
|
|
200
|
+
reads is.
|
|
201
|
+
|
|
202
|
+
### 4. Check your definitions before you upgrade
|
|
203
|
+
|
|
204
|
+
A registry written in code that names a SQL function in a formula adds `allowSql: true` (0.20): `defineFields`
|
|
205
|
+
and `contributeFields` now refuse one without it, as `checkFieldSpec` already did for definitions read from data.
|
|
206
|
+
|
|
207
|
+
```ts
|
|
208
|
+
// before
|
|
209
|
+
defineFields({ entity: "campaign", identity: "name", fields: { lastReply: { type: "formula", rule: { sql: "app.last_reply" } } } });
|
|
210
|
+
// after
|
|
211
|
+
defineFields({ entity: "campaign", identity: "name", allowSql: true, fields: { lastReply: { type: "formula", rule: { sql: "app.last_reply" } } } });
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
Some definitions TypeScript accepts are refused when they load. Run `checkFieldSpec` over every definition
|
|
216
|
+
your app stores, before the upgrade reaches production:
|
|
217
|
+
|
|
218
|
+
- A key the type doesn't declare, a value of the wrong kind, a blank label or a missing required setting
|
|
219
|
+
throws `FieldDefinitionError` (0.20). So does an unknown closed word, in any case or with stray spaces
|
|
220
|
+
(fields 0.16).
|
|
221
|
+
- A `validation.pattern` outside ViewKit's dialect is refused (0.25): no lookahead or lookbehind, no
|
|
222
|
+
backreferences, no group flags, no lone `{`, `}` or `]`, and no unknown escapes; at most 500 characters.
|
|
223
|
+
`"a{"` becomes `"a\\{"`; a lookahead or a backreference becomes a check of your own.
|
|
224
|
+
|
|
225
|
+
### 5. Rebuild your search indexes
|
|
226
|
+
|
|
227
|
+
This release folds text more for a search and a text rule: ł is l, ß is ss, æ is ae, a ligature is its
|
|
228
|
+
letters. "lodz" finds Łódź, and "strasse" finds Straße. The folded expression `searchIndexes` prints changed
|
|
229
|
+
with it, and Postgres serves a search only from an index on the same expression. **Create each trigram index
|
|
230
|
+
`searchIndexes` prints now**, or a search reads every row. Keep the ones it printed before until the build that
|
|
231
|
+
folds the new way is live, then drop them.
|
|
232
|
+
|
|
233
|
+
If your map has a `pick`, `searchIndexes` has printed each index as partial (`WHERE <pick>`) since postgres
|
|
234
|
+
0.11. Create it with the `statistics` printed beside it, then `ANALYZE`: Postgres reads no statistics from a
|
|
235
|
+
partial index.
|
|
236
|
+
|
|
237
|
+
A map that names none of the shapes postgres 0.7 to 0.12 added needs no index beyond the ones `searchIndexes`
|
|
238
|
+
prints; the postgres changelog names the indexes each new shape asks for. Its SQL still changes where the
|
|
239
|
+
behaviour does (step 8): a search word of one or two letters, the fold, the negative rules and exact decimals.
|
|
240
|
+
|
|
241
|
+
### 6. Take the default controls
|
|
242
|
+
|
|
243
|
+
`CONTROLS` (from `viewkitjs/views/controls`) is ViewKit's own control for each slot of the components map an
|
|
244
|
+
app leaves out. Spread it first and your own after, so yours win:
|
|
245
|
+
|
|
246
|
+
```tsx
|
|
247
|
+
import { CONTROLS } from "viewkitjs/views/controls";
|
|
248
|
+
|
|
249
|
+
<ViewsProvider components={{ ...CONTROLS, ...ownComponents }} /* … */ />
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
It holds `Button`, `Tooltip`, `Popover`, `Sheet`, `Input`, `Checkbox` and `Menu`; the Text editor
|
|
253
|
+
(`TextBody`); the Picker (`Picker`, and `FieldsBody`, the sort's and the filter's field lists); the Date editor
|
|
254
|
+
(`DateBody`); the month the filter panel picks a day in (`Calendar`); and the Compound editor (`PartsBody`) for
|
|
255
|
+
a name, a place and a range. **An app that spreads it hands no `Calendar`:** the filter panel's date, its date
|
|
256
|
+
ranges and its custom time scope open ViewKit's own month. An app's own `Calendar` or `RangeCalendar` atom is
|
|
257
|
+
kept. You still hand `Collapse`, `AppIcon` and `Markdown`, and `Command` unless you set `menus: "menu"`: the
|
|
258
|
+
grid's + Add column and a group's menu search still draw through it. `CONTROL_ATOMS` (0.23) does the same for the atoms
|
|
259
|
+
(`Tag`, `StatusBadge`, `CellMore`): `atoms={{ ...CONTROL_ATOMS, ...ownAtoms }}`.
|
|
260
|
+
|
|
261
|
+
The controls' stylesheet is in `viewkitjs/views/styles.css` (step 9). An app that imports the controls'
|
|
262
|
+
stylesheets one by one instead imports `smooth.css` first, then each control's own, and now adds
|
|
263
|
+
`picker.css`, `text-editor.css`, `date-editor.css`, `compound-editor.css` and `flag.css`.
|
|
264
|
+
|
|
265
|
+
What an app meets when it moves from its own editors, or ViewKit's older ones, to these:
|
|
266
|
+
|
|
267
|
+
- **The Picker.** It now picks a select, a status, several options, a person, a record, and the sort's and
|
|
268
|
+
the filter's fields. Every list shows its search, and typing filters at once. A held value is listed
|
|
269
|
+
first, a status stands at its place, a select's options are drawn without their colour inside the list,
|
|
270
|
+
and a relation's fields open one level in. By default a row's second line stands below its name.
|
|
271
|
+
- **The Text editor.** Long text, and a line the cell cut off, edit in the cell rather than in a panel. A
|
|
272
|
+
phone number has its country, its dial code and its pattern, Tab walks the country and then the number, a
|
|
273
|
+
number typed again in another form saves nothing, and its extension is kept. One ⌘Z takes back the run just
|
|
274
|
+
typed, as a native box does.
|
|
275
|
+
- **The Date editor.** A day pressed on a date and time keeps the editor open for its time, and Enter saves.
|
|
276
|
+
No date stands among the quick picks in place of the Clear row. The time is typed in parts. A date that
|
|
277
|
+
can't be read says why instead of putting the old one back. A short date ("12/3") reads in this year, and
|
|
278
|
+
the week starts on Monday. Month and weekday names are written in `conventions.language`.
|
|
279
|
+
- **The Compound editor.** A name and a range open in a popover under the value, not in place. A name is
|
|
280
|
+
typed in First name and Last name. While the full name is hidden, a name of its own follows its parts once
|
|
281
|
+
one changes: "Dr. Ana Pérez" with First name changed to Eva saves as "Eva Pérez", where the older editor kept
|
|
282
|
+
"Dr. Ana Pérez". A place uses one order for every country (street, city, state and postal code, the country
|
|
283
|
+
last with its flag), its street is one box of several lines, and it has no Clear row: clear the boxes and
|
|
284
|
+
pick No country. A range's bands are a list under its ends.
|
|
285
|
+
|
|
286
|
+
The keys, Escape, Tab, the save and the grid's undo of a save are the same as before in each of them.
|
|
287
|
+
|
|
288
|
+
### 7. Hand in your phone line
|
|
289
|
+
|
|
290
|
+
The default controls take their phone form below the line your app hands `ViewsProvider` as `desktopQuery`,
|
|
291
|
+
where ViewKit's editors and sheets switch too. The default is `(min-width: 1024px)`, so **a screen narrower than
|
|
292
|
+
1024 px gets the phone form** unless you hand your own line. Hand the one your shell switches on:
|
|
293
|
+
|
|
294
|
+
```tsx
|
|
295
|
+
<ViewsProvider desktopQuery="(min-width: 768px)" /* … */ />
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
On a phone, every default control marks its root `data-vk-phone`, which the stylesheets read. Mark a box you
|
|
299
|
+
show as a phone's screen with it too. A control drawn outside `ViewsProvider` reads the 1024 px default unless
|
|
300
|
+
it sits in `PhoneLine.Provider`.
|
|
301
|
+
|
|
302
|
+
**A control drawn on the server shows its computer size on a phone until the page comes alive.** A server
|
|
303
|
+
can't ask the screen's width, so it draws the computer form, and the phone form takes over once the page
|
|
304
|
+
hydrates.
|
|
305
|
+
|
|
306
|
+
### 8. What changes with no change to your code
|
|
307
|
+
|
|
308
|
+
**Filters, sorts and search**
|
|
309
|
+
|
|
310
|
+
- A number's "is" and "is not" round where the grid rounds the value: a whole range end at 0 decimals, a
|
|
311
|
+
percent with no stated decimals at 0, and a rollup, formula or lookup at the decimals of the field it shows
|
|
312
|
+
(fields 0.17 and 0.18). State `format.decimals` to keep another rounding.
|
|
313
|
+
- Every negative rule keeps a record whose value is empty, for every type. "Amount is not 0" and "Stage is
|
|
314
|
+
not Won" both keep the record that has neither. "Is empty" asks for those records alone.
|
|
315
|
+
- A `storage: "decimal"` field filters and sorts exactly, past 2^53 too. A value that reads as no number
|
|
316
|
+
sorts as empty, last in either direction.
|
|
317
|
+
- Search and text rules fold more letters (step 5).
|
|
318
|
+
- Sorts once refused as `not-yet` are answered: several emails, links, domains and phones by their main value
|
|
319
|
+
(postgres 0.7), and a multiselect or tags (postgres 0.10).
|
|
320
|
+
- A request too large is refused as `too-big` before any SQL runs (0.19): more than 500 rules or groups, 32
|
|
321
|
+
levels, 50 search words or 30,000 bound values.
|
|
322
|
+
- A cursor from before postgres 0.10, on a select or status kept in a row of its own (`row`) and sorted alone,
|
|
323
|
+
is refused as `bad-cursor`, and the list starts from its first page. A select kept in a plain column is
|
|
324
|
+
untouched.
|
|
325
|
+
- `rootDomain("kawasaki.jp")` is `null` (0.19). Four type names changed (fields 0.16): Long text, Percent,
|
|
326
|
+
Member and Place.
|
|
327
|
+
|
|
328
|
+
**Cells and the grid**
|
|
329
|
+
|
|
330
|
+
- Several values in one cell show as many as fit, then "+N" (0.21). `severalValues: "first"` on
|
|
331
|
+
`ViewsProvider` keeps the old way.
|
|
332
|
+
- A cell's text that runs over ends in "…" (0.21).
|
|
333
|
+
- A column with no `width` fits its first values and its header, up to 320 px (0.23). A column with a width is
|
|
334
|
+
unchanged.
|
|
335
|
+
- The group count is a chip ViewKit draws (0.21), so CSS that dressed `vk-grid-group-count` can go.
|
|
336
|
+
- The default Tag is a pill (0.21). An app's own `Tag` atom is unchanged.
|
|
337
|
+
- A place cell offers a Clear row on a column that may be emptied (views 0.10).
|
|
338
|
+
|
|
339
|
+
**Toolbar and panels**
|
|
340
|
+
|
|
341
|
+
- Inside `ToolbarSlotProvider`, the views part and Save draw through your `ToolbarButton` (views 0.10).
|
|
342
|
+
`slot={{ appFrame: false }}` keeps the old way.
|
|
343
|
+
- Drag announcements come from your messages and name a row by its label (views 0.10).
|
|
344
|
+
- A dragging part draws still until dnd-kit has loaded, then mounts once more (views 0.10). A test that drags
|
|
345
|
+
calls `await loadPanelsDrag()` first.
|
|
346
|
+
|
|
347
|
+
### 9. Tune the look to your own sizes and colours
|
|
348
|
+
|
|
349
|
+
Two ways give ViewKit its look, as `views/docs/install.md` sets out:
|
|
350
|
+
|
|
351
|
+
- `@import "viewkitjs/views/styles.css";` (0.20) carries every part's look, the controls' included. You need
|
|
352
|
+
neither Tailwind nor `@source`. Declare any `--vk-*` name to change it.
|
|
353
|
+
- Or keep compiling the views part with your own Tailwind through `@source`. Then nothing declares the
|
|
354
|
+
`--vk-*` colours for you, and the mapping block on the install page is required.
|
|
355
|
+
|
|
356
|
+
Each control reads only `--vk-*` names, each with a default. The names, and the rule they follow, are in
|
|
357
|
+
`views/docs/contract.md` ("Tokens" and "The controls' tokens"); each control's own are on its page under
|
|
358
|
+
`views/docs/controls/`. To fit your app, declare the sizes, radii and colours you want after the stylesheet.
|
|
359
|
+
|
|
360
|
+
- **Colours.** The optional colours grew from 21 to 54 (0.21). Under `styles.css`, an app that sets only
|
|
361
|
+
`--vk-label-<hue>` also sets its `-fill`, `-edge` and `-strong`, or the pill keeps the Outright look's.
|
|
362
|
+
`CATEGORY_COLOR_CLASSES` now reads `--vk-label-<hue>-fill`, `-edge` and `-strong` (0.22).
|
|
363
|
+
- **Looks.** A look is a set of picks a frame wears as `data-<piece>-<option>="<value>"`, through
|
|
364
|
+
`viewkitjs/views/looks` (0.21); `views/docs/guides/looks.md` shows how. With nothing picked, a control wears
|
|
365
|
+
its defaults. The Sheet, the phone header, the Popover, the inline input and the Picker changed theirs in
|
|
366
|
+
0.22 to 0.26.
|
|
367
|
+
|
|
368
|
+
### 10. Tests your app may have pinned
|
|
369
|
+
|
|
370
|
+
- **Exact component, icon and port names.** The required component names are unchanged. The optional ones
|
|
371
|
+
gained `SearchField` and `LinksBody`. The icon names and the port names are unchanged. A test that compares
|
|
372
|
+
the whole list of optional names fails on the two new ones.
|
|
373
|
+
- **The test kit's case count** (`viewkitjs/fields/testing`). Counted on ViewKit's own memory backend, it went
|
|
374
|
+
from 1,028 cases at fields 0.15 to 1,039: 6 more filter cases and 5 more search cases. A count pinned on
|
|
375
|
+
your own backend moves by what it runs of these. Fields 0.17 names three of the new filter cases; a backend
|
|
376
|
+
that rounds at two decimals fails them.
|
|
377
|
+
- **Sorts asserted as `not-yet`.** A test expecting `not-yet` on a sort by several emails, links, domains or
|
|
378
|
+
phones, or by tags, now gets an answer (step 8). Still `not-yet`: a sort by a related record's field, and a
|
|
379
|
+
phone or an actor with no `sort` read and not several.
|
|
380
|
+
- **Class names.** The controls' class names (`o-*`) are not public and may change in any version. Match a
|
|
381
|
+
control by its role or by its `data-` marks, never by a class.
|
|
382
|
+
- **Words.** A test that matches ViewKit's English meets the words in step 11, the four type names, and the
|
|
383
|
+
drag announcements.
|
|
384
|
+
|
|
385
|
+
### 11. Word the new message keys
|
|
386
|
+
|
|
387
|
+
ViewKit writes every word it shows through a message, and ships its words in English only. An app that
|
|
388
|
+
speaks another language words these keys in its own catalog: views' through `ViewsProvider`'s `messages`,
|
|
389
|
+
fields' through the conventions' `messages`. `VIEWS_MESSAGE_KEYS` lists every views key, and
|
|
390
|
+
`FIELD_MESSAGE_KEYS` (new in this release) lists every fields key, so a test can check that your catalog
|
|
391
|
+
words each one in every language you ship. No key was removed or renamed since views 0.9 and fields 0.15.
|
|
392
|
+
|
|
393
|
+
Every word the default controls draw is a message, so an app whose catalog words every key sees no English
|
|
394
|
+
from them. The one exception is Base UI's own: its combobox carries a hidden "Dismiss" button for screen
|
|
395
|
+
readers, which ViewKit can't word.
|
|
396
|
+
|
|
397
|
+
Four keys kept their names and changed their English, so the older editors and a field's part rows say
|
|
398
|
+
what the new editors say:
|
|
399
|
+
|
|
400
|
+
| Key | Was | Is |
|
|
401
|
+
| --- | --- | --- |
|
|
402
|
+
| `views.editors.name-given` | Given name | First name |
|
|
403
|
+
| `views.editors.name-family` | Family name | Last name |
|
|
404
|
+
| `views.editors.place-country-search` | Search countries | Search for a country |
|
|
405
|
+
| `type.label` (fields 0.16) | Rich text, Percentage, User, Location | Long text, Percent, Member, Place |
|
|
406
|
+
|
|
407
|
+
The keys added since views 0.9 and fields 0.15, with their English. A word in braces is a value ViewKit hands
|
|
408
|
+
the message.
|
|
409
|
+
|
|
410
|
+
The Compound editor, the Menu and the number box (`CONTROLS.PartsBody`, `CONTROLS.Menu`):
|
|
411
|
+
|
|
412
|
+
| Key | English |
|
|
413
|
+
| --- | --- |
|
|
414
|
+
| `views.editors.name-shown-as` | Shown as |
|
|
415
|
+
| `views.editors.name-follows` | Follows the first and last name. Type here to give it one of its own. |
|
|
416
|
+
| `views.editors.name-own` | Its own. Clear it to follow the first and last name again. |
|
|
417
|
+
| `views.editors.name-own-mark` | Its own |
|
|
418
|
+
| `views.editors.place-no-country` | No country |
|
|
419
|
+
| `views.editors.place-pick` | Select… |
|
|
420
|
+
| `views.editors.place-search-for-region` | Search for a {region} (the region's word, lowercased) |
|
|
421
|
+
| `views.editors.place-no-region` | No {region} (the region's word, lowercased) |
|
|
422
|
+
| `views.editors.place-find-country` | Find a country |
|
|
423
|
+
| `views.editors.place-find-region` | Find a {region} (the region's word, lowercased) |
|
|
424
|
+
| `views.editors.place-choose-country` | Choose a country |
|
|
425
|
+
| `views.editors.place-choose-region` | Choose a {region} (the region's word, lowercased) |
|
|
426
|
+
| `views.editors.place-street` | Street address |
|
|
427
|
+
| `views.editors.place-street-number` | Street and number |
|
|
428
|
+
| `views.editors.place-street-short` | Street |
|
|
429
|
+
| `views.editors.place-line2-plain` | Line 2 |
|
|
430
|
+
| `views.editors.place-postcode` | Postcode |
|
|
431
|
+
| `views.editors.number-increase` | Increase |
|
|
432
|
+
| `views.editors.number-decrease` | Decrease |
|
|
433
|
+
| `views.editors.number-field` | Number field |
|
|
434
|
+
| `views.menus.not-now` | Not now |
|
|
435
|
+
|
|
436
|
+
The Picker (`CONTROLS.Picker`, `CONTROLS.FieldsBody`):
|
|
437
|
+
|
|
438
|
+
| Key | English |
|
|
439
|
+
| --- | --- |
|
|
440
|
+
| `views.picker.searching` | Searching… |
|
|
441
|
+
| `views.picker.failed` | Couldn't search. |
|
|
442
|
+
| `views.picker.failed-line` | Check the connection and try again. |
|
|
443
|
+
| `views.picker.retry` | Try again |
|
|
444
|
+
| `views.picker.none-typed` | Nothing matches “{typed}”. |
|
|
445
|
+
| `views.picker.nothing-matches` | Nothing matches. |
|
|
446
|
+
| `views.picker.create` | Create “{typed}” |
|
|
447
|
+
| `views.picker.create-button` | Create |
|
|
448
|
+
| `views.picker.loading-more` | Loading more… |
|
|
449
|
+
| `views.picker.chosen` | {count} chosen |
|
|
450
|
+
| `views.picker.clear-all` | Clear all |
|
|
451
|
+
| `views.picker.selected` | Selected |
|
|
452
|
+
| `views.picker.selected-count` | Selected · {count} |
|
|
453
|
+
| `views.picker.selected-fixed` | Selected · can't be empty |
|
|
454
|
+
| `views.picker.cancel` | Cancel |
|
|
455
|
+
| `views.picker.save` | Save |
|
|
456
|
+
| `views.picker.type-to-search` | Type to look one up. |
|
|
457
|
+
| `views.picker.actions` | Actions |
|
|
458
|
+
| `views.picker.back` | Back to {label} |
|
|
459
|
+
| `views.picker.row-actions` | Actions for {label} |
|
|
460
|
+
| `views.picker.you` | you |
|
|
461
|
+
|
|
462
|
+
Adding an option to a select:
|
|
463
|
+
|
|
464
|
+
| Key | English |
|
|
465
|
+
| --- | --- |
|
|
466
|
+
| `views.editors.add-option` | Add “{value}” |
|
|
467
|
+
| `views.editors.adding-option` | Adding “{value}”… |
|
|
468
|
+
| `views.editors.add-failed` | Couldn't add “{value}” |
|
|
469
|
+
| `views.editors.add-not-listed` | Added “{value}”, but the list hasn't shown it yet |
|
|
470
|
+
|
|
471
|
+
The panels: quick filters, set-aside rules, dragging:
|
|
472
|
+
|
|
473
|
+
| Key | English |
|
|
474
|
+
| --- | --- |
|
|
475
|
+
| `views.panels.quick-reminder` | Quick filters: {names} |
|
|
476
|
+
| `views.panels.quick-more` | +{count} |
|
|
477
|
+
| `views.panels.quick-clear` | Clear quick filters |
|
|
478
|
+
| `views.panels.filter-set-aside-back` | Set aside: its field is back in this list, and Put back filters by it again |
|
|
479
|
+
| `views.panels.sort-set-aside-back` | Set aside: its field is back in this list, and Put back sorts by it again |
|
|
480
|
+
| `views.panels.drag-instructions` | To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel. |
|
|
481
|
+
| `views.panels.drag-picked-up` | Picked up draggable item {label}. |
|
|
482
|
+
| `views.panels.drag-over` | Draggable item {label} was moved over droppable area {over}. |
|
|
483
|
+
| `views.panels.drag-not-over` | Draggable item {label} is no longer over a droppable area. |
|
|
484
|
+
| `views.panels.drag-dropped-over` | Draggable item {label} was dropped over droppable area {over} |
|
|
485
|
+
| `views.panels.drag-dropped` | Draggable item {label} was dropped. |
|
|
486
|
+
| `views.panels.drag-cancelled` | Dragging was cancelled. Draggable item {label} was dropped. |
|
|
487
|
+
|
|
488
|
+
`viewkitjs/fields` (the conventions' `messages`):
|
|
489
|
+
|
|
490
|
+
| Key | English |
|
|
491
|
+
| --- | --- |
|
|
492
|
+
| `setting.label` | The name of a setting a New field dialog offers, by `{ type, path }`: Default value, Fewest characters, Most characters, Pattern it must match, Stored as, Decimals shown, Currency and the rest |
|
|
493
|
+
| `setting.word` | One word a word setting offers, by `{ type, path, word }`: Exact decimal, Up is good, Trim spaces, One record and the rest |
|
|
494
|
+
| `date.type` | Type a date |
|
|
495
|
+
| `date.none` | No date |
|
|
496
|
+
| `date.add-time` | Add time |
|
|
497
|
+
| `date.last-month` | Last month |
|
|
498
|
+
| `date.next-month` | Next month |
|
|
499
|
+
| `date.day` | Day |
|
|
500
|
+
| `date.month` | Month |
|
|
501
|
+
| `date.year` | Year |
|
|
502
|
+
| `date.months` | Months |
|
|
503
|
+
| `date.years` | Years |
|
|
504
|
+
| `time.hour` | Hour |
|
|
505
|
+
| `time.minute` | Minute |
|
|
506
|
+
| `date.not-a-date` | That isn't a date. Write a day and a month: 12/11 |
|
|
507
|
+
| `date.no-such-day` | {month} has no {day, as an ordinal}. Write a day and a month: 12/11 |
|
|
508
|
+
| `field.must-tick` | This box must be ticked |
|
|
509
|
+
|
|
510
|
+
### Check you're done with this part
|
|
511
|
+
|
|
512
|
+
- Your catalogs word every key in `VIEWS_MESSAGE_KEYS` and `FIELD_MESSAGE_KEYS`, in every language you ship.
|
|
513
|
+
- `searchIndexes` printed today's indexes, and the database holds them.
|
|
514
|
+
- `checkFieldSpec` accepts every definition you store.
|
|
515
|
+
- Every postgres request on your server names `readable`.
|
|
516
|
+
- `git grep -n "@viewkitjs/"` finds nothing (above).
|
package/fields/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type * from "./types.js";
|
|
2
2
|
export type * from "./messages.js";
|
|
3
|
-
export { resolveFieldMessage } from "./messages.js";
|
|
3
|
+
export { FIELD_MESSAGE_KEYS, resolveFieldMessage } from "./messages.js";
|
|
4
4
|
export { DEFAULT_CONVENTIONS, defineConventions, FieldConventionsError, type ConventionsInput, type ConventionsOverrides, type DecimalSeparator, type FieldConventions, } from "./conventions.js";
|
|
5
5
|
export { classifyFieldSaveResult, type FieldSaveClassification, type FieldSaveResult, type FieldSettlement, } from "./write-result.js";
|
|
6
6
|
export { requestedSettlementTitle } from "./settlement.js";
|
package/fields/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { resolveFieldMessage } from "./messages.js";
|
|
1
|
+
export { FIELD_MESSAGE_KEYS, resolveFieldMessage } from "./messages.js";
|
|
2
2
|
export { DEFAULT_CONVENTIONS, defineConventions, FieldConventionsError, } from "./conventions.js";
|
|
3
3
|
export { classifyFieldSaveResult, } from "./write-result.js";
|
|
4
4
|
export { requestedSettlementTitle } from "./settlement.js";
|
|
@@ -430,5 +430,7 @@ export type FieldMessage = {
|
|
|
430
430
|
};
|
|
431
431
|
export type FieldMessageKey = FieldMessage["key"];
|
|
432
432
|
export type FieldMessageResolver = (message: FieldMessage) => string;
|
|
433
|
+
/** Every key a host words, once: a host tests that its catalog holds each (`VIEWS_MESSAGE_KEYS` is the views part's). */
|
|
434
|
+
export declare const FIELD_MESSAGE_KEYS: readonly ["lock.system", "lock.provider", "lock.create", "lock.never", "derived.formula", "derived.lookup", "derived.count", "derived.rollup", "derived.exists", "derived.none", "settlement.requested", "provider.name", "type.label", "setting.label", "setting.word", "field.cannot-empty", "field.must-tick", "field.cannot-edit", "field.cannot-save", "field.retry-save", "field.stored-value-required", "field.history-unavailable", "field.restore-refused", "field.already-saving", "field.unavailable", "field.derived", "editor.search", "editor.searching", "editor.search-failed", "editor.loading-more", "editor.nothing-matches", "editor.use-value", "relation.none", "relation.lead", "relation.make-lead", "date.placeholder", "date.label", "date.today", "date.tomorrow", "date.next-monday", "date.in-a-week", "date.clear", "time.placeholder", "time.label", "date.type", "date.none", "date.add-time", "date.last-month", "date.next-month", "date.day", "date.month", "date.year", "date.months", "date.years", "time.hour", "time.minute", "date.not-a-date", "date.no-such-day", "chips.add-placeholder", "chips.everything-picked", "chips.add", "validation.invalid", "validation.text", "validation.number", "validation.integer", "validation.date", "validation.datetime", "validation.boolean", "validation.option", "validation.options-list", "validation.values-list", "validation.relation", "validation.url", "validation.domain", "validation.email", "validation.email-list", "validation.unit", "validation.phone", "validation.phone-country", "validation.phone-short", "validation.phone-long", "validation.phone-whole", "validation.user", "validation.location", "validation.country-code", "validation.region-code", "validation.name", "validation.actor", "actor.type", "validation.range-order", "range.up-to", "range.and-up", "validation.pattern", "validation.tag-empty", "validation.max-length", "validation.min-length", "validation.min", "validation.max", "validation.greater-than", "validation.less-than", "validation.decimals", "validation.max-items", "validation.max-addresses", "validation.one-main", "validation.duplicate-value", "save.failed", "save.refresh-failed", "filter.any", "filter.operator", "filter.text-summary", "filter.date-summary", "filter.relative", "filter.relative-direction", "filter.relative-unit", "group.none", "group.relative", "group.due", "group.week-of", "time.never", "time.future", "time.ago", "platform.website"];
|
|
433
435
|
/** Neutral English fallback for hosts that do not provide localization. */
|
|
434
436
|
export declare const resolveFieldMessage: FieldMessageResolver;
|