@iyulab/u-board-designer 0.0.0-stage → 0.2.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.
Files changed (82) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +127 -2
  3. package/dist/lib/authoring/AnchorFields.d.ts +12 -0
  4. package/dist/lib/authoring/AnchorFields.js +64 -0
  5. package/dist/lib/authoring/BackgroundField.d.ts +13 -0
  6. package/dist/lib/authoring/BackgroundField.js +38 -0
  7. package/dist/lib/authoring/BoardAuthoring.d.ts +37 -0
  8. package/dist/lib/authoring/BoardAuthoring.js +288 -0
  9. package/dist/lib/authoring/BoardElementsPanel.d.ts +14 -0
  10. package/dist/lib/authoring/BoardElementsPanel.js +49 -0
  11. package/dist/lib/authoring/BoardPanel.d.ts +40 -0
  12. package/dist/lib/authoring/BoardPanel.js +22 -0
  13. package/dist/lib/authoring/CanvasAuthoring.d.ts +13 -0
  14. package/dist/lib/authoring/CanvasAuthoring.js +161 -0
  15. package/dist/lib/authoring/DataPanel.d.ts +29 -0
  16. package/dist/lib/authoring/DataPanel.js +98 -0
  17. package/dist/lib/authoring/GridAuthoring.d.ts +13 -0
  18. package/dist/lib/authoring/GridAuthoring.js +135 -0
  19. package/dist/lib/authoring/GridItemPanel.d.ts +22 -0
  20. package/dist/lib/authoring/GridItemPanel.js +21 -0
  21. package/dist/lib/authoring/LinkPanel.d.ts +19 -0
  22. package/dist/lib/authoring/LinkPanel.js +24 -0
  23. package/dist/lib/authoring/MappingEditor.d.ts +23 -0
  24. package/dist/lib/authoring/MappingEditor.js +83 -0
  25. package/dist/lib/authoring/PartPanel.d.ts +24 -0
  26. package/dist/lib/authoring/PartPanel.js +78 -0
  27. package/dist/lib/authoring/ShapePanel.d.ts +20 -0
  28. package/dist/lib/authoring/ShapePanel.js +54 -0
  29. package/dist/lib/authoring/StatesEditor.d.ts +18 -0
  30. package/dist/lib/authoring/StatesEditor.js +79 -0
  31. package/dist/lib/authoring/StatusesPanel.d.ts +14 -0
  32. package/dist/lib/authoring/StatusesPanel.js +32 -0
  33. package/dist/lib/authoring/TriggersEditor.d.ts +30 -0
  34. package/dist/lib/authoring/TriggersEditor.js +137 -0
  35. package/dist/lib/authoring/ValueMapFields.d.ts +64 -0
  36. package/dist/lib/authoring/ValueMapFields.js +68 -0
  37. package/dist/lib/authoring/WidgetPropsForm.d.ts +27 -0
  38. package/dist/lib/authoring/WidgetPropsForm.js +56 -0
  39. package/dist/lib/authoring/background-image.d.ts +25 -0
  40. package/dist/lib/authoring/background-image.js +63 -0
  41. package/dist/lib/authoring/board-layout.d.ts +64 -0
  42. package/dist/lib/authoring/board-layout.js +326 -0
  43. package/dist/lib/authoring/board-triggers.d.ts +5 -0
  44. package/dist/lib/authoring/board-triggers.js +55 -0
  45. package/dist/lib/authoring/document-history.d.ts +23 -0
  46. package/dist/lib/authoring/document-history.js +37 -0
  47. package/dist/lib/authoring/editor-parts.d.ts +46 -0
  48. package/dist/lib/authoring/editor-parts.js +6 -0
  49. package/dist/lib/authoring/field-style.d.ts +3 -0
  50. package/dist/lib/authoring/field-style.js +2 -0
  51. package/dist/lib/authoring/part-names.d.ts +6 -0
  52. package/dist/lib/authoring/part-names.js +9 -0
  53. package/dist/lib/authoring/scene-mapping.d.ts +22 -0
  54. package/dist/lib/authoring/scene-mapping.js +124 -0
  55. package/dist/lib/authoring/use-edit-keys.d.ts +13 -0
  56. package/dist/lib/authoring/use-edit-keys.js +57 -0
  57. package/dist/lib/authoring/widget-catalog.d.ts +4 -0
  58. package/dist/lib/authoring/widget-catalog.js +9 -0
  59. package/dist/lib/authoring/widget-fields.d.ts +45 -0
  60. package/dist/lib/authoring/widget-fields.js +129 -0
  61. package/dist/lib/board/check.d.ts +27 -0
  62. package/dist/lib/board/check.js +48 -0
  63. package/dist/lib/board/rulebook.d.ts +7 -0
  64. package/dist/lib/board/rulebook.js +148 -0
  65. package/dist/lib/check-entry.d.ts +3 -0
  66. package/dist/lib/check-entry.js +4 -0
  67. package/dist/lib/editing/grid-editing.d.ts +19 -0
  68. package/dist/lib/editing/grid-editing.js +68 -0
  69. package/dist/lib/editing/part-removal.d.ts +4 -0
  70. package/dist/lib/editing/part-removal.js +11 -0
  71. package/dist/lib/editing/trigger-editing.d.ts +16 -0
  72. package/dist/lib/editing/trigger-editing.js +36 -0
  73. package/dist/lib/index.d.ts +7 -0
  74. package/dist/lib/index.js +5 -0
  75. package/dist/lib/labels-ko.d.ts +4 -0
  76. package/dist/lib/labels-ko.js +270 -0
  77. package/dist/lib/labels.d.ts +368 -0
  78. package/dist/lib/labels.js +273 -0
  79. package/dist/lib/use-labels.d.ts +7 -0
  80. package/dist/lib/use-labels.js +12 -0
  81. package/package.json +75 -4
  82. package/styles.css +277 -0
@@ -0,0 +1,368 @@
1
+ import { type UBoardLabels } from '@iyulab/u-board/viewer';
2
+ /**
3
+ * Every piece of text the authoring tool shows, beside the viewer's (`UBoardLabels`). English by default
4
+ * (`DEFAULT_DESIGNER_LABELS`); a host passes `labels` to `BoardAuthoring` to show its own language — any subset, the
5
+ * rest stays English.
6
+ */
7
+ export interface AuthoringLabels {
8
+ /** On a selected canvas cell: open its canvas in the canvas editor — and, there, back to the grid. */
9
+ editCanvas: string;
10
+ backToGrid: string;
11
+ /** Opens the grid a grid cell holds — the selected item's — in its own editor. */
12
+ editGridCell: string;
13
+ /** The width a grid view is laid out at while editing it — to see it as a narrow or medium screen will: the
14
+ * group's name and its three choices. */
15
+ layoutWidth: string;
16
+ layoutWide: string;
17
+ layoutMedium: string;
18
+ layoutNarrow: string;
19
+ /** Joins the two selected nodes with a line; `connectHint` says how to select them. */
20
+ addConnector: string;
21
+ connectHint: string;
22
+ /** Deletes the selected parts (a node takes its lines with it). */
23
+ deleteSelected: string;
24
+ /** Steps back through the edits since the document was opened (Ctrl+Z), and forward again (Ctrl+Shift+Z or Ctrl+Y). */
25
+ undo: string;
26
+ /** Add a part to a board, and the title it starts with. */
27
+ partAdd: string;
28
+ newPartTitle: string;
29
+ redo: string;
30
+ /** The save button when the host handles saving (`onSave`). */
31
+ save: string;
32
+ /** The save button when the document is downloaded as a file (no `onSave`). */
33
+ export: string;
34
+ import: string;
35
+ /** The heading of the board's own settings, shown in the panel while nothing is selected. */
36
+ boardHeading: string;
37
+ /** Chooses an image file as the board's background; `removeBackground` takes it away. */
38
+ setBackground: string;
39
+ removeBackground: string;
40
+ /** The background image's reference points (`BackgroundImage.referencePoints`): the fieldset, what they
41
+ * do, one point's group ("{n}" is 1 or 2), its fields — a point of the image and the coordinate it stands
42
+ * for — and why they are not saved yet. */
43
+ referencePoints: string;
44
+ referencePointsHint: string;
45
+ referencePoint: string;
46
+ imageX: string;
47
+ imageY: string;
48
+ coordinateX: string;
49
+ coordinateY: string;
50
+ referencePointsApart: string;
51
+ referencePointsIncomplete: string;
52
+ clearReferencePoints: string;
53
+ /** After the reference points changed or went away with an image: that the points are to be given again
54
+ * (shown while the background has none), and — once it has them — how many anchored nodes ("{count}") no
55
+ * longer read as the coordinate they had, with the choice to put them back there or leave them. */
56
+ referencePointsNeeded: string;
57
+ anchorsMoved: string;
58
+ relocateAnchors: string;
59
+ keepAnchors: string;
60
+ /** The board's tone (`ViewDocument.appearance`): the picker's name and its two choices. */
61
+ appearance: string;
62
+ appearanceLight: string;
63
+ appearanceDark: string;
64
+ /** The board's accent colour, and what an empty field means. */
65
+ accent: string;
66
+ accentPlaceholder: string;
67
+ /** Said when a chosen background is refused: not an image type browsers draw, over the size
68
+ * limit (`{max}` is replaced by it), or unreadable. */
69
+ backgroundType: string;
70
+ backgroundTooLarge: string;
71
+ backgroundUnreadable: string;
72
+ /** The authoring view's two modes — editing the board, and viewing it as it is shared — and the
73
+ * name of the switch between them. */
74
+ mode: string;
75
+ editMode: string;
76
+ viewMode: string;
77
+ /** The accessible name of the editor canvas. */
78
+ editorRegion: string;
79
+ /** The accessible name of the board in the authoring view's view mode. */
80
+ previewRegion: string;
81
+ /** Under the board's settings while nothing is selected: how to edit a node or a decoration. */
82
+ selectNode: string;
83
+ /** A grid item's room and place: the section heading, the span at full width (`{columns}` is replaced by 12) and
84
+ * at medium width (`{columns}`: 6, with a choice to follow the full-width span), the height (blank: the widget's
85
+ * own), and the buttons that move it in the order or remove it. */
86
+ itemLayout: string;
87
+ itemSpan: string;
88
+ itemSpanMedium: string;
89
+ itemSpanMediumAuto: string;
90
+ /** The rows an item spans beside the ones after it (from medium width up). */
91
+ itemRowSpan: string;
92
+ itemHeight: string;
93
+ itemHeightAuto: string;
94
+ /** The same, for a canvas cell — whose height left out keeps the canvas's proportions. */
95
+ canvasHeightAuto: string;
96
+ moveEarlier: string;
97
+ moveLater: string;
98
+ duplicateItem: string;
99
+ removeItem: string;
100
+ /** Shown instead of a property panel while several items are selected; `{count}` is replaced by
101
+ * how many. */
102
+ multipleSelected: string;
103
+ /** The panel of an editor that edits where the parts are and nothing else. */
104
+ layoutOnlyHint: string;
105
+ /** A part's panel: its heading (`{id}`) and fields. */
106
+ partHeading: string;
107
+ /** A link's panel on a board. `{from}`, `{to}`: the parts it joins. */
108
+ linkHeading: string;
109
+ /** A shape's panel, and adding a box or a text, on a canvas board. */
110
+ shapeHeading: string;
111
+ shapeAddBox: string;
112
+ shapeAddText: string;
113
+ shapeAddLine: string;
114
+ /** A line's points and a path's drawing, as its panel sets them. */
115
+ shapePoints: string;
116
+ shapePointsInvalid: string;
117
+ shapePath: string;
118
+ shapeNewText: string;
119
+ shapeLabel: string;
120
+ shapeText: string;
121
+ shapeSize: string;
122
+ shapeWidth: string;
123
+ shapeTone: string;
124
+ linkLabel: string;
125
+ linkReads: string;
126
+ linkShows: string;
127
+ linkTone: string;
128
+ linkToneNone: string;
129
+ linkRoute: string;
130
+ linkArrow: string;
131
+ linkDash: string;
132
+ partTitle: string;
133
+ partKind: string;
134
+ partFromPreset: string;
135
+ partOf: string;
136
+ partOfNone: string;
137
+ partItem: string;
138
+ partItemAll: string;
139
+ partShow: string;
140
+ /** A part made per item of `{data}`. */
141
+ partEach: string;
142
+ /** The groups of a part's kind's options: the ones the board reads itself, and the widget's. */
143
+ partOwnOptions: string;
144
+ partWidgetOptions: string;
145
+ /** An option written as a structure — not edited in a text box. */
146
+ partStructured: string;
147
+ /** A board whose settings leave it one that cannot be drawn: `{reason}`, where and why. */
148
+ boardNotDrawn: string;
149
+ /** The board's statuses panel. `{name}`: a status's name. */
150
+ statusesHeading: string;
151
+ statusTone: string;
152
+ statusLabel: string;
153
+ statusGlyph: string;
154
+ statusEmphasis: string;
155
+ statusEmphasisNone: string;
156
+ statusRemove: string;
157
+ statusNew: string;
158
+ statusAdd: string;
159
+ /** The board's data panel. `{name}`: a data read's or a field's name. */
160
+ dataHeading: string;
161
+ dataFrom: string;
162
+ dataPath: string;
163
+ /** A read by an adapter's own reference, which the panel does not write. */
164
+ dataByRef: string;
165
+ dataList: string;
166
+ dataKey: string;
167
+ /** The finer points of a request read, folded under one heading. */
168
+ dataDetails: string;
169
+ dataWhere: string;
170
+ dataWhereInvalid: string;
171
+ dataTime: string;
172
+ dataAnswerTime: string;
173
+ dataFresh: string;
174
+ dataZone: string;
175
+ dataNowDelay: string;
176
+ dataNowStep: string;
177
+ dataPivotKey: string;
178
+ dataPivotValue: string;
179
+ dataFields: string;
180
+ dataFieldLabel: string;
181
+ dataFieldUnit: string;
182
+ dataFieldDigits: string;
183
+ dataFieldFormat: string;
184
+ dataFieldRemove: string;
185
+ /** A field's status — how its value is doing — and the words it is shown as, as the data panel sets them. */
186
+ dataFieldState: string;
187
+ /** A status that follows the clock (`{ relative: bands }`) — shown as it is; it is written in the board's JSON. */
188
+ dataFieldStateRelative: string;
189
+ dataFieldNames: string;
190
+ mappingNone: string;
191
+ mappingRaw: string;
192
+ mappingMap: string;
193
+ mappingBands: string;
194
+ /** `{n}`: the row's number. */
195
+ mappingFrom: string;
196
+ mappingTo: string;
197
+ mappingAddRow: string;
198
+ mappingOtherwise: string;
199
+ mappingBandsText: string;
200
+ mappingBandsInvalid: string;
201
+ dataFieldNew: string;
202
+ dataFieldAdd: string;
203
+ /** Read the data now and list the fields its item has. */
204
+ dataLook: string;
205
+ dataLooking: string;
206
+ /** The fields reading found: a button per field the read does not name yet. `{name}`: the field. */
207
+ dataFound: string;
208
+ dataFoundAdd: string;
209
+ dataFoundNone: string;
210
+ dataRemove: string;
211
+ dataNew: string;
212
+ dataAdd: string;
213
+ widgetType: string;
214
+ /** The widget form: its data and its options, a field's "bound" mark, a choice left to the widget's
215
+ * own default, the JSON editor it folds the rest into, and how many options only that editor holds. */
216
+ widgetData: string;
217
+ widgetOptions: string;
218
+ /** An element's own props, as its definition describes them; the board's elements in the widget-type choice. */
219
+ elementProps: string;
220
+ boardElements: string;
221
+ /** The board's elements: their list, and the editor of one definition. */
222
+ elementsHeading: string;
223
+ addElement: string;
224
+ elementName: string;
225
+ elementTemplate: string;
226
+ elementScript: string;
227
+ elementStyle: string;
228
+ elementHeight: string;
229
+ elementScriptPreview: string;
230
+ removeElement: string;
231
+ removeElementPlaced: string;
232
+ /** An element prop of a board, by name: removed, and a new one. `{name}`: the prop. */
233
+ elementPropRemove: string;
234
+ elementPropNew: string;
235
+ elementPropAdd: string;
236
+ boundField: string;
237
+ choiceDefault: string;
238
+ advancedProps: string;
239
+ moreInAdvanced: string;
240
+ noDataSources: string;
241
+ propPath: string;
242
+ /** The prop picker's empty line, its "type a path" choice, and the field that path is typed in. */
243
+ choosePropPath: string;
244
+ otherPropPath: string;
245
+ typedPropPath: string;
246
+ /** The binding form's picker for an adapter that offers its references (`Adapter.references`),
247
+ * and the line it shows before one is chosen. */
248
+ reference: string;
249
+ chooseReference: string;
250
+ path: string;
251
+ /** Under the request path when it carries what looks like a key (`serviceKey=`, `apiKey=`, …): a board
252
+ * keeps its paths as written, and a share link hands them to whoever opens it. */
253
+ keyInPath: string;
254
+ valuePath: string;
255
+ /** Picking a value inside a list's element: the select that names the element by one of its fields
256
+ * instead of its position (sources reorder their lists), and its first option, which keeps the position. */
257
+ pickItemBy: string;
258
+ pickItemByPosition: string;
259
+ /** A binding that reads a list item named by its fields: "{list} · {field} = {value}" follows. */
260
+ listItem: string;
261
+ clearListItem: string;
262
+ /** The select naming the field where the source says when it observed the value (`observedAtPath`), its
263
+ * first option (no field: the value counts as observed when it is read), and the hint shown before the
264
+ * response has been explored for such fields. */
265
+ observedAt: string;
266
+ observedAtWhenRead: string;
267
+ observedAtHint: string;
268
+ /** The IANA time zone a source's time without an offset is in (`timeZone`), and why it cannot be saved. */
269
+ timeZone: string;
270
+ unknownTimeZone: string;
271
+ /** Under the observed-time field once explored: "{time}" is the instant it reads as, in the author's
272
+ * words, "{age}" how long ago that is (`qualityText.age`); and the warning when it is later than now. */
273
+ observedAtReads: string;
274
+ observedAtLater: string;
275
+ /** How old the source's value may normally be, in minutes (`maxAgeSeconds`); what it does; and why it
276
+ * cannot be saved. */
277
+ maxAge: string;
278
+ maxAgeHint: string;
279
+ invalidMaxAge: string;
280
+ /** For a path with time places (`{{now:yyyyMMdd}}`): the group's name, how long after a time the source has its
281
+ * data and how often it has new data (minutes, `requestTime`), what they do, the request it makes now, and why
282
+ * it cannot be saved — a place that is not a time, or a number that is not one. */
283
+ requestTime: string;
284
+ explore: string;
285
+ /** In the response explorer: the whole response, when it is itself the value to pick. */
286
+ wholeResponse: string;
287
+ /** Why "Save binding" cannot be pressed yet, shown next to it. */
288
+ bindingNeedsPropPath: string;
289
+ bindingNeedsReference: string;
290
+ /** The value-map part of the binding form (`Binding.map`). `{n}` is replaced by the row number. */
291
+ valueMapHeading: string;
292
+ mapFrom: string;
293
+ mapTo: string;
294
+ addMapping: string;
295
+ removeMapping: string;
296
+ /** A numeric range row of the value map (`ValueMap.ranges`): from `rangeMin` up to but not
297
+ * including `rangeMax`, shown as `rangeTo`. `{n}` is replaced by the row number. */
298
+ rangeMin: string;
299
+ rangeMax: string;
300
+ rangeTo: string;
301
+ addRange: string;
302
+ removeRange: string;
303
+ /** Said under a range row that is not a range — no end given, or an upper end not above the
304
+ * lower one; the binding cannot be saved. */
305
+ rangeInvalid: string;
306
+ /** The value shown for a source value with no mapping; left empty, such a value shows as it comes. */
307
+ mapOtherwise: string;
308
+ mapOtherwisePlaceholder: string;
309
+ /** The states section of a part's panel, and its fields. `{state}` is a state's name. */
310
+ statesHeading: string;
311
+ statesNeedBinding: string;
312
+ statesFrom: string;
313
+ statesNone: string;
314
+ statesMapHeading: string;
315
+ stateForValue: string;
316
+ stateForRange: string;
317
+ statesLooks: string;
318
+ stateOutline: string;
319
+ stateBlink: string;
320
+ stateHidden: string;
321
+ removeStates: string;
322
+ /** The triggers sections — a part's, and the board's own (when it opens). `{n}` numbers a trigger or an action. */
323
+ triggersHeading: string;
324
+ triggersOnOpenHeading: string;
325
+ triggerHeading: string;
326
+ triggerEvent: string;
327
+ triggerOnClick: string;
328
+ triggerOnElement: string;
329
+ triggerOnEnter: string;
330
+ triggerOnLeave: string;
331
+ triggerEventName: string;
332
+ triggerState: string;
333
+ triggerOnlyWhen: string;
334
+ /** A trigger on an item that applies to every item of its part; `{part}` is the part. */
335
+ triggerEveryItem: string;
336
+ triggerWhenPart: string;
337
+ triggerWhenState: string;
338
+ triggerAction: string;
339
+ triggerOpenLink: string;
340
+ triggerFocus: string;
341
+ triggerEmit: string;
342
+ triggerGoToBoard: string;
343
+ triggerFocusPart: string;
344
+ triggerLinkUrl: string;
345
+ triggerEmitName: string;
346
+ triggerBoardId: string;
347
+ removeTriggerAction: string;
348
+ addTriggerAction: string;
349
+ removeTrigger: string;
350
+ addTrigger: string;
351
+ triggerIncomplete: string;
352
+ triggerLinkRefused: string;
353
+ /** Marks a listed binding that has a value map. */
354
+ mapped: string;
355
+ /** The binding preview's word for a value that is current (`live`). */
356
+ previewLive: string;
357
+ arrowNone: string;
358
+ arrowEnd: string;
359
+ arrowStart: string;
360
+ arrowBoth: string;
361
+ /** A link's arrowheads read from a field of what it reads — `{field}` its name. */
362
+ arrowFromField: string;
363
+ }
364
+ export type DesignerLabels = UBoardLabels & AuthoringLabels;
365
+ export declare const DEFAULT_AUTHORING_LABELS: AuthoringLabels;
366
+ export declare const DEFAULT_DESIGNER_LABELS: DesignerLabels;
367
+ /** `DEFAULT_DESIGNER_LABELS` with `labels` laid over it. */
368
+ export declare function resolveDesignerLabels(labels?: Partial<DesignerLabels>): DesignerLabels;
@@ -0,0 +1,273 @@
1
+ import { DEFAULT_LABELS } from '@iyulab/u-board/viewer';
2
+ export const DEFAULT_AUTHORING_LABELS = {
3
+ editCanvas: 'Edit canvas',
4
+ backToGrid: '← Grid',
5
+ editGridCell: 'Edit the grid in this cell',
6
+ layoutWidth: 'Layout width',
7
+ layoutWide: 'Wide',
8
+ layoutMedium: 'Medium',
9
+ layoutNarrow: 'Narrow',
10
+ addConnector: 'Connect nodes',
11
+ connectHint: 'Select two nodes (Shift+click the second) to connect them.',
12
+ deleteSelected: 'Delete',
13
+ undo: 'Undo',
14
+ partAdd: 'Add part',
15
+ newPartTitle: 'New part',
16
+ redo: 'Redo',
17
+ save: 'Save',
18
+ export: 'Export',
19
+ import: 'Import',
20
+ boardHeading: 'Board',
21
+ setBackground: 'Background image',
22
+ removeBackground: 'Remove background',
23
+ referencePoints: 'Reference points',
24
+ referencePointsHint: "Two points of the image and the coordinates they stand for — a map's longitude and latitude, a plan's metres. An anchored node then reads as a coordinate.",
25
+ referencePoint: 'Point {n}',
26
+ imageX: 'Image x',
27
+ imageY: 'Image y',
28
+ coordinateX: 'Coordinate x',
29
+ coordinateY: 'Coordinate y',
30
+ referencePointsApart: 'The two points must differ on both axes, in the image and in their coordinates.',
31
+ referencePointsIncomplete: 'Fill in all eight numbers to save the points — until then, the saved ones stay.',
32
+ clearReferencePoints: 'Clear reference points',
33
+ referencePointsNeeded: "The earlier points do not fit this image, so they were cleared. Give it its reference points — anchored nodes, if any, can then go back to their coordinates.",
34
+ anchorsMoved: 'Anchored nodes no longer at the coordinates they had: {count}.',
35
+ relocateAnchors: 'Put them back at their coordinates',
36
+ keepAnchors: 'Leave them',
37
+ appearance: 'Tone',
38
+ appearanceLight: 'Light',
39
+ appearanceDark: 'Dark',
40
+ accent: 'Accent colour',
41
+ accentPlaceholder: 'The theme’s',
42
+ backgroundType: 'Choose a PNG, JPEG, WebP, GIF or SVG image.',
43
+ backgroundTooLarge: 'The image is larger than {max}.',
44
+ backgroundUnreadable: 'The image could not be read.',
45
+ mode: 'Mode',
46
+ editMode: 'Edit',
47
+ viewMode: 'View',
48
+ editorRegion: 'Editor',
49
+ previewRegion: 'Board view',
50
+ selectNode: 'Select a node or a decoration to edit it.',
51
+ itemLayout: 'Layout',
52
+ itemSpan: 'Width (of {columns} columns)',
53
+ itemSpanMedium: 'Width at medium size (of {columns})',
54
+ itemSpanMediumAuto: 'Auto — keeps the full-width row',
55
+ itemRowSpan: 'Rows it spans',
56
+ itemHeight: 'Height (px)',
57
+ itemHeightAuto: 'Widget default',
58
+ canvasHeightAuto: 'The canvas’s proportions',
59
+ moveEarlier: 'Move earlier',
60
+ moveLater: 'Move later',
61
+ duplicateItem: 'Duplicate item',
62
+ removeItem: 'Remove item',
63
+ multipleSelected: '{count} items selected — select one to edit it.',
64
+ layoutOnlyHint: 'Move and resize parts here, or delete them. Select one to edit it.',
65
+ partHeading: 'Part {id}',
66
+ linkHeading: 'Link {from} → {to}',
67
+ shapeHeading: 'Shape {id}',
68
+ shapeAddBox: 'Add frame',
69
+ shapeAddText: 'Add text',
70
+ shapeAddLine: 'Add line',
71
+ shapePoints: 'Points (x,y — by spaces)',
72
+ shapePointsInvalid: 'Write two points or more as x,y, by spaces: 20,20 220,20.',
73
+ shapePath: 'Path (M · L · C · Q · Z, absolute)',
74
+ shapeNewText: 'Text',
75
+ shapeLabel: 'Label',
76
+ shapeText: 'Text',
77
+ shapeSize: 'Font size',
78
+ shapeWidth: 'Line width',
79
+ shapeTone: 'Tone',
80
+ linkLabel: 'Label',
81
+ linkReads: 'Reads (an item, for its status)',
82
+ linkShows: 'Status field',
83
+ linkTone: 'Tone without a status',
84
+ linkToneNone: '(idle)',
85
+ linkRoute: 'Route',
86
+ linkArrow: 'Arrowhead',
87
+ linkDash: 'Dashed',
88
+ partTitle: 'Title',
89
+ partKind: 'Kind',
90
+ partFromPreset: '(from its preset)',
91
+ partOf: 'Reads',
92
+ partOfNone: '(nothing)',
93
+ partItem: 'Item (key)',
94
+ partItemAll: 'every item',
95
+ partShow: 'Shows (fields, by commas)',
96
+ partEach: 'One part per item of {data}.',
97
+ partOwnOptions: 'Options of its kind',
98
+ partWidgetOptions: 'Widget options',
99
+ partStructured: 'Written as a structure — set it with the assistant, or in the board’s JSON.',
100
+ boardNotDrawn: 'The board cannot be drawn as it is now — {reason}. The last board it could draw is shown.',
101
+ statusesHeading: 'Statuses',
102
+ statusTone: 'Tone',
103
+ statusLabel: 'Words',
104
+ statusGlyph: 'Mark',
105
+ statusEmphasis: 'Emphasis',
106
+ statusEmphasisNone: '(none)',
107
+ statusRemove: 'Remove {name}',
108
+ statusNew: 'New status',
109
+ statusAdd: 'Add status',
110
+ dataHeading: 'Data',
111
+ dataFrom: 'Source',
112
+ dataPath: 'Request path',
113
+ dataByRef: 'Read by its adapter’s own reference — set it with the assistant, or in the board’s JSON.',
114
+ dataList: 'List in the answer (JSON Pointer)',
115
+ dataKey: 'Key field of an item',
116
+ dataDetails: 'More about this read',
117
+ dataWhere: 'Only the items with (field=value, by commas)',
118
+ dataWhereInvalid: 'Write field=value pairs, by commas: kind=PM10, site=north.',
119
+ dataTime: 'Field with when an item was observed',
120
+ dataAnswerTime: 'When the answer as a whole was observed (JSON Pointer)',
121
+ dataFresh: 'Seconds a value stays current',
122
+ dataZone: 'Time zone the source writes times in (IANA)',
123
+ dataNowDelay: 'Request time — seconds after it the source has its data',
124
+ dataNowStep: 'Request time — seconds between the source’s data',
125
+ dataPivotKey: 'One row per name — the field naming it',
126
+ dataPivotValue: 'One row per name — the field with its value',
127
+ dataFields: 'Fields',
128
+ dataFieldLabel: 'Name',
129
+ dataFieldUnit: 'Unit',
130
+ dataFieldDigits: 'Decimal places',
131
+ dataFieldFormat: 'Format',
132
+ dataFieldRemove: 'Remove field {name}',
133
+ dataFieldState: 'Status',
134
+ dataFieldStateRelative: 'Status follows the clock (bands over the seconds from now) — written in the board’s JSON',
135
+ dataFieldNames: 'Words',
136
+ mappingNone: '(none)',
137
+ mappingRaw: 'The value is a status name',
138
+ mappingMap: 'By value',
139
+ mappingBands: 'Number bands',
140
+ mappingFrom: 'Value {n}',
141
+ mappingTo: 'Name {n}',
142
+ mappingAddRow: 'Add a value',
143
+ mappingOtherwise: 'Any other value',
144
+ mappingBandsText: 'Names and bounds in turn (ok, 1, warn, 5, alarm)',
145
+ mappingBandsInvalid: 'Write names and rising numbers in turn, from a name: ok, 1, warn, 5, alarm.',
146
+ dataFieldNew: 'New field',
147
+ dataFieldAdd: 'Add field',
148
+ dataLook: 'Look at the data',
149
+ dataLooking: 'Reading…',
150
+ dataFound: 'Fields found',
151
+ dataFoundAdd: 'Add {name}',
152
+ dataFoundNone: 'Nothing was read — check the source and the request path.',
153
+ dataRemove: 'Remove {name}',
154
+ dataNew: 'New data',
155
+ dataAdd: 'Add data',
156
+ widgetType: 'Widget type',
157
+ widgetData: 'Data',
158
+ widgetOptions: 'Display',
159
+ elementProps: 'Element props',
160
+ boardElements: 'This board’s elements',
161
+ elementsHeading: 'Elements',
162
+ addElement: 'New element',
163
+ elementName: 'Name',
164
+ elementTemplate: 'Template',
165
+ elementScript: 'Script',
166
+ elementStyle: 'CSS',
167
+ elementHeight: 'Height (px)',
168
+ elementScriptPreview: 'A script element is drawn from the saved board — save it to see this one.',
169
+ removeElement: 'Delete element',
170
+ removeElementPlaced: 'Placed {count} times — change or remove those widgets first.',
171
+ elementPropRemove: 'Remove {name}',
172
+ elementPropNew: 'New prop',
173
+ elementPropAdd: 'Add prop',
174
+ boundField: 'bound',
175
+ choiceDefault: 'Default',
176
+ advancedProps: 'Advanced: edit as JSON',
177
+ moreInAdvanced: 'More options in Advanced: {count}',
178
+ noDataSources: 'No data source is connected.',
179
+ propPath: 'Prop path',
180
+ choosePropPath: 'Choose what to bind',
181
+ otherPropPath: 'Another path…',
182
+ typedPropPath: 'Path in the widget props',
183
+ reference: 'Reference',
184
+ chooseReference: 'Choose a reference',
185
+ path: 'Path',
186
+ pickItemBy: 'Pick the list item by',
187
+ pickItemByPosition: 'its position in the list',
188
+ listItem: 'List item',
189
+ clearListItem: 'Pick by position',
190
+ observedAt: 'Observed time',
191
+ observedAtWhenRead: 'When it is read',
192
+ observedAtHint: 'Explore the response to pick the field where the source says when it observed the value.',
193
+ timeZone: 'Time zone of the source',
194
+ unknownTimeZone: 'Enter a time zone such as Asia/Seoul or UTC.',
195
+ observedAtReads: 'Reads as {time} — {age}',
196
+ observedAtLater: 'This is later than now — check the time zone.',
197
+ requestTime: 'The time it asks for',
198
+ maxAge: 'Normally at most (minutes old)',
199
+ maxAgeHint: "Older than this by the source's time, the value is marked 'Source behind'. The source is asked again no sooner than an eighth of it.",
200
+ invalidMaxAge: 'Enter a number of minutes above 0, or leave it empty.',
201
+ keyInPath: "This path seems to carry a key. A board keeps its paths and a share link shows them — send the key through the data source's authentication instead.",
202
+ valuePath: 'Value path',
203
+ explore: 'Explore',
204
+ wholeResponse: '(whole response)',
205
+ bindingNeedsPropPath: 'Enter the prop path to bind.',
206
+ bindingNeedsReference: 'Choose a reference.',
207
+ valueMapHeading: 'Value map',
208
+ mapFrom: 'Source value {n}',
209
+ mapTo: 'Shown as {n}',
210
+ addMapping: 'Add mapping',
211
+ removeMapping: 'Remove mapping {n}',
212
+ rangeMin: 'Range {n} from',
213
+ rangeMax: 'Range {n} below',
214
+ rangeTo: 'Range {n} shown as',
215
+ addRange: 'Add range',
216
+ removeRange: 'Remove range {n}',
217
+ rangeInvalid: 'Range {n}: give a lower end, an upper end, or both — the upper above the lower.',
218
+ mapOtherwise: 'Anything else',
219
+ mapOtherwisePlaceholder: 'as it comes',
220
+ statesHeading: 'States',
221
+ statesNeedBinding: 'Bind a value first — a part’s state is read from one of its widget’s bindings.',
222
+ statesFrom: 'Read from',
223
+ statesNone: 'No states',
224
+ statesMapHeading: 'Value → state',
225
+ stateForValue: 'State for value {n}',
226
+ stateForRange: 'State for range {n}',
227
+ statesLooks: 'How each state is shown',
228
+ stateOutline: 'Ring colour — {state}',
229
+ stateBlink: 'Blink — {state}',
230
+ stateHidden: 'Hide — {state}',
231
+ removeStates: 'Remove states',
232
+ triggersHeading: 'Triggers',
233
+ triggersOnOpenHeading: 'When the board opens',
234
+ triggerHeading: 'Trigger {n}',
235
+ triggerEvent: 'When',
236
+ triggerOnClick: 'It is clicked',
237
+ triggerOnElement: 'Its element raises an event',
238
+ triggerOnEnter: 'It enters a state',
239
+ triggerOnLeave: 'It leaves a state',
240
+ triggerEventName: 'Event name',
241
+ triggerState: 'State',
242
+ triggerOnlyWhen: 'Only while a part is in a state',
243
+ triggerEveryItem: 'For every item of {part}',
244
+ triggerWhenPart: 'Part',
245
+ triggerWhenState: 'State (several: comma-separated)',
246
+ triggerAction: 'Action {n}',
247
+ triggerOpenLink: 'Open a link',
248
+ triggerFocus: 'Bring a part into view',
249
+ triggerEmit: 'Tell the page',
250
+ triggerGoToBoard: 'Show another board',
251
+ triggerFocusPart: 'Part to show {n}',
252
+ triggerLinkUrl: 'Link {n}',
253
+ triggerEmitName: 'Event name {n}',
254
+ triggerBoardId: 'Board id {n}',
255
+ removeTriggerAction: 'Remove action {n}',
256
+ addTriggerAction: 'Add action',
257
+ removeTrigger: 'Remove trigger {n}',
258
+ addTrigger: 'Add trigger',
259
+ triggerIncomplete: 'Fill in every field — the trigger is saved once it is complete.',
260
+ triggerLinkRefused: 'A link must be an https:// address or a path on this installation (/…).',
261
+ mapped: 'mapped',
262
+ previewLive: 'live',
263
+ arrowNone: 'None',
264
+ arrowEnd: 'Toward {to}',
265
+ arrowStart: 'Toward {from}',
266
+ arrowBoth: 'Both ways',
267
+ arrowFromField: 'By {field}',
268
+ };
269
+ export const DEFAULT_DESIGNER_LABELS = { ...DEFAULT_LABELS, ...DEFAULT_AUTHORING_LABELS };
270
+ /** `DEFAULT_DESIGNER_LABELS` with `labels` laid over it. */
271
+ export function resolveDesignerLabels(labels) {
272
+ return labels ? { ...DEFAULT_DESIGNER_LABELS, ...labels } : DEFAULT_DESIGNER_LABELS;
273
+ }
@@ -0,0 +1,7 @@
1
+ import { type DesignerLabels } from './labels.js';
2
+ /**
3
+ * The full label set for a component, stable across renders while the text stays the same — so a host may pass
4
+ * `labels` as an inline object literal without re-running the effects that render with them. Keyed on the content
5
+ * (the labels are plain strings), not on the object's identity.
6
+ */
7
+ export declare function useDesignerLabels(labels: Partial<DesignerLabels> | undefined): DesignerLabels;
@@ -0,0 +1,12 @@
1
+ import { useMemo } from 'react';
2
+ import { resolveDesignerLabels } from './labels.js';
3
+ /**
4
+ * The full label set for a component, stable across renders while the text stays the same — so a host may pass
5
+ * `labels` as an inline object literal without re-running the effects that render with them. Keyed on the content
6
+ * (the labels are plain strings), not on the object's identity.
7
+ */
8
+ export function useDesignerLabels(labels) {
9
+ const key = labels ? JSON.stringify(labels) : '';
10
+ // eslint-disable-next-line react-hooks/exhaustive-deps -- `key` is the content of `labels`
11
+ return useMemo(() => resolveDesignerLabels(labels), [key]);
12
+ }