gwchq-textjam 0.1.8 → 0.1.10

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/README.md CHANGED
@@ -217,6 +217,7 @@ The consumer's webpack config should include the following setups
217
217
  - `project`: an object with the project data. Contains the following props:
218
218
  - `project_type`: Possible values `web` | `python`. Default project files will be created according to this value
219
219
  - `identifier`: A string that represents the project id. If provided, cached project with same id will be loaded
220
+ - `packageApiUrl`: A string with url to download pyodide packages. If not provided - default value is pyodide CDN.
220
221
 
221
222
  // TODO: review old options below
222
223
  - `code`: A preset blob of code to show in the editor pane (overrides content of `main.py`/`index.html`)
@@ -230,10 +231,7 @@ The consumer's webpack config should include the following setups
230
231
  - `readOnly`: Display the editor in read-only mode (defaults to `false`)
231
232
  - `showSavePrompt`: Prompt the user to save their work (defaults to `false`)
232
233
  - `sidebarOptions`: Array of strings specifying the panels to be displayed in the sidebar. Options include `"projects"`, `"file"`, `"download"`, `"settings"`.
233
- - `sidebarPlugins`: Array of plugin definitions to render inside the sidebar (defaults to `[]`)
234
234
  - `theme`: Force editor into `"dark"` or `"light"` mode; browser/system preferences are used when omitted
235
- - `withProjectbar`: Show the project bar containing project name and save status (defaults to `false`)
236
- - `withSidebar`: Show the sidebar (defaults to `false`)
237
235
 
238
236
  When no props are supplied the component falls back to parsing the current page’s query string so the local development experience (`yarn start`) continues to work unchanged. You can override this by explicitly passing `queryString` or the equivalent props.
239
237
 
@@ -8,16 +8,17 @@ function toAbsoluteFromOrigin(url) {
8
8
  // Nest the PyodideWorker function inside a globalThis object so we control when its initialised.
9
9
  const PyodideWorker = () => {
10
10
  let assets;
11
+ let packageApiUrl;
11
12
 
12
13
  const handleInit = (data) => {
13
14
  assets = data.assets;
15
+ packageApiUrl = data.packageApiUrl;
14
16
 
15
17
  // Import scripts dynamically based on the environment
16
18
  console.log("PyodideWorker", "importing scripts");
17
19
  importScripts(toAbsoluteFromOrigin(assets.pygalUrl));
18
20
 
19
- assets.pyodideBaseUrl =
20
- "https://cdn.jsdelivr.net/pyodide/v0.26.2/full/pyodide.js";
21
+ assets.pyodideBaseUrl = `${packageApiUrl}/pyodide.js`;
21
22
  importScripts(toAbsoluteFromOrigin(assets.pyodideBaseUrl));
22
23
 
23
24
  initialisePyodide();