@workbench-kit/react 0.0.2-prototype.0.2.4 → 0.0.2-prototype.0.2.41
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/README.md +172 -0
- package/package.json +38 -21
- package/src/index.ts +74 -34
- package/src/jdw/JsonCodeEditorPane.tsx +7 -6
- package/src/jdw/builtins/renderBuiltinWidgetLeaf.tsx +1 -3
- package/src/jdw/createBuiltinJdwRegistry.ts +1 -4
- package/src/jdw/cssRenderBackend.tsx +1 -4
- package/src/jdw/fixtures/jdw-fixtures.ts +0 -15
- package/src/json-config/JsonConfigWorkbench.tsx +1 -1
- package/src/layout/index.ts +11 -2
- package/src/layout/panel/Panel.tsx +0 -3
- package/src/layout/panel/index.ts +0 -2
- package/src/layout/sidebar/SideBarTree.tsx +301 -0
- package/src/layout/sidebar/SidebarActionIconBar.tsx +3 -3
- package/src/layout/sidebar/WorkbenchSidebarActions.tsx +1 -1
- package/src/layout/sidebar/index.ts +13 -0
- package/src/modal/Modal.tsx +55 -25
- package/src/modal/ModalTitlebar.tsx +8 -8
- package/src/modal/modalPosition.ts +3 -6
- package/src/modal/useModalFocusTrap.ts +142 -0
- package/src/modal/useModalWindowFrame.ts +2 -2
- package/src/overlay/ContextMenu.tsx +133 -21
- package/src/overlay/context-menu-density.css +22 -0
- package/src/overlay/context-menu-item.ts +17 -0
- package/src/overlay/context-menu.css +6 -2
- package/src/overlay/index.ts +6 -1
- package/src/overlay/measureAnchoredOverlayPanel.ts +4 -6
- package/src/overlay/pointerPassthroughRegion.ts +17 -1
- package/src/overlay/usePointerPassthroughRegion.ts +35 -6
- package/src/primitives/absolute-box/AbsoluteBox.tsx +4 -4
- package/src/primitives/app-icon/AppIcon.tsx +33 -0
- package/src/primitives/app-icon/app-icon.css +28 -0
- package/src/primitives/button/Button.tsx +4 -4
- package/src/primitives/catalog-browse-card/CatalogBrowseCard.tsx +6 -6
- package/src/primitives/catalog-browse-pane/CatalogBrowsePane.tsx +39 -32
- package/src/primitives/catalog-browse-pane/catalog-browse-pane.css +4 -0
- package/src/primitives/catalog-filter-overlay/CatalogFilterOverlay.tsx +2 -2
- package/src/primitives/checkbox/Checkbox.tsx +1 -1
- package/src/primitives/chip/Chip.tsx +3 -12
- package/src/primitives/chip/index.ts +2 -2
- package/src/primitives/codicon/Codicon.tsx +1 -1
- package/src/primitives/file-icon/FileIcon.tsx +1 -1
- package/src/primitives/icon-button/IconButton.tsx +1 -1
- package/src/primitives/index.ts +7 -2
- package/src/primitives/library-detail-layout/LibraryDetailLayout.tsx +123 -9
- package/src/primitives/library-detail-layout/library-detail-layout.css +57 -0
- package/src/primitives/library-detail-layout/resolve-hero-cover-media.ts +80 -0
- package/src/primitives/library-facet-filter-panel/LibraryFacetFilterPanel.tsx +12 -12
- package/src/primitives/library-facet-filter-strip/LibraryFacetFilterStrip.tsx +4 -4
- package/src/primitives/number-input/NumberInput.tsx +5 -5
- package/src/primitives/primitives.css +1 -0
- package/src/primitives/record-media-hero/RecordMediaHero.tsx +10 -6
- package/src/primitives/scroll-area/ScrollArea.tsx +5 -5
- package/src/primitives/scroll-area-infinite-load/useScrollAreaInfiniteLoad.ts +5 -5
- package/src/primitives/searchable-multi-select/SearchableMultiSelect.tsx +7 -7
- package/src/primitives/select/Select.tsx +1 -13
- package/src/primitives/text-area/TextArea.tsx +1 -1
- package/src/primitives/text-input/TextInput.tsx +1 -1
- package/src/primitives/workbench-media-slot/WorkbenchMediaPlaceholder.tsx +2 -2
- package/src/primitives/workbench-media-slot/WorkbenchMediaSlot.tsx +16 -10
- package/src/primitives/workbench-thumbnail/WorkbenchThumbnail.tsx +4 -4
- package/src/scrollbars.css +2 -6
- package/src/styles/core.css +16 -0
- package/src/styles/foundation.css +4 -0
- package/src/styles/overlay.css +2 -0
- package/src/styles.css +1 -15
- package/src/utils/clamp.ts +4 -0
- package/src/utils/normalizeKeyToken.ts +13 -0
- package/src/utils/readNumber.ts +4 -0
- package/src/widget-tree/WidgetSourceEditor.tsx +0 -14
- package/src/widget-tree/WidgetTreeCanvasPreview.tsx +3 -10
- package/src/widget-tree/WidgetTreeLab.tsx +2 -23
- package/src/widget-tree/WidgetTreeSidePanel.tsx +0 -5
- package/src/widget-tree/WidgetTreeWorkspaceShell.tsx +2 -2
- package/src/widget-tree/index.ts +1 -5
- package/src/workbench/auth/WorkbenchLoginView.tsx +1 -2
- package/src/workbench/auth/auth-flows.css +14 -0
- package/src/workbench/chat/ChatCommandProposalCard.tsx +4 -4
- package/src/workbench/chat/ChatConversationBar.tsx +3 -3
- package/src/workbench/chat/ChatHistoryMenu.tsx +1 -1
- package/src/workbench/chat/ChatMessageCollapsible.tsx +4 -0
- package/src/workbench/chat/ChatMessageItem.tsx +68 -10
- package/src/workbench/chat/ChatMessageList.tsx +1 -1
- package/src/workbench/chat/ChatPanel.tsx +32 -23
- package/src/workbench/chat/ChatPhasedRunProgress.tsx +86 -13
- package/src/workbench/chat/ChatRenameDialog.tsx +1 -1
- package/src/workbench/chat/chat-conversation.css +2 -2
- package/src/workbench/chat/chat-ui.css +8 -0
- package/src/workbench/chat/chatConversation.ts +2 -2
- package/src/workbench/chat/chatMessageMeta.tsx +4 -4
- package/src/workbench/chat/index.ts +1 -0
- package/src/workbench/chat/types.ts +7 -7
- package/src/workbench/chat/useCancelRuntimeOnUnmount.ts +4 -4
- package/src/workbench/chat/useChatPrependPagination.ts +10 -10
- package/src/workbench/chat/useSlashCommandSuggest.ts +1 -1
- package/src/workbench/{WorkbenchModalPortal.tsx → chrome/WorkbenchModalPortal.tsx} +1 -1
- package/src/workbench/chrome/workbench-chrome.css +4 -0
- package/src/workbench/chrome/workbench-layout-regions.css +13 -0
- package/src/workbench/chrome/workbench-shell-titlebar.css +0 -8
- package/src/workbench/{CommandGroupShell.tsx → commands/CommandGroupShell.tsx} +2 -2
- package/src/workbench/{CommandList.tsx → commands/CommandList.tsx} +6 -5
- package/src/workbench/{CommandPalette.tsx → commands/CommandPalette.tsx} +16 -42
- package/src/workbench/{ConfirmationFlow.tsx → commands/ConfirmationFlow.tsx} +5 -5
- package/src/workbench/{ShortcutCommandBridge.tsx → commands/ShortcutCommandBridge.tsx} +17 -13
- package/src/workbench/commands/WorkbenchQuickOpen.tsx +462 -0
- package/src/workbench/{command-model.ts → commands/command-model.ts} +5 -1
- package/src/workbench/commands/command-ui.ts +3 -0
- package/src/workbench/{commands.ts → commands/commands.ts} +45 -1
- package/src/workbench/commands/createWorkspaceFilesQuickOpenProvider.ts +86 -0
- package/src/workbench/commands/quick-open-model.ts +66 -0
- package/src/workbench/{WorkbenchEditorTabs.tsx → editor/WorkbenchEditorTabs.tsx} +13 -3
- package/src/workbench/{editor-tabs-dnd.ts → editor/editor-tabs-dnd.ts} +1 -1
- package/src/workbench/{editorTabContextMenu.ts → editor/editorTabContextMenu.ts} +43 -4
- package/src/workbench/{useEditorTabsStripDnd.ts → editor/useEditorTabsStripDnd.ts} +1 -1
- package/src/workbench/{useWorkbenchEditorTabContextMenu.tsx → editor/useWorkbenchEditorTabContextMenu.tsx} +16 -2
- package/src/workbench/editor-tabs/index.ts +10 -9
- package/src/workbench/index.ts +114 -74
- package/src/workbench/management/CommandManagementSidebar.tsx +16 -30
- package/src/workbench/management/ExtensionManagementPanel.tsx +84 -46
- package/src/workbench/management/ExtensionManagementSidebar.tsx +79 -45
- package/src/workbench/management/IntegrationCommandActions.tsx +8 -1
- package/src/workbench/management/IntegrationSettingsSurface.tsx +2 -5
- package/src/workbench/management/IntegrationsShell.tsx +1 -1
- package/src/workbench/management/KeybindingCaptureField.tsx +1 -9
- package/src/workbench/management/WorkbenchDialogFrame.tsx +2 -2
- package/src/workbench/management/WorkbenchNotice.tsx +17 -12
- package/src/workbench/management/createWorkbenchNotify.tsx +88 -0
- package/src/workbench/management/extension-install-approval.ts +72 -0
- package/src/workbench/management/extension-management-filters.ts +38 -0
- package/src/workbench/management/index.ts +18 -3
- package/src/workbench/management/management.css +28 -0
- package/src/workbench/management/types.ts +23 -1
- package/src/workbench/management/useWorkbenchNotify.ts +10 -0
- package/src/workbench/{MarkdownPreview.tsx → markdown/MarkdownPreview.tsx} +22 -7
- package/src/workbench/markdown/markdownRemarkPlugins.ts +12 -0
- package/src/workbench/markdown/sanitizeMarkdownHref.ts +29 -0
- package/src/workbench/schema/workbenchDocumentRenderer.tsx +48 -121
- package/src/workbench/settings/StructuredDataForm.tsx +1 -4
- package/src/workbench/settings/StructuredDataSchemaPanel.tsx +39 -44
- package/src/workbench/settings/sectionedPanelScrollSpy.ts +0 -81
- package/src/workbench/settings/structuredDataFormModel.ts +2 -1
- package/src/workbench/settings/structuredDataSchema.ts +24 -13
- package/src/workbench/settings/structuredDataSchemaSection.ts +4 -0
- package/src/workbench/settings/structuredDataSchemaTable.ts +5 -2
- package/src/workbench/{ActivityBar.tsx → shell/ActivityBar.tsx} +8 -12
- package/src/workbench/{ArtifactShell.tsx → shell/ArtifactShell.tsx} +25 -25
- package/src/workbench/{SplitView.tsx → shell/SplitView.tsx} +3 -3
- package/src/workbench/{StatusBar.tsx → shell/StatusBar.tsx} +8 -8
- package/src/workbench/{StructuredArtifactEditor.tsx → shell/StructuredArtifactEditor.tsx} +9 -9
- package/src/workbench/{Timeline.tsx → shell/Timeline.tsx} +77 -20
- package/src/workbench/{WorkbenchCanvasShell.defaults.ts → shell/WorkbenchCanvasShell.defaults.ts} +1 -1
- package/src/workbench/{WorkbenchCanvasShell.model.ts → shell/WorkbenchCanvasShell.model.ts} +5 -5
- package/src/workbench/{WorkbenchCanvasShell.tsx → shell/WorkbenchCanvasShell.tsx} +6 -6
- package/src/workbench/{WorkbenchDesktopTitleBar.tsx → shell/WorkbenchDesktopTitleBar.tsx} +15 -15
- package/src/workbench/{WorkbenchShell.tsx → shell/WorkbenchShell.tsx} +45 -6
- package/src/workbench/{WorkbenchShellTitleBarLayoutControls.tsx → shell/WorkbenchShellTitleBarLayoutControls.tsx} +16 -19
- package/src/workbench/{WorkbenchStandaloneShell.tsx → shell/WorkbenchStandaloneShell.tsx} +15 -22
- package/src/workbench/{WorkbenchViewEditor.tsx → shell/WorkbenchViewEditor.tsx} +7 -7
- package/src/workbench/{WorkbenchViewSidebar.tsx → shell/WorkbenchViewSidebar.tsx} +7 -7
- package/src/workbench/{WorkbenchWindowChromeControls.tsx → shell/WorkbenchWindowChromeControls.tsx} +18 -15
- package/src/workbench/shell/activity-bar.css +47 -0
- package/src/workbench/{activityBarOrder.ts → shell/activityBarOrder.ts} +2 -1
- package/src/workbench/{shell.ts → shell/shell.ts} +20 -13
- package/src/workbench/{shellViewModel.ts → shell/shellViewModel.ts} +3 -3
- package/src/workbench/{standalone.ts → shell/standalone.ts} +14 -2
- package/src/workbench/{useDeferredWorkbenchMount.ts → shell/useDeferredWorkbenchMount.ts} +3 -3
- package/src/workbench/{useWorkbenchAppearanceDocumentSync.tsx → shell/useWorkbenchAppearanceDocumentSync.tsx} +1 -1
- package/src/workbench/{useWorkbenchSidebarActionBarDnd.ts → shell/useWorkbenchSidebarActionBarDnd.ts} +1 -1
- package/src/workbench/{useWorkbenchSidebarViewPlacementDropZone.ts → shell/useWorkbenchSidebarViewPlacementDropZone.ts} +2 -2
- package/src/workbench/{workbenchSidebarLayoutContext.ts → shell/workbenchSidebarLayoutContext.ts} +0 -6
- package/src/workbench/{workbenchViewRouteState.ts → shell/workbenchViewRouteState.ts} +4 -4
- package/src/workbench/{WorkbenchThemeProvider.tsx → theme/WorkbenchThemeProvider.tsx} +4 -4
- package/src/workbench/{theme.ts → theme/theme.ts} +1 -1
- package/src/workbench/{themePresets.ts → theme/themePresets.ts} +39 -64
- package/src/workbench/views/command-list-density.css +36 -0
- package/src/workbench/views/command-list.css +2 -0
- package/src/workbench/views/extensions-sidebar.css +2 -0
- package/src/workbench/views/view-hosts.css +3 -3
- package/src/workbench/workspace/WorkspaceEditorPanel.tsx +1 -1
- package/src/workbench/workspace/WorkspaceExplorer.tsx +105 -4
- package/src/workbench/workspace/createVirtualWorkspaceExplorerPort.ts +1 -14
- package/src/workbench/workspace/workspaceExplorerKeyboard.ts +109 -0
- package/src/workbench/workspace/workspaceJsonDiagnostics.ts +6 -5
- package/src/workbench-menu-surfaces.css +3 -57
- package/src/brand/TilepaperAppIcon.tsx +0 -181
- package/src/brand/index.ts +0 -2
- package/src/brand/tilepaper-app-icon-geometry.ts +0 -201
- package/src/primitives/absolute-box/index.ts +0 -1
- package/src/primitives/catalog-browse-card/index.ts +0 -1
- package/src/primitives/catalog-browse-pane/index.ts +0 -3
- package/src/primitives/catalog-filter-overlay/index.ts +0 -1
- package/src/primitives/codicon/index.ts +0 -1
- package/src/primitives/external-link-button/index.ts +0 -1
- package/src/primitives/library-detail-layout/index.ts +0 -1
- package/src/primitives/library-facet-filter-panel/index.ts +0 -1
- package/src/primitives/library-facet-filter-strip/index.ts +0 -1
- package/src/primitives/panel-loading/index.ts +0 -1
- package/src/primitives/scroll-area-infinite-load/index.ts +0 -2
- package/src/primitives/workbench-thumbnail/index.ts +0 -1
- package/src/test-utils/workbenchMonacoMock.tsx +0 -37
- package/src/workbench/jdw/jdw-editors.css +0 -4
- package/src/workbench/jdw/jdw.css +0 -2
- package/src/workbench/management/integration-command-action.ts +0 -25
- package/src/workbench/markdownRemarkPlugins.ts +0 -4
- package/src/workbench/workbench-chrome.css +0 -4
- /package/src/workbench/{WorkbenchPlatformContext.tsx → chrome/WorkbenchPlatformContext.tsx} +0 -0
- /package/src/workbench/{workbenchModalViewState.ts → chrome/workbenchModalViewState.ts} +0 -0
- /package/src/workbench/{workbenchOverlaysContext.tsx → chrome/workbenchOverlaysContext.tsx} +0 -0
- /package/src/workbench/{workbenchPlatformChrome.ts → chrome/workbenchPlatformChrome.ts} +0 -0
- /package/src/workbench/{command-execution-policy.ts → commands/command-execution-policy.ts} +0 -0
- /package/src/workbench/{keyboard.ts → commands/keyboard.ts} +0 -0
- /package/src/workbench/{workbenchContextMenu.ts → commands/workbenchContextMenu.ts} +0 -0
- /package/src/workbench/{appearanceLabels.ts → shell/appearanceLabels.ts} +0 -0
- /package/src/workbench/{hardReset.ts → shell/hardReset.ts} +0 -0
- /package/src/workbench/{shellPresets.ts → shell/shellPresets.ts} +0 -0
- /package/src/workbench/{shellState.ts → shell/shellState.ts} +0 -0
- /package/src/workbench/{sidebarViewPlacementDnd.ts → shell/sidebarViewPlacementDnd.ts} +0 -0
- /package/src/workbench/{status.ts → shell/status.ts} +0 -0
- /package/src/workbench/{useWorkbenchSidebarLayout.tsx → shell/useWorkbenchSidebarLayout.tsx} +0 -0
- /package/src/workbench/{useWorkbenchStandaloneShellStateSync.tsx → shell/useWorkbenchStandaloneShellStateSync.tsx} +0 -0
- /package/src/workbench/{workbenchStandaloneShellReactContext.tsx → shell/workbenchStandaloneShellReactContext.tsx} +0 -0
|
@@ -1,8 +1,18 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import type {
|
|
2
|
+
ComponentPropsWithRef,
|
|
3
|
+
KeyboardEvent as ReactKeyboardEvent,
|
|
4
|
+
MouseEvent as ReactMouseEvent,
|
|
5
|
+
ReactNode,
|
|
6
|
+
} from 'react';
|
|
7
|
+
import { EmptyState } from '../../primitives/empty-state';
|
|
8
|
+
import { cxCodicon } from '../../utils/codicon';
|
|
9
|
+
import { cx } from '../../utils/cx';
|
|
10
|
+
import {
|
|
11
|
+
getWorkbenchStatusLabel,
|
|
12
|
+
isWorkbenchStatusBusy,
|
|
13
|
+
isWorkbenchStatusDisabled,
|
|
14
|
+
type WorkbenchStatus,
|
|
15
|
+
} from './status';
|
|
6
16
|
|
|
7
17
|
export type WorkbenchTimelineEventKind =
|
|
8
18
|
'message' | 'operation-call' | 'operation-result' | 'file-write' | 'progress' | 'error';
|
|
@@ -11,16 +21,16 @@ export type WorkbenchTimelineMessageSource = 'assistant' | 'system' | 'user' | (
|
|
|
11
21
|
export type WorkbenchTimelineVariant = 'compact' | 'expanded';
|
|
12
22
|
|
|
13
23
|
export interface WorkbenchTimelineEvent {
|
|
14
|
-
content?: ReactNode
|
|
15
|
-
description?: ReactNode
|
|
24
|
+
content?: ReactNode;
|
|
25
|
+
description?: ReactNode;
|
|
16
26
|
id: string;
|
|
17
27
|
kind: WorkbenchTimelineEventKind;
|
|
18
|
-
metadata?: Record<string, unknown
|
|
28
|
+
metadata?: Record<string, unknown>;
|
|
19
29
|
payload?: unknown;
|
|
20
|
-
source?: WorkbenchTimelineMessageSource
|
|
21
|
-
status?: WorkbenchStatus
|
|
22
|
-
timestamp?: ReactNode
|
|
23
|
-
title?: ReactNode
|
|
30
|
+
source?: WorkbenchTimelineMessageSource;
|
|
31
|
+
status?: WorkbenchStatus;
|
|
32
|
+
timestamp?: ReactNode;
|
|
33
|
+
title?: ReactNode;
|
|
24
34
|
}
|
|
25
35
|
|
|
26
36
|
export interface WorkbenchTimelineRenderContext {
|
|
@@ -172,10 +182,53 @@ export interface WorkbenchTimelineItemProps extends Omit<
|
|
|
172
182
|
'children'
|
|
173
183
|
> {
|
|
174
184
|
event: WorkbenchTimelineEvent;
|
|
175
|
-
index?: number
|
|
176
|
-
renderMetadata?: WorkbenchTimelineRenderMetadata
|
|
177
|
-
renderPayload?: WorkbenchTimelineRenderPayload
|
|
178
|
-
variant?: WorkbenchTimelineVariant
|
|
185
|
+
index?: number;
|
|
186
|
+
renderMetadata?: WorkbenchTimelineRenderMetadata;
|
|
187
|
+
renderPayload?: WorkbenchTimelineRenderPayload;
|
|
188
|
+
variant?: WorkbenchTimelineVariant;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
type WorkbenchTimelineActivationEvent =
|
|
192
|
+
ReactKeyboardEvent<HTMLElement> | ReactMouseEvent<HTMLElement>;
|
|
193
|
+
|
|
194
|
+
const timelineInteractiveDescendantSelector =
|
|
195
|
+
'a[href],button,input,select,textarea,[contenteditable],[role="button"],[role="link"]';
|
|
196
|
+
|
|
197
|
+
function createTimelineActivationProps(
|
|
198
|
+
event: WorkbenchTimelineEvent,
|
|
199
|
+
onEventActivate: WorkbenchTimelineProps['onEventActivate'],
|
|
200
|
+
): Pick<
|
|
201
|
+
WorkbenchTimelineItemProps,
|
|
202
|
+
'aria-description' | 'aria-disabled' | 'aria-keyshortcuts' | 'onClick' | 'onKeyDown' | 'tabIndex'
|
|
203
|
+
> {
|
|
204
|
+
if (onEventActivate === undefined) return {};
|
|
205
|
+
if (isWorkbenchStatusDisabled(getWorkbenchTimelineEventStatus(event))) {
|
|
206
|
+
return { 'aria-disabled': true, tabIndex: -1 };
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
const activate = (activationEvent: WorkbenchTimelineActivationEvent) => {
|
|
210
|
+
const { currentTarget, target } = activationEvent;
|
|
211
|
+
const fromNestedControl =
|
|
212
|
+
target instanceof Element &&
|
|
213
|
+
target !== currentTarget &&
|
|
214
|
+
target.closest(timelineInteractiveDescendantSelector) !== null;
|
|
215
|
+
if (activationEvent.defaultPrevented || fromNestedControl) return;
|
|
216
|
+
|
|
217
|
+
if ('key' in activationEvent) {
|
|
218
|
+
if (activationEvent.key !== 'Enter' && activationEvent.key !== ' ') return;
|
|
219
|
+
activationEvent.preventDefault();
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
onEventActivate(event);
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
return {
|
|
226
|
+
'aria-description': 'Press Enter or Space to activate.',
|
|
227
|
+
'aria-keyshortcuts': 'Enter Space',
|
|
228
|
+
onClick: activate,
|
|
229
|
+
onKeyDown: activate,
|
|
230
|
+
tabIndex: 0,
|
|
231
|
+
};
|
|
179
232
|
}
|
|
180
233
|
|
|
181
234
|
export function WorkbenchTimelineItem({
|
|
@@ -245,17 +298,20 @@ export function WorkbenchTimelineItem({
|
|
|
245
298
|
}
|
|
246
299
|
|
|
247
300
|
export interface WorkbenchTimelineProps extends Omit<ComponentPropsWithRef<'div'>, 'children'> {
|
|
248
|
-
emptyLabel?: ReactNode
|
|
301
|
+
emptyLabel?: ReactNode;
|
|
249
302
|
events: readonly WorkbenchTimelineEvent[];
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
303
|
+
/** Activates an enabled event from pointer or Enter/Space input. */
|
|
304
|
+
onEventActivate?: (event: WorkbenchTimelineEvent) => void;
|
|
305
|
+
renderMetadata?: WorkbenchTimelineRenderMetadata;
|
|
306
|
+
renderPayload?: WorkbenchTimelineRenderPayload;
|
|
307
|
+
variant?: WorkbenchTimelineVariant;
|
|
253
308
|
}
|
|
254
309
|
|
|
255
310
|
export function WorkbenchTimeline({
|
|
256
311
|
className,
|
|
257
312
|
emptyLabel = 'No timeline events',
|
|
258
313
|
events,
|
|
314
|
+
onEventActivate,
|
|
259
315
|
renderMetadata,
|
|
260
316
|
renderPayload,
|
|
261
317
|
variant = 'expanded',
|
|
@@ -290,6 +346,7 @@ export function WorkbenchTimeline({
|
|
|
290
346
|
renderMetadata={renderMetadata}
|
|
291
347
|
renderPayload={renderPayload}
|
|
292
348
|
variant={variant}
|
|
349
|
+
{...createTimelineActivationProps(event, onEventActivate)}
|
|
293
350
|
/>
|
|
294
351
|
))}
|
|
295
352
|
</div>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { WorkbenchDocumentNode, WorkbenchNodeLayout } from '
|
|
1
|
+
import type { WorkbenchDocumentNode, WorkbenchNodeLayout } from '../schema';
|
|
2
2
|
|
|
3
3
|
export interface WorkbenchCanvasLayoutInput {
|
|
4
|
-
readonly height?: string
|
|
5
|
-
readonly width?: string
|
|
6
|
-
readonly x?: string
|
|
7
|
-
readonly y?: string
|
|
4
|
+
readonly height?: string;
|
|
5
|
+
readonly width?: string;
|
|
6
|
+
readonly x?: string;
|
|
7
|
+
readonly y?: string;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
export function getWorkbenchCanvasNodeChildren(node: WorkbenchDocumentNode): readonly string[] {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { type CSSProperties, type ReactElement, useEffect, useMemo, useState } from 'react';
|
|
2
2
|
import { createCommandRegistryFromContributions } from '@workbench-kit/platform';
|
|
3
3
|
import { integratedShellWorkspaceFiles } from '@workbench-kit/adapters';
|
|
4
|
-
import { Button } from '
|
|
5
|
-
import { TextArea } from '
|
|
6
|
-
import { TextInput } from '
|
|
7
|
-
import { SideBarViewFrame } from '
|
|
8
|
-
import { createWorkbenchShellCommands } from '
|
|
4
|
+
import { Button } from '../../primitives/button';
|
|
5
|
+
import { TextArea } from '../../primitives/text-area';
|
|
6
|
+
import { TextInput } from '../../primitives/text-input';
|
|
7
|
+
import { SideBarViewFrame } from '../../layout/sidebar';
|
|
8
|
+
import { createWorkbenchShellCommands } from '../commands/commands';
|
|
9
9
|
import { WorkbenchStandaloneShell } from './WorkbenchStandaloneShell';
|
|
10
10
|
import type { WorkbenchActivityDescriptor, WorkbenchStandaloneBootstrap } from './standalone';
|
|
11
11
|
import {
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
type WorkbenchDocumentPatchHistory,
|
|
20
20
|
type WorkbenchDocumentPatchHistoryState,
|
|
21
21
|
type WorkbenchDocumentPatchResult,
|
|
22
|
-
} from '
|
|
22
|
+
} from '../schema';
|
|
23
23
|
import {
|
|
24
24
|
DEFAULT_CANVAS_ACTIVITY_ID,
|
|
25
25
|
DEFAULT_CANVAS_THEME,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import '
|
|
1
|
+
import '../chrome/workbench-desktop-titlebar.css';
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
|
-
import { cx } from '
|
|
4
|
-
import { useWorkbenchHostPlatform } from '
|
|
3
|
+
import { cx } from '../../utils/cx';
|
|
4
|
+
import { useWorkbenchHostPlatform } from '../chrome/WorkbenchPlatformContext';
|
|
5
5
|
import {
|
|
6
6
|
shouldUseDarwinPlatformChrome,
|
|
7
7
|
WorkbenchWindowChromeControls,
|
|
@@ -9,19 +9,19 @@ import {
|
|
|
9
9
|
import {
|
|
10
10
|
resolveWorkbenchWindowChromeDataAttributes,
|
|
11
11
|
type WorkbenchWindowChromeMode,
|
|
12
|
-
} from '
|
|
12
|
+
} from '../chrome/workbenchPlatformChrome';
|
|
13
13
|
|
|
14
14
|
export interface WorkbenchDesktopWindowControlsProps {
|
|
15
15
|
/** Defaults to `platform` so standalone controls match `WorkbenchDesktopTitleBar`. */
|
|
16
|
-
chrome?: WorkbenchWindowChromeMode
|
|
17
|
-
closeLabel?: string
|
|
16
|
+
chrome?: WorkbenchWindowChromeMode;
|
|
17
|
+
closeLabel?: string;
|
|
18
18
|
isMaximized: boolean;
|
|
19
|
-
maximizeLabel?: string
|
|
20
|
-
minimizeLabel?: string
|
|
19
|
+
maximizeLabel?: string;
|
|
20
|
+
minimizeLabel?: string;
|
|
21
21
|
onClose: () => void;
|
|
22
22
|
onMinimize: () => void;
|
|
23
23
|
onToggleMaximized: () => void;
|
|
24
|
-
restoreLabel?: string
|
|
24
|
+
restoreLabel?: string;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
/**
|
|
@@ -59,20 +59,20 @@ export function WorkbenchDesktopWindowControls({
|
|
|
59
59
|
|
|
60
60
|
export interface WorkbenchDesktopTitleBarProps {
|
|
61
61
|
/** Optional center area, e.g. a command-menu trigger. Omit to leave it empty. */
|
|
62
|
-
centerSlot?: ReactNode
|
|
62
|
+
centerSlot?: ReactNode;
|
|
63
63
|
/**
|
|
64
64
|
* `platform` (default): darwin traffic lights / win32 caption buttons via host platform context.
|
|
65
65
|
* `generic`: maximize + close only (modal-like), no OS-specific placement.
|
|
66
66
|
*/
|
|
67
|
-
chrome?: WorkbenchWindowChromeMode
|
|
68
|
-
className?: string
|
|
69
|
-
leading?: ReactNode
|
|
70
|
-
trailing?: ReactNode
|
|
67
|
+
chrome?: WorkbenchWindowChromeMode;
|
|
68
|
+
className?: string;
|
|
69
|
+
leading?: ReactNode;
|
|
70
|
+
trailing?: ReactNode;
|
|
71
71
|
/**
|
|
72
72
|
* Host-supplied window actions (Electron IPC callbacks). Omit on platforms that keep a native frame.
|
|
73
73
|
* Kit owns chrome markup; the host owns minimize / maximize / close side effects only.
|
|
74
74
|
*/
|
|
75
|
-
windowControls?: WorkbenchDesktopWindowControlsProps
|
|
75
|
+
windowControls?: WorkbenchDesktopWindowControlsProps;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
/**
|
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
import { type CSSProperties, type ReactNode, useState } from 'react';
|
|
2
|
-
import '
|
|
3
|
-
import { cx } from '
|
|
2
|
+
import '../chrome/workbench-layout-regions.css';
|
|
3
|
+
import { cx } from '../../utils/cx';
|
|
4
4
|
import { ActivityBar, type ActivityBarProps, type ActivityBarItem } from './ActivityBar';
|
|
5
5
|
import { SplitView } from './SplitView';
|
|
6
6
|
import { StatusBar, type StatusBarItemModel, type StatusBarSectionModel } from './StatusBar';
|
|
7
7
|
import { DEFAULT_PRIMARY_SIDEBAR_SIZE_PX } from './shellState';
|
|
8
|
-
import { suppressNativeBrowserContextMenu } from '
|
|
9
|
-
import { WorkbenchOverlaysProvider } from '
|
|
8
|
+
import { suppressNativeBrowserContextMenu } from '../commands/workbenchContextMenu';
|
|
9
|
+
import { WorkbenchOverlaysProvider } from '../chrome/workbenchOverlaysContext';
|
|
10
|
+
|
|
11
|
+
const DEFAULT_BOTTOM_PANEL_SIZE_PERCENT = 30;
|
|
12
|
+
|
|
13
|
+
function clampBottomPanelSizePercent(value: number): number {
|
|
14
|
+
return Math.min(70, Math.max(10, value));
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function clampBottomPanelPrimarySizePercent(value: number): number {
|
|
18
|
+
return Math.min(90, Math.max(30, value));
|
|
19
|
+
}
|
|
10
20
|
|
|
11
21
|
export type WorkbenchShellActivityBarPosition = 'left' | 'top';
|
|
12
22
|
|
|
@@ -15,7 +25,7 @@ export interface WorkbenchShellProps {
|
|
|
15
25
|
items: ActivityBarItem[];
|
|
16
26
|
visible?: boolean;
|
|
17
27
|
};
|
|
18
|
-
activityBarPosition?: WorkbenchShellActivityBarPosition
|
|
28
|
+
activityBarPosition?: WorkbenchShellActivityBarPosition;
|
|
19
29
|
auxiliarySidebar?: {
|
|
20
30
|
isVisible: boolean;
|
|
21
31
|
node: ReactNode;
|
|
@@ -25,10 +35,18 @@ export interface WorkbenchShellProps {
|
|
|
25
35
|
bottomPanel?: {
|
|
26
36
|
isVisible: boolean;
|
|
27
37
|
node: ReactNode;
|
|
38
|
+
/**
|
|
39
|
+
* Panel track size as a percent of the vertical editor+panel split.
|
|
40
|
+
* When set with `onSizePercentChange`, the split is controlled.
|
|
41
|
+
*/
|
|
42
|
+
sizePercent?: number;
|
|
43
|
+
onSizePercentChange?: (sizePercent: number) => void;
|
|
28
44
|
className?: string;
|
|
29
45
|
style?: CSSProperties;
|
|
30
46
|
};
|
|
31
47
|
compactStatus?: boolean;
|
|
48
|
+
/** Accessible name for the status bar region (default “Status bar”). */
|
|
49
|
+
statusBarAriaLabel?: string;
|
|
32
50
|
onStatusItemActivate?: (item: StatusBarItemModel) => void;
|
|
33
51
|
primarySidebar?: {
|
|
34
52
|
isVisible: boolean;
|
|
@@ -58,6 +76,7 @@ export function WorkbenchShell({
|
|
|
58
76
|
auxiliarySidebar,
|
|
59
77
|
bottomPanel,
|
|
60
78
|
compactStatus = true,
|
|
79
|
+
statusBarAriaLabel,
|
|
61
80
|
onStatusItemActivate,
|
|
62
81
|
overlays,
|
|
63
82
|
primarySidebar,
|
|
@@ -85,17 +104,36 @@ export function WorkbenchShell({
|
|
|
85
104
|
const isBottomPanelCollapsed = bottomPanel !== undefined && !bottomPanel.isVisible;
|
|
86
105
|
const isAuxiliarySidebarCollapsed = auxiliarySidebar !== undefined && !auxiliarySidebar.isVisible;
|
|
87
106
|
|
|
107
|
+
const bottomPanelSizePercent =
|
|
108
|
+
bottomPanel?.onSizePercentChange !== undefined
|
|
109
|
+
? (bottomPanel.sizePercent ?? DEFAULT_BOTTOM_PANEL_SIZE_PERCENT)
|
|
110
|
+
: undefined;
|
|
111
|
+
const bottomPanelPrimarySizePercent =
|
|
112
|
+
bottomPanelSizePercent !== undefined
|
|
113
|
+
? clampBottomPanelPrimarySizePercent(100 - bottomPanelSizePercent)
|
|
114
|
+
: undefined;
|
|
115
|
+
|
|
88
116
|
const editorArea = bottomPanel ? (
|
|
89
117
|
<SplitView
|
|
90
118
|
className={cx(
|
|
91
119
|
bottomPanel.className,
|
|
92
120
|
isBottomPanelCollapsed && 'ui-workbench-split-view--secondary-collapsed',
|
|
93
121
|
)}
|
|
94
|
-
defaultPrimarySizePercent={
|
|
122
|
+
defaultPrimarySizePercent={100 - DEFAULT_BOTTOM_PANEL_SIZE_PERCENT}
|
|
95
123
|
maxPrimarySizePercent={90}
|
|
96
124
|
minPrimarySizePercent={30}
|
|
125
|
+
onPrimarySizePercentChange={
|
|
126
|
+
bottomPanel.onSizePercentChange
|
|
127
|
+
? (primarySizePercent) => {
|
|
128
|
+
bottomPanel.onSizePercentChange?.(
|
|
129
|
+
clampBottomPanelSizePercent(100 - primarySizePercent),
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
: undefined
|
|
133
|
+
}
|
|
97
134
|
orientation="vertical"
|
|
98
135
|
primary={secondaryArea}
|
|
136
|
+
primarySizePercent={bottomPanelPrimarySizePercent}
|
|
99
137
|
secondary={bottomPanel.node}
|
|
100
138
|
/>
|
|
101
139
|
) : (
|
|
@@ -178,6 +216,7 @@ export function WorkbenchShell({
|
|
|
178
216
|
{body}
|
|
179
217
|
</div>
|
|
180
218
|
<StatusBar
|
|
219
|
+
aria-label={statusBarAriaLabel}
|
|
181
220
|
compact={compactStatus}
|
|
182
221
|
sections={statusSections}
|
|
183
222
|
onItemActivate={onStatusItemActivate}
|
|
@@ -1,25 +1,22 @@
|
|
|
1
|
-
import '
|
|
1
|
+
import '../chrome/workbench-shell-titlebar.css';
|
|
2
2
|
import type { JSX } from 'react';
|
|
3
3
|
|
|
4
|
-
import { IconButton } from '
|
|
4
|
+
import { IconButton } from '../../primitives/icon-button';
|
|
5
|
+
import { cx } from '../../utils/cx';
|
|
5
6
|
|
|
6
7
|
export interface WorkbenchShellTitleBarLayoutControlsProps {
|
|
7
|
-
readonly isAuxiliarySidebarVisible?: boolean
|
|
8
|
-
readonly isPanelVisible?: boolean
|
|
8
|
+
readonly isAuxiliarySidebarVisible?: boolean;
|
|
9
|
+
readonly isPanelVisible?: boolean;
|
|
9
10
|
readonly isPrimarySidebarVisible: boolean;
|
|
10
|
-
readonly onToggleAuxiliarySidebar?: (
|
|
11
|
-
readonly onTogglePanel?: (
|
|
11
|
+
readonly onToggleAuxiliarySidebar?: () => void;
|
|
12
|
+
readonly onTogglePanel?: () => void;
|
|
12
13
|
readonly onTogglePrimarySidebar: () => void;
|
|
13
|
-
readonly panelHideLabel?: string
|
|
14
|
-
readonly panelShowLabel?: string
|
|
15
|
-
readonly primarySidebarHideLabel?: string
|
|
16
|
-
readonly primarySidebarShowLabel?: string
|
|
17
|
-
readonly secondarySidebarHideLabel?: string
|
|
18
|
-
readonly secondarySidebarShowLabel?: string
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function joinClasses(...classNames: Array<string | false | null | undefined>): string {
|
|
22
|
-
return classNames.filter(Boolean).join(' ');
|
|
14
|
+
readonly panelHideLabel?: string;
|
|
15
|
+
readonly panelShowLabel?: string;
|
|
16
|
+
readonly primarySidebarHideLabel?: string;
|
|
17
|
+
readonly primarySidebarShowLabel?: string;
|
|
18
|
+
readonly secondarySidebarHideLabel?: string;
|
|
19
|
+
readonly secondarySidebarShowLabel?: string;
|
|
23
20
|
}
|
|
24
21
|
|
|
25
22
|
export function WorkbenchShellTitleBarLayoutControls({
|
|
@@ -40,7 +37,7 @@ export function WorkbenchShellTitleBarLayoutControls({
|
|
|
40
37
|
<div className="workbench-shell-titlebar__layout-controls">
|
|
41
38
|
<IconButton
|
|
42
39
|
aria-pressed={isPrimarySidebarVisible}
|
|
43
|
-
className={
|
|
40
|
+
className={cx(
|
|
44
41
|
'workbench-shell-titlebar__layout-control',
|
|
45
42
|
isPrimarySidebarVisible && 'workbench-shell-titlebar__layout-control--active',
|
|
46
43
|
)}
|
|
@@ -52,7 +49,7 @@ export function WorkbenchShellTitleBarLayoutControls({
|
|
|
52
49
|
{onTogglePanel ? (
|
|
53
50
|
<IconButton
|
|
54
51
|
aria-pressed={isPanelVisible}
|
|
55
|
-
className={
|
|
52
|
+
className={cx(
|
|
56
53
|
'workbench-shell-titlebar__layout-control',
|
|
57
54
|
isPanelVisible && 'workbench-shell-titlebar__layout-control--active',
|
|
58
55
|
)}
|
|
@@ -65,7 +62,7 @@ export function WorkbenchShellTitleBarLayoutControls({
|
|
|
65
62
|
{onToggleAuxiliarySidebar ? (
|
|
66
63
|
<IconButton
|
|
67
64
|
aria-pressed={isAuxiliarySidebarVisible}
|
|
68
|
-
className={
|
|
65
|
+
className={cx(
|
|
69
66
|
'workbench-shell-titlebar__layout-control',
|
|
70
67
|
isAuxiliarySidebarVisible && 'workbench-shell-titlebar__layout-control--active',
|
|
71
68
|
)}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { useMemo, useRef } from 'react';
|
|
2
|
-
import { useResolvedWorkbenchTheme } from '
|
|
2
|
+
import { useResolvedWorkbenchTheme } from '../theme/theme';
|
|
3
3
|
import type { CSSProperties, MouseEvent, ReactNode } from 'react';
|
|
4
4
|
import { useWorkbenchStandaloneShellStateSync } from './useWorkbenchStandaloneShellStateSync';
|
|
5
5
|
import {
|
|
6
6
|
WorkbenchStandaloneShellReactContextProvider,
|
|
7
7
|
type WorkbenchStandaloneShellStateChange,
|
|
8
8
|
} from './workbenchStandaloneShellReactContext';
|
|
9
|
-
import { cxCodicon } from '
|
|
9
|
+
import { cxCodicon } from '../../utils/codicon';
|
|
10
10
|
import type { StatusBarItemModel, StatusBarSectionModel } from './StatusBar';
|
|
11
11
|
import type { WorkbenchShellProps } from './WorkbenchShell';
|
|
12
12
|
import { WorkbenchShell } from './WorkbenchShell';
|
|
13
|
-
import type { WorkbenchShellCommandContext } from '
|
|
13
|
+
import type { WorkbenchShellCommandContext } from '../commands/commands';
|
|
14
14
|
import { DEFAULT_PRIMARY_SIDEBAR_SIZE_PX, useWorkbenchShellState } from './shellState';
|
|
15
15
|
import type {
|
|
16
16
|
WorkbenchActivityChangeEvent,
|
|
@@ -19,7 +19,7 @@ import type {
|
|
|
19
19
|
WorkbenchStandaloneBootstrapEvent,
|
|
20
20
|
WorkbenchTheme,
|
|
21
21
|
} from './standalone';
|
|
22
|
-
import { WorkspaceDraftsProvider } from '
|
|
22
|
+
import { WorkspaceDraftsProvider } from '../workspace/WorkspaceDraftsContext';
|
|
23
23
|
|
|
24
24
|
const DEFAULT_THEME: WorkbenchTheme = 'dark';
|
|
25
25
|
const DEFAULT_ACTIVITY_ID = 'explorer';
|
|
@@ -391,6 +391,15 @@ export function WorkbenchStandaloneShell<
|
|
|
391
391
|
}),
|
|
392
392
|
);
|
|
393
393
|
};
|
|
394
|
+
const togglePrimarySidebar = () => {
|
|
395
|
+
const nextSidebarVisible = !isPrimarySidebarVisible;
|
|
396
|
+
setPrimarySidebarLifecycle(
|
|
397
|
+
activeActivityId,
|
|
398
|
+
nextSidebarVisible,
|
|
399
|
+
nextSidebarVisible ? 'sidebar-show' : 'sidebar-hide',
|
|
400
|
+
);
|
|
401
|
+
shell.togglePrimarySidebar();
|
|
402
|
+
};
|
|
394
403
|
const createContext = ({
|
|
395
404
|
activityId,
|
|
396
405
|
shell,
|
|
@@ -403,15 +412,7 @@ export function WorkbenchStandaloneShell<
|
|
|
403
412
|
isPrimarySidebarVisible,
|
|
404
413
|
openSettings: shell.openSettings,
|
|
405
414
|
showActivity,
|
|
406
|
-
togglePrimarySidebar
|
|
407
|
-
const nextSidebarVisible = !isPrimarySidebarVisible;
|
|
408
|
-
setPrimarySidebarLifecycle(
|
|
409
|
-
activeActivityId,
|
|
410
|
-
nextSidebarVisible,
|
|
411
|
-
nextSidebarVisible ? 'sidebar-show' : 'sidebar-hide',
|
|
412
|
-
);
|
|
413
|
-
shell.togglePrimarySidebar();
|
|
414
|
-
},
|
|
415
|
+
togglePrimarySidebar,
|
|
415
416
|
},
|
|
416
417
|
isPrimarySidebarVisible,
|
|
417
418
|
isSettingsOpen,
|
|
@@ -430,15 +431,7 @@ export function WorkbenchStandaloneShell<
|
|
|
430
431
|
);
|
|
431
432
|
shell.setPrimarySidebarVisible(isVisible);
|
|
432
433
|
},
|
|
433
|
-
togglePrimarySidebar
|
|
434
|
-
const nextSidebarVisible = !isPrimarySidebarVisible;
|
|
435
|
-
setPrimarySidebarLifecycle(
|
|
436
|
-
activeActivityId,
|
|
437
|
-
nextSidebarVisible,
|
|
438
|
-
nextSidebarVisible ? 'sidebar-show' : 'sidebar-hide',
|
|
439
|
-
);
|
|
440
|
-
shell.togglePrimarySidebar();
|
|
441
|
-
},
|
|
434
|
+
togglePrimarySidebar,
|
|
442
435
|
openSettings: shell.openSettings,
|
|
443
436
|
closeSettings: shell.closeSettings,
|
|
444
437
|
setSettingsCategoryId: shell.setSettingsCategoryId,
|
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
type WorkbenchEditorBodyProps,
|
|
8
8
|
type WorkbenchEditorFrameProps,
|
|
9
9
|
type WorkbenchPanelSurfaceProps,
|
|
10
|
-
} from '
|
|
11
|
-
import { EmptyState, type EmptyStateProps } from '
|
|
10
|
+
} from '../../layout/WorkbenchLayoutBase';
|
|
11
|
+
import { EmptyState, type EmptyStateProps } from '../../primitives/empty-state';
|
|
12
12
|
|
|
13
13
|
export type WorkbenchViewEditorDataAttributes = {
|
|
14
14
|
readonly [key: `data-${string}`]: boolean | number | string | undefined;
|
|
@@ -26,15 +26,15 @@ export type WorkbenchViewEditorEmptyStateSurfaceProps = Omit<
|
|
|
26
26
|
export interface WorkbenchViewEditorEmptyState {
|
|
27
27
|
readonly children: ReactNode;
|
|
28
28
|
readonly icon: EmptyStateProps['icon'];
|
|
29
|
-
readonly props?: WorkbenchViewEditorEmptyStateProps
|
|
30
|
-
readonly surfaceProps?: WorkbenchViewEditorEmptyStateSurfaceProps
|
|
29
|
+
readonly props?: WorkbenchViewEditorEmptyStateProps;
|
|
30
|
+
readonly surfaceProps?: WorkbenchViewEditorEmptyStateSurfaceProps;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
export interface WorkbenchViewEditorProps extends Omit<WorkbenchEditorFrameProps, 'children'> {
|
|
34
|
-
readonly bodyProps?: Omit<WorkbenchEditorBodyProps, 'children'
|
|
34
|
+
readonly bodyProps?: Omit<WorkbenchEditorBodyProps, 'children'>;
|
|
35
35
|
readonly children?: ReactNode;
|
|
36
|
-
readonly emptyState?: WorkbenchViewEditorEmptyState
|
|
37
|
-
readonly tabs?: ReactNode
|
|
36
|
+
readonly emptyState?: WorkbenchViewEditorEmptyState;
|
|
37
|
+
readonly tabs?: ReactNode;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
export function WorkbenchViewEditor({
|
|
@@ -6,15 +6,15 @@ import {
|
|
|
6
6
|
SideBarViewFrame,
|
|
7
7
|
type SideBarListProps,
|
|
8
8
|
type SideBarViewFrameProps,
|
|
9
|
-
} from '
|
|
10
|
-
import { cx } from '
|
|
9
|
+
} from '../../layout/sidebar';
|
|
10
|
+
import { cx } from '../../utils/cx';
|
|
11
11
|
|
|
12
12
|
export interface WorkbenchViewSidebarItem<TViewId extends string, TIcon = unknown> {
|
|
13
|
-
readonly disabled?: boolean
|
|
13
|
+
readonly disabled?: boolean;
|
|
14
14
|
readonly icon: TIcon;
|
|
15
15
|
readonly id: TViewId;
|
|
16
16
|
readonly label: string;
|
|
17
|
-
readonly title?: string
|
|
17
|
+
readonly title?: string;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
export interface WorkbenchViewSidebarProps<TViewId extends string, TIcon = unknown> extends Omit<
|
|
@@ -22,10 +22,10 @@ export interface WorkbenchViewSidebarProps<TViewId extends string, TIcon = unkno
|
|
|
22
22
|
'children' | 'onSelect'
|
|
23
23
|
> {
|
|
24
24
|
readonly [key: `data-${string}`]: boolean | number | string | undefined;
|
|
25
|
-
readonly activeId?: TViewId
|
|
26
|
-
readonly itemDataAttributeName?: string
|
|
25
|
+
readonly activeId?: TViewId;
|
|
26
|
+
readonly itemDataAttributeName?: string;
|
|
27
27
|
readonly items: ReadonlyArray<WorkbenchViewSidebarItem<TViewId, TIcon>>;
|
|
28
|
-
readonly listProps?: Omit<SideBarListProps, 'children'
|
|
28
|
+
readonly listProps?: Omit<SideBarListProps, 'children'>;
|
|
29
29
|
readonly onSelect?:
|
|
30
30
|
((viewId: TViewId, item: WorkbenchViewSidebarItem<TViewId, TIcon>) => void) | undefined;
|
|
31
31
|
readonly renderIcon: (icon: TIcon, item: WorkbenchViewSidebarItem<TViewId, TIcon>) => ReactNode;
|
package/src/workbench/{WorkbenchWindowChromeControls.tsx → shell/WorkbenchWindowChromeControls.tsx}
RENAMED
|
@@ -1,21 +1,24 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
|
|
3
|
-
import { cx } from '
|
|
4
|
-
import { useWorkbenchHostPlatform } from '
|
|
5
|
-
import type {
|
|
3
|
+
import { cx } from '../../utils/cx';
|
|
4
|
+
import { useWorkbenchHostPlatform } from '../chrome/WorkbenchPlatformContext';
|
|
5
|
+
import type {
|
|
6
|
+
WorkbenchHostPlatform,
|
|
7
|
+
WorkbenchWindowChromeMode,
|
|
8
|
+
} from '../chrome/workbenchPlatformChrome';
|
|
6
9
|
|
|
7
10
|
export interface WorkbenchWindowChromeControlsProps {
|
|
8
|
-
chrome?: WorkbenchWindowChromeMode
|
|
9
|
-
closeLabel?: string
|
|
10
|
-
isMaximized?: boolean
|
|
11
|
-
maximizeLabel?: string
|
|
12
|
-
minimizeLabel?: string
|
|
11
|
+
chrome?: WorkbenchWindowChromeMode;
|
|
12
|
+
closeLabel?: string;
|
|
13
|
+
isMaximized?: boolean;
|
|
14
|
+
maximizeLabel?: string;
|
|
15
|
+
minimizeLabel?: string;
|
|
13
16
|
onClose: () => void;
|
|
14
|
-
onMinimize?: (
|
|
15
|
-
onToggleMaximized?: (
|
|
16
|
-
restoreLabel?: string
|
|
17
|
-
showMaximize?: boolean
|
|
18
|
-
showMinimize?: boolean
|
|
17
|
+
onMinimize?: () => void;
|
|
18
|
+
onToggleMaximized?: () => void;
|
|
19
|
+
restoreLabel?: string;
|
|
20
|
+
showMaximize?: boolean;
|
|
21
|
+
showMinimize?: boolean;
|
|
19
22
|
surface: 'desktop-titlebar' | 'modal';
|
|
20
23
|
}
|
|
21
24
|
|
|
@@ -88,8 +91,8 @@ interface SharedControlProps {
|
|
|
88
91
|
maximizeLabel: string;
|
|
89
92
|
minimizeLabel: string;
|
|
90
93
|
onClose: () => void;
|
|
91
|
-
onMinimize?: (
|
|
92
|
-
onToggleMaximized?: (
|
|
94
|
+
onMinimize?: () => void;
|
|
95
|
+
onToggleMaximized?: () => void;
|
|
93
96
|
restoreLabel: string;
|
|
94
97
|
showMaximize: boolean;
|
|
95
98
|
showMinimize: boolean;
|