@chelone/core 0.1.1 → 0.3.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/dist/controller/calendar-events.js +5 -8
- package/dist/controller/client-list-controller.js +4 -13
- package/dist/controller/record-tree.js +2 -5
- package/dist/controller/record-workflow.d.ts +27 -11
- package/dist/controller/record-workflow.js +5 -1
- package/dist/data/cache-ops.d.ts +8 -0
- package/dist/data/cache-ops.js +80 -0
- package/dist/data/mutation-options.d.ts +5 -1
- package/dist/data/mutation-options.js +33 -3
- package/dist/form/array-binding.d.ts +4 -3
- package/dist/form/input-binding.d.ts +6 -4
- package/dist/form/source.d.ts +22 -4
- package/dist/form/source.js +32 -2
- package/dist/i18n/english-messages.d.ts +250 -0
- package/dist/i18n/english-messages.js +193 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/resource/get-at-path.d.ts +18 -0
- package/dist/resource/get-at-path.js +16 -0
- package/dist/resource/register.d.ts +26 -0
- package/dist/resource/registry.d.ts +16 -1
- package/dist/resource/source-path.d.ts +114 -0
- package/package.json +4 -1
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The English catalog an `<Admin>` with no `i18n` prop reads from, and the base
|
|
3
|
+
* an app extends: spread it, then add or override entries.
|
|
4
|
+
*
|
|
5
|
+
* The ported shadcn components translate `ra.*` keys (the react-admin namespace
|
|
6
|
+
* they were ported from): page titles, list pagination, the bulk-action bar,
|
|
7
|
+
* menu a11y labels, boolean fields. Chelone's i18n never throws on a missing key
|
|
8
|
+
* (it returns the key or a `_` fallback), so a partial catalog shows raw
|
|
9
|
+
* `ra.page.list`-style keys.
|
|
10
|
+
*
|
|
11
|
+
* Interpolation is single-brace `{name}` (not react-admin's `%{name}`). Plural
|
|
12
|
+
* strings are `{ one, other }` objects keyed by Intl.PluralRules categories
|
|
13
|
+
* (react-admin's `a |||| b` form).
|
|
14
|
+
*
|
|
15
|
+
* `defaultMessages` (the `chelone.*` keys the core controllers emit) and
|
|
16
|
+
* `mapMessages` (the maps add-on's labels) sit underneath.
|
|
17
|
+
*/
|
|
18
|
+
export declare const englishMessages: {
|
|
19
|
+
readonly "ra.page.list": "{name}";
|
|
20
|
+
readonly "ra.page.create": "Create {name}";
|
|
21
|
+
readonly "ra.page.edit": "{name} {recordRepresentation}";
|
|
22
|
+
readonly "ra.page.show": "{name} {recordRepresentation}";
|
|
23
|
+
readonly "ra.page.dashboard": "Dashboard";
|
|
24
|
+
readonly "ra.page.error": "Something went wrong";
|
|
25
|
+
readonly "ra.page.not_found": "Not Found";
|
|
26
|
+
readonly "ra.page.loading": "Loading";
|
|
27
|
+
readonly "ra.page.empty": "No {name} yet.";
|
|
28
|
+
readonly "ra.page.access_denied": "Access denied";
|
|
29
|
+
readonly "ra.page.authentication_error": "Authentication error";
|
|
30
|
+
readonly "ra.action.add": "Add";
|
|
31
|
+
readonly "ra.action.add_filter": "Add filter";
|
|
32
|
+
readonly "ra.action.bulk_actions": {
|
|
33
|
+
readonly one: "1 item selected";
|
|
34
|
+
readonly other: "{count} items selected";
|
|
35
|
+
};
|
|
36
|
+
readonly "ra.action.cancel": "Cancel";
|
|
37
|
+
readonly "ra.action.clear_input_value": "Clear value";
|
|
38
|
+
readonly "ra.action.clear_search": "Clear search";
|
|
39
|
+
readonly "ra.action.close": "Close";
|
|
40
|
+
readonly "ra.action.close_menu": "Close menu";
|
|
41
|
+
readonly "ra.action.confirm": "Confirm";
|
|
42
|
+
readonly "ra.action.create": "Create";
|
|
43
|
+
readonly "ra.action.delete": "Delete";
|
|
44
|
+
readonly "ra.action.edit": "Edit";
|
|
45
|
+
readonly "ra.action.export": "Export";
|
|
46
|
+
readonly "ra.action.list": "List";
|
|
47
|
+
readonly "ra.action.open_menu": "Open menu";
|
|
48
|
+
readonly "ra.action.refresh": "Refresh";
|
|
49
|
+
readonly "ra.action.remove": "Remove";
|
|
50
|
+
readonly "ra.action.remove_filter": "Remove this filter";
|
|
51
|
+
readonly "ra.action.save": "Save";
|
|
52
|
+
readonly "ra.action.search": "Search";
|
|
53
|
+
readonly "ra.action.select_all": "Select all";
|
|
54
|
+
readonly "ra.action.select_row": "Select this row";
|
|
55
|
+
readonly "ra.action.show": "Show";
|
|
56
|
+
readonly "ra.action.sort": "Sort";
|
|
57
|
+
readonly "ra.action.toggle_theme": "Toggle light/dark mode";
|
|
58
|
+
readonly "ra.action.undo": "Undo";
|
|
59
|
+
readonly "ra.action.unselect": "Unselect";
|
|
60
|
+
readonly "ra.action.update": "Update";
|
|
61
|
+
readonly "ra.boolean.true": "Yes";
|
|
62
|
+
readonly "ra.boolean.false": "No";
|
|
63
|
+
readonly "ra.boolean.null": " ";
|
|
64
|
+
readonly "ra.auth.logout": "Logout";
|
|
65
|
+
readonly "ra.auth.sign_in": "Sign in";
|
|
66
|
+
readonly "ra.auth.sign_in_error": "Authentication failed, please retry";
|
|
67
|
+
readonly "ra.auth.user_menu": "Profile";
|
|
68
|
+
readonly "ra.auth.username": "Username";
|
|
69
|
+
readonly "ra.auth.password": "Password";
|
|
70
|
+
readonly "ra.auth.auth_check_error": "Please login to continue";
|
|
71
|
+
readonly "ra.message.access_denied": "You don't have the right permissions to access this page";
|
|
72
|
+
readonly "ra.message.auth_error": "An error occurred while validating the authentication token.";
|
|
73
|
+
readonly "ra.message.authentication_error": "The authentication server returned an error and your credentials could not be checked.";
|
|
74
|
+
readonly "ra.message.error": "A client error occurred and your request couldn't be completed.";
|
|
75
|
+
readonly "ra.message.invalid_form": "The form is not valid. Please check for errors";
|
|
76
|
+
readonly "ra.message.loading": "Please wait";
|
|
77
|
+
readonly "ra.message.not_found": "Either you typed a wrong URL, or you followed a bad link.";
|
|
78
|
+
readonly "ra.navigation.next": "Go to next page";
|
|
79
|
+
readonly "ra.navigation.previous": "Go to previous page";
|
|
80
|
+
readonly "ra.navigation.first": "Go to first page";
|
|
81
|
+
readonly "ra.navigation.last": "Go to last page";
|
|
82
|
+
readonly "ra.navigation.no_results": "No results found";
|
|
83
|
+
readonly "ra.navigation.no_filtered_results": "No results found with the current filters.";
|
|
84
|
+
readonly "ra.navigation.page_range_info": "{offsetBegin}-{offsetEnd} of {total}";
|
|
85
|
+
readonly "ra.navigation.partial_page_range_info": "{offsetBegin}-{offsetEnd} of more than {offsetEnd}";
|
|
86
|
+
readonly "ra.navigation.page_rows_per_page": "Rows per page:";
|
|
87
|
+
readonly "ra.navigation.current_page": "Page {page}";
|
|
88
|
+
readonly "ra.navigation.skip_nav": "Skip to content";
|
|
89
|
+
readonly "ra.input.file.upload_several": "Drop some files to upload, or click to select one.";
|
|
90
|
+
readonly "ra.input.file.upload_single": "Drop a file to upload, or click to select it.";
|
|
91
|
+
readonly "ra.input.image.upload_several": "Drop some pictures to upload, or click to select one.";
|
|
92
|
+
readonly "ra.input.image.upload_single": "Drop a picture to upload, or click to select it.";
|
|
93
|
+
readonly "ra.input.password.toggle_visible": "Hide password";
|
|
94
|
+
readonly "ra.input.password.toggle_hidden": "Show password";
|
|
95
|
+
readonly "ra.theme.light": "Light";
|
|
96
|
+
readonly "ra.theme.dark": "Dark";
|
|
97
|
+
readonly "ra.theme.system": "System";
|
|
98
|
+
readonly "ra.validation.required": "Required";
|
|
99
|
+
readonly "ra.validation.minLength": "Must be {min} characters at least";
|
|
100
|
+
readonly "ra.validation.maxLength": "Must be {max} characters or less";
|
|
101
|
+
readonly "ra.validation.minValue": "Must be at least {min}";
|
|
102
|
+
readonly "ra.validation.maxValue": "Must be {max} or less";
|
|
103
|
+
readonly "ra.validation.number": "Must be a number";
|
|
104
|
+
readonly "ra.validation.email": "Must be a valid email";
|
|
105
|
+
readonly "ra.action.back": "Back";
|
|
106
|
+
readonly "ra.action.bulk_edit_apply": {
|
|
107
|
+
readonly one: "Apply to 1 record";
|
|
108
|
+
readonly other: "Apply to {count} records";
|
|
109
|
+
};
|
|
110
|
+
readonly "ra.action.change_locale": "Change locale";
|
|
111
|
+
readonly "ra.action.clear_array_input": "Clear the array";
|
|
112
|
+
readonly "ra.action.clone": "Clone";
|
|
113
|
+
readonly "ra.action.collapse": "Collapse";
|
|
114
|
+
readonly "ra.action.expand": "Expand";
|
|
115
|
+
readonly "ra.action.move_column_down": "Move down";
|
|
116
|
+
readonly "ra.action.move_column_up": "Move up";
|
|
117
|
+
readonly "ra.action.move_down": "Move down";
|
|
118
|
+
readonly "ra.action.move_up": "Move up";
|
|
119
|
+
readonly "ra.action.reload": "Reload";
|
|
120
|
+
readonly "ra.action.remove_all_filters": "Remove all filters";
|
|
121
|
+
readonly "ra.action.reset": "Reset";
|
|
122
|
+
readonly "ra.action.reset_columns": "Reset";
|
|
123
|
+
readonly "ra.action.search_columns": "Search columns";
|
|
124
|
+
readonly "ra.action.select_columns": "Columns";
|
|
125
|
+
readonly "ra.auth.or": "or";
|
|
126
|
+
readonly "ra.calendar.agenda": "Agenda";
|
|
127
|
+
readonly "ra.calendar.month": "Month";
|
|
128
|
+
readonly "ra.calendar.week": "Week";
|
|
129
|
+
readonly "ra.calendar.next": "Next";
|
|
130
|
+
readonly "ra.calendar.previous": "Previous";
|
|
131
|
+
readonly "ra.calendar.today": "Today";
|
|
132
|
+
readonly "ra.calendar.view": "View";
|
|
133
|
+
readonly "ra.calendar.no_events": "No events";
|
|
134
|
+
readonly "ra.csv_import.back": "Back";
|
|
135
|
+
readonly "ra.csv_import.close": "Close";
|
|
136
|
+
readonly "ra.csv_import.complete": "Import complete";
|
|
137
|
+
readonly "ra.csv_import.counts": "{created} created · {failed} failed · {total} total";
|
|
138
|
+
readonly "ra.csv_import.download_errors": "Download error report";
|
|
139
|
+
readonly "ra.csv_import.drop": "Drop a CSV file here, or click to choose one";
|
|
140
|
+
readonly "ra.csv_import.import": "Import";
|
|
141
|
+
readonly "ra.csv_import.issues": "Issues";
|
|
142
|
+
readonly "ra.csv_import.next": "Next";
|
|
143
|
+
readonly "ra.csv_import.not_utf8": "This file is not UTF-8, so some letters may be wrong. Save it as CSV UTF-8 and try again.";
|
|
144
|
+
readonly "ra.csv_import.preview_summary": "{valid} valid · {errors} errors · {total} total";
|
|
145
|
+
readonly "ra.csv_import.required_unmapped": "Required fields are not mapped";
|
|
146
|
+
readonly "ra.csv_import.rows_parsed": "{count} rows parsed";
|
|
147
|
+
readonly "ra.csv_import.step.commit": "Importing";
|
|
148
|
+
readonly "ra.csv_import.step.map": "Map columns";
|
|
149
|
+
readonly "ra.csv_import.step.preview": "Preview";
|
|
150
|
+
readonly "ra.csv_import.step.upload": "Upload";
|
|
151
|
+
readonly "ra.csv_import.unmapped": "Not mapped";
|
|
152
|
+
readonly "ra.csv_import.wrong_file": "Choose a .csv file";
|
|
153
|
+
readonly "ra.message.bulk_delete_content": {
|
|
154
|
+
readonly one: "Are you sure you want to delete this item?";
|
|
155
|
+
readonly other: "Are you sure you want to delete these {count} items?";
|
|
156
|
+
};
|
|
157
|
+
readonly "ra.message.bulk_delete_title": {
|
|
158
|
+
readonly one: "Delete 1 item";
|
|
159
|
+
readonly other: "Delete {count} items";
|
|
160
|
+
};
|
|
161
|
+
readonly "ra.message.bulk_edit_description": {
|
|
162
|
+
readonly one: "Only the fields you change are applied to the selected record.";
|
|
163
|
+
readonly other: "Only the fields you change are applied to the {count} selected records.";
|
|
164
|
+
};
|
|
165
|
+
readonly "ra.message.bulk_edit_nested_source": "Bulk edit takes flat sources only, but {source} is nested.";
|
|
166
|
+
readonly "ra.message.bulk_update_content": {
|
|
167
|
+
readonly one: "Are you sure you want to update this item?";
|
|
168
|
+
readonly other: "Are you sure you want to update these {count} items?";
|
|
169
|
+
};
|
|
170
|
+
readonly "ra.message.bulk_update_title": {
|
|
171
|
+
readonly one: "Update 1 item";
|
|
172
|
+
readonly other: "Update {count} items";
|
|
173
|
+
};
|
|
174
|
+
readonly "ra.message.clear_array_input": "Are you sure you want to clear the whole array?";
|
|
175
|
+
readonly "ra.message.delete_content": "Are you sure you want to delete this item?";
|
|
176
|
+
readonly "ra.message.delete_title": "Delete {name} {recordRepresentation}";
|
|
177
|
+
readonly "ra.navigation.clear_filters": "Clear filters";
|
|
178
|
+
readonly "ra.notification.application_update_available": "A new version of the application is available";
|
|
179
|
+
readonly "ra.notification.http_error": "Error";
|
|
180
|
+
readonly "ra.notification.offline": "You are offline";
|
|
181
|
+
readonly "ra.saved_queries.new_label": "Save current query";
|
|
182
|
+
readonly "ra.saved_queries.query_name": "Query name";
|
|
183
|
+
readonly "ra.saved_queries.remove_label_with_name": "Remove saved query \"{name}\"";
|
|
184
|
+
readonly "chelone.map.load_failed": "The map could not be loaded";
|
|
185
|
+
readonly "chelone.map.no_coordinates": "No coordinates";
|
|
186
|
+
readonly "chelone.map.no_geometry": "No geometry";
|
|
187
|
+
readonly "chelone.map.shape_not_shown": "Part of this shape cannot be shown on the map";
|
|
188
|
+
readonly "chelone.map.snap_failed": "The line could not be snapped to roads";
|
|
189
|
+
readonly "chelone.map.toolbar": "Map tools";
|
|
190
|
+
readonly "chelone.map.tool.draw_point": "Draw a point";
|
|
191
|
+
readonly "chelone.map.tool.draw_line": "Draw a line";
|
|
192
|
+
readonly "chelone.map.tool.draw_polygon": "Draw a polygon";
|
|
193
|
+
readonly "chelone.map.tool.draw_rectangle": "Draw a rectangle";
|
|
194
|
+
readonly "chelone.map.tool.draw_circle": "Draw a circle";
|
|
195
|
+
readonly "chelone.map.tool.edit": "Edit";
|
|
196
|
+
readonly "chelone.map.tool.move": "Move";
|
|
197
|
+
readonly "chelone.map.tool.delete": "Delete";
|
|
198
|
+
readonly "chelone.map.tool.cut": "Cut a hole";
|
|
199
|
+
readonly "chelone.map.search_placeholder": "Search for a place";
|
|
200
|
+
readonly "chelone.map.search_button": "Search";
|
|
201
|
+
readonly "chelone.map.searching": "Searching...";
|
|
202
|
+
readonly "chelone.map.no_results": "No results";
|
|
203
|
+
readonly "chelone.map.search_failed": "The search failed, try again shortly";
|
|
204
|
+
readonly "chelone.map.simplify.tolerance": "Tolerance: {value}";
|
|
205
|
+
readonly "chelone.map.simplify.default": "Default";
|
|
206
|
+
readonly "chelone.map.simplify.high": "High";
|
|
207
|
+
readonly "chelone.map.osm.subtract": "Subtract OpenStreetMap areas";
|
|
208
|
+
readonly "chelone.map.osm.add": "Add OpenStreetMap areas";
|
|
209
|
+
readonly "chelone.map.osm.no_sources": "No OpenStreetMap sources configured";
|
|
210
|
+
readonly "chelone.map.osm.no_polygon": "Draw a polygon first";
|
|
211
|
+
readonly "chelone.map.osm.no_match": "No matching OpenStreetMap area found";
|
|
212
|
+
readonly "chelone.map.osm.covered": "The polygon is already covered";
|
|
213
|
+
readonly "chelone.map.osm.subtracted": "Subtracted {area}";
|
|
214
|
+
readonly "chelone.map.osm.added": "Added {area}";
|
|
215
|
+
readonly "chelone.map.osm.would_split": "The result has more than one piece, so the polygon was left as it was";
|
|
216
|
+
readonly "chelone.map.osm.union_empty": "The union is empty";
|
|
217
|
+
readonly "chelone.map.osm.error": "OpenStreetMap request failed";
|
|
218
|
+
readonly "chelone.map.osm.rate_limited": "OpenStreetMap is rate limiting requests, try again shortly";
|
|
219
|
+
readonly "chelone.validation.latitude": "Must be a latitude between -90 and 90";
|
|
220
|
+
readonly "chelone.validation.longitude": "Must be a longitude between -180 and 180";
|
|
221
|
+
readonly "chelone.validation.minVertices": "Must have at least {min} vertices";
|
|
222
|
+
readonly "chelone.validation.maxVertices": "Must have {max} vertices or fewer";
|
|
223
|
+
readonly "chelone.validation.minArea": "Area {area} is below the minimum of {min}";
|
|
224
|
+
readonly "chelone.validation.selfIntersection": "Must not cross itself";
|
|
225
|
+
readonly "chelone.auth.auth_check_error": "Please login to continue";
|
|
226
|
+
readonly "chelone.auth.logout": "Logout";
|
|
227
|
+
readonly "chelone.message.access_denied": "You don't have access to this page";
|
|
228
|
+
readonly "chelone.message.authentication_error": "The authentication server returned an error";
|
|
229
|
+
readonly "chelone.message.invalid_form": "The form is not valid. Please check for errors";
|
|
230
|
+
readonly "chelone.message.loading": "The page is loading, just a moment please";
|
|
231
|
+
readonly "chelone.message.not_found": "Either you typed a wrong URL, or you followed a bad link.";
|
|
232
|
+
readonly "chelone.message.select_all_limit_reached": "There are too many elements to select them all. Only the first {max} elements were selected";
|
|
233
|
+
readonly "chelone.message.unsaved_changes": "Some of your changes weren't saved. Are you sure you want to ignore them?";
|
|
234
|
+
readonly "chelone.notification.created": "Element created";
|
|
235
|
+
readonly "chelone.notification.deleted": "Element deleted";
|
|
236
|
+
readonly "chelone.notification.http_error": "Server communication error";
|
|
237
|
+
readonly "chelone.notification.item_doesnt_exist": "Element does not exist";
|
|
238
|
+
readonly "chelone.notification.logged_out": "Your session has ended, please reconnect";
|
|
239
|
+
readonly "chelone.notification.not_authorized": "You are not authorized to access this resource";
|
|
240
|
+
readonly "chelone.notification.updated": "Element updated";
|
|
241
|
+
readonly "chelone.validation.email": "Must be a valid email";
|
|
242
|
+
readonly "chelone.validation.maxLength": "Must be {max} characters or less";
|
|
243
|
+
readonly "chelone.validation.maxValue": "Must be {max} or less";
|
|
244
|
+
readonly "chelone.validation.minLength": "Must be {min} characters at least";
|
|
245
|
+
readonly "chelone.validation.minValue": "Must be at least {min}";
|
|
246
|
+
readonly "chelone.validation.number": "Must be a number";
|
|
247
|
+
readonly "chelone.validation.oneOf": "Must be one of: {options}";
|
|
248
|
+
readonly "chelone.validation.regex": "Must match a specific format (regexp): {pattern}";
|
|
249
|
+
readonly "chelone.validation.required": "Required";
|
|
250
|
+
};
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { mapMessages } from "../geo/messages.js";
|
|
2
|
+
import { defaultMessages } from "./default-messages.js";
|
|
3
|
+
import { defineMessages } from "./messages.js";
|
|
4
|
+
const englishMessages = defineMessages({
|
|
5
|
+
...defaultMessages,
|
|
6
|
+
...mapMessages,
|
|
7
|
+
// Pages
|
|
8
|
+
"ra.page.list": "{name}",
|
|
9
|
+
"ra.page.create": "Create {name}",
|
|
10
|
+
"ra.page.edit": "{name} {recordRepresentation}",
|
|
11
|
+
"ra.page.show": "{name} {recordRepresentation}",
|
|
12
|
+
"ra.page.dashboard": "Dashboard",
|
|
13
|
+
"ra.page.error": "Something went wrong",
|
|
14
|
+
"ra.page.not_found": "Not Found",
|
|
15
|
+
"ra.page.loading": "Loading",
|
|
16
|
+
"ra.page.empty": "No {name} yet.",
|
|
17
|
+
"ra.page.access_denied": "Access denied",
|
|
18
|
+
"ra.page.authentication_error": "Authentication error",
|
|
19
|
+
// Actions
|
|
20
|
+
"ra.action.add": "Add",
|
|
21
|
+
"ra.action.add_filter": "Add filter",
|
|
22
|
+
"ra.action.bulk_actions": {
|
|
23
|
+
one: "1 item selected",
|
|
24
|
+
other: "{count} items selected"
|
|
25
|
+
},
|
|
26
|
+
"ra.action.cancel": "Cancel",
|
|
27
|
+
"ra.action.clear_input_value": "Clear value",
|
|
28
|
+
"ra.action.clear_search": "Clear search",
|
|
29
|
+
"ra.action.close": "Close",
|
|
30
|
+
"ra.action.close_menu": "Close menu",
|
|
31
|
+
"ra.action.confirm": "Confirm",
|
|
32
|
+
"ra.action.create": "Create",
|
|
33
|
+
"ra.action.delete": "Delete",
|
|
34
|
+
"ra.action.edit": "Edit",
|
|
35
|
+
"ra.action.export": "Export",
|
|
36
|
+
"ra.action.list": "List",
|
|
37
|
+
"ra.action.open_menu": "Open menu",
|
|
38
|
+
"ra.action.refresh": "Refresh",
|
|
39
|
+
"ra.action.remove": "Remove",
|
|
40
|
+
"ra.action.remove_filter": "Remove this filter",
|
|
41
|
+
"ra.action.save": "Save",
|
|
42
|
+
"ra.action.search": "Search",
|
|
43
|
+
"ra.action.select_all": "Select all",
|
|
44
|
+
"ra.action.select_row": "Select this row",
|
|
45
|
+
"ra.action.show": "Show",
|
|
46
|
+
"ra.action.sort": "Sort",
|
|
47
|
+
"ra.action.toggle_theme": "Toggle light/dark mode",
|
|
48
|
+
"ra.action.undo": "Undo",
|
|
49
|
+
"ra.action.unselect": "Unselect",
|
|
50
|
+
"ra.action.update": "Update",
|
|
51
|
+
// Booleans
|
|
52
|
+
"ra.boolean.true": "Yes",
|
|
53
|
+
"ra.boolean.false": "No",
|
|
54
|
+
"ra.boolean.null": " ",
|
|
55
|
+
// Auth
|
|
56
|
+
"ra.auth.logout": "Logout",
|
|
57
|
+
"ra.auth.sign_in": "Sign in",
|
|
58
|
+
"ra.auth.sign_in_error": "Authentication failed, please retry",
|
|
59
|
+
"ra.auth.user_menu": "Profile",
|
|
60
|
+
"ra.auth.username": "Username",
|
|
61
|
+
"ra.auth.password": "Password",
|
|
62
|
+
"ra.auth.auth_check_error": "Please login to continue",
|
|
63
|
+
// Messages
|
|
64
|
+
"ra.message.access_denied": "You don't have the right permissions to access this page",
|
|
65
|
+
"ra.message.auth_error": "An error occurred while validating the authentication token.",
|
|
66
|
+
"ra.message.authentication_error": "The authentication server returned an error and your credentials could not be checked.",
|
|
67
|
+
"ra.message.error": "A client error occurred and your request couldn't be completed.",
|
|
68
|
+
"ra.message.invalid_form": "The form is not valid. Please check for errors",
|
|
69
|
+
"ra.message.loading": "Please wait",
|
|
70
|
+
"ra.message.not_found": "Either you typed a wrong URL, or you followed a bad link.",
|
|
71
|
+
// Navigation / pagination
|
|
72
|
+
"ra.navigation.next": "Go to next page",
|
|
73
|
+
"ra.navigation.previous": "Go to previous page",
|
|
74
|
+
"ra.navigation.first": "Go to first page",
|
|
75
|
+
"ra.navigation.last": "Go to last page",
|
|
76
|
+
// No `{name}`: the list and input call sites pass no params for these.
|
|
77
|
+
"ra.navigation.no_results": "No results found",
|
|
78
|
+
"ra.navigation.no_filtered_results": "No results found with the current filters.",
|
|
79
|
+
"ra.navigation.page_range_info": "{offsetBegin}-{offsetEnd} of {total}",
|
|
80
|
+
"ra.navigation.partial_page_range_info": "{offsetBegin}-{offsetEnd} of more than {offsetEnd}",
|
|
81
|
+
"ra.navigation.page_rows_per_page": "Rows per page:",
|
|
82
|
+
"ra.navigation.current_page": "Page {page}",
|
|
83
|
+
"ra.navigation.skip_nav": "Skip to content",
|
|
84
|
+
// Inputs
|
|
85
|
+
"ra.input.file.upload_several": "Drop some files to upload, or click to select one.",
|
|
86
|
+
"ra.input.file.upload_single": "Drop a file to upload, or click to select it.",
|
|
87
|
+
"ra.input.image.upload_several": "Drop some pictures to upload, or click to select one.",
|
|
88
|
+
"ra.input.image.upload_single": "Drop a picture to upload, or click to select it.",
|
|
89
|
+
"ra.input.password.toggle_visible": "Hide password",
|
|
90
|
+
"ra.input.password.toggle_hidden": "Show password",
|
|
91
|
+
// Theme
|
|
92
|
+
"ra.theme.light": "Light",
|
|
93
|
+
"ra.theme.dark": "Dark",
|
|
94
|
+
"ra.theme.system": "System",
|
|
95
|
+
// Validation (ra namespace — some ported inputs read these)
|
|
96
|
+
"ra.validation.required": "Required",
|
|
97
|
+
"ra.validation.minLength": "Must be {min} characters at least",
|
|
98
|
+
"ra.validation.maxLength": "Must be {max} characters or less",
|
|
99
|
+
"ra.validation.minValue": "Must be at least {min}",
|
|
100
|
+
"ra.validation.maxValue": "Must be {max} or less",
|
|
101
|
+
"ra.validation.number": "Must be a number",
|
|
102
|
+
"ra.validation.email": "Must be a valid email",
|
|
103
|
+
// Actions the components translate beyond the base set
|
|
104
|
+
"ra.action.back": "Back",
|
|
105
|
+
"ra.action.bulk_edit_apply": {
|
|
106
|
+
one: "Apply to 1 record",
|
|
107
|
+
other: "Apply to {count} records"
|
|
108
|
+
},
|
|
109
|
+
"ra.action.change_locale": "Change locale",
|
|
110
|
+
"ra.action.clear_array_input": "Clear the array",
|
|
111
|
+
"ra.action.clone": "Clone",
|
|
112
|
+
"ra.action.collapse": "Collapse",
|
|
113
|
+
"ra.action.expand": "Expand",
|
|
114
|
+
"ra.action.move_column_down": "Move down",
|
|
115
|
+
"ra.action.move_column_up": "Move up",
|
|
116
|
+
"ra.action.move_down": "Move down",
|
|
117
|
+
"ra.action.move_up": "Move up",
|
|
118
|
+
"ra.action.reload": "Reload",
|
|
119
|
+
"ra.action.remove_all_filters": "Remove all filters",
|
|
120
|
+
"ra.action.reset": "Reset",
|
|
121
|
+
"ra.action.reset_columns": "Reset",
|
|
122
|
+
"ra.action.search_columns": "Search columns",
|
|
123
|
+
"ra.action.select_columns": "Columns",
|
|
124
|
+
// Auth
|
|
125
|
+
"ra.auth.or": "or",
|
|
126
|
+
// Calendar
|
|
127
|
+
"ra.calendar.agenda": "Agenda",
|
|
128
|
+
"ra.calendar.month": "Month",
|
|
129
|
+
"ra.calendar.week": "Week",
|
|
130
|
+
"ra.calendar.next": "Next",
|
|
131
|
+
"ra.calendar.previous": "Previous",
|
|
132
|
+
"ra.calendar.today": "Today",
|
|
133
|
+
"ra.calendar.view": "View",
|
|
134
|
+
"ra.calendar.no_events": "No events",
|
|
135
|
+
// CSV import
|
|
136
|
+
"ra.csv_import.back": "Back",
|
|
137
|
+
"ra.csv_import.close": "Close",
|
|
138
|
+
"ra.csv_import.complete": "Import complete",
|
|
139
|
+
"ra.csv_import.counts": "{created} created · {failed} failed · {total} total",
|
|
140
|
+
"ra.csv_import.download_errors": "Download error report",
|
|
141
|
+
"ra.csv_import.drop": "Drop a CSV file here, or click to choose one",
|
|
142
|
+
"ra.csv_import.import": "Import",
|
|
143
|
+
"ra.csv_import.issues": "Issues",
|
|
144
|
+
"ra.csv_import.next": "Next",
|
|
145
|
+
"ra.csv_import.not_utf8": "This file is not UTF-8, so some letters may be wrong. Save it as CSV UTF-8 and try again.",
|
|
146
|
+
"ra.csv_import.preview_summary": "{valid} valid · {errors} errors · {total} total",
|
|
147
|
+
"ra.csv_import.required_unmapped": "Required fields are not mapped",
|
|
148
|
+
"ra.csv_import.rows_parsed": "{count} rows parsed",
|
|
149
|
+
"ra.csv_import.step.commit": "Importing",
|
|
150
|
+
"ra.csv_import.step.map": "Map columns",
|
|
151
|
+
"ra.csv_import.step.preview": "Preview",
|
|
152
|
+
"ra.csv_import.step.upload": "Upload",
|
|
153
|
+
"ra.csv_import.unmapped": "Not mapped",
|
|
154
|
+
"ra.csv_import.wrong_file": "Choose a .csv file",
|
|
155
|
+
// Confirmation dialogs and other messages
|
|
156
|
+
"ra.message.bulk_delete_content": {
|
|
157
|
+
one: "Are you sure you want to delete this item?",
|
|
158
|
+
other: "Are you sure you want to delete these {count} items?"
|
|
159
|
+
},
|
|
160
|
+
"ra.message.bulk_delete_title": {
|
|
161
|
+
one: "Delete 1 item",
|
|
162
|
+
other: "Delete {count} items"
|
|
163
|
+
},
|
|
164
|
+
"ra.message.bulk_edit_description": {
|
|
165
|
+
one: "Only the fields you change are applied to the selected record.",
|
|
166
|
+
other: "Only the fields you change are applied to the {count} selected records."
|
|
167
|
+
},
|
|
168
|
+
"ra.message.bulk_edit_nested_source": "Bulk edit takes flat sources only, but {source} is nested.",
|
|
169
|
+
"ra.message.bulk_update_content": {
|
|
170
|
+
one: "Are you sure you want to update this item?",
|
|
171
|
+
other: "Are you sure you want to update these {count} items?"
|
|
172
|
+
},
|
|
173
|
+
"ra.message.bulk_update_title": {
|
|
174
|
+
one: "Update 1 item",
|
|
175
|
+
other: "Update {count} items"
|
|
176
|
+
},
|
|
177
|
+
"ra.message.clear_array_input": "Are you sure you want to clear the whole array?",
|
|
178
|
+
"ra.message.delete_content": "Are you sure you want to delete this item?",
|
|
179
|
+
"ra.message.delete_title": "Delete {name} {recordRepresentation}",
|
|
180
|
+
// More navigation
|
|
181
|
+
"ra.navigation.clear_filters": "Clear filters",
|
|
182
|
+
// Notifications
|
|
183
|
+
"ra.notification.application_update_available": "A new version of the application is available",
|
|
184
|
+
"ra.notification.http_error": "Error",
|
|
185
|
+
"ra.notification.offline": "You are offline",
|
|
186
|
+
// Saved queries
|
|
187
|
+
"ra.saved_queries.new_label": "Save current query",
|
|
188
|
+
"ra.saved_queries.query_name": "Query name",
|
|
189
|
+
"ra.saved_queries.remove_label_with_name": 'Remove saved query "{name}"'
|
|
190
|
+
});
|
|
191
|
+
export {
|
|
192
|
+
englishMessages
|
|
193
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -118,6 +118,7 @@ export { featuresToShape, heldFeatures, shapeToFeatures, } from "./geo/shape-val
|
|
|
118
118
|
export type { OsrmProviderOptions, RoutingProvider } from "./geo/snap-to-roads.js";
|
|
119
119
|
export { createOsrmProvider } from "./geo/snap-to-roads.js";
|
|
120
120
|
export { defaultMessages } from "./i18n/default-messages.js";
|
|
121
|
+
export { englishMessages } from "./i18n/english-messages.js";
|
|
121
122
|
export type { AnyCheloneI18n, CheloneI18n } from "./i18n/i18n.js";
|
|
122
123
|
export { createI18n } from "./i18n/i18n.js";
|
|
123
124
|
export type { ExtractParams, MessageCatalog, MessageKey, MessageValue, PluralMessage, TranslateParams, } from "./i18n/messages.js";
|
|
@@ -150,12 +151,15 @@ export type { SubscribeUnreadCountOptions } from "./realtime/unread-count.js";
|
|
|
150
151
|
export { clearUnread, subscribeUnreadCount, unreadKey, } from "./realtime/unread-count.js";
|
|
151
152
|
export type { FieldComponentName, FieldDescriptor, FieldKind, InputComponentName, ResourceDescriptor, } from "./resource/describe-resource.js";
|
|
152
153
|
export { describeResource } from "./resource/describe-resource.js";
|
|
154
|
+
export { getAtPath } from "./resource/get-at-path.js";
|
|
153
155
|
export type { Identifier } from "./resource/identifier.js";
|
|
154
156
|
export type { LooseRecord, ResourceRecord } from "./resource/record.js";
|
|
157
|
+
export type { Register, RegisteredRecord, RegisteredResourceName, RegisteredResources, } from "./resource/register.js";
|
|
155
158
|
export type { RecordOf, ResourceConfig, ResourceMap, } from "./resource/registry.js";
|
|
156
159
|
export { defineResources } from "./resource/registry.js";
|
|
157
160
|
export type { ComputeDefinitionProps, ResourceDefinition, ResourceDefinitionMap, ResourceRegistry, ResourceRegistryListener, } from "./resource/registry-store.js";
|
|
158
161
|
export { computeDefinition, createResourceRegistry, } from "./resource/registry-store.js";
|
|
162
|
+
export type { AnySourcePath, AnySourcePathOf, FilterSourceKey, RowSourcePath, SourceKey, SourcePath, SourceProp, SourceValue, } from "./resource/source-path.js";
|
|
159
163
|
export type { CheloneLocation, NavigateOpts } from "./router/location.js";
|
|
160
164
|
export { parseLocation } from "./router/location.js";
|
|
161
165
|
export type { PathMatch } from "./router/match.js";
|
package/dist/index.js
CHANGED
|
@@ -69,6 +69,7 @@ import { OverpassError, OverpassRateLimitError, OverpassTimeoutError, createOver
|
|
|
69
69
|
import { featuresToShape, heldFeatures, shapeToFeatures } from "./geo/shape-value.js";
|
|
70
70
|
import { createOsrmProvider } from "./geo/snap-to-roads.js";
|
|
71
71
|
import { defaultMessages } from "./i18n/default-messages.js";
|
|
72
|
+
import { englishMessages } from "./i18n/english-messages.js";
|
|
72
73
|
import { createI18n } from "./i18n/i18n.js";
|
|
73
74
|
import { defineMessages } from "./i18n/messages.js";
|
|
74
75
|
import { createTranslatableController, getRecordForLocale } from "./i18n/translatable.js";
|
|
@@ -87,6 +88,7 @@ import { lockResourceTopic, lockTopic, presenceTopic, recordTopic, resourceTopic
|
|
|
87
88
|
import { LockConflictError } from "./realtime/types.js";
|
|
88
89
|
import { clearUnread, subscribeUnreadCount, unreadKey } from "./realtime/unread-count.js";
|
|
89
90
|
import { describeResource } from "./resource/describe-resource.js";
|
|
91
|
+
import { getAtPath } from "./resource/get-at-path.js";
|
|
90
92
|
import { defineResources } from "./resource/registry.js";
|
|
91
93
|
import { computeDefinition, createResourceRegistry } from "./resource/registry-store.js";
|
|
92
94
|
import { parseLocation } from "./router/location.js";
|
|
@@ -191,6 +193,7 @@ export {
|
|
|
191
193
|
downloadCSV,
|
|
192
194
|
editorStyles,
|
|
193
195
|
email,
|
|
196
|
+
englishMessages,
|
|
194
197
|
expandTileUrl,
|
|
195
198
|
extractValidSavedQueries,
|
|
196
199
|
fakeDataProvider,
|
|
@@ -206,6 +209,7 @@ export {
|
|
|
206
209
|
geocodeQueryOptions,
|
|
207
210
|
getAllowedTransitions,
|
|
208
211
|
getApprovalState,
|
|
212
|
+
getAtPath,
|
|
209
213
|
getDataTableColumnId,
|
|
210
214
|
getDirtyFormValues,
|
|
211
215
|
getFilterFormValues,
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one path grammar chelone reads a record with. Dot members (`a.b`),
|
|
3
|
+
* bracket indices (`a[0].b`) and numeric-dot indices (`a.0.b`) all resolve to
|
|
4
|
+
* the same value, matching `lodash/get`'s relevant semantics.
|
|
5
|
+
*
|
|
6
|
+
* The core tree, calendar and client-list readers read through this, and so do
|
|
7
|
+
* both adapters' `useFieldValue` and `useGetRecordRepresentation`: a `source`
|
|
8
|
+
* written one way reads the same record everywhere, and one walker is left.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Read the value at `source` off `record`. An empty `source` returns the record
|
|
12
|
+
* itself; a step that is null, undefined or a primitive returns `undefined`.
|
|
13
|
+
*
|
|
14
|
+
* An own key equal to the whole `source` wins before any split, as in
|
|
15
|
+
* `lodash/get`: a record that literally holds a `"nested.level"` key — a
|
|
16
|
+
* flattened filter payload, for instance — still reads.
|
|
17
|
+
*/
|
|
18
|
+
export declare function getAtPath(record: unknown, source: string): unknown;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const PATH_SEGMENT = /\[([^\]]*)\]|[^.[\]]+/g;
|
|
2
|
+
function getAtPath(record, source) {
|
|
3
|
+
if (source === "") return record;
|
|
4
|
+
if (record !== null && typeof record === "object" && Object.hasOwn(record, source)) {
|
|
5
|
+
return record[source];
|
|
6
|
+
}
|
|
7
|
+
let current = record;
|
|
8
|
+
for (const match of source.matchAll(PATH_SEGMENT)) {
|
|
9
|
+
if (current === null || typeof current !== "object") return void 0;
|
|
10
|
+
current = current[match[1] !== void 0 ? match[1] : match[0]];
|
|
11
|
+
}
|
|
12
|
+
return current;
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
getAtPath
|
|
16
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { RecordOf, ResourceMap } from "./registry.js";
|
|
2
|
+
/**
|
|
3
|
+
* The app's augmentation point: the one place a Chelone program tells core
|
|
4
|
+
* which resources it has, so `source` props can be typed against a registered
|
|
5
|
+
* resource's record instead of a plain `string`.
|
|
6
|
+
*
|
|
7
|
+
* ```ts
|
|
8
|
+
* const resources = defineResources({ posts: { schema: postSchema } });
|
|
9
|
+
* declare module "@chelone/core" {
|
|
10
|
+
* interface Register { resources: typeof resources }
|
|
11
|
+
* }
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* Augmenting `Register` is global to a TypeScript program. Without it every
|
|
15
|
+
* `Registered*` type below resolves to its loose fallback and nothing breaks.
|
|
16
|
+
*/
|
|
17
|
+
export interface Register {
|
|
18
|
+
}
|
|
19
|
+
/** The registered resource map, or {@link ResourceMap} when nothing is registered. */
|
|
20
|
+
export type RegisteredResources = Register extends {
|
|
21
|
+
resources: infer TResources extends ResourceMap;
|
|
22
|
+
} ? TResources : ResourceMap;
|
|
23
|
+
/** The registered resource names, or `string` when nothing is registered. */
|
|
24
|
+
export type RegisteredResourceName = keyof RegisteredResources & string;
|
|
25
|
+
/** The record type of a registered resource, or {@link LooseRecord} when it has no schema. */
|
|
26
|
+
export type RegisteredRecord<TName extends RegisteredResourceName> = RecordOf<RegisteredResources, TName>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { StandardSchemaV1 } from "@tanstack/form-core";
|
|
2
2
|
import type { LooseRecord } from "./record.js";
|
|
3
|
+
import type { SourceKey } from "./source-path.js";
|
|
3
4
|
/** Per-resource configuration: an optional Standard Schema (Zod 3, Zod 4, Valibot, ...) and the references its fields hold. */
|
|
4
5
|
export interface ResourceConfig<TSchema extends StandardSchemaV1 = StandardSchemaV1> {
|
|
5
6
|
schema?: TSchema;
|
|
@@ -20,7 +21,20 @@ export type ResourceMap = {
|
|
|
20
21
|
* `defineResources({ posts: { schema: postSchema } })` keeps `"posts"` literal
|
|
21
22
|
* and `typeof postSchema` exact, enabling end-to-end inference.
|
|
22
23
|
*/
|
|
23
|
-
export declare function defineResources<const T extends ResourceMap>(resources: T): T;
|
|
24
|
+
export declare function defineResources<const T extends ResourceMap>(resources: T & Checked<T>): T;
|
|
25
|
+
/**
|
|
26
|
+
* Narrows each resource's `references` to keys that are top-level fields of its
|
|
27
|
+
* record and values that are registered resource names. A mapped type over the
|
|
28
|
+
* keys actually written is what makes a misspelled key an error: an optional
|
|
29
|
+
* `{ [K in SourceKey]?: ... }` intersection lets inference widen `T` instead.
|
|
30
|
+
*/
|
|
31
|
+
type Checked<T extends ResourceMap> = {
|
|
32
|
+
[N in keyof T & string]: {
|
|
33
|
+
references?: {
|
|
34
|
+
[K in keyof NonNullable<T[N]["references"]>]: K extends SourceKey<RecordOf<T, N>> ? keyof T & string : never;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
};
|
|
24
38
|
/**
|
|
25
39
|
* The record type for a given resource name in a registry:
|
|
26
40
|
* the schema's Standard Schema output type when a schema is present, else `LooseRecord`.
|
|
@@ -28,3 +42,4 @@ export declare function defineResources<const T extends ResourceMap>(resources:
|
|
|
28
42
|
export type RecordOf<TResources extends ResourceMap, TName extends keyof TResources> = TResources[TName] extends {
|
|
29
43
|
schema: infer S;
|
|
30
44
|
} ? S extends StandardSchemaV1<unknown, infer Output> ? Output : LooseRecord : LooseRecord;
|
|
45
|
+
export {};
|