@widgetic/canvas 0.5.35 → 0.5.37

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 (210) hide show
  1. package/README.md +105 -36
  2. package/dist/canvas/DomCanvas.svelte +449 -0
  3. package/dist/canvas/DomCanvas.svelte.d.ts +221 -0
  4. package/dist/canvas/boardFrame.d.ts +13 -0
  5. package/dist/canvas/boardFrame.js +13 -0
  6. package/dist/canvas/boardSurface.d.ts +9 -0
  7. package/dist/canvas/boardSurface.js +9 -0
  8. package/dist/canvas/chromeLayout.d.ts +76 -0
  9. package/dist/canvas/chromeLayout.js +121 -0
  10. package/dist/canvas/emptyBoardHint.d.ts +17 -0
  11. package/dist/canvas/emptyBoardHint.js +12 -0
  12. package/dist/canvas/eventScope.d.ts +1 -1
  13. package/dist/canvas/eventScope.js +1 -1
  14. package/dist/canvas/host/CanvasHost.d.ts +348 -0
  15. package/dist/canvas/host/CanvasHost.js +1715 -0
  16. package/dist/canvas/host/CanvasHostApi.d.ts +30 -0
  17. package/dist/canvas/host/CanvasHostApi.js +95 -0
  18. package/dist/canvas/host/browserServices.d.ts +46 -0
  19. package/dist/canvas/host/browserServices.js +167 -0
  20. package/dist/canvas/host/conversion.d.ts +53 -0
  21. package/dist/canvas/host/conversion.js +125 -0
  22. package/dist/canvas/host/hostObject.d.ts +40 -0
  23. package/dist/canvas/host/hostObject.js +93 -0
  24. package/dist/canvas/host/pageEvents.d.ts +24 -0
  25. package/dist/canvas/host/pageEvents.js +35 -0
  26. package/dist/canvas/host/screenRects.d.ts +66 -0
  27. package/dist/canvas/host/screenRects.js +102 -0
  28. package/dist/canvas/host/strokeSnap.d.ts +67 -0
  29. package/dist/canvas/host/strokeSnap.js +165 -0
  30. package/dist/canvas/index.d.ts +7 -7
  31. package/dist/canvas/index.js +8 -8
  32. package/dist/canvas/openMarks.d.ts +17 -0
  33. package/dist/canvas/openMarks.js +26 -0
  34. package/dist/canvas/panZoomPosition.d.ts +15 -0
  35. package/dist/canvas/panZoomPosition.js +16 -0
  36. package/dist/canvas/preferredTextFont.d.ts +12 -0
  37. package/dist/canvas/preferredTextFont.js +38 -0
  38. package/dist/canvas/shapes/ShapeLibrary.d.ts +1 -1
  39. package/dist/canvas/shapes/ShapeLibrary.js +13 -1
  40. package/dist/canvas/shapes/strokeShapeSnap.d.ts +14 -12
  41. package/dist/canvas/shapes/strokeShapeSnap.js +10 -8
  42. package/dist/canvas/toolbarPosition.d.ts +11 -11
  43. package/dist/canvas/toolbarPosition.js +11 -24
  44. package/dist/canvas/types.d.ts +14 -0
  45. package/dist/canvas/ui/CanvasContextMenu.svelte +173 -0
  46. package/dist/canvas/ui/CanvasContextMenu.svelte.d.ts +12 -0
  47. package/dist/canvas/ui/CanvasHint.svelte +21 -0
  48. package/dist/canvas/ui/CanvasHint.svelte.d.ts +18 -0
  49. package/dist/canvas/ui/CanvasToolbar.svelte +95 -0
  50. package/dist/canvas/ui/CanvasToolbar.svelte.d.ts +14 -0
  51. package/dist/canvas/ui/ColorField.svelte +156 -0
  52. package/dist/canvas/ui/ColorField.svelte.d.ts +14 -0
  53. package/dist/canvas/ui/LoadNotice.svelte +39 -0
  54. package/dist/canvas/ui/LoadNotice.svelte.d.ts +8 -0
  55. package/dist/canvas/ui/SelectionPanel.svelte +300 -0
  56. package/dist/canvas/ui/SelectionPanel.svelte.d.ts +20 -0
  57. package/dist/canvas/ui/SelectorBar.svelte +82 -0
  58. package/dist/canvas/ui/SelectorBar.svelte.d.ts +12 -0
  59. package/dist/canvas/ui/ShapesMenu.svelte +185 -0
  60. package/dist/canvas/ui/ShapesMenu.svelte.d.ts +15 -0
  61. package/dist/canvas/ui/ShortcutsPanel.svelte +124 -0
  62. package/dist/canvas/ui/ShortcutsPanel.svelte.d.ts +7 -0
  63. package/dist/canvas/ui/ToolButton.svelte +78 -0
  64. package/dist/canvas/ui/ToolButton.svelte.d.ts +20 -0
  65. package/dist/canvas/ui/WidgetActions.svelte +145 -0
  66. package/dist/canvas/ui/WidgetActions.svelte.d.ts +19 -0
  67. package/dist/canvas/ui/ZoomControl.svelte +89 -0
  68. package/dist/canvas/ui/ZoomControl.svelte.d.ts +18 -0
  69. package/dist/canvas/ui/colorModel.d.ts +18 -0
  70. package/dist/canvas/ui/colorModel.js +85 -0
  71. package/dist/canvas/ui/colorPickerMessages.d.ts +5 -0
  72. package/dist/canvas/ui/colorPickerMessages.js +15 -0
  73. package/dist/canvas/ui/floatingCard.d.ts +107 -0
  74. package/dist/canvas/ui/floatingCard.js +107 -0
  75. package/dist/canvas/ui/floatingLayer.d.ts +21 -0
  76. package/dist/canvas/ui/floatingLayer.js +52 -0
  77. package/dist/canvas/ui/icons.d.ts +12 -0
  78. package/dist/canvas/ui/icons.js +7 -0
  79. package/dist/canvas/ui/keyHints.d.ts +27 -0
  80. package/dist/canvas/ui/keyHints.js +43 -0
  81. package/dist/canvas/ui/popoverSide.d.ts +5 -0
  82. package/dist/canvas/ui/popoverSide.js +20 -0
  83. package/dist/canvas/ui/selectionTraits.d.ts +61 -0
  84. package/dist/canvas/ui/selectionTraits.js +99 -0
  85. package/dist/canvas/view/CanvasStage.svelte +132 -0
  86. package/dist/canvas/view/CanvasStage.svelte.d.ts +21 -0
  87. package/dist/canvas/view/EraserTrail.svelte +50 -0
  88. package/dist/canvas/view/EraserTrail.svelte.d.ts +9 -0
  89. package/dist/canvas/view/ObjectView.svelte +245 -0
  90. package/dist/canvas/view/ObjectView.svelte.d.ts +21 -0
  91. package/dist/canvas/view/SelectionOverlay.svelte +487 -0
  92. package/dist/canvas/view/SelectionOverlay.svelte.d.ts +17 -0
  93. package/dist/canvas/view/TextEditor.svelte +76 -0
  94. package/dist/canvas/view/TextEditor.svelte.d.ts +9 -0
  95. package/dist/canvas/view/WidgetChromeLayer.svelte +83 -0
  96. package/dist/canvas/view/WidgetChromeLayer.svelte.d.ts +13 -0
  97. package/dist/canvas/view/erasingMarks.d.ts +13 -0
  98. package/dist/canvas/view/erasingMarks.js +34 -0
  99. package/dist/canvas/view/geometry.d.ts +169 -0
  100. package/dist/canvas/view/geometry.js +272 -0
  101. package/dist/components/CanvasBoardPlaceholder.svelte +5 -3
  102. package/dist/components/CanvasBoardPlaceholder.svelte.d.ts +3 -3
  103. package/dist/components/index.js +1 -1
  104. package/dist/components/input-controls/ColorIC.svelte +2 -2
  105. package/dist/engine/EngineCore.d.ts +273 -0
  106. package/dist/engine/EngineCore.js +1051 -0
  107. package/dist/engine/codec/canvasDocument.d.ts +57 -0
  108. package/dist/engine/codec/canvasDocument.js +471 -0
  109. package/dist/engine/codec/hostReadableKeys.d.ts +25 -0
  110. package/dist/engine/codec/hostReadableKeys.js +25 -0
  111. package/dist/engine/core/arrange.d.ts +20 -0
  112. package/dist/engine/core/arrange.js +81 -0
  113. package/dist/engine/core/arrow.d.ts +91 -0
  114. package/dist/engine/core/arrow.js +182 -0
  115. package/dist/engine/core/brush.d.ts +68 -0
  116. package/dist/engine/core/brush.js +173 -0
  117. package/dist/engine/core/defaults.d.ts +70 -0
  118. package/dist/engine/core/defaults.js +158 -0
  119. package/dist/engine/core/freehand.d.ts +130 -0
  120. package/dist/engine/core/freehand.js +430 -0
  121. package/dist/engine/core/geometry.d.ts +44 -0
  122. package/dist/engine/core/geometry.js +216 -0
  123. package/dist/engine/core/history.d.ts +39 -0
  124. package/dist/engine/core/history.js +69 -0
  125. package/dist/engine/core/hitTest.d.ts +54 -0
  126. package/dist/engine/core/hitTest.js +298 -0
  127. package/dist/engine/core/matrix.d.ts +47 -0
  128. package/dist/engine/core/matrix.js +101 -0
  129. package/dist/engine/core/pathData.d.ts +50 -0
  130. package/dist/engine/core/pathData.js +550 -0
  131. package/dist/engine/core/rotationReset.d.ts +10 -0
  132. package/dist/engine/core/rotationReset.js +17 -0
  133. package/dist/engine/core/scene.d.ts +99 -0
  134. package/dist/engine/core/scene.js +450 -0
  135. package/dist/engine/core/scribble.d.ts +64 -0
  136. package/dist/engine/core/scribble.js +121 -0
  137. package/dist/engine/core/shapePaths.d.ts +34 -0
  138. package/dist/engine/core/shapePaths.js +69 -0
  139. package/dist/engine/core/shapeTools.d.ts +80 -0
  140. package/dist/engine/core/shapeTools.js +161 -0
  141. package/dist/engine/core/snapping.d.ts +64 -0
  142. package/dist/engine/core/snapping.js +164 -0
  143. package/dist/engine/core/style.d.ts +40 -0
  144. package/dist/engine/core/style.js +151 -0
  145. package/dist/engine/core/transform.d.ts +79 -0
  146. package/dist/engine/core/transform.js +258 -0
  147. package/dist/engine/core/types.d.ts +238 -0
  148. package/dist/engine/core/types.js +31 -0
  149. package/dist/engine/core/viewport.d.ts +32 -0
  150. package/dist/engine/core/viewport.js +84 -0
  151. package/dist/engine/input/PointerController.d.ts +38 -0
  152. package/dist/engine/input/PointerController.js +545 -0
  153. package/dist/engine/input/arrowHandles.d.ts +38 -0
  154. package/dist/engine/input/arrowHandles.js +60 -0
  155. package/dist/engine/input/gestures.d.ts +79 -0
  156. package/dist/engine/input/gestures.js +769 -0
  157. package/dist/engine/input/hoverCursor.d.ts +29 -0
  158. package/dist/engine/input/hoverCursor.js +23 -0
  159. package/dist/engine/input/keyboard.d.ts +75 -0
  160. package/dist/engine/input/keyboard.js +264 -0
  161. package/dist/engine/input/selectionHandles.d.ts +89 -0
  162. package/dist/engine/input/selectionHandles.js +169 -0
  163. package/dist/engine/input/types.d.ts +82 -0
  164. package/dist/engine/input/types.js +5 -0
  165. package/dist/engine/render/rasterize.d.ts +74 -0
  166. package/dist/engine/render/rasterize.js +273 -0
  167. package/dist/engine/state.d.ts +124 -0
  168. package/dist/engine/state.js +47 -0
  169. package/dist/engine/text/layoutText.d.ts +53 -0
  170. package/dist/engine/text/layoutText.js +170 -0
  171. package/dist/engine/widgets.d.ts +124 -0
  172. package/dist/engine/widgets.js +345 -0
  173. package/dist/i18n/labels.d.ts +4 -15
  174. package/dist/i18n/labels.js +33 -53
  175. package/dist/i18n/language.d.ts +3 -3
  176. package/dist/i18n/messages.d.ts +52 -124
  177. package/dist/i18n/messages.js +59 -133
  178. package/dist/i18n/shortcuts.d.ts +0 -1
  179. package/dist/i18n/shortcuts.js +2 -11
  180. package/dist/index.d.ts +4 -2
  181. package/dist/index.js +5 -3
  182. package/package.json +30 -5
  183. package/dist/canvas/Canvas.svelte +0 -13363
  184. package/dist/canvas/Canvas.svelte.d.ts +0 -286
  185. package/dist/canvas/CanvasToolbar.svelte +0 -1498
  186. package/dist/canvas/CanvasToolbar.svelte.d.ts +0 -69
  187. package/dist/canvas/ContextMenu.svelte +0 -305
  188. package/dist/canvas/ContextMenu.svelte.d.ts +0 -42
  189. package/dist/canvas/PanZoomPanel.svelte +0 -478
  190. package/dist/canvas/PanZoomPanel.svelte.d.ts +0 -38
  191. package/dist/canvas/WidgetSelectionLayer.svelte +0 -156
  192. package/dist/canvas/WidgetSelectionLayer.svelte.d.ts +0 -11
  193. package/dist/canvas/props-panel/PropsPanel.svelte +0 -2075
  194. package/dist/canvas/props-panel/PropsPanel.svelte.d.ts +0 -84
  195. package/dist/canvas/props-panel/TextPropsICSection.svelte +0 -242
  196. package/dist/canvas/props-panel/TextPropsICSection.svelte.d.ts +0 -40
  197. package/dist/canvas/shadowRootText.d.ts +0 -5
  198. package/dist/canvas/shadowRootText.js +0 -43
  199. package/dist/canvas/shapes/FrameShape.d.ts +0 -97
  200. package/dist/canvas/shapes/FrameShape.js +0 -953
  201. package/dist/canvas/shapes/ImageShape.d.ts +0 -47
  202. package/dist/canvas/shapes/ImageShape.js +0 -339
  203. package/dist/canvas/shapes/WidgetShape.d.ts +0 -30
  204. package/dist/canvas/shapes/WidgetShape.js +0 -200
  205. package/dist/canvas/widgetPreviewGeometry.d.ts +0 -19
  206. package/dist/canvas/widgetPreviewGeometry.js +0 -66
  207. package/dist/i18n/shapeWords.d.ts +0 -30
  208. package/dist/i18n/shapeWords.js +0 -36
  209. package/dist/i18n/slots.d.ts +0 -20
  210. package/dist/i18n/slots.js +0 -40
@@ -10,8 +10,7 @@
10
10
  * so a language can be added a screen at a time.
11
11
  *
12
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;
13
+ * - the names of widgets, files and fonts, and what the visitor typed into a text: they are shown as they were written;
15
14
  * - the English names the canvas keeps for the things it saves ("libraryShape", "Symbol Shapes", a shape's key): they
16
15
  * are data, and a screen says them with the messages below.
17
16
  */
@@ -19,55 +18,48 @@ export const CANVAS_MESSAGES = {
19
18
  // ===== The canvas itself =====
20
19
  'canvas.state.loading': 'Loading canvas…',
21
20
  '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.',
21
+ /** The name of the drawing surface, for a screen reader. */
22
+ 'canvas.state.boardLabel': 'Canvas board',
23
+ /** Said over a board that could not be opened: it was saved by the earlier canvas, whose format this one does not read. */
24
+ 'canvas.state.unsupported': 'This canvas was made with an older version and cannot be opened. It stays as it is until you add something new.',
25
+ /** Said over a board whose saved text could not be read at all. */
26
+ 'canvas.state.invalid': 'This canvas could not be read. It stays as it is until you add something new.',
27
+ 'canvas.state.dismiss': 'Dismiss',
28
+ // ===== What an empty board says =====
29
+ 'canvas.hint.title': 'Start with a sketch',
30
+ 'canvas.hint.description': 'Draw the widget you have in mind, then describe it in the chat.',
24
31
  // ===== What a new thing says before the visitor changes it (saved with the canvas, in the language it was made in) =====
25
32
  /** Gray hint drawn on an empty text shape. It is not stored as the text: a new text box starts empty. */
26
33
  'canvas.defaults.textBox': 'Type here',
27
- /** The name written above a new frame. */
28
- 'canvas.defaults.frameLabel': 'Frame',
29
- /** The name a frame gets when it is made into a widget without one. */
30
- 'canvas.defaults.untitledFrame': 'Untitled Frame',
31
34
  'canvas.defaults.untitledShape': 'Untitled Shape',
32
- // ===== Words drawn onto the canvas itself (on an empty image or video, and on a widget that has no picture yet) =====
33
- 'canvas.draw.dropImage': 'Drop image',
34
- 'canvas.draw.dropVideo': 'Drop video',
35
- /** Between "Drop image" and "double click": "Drop image / or / double click". */
36
- 'canvas.draw.or': 'or',
37
- 'canvas.draw.doubleClick': 'double click',
35
+ // ===== Words drawn onto the canvas itself (on a widget card) =====
38
36
  /** What a widget on the canvas is called until it has a name. */
39
37
  'canvas.draw.widgetName': 'Widget',
40
38
  'canvas.draw.widgetPreview': 'Widget preview',
41
39
  // ===== The names of the tools (also the names of the buttons that choose them) =====
40
+ /** The name of the bar of tools, for a screen reader. */
41
+ 'canvas.toolbar.label': 'Canvas tools',
42
42
  'canvas.tool.select': 'Select',
43
43
  'canvas.tool.hand': 'Hand / Pan',
44
44
  'canvas.tool.erase': 'Erase',
45
45
  'canvas.tool.draw': 'Draw',
46
46
  'canvas.tool.arrow': 'Arrow',
47
47
  'canvas.tool.rectangle': 'Rectangle',
48
+ 'canvas.tool.roundedRectangle': 'Rounded rectangle',
48
49
  'canvas.tool.triangle': 'Triangle',
49
50
  'canvas.tool.ellipse': 'Ellipse',
50
51
  'canvas.tool.circle': 'Circle',
51
- 'canvas.tool.frame': 'Frame',
52
52
  'canvas.tool.text': 'Text',
53
53
  'canvas.tool.selector': 'Selector',
54
54
  'canvas.tool.image': 'Image',
55
- 'canvas.tool.video': 'Video',
55
+ 'canvas.tool.svg': 'SVG',
56
56
  'canvas.tool.shapes': 'Shapes',
57
- 'canvas.tool.moreShapes': 'More Shapes',
57
+ 'canvas.tool.moreShapes': 'More shapes',
58
58
  'canvas.tool.undo': 'Undo',
59
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
60
  // ===== 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',
61
+ /** The group of image and SVG in the menu of shapes. */
62
+ 'canvas.menu.media': 'Media',
71
63
  /** The groups of the shape library. */
72
64
  'canvas.category.geometric': 'Geometric Shapes',
73
65
  'canvas.category.arrows': 'Arrow Shapes',
@@ -76,6 +68,7 @@ export const CANVAS_MESSAGES = {
76
68
  'canvas.category.symbols': 'Symbol Shapes',
77
69
  // ===== The names of the shapes in the shape library =====
78
70
  'canvas.shape.hexagon': 'Hexagon',
71
+ 'canvas.shape.pentagon': 'Pentagon',
79
72
  'canvas.shape.oval': 'Oval',
80
73
  'canvas.shape.play': 'Play',
81
74
  'canvas.shape.pause': 'Pause',
@@ -101,7 +94,7 @@ export const CANVAS_MESSAGES = {
101
94
  'canvas.shape.rhombus': 'Rhombus',
102
95
  'canvas.shape.lightning': 'Lightning',
103
96
  'canvas.shape.shield': 'Shield',
104
- // ===== Actions on what is selected (the toolbar, the context menu and the list of shortcuts all use these) =====
97
+ // ===== Actions on what is selected (the context menu and the list of shortcuts both use these) =====
105
98
  'canvas.action.cut': 'Cut',
106
99
  'canvas.action.copy': 'Copy',
107
100
  'canvas.action.paste': 'Paste',
@@ -110,24 +103,15 @@ export const CANVAS_MESSAGES = {
110
103
  'canvas.action.group': 'Group',
111
104
  'canvas.action.ungroup': 'Ungroup',
112
105
  'canvas.action.selectAll': 'Select All',
113
- 'canvas.action.clearAll': 'Clear All',
114
106
  // ===== The order of the layers =====
115
107
  'canvas.layer.title': 'Layer Order',
116
108
  'canvas.layer.front': 'Bring to Front',
117
109
  'canvas.layer.forward': 'Bring Forward',
118
110
  'canvas.layer.backward': 'Send Backward',
119
111
  '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
112
  // ===== The list of keyboard shortcuts =====
126
113
  'canvas.shortcuts.title': 'Keyboard Shortcuts',
127
114
  '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
115
  'canvas.shortcuts.groupTools': 'Tools',
132
116
  'canvas.shortcuts.groupSelection': 'Selection',
133
117
  'canvas.shortcuts.groupHistory': 'History',
@@ -142,9 +126,8 @@ export const CANVAS_MESSAGES = {
142
126
  'canvas.shortcuts.pan': 'Pan canvas',
143
127
  'canvas.shortcuts.move1': 'Move selected (1px)',
144
128
  'canvas.shortcuts.move10': 'Move selected (10px)',
145
- 'canvas.shortcuts.frameResize': 'Resize, keep children size',
146
- 'canvas.shortcuts.frameEdit': 'Enter / exit frame edit',
147
129
  /** The names of keys that are words. Letters and symbols are not here: they are the same on every keyboard. */
130
+ 'canvas.key.ctrl': 'Ctrl',
148
131
  'canvas.key.ctrlCmd': 'Ctrl/Cmd',
149
132
  'canvas.key.alt': 'Alt',
150
133
  'canvas.key.shift': 'Shift',
@@ -152,108 +135,53 @@ export const CANVAS_MESSAGES = {
152
135
  'canvas.key.space': 'Space',
153
136
  'canvas.key.click': 'Click',
154
137
  '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
- /** The small label next to the zoom controls while the hand tool is on. */
165
- 'canvas.zoom.panBanner': 'Dragging the canvas',
166
- 'canvas.zoom.outTitle': 'Zoom Out [Ctrl/Cmd] + [−]',
138
+ // ===== The zoom control =====
139
+ /** The name of the group of zoom buttons, for a screen reader. */
140
+ 'canvas.zoom.groupLabel': 'Zoom',
167
141
  'canvas.zoom.outLabel': 'Zoom out',
168
- 'canvas.zoom.inTitle': 'Zoom In [Ctrl/Cmd] + [+]',
169
142
  'canvas.zoom.inLabel': 'Zoom in',
170
- /** The number field with the zoom level: what it does when it is clicked, and what it is. */
171
- 'canvas.zoom.resetTitle': 'Reset zoom to 100% [Ctrl/Cmd] + [0]',
172
143
  'canvas.zoom.resetLabel': 'Reset zoom to 100%',
173
- 'canvas.zoom.levelLabel': 'Zoom level (percent)',
174
- /** The "1:1" button. */
175
- 'canvas.zoom.oneToOneTitle': 'Reset Zoom 100% [Ctrl/Cmd] + [0]',
176
- 'canvas.zoom.fitTitle': 'Fit Content to View [Ctrl/Cmd] + [9]',
177
144
  'canvas.zoom.fitLabel': 'Fit content to view',
178
- 'canvas.zoom.shortcutsTitle': 'Keyboard Shortcuts [?]',
179
- 'canvas.zoom.shortcutsLabel': 'Toggle keyboard shortcuts panel',
180
- 'canvas.zoom.unsavedTitle': 'Unsaved changes — click to save [Cmd+S]',
181
- 'canvas.zoom.savedTitle': 'All changes saved [Cmd+S]',
182
- 'canvas.zoom.minimize': 'Minimize Zoom Panel',
183
- // ===== The properties panel: header and sections =====
184
- 'canvas.props.shape': 'SHAPE:',
185
- 'canvas.props.showAll': 'Show all properties',
186
- 'canvas.props.showFewer': 'Show fewer properties',
187
- 'canvas.props.close': 'Close properties panel',
188
- /** What a container holds: "Children: 3". */
189
- 'canvas.props.children': 'Children: {count}',
190
- 'canvas.props.actions': 'Actions',
191
- 'canvas.props.general': 'General Properties',
192
- 'canvas.props.dimensions': 'Dimensions',
193
- 'canvas.props.width': 'Width',
194
- 'canvas.props.height': 'Height',
195
- 'canvas.props.proportionsFixed': 'Proportions locked (shape constraint)',
196
- 'canvas.props.proportionsUnlock': 'Unlock proportions',
197
- 'canvas.props.proportionsLock': 'Lock proportions',
198
- 'canvas.props.textProperties': 'Text Properties',
199
- 'canvas.props.labelProperties': 'Label Properties',
200
- 'canvas.props.boxProperties': 'Box Properties',
201
- 'canvas.props.groupBox': 'Group Box',
202
- 'canvas.props.labelText': 'Text/Description',
203
- 'canvas.props.labelPlaceholder': 'Describe this frame (used as widget description & prompt context)',
204
- 'canvas.props.textBackground': 'Text Background',
205
- // ===== What the selected thing is called in the header of the properties panel =====
145
+ 'canvas.zoom.unsavedTitle': 'Unsaved changes — click to save',
146
+ 'canvas.zoom.savedTitle': 'All changes saved',
147
+ // ===== The selection panel: the card that edits what is selected =====
148
+ /** The name of the panel, for a screen reader. */
149
+ 'canvas.panel.label': 'Selection properties',
150
+ 'canvas.panel.close': 'Close panel',
151
+ 'canvas.panel.open': 'Open selection properties',
152
+ /** The title of the panel when nothing is selected and the page offers an action for the whole sketch. */
153
+ 'canvas.panel.actions': 'Actions',
154
+ 'canvas.panel.fill': 'Fill',
155
+ 'canvas.panel.stroke': 'Stroke',
156
+ 'canvas.panel.strokeWidth': 'Stroke width',
157
+ 'canvas.panel.roundness': 'Roundness',
158
+ 'canvas.panel.opacity': 'Opacity',
159
+ 'canvas.panel.fontSize': 'Font size',
160
+ /** The names of the two buttons of a stepper that changes a number by one. */
161
+ 'canvas.panel.decrease': 'Decrease',
162
+ 'canvas.panel.increase': 'Increase',
163
+ /** What a field says when the things selected do not agree on it. */
164
+ 'canvas.panel.mixed': 'Mixed',
165
+ /** What a colour field says when the colour is none (nothing is painted). */
166
+ 'canvas.panel.none': 'None',
167
+ 'canvas.panel.noColor': 'No color',
168
+ 'canvas.panel.pickColor': 'Pick a color',
169
+ 'canvas.panel.hex': 'Hex color',
170
+ /** Words the design-system colour picker speaks and shows (see `ColorPickerMessages`). */
171
+ 'canvas.colorPicker.area': 'Saturation and brightness',
172
+ 'canvas.colorPicker.areaValue': 'Saturation {s}%, brightness {v}%',
173
+ 'canvas.colorPicker.hue': 'Hue',
174
+ 'canvas.colorPicker.add': 'Add',
175
+ 'canvas.colorPicker.swatch': 'Use {hex}',
176
+ // ===== What the selected thing is called in the header of the selection panel =====
206
177
  'canvas.type.none': 'None',
207
178
  'canvas.type.widget': 'Widget',
208
179
  'canvas.type.drawing': 'Drawing',
209
- 'canvas.type.line': 'Line',
210
180
  'canvas.type.group': 'Group',
211
181
  'canvas.type.selection': 'Selection',
212
182
  /** A shape of the library that was drawn: "Star (Drawing)". */
213
183
  'canvas.type.drawingOf': '{name} (Drawing)',
214
- 'canvas.type.customShape': 'Custom Shape (Drawing)',
215
- // ===== The properties panel: the fields =====
216
- 'canvas.field.opacity': 'Opacity',
217
- 'canvas.field.cornerRoundness': 'Corner Roundness',
218
- 'canvas.field.backgroundColor': 'Background Color',
219
- 'canvas.field.backgroundOpacity': 'Background Opacity',
220
- 'canvas.field.fillColor': 'Fill Color',
221
- 'canvas.field.fillOpacity': 'Fill Opacity',
222
- 'canvas.field.strokeColor': 'Stroke Color',
223
- 'canvas.field.strokeWidth': 'Stroke Width',
224
- 'canvas.field.strokeType': 'Stroke Type',
225
- 'canvas.field.strokeSolid': 'Solid',
226
- 'canvas.field.strokeDashed': 'Dashed',
227
- 'canvas.field.strokeDotted': 'Dotted',
228
- 'canvas.field.fontSize': 'Font Size',
229
- 'canvas.field.textPadding': 'Text Padding',
230
- 'canvas.field.textColor': 'Text Color',
231
- 'canvas.field.textStrokeColor': 'Text Stroke Color',
232
- 'canvas.field.textStrokeWidth': 'Text Stroke Width',
233
- 'canvas.field.groupFillColor': 'Group Fill Color',
234
- 'canvas.field.groupFillOpacity': 'Group Fill Opacity',
235
- 'canvas.field.groupStrokeColor': 'Group Stroke Color',
236
- 'canvas.field.groupStrokeWidth': 'Group Stroke Width',
237
- 'canvas.field.groupStrokeType': 'Group Stroke Type',
238
- // ===== The properties panel: aligning the selection on the canvas =====
239
- 'canvas.arrange.title': 'Align',
240
- 'canvas.arrange.left': 'Align Left',
241
- 'canvas.arrange.centerH': 'Align Center (horizontal)',
242
- 'canvas.arrange.right': 'Align Right',
243
- 'canvas.arrange.top': 'Align Top',
244
- 'canvas.arrange.middleV': 'Align Middle (vertical)',
245
- 'canvas.arrange.bottom': 'Align Bottom',
246
- // ===== The properties panel: the picture of an image =====
247
- 'canvas.image.source': 'IMAGE SOURCE',
248
- 'canvas.image.file': 'File:',
249
- 'canvas.image.noFile': 'No file selected',
250
- 'canvas.image.changeFile': 'Change File',
251
- 'canvas.image.chooseFile': 'Choose File',
252
- 'canvas.image.url': 'URL:',
253
- 'canvas.image.pasteUrl': 'Paste URL...',
254
- 'canvas.image.newUrl': 'New URL...',
255
- 'canvas.image.load': 'Load',
256
- // ===== The properties panel: widgets =====
184
+ // ===== Widgets =====
257
185
  'canvas.widget.createPreview': 'Create Preview',
258
186
  'canvas.widget.capture': 'Capture',
259
187
  'canvas.widget.linked': 'Widget Linked',
@@ -269,8 +197,6 @@ export const CANVAS_MESSAGES = {
269
197
  'canvas.widget.primary': 'Primary widget',
270
198
  'canvas.widget.primaryTitle': 'Use this widget as the canvas primary (red stroke)',
271
199
  'canvas.widget.setPrimary': 'Set as primary',
272
- 'canvas.widget.convertLabel': 'Convert to Widget',
273
- 'canvas.widget.convertButton': 'CONVERT TO WIDGET',
274
200
  /** What a widget shape is called when the widget it points to is gone. */
275
201
  'canvas.widget.unlinkedName': 'Unlinked widget',
276
202
  // ===== The controls of text and colour (also used on their own, outside the panel) =====
@@ -278,7 +204,7 @@ export const CANVAS_MESSAGES = {
278
204
  'canvas.control.value': 'Value',
279
205
  'canvas.control.openPicker': 'Open color picker',
280
206
  'canvas.control.removeColor': 'Remove color',
281
- 'canvas.control.fontFamily': 'Font Family',
207
+ 'canvas.control.fontFamily': 'Font family',
282
208
  'canvas.control.textStyle': 'Text Style',
283
209
  'canvas.control.bold': 'Bold',
284
210
  /** The letters on the buttons for bold, italic and underline. */
@@ -14,7 +14,6 @@ export declare const TOOL_KEYS: {
14
14
  readonly rectangle: "R";
15
15
  readonly triangle: "G";
16
16
  readonly ellipse: "O";
17
- readonly frame: "F";
18
17
  readonly text: "T";
19
18
  readonly image: "I";
20
19
  };
@@ -11,7 +11,6 @@ export const TOOL_KEYS = {
11
11
  rectangle: 'R',
12
12
  triangle: 'G',
13
13
  ellipse: 'O',
14
- frame: 'F',
15
14
  text: 'T',
16
15
  image: 'I'
17
16
  };
@@ -34,7 +33,6 @@ export const SHORTCUT_GROUPS = [
34
33
  { keys: [cap(TOOL_KEYS.rectangle)], label: 'canvas.tool.rectangle' },
35
34
  { keys: [cap(TOOL_KEYS.triangle)], label: 'canvas.tool.triangle' },
36
35
  { keys: [cap(TOOL_KEYS.ellipse)], label: 'canvas.tool.ellipse' },
37
- { keys: [cap(TOOL_KEYS.frame)], label: 'canvas.tool.frame' },
38
36
  { keys: [cap(TOOL_KEYS.text)], label: 'canvas.tool.text' },
39
37
  { keys: [cap(TOOL_KEYS.image)], label: 'canvas.tool.image' }
40
38
  ]
@@ -80,15 +78,8 @@ export const SHORTCUT_GROUPS = [
80
78
  shortcuts: [
81
79
  { keys: [cap(']')], label: 'canvas.layer.forward' },
82
80
  { keys: [cap('[')], label: 'canvas.layer.backward' },
83
- { keys: [CTRL, PLUS, cap(']')], label: 'canvas.layer.front' },
84
- { keys: [CTRL, PLUS, cap('[')], label: 'canvas.layer.back' }
85
- ]
86
- },
87
- {
88
- title: 'canvas.tool.frame',
89
- shortcuts: [
90
- { keys: [ALT, PLUS, named('canvas.key.dragCorner')], label: 'canvas.shortcuts.frameResize' },
91
- { keys: [named('canvas.key.doubleClick')], label: 'canvas.shortcuts.frameEdit' }
81
+ { keys: [CTRL, PLUS, SHIFT, PLUS, cap(']')], label: 'canvas.layer.front' },
82
+ { keys: [CTRL, PLUS, SHIFT, PLUS, cap('[')], label: 'canvas.layer.back' }
92
83
  ]
93
84
  }
94
85
  ];
package/dist/index.d.ts CHANGED
@@ -1,15 +1,17 @@
1
1
  /**
2
2
  * Root barrel — re-exports everything.
3
3
  *
4
- * WARNING: This barrel includes Canvas.svelte (10K+ lines).
4
+ * NOTE: This barrel includes the canvas component and its engine, a good deal more than the components barrel.
5
5
  * In consuming apps, prefer:
6
6
  * - Static: import { Tooltip } from '@widgetic/canvas/components'
7
7
  * - Dynamic: const { Canvas } = await import('@widgetic/canvas')
8
8
  */
9
- export { Canvas, CanvasToolbar, ContextMenu, PanZoomPanel, PropsPanel } from './canvas';
9
+ export { Canvas } from './canvas';
10
10
  export type { WidgetConversionPayload, StrokeRecognizer, StrokeRecognitionRequest, StrokeRecognitionResult } from './canvas';
11
11
  export { TOOLBAR_POSITIONS, DEFAULT_TOOLBAR_POSITION } from './canvas';
12
12
  export type { ToolbarPosition } from './canvas';
13
+ export { PAN_ZOOM_POSITIONS, DEFAULT_PAN_ZOOM_POSITION } from './canvas';
14
+ export type { PanZoomPosition } from './canvas';
13
15
  export { setShapeImageStore, getShapeImageStore } from './canvas';
14
16
  export type { ShapeImageStore } from './canvas';
15
17
  export { Tooltip, ColorIC, FontSelectorIC, SliderUnitIC, TextAlignIC, TextStyleIC } from './components';
package/dist/index.js CHANGED
@@ -1,15 +1,17 @@
1
1
  /**
2
2
  * Root barrel — re-exports everything.
3
3
  *
4
- * WARNING: This barrel includes Canvas.svelte (10K+ lines).
4
+ * NOTE: This barrel includes the canvas component and its engine, a good deal more than the components barrel.
5
5
  * In consuming apps, prefer:
6
6
  * - Static: import { Tooltip } from '@widgetic/canvas/components'
7
7
  * - Dynamic: const { Canvas } = await import('@widgetic/canvas')
8
8
  */
9
9
  // Canvas (heavy — dynamic import recommended)
10
- export { Canvas, CanvasToolbar, ContextMenu, PanZoomPanel, PropsPanel } from './canvas';
11
- // Where the drawing toolbar stands along the bottom edge of the board (the `toolbarPosition` option of <Canvas>)
10
+ export { Canvas } from './canvas';
11
+ // Where the drawing toolbar stands: one of eight places on the board (the `toolbarPosition` option of <Canvas>)
12
12
  export { TOOLBAR_POSITIONS, DEFAULT_TOOLBAR_POSITION } from './canvas';
13
+ // Where the zoom control stands: one of the same eight places (the `panZoomPosition` option of <Canvas>)
14
+ export { PAN_ZOOM_POSITIONS, DEFAULT_PAN_ZOOM_POSITION } from './canvas';
13
15
  // Widget thumbnails live outside the canvas JSON when the host installs a store
14
16
  export { setShapeImageStore, getShapeImageStore } from './canvas';
15
17
  // Lightweight components (safe for static import)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widgetic/canvas",
3
- "version": "0.5.35",
3
+ "version": "0.5.37",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "type": "module",
6
6
  "svelte": "./dist/index.js",
@@ -54,7 +54,7 @@
54
54
  "package": "NODE_ENV=production svelte-package",
55
55
  "publish-to-npm": "node ../dev-tools/bin/publish-package.mjs",
56
56
  "package:watch": "NODE_ENV=development svelte-package --watch",
57
- "test": "node --test \"scripts/*.test.ts\" \"tests/*.test.mjs\"",
57
+ "test": "node --test \"scripts/*.test.ts\" \"tests/*.test.mjs\" \"tests/engine/*.test.mjs\" \"tests/host/*.test.mjs\" \"tests/view/*.test.mjs\" \"tests/ui/*.test.mjs\"",
58
58
  "preview": "vite preview",
59
59
  "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
60
60
  "check:peers": "check-design-system-peers ..",
@@ -70,18 +70,44 @@
70
70
  "@sveltejs/package": "^2.5.8",
71
71
  "@sveltejs/vite-plugin-svelte": "^5.0.3",
72
72
  "@tailwindcss/postcss": "^4.1.4",
73
- "@widgetic/design-system": "^0.5.21",
73
+ "@tiptap/core": "^2.9.1",
74
+ "@tiptap/extension-bubble-menu": "^2.9.1",
75
+ "@tiptap/extension-code-block-lowlight": "^2.9.1",
76
+ "@tiptap/extension-color": "^2.9.1",
77
+ "@tiptap/extension-floating-menu": "^2.27.2",
78
+ "@tiptap/extension-heading": "^2.9.1",
79
+ "@tiptap/extension-highlight": "^2.9.1",
80
+ "@tiptap/extension-image": "^2.9.1",
81
+ "@tiptap/extension-link": "^2.9.1",
82
+ "@tiptap/extension-subscript": "^2.9.1",
83
+ "@tiptap/extension-superscript": "^2.9.1",
84
+ "@tiptap/extension-table": "^2.9.1",
85
+ "@tiptap/extension-table-cell": "^2.9.1",
86
+ "@tiptap/extension-table-header": "^2.9.1",
87
+ "@tiptap/extension-table-row": "^2.9.1",
88
+ "@tiptap/extension-task-item": "^2.9.1",
89
+ "@tiptap/extension-task-list": "^2.9.1",
90
+ "@tiptap/extension-text": "^2.9.1",
91
+ "@tiptap/extension-text-align": "^2.9.1",
92
+ "@tiptap/extension-text-style": "^2.9.1",
93
+ "@tiptap/extension-typography": "^2.9.1",
94
+ "@tiptap/extension-underline": "^2.9.1",
95
+ "@tiptap/pm": "^2.9.1",
96
+ "@tiptap/starter-kit": "^2.9.1",
97
+ "@widgetic/design-system": "^0.5.30",
74
98
  "@widgetic/dev-tools": "^0.3.0",
75
99
  "eslint": "^9.18.0",
76
100
  "eslint-config-prettier": "^10.0.1",
77
101
  "eslint-plugin-svelte": "^3.0.0",
78
102
  "globals": "^16.0.0",
103
+ "lowlight": "^3.2.0",
79
104
  "postcss": "^8.5.3",
80
105
  "prettier": "^3.4.2",
81
106
  "prettier-plugin-svelte": "^3.3.3",
82
107
  "prettier-plugin-tailwindcss": "^0.6.11",
83
108
  "svelte": "^5.25.6",
84
109
  "svelte-check": "^4.0.0",
110
+ "svelte-tiptap": "^2.0.3",
85
111
  "tailwind-merge": "^2.5.2",
86
112
  "tailwind-variants": "^0.2.1",
87
113
  "tailwindcss": "^4.1.4",
@@ -91,7 +117,6 @@
91
117
  },
92
118
  "dependencies": {
93
119
  "@tailwindcss/typography": "^0.5.19",
94
- "fabric": "^7.4.0",
95
120
  "tailwindcss-animate": "^1.0.7"
96
121
  },
97
122
  "overrides": {
@@ -113,7 +138,7 @@
113
138
  "url": "https://gitlab.com/widgeticai/Frontend/canvas.git"
114
139
  },
115
140
  "peerDependencies": {
116
- "@widgetic/design-system": ">=0.3.0",
141
+ "@widgetic/design-system": ">=0.5.30",
117
142
  "svelte": "^5.0.0"
118
143
  }
119
144
  }