jderobot-ide-interface 0.3.17 → 0.3.18

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.
Binary file
@@ -16,7 +16,7 @@ export declare const StyledExtraIcon: import("styled-components/dist/types").ISt
16
16
  interface StyledExplorerAccentProps {
17
17
  color?: string;
18
18
  }
19
- export declare const StyledExplorerAccent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("@mui/material/SvgIcon").SvgIconOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<import("react").SVGProps<SVGSVGElement>, "children" | "color" | "className" | "style" | "fontSize" | "shapeRendering" | "viewBox" | "classes" | "htmlColor" | "inheritViewBox" | "sx" | "titleAccess">, "color"> & StyledExplorerAccentProps, never> & Partial<Pick<import("styled-components").FastOmit<import("@mui/material/SvgIcon").SvgIconOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<import("react").SVGProps<SVGSVGElement>, "children" | "color" | "className" | "style" | "fontSize" | "shapeRendering" | "viewBox" | "classes" | "htmlColor" | "inheritViewBox" | "sx" | "titleAccess">, "color"> & StyledExplorerAccentProps, never>>> & string & Omit<import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material/SvgIcon").SvgIconTypeMap<{}, "svg">> & {
19
+ export declare const StyledExplorerAccent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("@mui/material/SvgIcon").SvgIconOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<import("react").SVGProps<SVGSVGElement>, "children" | "color" | "className" | "style" | "classes" | "fontSize" | "htmlColor" | "inheritViewBox" | "shapeRendering" | "sx" | "titleAccess" | "viewBox">, "color"> & StyledExplorerAccentProps, never> & Partial<Pick<import("styled-components").FastOmit<import("@mui/material/SvgIcon").SvgIconOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<import("react").SVGProps<SVGSVGElement>, "children" | "color" | "className" | "style" | "classes" | "fontSize" | "htmlColor" | "inheritViewBox" | "shapeRendering" | "sx" | "titleAccess" | "viewBox">, "color"> & StyledExplorerAccentProps, never>>> & string & Omit<import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material/SvgIcon").SvgIconTypeMap<{}, "svg">> & {
20
20
  muiName: string;
21
21
  }, keyof import("react").Component<any, {}, any>>;
22
22
  export {};
@@ -1,7 +1,7 @@
1
1
  import { JSX } from "react";
2
2
  import { CommsManager } from "jderobot-commsmanager";
3
3
  import { Entry, EditorsEntry, Options, ExtraSnippets, ExtraApi, Layout } from "Types";
4
- declare const FileEditor: ({ currentFile, changeCurrentFile, currentProjectname, autosave, manager, api, extraEditors, splashIcon, options, extraSnippets, layout, }: {
4
+ declare const FileEditor: ({ currentFile, changeCurrentFile, currentProjectname, autosave, manager, api, extraEditors, splashIcon, options, extraSnippets, layout, onCodeChange, }: {
5
5
  currentFile?: Entry;
6
6
  changeCurrentFile: Function;
7
7
  currentProjectname: string;
@@ -13,5 +13,6 @@ declare const FileEditor: ({ currentFile, changeCurrentFile, currentProjectname,
13
13
  options?: Options;
14
14
  extraSnippets?: ExtraSnippets;
15
15
  layout: Layout;
16
+ onCodeChange?: () => void;
16
17
  }) => JSX.Element;
17
18
  export default FileEditor;
@@ -0,0 +1,5 @@
1
+ import type { StoryObj } from "@storybook/react-webpack5";
2
+ import TextEditor from "./TextEditor";
3
+ type Story = StoryObj<typeof TextEditor>;
4
+ export declare const Main: Story;
5
+ export {};
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import { CommsManager } from "jderobot-commsmanager";
3
3
  import { ExtraSnippets } from "Types";
4
- declare const FileEditor: ({ commsManager, fileContent, setFileContent, saveFile, language, zoomLevel, extraSnippets, }: {
4
+ declare const FileEditor: ({ commsManager, fileContent, setFileContent, saveFile, language, zoomLevel, extraSnippets, onCodeChange, }: {
5
5
  commsManager: CommsManager | null;
6
6
  fileContent: string;
7
7
  setFileContent: Function;
@@ -9,5 +9,6 @@ declare const FileEditor: ({ commsManager, fileContent, setFileContent, saveFile
9
9
  language: string;
10
10
  zoomLevel: number;
11
11
  extraSnippets?: ExtraSnippets;
12
+ onCodeChange?: () => void;
12
13
  }) => React.JSX.Element;
13
14
  export default FileEditor;
@@ -0,0 +1 @@
1
+ export declare const initWebSocketAndStartClient: (url: string) => WebSocket;
@@ -1,6 +1,6 @@
1
1
  import type { Meta, StoryObj } from "@storybook/react-webpack5";
2
- import { ExplorerEntry } from "Types";
3
2
  import IdeInterface from "./IdeInterface";
3
+ import { ExplorerEntry } from "Types";
4
4
  type Story = StoryObj<typeof IdeInterface>;
5
5
  declare const meta: Meta<typeof IdeInterface>;
6
6
  export default meta;
@@ -13,10 +13,10 @@ interface StyledModalTitlebarProps {
13
13
  roundness?: number;
14
14
  }
15
15
  export declare const StyledModalTitlebar: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof StyledModalTitlebarProps> & StyledModalTitlebarProps, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof StyledModalTitlebarProps> & StyledModalTitlebarProps, never>>> & string;
16
- export declare const StyledModalCloseButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("@mui/material/SvgIcon").SvgIconOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<import("react").SVGProps<SVGSVGElement>, "children" | "color" | "className" | "style" | "fontSize" | "shapeRendering" | "viewBox" | "classes" | "htmlColor" | "inheritViewBox" | "sx" | "titleAccess">, never> & Partial<Pick<import("@mui/material/SvgIcon").SvgIconOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<import("react").SVGProps<SVGSVGElement>, "children" | "color" | "className" | "style" | "fontSize" | "shapeRendering" | "viewBox" | "classes" | "htmlColor" | "inheritViewBox" | "sx" | "titleAccess">, never>>> & string & Omit<import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material/SvgIcon").SvgIconTypeMap<{}, "svg">> & {
16
+ export declare const StyledModalCloseButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("@mui/material/SvgIcon").SvgIconOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<import("react").SVGProps<SVGSVGElement>, "children" | "color" | "className" | "style" | "classes" | "fontSize" | "htmlColor" | "inheritViewBox" | "shapeRendering" | "sx" | "titleAccess" | "viewBox">, never> & Partial<Pick<import("@mui/material/SvgIcon").SvgIconOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<import("react").SVGProps<SVGSVGElement>, "children" | "color" | "className" | "style" | "classes" | "fontSize" | "htmlColor" | "inheritViewBox" | "shapeRendering" | "sx" | "titleAccess" | "viewBox">, never>>> & string & Omit<import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material/SvgIcon").SvgIconTypeMap<{}, "svg">> & {
17
17
  muiName: string;
18
18
  }, keyof import("react").Component<any, {}, any>>;
19
- export declare const StyledModalBackButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("@mui/material/SvgIcon").SvgIconOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<import("react").SVGProps<SVGSVGElement>, "children" | "color" | "className" | "style" | "fontSize" | "shapeRendering" | "viewBox" | "classes" | "htmlColor" | "inheritViewBox" | "sx" | "titleAccess">, never> & Partial<Pick<import("@mui/material/SvgIcon").SvgIconOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<import("react").SVGProps<SVGSVGElement>, "children" | "color" | "className" | "style" | "fontSize" | "shapeRendering" | "viewBox" | "classes" | "htmlColor" | "inheritViewBox" | "sx" | "titleAccess">, never>>> & string & Omit<import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material/SvgIcon").SvgIconTypeMap<{}, "svg">> & {
19
+ export declare const StyledModalBackButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("@mui/material/SvgIcon").SvgIconOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<import("react").SVGProps<SVGSVGElement>, "children" | "color" | "className" | "style" | "classes" | "fontSize" | "htmlColor" | "inheritViewBox" | "shapeRendering" | "sx" | "titleAccess" | "viewBox">, never> & Partial<Pick<import("@mui/material/SvgIcon").SvgIconOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<import("react").SVGProps<SVGSVGElement>, "children" | "color" | "className" | "style" | "classes" | "fontSize" | "htmlColor" | "inheritViewBox" | "shapeRendering" | "sx" | "titleAccess" | "viewBox">, never>>> & string & Omit<import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material/SvgIcon").SvgIconTypeMap<{}, "svg">> & {
20
20
  muiName: string;
21
21
  }, keyof import("react").Component<any, {}, any>>;
22
22
  interface StyledModalRowProps {
@@ -0,0 +1,123 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Security-Policy" content="
5
+ default-src 'none';
6
+ child-src 'self' data: blob:;
7
+ script-src 'self' 'unsafe-eval' 'sha256-2EBQn+AFduI8Wb0riLwbeshEGP4dJlHornyvuFAgYnA=' data: extension-file: https: http://localhost:* blob:;
8
+ connect-src 'self' data: extension-file: https: wss: http://localhost:* http://127.0.0.1:* ws://localhost:* ws://127.0.0.1:*;"/>
9
+ </head>
10
+ <body>
11
+ <script>
12
+ (function () {
13
+ const searchParams = new URL(document.location.href).searchParams;
14
+ const vscodeWebWorkerExtHostId = searchParams.get('vscodeWebWorkerExtHostId') || '';
15
+ const name = searchParams.get('debugged') ? 'DebugExtensionHostWorker' : 'ExtensionHostWorker';
16
+ const parentOriginParam = searchParams.get('parentOrigin');
17
+ const parentOrigin = parentOriginParam || window.origin;
18
+ const salt = searchParams.get('salt');
19
+
20
+ (async function () {
21
+ return start();
22
+ })();
23
+
24
+ function sendError(error) {
25
+ window.parent.postMessage({
26
+ vscodeWebWorkerExtHostId,
27
+ error: {
28
+ name: error ? error.name : '',
29
+ message: error ? error.message : '',
30
+ stack: error ? error.stack : []
31
+ }
32
+ }, '*');
33
+ }
34
+
35
+ function start() {
36
+
37
+ // Before we can load the worker, we need to get the current set of NLS
38
+ // configuration into this iframe. We ask the parent window to send it
39
+ // together with the necessary information to load the worker via Blob.
40
+
41
+ const bootstrapNlsType = 'vscode.bootstrap.nls';
42
+
43
+ self.onmessage = (event) => {
44
+ if (event.origin !== parentOrigin || event.data.type !== bootstrapNlsType) {
45
+ return;
46
+ }
47
+ const { data } = event.data;
48
+ createWorker(data.workerUrl, data.workerOptions, data.fileRoot, data.nls.messages, data.nls.language);
49
+ };
50
+
51
+ window.parent.postMessage({
52
+ vscodeWebWorkerExtHostId,
53
+ type: bootstrapNlsType
54
+ }, '*');
55
+ }
56
+
57
+ function createWorker(workerUrl, workerOptions, fileRoot, nlsMessages, nlsLanguage) {
58
+ try {
59
+ if (globalThis.crossOriginIsolated) {
60
+ workerUrl += '?vscode-coi=2'; // COEP
61
+ }
62
+
63
+ // In below blob code, we are using JSON.stringify to ensure the passed
64
+ // in values are not breaking our script. The values may contain string
65
+ // terminating characters (such as ' or ").
66
+
67
+ const blob = new Blob([[
68
+ `/*extensionHostWorker*/`,
69
+ `globalThis._VSCODE_NLS_MESSAGES = ${JSON.stringify(nlsMessages)};`,
70
+ `globalThis._VSCODE_NLS_LANGUAGE = ${JSON.stringify(nlsLanguage)};`,
71
+ `globalThis._VSCODE_FILE_ROOT = ${JSON.stringify(fileRoot)};`,
72
+ (workerOptions?.type === 'module') ? `await import('${workerUrl}');` : `importScripts('${workerUrl}');`,
73
+ `/*extensionHostWorker*/`
74
+ ].join('')], { type: 'application/javascript' });
75
+
76
+ const worker = new Worker(URL.createObjectURL(blob), { name, ...workerOptions });
77
+ const nestedWorkers = new Map();
78
+
79
+ worker.onmessage = (event) => {
80
+ const { data } = event;
81
+
82
+ if (data?.type === '_newWorker') {
83
+ const { id, port, url, options } = data;
84
+ const newWorker = new Worker(url, options);
85
+ newWorker.postMessage(port, [port]);
86
+ newWorker.onerror = console.error.bind(console);
87
+ nestedWorkers.set(id, newWorker);
88
+
89
+ } else if (data?.type === '_terminateWorker') {
90
+ const { id } = data;
91
+ if (nestedWorkers.has(id)) {
92
+ nestedWorkers.get(id).terminate();
93
+ nestedWorkers.delete(id);
94
+ }
95
+ } else {
96
+ worker.onerror = console.error.bind(console);
97
+ window.parent.postMessage({
98
+ vscodeWebWorkerExtHostId,
99
+ data
100
+ }, parentOrigin, [data]);
101
+ }
102
+ };
103
+
104
+ worker.onerror = (event) => {
105
+ console.error(event.message, event.error);
106
+ sendError(event.error);
107
+ };
108
+
109
+ self.onmessage = (event) => {
110
+ if (event.origin !== parentOrigin) {
111
+ return;
112
+ }
113
+ worker.postMessage(event.data, event.ports);
114
+ };
115
+ } catch (err) {
116
+ console.error(err);
117
+ sendError(err);
118
+ }
119
+ }
120
+ })();
121
+ </script>
122
+ </body>
123
+ </html>