@typespec/playground 0.2.0 → 0.2.1

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/index.css CHANGED
@@ -24,15 +24,6 @@
24
24
  overflow: auto;
25
25
  }
26
26
 
27
- .footer-version-item-module_version-item__pjuvV {
28
- padding: 0;
29
- }
30
- .footer-version-item-module_button__70iqf {
31
- cursor: pointer;
32
- height: 100%;
33
- padding: 0 5px;
34
- }
35
-
36
27
  .footer-module_footer__QqUEE {
37
28
  grid-area: footer;
38
29
  display: flex;
@@ -52,6 +43,15 @@
52
43
  background-color: #063a5c;
53
44
  }
54
45
 
46
+ .footer-version-item-module_version-item__pjuvV {
47
+ padding: 0;
48
+ }
49
+ .footer-version-item-module_button__70iqf {
50
+ cursor: pointer;
51
+ height: 100%;
52
+ padding: 0 5px;
53
+ }
54
+
55
55
  .output-view-module_output-view__uT5Ae {
56
56
  display: flex;
57
57
  flex-direction: column;
@@ -145,6 +145,25 @@
145
145
  overflow: hidden;
146
146
  }
147
147
 
148
+ .problem-pane-module_problem-pane__GJKF4 {
149
+ height: 100%;
150
+ background-color: var(--colorNeutralBackground3);
151
+ display: flex;
152
+ flex-direction: column;
153
+ max-height: 100%;
154
+ }
155
+
156
+ .problem-pane-module_problem-content__rYzbh {
157
+ overflow-y: auto;
158
+ }
159
+ .problem-pane-module_no-problems__Ub8R- {
160
+ padding: 10px;
161
+ }
162
+
163
+ .problem-pane-module_internal-compiler-error__laE4f {
164
+ padding: 10px;
165
+ }
166
+
148
167
  .file-output-module_file-output__YBaE7 {
149
168
  position: relative;
150
169
  height: 100%;
@@ -176,25 +195,6 @@
176
195
  background-color: var(--colorNeutralBackground5) !important;
177
196
  }
178
197
 
179
- .problem-pane-module_problem-pane__GJKF4 {
180
- height: 100%;
181
- background-color: var(--colorNeutralBackground3);
182
- display: flex;
183
- flex-direction: column;
184
- max-height: 100%;
185
- }
186
-
187
- .problem-pane-module_problem-content__rYzbh {
188
- overflow-y: auto;
189
- }
190
- .problem-pane-module_no-problems__Ub8R- {
191
- padding: 10px;
192
- }
193
-
194
- .problem-pane-module_internal-compiler-error__laE4f {
195
- padding: 10px;
196
- }
197
-
198
198
  .diagnostic-list-module_list__6tVpz {
199
199
  }
200
200
 
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { c as createBrowserHost, a as createUrlStateStorage, r as registerMonacoLanguage } from './state-storage-II_txdR1.js';
1
+ export { c as createBrowserHost, a as createUrlStateStorage, r as registerMonacoLanguage } from './state-storage-C_Vk3Rrw.js';
2
2
  import '@typespec/compiler';
3
3
  import 'monaco-editor';
4
4
  import 'vscode-languageserver';
@@ -5,7 +5,7 @@ import debounce from 'debounce';
5
5
  import { editor, Uri, MarkerSeverity, KeyMod, KeyCode } from 'monaco-editor';
6
6
  import { CompletionItemTag } from 'vscode-languageserver';
7
7
  import { Settings24Regular, Save16Regular, Broom16Filled, Bug16Regular, ErrorCircle16Filled, Warning16Filled, ChevronDown16Regular } from '@fluentui/react-icons';
8
- import { g as getMonacoRange, c as createBrowserHost, r as registerMonacoLanguage, a as createUrlStateStorage } from '../state-storage-II_txdR1.js';
8
+ import { g as getMonacoRange, c as createBrowserHost, r as registerMonacoLanguage, a as createUrlStateStorage } from '../state-storage-C_Vk3Rrw.js';
9
9
  import { ColorProvider, TypeSpecProgramViewer } from '@typespec/html-program-viewer';
10
10
  import { getSourceLocation } from '@typespec/compiler';
11
11
  import { createRoot } from 'react-dom/client';
@@ -50,7 +50,7 @@ const VersionSelector = memo(({ versions, selected, latest, onChange }) => {
50
50
  const changeVersion = useCallback((ev, data) => {
51
51
  onChange(versions.find((x) => x.name === data.value));
52
52
  }, [versions, onChange]);
53
- return (jsxs("div", { children: [jsx(Title3, { children: "Select release" }), jsx(Select, { value: selected, onChange: changeVersion, children: versions.map((version) => (jsxs("option", { value: version.name, children: [version.label, " ", version.name === latest ? "(latest)" : ""] }, version.name))) })] }));
53
+ return (jsxs("div", { children: [jsx(Title3, { children: "Select release" }), jsx(Select, { value: selected, onChange: changeVersion, "aria-label": "Select version", children: versions.map((version) => (jsxs("option", { value: version.name, children: [version.label, " ", version.name === latest ? "(latest)" : ""] }, version.name))) })] }));
54
54
  });
55
55
 
56
56
  const Footer = ({ className, children }) => {
@@ -64,7 +64,7 @@ const EmitterDropdown = ({ emitters, onSelectedEmitterChange, selectedEmitter, }
64
64
  const handleSelected = useCallback((evt) => {
65
65
  onSelectedEmitterChange(evt.target.value);
66
66
  }, [onSelectedEmitterChange]);
67
- return (jsxs(Select, { className: "sample-dropdown", onChange: handleSelected, value: selectedEmitter, children: [jsx("option", { value: "", disabled: true, children: "Select emitter..." }), options] }));
67
+ return (jsxs(Select, { className: "sample-dropdown", onChange: handleSelected, value: selectedEmitter, "aria-label": "Select an emitter", children: [jsx("option", { value: "", disabled: true, children: "Select emitter..." }), options] }));
68
68
  };
69
69
 
70
70
  const SamplesDropdown = ({ samples, selectedSampleName, onSelectedSampleNameChange, }) => {
@@ -76,7 +76,7 @@ const SamplesDropdown = ({ samples, selectedSampleName, onSelectedSampleNameChan
76
76
  onSelectedSampleNameChange(evt.target.value);
77
77
  }
78
78
  }, [onSelectedSampleNameChange]);
79
- return (jsxs(Select, { className: "sample-dropdown", onChange: handleSelected, value: selectedSampleName !== null && selectedSampleName !== void 0 ? selectedSampleName : "", children: [jsx("option", { value: "", disabled: true, children: "Select sample..." }), options] }));
79
+ return (jsxs(Select, { className: "sample-dropdown", onChange: handleSelected, value: selectedSampleName !== null && selectedSampleName !== void 0 ? selectedSampleName : "", "aria-label": "Select a sample", children: [jsx("option", { value: "", disabled: true, children: "Select sample..." }), options] }));
80
80
  };
81
81
 
82
82
  var style$9 = {"form":"emitter-options-form-module_form__dm2RP","item":"emitter-options-form-module_item__WocHP","switch":"emitter-options-form-module_switch__d4EQs"};
@@ -170,7 +170,7 @@ const CompilerSettings = ({ selectedEmitter, host, options, onOptionsChanged, })
170
170
 
171
171
  const CompilerSettingsDialogButton = ({ selectedEmitter, compilerOptions, onCompilerOptionsChange, }) => {
172
172
  const { host } = usePlaygroundContext();
173
- return (jsxs(Dialog, { children: [jsx(DialogTrigger, { children: jsx(ToolbarButton, { icon: jsx(Settings24Regular, {}) }) }), jsx(DialogSurface, { children: jsxs(DialogBody, { children: [jsx(DialogTitle, { children: "Settings" }), jsx(DialogContent, { children: jsx(CompilerSettings, { host: host, selectedEmitter: selectedEmitter, options: compilerOptions, onOptionsChanged: onCompilerOptionsChange }) })] }) })] }));
173
+ return (jsxs(Dialog, { children: [jsx(DialogTrigger, { children: jsx(ToolbarButton, { icon: jsx(Settings24Regular, {}), "aria-label": "Open Settings" }) }), jsx(DialogSurface, { children: jsxs(DialogBody, { children: [jsx(DialogTitle, { children: "Settings" }), jsx(DialogContent, { children: jsx(CompilerSettings, { host: host, selectedEmitter: selectedEmitter, options: compilerOptions, onOptionsChanged: onCompilerOptionsChange }) })] }) })] }));
174
174
  };
175
175
 
176
176
  var style$8 = {"bar":"editor-command-bar-module_bar__5q4D5","divider":"editor-command-bar-module_divider__iDahk","spacer":"editor-command-bar-module_spacer__hlHE9"};
@@ -300,7 +300,7 @@ const FileOutput = ({ filename, content, viewers }) => {
300
300
  var _a;
301
301
  return (_a = viewers.find((x) => x.key === selected)) === null || _a === void 0 ? void 0 : _a.render;
302
302
  }, [selected, viewers]);
303
- return (jsxs("div", { className: style$7["file-output"], children: [jsx("div", { className: style$7["viewer-selector"], children: jsx(Select, { value: selected, onChange: handleSelected, children: viewers.map(({ key, label }) => (jsx("option", { value: key, children: label }, key))) }) }), selectedRender && selectedRender({ filename, content })] }));
303
+ return (jsxs("div", { className: style$7["file-output"], children: [jsx("div", { className: style$7["viewer-selector"], children: jsx(Select, { value: selected, onChange: handleSelected, "aria-label": "Select viewer", children: viewers.map(({ key, label }) => (jsx("option", { value: key, children: label }, key))) }) }), selectedRender && selectedRender({ filename, content })] }));
304
304
  };
305
305
 
306
306
  var style$6 = {"tabs":"output-tabs-module_tabs__MFCRl","tab-divider":"output-tabs-module_tab-divider__9Fv--","tab":"output-tabs-module_tab__FJ78k","tab--selected":"output-tabs-module_tab--selected__GjCZY"};
@@ -503,7 +503,7 @@ const Container = ({ children, className, status, onClick, collaped }) => {
503
503
  var style$1 = {"problem-pane":"problem-pane-module_problem-pane__GJKF4","problem-content":"problem-pane-module_problem-content__rYzbh","no-problems":"problem-pane-module_no-problems__Ub8R-","internal-compiler-error":"problem-pane-module_internal-compiler-error__laE4f"};
504
504
 
505
505
  const ProblemPane = ({ collapsed, compilationState, onHeaderClick, onDiagnosticSelected, }) => {
506
- return (jsxs("div", { className: style$1["problem-pane"], children: [jsx(ProblemPaneHeader, { compilationState: compilationState, onClick: onHeaderClick, collaped: collapsed }), jsx("div", { className: style$1["problem-content"], children: jsx(ProblemPaneContent, { compilationState: compilationState, onDiagnosticSelected: onDiagnosticSelected }) })] }));
506
+ return (jsxs("div", { className: style$1["problem-pane"], children: [jsx(ProblemPaneHeader, { compilationState: compilationState, onClick: onHeaderClick, collaped: collapsed }), jsx("div", { className: style$1["problem-content"], "aria-hidden": collapsed, children: jsx(ProblemPaneContent, { compilationState: compilationState, onDiagnosticSelected: onDiagnosticSelected }) })] }));
507
507
  };
508
508
  const ProblemPaneContent = ({ compilationState, onDiagnosticSelected, }) => {
509
509
  if (compilationState === undefined) {