@webiny/app-sdk-playground 6.3.0 → 6.4.0-beta.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.
Files changed (45) hide show
  1. package/PermissionsSchema.js +22 -14
  2. package/PermissionsSchema.js.map +1 -1
  3. package/SecurityPermission.js +11 -14
  4. package/SecurityPermission.js.map +1 -1
  5. package/index.js +42 -41
  6. package/index.js.map +1 -1
  7. package/package.json +8 -8
  8. package/plugins/Playground.js +31 -43
  9. package/plugins/Playground.js.map +1 -1
  10. package/plugins/components/CodeEditor.js +48 -59
  11. package/plugins/components/CodeEditor.js.map +1 -1
  12. package/plugins/components/OutputLine.js +14 -15
  13. package/plugins/components/OutputLine.js.map +1 -1
  14. package/plugins/components/OutputPanel.js +19 -22
  15. package/plugins/components/OutputPanel.js.map +1 -1
  16. package/plugins/components/PlaygroundToolbar.js +23 -29
  17. package/plugins/components/PlaygroundToolbar.js.map +1 -1
  18. package/plugins/consoleCapture.js +61 -66
  19. package/plugins/consoleCapture.js.map +1 -1
  20. package/plugins/declarations/cms.js +2 -2
  21. package/plugins/declarations/cms.js.map +1 -1
  22. package/plugins/declarations/common.js +2 -2
  23. package/plugins/declarations/common.js.map +1 -1
  24. package/plugins/declarations/fileManager.js +2 -2
  25. package/plugins/declarations/fileManager.js.map +1 -1
  26. package/plugins/declarations/languages.js +2 -2
  27. package/plugins/declarations/languages.js.map +1 -1
  28. package/plugins/declarations/tasks.js +2 -2
  29. package/plugins/declarations/tasks.js.map +1 -1
  30. package/plugins/declarations/tenantManager.js +2 -2
  31. package/plugins/declarations/tenantManager.js.map +1 -1
  32. package/plugins/defaultCode.js +2 -2
  33. package/plugins/defaultCode.js.map +1 -1
  34. package/plugins/sdkGlobalDeclaration.js +2 -13
  35. package/plugins/sdkGlobalDeclaration.js.map +1 -1
  36. package/plugins/types.js +2 -2
  37. package/plugins/types.js.map +1 -1
  38. package/plugins/useCodeExecution.js +45 -59
  39. package/plugins/useCodeExecution.js.map +1 -1
  40. package/plugins/useMonacoEditor.js +43 -48
  41. package/plugins/useMonacoEditor.js.map +1 -1
  42. package/plugins/useResizableSplit.js +35 -38
  43. package/plugins/useResizableSplit.js.map +1 -1
  44. package/routes.js +6 -5
  45. package/routes.js.map +1 -1
@@ -1,44 +1,31 @@
1
1
  import { useSnackbar, useTenantContext } from "@webiny/app-admin";
2
2
  import { AuthenticationContextFeature } from "@webiny/app-admin/features/security/AuthenticationContext/feature.js";
3
3
  import { useFeature } from "@webiny/app";
4
- import { config as appConfig } from "@webiny/app/config.js";
4
+ import { config } from "@webiny/app/config.js";
5
5
  import { Webiny } from "@webiny/sdk";
6
6
  import { useCallback, useState } from "react";
7
7
  import { createCustomConsole } from "./consoleCapture.js";
8
- export function useCodeExecution(code, editorRef) {
9
- const [output, setOutput] = useState([]);
10
- const [isRunning, setIsRunning] = useState(false);
11
- const {
12
- showSnackbar
13
- } = useSnackbar();
14
- const {
15
- tenant
16
- } = useTenantContext();
17
- const {
18
- authenticationContext
19
- } = useFeature(AuthenticationContextFeature);
20
- const handleRun = useCallback(async () => {
21
- const apiUrl = appConfig.getKey("API_URL", process.env.REACT_APP_API_URL);
22
- if (!apiUrl) {
23
- showSnackbar("API URL is not configured");
24
- return;
25
- }
26
- const currentCode = editorRef.current?.getValue() || code;
27
- setIsRunning(true);
28
- setOutput([]);
29
- const messages = [];
30
-
31
- // Create custom console for capturing output.
32
- const customConsole = createCustomConsole(messages, setOutput);
33
- try {
34
- const sdk = new Webiny({
35
- endpoint: apiUrl,
36
- tenant: tenant || undefined,
37
- token: () => authenticationContext.getIdToken()
38
- });
39
-
40
- // Wrap code in async function to allow top-level await.
41
- const wrappedCode = `
8
+ function useCodeExecution(code, editorRef) {
9
+ const [output, setOutput] = useState([]);
10
+ const [isRunning, setIsRunning] = useState(false);
11
+ const { showSnackbar } = useSnackbar();
12
+ const { tenant } = useTenantContext();
13
+ const { authenticationContext } = useFeature(AuthenticationContextFeature);
14
+ const handleRun = useCallback(async ()=>{
15
+ const apiUrl = config.getKey("API_URL", process.env.REACT_APP_API_URL);
16
+ if (!apiUrl) return void showSnackbar("API URL is not configured");
17
+ const currentCode = editorRef.current?.getValue() || code;
18
+ setIsRunning(true);
19
+ setOutput([]);
20
+ const messages = [];
21
+ const customConsole = createCustomConsole(messages, setOutput);
22
+ try {
23
+ const sdk = new Webiny({
24
+ endpoint: apiUrl,
25
+ tenant: tenant || void 0,
26
+ token: ()=>authenticationContext.getIdToken()
27
+ });
28
+ const wrappedCode = `
42
29
  (async () => {
43
30
  try {
44
31
  ${currentCode}
@@ -48,30 +35,29 @@ export function useCodeExecution(code, editorRef) {
48
35
  }
49
36
  })()
50
37
  `;
51
-
52
- // Create function with injected dependencies.
53
- const fn = new Function("console", "sdk", "window", wrappedCode);
54
-
55
- // Execute with custom console and SDK.
56
- const result = fn(customConsole, sdk, {
57
- sdk
58
- });
59
-
60
- // Handle async results.
61
- if (result && typeof result.then === "function") {
62
- await result;
63
- }
64
- } catch (error) {
65
- customConsole.error("Execution error:", error);
66
- } finally {
67
- setIsRunning(false);
68
- }
69
- }, [code, editorRef, showSnackbar, tenant, authenticationContext]);
70
- return {
71
- output,
72
- isRunning,
73
- handleRun
74
- };
38
+ const fn = new Function("console", "sdk", "window", wrappedCode);
39
+ const result = fn(customConsole, sdk, {
40
+ sdk
41
+ });
42
+ if (result && "function" == typeof result.then) await result;
43
+ } catch (error) {
44
+ customConsole.error("Execution error:", error);
45
+ } finally{
46
+ setIsRunning(false);
47
+ }
48
+ }, [
49
+ code,
50
+ editorRef,
51
+ showSnackbar,
52
+ tenant,
53
+ authenticationContext
54
+ ]);
55
+ return {
56
+ output,
57
+ isRunning,
58
+ handleRun
59
+ };
75
60
  }
61
+ export { useCodeExecution };
76
62
 
77
63
  //# sourceMappingURL=useCodeExecution.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useSnackbar","useTenantContext","AuthenticationContextFeature","useFeature","config","appConfig","Webiny","useCallback","useState","createCustomConsole","useCodeExecution","code","editorRef","output","setOutput","isRunning","setIsRunning","showSnackbar","tenant","authenticationContext","handleRun","apiUrl","getKey","process","env","REACT_APP_API_URL","currentCode","current","getValue","messages","customConsole","sdk","endpoint","undefined","token","getIdToken","wrappedCode","fn","Function","result","then","error"],"sources":["useCodeExecution.ts"],"sourcesContent":["import { useSnackbar, useTenantContext } from \"@webiny/app-admin\";\nimport { AuthenticationContextFeature } from \"@webiny/app-admin/features/security/AuthenticationContext/feature.js\";\nimport { useFeature } from \"@webiny/app\";\nimport { config as appConfig } from \"@webiny/app/config.js\";\nimport { Webiny } from \"@webiny/sdk\";\nimport type { editor } from \"monaco-editor\";\nimport type { MutableRefObject } from \"react\";\nimport { useCallback, useState } from \"react\";\nimport { createCustomConsole } from \"./consoleCapture.js\";\nimport type { ConsoleMessage } from \"./types.js\";\n\nexport function useCodeExecution(\n code: string,\n editorRef: MutableRefObject<editor.IStandaloneCodeEditor | null>\n) {\n const [output, setOutput] = useState<ConsoleMessage[]>([]);\n const [isRunning, setIsRunning] = useState(false);\n const { showSnackbar } = useSnackbar();\n const { tenant } = useTenantContext();\n const { authenticationContext } = useFeature(AuthenticationContextFeature);\n\n const handleRun = useCallback(async () => {\n const apiUrl = appConfig.getKey(\"API_URL\", process.env.REACT_APP_API_URL) as string;\n if (!apiUrl) {\n showSnackbar(\"API URL is not configured\");\n return;\n }\n\n const currentCode = editorRef.current?.getValue() || code;\n setIsRunning(true);\n setOutput([]);\n\n const messages: ConsoleMessage[] = [];\n\n // Create custom console for capturing output.\n const customConsole = createCustomConsole(messages, setOutput);\n\n try {\n const sdk = new Webiny({\n endpoint: apiUrl,\n tenant: tenant || undefined,\n token: () => authenticationContext.getIdToken() as Promise<string>\n });\n\n // Wrap code in async function to allow top-level await.\n const wrappedCode = `\n (async () => {\n try {\n ${currentCode}\n } catch (error) {\n console.error(\"Runtime error:\", error);\n throw error;\n }\n })()\n `;\n\n // Create function with injected dependencies.\n const fn = new Function(\"console\", \"sdk\", \"window\", wrappedCode);\n\n // Execute with custom console and SDK.\n const result = fn(customConsole, sdk, { sdk });\n\n // Handle async results.\n if (result && typeof result.then === \"function\") {\n await result;\n }\n } catch (error) {\n customConsole.error(\"Execution error:\", error);\n } finally {\n setIsRunning(false);\n }\n }, [code, editorRef, showSnackbar, tenant, authenticationContext]);\n\n return {\n output,\n isRunning,\n handleRun\n };\n}\n"],"mappings":"AAAA,SAASA,WAAW,EAAEC,gBAAgB,QAAQ,mBAAmB;AACjE,SAASC,4BAA4B,QAAQ,sEAAsE;AACnH,SAASC,UAAU,QAAQ,aAAa;AACxC,SAASC,MAAM,IAAIC,SAAS,QAAQ,uBAAuB;AAC3D,SAASC,MAAM,QAAQ,aAAa;AAGpC,SAASC,WAAW,EAAEC,QAAQ,QAAQ,OAAO;AAC7C,SAASC,mBAAmB;AAG5B,OAAO,SAASC,gBAAgBA,CAC5BC,IAAY,EACZC,SAAgE,EAClE;EACE,MAAM,CAACC,MAAM,EAAEC,SAAS,CAAC,GAAGN,QAAQ,CAAmB,EAAE,CAAC;EAC1D,MAAM,CAACO,SAAS,EAAEC,YAAY,CAAC,GAAGR,QAAQ,CAAC,KAAK,CAAC;EACjD,MAAM;IAAES;EAAa,CAAC,GAAGjB,WAAW,CAAC,CAAC;EACtC,MAAM;IAAEkB;EAAO,CAAC,GAAGjB,gBAAgB,CAAC,CAAC;EACrC,MAAM;IAAEkB;EAAsB,CAAC,GAAGhB,UAAU,CAACD,4BAA4B,CAAC;EAE1E,MAAMkB,SAAS,GAAGb,WAAW,CAAC,YAAY;IACtC,MAAMc,MAAM,GAAGhB,SAAS,CAACiB,MAAM,CAAC,SAAS,EAAEC,OAAO,CAACC,GAAG,CAACC,iBAAiB,CAAW;IACnF,IAAI,CAACJ,MAAM,EAAE;MACTJ,YAAY,CAAC,2BAA2B,CAAC;MACzC;IACJ;IAEA,MAAMS,WAAW,GAAGd,SAAS,CAACe,OAAO,EAAEC,QAAQ,CAAC,CAAC,IAAIjB,IAAI;IACzDK,YAAY,CAAC,IAAI,CAAC;IAClBF,SAAS,CAAC,EAAE,CAAC;IAEb,MAAMe,QAA0B,GAAG,EAAE;;IAErC;IACA,MAAMC,aAAa,GAAGrB,mBAAmB,CAACoB,QAAQ,EAAEf,SAAS,CAAC;IAE9D,IAAI;MACA,MAAMiB,GAAG,GAAG,IAAIzB,MAAM,CAAC;QACnB0B,QAAQ,EAAEX,MAAM;QAChBH,MAAM,EAAEA,MAAM,IAAIe,SAAS;QAC3BC,KAAK,EAAEA,CAAA,KAAMf,qBAAqB,CAACgB,UAAU,CAAC;MAClD,CAAC,CAAC;;MAEF;MACA,MAAMC,WAAW,GAAG;AAChC;AACA;AACA,0BAA0BV,WAAW;AACrC;AACA;AACA;AACA;AACA;AACA,aAAa;;MAED;MACA,MAAMW,EAAE,GAAG,IAAIC,QAAQ,CAAC,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAEF,WAAW,CAAC;;MAEhE;MACA,MAAMG,MAAM,GAAGF,EAAE,CAACP,aAAa,EAAEC,GAAG,EAAE;QAAEA;MAAI,CAAC,CAAC;;MAE9C;MACA,IAAIQ,MAAM,IAAI,OAAOA,MAAM,CAACC,IAAI,KAAK,UAAU,EAAE;QAC7C,MAAMD,MAAM;MAChB;IACJ,CAAC,CAAC,OAAOE,KAAK,EAAE;MACZX,aAAa,CAACW,KAAK,CAAC,kBAAkB,EAAEA,KAAK,CAAC;IAClD,CAAC,SAAS;MACNzB,YAAY,CAAC,KAAK,CAAC;IACvB;EACJ,CAAC,EAAE,CAACL,IAAI,EAAEC,SAAS,EAAEK,YAAY,EAAEC,MAAM,EAAEC,qBAAqB,CAAC,CAAC;EAElE,OAAO;IACHN,MAAM;IACNE,SAAS;IACTK;EACJ,CAAC;AACL","ignoreList":[]}
1
+ {"version":3,"file":"plugins/useCodeExecution.js","sources":["../../src/plugins/useCodeExecution.ts"],"sourcesContent":["import { useSnackbar, useTenantContext } from \"@webiny/app-admin\";\nimport { AuthenticationContextFeature } from \"@webiny/app-admin/features/security/AuthenticationContext/feature.js\";\nimport { useFeature } from \"@webiny/app\";\nimport { config as appConfig } from \"@webiny/app/config.js\";\nimport { Webiny } from \"@webiny/sdk\";\nimport type { editor } from \"monaco-editor\";\nimport type { MutableRefObject } from \"react\";\nimport { useCallback, useState } from \"react\";\nimport { createCustomConsole } from \"./consoleCapture.js\";\nimport type { ConsoleMessage } from \"./types.js\";\n\nexport function useCodeExecution(\n code: string,\n editorRef: MutableRefObject<editor.IStandaloneCodeEditor | null>\n) {\n const [output, setOutput] = useState<ConsoleMessage[]>([]);\n const [isRunning, setIsRunning] = useState(false);\n const { showSnackbar } = useSnackbar();\n const { tenant } = useTenantContext();\n const { authenticationContext } = useFeature(AuthenticationContextFeature);\n\n const handleRun = useCallback(async () => {\n const apiUrl = appConfig.getKey(\"API_URL\", process.env.REACT_APP_API_URL) as string;\n if (!apiUrl) {\n showSnackbar(\"API URL is not configured\");\n return;\n }\n\n const currentCode = editorRef.current?.getValue() || code;\n setIsRunning(true);\n setOutput([]);\n\n const messages: ConsoleMessage[] = [];\n\n // Create custom console for capturing output.\n const customConsole = createCustomConsole(messages, setOutput);\n\n try {\n const sdk = new Webiny({\n endpoint: apiUrl,\n tenant: tenant || undefined,\n token: () => authenticationContext.getIdToken() as Promise<string>\n });\n\n // Wrap code in async function to allow top-level await.\n const wrappedCode = `\n (async () => {\n try {\n ${currentCode}\n } catch (error) {\n console.error(\"Runtime error:\", error);\n throw error;\n }\n })()\n `;\n\n // Create function with injected dependencies.\n const fn = new Function(\"console\", \"sdk\", \"window\", wrappedCode);\n\n // Execute with custom console and SDK.\n const result = fn(customConsole, sdk, { sdk });\n\n // Handle async results.\n if (result && typeof result.then === \"function\") {\n await result;\n }\n } catch (error) {\n customConsole.error(\"Execution error:\", error);\n } finally {\n setIsRunning(false);\n }\n }, [code, editorRef, showSnackbar, tenant, authenticationContext]);\n\n return {\n output,\n isRunning,\n handleRun\n };\n}\n"],"names":["useCodeExecution","code","editorRef","output","setOutput","useState","isRunning","setIsRunning","showSnackbar","useSnackbar","tenant","useTenantContext","authenticationContext","useFeature","AuthenticationContextFeature","handleRun","useCallback","apiUrl","appConfig","process","currentCode","messages","customConsole","createCustomConsole","sdk","Webiny","undefined","wrappedCode","fn","Function","result","error"],"mappings":";;;;;;;AAWO,SAASA,iBACZC,IAAY,EACZC,SAAgE;IAEhE,MAAM,CAACC,QAAQC,UAAU,GAAGC,SAA2B,EAAE;IACzD,MAAM,CAACC,WAAWC,aAAa,GAAGF,SAAS;IAC3C,MAAM,EAAEG,YAAY,EAAE,GAAGC;IACzB,MAAM,EAAEC,MAAM,EAAE,GAAGC;IACnB,MAAM,EAAEC,qBAAqB,EAAE,GAAGC,WAAWC;IAE7C,MAAMC,YAAYC,YAAY;QAC1B,MAAMC,SAASC,OAAAA,MAAgB,CAAC,WAAWC,QAAQ,GAAG,CAAC,iBAAiB;QACxE,IAAI,CAACF,QAAQ,YACTT,aAAa;QAIjB,MAAMY,cAAclB,UAAU,OAAO,EAAE,cAAcD;QACrDM,aAAa;QACbH,UAAU,EAAE;QAEZ,MAAMiB,WAA6B,EAAE;QAGrC,MAAMC,gBAAgBC,oBAAoBF,UAAUjB;QAEpD,IAAI;YACA,MAAMoB,MAAM,IAAIC,OAAO;gBACnB,UAAUR;gBACV,QAAQP,UAAUgB;gBAClB,OAAO,IAAMd,sBAAsB,UAAU;YACjD;YAGA,MAAMe,cAAc,CAAC;;;wBAGT,EAAEP,YAAY;;;;;;YAM1B,CAAC;YAGD,MAAMQ,KAAK,IAAIC,SAAS,WAAW,OAAO,UAAUF;YAGpD,MAAMG,SAASF,GAAGN,eAAeE,KAAK;gBAAEA;YAAI;YAG5C,IAAIM,UAAU,AAAuB,cAAvB,OAAOA,OAAO,IAAI,EAC5B,MAAMA;QAEd,EAAE,OAAOC,OAAO;YACZT,cAAc,KAAK,CAAC,oBAAoBS;QAC5C,SAAU;YACNxB,aAAa;QACjB;IACJ,GAAG;QAACN;QAAMC;QAAWM;QAAcE;QAAQE;KAAsB;IAEjE,OAAO;QACHT;QACAG;QACAS;IACJ;AACJ"}
@@ -1,54 +1,49 @@
1
1
  import { useCallback, useRef } from "react";
2
2
  import { SDK_GLOBAL_DECLARATION } from "./sdkGlobalDeclaration.js";
3
3
  import { defaultSdkCode } from "./defaultCode.js";
4
- export function useMonacoEditor(handleRun) {
5
- const editorRef = useRef(null);
6
-
7
- // Configure Monaco editor with SDK types.
8
- const handleBeforeMount = useCallback(monaco => {
9
- monaco.languages.typescript.typescriptDefaults.setCompilerOptions({
10
- target: monaco.languages.typescript.ScriptTarget.ES2020,
11
- allowNonTsExtensions: true,
12
- moduleResolution: monaco.languages.typescript.ModuleResolutionKind.NodeJs,
13
- module: monaco.languages.typescript.ModuleKind.CommonJS,
14
- noEmit: true,
15
- esModuleInterop: true,
16
- allowJs: true
17
- });
18
-
19
- // Single addExtraLib call with a pure script-mode string (no import/export).
20
- // This makes TypeScript treat the file as an ambient script, so all
21
- // declare statements become true globals visible to user code.
22
- monaco.languages.typescript.typescriptDefaults.addExtraLib(SDK_GLOBAL_DECLARATION, "file:///sdk-globals.d.ts");
23
- }, []);
24
- const handleEditorDidMount = useCallback((ed, monaco) => {
25
- editorRef.current = ed;
26
-
27
- // Re-create the model with a file:/// URI so it lives in the same
28
- // virtual FS namespace as the addExtraLib file, giving the TS
29
- // language service full visibility into the ambient declarations.
30
- const existingModel = ed.getModel();
31
- const newModel = monaco.editor.createModel(existingModel?.getValue() ?? defaultSdkCode, "typescript", monaco.Uri.parse("file:///user-script.ts"));
32
- ed.setModel(newModel);
33
- existingModel?.dispose();
34
- ed.addAction({
35
- id: "run-code",
36
- label: "Run Code",
37
- keybindings: [monaco.KeyMod.CtrlCmd | monaco.KeyCode.Enter],
38
- run: () => {
39
- void handleRun();
40
- }
41
- });
42
- }, [handleRun]);
43
- const handleFormat = useCallback(() => {
44
- editorRef.current?.getAction("editor.action.formatDocument")?.run();
45
- }, []);
46
- return {
47
- editorRef,
48
- handleBeforeMount,
49
- handleEditorDidMount,
50
- handleFormat
51
- };
4
+ function useMonacoEditor(handleRun) {
5
+ const editorRef = useRef(null);
6
+ const handleBeforeMount = useCallback((monaco)=>{
7
+ monaco.languages.typescript.typescriptDefaults.setCompilerOptions({
8
+ target: monaco.languages.typescript.ScriptTarget.ES2020,
9
+ allowNonTsExtensions: true,
10
+ moduleResolution: monaco.languages.typescript.ModuleResolutionKind.NodeJs,
11
+ module: monaco.languages.typescript.ModuleKind.CommonJS,
12
+ noEmit: true,
13
+ esModuleInterop: true,
14
+ allowJs: true
15
+ });
16
+ monaco.languages.typescript.typescriptDefaults.addExtraLib(SDK_GLOBAL_DECLARATION, "file:///sdk-globals.d.ts");
17
+ }, []);
18
+ const handleEditorDidMount = useCallback((ed, monaco)=>{
19
+ editorRef.current = ed;
20
+ const existingModel = ed.getModel();
21
+ const newModel = monaco.editor.createModel(existingModel?.getValue() ?? defaultSdkCode, "typescript", monaco.Uri.parse("file:///user-script.ts"));
22
+ ed.setModel(newModel);
23
+ existingModel?.dispose();
24
+ ed.addAction({
25
+ id: "run-code",
26
+ label: "Run Code",
27
+ keybindings: [
28
+ monaco.KeyMod.CtrlCmd | monaco.KeyCode.Enter
29
+ ],
30
+ run: ()=>{
31
+ handleRun();
32
+ }
33
+ });
34
+ }, [
35
+ handleRun
36
+ ]);
37
+ const handleFormat = useCallback(()=>{
38
+ editorRef.current?.getAction("editor.action.formatDocument")?.run();
39
+ }, []);
40
+ return {
41
+ editorRef,
42
+ handleBeforeMount,
43
+ handleEditorDidMount,
44
+ handleFormat
45
+ };
52
46
  }
47
+ export { useMonacoEditor };
53
48
 
54
49
  //# sourceMappingURL=useMonacoEditor.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useCallback","useRef","SDK_GLOBAL_DECLARATION","defaultSdkCode","useMonacoEditor","handleRun","editorRef","handleBeforeMount","monaco","languages","typescript","typescriptDefaults","setCompilerOptions","target","ScriptTarget","ES2020","allowNonTsExtensions","moduleResolution","ModuleResolutionKind","NodeJs","module","ModuleKind","CommonJS","noEmit","esModuleInterop","allowJs","addExtraLib","handleEditorDidMount","ed","current","existingModel","getModel","newModel","editor","createModel","getValue","Uri","parse","setModel","dispose","addAction","id","label","keybindings","KeyMod","CtrlCmd","KeyCode","Enter","run","handleFormat","getAction"],"sources":["useMonacoEditor.ts"],"sourcesContent":["import { useCallback, useRef } from \"react\";\nimport type { OnMount, BeforeMount } from \"@monaco-editor/react\";\nimport type { editor } from \"monaco-editor\";\nimport { SDK_GLOBAL_DECLARATION } from \"./sdkGlobalDeclaration.js\";\nimport { defaultSdkCode } from \"./defaultCode.js\";\n\nexport function useMonacoEditor(handleRun: () => void) {\n const editorRef = useRef<editor.IStandaloneCodeEditor | null>(null);\n\n // Configure Monaco editor with SDK types.\n const handleBeforeMount: BeforeMount = useCallback(monaco => {\n monaco.languages.typescript.typescriptDefaults.setCompilerOptions({\n target: monaco.languages.typescript.ScriptTarget.ES2020,\n allowNonTsExtensions: true,\n moduleResolution: monaco.languages.typescript.ModuleResolutionKind.NodeJs,\n module: monaco.languages.typescript.ModuleKind.CommonJS,\n noEmit: true,\n esModuleInterop: true,\n allowJs: true\n });\n\n // Single addExtraLib call with a pure script-mode string (no import/export).\n // This makes TypeScript treat the file as an ambient script, so all\n // declare statements become true globals visible to user code.\n monaco.languages.typescript.typescriptDefaults.addExtraLib(\n SDK_GLOBAL_DECLARATION,\n \"file:///sdk-globals.d.ts\"\n );\n }, []);\n\n const handleEditorDidMount: OnMount = useCallback(\n (ed, monaco) => {\n editorRef.current = ed;\n\n // Re-create the model with a file:/// URI so it lives in the same\n // virtual FS namespace as the addExtraLib file, giving the TS\n // language service full visibility into the ambient declarations.\n const existingModel = ed.getModel();\n const newModel = monaco.editor.createModel(\n existingModel?.getValue() ?? defaultSdkCode,\n \"typescript\",\n monaco.Uri.parse(\"file:///user-script.ts\")\n );\n ed.setModel(newModel);\n existingModel?.dispose();\n\n ed.addAction({\n id: \"run-code\",\n label: \"Run Code\",\n keybindings: [monaco.KeyMod.CtrlCmd | monaco.KeyCode.Enter],\n run: () => {\n void handleRun();\n }\n });\n },\n [handleRun]\n );\n\n const handleFormat = useCallback(() => {\n editorRef.current?.getAction(\"editor.action.formatDocument\")?.run();\n }, []);\n\n return {\n editorRef,\n handleBeforeMount,\n handleEditorDidMount,\n handleFormat\n };\n}\n"],"mappings":"AAAA,SAASA,WAAW,EAAEC,MAAM,QAAQ,OAAO;AAG3C,SAASC,sBAAsB;AAC/B,SAASC,cAAc;AAEvB,OAAO,SAASC,eAAeA,CAACC,SAAqB,EAAE;EACnD,MAAMC,SAAS,GAAGL,MAAM,CAAsC,IAAI,CAAC;;EAEnE;EACA,MAAMM,iBAA8B,GAAGP,WAAW,CAACQ,MAAM,IAAI;IACzDA,MAAM,CAACC,SAAS,CAACC,UAAU,CAACC,kBAAkB,CAACC,kBAAkB,CAAC;MAC9DC,MAAM,EAAEL,MAAM,CAACC,SAAS,CAACC,UAAU,CAACI,YAAY,CAACC,MAAM;MACvDC,oBAAoB,EAAE,IAAI;MAC1BC,gBAAgB,EAAET,MAAM,CAACC,SAAS,CAACC,UAAU,CAACQ,oBAAoB,CAACC,MAAM;MACzEC,MAAM,EAAEZ,MAAM,CAACC,SAAS,CAACC,UAAU,CAACW,UAAU,CAACC,QAAQ;MACvDC,MAAM,EAAE,IAAI;MACZC,eAAe,EAAE,IAAI;MACrBC,OAAO,EAAE;IACb,CAAC,CAAC;;IAEF;IACA;IACA;IACAjB,MAAM,CAACC,SAAS,CAACC,UAAU,CAACC,kBAAkB,CAACe,WAAW,CACtDxB,sBAAsB,EACtB,0BACJ,CAAC;EACL,CAAC,EAAE,EAAE,CAAC;EAEN,MAAMyB,oBAA6B,GAAG3B,WAAW,CAC7C,CAAC4B,EAAE,EAAEpB,MAAM,KAAK;IACZF,SAAS,CAACuB,OAAO,GAAGD,EAAE;;IAEtB;IACA;IACA;IACA,MAAME,aAAa,GAAGF,EAAE,CAACG,QAAQ,CAAC,CAAC;IACnC,MAAMC,QAAQ,GAAGxB,MAAM,CAACyB,MAAM,CAACC,WAAW,CACtCJ,aAAa,EAAEK,QAAQ,CAAC,CAAC,IAAIhC,cAAc,EAC3C,YAAY,EACZK,MAAM,CAAC4B,GAAG,CAACC,KAAK,CAAC,wBAAwB,CAC7C,CAAC;IACDT,EAAE,CAACU,QAAQ,CAACN,QAAQ,CAAC;IACrBF,aAAa,EAAES,OAAO,CAAC,CAAC;IAExBX,EAAE,CAACY,SAAS,CAAC;MACTC,EAAE,EAAE,UAAU;MACdC,KAAK,EAAE,UAAU;MACjBC,WAAW,EAAE,CAACnC,MAAM,CAACoC,MAAM,CAACC,OAAO,GAAGrC,MAAM,CAACsC,OAAO,CAACC,KAAK,CAAC;MAC3DC,GAAG,EAAEA,CAAA,KAAM;QACP,KAAK3C,SAAS,CAAC,CAAC;MACpB;IACJ,CAAC,CAAC;EACN,CAAC,EACD,CAACA,SAAS,CACd,CAAC;EAED,MAAM4C,YAAY,GAAGjD,WAAW,CAAC,MAAM;IACnCM,SAAS,CAACuB,OAAO,EAAEqB,SAAS,CAAC,8BAA8B,CAAC,EAAEF,GAAG,CAAC,CAAC;EACvE,CAAC,EAAE,EAAE,CAAC;EAEN,OAAO;IACH1C,SAAS;IACTC,iBAAiB;IACjBoB,oBAAoB;IACpBsB;EACJ,CAAC;AACL","ignoreList":[]}
1
+ {"version":3,"file":"plugins/useMonacoEditor.js","sources":["../../src/plugins/useMonacoEditor.ts"],"sourcesContent":["import { useCallback, useRef } from \"react\";\nimport type { OnMount, BeforeMount } from \"@monaco-editor/react\";\nimport type { editor } from \"monaco-editor\";\nimport { SDK_GLOBAL_DECLARATION } from \"./sdkGlobalDeclaration.js\";\nimport { defaultSdkCode } from \"./defaultCode.js\";\n\nexport function useMonacoEditor(handleRun: () => void) {\n const editorRef = useRef<editor.IStandaloneCodeEditor | null>(null);\n\n // Configure Monaco editor with SDK types.\n const handleBeforeMount: BeforeMount = useCallback(monaco => {\n monaco.languages.typescript.typescriptDefaults.setCompilerOptions({\n target: monaco.languages.typescript.ScriptTarget.ES2020,\n allowNonTsExtensions: true,\n moduleResolution: monaco.languages.typescript.ModuleResolutionKind.NodeJs,\n module: monaco.languages.typescript.ModuleKind.CommonJS,\n noEmit: true,\n esModuleInterop: true,\n allowJs: true\n });\n\n // Single addExtraLib call with a pure script-mode string (no import/export).\n // This makes TypeScript treat the file as an ambient script, so all\n // declare statements become true globals visible to user code.\n monaco.languages.typescript.typescriptDefaults.addExtraLib(\n SDK_GLOBAL_DECLARATION,\n \"file:///sdk-globals.d.ts\"\n );\n }, []);\n\n const handleEditorDidMount: OnMount = useCallback(\n (ed, monaco) => {\n editorRef.current = ed;\n\n // Re-create the model with a file:/// URI so it lives in the same\n // virtual FS namespace as the addExtraLib file, giving the TS\n // language service full visibility into the ambient declarations.\n const existingModel = ed.getModel();\n const newModel = monaco.editor.createModel(\n existingModel?.getValue() ?? defaultSdkCode,\n \"typescript\",\n monaco.Uri.parse(\"file:///user-script.ts\")\n );\n ed.setModel(newModel);\n existingModel?.dispose();\n\n ed.addAction({\n id: \"run-code\",\n label: \"Run Code\",\n keybindings: [monaco.KeyMod.CtrlCmd | monaco.KeyCode.Enter],\n run: () => {\n void handleRun();\n }\n });\n },\n [handleRun]\n );\n\n const handleFormat = useCallback(() => {\n editorRef.current?.getAction(\"editor.action.formatDocument\")?.run();\n }, []);\n\n return {\n editorRef,\n handleBeforeMount,\n handleEditorDidMount,\n handleFormat\n };\n}\n"],"names":["useMonacoEditor","handleRun","editorRef","useRef","handleBeforeMount","useCallback","monaco","SDK_GLOBAL_DECLARATION","handleEditorDidMount","ed","existingModel","newModel","defaultSdkCode","handleFormat"],"mappings":";;;AAMO,SAASA,gBAAgBC,SAAqB;IACjD,MAAMC,YAAYC,OAA4C;IAG9D,MAAMC,oBAAiCC,YAAYC,CAAAA;QAC/CA,OAAO,SAAS,CAAC,UAAU,CAAC,kBAAkB,CAAC,kBAAkB,CAAC;YAC9D,QAAQA,OAAO,SAAS,CAAC,UAAU,CAAC,YAAY,CAAC,MAAM;YACvD,sBAAsB;YACtB,kBAAkBA,OAAO,SAAS,CAAC,UAAU,CAAC,oBAAoB,CAAC,MAAM;YACzE,QAAQA,OAAO,SAAS,CAAC,UAAU,CAAC,UAAU,CAAC,QAAQ;YACvD,QAAQ;YACR,iBAAiB;YACjB,SAAS;QACb;QAKAA,OAAO,SAAS,CAAC,UAAU,CAAC,kBAAkB,CAAC,WAAW,CACtDC,wBACA;IAER,GAAG,EAAE;IAEL,MAAMC,uBAAgCH,YAClC,CAACI,IAAIH;QACDJ,UAAU,OAAO,GAAGO;QAKpB,MAAMC,gBAAgBD,GAAG,QAAQ;QACjC,MAAME,WAAWL,OAAO,MAAM,CAAC,WAAW,CACtCI,eAAe,cAAcE,gBAC7B,cACAN,OAAO,GAAG,CAAC,KAAK,CAAC;QAErBG,GAAG,QAAQ,CAACE;QACZD,eAAe;QAEfD,GAAG,SAAS,CAAC;YACT,IAAI;YACJ,OAAO;YACP,aAAa;gBAACH,OAAO,MAAM,CAAC,OAAO,GAAGA,OAAO,OAAO,CAAC,KAAK;aAAC;YAC3D,KAAK;gBACIL;YACT;QACJ;IACJ,GACA;QAACA;KAAU;IAGf,MAAMY,eAAeR,YAAY;QAC7BH,UAAU,OAAO,EAAE,UAAU,iCAAiC;IAClE,GAAG,EAAE;IAEL,OAAO;QACHA;QACAE;QACAI;QACAK;IACJ;AACJ"}
@@ -1,44 +1,41 @@
1
1
  import { useCallback, useEffect, useRef, useState } from "react";
2
2
  import { MIN_PANE_PCT } from "./types.js";
3
- export function useResizableSplit() {
4
- const splitRef = useRef(null);
5
- const [editorPct, setEditorPct] = useState(60);
6
- const isDragging = useRef(false);
7
- const handleDividerMouseDown = useCallback(e => {
8
- e.preventDefault();
9
- isDragging.current = true;
10
- document.body.style.cursor = "col-resize";
11
- document.body.style.userSelect = "none";
12
- }, []);
13
- useEffect(() => {
14
- const onMouseMove = e => {
15
- if (!isDragging.current || !splitRef.current) {
16
- return;
17
- }
18
- const rect = splitRef.current.getBoundingClientRect();
19
- const pct = (e.clientX - rect.left) / rect.width * 100;
20
- setEditorPct(Math.min(100 - MIN_PANE_PCT, Math.max(MIN_PANE_PCT, pct)));
3
+ function useResizableSplit() {
4
+ const splitRef = useRef(null);
5
+ const [editorPct, setEditorPct] = useState(60);
6
+ const isDragging = useRef(false);
7
+ const handleDividerMouseDown = useCallback((e)=>{
8
+ e.preventDefault();
9
+ isDragging.current = true;
10
+ document.body.style.cursor = "col-resize";
11
+ document.body.style.userSelect = "none";
12
+ }, []);
13
+ useEffect(()=>{
14
+ const onMouseMove = (e)=>{
15
+ if (!isDragging.current || !splitRef.current) return;
16
+ const rect = splitRef.current.getBoundingClientRect();
17
+ const pct = (e.clientX - rect.left) / rect.width * 100;
18
+ setEditorPct(Math.min(100 - MIN_PANE_PCT, Math.max(MIN_PANE_PCT, pct)));
19
+ };
20
+ const onMouseUp = ()=>{
21
+ if (!isDragging.current) return;
22
+ isDragging.current = false;
23
+ document.body.style.cursor = "";
24
+ document.body.style.userSelect = "";
25
+ };
26
+ document.addEventListener("mousemove", onMouseMove);
27
+ document.addEventListener("mouseup", onMouseUp);
28
+ return ()=>{
29
+ document.removeEventListener("mousemove", onMouseMove);
30
+ document.removeEventListener("mouseup", onMouseUp);
31
+ };
32
+ }, []);
33
+ return {
34
+ splitRef,
35
+ editorPct,
36
+ handleDividerMouseDown
21
37
  };
22
- const onMouseUp = () => {
23
- if (!isDragging.current) {
24
- return;
25
- }
26
- isDragging.current = false;
27
- document.body.style.cursor = "";
28
- document.body.style.userSelect = "";
29
- };
30
- document.addEventListener("mousemove", onMouseMove);
31
- document.addEventListener("mouseup", onMouseUp);
32
- return () => {
33
- document.removeEventListener("mousemove", onMouseMove);
34
- document.removeEventListener("mouseup", onMouseUp);
35
- };
36
- }, []);
37
- return {
38
- splitRef,
39
- editorPct,
40
- handleDividerMouseDown
41
- };
42
38
  }
39
+ export { useResizableSplit };
43
40
 
44
41
  //# sourceMappingURL=useResizableSplit.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useCallback","useEffect","useRef","useState","MIN_PANE_PCT","useResizableSplit","splitRef","editorPct","setEditorPct","isDragging","handleDividerMouseDown","e","preventDefault","current","document","body","style","cursor","userSelect","onMouseMove","rect","getBoundingClientRect","pct","clientX","left","width","Math","min","max","onMouseUp","addEventListener","removeEventListener"],"sources":["useResizableSplit.ts"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from \"react\";\nimport { MIN_PANE_PCT } from \"./types.js\";\n\nexport function useResizableSplit() {\n const splitRef = useRef<HTMLDivElement | null>(null);\n const [editorPct, setEditorPct] = useState(60);\n const isDragging = useRef(false);\n\n const handleDividerMouseDown = useCallback((e: React.MouseEvent) => {\n e.preventDefault();\n isDragging.current = true;\n document.body.style.cursor = \"col-resize\";\n document.body.style.userSelect = \"none\";\n }, []);\n\n useEffect(() => {\n const onMouseMove = (e: MouseEvent) => {\n if (!isDragging.current || !splitRef.current) {\n return;\n }\n const rect = splitRef.current.getBoundingClientRect();\n const pct = ((e.clientX - rect.left) / rect.width) * 100;\n setEditorPct(Math.min(100 - MIN_PANE_PCT, Math.max(MIN_PANE_PCT, pct)));\n };\n\n const onMouseUp = () => {\n if (!isDragging.current) {\n return;\n }\n isDragging.current = false;\n document.body.style.cursor = \"\";\n document.body.style.userSelect = \"\";\n };\n\n document.addEventListener(\"mousemove\", onMouseMove);\n document.addEventListener(\"mouseup\", onMouseUp);\n return () => {\n document.removeEventListener(\"mousemove\", onMouseMove);\n document.removeEventListener(\"mouseup\", onMouseUp);\n };\n }, []);\n\n return {\n splitRef,\n editorPct,\n handleDividerMouseDown\n };\n}\n"],"mappings":"AAAA,SAASA,WAAW,EAAEC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAChE,SAASC,YAAY;AAErB,OAAO,SAASC,iBAAiBA,CAAA,EAAG;EAChC,MAAMC,QAAQ,GAAGJ,MAAM,CAAwB,IAAI,CAAC;EACpD,MAAM,CAACK,SAAS,EAAEC,YAAY,CAAC,GAAGL,QAAQ,CAAC,EAAE,CAAC;EAC9C,MAAMM,UAAU,GAAGP,MAAM,CAAC,KAAK,CAAC;EAEhC,MAAMQ,sBAAsB,GAAGV,WAAW,CAAEW,CAAmB,IAAK;IAChEA,CAAC,CAACC,cAAc,CAAC,CAAC;IAClBH,UAAU,CAACI,OAAO,GAAG,IAAI;IACzBC,QAAQ,CAACC,IAAI,CAACC,KAAK,CAACC,MAAM,GAAG,YAAY;IACzCH,QAAQ,CAACC,IAAI,CAACC,KAAK,CAACE,UAAU,GAAG,MAAM;EAC3C,CAAC,EAAE,EAAE,CAAC;EAENjB,SAAS,CAAC,MAAM;IACZ,MAAMkB,WAAW,GAAIR,CAAa,IAAK;MACnC,IAAI,CAACF,UAAU,CAACI,OAAO,IAAI,CAACP,QAAQ,CAACO,OAAO,EAAE;QAC1C;MACJ;MACA,MAAMO,IAAI,GAAGd,QAAQ,CAACO,OAAO,CAACQ,qBAAqB,CAAC,CAAC;MACrD,MAAMC,GAAG,GAAI,CAACX,CAAC,CAACY,OAAO,GAAGH,IAAI,CAACI,IAAI,IAAIJ,IAAI,CAACK,KAAK,GAAI,GAAG;MACxDjB,YAAY,CAACkB,IAAI,CAACC,GAAG,CAAC,GAAG,GAAGvB,YAAY,EAAEsB,IAAI,CAACE,GAAG,CAACxB,YAAY,EAAEkB,GAAG,CAAC,CAAC,CAAC;IAC3E,CAAC;IAED,MAAMO,SAAS,GAAGA,CAAA,KAAM;MACpB,IAAI,CAACpB,UAAU,CAACI,OAAO,EAAE;QACrB;MACJ;MACAJ,UAAU,CAACI,OAAO,GAAG,KAAK;MAC1BC,QAAQ,CAACC,IAAI,CAACC,KAAK,CAACC,MAAM,GAAG,EAAE;MAC/BH,QAAQ,CAACC,IAAI,CAACC,KAAK,CAACE,UAAU,GAAG,EAAE;IACvC,CAAC;IAEDJ,QAAQ,CAACgB,gBAAgB,CAAC,WAAW,EAAEX,WAAW,CAAC;IACnDL,QAAQ,CAACgB,gBAAgB,CAAC,SAAS,EAAED,SAAS,CAAC;IAC/C,OAAO,MAAM;MACTf,QAAQ,CAACiB,mBAAmB,CAAC,WAAW,EAAEZ,WAAW,CAAC;MACtDL,QAAQ,CAACiB,mBAAmB,CAAC,SAAS,EAAEF,SAAS,CAAC;IACtD,CAAC;EACL,CAAC,EAAE,EAAE,CAAC;EAEN,OAAO;IACHvB,QAAQ;IACRC,SAAS;IACTG;EACJ,CAAC;AACL","ignoreList":[]}
1
+ {"version":3,"file":"plugins/useResizableSplit.js","sources":["../../src/plugins/useResizableSplit.ts"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from \"react\";\nimport { MIN_PANE_PCT } from \"./types.js\";\n\nexport function useResizableSplit() {\n const splitRef = useRef<HTMLDivElement | null>(null);\n const [editorPct, setEditorPct] = useState(60);\n const isDragging = useRef(false);\n\n const handleDividerMouseDown = useCallback((e: React.MouseEvent) => {\n e.preventDefault();\n isDragging.current = true;\n document.body.style.cursor = \"col-resize\";\n document.body.style.userSelect = \"none\";\n }, []);\n\n useEffect(() => {\n const onMouseMove = (e: MouseEvent) => {\n if (!isDragging.current || !splitRef.current) {\n return;\n }\n const rect = splitRef.current.getBoundingClientRect();\n const pct = ((e.clientX - rect.left) / rect.width) * 100;\n setEditorPct(Math.min(100 - MIN_PANE_PCT, Math.max(MIN_PANE_PCT, pct)));\n };\n\n const onMouseUp = () => {\n if (!isDragging.current) {\n return;\n }\n isDragging.current = false;\n document.body.style.cursor = \"\";\n document.body.style.userSelect = \"\";\n };\n\n document.addEventListener(\"mousemove\", onMouseMove);\n document.addEventListener(\"mouseup\", onMouseUp);\n return () => {\n document.removeEventListener(\"mousemove\", onMouseMove);\n document.removeEventListener(\"mouseup\", onMouseUp);\n };\n }, []);\n\n return {\n splitRef,\n editorPct,\n handleDividerMouseDown\n };\n}\n"],"names":["useResizableSplit","splitRef","useRef","editorPct","setEditorPct","useState","isDragging","handleDividerMouseDown","useCallback","e","document","useEffect","onMouseMove","rect","pct","Math","MIN_PANE_PCT","onMouseUp"],"mappings":";;AAGO,SAASA;IACZ,MAAMC,WAAWC,OAA8B;IAC/C,MAAM,CAACC,WAAWC,aAAa,GAAGC,SAAS;IAC3C,MAAMC,aAAaJ,OAAO;IAE1B,MAAMK,yBAAyBC,YAAY,CAACC;QACxCA,EAAE,cAAc;QAChBH,WAAW,OAAO,GAAG;QACrBI,SAAS,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG;QAC7BA,SAAS,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG;IACrC,GAAG,EAAE;IAELC,UAAU;QACN,MAAMC,cAAc,CAACH;YACjB,IAAI,CAACH,WAAW,OAAO,IAAI,CAACL,SAAS,OAAO,EACxC;YAEJ,MAAMY,OAAOZ,SAAS,OAAO,CAAC,qBAAqB;YACnD,MAAMa,MAAQL,AAAAA,CAAAA,EAAE,OAAO,GAAGI,KAAK,IAAG,IAAKA,KAAK,KAAK,GAAI;YACrDT,aAAaW,KAAK,GAAG,CAAC,MAAMC,cAAcD,KAAK,GAAG,CAACC,cAAcF;QACrE;QAEA,MAAMG,YAAY;YACd,IAAI,CAACX,WAAW,OAAO,EACnB;YAEJA,WAAW,OAAO,GAAG;YACrBI,SAAS,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG;YAC7BA,SAAS,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG;QACrC;QAEAA,SAAS,gBAAgB,CAAC,aAAaE;QACvCF,SAAS,gBAAgB,CAAC,WAAWO;QACrC,OAAO;YACHP,SAAS,mBAAmB,CAAC,aAAaE;YAC1CF,SAAS,mBAAmB,CAAC,WAAWO;QAC5C;IACJ,GAAG,EAAE;IAEL,OAAO;QACHhB;QACAE;QACAI;IACJ;AACJ"}
package/routes.js CHANGED
@@ -1,9 +1,10 @@
1
1
  import { Route } from "@webiny/app-admin";
2
- export const Routes = {
3
- SdkPlayground: new Route({
4
- name: "SdkPlayground",
5
- path: "/sdk-playground"
6
- })
2
+ const Routes = {
3
+ SdkPlayground: new Route({
4
+ name: "SdkPlayground",
5
+ path: "/sdk-playground"
6
+ })
7
7
  };
8
+ export { Routes };
8
9
 
9
10
  //# sourceMappingURL=routes.js.map
package/routes.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["Route","Routes","SdkPlayground","name","path"],"sources":["routes.ts"],"sourcesContent":["import { Route } from \"@webiny/app-admin\";\n\nexport const Routes = {\n SdkPlayground: new Route({\n name: \"SdkPlayground\",\n path: \"/sdk-playground\"\n })\n};\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,mBAAmB;AAEzC,OAAO,MAAMC,MAAM,GAAG;EAClBC,aAAa,EAAE,IAAIF,KAAK,CAAC;IACrBG,IAAI,EAAE,eAAe;IACrBC,IAAI,EAAE;EACV,CAAC;AACL,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"routes.js","sources":["../src/routes.ts"],"sourcesContent":["import { Route } from \"@webiny/app-admin\";\n\nexport const Routes = {\n SdkPlayground: new Route({\n name: \"SdkPlayground\",\n path: \"/sdk-playground\"\n })\n};\n"],"names":["Routes","Route"],"mappings":";AAEO,MAAMA,SAAS;IAClB,eAAe,IAAIC,MAAM;QACrB,MAAM;QACN,MAAM;IACV;AACJ"}