You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0b6da27
Browse filesBrowse the repository at this point in the historyBrowse files
|`instance`| Host-chosen string naming this showing of the view. A new `open` gets a new instance; the same tool window open in two workspaces has two. |
5134
5134
|`surface`|`{toolWindowID}` or `{settingRegionID}`: the declaration being drawn |
5135
5135
|`language`| Interface language tag, such as `en` or `zh-Hans`. View text is plugin content; the backend returns it in this language. |
@@ -5140,6 +5140,7 @@ event, with these params:
5140
5140
|`setting`|`change` of a control bound to a setting: the setting ID |
5141
5141
|`item`|`select`, `activate`: the tree item ID; `node` is the tree's ID |
5142
5142
|`viewport`|`viewport`: `{x, y, width, height}`, the visible part of the canvas in view-box coordinates |
5143
+
|`width`| Every event, from a host that reports it: the width in points the host lays the view's nodes out in, which is also the width of a canvas at the top level, a whole number of at least 1. A host that reports it sends `open` only once it knows the width. |
5143
5144
5144
5145
| Event | Sent when | Result |
5145
5146
| --- | --- | --- |
@@ -5149,13 +5150,14 @@ event, with these params:
5149
5150
|`change`| A `textField` commits on Enter, focus loss, or submit; a `select`, `segmented`, or `toggle` changes | Any |
5150
5151
|`select`, `activate`| A tree item is selected; double-clicked or activated with Return | Any |
5151
5152
|`viewport`| 400 ms after a pan or zoom stops, only for a canvas whose `on` lists `viewport`| Any |
5153
+
|`resize`| 400 ms after the view's `width` stops changing, only while the drawn view has a canvas whose `on` lists `resize`| Any |
5152
5154
|`settings`|`effective` or `draft` changes: the user edits a declared row or a bound control, applies, cancels, or a value changes elsewhere | Any |
5153
5155
5154
5156
Hovering, pressing, keyboard focus and focus rings, tooltips, tree expansion,
5155
5157
scrolling, panning, zooming, and typing never reach the plugin. A text field
5156
5158
does not call the backend per keystroke. The host sends one event at a time
5157
-
per instance, in order, and may merge waiting `viewport` or `settings` events
5158
-
into the latest one. A view changes only in answer to an event; this version
5159
+
per instance, in order, and may merge waiting `viewport`, `resize`, or
5160
+
`settings` events into the latest one. A view changes only in answer to an event; this version
5159
5161
has no way for a plugin to push a view on its own.
Copy file name to clipboardExpand all lines: shared/plugins/contract/v1/plugin-ui.schema.json
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -341,7 +341,7 @@
341
341
}
342
342
},
343
343
"canvas": {
344
-
"description": "A vector scene the host draws natively in view-box coordinates, scaled to the view width. Pan, zoom, hover states and tooltips stay in the host; viewport sends viewport events after the user pans or zooms. Canvas text is not searchable; a settings region names its words in keywords.",
344
+
"description": "A vector scene the host draws natively in view-box coordinates, in an area as wide as the view and height points tall. Without pan, the whole view box shows at zoom 1, scaled to the view width but no taller than height, from the top-left corner; with pan, its width fills the view. Pan, zoom, hover states and tooltips stay in the host; viewport sends viewport events after the user pans or zooms, and resize sends resize events with the new view width after the window is resized. Canvas text is not searchable; a settings region names its words in keywords.",
@@ -238,6 +239,7 @@ Content that declared rows cannot draw goes in `settingRegions` (at most 16, uni
238
239
-`keywords`: 1–32, distinct ignoring case, each 1–64 characters without line breaks or surrounding spaces. Settings search finds the page by them in addition to the page title and the declared rows, and opens the page at this plugin's part.
239
240
-`view`: `{function}`, a view function of the plugin's backend, drawn between the page header and the plugin's declared rows. The view may hold host controls and canvases, edit the plugin's own settings through bound controls (the same draft the declared rows edit), show the plugin's buttons and tool rows with how its tools resolve, but no tree. It needs `backend`, `ui` 0, and the `ui.contribute` permission; the host starts the backend when the page opens.
240
241
- A region with keywords only needs no backend. A region stores no values. Declaring regions counts as using `settings`.
242
+
- A canvas in a region that follows the window lays itself out for the event's `width`: its `viewBox` is `width` wide, its `height` is what the scene needs at that width, and its `on` lists `resize`. Once the user stops resizing the window for 400 ms, the host sends `resize` with the new `width`, and the plugin answers the scene laid out again, so it always draws at one point a unit. Without `pan`, the host shows the whole `viewBox` until the answer arrives (see [canvas](../../contract/v1/README.md#canvas)), never scaled up so far that its bottom is cut off. An older host sends no `width` and no `resize` and may refuse a canvas that lists it, so without `width` a plugin leaves `resize` out and lays the scene out for a fixed width: in Lithe desktop's smallest window a region is about 610 points wide on a language page and about 340 in the detail pane of a build system or compiler page.
0 commit comments