code-playpad 0.10.1 → 0.12.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.
Files changed (70) hide show
  1. package/README.md +222 -17
  2. package/dist/THIRD-PARTY-NOTICES.txt +223 -0
  3. package/dist/cdn.js +2 -2
  4. package/dist/compiler-B408qd3N.js +151 -0
  5. package/dist/{config-CT3H6Oum.js → config-DB58UVsk.js} +1 -1
  6. package/dist/{cpp-Cs32J8JC.js → cpp-Bhr_Zgfk.js} +1 -1
  7. package/dist/{cpp-CO2abWii.js → cpp-xLJOrOXX.js} +1 -1
  8. package/dist/dist-3xj9-ylK.js +6 -0
  9. package/dist/{dist-BIgiGgKu.js → dist-7CHy0evE.js} +1 -1
  10. package/dist/dist-BDifu2bQ.js +6 -0
  11. package/dist/dist-BwlTZqCY.js +28 -0
  12. package/dist/dist-C41hAfPr.js +6 -0
  13. package/dist/dist-CRXZcpYD.js +14 -0
  14. package/dist/dist-CTLX4tws.js +8 -0
  15. package/dist/dist-CjnVq6q1.js +10 -0
  16. package/dist/{dist-Vr-fb58P.js → dist-D4P7t1AU.js} +4 -4
  17. package/dist/dist-DHeVjdBc.js +6 -0
  18. package/dist/dist-IFh_mUXG.js +7 -0
  19. package/dist/dist-UbI3_a5S.js +6 -0
  20. package/dist/dist-_fde-E8H.js +6 -0
  21. package/dist/dist-g8djAEMH.js +6 -0
  22. package/dist/dist-ixcYRC9x.js +6 -0
  23. package/dist/editor.d.ts +3 -1
  24. package/dist/element-Dzhksh6_.js +596 -0
  25. package/dist/element.d.ts +26 -0
  26. package/dist/element.js +1 -1
  27. package/dist/hints-DpBIeoeG.js +6 -0
  28. package/dist/index.d.ts +5 -3
  29. package/dist/index.js +1 -1
  30. package/dist/{java-8qjVCjsN.js → java-DFiOVxDN.js} +1 -1
  31. package/dist/{java-DeBiVPXO.js → java-DjuG1fCk.js} +1 -1
  32. package/dist/{javascript-DLPaJJzf.js → javascript-BBiCDtZ3.js} +2 -2
  33. package/dist/{javascript-B1tVx7AD.js → javascript-CLaHCZ8o.js} +1 -1
  34. package/dist/languages.d.ts +1 -1
  35. package/dist/{pyodide-C8ImkXdD.js → pyodide-Cs-Kwccb.js} +1 -1
  36. package/dist/{pyodide-BOoYEfX1.js → pyodide-QurAOd7j.js} +2 -2
  37. package/dist/react-ALhWeEZ5.js +9 -0
  38. package/dist/react-DmuIc3qw.js +4 -0
  39. package/dist/react-runtime-19.2.8.js +240 -0
  40. package/dist/react-vendor.generated-DMxIoCMn.js +6 -0
  41. package/dist/react-version.generated-BNNJmf7J.js +6 -0
  42. package/dist/react.d.ts +9 -1
  43. package/dist/react.js +1 -1
  44. package/dist/rolldown-runtime-DK3Fl9T5.js +6 -0
  45. package/dist/runtime/config.d.ts +15 -1
  46. package/dist/runtime/react/boot.d.ts +9 -0
  47. package/dist/runtime/react/compiler.d.ts +30 -0
  48. package/dist/runtime/react-vendor.generated.d.ts +5 -0
  49. package/dist/runtime/react-version.generated.d.ts +3 -0
  50. package/dist/runtime/react.d.ts +2 -0
  51. package/dist/standalone.js +289 -17
  52. package/dist/styles.d.ts +0 -2
  53. package/dist/theme.d.ts +48 -0
  54. package/dist/{hints-CCMgezw9.js → types-CfcYqU2K.js} +1 -1
  55. package/dist/types.d.ts +23 -0
  56. package/dist/worker-runtime-DvpugeXD.js +9 -0
  57. package/dist/{worker-runtime-sUPz1J56.js → worker-runtime-tSXm-pPB.js} +1 -1
  58. package/package.json +23 -6
  59. package/dist/dist--J_vhCIU.js +0 -14
  60. package/dist/dist-BNvM_BAY.js +0 -6
  61. package/dist/dist-BkpKCrXQ.js +0 -6
  62. package/dist/dist-CJxiVI4a.js +0 -6
  63. package/dist/dist-CNOK8CHE.js +0 -6
  64. package/dist/dist-D25hs99E.js +0 -10
  65. package/dist/dist-D2igTc4m.js +0 -6
  66. package/dist/dist-D7jBL3Ib.js +0 -28
  67. package/dist/dist-DXjodKfp.js +0 -6
  68. package/dist/dist-DfFrsBkU.js +0 -8
  69. package/dist/element-CQGYVEF7.js +0 -324
  70. package/dist/worker-runtime-DfYet3xy.js +0 -9
package/dist/element.d.ts CHANGED
@@ -16,6 +16,22 @@ export interface ErrorEventDetail {
16
16
  /** Plain-language guidance, when the runtime could work out the cause. */
17
17
  hint?: string;
18
18
  language: string;
19
+ /** React: where the error is, when known. */
20
+ file?: string;
21
+ line?: number;
22
+ column?: number;
23
+ }
24
+ /** React: one line of the preview's console. */
25
+ export interface ConsoleEventDetail {
26
+ level: 'log' | 'info' | 'warn' | 'error';
27
+ text: string;
28
+ language: string;
29
+ }
30
+ /** React: the text of the preview's #root, after it changes. Learner code can
31
+ * forge this, so it is a lesson check, not proof of completion. */
32
+ export interface RenderEventDetail {
33
+ rootText: string;
34
+ language: string;
19
35
  }
20
36
  /**
21
37
  * `class X extends HTMLElement` is evaluated when the module loads, so importing
@@ -64,6 +80,16 @@ export declare class CodePlayPadElement extends ElementBase {
64
80
  * The runtime is shared, so a bare runtime.stop() would kill whichever
65
81
  * widget happens to be running. */
66
82
  stop(): void;
83
+ /**
84
+ * Moves the project to a separate window that the reader can resize, and runs
85
+ * it there. The widget in that window is this page's code, so the page keeps
86
+ * getting its events. Edits come back when the window closes, or with
87
+ * closeWindow(). Call it from a click: browsers block other popups. Returns
88
+ * false when the browser blocked it.
89
+ */
90
+ openWindow(): boolean;
91
+ /** Closes the separate window, and brings its edits back to this widget. */
92
+ closeWindow(): void;
67
93
  /** Boot the runtime without running anything. Safe to call repeatedly. */
68
94
  prewarm(): Promise<Runtime>;
69
95
  connectedCallback(): void;
package/dist/element.js CHANGED
@@ -1 +1 @@
1
- export{t as CodePlayPadElement,n as defineCodePlayPad}from"./element-CQGYVEF7.js";
1
+ export{t as CodePlayPadElement,n as defineCodePlayPad}from"./element-Dzhksh6_.js";
@@ -0,0 +1,6 @@
1
+ /*!
2
+ * code-playpad — MIT © 2026 Seung Hun Lee
3
+ * Bundles CodeMirror 6 and Lezer (MIT) © Marijn Haverbeke and others.
4
+ * Full third-party licences: THIRD-PARTY-NOTICES.txt in this package.
5
+ */
6
+ var e=/* @__PURE__ */ new WeakSet;export{e as t};
package/dist/index.d.ts CHANGED
@@ -1,10 +1,12 @@
1
1
  export { CodePlayPadElement, defineCodePlayPad } from './element.js';
2
- export type { ErrorEventDetail, OutputEventDetail, RunEventDetail } from './element.js';
2
+ export type { ConsoleEventDetail, ErrorEventDetail, OutputEventDetail, RenderEventDetail, RunEventDetail } from './element.js';
3
+ export { EDITOR_THEMES, getThemePreference, onThemePreferenceChange, setThemePreference } from './theme.js';
4
+ export type { EditorTheme, EditorThemeColors, ThemeMode, ThemePreference } from './theme.js';
3
5
  export { createEditor } from './editor.js';
4
6
  export type { EditorHandle, EditorOptions } from './editor.js';
5
7
  export { getRuntime, listRuntimes, registerRuntime } from './runtime/registry.js';
6
- export { configurePython, configureCpp, configureTypeScript, pyodideAssetUrls, PYODIDE_VERSION } from './runtime/config.js';
8
+ export { configurePython, configureCpp, configureReact, REACT_VERSION, configureTypeScript, pyodideAssetUrls, PYODIDE_VERSION } from './runtime/config.js';
7
9
  export { RunStopped, WorkerUnavailable } from './types.js';
8
- export type { CaseResult, CaseStatus, Files, LoadProgress, PracticeCase, PracticeSpec, PracticeValue, Result, Runtime, RunOptions, Table } from './types.js';
10
+ export type { CaseResult, CaseStatus, Files, LoadProgress, PreviewBinding, PracticeCase, PracticeSpec, PracticeValue, Result, Runtime, RunOptions, Table } from './types.js';
9
11
  export { allProgress, clearSnippet, getProgress, loadSnippet, saveSnippet, setProgress } from './progress.js';
10
12
  export type { ProgressRecord } from './progress.js';
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{a as e,c as t,d as n,f as r,h as i,i as a,m as o,n as s,o as c,p as l,r as u,s as d,t as f,u as p}from"./element-CQGYVEF7.js";import{c as m,i as h,n as g,r as _,t as v}from"./config-CT3H6Oum.js";export{f as CodePlayPadElement,v as PYODIDE_VERSION,p as RunStopped,n as WorkerUnavailable,u as allProgress,a as clearSnippet,g as configureCpp,_ as configurePython,h as configureTypeScript,i as createEditor,s as defineCodePlayPad,e as getProgress,r as getRuntime,l as listRuntimes,c as loadSnippet,m as pyodideAssetUrls,o as registerRuntime,d as saveSnippet,t as setProgress};
1
+ import{_ as e,a as t,c as n,d as r,f as i,g as a,h as o,i as s,m as c,n as l,o as u,p as d,r as f,s as p,t as m,u as h,v as g,y as _}from"./element-Dzhksh6_.js";import{t as v}from"./react-version.generated-BNNJmf7J.js";import{a as y,i as b,n as x,r as S,t as C,u as w}from"./config-DB58UVsk.js";export{m as CodePlayPadElement,a as EDITOR_THEMES,C as PYODIDE_VERSION,v as REACT_VERSION,h as RunStopped,r as WorkerUnavailable,f as allProgress,s as clearSnippet,x as configureCpp,S as configurePython,b as configureReact,y as configureTypeScript,o as createEditor,l as defineCodePlayPad,t as getProgress,i as getRuntime,e as getThemePreference,d as listRuntimes,u as loadSnippet,g as onThemePreferenceChange,w as pyodideAssetUrls,c as registerRuntime,p as saveSnippet,n as setProgress,_ as setThemePreference};