@typespec/playground 0.8.0-dev.0 → 0.8.0-dev.2
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.js +1 -1
- package/dist/react/index.js +37 -42
- package/dist/{services-VCejxTUV.js → services-CPLOnj6Z.js} +12 -12
- package/dist/state-storage.js +3 -3
- package/dist/vite/index.js +3 -3
- package/dist/vite.config.d.ts.map +1 -1
- package/package.json +22 -22
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { c as createBrowserHost, r as registerMonacoLanguage } from './services-
|
|
1
|
+
export { c as createBrowserHost, r as registerMonacoLanguage } from './services-CPLOnj6Z.js';
|
|
2
2
|
export { createUrlStateStorage } from './state-storage.js';
|
|
3
3
|
|
|
4
4
|
function registerMonacoDefaultWorkersForVite() {
|
package/dist/react/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { mergeClasses, Popover, PopoverTrigger, PopoverSurface, Title3, Table, T
|
|
|
5
5
|
import { Settings24Regular, Save16Regular, Broom16Filled, Bug16Regular, FolderListRegular, DataLineRegular, ErrorCircle16Filled, Warning16Filled, ChevronDown16Regular } from '@fluentui/react-icons';
|
|
6
6
|
import debounce from 'debounce';
|
|
7
7
|
import { CompletionItemTag } from 'vscode-languageserver';
|
|
8
|
-
import { a as resolveVirtualPath, g as getMonacoRange, c as createBrowserHost, r as registerMonacoLanguage } from '../services-
|
|
8
|
+
import { a as resolveVirtualPath, g as getMonacoRange, c as createBrowserHost, r as registerMonacoLanguage } from '../services-CPLOnj6Z.js';
|
|
9
9
|
import { ErrorBoundary } from 'react-error-boundary';
|
|
10
10
|
import { TypeGraph } from '@typespec/html-program-viewer/react';
|
|
11
11
|
import '@typespec/html-program-viewer/style.css';
|
|
@@ -13,11 +13,11 @@ import { getSourceLocation } from '@typespec/compiler';
|
|
|
13
13
|
import { createRoot } from 'react-dom/client';
|
|
14
14
|
import { createUrlStateStorage } from '../state-storage.js';
|
|
15
15
|
|
|
16
|
-
const PlaygroundContext = createContext(
|
|
16
|
+
const PlaygroundContext = createContext(undefined);
|
|
17
17
|
const PlaygroundContextProvider = PlaygroundContext.Provider;
|
|
18
18
|
function usePlaygroundContext() {
|
|
19
19
|
const context = useContext(PlaygroundContext);
|
|
20
|
-
if (context ===
|
|
20
|
+
if (context === undefined) {
|
|
21
21
|
throw new Error("usePlaygroundContext must be used within a PlaygroundContextProvider");
|
|
22
22
|
}
|
|
23
23
|
return context;
|
|
@@ -138,7 +138,7 @@ const Footer = ({ className, children }) => {
|
|
|
138
138
|
|
|
139
139
|
function useControllableValue(controlledValue, defaultUncontrolledValue, onChange) {
|
|
140
140
|
const [value, setValue] = useState(defaultUncontrolledValue);
|
|
141
|
-
const isControlled = useMemo(() => controlledValue !==
|
|
141
|
+
const isControlled = useMemo(() => controlledValue !== undefined, []);
|
|
142
142
|
const currentValue = isControlled ? controlledValue : value;
|
|
143
143
|
const valueRef = useRef(currentValue);
|
|
144
144
|
const onChangeRef = useRef(onChange);
|
|
@@ -180,8 +180,8 @@ var hasRequiredReactJsxRuntime_production_min;
|
|
|
180
180
|
function requireReactJsxRuntime_production_min () {
|
|
181
181
|
if (hasRequiredReactJsxRuntime_production_min) return reactJsxRuntime_production_min;
|
|
182
182
|
hasRequiredReactJsxRuntime_production_min = 1;
|
|
183
|
-
var f=require$$0,k=Symbol.for("react.element"),l=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key
|
|
184
|
-
function q(c,a,g){var b,d={},e=null,h=null;
|
|
183
|
+
var f=require$$0,k=Symbol.for("react.element"),l=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:true,ref:true,__self:true,__source:true};
|
|
184
|
+
function q(c,a,g){var b,d={},e=null,h=null;undefined!==g&&(e=""+g);undefined!==a.key&&(e=""+a.key);undefined!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a) undefined===d[b]&&(d[b]=a[b]);return {$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}reactJsxRuntime_production_min.Fragment=l;reactJsxRuntime_production_min.jsx=q;reactJsxRuntime_production_min.jsxs=q;
|
|
185
185
|
return reactJsxRuntime_production_min;
|
|
186
186
|
}
|
|
187
187
|
|
|
@@ -787,7 +787,7 @@ function requireReactJsxRuntime_development () {
|
|
|
787
787
|
|
|
788
788
|
for (var typeSpecName in typeSpecs) {
|
|
789
789
|
if (has(typeSpecs, typeSpecName)) {
|
|
790
|
-
var error$1 =
|
|
790
|
+
var error$1 = undefined; // Prop type validation may throw. In case they do, we don't want to
|
|
791
791
|
// fail the render phase where it didn't fail before. So we log it.
|
|
792
792
|
// After these have been cleaned up, we'll let them throw.
|
|
793
793
|
|
|
@@ -911,11 +911,6 @@ function requireReactJsxRuntime_development () {
|
|
|
911
911
|
};
|
|
912
912
|
var specialPropKeyWarningShown;
|
|
913
913
|
var specialPropRefWarningShown;
|
|
914
|
-
var didWarnAboutStringRefs;
|
|
915
|
-
|
|
916
|
-
{
|
|
917
|
-
didWarnAboutStringRefs = {};
|
|
918
|
-
}
|
|
919
914
|
|
|
920
915
|
function hasValidRef(config) {
|
|
921
916
|
{
|
|
@@ -947,15 +942,7 @@ function requireReactJsxRuntime_development () {
|
|
|
947
942
|
|
|
948
943
|
function warnIfStringRefCannotBeAutoConverted(config, self) {
|
|
949
944
|
{
|
|
950
|
-
if (typeof config.ref === 'string' && ReactCurrentOwner.current && self
|
|
951
|
-
var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
|
|
952
|
-
|
|
953
|
-
if (!didWarnAboutStringRefs[componentName]) {
|
|
954
|
-
error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);
|
|
955
|
-
|
|
956
|
-
didWarnAboutStringRefs[componentName] = true;
|
|
957
|
-
}
|
|
958
|
-
}
|
|
945
|
+
if (typeof config.ref === 'string' && ReactCurrentOwner.current && self) ;
|
|
959
946
|
}
|
|
960
947
|
}
|
|
961
948
|
|
|
@@ -1521,13 +1508,21 @@ function requireReactJsxRuntime_development () {
|
|
|
1521
1508
|
return reactJsxRuntime_development;
|
|
1522
1509
|
}
|
|
1523
1510
|
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1511
|
+
var hasRequiredJsxRuntime;
|
|
1512
|
+
|
|
1513
|
+
function requireJsxRuntime () {
|
|
1514
|
+
if (hasRequiredJsxRuntime) return jsxRuntime.exports;
|
|
1515
|
+
hasRequiredJsxRuntime = 1;
|
|
1516
|
+
|
|
1517
|
+
if (process.env.NODE_ENV === 'production') {
|
|
1518
|
+
jsxRuntime.exports = requireReactJsxRuntime_production_min();
|
|
1519
|
+
} else {
|
|
1520
|
+
jsxRuntime.exports = requireReactJsxRuntime_development();
|
|
1521
|
+
}
|
|
1522
|
+
return jsxRuntime.exports;
|
|
1528
1523
|
}
|
|
1529
1524
|
|
|
1530
|
-
var jsxRuntimeExports =
|
|
1525
|
+
var jsxRuntimeExports = requireJsxRuntime();
|
|
1531
1526
|
|
|
1532
1527
|
function Pane({
|
|
1533
1528
|
children,
|
|
@@ -1926,7 +1921,7 @@ const EmitterOptionsForm = ({
|
|
|
1926
1921
|
[library.name, options, optionsChanged]
|
|
1927
1922
|
);
|
|
1928
1923
|
const emitterOptionsSchema = library.definition?.emitter?.options?.properties;
|
|
1929
|
-
if (emitterOptionsSchema ===
|
|
1924
|
+
if (emitterOptionsSchema === undefined) {
|
|
1930
1925
|
return /* @__PURE__ */ jsx(Fragment, { children: '"No options"' });
|
|
1931
1926
|
}
|
|
1932
1927
|
const entries = Object.entries(emitterOptionsSchema);
|
|
@@ -2175,8 +2170,8 @@ const EditorCommandBar = ({
|
|
|
2175
2170
|
onSelectedSampleNameChange,
|
|
2176
2171
|
commandBarButtons
|
|
2177
2172
|
}) => {
|
|
2178
|
-
const documentation = documentationUrl ? /* @__PURE__ */ jsx("label", { children: /* @__PURE__ */ jsx(Link, { href: documentationUrl, target: "_blank", children: "Docs" }) }) :
|
|
2179
|
-
const bugButton = fileBug ? /* @__PURE__ */ jsx(FileBugButton, { onClick: fileBug }) :
|
|
2173
|
+
const documentation = documentationUrl ? /* @__PURE__ */ jsx("label", { children: /* @__PURE__ */ jsx(Link, { href: documentationUrl, target: "_blank", children: "Docs" }) }) : undefined;
|
|
2174
|
+
const bugButton = fileBug ? /* @__PURE__ */ jsx(FileBugButton, { onClick: fileBug }) : undefined;
|
|
2180
2175
|
const emitters = useMemo(
|
|
2181
2176
|
() => Object.values(host.libraries).filter((x) => x.isEmitter).map((x) => x.name),
|
|
2182
2177
|
[host.libraries]
|
|
@@ -2420,7 +2415,7 @@ const OutputView = ({
|
|
|
2420
2415
|
() => resolveViewers(viewers, fileViewers),
|
|
2421
2416
|
[fileViewers, viewers]
|
|
2422
2417
|
);
|
|
2423
|
-
if (compilationState ===
|
|
2418
|
+
if (compilationState === undefined) {
|
|
2424
2419
|
return /* @__PURE__ */ jsx(Fragment, {});
|
|
2425
2420
|
}
|
|
2426
2421
|
if ("internalCompilerError" in compilationState) {
|
|
@@ -2571,7 +2566,7 @@ const style$1 = {
|
|
|
2571
2566
|
|
|
2572
2567
|
const ProblemPaneHeader = memo(({ compilationState, ...props }) => {
|
|
2573
2568
|
const noProblem = /* @__PURE__ */ jsx(Container, { status: "none", ...props, children: "No problems" });
|
|
2574
|
-
if (compilationState ===
|
|
2569
|
+
if (compilationState === undefined) {
|
|
2575
2570
|
return noProblem;
|
|
2576
2571
|
}
|
|
2577
2572
|
if ("internalCompilerError" in compilationState) {
|
|
@@ -2605,7 +2600,7 @@ const Container = ({ children, className, status, onClick, collaped }) => {
|
|
|
2605
2600
|
return /* @__PURE__ */ jsxs(
|
|
2606
2601
|
"div",
|
|
2607
2602
|
{
|
|
2608
|
-
tabIndex: onClick ===
|
|
2603
|
+
tabIndex: onClick === undefined ? undefined : 0,
|
|
2609
2604
|
className: mergeClasses(
|
|
2610
2605
|
style$1["header"],
|
|
2611
2606
|
status === "error" && style$1["header--error"],
|
|
@@ -2664,7 +2659,7 @@ const ProblemPaneContent = ({
|
|
|
2664
2659
|
compilationState,
|
|
2665
2660
|
onDiagnosticSelected
|
|
2666
2661
|
}) => {
|
|
2667
|
-
if (compilationState ===
|
|
2662
|
+
if (compilationState === undefined) {
|
|
2668
2663
|
return /* @__PURE__ */ jsx(Fragment, {});
|
|
2669
2664
|
}
|
|
2670
2665
|
if ("internalCompilerError" in compilationState) {
|
|
@@ -2676,7 +2671,7 @@ const ProblemPaneContent = ({
|
|
|
2676
2671
|
|
|
2677
2672
|
const Playground = (props) => {
|
|
2678
2673
|
const { host, onSave } = props;
|
|
2679
|
-
const editorRef = useRef(
|
|
2674
|
+
const editorRef = useRef(undefined);
|
|
2680
2675
|
useEffect(() => {
|
|
2681
2676
|
editor.setTheme(props.editorOptions?.theme ?? "typespec");
|
|
2682
2677
|
}, [props.editorOptions?.theme]);
|
|
@@ -2700,7 +2695,7 @@ const Playground = (props) => {
|
|
|
2700
2695
|
return Boolean(selectedSampleName && content === props.samples?.[selectedSampleName]?.content);
|
|
2701
2696
|
}, [content, selectedSampleName, props.samples]);
|
|
2702
2697
|
const typespecModel = useMonacoModel("inmemory://test/main.tsp", "typespec");
|
|
2703
|
-
const [compilationState, setCompilationState] = useState(
|
|
2698
|
+
const [compilationState, setCompilationState] = useState(undefined);
|
|
2704
2699
|
const doCompile = useCallback(async () => {
|
|
2705
2700
|
const content2 = typespecModel.getValue();
|
|
2706
2701
|
setContent(content2);
|
|
@@ -2712,7 +2707,7 @@ const Playground = (props) => {
|
|
|
2712
2707
|
...getMonacoRange(typespecCompiler, diag.target),
|
|
2713
2708
|
message: diag.message,
|
|
2714
2709
|
severity: diag.severity === "error" ? MarkerSeverity.Error : MarkerSeverity.Warning,
|
|
2715
|
-
tags: diag.code === "deprecated" ? [CompletionItemTag.Deprecated] :
|
|
2710
|
+
tags: diag.code === "deprecated" ? [CompletionItemTag.Deprecated] : undefined
|
|
2716
2711
|
}));
|
|
2717
2712
|
editor.setModelMarkers(typespecModel, "owner", markers ?? []);
|
|
2718
2713
|
} else {
|
|
@@ -2767,7 +2762,7 @@ const Playground = (props) => {
|
|
|
2767
2762
|
content: typespecModel.getValue(),
|
|
2768
2763
|
emitter: selectedEmitter,
|
|
2769
2764
|
options: compilerOptions,
|
|
2770
|
-
sampleName: isSampleUntouched ? selectedSampleName :
|
|
2765
|
+
sampleName: isSampleUntouched ? selectedSampleName : undefined
|
|
2771
2766
|
});
|
|
2772
2767
|
}
|
|
2773
2768
|
}, [
|
|
@@ -2843,7 +2838,7 @@ const Playground = (props) => {
|
|
|
2843
2838
|
onSelectedSampleNameChange,
|
|
2844
2839
|
saveCode,
|
|
2845
2840
|
formatCode,
|
|
2846
|
-
fileBug: props.onFileBug ? fileBug :
|
|
2841
|
+
fileBug: props.onFileBug ? fileBug : undefined,
|
|
2847
2842
|
commandBarButtons: props.commandBarButtons,
|
|
2848
2843
|
documentationUrl: props.links?.documentationUrl
|
|
2849
2844
|
}
|
|
@@ -2882,8 +2877,8 @@ const Playground = (props) => {
|
|
|
2882
2877
|
] }) });
|
|
2883
2878
|
};
|
|
2884
2879
|
const verticalPaneSizesConst = {
|
|
2885
|
-
collapsed: [
|
|
2886
|
-
expanded: [
|
|
2880
|
+
collapsed: [undefined, 30],
|
|
2881
|
+
expanded: [undefined, 200]
|
|
2887
2882
|
};
|
|
2888
2883
|
const outputDir = resolveVirtualPath("tsp-output");
|
|
2889
2884
|
async function compile(host, content, selectedEmitter, options) {
|
|
@@ -2985,7 +2980,7 @@ const StandalonePlayground = (config) => {
|
|
|
2985
2980
|
},
|
|
2986
2981
|
[config.defaultEmitter, config.libraries, context]
|
|
2987
2982
|
);
|
|
2988
|
-
if (context ===
|
|
2983
|
+
if (context === undefined || fixedOptions === undefined) {
|
|
2989
2984
|
return config.fallback;
|
|
2990
2985
|
}
|
|
2991
2986
|
const options = {
|
|
@@ -2995,7 +2990,7 @@ const StandalonePlayground = (config) => {
|
|
|
2995
2990
|
};
|
|
2996
2991
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2997
2992
|
/* @__PURE__ */ jsx(Toaster, { toasterId }),
|
|
2998
|
-
|
|
2993
|
+
/* @__PURE__ */ jsx(Playground, { ...options })
|
|
2999
2994
|
] });
|
|
3000
2995
|
};
|
|
3001
2996
|
async function createReactPlayground(config) {
|
|
@@ -51,7 +51,7 @@ function createBrowserHostInternal(options) {
|
|
|
51
51
|
libraries,
|
|
52
52
|
async readUrl(url) {
|
|
53
53
|
const contents = virtualFs.get(url);
|
|
54
|
-
if (contents ===
|
|
54
|
+
if (contents === undefined) {
|
|
55
55
|
const e = new Error(`File ${url} not found.`);
|
|
56
56
|
e.code = "ENOENT";
|
|
57
57
|
throw e;
|
|
@@ -61,7 +61,7 @@ function createBrowserHostInternal(options) {
|
|
|
61
61
|
async readFile(path) {
|
|
62
62
|
path = resolveVirtualPath(path);
|
|
63
63
|
const contents = virtualFs.get(path);
|
|
64
|
-
if (contents ===
|
|
64
|
+
if (contents === undefined) {
|
|
65
65
|
const e = new Error(`File ${path} not found.`);
|
|
66
66
|
e.code = "ENOENT";
|
|
67
67
|
throw e;
|
|
@@ -101,7 +101,7 @@ function createBrowserHostInternal(options) {
|
|
|
101
101
|
async getJsImport(path) {
|
|
102
102
|
path = resolveVirtualPath(path);
|
|
103
103
|
const module = await jsImports.get(path);
|
|
104
|
-
if (module ===
|
|
104
|
+
if (module === undefined) {
|
|
105
105
|
const e = new Error(`Module ${path} not found`);
|
|
106
106
|
e.code = "MODULE_NOT_FOUND";
|
|
107
107
|
throw e;
|
|
@@ -185,7 +185,7 @@ function foldingRange(range2) {
|
|
|
185
185
|
return {
|
|
186
186
|
start: range2.startLine + 1,
|
|
187
187
|
end: range2.endLine + 1,
|
|
188
|
-
kind: range2.kind ? new monaco.languages.FoldingRangeKind(range2.kind) :
|
|
188
|
+
kind: range2.kind ? new monaco.languages.FoldingRangeKind(range2.kind) : undefined
|
|
189
189
|
};
|
|
190
190
|
}
|
|
191
191
|
function textEdits(edit) {
|
|
@@ -274,11 +274,11 @@ function getTypeSpecLanguageConfiguration() {
|
|
|
274
274
|
onEnterRules: TypeSpecLanguageConfiguration.onEnterRules.map((rule) => {
|
|
275
275
|
return {
|
|
276
276
|
beforeText: new RegExp(rule.beforeText.pattern),
|
|
277
|
-
previousLineText: "previousLineText" in rule ? new RegExp(rule.previousLineText.pattern) :
|
|
277
|
+
previousLineText: "previousLineText" in rule ? new RegExp(rule.previousLineText.pattern) : undefined,
|
|
278
278
|
action: {
|
|
279
279
|
indentAction: getIndentAction(rule.action.indent),
|
|
280
|
-
appendText: "appendText" in rule.action ? rule.action.appendText :
|
|
281
|
-
removeText: "removeText" in rule.action ? rule.action.removeText :
|
|
280
|
+
appendText: "appendText" in rule.action ? rule.action.appendText : undefined,
|
|
281
|
+
removeText: "removeText" in rule.action ? rule.action.removeText : undefined
|
|
282
282
|
}
|
|
283
283
|
};
|
|
284
284
|
})
|
|
@@ -295,7 +295,7 @@ async function registerMonacoLanguage(host) {
|
|
|
295
295
|
compilerHost: host,
|
|
296
296
|
getOpenDocumentByURL(url) {
|
|
297
297
|
const model = monaco.editor.getModel(monaco.Uri.parse(url));
|
|
298
|
-
return model ? textDocumentForModel(model) :
|
|
298
|
+
return model ? textDocumentForModel(model) : undefined;
|
|
299
299
|
},
|
|
300
300
|
sendDiagnostics() {
|
|
301
301
|
},
|
|
@@ -377,7 +377,7 @@ async function registerMonacoLanguage(host) {
|
|
|
377
377
|
case DocumentHighlightKind.Write:
|
|
378
378
|
return monaco.languages.DocumentHighlightKind.Write;
|
|
379
379
|
default:
|
|
380
|
-
return
|
|
380
|
+
return undefined;
|
|
381
381
|
}
|
|
382
382
|
}
|
|
383
383
|
function monacoHoverContents(contents) {
|
|
@@ -389,7 +389,7 @@ async function registerMonacoLanguage(host) {
|
|
|
389
389
|
}
|
|
390
390
|
return {
|
|
391
391
|
contents: monacoHoverContents(hover.contents),
|
|
392
|
-
range: hover.range ? LspToMonaco.range(hover.range) :
|
|
392
|
+
range: hover.range ? LspToMonaco.range(hover.range) : undefined
|
|
393
393
|
};
|
|
394
394
|
}
|
|
395
395
|
function monacoWorkspaceEdit(edit) {
|
|
@@ -397,7 +397,7 @@ async function registerMonacoLanguage(host) {
|
|
|
397
397
|
for (const [uri, changes] of Object.entries(edit.changes ?? {})) {
|
|
398
398
|
const resource = monaco.Uri.parse(uri);
|
|
399
399
|
for (const change of changes) {
|
|
400
|
-
edits.push({ resource, textEdit: LspToMonaco.textEdit(change), versionId:
|
|
400
|
+
edits.push({ resource, textEdit: LspToMonaco.textEdit(change), versionId: undefined });
|
|
401
401
|
}
|
|
402
402
|
}
|
|
403
403
|
return { edits };
|
|
@@ -556,7 +556,7 @@ async function registerMonacoLanguage(host) {
|
|
|
556
556
|
}
|
|
557
557
|
function getMonacoRange(typespecCompiler, target) {
|
|
558
558
|
const loc = typespecCompiler.getSourceLocation(target);
|
|
559
|
-
if (loc ===
|
|
559
|
+
if (loc === undefined || loc.file.path !== "/test/main.tsp") {
|
|
560
560
|
return {
|
|
561
561
|
startLineNumber: 1,
|
|
562
562
|
startColumn: 1,
|
package/dist/state-storage.js
CHANGED
|
@@ -24,7 +24,7 @@ function createUrlStateStorage(schema) {
|
|
|
24
24
|
`Error decompressing query parameter ${item.queryParam} with content:`,
|
|
25
25
|
value
|
|
26
26
|
);
|
|
27
|
-
return
|
|
27
|
+
return undefined;
|
|
28
28
|
}
|
|
29
29
|
} else {
|
|
30
30
|
return value;
|
|
@@ -39,7 +39,7 @@ function createUrlStateStorage(schema) {
|
|
|
39
39
|
`Error decompressing query parameter ${item.queryParam} with content:`,
|
|
40
40
|
value
|
|
41
41
|
);
|
|
42
|
-
return
|
|
42
|
+
return undefined;
|
|
43
43
|
}
|
|
44
44
|
} else {
|
|
45
45
|
return value;
|
|
@@ -50,7 +50,7 @@ function createUrlStateStorage(schema) {
|
|
|
50
50
|
history.pushState(null, "", window.location.pathname + "?" + params.toString());
|
|
51
51
|
}
|
|
52
52
|
function resolveSearchParams(data, mergeWithExisting = false) {
|
|
53
|
-
const params = new URLSearchParams(mergeWithExisting ? location.search :
|
|
53
|
+
const params = new URLSearchParams(mergeWithExisting ? location.search : undefined);
|
|
54
54
|
for (const [key, item] of Object.entries(schema)) {
|
|
55
55
|
const value = data[key];
|
|
56
56
|
if (value) {
|
package/dist/vite/index.js
CHANGED
|
@@ -13,7 +13,7 @@ function definePlaygroundViteConfig(config) {
|
|
|
13
13
|
if (id.includes("/node_modules/monaco-editor/esm/vs/editor")) {
|
|
14
14
|
return "monaco";
|
|
15
15
|
}
|
|
16
|
-
return
|
|
16
|
+
return undefined;
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
}
|
|
@@ -31,7 +31,7 @@ function definePlaygroundViteConfig(config) {
|
|
|
31
31
|
!config.skipBundleLibraries ? typespecBundlePlugin({
|
|
32
32
|
folderName: "libs",
|
|
33
33
|
libraries: config.libraries
|
|
34
|
-
}) :
|
|
34
|
+
}) : undefined
|
|
35
35
|
],
|
|
36
36
|
server: {
|
|
37
37
|
fs: {
|
|
@@ -83,7 +83,7 @@ function playgroundManifestPlugin(config) {
|
|
|
83
83
|
};`;
|
|
84
84
|
return file;
|
|
85
85
|
}
|
|
86
|
-
return
|
|
86
|
+
return undefined;
|
|
87
87
|
}
|
|
88
88
|
};
|
|
89
89
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite.config.d.ts","sourceRoot":"","sources":["../vite.config.ts"],"names":[],"mappings":";AAwBA,
|
|
1
|
+
{"version":3,"file":"vite.config.d.ts","sourceRoot":"","sources":["../vite.config.ts"],"names":[],"mappings":";AAwBA,wBA0CG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typespec/playground",
|
|
3
|
-
"version": "0.8.0-dev.
|
|
3
|
+
"version": "0.8.0-dev.2",
|
|
4
4
|
"author": "Microsoft Corporation",
|
|
5
5
|
"description": "TypeSpec playground UI components.",
|
|
6
6
|
"homepage": "https://typespec.io",
|
|
@@ -59,8 +59,8 @@
|
|
|
59
59
|
"!dist/test/**"
|
|
60
60
|
],
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@fluentui/react-components": "~9.
|
|
63
|
-
"@fluentui/react-icons": "^2.0.
|
|
62
|
+
"@fluentui/react-components": "~9.57.0",
|
|
63
|
+
"@fluentui/react-icons": "^2.0.271",
|
|
64
64
|
"@typespec/bundler": "~0.1.11 || >=0.2.0-dev <0.2.0",
|
|
65
65
|
"@typespec/compiler": "~0.64.0 || >=0.65.0-dev <0.65.0",
|
|
66
66
|
"@typespec/html-program-viewer": "~0.64.0 || >=0.65.0-dev <0.65.0",
|
|
@@ -71,40 +71,40 @@
|
|
|
71
71
|
"@typespec/rest": "~0.64.0 || >=0.65.0-dev <0.65.0",
|
|
72
72
|
"@typespec/versioning": "~0.64.0 || >=0.65.0-dev <0.65.0",
|
|
73
73
|
"clsx": "^2.1.1",
|
|
74
|
-
"debounce": "~2.
|
|
74
|
+
"debounce": "~2.2.0",
|
|
75
75
|
"lzutf8": "0.6.3",
|
|
76
|
-
"monaco-editor": "~0.52.
|
|
76
|
+
"monaco-editor": "~0.52.2",
|
|
77
77
|
"react": "~18.3.1",
|
|
78
78
|
"react-dom": "~18.3.1",
|
|
79
|
-
"react-error-boundary": "^
|
|
80
|
-
"swagger-ui-dist": "^5.
|
|
79
|
+
"react-error-boundary": "^5.0.0",
|
|
80
|
+
"swagger-ui-dist": "^5.18.2",
|
|
81
81
|
"vscode-languageserver": "~9.0.1",
|
|
82
82
|
"vscode-languageserver-textdocument": "~1.0.12"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
|
-
"@babel/core": "^7.
|
|
86
|
-
"@playwright/test": "^1.
|
|
87
|
-
"@storybook/addon-actions": "^8.
|
|
88
|
-
"@storybook/cli": "^8.
|
|
89
|
-
"@storybook/react": "^8.
|
|
90
|
-
"@storybook/react-vite": "^8.
|
|
91
|
-
"@storybook/test": "^8.
|
|
92
|
-
"@storybook/types": "^8.
|
|
85
|
+
"@babel/core": "^7.26.0",
|
|
86
|
+
"@playwright/test": "^1.49.1",
|
|
87
|
+
"@storybook/addon-actions": "^8.5.0",
|
|
88
|
+
"@storybook/cli": "^8.5.0",
|
|
89
|
+
"@storybook/react": "^8.5.0",
|
|
90
|
+
"@storybook/react-vite": "^8.5.0",
|
|
91
|
+
"@storybook/test": "^8.5.0",
|
|
92
|
+
"@storybook/types": "^8.5.0",
|
|
93
93
|
"@types/debounce": "~1.2.4",
|
|
94
|
-
"@types/node": "~22.
|
|
94
|
+
"@types/node": "~22.10.10",
|
|
95
95
|
"@types/react": "~18.3.11",
|
|
96
96
|
"@types/react-dom": "~18.3.0",
|
|
97
97
|
"@types/swagger-ui-dist": "~3.30.5",
|
|
98
98
|
"@typespec/bundler": "~0.1.11 || >=0.2.0-dev <0.2.0",
|
|
99
|
-
"@vitejs/plugin-react": "~4.3.
|
|
100
|
-
"c8": "^10.1.
|
|
99
|
+
"@vitejs/plugin-react": "~4.3.4",
|
|
100
|
+
"c8": "^10.1.3",
|
|
101
101
|
"cross-env": "~7.0.3",
|
|
102
|
-
"es-module-shims": "~
|
|
102
|
+
"es-module-shims": "~2.0.5",
|
|
103
103
|
"rimraf": "~6.0.1",
|
|
104
|
-
"typescript": "~5.
|
|
105
|
-
"vite": "^
|
|
104
|
+
"typescript": "~5.7.3",
|
|
105
|
+
"vite": "^6.0.11",
|
|
106
106
|
"vite-plugin-checker": "^0.8.0",
|
|
107
|
-
"vite-plugin-dts": "4.
|
|
107
|
+
"vite-plugin-dts": "4.5.0",
|
|
108
108
|
"@typespec/react-components": "~0.57.0"
|
|
109
109
|
},
|
|
110
110
|
"peerDependencies": {},
|