@workbench-kit/react 0.0.2-prototype.0.2.25 → 0.0.2-prototype.0.2.27

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.
Files changed (53) hide show
  1. package/README.md +61 -14
  2. package/package.json +21 -11
  3. package/src/index.ts +2 -2
  4. package/src/jdw/fixtures/jdw-fixtures.ts +0 -15
  5. package/src/overlay/ContextMenu.tsx +4 -16
  6. package/src/overlay/context-menu-density.css +22 -0
  7. package/src/overlay/context-menu-item.ts +17 -0
  8. package/src/overlay/context-menu.css +2 -0
  9. package/src/primitives/app-icon/AppIcon.tsx +33 -0
  10. package/src/primitives/app-icon/app-icon.css +28 -0
  11. package/src/primitives/catalog-browse-pane/CatalogBrowsePane.tsx +24 -17
  12. package/src/primitives/catalog-browse-pane/catalog-browse-pane.css +4 -0
  13. package/src/primitives/index.ts +2 -0
  14. package/src/primitives/primitives.css +1 -0
  15. package/src/scrollbars.css +2 -6
  16. package/src/styles/core.css +16 -0
  17. package/src/styles/foundation.css +4 -0
  18. package/src/styles/overlay.css +2 -0
  19. package/src/styles.css +0 -1
  20. package/src/widget-tree/WidgetSourceEditor.tsx +0 -14
  21. package/src/widget-tree/WidgetTreeCanvasPreview.tsx +2 -6
  22. package/src/widget-tree/WidgetTreeLab.tsx +2 -23
  23. package/src/workbench/auth/WorkbenchLoginView.tsx +1 -2
  24. package/src/workbench/auth/auth-flows.css +14 -0
  25. package/src/workbench/chrome/workbench-layout-regions.css +13 -0
  26. package/src/workbench/chrome/workbench-shell-titlebar.css +0 -8
  27. package/src/workbench/commands/CommandList.tsx +1 -0
  28. package/src/workbench/commands/commands.ts +28 -0
  29. package/src/workbench/index.ts +1 -0
  30. package/src/workbench/management/WorkbenchNotice.tsx +19 -11
  31. package/src/workbench/settings/StructuredDataSchemaPanel.tsx +21 -40
  32. package/src/workbench/settings/sectionedPanelScrollSpy.ts +0 -81
  33. package/src/workbench/shell/workbenchSidebarLayoutContext.ts +0 -6
  34. package/src/workbench/views/command-list-density.css +36 -0
  35. package/src/workbench/views/command-list.css +2 -0
  36. package/src/workbench/workspace/WorkspaceExplorer.tsx +1 -1
  37. package/src/workbench/workspace/createVirtualWorkspaceExplorerPort.ts +1 -14
  38. package/src/workbench-menu-surfaces.css +3 -57
  39. package/src/brand/TilepaperAppIcon.tsx +0 -181
  40. package/src/brand/index.ts +0 -2
  41. package/src/brand/tilepaper-app-icon-geometry.ts +0 -201
  42. package/src/primitives/absolute-box/index.ts +0 -1
  43. package/src/primitives/catalog-browse-card/index.ts +0 -1
  44. package/src/primitives/catalog-browse-pane/index.ts +0 -3
  45. package/src/primitives/catalog-filter-overlay/index.ts +0 -1
  46. package/src/primitives/codicon/index.ts +0 -1
  47. package/src/primitives/external-link-button/index.ts +0 -1
  48. package/src/primitives/library-detail-layout/index.ts +0 -6
  49. package/src/primitives/library-facet-filter-panel/index.ts +0 -1
  50. package/src/primitives/library-facet-filter-strip/index.ts +0 -1
  51. package/src/primitives/panel-loading/index.ts +0 -1
  52. package/src/primitives/scroll-area-infinite-load/index.ts +0 -2
  53. package/src/primitives/workbench-thumbnail/index.ts +0 -1
@@ -1,3 +1,4 @@
1
+ import '../views/command-list.css';
1
2
  import { useEffect, useId, useRef, type ComponentPropsWithRef, type ReactNode } from 'react';
2
3
  import { Button } from '../../primitives/button';
3
4
  import { EmptyState } from '../../primitives/empty-state';
@@ -13,6 +13,7 @@ import {
13
13
  import type { ContextMenuItem } from '../../overlay/ContextMenu';
14
14
 
15
15
  export const WORKBENCH_OPEN_SETTINGS_COMMAND_ID = 'workbench.openSettings';
16
+ export const WORKBENCH_TOGGLE_FOCUS_MODE_COMMAND_ID = 'workbench.toggleFocusMode';
16
17
  export const WORKBENCH_TOGGLE_PRIMARY_SIDEBAR_COMMAND_ID = 'workbench.togglePrimarySidebar';
17
18
  export const WORKBENCH_EDITOR_SAVE_COMMAND_ID = 'editor.save';
18
19
  export const WORKBENCH_EDITOR_DISCARD_CHANGES_COMMAND_ID = 'editor.discardChanges';
@@ -54,9 +55,11 @@ export interface WorkbenchShellCommandActivity<TActivityId extends string = stri
54
55
  }
55
56
 
56
57
  export interface WorkbenchShellCommandContext<TActivityId extends string = string> {
58
+ isFocusModeActive?: boolean | undefined;
57
59
  isPrimarySidebarVisible: boolean;
58
60
  openSettings: () => void;
59
61
  showActivity: (activityId: TActivityId) => void;
62
+ toggleFocusMode?: (() => void) | undefined;
60
63
  togglePrimarySidebar: () => void;
61
64
  }
62
65
 
@@ -96,6 +99,7 @@ function applyWorkbenchCommandOverrides<TContext>(
96
99
 
97
100
  export interface WorkbenchShellCommandPresetOptions<TActivityId extends string = string> {
98
101
  activities: WorkbenchShellCommandActivity<TActivityId>[];
102
+ includeFocusModeToggle?: boolean | undefined;
99
103
  includeSettings?: boolean | undefined;
100
104
  includeSidebarToggle?: boolean | undefined;
101
105
  menuSeparatorId?: string | undefined;
@@ -159,6 +163,7 @@ export function getWorkbenchShowActivityCommandId(activityId: string) {
159
163
 
160
164
  export function createWorkbenchShellCommands<TActivityId extends string>({
161
165
  activities,
166
+ includeFocusModeToggle = true,
162
167
  includeSettings = true,
163
168
  includeSidebarToggle = true,
164
169
  settingsIcon = 'codicon-settings-gear',
@@ -179,6 +184,19 @@ export function createWorkbenchShellCommands<TActivityId extends string>({
179
184
 
180
185
  const shellCommands: CommandDefinition<WorkbenchShellCommandContext<TActivityId>>[] = [];
181
186
 
187
+ if (includeFocusModeToggle) {
188
+ shellCommands.push({
189
+ id: WORKBENCH_TOGGLE_FOCUS_MODE_COMMAND_ID,
190
+ icon: 'codicon-screen-full',
191
+ isEnabled: ({ toggleFocusMode }) => toggleFocusMode !== undefined,
192
+ label: ({ isFocusModeActive }) =>
193
+ isFocusModeActive ? 'Exit Focus Mode' : 'Enter Focus Mode',
194
+ run: ({ toggleFocusMode }) => toggleFocusMode?.(),
195
+ shortcut: 'Ctrl/Cmd+Shift+F11',
196
+ title: 'Toggle Focus Mode',
197
+ });
198
+ }
199
+
182
200
  if (includeSidebarToggle) {
183
201
  shellCommands.push({
184
202
  id: WORKBENCH_TOGGLE_PRIMARY_SIDEBAR_COMMAND_ID,
@@ -207,6 +225,7 @@ export function createWorkbenchShellCommands<TActivityId extends string>({
207
225
 
208
226
  export function createWorkbenchShellMenuEntries<TActivityId extends string>({
209
227
  activities,
228
+ includeFocusModeToggle = true,
210
229
  includeSettings = true,
211
230
  includeSidebarToggle = true,
212
231
  menuSeparatorId = 'workbench-shell-separator',
@@ -223,6 +242,15 @@ export function createWorkbenchShellMenuEntries<TActivityId extends string>({
223
242
  );
224
243
  const shellEntries: CommandMenuEntry<WorkbenchShellCommandContext<TActivityId>>[] = [];
225
244
 
245
+ if (includeFocusModeToggle) {
246
+ shellEntries.push(
247
+ commandMenuEntry<WorkbenchShellCommandContext<TActivityId>>(
248
+ WORKBENCH_TOGGLE_FOCUS_MODE_COMMAND_ID,
249
+ { surfaces: [WORKBENCH_COMMAND_SURFACE_ACTIVITY_BAR] },
250
+ ),
251
+ );
252
+ }
253
+
226
254
  if (includeSidebarToggle) {
227
255
  shellEntries.push(
228
256
  commandMenuEntry<WorkbenchShellCommandContext<TActivityId>>(
@@ -311,6 +311,7 @@ export {
311
311
  WORKBENCH_COMMAND_SURFACE_SETTINGS,
312
312
  WORKBENCH_COMMAND_SURFACE_WORKSPACE,
313
313
  WORKBENCH_OPEN_SETTINGS_COMMAND_ID,
314
+ WORKBENCH_TOGGLE_FOCUS_MODE_COMMAND_ID,
314
315
  WORKBENCH_SEARCH_COPY_RESULT_PATH_COMMAND_ID,
315
316
  WORKBENCH_SEARCH_DELETE_RESULT_COMMAND_ID,
316
317
  WORKBENCH_SEARCH_OPEN_RESULT_COMMAND_ID,
@@ -9,7 +9,6 @@ import {
9
9
  type ReactNode,
10
10
  } from 'react';
11
11
  import { IconButton, WorkbenchBanner, WorkbenchBannerMessage } from '../../primitives/index';
12
- import { cx } from '../../utils/cx';
13
12
 
14
13
  export type WorkbenchNoticeTone = 'error' | 'info' | 'success' | 'warning';
15
14
  export type WorkbenchNoticePosition = 'bottom-center' | 'bottom-right';
@@ -150,16 +149,16 @@ export function WorkbenchNoticeViewport({
150
149
 
151
150
  return (
152
151
  <div
153
- aria-live="polite"
154
- className={resolveNoticeViewportClassName(position)}
152
+ className="ui-workbench-notice-viewport"
155
153
  data-position={position}
154
+ style={resolveNoticeViewportStyle(position)}
156
155
  {...(dataAttributes ?? {})}
157
156
  >
158
157
  {visibleNotices.map((notice) => (
159
158
  <WorkbenchBanner
160
- className="pointer-events-auto"
161
159
  data-tone={notice.tone}
162
160
  key={notice.id}
161
+ role={notice.tone === 'error' ? 'alert' : 'status'}
163
162
  style={resolveNoticeBannerStyle(notice.tone)}
164
163
  tone={notice.tone === 'warning' ? 'warning' : 'default'}
165
164
  {...(notice.dataAttributes ?? {})}
@@ -187,13 +186,6 @@ export function useWorkbenchNotice(): WorkbenchNoticeController {
187
186
  return controller;
188
187
  }
189
188
 
190
- function resolveNoticeViewportClassName(position: WorkbenchNoticePosition): string {
191
- return cx(
192
- 'pointer-events-none fixed inset-x-0 bottom-4 z-50 flex flex-col gap-2 px-4',
193
- position === 'bottom-center' ? 'items-center' : 'items-end',
194
- );
195
- }
196
-
197
189
  function resolveNoticeBannerStyle(tone: WorkbenchNoticeTone): CSSProperties {
198
190
  return {
199
191
  borderColor:
@@ -204,5 +196,21 @@ function resolveNoticeBannerStyle(tone: WorkbenchNoticeTone): CSSProperties {
204
196
  : undefined,
205
197
  maxWidth: 'min(520px, calc(100vw - 32px))',
206
198
  minWidth: 'min(420px, calc(100vw - 32px))',
199
+ pointerEvents: 'auto',
200
+ };
201
+ }
202
+
203
+ function resolveNoticeViewportStyle(position: WorkbenchNoticePosition): CSSProperties {
204
+ return {
205
+ alignItems: position === 'bottom-center' ? 'center' : 'flex-end',
206
+ bottom: 16,
207
+ display: 'flex',
208
+ flexDirection: 'column',
209
+ gap: 8,
210
+ insetInline: 0,
211
+ paddingInline: 16,
212
+ pointerEvents: 'none',
213
+ position: 'fixed',
214
+ zIndex: 50,
207
215
  };
208
216
  }
@@ -98,6 +98,24 @@ interface WorkbenchStructuredDataSchemaSectionView {
98
98
  value: unknown;
99
99
  }
100
100
 
101
+ interface SchemaSectionRenderOptions {
102
+ classNames?: WorkbenchStructuredDataSchemaPanelClassNames | undefined;
103
+ fieldErrors?: Record<string, ReactNode> | undefined;
104
+ getFieldErrorId?: ((dataPath: string) => string | undefined) | undefined;
105
+ labels?: WorkbenchStructuredDataSchemaPanelLabels | undefined;
106
+ localErrorKeys?: ReadonlySet<string> | undefined;
107
+ onDataValueChange: (path: string[], value: unknown) => void;
108
+ onValidateField?: (
109
+ dataPath: string,
110
+ definition: WorkbenchStructuredDataSchemaFieldDefinition | undefined,
111
+ value: unknown,
112
+ ) => void;
113
+ readOnly: boolean;
114
+ }
115
+
116
+ type SchemaSectionRenderProps = WorkbenchStructuredDataSchemaSectionView &
117
+ SchemaSectionRenderOptions;
118
+
101
119
  const defaultSchemaPanelClassNames: Required<WorkbenchStructuredDataSchemaPanelClassNames> = {
102
120
  checkbox: 'ui-workbench-structured-data-schema-panel__checkbox',
103
121
  empty: 'ui-workbench-structured-data-schema-panel__empty',
@@ -245,20 +263,7 @@ function renderSchemaFormSection({
245
263
  schema,
246
264
  section,
247
265
  value,
248
- }: WorkbenchStructuredDataSchemaSectionView & {
249
- classNames?: WorkbenchStructuredDataSchemaPanelClassNames | undefined;
250
- fieldErrors?: Record<string, ReactNode> | undefined;
251
- getFieldErrorId?: ((dataPath: string) => string | undefined) | undefined;
252
- labels?: WorkbenchStructuredDataSchemaPanelLabels | undefined;
253
- localErrorKeys?: ReadonlySet<string> | undefined;
254
- onDataValueChange: (path: string[], value: unknown) => void;
255
- onValidateField?: (
256
- dataPath: string,
257
- definition: WorkbenchStructuredDataSchemaFieldDefinition | undefined,
258
- value: unknown,
259
- ) => void;
260
- readOnly: boolean;
261
- }) {
266
+ }: SchemaSectionRenderProps) {
262
267
  const fields = section.fields ?? [];
263
268
  if (fields.length) {
264
269
  return (
@@ -379,20 +384,8 @@ function renderSchemaTableSection({
379
384
  section,
380
385
  value,
381
386
  ...sectionView
382
- }: WorkbenchStructuredDataSchemaSectionView & {
383
- classNames?: WorkbenchStructuredDataSchemaPanelClassNames | undefined;
384
- fieldErrors?: Record<string, ReactNode> | undefined;
385
- getFieldErrorId?: ((dataPath: string) => string | undefined) | undefined;
386
- labels?: WorkbenchStructuredDataSchemaPanelLabels | undefined;
387
- localErrorKeys?: ReadonlySet<string> | undefined;
388
- onDataValueChange: (path: string[], value: unknown) => void;
389
- onValidateField?: (
390
- dataPath: string,
391
- definition: WorkbenchStructuredDataSchemaFieldDefinition | undefined,
392
- value: unknown,
393
- ) => void;
387
+ }: SchemaSectionRenderProps & {
394
388
  preferredTableColumns?: readonly string[] | undefined;
395
- readOnly: boolean;
396
389
  }) {
397
390
  const rows = getWorkbenchStructuredDataSchemaTableRows(value);
398
391
  const columns = getWorkbenchStructuredDataSchemaDocumentTableColumns({
@@ -569,22 +562,10 @@ function renderSchemaPanelSection({
569
562
  preferredTableColumns,
570
563
  readOnly,
571
564
  sectionView,
572
- }: {
565
+ }: SchemaSectionRenderOptions & {
573
566
  anchorId?: string | undefined;
574
- classNames?: WorkbenchStructuredDataSchemaPanelClassNames | undefined;
575
- fieldErrors?: Record<string, ReactNode> | undefined;
576
- getFieldErrorId?: ((dataPath: string) => string | undefined) | undefined;
577
567
  headerActions?: ReactNode | undefined;
578
- labels?: WorkbenchStructuredDataSchemaPanelLabels | undefined;
579
- localErrorKeys?: ReadonlySet<string> | undefined;
580
- onDataValueChange: (path: string[], value: unknown) => void;
581
- onValidateField?: (
582
- dataPath: string,
583
- definition: WorkbenchStructuredDataSchemaFieldDefinition | undefined,
584
- value: unknown,
585
- ) => void;
586
568
  preferredTableColumns?: readonly string[] | undefined;
587
- readOnly: boolean;
588
569
  sectionView: WorkbenchStructuredDataSchemaSectionView;
589
570
  }) {
590
571
  const { section, value } = sectionView;
@@ -30,12 +30,6 @@ export const WORKBENCH_SECTIONED_PANEL_INTERSECTION_THRESHOLDS = [0, 0.25, 0.5,
30
30
 
31
31
  export type WorkbenchSectionedPanelScrollSpyAxis = 'vertical' | 'horizontal';
32
32
 
33
- export interface WorkbenchSectionedPanelIntersectionEntry {
34
- intersectionRatio: number;
35
- isIntersecting: boolean;
36
- target: { id: string };
37
- }
38
-
39
33
  export interface WorkbenchSectionedPanelScrollPosition {
40
34
  anchorId: string;
41
35
  /** Section start along the active scroll axis (top or left). */
@@ -108,70 +102,6 @@ export function isWorkbenchSectionedPanelAtScrollEnd({
108
102
  return scrollPosition + clientSize >= scrollSize - bottomThreshold;
109
103
  }
110
104
 
111
- /** @deprecated Use `isWorkbenchSectionedPanelAtScrollStart`. */
112
- export function isWorkbenchSectionedPanelAtScrollTop({
113
- scrollTop,
114
- topThreshold = WORKBENCH_SECTIONED_PANEL_SCROLL_THRESHOLD,
115
- }: {
116
- scrollTop: number;
117
- topThreshold?: number | undefined;
118
- }): boolean {
119
- return isWorkbenchSectionedPanelAtScrollStart({
120
- scrollPosition: scrollTop,
121
- startThreshold: topThreshold,
122
- });
123
- }
124
-
125
- /** @deprecated Use `isWorkbenchSectionedPanelAtScrollEnd`. */
126
- export function isWorkbenchSectionedPanelAtScrollBottom({
127
- bottomThreshold = WORKBENCH_SECTIONED_PANEL_SCROLL_THRESHOLD,
128
- clientHeight,
129
- scrollHeight,
130
- scrollTop,
131
- }: {
132
- bottomThreshold?: number | undefined;
133
- clientHeight: number;
134
- scrollHeight: number;
135
- scrollTop: number;
136
- }): boolean {
137
- return isWorkbenchSectionedPanelAtScrollEnd({
138
- bottomThreshold,
139
- clientSize: clientHeight,
140
- scrollPosition: scrollTop,
141
- scrollSize: scrollHeight,
142
- });
143
- }
144
-
145
- export function resolveWorkbenchSectionedPanelActiveAnchorFromIntersection({
146
- anchorOrder,
147
- entries,
148
- fallbackAnchorId,
149
- }: {
150
- anchorOrder: readonly string[];
151
- entries: readonly WorkbenchSectionedPanelIntersectionEntry[];
152
- fallbackAnchorId?: string | undefined;
153
- }): string | undefined {
154
- const intersectingAnchorIds = new Set(
155
- entries
156
- .filter((entry) => entry.isIntersecting && entry.target.id)
157
- .map((entry) => entry.target.id),
158
- );
159
-
160
- if (intersectingAnchorIds.size === 0) {
161
- return fallbackAnchorId;
162
- }
163
-
164
- let nextActive = fallbackAnchorId;
165
-
166
- for (const anchorId of anchorOrder) {
167
- if (intersectingAnchorIds.has(anchorId)) {
168
- nextActive = anchorId;
169
- }
170
- }
171
-
172
- return nextActive ?? fallbackAnchorId;
173
- }
174
-
175
105
  export function resolveWorkbenchSectionedPanelActiveAnchorFromScroll({
176
106
  activeLineBias = WORKBENCH_SECTIONED_PANEL_SCROLL_SPY_ACTIVE_LINE_BIAS,
177
107
  anchorOrder,
@@ -250,17 +180,6 @@ export function resolveWorkbenchSectionedPanelScrollTarget({
250
180
  return Math.max(0, sectionStart - offset);
251
181
  }
252
182
 
253
- /** @deprecated Use `resolveWorkbenchSectionedPanelScrollTarget`. */
254
- export function resolveWorkbenchSectionedPanelScrollTop({
255
- offset = WORKBENCH_SECTIONED_PANEL_SCROLL_SPY_OFFSET,
256
- sectionTop,
257
- }: {
258
- offset?: number | undefined;
259
- sectionTop: number;
260
- }): number {
261
- return resolveWorkbenchSectionedPanelScrollTarget({ offset, sectionStart: sectionTop });
262
- }
263
-
264
183
  export function createWorkbenchSectionedPanelIntersectionRootMargin(
265
184
  offset = WORKBENCH_SECTIONED_PANEL_SCROLL_SPY_OFFSET,
266
185
  axis: WorkbenchSectionedPanelScrollSpyAxis = 'vertical',
@@ -38,9 +38,3 @@ export function toWorkbenchSidebarLayoutContextValue<TViewId extends string>(
38
38
  ): WorkbenchSidebarLayoutContextStore {
39
39
  return value as unknown as WorkbenchSidebarLayoutContextStore;
40
40
  }
41
-
42
- export function fromWorkbenchSidebarLayoutContextValue<TViewId extends string>(
43
- value: WorkbenchSidebarLayoutContextStore,
44
- ): WorkbenchSidebarLayoutContextValue<TViewId> {
45
- return value as unknown as WorkbenchSidebarLayoutContextValue<TViewId>;
46
- }
@@ -0,0 +1,36 @@
1
+ /* Compact density overrides for Workbench command lists. Keep before command-list.css. */
2
+
3
+ .ui-workbench-command-list {
4
+ padding: 0;
5
+ }
6
+
7
+ .ui-workbench-command-item,
8
+ .ui-workbench-command-item.ui-button {
9
+ --ui-button-height: auto;
10
+ --ui-button-padding: 7px 10px;
11
+ --ui-button-border-radius: 0;
12
+ border-radius: 0;
13
+ height: auto;
14
+ padding: 7px 10px;
15
+ }
16
+
17
+ .ui-workbench-command-group-shell__nav {
18
+ padding: 0;
19
+ }
20
+
21
+ .ui-workbench-command-group-shell__nav-link {
22
+ border-radius: 0;
23
+ }
24
+
25
+ .ui-workbench-command-group-shell__content {
26
+ padding: 0;
27
+ }
28
+
29
+ .ui-workbench-command-group-shell__section {
30
+ padding: 0;
31
+ }
32
+
33
+ .ui-workbench-command-group-shell__section-header {
34
+ min-height: 28px;
35
+ padding: 4px 10px;
36
+ }
@@ -1,3 +1,5 @@
1
+ @import './command-list-density.css';
2
+
1
3
  .ui-workbench-command-list {
2
4
  max-height: min(430px, calc(100vh - 190px));
3
5
  overflow: auto;
@@ -30,7 +30,7 @@ import {
30
30
  import { WorkspaceFileIcon } from './WorkspaceFileIcon';
31
31
  import type { WorkspaceTreeNode } from './types';
32
32
 
33
- export const WORKSPACE_EXPLORER_DRAG_DATA_TYPE = 'application/x-newchobo-ui-workspace-paths';
33
+ export const WORKSPACE_EXPLORER_DRAG_DATA_TYPE = 'application/x-workbench-kit-workspace-paths';
34
34
  export const WORKSPACE_EXPLORER_DRAG_METADATA_DATA_TYPE = `${WORKSPACE_EXPLORER_DRAG_DATA_TYPE}.metadata`;
35
35
 
36
36
  export type WorkspaceExplorerSelectionChangeReason =
@@ -6,10 +6,7 @@ import {
6
6
  } from '@workbench-kit/workspace';
7
7
 
8
8
  import type { VirtualWorkspaceApi } from './useVirtualWorkspace';
9
- import type {
10
- WorkspaceExplorerControllerPort,
11
- WorkspaceExplorerMutationResult,
12
- } from './workspaceExplorerController';
9
+ import type { WorkspaceExplorerControllerPort } from './workspaceExplorerController';
13
10
 
14
11
  export function createVirtualWorkspaceExplorerPort({
15
12
  onNotify,
@@ -129,13 +126,3 @@ export function applyVirtualWorkspaceRenameSelection(
129
126
  paths: selection.paths.map(renameDescendantPath),
130
127
  };
131
128
  }
132
-
133
- export function toWorkspaceExplorerMutationResult(
134
- value: WorkspaceExplorerMutationResult | void | undefined,
135
- ): WorkspaceExplorerMutationResult | undefined {
136
- if (!value) {
137
- return undefined;
138
- }
139
-
140
- return value;
141
- }
@@ -1,57 +1,3 @@
1
- /* Optional compact menu density for context menus and command lists. */
2
-
3
- .ui-context-menu__item,
4
- .ui-context-menu__item.ui-button {
5
- --ui-button-min-height: 28px;
6
- --ui-button-height: auto;
7
- --ui-button-padding: 4px 10px;
8
- --ui-button-border-radius: 0;
9
- border-radius: 0;
10
- min-height: 28px;
11
- height: auto;
12
- padding: 4px 10px;
13
- }
14
-
15
- .ui-context-menu__separator {
16
- margin: 0;
17
- }
18
-
19
- .ui-context-menu__shortcut {
20
- font-size: var(--font-size-xs);
21
- color: var(--color-text-subtle);
22
- }
23
-
24
- .ui-workbench-command-list {
25
- padding: 0;
26
- }
27
-
28
- .ui-workbench-command-item,
29
- .ui-workbench-command-item.ui-button {
30
- --ui-button-height: auto;
31
- --ui-button-padding: 7px 10px;
32
- --ui-button-border-radius: 0;
33
- border-radius: 0;
34
- height: auto;
35
- padding: 7px 10px;
36
- }
37
-
38
- .ui-workbench-command-group-shell__nav {
39
- padding: 0;
40
- }
41
-
42
- .ui-workbench-command-group-shell__nav-link {
43
- border-radius: 0;
44
- }
45
-
46
- .ui-workbench-command-group-shell__content {
47
- padding: 0;
48
- }
49
-
50
- .ui-workbench-command-group-shell__section {
51
- padding: 0;
52
- }
53
-
54
- .ui-workbench-command-group-shell__section-header {
55
- min-height: 28px;
56
- padding: 4px 10px;
57
- }
1
+ /* Compatibility entry for consumers that opt into both compact menu surfaces. */
2
+ @import './overlay/context-menu-density.css';
3
+ @import './workbench/views/command-list-density.css';
@@ -1,181 +0,0 @@
1
- import { useId, type SVGProps } from 'react';
2
- import { cx } from '../utils/cx';
3
- import {
4
- TILEPAPER_ICON_CANVAS,
5
- TILEPAPER_ICON_GRADIENTS,
6
- TILEPAPER_ICON_GRID,
7
- TILEPAPER_ICON_ROOT_ELEVATION,
8
- TILEPAPER_ICON_ROOT_PANEL,
9
- TILEPAPER_ICON_TILES,
10
- tilepaperPaperFoldPaths,
11
- } from './tilepaper-app-icon-geometry.js';
12
-
13
- export type TilepaperAppIconProps = Omit<SVGProps<SVGSVGElement>, 'viewBox'> & {
14
- /** Flat rendering for small surfaces (e.g. titlebar) where elevation blur reads muddy. */
15
- compact?: boolean;
16
- };
17
-
18
- export function TilepaperAppIcon({ className, compact = false, ...props }: TilepaperAppIconProps) {
19
- const idPrefix = `tilepaper-icon-${useId().replace(/:/g, '')}`;
20
- const bgId = `${idPrefix}-bg`;
21
- const panelId = `${idPrefix}-panel`;
22
- const elevationId = `${idPrefix}-elevation`;
23
- const blueId = `${idPrefix}-blue`;
24
- const paperId = `${idPrefix}-paper`;
25
- const tealId = `${idPrefix}-teal`;
26
- const violetId = `${idPrefix}-violet`;
27
- const { tileRx, tileSize } = TILEPAPER_ICON_GRID;
28
- const fold = tilepaperPaperFoldPaths(
29
- TILEPAPER_ICON_TILES.paper.x,
30
- TILEPAPER_ICON_TILES.paper.y,
31
- tileSize,
32
- );
33
-
34
- return (
35
- <svg
36
- aria-hidden="true"
37
- className={cx('tilepaper-app-icon', className)}
38
- fill="none"
39
- viewBox={`0 0 ${TILEPAPER_ICON_CANVAS.size} ${TILEPAPER_ICON_CANVAS.size}`}
40
- xmlns="http://www.w3.org/2000/svg"
41
- {...props}
42
- >
43
- <defs>
44
- {compact ? null : (
45
- <filter
46
- id={elevationId}
47
- x="-12%"
48
- y="-8%"
49
- width="124%"
50
- height="128%"
51
- colorInterpolationFilters="sRGB"
52
- >
53
- <feDropShadow
54
- dx="0"
55
- dy={TILEPAPER_ICON_ROOT_ELEVATION.dy}
56
- floodColor={TILEPAPER_ICON_ROOT_ELEVATION.floodColor}
57
- floodOpacity={TILEPAPER_ICON_ROOT_ELEVATION.floodOpacity}
58
- stdDeviation={TILEPAPER_ICON_ROOT_ELEVATION.stdDeviation}
59
- />
60
- </filter>
61
- )}
62
- <linearGradient
63
- id={bgId}
64
- x1={TILEPAPER_ICON_GRADIENTS.bg.x1}
65
- x2={TILEPAPER_ICON_GRADIENTS.bg.x2}
66
- y1={TILEPAPER_ICON_GRADIENTS.bg.y1}
67
- y2={TILEPAPER_ICON_GRADIENTS.bg.y2}
68
- gradientUnits="userSpaceOnUse"
69
- >
70
- <stop offset="0" stopColor="#0A1020" />
71
- <stop offset="1" stopColor="#121C33" />
72
- </linearGradient>
73
- <linearGradient
74
- id={panelId}
75
- x1={TILEPAPER_ICON_GRADIENTS.panel.x1}
76
- x2={TILEPAPER_ICON_GRADIENTS.panel.x2}
77
- y1={TILEPAPER_ICON_GRADIENTS.panel.y1}
78
- y2={TILEPAPER_ICON_GRADIENTS.panel.y2}
79
- gradientUnits="userSpaceOnUse"
80
- >
81
- <stop offset="0" stopColor="#1A2C4D" />
82
- <stop offset="0.42" stopColor="#162844" />
83
- <stop offset="1" stopColor="#111D35" />
84
- </linearGradient>
85
- <linearGradient
86
- id={blueId}
87
- x1={TILEPAPER_ICON_GRADIENTS.blue.x1}
88
- x2={TILEPAPER_ICON_GRADIENTS.blue.x2}
89
- y1={TILEPAPER_ICON_GRADIENTS.blue.y1}
90
- y2={TILEPAPER_ICON_GRADIENTS.blue.y2}
91
- gradientUnits="userSpaceOnUse"
92
- >
93
- <stop offset="0" stopColor="#5D88FF" />
94
- <stop offset="1" stopColor="#3158D6" />
95
- </linearGradient>
96
- <linearGradient
97
- id={paperId}
98
- x1={TILEPAPER_ICON_GRADIENTS.paper.x1}
99
- x2={TILEPAPER_ICON_GRADIENTS.paper.x2}
100
- y1={TILEPAPER_ICON_GRADIENTS.paper.y1}
101
- y2={TILEPAPER_ICON_GRADIENTS.paper.y2}
102
- gradientUnits="userSpaceOnUse"
103
- >
104
- <stop offset="0" stopColor="#FFF9EE" />
105
- <stop offset="1" stopColor="#DDD9D1" />
106
- </linearGradient>
107
- <linearGradient
108
- id={tealId}
109
- x1={TILEPAPER_ICON_GRADIENTS.teal.x1}
110
- x2={TILEPAPER_ICON_GRADIENTS.teal.x2}
111
- y1={TILEPAPER_ICON_GRADIENTS.teal.y1}
112
- y2={TILEPAPER_ICON_GRADIENTS.teal.y2}
113
- gradientUnits="userSpaceOnUse"
114
- >
115
- <stop offset="0" stopColor="#2FD6C1" />
116
- <stop offset="1" stopColor="#149685" />
117
- </linearGradient>
118
- <linearGradient
119
- id={violetId}
120
- x1={TILEPAPER_ICON_GRADIENTS.violet.x1}
121
- x2={TILEPAPER_ICON_GRADIENTS.violet.x2}
122
- y1={TILEPAPER_ICON_GRADIENTS.violet.y1}
123
- y2={TILEPAPER_ICON_GRADIENTS.violet.y2}
124
- gradientUnits="userSpaceOnUse"
125
- >
126
- <stop offset="0" stopColor="#8A67FF" />
127
- <stop offset="1" stopColor="#5D3AC8" />
128
- </linearGradient>
129
- </defs>
130
- <rect
131
- width={TILEPAPER_ICON_CANVAS.size}
132
- height={TILEPAPER_ICON_CANVAS.size}
133
- rx={TILEPAPER_ICON_CANVAS.rx}
134
- fill={`url(#${bgId})`}
135
- />
136
- <rect
137
- filter={compact ? undefined : `url(#${elevationId})`}
138
- fill={`url(#${panelId})`}
139
- height={TILEPAPER_ICON_ROOT_PANEL.size}
140
- rx={TILEPAPER_ICON_ROOT_PANEL.rx}
141
- width={TILEPAPER_ICON_ROOT_PANEL.size}
142
- x={TILEPAPER_ICON_ROOT_PANEL.x}
143
- y={TILEPAPER_ICON_ROOT_PANEL.y}
144
- />
145
- <rect
146
- x={TILEPAPER_ICON_TILES.blue.x}
147
- y={TILEPAPER_ICON_TILES.blue.y}
148
- width={tileSize}
149
- height={tileSize}
150
- rx={tileRx}
151
- fill={`url(#${blueId})`}
152
- />
153
- <rect
154
- x={TILEPAPER_ICON_TILES.teal.x}
155
- y={TILEPAPER_ICON_TILES.teal.y}
156
- width={tileSize}
157
- height={tileSize}
158
- rx={tileRx}
159
- fill={`url(#${tealId})`}
160
- />
161
- <rect
162
- x={TILEPAPER_ICON_TILES.violet.x}
163
- y={TILEPAPER_ICON_TILES.violet.y}
164
- width={tileSize}
165
- height={tileSize}
166
- rx={tileRx}
167
- fill={`url(#${violetId})`}
168
- />
169
- <rect
170
- x={TILEPAPER_ICON_TILES.paper.x}
171
- y={TILEPAPER_ICON_TILES.paper.y}
172
- width={tileSize}
173
- height={tileSize}
174
- rx={tileRx}
175
- fill={`url(#${paperId})`}
176
- />
177
- <path d={fold.highlight} fill="white" fillOpacity="0.92" />
178
- <path d={fold.shadow} fill="#C9C3B7" fillOpacity="0.74" />
179
- </svg>
180
- );
181
- }
@@ -1,2 +0,0 @@
1
- export { TilepaperAppIcon } from './TilepaperAppIcon';
2
- export type { TilepaperAppIconProps } from './TilepaperAppIcon';