@typespec/playground 0.14.0-dev.1 → 0.14.0-dev.3
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/dist/react/index.js +422 -225
- package/dist/src/editor-command-bar/editor-command-bar.d.ts +4 -3
- package/dist/src/editor-command-bar/editor-command-bar.d.ts.map +1 -1
- package/dist/src/react/index.d.ts +1 -0
- package/dist/src/react/index.d.ts.map +1 -1
- package/dist/src/react/playground.d.ts +3 -8
- package/dist/src/react/playground.d.ts.map +1 -1
- package/dist/src/react/responsive-command-bar/index.d.ts +3 -0
- package/dist/src/react/responsive-command-bar/index.d.ts.map +1 -0
- package/dist/src/react/responsive-command-bar/responsive-command-bar.d.ts +36 -0
- package/dist/src/react/responsive-command-bar/responsive-command-bar.d.ts.map +1 -0
- package/dist/src/react/samples-drawer/index.d.ts +1 -1
- package/dist/src/react/samples-drawer/index.d.ts.map +1 -1
- package/dist/src/react/samples-drawer/samples-drawer-trigger.d.ts +7 -0
- package/dist/src/react/samples-drawer/samples-drawer-trigger.d.ts.map +1 -1
- package/dist/src/react/use-mobile.d.ts +6 -0
- package/dist/src/react/use-mobile.d.ts.map +1 -0
- package/dist/src/react/view-toggle.d.ts +10 -0
- package/dist/src/react/view-toggle.d.ts.map +1 -0
- package/dist/src/vite/types.d.ts +0 -2
- package/dist/src/vite/types.d.ts.map +1 -1
- package/dist/style.css +33 -13
- package/package.json +33 -29
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { FunctionComponent
|
|
1
|
+
import { FunctionComponent } from 'react';
|
|
2
|
+
import { CommandBarItem } from '../react/responsive-command-bar/index.js';
|
|
2
3
|
import { BrowserHost, PlaygroundSample } from '../types.js';
|
|
3
4
|
export interface EditorCommandBarProps {
|
|
4
|
-
documentationUrl?: string;
|
|
5
5
|
saveCode: () => Promise<void> | void;
|
|
6
6
|
formatCode: () => Promise<void> | void;
|
|
7
7
|
fileBug?: () => Promise<void> | void;
|
|
8
|
-
|
|
8
|
+
/** Additional items provided by the consumer. */
|
|
9
|
+
commandBarItems?: readonly CommandBarItem[];
|
|
9
10
|
host: BrowserHost;
|
|
10
11
|
selectedEmitter: string;
|
|
11
12
|
onSelectedEmitterChange: (emitter: string) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor-command-bar.d.ts","sourceRoot":"","sources":["../../../src/editor-command-bar/editor-command-bar.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"editor-command-bar.d.ts","sourceRoot":"","sources":["../../../src/editor-command-bar/editor-command-bar.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAkC,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAI/E,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEjE,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACrC,UAAU,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACvC,OAAO,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACrC,iDAAiD;IACjD,eAAe,CAAC,EAAE,SAAS,cAAc,EAAE,CAAC;IAC5C,IAAI,EAAE,WAAW,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,uBAAuB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAEnD,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC3C,kBAAkB,EAAE,MAAM,CAAC;IAC3B,0BAA0B,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;CAC1D;AAED,eAAO,MAAM,gBAAgB,EAAE,iBAAiB,CAAC,qBAAqB,CAwHrE,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export type { CommandBarItem } from '../react/responsive-command-bar/index.js';
|
|
1
2
|
export { usePlaygroundContext } from './context/index.js';
|
|
2
3
|
export { DiagnosticList } from './diagnostic-list/diagnostic-list.js';
|
|
3
4
|
export type { DiagnosticListProps } from './diagnostic-list/diagnostic-list.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/react/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AACtE,YAAY,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AACvE,OAAO,EACL,MAAM,EACN,UAAU,EACV,iBAAiB,EACjB,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,GAC5B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,YAAY,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC3E,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,sCAAsC,EACtC,qBAAqB,GACtB,MAAM,iBAAiB,CAAC;AACzB,mBAAmB,YAAY,CAAC;AAChC,OAAO,EAAE,kBAAkB,EAAE,KAAK,eAAe,EAAE,MAAM,2BAA2B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/react/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AACtE,YAAY,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AACvE,OAAO,EACL,MAAM,EACN,UAAU,EACV,iBAAiB,EACjB,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,GAC5B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,YAAY,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC3E,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,sCAAsC,EACtC,qBAAqB,GACtB,MAAM,iBAAiB,CAAC;AACzB,mBAAmB,YAAY,CAAC;AAChC,OAAO,EAAE,kBAAkB,EAAE,KAAK,eAAe,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FunctionComponent, ReactNode } from 'react';
|
|
2
2
|
import { BrowserHost, PlaygroundSample } from '../types.js';
|
|
3
|
+
import { CommandBarItem } from './responsive-command-bar/index.js';
|
|
3
4
|
import { FileOutputViewer, ProgramViewer } from './types.js';
|
|
4
5
|
import { PlaygroundState } from './use-playground-state.js';
|
|
5
6
|
export type { PlaygroundState };
|
|
@@ -23,10 +24,8 @@ export interface PlaygroundProps {
|
|
|
23
24
|
*/
|
|
24
25
|
defaultEmitter?: string;
|
|
25
26
|
onFileBug?: () => void;
|
|
26
|
-
/** Additional
|
|
27
|
-
|
|
28
|
-
/** Playground links */
|
|
29
|
-
links?: PlaygroundLinks;
|
|
27
|
+
/** Additional items to show in the command bar. */
|
|
28
|
+
commandBarItems?: CommandBarItem[];
|
|
30
29
|
/** Custom viewers to view the typespec program */
|
|
31
30
|
viewers?: ProgramViewer[];
|
|
32
31
|
/** Custom file viewers that enabled for certain emitters. Key of the map is emitter name */
|
|
@@ -47,10 +46,6 @@ export interface PlaygroundSaveData extends PlaygroundState {
|
|
|
47
46
|
/** Emitter name. */
|
|
48
47
|
emitter: string;
|
|
49
48
|
}
|
|
50
|
-
export interface PlaygroundLinks {
|
|
51
|
-
/** Link to documentation */
|
|
52
|
-
documentationUrl?: string;
|
|
53
|
-
}
|
|
54
49
|
/**
|
|
55
50
|
* Playground component for TypeSpec with consolidated state management.
|
|
56
51
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playground.d.ts","sourceRoot":"","sources":["../../../src/react/playground.tsx"],"names":[],"mappings":"AAGA,OAAO,sCAAsC,CAAC;AAG9C,OAAO,EAML,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAKf,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AASjE,OAAO,KAAK,EAAoB,gBAAgB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"playground.d.ts","sourceRoot":"","sources":["../../../src/react/playground.tsx"],"names":[],"mappings":"AAGA,OAAO,sCAAsC,CAAC;AAG9C,OAAO,EAML,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAKf,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AASjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,KAAK,EAAoB,gBAAgB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEpF,OAAO,EAAsB,KAAK,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAIrF,YAAY,EAAE,eAAe,EAAE,CAAC;AAEhC,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,wBAAwB;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAE3C,oCAAoC;IACpC,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,yDAAyD;IACzD,sBAAsB,CAAC,EAAE,eAAe,CAAC;IACzC,6CAA6C;IAC7C,uBAAuB,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;IAE3D;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IAEvB,mDAAmD;IACnD,eAAe,CAAC,EAAE,cAAc,EAAE,CAAC;IAEnC,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,kBAAmB,SAAQ,eAAe;IACzD,2CAA2C;IAC3C,OAAO,EAAE,MAAM,CAAC;IAEhB,oBAAoB;IACpB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,eAAO,MAAM,UAAU,EAAE,iBAAiB,CAAC,eAAe,CAmRzD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/react/responsive-command-bar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,YAAY,EAAE,cAAc,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { FunctionComponent, ReactNode } from 'react';
|
|
2
|
+
/** Defines a single item in a responsive command bar. */
|
|
3
|
+
export interface CommandBarItem {
|
|
4
|
+
/** Unique identifier for the item. */
|
|
5
|
+
readonly id: string;
|
|
6
|
+
/** Display label used for tooltip (desktop) and menu text (mobile). */
|
|
7
|
+
readonly label: string;
|
|
8
|
+
/** Icon element. */
|
|
9
|
+
readonly icon?: ReactNode;
|
|
10
|
+
/** Click handler for simple items. */
|
|
11
|
+
readonly onClick?: () => void;
|
|
12
|
+
/** If true, always visible as an icon button. If false (default), goes to overflow menu on mobile. */
|
|
13
|
+
readonly pinned?: boolean;
|
|
14
|
+
/** Sub-items rendered as a dropdown (desktop) or nested submenu (mobile). */
|
|
15
|
+
readonly children?: readonly CommandBarItem[];
|
|
16
|
+
/** Additional content rendered alongside the command bar (e.g., dialogs triggered by children). */
|
|
17
|
+
readonly content?: ReactNode;
|
|
18
|
+
/** Custom toolbar element for desktop rendering. Overrides default and children-based rendering. */
|
|
19
|
+
readonly toolbarItem?: ReactNode;
|
|
20
|
+
/** Custom menu element for mobile overflow menu. Overrides default and children-based rendering. */
|
|
21
|
+
readonly menuItem?: ReactNode;
|
|
22
|
+
/** Alignment group on the desktop toolbar. Defaults to "left". */
|
|
23
|
+
readonly align?: "left" | "right";
|
|
24
|
+
}
|
|
25
|
+
export interface ResponsiveCommandBarProps {
|
|
26
|
+
/** The items to render in the command bar. */
|
|
27
|
+
readonly items: readonly CommandBarItem[];
|
|
28
|
+
/** Whether to render in mobile (compact) mode. */
|
|
29
|
+
readonly isMobile: boolean;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* A generic responsive command bar that renders items as a toolbar on desktop
|
|
33
|
+
* and collapses non-pinned items into a hamburger overflow menu on mobile.
|
|
34
|
+
*/
|
|
35
|
+
export declare const ResponsiveCommandBar: FunctionComponent<ResponsiveCommandBarProps>;
|
|
36
|
+
//# sourceMappingURL=responsive-command-bar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"responsive-command-bar.d.ts","sourceRoot":"","sources":["../../../../src/react/responsive-command-bar/responsive-command-bar.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAY,KAAK,iBAAiB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGzE,yDAAyD;AACzD,MAAM,WAAW,cAAc;IAC7B,sCAAsC;IACtC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,uEAAuE;IACvE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,oBAAoB;IACpB,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC;IAC1B,sCAAsC;IACtC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,sGAAsG;IACtG,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,6EAA6E;IAC7E,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,cAAc,EAAE,CAAC;IAC9C,mGAAmG;IACnG,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC;IAC7B,oGAAoG;IACpG,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,CAAC;IACjC,oGAAoG;IACpG,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;IAC9B,kEAAkE;IAClE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CACnC;AAED,MAAM,WAAW,yBAAyB;IACxC,8CAA8C;IAC9C,QAAQ,CAAC,KAAK,EAAE,SAAS,cAAc,EAAE,CAAC;IAC1C,kDAAkD;IAClD,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;CAC5B;AAED;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,iBAAiB,CAAC,yBAAyB,CA8D7E,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { SamplesDrawerTrigger, type SamplesDrawerProps } from './samples-drawer-trigger.js';
|
|
1
|
+
export { SamplesDrawerOverlay, SamplesDrawerTrigger, type SamplesDrawerOverlayProps, type SamplesDrawerProps, } from './samples-drawer-trigger.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/react/samples-drawer/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/react/samples-drawer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,KAAK,yBAAyB,EAC9B,KAAK,kBAAkB,GACxB,MAAM,6BAA6B,CAAC"}
|
|
@@ -4,5 +4,12 @@ export interface SamplesDrawerProps {
|
|
|
4
4
|
samples: Record<string, PlaygroundSample>;
|
|
5
5
|
onSelectedSampleNameChange: (sampleName: string) => void;
|
|
6
6
|
}
|
|
7
|
+
export interface SamplesDrawerOverlayProps extends SamplesDrawerProps {
|
|
8
|
+
open: boolean;
|
|
9
|
+
onOpenChange: (open: boolean) => void;
|
|
10
|
+
}
|
|
11
|
+
/** The overlay drawer showing the sample gallery. Controlled via open/onOpenChange. */
|
|
12
|
+
export declare const SamplesDrawerOverlay: FunctionComponent<SamplesDrawerOverlayProps>;
|
|
13
|
+
/** Toolbar button trigger + overlay drawer for samples. */
|
|
7
14
|
export declare const SamplesDrawerTrigger: FunctionComponent<SamplesDrawerProps>;
|
|
8
15
|
//# sourceMappingURL=samples-drawer-trigger.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"samples-drawer-trigger.d.ts","sourceRoot":"","sources":["../../../../src/react/samples-drawer/samples-drawer-trigger.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAyB,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AACtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAIvD,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC1C,0BAA0B,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;CAC1D;AAED,eAAO,MAAM,oBAAoB,EAAE,iBAAiB,CAAC,kBAAkB,
|
|
1
|
+
{"version":3,"file":"samples-drawer-trigger.d.ts","sourceRoot":"","sources":["../../../../src/react/samples-drawer/samples-drawer-trigger.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAyB,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AACtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAIvD,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC1C,0BAA0B,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;CAC1D;AAED,MAAM,WAAW,yBAA0B,SAAQ,kBAAkB;IACnE,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACvC;AAED,uFAAuF;AACvF,eAAO,MAAM,oBAAoB,EAAE,iBAAiB,CAAC,yBAAyB,CA4C7E,CAAC;AAEF,2DAA2D;AAC3D,eAAO,MAAM,oBAAoB,EAAE,iBAAiB,CAAC,kBAAkB,CA0BtE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-mobile.d.ts","sourceRoot":"","sources":["../../../src/react/use-mobile.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,wBAAgB,WAAW,IAAI,OAAO,CAkBrC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FunctionComponent, ReactNode } from 'react';
|
|
2
|
+
export type ViewMode = "editor" | "output" | "both";
|
|
3
|
+
export interface ViewToggleProps {
|
|
4
|
+
viewMode: ViewMode;
|
|
5
|
+
onViewModeChange: (mode: ViewMode) => void;
|
|
6
|
+
/** Additional toolbar actions rendered on the right side of the bar. */
|
|
7
|
+
actions?: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export declare const ViewToggle: FunctionComponent<ViewToggleProps>;
|
|
10
|
+
//# sourceMappingURL=view-toggle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view-toggle.d.ts","sourceRoot":"","sources":["../../../src/react/view-toggle.tsx"],"names":[],"mappings":"AACA,OAAO,EAAe,KAAK,iBAAiB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAG5E,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEpD,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,QAAQ,CAAC;IACnB,gBAAgB,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IAC3C,wEAAwE;IACxE,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB;AAED,eAAO,MAAM,UAAU,EAAE,iBAAiB,CAAC,eAAe,CAiCzD,CAAC"}
|
package/dist/src/vite/types.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { PlaygroundLinks } from '../react/playground.js';
|
|
2
1
|
import { PlaygroundSampleConfig } from '../tooling/types.js';
|
|
3
2
|
import { PlaygroundSample } from '../types.js';
|
|
4
3
|
export interface PlaygroundUserConfig extends Omit<PlaygroundConfig, "samples"> {
|
|
@@ -12,6 +11,5 @@ export interface PlaygroundConfig {
|
|
|
12
11
|
readonly defaultEmitter: string;
|
|
13
12
|
readonly libraries: readonly string[];
|
|
14
13
|
readonly samples: Record<string, PlaygroundSample>;
|
|
15
|
-
readonly links?: PlaygroundLinks;
|
|
16
14
|
}
|
|
17
15
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/vite/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/vite/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,MAAM,WAAW,oBAAqB,SAAQ,IAAI,CAAC,gBAAgB,EAAE,SAAS,CAAC;IAC7E;;OAEG;IACH,QAAQ,CAAC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IACvC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC;CAC3D;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;CACpD"}
|
package/dist/style.css
CHANGED
|
@@ -175,6 +175,13 @@
|
|
|
175
175
|
._tree-row_16t0l_4 ._column_16t0l_44:last-child {
|
|
176
176
|
margin-right: 5px;
|
|
177
177
|
}
|
|
178
|
+
._bar_1gurd_1 {
|
|
179
|
+
border-bottom: 1px solid var(--colorNeutralStroke1);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
._divider_1gurd_5 {
|
|
183
|
+
flex: 1;
|
|
184
|
+
}
|
|
178
185
|
._samples-grid_1dkte_1 {
|
|
179
186
|
display: grid;
|
|
180
187
|
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
|
|
@@ -251,17 +258,6 @@
|
|
|
251
258
|
margin: 0;
|
|
252
259
|
line-height: 1.4;
|
|
253
260
|
}
|
|
254
|
-
._bar_15c2c_1 {
|
|
255
|
-
border-bottom: 1px solid var(--colorNeutralStroke1);
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
._divider_15c2c_5 {
|
|
259
|
-
flex: 1;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
._spacer_15c2c_9 {
|
|
263
|
-
width: 10px;
|
|
264
|
-
}
|
|
265
261
|
._settings_1yvpj_1 {
|
|
266
262
|
display: flex;
|
|
267
263
|
flex-direction: column;
|
|
@@ -464,7 +460,7 @@
|
|
|
464
460
|
._viewer-error_eeqi3_41 {
|
|
465
461
|
padding: 20px;
|
|
466
462
|
}
|
|
467
|
-
.
|
|
463
|
+
._layout_63onh_1 {
|
|
468
464
|
display: flex;
|
|
469
465
|
flex-direction: column;
|
|
470
466
|
width: 100%;
|
|
@@ -472,9 +468,16 @@
|
|
|
472
468
|
overflow: hidden;
|
|
473
469
|
}
|
|
474
470
|
|
|
475
|
-
._edit-
|
|
471
|
+
._edit-pane_63onh_9 {
|
|
472
|
+
display: flex;
|
|
473
|
+
flex-direction: column;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
._single-pane_63onh_14 {
|
|
476
477
|
display: flex;
|
|
477
478
|
flex-direction: column;
|
|
479
|
+
height: 100%;
|
|
480
|
+
width: 100%;
|
|
478
481
|
}
|
|
479
482
|
._header_1qhql_1 {
|
|
480
483
|
padding: 5px;
|
|
@@ -535,6 +538,23 @@
|
|
|
535
538
|
._internal-compiler-error_kxgwp_16 {
|
|
536
539
|
padding: 10px;
|
|
537
540
|
}
|
|
541
|
+
._view-toggle-bar_1yl8k_1 {
|
|
542
|
+
display: flex;
|
|
543
|
+
align-items: center;
|
|
544
|
+
padding: 0 4px;
|
|
545
|
+
border-bottom: 1px solid var(--colorNeutralStroke1);
|
|
546
|
+
background-color: var(--colorNeutralBackground1);
|
|
547
|
+
flex-shrink: 0;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
._view-toggle-tabs_1yl8k_10 {
|
|
551
|
+
min-height: auto;
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
._view-toggle-actions_1yl8k_14 {
|
|
555
|
+
margin-left: auto;
|
|
556
|
+
overflow: hidden;
|
|
557
|
+
}
|
|
538
558
|
._swagger-ui-container_1c81n_1 {
|
|
539
559
|
width: 100%;
|
|
540
560
|
height: 100%;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typespec/playground",
|
|
3
|
-
"version": "0.14.0-dev.
|
|
3
|
+
"version": "0.14.0-dev.3",
|
|
4
4
|
"author": "Microsoft Corporation",
|
|
5
5
|
"description": "TypeSpec playground UI components.",
|
|
6
6
|
"homepage": "https://typespec.io",
|
|
@@ -59,50 +59,54 @@
|
|
|
59
59
|
"!dist/test/**"
|
|
60
60
|
],
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@fluentui/react-components": "~9.73.
|
|
63
|
-
"@fluentui/react-icons": "^2.0.
|
|
64
|
-
"@typespec/bundler": "^0.5.1 || >= 0.5.2-dev.
|
|
65
|
-
"@typespec/compiler": "^1.10.0 || >= 1.11.0-dev.
|
|
66
|
-
"@typespec/html-program-viewer": "^0.80.0 || >= 0.81.0-dev.
|
|
67
|
-
"@typespec/http": "^1.10.0 || >= 1.11.0-dev.
|
|
68
|
-
"@typespec/openapi": "^1.10.0 || >= 1.11.0-dev.
|
|
69
|
-
"@typespec/openapi3": "^1.10.0 || >= 1.11.0-dev.
|
|
70
|
-
"@typespec/protobuf": "^0.80.0 || >= 0.81.0-dev.
|
|
71
|
-
"@typespec/rest": "^0.80.0 || >= 0.81.0-dev.
|
|
72
|
-
"@typespec/versioning": "^0.80.0 || >= 0.81.0-dev.
|
|
62
|
+
"@fluentui/react-components": "~9.73.3",
|
|
63
|
+
"@fluentui/react-icons": "^2.0.321",
|
|
64
|
+
"@typespec/bundler": "^0.5.1 || >= 0.5.2-dev.2",
|
|
65
|
+
"@typespec/compiler": "^1.10.0 || >= 1.11.0-dev.4",
|
|
66
|
+
"@typespec/html-program-viewer": "^0.80.0 || >= 0.81.0-dev.1",
|
|
67
|
+
"@typespec/http": "^1.10.0 || >= 1.11.0-dev.2",
|
|
68
|
+
"@typespec/openapi": "^1.10.0 || >= 1.11.0-dev.1",
|
|
69
|
+
"@typespec/openapi3": "^1.10.0 || >= 1.11.0-dev.3",
|
|
70
|
+
"@typespec/protobuf": "^0.80.0 || >= 0.81.0-dev.1",
|
|
71
|
+
"@typespec/rest": "^0.80.0 || >= 0.81.0-dev.1",
|
|
72
|
+
"@typespec/versioning": "^0.80.0 || >= 0.81.0-dev.1",
|
|
73
73
|
"clsx": "^2.1.1",
|
|
74
74
|
"debounce": "~3.0.0",
|
|
75
75
|
"lzutf8": "0.6.3",
|
|
76
|
-
"monaco-editor": "~0.55.
|
|
77
|
-
"react": "~19.2.
|
|
78
|
-
"react-dom": "~19.2.
|
|
79
|
-
"react-error-boundary": "^6.
|
|
80
|
-
"swagger-ui-dist": "^5.
|
|
81
|
-
"yaml": "~2.8.2",
|
|
76
|
+
"monaco-editor": "~0.55.1",
|
|
77
|
+
"react": "~19.2.4",
|
|
78
|
+
"react-dom": "~19.2.4",
|
|
79
|
+
"react-error-boundary": "^6.1.1",
|
|
80
|
+
"swagger-ui-dist": "^5.32.0",
|
|
82
81
|
"vscode-languageserver": "~9.0.1",
|
|
83
|
-
"vscode-languageserver-textdocument": "~1.0.12"
|
|
82
|
+
"vscode-languageserver-textdocument": "~1.0.12",
|
|
83
|
+
"yaml": "~2.8.2"
|
|
84
84
|
},
|
|
85
85
|
"devDependencies": {
|
|
86
|
-
"@babel/core": "^7.
|
|
87
|
-
"@playwright/test": "^1.
|
|
86
|
+
"@babel/core": "^7.29.0",
|
|
87
|
+
"@playwright/test": "^1.58.2",
|
|
88
88
|
"@storybook/cli": "^10.1.8",
|
|
89
89
|
"@storybook/react-vite": "^10.1.8",
|
|
90
|
+
"@testing-library/dom": "^10.4.1",
|
|
91
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
92
|
+
"@testing-library/react": "^16.3.2",
|
|
90
93
|
"@types/debounce": "~1.2.4",
|
|
91
|
-
"@types/node": "~25.
|
|
92
|
-
"@types/react": "~19.2.
|
|
93
|
-
"@types/react-dom": "~19.2.
|
|
94
|
-
"@types/swagger-ui-dist": "~3.30.
|
|
95
|
-
"@typespec/bundler": "^0.5.1 || >= 0.5.2-dev.
|
|
94
|
+
"@types/node": "~25.5.0",
|
|
95
|
+
"@types/react": "~19.2.14",
|
|
96
|
+
"@types/react-dom": "~19.2.3",
|
|
97
|
+
"@types/swagger-ui-dist": "~3.30.6",
|
|
98
|
+
"@typespec/bundler": "^0.5.1 || >= 0.5.2-dev.2",
|
|
96
99
|
"@vitejs/plugin-react": "~5.1.2",
|
|
97
100
|
"c8": "^11.0.0",
|
|
98
101
|
"cross-env": "~10.1.0",
|
|
99
102
|
"es-module-shims": "~2.8.0",
|
|
100
103
|
"rimraf": "~6.1.3",
|
|
101
|
-
"storybook": "^10.
|
|
104
|
+
"storybook": "^10.2.19",
|
|
102
105
|
"typescript": "~5.9.3",
|
|
103
106
|
"vite": "^7.2.7",
|
|
104
107
|
"vite-plugin-checker": "^0.12.0",
|
|
105
108
|
"vite-plugin-dts": "4.5.4",
|
|
109
|
+
"vitest": "^4.1.0",
|
|
106
110
|
"@typespec/react-components": "^0.57.0"
|
|
107
111
|
},
|
|
108
112
|
"scripts": {
|
|
@@ -113,8 +117,8 @@
|
|
|
113
117
|
"build:storybook": "sb build",
|
|
114
118
|
"preview": "pnpm build && vite preview",
|
|
115
119
|
"start": "vite",
|
|
116
|
-
"test": "
|
|
117
|
-
"test:ci": "
|
|
120
|
+
"test": "vitest run",
|
|
121
|
+
"test:ci": "vitest run --coverage --reporter=junit --reporter=default",
|
|
118
122
|
"lint": "eslint . --max-warnings=0",
|
|
119
123
|
"lint:fix": "eslint . --fix"
|
|
120
124
|
}
|