@dodona/papyros 4.0.0-beta.5 → 4.0.0-beta.6

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/README.md CHANGED
@@ -72,7 +72,7 @@ You can then register the service worker in your application before launching: `
72
72
  If you only want to use the state and runner logic without UI components:
73
73
 
74
74
  ```ts
75
- import { papyros } from "@dodona/papyros/Papyros";
75
+ import { papyros } from "@dodona/papyros";
76
76
 
77
77
  papyros.launch(); // heavy operation, loads workers and Pyodide
78
78
  papyros.runner.code = "print(input())";
@@ -93,8 +93,7 @@ Each expects a `papyros` state instance, but defaults to the global `papyros`.
93
93
 
94
94
  ```html
95
95
  <script type="module">
96
- import { papyros } from "@dodona/papyros/Papyros";
97
- import "@dodona/papyros/components";
96
+ import { papyros } from "@dodona/papyros";
98
97
 
99
98
  papyros.launch();
100
99
  </script>
@@ -0,0 +1,11 @@
1
+ import "./frontend/components/Input";
2
+ import "./frontend/components/Output";
3
+ import "./frontend/components/CodeRunner";
4
+ import "./frontend/components/Debugger";
5
+ import { Papyros, papyros } from "./frontend/state/Papyros";
6
+ import { InputMode } from "./frontend/state/InputOutput";
7
+ import { RunMode } from "./backend/Backend";
8
+ import { ProgrammingLanguage } from "./ProgrammingLanguage";
9
+ import { OutputType, FriendlyError } from "./frontend/state/InputOutput";
10
+ export { Papyros, InputMode, RunMode, ProgrammingLanguage, OutputType, papyros };
11
+ export type { FriendlyError };
@@ -0,0 +1,11 @@
1
+ import "./frontend/components/Input";
2
+ import "./frontend/components/Output";
3
+ import "./frontend/components/CodeRunner";
4
+ import "./frontend/components/Debugger";
5
+ import { Papyros, papyros } from "./frontend/state/Papyros";
6
+ import { InputMode } from "./frontend/state/InputOutput";
7
+ import { RunMode } from "./backend/Backend";
8
+ import { ProgrammingLanguage } from "./ProgrammingLanguage";
9
+ import { OutputType } from "./frontend/state/InputOutput";
10
+ export { Papyros, InputMode, RunMode, ProgrammingLanguage, OutputType, papyros };
11
+ //# sourceMappingURL=Library.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Library.js","sourceRoot":"","sources":["../src/Library.ts"],"names":[],"mappings":"AAAA,OAAO,6BAA6B,CAAC;AACrC,OAAO,8BAA8B,CAAC;AACtC,OAAO,kCAAkC,CAAC;AAC1C,OAAO,gCAAgC,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAiB,MAAM,8BAA8B,CAAC;AAEzE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,mBAAmB,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { LitElement } from "lit";
2
2
  import { StateController } from "@dodona/lit-state";
3
- import { Papyros } from "../../Papyros";
3
+ import { Papyros } from "../state/Papyros";
4
4
  export declare abstract class PapyrosElement extends LitElement {
5
5
  controller: StateController;
6
6
  papyros: Papyros;
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  import { LitElement } from "lit";
8
8
  import { StateController } from "@dodona/lit-state";
9
9
  import { property } from "lit/decorators.js";
10
- import { papyros } from "../../Papyros";
10
+ import { papyros } from "../state/Papyros";
11
11
  export class PapyrosElement extends LitElement {
12
12
  constructor() {
13
13
  super(...arguments);
@@ -1 +1 @@
1
- {"version":3,"file":"PapyrosElement.js","sourceRoot":"","sources":["../../../src/frontend/components/PapyrosElement.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAW,OAAO,EAAE,MAAM,eAAe,CAAC;AAEjD,MAAM,OAAgB,cAAe,SAAQ,UAAU;IAAvD;;QACI,eAAU,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;QAEnC,YAAO,GAAY,OAAO,CAAC;IAKnC,CAAC;IAHa,CAAC,CAAC,MAAc,EAAE,OAA6B;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChD,CAAC;CACJ;AALO;IADH,QAAQ,EAAE;+CACoB"}
1
+ {"version":3,"file":"PapyrosElement.js","sourceRoot":"","sources":["../../../src/frontend/components/PapyrosElement.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAW,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEpD,MAAM,OAAgB,cAAe,SAAQ,UAAU;IAAvD;;QACI,eAAU,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;QAEnC,YAAO,GAAY,OAAO,CAAC;IAKnC,CAAC;IAHa,CAAC,CAAC,MAAc,EAAE,OAA6B;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChD,CAAC;CACJ;AALO;IADH,QAAQ,EAAE;+CACoB"}
@@ -1,6 +1,6 @@
1
1
  import { Frame } from "@dodona/trace-component/dist/trace_types";
2
2
  import { State } from "@dodona/lit-state";
3
- import { Papyros } from "../../Papyros";
3
+ import { Papyros } from "./Papyros";
4
4
  export type FrameState = {
5
5
  line: number;
6
6
  outputs: number;
@@ -1,6 +1,6 @@
1
1
  import { State } from "@dodona/lit-state";
2
2
  import { ProgrammingLanguage } from "../../ProgrammingLanguage";
3
- import { Papyros } from "../../Papyros";
3
+ import { Papyros } from "./Papyros";
4
4
  export declare class Examples extends State {
5
5
  papyros: Papyros;
6
6
  private examples;
@@ -1,5 +1,5 @@
1
1
  import { State } from "@dodona/lit-state";
2
- import { Papyros } from "../../Papyros";
2
+ import { Papyros } from "./Papyros";
3
3
  /**
4
4
  * Shape of Error objects that are easy to interpret
5
5
  */
@@ -1,11 +1,11 @@
1
1
  import { State } from "@dodona/lit-state";
2
- import { Debugger } from "./frontend/state/Debugger";
3
- import { Runner } from "./frontend/state/Runner";
4
- import { InputOutput } from "./frontend/state/InputOutput";
5
- import { Constants } from "./frontend/state/Constants";
6
- import { Examples } from "./frontend/state/Examples";
7
- import { I18n } from "./frontend/state/I18n";
8
- import { Test } from "./frontend/state/Test";
2
+ import { Debugger } from "./Debugger";
3
+ import { Runner } from "./Runner";
4
+ import { InputOutput } from "./InputOutput";
5
+ import { Constants } from "./Constants";
6
+ import { Examples } from "./Examples";
7
+ import { I18n } from "./I18n";
8
+ import { Test } from "./Test";
9
9
  export declare class Papyros extends State {
10
10
  readonly debugger: Debugger;
11
11
  readonly runner: Runner;
@@ -14,15 +14,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
14
14
  });
15
15
  };
16
16
  import { State, stateProperty } from "@dodona/lit-state";
17
- import { Debugger } from "./frontend/state/Debugger";
18
- import { Runner } from "./frontend/state/Runner";
19
- import { InputOutput } from "./frontend/state/InputOutput";
20
- import { Constants } from "./frontend/state/Constants";
21
- import { Examples } from "./frontend/state/Examples";
22
- import { BackendManager } from "./communication/BackendManager";
17
+ import { Debugger } from "./Debugger";
18
+ import { Runner } from "./Runner";
19
+ import { InputOutput } from "./InputOutput";
20
+ import { Constants } from "./Constants";
21
+ import { Examples } from "./Examples";
22
+ import { BackendManager } from "../../communication/BackendManager";
23
23
  import { makeChannel } from "sync-message";
24
- import { I18n } from "./frontend/state/I18n";
25
- import { Test } from "./frontend/state/Test";
24
+ import { I18n } from "./I18n";
25
+ import { Test } from "./Test";
26
26
  export class Papyros extends State {
27
27
  constructor() {
28
28
  super(...arguments);
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Papyros.js","sourceRoot":"","sources":["../../../src/frontend/state/Papyros.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,MAAM,OAAO,OAAQ,SAAQ,KAAK;IAAlC;;QACa,aAAQ,GAAa,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC;QACxC,WAAM,GAAW,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC;QAClC,OAAE,GAAgB,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;QACxC,cAAS,GAAc,IAAI,SAAS,EAAE,CAAC;QACvC,aAAQ,GAAa,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC;QACxC,SAAI,GAAG,IAAI,IAAI,EAAE,CAAC;QAClB,SAAI,GAAS,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC;QAGjC,sBAAiB,GAAW,uBAAuB,CAAC;IA6C5D,CAAC;IA3CG;;;OAGG;IACU,MAAM;;YACf,IAAI,CA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I,CAAC;QAChB,CAAC;KAAA;CACJ;AA7CO;IADH,aAAa;kDAC0C;AA+C5D,MAAM,CAAC,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { SyncClient } from "comsync";
2
2
  import { Backend, RunMode, WorkerDiagnostic } from "../../backend/Backend";
3
3
  import { State } from "@dodona/lit-state";
4
- import { Papyros } from "../../Papyros";
4
+ import { Papyros } from "./Papyros";
5
5
  import { ProgrammingLanguage } from "../../ProgrammingLanguage";
6
6
  /**
7
7
  * Enum representing the possible states while processing code
@@ -1,5 +1,5 @@
1
1
  import { State } from "@dodona/lit-state";
2
- import { Papyros } from "../../Papyros";
2
+ import { Papyros } from "./Papyros";
3
3
  export declare class Test extends State {
4
4
  papyros: Papyros;
5
5
  testLineCount: number | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dodona/papyros",
3
- "version": "4.0.0-beta.5",
3
+ "version": "4.0.0-beta.6",
4
4
  "private": false,
5
5
  "homepage": ".",
6
6
  "devDependencies": {
@@ -1,4 +0,0 @@
1
- import "./frontend/components/Input";
2
- import "./frontend/components/Output";
3
- import "./frontend/components/CodeRunner";
4
- import "./frontend/components/Debugger";
@@ -1,5 +0,0 @@
1
- import "./frontend/components/Input";
2
- import "./frontend/components/Output";
3
- import "./frontend/components/CodeRunner";
4
- import "./frontend/components/Debugger";
5
- //# sourceMappingURL=Components.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Components.js","sourceRoot":"","sources":["../src/Components.ts"],"names":[],"mappings":"AAAA,OAAO,6BAA6B,CAAC;AACrC,OAAO,8BAA8B,CAAC;AACtC,OAAO,kCAAkC,CAAC;AAC1C,OAAO,gCAAgC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Papyros.js","sourceRoot":"","sources":["../src/Papyros.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,aAAa,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