gwchq-textjam 0.1.0

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/LICENSE.txt ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,157 @@
1
+ # Getting Started
2
+
3
+ This project provides a React component containing the Raspberry Pi Code Editor for embedding inside other applications. Although originally bootstrapped with [Create React App](https://github.com/facebook/create-react-app), the application has been ejected so all the build scripts etc. are now in the repo. Legacy web-component assets are still published for backwards compatibility, but the primary integration surface is the `TextJamEditor` React component.
4
+
5
+ ## Install dependencies
6
+
7
+ This repository uses Yarn 3 (see `package.json` → `packageManager`). Please install dependencies with Yarn:
8
+
9
+ ```
10
+ yarn install
11
+ ```
12
+
13
+ Using `npm install` can fail due to strict peer-dependency resolution in npm for some legacy packages in this project.
14
+
15
+ ## Available Scripts
16
+
17
+ In the project directory, you can run:
18
+
19
+ ### `yarn start`
20
+
21
+ Runs the app in the development mode.\
22
+ Open [http://localhost:3011](http://localhost:3011) to view the web component test page in the browser.
23
+
24
+ The page will reload if you make edits.\
25
+ You will also see any lint errors in the console.
26
+
27
+ ### `yarn test`
28
+
29
+ Launches the test runner in interactive watch mode.\
30
+ See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
31
+
32
+ ### `yarn build:lib`
33
+
34
+ Builds the lib for production to the `dist` folder.\
35
+ It bundles React in production mode and optimizes the build for the best performance.
36
+
37
+ The build is minified and the filenames include the hashes.\
38
+ Your app is ready to be deployed!
39
+
40
+ See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
41
+
42
+ ## Testing
43
+
44
+ Automated unit tests can be run via the `yarn test` command. These unit tests are written using the JavaScript testing framework `Jest` and make use of the tools provided by the [React Testing Library](https://testing-library.com/docs/). Automated accessibility testing for components is available via the `jest-axe` library. This can be achieved using the `haveNoViolations` matcher provided by `jest-axe`, although this does not guarantee that the tested components have no accessibility issues.
45
+
46
+ ## Using the editor as a React component
47
+
48
+ The editor can be imported and rendered directly inside another React application. The package exports the `TextJamEditor` component:
49
+
50
+ ```tsx
51
+ import { TextJamEditor } from "gwchq-textjam";
52
+
53
+ export function EditorWrapper() {
54
+ return (
55
+ <TextJamEditor
56
+ identifier="my-project-id"
57
+ reactAppApiEndpoint="https://example.com/api"
58
+ withSidebar
59
+ />
60
+ );
61
+ }
62
+ ```
63
+
64
+ The consumer's webpack config should include the following
65
+ ```
66
+ {
67
+ ...,
68
+ modules: {
69
+ rules: [
70
+ ...,
71
+ {
72
+ test: /\.map$/,
73
+ type: "asset/resource",
74
+ },
75
+ {
76
+ test: /\.whl$/,
77
+ type: "asset/resource",
78
+ },
79
+ {
80
+ test: /\.glb$/,
81
+ type: "asset/resource",
82
+ },
83
+ ]
84
+ },
85
+ plugins: [
86
+ new CopyWebpackPlugin({
87
+ patterns: [
88
+ ...,
89
+ {
90
+ from: "node_modules/gwchq-textjam/dist/assets",
91
+ to: "assets",
92
+ },
93
+ ],
94
+ }),
95
+ ]
96
+ }
97
+ ```
98
+
99
+ ### Component props
100
+
101
+ `TextJamEditor` accepts the following props (previously exposed as web-component attributes):
102
+
103
+ - `assetsIdentifier`: Load assets (not code) from this project identifier
104
+ - `authKey`: Authenticate the user to allow them to make API requests such as saving their work
105
+ - `code`: A preset blob of code to show in the editor pane (overrides content of `main.py`/`index.html`)
106
+ - `editableInstructions`: Boolean; show edit panel for instructions when `true`
107
+ - `embedded`: Enable embedded mode which hides some functionality (defaults to `false`)
108
+ - `identifier`: Load the project with this identifier from the database
109
+ - `instructions`: JSON object containing steps to be displayed in the instructions panel in the sidebar
110
+ - `loadCache`: Load latest version of project code from local storage (defaults to `true`)
111
+ - `loadRemixDisabled`: Do not load a logged-in user's remixed version of the project specified by `identifier` even if one exists (defaults to `false`)
112
+ - `locale`: Locale for UI elements and to determine the language of projects loaded from the API (defaults to `en`)
113
+ - `outputOnly`: Only display the output panel (defaults to `false`)
114
+ - `outputPanels`: Array of output panel names to display (defaults to `['text', 'visual']`)
115
+ - `outputSplitView`: Start with split view in output panel (defaults to `false`, i.e. tabbed view)
116
+ - `projectNameEditable`: Allow the user to edit the project name in the project bar (defaults to `false`)
117
+ - `reactAppApiEndpoint`: API endpoint to send project-related requests to
118
+ - `readOnly`: Display the editor in read-only mode (defaults to `false`)
119
+ - `senseHatAlwaysEnabled`: Show the Astro Pi Sense HAT emulator on page load (defaults to `false`)
120
+ - `showSavePrompt`: Prompt the user to save their work (defaults to `false`)
121
+ - `sidebarOptions`: Array of strings specifying the panels to be displayed in the sidebar. Options include `"projects"`, `"instructions"`, `"file"`, `"images"`, `"download"`, `"settings"`, and `"info"`.
122
+ - `sidebarPlugins`: Array of plugin definitions to render inside the sidebar (defaults to `[]`)
123
+ - `theme`: Force editor into `"dark"` or `"light"` mode; browser/system preferences are used when omitted
124
+ - `withProjectbar`: Show the project bar containing project name and save status (defaults to `false`)
125
+ - `withSidebar`: Show the sidebar (defaults to `false`)
126
+
127
+ 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.
128
+
129
+ ### Events and callbacks
130
+
131
+ For backwards compatibility the editor continues to dispatch the following `document` events. You can listen for them from your host application if you rely on the legacy integration layer:
132
+
133
+ - `editor-codeChanged`
134
+ - `editor-navigateToProjectsPage`
135
+ - `editor-projectIdentifierChanged`
136
+ - `editor-projectOwnerLoaded`
137
+ - `editor-runCompleted`
138
+ - `editor-runStarted`
139
+ - `editor-stepChanged`
140
+ - `editor-logIn`
141
+ - `editor-signUp`
142
+ - `editor-quizReady`
143
+ - `editor-themeUpdated`
144
+
145
+ These events make it possible for the host page to react to code execution, project changes, authentication requests, and theme updates.
146
+
147
+ ### Styling and assets
148
+
149
+ Webpack-style bundlers that understand SCSS imports automatically include the editor styles because they are pulled in by the component (`ExternalStyles.scss`, `InternalStyles.scss`, `index.scss`, and `Notifications.scss`). If you use a different build pipeline ensure SCSS files are processed or precompile the bundle before publishing.
150
+
151
+ Web worker entry points (`PyodideWorker.js`) are referenced via dynamic imports; make sure your bundler or hosting environment permits worker assets to be served.
152
+
153
+ The component renders everything inside an `.editor-shell` wrapper, exposing CSS custom properties for theming (see `src/assets/stylesheets/index.scss`). You can override colors and typography by adjusting those variables in your host application.
154
+
155
+ ## Development
156
+
157
+ The app test page at `http://localhost:3011` can be used to develop the React component in isolation if needed. This page is configured to pass query parameters into the component, allowing it to be previewed in different states during development. For example, to preview the component with the Sense HAT always showing, visit `http://localhost:3011?sense_hat_always_enabled=true`.
@@ -0,0 +1 @@
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"}}')}};
@@ -0,0 +1 @@
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"}}')}};
@@ -0,0 +1 @@
1
+ export const id=360;export const ids=[360];export const modules={22796: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","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"},"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 started working on this project will still be able to see the instructions as they were when they 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":"colour","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, for example, links to other websites are not allowed.","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"}}')}};
@@ -0,0 +1 @@
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"}}')}};
@@ -0,0 +1 @@
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"}}')}};
@@ -0,0 +1 @@
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();
@@ -0,0 +1 @@
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;
@@ -0,0 +1 @@
1
+ var pygal={};pygal.config={renderChart:t=>{throw new Error("The config.renderChart function has not been set for pygal.")},availableWidth:400,availableHeight:300};const COLORS=[[255,89,149],[182,227,84],[254,237,108],[140,237,255],[158,111,254],[137,156,161],[248,248,242],[191,70,70],[81,96,131],[249,38,114],[130,180,20],[253,151,31],[86,194,214],[128,131,132],[140,84,254],[70,84,87]],some=t=>void 0!==t;pygal.toJs=t=>t?.toJs?t.toJs():t;class Chart{constructor({title:t,width:e,height:s,range:r,include_x_axis:a,x_title:o,y_title:i,title_font_size:n,fill:l,stroke:h,x_labels:c}={}){const g={};some(t)&&(g.title=pygal.toJs(t)),some(e)&&(g.width=pygal.toJs(e)),some(s)&&(g.height=pygal.toJs(s)),some(r)&&(g.range={min:pygal.toJs(r)[0],max:pygal.toJs(r)[1]}),some(a)&&(g.include_x_axis=pygal.toJs(a)),some(o)&&(g.x_title=pygal.toJs(o)),some(i)&&(g.y_title=pygal.toJs(i)),some(n)&&(g.title_font_size=pygal.toJs(n)),some(l)&&(g.fill=pygal.toJs(l)),some(h)&&(g.stroke=pygal.toJs(h)),some(c)&&(g.x_labels=pygal.toJs(c)),this._options=g,this._data=[]}add(t,e){Array.isArray(pygal.toJs(e))||(e=[e]);const s=[...pygal.toJs(e)].map((t=>t||0));return this._data.unshift({name:pygal.toJs(t),color:this.#t(COLORS[this._data.length%COLORS.length],.75),data:s,marker:{symbol:"circle"},stack:1}),""}render(){const t=this._options,e={color:"#FFFFFF"};t.title_font_size&&(e["font-size"]=t.title_font_size+"px");const s=[];t.range&&s.push({value:t.range.min,width:1,color:"#FFFFFF"});const r=pygal.config.availableWidth,a=Math.min(r,pygal.config.availableHeight);let o={chart:{width:t.width||r,height:t.height||a,backgroundColor:"#000"},credits:{enabled:!1},title:{text:t.title,style:e},xAxis:{title:{text:t.x_title||null,style:e,margin:20},categories:t.x_labels,labels:{enabled:!!t.x_labels},tickLength:0},yAxis:{startOnTick:!1,title:{text:t.y_title||null,style:e,margin:20},plotLines:s,min:t.include_x_axis?0:t.range?t.range.min:null,max:t.range?t.range.max:null,gridLineDashStyle:"ShortDash",gridLineColor:"#DDD",tickLength:0},legend:{itemStyle:{color:"#FFFFFF"},layout:"vertical",align:"left",verticalAlign:"top",y:50,borderWidth:0},labels:{style:{color:"#FFFFFF"}},series:this._data};for(let t=0;t<o.series.length;t++)o.series[t].legendIndex=o.series.length-t,o.series[t].index=o.series.length-t;return this.renderer&&(o=this.renderer(t,o)),pygal.config.renderChart(o),""}get title(){return this._options.title}get width(){return this._options.width}get height(){return this._options.height}get range(){return this._options.range}get include_x_axis(){return this._options.include_x_axis}get x_title(){return this._options.x_title}get y_title(){return this._options.y_title}get title_font_size(){return this._options.title_font_size}get fill(){return this._options.fill}get stroke(){return this._options.stroke}get x_labels(){return this._options.x_labels}set title(t){this._options.title=pygal.toJs(t)}set width(t){this._options.width=pygal.toJs(t)}set height(t){this._options.height=pygal.toJs(t)}set range(t){this._options.range=pygal.toJs(t)}set include_x_axis(t){this._options.include_x_axis=pygal.toJs(t)}set x_title(t){this._options.x_title=pygal.toJs(t)}set y_title(t){this._options.y_title=pygal.toJs(t)}set title_font_size(t){this._options.title_font_size=pygal.toJs(t)}set fill(t){this._options.fill=pygal.toJs(t)}set stroke(t){this._options.stroke=pygal.toJs(t)}set x_labels(t){this._options.x_labels=pygal.toJs(t)}#t(t,e){return"rgba("+t.join(",")+","+e+")"}}globalThis.$RefreshReg$=()=>{};class _Line extends Chart{constructor(...t){super(...t),this.renderer=(t,e)=>(e.chart.type=pygal.toJs(t.fill)?"area":"line",e)}}const Line=(...t)=>new _Line(...t);class _StackedLine extends Chart{constructor(...t){super(...t),this.renderer=(t,e)=>(e.chart.type=pygal.toJs(t.fill)?"area":"line",e.plotOptions={area:{stacking:"percent"},series:{stacking:"percent"}},e)}}const StackedLine=(...t)=>new _StackedLine(...t);class _Bar extends Chart{constructor(...t){super(...t),this.renderer=(t,e)=>(e.chart.type="column",e)}}const Bar=(...t)=>new _Bar(...t);class _StackedBar extends Chart{constructor(...t){super(...t),this.renderer=(t,e)=>(e.chart.type="column",e.plotOptions={column:{stacking:"percent"}},e)}}const StackedBar=(...t)=>new _StackedBar(...t);class _HorizontalBar extends Chart{constructor(...t){super(...t),this.renderer=(t,e)=>(e.chart.type="bar",e)}}const HorizontalBar=(...t)=>new _HorizontalBar(...t);class _StackedHorizontalBar extends Chart{constructor(...t){super(...t),this.renderer=(t,e)=>(e.chart.type="bar",e.plotOptions={bar:{stacking:"percent"}},e)}}const StackedHorizontalBar=(...t)=>new _StackedHorizontalBar(...t);class _XY extends Chart{constructor(...t){super(...t),this.renderer=(t,e)=>(!1===pygal.toJs(t.stroke)?e.chart.type="scatter":e.chart.type=pygal.toJs(t.fill)?"area":"line",e.xAxis.labels.enabled=!0,e)}}const XY=(...t)=>new _XY(...t);class _Radar extends Chart{constructor(...t){super(...t),this.renderer=(t,e)=>{e.chart.polar=!0,e.chart.type="line",e.xAxis={categories:pygal.toJs(t.x_labels),tickmarkPlacement:"on",lineWidth:0},e.yAxis={gridLineInterpolation:"polygon",lineWidth:0,min:0,gridLineDashStyle:"ShortDash",gridLineColor:"#DDD"};for(let t=0;t<e.series.length;t++)e.series[t].pointPlacement="on";return e}}}const Radar=(...t)=>new _Radar(...t);class _Pie extends Chart{constructor(...t){super(...t),this.renderer=(t,e)=>{e.chart.type="pie";const s=[],r=[];let a=!1;for(let t=0;t<e.series.length;t++){const o=e.series[t];if(1===o.data.length)s.unshift({name:o.name,color:o.color,borderColor:o.color,legendIndex:o.legendIndex,y:o.data[0]}),r.unshift({name:o.name,color:o.color,borderColor:o.color,y:o.data[0]});else{a=!0;let t=0,e=0;for(let s=0;s<o.data.length;s++){const a=o.data[s].toString().split(".");e=Math.max(e,a[1]?a[1].length:0),t+=o.data[s],r.unshift({name:o.name,color:"rgba(0,0,0,0)",borderColor:o.color,y:o.data[s]})}s.unshift({name:o.name,color:o.color,borderColor:o.color,legendIndex:o.legendIndex,y:parseFloat(t.toFixed(e))})}}return e.tooltip={formatter:function(){return this.key+": "+this.y}},e.plotOptions={pie:{allowPointSelect:!a,cursor:a?null:"pointer",shadow:!1,center:["50%","50%"],dataLabels:{enabled:!1}}},e.series=[{name:" ",data:s,showInLegend:!0}],a&&e.series.push({name:" ",data:r,innerSize:"90%",showInLegend:!1}),e}}}const Pie=(...t)=>new _Pie(...t);pygal={...pygal,Chart,COLORS,some,Line,StackedLine,Bar,StackedBar,HorizontalBar,StackedHorizontalBar,XY,Radar,Pie},globalThis.pygal=pygal;