You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+28Lines changed: 28 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -91,6 +91,7 @@ The `editor-wc` tag accepts the following attributes, which must be provided as
91
91
-`output_split_view`: Start with split view in output panel (defaults to `false`, i.e. tabbed view)
92
92
-`project_name_editable`: Allow the user to edit the project name in the project bar (defaults to `false`)
93
93
-`react_app_api_endpoint`: API endpoint to send project-related requests to
94
+
-`offline_enabled`: Show an offline indicator when the user's device loses connectivity (defaults to `false`). Requires the service worker to be registered on the host page — see [Offline support](#offline-support).
94
95
-`read_only`: Display the editor in read only mode (defaults to `false`)
95
96
-`sense_hat_always_enabled`: Show the Astro Pi Sense HAT emulator on page load (defaults to `false`)
96
97
-`show_save_prompt`: Prompt the user to save their work (defaults to `false`)
@@ -130,6 +131,33 @@ The host page is able to communicate with the web component via custom methods p
130
131
131
132
This allows the host page to query the current code in the editor and to control code runs from outside the web component, for example.
132
133
134
+
### Offline support
135
+
136
+
The web component ships a service worker (`service-worker.js`) that caches the editor shell and Pyodide assets so the component remains usable after a network loss.
137
+
138
+
To enable offline support on your host page:
139
+
140
+
1. Register the service worker from your host page (or let the bundled `web-component.html` do it automatically):
0 commit comments