gwchq-textjam 0.1.0 → 0.1.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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "gwchq-textjam",
3
3
  "description": "Embeddable React editor used in Raspberry Pi text-based projects.",
4
- "version": "0.1.0",
4
+ "version": "0.1.1",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/GirlsFirst/gwchq-textjam",
7
7
  "author": "Girls Who Code HQ",
@@ -20,7 +20,7 @@
20
20
  "lint": "eslint \"src/**/*.{js,jsx,json}\"",
21
21
  "lint:fix": "eslint --fix \"src/**/*.{js,jsx,json}\"",
22
22
  "stylelint": "stylelint src/**/*.scss",
23
- "test": "node scripts/test.js --transformIgnorePatterns 'node_modules/(?!three)/'"
23
+ "test": "jest"
24
24
  },
25
25
  "module": "./dist/index.js",
26
26
  "exports": {
@@ -32,7 +32,9 @@
32
32
  "./assets/*": "./dist/assets/*"
33
33
  },
34
34
  "files": [
35
- "dist"
35
+ "dist",
36
+ "README.md",
37
+ "LICENSE"
36
38
  ],
37
39
  "peerDependencies": {
38
40
  "react": ">=17",
@@ -43,7 +45,6 @@
43
45
  "*.scss"
44
46
  ],
45
47
  "dependencies": {
46
- "@apollo/client": "^3.7.8",
47
48
  "@babel/core": "^7.17.10",
48
49
  "@codemirror/commands": "^6.1.1",
49
50
  "@codemirror/lang-css": "^6.0.0",
@@ -56,30 +57,19 @@
56
57
  "@juggle/resize-observer": "^3.3.1",
57
58
  "@lezer/highlight": "^1.0.0",
58
59
  "@raspberrypifoundation/design-system-react": "^2.7.0",
59
- "@react-three/drei": "9.114.3",
60
- "@react-three/fiber": "^8.0.13",
61
60
  "@reduxjs/toolkit": "^1.6.2",
62
61
  "@replit/codemirror-indentation-markers": "^6.1.0",
63
- "@sentry/browser": "^7.17.3",
64
- "@sentry/react": "7.16.0",
65
- "@sentry/tracing": "7.16.0",
66
62
  "@szhsin/react-menu": "^3.2.0",
67
- "apollo-link-sentry": "^3.2.3",
68
63
  "assert": "^2.1.0",
69
64
  "axios": "^0.24.0",
70
- "buffer": "^6.0.3",
71
65
  "classnames": "^2.3.2",
72
66
  "codemirror": "^6.0.1",
73
- "container-query-polyfill": "^1.0.2",
74
67
  "date-fns": "^4.1.0",
75
68
  "file-saver": "^2.0.5",
76
- "fs-extra": "^9.0.1",
77
- "graphql": "^16.6.0",
78
69
  "highcharts": "^9.3.1",
79
70
  "highcharts-react-official": "^3.1.0",
80
71
  "i18next": "^22.0.3",
81
72
  "i18next-resources-to-backend": "^1.2.1",
82
- "identity-obj-proxy": "3.0.0",
83
73
  "jest-axe": "^7.0.0",
84
74
  "jest-canvas-mock": "^2.5.2",
85
75
  "js-convert-case": "^4.2.0",
@@ -88,16 +78,12 @@
88
78
  "marked": "^15.0.6",
89
79
  "mime-types": "^2.1.35",
90
80
  "node-html-parser": "^6.1.5",
91
- "oidc-client": "^1.11.5",
92
81
  "plotly.js": "^3.0.2",
93
82
  "prismjs": "^1.29.0",
94
83
  "process": "^0.11.10",
95
- "prompts": "2.4.0",
96
84
  "prop-types": "^15.8.1",
97
- "raw-loader": "^4.0.2",
98
85
  "rc-resize-observer": "^1.3.1",
99
86
  "re-resizable": "6.9.9",
100
- "react-app-polyfill": "^2.0.0",
101
87
  "react-confirm-alert": "^2.8.0",
102
88
  "react-container-query": "^0.13.0",
103
89
  "react-cookie": "^4.1.1",
@@ -112,14 +98,8 @@
112
98
  "react-timer-hook": "^3.0.5",
113
99
  "react-toastify": "^8.1.0",
114
100
  "react-toggle": "^4.1.3",
115
- "redux-oidc": "^4.0.0-beta1",
116
- "skulpt": "^1.2.0",
117
101
  "stream-browserify": "^3.0.0",
118
- "three": "0.169.0",
119
- "ts-pnp": "1.2.0",
120
- "url": "^0.11.4",
121
102
  "util": "^0.12.5",
122
- "watch": "^1.0.2",
123
103
  "web-vitals": "^1.0.1"
124
104
  },
125
105
  "browserslist": {
package/dist/13.index.js DELETED
@@ -1 +0,0 @@
1
- export const id=13;export const ids=[13];export const modules={48675:e=>{e.exports=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","viewOnly":"View only","close":"close","characterLimitExplanation_one":"Files in the editor are limited to {{count}} character","characterLimitExplanation_other":"Files in the editor are limited to {{count}} characters"},"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"},"infoPanel":{"info":"Information"},"instructionsPanel":{"demoInstructions":{"title":"How instructions work","enablingInstructions":"Enabling instructions","visible":"Any text written here will be visible to students in the sidebar.","writingInstructions":"Writing instructions","markdown":"Write your instructions using [Markdown](https://www.markdownguide.org/).","whatYouCanDo":"What you can do","lists":"Lists","bulletPoints":"Bullet points","numberedSteps":"Numbered steps"},"emptyState":{"addInstructions":"Add instructions","edits":"Like project code, students will not see any edits you make to the instructions after they have saved their version of the project.","location":"These instructions will be shown to students in their project sidebar and will be view-only.","markdown":"Instructions are written in <0>markdown</0>.","purpose":"Instructions can be added to your project to guide students."},"removeInstructions":"Remove instructions","nextStep":"Next step","previousStep":"Previous step","projectSteps":"Project instructions","edit":"Edit","view":"View","removeInstructionsModal":{"removeInstructions":"Remove instructions","close":"Close","heading":"Remove project instructions?","removeInstuctionsWarning":"You are about to remove the instructions from the project.","resultRemovingInstructions":"As a result of removing these instructions:","instructionsWillBeDeleted":"Instructions content will be deleted.","studentsWorkingProjectNotRecievedInstructions":"Students who start working on this project will not receive instructions.","studentsStartedWillSeeInstructions":"Students who have already begun this project will still see the instructions in the form they had when the project was started."}},"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!","projectRemixed":"Your remixed project has been saved","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","senseHat":{"controls":{"colour":"color","humidity":"humidity","motion":"motion","motionSensorOptions":{"no":"No","yes":"Yes"},"name":"Space Station Control Panel","pressure":"pressure","temperature":"temperature","timer":"timer"},"model":{"pitch":"pitch","roll":"roll","yaw":"yaw"}},"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 links to other websites are not allowed, for example.","instructions":"Project instructions","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"},"imageUploadButton":{"uploadImage":"Upload image","uploadAnImage":"Upload an image","info":"Drag and drop images here, or click to select images from file","cancel":"Cancel","save":"Save","or":"or","errors":{"error":"Error","imageNameNotUnique":"Image names must be unique.","invalidImageExtension":"Image names must end in {{extensions}}."}},"newInputPanelButton":{"buttonText":"Add another panel"},"button":{"yes":"Yes","no":"No"},"common":{"or":"or"}}')}};
package/dist/156.index.js DELETED
@@ -1 +0,0 @@
1
- export const id=156;export const ids=[156];export const modules={53302:e=>{e.exports=JSON.parse('{"modal":{"close":"Schließen","error":{"error":"Fehler","heading":"Ein Fehler ist aufgetreten","externalLink":{"message":"Leider sind Links zu externen Seiten im Editor nicht verfügbar."}}},"editorPanel":{"ariaLabel":"Texteingabe des Editors","characterLimitError":"Fehler: Zeichenlimit erreicht","characterLimitExplanation_other":"Dateien im Editor sind auf {{count}} Zeichen begrenzt","viewOnly":"Nur Ansicht","close":"schließen"},"filePanel":{"errors":{"reservedFileName":"{{fileName}} ist ein reservierter Dateiname. Bitte wählen Sie einen anderen Namen.","containsSpaces":"Dateinamen dürfen keine Leerzeichen enthalten.","generalError":"Fehler","notUnique":"Dateinamen müssen eindeutig sein.","or":"oder","unsupportedExtension":"Dateinamen müssen mit {{allowedExtensions}} enden."},"files":"Projektdateien","images":"Bildergalerie","newFileButton":"Datei hinzufügen","newFileModal":{"cancel":"Abbrechen","heading":"Eine neue Datei zu Ihrem Projekt hinzufügen","helpText":"Denken Sie daran, die Dateiendung am Ende Ihres Dateinamens hinzuzufügen, zum Beispiel {{examples}}","helpTextExample":{"html":"\'datei.html\', \'datei.css\' oder \'datei.js\'","python":"\'datei.py\'"},"inputLabel":"Benennen Sie Ihre Datei","addFile":"Datei hinzufügen"},"renameFileModal":{"cancel":"Abbrechen","heading":"Datei umbenennen","inputLabel":"Benennen Sie Ihre Datei","save":"Speichern"},"fileMenu":{"label":"Datei-Menü öffnen","renameItem":"Datei umbenennen"}},"downloadPanel":{"heading":"Speichern & herunterladen","logInTitle":"Melden Sie sich an, um Ihren Fortschritt zu speichern","logInHint":"Mit einem Raspberry Pi Konto können Sie Ihren Code und den Fortschritt Ihrer Projektschritte speichern.","logInButton":"Zum Speichern anmelden","signUpButton":"Registrieren","downloadHint":"Laden Sie Ihre Projektdateien herunter, damit Sie sie offline und in einem anderen Code-Editor verwenden können.","downloadButton":"Projekt herunterladen"},"footer":{"accessibility":"Barrierefreiheit","charityNameAndNumber":"Raspberry Pi Foundation UK eingetragene Wohltätigkeitsorganisation 1129409","cookies":"Cookies","privacy":"Datenschutz","safeguarding":"Kinderschutz"},"projectName":{"label":"Projektname","newProject":"Neues Projekt"},"header":{"download":"Herunterladen","downloadFileNameDefault":"mein {{project_type}} Projekt","editorLogoAltText":"Editor-Logo","projects":"Ihre Projekte","renameProject":"Projektnamen bearbeiten","renameSave":"Projektnamen speichern","save":"Speichern","loginToSave":"Zum Speichern anmelden","settings":"Einstellungen"},"imagePanel":{"gallery":"Bildergalerie"},"infoPanel":{"info":"Informationen"},"instructionsPanel":{"demoInstructions":{"title":"So funktionieren Anweisungen","enablingInstructions":"Anweisungen aktivieren","visible":"Jeder hier geschriebene Text ist für die Schüler in der Seitenleiste sichtbar.","writingInstructions":"Anweisungen schreiben","markdown":"Schreiben Sie Ihre Anweisungen mit [Markdown](https://www.markdownguide.org/).","whatYouCanDo":"Was Sie tun können","lists":"Listen","bulletPoints":"Aufzählungszeichen","numberedSteps":"Nummerierte Schritte"},"emptyState":{"addInstructions":"Anweisungen hinzufügen","edits":"Wie beim Projektcode sehen die Schüler keine Änderungen, die Sie an den Anweisungen vornehmen, nachdem sie ihre Version des Projekts gespeichert haben.","location":"Diese Anweisungen werden den Schülern in ihrer Projekt-Seitenleiste angezeigt und sind schreibgeschützt.","markdown":"Anweisungen werden in Markdown geschrieben.","purpose":"Anweisungen können zu Ihrem Projekt hinzugefügt werden, um die Schüler anzuleiten."},"removeInstructions":"Anweisungen entfernen","nextStep":"Nächster Schritt","previousStep":"Vorheriger Schritt","projectSteps":"Projektablauf","edit":"Bearbeiten","view":"Anzeigen","removeInstructionsModal":{"removeInstructions":"Anweisungen entfernen","close":"Schließen","heading":"Projektanweisungen entfernen?","removeInstuctionsWarning":"Sie sind dabei, die Anweisungen aus dem Projekt zu entfernen.","resultRemovingInstructions":"Als Ergebnis des Entfernens dieser Anweisungen:","instructionsWillBeDeleted":"Der Inhalt der Anweisungen wird gelöscht.","studentsWorkingProjectNotRecievedInstructions":"Schüler, die mit diesem Projekt beginnen, erhalten keine Anweisungen.","studentsStartedWillSeeInstructions":"Schüler, die bereits mit diesem Projekt begonnen haben, können die Anweisungen weiterhin so sehen, wie sie beim Start waren."}},"projectsPanel":{"projects":"Projekte","yourProjectsButton":"Zu Ihren Projekten gehen","projectTypeLabel":"Projekttyp"},"settingsPanel":{"info":"Einstellungen"},"input":{"comment":{"py5":"Py5: importierter Modus"}},"mobile":{"code":"Code","menu":"Menü","output":"Ausgabe","preview":"Vorschau","steps":"Schritte"},"modals":{"close":"Schließen"},"notifications":{"close":"schließen","loginPrompt":"Um dieses Projekt zu speichern und später darauf zuzugreifen, vergessen Sie nicht, sich anzumelden oder zu registrieren!","projectRemixed":"Ihr neu gemischtes Projekt wurde gespeichert","projectRenamed":"Sie haben Ihr Projekt umbenannt.","projectSaved":"Ihr Projekt wurde gespeichert","savePrompt":"Speichern Sie dieses Projekt, um später unter „Ihre Projekte“ darauf zuzugreifen."},"output":{"errors":{"interrupted":"Ausführung unterbrochen"},"newTab":"Vorschau in neuem Tab","preview":"Vorschau","senseHat":{"controls":{"colour":"Farbe","humidity":"Feuchtigkeit","motion":"Bewegung","motionSensorOptions":{"no":"Nein","yes":"Ja"},"name":"Steuerungspanel der Raumstation","pressure":"Druck","temperature":"Temperatur","timer":"Timer"},"model":{"pitch":"Neigung","roll":"Rollen","yaw":"Gieren"}},"textOutput":"Textausgabe","visualOutput":"Visuelle Ausgabe"},"outputViewToggle":{"buttonTabLabel":"Tab-Ansicht","buttonTabTitle":"Tab-Ansicht","buttonSplitLabel":"Geteilte Ansicht","buttonSplitTitle":"Geteilte Ansicht"},"project":{"accessDeniedWithAuthModal":{"embedded":{"text":"Besuchen Sie die Projektseite für tolle Projektideen"},"heading":"Sie können auf dieses Projekt nicht zugreifen","newProject":"Ein neues Code-Projekt erstellen","projectsSiteLinkText":"Projektseite erkunden","text":"Besuchen Sie die Projektseite für tolle Projektideen oder beginnen Sie mit dem Programmieren in einem neuen Projekt."},"loading":"Wird geladen","notFoundModal":{"embedded":{"text":"Besuchen Sie die Projektseite für tolle Projektideen"},"heading":"Dieses Projekt existiert nicht","newProject":"Neues Code-Projekt starten","projectsSiteLinkText":"Projektseite erkunden","text":"Sie können mit dem Programmieren in einem neuen Projekt beginnen oder die Projektseite für tolle Projektideen besuchen."},"untitled":"Unbenanntes Projekt"},"projectHeader":{"subTitle":"Code-Editor","title":"Ihre Projekte","text":"Wählen Sie ein Projekt aus, um mit dem Programmieren fortzufahren, es anzuzeigen oder zu bearbeiten."},"projectList":{"delete":"Löschen","deleteLabel":"Projekt löschen","empty":"Noch keine Projekte erstellt","label":"Projektmenü öffnen","loading":"Wird geladen","loadingFailed":"Fehler beim Laden der Projekte","newProject":"Neues Projekt erstellen","pagination":{"first":"Erste Seite","last":"Letzte Seite","next":"Nächste Seite","previous":"Vorherige Seite","more":"Weitere Projekte laden"},"rename":"Umbenennen","renameLabel":"Projekt umbenennen","renameProjectModal":{"cancel":"Nicht speichern","heading":"Projekt umbenennen","inputLabel":"Ändern Sie den Namen Ihres Projekts","save":"Speichern"},"updated":"Bearbeitet","python_type":"Python","html_type":"HTML"},"projectTypes":{"html":"HTML/CSS","python":"Python"},"runButton":{"run":"Ausführen","stop":"Stopp","stopping":"Wird gestoppt..."},"saveStatus":{"saving":"Wird gespeichert","saved":"Gespeichert"},"runners":{"HtmlOutput":"HTML-Ausgabevorschau"},"sidebar":{"collapse":"Seitenleiste einklappen","download":"Projekt herunterladen","expand":"Seitenleiste ausklappen","file":"Projektdateien","images":"Bildergalerie","settings":"Einstellungen","projects":"Projekte","information":"Informationen","information_text":"Unser Code-Editor ist ein Werkzeug, um jungen Menschen das Programmieren zu erleichtern. Wir haben nur Funktionen integriert, die einfach und sicher zu bedienen sind. Deshalb sind beispielsweise Links zu anderen Webseiten nicht erlaubt.","instructions":"Projektanweisungen","feedback":"Feedback","help":"Hilfe","privacy":"Datenschutz","cookies":"Cookies","accessibility":"Barrierefreiheit","safeguarding":"Kinderschutz","charity":"Raspberry Pi Foundation - eingetragene Wohltätigkeitsorganisation in Großbritannien 1129409","settingsMenu":{"heading":"Einstellungen","textSize":"Textgröße","theme":"Thema","textSizeOptions":{"large":"Groß","medium":"Mittel","small":"Klein"},"themeOptions":{"dark":"Dunkel","light":"Hell"}}},"webComponent":{"loading":"Wird geladen","failed":"Laden fehlgeschlagen"},"imageUploadButton":{"uploadImage":"Bild hochladen","uploadAnImage":"Laden Sie ein Bild hoch","info":"Ziehen Sie Bilder hierher, oder klicken Sie, um Bilder aus der Datei auszuwählen","cancel":"Stornieren","save":"Speichern","errors":{"error":"Fehler","imageNameNotUnique":"Bildnamen müssen eindeutig sein.","invalidImageExtension":"Bildnamen müssen enden auf {{extensions}}."}},"newInputPanelButton":{"buttonText":"Fügen Sie ein weiteres Panel hinzu"},"button":{"yes":"Ja","no":"Nein"},"common":{"or":"oder"}}')}};
package/dist/447.index.js DELETED
@@ -1 +0,0 @@
1
- export const id=447;export const ids=[447];export const modules={84701:e=>{e.exports=JSON.parse('{"modal":{"close":"Cerrar","error":{"error":"Error","heading":"Se produjo un error","externalLink":{"message":"Desafortunadamente, no se pueden usar enlaces a sitios externos dentro del Editor."}}},"editorPanel":{"ariaLabel":"entrada de texto del editor","characterLimitError":"Error: Se alcanzó el límite de caracteres","viewOnly":"Vista solamente","close":"cerrar","characterLimitExplanation_one":"Los archivos del editor se limitan a {{count}} carácter","characterLimitExplanation_other":"Los archivos del editor se limitan a {{count}} caracteres"},"filePanel":{"errors":{"reservedFileName":"{{fileName}} es un nombre de archivo reservado. Elige otro nombre.","containsSpaces":"Los nombres de archivo no deben contener espacios.","generalError":"Error","notUnique":"Los nombres de archivo deben ser únicos.","or":"o","unsupportedExtension":"Los nombres de archivo deben terminar en {{allowedExtensions}}."},"files":"Archivos del proyecto","images":"Galería de imágenes","newFileButton":"Agregar archivo","newFileModal":{"cancel":"Cancelar","heading":"Agrega un nuevo archivo a tu proyecto","helpText":"Recuerda agregar la extensión de archivo al final del nombre de archivo, por ejemplo, {{examples}}","helpTextExample":{"html":"\\"archivo.html\\", \\"archivo.css\\" o \\"archivo.js\\"","python":"\\"archivo.py\\""},"inputLabel":"Asigna un nombre a tu archivo","addFile":"Agregar archivo"},"renameFileModal":{"cancel":"Cancelar","heading":"Cambia el nombre del archivo","inputLabel":"Asigna un nombre a tu archivo","save":"Guardar"},"fileMenu":{"label":"Abrir el menú de archivos","renameItem":"Cambiar el nombre del archivo"}},"downloadPanel":{"heading":"Guardar y descargar","logInTitle":"Inicia sesión para guardar tu progreso","logInHint":"Con una cuenta de Raspberry Pi, puedes guardar tu código y el progreso en los pasos de tu proyecto.","logInButton":"Inicia sesión para guardar","signUpButton":"Registrarse","downloadHint":"Descarga los archivos de tu proyecto para que usarlos sin conexión y en un editor de código diferente.","downloadButton":"Descargar proyecto"},"footer":{"accessibility":"Accesibilidad","charityNameAndNumber":"Fundación Raspberry Pi, organización benéfica registrada en el Reino Unido 1129409","cookies":"Cookies","privacy":"Privacidad","safeguarding":"Protección"},"projectName":{"label":"Nombre del proyecto","newProject":"Nuevo proyecto"},"header":{"download":"Descargar","downloadFileNameDefault":"mi proyecto {{project_type}}","editorLogoAltText":"Logotipo del Editor","projects":"Tus proyectos","renameProject":"Edita el nombre del proyecto","renameSave":"Guarda el nombre del proyecto","save":"Guardar","loginToSave":"Inicia sesión para guardar","settings":"Configuración"},"imagePanel":{"gallery":"Galería de imágenes"},"infoPanel":{"info":"Información"},"instructionsPanel":{"demoInstructions":{"title":"Funcionamiento de las instrucciones","enablingInstructions":"Activación de las instrucciones","visible":"Todo texto escrito aquí será visible para el grupo de estudiantes en la barra lateral.","writingInstructions":"Redacción de las instrucciones","markdown":"Escribe tus instrucciones usando [Markdown](https://www.markdownguide.org/).","whatYouCanDo":"Lo que puedes hacer","lists":"Listas","bulletPoints":"Viñetas","numberedSteps":"Pasos numerados"},"emptyState":{"addInstructions":"Añadir instrucciones","edits":"Al igual que con el código del proyecto, el grupo de estudiantes no verá los cambios que hagas en las instrucciones una vez que hayan guardado su versión del proyecto.","location":"Estas instrucciones aparecerán en la barra lateral del proyecto de cada estudiante, y serán de lectura únicamente.","markdown":"Las instrucciones están escritas en <0>markdown</0>.","purpose":"Puedes agregar instrucciones a tu proyecto para guiar a tus estudiantes."},"removeInstructions":"Eliminar las instrucciones","nextStep":"Siguiente paso","previousStep":"Paso anterior","projectSteps":"Instrucciones del proyecto","edit":"Editar","view":"Ver","removeInstructionsModal":{"removeInstructions":"Eliminar las instrucciones","close":"Cerrar","heading":"¿Deseas eliminar las instrucciones del proyecto?","removeInstuctionsWarning":"Estás a punto de eliminar las instrucciones del proyecto.","resultRemovingInstructions":"Si eliminas estas instrucciones, sucederá lo siguiente:","instructionsWillBeDeleted":"El contenido de las instrucciones se borrará.","studentsWorkingProjectNotRecievedInstructions":"Quienes comiencen a trabajar en este proyecto, no recibirán instrucciones.","studentsStartedWillSeeInstructions":"Quienes ya hayan comenzado a trabajar en este proyecto seguirán viendo las instrucciones tal como estaban cuando comenzaron."}},"projectsPanel":{"projects":"Proyectos","yourProjectsButton":"Ir a tus proyectos","projectTypeLabel":"Tipo de proyecto"},"settingsPanel":{"info":"Configuración"},"input":{"comment":{"py5":"Py5: modo importado"}},"mobile":{"code":"Código","menu":"Menú","output":"Salida","preview":"Vista previa","steps":"Pasos"},"modals":{"close":"Cerrar"},"notifications":{"close":"cerrar","loginPrompt":"Para guardar este proyecto y poder acceder a él más tarde, ¡no olvides iniciar sesión o registrarte!","projectRemixed":"Tu proyecto remezclado se guardó","projectRenamed":"Cambiaste el nombre de tu proyecto.","projectSaved":"Tu proyecto se guardó","savePrompt":"Guarda este proyecto para volver a acceder a él en \\"Tus proyectos\\"."},"output":{"errors":{"interrupted":"Se interrumpió la ejecución"},"newTab":"Vista previa en nueva pestaña","preview":"vista previa","senseHat":{"controls":{"colour":"color","humidity":"humedad","motion":"movimiento","motionSensorOptions":{"no":"No","yes":"Sí"},"name":"Panel de control de la estación espacial","pressure":"presión","temperature":"temperatura","timer":"temporizador"},"model":{"pitch":"cabeceo","roll":"alabeo","yaw":"guiñada"}},"textOutput":"Salida de texto","visualOutput":"Salida visual"},"outputViewToggle":{"buttonTabLabel":"Vista con pestañas","buttonTabTitle":"Vista con pestañas","buttonSplitLabel":"Vista dividida","buttonSplitTitle":"Vista dividida"},"project":{"accessDeniedWithAuthModal":{"embedded":{"text":"Visita el sitio de proyectos para ver ideas de proyectos geniales"},"heading":"No puedes acceder a este proyecto","newProject":"Crea un nuevo proyecto de programación","projectsSiteLinkText":"Explora el sitio de proyectos","text":"Visita el sitio de proyectos para ver ideas de proyectos geniales o para comenzar a programar un proyecto nuevo."},"loading":"Cargando","notFoundModal":{"embedded":{"text":"Visita el sitio de proyectos para ver ideas de proyectos geniales"},"heading":"Este proyecto no existe","newProject":"Comienza un nuevo proyecto de programación","projectsSiteLinkText":"Explora el sitio de proyectos","text":"Puedes comenzar a programar en un nuevo proyecto o visitar el sitio de Proyectos para obtener ideas de proyectos geniales."},"untitled":"Proyecto sin título"},"projectHeader":{"subTitle":"Code Editor","title":"Tus proyectos","text":"Selecciona un proyecto para seguir programando, verlo o editarlo."},"projectList":{"delete":"Borrar","deleteLabel":"Borrar el proyecto","empty":"Aún no se crearon proyectos","label":"Abrir el menú de proyectos","loading":"Cargando","loadingFailed":"No se pudieron cargar los proyectos","newProject":"Crea un nuevo proyecto","pagination":{"first":"Primera página","last":"Última página","next":"Página siguiente","previous":"Página anterior","more":"Cargar más proyectos"},"rename":"Cambiar el nombre","renameLabel":"Cambiar el nombre del proyecto","renameProjectModal":{"cancel":"No guardar","heading":"Cambiar el nombre del proyecto","inputLabel":"Cambia el nombre de tu proyecto","save":"Guardar"},"updated":"Editado","python_type":"Python","html_type":"HTML"},"projectTypes":{"html":"HTML/CSS","python":"Python"},"runButton":{"run":"Ejecutar","stop":"Detener","stopping":"Deteniendo…"},"saveStatus":{"saving":"Guardando","saved":"Guardado"},"runners":{"HtmlOutput":"Vista previa de salida HTML"},"sidebar":{"collapse":"Contraer barra lateral","download":"Descargar proyecto","expand":"Expandir barra lateral","file":"Archivos del proyecto","images":"Galería de imágenes","settings":"Configuración","projects":"Proyectos","information":"Información","information_text":"Nuestro Code Editor es una herramienta para ayudar a la población joven a programar. Solo incluimos funciones que son simples y de uso seguro. Por eso, por ejemplo, no se permiten los enlaces a otros sitios web.","instructions":"Instrucciones del proyecto","feedback":"Comentarios","help":"Ayuda","privacy":"Privacidad","cookies":"Cookies","accessibility":"Accesibilidad","safeguarding":"Protección","charity":"Fundación Raspberry Pi, organización benéfica registrada en el Reino Unido 1129409","settingsMenu":{"heading":"Configuración","textSize":"Tamaño del texto","theme":"Tema","textSizeOptions":{"large":"Grande","medium":"Medio","small":"Pequeño"},"themeOptions":{"dark":"Oscuro","light":"Claro"}}},"webComponent":{"loading":"Cargando","failed":"Error al cargar"},"imageUploadButton":{"uploadImage":"Subir imagen","uploadAnImage":"Subir una imagen","info":"Arrastra y suelta imágenes aquí o haz clic para seleccionar imágenes de un archivo","cancel":"Cancelar","save":"Guardar","or":"o","errors":{"error":"Error","imageNameNotUnique":"Los nombres de imagen deben ser únicos.","invalidImageExtension":"Los nombres de imagen deben terminar en {{extensions}}."}},"newInputPanelButton":{"buttonText":"Agregar otro panel"},"button":{"yes":"Sí","no":"No"},"common":{"or":"o"}}')}};
package/dist/64.index.js DELETED
@@ -1 +0,0 @@
1
- export const id=64;export const ids=[64];export const modules={15226:e=>{e.exports=JSON.parse('{"modal":{"close":"Fermer ","error":{"error":"Erreur","heading":"Une erreur s\'est produite","externalLink":{"message":"Malheureusement, les liens vers des sites externes ne sont pas disponibles dans le Code Editor."}}},"editorPanel":{"ariaLabel":"saisie de texte dans le Code Editor","characterLimitError":"Erreur : limite de caractères atteinte","viewOnly":"Voir seulement","close":"fermer ","characterLimitExplanation_one":"Les fichiers dans le Code Editor sont limités à {{count}} caractère","characterLimitExplanation_other":"Les fichiers dans le Code Editor sont limités à {{count}} caractères"},"filePanel":{"errors":{"reservedFileName":"{{fileName}} est un nom de fichier réservé. Veuillez choisir un autre nom.","containsSpaces":"Le nom des fichiers ne doit pas contenir d\'espaces.","generalError":"Erreur","notUnique":"Le nom des fichiers doit être unique.","or":"ou","unsupportedExtension":"Le nom des fichiers doit se terminer par {{allowedExtensions}}."},"files":"Fichiers du projet","images":"Galerie d\'images","newFileButton":"Ajouter un fichier","newFileModal":{"cancel":"Annuler","heading":"Ajouter un nouveau fichier à votre projet","helpText":"N\'oubliez pas d\'ajouter l\'extension du fichier à la fin du nom de votre fichier, par exemple, {{examples}}","helpTextExample":{"html":"\'fichier.html\', \'fichier.css\' ou \'fichier.js\'","python":"\'fichier.py\'"},"inputLabel":"Nommer votre fichier","addFile":"Ajouter un fichier"},"renameFileModal":{"cancel":"Annuler","heading":"Renommer le fichier","inputLabel":"Nommer votre fichier","save":"Enregistrer"},"fileMenu":{"label":"Ouvrir le menu fichier","renameItem":"Renommer le fichier"}},"downloadPanel":{"heading":"Enregistrer et télécharger","logInTitle":"Connectez-vous pour enregistrer vos progrès","logInHint":"Avec un compte Raspberry Pi, vous pouvez enregistrer votre code et la progression des étapes du projet.","logInButton":"Connectez-vous pour enregistrer","signUpButton":"S\'inscrire","downloadHint":"Téléchargez vos fichiers de projet afin de pouvoir les utiliser hors ligne et dans un autre éditeur de code.","downloadButton":"Télécharger le projet"},"footer":{"accessibility":"Accessibilité","charityNameAndNumber":"Raspberry Pi Foundation, organisme de charité enregistré au Royaume-Uni sous le numéro 1129409","cookies":"Témoins","privacy":"Protection de la vie privée","safeguarding":"Protection"},"projectName":{"label":"Nom du projet","newProject":"Nouveau projet"},"header":{"download":"Télécharger","downloadFileNameDefault":"mon projet {{project_type}}","editorLogoAltText":"Logo du Editor","projects":"Tes projets","renameProject":"Modifier le nom du projet","renameSave":"Enregistrer le nom du projet","save":"Enregistrer","loginToSave":"Connectez-vous pour enregistrer","settings":"Paramètres"},"imagePanel":{"gallery":"Galerie d\'images"},"infoPanel":{"info":"Informations"},"instructionsPanel":{"demoInstructions":{"title":"Comment utiliser les instructions","enablingInstructions":"Activer les instructions","visible":"Tout texte écrit ici sera visible par les élèves dans la barre latérale.","writingInstructions":"Écrire des instructions","markdown":"Écrivez vos instructions en utilisant [Markdown](https://www.markdownguide.org/).","whatYouCanDo":"Voici ce que vous pouvez faire","lists":"Listes","bulletPoints":"Puces","numberedSteps":"Étapes numérotées"},"emptyState":{"addInstructions":"Ajouter des instructions","edits":"Comme pour les projets de codage, les élèves ne verront aucune modification que vous apportez aux instructions après avoir enregistré leur version du projet.","location":"Les élèves pourront voir ces instructions dans la barre latérale de leur projet, mais elles seront en lecture seule.","markdown":"Les instructions sont écrites en <0>markdown</0>.","purpose":"Des instructions peuvent être ajoutées à votre projet pour guider les élèves."},"removeInstructions":"Supprimer les instructions","nextStep":"Prochaine étape","previousStep":"Étape précédente","projectSteps":"Instructions du projet","edit":"Modifier","view":"Voir","removeInstructionsModal":{"removeInstructions":"Supprimer les instructions","close":"Fermer ","heading":"Supprimer les instructions du projet?","removeInstuctionsWarning":"Vous êtes sur le point de supprimer les instructions du projet.","resultRemovingInstructions":"En supprimant les instructions, cela signifie que :","instructionsWillBeDeleted":"Le contenu des instructions sera supprimé.","studentsWorkingProjectNotRecievedInstructions":"Les élèves qui commencent à travailler sur ce projet ne recevront pas d’instructions.","studentsStartedWillSeeInstructions":"Les élèves qui ont déjà commencé à travailler sur ce projet pourront toujours voir les instructions telles qu\'elles étaient lorsqu\'ils ont commencé."}},"projectsPanel":{"projects":"Projets","yourProjectsButton":"Aller à vos projets","projectTypeLabel":"Type de projet"},"settingsPanel":{"info":"Paramètres"},"input":{"comment":{"py5":"Py5 : mode importé"}},"mobile":{"code":"Code","menu":"Menu","output":"Sortie","preview":"Aperçu","steps":"Étapes"},"modals":{"close":"Fermer "},"notifications":{"close":"fermer ","loginPrompt":"Pour enregistrer ce projet et y accéder plus tard, n\'oubliez pas de vous connecter ou de vous inscrire!","projectRemixed":"Votre projet remixé a été enregistré","projectRenamed":"Vous avez renommé votre projet.","projectSaved":"Votre projet a été enregistré","savePrompt":"Enregistrez ce projet pour y accéder ultérieurement sous « Vos projets »."},"output":{"errors":{"interrupted":"Exécution interrompue"},"newTab":"Voir un aperçu dans un nouvel onglet","preview":"aperçu","senseHat":{"controls":{"colour":"couleur","humidity":"humidité","motion":"mouvement","motionSensorOptions":{"no":"Non","yes":"Oui"},"name":"Panneau de contrôle de la station spatiale","pressure":"pression","temperature":"température","timer":"chronomètre"},"model":{"pitch":"tangage","roll":"roulis","yaw":"lacet"}},"textOutput":"Sortie de texte","visualOutput":"Sortie visuelle"},"outputViewToggle":{"buttonTabLabel":"Affichage par onglets","buttonTabTitle":"Affichage par onglets","buttonSplitLabel":"Affichage en écran partagé","buttonSplitTitle":"Affichage en écran partagé"},"project":{"accessDeniedWithAuthModal":{"embedded":{"text":"Visitez le site Projets pour des idées de projets intéressants"},"heading":"Vous ne pouvez pas accéder à ce projet","newProject":"Créer un nouveau code pour un projet","projectsSiteLinkText":"Explorer le site Projets","text":"Visitez le site Projets pour des idées de projets intéressants ou commencez à coder dans un nouveau projet."},"loading":"Chargement","notFoundModal":{"embedded":{"text":"Visitez le site Projets pour des idées de projets intéressants"},"heading":"Ce projet n\'existe pas","newProject":"Commencer un nouveau code pour un projet","projectsSiteLinkText":"Explorer le site Projets","text":"Vous pouvez commencer à coder dans un nouveau projet ou visiter le site Projets pour des idées de projets intéressantes."},"untitled":"Projet sans titre"},"projectHeader":{"subTitle":"Code Editor","title":"Vos projets","text":"Sélectionner un projet pour continuer à coder, l\'afficher ou le modifier."},"projectList":{"delete":"Supprimer","deleteLabel":"Supprimer le projet","empty":"Aucun projet n\'a été créé pour le moment","label":"Ouvrir le menu du projet","loading":"Chargement en cours","loadingFailed":"Échec du chargement des projets","newProject":"Créer un nouveau projet","pagination":{"first":"Première page","last":"Dernière page","next":"Page suivante","previous":"Page précédente","more":"Afficher plus de projets"},"rename":"Renommer","renameLabel":"Renommer le projet","renameProjectModal":{"cancel":"Ne pas enregistrer","heading":"Renommer le projet","inputLabel":"Modifier le nom de votre projet","save":"Enregistrer"},"updated":"Modifié","python_type":"Python","html_type":"HTML"},"projectTypes":{"html":"HTML/CSS","python":"Python"},"runButton":{"run":"Exécuter","stop":"Arrêter","stopping":"Arrêt en cours..."},"saveStatus":{"saving":"Enregistrement en cours","saved":"Enregistré"},"runners":{"HtmlOutput":"Aperçu de la sortie HTML"},"sidebar":{"collapse":"Réduire la barre latérale","download":"Télécharger le projet","expand":"Ouvrir la barre latérale","file":"Fichiers du projet","images":"Galerie d\'images","settings":"Paramètres","projects":"Projets","information":"Informations","information_text":"Notre Code Editor est un outil destiné à aider les jeunes à apprendre à coder. Nous n\'avons inclus que des fonctions simples et sûres. C\'est pourquoi, par exemple, les liens vers d\'autres sites Web ne sont pas autorisés.","instructions":"Instructions du projet","feedback":"Rétroaction","help":"Aide","privacy":"Protection de la vie privée","cookies":"Témoins","accessibility":"Accessibilité","safeguarding":"Protection","charity":"The Raspberry Pi Foundation, organisme de charité enregistré au Royaume-Uni sous le numéro 1129409","settingsMenu":{"heading":"Paramètres","textSize":"Taille du texte","theme":"Thème","textSizeOptions":{"large":"Grand","medium":"Moyen","small":"Petit"},"themeOptions":{"dark":"Foncé","light":"Pâle"}}},"webComponent":{"loading":"Chargement en cours","failed":"Échec du chargement"},"imageUploadButton":{"uploadImage":"Téléverser une image","uploadAnImage":"Téléverser une image","info":"Faire glisser et déposer les images ici, ou cliquer pour sélectionner des images à partir du fichier","cancel":"Annuler","save":"Enregistrer","or":"ou","errors":{"error":"Erreur","imageNameNotUnique":"Le nom des images doit être unique.","invalidImageExtension":"Le nom des images doit se terminer par {{extensions}}."}},"newInputPanelButton":{"buttonText":"Ajouter une autre panneau"},"button":{"yes":"Oui","no":"Non"},"common":{"or":"ou"}}')}};
@@ -1 +0,0 @@
1
- function toAbsoluteFromOrigin(e){return e.startsWith("http")||e.startsWith("/")?e:new URL(e,self.location.origin).href}const PyodideWorker=()=>{let e;const t="undefined"!=typeof SharedArrayBuffer;let n,o,a,i,s;t||"incremental-features"===name||console.warn(["The code editor will not be able to capture standard input or stop execution because these HTTP headers are not set:"," - Cross-Origin-Opener-Policy: same-origin"," - Cross-Origin-Embedder-Policy: require-corp","","If your app can cope with or without these features, please initialize the web worker with { name: 'incremental-features' } to silence this warning.","You can then check for the presence of { stdinBuffer, interruptBuffer } in the handleLoaded message to check whether these features are supported.","","If you definitely need these features, either configure your server to respond with the HTTP headers above, or register a service worker.","Once the HTTP headers are set, the browser will block cross-domain resources so you will need to add 'crossorigin' to <script> and other tags.","You may wish to scope the HTTP headers to only those pages that host the code editor to make the browser restriction easier to deal with.","","Please refer to these code snippets for registering a service worker:"," - https://github.com/RaspberryPiFoundation/python-execution-prototypes/blob/fd2c50e032cba3bb0e92e19a88eb62e5b120fe7a/pyodide/index.html#L92-L98"," - https://github.com/RaspberryPiFoundation/python-execution-prototypes/blob/fd2c50e032cba3bb0e92e19a88eb62e5b120fe7a/pyodide/serviceworker.js"].join("\n"));addEventListener("message",(async t=>{(async({data:t})=>{n=await o;let a=new TextEncoder;switch(t.method){case"init":(t=>{e=t.assets,console.log("PyodideWorker","importing scripts"),importScripts(toAbsoluteFromOrigin(e.senseHatUrl)),importScripts(toAbsoluteFromOrigin(e.pygalUrl)),e.pyodideBaseUrl="https://cdn.jsdelivr.net/pyodide/v0.26.2/full/pyodide.js",importScripts(toAbsoluteFromOrigin(e.pyodideBaseUrl)),_()})(t);break;case"writeFile":n.FS.writeFile(t.filename,a.encode(t.content));break;case"runPython":r(t.python);break;case"stopPython":s=!0;break;default:throw new Error(`Unsupported method: ${t.method}`)}})(t)}));const r=async e=>{s=!1;try{await p(e,(async()=>{await n.runPython(e)}))}catch(e){if(!(e instanceof n.ffi.PythonError))throw e;postMessage({method:"handleError",...u(e)})}await h()},l=()=>{if(s)throw new n.ffi.PythonError("KeyboardInterrupt")},p=async(e,t=async()=>{})=>{const o=await n._api.pyodide_code.find_imports(e).toJs();await Promise.all(o.map((e=>c(e)))),l(),await n.loadPackagesFromImports(e),l(),await n.runPythonAsync('\n import basthon\n import builtins\n import os\n\n MAX_FILES = 100\n MAX_FILE_SIZE = 8500000\n\n def _custom_open(filename, mode="r", *args, **kwargs):\n if "x" in mode and os.path.exists(filename):\n raise FileExistsError(f"File \'{filename}\' already exists")\n if ("w" in mode or "a" in mode or "x" in mode) and "b" not in mode:\n if len(os.listdir()) > MAX_FILES and not os.path.exists(filename):\n raise OSError(f"File system limit reached, no more than {MAX_FILES} files allowed")\n class CustomFile:\n def __init__(self, filename):\n self.filename = filename\n self.content = ""\n\n def write(self, content):\n self.content += content\n if len(self.content) > MAX_FILE_SIZE:\n raise OSError(f"File \'{self.filename}\' exceeds maximum file size of {MAX_FILE_SIZE} bytes")\n with _original_open(self.filename, mode) as f:\n f.write(self.content)\n basthon.kernel.write_file({ "filename": self.filename, "content": self.content, "mode": mode })\n\n def close(self):\n pass\n\n def __enter__(self):\n return self\n\n def __exit__(self, exc_type, exc_val, exc_tb):\n self.close()\n\n return CustomFile(filename)\n else:\n return _original_open(filename, mode, *args, **kwargs)\n\n # Override the built-in open function\n builtins.open = _custom_open\n ',{filename:"__custom_open__.py"}),await t();for(let e of o)l(),await(d[e]?.after())},c=async e=>{if(l(),n.FS.readdir("/home/pyodide").includes(`${e}.py`)){const t=n.FS.readFile(`/home/pyodide/${e}.py`,{encoding:"utf8"});return void await p(t)}const t=d[e];if(await(t?.before()),t)return;let o,a;try{o=n.pyimport(e)}catch(e){}if(!o){await(n.loadPackage(e)?.catch((()=>{})));try{a=n.pyimport(e)}catch(e){}a||(n.micropip||(await n.loadPackage("micropip"),n.micropip=n.pyimport("micropip")),await n.micropip.install(e).catch((()=>{})))}},d={enigma:{before:async()=>{await n.loadPackage(toAbsoluteFromOrigin(e.enigmaWhlUrl))},after:()=>{}},turtle:{before:async()=>{n.registerJsModule("basthon",m),await n.loadPackage(toAbsoluteFromOrigin(e.turtleWhlUrl))},after:()=>n.runPython('\n import turtle\n import basthon\n\n svg_dict = turtle.Screen().show_scene()\n basthon.kernel.display_event({ "display_type": "turtle", "content": svg_dict })\n turtle.restart()\n ')},p5:{before:async()=>{n.registerJsModule("basthon",m),await n.loadPackage(["setuptools",toAbsoluteFromOrigin(e.p5WhlUrl)])},after:()=>{}},pygal:{before:()=>{n.registerJsModule("pygal",{...pygal}),pygal.config.renderChart=e=>{postMessage({method:"handleVisual",origin:"pygal",content:e})}},after:()=>{}},sense_hat:{before:async()=>{n.registerJsModule("_internal_sense_hat",{..._internal_sense_hat}),await n.loadPackage(["pillow",toAbsoluteFromOrigin(e.senseHatWhlUrl)]),_internal_sense_hat.config.pyodide=n,_internal_sense_hat.config.emit=e=>postMessage({method:"handleSenseHatEvent",type:e})},after:()=>{const{pyodide:e,emit:t,sensestick:n,start_motion_callback:o,stop_motion_callback:a,...i}=_internal_sense_hat.config;postMessage({method:"handleVisual",origin:"sense_hat",content:i})}},matplotlib:{before:async()=>{let e;n.registerJsModule("basthon",m),n.runPython("\n import js\n\n class __DummyDocument__:\n def __init__(self, *args, **kwargs) -> None:\n return\n def __getattr__(self, __name: str):\n return __DummyDocument__\n js.document = __DummyDocument__()\n "),await(n.loadPackage("matplotlib")?.catch((()=>{})));try{e=n.pyimport("matplotlib")}catch(e){}e&&n.runPython('\n import matplotlib.pyplot as plt\n import io\n import basthon\n\n def show_chart():\n bytes_io = io.BytesIO()\n plt.savefig(bytes_io, format=\'jpg\')\n bytes_io.seek(0)\n basthon.kernel.display_event({ "display_type": "matplotlib", "content": bytes_io.read() })\n plt.show = show_chart\n ')},after:()=>{n.runPython("\n import matplotlib.pyplot as plt\n plt.clf()\n ")}},seaborn:{before:async()=>{n.registerJsModule("basthon",m),n.runPython("\n import js\n\n class __DummyDocument__:\n def __init__(self, *args, **kwargs) -> None:\n return\n def __getattr__(self, __name: str):\n return __DummyDocument__\n js.document = __DummyDocument__()\n "),n.micropip||(await n.loadPackage("micropip"),n.micropip=n.pyimport("micropip")),await n.micropip.install("seaborn").catch((()=>{}))},after:()=>{n.runPython('\n import matplotlib.pyplot as plt\n import io\n import basthon\n\n def is_plot_empty():\n fig = plt.gcf()\n for ax in fig.get_axes():\n # Check if the axes contain any lines, patches, collections, etc.\n if ax.lines or ax.patches or ax.collections or ax.images or ax.texts:\n return False\n return True\n\n if not is_plot_empty():\n bytes_io = io.BytesIO()\n plt.savefig(bytes_io, format=\'jpg\')\n bytes_io.seek(0)\n basthon.kernel.display_event({ "display_type": "matplotlib", "content": bytes_io.read() })\n\n plt.clf()\n ')}},plotly:{before:async()=>{n.micropip||(await n.loadPackage("micropip"),n.micropip=n.pyimport("micropip")),await n.micropip.install("plotly").catch((()=>{})),await n.micropip.install("pandas").catch((()=>{})),n.registerJsModule("basthon",m),n.runPython('\n import plotly.graph_objs as go\n\n def _hacked_show(self, *args, **kwargs):\n basthon.kernel.display_event({\n "display_type": "plotly",\n "content": self.to_json()\n })\n\n go.Figure.show = _hacked_show\n ')},after:()=>{}}},m={kernel:{display_event:e=>{const t=e.toJs().get("display_type"),n=e.toJs().get("content");postMessage({method:"handleVisual",origin:t,content:n})},write_file:e=>{const t=e.toJs().get("filename"),n=e.toJs().get("content"),o=e.toJs().get("mode");postMessage({method:"handleFileWrite",filename:t,content:n,mode:o})},locals:()=>n.runPython("globals()")}},h=async()=>{postMessage({method:"handleLoading"}),console.log("clearPyodideData"),await n.runPythonAsync("\n # Clear all user-defined variables and modules\n for name in dir():\n if not name.startswith('_') and not name=='basthon':\n del globals()[name]\n "),console.log("clearPyodideData done"),postMessage({method:"handleLoaded",stdinBuffer:a,interruptBuffer:i})},_=async()=>{postMessage({method:"handleLoading"}),o=loadPyodide({stdout:e=>postMessage({method:"handleOutput",stream:"stdout",content:e}),stderr:e=>postMessage({method:"handleOutput",stream:"stderr",content:e})}),n=await o,n.registerJsModule("basthon",m),await n.runPythonAsync("\n __old_input__ = input\n def __patched_input__(prompt=False):\n if (prompt):\n print(prompt)\n return __old_input__()\n __builtins__.input = __patched_input__\n "),await n.runPythonAsync("\n import builtins\n # Save the original open function\n _original_open = builtins.open\n "),await n.loadPackage("pyodide-http"),await n.runPythonAsync("\n import pyodide_http\n pyodide_http.patch_all()\n "),t&&(a=a||new Int32Array(new SharedArrayBuffer(1048576)),a[0]=1,n.setStdin({isatty:!0,read:f}),i=i||new Uint8Array(new SharedArrayBuffer(1)),n.setInterruptBuffer(i)),postMessage({method:"handleLoaded",stdinBuffer:a,interruptBuffer:i})},f=e=>{const t=a[0];for(postMessage({method:"handleInput"});n.checkInterrupt(),"not-equal"!==Atomics.wait(a,0,t,100););const o=a[0];if(-1===o)return 0;const i=a.slice(t,o);return e.set(i),i.length},u=e=>{const t=e.type,[n,o]=e.message.split(`${t}:`).map((e=>e?.trim())),a=n.split("\n");a.length>3&&/File "__custom_open__\.py", line (\d+)/g.test(a[a.length-3])&&a.splice(-3,3);const i=a[a.length-2],s=a[a.length-1],r=s.includes("^")?[i.slice(4),s.slice(4)].join("\n"):"",l=[...n.matchAll(/File "(?!__custom_open__\.py)(.*)", line (\d+)/g)],p=l[l.length-1],c=(p?p[1]:"").split("/").reverse()[0];return{file:"<exec>"===c?"main.py":c,line:p?parseInt(p[2],10):"",mistake:r,type:t,info:o}}};globalThis.PyodideWorker=PyodideWorker,PyodideWorker();
@@ -1 +0,0 @@
1
- let _internal_sense_hat={};_internal_sense_hat.config={pyodide:null,emit:()=>{},colour:"#FF00A4",gamma:new Array(32).fill(0),pixels:new Array(64).fill([0,0,0]),low_light:!1,motion:!1,mz_criteria:{duration:null,noInputEvents:!0,readColour:!1,readHumidity:!1,readPressure:!1,readTemperature:!1,usedLEDs:!1},rtimu:{pressure:[1,1013+Math.random()-.5],temperature:[1,13+Math.random()-.5],humidity:[1,45+Math.random()-.5],gyro:[0,0,0],accel:[0,0,0],compass:[0,0,33],raw_orientation:[0,90,0]},sensestick:{_eventQueue:[],off:()=>{},once:()=>{}},start_motion_callback:()=>{},stop_motion_callback:()=>{}};const raisePythonError=(e,t)=>{if(!_internal_sense_hat.config.pyodide)throw new Error(`${e}: ${t}`);{const n=t.replaceAll('"','\\"');_internal_sense_hat.config.pyodide.runPython(`raise ${e}("${n}")`)}};_internal_sense_hat.toJs=e=>e?.toJs?e.toJs():e;const isIterable=e=>!!e?.[Symbol.iterator],isInteger=e=>e===parseInt(e,10),checkNumberAndReturn=e=>{const t=parseFloat(e);return!isNaN(t)&&isFinite(e)?{value:t,valid:!0}:{value:-1,valid:!1}},init=()=>{_internal_sense_hat.config.emit("init")},setpixel=(e,t)=>{_internal_sense_hat.config.mz_criteria.usedLEDs=!0;const n=_internal_sense_hat.toJs(e),a=_internal_sense_hat.toJs(t);isIterable(a)||raisePythonError("ValueError","'value' should be iterable");for(let e of a)isInteger(e)||raisePythonError("ValueError","'value' should be iterable of 'int'");try{_internal_sense_hat.config.pixels[n]=a}catch(e){raisePythonError("ValueError",e.message)}_internal_sense_hat.config.emit("setpixel",n)},getpixel=e=>{const t=_internal_sense_hat.toJs(e);try{return _internal_sense_hat.config.pixels[t]}catch(e){raisePythonError("ValueError",e.message)}},setpixels=(e,t)=>{const n=_internal_sense_hat.toJs(e),a=_internal_sense_hat.toJs(t);n&&(_internal_sense_hat.config.mz_criteria.usedLEDs=!0);try{_internal_sense_hat.config.pixels=a}catch(e){raisePythonError("ValueError",e.message)}_internal_sense_hat.config.emit("setpixels",n)},getpixels=()=>_internal_sense_hat.config.pixels,getGamma=()=>_internal_sense_hat.config.gamma,setGamma=e=>{_internal_sense_hat.config.gamma=_internal_sense_hat.toJs(e),_internal_sense_hat.config.emit("setGamma")},setLowlight=e=>{const t=_internal_sense_hat.toJs(e);_internal_sense_hat.config.low_light=_internal_sense_hat.toJs(t),_internal_sense_hat.config.emit("changeLowlight",t)},pressureRead=()=>{_internal_sense_hat.config.mz_criteria.readPressure=!0;const e=temperatureRead();if(!_internal_sense_hat.config.rtimu.pressure||2!==_internal_sense_hat.config.rtimu.pressure.length)return[].concat([0,-1],e);const{valid:t,value:n}=checkNumberAndReturn(_internal_sense_hat.config.rtimu.pressure[1]);return[].concat(t?n<260||n>1260?[0,n]:[1,n]:[0,-1],e)},humidityRead=()=>{_internal_sense_hat.config.mz_criteria.readHumidity=!0;const e=temperatureRead();if(!_internal_sense_hat.config.rtimu.humidity||2!==_internal_sense_hat.config.rtimu.humidity.length)return[].concat([0,-1],e);const{valid:t,value:n}=checkNumberAndReturn(_internal_sense_hat.config.rtimu.humidity[1]);return[].concat(t?n<0?[0,n]:[1,n]:[0,-1],e)},temperatureRead=()=>{if(_internal_sense_hat.config.mz_criteria.readTemperature=!0,!_internal_sense_hat.config.rtimu.temperature||2!==_internal_sense_hat.config.rtimu.temperature.length)return[0,-1];const{valid:e,value:t}=checkNumberAndReturn(_internal_sense_hat.config.rtimu.temperature[1]);return e?t<-40||t>120?[0,t]:[1,t]:[0,-1]},hex2rgb=e=>["0x"+e[1]+e[2]|0,"0x"+e[3]+e[4]|0,"0x"+e[5]+e[6]|0],colourRead=()=>(_internal_sense_hat.config.mz_criteria.readColour=!0,hex2rgb(_internal_sense_hat.config.colour)),motionRead=()=>_internal_sense_hat.config.motion,_start_motion=e=>{e&&(_internal_sense_hat.config.start_motion_callback=e)},_stop_motion=e=>{e&&(_internal_sense_hat.config.stop_motion_callback=e)},fusionPoseRead=()=>_internal_sense_hat.config.rtimu.raw_orientation.map((e=>e*Math.PI/180)),accelRead=()=>_internal_sense_hat.config.rtimu.accel,compassRead=()=>_internal_sense_hat.config.rtimu.compass,headingRead=()=>{const e=_internal_sense_hat.config.rtimu.raw_orientation[0],t=_internal_sense_hat.config.rtimu.raw_orientation[1],n=_internal_sense_hat.config.rtimu.compass[0],a=_internal_sense_hat.config.rtimu.compass[1],r=_internal_sense_hat.config.rtimu.compass[2],i=e,s=t,_=n*Math.cos(s)+a*Math.sin(i)*Math.sin(i)+r*Math.cos(i)*Math.sin(s),o=a*Math.cos(i)-r*Math.sin(i);return Math.atan2(-o,_)},gyroRead=()=>_internal_sense_hat.config.rtimu.gyro,_wait=e=>{raisePythonError("NotImplementedError","_wait")},_waitmotion=(e,t)=>{_internal_sense_hat.config.mz_criteria.noInputEvents=!1,raisePythonError("NotImplementedError","_waitmotion")},_inspectFunction=e=>{raisePythonError("NotImplementedError","_inspectFunction")},_stop_stick_thread=()=>{raisePythonError("NotImplementedError","_stop_stick_thread")},_start_stick_thread=e=>{raisePythonError("NotImplementedError","_start_stick_thread")},_read=()=>{raisePythonError("NotImplementedError","_read")};_internal_sense_hat={..._internal_sense_hat,init,setpixel,getpixel,setpixels,getpixels,getGamma,setGamma,setLowlight,pressureRead,humidityRead,temperatureRead,colourRead,motionRead,_start_motion,_stop_motion,fusionPoseRead,accelRead,compassRead,headingRead,gyroRead,_wait,_waitmotion,_inspectFunction,_stop_stick_thread,_start_stick_thread,_read},globalThis._internal_sense_hat=_internal_sense_hat;