@citolab/qti-components 6.9.1-beta.9 → 7.0.1

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 (47) hide show
  1. package/cdn/index.global.js +277 -0
  2. package/cdn/index.min.cjs +4489 -0
  3. package/cdn/index.min.js +4489 -0
  4. package/dist/custom-element-eslint-rules.js +337 -0
  5. package/dist/item.css +2613 -738
  6. package/dist/qti-components/index.cjs +6704 -0
  7. package/dist/qti-components/index.cjs.map +1 -0
  8. package/dist/qti-components/index.d.cts +150 -0
  9. package/dist/qti-components/index.d.ts +7 -7
  10. package/dist/qti-components/index.js +6244 -224
  11. package/dist/qti-components/index.js.map +1 -0
  12. package/dist/qti-components-jsx.d.ts +2170 -0
  13. package/dist/qti-item/index.cjs +89 -0
  14. package/dist/qti-item/index.cjs.map +1 -0
  15. package/dist/qti-item/index.d.cts +24 -0
  16. package/dist/qti-item/index.d.ts +15 -10
  17. package/dist/qti-item/index.js +63 -1504
  18. package/dist/qti-item/index.js.map +1 -0
  19. package/dist/qti-loader/index.cjs +332 -0
  20. package/dist/qti-loader/index.cjs.map +1 -0
  21. package/dist/qti-loader/index.d.cts +20 -0
  22. package/dist/qti-loader/index.d.ts +19 -4
  23. package/dist/qti-loader/index.js +305 -2
  24. package/dist/qti-loader/index.js.map +1 -0
  25. package/dist/{qti-simple-choice-CafJuhnH.d.ts → qti-simple-choice-CynLWb8d.d.cts} +183 -171
  26. package/dist/qti-simple-choice-CynLWb8d.d.ts +1185 -0
  27. package/dist/qti-test/index.cjs +4632 -0
  28. package/dist/qti-test/index.cjs.map +1 -0
  29. package/dist/qti-test/index.d.cts +304 -0
  30. package/dist/qti-test/index.d.ts +304 -0
  31. package/dist/qti-test/index.js +4599 -0
  32. package/dist/qti-test/index.js.map +1 -0
  33. package/dist/qti-transformers/index.cjs +316 -0
  34. package/dist/qti-transformers/index.cjs.map +1 -0
  35. package/dist/qti-transformers/index.d.cts +75 -0
  36. package/dist/qti-transformers/index.d.ts +25 -120
  37. package/dist/qti-transformers/index.js +288 -2
  38. package/dist/qti-transformers/index.js.map +1 -0
  39. package/dist/vscode.css-custom-data.json +72 -0
  40. package/dist/vscode.html-custom-data.json +914 -0
  41. package/package.json +178 -68
  42. package/dist/chunk-62FWJYVB.js +0 -24
  43. package/dist/chunk-E7TLXHQH.js +0 -2
  44. package/dist/custom-elements.json +0 -8035
  45. package/dist/index.js +0 -2326
  46. /package/{LICENSE → LICENSE.md} +0 -0
  47. /package/{readme.md → README.md} +0 -0
@@ -0,0 +1,89 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var __decorateClass = (decorators, target, key, kind) => {
19
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
20
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
21
+ if (decorator = decorators[i])
22
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
23
+ if (kind && result) __defProp(target, key, result);
24
+ return result;
25
+ };
26
+
27
+ // src/lib/qti-item/index.ts
28
+ var qti_item_exports = {};
29
+ __export(qti_item_exports, {
30
+ QtiItem: () => QtiItem,
31
+ QtiItemMixin: () => QtiItemMixin
32
+ });
33
+ module.exports = __toCommonJS(qti_item_exports);
34
+
35
+ // src/lib/qti-item/qti-item.ts
36
+ var import_lit2 = require("lit");
37
+ var import_decorators2 = require("lit/decorators.js");
38
+
39
+ // src/lib/qti-item/qti-item.mixin.ts
40
+ var import_lit = require("lit");
41
+ var import_decorators = require("lit/decorators.js");
42
+ function QtiItemMixin(Base) {
43
+ class QtiItemClass extends Base {
44
+ // the XMLDocument
45
+ createRenderRoot() {
46
+ return this;
47
+ }
48
+ get assessmentItem() {
49
+ return this.renderRoot?.querySelector("qti-assessment-item");
50
+ }
51
+ async connectedCallback() {
52
+ super.connectedCallback();
53
+ await this.updateComplete;
54
+ this.dispatchEvent(
55
+ new CustomEvent("qti-item-connected", {
56
+ bubbles: true,
57
+ composed: true,
58
+ detail: { identifier: this.identifier, href: this.href }
59
+ })
60
+ );
61
+ }
62
+ render() {
63
+ return import_lit.html`${this.xmlDoc}`;
64
+ }
65
+ }
66
+ __decorateClass([
67
+ (0, import_decorators.property)({ type: String, reflect: true })
68
+ ], QtiItemClass.prototype, "identifier", 2);
69
+ __decorateClass([
70
+ (0, import_decorators.property)({ type: String })
71
+ ], QtiItemClass.prototype, "href", 2);
72
+ __decorateClass([
73
+ (0, import_decorators.property)({ type: Object, attribute: false })
74
+ ], QtiItemClass.prototype, "xmlDoc", 2);
75
+ return QtiItemClass;
76
+ }
77
+
78
+ // src/lib/qti-item/qti-item.ts
79
+ var QtiItem = class extends QtiItemMixin(import_lit2.LitElement) {
80
+ };
81
+ QtiItem = __decorateClass([
82
+ (0, import_decorators2.customElement)("qti-item")
83
+ ], QtiItem);
84
+ // Annotate the CommonJS export names for ESM import in node:
85
+ 0 && (module.exports = {
86
+ QtiItem,
87
+ QtiItemMixin
88
+ });
89
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/qti-item/index.ts","../../src/lib/qti-item/qti-item.ts","../../src/lib/qti-item/qti-item.mixin.ts"],"sourcesContent":["export * from './qti-item';\nexport * from './qti-item.mixin';\n\n","import { LitElement } from 'lit';\nimport { customElement } from 'lit/decorators.js';\nimport { QtiItemMixin } from './qti-item.mixin';\n\n@customElement('qti-item')\nexport class QtiItem extends QtiItemMixin(LitElement) {}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-item': QtiItem;\n }\n}","import { LitElement, html } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { QtiAssessmentItem } from '../qti-components';\n\ntype Constructor<T = {}> = new (...args: any[]) => T;\n\nexport interface QtiItemInterface {\n identifier?: string;\n href?: string;\n xmlDoc: DocumentFragment;\n assessmentItem: QtiAssessmentItem | null;\n}\n\nexport function QtiItemMixin<T extends Constructor<LitElement>>(Base: T) {\n class QtiItemClass extends Base {\n @property({ type: String, reflect: true }) identifier?: string;\n @property({ type: String }) href?: string;\n\n @property({ type: Object, attribute: false })\n xmlDoc!: DocumentFragment; // the XMLDocument\n\n protected createRenderRoot(): HTMLElement | DocumentFragment {\n return this;\n }\n\n get assessmentItem(): QtiAssessmentItem | null {\n return this.renderRoot?.querySelector('qti-assessment-item');\n }\n\n async connectedCallback(): Promise<void> {\n super.connectedCallback();\n await this.updateComplete;\n this.dispatchEvent(\n new CustomEvent('qti-item-connected', {\n bubbles: true,\n composed: true,\n detail: { identifier: this.identifier, href: this.href }\n })\n );\n }\n\n render() {\n return html`${this.xmlDoc}`;\n }\n }\n return QtiItemClass as Constructor<QtiItemInterface> & T;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,cAA2B;AAC3B,IAAAC,qBAA8B;;;ACD9B,iBAAiC;AACjC,wBAAyB;AAYlB,SAAS,aAAgD,MAAS;AAAA,EACvE,MAAM,qBAAqB,KAAK;AAAA;AAAA,IAOpB,mBAAmD;AAC3D,aAAO;AAAA,IACT;AAAA,IAEA,IAAI,iBAA2C;AAC7C,aAAO,KAAK,YAAY,cAAc,qBAAqB;AAAA,IAC7D;AAAA,IAEA,MAAM,oBAAmC;AACvC,YAAM,kBAAkB;AACxB,YAAM,KAAK;AACX,WAAK;AAAA,QACH,IAAI,YAAY,sBAAsB;AAAA,UACpC,SAAS;AAAA,UACT,UAAU;AAAA,UACV,QAAQ,EAAE,YAAY,KAAK,YAAY,MAAM,KAAK,KAAK;AAAA,QACzD,CAAC;AAAA,MACH;AAAA,IACF;AAAA,IAEA,SAAS;AACP,aAAO,kBAAO,KAAK,MAAM;AAAA,IAC3B;AAAA,EACF;AA7B6C;AAAA,QAA1C,4BAAS,EAAE,MAAM,QAAQ,SAAS,KAAK,CAAC;AAAA,KADrC,aACuC;AACf;AAAA,QAA3B,4BAAS,EAAE,MAAM,OAAO,CAAC;AAAA,KAFtB,aAEwB;AAG5B;AAAA,QADC,4BAAS,EAAE,MAAM,QAAQ,WAAW,MAAM,CAAC;AAAA,KAJxC,aAKJ;AA0BF,SAAO;AACT;;;ADzCO,IAAM,UAAN,cAAsB,aAAa,sBAAU,EAAE;AAAC;AAA1C,UAAN;AAAA,MADN,kCAAc,UAAU;AAAA,GACZ;","names":["import_lit","import_decorators"]}
@@ -0,0 +1,24 @@
1
+ import { LitElement } from 'lit';
2
+ import { p as QtiAssessmentItem } from '../qti-simple-choice-CynLWb8d.cjs';
3
+ import 'lit-html';
4
+ import 'lit-html/directives/ref.js';
5
+
6
+ type Constructor<T = {}> = new (...args: any[]) => T;
7
+ interface QtiItemInterface {
8
+ identifier?: string;
9
+ href?: string;
10
+ xmlDoc: DocumentFragment;
11
+ assessmentItem: QtiAssessmentItem | null;
12
+ }
13
+ declare function QtiItemMixin<T extends Constructor<LitElement>>(Base: T): Constructor<QtiItemInterface> & T;
14
+
15
+ declare const QtiItem_base: (new (...args: any[]) => QtiItemInterface) & typeof LitElement;
16
+ declare class QtiItem extends QtiItem_base {
17
+ }
18
+ declare global {
19
+ interface HTMLElementTagNameMap {
20
+ 'qti-item': QtiItem;
21
+ }
22
+ }
23
+
24
+ export { QtiItem, type QtiItemInterface, QtiItemMixin };
@@ -1,19 +1,24 @@
1
- import { n as VariableValue } from '../qti-simple-choice-CafJuhnH.js';
1
+ import { LitElement } from 'lit';
2
+ import { p as QtiAssessmentItem } from '../qti-simple-choice-CynLWb8d.js';
2
3
  import 'lit-html';
3
- import 'lit';
4
4
  import 'lit-html/directives/ref.js';
5
5
 
6
- declare class QtiItem extends HTMLElement {
7
- #private;
8
- view?: string;
9
- set xmlDoc(xml: DocumentFragment);
10
- processResponse(): void;
11
- get variables(): VariableValue<string | string[] | null>[];
12
- set variables(variables: VariableValue<string | string[] | null>[]);
13
- attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
6
+ type Constructor<T = {}> = new (...args: any[]) => T;
7
+ interface QtiItemInterface {
8
+ identifier?: string;
9
+ href?: string;
10
+ xmlDoc: DocumentFragment;
11
+ assessmentItem: QtiAssessmentItem | null;
12
+ }
13
+ declare function QtiItemMixin<T extends Constructor<LitElement>>(Base: T): Constructor<QtiItemInterface> & T;
14
+
15
+ declare const QtiItem_base: (new (...args: any[]) => QtiItemInterface) & typeof LitElement;
16
+ declare class QtiItem extends QtiItem_base {
14
17
  }
15
18
  declare global {
16
19
  interface HTMLElementTagNameMap {
17
20
  'qti-item': QtiItem;
18
21
  }
19
22
  }
23
+
24
+ export { QtiItem, type QtiItemInterface, QtiItemMixin };