@whity/ui 0.5.0 → 1.0.1

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.
Files changed (208) hide show
  1. package/README.md +107 -107
  2. package/package.json +223 -192
  3. package/src/access-denied.stories.tsx +179 -179
  4. package/src/access-denied.tsx +305 -305
  5. package/src/action-proposal.tsx +338 -302
  6. package/src/actor-chip.tsx +71 -71
  7. package/src/agent-activity.tsx +163 -163
  8. package/src/agent-collaboration.stories.tsx +156 -156
  9. package/src/agent-run-status.tsx +196 -196
  10. package/src/alert-dialog.stories.tsx +45 -45
  11. package/src/alert-dialog.tsx +147 -147
  12. package/src/alert.stories.tsx +91 -91
  13. package/src/alert.tsx +89 -89
  14. package/src/app-sidebar.stories.tsx +195 -195
  15. package/src/app-sidebar.tsx +604 -500
  16. package/src/approval-queue.tsx +109 -108
  17. package/src/audience-group-picker.stories.tsx +198 -198
  18. package/src/audience-group-picker.tsx +362 -362
  19. package/src/audience-people-picker.stories.tsx +102 -102
  20. package/src/audience-people-picker.tsx +279 -279
  21. package/src/avatar-pattern.ts +138 -0
  22. package/src/avatar.tsx +125 -83
  23. package/src/badge.stories.tsx +105 -105
  24. package/src/badge.tsx +68 -68
  25. package/src/beta-warning.stories.tsx +79 -79
  26. package/src/beta-warning.tsx +189 -189
  27. package/src/bilingual-input.stories.tsx +82 -82
  28. package/src/bilingual-input.tsx +188 -183
  29. package/src/board.tsx +216 -0
  30. package/src/breadcrumb.stories.tsx +51 -51
  31. package/src/breadcrumb.tsx +90 -90
  32. package/src/built-on-whity.tsx +52 -0
  33. package/src/button.stories.tsx +87 -87
  34. package/src/button.tsx +125 -118
  35. package/src/card.stories.tsx +423 -423
  36. package/src/card.tsx +180 -180
  37. package/src/chart.stories.tsx +66 -66
  38. package/src/chart.tsx +228 -228
  39. package/src/checkbox.stories.tsx +62 -62
  40. package/src/checkbox.tsx +54 -54
  41. package/src/collapsible.stories.tsx +48 -48
  42. package/src/collapsible.tsx +34 -34
  43. package/src/color-card.stories.tsx +61 -61
  44. package/src/color-card.tsx +270 -270
  45. package/src/color-picker.stories.tsx +65 -65
  46. package/src/color-picker.tsx +425 -425
  47. package/src/column-matcher.tsx +84 -0
  48. package/src/command-palette.tsx +399 -306
  49. package/src/confirm-action.tsx +98 -0
  50. package/src/copy-block.stories.tsx +38 -38
  51. package/src/copy-block.tsx +85 -85
  52. package/src/data-table.stories.tsx +200 -200
  53. package/src/data-table.tsx +1687 -1106
  54. package/src/date-picker.stories.tsx +61 -61
  55. package/src/date-picker.tsx +457 -422
  56. package/src/design-cards.stories.tsx +551 -458
  57. package/src/dialog.stories.tsx +48 -48
  58. package/src/dialog.tsx +179 -166
  59. package/src/display-preferences.tsx +59 -0
  60. package/src/documents/barcode-svg.stories.tsx +72 -72
  61. package/src/documents/barcode-svg.tsx +79 -79
  62. package/src/dropdown-menu.stories.tsx +77 -77
  63. package/src/dropdown-menu.tsx +271 -271
  64. package/src/editor/agent-panel.tsx +222 -0
  65. package/src/editor/agents.stories.tsx +81 -0
  66. package/src/editor/agents.ts +55 -0
  67. package/src/editor/behaviour.ts +279 -279
  68. package/src/editor/block-ids.ts +44 -44
  69. package/src/editor/block-list.tsx +104 -101
  70. package/src/editor/block-toolbar.tsx +490 -477
  71. package/src/editor/bubble.tsx +119 -93
  72. package/src/editor/catalogue.ts +169 -103
  73. package/src/editor/collab-rail.tsx +746 -746
  74. package/src/editor/collab.stories.tsx +207 -207
  75. package/src/editor/collab.ts +87 -87
  76. package/src/editor/contract.ts +476 -408
  77. package/src/editor/convert.ts +414 -362
  78. package/src/editor/doc-editor.stories.tsx +98 -98
  79. package/src/editor/doc-editor.tsx +1492 -1287
  80. package/src/editor/editor.css +636 -536
  81. package/src/editor/extensions.ts +86 -86
  82. package/src/editor/field-bar.tsx +154 -0
  83. package/src/editor/field-picker.tsx +109 -107
  84. package/src/editor/fields.ts +100 -100
  85. package/src/editor/gutter.tsx +443 -367
  86. package/src/editor/index.ts +23 -22
  87. package/src/editor/label-sheet.tsx +289 -289
  88. package/src/editor/labels.ts +394 -310
  89. package/src/editor/link-tools.tsx +141 -141
  90. package/src/editor/node-views.tsx +461 -450
  91. package/src/editor/page-view.tsx +372 -353
  92. package/src/editor/phone.tsx +310 -0
  93. package/src/editor/plugin-block-view.tsx +230 -0
  94. package/src/editor/plugin-blocks.stories.tsx +96 -0
  95. package/src/editor/plugin-blocks.ts +52 -0
  96. package/src/editor/publish-check.tsx +201 -182
  97. package/src/editor/rich-blocks.stories.tsx +146 -146
  98. package/src/editor/sample.ts +40 -40
  99. package/src/editor/save-block-dialog.tsx +141 -0
  100. package/src/editor/saved-block-view.tsx +205 -0
  101. package/src/editor/saved-blocks.stories.tsx +105 -0
  102. package/src/editor/saved-parts.ts +192 -0
  103. package/src/editor/schema-rich.ts +156 -150
  104. package/src/editor/schema.ts +368 -315
  105. package/src/editor/services.tsx +205 -127
  106. package/src/editor/slash.ts +64 -64
  107. package/src/editor/suggesting.ts +372 -372
  108. package/src/editor/suggestions.ts +763 -763
  109. package/src/editor/table-keys.ts +66 -66
  110. package/src/editor/templates.stories.tsx +324 -324
  111. package/src/editor/toolbar.tsx +364 -358
  112. package/src/empty-state.stories.tsx +51 -51
  113. package/src/empty-state.tsx +126 -100
  114. package/src/empty-state.usage-notes.md +30 -30
  115. package/src/form.stories.tsx +112 -112
  116. package/src/form.tsx +176 -176
  117. package/src/globals.css +20 -20
  118. package/src/icon-button.tsx +85 -85
  119. package/src/icon-map.ts +335 -244
  120. package/src/icon.tsx +41 -41
  121. package/src/index.ts +92 -67
  122. package/src/input.stories.tsx +157 -157
  123. package/src/input.tsx +768 -759
  124. package/src/kpi-strip.tsx +47 -0
  125. package/src/localized-text.ts +76 -0
  126. package/src/locked-screen.stories.tsx +29 -29
  127. package/src/locked-screen.tsx +75 -61
  128. package/src/lockup.tsx +42 -0
  129. package/src/lottie.tsx +441 -0
  130. package/src/mark.tsx +62 -62
  131. package/src/math-text.stories.tsx +33 -33
  132. package/src/math-text.tsx +43 -43
  133. package/src/menu-bar.stories.tsx +198 -198
  134. package/src/menu-bar.tsx +373 -373
  135. package/src/message-thread.tsx +181 -0
  136. package/src/money/currency.ts +244 -230
  137. package/src/money/money-input.tsx +131 -0
  138. package/src/money/money.tsx +33 -0
  139. package/src/open-on-computer.tsx +150 -0
  140. package/src/otp-input.tsx +161 -0
  141. package/src/page-header.stories.tsx +95 -95
  142. package/src/page-header.tsx +122 -122
  143. package/src/page-shell.stories.tsx +42 -42
  144. package/src/page-shell.tsx +32 -32
  145. package/src/page-states.tsx +277 -0
  146. package/src/pagination.stories.tsx +45 -45
  147. package/src/pagination.tsx +98 -98
  148. package/src/paper-sheet.stories.tsx +88 -0
  149. package/src/paper-sheet.tsx +85 -0
  150. package/src/phone-input.tsx +252 -0
  151. package/src/phone-tab-bar.tsx +152 -0
  152. package/src/plugin-card.stories.tsx +208 -180
  153. package/src/plugin-card.tsx +931 -848
  154. package/src/popover.stories.tsx +48 -48
  155. package/src/popover.tsx +55 -55
  156. package/src/radio-group.stories.tsx +26 -26
  157. package/src/radio-group.tsx +44 -44
  158. package/src/role-summary.stories.tsx +143 -0
  159. package/src/role-summary.tsx +120 -0
  160. package/src/route-flow/editor.tsx +1087 -1014
  161. package/src/route-flow/model.ts +771 -716
  162. package/src/save-bar.tsx +94 -0
  163. package/src/scope-grant.tsx +139 -139
  164. package/src/screen-too-small.stories.tsx +61 -61
  165. package/src/screen-too-small.tsx +104 -104
  166. package/src/search-field.tsx +65 -0
  167. package/src/select.stories.tsx +44 -44
  168. package/src/select.tsx +197 -197
  169. package/src/separator.stories.tsx +34 -34
  170. package/src/separator.tsx +34 -34
  171. package/src/sheet.stories.tsx +49 -49
  172. package/src/sheet.tsx +168 -168
  173. package/src/skeleton.stories.tsx +28 -28
  174. package/src/skeleton.tsx +19 -19
  175. package/src/slider.stories.tsx +78 -78
  176. package/src/slider.tsx +300 -300
  177. package/src/spinner.stories.tsx +33 -33
  178. package/src/spinner.tsx +55 -55
  179. package/src/stepper.tsx +85 -0
  180. package/src/switch.stories.tsx +42 -42
  181. package/src/switch.tsx +41 -41
  182. package/src/switcher.stories.tsx +111 -111
  183. package/src/switcher.tsx +131 -131
  184. package/src/system-state.tsx +55 -0
  185. package/src/table.stories.tsx +48 -48
  186. package/src/table.tsx +121 -121
  187. package/src/tabs.stories.tsx +74 -74
  188. package/src/tabs.tsx +90 -90
  189. package/src/tag-input.stories.tsx +67 -67
  190. package/src/tag-input.tsx +117 -117
  191. package/src/tenant-logo.tsx +63 -63
  192. package/src/tenant-switcher.stories.tsx +38 -38
  193. package/src/tenant-switcher.tsx +185 -164
  194. package/src/textarea.stories.tsx +27 -27
  195. package/src/textarea.tsx +18 -18
  196. package/src/theme-mode.ts +74 -52
  197. package/src/time-grid.tsx +163 -0
  198. package/src/time-picker.stories.tsx +62 -62
  199. package/src/time-picker.tsx +616 -615
  200. package/src/toggle-group.tsx +139 -138
  201. package/src/tooltip.stories.tsx +43 -43
  202. package/src/tooltip.tsx +73 -73
  203. package/src/top-nav.stories.tsx +58 -58
  204. package/src/top-nav.tsx +324 -324
  205. package/src/undo-bar.tsx +107 -107
  206. package/src/utils.ts +45 -45
  207. package/src/view-toggle.stories.tsx +84 -84
  208. package/src/view-toggle.tsx +111 -110
@@ -1,310 +1,394 @@
1
- /**
2
- * Every string the editor shows, with its English default. Pass Arabic (or
3
- * any language) through `labels`; the feature layer fills it from t().
4
- */
5
- export const EDITOR_LABELS = {
6
- back: "Back",
7
- documentTitle: "Document title",
8
- untitled: "Untitled",
9
- saved: "Saved {time}",
10
- saving: "Saving…",
11
- offline: "Offline. Changes save when you’re back online",
12
- saveFailed: "Not saved. Try again",
13
- modeEditing: "Editing",
14
- modeViewing: "Viewing",
15
- modeMenu: "Mode",
16
- modeEditingHint: "Change the document directly",
17
- modeViewingHint: "Read only",
18
- formatting: "Formatting",
19
- undo: "Undo",
20
- redo: "Redo",
21
- styleMenu: "Text style",
22
- normalText: "Normal text",
23
- bold: "Bold",
24
- italic: "Italic",
25
- underline: "Underline",
26
- strike: "Strikethrough",
27
- code: "Code",
28
- link: "Link",
29
- highlight: "Highlight",
30
- insert: "Insert",
31
- outline: "Outline",
32
- outlineEmpty: "Headings appear here",
33
- selection: "Selection",
34
- linkAddress: "Link address",
35
- linkApply: "Apply",
36
- linkOpen: "Open link",
37
- linkCopy: "Copy link",
38
- linkEdit: "Edit link",
39
- linkRemove: "Remove link",
40
- addBelow: "Add a block below",
41
- dragHandle: "Drag to move, click for options",
42
- blockMenu: "Block options",
43
- turnInto: "Turn into",
44
- duplicate: "Duplicate",
45
- copyLinkToBlock: "Copy link to block",
46
- moveUp: "Move up",
47
- moveDown: "Move down",
48
- delete: "Delete",
49
- searchBlocks: "Search blocks",
50
- noBlocks: "No blocks match",
51
- slashMove: "↑↓ to move",
52
- slashInsert: "Enter to insert",
53
- slashInsertAfter: "Enter inserts after this line",
54
- slashClose: "Esc to close",
55
- placeholder: "Type / for blocks, {{ for fields, or just write",
56
- laterBlock: "{block} block · edited in a later version",
57
- words: "{n} words",
58
- word: "1 word",
59
- lastEdited: "Last edited by {name} at {time}",
60
- english: "English",
61
- arabic: "Arabic",
62
- kindTemplate: "Template",
63
- kindLetter: "Letter",
64
- kindReport: "Report",
65
- kindNote: "Note",
66
- kindWiki: "Wiki page",
67
- kindLabel: "Label sheet",
68
- groupBasic: "Basic",
69
- groupLists: "Lists",
70
- groupStructure: "Structure",
71
- groupMedia: "Media",
72
- groupWhity: "Whity",
73
- blockCallout: "Callout",
74
- blockCalloutHint: "A note or something important",
75
- blockToggle: "Toggle",
76
- blockToggleHint: "A line that hides blocks under it",
77
- blockColumns: "Columns",
78
- blockColumnsHint: "Two columns side by side",
79
- blockPageBreak: "Page break",
80
- blockPageBreakHint: "Start a new page when printed",
81
- blockTable: "Table",
82
- blockTableHint: "Rows and columns",
83
- blockImage: "Image",
84
- blockImageHint: "A picture with a caption",
85
- blockFile: "File",
86
- blockFileHint: "A file to download",
87
- blockRecord: "Record",
88
- blockRecordHint: "A live invoice, customer or any record",
89
- blockChart: "Chart",
90
- blockChartHint: "A live chart",
91
- blockSignature: "Signature and stamp",
92
- blockSignatureHint: "For letters and contracts",
93
- blockBarcode: "Barcode",
94
- blockBarcodeHint: "Code 128, EAN-13 or Code 39",
95
- blockQr: "QR code",
96
- blockQrHint: "A link or value as a QR code",
97
- blockMath: "Maths",
98
- blockMathHint: "A formula in TeX",
99
- toggleOpen: "Show what’s inside",
100
- toggleClose: "Hide what’s inside",
101
- imageEmpty: "Choose an image",
102
- fileEmpty: "Choose a file",
103
- fileDownload: "Download {name}",
104
- live: "Live",
105
- recordEmpty: "Choose a record",
106
- recordHidden: "You can’t see this record",
107
- recordUnavailable: "Records aren’t available here",
108
- recordFailed: "The record didn’t load",
109
- chartEmpty: "Choose what the chart shows",
110
- chartHidden: "You can’t see this chart’s data",
111
- chartUnavailable: "Charts aren’t available here",
112
- chartFailed: "The chart didn’t load",
113
- chartNoData: "No data yet",
114
- chartLiveRange: "{range} · live",
115
- chartShowTable: "Show as table",
116
- chartShowChart: "Show as chart",
117
- chartCategory: "Item",
118
- signatureName: "Name",
119
- signatureDate: "Date",
120
- signatureStamp: "Company stamp",
121
- barcodeEmpty: "Set the barcode’s value",
122
- qrEmpty: "Set the QR code’s value",
123
- codeFromField: "Drawn from {value} when printed",
124
- mathEmpty: "Write a formula",
125
- blockToolbar: "Block",
126
- calloutNote: "Note",
127
- calloutImportant: "Important",
128
- widthHalf: "Half width",
129
- widthWide: "Wide",
130
- widthFull: "Full width",
131
- caption: "Caption",
132
- altText: "Alt text",
133
- replace: "Replace",
134
- upload: "Upload",
135
- uploading: "Uploading…",
136
- uploadFailed: "The upload didn’t finish. Try again.",
137
- headerRow: "Header row",
138
- addRow: "Row",
139
- addColumn: "Column",
140
- deleteRow: "Delete row",
141
- deleteColumn: "Delete column",
142
- columnAlign: "Column alignment",
143
- alignStart: "Align to start",
144
- alignEnd: "Align to end",
145
- deleteBlock: "Delete block",
146
- recordChoose: "Change record",
147
- recordType: "Record type",
148
- recordId: "Record",
149
- viewCard: "Card",
150
- viewSummary: "Summary",
151
- chartBar: "Bars",
152
- chartLine: "Line",
153
- chartDonut: "Donut",
154
- chartSource: "Data",
155
- chartTitle: "Title",
156
- addSigner: "Signer",
157
- signerRole: "Role",
158
- stamp: "Stamp",
159
- symbology: "Type",
160
- value: "Value",
161
- showText: "Show the value under it",
162
- formula: "Formula",
163
- done: "Done",
164
- blockText: "Text",
165
- blockTextHint: "Plain paragraph",
166
- blockH1: "Heading 1",
167
- blockH1Hint: "Big section heading",
168
- blockH2: "Heading 2",
169
- blockH2Hint: "Medium heading",
170
- blockH3: "Heading 3",
171
- blockH3Hint: "Small heading",
172
- blockQuote: "Quote",
173
- blockQuoteHint: "A quotation",
174
- blockCode: "Code",
175
- blockCodeHint: "Code or a fixed-width snippet",
176
- blockBullet: "Bulleted list",
177
- blockBulletHint: "A simple list",
178
- blockNumber: "Numbered list",
179
- blockNumberHint: "A list with numbers",
180
- blockChecklist: "Checklist",
181
- blockChecklistHint: "Tasks with checkboxes",
182
- blockDivider: "Divider",
183
- blockDividerHint: "A line between sections",
184
- field: "Field",
185
- fieldPicker: "Fields",
186
- fieldSearch: "Search fields",
187
- noFields: "No fields match",
188
- fieldMissing: "No value for this record",
189
- zoom: "Zoom",
190
- zoomFit: "Fit width",
191
- zoomPercent: "{n}%",
192
- view: "View",
193
- viewContinuous: "Continuous",
194
- viewPage: "Page view",
195
- pageOf: "Page {page} of {pages}",
196
- pageContinued: "{title} · continued",
197
- pageSetup: "A4 · margins 16 mm",
198
- reference: "Ref",
199
- preview: "Preview",
200
- previewingWith: "Previewing with",
201
- changeRecord: "Change record",
202
- showFields: "Show fields",
203
- previewStatus: "Previewing {record}: as it will print, read-only",
204
- previewEditingStatus: "Previewing {record}: as it will print",
205
- pdf: "PDF",
206
- publish: "Publish",
207
- draftSaved: "Draft saved {time}",
208
- publishedInUse: "published version {n} is in use",
209
- notPublished: "not published yet",
210
- publishTitle: "Before you publish",
211
- publishExplain: "Publishing makes this draft the version Whity Render and agents use.",
212
- publishExplainFor: "Publishing makes this draft the version Whity Render and agents use for every {records}.",
213
- publishChecking: "Checking the template…",
214
- publishBlockers: "What blocks publishing",
215
- publishClear: "Nothing blocks publishing.",
216
- publishFailed: "Not published. Try again",
217
- publishVersion: "Publish version {n}",
218
- keepEditing: "Keep editing",
219
- review: "Review",
220
- show: "Show",
221
- blockerSuggestion: "1 open suggestion",
222
- blockerSuggestions: "{n} open suggestions",
223
- blockerSuggestionsHint: "Accept or reject them first.",
224
- blockerPlugin: "{plugin} is turned off",
225
- blockerPluginHint: "Its blocks can’t be printed until it’s on again.",
226
- blockerNoPrint: "A block has no print view",
227
- blockerNoPrintHint: "It can’t be printed. Remove it, or keep it for notes.",
228
- blockerField: "{field} isn’t a field of this record type",
229
- blockerFieldHint: "Remove it, or pick a field the record has.",
230
- blockerTheme: "This document uses a theme the workspace doesn’t have: {ref}",
231
- blockerThemeHint: "Choose another theme or restore it.",
232
- labelGrid: "{columns} × {rows} labels",
233
- labelStock: "Label stock",
234
- labelCertificate: "Certificate",
235
- labelSheet: "Sheet",
236
- labelColumns: "Columns",
237
- labelRows: "Rows",
238
- labelWidth: "Label width (mm)",
239
- labelHeight: "Label height (mm)",
240
- labelGapX: "Gap between columns (mm)",
241
- labelGapY: "Gap between rows (mm)",
242
- labelTooBig: "The labels don’t fit on the sheet.",
243
- labelOverflow: "Doesn’t fit the label",
244
- labelsPerSheet: "{n} labels a sheet",
245
- printLabels: "Print labels",
246
- fieldsThisTemplate: "This template",
247
- fieldNew: "New field “{name}”",
248
- fieldNewHint: "Type a name to add a field of this template.",
249
- modeSuggesting: "Suggesting",
250
- modeSuggestingHint: "Your edits become suggestions to accept",
251
- modeSuggestingHintNoEdit: "An editor accepts your changes",
252
- modeEditingLocked: "Ask an owner for edit access",
253
- modeViewingCommentHint: "Read and comment, nothing changes",
254
- comment: "Comment",
255
- commentsAndSuggestions: "Comments and suggestions",
256
- close: "Close",
257
- cancel: "Cancel",
258
- commentPlaceholder: "Comment or add others with @",
259
- replyPlaceholder: "Reply or add others with @",
260
- reply: "Reply",
261
- resolve: "Resolve",
262
- reopen: "Reopen",
263
- resolvedBy: "Resolved by {name} · {time}",
264
- accept: "Accept",
265
- reject: "Reject",
266
- railAll: "All",
267
- acceptAll: "Accept all",
268
- rejectAll: "Reject all",
269
- acceptAllFrom: "Accept all from {name}",
270
- rejectAllFrom: "Reject all from {name}",
271
- countSuggestion: "1 suggestion",
272
- countSuggestions: "{n} suggestions",
273
- countComment: "1 comment",
274
- countComments: "{n} comments",
275
- countResolved: "{n} resolved",
276
- tabAll: "All",
277
- tabComments: "Comments",
278
- tabSuggestions: "Suggestions",
279
- tabResolved: "Resolved",
280
- railEmpty: "No comments or suggestions yet. Select text and choose Comment.",
281
- resolvedEmpty: "No resolved comments",
282
- mentionPeople: "People",
283
- mentionNone: "No one matches",
284
- mentionHint: "Type a name to mention someone",
285
- you: "You",
286
- now: "now",
287
- oneReply: "1 reply",
288
- replies: "{n} replies",
289
- actorFor: "for",
290
- sugReplace: "Replace {from} with {to}",
291
- sugAdd: "Add {text}",
292
- sugDelete: "Delete {text}",
293
- sugFormat: "Make {text} {mark}",
294
- sugUnformat: "Remove {mark} from {text}",
295
- sugAddBlocks: "Add {text}",
296
- sugDeleteBlocks: "Delete {text}",
297
- sugMoveBlock: "Move {text}",
298
- sugBlock: "a block",
299
- sugSending: "Sending…",
300
- sugUnplaced: "Its text has changed since",
301
- sugRefused: "That change can’t be a suggestion yet, so it was undone.",
302
- collabFailed: "That didn’t work. Try again.",
303
- }
304
-
305
- export type EditorLabels = typeof EDITOR_LABELS
306
-
307
- /** Fill `{name}` placeholders. */
308
- export function fill(template: string, values: Record<string, string | number>): string {
309
- return template.replace(/\{(\w+)\}/g, (_, key: string) => String(values[key] ?? `{${key}}`))
310
- }
1
+ /**
2
+ * Every string the editor shows, with its English default. Pass Arabic (or
3
+ * any language) through `labels`; the feature layer fills it from t().
4
+ */
5
+ export const EDITOR_LABELS = {
6
+ back: "Back",
7
+ documentTitle: "Document title",
8
+ untitled: "Untitled",
9
+ saved: "Saved {time}",
10
+ saving: "Saving…",
11
+ offline: "Offline. Changes save when you’re back online",
12
+ saveFailed: "Not saved. Try again",
13
+ modeEditing: "Editing",
14
+ modeViewing: "Viewing",
15
+ modeMenu: "Mode",
16
+ modeEditingHint: "Change the document directly",
17
+ modeViewingHint: "Read only",
18
+ formatting: "Formatting",
19
+ undo: "Undo",
20
+ redo: "Redo",
21
+ styleMenu: "Text style",
22
+ normalText: "Normal text",
23
+ bold: "Bold",
24
+ italic: "Italic",
25
+ underline: "Underline",
26
+ strike: "Strikethrough",
27
+ code: "Code",
28
+ link: "Link",
29
+ highlight: "Highlight",
30
+ insert: "Insert",
31
+ moreTools: "More tools",
32
+ hideKeyboard: "Hide keyboard",
33
+ outline: "Outline",
34
+ outlineEmpty: "Headings appear here",
35
+ selection: "Selection",
36
+ linkAddress: "Link address",
37
+ linkApply: "Apply",
38
+ linkOpen: "Open link",
39
+ linkCopy: "Copy link",
40
+ linkEdit: "Edit link",
41
+ linkRemove: "Remove link",
42
+ addBelow: "Add a block below",
43
+ dragHandle: "Drag to move, click for options",
44
+ blockMenu: "Block options",
45
+ turnInto: "Turn into",
46
+ duplicate: "Duplicate",
47
+ copyLinkToBlock: "Copy link to block",
48
+ moveUp: "Move up",
49
+ moveDown: "Move down",
50
+ delete: "Delete",
51
+ searchBlocks: "Search blocks",
52
+ noBlocks: "No blocks match",
53
+ slashMove: "↑↓ to move",
54
+ slashInsert: "Enter to insert",
55
+ slashInsertAfter: "Enter inserts after this line",
56
+ slashClose: "Esc to close",
57
+ placeholder: "Type / for blocks, {{ for fields, or just write",
58
+ laterBlock: "{block} block · edited in a later version",
59
+ words: "{n} words",
60
+ word: "1 word",
61
+ lastEdited: "Last edited by {name} at {time}",
62
+ lastEditedAt: "Last edited at {time}",
63
+ english: "English",
64
+ arabic: "Arabic",
65
+ kindTemplate: "Template",
66
+ kindLetter: "Letter",
67
+ kindReport: "Report",
68
+ kindNote: "Note",
69
+ kindWiki: "Wiki page",
70
+ kindLabel: "Label sheet",
71
+ groupBasic: "Basic",
72
+ groupLists: "Lists",
73
+ groupStructure: "Structure",
74
+ groupMedia: "Media",
75
+ groupWhity: "Whity",
76
+ groupSaved: "Saved blocks",
77
+ groupPlugin: "Plugins",
78
+ blockCallout: "Callout",
79
+ blockCalloutHint: "A note or something important",
80
+ blockToggle: "Toggle",
81
+ blockToggleHint: "A line that hides blocks under it",
82
+ blockColumns: "Columns",
83
+ blockColumnsHint: "Two columns side by side",
84
+ blockPageBreak: "Page break",
85
+ blockPageBreakHint: "Start a new page when printed",
86
+ blockTable: "Table",
87
+ blockTableHint: "Rows and columns",
88
+ blockImage: "Image",
89
+ blockImageHint: "A picture with a caption",
90
+ blockFile: "File",
91
+ blockFileHint: "A file to download",
92
+ blockRecord: "Record",
93
+ blockRecordHint: "A live invoice, customer or any record",
94
+ blockChart: "Chart",
95
+ blockChartHint: "A live chart",
96
+ blockSignature: "Signature and stamp",
97
+ blockSignatureHint: "For letters and contracts",
98
+ blockBarcode: "Barcode",
99
+ blockBarcodeHint: "Code 128, EAN-13 or Code 39",
100
+ blockQr: "QR code",
101
+ blockQrHint: "A link or value as a QR code",
102
+ blockMath: "Maths",
103
+ blockMathHint: "A formula in TeX",
104
+ toggleOpen: "Show what’s inside",
105
+ toggleClose: "Hide what’s inside",
106
+ imageEmpty: "Choose an image",
107
+ fileEmpty: "Choose a file",
108
+ fileDownload: "Download {name}",
109
+ live: "Live",
110
+ recordEmpty: "Choose a record",
111
+ recordHidden: "You can’t see this record",
112
+ recordUnavailable: "Records aren’t available here",
113
+ recordFailed: "The record didn’t load",
114
+ chartEmpty: "Choose what the chart shows",
115
+ chartHidden: "You can’t see this chart’s data",
116
+ chartUnavailable: "Charts aren’t available here",
117
+ chartFailed: "The chart didn’t load",
118
+ chartNoData: "No data yet",
119
+ chartLiveRange: "{range} · live",
120
+ chartShowTable: "Show as table",
121
+ chartShowChart: "Show as chart",
122
+ chartCategory: "Item",
123
+ signatureName: "Name",
124
+ signatureDate: "Date",
125
+ signatureStamp: "Company stamp",
126
+ barcodeEmpty: "Set the barcode’s value",
127
+ qrEmpty: "Set the QR code’s value",
128
+ codeFromField: "Drawn from {value} when printed",
129
+ mathEmpty: "Write a formula",
130
+ blockToolbar: "Block",
131
+ calloutNote: "Note",
132
+ calloutImportant: "Important",
133
+ widthHalf: "Half width",
134
+ widthWide: "Wide",
135
+ widthFull: "Full width",
136
+ caption: "Caption",
137
+ altText: "Alt text",
138
+ replace: "Replace",
139
+ upload: "Upload",
140
+ uploading: "Uploading…",
141
+ uploadFailed: "The upload didn’t finish. Try again.",
142
+ headerRow: "Header row",
143
+ addRow: "Row",
144
+ addColumn: "Column",
145
+ deleteRow: "Delete row",
146
+ deleteColumn: "Delete column",
147
+ columnAlign: "Column alignment",
148
+ alignStart: "Align to start",
149
+ alignEnd: "Align to end",
150
+ deleteBlock: "Delete block",
151
+ recordChoose: "Change record",
152
+ recordType: "Record type",
153
+ recordId: "Record",
154
+ viewCard: "Card",
155
+ viewSummary: "Summary",
156
+ chartBar: "Bars",
157
+ chartLine: "Line",
158
+ chartDonut: "Donut",
159
+ chartSource: "Data",
160
+ chartTitle: "Title",
161
+ addSigner: "Signer",
162
+ signerRole: "Role",
163
+ stamp: "Stamp",
164
+ symbology: "Type",
165
+ value: "Value",
166
+ showText: "Show the value under it",
167
+ formula: "Formula",
168
+ done: "Done",
169
+ blockText: "Text",
170
+ blockTextHint: "Plain paragraph",
171
+ blockH1: "Heading 1",
172
+ blockH1Hint: "Big section heading",
173
+ blockH2: "Heading 2",
174
+ blockH2Hint: "Medium heading",
175
+ blockH3: "Heading 3",
176
+ blockH3Hint: "Small heading",
177
+ blockQuote: "Quote",
178
+ blockQuoteHint: "A quotation",
179
+ blockCode: "Code",
180
+ blockCodeHint: "Code or a fixed-width snippet",
181
+ blockBullet: "Bulleted list",
182
+ blockBulletHint: "A simple list",
183
+ blockNumber: "Numbered list",
184
+ blockNumberHint: "A list with numbers",
185
+ blockChecklist: "Checklist",
186
+ blockChecklistHint: "Tasks with checkboxes",
187
+ blockDivider: "Divider",
188
+ blockDividerHint: "A line between sections",
189
+ field: "Field",
190
+ fieldPicker: "Fields",
191
+ fieldSearch: "Search fields",
192
+ fieldBar: "Field",
193
+ fieldExample: "e.g.",
194
+ fieldChange: "Change field",
195
+ fieldRemove: "Remove field",
196
+ noFields: "No fields match",
197
+ fieldMissing: "No value for this record",
198
+ zoom: "Zoom",
199
+ zoomFit: "Fit width",
200
+ zoomPercent: "{n}%",
201
+ view: "View",
202
+ viewContinuous: "Continuous",
203
+ viewPage: "Page view",
204
+ pageOf: "Page {page} of {pages}",
205
+ pageContinued: "{title} · continued",
206
+ pageSetup: "A4 · margins 16 mm",
207
+ reference: "Ref",
208
+ preview: "Preview",
209
+ previewingWith: "Previewing with",
210
+ changeRecord: "Change record",
211
+ showFields: "Show fields",
212
+ backToEditing: "Back to editing",
213
+ exampleValues: "example values",
214
+ typedValues: "the values you type",
215
+ previewStatus: "Previewing {record}: as it will print, read-only",
216
+ previewEditingStatus: "Previewing {record}: as it will print",
217
+ pdf: "PDF",
218
+ publish: "Publish",
219
+ draftSaved: "Draft saved {time}",
220
+ publishedInUse: "published version {n} is in use",
221
+ notPublished: "not published yet",
222
+ publishTitle: "Before you publish",
223
+ publishExplain: "Publishing makes this draft the version new documents are issued from.",
224
+ publishExplainFor: "Publishing makes this draft the version new documents are issued from, for every {records}.",
225
+ publishChecking: "Checking the template…",
226
+ publishBlockers: "What blocks publishing",
227
+ publishClear: "Nothing blocks publishing.",
228
+ publishFailed: "Not published. Try again",
229
+ publishVersion: "Publish version {n}",
230
+ keepEditing: "Keep editing",
231
+ review: "Review",
232
+ show: "Show",
233
+ blockerSuggestion: "1 open suggestion",
234
+ blockerSuggestions: "{n} open suggestions",
235
+ blockerSuggestionsHint: "Accept or reject them first.",
236
+ blockerPlugin: "{plugin} is turned off",
237
+ blockerPluginHint: "Its blocks can’t be printed until it’s on again.",
238
+ blockerNoPrint: "A block has no print view",
239
+ blockerNoPrintHint: "It can’t be printed. Remove it, or keep it for notes.",
240
+ blockerField: "{field} isn’t a field of this record type",
241
+ blockerFieldHint: "Remove it, or pick a field the record has.",
242
+ blockerTheme: "This document uses a theme the workspace doesn’t have: {ref}",
243
+ blockerThemeHint: "Choose another theme or restore it.",
244
+ blockerTooLarge: "This template is too large to print: {size}, and the limit is {max}",
245
+ blockerTooLargeHint: "Use smaller images or fewer of them, then publish again.",
246
+ labelGrid: "{columns} × {rows} labels",
247
+ labelStock: "Label stock",
248
+ labelCertificate: "Certificate",
249
+ labelSheet: "Sheet",
250
+ labelColumns: "Columns",
251
+ labelRows: "Rows",
252
+ labelWidth: "Label width (mm)",
253
+ labelHeight: "Label height (mm)",
254
+ labelGapX: "Gap between columns (mm)",
255
+ labelGapY: "Gap between rows (mm)",
256
+ labelTooBig: "The labels don’t fit on the sheet.",
257
+ labelOverflow: "Doesn’t fit the label",
258
+ labelsPerSheet: "{n} labels a sheet",
259
+ printLabels: "Print labels",
260
+ fieldsThisTemplate: "This template",
261
+ fieldNew: "New field “{name}”",
262
+ fieldNewHint: "Type a name to add a field of this template.",
263
+ modeSuggesting: "Suggesting",
264
+ modeSuggestingHint: "Your edits become suggestions to accept",
265
+ modeSuggestingHintNoEdit: "An editor accepts your changes",
266
+ modeEditingLocked: "Ask an owner for edit access",
267
+ modeViewingCommentHint: "Read and comment, nothing changes",
268
+ comment: "Comment",
269
+ commentsAndSuggestions: "Comments and suggestions",
270
+ close: "Close",
271
+ cancel: "Cancel",
272
+ commentPlaceholder: "Comment or add others with @",
273
+ replyPlaceholder: "Reply or add others with @",
274
+ reply: "Reply",
275
+ resolve: "Resolve",
276
+ reopen: "Reopen",
277
+ resolvedBy: "Resolved by {name} · {time}",
278
+ accept: "Accept",
279
+ reject: "Reject",
280
+ railAll: "All",
281
+ acceptAll: "Accept all",
282
+ rejectAll: "Reject all",
283
+ acceptAllFrom: "Accept all from {name}",
284
+ rejectAllFrom: "Reject all from {name}",
285
+ countSuggestion: "1 suggestion",
286
+ countSuggestions: "{n} suggestions",
287
+ countComment: "1 comment",
288
+ countComments: "{n} comments",
289
+ countResolved: "{n} resolved",
290
+ tabAll: "All",
291
+ tabComments: "Comments",
292
+ tabSuggestions: "Suggestions",
293
+ tabResolved: "Resolved",
294
+ railEmpty: "No comments or suggestions yet. Select text and choose Comment.",
295
+ resolvedEmpty: "No resolved comments",
296
+ mentionPeople: "People",
297
+ mentionNone: "No one matches",
298
+ mentionHint: "Type a name to mention someone",
299
+ you: "You",
300
+ now: "now",
301
+ oneReply: "1 reply",
302
+ replies: "{n} replies",
303
+ actorFor: "for",
304
+ sugReplace: "Replace {from} with {to}",
305
+ sugAdd: "Add {text}",
306
+ sugDelete: "Delete {text}",
307
+ sugFormat: "Make {text} {mark}",
308
+ sugUnformat: "Remove {mark} from {text}",
309
+ sugAddBlocks: "Add {text}",
310
+ sugDeleteBlocks: "Delete {text}",
311
+ sugMoveBlock: "Move {text}",
312
+ sugBlock: "a block",
313
+ sugSending: "Sending…",
314
+ sugUnplaced: "Its text has changed since",
315
+ sugRefused: "That change can’t be a suggestion yet, so it was undone.",
316
+ collabFailed: "That didn’t work. Try again.",
317
+ agentAsk: "Ask an agent",
318
+ agentClose: "Close",
319
+ agentNoneConnected: "You haven't connected an agent yet. Connect your AI app to Whity, then ask it here.",
320
+ agentConnect: "Connect an agent",
321
+ agentPicker: "Agent",
322
+ agentAny: "Any of my agents",
323
+ agentThisDocument: "This document",
324
+ agentRequest: "What should the agent do?",
325
+ agentRequestPlaceholder: "Ask for a paragraph, a rewrite or a check",
326
+ agentWritesFor: "Writes only suggestions, for {name}",
327
+ agentWrites: "Writes only suggestions",
328
+ agentAskButton: "Ask",
329
+ agentRequests: "Your requests",
330
+ agentWaiting: "Waiting for your agent to pick this up",
331
+ agentWorking: "Working on it",
332
+ agentStopped: "Stopped before it finished",
333
+ agentFailedNext: "Check that your agent is still connected, then try again.",
334
+ agentQueued: "Waiting",
335
+ agentRunning: "Running",
336
+ agentDone: "Done",
337
+ agentStoppedBadge: "Stopped",
338
+ agentFailed: "Failed",
339
+ agentStop: "Stop",
340
+ agentRetry: "Try again",
341
+ agentRewrite: "Rewrite with an agent",
342
+ agentRewriteRequest: "Rewrite this, keeping the meaning",
343
+ saveBlockTitle: "Save as block",
344
+ saveBlockExplain: "Saves the {n} selected blocks as one block you can insert from the / menu.",
345
+ saveBlockName: "Name",
346
+ saveBlockNamePlaceholder: "Bank details",
347
+ saveBlockHow: "When it's inserted",
348
+ saveBlockSynced: "Synced",
349
+ saveBlockSyncedHint: "Editing it once updates every document that uses it. Published templates pick up the change when they're published again.",
350
+ saveBlockCopy: "Copy",
351
+ saveBlockCopyHint: "Inserts a copy people change freely.",
352
+ saveBlockWho: "Who can use it",
353
+ saveBlockOnlyMe: "Only me",
354
+ saveBlockOnlyMeHint: "It's in your / menu only.",
355
+ saveBlockEveryone: "Everyone in the workspace",
356
+ saveBlockEveryoneHint: "It joins the workspace library.",
357
+ saveBlockSave: "Save block",
358
+ saveBlockCancel: "Cancel",
359
+ saveBlockExplainOne: "Saves this block so you can insert it from the / menu.",
360
+ saveAsBlock: "Save as block",
361
+ savedBlockLabel: "Saved block: {name}",
362
+ savedBlockSynced: "Synced",
363
+ savedBlockUsedIn: "used in {n} documents",
364
+ savedBlockUsedInOne: "used in 1 document",
365
+ savedBlockDetach: "Detach",
366
+ savedBlockDetachHint: "Turn it into ordinary blocks you change here only",
367
+ savedBlockMissing: "This saved block was deleted or isn't shared with you.",
368
+ savedBlockSyncedHint: "Synced: changes reach every document",
369
+ savedBlockCopyHint: "Inserts a copy you change freely",
370
+ perDocumentMark: "Filled per document",
371
+ perDocumentFill: "Filled per document: {text}",
372
+ pluginBlockLabel: "{name}, from {plugin}",
373
+ pluginVerified: "Verified",
374
+ pluginNotVerified: "Not verified",
375
+ pluginPrints: "Prints",
376
+ pluginNotesOnly: "Notes only",
377
+ pluginEdit: "Edit",
378
+ pluginEditTitle: "Edit {name}",
379
+ pluginSave: "Save",
380
+ pluginCancel: "Cancel",
381
+ pluginChoose: "Choose",
382
+ pluginNeeds: "Needs the {plugin} plugin",
383
+ pluginNeedsHint: "Its data is kept. A template with it can't be published until the plugin is on.",
384
+ pluginEnable: "Enable",
385
+ pluginEnableFailed: "The plugin wasn't turned on. Try again.",
386
+ pluginNoView: "This block has nothing to show yet.",
387
+ }
388
+
389
+ export type EditorLabels = typeof EDITOR_LABELS
390
+
391
+ /** Fill `{name}` placeholders. */
392
+ export function fill(template: string, values: Record<string, string | number>): string {
393
+ return template.replace(/\{(\w+)\}/g, (_, key: string) => String(values[key] ?? `{${key}}`))
394
+ }