@phoundry/phials-plugin-sdk 1.0.1 → 1.0.2
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.
|
@@ -29,9 +29,9 @@ type CommandContextKey =
|
|
|
29
29
|
| "selectionIsFile" // All selected are files
|
|
30
30
|
| "selectionIsDirectory" // All selected are directories
|
|
31
31
|
| "selectionIsMixed" // Mix of files and directories
|
|
32
|
-
//
|
|
33
|
-
| "
|
|
34
|
-
| "
|
|
32
|
+
// Workspace/Collection state
|
|
33
|
+
| "inWorkspace" // Current directory is a workspace
|
|
34
|
+
| "hasWorkspaceSelection" // Selected files are in a workspace
|
|
35
35
|
// Clipboard
|
|
36
36
|
| "hasClipboard" // Files in clipboard (cut/copy)
|
|
37
37
|
| "clipboardIsCut" // Clipboard operation is cut
|
|
@@ -62,8 +62,8 @@ interface CommandContext {
|
|
|
62
62
|
/** Current directory path */
|
|
63
63
|
currentPath: string;
|
|
64
64
|
|
|
65
|
-
/** Whether current directory is a
|
|
66
|
-
|
|
65
|
+
/** Whether current directory is a workspace */
|
|
66
|
+
isWorkspace: boolean;
|
|
67
67
|
|
|
68
68
|
/** Whether the saved-views scope has a property schema (e.g. Boards). */
|
|
69
69
|
hasPropertySchema: boolean;
|
|
@@ -143,9 +143,7 @@ interface ContextMenuPlacementConfig extends CommandPlacementBase {
|
|
|
143
143
|
/**
|
|
144
144
|
* Union of all placement configurations.
|
|
145
145
|
*/
|
|
146
|
-
type CommandPlacement =
|
|
147
|
-
| ToolbarPlacementConfig
|
|
148
|
-
| ContextMenuPlacementConfig;
|
|
146
|
+
type CommandPlacement = ToolbarPlacementConfig | ContextMenuPlacementConfig;
|
|
149
147
|
|
|
150
148
|
// ─── Command Definition ──────────────────────────────────────────────────────
|
|
151
149
|
|
|
@@ -94,22 +94,27 @@ interface CoreEvents {
|
|
|
94
94
|
/** Persisted File Note content was created, updated, or removed */
|
|
95
95
|
"core.file-note.saved": {
|
|
96
96
|
path: string;
|
|
97
|
-
|
|
97
|
+
workspacePath: string;
|
|
98
98
|
hasNote: boolean;
|
|
99
99
|
};
|
|
100
|
-
/** Portable Page visibility/order changed for one
|
|
101
|
-
"core.
|
|
102
|
-
|
|
103
|
-
page:
|
|
100
|
+
/** Portable Page visibility/order changed for one Workspace. */
|
|
101
|
+
"core.workspace-page-config.changed": {
|
|
102
|
+
workspacePath: string;
|
|
103
|
+
page: WorkspacePageConfig;
|
|
104
|
+
};
|
|
105
|
+
/** Canonical cell deltas or a filtered compatibility refetch for one Workspace. */
|
|
106
|
+
"core.workspace-values.changed": WorkspaceValuesChangedEvent;
|
|
107
|
+
/** Workspace Folder Property schemas changed, including paired Relations. */
|
|
108
|
+
"core.workspace-properties.changed": {
|
|
109
|
+
workspaceIds: string[];
|
|
110
|
+
sourcePaneId: string;
|
|
104
111
|
};
|
|
105
|
-
/** Canonical cell deltas or a filtered compatibility refetch for one Vial. */
|
|
106
|
-
"core.vial-values.changed": VialValuesChangedEvent;
|
|
107
112
|
/** Formula output types changed; every pane must normalize its consumers. */
|
|
108
|
-
"core.
|
|
109
|
-
|
|
110
|
-
|
|
113
|
+
"core.workspace-formula-output-types.changed": {
|
|
114
|
+
workspaceId?: string;
|
|
115
|
+
workspacePath: string;
|
|
111
116
|
propertyIds: string[];
|
|
112
|
-
savedViews:
|
|
117
|
+
savedViews: SavedWorkspaceView[];
|
|
113
118
|
sourcePaneId: string;
|
|
114
119
|
};
|
|
115
120
|
/** File opened */
|
|
@@ -129,8 +134,8 @@ interface CoreEvents {
|
|
|
129
134
|
/** App setting value changed */
|
|
130
135
|
"core.settings.changed": { key: string; value: unknown };
|
|
131
136
|
|
|
132
|
-
/** Known
|
|
133
|
-
"core.known-
|
|
137
|
+
/** Known workspaces list changed (add/remove/rename in session) */
|
|
138
|
+
"core.known-workspaces.changed": { paths: string[] };
|
|
134
139
|
|
|
135
140
|
/** Explorer always-hide globs changed */
|
|
136
141
|
"core.config.hidden-globs.changed": { globs: string[] };
|
|
@@ -21,6 +21,7 @@ type FileCategory =
|
|
|
21
21
|
| "ebook"
|
|
22
22
|
| "spreadsheet"
|
|
23
23
|
| "presentation"
|
|
24
|
+
| "plain text"
|
|
24
25
|
// Code & Data
|
|
25
26
|
| "code"
|
|
26
27
|
| "code - data"
|
|
@@ -54,14 +55,16 @@ interface FileEntry {
|
|
|
54
55
|
icon?: string;
|
|
55
56
|
is_file: boolean;
|
|
56
57
|
is_dir: boolean;
|
|
57
|
-
|
|
58
|
-
/** Nested
|
|
59
|
-
|
|
58
|
+
is_workspace: boolean;
|
|
59
|
+
/** Nested workspace folder when listing inside a parent workspace */
|
|
60
|
+
isChildWorkspace?: boolean;
|
|
60
61
|
/** Listing node is a symlink or Windows directory junction */
|
|
61
62
|
is_symlink?: boolean;
|
|
62
63
|
/** Resolved absolute target when healthy; stored link text when broken */
|
|
63
64
|
symlink_target?: string | null;
|
|
64
65
|
symlink_broken?: boolean;
|
|
66
|
+
/** Bytes are not local. Set from listing metadata; absent means local or unknown. */
|
|
67
|
+
online_only?: boolean;
|
|
65
68
|
size: number;
|
|
66
69
|
created?: number | null;
|
|
67
70
|
modified?: number | null;
|
|
@@ -101,7 +104,7 @@ type ViewMode =
|
|
|
101
104
|
/** Calendar view zoom level */
|
|
102
105
|
type CalendarScope = "year" | "month" | "week" | "3day" | "day";
|
|
103
106
|
|
|
104
|
-
/** Built-in calendar date sources (`created`, `modified`) or a
|
|
107
|
+
/** Built-in calendar date sources (`created`, `modified`) or a workspace property id */
|
|
105
108
|
type CalendarDateSourceId = "created" | "modified" | (string & {});
|
|
106
109
|
|
|
107
110
|
/**
|
package/package.json
CHANGED
|
@@ -110,6 +110,9 @@ type ProviderType = "preview" | "metadata" | "view" | "module" | "command";
|
|
|
110
110
|
|
|
111
111
|
type PreviewDestination = "module" | "gallery" | "page" | "embed";
|
|
112
112
|
|
|
113
|
+
/** File-mode vs inspection chrome for a Preview surface. Destination still names the host. */
|
|
114
|
+
type PreviewPresentation = "file" | "inspection";
|
|
115
|
+
|
|
113
116
|
/** Provider-owned state shared by every presentation of one file preview. */
|
|
114
117
|
interface PreviewSession {
|
|
115
118
|
/** Clean unreferenced sessions are disposed; unresolved work can retain itself. */
|
|
@@ -331,7 +334,11 @@ interface MetadataColumnPolicy {
|
|
|
331
334
|
*/
|
|
332
335
|
columnWhitelist?: string[];
|
|
333
336
|
|
|
334
|
-
/**
|
|
337
|
+
/**
|
|
338
|
+
* Whether columns can be auto-shown from file matching alone.
|
|
339
|
+
* `"when-dominant"` means uniquely leading in the Folder (match ratio, then
|
|
340
|
+
* priority). It does not use the profile `dominant` flag.
|
|
341
|
+
*/
|
|
335
342
|
autoVisible?: "never" | "when-any" | "when-dominant";
|
|
336
343
|
|
|
337
344
|
/** Fields to show automatically when the provider qualifies. Defaults to the first few schema fields. */
|
|
@@ -497,13 +504,13 @@ interface FileBrowserViewProvider {
|
|
|
497
504
|
/** Optional: custom column configuration for this view */
|
|
498
505
|
columns?: ViewColumnDefinition[];
|
|
499
506
|
|
|
500
|
-
/** If true, this view is only available in collections (
|
|
507
|
+
/** If true, this view is only available in collections (workspaces) */
|
|
501
508
|
collectionOnly?: boolean;
|
|
502
509
|
|
|
503
510
|
/**
|
|
504
511
|
* Default item size when a folder has no per-folder override (`itemSize` null).
|
|
505
|
-
* Details family uses row-height ticks;
|
|
506
|
-
* Boards uses its column-width ticks.
|
|
512
|
+
* Details family uses row-height ticks; Thumbnails, Masonry, and Gallery each
|
|
513
|
+
* have their own S/M/L grid ticks; Boards uses its column-width ticks.
|
|
507
514
|
*/
|
|
508
515
|
defaultItemSizePreset?: ViewItemSizePreset;
|
|
509
516
|
|
|
@@ -901,6 +908,8 @@ interface PluginSettings {
|
|
|
901
908
|
unset(key: string): Promise<void>;
|
|
902
909
|
/** Remove every durable value and reveal all schema defaults. */
|
|
903
910
|
reset(): Promise<void>;
|
|
911
|
+
/** Open the Phials settings window directly to this plugin's settings page. */
|
|
912
|
+
open(): Promise<void>;
|
|
904
913
|
onChange(
|
|
905
914
|
handler: (change: PluginSettingsChange) => void,
|
|
906
915
|
): PluginSettingsSubscription;
|
|
@@ -1092,6 +1101,9 @@ interface EventsAPI {
|
|
|
1092
1101
|
* Base Plugin API - available to all providers
|
|
1093
1102
|
*/
|
|
1094
1103
|
interface PluginAPI {
|
|
1104
|
+
/** Open the Phials settings window directly to this plugin's settings page. */
|
|
1105
|
+
openSettings(): Promise<void>;
|
|
1106
|
+
|
|
1095
1107
|
/** Plugin's own settings */
|
|
1096
1108
|
settings: PluginSettings;
|
|
1097
1109
|
|
|
@@ -291,7 +291,7 @@ interface DetailsViewColumnConfig {
|
|
|
291
291
|
|
|
292
292
|
type PagePropertyVisibility = "always" | "not-empty" | "hidden";
|
|
293
293
|
|
|
294
|
-
interface
|
|
294
|
+
interface WorkspacePageConfig {
|
|
295
295
|
readonly propertyOrder?: readonly string[];
|
|
296
296
|
readonly propertyVisibility?: Readonly<
|
|
297
297
|
Record<string, PagePropertyVisibility>
|
|
@@ -300,7 +300,7 @@ interface VialPageConfig {
|
|
|
300
300
|
readonly fullWidth?: boolean;
|
|
301
301
|
}
|
|
302
302
|
|
|
303
|
-
interface
|
|
303
|
+
interface SavedWorkspaceView {
|
|
304
304
|
readonly id: string;
|
|
305
305
|
readonly name: string;
|
|
306
306
|
readonly icon?: string;
|
|
@@ -310,38 +310,39 @@ interface SavedVialView {
|
|
|
310
310
|
}
|
|
311
311
|
|
|
312
312
|
type PropertyValue = WorkspaceFolderPropertyValue;
|
|
313
|
-
type
|
|
313
|
+
type WorkspaceCellDeltaOperation = "set" | "clear" | "pending";
|
|
314
314
|
|
|
315
|
-
interface
|
|
316
|
-
readonly
|
|
317
|
-
readonly
|
|
315
|
+
interface WorkspaceCellDelta {
|
|
316
|
+
readonly workspaceId: string;
|
|
317
|
+
readonly workspacePath: string;
|
|
318
318
|
readonly fileId: string;
|
|
319
319
|
readonly filePath: string;
|
|
320
320
|
readonly propertyId: string;
|
|
321
|
-
readonly operation:
|
|
321
|
+
readonly operation: WorkspaceCellDeltaOperation;
|
|
322
322
|
readonly value: PropertyValue | null;
|
|
323
323
|
readonly mutationVersion: number;
|
|
324
324
|
}
|
|
325
325
|
|
|
326
|
-
interface
|
|
326
|
+
interface WorkspaceValueDeltaEvent {
|
|
327
327
|
readonly kind: "delta";
|
|
328
328
|
readonly sourcePaneId: string;
|
|
329
|
-
readonly cell:
|
|
330
|
-
readonly dependentDeltas: readonly
|
|
329
|
+
readonly cell: WorkspaceCellDelta;
|
|
330
|
+
readonly dependentDeltas: readonly WorkspaceCellDelta[];
|
|
331
331
|
}
|
|
332
332
|
|
|
333
|
-
interface
|
|
333
|
+
interface WorkspaceValueRefetchEvent {
|
|
334
334
|
readonly kind: "refetch";
|
|
335
335
|
readonly sourcePaneId: string;
|
|
336
|
-
readonly
|
|
337
|
-
readonly
|
|
336
|
+
readonly workspaceId: string;
|
|
337
|
+
readonly workspacePath: string;
|
|
338
338
|
readonly fileIds?: readonly string[];
|
|
339
339
|
readonly filePaths?: readonly string[];
|
|
340
340
|
readonly propertyIds?: readonly string[];
|
|
341
341
|
readonly reason: "legacy" | "plugin" | "schema";
|
|
342
342
|
}
|
|
343
343
|
|
|
344
|
-
type
|
|
344
|
+
type WorkspaceValuesChangedEvent =
|
|
345
|
+
WorkspaceValueDeltaEvent | WorkspaceValueRefetchEvent;
|
|
345
346
|
|
|
346
347
|
type DrivesChangedPayload = {
|
|
347
348
|
readonly reason: "mounted" | "unmounted" | "changed" | "poll";
|