@pie-element/venn-classification 0.1.1-next.4 → 0.1.1-next.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.
@@ -1,10 +1,11 @@
1
- import { i as e, r as t, t as n } from "../VennClassification-BT81NwZz.js";
2
- import { s as r } from "../controller-DGuLVZuv.js";
1
+ import { a as e, i as t, r as n, t as r } from "../VennClassification-DCPzzIcj.js";
2
+ import { s as i } from "../controller-DGuLVZuv.js";
3
3
  //#region src/delivery/index.ts
4
- var i = n.element, a = class extends i {
4
+ var a = r.element, o = class extends a {
5
5
  _internalSession = null;
6
+ _playerSession = null;
6
7
  _model = null;
7
- _isComplete = () => r(this._model, this._internalSession);
8
+ _isComplete = () => i(this._model, this._internalSession);
8
9
  _dispatchModelSet = () => {
9
10
  this.dispatchEvent(new t(this.tagName.toLowerCase(), this._isComplete(), this._model !== void 0));
10
11
  };
@@ -18,19 +19,19 @@ var i = n.element, a = class extends i {
18
19
  return this._model;
19
20
  }
20
21
  set session(e) {
21
- e !== this._internalSession && (this._internalSession = e, super.session = e, this._dispatchSessionChanged());
22
+ e !== this._internalSession && (this._playerSession = e, this._internalSession = e, super.session = e, this._dispatchSessionChanged());
22
23
  }
23
24
  get session() {
24
25
  return this._internalSession;
25
26
  }
26
27
  onSessionChange = (e) => {
27
- this._internalSession = e, super.session = e, this._dispatchSessionChanged();
28
+ n(this._playerSession, e), this._internalSession = e, super.session = e, this._dispatchSessionChanged();
28
29
  };
29
30
  connectedCallback() {
30
31
  super.connectedCallback(), this.onSessionChange = this.onSessionChange;
31
32
  }
32
33
  };
33
34
  //#endregion
34
- export { a as default };
35
+ export { o as default };
35
36
 
36
37
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../src/delivery/index.ts"],"sourcesContent":["import VennClassificationComponent from './VennClassification.svelte';\nimport { isComplete as isControllerComplete } from '../controller/index.js';\nimport { ModelSetEvent, SessionChangedEvent } from '@pie-lib/delivery-events-svelte';\n\nconst SvelteElementClass = (VennClassificationComponent as any).element;\n\nclass VennClassificationElement extends SvelteElementClass {\n _internalSession: any = null;\n _model: any = null;\n\n _isComplete = () => {\n return isControllerComplete(this._model, this._internalSession);\n };\n\n _dispatchModelSet = () => {\n this.dispatchEvent(\n new ModelSetEvent(this.tagName.toLowerCase(), this._isComplete(), this._model !== undefined)\n );\n };\n\n _dispatchSessionChanged = () => {\n this.dispatchEvent(new SessionChangedEvent(this.tagName.toLowerCase(), this._isComplete()));\n };\n\n set model(m: any) {\n this._model = m;\n super.model = m;\n this._dispatchModelSet();\n }\n\n get model() {\n return this._model;\n }\n\n set session(s: any) {\n // Avoid redundant reactive loops: if the incoming session is structurally\n // identical to the last one we saw, skip the update.\n if (s === this._internalSession) return;\n this._internalSession = s;\n super.session = s;\n this._dispatchSessionChanged();\n }\n\n get session() {\n return this._internalSession;\n }\n\n onSessionChange = (updatedSession: any) => {\n this._internalSession = updatedSession;\n super.session = updatedSession;\n this._dispatchSessionChanged();\n };\n\n connectedCallback() {\n super.connectedCallback();\n (this as any).onSessionChange = this.onSessionChange;\n }\n}\n\nexport default VennClassificationElement;\n"],"mappings":";;;AAIA,IAAM,IAAsB,EAAoC,SAE1D,IAAN,cAAwC,EAAmB;CACzD,mBAAwB;CACxB,SAAc;CAEd,oBACS,EAAqB,KAAK,QAAQ,KAAK,gBAAgB;CAGhE,0BAA0B;EACxB,KAAK,cACH,IAAI,EAAc,KAAK,QAAQ,YAAY,GAAG,KAAK,YAAY,GAAG,KAAK,WAAW,KAAA,CAAS,CAC7F;CACF;CAEA,gCAAgC;EAC9B,KAAK,cAAc,IAAI,EAAoB,KAAK,QAAQ,YAAY,GAAG,KAAK,YAAY,CAAC,CAAC;CAC5F;CAEA,IAAI,MAAM,GAAQ;EAGhB,AAFA,KAAK,SAAS,GACd,MAAM,QAAQ,GACd,KAAK,kBAAkB;CACzB;CAEA,IAAI,QAAQ;EACV,OAAO,KAAK;CACd;CAEA,IAAI,QAAQ,GAAQ;EAGd,MAAM,KAAK,qBACf,KAAK,mBAAmB,GACxB,MAAM,UAAU,GAChB,KAAK,wBAAwB;CAC/B;CAEA,IAAI,UAAU;EACZ,OAAO,KAAK;CACd;CAEA,mBAAmB,MAAwB;EAGzC,AAFA,KAAK,mBAAmB,GACxB,MAAM,UAAU,GAChB,KAAK,wBAAwB;CAC/B;CAEA,oBAAoB;EAElB,AADA,MAAM,kBAAkB,GACxB,KAAc,kBAAkB,KAAK;CACvC;AACF"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/delivery/index.ts"],"sourcesContent":["import VennClassificationComponent from './VennClassification.svelte';\nimport { isComplete as isControllerComplete } from '../controller/index.js';\nimport {\n ModelSetEvent,\n SessionChangedEvent,\n writeSessionInPlace,\n} from '@pie-lib/delivery-events-svelte';\n\nconst SvelteElementClass = (VennClassificationComponent as any).element;\n\nclass VennClassificationElement extends SvelteElementClass {\n _internalSession: any = null;\n /**\n * The session object the player handed us. A player reads the learner's\n * response back off this object, so every update is written into it as well\n * as into the copy the component renders from.\n */\n _playerSession: any = null;\n _model: any = null;\n\n _isComplete = () => {\n return isControllerComplete(this._model, this._internalSession);\n };\n\n _dispatchModelSet = () => {\n this.dispatchEvent(\n new ModelSetEvent(this.tagName.toLowerCase(), this._isComplete(), this._model !== undefined)\n );\n };\n\n _dispatchSessionChanged = () => {\n this.dispatchEvent(new SessionChangedEvent(this.tagName.toLowerCase(), this._isComplete()));\n };\n\n set model(m: any) {\n this._model = m;\n super.model = m;\n this._dispatchModelSet();\n }\n\n get model() {\n return this._model;\n }\n\n set session(s: any) {\n // Avoid redundant reactive loops: if the incoming session is structurally\n // identical to the last one we saw, skip the update.\n if (s === this._internalSession) return;\n this._playerSession = s;\n this._internalSession = s;\n super.session = s;\n this._dispatchSessionChanged();\n }\n\n get session() {\n return this._internalSession;\n }\n\n onSessionChange = (updatedSession: any) => {\n writeSessionInPlace(this._playerSession, updatedSession);\n this._internalSession = updatedSession;\n super.session = updatedSession;\n this._dispatchSessionChanged();\n };\n\n connectedCallback() {\n super.connectedCallback();\n (this as any).onSessionChange = this.onSessionChange;\n }\n}\n\nexport default VennClassificationElement;\n"],"mappings":";;;AAQA,IAAM,IAAsB,EAAoC,SAE1D,IAAN,cAAwC,EAAmB;CACzD,mBAAwB;CAMxB,iBAAsB;CACtB,SAAc;CAEd,oBACS,EAAqB,KAAK,QAAQ,KAAK,gBAAgB;CAGhE,0BAA0B;EACxB,KAAK,cACH,IAAI,EAAc,KAAK,QAAQ,YAAY,GAAG,KAAK,YAAY,GAAG,KAAK,WAAW,KAAA,CAAS,CAC7F;CACF;CAEA,gCAAgC;EAC9B,KAAK,cAAc,IAAI,EAAoB,KAAK,QAAQ,YAAY,GAAG,KAAK,YAAY,CAAC,CAAC;CAC5F;CAEA,IAAI,MAAM,GAAQ;EAGhB,AAFA,KAAK,SAAS,GACd,MAAM,QAAQ,GACd,KAAK,kBAAkB;CACzB;CAEA,IAAI,QAAQ;EACV,OAAO,KAAK;CACd;CAEA,IAAI,QAAQ,GAAQ;EAGd,MAAM,KAAK,qBACf,KAAK,iBAAiB,GACtB,KAAK,mBAAmB,GACxB,MAAM,UAAU,GAChB,KAAK,wBAAwB;CAC/B;CAEA,IAAI,UAAU;EACZ,OAAO,KAAK;CACd;CAEA,mBAAmB,MAAwB;EAIzC,AAHA,EAAoB,KAAK,gBAAgB,CAAc,GACvD,KAAK,mBAAmB,GACxB,MAAM,UAAU,GAChB,KAAK,wBAAwB;CAC/B;CAEA,oBAAoB;EAElB,AADA,MAAM,kBAAkB,GACxB,KAAc,kBAAkB,KAAK;CACvC;AACF"}
@@ -1,6 +1,12 @@
1
1
  declare const SvelteElementClass: any;
2
2
  declare class VennClassificationElement extends SvelteElementClass {
3
3
  _internalSession: any;
4
+ /**
5
+ * The session object the player handed us. A player reads the learner's
6
+ * response back off this object, so every update is written into it as well
7
+ * as into the copy the component renders from.
8
+ */
9
+ _playerSession: any;
4
10
  _model: any;
5
11
  _isComplete: () => boolean;
6
12
  _dispatchModelSet: () => void;