@typespec/playground 0.5.0-dev.0 → 0.5.0-dev.10

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 (48) hide show
  1. package/dist/.storybook/main.d.ts +0 -1
  2. package/dist/.storybook/preview.d.ts +0 -1
  3. package/dist/index.js +1 -1
  4. package/dist/react/index.js +243 -52207
  5. package/dist/src/browser-host.d.ts +0 -1
  6. package/dist/src/editor-command-bar/editor-command-bar.d.ts +0 -1
  7. package/dist/src/manifest.d.ts +0 -1
  8. package/dist/src/react/context/playground-context.d.ts +0 -1
  9. package/dist/src/react/default-footer.d.ts +0 -1
  10. package/dist/src/react/diagnostic-list/diagnostic-list.d.ts +0 -1
  11. package/dist/src/react/editor.d.ts +0 -1
  12. package/dist/src/react/emitter-dropdown.d.ts +0 -1
  13. package/dist/src/react/file-output/file-output.d.ts +0 -1
  14. package/dist/src/react/footer/footer-item.d.ts +0 -1
  15. package/dist/src/react/footer/footer.d.ts +0 -1
  16. package/dist/src/react/output-tabs/output-tabs.d.ts +0 -1
  17. package/dist/src/react/output-view/file-viewer.d.ts +0 -1
  18. package/dist/src/react/output-view/output-view.d.ts +0 -1
  19. package/dist/src/react/output-view/type-graph-viewer.d.ts +0 -1
  20. package/dist/src/react/playground.d.ts +0 -1
  21. package/dist/src/react/playground.d.ts.map +1 -1
  22. package/dist/src/react/problem-pane/header.d.ts +0 -1
  23. package/dist/src/react/problem-pane/problem-pane.d.ts +0 -1
  24. package/dist/src/react/samples-dropdown.d.ts +0 -1
  25. package/dist/src/react/settings/compiler-settings-dialog-button.d.ts +0 -1
  26. package/dist/src/react/settings/compiler-settings.d.ts +0 -1
  27. package/dist/src/react/settings/emitter-options-form.d.ts +0 -1
  28. package/dist/src/react/settings/linter-form.d.ts +0 -1
  29. package/dist/src/react/standalone.d.ts +0 -1
  30. package/dist/src/react/types.d.ts +0 -1
  31. package/dist/src/react/typespec-editor.d.ts +0 -1
  32. package/dist/src/react/viewers/index.d.ts +0 -1
  33. package/dist/src/react/viewers/swagger-ui.d.ts +0 -1
  34. package/dist/src/services.d.ts +0 -1
  35. package/dist/src/services.d.ts.map +1 -1
  36. package/dist/src/tooling/index.d.ts +0 -1
  37. package/dist/src/tooling/types.d.ts +0 -1
  38. package/dist/src/types.d.ts +0 -1
  39. package/dist/src/vite/index.d.ts +0 -1
  40. package/dist/src/vite/types.d.ts +0 -1
  41. package/dist/{state-storage-BjOULkS3.js → state-storage-DqG2VXgn.js} +6 -2
  42. package/dist/stories/footer/footer-item.stories.d.ts +0 -1
  43. package/dist/stories/footer/footer-version-item.stories.d.ts +0 -1
  44. package/dist/stories/footer/footer.stories.d.ts +0 -1
  45. package/dist/stories/playground.stories.d.ts +0 -1
  46. package/dist/style.css +4 -248
  47. package/package.json +31 -31
  48. package/dist/manifest-Bx5EZvxu-Bx5EZvxu.js +0 -6
@@ -1,6 +1,5 @@
1
1
  import { LibraryImportOptions } from './core.js';
2
2
  import { BrowserHost } from './types.js';
3
-
4
3
  export declare function resolveVirtualPath(path: string, ...paths: string[]): string;
5
4
  /**
6
5
  * Create the browser host from the list of libraries.
@@ -1,7 +1,6 @@
1
1
  import { CompilerOptions } from '@typespec/compiler';
2
2
  import { FunctionComponent, ReactNode } from 'react';
3
3
  import { BrowserHost, PlaygroundSample } from '../types.js';
4
-
5
4
  export interface EditorCommandBarProps {
6
5
  documentationUrl?: string;
7
6
  saveCode: () => Promise<void> | void;
@@ -1,5 +1,4 @@
1
1
  import { PlaygroundConfig } from '../src/vite/types.js';
2
-
3
2
  declare const config: PlaygroundConfig;
4
3
  export default config;
5
4
  //# sourceMappingURL=manifest.d.ts.map
@@ -1,5 +1,4 @@
1
1
  import { BrowserHost } from '../../types.js';
2
-
3
2
  export interface PlaygroundContext {
4
3
  readonly host: BrowserHost;
5
4
  readonly setContent: (content: string) => void;
@@ -1,4 +1,3 @@
1
1
  import { FunctionComponent } from 'react';
2
-
3
2
  export declare const DefaultFooter: FunctionComponent;
4
3
  //# sourceMappingURL=default-footer.d.ts.map
@@ -1,6 +1,5 @@
1
1
  import { Diagnostic } from '@typespec/compiler';
2
2
  import { FunctionComponent } from 'react';
3
-
4
3
  export interface DiagnosticListProps {
5
4
  readonly diagnostics: readonly Diagnostic[];
6
5
  readonly onDiagnosticSelected?: (diagnostic: Diagnostic) => void;
@@ -1,6 +1,5 @@
1
1
  import { editor } from 'monaco-editor';
2
2
  import { FunctionComponent } from 'react';
3
-
4
3
  export interface EditorProps {
5
4
  model: editor.IModel;
6
5
  actions?: editor.IActionDescriptor[];
@@ -1,5 +1,4 @@
1
1
  import { FunctionComponent } from 'react';
2
-
3
2
  export type EmitterDropdownProps = {
4
3
  emitters: string[];
5
4
  selectedEmitter: string;
@@ -1,6 +1,5 @@
1
1
  import { FunctionComponent } from 'react';
2
2
  import { FileOutputViewer } from '../types.js';
3
-
4
3
  export interface FileOutputProps {
5
4
  readonly filename: string;
6
5
  readonly content: string;
@@ -1,5 +1,4 @@
1
1
  import { FunctionComponent, ReactNode } from 'react';
2
-
3
2
  export interface FooterItemProps {
4
3
  className?: string;
5
4
  link?: string;
@@ -1,5 +1,4 @@
1
1
  import { FunctionComponent, ReactNode } from 'react';
2
-
3
2
  export interface FooterProps {
4
3
  className?: string;
5
4
  children: ReactNode;
@@ -1,5 +1,4 @@
1
1
  import { FunctionComponent } from 'react';
2
-
3
2
  export interface OutputTabsProps {
4
3
  filenames: string[];
5
4
  selected: string;
@@ -1,4 +1,3 @@
1
1
  import { FileOutputViewer, ProgramViewer } from '../types.js';
2
-
3
2
  export declare function createFileViewer(fileViewers: FileOutputViewer[]): ProgramViewer;
4
3
  //# sourceMappingURL=file-viewer.d.ts.map
@@ -1,7 +1,6 @@
1
1
  import { FunctionComponent } from 'react';
2
2
  import { PlaygroundEditorsOptions } from '../playground.js';
3
3
  import { CompilationState, FileOutputViewer, ProgramViewer } from '../types.js';
4
-
5
4
  export interface OutputViewProps {
6
5
  compilationState: CompilationState | undefined;
7
6
  editorOptions?: PlaygroundEditorsOptions;
@@ -1,4 +1,3 @@
1
1
  import { ProgramViewer } from '../types.js';
2
-
3
2
  export declare const TypeGraphViewer: ProgramViewer;
4
3
  //# sourceMappingURL=type-graph-viewer.d.ts.map
@@ -2,7 +2,6 @@ import { CompilerOptions } from '@typespec/compiler';
2
2
  import { FunctionComponent, ReactNode } from 'react';
3
3
  import { BrowserHost, PlaygroundSample } from '../types.js';
4
4
  import { FileOutputViewer, ProgramViewer } from './types.js';
5
-
6
5
  export interface PlaygroundProps {
7
6
  host: BrowserHost;
8
7
  /** Default emitter if leaving this unmanaged. */
@@ -1 +1 @@
1
- {"version":3,"file":"playground.d.ts","sourceRoot":"","sources":["../../../src/react/playground.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAc,MAAM,oBAAoB,CAAC;AAEtE,OAAO,sCAAsC,CAAC;AAG9C,OAAO,EAML,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAIf,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAOjE,OAAO,KAAK,EAAoB,gBAAgB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGpF,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,WAAW,CAAC;IAElB,iDAAiD;IACjD,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,kCAAkC;IAClC,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IAEtC,qBAAqB;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iDAAiD;IACjD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mCAAmC;IACnC,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAE5C,sBAAsB;IACtB,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,yDAAyD;IACzD,sBAAsB,CAAC,EAAE,eAAe,CAAC;IACzC,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AC,EAAE,MAAM,IAAI,CAAC;IAEvB,uDAAuD;IACvD,iBAAiB,CAAC,EAAE,SAAS,CAAC;IAE9B,uBAAuB;IACvB,KAAK,CAAC,EAAE,eAAe,CAAC;IAExB,kDAAkD;IAClD,OAAO,CAAC,EAAE,aAAa,EAAE,CAAC;IAE1B,4FAA4F;IAC5F,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,EAAE,CAAC,CAAC;IAEpD,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAE7C,aAAa,CAAC,EAAE,wBAAwB,CAAC;IAEzC;;OAEG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB;AAED,MAAM,WAAW,wBAAwB;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,kBAAkB;IACjC,2CAA2C;IAC3C,OAAO,EAAE,MAAM,CAAC;IAEhB,oBAAoB;IACpB,OAAO,EAAE,MAAM,CAAC;IAEhB,uBAAuB;IACvB,OAAO,CAAC,EAAE,eAAe,CAAC;IAE1B,oEAAoE;IACpE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC9B,4BAA4B;IAC5B,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,eAAO,MAAM,UAAU,EAAE,iBAAiB,CAAC,eAAe,CA4NzD,CAAC"}
@@ -1,6 +1,5 @@
1
1
  import { MouseEventHandler } from 'react';
2
2
  import { CompilationState } from '../types.js';
3
-
4
3
  export interface ProblemPaneHeaderProps {
5
4
  compilationState: CompilationState | undefined;
6
5
  onClick?: MouseEventHandler<HTMLDivElement>;
@@ -1,7 +1,6 @@
1
1
  import { Diagnostic } from '@typespec/compiler';
2
2
  import { FunctionComponent, MouseEventHandler } from 'react';
3
3
  import { CompilationState } from '../types.js';
4
-
5
4
  export interface ProblemPaneProps {
6
5
  readonly collapsed: boolean;
7
6
  readonly compilationState: CompilationState | undefined;
@@ -1,6 +1,5 @@
1
1
  import { FunctionComponent } from 'react';
2
2
  import { PlaygroundSample } from '../types.js';
3
-
4
3
  export interface SamplesDropdownProps {
5
4
  samples: Record<string, PlaygroundSample>;
6
5
  selectedSampleName: string;
@@ -1,5 +1,4 @@
1
1
  import { CompilerOptions } from '@typespec/compiler';
2
-
3
2
  export interface CompilerSettingsDialogButtonProps {
4
3
  selectedEmitter: string;
5
4
  compilerOptions: CompilerOptions;
@@ -1,7 +1,6 @@
1
1
  import { CompilerOptions } from '@typespec/compiler';
2
2
  import { FunctionComponent } from 'react';
3
3
  import { BrowserHost } from '../../types.js';
4
-
5
4
  export interface CompilerSettingsProps {
6
5
  readonly host: BrowserHost;
7
6
  readonly selectedEmitter: string;
@@ -1,7 +1,6 @@
1
1
  import { FunctionComponent } from 'react';
2
2
  import { PlaygroundTspLibrary } from '../../types.js';
3
3
  import { EmitterOptions } from '../types.js';
4
-
5
4
  export interface EmitterOptionsFormProps {
6
5
  readonly library: PlaygroundTspLibrary;
7
6
  readonly options: EmitterOptions;
@@ -1,7 +1,6 @@
1
1
  import { LinterRuleSet } from '@typespec/compiler';
2
2
  import { FunctionComponent } from 'react';
3
3
  import { PlaygroundTspLibrary } from '../../types.js';
4
-
5
4
  export interface LinterFormProps {
6
5
  libraries: Record<string, PlaygroundTspLibrary>;
7
6
  linterRuleSet: LinterRuleSet;
@@ -2,7 +2,6 @@ import { FunctionComponent, ReactNode } from 'react';
2
2
  import { LibraryImportOptions } from '../core.js';
3
3
  import { UrlStateStorage } from '../state-storage.js';
4
4
  import { PlaygroundProps, PlaygroundSaveData } from './playground.js';
5
-
6
5
  export interface ReactPlaygroundConfig extends Partial<PlaygroundProps> {
7
6
  readonly libraries: readonly string[];
8
7
  readonly importConfig?: LibraryImportOptions;
@@ -1,6 +1,5 @@
1
1
  import { Program } from '@typespec/compiler';
2
2
  import { ReactNode } from 'react';
3
-
4
3
  export type CompilationCrashed = {
5
4
  readonly internalCompilerError: any;
6
5
  };
@@ -2,7 +2,6 @@ import { editor } from 'monaco-editor';
2
2
  import { FunctionComponent } from 'react';
3
3
  import { EditorProps } from './editor.js';
4
4
  import { PlaygroundEditorsOptions } from './playground.js';
5
-
6
5
  export interface TypeSpecEditorProps extends Omit<EditorProps, "options"> {
7
6
  options?: editor.IStandaloneEditorConstructionOptions;
8
7
  }
@@ -1,4 +1,3 @@
1
1
  import { FileOutputViewer } from '../types.js';
2
-
3
2
  export declare const SwaggerUIViewer: FileOutputViewer;
4
3
  //# sourceMappingURL=index.d.ts.map
@@ -1,5 +1,4 @@
1
1
  import { FunctionComponent } from 'react';
2
-
3
2
  export interface SwaggerUIProps {
4
3
  readonly spec: string;
5
4
  }
@@ -1,6 +1,5 @@
1
1
  import { DiagnosticTarget, NoTarget } from '@typespec/compiler';
2
2
  import { BrowserHost } from './types.js';
3
-
4
3
  import * as monaco from "monaco-editor";
5
4
  export declare function registerMonacoLanguage(host: BrowserHost): Promise<void>;
6
5
  export declare function getMonacoRange(typespecCompiler: typeof import("@typespec/compiler"), target: DiagnosticTarget | typeof NoTarget): monaco.IRange;
@@ -1 +1 @@
1
- {"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../src/services.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,QAAQ,EAEd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAKxC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAmC9C,wBAAsB,sBAAsB,CAAC,IAAI,EAAE,WAAW,iBA4T7D;AAED,wBAAgB,cAAc,CAC5B,gBAAgB,EAAE,cAAc,oBAAoB,CAAC,EACrD,MAAM,EAAE,gBAAgB,GAAG,OAAO,QAAQ,GACzC,MAAM,CAAC,MAAM,CAkBf"}
1
+ {"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../src/services.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,QAAQ,EAEd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAKxC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAmC9C,wBAAsB,sBAAsB,CAAC,IAAI,EAAE,WAAW,iBAiU7D;AAED,wBAAgB,cAAc,CAC5B,gBAAgB,EAAE,cAAc,oBAAoB,CAAC,EACrD,MAAM,EAAE,gBAAgB,GAAG,OAAO,QAAQ,GACzC,MAAM,CAAC,MAAM,CAkBf"}
@@ -1,5 +1,4 @@
1
1
  import { PlaygroundSampleConfig } from './types.js';
2
-
3
2
  /**
4
3
  * @experimental This API is experimental
5
4
  */
@@ -1,4 +1,3 @@
1
1
  import { PlaygroundSample } from '../types.js';
2
-
3
2
  export type PlaygroundSampleConfig = Omit<PlaygroundSample, "content">;
4
3
  //# sourceMappingURL=types.d.ts.map
@@ -1,5 +1,4 @@
1
1
  import { CompilerHost, CompilerOptions, LinterDefinition, NodePackage, TypeSpecLibrary } from '@typespec/compiler';
2
-
3
2
  export interface PlaygroundSample {
4
3
  filename: string;
5
4
  preferredEmitter?: string;
@@ -1,5 +1,4 @@
1
1
  import { UserConfig } from 'vite';
2
2
  import { PlaygroundUserConfig } from './types.js';
3
-
4
3
  export declare function definePlaygroundViteConfig(config: PlaygroundUserConfig): UserConfig;
5
4
  //# sourceMappingURL=index.d.ts.map
@@ -1,7 +1,6 @@
1
1
  import { PlaygroundLinks } from '../react/playground.js';
2
2
  import { PlaygroundSampleConfig } from '../tooling/types.js';
3
3
  import { PlaygroundSample } from '../types.js';
4
-
5
4
  export interface PlaygroundUserConfig extends Omit<PlaygroundConfig, "samples"> {
6
5
  /**
7
6
  * If the bundle library plugin should be loaded.
@@ -1,4 +1,4 @@
1
- import { createSourceFile, getSourceFileKindFromExt, resolvePath, TypeSpecLanguageConfiguration } from '@typespec/compiler';
1
+ import { resolvePath, createSourceFile, getSourceFileKindFromExt, TypeSpecLanguageConfiguration } from '@typespec/compiler';
2
2
  import * as monaco from 'monaco-editor';
3
3
  import * as lsp from 'vscode-languageserver';
4
4
  import { DiagnosticSeverity, FormattingOptions, DocumentHighlightKind } from 'vscode-languageserver';
@@ -288,6 +288,10 @@ function getTypeSpecLanguageConfiguration() {
288
288
  async function registerMonacoLanguage(host) {
289
289
  monaco.languages.register({ id: "typespec", extensions: [".tsp"] });
290
290
  monaco.languages.setLanguageConfiguration("typespec", getTypeSpecLanguageConfiguration());
291
+ if (window.registeredServices) {
292
+ return;
293
+ }
294
+ window.registeredServices = true;
291
295
  const serverHost = {
292
296
  compilerHost: host,
293
297
  getOpenDocumentByURL(url) {
@@ -651,4 +655,4 @@ function createUrlStateStorage(schema) {
651
655
  }
652
656
  }
653
657
 
654
- export { createUrlStateStorage as a, createBrowserHost as c, getMonacoRange as g, registerMonacoLanguage as r };
658
+ export { createUrlStateStorage as a, resolveVirtualPath as b, createBrowserHost as c, getMonacoRange as g, registerMonacoLanguage as r };
@@ -1,6 +1,5 @@
1
1
  import { Meta, StoryObj } from '@storybook/react';
2
2
  import { FooterItem } from '../../src/react/footer/index.js';
3
-
4
3
  declare const meta: Meta<typeof FooterItem>;
5
4
  export default meta;
6
5
  type Story = StoryObj<typeof FooterItem>;
@@ -1,6 +1,5 @@
1
1
  import { Meta, StoryObj } from '@storybook/react';
2
2
  import { FooterVersionItem } from '../../src/react/footer/index.js';
3
-
4
3
  declare const meta: Meta<typeof FooterVersionItem>;
5
4
  export default meta;
6
5
  type Story = StoryObj<typeof FooterVersionItem>;
@@ -1,6 +1,5 @@
1
1
  import { Meta, StoryObj } from '@storybook/react';
2
2
  import { Footer } from '../../src/react/footer/index.js';
3
-
4
3
  declare const meta: Meta<typeof Footer>;
5
4
  export default meta;
6
5
  type Story = StoryObj<typeof Footer>;
@@ -1,6 +1,5 @@
1
1
  import { Meta, StoryObj } from '@storybook/react';
2
2
  import { Playground } from '../src/react/playground.js';
3
-
4
3
  declare const meta: Meta<typeof Playground>;
5
4
  export default meta;
6
5
  type Story = StoryObj<typeof Playground>;
package/dist/style.css CHANGED
@@ -1,19 +1,19 @@
1
- ._footer_cn8nf_1 {
1
+ ._footer_e6dic_1 {
2
2
  grid-area: footer;
3
3
  display: flex;
4
4
  font-size: 14px;
5
5
 
6
- background-color: #007acc;
6
+ background-color: #0073c1;
7
7
  }
8
8
 
9
- ._footer-item_cn8nf_9 {
9
+ ._footer-item_e6dic_9 {
10
10
  text-decoration: none;
11
11
  color: #fefefe;
12
12
  border-right: 1px solid #d5d5d5;
13
13
  padding: 0 5px;
14
14
  }
15
15
 
16
- ._footer-item_cn8nf_9:hover {
16
+ ._footer-item_e6dic_9:hover {
17
17
  background-color: #063a5c;
18
18
  }
19
19
  ._version-item_1c15n_1 {
@@ -232,250 +232,6 @@
232
232
  ._viewer-error_omce4_30 {
233
233
  padding: 20px;
234
234
  }
235
- ._type-kind-icon_1l8cz_1 {
236
- color: var(--colorPaletteBerryForeground2);
237
- font-weight: bold;
238
- padding: 1px 1px;
239
- border-radius: 2px;
240
- line-height: 16px;
241
- }
242
- ._current-path_x1yb7_1 {
243
- overflow-y: auto;
244
- border: 1px solid var(--colorNeutralStroke1);
245
- }
246
-
247
- ._current-path_x1yb7_1._focus_x1yb7_6 {
248
- border-bottom: 1px solid var(--colorBrandForeground1);
249
- }
250
- ._breadcrumb-search_x1yb7_9 {
251
- width: 100%;
252
- border-radius: 0 !important;
253
- border: none !important;
254
- }
255
-
256
- ._breadcrumb-search_x1yb7_9::after {
257
- border: none !important;
258
- }
259
-
260
- ._option_x1yb7_19 {
261
- padding: 2px 4px !important;
262
- }
263
-
264
- ._option_x1yb7_19 ._doc_x1yb7_23 {
265
- color: var(--colorNeutralForeground4);
266
- text-overflow: ellipsis;
267
- text-wrap: nowrap;
268
- min-width: 0;
269
- flex: 0 1 auto;
270
- overflow: hidden;
271
- }
272
-
273
- ._flex-gap_x1yb7_32 {
274
- flex: 1;
275
- }
276
-
277
- ._search-placeholder_x1yb7_36 {
278
- color: var(--colorNeutralForeground4);
279
- font-size: 12px;
280
- margin: 5px;
281
- text-wrap: nowrap;
282
- }
283
- ._item_1lyf1_1 {
284
- border-top: 1px solid var(--colorNeutralStroke1);
285
- padding: 5px 0 !important;
286
- }
287
-
288
- ._item_1lyf1_1:hover {
289
- background-color: var(--colorNeutralBackground1Hover);
290
- }
291
- ._type-graph_yi03c_1 * {
292
- box-sizing: border-box;
293
- }
294
-
295
- ._tree-navigation-pane_yi03c_5 {
296
- height: 100%;
297
- overflow-y: auto;
298
- }
299
-
300
- ._view-pane_yi03c_10 {
301
- padding: 10px;
302
- overflow-y: auto;
303
- }
304
-
305
- ._current-path_yi03c_15 {
306
- margin-bottom: 10px;
307
- }
308
- ._mono_ouyit_1 {
309
- font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
310
- }
311
-
312
- ._literal_ouyit_5 {
313
- color: var(--colorPaletteLightGreenForeground2);
314
- }
315
-
316
- ._type-kind_ouyit_9 {
317
- color: var(--colorPaletteBerryForeground2);
318
- }
319
- ._type-kind-tag_ouyit_12 {
320
- color: white;
321
- background-color: var(--colorPaletteBerryForeground2);
322
- border-radius: 2px;
323
- }
324
- ._type-kind-tag-small_ouyit_17 {
325
- height: 16px;
326
- line-height: 16px;
327
- font-size: 10px;
328
- padding: 0 3px;
329
- }
330
-
331
- ._type-kind-tag-auto_ouyit_24 {
332
- padding: 1px 5px;
333
- }
334
- ._string_yr0s7_1 {
335
- color: var(--colorPaletteLightGreenForeground2);
336
- }
337
-
338
- ._boolean_yr0s7_5 {
339
- color: var(--colorPaletteDarkOrangeForeground1);
340
- }
341
-
342
- ._number_yr0s7_9 {
343
- color: var(--colorPaletteDarkOrangeForeground1);
344
- }
345
-
346
- ._intrinsic_yr0s7_13 {
347
- color: var(--colorPaletteDarkOrangeForeground1);
348
- }
349
- ._inspect-type_pmg7n_1 {
350
- font-size: 12px;
351
- }
352
- ._inspect-type_pmg7n_1 ul {
353
- padding: 0 0 0 16px;
354
- margin: 0;
355
- }
356
-
357
- ._inspect-type_pmg7n_1 > ul {
358
- padding: 0;
359
- }
360
-
361
- ._inspect-type_pmg7n_1 li {
362
- margin: 0;
363
- list-style: none;
364
- position: relative;
365
- }
366
-
367
- ._type-ui_pmg7n_19 {
368
- display: inline;
369
- }
370
- ._type-ui-header_pmg7n_22 {
371
- cursor: pointer;
372
- display: inline;
373
- }
374
-
375
- ._type-ui-header_pmg7n_22:hover {
376
- text-decoration: underline;
377
- }
378
-
379
- ._type-name_pmg7n_31 {
380
- color: var(--colorNeutralForeground2);
381
- }
382
-
383
- ._property_pmg7n_35 {
384
- color: var(--colorPaletteMarigoldForeground2);
385
- }
386
-
387
- ._named-type-ref_pmg7n_39 {
388
- color: var(--colorBrandForeground1);
389
- text-decoration: none;
390
- cursor: pointer;
391
- }
392
-
393
- ._named-type-ref_pmg7n_39:hover {
394
- text-decoration: underline;
395
- }
396
-
397
- ._js-value_pmg7n_49 {
398
- color: var(--colorPaletteDarkOrangeForeground1);
399
- }
400
- ._object-description_1mqr2_1 {
401
- font-style: italic;
402
- }
403
-
404
- ._preview_1mqr2_5 {
405
- font-style: italic;
406
- }
407
-
408
- ._object-name_1mqr2_9 {
409
- color: var(--colorPaletteMarigoldForeground2);
410
- }
411
-
412
- ._dimmed_1mqr2_13 {
413
- opacity: 0.6;
414
- }
415
- ._table_1qvgd_1 {
416
- table-layout: auto;
417
- border-collapse: collapse;
418
- }
419
-
420
- ._table_1qvgd_1 th {
421
- font-weight: bold;
422
- }
423
-
424
- ._table_1qvgd_1 thead tr,
425
- ._table_1qvgd_1 tbody tr:not(:last-child) {
426
- border-bottom: 1px solid var(--colorNeutralStroke1);
427
- }
428
-
429
- ._key_1qvgd_15 {
430
- vertical-align: top;
431
- color: var(--colorNeutralForeground2);
432
- }
433
-
434
- ._data_1qvgd_20 {
435
- }
436
-
437
- ._tsp-type-ref_1qvgd_23 {
438
- display: inline-flex;
439
- align-items: center;
440
- gap: 3px;
441
- }
442
-
443
- ._tsp-type-logo_1qvgd_29 {
444
- display: inline-block;
445
- font-size: 7px;
446
- width: 12px;
447
- height: 12px;
448
- line-height: 12px;
449
- background-color: var(--colorPaletteBerryForeground2);
450
- color: white;
451
- }
452
- ._type-view_d4sc6_1 {
453
- display: flex;
454
- flex-direction: column;
455
- gap: 20px;
456
- }
457
-
458
- ._main_d4sc6_7 {
459
- padding: var(--fui-Card--size) 0 !important;
460
- }
461
-
462
- ._header-section_d4sc6_11 {
463
- padding: 0 var(--fui-Card--size);
464
- }
465
-
466
- ._inspect-section_d4sc6_15 {
467
- padding: 0 var(--fui-Card--size);
468
- }
469
-
470
- ._header_d4sc6_11 {
471
- display: flex;
472
- align-items: center;
473
- gap: 10px;
474
- }
475
-
476
- ._doc_d4sc6_25 {
477
- color: var(--colorNeutralForeground3);
478
- }
479
235
  ._layout_l03ni_1 {
480
236
  display: flex;
481
237
  flex-direction: column;