gwchq-textjam 0.1.9 → 0.1.11

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`)
package/dist/360.index.js CHANGED
@@ -5,7 +5,7 @@ export const modules = {
5
5
  /***/ 22796:
6
6
  /***/ ((module) => {
7
7
 
8
- module.exports = /*#__PURE__*/JSON.parse('{"modal":{"close":"Close","error":{"error":"Error","heading":"An error has occurred","externalLink":{"message":"Unfortunately links to external sites are not available in the Editor."}}},"editorPanel":{"ariaLabel":"editor text input","characterLimitError":"Error: Character limit reached","characterLimitExplanation_one":"Files in the editor are limited to {{count}} character","characterLimitExplanation_other":"Files in the editor are limited to {{count}} characters","viewOnly":"View only","close":"close"},"filePanel":{"errors":{"reservedFileName":"{{fileName}} is a reserved file name. Please choose a different name.","containsSpaces":"File names must not contain spaces.","generalError":"Error","notUnique":"File names must be unique.","or":"or","unsupportedExtension":"File names must end in {{allowedExtensions}}."},"files":"Project files","images":"Image gallery","newFileButton":"Add file","newFileModal":{"cancel":"Cancel","heading":"Add a new file to your project","helpText":"Remember to add the file extension at the end of your file name, for example, {{examples}}","helpTextExample":{"html":"\'file.html\', \'file.css\' or \'file.js\'","python":"\'file.py\'"},"inputLabel":"Name your file","addFile":"Add file"},"renameFileModal":{"cancel":"Cancel","heading":"Rename file","inputLabel":"Name your file","save":"Save"},"fileMenu":{"label":"Open file menu","renameItem":"Rename file"}},"downloadPanel":{"heading":"Save & download","logInTitle":"Log in to save your progress","logInHint":"With a Raspberry Pi Account you can save your code and project steps progress.","logInButton":"Log in to save","signUpButton":"Sign up","downloadHint":"Download your project files so you can use them offline and in a different code editor.","downloadButton":"Download project"},"footer":{"accessibility":"Accessibility","charityNameAndNumber":"Raspberry Pi Foundation UK registered charity 1129409","cookies":"Cookies","privacy":"Privacy","safeguarding":"Safeguarding"},"projectName":{"label":"Project name","newProject":"New Project"},"header":{"download":"Download","downloadFileNameDefault":"my {{project_type}} project","editorLogoAltText":"Editor logo","projects":"Your projects","renameProject":"Edit project name","renameSave":"Save project name","save":"Save","loginToSave":"Log in to save","settings":"Settings"},"imagePanel":{"gallery":"Image Gallery"},"projectsPanel":{"projects":"Projects","yourProjectsButton":"Go to your projects","projectTypeLabel":"Project type"},"settingsPanel":{"info":"Settings"},"input":{"comment":{"py5":"Py5: imported mode"}},"mobile":{"code":"Code","menu":"Menu","output":"Output","preview":"Preview","steps":"Steps"},"modals":{"close":"Close"},"notifications":{"close":"close","loginPrompt":"To save this project and access it later, don\'t forget to log in or sign up!","projectRenamed":"You have renamed your project.","projectSaved":"Your project has been saved","savePrompt":"Save this project to access it later under \\"Your projects\\"."},"output":{"errors":{"interrupted":"Execution interrupted"},"newTab":"Preview in new tab","preview":"preview","textOutput":"Text output","visualOutput":"Visual output"},"outputViewToggle":{"buttonTabLabel":"Tabbed view","buttonTabTitle":"Tabbed view","buttonSplitLabel":"Split view","buttonSplitTitle":"Split view"},"project":{"accessDeniedWithAuthModal":{"embedded":{"text":"Visit the Projects site for cool project ideas"},"heading":"You can\'t access this project","newProject":"Create a new code project","projectsSiteLinkText":"Explore Projects site","text":"Visit the Projects site for cool project ideas or start coding in a new project."},"loading":"Loading","notFoundModal":{"embedded":{"text":"Visit the Projects site for cool project ideas"},"heading":"This project does not exist","newProject":"Start new code project","projectsSiteLinkText":"Explore Projects site","text":"You can start coding in a new project, or visit the Projects site for cool project ideas."},"untitled":"Untitled project"},"projectHeader":{"subTitle":"Code Editor","title":"Your projects","text":"Select a project to continue coding, view, or edit it."},"projectList":{"delete":"Delete","deleteLabel":"Delete project","empty":"No projects created yet","label":"Open project menu","loading":"Loading","loadingFailed":"Failed to load projects","newProject":"Create a new project","pagination":{"first":"First page","last":"Last page","next":"Next page","previous":"Previous page","more":"Load more projects"},"rename":"Rename","renameLabel":"Rename project","renameProjectModal":{"cancel":"Do not save","heading":"Rename project","inputLabel":"Change the name of your project","save":"Save"},"updated":"Edited","python_type":"Python","html_type":"HTML"},"projectTypes":{"html":"HTML/CSS","python":"Python"},"runButton":{"run":"Run","stop":"Stop","stopping":"Stopping..."},"saveStatus":{"saving":"Saving","saved":"Saved"},"runners":{"HtmlOutput":"HTML Output Preview"},"sidebar":{"collapse":"Collapse sidebar","download":"Download project","expand":"Expand sidebar","file":"Project files","images":"Image gallery","settings":"Settings","projects":"Projects","information":"Information","information_text":"Our Code Editor is a tool to help young people learn to code. We have only included functions that are simple and safe to use. That\'s why, for example, links to other websites are not allowed.","feedback":"Feedback","help":"Help","privacy":"Privacy","cookies":"Cookies","accessibility":"Accessibility","safeguarding":"Safeguarding","charity":"Raspberry Pi Foundation - UK registered charity 1129409","settingsMenu":{"heading":"Settings","textSize":"Text size","theme":"Theme","textSizeOptions":{"large":"Large","medium":"Medium","small":"Small"},"themeOptions":{"dark":"Dark","light":"Light"}}},"webComponent":{"loading":"Loading","failed":"Load failed"},"newInputPanelButton":{"buttonText":"Add another panel"},"button":{"yes":"Yes","no":"No"},"common":{"or":"or"}}');
8
+ module.exports = /*#__PURE__*/JSON.parse('{"modal":{"close":"Close","error":{"error":"Error","heading":"An error has occurred","externalLink":{"message":"Unfortunately links to external sites are not available in the Editor."}}},"editorPanel":{"ariaLabel":"editor text input","characterLimitError":"Error: Character limit reached","characterLimitExplanation_one":"Files in the editor are limited to {{count}} character","characterLimitExplanation_other":"Files in the editor are limited to {{count}} characters","viewOnly":"View only","close":"close"},"filePanel":{"errors":{"reservedFileName":"{{fileName}} is a reserved file name. Please choose a different name.","containsSpaces":"File names must not contain spaces.","generalError":"Error","notUnique":"File names must be unique.","or":"or","unsupportedExtension":"File names must end in {{allowedExtensions}}."},"files":"Project files","images":"Image gallery","newFileButton":"Add file","newFileModal":{"cancel":"Cancel","heading":"Add a new file to your project","helpText":"Remember to add the file extension at the end of your file name, for example, {{examples}}","helpTextExample":{"html":"\'file.html\', \'file.css\' or \'file.js\'","python":"\'file.py\'"},"inputLabel":"Name your file","addFile":"Add file"},"renameFileModal":{"cancel":"Cancel","heading":"Rename file","inputLabel":"Name your file","save":"Save"},"fileMenu":{"label":"Open file menu","renameItem":"Rename file"}},"downloadPanel":{"heading":"Save & download","logInTitle":"Log in to save your progress","logInHint":"With a Raspberry Pi Account you can save your code and project steps progress.","logInButton":"Log in to save","signUpButton":"Sign up","downloadHint":"Download your project files so you can use them offline and in a different code editor.","downloadButton":"Download project"},"footer":{"accessibility":"Accessibility","charityNameAndNumber":"Raspberry Pi Foundation UK registered charity 1129409","cookies":"Cookies","privacy":"Privacy","safeguarding":"Safeguarding"},"projectName":{"label":"Project name","newProject":"New Project"},"header":{"download":"Download","downloadFileNameDefault":"my {{project_type}} project","editorLogoAltText":"Editor logo","projects":"Your projects","renameProject":"Edit project name","renameSave":"Save project name","save":"Save","loginToSave":"Log in to save","settings":"Settings"},"imagePanel":{"gallery":"Image Gallery"},"projectsPanel":{"projects":"Projects","yourProjectsButton":"Go to your projects","projectTypeLabel":"Project type"},"settingsPanel":{"info":"Settings"},"input":{"comment":{"py5":"Py5: imported mode"}},"mobile":{"code":"Code","menu":"Menu","output":"Output","preview":"Preview","steps":"Steps"},"modals":{"close":"Close"},"notifications":{"close":"close","loginPrompt":"To save this project and access it later, don\'t forget to log in or sign up!","projectRenamed":"You have renamed your project.","projectSaved":"Your project has been saved","savePrompt":"Save this project to access it later under \\"Your projects\\"."},"output":{"errors":{"interrupted":"Execution interrupted"},"newTab":"Preview in new tab","preview":"preview","textOutput":"Text output","visualOutput":"Visual output"},"outputViewToggle":{"buttonTabLabel":"Tabbed view","buttonTabTitle":"Tabbed view","buttonSplitLabel":"Split view","buttonSplitTitle":"Split view"},"project":{"accessDeniedWithAuthModal":{"embedded":{"text":"Visit the Projects site for cool project ideas"},"heading":"You can\'t access this project","newProject":"Create a new code project","projectsSiteLinkText":"Explore Projects site","text":"Visit the Projects site for cool project ideas or start coding in a new project."},"loading":"Loading","notFoundModal":{"embedded":{"text":"Visit the Projects site for cool project ideas"},"heading":"This project does not exist","newProject":"Start new code project","projectsSiteLinkText":"Explore Projects site","text":"You can start coding in a new project, or visit the Projects site for cool project ideas."},"untitled":"Untitled project"},"projectHeader":{"subTitle":"Code Editor","title":"Your projects","text":"Select a project to continue coding, view, or edit it."},"projectList":{"delete":"Delete","deleteLabel":"Delete project","empty":"No projects created yet","label":"Open project menu","loading":"Loading","loadingFailed":"Failed to load projects","newProject":"Create a new project","pagination":{"first":"First page","last":"Last page","next":"Next page","previous":"Previous page","more":"Load more projects"},"rename":"Rename","renameLabel":"Rename project","renameProjectModal":{"cancel":"Do not save","heading":"Rename project","inputLabel":"Change the name of your project","save":"Save"},"updated":"Edited","python_type":"Python","html_type":"HTML"},"projectTypes":{"html":"HTML/CSS","python":"Python"},"runButton":{"run":"Run","stop":"Stop","stopping":"Stopping..."},"saveStatus":{"saving":"Saving","saved":"Saved"},"sidebar":{"collapse":"Collapse sidebar","download":"Download project","expand":"Expand sidebar","file":"Project files","images":"Image gallery","settings":"Settings","projects":"Projects","information":"Information","information_text":"Our Code Editor is a tool to help young people learn to code. We have only included functions that are simple and safe to use. That\'s why, for example, links to other websites are not allowed.","feedback":"Feedback","help":"Help","privacy":"Privacy","cookies":"Cookies","accessibility":"Accessibility","safeguarding":"Safeguarding","charity":"Raspberry Pi Foundation - UK registered charity 1129409","settingsMenu":{"heading":"Settings","textSize":"Text size","theme":"Theme","textSizeOptions":{"large":"Large","medium":"Medium","small":"Small"},"themeOptions":{"dark":"Dark","light":"Light"}}},"webComponent":{"loading":"Loading","failed":"Load failed"},"newInputPanelButton":{"buttonText":"Add another panel"},"button":{"yes":"Yes","no":"No"},"common":{"or":"or"}}');
9
9
 
10
10
  /***/ })
11
11
 
@@ -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();