@pstdio/workbench 0.6.0 → 0.7.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.
@@ -142,6 +142,7 @@ declare interface Command {
142
142
  }
143
143
 
144
144
  declare interface CommandHandler<TArgs = unknown, TResult = unknown> {
145
+ prepareArgs?(args: TArgs, context?: WorkbenchCommandExecutionContext, onArgsChange?: (args: TArgs) => void): TArgs | Promise<TArgs>;
145
146
  execute(args: TArgs, context?: WorkbenchCommandExecutionContext): TResult | Promise<TResult>;
146
147
  isEnabled?(args: TArgs): boolean;
147
148
  isVisible?(args: TArgs): boolean;
@@ -198,6 +199,8 @@ declare interface CommandParamDescriptor {
198
199
  options?: CommandParamOption[];
199
200
  templateType?: string;
200
201
  resourceType?: string;
202
+ accept?: string;
203
+ multiple?: boolean;
201
204
  metadata?: Record<string, unknown>;
202
205
  }
203
206
 
@@ -217,6 +220,7 @@ declare interface CommandRegistry {
217
220
  isCommandEnabled(id: string, args?: unknown): boolean;
218
221
  isCommandVisible(id: string, args?: unknown): boolean;
219
222
  isCommandToggled(id: string, args?: unknown): boolean;
223
+ prepareCommandArgs(id: string, args: unknown, context?: WorkbenchCommandExecutionContext, onArgsChange?: (args: unknown) => void): Promise<unknown>;
220
224
  executeCommand(id: string, args?: unknown, context?: WorkbenchCommandExecutionContext): Promise<unknown>;
221
225
  onDidExecuteError(listener: WorkbenchCommandExecutionErrorListener): Disposable_2;
222
226
  }
@@ -681,10 +685,21 @@ declare interface FileIconThemeRegistry {
681
685
 
682
686
  declare interface FileRendererContent {
683
687
  fileName?: string;
688
+ /** Workspace-relative path shown above the file preview. */
689
+ filePath?: string;
684
690
  mimeType?: string;
685
691
  content?: string;
686
692
  dataUrl?: string;
687
693
  placeholder?: string;
694
+ /** Override contribution-level save support for one loaded file. */
695
+ editable?: boolean;
696
+ /** Request Monaco for text that automatic dispatch would open as markdown. */
697
+ textRenderer?: "automatic" | "monaco";
698
+ /** Represent a deliberate no-file selection without an editable blank document. */
699
+ emptyState?: {
700
+ title: string;
701
+ description?: string;
702
+ };
688
703
  /** Ordered backing-store revision when one is available. */
689
704
  revision?: string;
690
705
  }
@@ -1434,7 +1449,9 @@ declare interface ResolvedCompositionPlacement {
1434
1449
 
1435
1450
  declare type ResolvedResourceHierarchyProvider = Required<ResourceHierarchyProvider>;
1436
1451
 
1437
- declare type ResolvedResourcePresenter = Required<ResourcePresenter>;
1452
+ declare type ResolvedResourcePresenter = Omit<ResourcePresenter, "priority"> & {
1453
+ priority: number;
1454
+ };
1438
1455
 
1439
1456
  declare interface ResourceBrowseEntry {
1440
1457
  resource: ResourceRef;
@@ -1496,6 +1513,7 @@ declare interface ResourcePresenter {
1496
1513
  priority?: number;
1497
1514
  canOpen(resource: ResourceRef): boolean;
1498
1515
  open(resource: ResourceRef, input: OpenResourceInput): WorkbenchPanelInstance | Promise<WorkbenchPanelInstance>;
1516
+ afterOpen?(resource: ResourceRef, instance: WorkbenchPanelInstance, input: OpenResourceInput): void;
1499
1517
  }
1500
1518
 
1501
1519
  declare interface ResourceProvider {
@@ -1699,11 +1717,13 @@ declare interface TreeNode {
1699
1717
  target?: NavigationTarget;
1700
1718
  /** Visual row variant for non-data rows such as placeholders. */
1701
1719
  rowVariant?: TreeNodeRowVariant;
1720
+ inlineInput?: TreeNodeInlineInput;
1702
1721
  actions?: TreeAction[];
1703
1722
  contextMenuActions?: TreeAction[];
1704
1723
  contextMenuPath?: MenuPath;
1705
1724
  menuPath?: MenuPath;
1706
1725
  menuPlacement?: "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "left-start";
1726
+ showContextMenuTrigger?: boolean;
1707
1727
  collapsible?: boolean;
1708
1728
  disabled?: boolean;
1709
1729
  children?: TreeNode[];
@@ -1714,6 +1734,18 @@ declare interface TreeNode {
1714
1734
  canHide?: boolean;
1715
1735
  /** When false, the node stays fixed within its Sidenav group. */
1716
1736
  canReorder?: boolean;
1737
+ /** Allow this node to be moved to another tree location. */
1738
+ canDrag?: boolean;
1739
+ /** Allow movable nodes to be dropped on this node. */
1740
+ canDrop?: boolean;
1741
+ }
1742
+
1743
+ declare interface TreeNodeInlineInput {
1744
+ ariaLabel: string;
1745
+ defaultValue?: string;
1746
+ placeholder?: string;
1747
+ onCommit(value: string): Promise<void> | void;
1748
+ onCancel?(): void;
1717
1749
  }
1718
1750
 
1719
1751
  declare type TreeNodeRowVariant = "empty-state";
@@ -1722,6 +1754,8 @@ declare interface TreeRendererContribution {
1722
1754
  id: string;
1723
1755
  title: string;
1724
1756
  icon?: string;
1757
+ searchable?: boolean;
1758
+ searchPlaceholder?: string;
1725
1759
  when?: string;
1726
1760
  defaultExpandedSectionIds?: string[];
1727
1761
  defaultExpandedNodeIds?: string[];
@@ -1729,6 +1763,7 @@ declare interface TreeRendererContribution {
1729
1763
  getHeader?(ctx: TreeContext): Promise<TreeNode[]> | TreeNode[];
1730
1764
  getFooter?(ctx: TreeContext): Promise<TreeNode[]> | TreeNode[];
1731
1765
  getChildren(node: TreeNode, ctx: TreeContext): Promise<TreeNode[]> | TreeNode[];
1766
+ moveNode?(source: TreeNode, target: TreeNode | undefined, ctx: TreeContext): Promise<void> | void;
1732
1767
  }
1733
1768
 
1734
1769
  declare type TreeRendererImplementation = (input: WorkbenchPanelRenderInput & {
@@ -1104,6 +1104,7 @@ const Mt = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
1104
1104
  label: o(r.label, r.extensionId),
1105
1105
  icon: r.icon,
1106
1106
  group: s.group ?? r.group,
1107
+ args: r.params,
1107
1108
  overflowLabel: s.overflowLabel,
1108
1109
  order: Ne(r, n),
1109
1110
  when: i
@@ -1120,6 +1121,7 @@ const Mt = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
1120
1121
  label: o(r.label, r.extensionId),
1121
1122
  icon: r.icon,
1122
1123
  group: r.group,
1124
+ args: r.params,
1123
1125
  order: Ne(r, n)
1124
1126
  };
1125
1127
  }, vr = (e) => {
@@ -1851,6 +1853,8 @@ const Mt = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
1851
1853
  id: t.id,
1852
1854
  title: f(t.title, t.id),
1853
1855
  icon: t.icon,
1856
+ searchable: t.searchable,
1857
+ searchPlaceholder: f(t.searchPlaceholder, "Search files"),
1854
1858
  defaultExpandedNodeIds: t.defaultExpandedNodeIds,
1855
1859
  defaultExpandedSectionIds: t.defaultExpandedSectionIds,
1856
1860
  getHeader: (i) => Jr({