code-battles 1.7.8 → 1.7.9

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/cjs/index.js CHANGED
@@ -5987,6 +5987,19 @@ function requirePrismLineNumbers () {
5987
5987
  requirePrismLineNumbers();
5988
5988
 
5989
5989
  const initialize = () => {
5990
+ // Load the packed Python file of the project, on the main thread and on a web worker.
5991
+ const mainThreadScript = document.createElement("script");
5992
+ mainThreadScript.type = "py";
5993
+ mainThreadScript.src = "/scripts/packed.py";
5994
+ mainThreadScript.setAttribute("config", "/config.json");
5995
+ document.body.appendChild(mainThreadScript);
5996
+ const workerScript = document.createElement("script");
5997
+ workerScript.type = "py";
5998
+ workerScript.src = "/scripts/packed.py";
5999
+ workerScript.setAttribute("config", "/config.json");
6000
+ workerScript.toggleAttribute("worker", true);
6001
+ workerScript.setAttribute("name", "worker");
6002
+ document.body.appendChild(workerScript);
5990
6003
  // @ts-ignore
5991
6004
  window.showAlert = (title, alert, color, icon, limitTime, isCode) => {
5992
6005
  var _a;
package/dist/esm/index.js CHANGED
@@ -5985,6 +5985,19 @@ function requirePrismLineNumbers () {
5985
5985
  requirePrismLineNumbers();
5986
5986
 
5987
5987
  const initialize = () => {
5988
+ // Load the packed Python file of the project, on the main thread and on a web worker.
5989
+ const mainThreadScript = document.createElement("script");
5990
+ mainThreadScript.type = "py";
5991
+ mainThreadScript.src = "/scripts/packed.py";
5992
+ mainThreadScript.setAttribute("config", "/config.json");
5993
+ document.body.appendChild(mainThreadScript);
5994
+ const workerScript = document.createElement("script");
5995
+ workerScript.type = "py";
5996
+ workerScript.src = "/scripts/packed.py";
5997
+ workerScript.setAttribute("config", "/config.json");
5998
+ workerScript.toggleAttribute("worker", true);
5999
+ workerScript.setAttribute("name", "worker");
6000
+ document.body.appendChild(workerScript);
5988
6001
  // @ts-ignore
5989
6002
  window.showAlert = (title, alert, color, icon, limitTime, isCode) => {
5990
6003
  var _a;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "code-battles",
3
- "version": "1.7.8",
3
+ "version": "1.7.9",
4
4
  "description": "A library for building interactive competitive coding battles",
5
5
  "repository": "https://github.com/noamzaks/code-battles",
6
6
  "homepage": "https://code-battles.readthedocs.org",