@punica/editor 1.10.11 → 1.11.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@punica/editor",
3
- "version": "1.10.11",
3
+ "version": "1.11.1",
4
4
  "description": "Punica Editor",
5
5
  "private": false,
6
6
  "type": "module",
@@ -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
 
@@ -16,7 +16,11 @@ declare module 'punica' {
16
16
  *
17
17
  * - 'streaming' : opt-in chunked read/write for large files
18
18
  * - 'binary' : ranged binary reads via `readBytes` (e.g.
19
- * Parquet); text-only providers omit this
19
+ * Parquet); text-only providers omit this.
20
+ * READS ONLY — binary WRITE support is not
21
+ * implied, because both shipped hosts declared
22
+ * this flag before either could write bytes.
23
+ * Feature-detect `writeBytes` directly instead
20
24
  * - 'watch' : path-scoped change notifications
21
25
  * - 'versioning' : per-path history + time-travel reads
22
26
  * - 'encrypted-at-rest' : payloads stored encrypted by the host
@@ -253,6 +257,17 @@ declare module 'punica' {
253
257
  length: number
254
258
  ): Promise<ArrayBuffer>;
255
259
 
260
+ /**
261
+ * Write raw bytes to a workspace file, creating it when absent and
262
+ * replacing it wholesale when present. Optional/capability-gated:
263
+ * present on hosts with a binary bridge, absent on text-only providers
264
+ * — feature-detect with `typeof fs.writeBytes === 'function'` rather
265
+ * than the `'binary'` flag, which speaks only for reads. Use for
266
+ * binary content (a pasted screenshot, a copied image) that
267
+ * `createFileWithContent` would corrupt by encoding it as UTF-8.
268
+ */
269
+ writeBytes?(path: string, data: ArrayBuffer): Promise<void>;
270
+
256
271
  /**
257
272
  * Create a new file with the given textual content.
258
273
  */
@@ -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