@widgetic/canvas 0.5.17 → 0.5.19
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/README.md +110 -0
- package/dist/canvas/Canvas.svelte +190 -55
- package/dist/canvas/Canvas.svelte.d.ts +6 -0
- package/dist/canvas/CanvasToolbar.svelte +146 -178
- package/dist/canvas/CanvasToolbar.svelte.d.ts +2 -2
- package/dist/canvas/ContextMenu.svelte +52 -28
- package/dist/canvas/PanZoomPanel.svelte +32 -23
- package/dist/canvas/WidgetSelectionLayer.svelte +1 -1
- package/dist/canvas/eventScope.d.ts +56 -0
- package/dist/canvas/eventScope.js +89 -0
- package/dist/canvas/props-panel/PropsPanel.svelte +117 -146
- package/dist/canvas/props-panel/TextPropsICSection.svelte +18 -14
- package/dist/canvas/shadowRootText.d.ts +5 -0
- package/dist/canvas/shadowRootText.js +43 -0
- package/dist/canvas/shapes/FrameShape.js +4 -2
- package/dist/canvas/shapes/ImageShape.js +9 -11
- package/dist/canvas/shapes/ShapeLibrary.d.ts +3 -1
- package/dist/canvas/shapes/ShapeLibrary.js +26 -26
- package/dist/canvas/shapes/WidgetShape.js +6 -3
- package/dist/canvas/widgetPreviewGeometry.js +5 -8
- package/dist/components/Tooltip.svelte +5 -2
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.js +4 -0
- package/dist/components/input-controls/ColorIC.svelte +15 -10
- package/dist/components/input-controls/ColorIC.svelte.d.ts +1 -1
- package/dist/components/input-controls/FontSelectorIC.svelte +12 -3
- package/dist/components/input-controls/SliderUnitIC.svelte +21 -7
- package/dist/components/input-controls/SliderUnitIC.svelte.d.ts +1 -1
- package/dist/components/input-controls/TextAlignIC.svelte +10 -5
- package/dist/components/input-controls/TextStyleIC.svelte +11 -7
- package/dist/components/preferenceStorage.d.ts +14 -0
- package/dist/components/preferenceStorage.js +25 -0
- package/dist/i18n/index.d.ts +2 -0
- package/dist/i18n/index.js +2 -0
- package/dist/i18n/labels.d.ts +23 -0
- package/dist/i18n/labels.js +75 -0
- package/dist/i18n/language.d.ts +23 -0
- package/dist/i18n/language.js +33 -0
- package/dist/i18n/messages.d.ts +277 -0
- package/dist/i18n/messages.js +292 -0
- package/dist/i18n/shapeWords.d.ts +30 -0
- package/dist/i18n/shapeWords.js +36 -0
- package/dist/i18n/shortcuts.d.ts +52 -0
- package/dist/i18n/shortcuts.js +104 -0
- package/dist/i18n/slots.d.ts +20 -0
- package/dist/i18n/slots.js +40 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +5 -0
- package/package.json +11 -2
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every word the canvas shows to the person using it, in English: the one place to read them, and the keys a page can
|
|
3
|
+
* replace with the `messages` of the canvas.
|
|
4
|
+
*
|
|
5
|
+
* A message is plain text. `{name}` is a value the canvas puts in; `{count, plural, one {# file} other {# files}}` picks
|
|
6
|
+
* the form that fits a number in the page's language. `\{`, `\}`, `\#` and `\\` write those characters themselves. See
|
|
7
|
+
* `@widgetic/design-system/i18n` for the whole format.
|
|
8
|
+
*
|
|
9
|
+
* Keys are grouped by where the words appear. A key that is left out of a page's `messages` keeps the English text below,
|
|
10
|
+
* so a language can be added a screen at a time.
|
|
11
|
+
*
|
|
12
|
+
* Words that are NOT here, on purpose:
|
|
13
|
+
* - the names of widgets, frames, files and fonts, and what the visitor typed into a text: they are shown as they were
|
|
14
|
+
* written;
|
|
15
|
+
* - the English names the canvas keeps for the things it saves ("libraryShape", "Symbol Shapes", a shape's key): they
|
|
16
|
+
* are data, and a screen says them with the messages below.
|
|
17
|
+
*/
|
|
18
|
+
export declare const CANVAS_MESSAGES: {
|
|
19
|
+
readonly 'canvas.state.loading': "Loading canvas…";
|
|
20
|
+
readonly 'canvas.state.initFailed': "Canvas failed to initialize.";
|
|
21
|
+
/** Said in a dialog of the browser when a picture cannot be loaded from the address the visitor typed. */
|
|
22
|
+
readonly 'canvas.error.imageFromUrl': "Failed to load image from URL. Make sure the URL is correct and allows cross-origin requests.";
|
|
23
|
+
readonly 'canvas.defaults.text': "Hello World!";
|
|
24
|
+
/** The text a new text box starts with. */
|
|
25
|
+
readonly 'canvas.defaults.textBox': "Type here";
|
|
26
|
+
/** The name written above a new frame. */
|
|
27
|
+
readonly 'canvas.defaults.frameLabel': "Frame";
|
|
28
|
+
/** The name a frame gets when it is made into a widget without one. */
|
|
29
|
+
readonly 'canvas.defaults.untitledFrame': "Untitled Frame";
|
|
30
|
+
readonly 'canvas.defaults.untitledShape': "Untitled Shape";
|
|
31
|
+
readonly 'canvas.draw.dropImage': "Drop image";
|
|
32
|
+
readonly 'canvas.draw.dropVideo': "Drop video";
|
|
33
|
+
/** Between "Drop image" and "double click": "Drop image / or / double click". */
|
|
34
|
+
readonly 'canvas.draw.or': "or";
|
|
35
|
+
readonly 'canvas.draw.doubleClick': "double click";
|
|
36
|
+
/** What a widget on the canvas is called until it has a name. */
|
|
37
|
+
readonly 'canvas.draw.widgetName': "Widget";
|
|
38
|
+
readonly 'canvas.draw.widgetPreview': "Widget preview";
|
|
39
|
+
readonly 'canvas.tool.select': "Select";
|
|
40
|
+
readonly 'canvas.tool.hand': "Hand / Pan";
|
|
41
|
+
readonly 'canvas.tool.erase': "Erase";
|
|
42
|
+
readonly 'canvas.tool.draw': "Draw";
|
|
43
|
+
readonly 'canvas.tool.arrow': "Arrow";
|
|
44
|
+
readonly 'canvas.tool.rectangle': "Rectangle";
|
|
45
|
+
readonly 'canvas.tool.triangle': "Triangle";
|
|
46
|
+
readonly 'canvas.tool.ellipse': "Ellipse";
|
|
47
|
+
readonly 'canvas.tool.circle': "Circle";
|
|
48
|
+
readonly 'canvas.tool.frame': "Frame";
|
|
49
|
+
readonly 'canvas.tool.text': "Text";
|
|
50
|
+
readonly 'canvas.tool.image': "Image";
|
|
51
|
+
readonly 'canvas.tool.video': "Video";
|
|
52
|
+
readonly 'canvas.tool.shapes': "Shapes";
|
|
53
|
+
readonly 'canvas.tool.moreShapes': "More Shapes";
|
|
54
|
+
readonly 'canvas.tool.undo': "Undo";
|
|
55
|
+
readonly 'canvas.tool.redo': "Redo";
|
|
56
|
+
/** The hint of a button that has a shortcut: "Draw (D)". `{name}` is the name of the tool, `{key}` its key. */
|
|
57
|
+
readonly 'canvas.tool.withKey': "{name} ({key})";
|
|
58
|
+
/** The hints of the two buttons whose shortcut has Ctrl in it. */
|
|
59
|
+
readonly 'canvas.tool.undoTitle': "Undo (Ctrl+Z)";
|
|
60
|
+
readonly 'canvas.tool.redoTitle': "Redo (Ctrl+Shift+Z)";
|
|
61
|
+
readonly 'canvas.tool.stickyOn': "Tool Lock: ON — drawing tool stays active";
|
|
62
|
+
readonly 'canvas.tool.stickyOff': "Tool Lock: OFF — reverts to Select after placing";
|
|
63
|
+
readonly 'canvas.tool.stickyLabel': "Toggle sticky tool mode";
|
|
64
|
+
/** The group of frame, image and video in the menu of shapes. */
|
|
65
|
+
readonly 'canvas.menu.mediaShapes': "Media Shapes";
|
|
66
|
+
/** The groups of the shape library. */
|
|
67
|
+
readonly 'canvas.category.geometric': "Geometric Shapes";
|
|
68
|
+
readonly 'canvas.category.arrows': "Arrow Shapes";
|
|
69
|
+
readonly 'canvas.category.media': "Media Icons";
|
|
70
|
+
readonly 'canvas.category.ui': "UI Icons";
|
|
71
|
+
readonly 'canvas.category.symbols': "Symbol Shapes";
|
|
72
|
+
readonly 'canvas.shape.hexagon': "Hexagon";
|
|
73
|
+
readonly 'canvas.shape.oval': "Oval";
|
|
74
|
+
readonly 'canvas.shape.play': "Play";
|
|
75
|
+
readonly 'canvas.shape.pause': "Pause";
|
|
76
|
+
readonly 'canvas.shape.stop': "Stop";
|
|
77
|
+
readonly 'canvas.shape.rewind': "Rewind";
|
|
78
|
+
readonly 'canvas.shape.fastForward': "Fast Forward";
|
|
79
|
+
readonly 'canvas.shape.record': "Record";
|
|
80
|
+
readonly 'canvas.shape.arrowRight': "Arrow Right";
|
|
81
|
+
readonly 'canvas.shape.arrowLeft': "Arrow Left";
|
|
82
|
+
readonly 'canvas.shape.arrowUp': "Arrow Up";
|
|
83
|
+
readonly 'canvas.shape.arrowDown': "Arrow Down";
|
|
84
|
+
readonly 'canvas.shape.doubleArrow': "Double Arrow";
|
|
85
|
+
readonly 'canvas.shape.curvedArrow': "Curved Arrow";
|
|
86
|
+
readonly 'canvas.shape.checkMark': "Check Mark";
|
|
87
|
+
readonly 'canvas.shape.cross': "Cross / X";
|
|
88
|
+
readonly 'canvas.shape.plus': "Plus";
|
|
89
|
+
readonly 'canvas.shape.minus': "Minus";
|
|
90
|
+
readonly 'canvas.shape.info': "Info";
|
|
91
|
+
readonly 'canvas.shape.warning': "Warning";
|
|
92
|
+
readonly 'canvas.shape.star': "Star";
|
|
93
|
+
readonly 'canvas.shape.heart': "Heart";
|
|
94
|
+
readonly 'canvas.shape.speechBubble': "Speech Bubble";
|
|
95
|
+
readonly 'canvas.shape.rhombus': "Rhombus";
|
|
96
|
+
readonly 'canvas.shape.lightning': "Lightning";
|
|
97
|
+
readonly 'canvas.shape.shield': "Shield";
|
|
98
|
+
readonly 'canvas.action.cut': "Cut";
|
|
99
|
+
readonly 'canvas.action.copy': "Copy";
|
|
100
|
+
readonly 'canvas.action.paste': "Paste";
|
|
101
|
+
readonly 'canvas.action.duplicate': "Duplicate";
|
|
102
|
+
readonly 'canvas.action.delete': "Delete";
|
|
103
|
+
readonly 'canvas.action.group': "Group";
|
|
104
|
+
readonly 'canvas.action.ungroup': "Ungroup";
|
|
105
|
+
readonly 'canvas.action.selectAll': "Select All";
|
|
106
|
+
readonly 'canvas.action.clearAll': "Clear All";
|
|
107
|
+
readonly 'canvas.layer.title': "Layer Order";
|
|
108
|
+
readonly 'canvas.layer.front': "Bring to Front";
|
|
109
|
+
readonly 'canvas.layer.forward': "Bring Forward";
|
|
110
|
+
readonly 'canvas.layer.backward': "Send Backward";
|
|
111
|
+
readonly 'canvas.layer.back': "Send to Back";
|
|
112
|
+
/** The short names on the four buttons of the properties panel. */
|
|
113
|
+
readonly 'canvas.layer.frontShort': "Front";
|
|
114
|
+
readonly 'canvas.layer.upShort': "Up";
|
|
115
|
+
readonly 'canvas.layer.downShort': "Down";
|
|
116
|
+
readonly 'canvas.layer.backShort': "Back";
|
|
117
|
+
readonly 'canvas.shortcuts.title': "Keyboard Shortcuts";
|
|
118
|
+
readonly 'canvas.shortcuts.close': "Close keyboard shortcuts";
|
|
119
|
+
/** The line under the list. `{key}` is the "?" key, `{hint}` the note after it (next message), `{icon}` the keyboard icon. */
|
|
120
|
+
readonly 'canvas.shortcuts.footer': "Press {key} {hint} or click {icon} in the zoom panel to toggle";
|
|
121
|
+
readonly 'canvas.shortcuts.footerHint': "(Shift + /)";
|
|
122
|
+
readonly 'canvas.shortcuts.groupTools': "Tools";
|
|
123
|
+
readonly 'canvas.shortcuts.groupSelection': "Selection";
|
|
124
|
+
readonly 'canvas.shortcuts.groupHistory': "History";
|
|
125
|
+
readonly 'canvas.shortcuts.groupZoom': "Zoom & Canvas";
|
|
126
|
+
readonly 'canvas.shortcuts.drillThrough': "Drill-through Select";
|
|
127
|
+
readonly 'canvas.shortcuts.redoAlt': "Redo (alt)";
|
|
128
|
+
readonly 'canvas.shortcuts.save': "Save";
|
|
129
|
+
readonly 'canvas.shortcuts.zoomIn': "Zoom In";
|
|
130
|
+
readonly 'canvas.shortcuts.zoomOut': "Zoom Out";
|
|
131
|
+
readonly 'canvas.shortcuts.zoomReset': "Reset Zoom (100%)";
|
|
132
|
+
readonly 'canvas.shortcuts.fit': "Fit to screen";
|
|
133
|
+
readonly 'canvas.shortcuts.pan': "Pan canvas";
|
|
134
|
+
readonly 'canvas.shortcuts.move1': "Move selected (1px)";
|
|
135
|
+
readonly 'canvas.shortcuts.move10': "Move selected (10px)";
|
|
136
|
+
readonly 'canvas.shortcuts.frameResize': "Resize, keep children size";
|
|
137
|
+
readonly 'canvas.shortcuts.frameEdit': "Enter / exit frame edit";
|
|
138
|
+
/** The names of keys that are words. Letters and symbols are not here: they are the same on every keyboard. */
|
|
139
|
+
readonly 'canvas.key.ctrlCmd': "Ctrl/Cmd";
|
|
140
|
+
readonly 'canvas.key.alt': "Alt";
|
|
141
|
+
readonly 'canvas.key.shift': "Shift";
|
|
142
|
+
readonly 'canvas.key.delete': "Del";
|
|
143
|
+
readonly 'canvas.key.space': "Space";
|
|
144
|
+
readonly 'canvas.key.click': "Click";
|
|
145
|
+
readonly 'canvas.key.drag': "Drag";
|
|
146
|
+
readonly 'canvas.key.dragCorner': "Drag corner";
|
|
147
|
+
readonly 'canvas.key.doubleClick': "Double-click";
|
|
148
|
+
readonly 'canvas.zoom.expandTitle': "Zoom {percent}% — click to expand";
|
|
149
|
+
readonly 'canvas.zoom.expandLabel': "Expand zoom controls";
|
|
150
|
+
readonly 'canvas.zoom.gridTitle': "Toggle Grid [G]";
|
|
151
|
+
readonly 'canvas.zoom.gridLabel': "Toggle grid";
|
|
152
|
+
readonly 'canvas.zoom.panTitle': "Hand / Pan [H]";
|
|
153
|
+
readonly 'canvas.zoom.panLabel': "Hand / pan tool";
|
|
154
|
+
readonly 'canvas.zoom.outTitle': "Zoom Out [Ctrl/Cmd] + [−]";
|
|
155
|
+
readonly 'canvas.zoom.outLabel': "Zoom out";
|
|
156
|
+
readonly 'canvas.zoom.inTitle': "Zoom In [Ctrl/Cmd] + [+]";
|
|
157
|
+
readonly 'canvas.zoom.inLabel': "Zoom in";
|
|
158
|
+
/** The number field with the zoom level: what it does when it is clicked, and what it is. */
|
|
159
|
+
readonly 'canvas.zoom.resetTitle': "Reset zoom to 100% [Ctrl/Cmd] + [0]";
|
|
160
|
+
readonly 'canvas.zoom.resetLabel': "Reset zoom to 100%";
|
|
161
|
+
readonly 'canvas.zoom.levelLabel': "Zoom level (percent)";
|
|
162
|
+
/** The "1:1" button. */
|
|
163
|
+
readonly 'canvas.zoom.oneToOneTitle': "Reset Zoom 100% [Ctrl/Cmd] + [0]";
|
|
164
|
+
readonly 'canvas.zoom.fitTitle': "Fit Content to View [Ctrl/Cmd] + [9]";
|
|
165
|
+
readonly 'canvas.zoom.fitLabel': "Fit content to view";
|
|
166
|
+
readonly 'canvas.zoom.shortcutsTitle': "Keyboard Shortcuts [?]";
|
|
167
|
+
readonly 'canvas.zoom.shortcutsLabel': "Toggle keyboard shortcuts panel";
|
|
168
|
+
readonly 'canvas.zoom.unsavedTitle': "Unsaved changes — click to save [Cmd+S]";
|
|
169
|
+
readonly 'canvas.zoom.savedTitle': "All changes saved [Cmd+S]";
|
|
170
|
+
readonly 'canvas.zoom.minimize': "Minimize Zoom Panel";
|
|
171
|
+
readonly 'canvas.props.shape': "SHAPE:";
|
|
172
|
+
readonly 'canvas.props.showAll': "Show all properties";
|
|
173
|
+
readonly 'canvas.props.showFewer': "Show fewer properties";
|
|
174
|
+
readonly 'canvas.props.close': "Close properties panel";
|
|
175
|
+
/** What a container holds: "Children: 3". */
|
|
176
|
+
readonly 'canvas.props.children': "Children: {count}";
|
|
177
|
+
readonly 'canvas.props.actions': "Actions";
|
|
178
|
+
readonly 'canvas.props.general': "General Properties";
|
|
179
|
+
readonly 'canvas.props.dimensions': "Dimensions";
|
|
180
|
+
readonly 'canvas.props.width': "Width";
|
|
181
|
+
readonly 'canvas.props.height': "Height";
|
|
182
|
+
readonly 'canvas.props.proportionsFixed': "Proportions locked (shape constraint)";
|
|
183
|
+
readonly 'canvas.props.proportionsUnlock': "Unlock proportions";
|
|
184
|
+
readonly 'canvas.props.proportionsLock': "Lock proportions";
|
|
185
|
+
readonly 'canvas.props.textProperties': "Text Properties";
|
|
186
|
+
readonly 'canvas.props.labelProperties': "Label Properties";
|
|
187
|
+
readonly 'canvas.props.boxProperties': "Box Properties";
|
|
188
|
+
readonly 'canvas.props.groupBox': "Group Box";
|
|
189
|
+
readonly 'canvas.props.labelText': "Text/Description";
|
|
190
|
+
readonly 'canvas.props.labelPlaceholder': "Describe this frame (used as widget description & prompt context)";
|
|
191
|
+
readonly 'canvas.props.textBackground': "Text Background";
|
|
192
|
+
readonly 'canvas.type.none': "None";
|
|
193
|
+
readonly 'canvas.type.widget': "Widget";
|
|
194
|
+
readonly 'canvas.type.drawing': "Drawing";
|
|
195
|
+
readonly 'canvas.type.line': "Line";
|
|
196
|
+
readonly 'canvas.type.group': "Group";
|
|
197
|
+
readonly 'canvas.type.selection': "Selection";
|
|
198
|
+
/** A shape of the library that was drawn: "Star (Drawing)". */
|
|
199
|
+
readonly 'canvas.type.drawingOf': "{name} (Drawing)";
|
|
200
|
+
readonly 'canvas.type.customShape': "Custom Shape (Drawing)";
|
|
201
|
+
readonly 'canvas.field.opacity': "Opacity";
|
|
202
|
+
readonly 'canvas.field.cornerRoundness': "Corner Roundness";
|
|
203
|
+
readonly 'canvas.field.backgroundColor': "Background Color";
|
|
204
|
+
readonly 'canvas.field.backgroundOpacity': "Background Opacity";
|
|
205
|
+
readonly 'canvas.field.fillColor': "Fill Color";
|
|
206
|
+
readonly 'canvas.field.fillOpacity': "Fill Opacity";
|
|
207
|
+
readonly 'canvas.field.strokeColor': "Stroke Color";
|
|
208
|
+
readonly 'canvas.field.strokeWidth': "Stroke Width";
|
|
209
|
+
readonly 'canvas.field.strokeType': "Stroke Type";
|
|
210
|
+
readonly 'canvas.field.strokeSolid': "Solid";
|
|
211
|
+
readonly 'canvas.field.strokeDashed': "Dashed";
|
|
212
|
+
readonly 'canvas.field.strokeDotted': "Dotted";
|
|
213
|
+
readonly 'canvas.field.fontSize': "Font Size";
|
|
214
|
+
readonly 'canvas.field.textPadding': "Text Padding";
|
|
215
|
+
readonly 'canvas.field.textColor': "Text Color";
|
|
216
|
+
readonly 'canvas.field.textStrokeColor': "Text Stroke Color";
|
|
217
|
+
readonly 'canvas.field.textStrokeWidth': "Text Stroke Width";
|
|
218
|
+
readonly 'canvas.field.groupFillColor': "Group Fill Color";
|
|
219
|
+
readonly 'canvas.field.groupFillOpacity': "Group Fill Opacity";
|
|
220
|
+
readonly 'canvas.field.groupStrokeColor': "Group Stroke Color";
|
|
221
|
+
readonly 'canvas.field.groupStrokeWidth': "Group Stroke Width";
|
|
222
|
+
readonly 'canvas.field.groupStrokeType': "Group Stroke Type";
|
|
223
|
+
readonly 'canvas.arrange.title': "Align";
|
|
224
|
+
readonly 'canvas.arrange.left': "Align Left";
|
|
225
|
+
readonly 'canvas.arrange.centerH': "Align Center (horizontal)";
|
|
226
|
+
readonly 'canvas.arrange.right': "Align Right";
|
|
227
|
+
readonly 'canvas.arrange.top': "Align Top";
|
|
228
|
+
readonly 'canvas.arrange.middleV': "Align Middle (vertical)";
|
|
229
|
+
readonly 'canvas.arrange.bottom': "Align Bottom";
|
|
230
|
+
readonly 'canvas.image.source': "IMAGE SOURCE";
|
|
231
|
+
readonly 'canvas.image.file': "File:";
|
|
232
|
+
readonly 'canvas.image.noFile': "No file selected";
|
|
233
|
+
readonly 'canvas.image.changeFile': "Change File";
|
|
234
|
+
readonly 'canvas.image.chooseFile': "Choose File";
|
|
235
|
+
readonly 'canvas.image.url': "URL:";
|
|
236
|
+
readonly 'canvas.image.pasteUrl': "Paste URL...";
|
|
237
|
+
readonly 'canvas.image.newUrl': "New URL...";
|
|
238
|
+
readonly 'canvas.image.load': "Load";
|
|
239
|
+
readonly 'canvas.widget.createPreview': "Create Preview";
|
|
240
|
+
readonly 'canvas.widget.capture': "Capture";
|
|
241
|
+
readonly 'canvas.widget.linked': "Widget Linked";
|
|
242
|
+
readonly 'canvas.widget.converting': "Converting...";
|
|
243
|
+
readonly 'canvas.widget.duplicating': "Duplicating...";
|
|
244
|
+
readonly 'canvas.widget.linking': "Linking widget...";
|
|
245
|
+
readonly 'canvas.widget.unlinkedTitle': "Unlinked Widget Shape";
|
|
246
|
+
readonly 'canvas.widget.orphanNotice': "This shape points to a widget that was deleted or moved to another canvas. Remove it from the canvas to avoid confusion.";
|
|
247
|
+
readonly 'canvas.widget.removeFromCanvas': "Remove from canvas";
|
|
248
|
+
readonly 'canvas.widget.namePlaceholder': "Widget name";
|
|
249
|
+
readonly 'canvas.widget.openDetails': "Click to open Widget Details";
|
|
250
|
+
readonly 'canvas.widget.refreshPreview': "Refresh Preview Image";
|
|
251
|
+
readonly 'canvas.widget.primary': "Primary widget";
|
|
252
|
+
readonly 'canvas.widget.primaryTitle': "Use this widget as the canvas primary (red stroke)";
|
|
253
|
+
readonly 'canvas.widget.setPrimary': "Set as primary";
|
|
254
|
+
readonly 'canvas.widget.convertLabel': "Convert to Widget";
|
|
255
|
+
readonly 'canvas.widget.convertButton': "CONVERT TO WIDGET";
|
|
256
|
+
/** What a widget shape is called when the widget it points to is gone. */
|
|
257
|
+
readonly 'canvas.widget.unlinkedName': "Unlinked widget";
|
|
258
|
+
readonly 'canvas.control.color': "Color";
|
|
259
|
+
readonly 'canvas.control.value': "Value";
|
|
260
|
+
readonly 'canvas.control.openPicker': "Open color picker";
|
|
261
|
+
readonly 'canvas.control.removeColor': "Remove color";
|
|
262
|
+
readonly 'canvas.control.fontFamily': "Font Family";
|
|
263
|
+
readonly 'canvas.control.textStyle': "Text Style";
|
|
264
|
+
readonly 'canvas.control.bold': "Bold";
|
|
265
|
+
/** The letters on the buttons for bold, italic and underline. */
|
|
266
|
+
readonly 'canvas.control.boldMark': "B";
|
|
267
|
+
readonly 'canvas.control.italic': "Italic";
|
|
268
|
+
readonly 'canvas.control.italicMark': "I";
|
|
269
|
+
readonly 'canvas.control.underline': "Underline";
|
|
270
|
+
readonly 'canvas.control.underlineMark': "U";
|
|
271
|
+
readonly 'canvas.control.textAlign': "Text Align";
|
|
272
|
+
readonly 'canvas.control.alignLeft': "Align Left";
|
|
273
|
+
readonly 'canvas.control.alignCenter': "Align Center";
|
|
274
|
+
readonly 'canvas.control.alignRight': "Align Right";
|
|
275
|
+
};
|
|
276
|
+
/** The name of a message of the canvas. */
|
|
277
|
+
export type CanvasMessageKey = keyof typeof CANVAS_MESSAGES;
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every word the canvas shows to the person using it, in English: the one place to read them, and the keys a page can
|
|
3
|
+
* replace with the `messages` of the canvas.
|
|
4
|
+
*
|
|
5
|
+
* A message is plain text. `{name}` is a value the canvas puts in; `{count, plural, one {# file} other {# files}}` picks
|
|
6
|
+
* the form that fits a number in the page's language. `\{`, `\}`, `\#` and `\\` write those characters themselves. See
|
|
7
|
+
* `@widgetic/design-system/i18n` for the whole format.
|
|
8
|
+
*
|
|
9
|
+
* Keys are grouped by where the words appear. A key that is left out of a page's `messages` keeps the English text below,
|
|
10
|
+
* so a language can be added a screen at a time.
|
|
11
|
+
*
|
|
12
|
+
* Words that are NOT here, on purpose:
|
|
13
|
+
* - the names of widgets, frames, files and fonts, and what the visitor typed into a text: they are shown as they were
|
|
14
|
+
* written;
|
|
15
|
+
* - the English names the canvas keeps for the things it saves ("libraryShape", "Symbol Shapes", a shape's key): they
|
|
16
|
+
* are data, and a screen says them with the messages below.
|
|
17
|
+
*/
|
|
18
|
+
export const CANVAS_MESSAGES = {
|
|
19
|
+
// ===== The canvas itself =====
|
|
20
|
+
'canvas.state.loading': 'Loading canvas…',
|
|
21
|
+
'canvas.state.initFailed': 'Canvas failed to initialize.',
|
|
22
|
+
/** Said in a dialog of the browser when a picture cannot be loaded from the address the visitor typed. */
|
|
23
|
+
'canvas.error.imageFromUrl': 'Failed to load image from URL. Make sure the URL is correct and allows cross-origin requests.',
|
|
24
|
+
// ===== What a new thing says before the visitor changes it (saved with the canvas, in the language it was made in) =====
|
|
25
|
+
'canvas.defaults.text': 'Hello World!',
|
|
26
|
+
/** The text a new text box starts with. */
|
|
27
|
+
'canvas.defaults.textBox': 'Type here',
|
|
28
|
+
/** The name written above a new frame. */
|
|
29
|
+
'canvas.defaults.frameLabel': 'Frame',
|
|
30
|
+
/** The name a frame gets when it is made into a widget without one. */
|
|
31
|
+
'canvas.defaults.untitledFrame': 'Untitled Frame',
|
|
32
|
+
'canvas.defaults.untitledShape': 'Untitled Shape',
|
|
33
|
+
// ===== Words drawn onto the canvas itself (on an empty image or video, and on a widget that has no picture yet) =====
|
|
34
|
+
'canvas.draw.dropImage': 'Drop image',
|
|
35
|
+
'canvas.draw.dropVideo': 'Drop video',
|
|
36
|
+
/** Between "Drop image" and "double click": "Drop image / or / double click". */
|
|
37
|
+
'canvas.draw.or': 'or',
|
|
38
|
+
'canvas.draw.doubleClick': 'double click',
|
|
39
|
+
/** What a widget on the canvas is called until it has a name. */
|
|
40
|
+
'canvas.draw.widgetName': 'Widget',
|
|
41
|
+
'canvas.draw.widgetPreview': 'Widget preview',
|
|
42
|
+
// ===== The names of the tools (also the names of the buttons that choose them) =====
|
|
43
|
+
'canvas.tool.select': 'Select',
|
|
44
|
+
'canvas.tool.hand': 'Hand / Pan',
|
|
45
|
+
'canvas.tool.erase': 'Erase',
|
|
46
|
+
'canvas.tool.draw': 'Draw',
|
|
47
|
+
'canvas.tool.arrow': 'Arrow',
|
|
48
|
+
'canvas.tool.rectangle': 'Rectangle',
|
|
49
|
+
'canvas.tool.triangle': 'Triangle',
|
|
50
|
+
'canvas.tool.ellipse': 'Ellipse',
|
|
51
|
+
'canvas.tool.circle': 'Circle',
|
|
52
|
+
'canvas.tool.frame': 'Frame',
|
|
53
|
+
'canvas.tool.text': 'Text',
|
|
54
|
+
'canvas.tool.image': 'Image',
|
|
55
|
+
'canvas.tool.video': 'Video',
|
|
56
|
+
'canvas.tool.shapes': 'Shapes',
|
|
57
|
+
'canvas.tool.moreShapes': 'More Shapes',
|
|
58
|
+
'canvas.tool.undo': 'Undo',
|
|
59
|
+
'canvas.tool.redo': 'Redo',
|
|
60
|
+
/** The hint of a button that has a shortcut: "Draw (D)". `{name}` is the name of the tool, `{key}` its key. */
|
|
61
|
+
'canvas.tool.withKey': '{name} ({key})',
|
|
62
|
+
/** The hints of the two buttons whose shortcut has Ctrl in it. */
|
|
63
|
+
'canvas.tool.undoTitle': 'Undo (Ctrl+Z)',
|
|
64
|
+
'canvas.tool.redoTitle': 'Redo (Ctrl+Shift+Z)',
|
|
65
|
+
'canvas.tool.stickyOn': 'Tool Lock: ON — drawing tool stays active',
|
|
66
|
+
'canvas.tool.stickyOff': 'Tool Lock: OFF — reverts to Select after placing',
|
|
67
|
+
'canvas.tool.stickyLabel': 'Toggle sticky tool mode',
|
|
68
|
+
// ===== The menu of shapes under the toolbar =====
|
|
69
|
+
/** The group of frame, image and video in the menu of shapes. */
|
|
70
|
+
'canvas.menu.mediaShapes': 'Media Shapes',
|
|
71
|
+
/** The groups of the shape library. */
|
|
72
|
+
'canvas.category.geometric': 'Geometric Shapes',
|
|
73
|
+
'canvas.category.arrows': 'Arrow Shapes',
|
|
74
|
+
'canvas.category.media': 'Media Icons',
|
|
75
|
+
'canvas.category.ui': 'UI Icons',
|
|
76
|
+
'canvas.category.symbols': 'Symbol Shapes',
|
|
77
|
+
// ===== The names of the shapes in the shape library =====
|
|
78
|
+
'canvas.shape.hexagon': 'Hexagon',
|
|
79
|
+
'canvas.shape.oval': 'Oval',
|
|
80
|
+
'canvas.shape.play': 'Play',
|
|
81
|
+
'canvas.shape.pause': 'Pause',
|
|
82
|
+
'canvas.shape.stop': 'Stop',
|
|
83
|
+
'canvas.shape.rewind': 'Rewind',
|
|
84
|
+
'canvas.shape.fastForward': 'Fast Forward',
|
|
85
|
+
'canvas.shape.record': 'Record',
|
|
86
|
+
'canvas.shape.arrowRight': 'Arrow Right',
|
|
87
|
+
'canvas.shape.arrowLeft': 'Arrow Left',
|
|
88
|
+
'canvas.shape.arrowUp': 'Arrow Up',
|
|
89
|
+
'canvas.shape.arrowDown': 'Arrow Down',
|
|
90
|
+
'canvas.shape.doubleArrow': 'Double Arrow',
|
|
91
|
+
'canvas.shape.curvedArrow': 'Curved Arrow',
|
|
92
|
+
'canvas.shape.checkMark': 'Check Mark',
|
|
93
|
+
'canvas.shape.cross': 'Cross / X',
|
|
94
|
+
'canvas.shape.plus': 'Plus',
|
|
95
|
+
'canvas.shape.minus': 'Minus',
|
|
96
|
+
'canvas.shape.info': 'Info',
|
|
97
|
+
'canvas.shape.warning': 'Warning',
|
|
98
|
+
'canvas.shape.star': 'Star',
|
|
99
|
+
'canvas.shape.heart': 'Heart',
|
|
100
|
+
'canvas.shape.speechBubble': 'Speech Bubble',
|
|
101
|
+
'canvas.shape.rhombus': 'Rhombus',
|
|
102
|
+
'canvas.shape.lightning': 'Lightning',
|
|
103
|
+
'canvas.shape.shield': 'Shield',
|
|
104
|
+
// ===== Actions on what is selected (the toolbar, the context menu and the list of shortcuts all use these) =====
|
|
105
|
+
'canvas.action.cut': 'Cut',
|
|
106
|
+
'canvas.action.copy': 'Copy',
|
|
107
|
+
'canvas.action.paste': 'Paste',
|
|
108
|
+
'canvas.action.duplicate': 'Duplicate',
|
|
109
|
+
'canvas.action.delete': 'Delete',
|
|
110
|
+
'canvas.action.group': 'Group',
|
|
111
|
+
'canvas.action.ungroup': 'Ungroup',
|
|
112
|
+
'canvas.action.selectAll': 'Select All',
|
|
113
|
+
'canvas.action.clearAll': 'Clear All',
|
|
114
|
+
// ===== The order of the layers =====
|
|
115
|
+
'canvas.layer.title': 'Layer Order',
|
|
116
|
+
'canvas.layer.front': 'Bring to Front',
|
|
117
|
+
'canvas.layer.forward': 'Bring Forward',
|
|
118
|
+
'canvas.layer.backward': 'Send Backward',
|
|
119
|
+
'canvas.layer.back': 'Send to Back',
|
|
120
|
+
/** The short names on the four buttons of the properties panel. */
|
|
121
|
+
'canvas.layer.frontShort': 'Front',
|
|
122
|
+
'canvas.layer.upShort': 'Up',
|
|
123
|
+
'canvas.layer.downShort': 'Down',
|
|
124
|
+
'canvas.layer.backShort': 'Back',
|
|
125
|
+
// ===== The list of keyboard shortcuts =====
|
|
126
|
+
'canvas.shortcuts.title': 'Keyboard Shortcuts',
|
|
127
|
+
'canvas.shortcuts.close': 'Close keyboard shortcuts',
|
|
128
|
+
/** The line under the list. `{key}` is the "?" key, `{hint}` the note after it (next message), `{icon}` the keyboard icon. */
|
|
129
|
+
'canvas.shortcuts.footer': 'Press {key} {hint} or click {icon} in the zoom panel to toggle',
|
|
130
|
+
'canvas.shortcuts.footerHint': '(Shift + /)',
|
|
131
|
+
'canvas.shortcuts.groupTools': 'Tools',
|
|
132
|
+
'canvas.shortcuts.groupSelection': 'Selection',
|
|
133
|
+
'canvas.shortcuts.groupHistory': 'History',
|
|
134
|
+
'canvas.shortcuts.groupZoom': 'Zoom & Canvas',
|
|
135
|
+
'canvas.shortcuts.drillThrough': 'Drill-through Select',
|
|
136
|
+
'canvas.shortcuts.redoAlt': 'Redo (alt)',
|
|
137
|
+
'canvas.shortcuts.save': 'Save',
|
|
138
|
+
'canvas.shortcuts.zoomIn': 'Zoom In',
|
|
139
|
+
'canvas.shortcuts.zoomOut': 'Zoom Out',
|
|
140
|
+
'canvas.shortcuts.zoomReset': 'Reset Zoom (100%)',
|
|
141
|
+
'canvas.shortcuts.fit': 'Fit to screen',
|
|
142
|
+
'canvas.shortcuts.pan': 'Pan canvas',
|
|
143
|
+
'canvas.shortcuts.move1': 'Move selected (1px)',
|
|
144
|
+
'canvas.shortcuts.move10': 'Move selected (10px)',
|
|
145
|
+
'canvas.shortcuts.frameResize': 'Resize, keep children size',
|
|
146
|
+
'canvas.shortcuts.frameEdit': 'Enter / exit frame edit',
|
|
147
|
+
/** The names of keys that are words. Letters and symbols are not here: they are the same on every keyboard. */
|
|
148
|
+
'canvas.key.ctrlCmd': 'Ctrl/Cmd',
|
|
149
|
+
'canvas.key.alt': 'Alt',
|
|
150
|
+
'canvas.key.shift': 'Shift',
|
|
151
|
+
'canvas.key.delete': 'Del',
|
|
152
|
+
'canvas.key.space': 'Space',
|
|
153
|
+
'canvas.key.click': 'Click',
|
|
154
|
+
'canvas.key.drag': 'Drag',
|
|
155
|
+
'canvas.key.dragCorner': 'Drag corner',
|
|
156
|
+
'canvas.key.doubleClick': 'Double-click',
|
|
157
|
+
// ===== The zoom panel =====
|
|
158
|
+
'canvas.zoom.expandTitle': 'Zoom {percent}% — click to expand',
|
|
159
|
+
'canvas.zoom.expandLabel': 'Expand zoom controls',
|
|
160
|
+
'canvas.zoom.gridTitle': 'Toggle Grid [G]',
|
|
161
|
+
'canvas.zoom.gridLabel': 'Toggle grid',
|
|
162
|
+
'canvas.zoom.panTitle': 'Hand / Pan [H]',
|
|
163
|
+
'canvas.zoom.panLabel': 'Hand / pan tool',
|
|
164
|
+
'canvas.zoom.outTitle': 'Zoom Out [Ctrl/Cmd] + [−]',
|
|
165
|
+
'canvas.zoom.outLabel': 'Zoom out',
|
|
166
|
+
'canvas.zoom.inTitle': 'Zoom In [Ctrl/Cmd] + [+]',
|
|
167
|
+
'canvas.zoom.inLabel': 'Zoom in',
|
|
168
|
+
/** The number field with the zoom level: what it does when it is clicked, and what it is. */
|
|
169
|
+
'canvas.zoom.resetTitle': 'Reset zoom to 100% [Ctrl/Cmd] + [0]',
|
|
170
|
+
'canvas.zoom.resetLabel': 'Reset zoom to 100%',
|
|
171
|
+
'canvas.zoom.levelLabel': 'Zoom level (percent)',
|
|
172
|
+
/** The "1:1" button. */
|
|
173
|
+
'canvas.zoom.oneToOneTitle': 'Reset Zoom 100% [Ctrl/Cmd] + [0]',
|
|
174
|
+
'canvas.zoom.fitTitle': 'Fit Content to View [Ctrl/Cmd] + [9]',
|
|
175
|
+
'canvas.zoom.fitLabel': 'Fit content to view',
|
|
176
|
+
'canvas.zoom.shortcutsTitle': 'Keyboard Shortcuts [?]',
|
|
177
|
+
'canvas.zoom.shortcutsLabel': 'Toggle keyboard shortcuts panel',
|
|
178
|
+
'canvas.zoom.unsavedTitle': 'Unsaved changes — click to save [Cmd+S]',
|
|
179
|
+
'canvas.zoom.savedTitle': 'All changes saved [Cmd+S]',
|
|
180
|
+
'canvas.zoom.minimize': 'Minimize Zoom Panel',
|
|
181
|
+
// ===== The properties panel: header and sections =====
|
|
182
|
+
'canvas.props.shape': 'SHAPE:',
|
|
183
|
+
'canvas.props.showAll': 'Show all properties',
|
|
184
|
+
'canvas.props.showFewer': 'Show fewer properties',
|
|
185
|
+
'canvas.props.close': 'Close properties panel',
|
|
186
|
+
/** What a container holds: "Children: 3". */
|
|
187
|
+
'canvas.props.children': 'Children: {count}',
|
|
188
|
+
'canvas.props.actions': 'Actions',
|
|
189
|
+
'canvas.props.general': 'General Properties',
|
|
190
|
+
'canvas.props.dimensions': 'Dimensions',
|
|
191
|
+
'canvas.props.width': 'Width',
|
|
192
|
+
'canvas.props.height': 'Height',
|
|
193
|
+
'canvas.props.proportionsFixed': 'Proportions locked (shape constraint)',
|
|
194
|
+
'canvas.props.proportionsUnlock': 'Unlock proportions',
|
|
195
|
+
'canvas.props.proportionsLock': 'Lock proportions',
|
|
196
|
+
'canvas.props.textProperties': 'Text Properties',
|
|
197
|
+
'canvas.props.labelProperties': 'Label Properties',
|
|
198
|
+
'canvas.props.boxProperties': 'Box Properties',
|
|
199
|
+
'canvas.props.groupBox': 'Group Box',
|
|
200
|
+
'canvas.props.labelText': 'Text/Description',
|
|
201
|
+
'canvas.props.labelPlaceholder': 'Describe this frame (used as widget description & prompt context)',
|
|
202
|
+
'canvas.props.textBackground': 'Text Background',
|
|
203
|
+
// ===== What the selected thing is called in the header of the properties panel =====
|
|
204
|
+
'canvas.type.none': 'None',
|
|
205
|
+
'canvas.type.widget': 'Widget',
|
|
206
|
+
'canvas.type.drawing': 'Drawing',
|
|
207
|
+
'canvas.type.line': 'Line',
|
|
208
|
+
'canvas.type.group': 'Group',
|
|
209
|
+
'canvas.type.selection': 'Selection',
|
|
210
|
+
/** A shape of the library that was drawn: "Star (Drawing)". */
|
|
211
|
+
'canvas.type.drawingOf': '{name} (Drawing)',
|
|
212
|
+
'canvas.type.customShape': 'Custom Shape (Drawing)',
|
|
213
|
+
// ===== The properties panel: the fields =====
|
|
214
|
+
'canvas.field.opacity': 'Opacity',
|
|
215
|
+
'canvas.field.cornerRoundness': 'Corner Roundness',
|
|
216
|
+
'canvas.field.backgroundColor': 'Background Color',
|
|
217
|
+
'canvas.field.backgroundOpacity': 'Background Opacity',
|
|
218
|
+
'canvas.field.fillColor': 'Fill Color',
|
|
219
|
+
'canvas.field.fillOpacity': 'Fill Opacity',
|
|
220
|
+
'canvas.field.strokeColor': 'Stroke Color',
|
|
221
|
+
'canvas.field.strokeWidth': 'Stroke Width',
|
|
222
|
+
'canvas.field.strokeType': 'Stroke Type',
|
|
223
|
+
'canvas.field.strokeSolid': 'Solid',
|
|
224
|
+
'canvas.field.strokeDashed': 'Dashed',
|
|
225
|
+
'canvas.field.strokeDotted': 'Dotted',
|
|
226
|
+
'canvas.field.fontSize': 'Font Size',
|
|
227
|
+
'canvas.field.textPadding': 'Text Padding',
|
|
228
|
+
'canvas.field.textColor': 'Text Color',
|
|
229
|
+
'canvas.field.textStrokeColor': 'Text Stroke Color',
|
|
230
|
+
'canvas.field.textStrokeWidth': 'Text Stroke Width',
|
|
231
|
+
'canvas.field.groupFillColor': 'Group Fill Color',
|
|
232
|
+
'canvas.field.groupFillOpacity': 'Group Fill Opacity',
|
|
233
|
+
'canvas.field.groupStrokeColor': 'Group Stroke Color',
|
|
234
|
+
'canvas.field.groupStrokeWidth': 'Group Stroke Width',
|
|
235
|
+
'canvas.field.groupStrokeType': 'Group Stroke Type',
|
|
236
|
+
// ===== The properties panel: aligning the selection on the canvas =====
|
|
237
|
+
'canvas.arrange.title': 'Align',
|
|
238
|
+
'canvas.arrange.left': 'Align Left',
|
|
239
|
+
'canvas.arrange.centerH': 'Align Center (horizontal)',
|
|
240
|
+
'canvas.arrange.right': 'Align Right',
|
|
241
|
+
'canvas.arrange.top': 'Align Top',
|
|
242
|
+
'canvas.arrange.middleV': 'Align Middle (vertical)',
|
|
243
|
+
'canvas.arrange.bottom': 'Align Bottom',
|
|
244
|
+
// ===== The properties panel: the picture of an image =====
|
|
245
|
+
'canvas.image.source': 'IMAGE SOURCE',
|
|
246
|
+
'canvas.image.file': 'File:',
|
|
247
|
+
'canvas.image.noFile': 'No file selected',
|
|
248
|
+
'canvas.image.changeFile': 'Change File',
|
|
249
|
+
'canvas.image.chooseFile': 'Choose File',
|
|
250
|
+
'canvas.image.url': 'URL:',
|
|
251
|
+
'canvas.image.pasteUrl': 'Paste URL...',
|
|
252
|
+
'canvas.image.newUrl': 'New URL...',
|
|
253
|
+
'canvas.image.load': 'Load',
|
|
254
|
+
// ===== The properties panel: widgets =====
|
|
255
|
+
'canvas.widget.createPreview': 'Create Preview',
|
|
256
|
+
'canvas.widget.capture': 'Capture',
|
|
257
|
+
'canvas.widget.linked': 'Widget Linked',
|
|
258
|
+
'canvas.widget.converting': 'Converting...',
|
|
259
|
+
'canvas.widget.duplicating': 'Duplicating...',
|
|
260
|
+
'canvas.widget.linking': 'Linking widget...',
|
|
261
|
+
'canvas.widget.unlinkedTitle': 'Unlinked Widget Shape',
|
|
262
|
+
'canvas.widget.orphanNotice': 'This shape points to a widget that was deleted or moved to another canvas. Remove it from the canvas to avoid confusion.',
|
|
263
|
+
'canvas.widget.removeFromCanvas': 'Remove from canvas',
|
|
264
|
+
'canvas.widget.namePlaceholder': 'Widget name',
|
|
265
|
+
'canvas.widget.openDetails': 'Click to open Widget Details',
|
|
266
|
+
'canvas.widget.refreshPreview': 'Refresh Preview Image',
|
|
267
|
+
'canvas.widget.primary': 'Primary widget',
|
|
268
|
+
'canvas.widget.primaryTitle': 'Use this widget as the canvas primary (red stroke)',
|
|
269
|
+
'canvas.widget.setPrimary': 'Set as primary',
|
|
270
|
+
'canvas.widget.convertLabel': 'Convert to Widget',
|
|
271
|
+
'canvas.widget.convertButton': 'CONVERT TO WIDGET',
|
|
272
|
+
/** What a widget shape is called when the widget it points to is gone. */
|
|
273
|
+
'canvas.widget.unlinkedName': 'Unlinked widget',
|
|
274
|
+
// ===== The controls of text and colour (also used on their own, outside the panel) =====
|
|
275
|
+
'canvas.control.color': 'Color',
|
|
276
|
+
'canvas.control.value': 'Value',
|
|
277
|
+
'canvas.control.openPicker': 'Open color picker',
|
|
278
|
+
'canvas.control.removeColor': 'Remove color',
|
|
279
|
+
'canvas.control.fontFamily': 'Font Family',
|
|
280
|
+
'canvas.control.textStyle': 'Text Style',
|
|
281
|
+
'canvas.control.bold': 'Bold',
|
|
282
|
+
/** The letters on the buttons for bold, italic and underline. */
|
|
283
|
+
'canvas.control.boldMark': 'B',
|
|
284
|
+
'canvas.control.italic': 'Italic',
|
|
285
|
+
'canvas.control.italicMark': 'I',
|
|
286
|
+
'canvas.control.underline': 'Underline',
|
|
287
|
+
'canvas.control.underlineMark': 'U',
|
|
288
|
+
'canvas.control.textAlign': 'Text Align',
|
|
289
|
+
'canvas.control.alignLeft': 'Align Left',
|
|
290
|
+
'canvas.control.alignCenter': 'Align Center',
|
|
291
|
+
'canvas.control.alignRight': 'Align Right'
|
|
292
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Translate } from '@widgetic/design-system/i18n';
|
|
2
|
+
import type { CanvasMessageKey } from './messages.js';
|
|
3
|
+
/**
|
|
4
|
+
* The words that are drawn onto the canvas itself: on an empty image or video, on a widget that has no picture yet, and
|
|
5
|
+
* above a frame that has no name. They are not part of any component, they are painted by the shapes (`ImageShape`,
|
|
6
|
+
* `WidgetShape`, `FrameShape`) every time the canvas redraws, so a shape reads them from the canvas it is on.
|
|
7
|
+
*/
|
|
8
|
+
export interface ShapeWords {
|
|
9
|
+
dropImage: string;
|
|
10
|
+
dropVideo: string;
|
|
11
|
+
or: string;
|
|
12
|
+
doubleClick: string;
|
|
13
|
+
/** What a widget on the canvas is called until it has a name. */
|
|
14
|
+
widgetName: string;
|
|
15
|
+
/** What a widget with no link says in place of its name. */
|
|
16
|
+
unlinkedWidget: string;
|
|
17
|
+
widgetPreview: string;
|
|
18
|
+
removeFromCanvas: string;
|
|
19
|
+
/** What is written above a frame that has no name. */
|
|
20
|
+
frameLabel: string;
|
|
21
|
+
}
|
|
22
|
+
/** The words, in the language `t` speaks. */
|
|
23
|
+
export declare function makeShapeWords(t: Translate<CanvasMessageKey>): ShapeWords;
|
|
24
|
+
/** Called by the canvas when it is made, and again when the page sets the language. */
|
|
25
|
+
export declare function setShapeWords(owner: object, words: ShapeWords): void;
|
|
26
|
+
/**
|
|
27
|
+
* The words for the shapes of one canvas. A shape that is not on a canvas (it is being made, or drawn to an image of its
|
|
28
|
+
* own) speaks English.
|
|
29
|
+
*/
|
|
30
|
+
export declare function shapeWordsOf(owner: object | null | undefined): ShapeWords;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { translateEnglish } from './language.js';
|
|
2
|
+
/** The words, in the language `t` speaks. */
|
|
3
|
+
export function makeShapeWords(t) {
|
|
4
|
+
return {
|
|
5
|
+
dropImage: t('canvas.draw.dropImage'),
|
|
6
|
+
dropVideo: t('canvas.draw.dropVideo'),
|
|
7
|
+
or: t('canvas.draw.or'),
|
|
8
|
+
doubleClick: t('canvas.draw.doubleClick'),
|
|
9
|
+
widgetName: t('canvas.draw.widgetName'),
|
|
10
|
+
unlinkedWidget: t('canvas.widget.unlinkedName'),
|
|
11
|
+
widgetPreview: t('canvas.draw.widgetPreview'),
|
|
12
|
+
removeFromCanvas: t('canvas.widget.removeFromCanvas'),
|
|
13
|
+
frameLabel: t('canvas.defaults.frameLabel')
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
// One set of words for each canvas: two canvases on a page can speak two languages. The key is the Fabric canvas the
|
|
17
|
+
// shapes are on, so the words go away with it.
|
|
18
|
+
const wordsOfCanvas = new WeakMap();
|
|
19
|
+
let englishWords = null;
|
|
20
|
+
/** Called by the canvas when it is made, and again when the page sets the language. */
|
|
21
|
+
export function setShapeWords(owner, words) {
|
|
22
|
+
wordsOfCanvas.set(owner, words);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The words for the shapes of one canvas. A shape that is not on a canvas (it is being made, or drawn to an image of its
|
|
26
|
+
* own) speaks English.
|
|
27
|
+
*/
|
|
28
|
+
export function shapeWordsOf(owner) {
|
|
29
|
+
if (owner) {
|
|
30
|
+
const words = wordsOfCanvas.get(owner);
|
|
31
|
+
if (words)
|
|
32
|
+
return words;
|
|
33
|
+
}
|
|
34
|
+
englishWords ??= makeShapeWords(translateEnglish);
|
|
35
|
+
return englishWords;
|
|
36
|
+
}
|