@punica/editor 1.10.11 → 1.11.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.
- package/dist/index.bundle.esm.js +1 -1
- package/dist/index.bundle.esm.js.map +1 -1
- package/dist/index.bundle.umd.js +1 -1
- package/dist/index.bundle.umd.js.map +1 -1
- package/package.json +1 -1
- package/types/punica.module.extensions.api.d.ts +8 -0
- package/types/punica.module.shell.panelTabs.d.ts +8 -0
- package/types/punica.module.shell.views.d.ts +46 -0
package/package.json
CHANGED
|
@@ -450,6 +450,14 @@ declare module 'punica' {
|
|
|
450
450
|
* Escape) goes through here, never through direct DOM removal.
|
|
451
451
|
*/
|
|
452
452
|
hide(viewId: string): Promise<void>;
|
|
453
|
+
|
|
454
|
+
/**
|
|
455
|
+
* Publish what this extension's view is holding, so the shell can tint
|
|
456
|
+
* its tab icon (`level: 'none'` clears it). PASSIVE: it shows nothing
|
|
457
|
+
* and reveals nothing — the same rule a status-bar counter follows.
|
|
458
|
+
* Only views this extension declared may be decorated.
|
|
459
|
+
*/
|
|
460
|
+
setViewStatus(viewId: string, status: shell.Views.ViewStatus): void;
|
|
453
461
|
};
|
|
454
462
|
}
|
|
455
463
|
|
|
@@ -50,6 +50,14 @@ declare module 'punica' {
|
|
|
50
50
|
/** Returns the id of the currently active panel tab, or null. */
|
|
51
51
|
getActiveId(): string | null;
|
|
52
52
|
|
|
53
|
+
/**
|
|
54
|
+
* Paint a tab's passive indicator: the icon takes the status color and
|
|
55
|
+
* the tooltip / accessible name carries `detail`. Called by the
|
|
56
|
+
* ViewRegistry, which owns the status — extensions publish through
|
|
57
|
+
* `context.ui.setViewStatus`, never here. `null` clears it.
|
|
58
|
+
*/
|
|
59
|
+
setTabStatus(id: string, status: Views.ViewStatus | null): void;
|
|
60
|
+
|
|
53
61
|
/**
|
|
54
62
|
* Activate a tab and execute its bound command (legacy render
|
|
55
63
|
* path). Blocked during headless extension activation — a
|
|
@@ -91,6 +91,34 @@ declare module 'punica' {
|
|
|
91
91
|
focus?: boolean;
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
+
/**
|
|
95
|
+
* How bad is the worst thing a view is currently holding. `none` means
|
|
96
|
+
* empty — the view's own resting state, not an absence of information.
|
|
97
|
+
*/
|
|
98
|
+
export type ViewStatusLevel =
|
|
99
|
+
| 'none'
|
|
100
|
+
| 'info'
|
|
101
|
+
| 'success'
|
|
102
|
+
| 'warning'
|
|
103
|
+
| 'error';
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* A view's passive indicator: what its list holds right now, published by
|
|
107
|
+
* the owning extension so the shell can tint the view's tab icon.
|
|
108
|
+
*
|
|
109
|
+
* Deliberately not a count. The number belongs to whatever surface the
|
|
110
|
+
* extension already renders it on (a status-bar counter, a bell badge);
|
|
111
|
+
* a third copy in the tab strip would widen the strip and say nothing new.
|
|
112
|
+
* `detail` carries the words instead, and reaches the tab's accessible
|
|
113
|
+
* name — the icon-only strips have no label to fall back on, so the color
|
|
114
|
+
* must never be the only channel.
|
|
115
|
+
*/
|
|
116
|
+
export interface ViewStatus {
|
|
117
|
+
level: ViewStatusLevel;
|
|
118
|
+
/** Human phrasing, e.g. "2 warnings, 1 info". */
|
|
119
|
+
detail?: string;
|
|
120
|
+
}
|
|
121
|
+
|
|
94
122
|
export interface ViewInfo {
|
|
95
123
|
viewId: string;
|
|
96
124
|
slot: ViewSlotId;
|
|
@@ -142,6 +170,24 @@ declare module 'punica' {
|
|
|
142
170
|
*/
|
|
143
171
|
hide(viewId: string, source: RevealSource): void;
|
|
144
172
|
|
|
173
|
+
/**
|
|
174
|
+
* Publish a view's passive indicator (see `ViewStatus`) and push it to
|
|
175
|
+
* whichever tabbed container currently holds the view — so the tint
|
|
176
|
+
* follows the view when it is relocated between the bottom panel and
|
|
177
|
+
* the right sidebar.
|
|
178
|
+
*
|
|
179
|
+
* PASSIVE: this never reveals a view, never activates an extension and
|
|
180
|
+
* never changes the active tab. `owner` (the calling extension's name,
|
|
181
|
+
* supplied by `context.ui.setViewStatus`) is checked against the
|
|
182
|
+
* placement, so one extension cannot decorate another's tab.
|
|
183
|
+
*
|
|
184
|
+
* `level: 'none'` clears the status.
|
|
185
|
+
*/
|
|
186
|
+
setViewStatus(viewId: string, status: ViewStatus, owner?: string): void;
|
|
187
|
+
|
|
188
|
+
/** The last published status, or undefined when the view is at rest. */
|
|
189
|
+
getViewStatus(viewId: string): ViewStatus | undefined;
|
|
190
|
+
|
|
145
191
|
/**
|
|
146
192
|
* Relocate a view to another dock area (relocation primitive).
|
|
147
193
|
* Validates `targetSlot ∈ placement.allowedSlots`, tears down the
|