@atscript/ui 0.1.164 → 0.1.165
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/client-factory.d.cts +6 -1
- package/dist/client-factory.d.mts +6 -1
- package/dist/form/create-form-def.cjs +28 -6
- package/dist/form/create-form-def.mjs +29 -7
- package/dist/form/labels.cjs +7 -4
- package/dist/form/labels.d.cts +6 -2
- package/dist/form/labels.d.mts +6 -2
- package/dist/form/labels.mjs +7 -4
- package/dist/form/types.d.cts +14 -0
- package/dist/form/types.d.mts +14 -0
- package/dist/form/validate.cjs +59 -23
- package/dist/form/validate.d.cts +37 -6
- package/dist/form/validate.d.mts +37 -6
- package/dist/form/validate.mjs +58 -23
- package/dist/i18n/ui-texts.cjs +135 -0
- package/dist/i18n/ui-texts.d.cts +81 -0
- package/dist/i18n/ui-texts.d.mts +81 -0
- package/dist/i18n/ui-texts.mjs +132 -0
- package/dist/index.cjs +6 -0
- package/dist/index.d.cts +7 -6
- package/dist/index.d.mts +7 -6
- package/dist/index.mjs +3 -2
- package/dist/messages.cjs +301 -0
- package/dist/messages.d.cts +302 -0
- package/dist/messages.d.mts +302 -0
- package/dist/messages.mjs +300 -0
- package/dist/plugin/annotations.cjs +30 -15
- package/dist/plugin/annotations.mjs +30 -15
- package/dist/plugin/value-help-validation.cjs +17 -7
- package/dist/plugin/value-help-validation.mjs +17 -7
- package/dist/shared/meta-cache.cjs +75 -37
- package/dist/shared/meta-cache.d.cts +40 -20
- package/dist/shared/meta-cache.d.mts +40 -20
- package/dist/shared/meta-cache.mjs +75 -37
- package/dist/table/create-table-def.cjs +17 -8
- package/dist/table/create-table-def.d.cts +5 -1
- package/dist/table/create-table-def.d.mts +5 -1
- package/dist/table/create-table-def.mjs +18 -9
- package/dist/table/types.d.cts +5 -2
- package/dist/table/types.d.mts +5 -2
- package/dist/table/value-kind.cjs +6 -6
- package/dist/table/value-kind.d.cts +8 -7
- package/dist/table/value-kind.d.mts +8 -7
- package/dist/table/value-kind.mjs +6 -6
- package/dist/value-help/extract-literals.cjs +61 -22
- package/dist/value-help/extract-literals.d.cts +20 -8
- package/dist/value-help/extract-literals.d.mts +20 -8
- package/dist/value-help/extract-literals.mjs +60 -23
- package/dist/value-help/index.d.mts +1 -1
- package/dist/value-help/resolve-options.cjs +8 -4
- package/dist/value-help/resolve-options.d.cts +8 -3
- package/dist/value-help/resolve-options.d.mts +8 -3
- package/dist/value-help/resolve-options.mjs +9 -5
- package/dist/value-help/resolve.cjs +7 -3
- package/dist/value-help/resolve.d.cts +7 -2
- package/dist/value-help/resolve.d.mts +7 -2
- package/dist/value-help/resolve.mjs +7 -3
- package/dist/value-help/types.d.cts +5 -0
- package/dist/value-help/types.d.mts +5 -0
- package/package.json +15 -10
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
//#region src/messages.ts
|
|
2
|
+
/**
|
|
3
|
+
* The built-in texts of the atscript-ui components, by code: `UI_*` code →
|
|
4
|
+
* English template with `{name}` placeholders. Imports nothing — a server
|
|
5
|
+
* registers it with moost's translation registry:
|
|
6
|
+
*
|
|
7
|
+
* ```ts
|
|
8
|
+
* import { registerMessages } from "moost";
|
|
9
|
+
* import { AS_UI_MESSAGES } from "@atscript/ui/messages";
|
|
10
|
+
*
|
|
11
|
+
* registerMessages(AS_UI_MESSAGES);
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* The client renders these texts in English unless the server served a
|
|
15
|
+
* translation for the locale (or your own translator returns one).
|
|
16
|
+
*/
|
|
17
|
+
const AS_UI_MESSAGES = Object.freeze({
|
|
18
|
+
UI_YES: "Yes",
|
|
19
|
+
UI_NO: "No",
|
|
20
|
+
UI_ITEM: "item",
|
|
21
|
+
UI_CANCEL: "Cancel",
|
|
22
|
+
UI_APPLY: "Apply",
|
|
23
|
+
UI_SAVE: "Save",
|
|
24
|
+
UI_CLOSE: "Close",
|
|
25
|
+
UI_CONFIRM: "Confirm",
|
|
26
|
+
UI_CONFIRMATION: "Confirmation",
|
|
27
|
+
UI_REMOVE: "Remove",
|
|
28
|
+
UI_CLEAR: "Clear",
|
|
29
|
+
UI_CLEAR_ALL: "Clear all",
|
|
30
|
+
UI_CLEAR_SELECTION: "Clear selection",
|
|
31
|
+
UI_SELECT_ALL: "Select all",
|
|
32
|
+
UI_SELECT_PLACEHOLDER: "Select...",
|
|
33
|
+
UI_SEARCH_PLACEHOLDER: "Search...",
|
|
34
|
+
UI_RESET: "Reset",
|
|
35
|
+
UI_RETRY: "Retry",
|
|
36
|
+
UI_ERROR: "Error",
|
|
37
|
+
UI_MORE: "+{count} more",
|
|
38
|
+
UI_INVALID_VALUE: "Invalid value",
|
|
39
|
+
UI_VALIDATION_FAILED: "Validation failed",
|
|
40
|
+
UI_FORM_SUBMIT: "Submit",
|
|
41
|
+
UI_FORM_DISMISS: "Dismiss",
|
|
42
|
+
UI_FORM_MODIFIED: "Modified",
|
|
43
|
+
UI_FORM_WRONG_VALUE: "Wrong value",
|
|
44
|
+
UI_FORM_ADD: "Add {item}",
|
|
45
|
+
UI_FORM_ITEMS_COUNT: "{count} items",
|
|
46
|
+
UI_FORM_ERRORS_INSIDE_ONE: "{count} error inside",
|
|
47
|
+
UI_FORM_ERRORS_INSIDE: "{count} errors inside",
|
|
48
|
+
UI_FORM_NOT_SET: "Not set",
|
|
49
|
+
UI_FORM_CLICK_TO_EDIT: "Click to edit",
|
|
50
|
+
UI_FORM_UNSET: "Unset",
|
|
51
|
+
UI_FORM_UNSET_VALUE: "Unset value",
|
|
52
|
+
UI_FORM_UNSET_FIELD: "Unset {field}",
|
|
53
|
+
UI_FORM_CLEAR_FIELD: "Clear {field}",
|
|
54
|
+
UI_FORM_REMOVE_VALUE: "Remove {value}",
|
|
55
|
+
UI_FORM_NO_MATCHES: "No matches",
|
|
56
|
+
UI_FORM_NO_RESULTS: "No results",
|
|
57
|
+
UI_FORM_SWITCH: "Switch",
|
|
58
|
+
UI_FORM_SWITCH_TYPE: "Switch type — current: {type}",
|
|
59
|
+
UI_FORM_DECIMALS_OF: "decimals of {field}",
|
|
60
|
+
UI_FORM_HIDDEN_PLACEHOLDER: "(hidden — enter a value to replace)",
|
|
61
|
+
UI_FORM_TYPE_OBJECT: "Object",
|
|
62
|
+
UI_FORM_TYPE_STRING: "String",
|
|
63
|
+
UI_FORM_TYPE_NUMBER: "Number",
|
|
64
|
+
UI_FORM_TYPE_BOOLEAN: "Boolean",
|
|
65
|
+
UI_FORM_TYPE_ITEM: "Item",
|
|
66
|
+
UI_FORM_TYPE_ARRAY: "Array",
|
|
67
|
+
UI_FORM_TYPE_TUPLE: "Tuple",
|
|
68
|
+
UI_TABLE_VALUE: "Value",
|
|
69
|
+
UI_TABLE_ACTIONS: "Actions",
|
|
70
|
+
UI_TABLE_ROW_ACTIONS: "Row actions",
|
|
71
|
+
UI_TABLE_MORE_ACTIONS: "More actions",
|
|
72
|
+
UI_TABLE_MORE_ACTIONS_RUNNING: "More actions, running",
|
|
73
|
+
UI_TABLE_MORE_FILTERS: "More filters",
|
|
74
|
+
UI_TABLE_SELECT_ALL_ROWS: "Select all rows",
|
|
75
|
+
UI_TABLE_SELECT_ROW: "Select row",
|
|
76
|
+
UI_TABLE_SELECT_ROW_REASON: "Select row, {reason}",
|
|
77
|
+
UI_TABLE_SELECT_ROW_DISABLED: "Select row, not selectable",
|
|
78
|
+
UI_TABLE_SELECTED_PAGE_ONE: "The 1 row on this page is selected.",
|
|
79
|
+
UI_TABLE_SELECTED_PAGE: "All {count} rows on this page are selected.",
|
|
80
|
+
UI_TABLE_SELECTED_LOADED_ONE: "The 1 row loaded is selected.",
|
|
81
|
+
UI_TABLE_SELECTED_LOADED: "All {count} rows loaded are selected.",
|
|
82
|
+
UI_TABLE_SELECTED_MATCHING_ONE: "1 matching row is selected.",
|
|
83
|
+
UI_TABLE_SELECTED_MATCHING: "All {count} matching rows are selected.",
|
|
84
|
+
UI_TABLE_SELECT_ALL_MATCHING: "Select all {count} matching",
|
|
85
|
+
UI_TABLE_LOAD_FAILED: "Failed to load values",
|
|
86
|
+
UI_TABLE_NO_MATCHING: "No matching values",
|
|
87
|
+
UI_TABLE_NO_MATCH_SEARCH: "No entries match {term}. Try a different search.",
|
|
88
|
+
UI_TABLE_NO_MATCH_FILTERS: "No entries match the current filters.",
|
|
89
|
+
UI_TABLE_NO_ENTRIES: "No entries available",
|
|
90
|
+
UI_TABLE_CLEAR_FILTERS: "Clear filters",
|
|
91
|
+
UI_TABLE_RECORDS: "{count} records",
|
|
92
|
+
UI_TABLE_VIEW_ITEMS: "View {count} items",
|
|
93
|
+
UI_TABLE_VIEW_OBJECT: "View object",
|
|
94
|
+
UI_TABLE_ROWS_ONE: "{count} row",
|
|
95
|
+
UI_TABLE_ROWS: "{count} rows",
|
|
96
|
+
UI_TABLE_SORT: "Sort",
|
|
97
|
+
UI_TABLE_ASCENDING: "Ascending",
|
|
98
|
+
UI_TABLE_DESCENDING: "Descending",
|
|
99
|
+
UI_TABLE_FILTER_MENU: "Filter...",
|
|
100
|
+
UI_TABLE_RESET_WIDTH: "Reset width",
|
|
101
|
+
UI_TABLE_HIDE_COLUMN: "Hide column",
|
|
102
|
+
UI_TABLE_SETTINGS: "Table Settings",
|
|
103
|
+
UI_TABLE_SETTINGS_DESCRIPTION: "Choose which columns are visible, which fields appear in the filter bar, and the sort order of the table.",
|
|
104
|
+
UI_TABLE_COLUMNS: "Columns",
|
|
105
|
+
UI_TABLE_FILTERS: "Filters",
|
|
106
|
+
UI_TABLE_SORTERS: "Sorters",
|
|
107
|
+
UI_TABLE_CLIENT_SORTER: "client",
|
|
108
|
+
UI_TABLE_COLUMNS_VISIBLE: "{count} of {total} columns visible",
|
|
109
|
+
UI_TABLE_FILTERS_SHOWN: "{count} of {total} filterable columns shown as filter pills",
|
|
110
|
+
UI_TABLE_SORTERS_ACTIVE: "{count} of {total} sortable columns in effect",
|
|
111
|
+
UI_TABLE_COLUMNS_HINT: "Checked columns are rendered in the table. Drag rows to reorder.",
|
|
112
|
+
UI_TABLE_FILTERS_HINT: "Checked columns appear in the filter bar for quick filtering.",
|
|
113
|
+
UI_TABLE_SORTERS_HINT: "Rows are ordered by these fields, top-to-bottom.",
|
|
114
|
+
UI_TABLE_SORT_PRIORITY: "Sort priority {n}",
|
|
115
|
+
UI_TABLE_SORT_DIRECTION: "Sort direction",
|
|
116
|
+
UI_TABLE_ASC: "↑ Asc",
|
|
117
|
+
UI_TABLE_DESC: "↓ Desc",
|
|
118
|
+
UI_TABLE_LOCKED: "Locked",
|
|
119
|
+
UI_TABLE_NONE: "None",
|
|
120
|
+
UI_TABLE_MOVE_TOP: "Move to top",
|
|
121
|
+
UI_TABLE_MOVE_UP: "Move up",
|
|
122
|
+
UI_TABLE_MOVE_DOWN: "Move down",
|
|
123
|
+
UI_TABLE_MOVE_BOTTOM: "Move to bottom",
|
|
124
|
+
UI_FILTER_TITLE: "Filter",
|
|
125
|
+
UI_FILTER_DESCRIPTION: "Build the filter conditions applied to this column.",
|
|
126
|
+
UI_FILTER_VALUES: "Values",
|
|
127
|
+
UI_FILTER_CONDITIONS: "Conditions",
|
|
128
|
+
UI_FILTER_APPLIED_ONE: "{count} condition applied",
|
|
129
|
+
UI_FILTER_APPLIED: "{count} conditions applied",
|
|
130
|
+
UI_FILTER_SEE_ALL: "See All ({count})",
|
|
131
|
+
UI_FILTER_OPEN_DIALOG: "Open filter dialog (F4)",
|
|
132
|
+
UI_FILTER_DATE_PLACEHOLDER: "YYYY-MM-DD",
|
|
133
|
+
UI_FILTER_VALUE_PLACEHOLDER: "Value...",
|
|
134
|
+
UI_FILTER_FROM: "From",
|
|
135
|
+
UI_FILTER_TO: "To",
|
|
136
|
+
UI_FILTER_PICK_TIME: "Pick a time",
|
|
137
|
+
UI_FILTER_CLEAR_VALUE: "Clear value",
|
|
138
|
+
UI_FILTER_ADD_CONDITION: "+ Add condition",
|
|
139
|
+
UI_FILTER_REMOVE_CONDITION: "Remove condition",
|
|
140
|
+
UI_FILTER_QUICK: "Quick:",
|
|
141
|
+
UI_FILTER_SHOW_FILTERS: "Show filters",
|
|
142
|
+
UI_FILTER_HIDE_FILTERS: "Hide filters",
|
|
143
|
+
UI_FILTER_CUSTOM: "Custom filter",
|
|
144
|
+
UI_FILTER_REMOVE_CUSTOM: "Remove custom filter",
|
|
145
|
+
UI_FILTER_COND_EQ: "equals",
|
|
146
|
+
UI_FILTER_COND_NE: "not equals",
|
|
147
|
+
UI_FILTER_COND_GT: "greater than",
|
|
148
|
+
UI_FILTER_COND_GTE: "greater or equal",
|
|
149
|
+
UI_FILTER_COND_LT: "less than",
|
|
150
|
+
UI_FILTER_COND_LTE: "less or equal",
|
|
151
|
+
UI_FILTER_COND_CONTAINS: "contains",
|
|
152
|
+
UI_FILTER_COND_STARTS: "starts with",
|
|
153
|
+
UI_FILTER_COND_ENDS: "ends with",
|
|
154
|
+
UI_FILTER_COND_BW: "between",
|
|
155
|
+
UI_FILTER_COND_NULL: "is empty",
|
|
156
|
+
UI_FILTER_COND_NOT_NULL: "is not empty",
|
|
157
|
+
UI_FILTER_COND_REGEX: "matches pattern",
|
|
158
|
+
UI_FILTER_DATE_EQ: "on",
|
|
159
|
+
UI_FILTER_DATE_NE: "not on",
|
|
160
|
+
UI_FILTER_DATE_LT: "before",
|
|
161
|
+
UI_FILTER_DATE_LTE: "on or before",
|
|
162
|
+
UI_FILTER_DATE_GT: "after",
|
|
163
|
+
UI_FILTER_DATE_GTE: "on or after",
|
|
164
|
+
UI_FILTER_CHIP: "{field} {condition} {value}",
|
|
165
|
+
UI_FILTER_CHIP_EMPTY: "{field}: empty",
|
|
166
|
+
UI_FILTER_CHIP_NOT_EMPTY: "{field}: not empty",
|
|
167
|
+
UI_FILTER_CHIP_BETWEEN: "{field}: {from} – {to}",
|
|
168
|
+
UI_FILTER_CHIP_COUNT: "{field}: {count} conditions",
|
|
169
|
+
UI_FILTER_CHIP_IN: "{field} is one of {values}",
|
|
170
|
+
UI_FILTER_CHIP_NOT_IN: "{field} is none of {values}",
|
|
171
|
+
UI_FILTER_CHIP_SOME: "{field} has some ({filter})",
|
|
172
|
+
UI_FILTER_CHIP_NONE: "{field} has none ({filter})",
|
|
173
|
+
UI_FILTER_CHIP_ANY: "any",
|
|
174
|
+
UI_FILTER_CHIP_NOT: "not ({filter})",
|
|
175
|
+
UI_FILTER_AND: "and",
|
|
176
|
+
UI_FILTER_OR: "or",
|
|
177
|
+
UI_FILTER_EMPTY: "empty",
|
|
178
|
+
UI_FILTER_NOT_EMPTY: "not empty",
|
|
179
|
+
UI_FILTER_ON_DATE: "on {date}",
|
|
180
|
+
UI_FILTER_IN_MONTH: "in {date}",
|
|
181
|
+
UI_FILTER_NOT_ON_DATE: "not on {date}",
|
|
182
|
+
UI_FILTER_BEFORE_DATE: "before {date}",
|
|
183
|
+
UI_FILTER_ON_OR_BEFORE_DATE: "on or before {date}",
|
|
184
|
+
UI_FILTER_AFTER_DATE: "after {date}",
|
|
185
|
+
UI_FILTER_ON_OR_AFTER_DATE: "on or after {date}",
|
|
186
|
+
UI_FILTER_TODAY: "today",
|
|
187
|
+
UI_FILTER_YESTERDAY: "yesterday",
|
|
188
|
+
UI_FILTER_DAYS_AGO: "{count} days ago",
|
|
189
|
+
UI_FILTER_THIS_WEEK: "this week",
|
|
190
|
+
UI_FILTER_LAST_WEEK: "last week",
|
|
191
|
+
UI_FILTER_WEEKS_AGO: "{count} weeks ago",
|
|
192
|
+
UI_FILTER_THIS_MONTH: "this month",
|
|
193
|
+
UI_FILTER_LAST_MONTH: "last month",
|
|
194
|
+
UI_FILTER_MONTHS_AGO: "{count} months ago",
|
|
195
|
+
UI_FILTER_THIS_YEAR: "this year",
|
|
196
|
+
UI_FILTER_LAST_YEAR: "last year",
|
|
197
|
+
UI_FILTER_YEARS_AGO: "{count} years ago",
|
|
198
|
+
UI_DATE_TODAY: "Today",
|
|
199
|
+
UI_DATE_YESTERDAY: "Yesterday",
|
|
200
|
+
UI_DATE_LAST_7_DAYS: "Last 7 days",
|
|
201
|
+
UI_DATE_LAST_30_DAYS: "Last 30 days",
|
|
202
|
+
UI_DATE_THIS_WEEK: "This week",
|
|
203
|
+
UI_DATE_LAST_WEEK: "Last week",
|
|
204
|
+
UI_DATE_THIS_MONTH: "This month",
|
|
205
|
+
UI_DATE_LAST_MONTH: "Last month",
|
|
206
|
+
UI_DATE_THIS_YEAR: "This year",
|
|
207
|
+
UI_DATES_LAST_7_DAYS: "Last 7 Days",
|
|
208
|
+
UI_DATES_LAST_30_DAYS: "Last 30 Days",
|
|
209
|
+
UI_DATES_MONTH_TO_DATE: "Month to Date",
|
|
210
|
+
UI_DATES_LAST_90_DAYS: "Last 90 Days",
|
|
211
|
+
UI_DATES_LAST_6_MONTHS: "Last 6 Months",
|
|
212
|
+
UI_DATES_LAST_12_MONTHS: "Last 12 Months",
|
|
213
|
+
UI_DATES_YEAR_TO_DATE: "Year to Date",
|
|
214
|
+
UI_ACTION_DELETE: "Delete",
|
|
215
|
+
UI_ACTION_DELETE_ONE: "Delete item $1?",
|
|
216
|
+
UI_ACTION_DELETE_MANY: "Delete $N items?",
|
|
217
|
+
UI_ACTION_PROCEED: "Proceed",
|
|
218
|
+
UI_ACTION_NO_FORM: "Action does not declare an input form.",
|
|
219
|
+
UI_ACTION_PROVIDE_INPUT: "Provide the input for {action}.",
|
|
220
|
+
UI_ACTION_LOADING_FORM: "Loading form…",
|
|
221
|
+
UI_ACTION_MORE_IDS: "{count} more…",
|
|
222
|
+
UI_ACTION_AT_MOST: "At most {rows}",
|
|
223
|
+
UI_ACTION_QUERY_UNSUPPORTED: "Not available for all matching rows — select rows individually",
|
|
224
|
+
UI_ACTION_RUN_ON: "Run “{action}” on {rows}?",
|
|
225
|
+
UI_ACTION_TARGET_CHANGED: "The rows matching the query changed. {question}",
|
|
226
|
+
UI_PRESET_STANDARD: "Standard",
|
|
227
|
+
UI_PRESET_SYSTEM: "System",
|
|
228
|
+
UI_PRESET_MINE: "My presets",
|
|
229
|
+
UI_PRESET_FAVORITES: "Favorites",
|
|
230
|
+
UI_PRESET_SHARED: "Shared by others",
|
|
231
|
+
UI_PRESET_COPY_OF: "Copy of {name}",
|
|
232
|
+
UI_PRESET_SAVE_FAILED: "Could not save the preset.",
|
|
233
|
+
UI_PRESET_CHANGE_FAILED: "The change could not be saved.",
|
|
234
|
+
UI_PRESET_FIELDS_UNAVAILABLE: "Some fields in this preset aren't available to you.",
|
|
235
|
+
UI_PRESET_SAVE_AS: "Save as…",
|
|
236
|
+
UI_PRESET_RESET: "Reset changes",
|
|
237
|
+
UI_PRESET_MANAGE: "Manage presets…",
|
|
238
|
+
UI_PRESET_SAVE_AS_TITLE: "Save as new preset",
|
|
239
|
+
UI_PRESET_NAME: "Name",
|
|
240
|
+
UI_PRESET_SAVE_ASPECTS: "Save:",
|
|
241
|
+
UI_PRESET_RESIDUAL_NOT_SAVED: "Custom filter conditions are not saved with presets.",
|
|
242
|
+
UI_PRESET_MAKE_PUBLIC: "Make public",
|
|
243
|
+
UI_PRESET_ASPECT_COLUMNS: "Displayed Columns",
|
|
244
|
+
UI_PRESET_ASPECT_FILTERS: "Displayed Filters",
|
|
245
|
+
UI_PRESET_ASPECT_FILTER_OPS: "Filter conditions",
|
|
246
|
+
UI_PRESET_ASPECT_SORTERS: "Sorters",
|
|
247
|
+
UI_PRESET_ASPECT_PAGE_SIZE: "Page size",
|
|
248
|
+
UI_PRESET_DIALOG_TITLE: "Presets",
|
|
249
|
+
UI_PRESET_DIALOG_DESCRIPTION: "Rename, share, favorite, pin as default or delete your saved table views.",
|
|
250
|
+
UI_PRESET_SEARCH: "Search by name or owner…",
|
|
251
|
+
UI_PRESET_LEGEND_DEFAULT: "default",
|
|
252
|
+
UI_PRESET_LEGEND_FAVORITE: "favorite",
|
|
253
|
+
UI_PRESET_LEGEND_PUBLIC: "public",
|
|
254
|
+
UI_PRESET_LEGEND_DELETE: "delete",
|
|
255
|
+
UI_PRESET_NO_MATCH: "No presets match \"{query}\".",
|
|
256
|
+
UI_PRESET_OWNER_YOU: "you",
|
|
257
|
+
UI_PRESET_WILL_APPLY: "This preset will be applied",
|
|
258
|
+
UI_PRESET_CLICK_TO_APPLY: "Click to apply this preset on Save",
|
|
259
|
+
UI_PRESET_RENAME_PENDING: "Modified — click to keep editing",
|
|
260
|
+
UI_PRESET_CLICK_TO_RENAME: "Click to rename",
|
|
261
|
+
UI_PRESET_FAVORITED: "Favorited — click to remove",
|
|
262
|
+
UI_PRESET_CLICK_TO_FAVORITE: "Click to add to favorites",
|
|
263
|
+
UI_PRESET_DEFAULT: "Default — click to unpin",
|
|
264
|
+
UI_PRESET_CLICK_TO_PIN: "Click to pin as default",
|
|
265
|
+
UI_PRESET_PUBLIC: "Public — click to make private",
|
|
266
|
+
UI_PRESET_PRIVATE: "Private — click to make public",
|
|
267
|
+
UI_PRESET_SHARED_PUBLIC: "Public preset shared with everyone",
|
|
268
|
+
UI_PRESET_MARKED_DELETE: "Marked for deletion — click to undo",
|
|
269
|
+
UI_PRESET_MARK_DELETE: "Mark for deletion (applied on Save)",
|
|
270
|
+
UI_PRESET_UNSAVED: "unsaved changes",
|
|
271
|
+
UI_PRESET_SAVING: "Saving…",
|
|
272
|
+
UI_PRESET_CHANGES_FAILED: "{count} changes could not be saved.",
|
|
273
|
+
UI_AOOTH_COPY: "Copy",
|
|
274
|
+
UI_AOOTH_COPIED: "Copied",
|
|
275
|
+
UI_AOOTH_COPY_FAILED: "Copy failed — select and copy manually",
|
|
276
|
+
UI_AOOTH_QR_FAILED: "Failed to render QR code.",
|
|
277
|
+
UI_AOOTH_OR: "or",
|
|
278
|
+
UI_WF_STATUS_400: "The request was invalid. Please check your input and try again.",
|
|
279
|
+
UI_WF_STATUS_401: "You need to sign in to continue.",
|
|
280
|
+
UI_WF_STATUS_403: "You don't have permission to do that.",
|
|
281
|
+
UI_WF_STATUS_404: "We couldn't find what you're looking for.",
|
|
282
|
+
UI_WF_STATUS_408: "The request took too long. Please try again.",
|
|
283
|
+
UI_WF_STATUS_409: "There's a conflict with the current state. Please refresh and try again.",
|
|
284
|
+
UI_WF_STATUS_410: "This session has expired. Please start over.",
|
|
285
|
+
UI_WF_STATUS_422: "Some of the information you provided couldn't be processed.",
|
|
286
|
+
UI_WF_STATUS_423: "This account is temporarily locked. Please try again later.",
|
|
287
|
+
UI_WF_STATUS_429: "Too many requests. Please wait a moment and try again.",
|
|
288
|
+
UI_WF_STATUS_500: "Something went wrong on our end. Please try again in a moment.",
|
|
289
|
+
UI_WF_STATUS_502: "We're having trouble reaching the server. Please try again shortly.",
|
|
290
|
+
UI_WF_STATUS_503: "The service is temporarily unavailable. Please try again in a few minutes.",
|
|
291
|
+
UI_WF_STATUS_504: "The server took too long to respond. Please try again.",
|
|
292
|
+
UI_WF_REQUEST_FAILED: "Something went wrong with that request. Please try again.",
|
|
293
|
+
UI_WF_UNEXPECTED_RESPONSE: "Unexpected response from the server.",
|
|
294
|
+
UI_WF_UNEXPECTED_FORMAT: "Unexpected response format",
|
|
295
|
+
UI_WF_NETWORK_ERROR: "Network error",
|
|
296
|
+
UI_WF_REDIRECTING: "Redirecting…",
|
|
297
|
+
UI_WF_CONTINUING_IN: "Continuing in {seconds}…"
|
|
298
|
+
});
|
|
299
|
+
//#endregion
|
|
300
|
+
export { AS_UI_MESSAGES };
|
|
@@ -75,7 +75,8 @@ const uiAnnotations = { ui: {
|
|
|
75
75
|
argument: {
|
|
76
76
|
name: "text",
|
|
77
77
|
type: "string",
|
|
78
|
-
description: "The placeholder text to display in UI input fields."
|
|
78
|
+
description: "The placeholder text to display in UI input fields.",
|
|
79
|
+
userText: true
|
|
79
80
|
}
|
|
80
81
|
}),
|
|
81
82
|
hint: new _atscript_core.AnnotationSpec({
|
|
@@ -84,7 +85,8 @@ const uiAnnotations = { ui: {
|
|
|
84
85
|
argument: {
|
|
85
86
|
name: "text",
|
|
86
87
|
type: "string",
|
|
87
|
-
description: "Help text or tooltip content."
|
|
88
|
+
description: "Help text or tooltip content.",
|
|
89
|
+
userText: true
|
|
88
90
|
}
|
|
89
91
|
}),
|
|
90
92
|
classes: new _atscript_core.AnnotationSpec({
|
|
@@ -139,13 +141,17 @@ const uiAnnotations = { ui: {
|
|
|
139
141
|
argument: [{
|
|
140
142
|
name: "label",
|
|
141
143
|
type: "string",
|
|
142
|
-
description: "Display label for the option"
|
|
144
|
+
description: "Display label for the option",
|
|
145
|
+
userText: true
|
|
143
146
|
}, {
|
|
144
147
|
name: "value",
|
|
145
148
|
type: "string",
|
|
146
149
|
optional: true,
|
|
147
150
|
description: "Value/key for the option (defaults to label if omitted)"
|
|
148
|
-
}]
|
|
151
|
+
}],
|
|
152
|
+
modify(_token, args) {
|
|
153
|
+
if (args.length === 1) args.push(args[0].clone({}));
|
|
154
|
+
}
|
|
149
155
|
}),
|
|
150
156
|
order: new _atscript_core.AnnotationSpec({
|
|
151
157
|
description: "Explicit form-field ordering (lower values render first).",
|
|
@@ -240,7 +246,8 @@ const uiAnnotations = { ui: {
|
|
|
240
246
|
argument: {
|
|
241
247
|
name: "text",
|
|
242
248
|
type: "string",
|
|
243
|
-
description: "Submit button label"
|
|
249
|
+
description: "Submit button label",
|
|
250
|
+
userText: true
|
|
244
251
|
}
|
|
245
252
|
}) },
|
|
246
253
|
label: { singular: new _atscript_core.AnnotationSpec({
|
|
@@ -249,7 +256,8 @@ const uiAnnotations = { ui: {
|
|
|
249
256
|
argument: {
|
|
250
257
|
name: "singular",
|
|
251
258
|
type: "string",
|
|
252
|
-
description: "Singular label, e.g. \"phone number\" for a `phones` field."
|
|
259
|
+
description: "Singular label, e.g. \"phone number\" for a `phones` field.",
|
|
260
|
+
userText: true
|
|
253
261
|
}
|
|
254
262
|
}) },
|
|
255
263
|
pushDown: new _atscript_core.AnnotationSpec({
|
|
@@ -267,7 +275,8 @@ const uiAnnotations = { ui: {
|
|
|
267
275
|
name: "label",
|
|
268
276
|
type: "string",
|
|
269
277
|
optional: true,
|
|
270
|
-
description: "Display label for the action (falls back to @meta.label)"
|
|
278
|
+
description: "Display label for the action (falls back to @meta.label)",
|
|
279
|
+
userText: true
|
|
271
280
|
}]
|
|
272
281
|
}),
|
|
273
282
|
prefix: {
|
|
@@ -277,7 +286,8 @@ const uiAnnotations = { ui: {
|
|
|
277
286
|
argument: {
|
|
278
287
|
name: "value",
|
|
279
288
|
type: "string",
|
|
280
|
-
description: "Literal text to display before the input value."
|
|
289
|
+
description: "Literal text to display before the input value.",
|
|
290
|
+
userText: true
|
|
281
291
|
}
|
|
282
292
|
}),
|
|
283
293
|
ref: new _atscript_core.AnnotationSpec({
|
|
@@ -307,7 +317,8 @@ const uiAnnotations = { ui: {
|
|
|
307
317
|
argument: {
|
|
308
318
|
name: "value",
|
|
309
319
|
type: "string",
|
|
310
|
-
description: "Literal text to display after the input value."
|
|
320
|
+
description: "Literal text to display after the input value.",
|
|
321
|
+
userText: true
|
|
311
322
|
}
|
|
312
323
|
}),
|
|
313
324
|
ref: new _atscript_core.AnnotationSpec({
|
|
@@ -475,19 +486,20 @@ const uiAnnotations = { ui: {
|
|
|
475
486
|
})
|
|
476
487
|
},
|
|
477
488
|
literalLabel: new _atscript_core.AnnotationSpec({
|
|
478
|
-
description: "Display label for one literal of a union (`'open' | 'closed'`). Repeat per literal; unlabelled literals keep their raw text. Used by form selects/radios, table cells, enum filter options, filter chips and export. A prop's labels are added to the referenced type's (`append` merge: the type's other labels stay); for the same literal the prop's label wins.\n\n**Example:**\n```atscript\n@ui.literalLabel 'in_progress', 'In progress'\nexport type Status = 'open' | 'in_progress'\n```\n",
|
|
489
|
+
description: "Display label for one literal of a union (`'open' | 'closed'`) or one value of a boolean (`'true'` / `'false'`). Repeat per literal; unlabelled literals keep their raw text, unlabelled booleans read Yes / No. Used by form selects/radios, read-only form fields, table cells, enum filter options, filter chips and export. A prop's labels are added to the referenced type's (`append` merge: the type's other labels stay); for the same literal the prop's label wins.\n\n**Example:**\n```atscript\n@ui.literalLabel 'in_progress', 'In progress'\nexport type Status = 'open' | 'in_progress'\n\n@ui.literalLabel 'true', 'Active'\n@ui.literalLabel 'false', 'Inactive'\nactive: boolean\n```\n",
|
|
479
490
|
nodeType: ["prop", "type"],
|
|
480
491
|
multiple: true,
|
|
481
492
|
mergeStrategy: "append",
|
|
482
493
|
argument: [{
|
|
483
494
|
name: "value",
|
|
484
495
|
type: "string",
|
|
485
|
-
description: "The literal as text (`'2'` for the number literal `2`).",
|
|
496
|
+
description: "The literal as text (`'2'` for the number literal `2`; `'true'` / `'false'` on a boolean).",
|
|
486
497
|
valueScope: require_value_help_validation.literalLabelValues
|
|
487
498
|
}, {
|
|
488
499
|
name: "label",
|
|
489
500
|
type: "string",
|
|
490
|
-
description: "Display label."
|
|
501
|
+
description: "Display label.",
|
|
502
|
+
userText: true
|
|
491
503
|
}],
|
|
492
504
|
validate: require_value_help_validation.validateLiteralLabel
|
|
493
505
|
}),
|
|
@@ -533,7 +545,8 @@ const uiAnnotations = { ui: {
|
|
|
533
545
|
argument: {
|
|
534
546
|
name: "group",
|
|
535
547
|
type: "string",
|
|
536
|
-
description: "Nav section name shared by related models."
|
|
548
|
+
description: "Nav section name shared by related models.",
|
|
549
|
+
userText: true
|
|
537
550
|
}
|
|
538
551
|
}),
|
|
539
552
|
order: new _atscript_core.AnnotationSpec({
|
|
@@ -559,7 +572,8 @@ const uiAnnotations = { ui: {
|
|
|
559
572
|
argument: {
|
|
560
573
|
name: "label",
|
|
561
574
|
type: "string",
|
|
562
|
-
description: "Button label text"
|
|
575
|
+
description: "Button label text",
|
|
576
|
+
userText: true
|
|
563
577
|
}
|
|
564
578
|
}) },
|
|
565
579
|
remove: { label: new _atscript_core.AnnotationSpec({
|
|
@@ -568,7 +582,8 @@ const uiAnnotations = { ui: {
|
|
|
568
582
|
argument: {
|
|
569
583
|
name: "label",
|
|
570
584
|
type: "string",
|
|
571
|
-
description: "Button label text"
|
|
585
|
+
description: "Button label text",
|
|
586
|
+
userText: true
|
|
572
587
|
}
|
|
573
588
|
}) }
|
|
574
589
|
}
|
|
@@ -75,7 +75,8 @@ const uiAnnotations = { ui: {
|
|
|
75
75
|
argument: {
|
|
76
76
|
name: "text",
|
|
77
77
|
type: "string",
|
|
78
|
-
description: "The placeholder text to display in UI input fields."
|
|
78
|
+
description: "The placeholder text to display in UI input fields.",
|
|
79
|
+
userText: true
|
|
79
80
|
}
|
|
80
81
|
}),
|
|
81
82
|
hint: new AnnotationSpec({
|
|
@@ -84,7 +85,8 @@ const uiAnnotations = { ui: {
|
|
|
84
85
|
argument: {
|
|
85
86
|
name: "text",
|
|
86
87
|
type: "string",
|
|
87
|
-
description: "Help text or tooltip content."
|
|
88
|
+
description: "Help text or tooltip content.",
|
|
89
|
+
userText: true
|
|
88
90
|
}
|
|
89
91
|
}),
|
|
90
92
|
classes: new AnnotationSpec({
|
|
@@ -139,13 +141,17 @@ const uiAnnotations = { ui: {
|
|
|
139
141
|
argument: [{
|
|
140
142
|
name: "label",
|
|
141
143
|
type: "string",
|
|
142
|
-
description: "Display label for the option"
|
|
144
|
+
description: "Display label for the option",
|
|
145
|
+
userText: true
|
|
143
146
|
}, {
|
|
144
147
|
name: "value",
|
|
145
148
|
type: "string",
|
|
146
149
|
optional: true,
|
|
147
150
|
description: "Value/key for the option (defaults to label if omitted)"
|
|
148
|
-
}]
|
|
151
|
+
}],
|
|
152
|
+
modify(_token, args) {
|
|
153
|
+
if (args.length === 1) args.push(args[0].clone({}));
|
|
154
|
+
}
|
|
149
155
|
}),
|
|
150
156
|
order: new AnnotationSpec({
|
|
151
157
|
description: "Explicit form-field ordering (lower values render first).",
|
|
@@ -240,7 +246,8 @@ const uiAnnotations = { ui: {
|
|
|
240
246
|
argument: {
|
|
241
247
|
name: "text",
|
|
242
248
|
type: "string",
|
|
243
|
-
description: "Submit button label"
|
|
249
|
+
description: "Submit button label",
|
|
250
|
+
userText: true
|
|
244
251
|
}
|
|
245
252
|
}) },
|
|
246
253
|
label: { singular: new AnnotationSpec({
|
|
@@ -249,7 +256,8 @@ const uiAnnotations = { ui: {
|
|
|
249
256
|
argument: {
|
|
250
257
|
name: "singular",
|
|
251
258
|
type: "string",
|
|
252
|
-
description: "Singular label, e.g. \"phone number\" for a `phones` field."
|
|
259
|
+
description: "Singular label, e.g. \"phone number\" for a `phones` field.",
|
|
260
|
+
userText: true
|
|
253
261
|
}
|
|
254
262
|
}) },
|
|
255
263
|
pushDown: new AnnotationSpec({
|
|
@@ -267,7 +275,8 @@ const uiAnnotations = { ui: {
|
|
|
267
275
|
name: "label",
|
|
268
276
|
type: "string",
|
|
269
277
|
optional: true,
|
|
270
|
-
description: "Display label for the action (falls back to @meta.label)"
|
|
278
|
+
description: "Display label for the action (falls back to @meta.label)",
|
|
279
|
+
userText: true
|
|
271
280
|
}]
|
|
272
281
|
}),
|
|
273
282
|
prefix: {
|
|
@@ -277,7 +286,8 @@ const uiAnnotations = { ui: {
|
|
|
277
286
|
argument: {
|
|
278
287
|
name: "value",
|
|
279
288
|
type: "string",
|
|
280
|
-
description: "Literal text to display before the input value."
|
|
289
|
+
description: "Literal text to display before the input value.",
|
|
290
|
+
userText: true
|
|
281
291
|
}
|
|
282
292
|
}),
|
|
283
293
|
ref: new AnnotationSpec({
|
|
@@ -307,7 +317,8 @@ const uiAnnotations = { ui: {
|
|
|
307
317
|
argument: {
|
|
308
318
|
name: "value",
|
|
309
319
|
type: "string",
|
|
310
|
-
description: "Literal text to display after the input value."
|
|
320
|
+
description: "Literal text to display after the input value.",
|
|
321
|
+
userText: true
|
|
311
322
|
}
|
|
312
323
|
}),
|
|
313
324
|
ref: new AnnotationSpec({
|
|
@@ -475,19 +486,20 @@ const uiAnnotations = { ui: {
|
|
|
475
486
|
})
|
|
476
487
|
},
|
|
477
488
|
literalLabel: new AnnotationSpec({
|
|
478
|
-
description: "Display label for one literal of a union (`'open' | 'closed'`). Repeat per literal; unlabelled literals keep their raw text. Used by form selects/radios, table cells, enum filter options, filter chips and export. A prop's labels are added to the referenced type's (`append` merge: the type's other labels stay); for the same literal the prop's label wins.\n\n**Example:**\n```atscript\n@ui.literalLabel 'in_progress', 'In progress'\nexport type Status = 'open' | 'in_progress'\n```\n",
|
|
489
|
+
description: "Display label for one literal of a union (`'open' | 'closed'`) or one value of a boolean (`'true'` / `'false'`). Repeat per literal; unlabelled literals keep their raw text, unlabelled booleans read Yes / No. Used by form selects/radios, read-only form fields, table cells, enum filter options, filter chips and export. A prop's labels are added to the referenced type's (`append` merge: the type's other labels stay); for the same literal the prop's label wins.\n\n**Example:**\n```atscript\n@ui.literalLabel 'in_progress', 'In progress'\nexport type Status = 'open' | 'in_progress'\n\n@ui.literalLabel 'true', 'Active'\n@ui.literalLabel 'false', 'Inactive'\nactive: boolean\n```\n",
|
|
479
490
|
nodeType: ["prop", "type"],
|
|
480
491
|
multiple: true,
|
|
481
492
|
mergeStrategy: "append",
|
|
482
493
|
argument: [{
|
|
483
494
|
name: "value",
|
|
484
495
|
type: "string",
|
|
485
|
-
description: "The literal as text (`'2'` for the number literal `2`).",
|
|
496
|
+
description: "The literal as text (`'2'` for the number literal `2`; `'true'` / `'false'` on a boolean).",
|
|
486
497
|
valueScope: literalLabelValues
|
|
487
498
|
}, {
|
|
488
499
|
name: "label",
|
|
489
500
|
type: "string",
|
|
490
|
-
description: "Display label."
|
|
501
|
+
description: "Display label.",
|
|
502
|
+
userText: true
|
|
491
503
|
}],
|
|
492
504
|
validate: validateLiteralLabel
|
|
493
505
|
}),
|
|
@@ -533,7 +545,8 @@ const uiAnnotations = { ui: {
|
|
|
533
545
|
argument: {
|
|
534
546
|
name: "group",
|
|
535
547
|
type: "string",
|
|
536
|
-
description: "Nav section name shared by related models."
|
|
548
|
+
description: "Nav section name shared by related models.",
|
|
549
|
+
userText: true
|
|
537
550
|
}
|
|
538
551
|
}),
|
|
539
552
|
order: new AnnotationSpec({
|
|
@@ -559,7 +572,8 @@ const uiAnnotations = { ui: {
|
|
|
559
572
|
argument: {
|
|
560
573
|
name: "label",
|
|
561
574
|
type: "string",
|
|
562
|
-
description: "Button label text"
|
|
575
|
+
description: "Button label text",
|
|
576
|
+
userText: true
|
|
563
577
|
}
|
|
564
578
|
}) },
|
|
565
579
|
remove: { label: new AnnotationSpec({
|
|
@@ -568,7 +582,8 @@ const uiAnnotations = { ui: {
|
|
|
568
582
|
argument: {
|
|
569
583
|
name: "label",
|
|
570
584
|
type: "string",
|
|
571
|
-
description: "Button label text"
|
|
585
|
+
description: "Button label text",
|
|
586
|
+
userText: true
|
|
572
587
|
}
|
|
573
588
|
}) }
|
|
574
589
|
}
|
|
@@ -119,9 +119,16 @@ function hostDesign(token, doc) {
|
|
|
119
119
|
const host = doc.annotatedDefinition(token.parentNode);
|
|
120
120
|
return host ? designOf(host.def, host.doc) : void 0;
|
|
121
121
|
}
|
|
122
|
-
/**
|
|
122
|
+
/** The values of a `boolean` host, as `@ui.literalLabel` names them. */
|
|
123
|
+
const BOOLEAN_VALUES = ["true", "false"];
|
|
124
|
+
/**
|
|
125
|
+
* Collects the values of a pure literal union or a `boolean` (`'true'` / `'false'`), or
|
|
126
|
+
* of an array of one; `null` / `undefined` members (`boolean | null`) have none. `false`
|
|
127
|
+
* when the host is anything else, `undefined` when it cannot be resolved.
|
|
128
|
+
*/
|
|
123
129
|
function collectLiterals(def, doc, out, depth = 0) {
|
|
124
130
|
let unresolved = false;
|
|
131
|
+
const start = out.length;
|
|
125
132
|
for (const leaf of leavesOf(def, doc, depth)) if (!leaf) unresolved = true;
|
|
126
133
|
else if (leaf.def.entity === "const") {
|
|
127
134
|
const text = leaf.def.token("identifier")?.text;
|
|
@@ -135,8 +142,10 @@ function collectLiterals(def, doc, out, depth = 0) {
|
|
|
135
142
|
const ok = collectLiterals(leaf.def.getDefinition(), leaf.doc, out, depth + 1);
|
|
136
143
|
if (ok === false) return false;
|
|
137
144
|
if (ok === void 0) unresolved = true;
|
|
138
|
-
} else
|
|
139
|
-
|
|
145
|
+
} else if (leaf.def.entity === "primitive" && (0, _atscript_db_shared.primitiveBaseType)(leaf.def) === "boolean") for (const text of BOOLEAN_VALUES) out.push({ text });
|
|
146
|
+
else if (!isEmptyLeaf(leaf.def)) return false;
|
|
147
|
+
if (unresolved) return void 0;
|
|
148
|
+
return out.length > start;
|
|
140
149
|
}
|
|
141
150
|
/** {@link collectLiterals} of the type an annotated node stands for. */
|
|
142
151
|
function collectHostLiterals(node, doc, out) {
|
|
@@ -346,7 +355,8 @@ function validateDistinct(token, _args, doc) {
|
|
|
346
355
|
/**
|
|
347
356
|
* `valueScope` of `@ui.literalLabel`'s `value`: the literals of the annotated
|
|
348
357
|
* union (or array of one), each linked to the literal it declares — completion
|
|
349
|
-
* offers them and go-to-definition on the value jumps to the literal.
|
|
358
|
+
* offers them and go-to-definition on the value jumps to the literal. A `boolean`
|
|
359
|
+
* host offers `'true'` / `'false'` (since 0.1.165).
|
|
350
360
|
*/
|
|
351
361
|
function literalLabelValues(annotationToken, doc) {
|
|
352
362
|
const found = [];
|
|
@@ -356,10 +366,10 @@ function literalLabelValues(annotationToken, doc) {
|
|
|
356
366
|
for (const { text, def, doc: declaring } of found) {
|
|
357
367
|
if (seen.has(text)) continue;
|
|
358
368
|
seen.add(text);
|
|
359
|
-
const token = def
|
|
369
|
+
const token = def?.token("identifier");
|
|
360
370
|
candidates.push({
|
|
361
371
|
value: text,
|
|
362
|
-
...token && { definition: {
|
|
372
|
+
...token && declaring && { definition: {
|
|
363
373
|
doc: declaring,
|
|
364
374
|
token
|
|
365
375
|
} }
|
|
@@ -375,7 +385,7 @@ function validateLiteralLabel(token, args, doc) {
|
|
|
375
385
|
const literals = found.map((l) => l.text);
|
|
376
386
|
if (pure === false) {
|
|
377
387
|
errors.push({
|
|
378
|
-
message: "@ui.literalLabel requires a union of literal values (or an array of one)",
|
|
388
|
+
message: "@ui.literalLabel requires a union of literal values or a boolean (or an array of one)",
|
|
379
389
|
severity: ERROR,
|
|
380
390
|
range: token.range
|
|
381
391
|
});
|