@punica/editor 1.6.12 → 1.6.14
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 +2 -2
- 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/index.d.ts +1 -0
- package/types/punica.module.runtime.fs.d.ts +16 -0
- package/types/punica.module.runtime.search.d.ts +16 -2
- package/types/punica.module.shell.appBar.d.ts +86 -0
- package/types/punica.module.shell.profile.d.ts +8 -0
package/package.json
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference path="punica.module.shell.activityBar.d.ts" />
|
|
2
|
+
/// <reference path="punica.module.shell.appBar.d.ts" />
|
|
2
3
|
/// <reference path="punica.module.shell.keyboardShortcuts.d.ts" />
|
|
3
4
|
/// <reference path="punica.module.shell.dragDrop.d.ts" />
|
|
4
5
|
/// <reference path="punica.module.shell.layout.d.ts" />
|
|
@@ -192,6 +192,22 @@ declare module 'punica' {
|
|
|
192
192
|
*/
|
|
193
193
|
cwd?: string;
|
|
194
194
|
|
|
195
|
+
/**
|
|
196
|
+
* Is a concrete provider installed behind this facade?
|
|
197
|
+
*
|
|
198
|
+
* **Substrate-provided — hosts must NOT implement this.** It exists only
|
|
199
|
+
* on the wrapper the substrate hands out as `punica.runtime.fs`, which is
|
|
200
|
+
* why it is optional: reading it off a raw provider object yields
|
|
201
|
+
* `undefined`, and a caller should treat that as "cannot tell, fall back".
|
|
202
|
+
*
|
|
203
|
+
* Answers without any filesystem access. Before it existed, the only way
|
|
204
|
+
* to detect a missing provider was to call a real method and match its
|
|
205
|
+
* error message — which cost a full recursive workspace walk for a
|
|
206
|
+
* boolean, and could not distinguish "no provider" from a provider that
|
|
207
|
+
* failed transiently.
|
|
208
|
+
*/
|
|
209
|
+
hasProvider?(): boolean;
|
|
210
|
+
|
|
195
211
|
/**
|
|
196
212
|
* Returns the full file tree for the current workspace root.
|
|
197
213
|
*/
|
|
@@ -48,12 +48,26 @@ declare module 'punica' {
|
|
|
48
48
|
query(options: SearchQueryOptions): Promise<SearchResponse>;
|
|
49
49
|
|
|
50
50
|
/**
|
|
51
|
-
* (Optional) Trigger
|
|
51
|
+
* (Optional) Trigger an index operation.
|
|
52
52
|
* Implementations may ignore this if indexing is managed externally.
|
|
53
|
+
*
|
|
54
|
+
* Incremental by default — a host is expected to re-read only what
|
|
55
|
+
* changed since the last pass. `rebuild` asks for a from-scratch index,
|
|
56
|
+
* which a caller should only need after changing what gets indexed.
|
|
57
|
+
*
|
|
58
|
+
* `skipped` and `rebuilt` are optional so an older host stays conformant;
|
|
59
|
+
* a host that reports them makes "the index quietly grew to a gigabyte
|
|
60
|
+
* over a virtualenv" observable instead of invisible.
|
|
53
61
|
*/
|
|
54
62
|
startIndex?(options?: {
|
|
55
63
|
verbose?: boolean;
|
|
56
|
-
|
|
64
|
+
rebuild?: boolean;
|
|
65
|
+
}): Promise<void | {
|
|
66
|
+
addedOrUpdated: number;
|
|
67
|
+
removed: number;
|
|
68
|
+
skipped?: number;
|
|
69
|
+
rebuilt?: boolean;
|
|
70
|
+
}>;
|
|
57
71
|
}
|
|
58
72
|
}
|
|
59
73
|
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* App bar type declarations.
|
|
3
|
+
*
|
|
4
|
+
* The app bar is the top strip of the window: branding on the left, the current
|
|
5
|
+
* workspace in the middle, actions on the right. On hosts that hide the native
|
|
6
|
+
* title bar it is also the window's drag handle, so it exists on every profile
|
|
7
|
+
* that lists `shell.appBar` — including the welcome layout, where it is the only
|
|
8
|
+
* way to move the window.
|
|
9
|
+
*
|
|
10
|
+
* Composition is declarative: a profile's `shell.appBar` spec describes the bar,
|
|
11
|
+
* and a shell renders it. Extensions may add their own actions at runtime
|
|
12
|
+
* through `punica.shell.AppBar.manager`, which is the same registry the profile
|
|
13
|
+
* items go through.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
declare module 'punica' {
|
|
17
|
+
export namespace shell {
|
|
18
|
+
namespace AppBar {
|
|
19
|
+
/** Which end of the bar an item belongs to. */
|
|
20
|
+
type AppBarAlignment = 'left' | 'right';
|
|
21
|
+
|
|
22
|
+
/** What the middle of the bar shows. */
|
|
23
|
+
type AppBarTitleMode = 'workspace' | 'product' | 'none';
|
|
24
|
+
|
|
25
|
+
/** One entry in an item's dropdown menu. */
|
|
26
|
+
interface AppBarMenuItem {
|
|
27
|
+
id: string;
|
|
28
|
+
label: string;
|
|
29
|
+
/** Command (or capability) id executed on select. */
|
|
30
|
+
command: string;
|
|
31
|
+
/** Draw a separator above this entry. */
|
|
32
|
+
separatorBefore?: boolean;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* An action on the bar. `command` fires on click; `menu` opens a dropdown
|
|
37
|
+
* instead. An item may declare both, in which case the menu wins and the
|
|
38
|
+
* command is ignored.
|
|
39
|
+
*/
|
|
40
|
+
interface AppBarItem {
|
|
41
|
+
id: string;
|
|
42
|
+
/** Icon markup (e.g. `<i class="fa-solid fa-gear"></i>`). */
|
|
43
|
+
icon?: string;
|
|
44
|
+
/** Optional text next to the icon. */
|
|
45
|
+
label?: string;
|
|
46
|
+
/** Tooltip / accessible name. */
|
|
47
|
+
title?: string;
|
|
48
|
+
alignment?: AppBarAlignment;
|
|
49
|
+
/**
|
|
50
|
+
* `'avatar'` draws a round account button whose glyph is the first
|
|
51
|
+
* letter of `label` (or the icon when there is none); `'action'` (the
|
|
52
|
+
* default) draws a flat icon button.
|
|
53
|
+
*/
|
|
54
|
+
kind?: 'action' | 'avatar';
|
|
55
|
+
command?: string;
|
|
56
|
+
menu?: AppBarMenuItem[];
|
|
57
|
+
/**
|
|
58
|
+
* Command id returning a one-line summary rendered as the menu header
|
|
59
|
+
* (e.g. the licence state). Dropped when the command is not registered,
|
|
60
|
+
* which is how a host without the surface stays quiet.
|
|
61
|
+
*/
|
|
62
|
+
summaryCommand?: string;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** A profile's app bar composition (see `ProfileShellSpec.appBar`). */
|
|
66
|
+
interface AppBarSpec {
|
|
67
|
+
/** Bar height in px. Defaults to 38. */
|
|
68
|
+
height?: number;
|
|
69
|
+
/** What the centre region shows. Defaults to `'workspace'`. */
|
|
70
|
+
title?: AppBarTitleMode;
|
|
71
|
+
items?: AppBarItem[];
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
interface IAppBarManager {
|
|
75
|
+
/**
|
|
76
|
+
* Add (or replace) an item. Re-adding a known id keeps its original
|
|
77
|
+
* position, so an extension reload never reshuffles the bar.
|
|
78
|
+
*/
|
|
79
|
+
addItem(item: AppBarItem): void;
|
|
80
|
+
removeItem(itemId: string): void;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const manager: IAppBarManager;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -21,6 +21,7 @@ declare module 'punica' {
|
|
|
21
21
|
*/
|
|
22
22
|
type ShellModuleId =
|
|
23
23
|
| 'shell.activityBar'
|
|
24
|
+
| 'shell.appBar'
|
|
24
25
|
| 'shell.statusbar'
|
|
25
26
|
| 'shell.view'
|
|
26
27
|
| 'shell.views'
|
|
@@ -136,6 +137,13 @@ declare module 'punica' {
|
|
|
136
137
|
* default minimal layout (single content slot).
|
|
137
138
|
*/
|
|
138
139
|
layout?: ProfileLayoutSpec;
|
|
140
|
+
/**
|
|
141
|
+
* Optional app bar composition — branding, title mode and the actions
|
|
142
|
+
* on the top strip. Omitted means the profile has no app bar, even when
|
|
143
|
+
* `shell.appBar` is listed in `activeModules`, in which case the shell
|
|
144
|
+
* falls back to the module's own defaults.
|
|
145
|
+
*/
|
|
146
|
+
appBar?: shell.AppBar.AppBarSpec;
|
|
139
147
|
/**
|
|
140
148
|
* Optional product defaults for the bottom panel. User settings
|
|
141
149
|
* (Project > Global) override these; when both are unset the substrate
|