@citolab/qti-components 7.14.3 → 7.15.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.
- package/cdn/index.global.js +1 -1
- package/cdn/index.js +4044 -4030
- package/custom-elements.json +10478 -26460
- package/dist/base.d.ts +8 -0
- package/dist/base.js +50 -0
- package/dist/{chunks/chunk-DGBI4IU5.js → chunk-2DOYPVF5.js} +252 -136
- package/dist/chunk-2DOYPVF5.js.map +1 -0
- package/dist/chunk-2ZEJ3RR5.js +89 -0
- package/dist/chunk-2ZEJ3RR5.js.map +1 -0
- package/dist/{chunks/chunk-E4GR4K26.js → chunk-352OTVTY.js} +1481 -442
- package/dist/chunk-352OTVTY.js.map +1 -0
- package/dist/{chunks/chunk-C4ELTNV7.js → chunk-C2HQFI2C.js} +857 -3819
- package/dist/chunk-C2HQFI2C.js.map +1 -0
- package/dist/chunk-DWIRLYDS.js +20 -0
- package/dist/chunk-DWIRLYDS.js.map +1 -0
- package/dist/{chunks/chunk-H2JE6IVU.js → chunk-EUXUH3YW.js} +1 -1
- package/dist/chunk-F44CI35W.js +145 -0
- package/dist/chunk-F44CI35W.js.map +1 -0
- package/dist/{chunks/chunk-XBPO6E25.js → chunk-INKI27D5.js} +6 -5
- package/dist/chunk-INKI27D5.js.map +1 -0
- package/dist/chunk-JEUY3MYB.js +2010 -0
- package/dist/chunk-JEUY3MYB.js.map +1 -0
- package/dist/chunk-O4XIWHTF.js +1139 -0
- package/dist/chunk-O4XIWHTF.js.map +1 -0
- package/dist/chunk-RI47B4ZT.js +1753 -0
- package/dist/chunk-RI47B4ZT.js.map +1 -0
- package/dist/{qti-loader/index.js → chunk-VEV4DGPH.js} +6 -6
- package/dist/chunk-VEV4DGPH.js.map +1 -0
- package/dist/{chunks/chunk-TN75CWLX.js → chunk-W4SQRNWO.js} +97 -2
- package/dist/chunk-W4SQRNWO.js.map +1 -0
- package/dist/elements.d.ts +1 -0
- package/dist/elements.js +42 -0
- package/dist/index.d.ts +8 -24
- package/dist/index.js +117 -285
- package/dist/index.js.map +1 -1
- package/dist/interactions.d.ts +1 -0
- package/dist/interactions.js +72 -0
- package/dist/item.d.ts +1 -0
- package/dist/item.js +23 -0
- package/dist/loader.d.ts +1 -0
- package/dist/loader.js +11 -0
- package/dist/processing.d.ts +1 -0
- package/dist/processing.js +103 -0
- package/dist/qti-components-jsx.d.ts +1475 -2388
- package/dist/test.d.ts +1 -0
- package/dist/{qti-test/index.js → test.js} +11 -19
- package/dist/transformers.d.ts +1 -0
- package/dist/{qti-transformers/index.js → transformers.js} +3 -3
- package/dist/vscode.html-custom-data.json +469 -631
- package/package.json +70 -166
- package/LICENSE.md +0 -674
- package/dist/chunks/chunk-4OGJBG35.js +0 -8
- package/dist/chunks/chunk-4OGJBG35.js.map +0 -1
- package/dist/chunks/chunk-AGV5GOTF.js +0 -234
- package/dist/chunks/chunk-AGV5GOTF.js.map +0 -1
- package/dist/chunks/chunk-BHJSX3Q6.js +0 -8
- package/dist/chunks/chunk-BHJSX3Q6.js.map +0 -1
- package/dist/chunks/chunk-C4ELTNV7.js.map +0 -1
- package/dist/chunks/chunk-C5RLRG3L.js +0 -10
- package/dist/chunks/chunk-C5RLRG3L.js.map +0 -1
- package/dist/chunks/chunk-CJADUWEC.js +0 -10
- package/dist/chunks/chunk-CJADUWEC.js.map +0 -1
- package/dist/chunks/chunk-DGBI4IU5.js.map +0 -1
- package/dist/chunks/chunk-DVQQ7I6Y.js +0 -8
- package/dist/chunks/chunk-DVQQ7I6Y.js.map +0 -1
- package/dist/chunks/chunk-E4GR4K26.js.map +0 -1
- package/dist/chunks/chunk-ELDMXTUQ.js +0 -31
- package/dist/chunks/chunk-ELDMXTUQ.js.map +0 -1
- package/dist/chunks/chunk-GAAFN7QF.js +0 -146
- package/dist/chunks/chunk-GAAFN7QF.js.map +0 -1
- package/dist/chunks/chunk-H6KHXSIO.js +0 -8
- package/dist/chunks/chunk-H6KHXSIO.js.map +0 -1
- package/dist/chunks/chunk-JQ6HWGRY.js +0 -22
- package/dist/chunks/chunk-JQ6HWGRY.js.map +0 -1
- package/dist/chunks/chunk-NJNQOQUU.js +0 -8
- package/dist/chunks/chunk-NJNQOQUU.js.map +0 -1
- package/dist/chunks/chunk-P4QBOVQ2.js +0 -206
- package/dist/chunks/chunk-P4QBOVQ2.js.map +0 -1
- package/dist/chunks/chunk-SV4K25ZI.js +0 -19
- package/dist/chunks/chunk-SV4K25ZI.js.map +0 -1
- package/dist/chunks/chunk-TN75CWLX.js.map +0 -1
- package/dist/chunks/chunk-XBPO6E25.js.map +0 -1
- package/dist/exports/computed-item.context.d.ts +0 -23
- package/dist/exports/computed-item.context.js +0 -8
- package/dist/exports/computed.context.d.ts +0 -34
- package/dist/exports/computed.context.js +0 -8
- package/dist/exports/config.context.d.ts +0 -14
- package/dist/exports/config.context.js +0 -8
- package/dist/exports/expression-result.d.ts +0 -19
- package/dist/exports/expression-result.js +0 -1
- package/dist/exports/interaction.d.ts +0 -46
- package/dist/exports/interaction.interface.d.ts +0 -13
- package/dist/exports/interaction.interface.js +0 -1
- package/dist/exports/interaction.js +0 -12
- package/dist/exports/item.context.d.ts +0 -11
- package/dist/exports/item.context.js +0 -8
- package/dist/exports/qti-assessment-item.context.d.ts +0 -9
- package/dist/exports/qti-assessment-item.context.js +0 -8
- package/dist/exports/qti-condition-expression.d.ts +0 -14
- package/dist/exports/qti-condition-expression.js +0 -11
- package/dist/exports/qti-condition-expression.js.map +0 -1
- package/dist/exports/qti-expression.d.ts +0 -23
- package/dist/exports/qti-expression.js +0 -10
- package/dist/exports/qti-expression.js.map +0 -1
- package/dist/exports/qti-test.d.ts +0 -12
- package/dist/exports/qti-test.js +0 -1
- package/dist/exports/qti-test.js.map +0 -1
- package/dist/exports/qti.context.d.ts +0 -14
- package/dist/exports/qti.context.js +0 -8
- package/dist/exports/qti.context.js.map +0 -1
- package/dist/exports/session.context.d.ts +0 -15
- package/dist/exports/session.context.js +0 -10
- package/dist/exports/session.context.js.map +0 -1
- package/dist/exports/test.context.d.ts +0 -16
- package/dist/exports/test.context.js +0 -10
- package/dist/exports/test.context.js.map +0 -1
- package/dist/exports/variables.d.ts +0 -2
- package/dist/exports/variables.js +0 -1
- package/dist/exports/variables.js.map +0 -1
- package/dist/qti-assessment-item-l-mN3teH.d.ts +0 -105
- package/dist/qti-components/index.d.ts +0 -1524
- package/dist/qti-components/index.js +0 -216
- package/dist/qti-components/index.js.map +0 -1
- package/dist/qti-item/index.d.ts +0 -114
- package/dist/qti-item/index.js +0 -19
- package/dist/qti-item/index.js.map +0 -1
- package/dist/qti-loader/index.d.ts +0 -21
- package/dist/qti-loader/index.js.map +0 -1
- package/dist/qti-modal-feedback-Cp3CHVKw.d.ts +0 -30
- package/dist/qti-test/index.d.ts +0 -480
- package/dist/qti-test/index.js.map +0 -1
- package/dist/qti-test-mmY8zNIj.d.ts +0 -120
- package/dist/qti-transform-test-Bz9A3hmD.d.ts +0 -63
- package/dist/qti-transformers/index.d.ts +0 -18
- package/dist/qti-transformers/index.js.map +0 -1
- package/dist/variables-BCkyLoXK.d.ts +0 -55
- package/readme.md +0 -59
- /package/dist/{chunks/chunk-H2JE6IVU.js.map → base.js.map} +0 -0
- /package/dist/{exports/computed-item.context.js.map → chunk-EUXUH3YW.js.map} +0 -0
- /package/dist/{exports/computed.context.js.map → elements.js.map} +0 -0
- /package/dist/{exports/config.context.js.map → interactions.js.map} +0 -0
- /package/dist/{exports/expression-result.js.map → item.js.map} +0 -0
- /package/dist/{exports/interaction.interface.js.map → loader.js.map} +0 -0
- /package/dist/{exports/interaction.js.map → processing.js.map} +0 -0
- /package/dist/{exports/item.context.js.map → test.js.map} +0 -0
- /package/dist/{exports/qti-assessment-item.context.js.map → transformers.js.map} +0 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
E
|
|
3
|
+
} from "./chunk-JEUY3MYB.js";
|
|
4
|
+
|
|
5
|
+
// ../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/node/directives/if-defined.js
|
|
6
|
+
var o = (o2) => o2 ?? E;
|
|
7
|
+
|
|
8
|
+
export {
|
|
9
|
+
o
|
|
10
|
+
};
|
|
11
|
+
/*! Bundled license information:
|
|
12
|
+
|
|
13
|
+
lit-html/node/directives/if-defined.js:
|
|
14
|
+
(**
|
|
15
|
+
* @license
|
|
16
|
+
* Copyright 2018 Google LLC
|
|
17
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
18
|
+
*)
|
|
19
|
+
*/
|
|
20
|
+
//# sourceMappingURL=chunk-DWIRLYDS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/src/directives/if-defined.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {nothing} from '../lit-html.js';\n\n/**\n * For AttributeParts, sets the attribute if the value is defined and removes\n * the attribute if the value is undefined.\n *\n * For other part types, this directive is a no-op.\n */\nexport const ifDefined = <T>(value: T) => value ?? nothing;\n"],"mappings":";;;;;AAcO,IAAMA,IAAgBC,CAAAA,OAAaA,MAASC;","names":["ifDefined","value","nothing"]}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import {
|
|
2
|
+
W
|
|
3
|
+
} from "./chunk-JEUY3MYB.js";
|
|
4
|
+
|
|
5
|
+
// ../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/node/directive-helpers.js
|
|
6
|
+
var { I: t } = W;
|
|
7
|
+
var i = (o2) => null === o2 || "object" != typeof o2 && "function" != typeof o2;
|
|
8
|
+
var f = (o2) => void 0 === o2.strings;
|
|
9
|
+
var r = () => document.createComment("");
|
|
10
|
+
var s = (o2, i3, n2) => {
|
|
11
|
+
const e2 = o2._$AA.parentNode, l = void 0 === i3 ? o2._$AB : i3._$AA;
|
|
12
|
+
if (void 0 === n2) {
|
|
13
|
+
const i4 = e2.insertBefore(r(), l), d = e2.insertBefore(r(), l);
|
|
14
|
+
n2 = new t(i4, d, o2, o2.options);
|
|
15
|
+
} else {
|
|
16
|
+
const t3 = n2._$AB.nextSibling, i4 = n2._$AM, d = i4 !== o2;
|
|
17
|
+
if (d) {
|
|
18
|
+
let t4;
|
|
19
|
+
n2._$AQ?.(o2), n2._$AM = o2, void 0 !== n2._$AP && (t4 = o2._$AU) !== i4._$AU && n2._$AP(t4);
|
|
20
|
+
}
|
|
21
|
+
if (t3 !== l || d) {
|
|
22
|
+
let o3 = n2._$AA;
|
|
23
|
+
for (; o3 !== t3; ) {
|
|
24
|
+
const t4 = o3.nextSibling;
|
|
25
|
+
e2.insertBefore(o3, l), o3 = t4;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return n2;
|
|
30
|
+
};
|
|
31
|
+
var v = (o2, t3, i3 = o2) => (o2._$AI(t3, i3), o2);
|
|
32
|
+
var u = {};
|
|
33
|
+
var m = (o2, t3 = u) => o2._$AH = t3;
|
|
34
|
+
var p = (o2) => o2._$AH;
|
|
35
|
+
var M = (o2) => {
|
|
36
|
+
o2._$AR(), o2._$AA.remove();
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
// ../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/node/directive.js
|
|
40
|
+
var t2 = { ATTRIBUTE: 1, CHILD: 2, PROPERTY: 3, BOOLEAN_ATTRIBUTE: 4, EVENT: 5, ELEMENT: 6 };
|
|
41
|
+
var e = (t3) => (...e2) => ({ _$litDirective$: t3, values: e2 });
|
|
42
|
+
var i2 = class {
|
|
43
|
+
constructor(t3) {
|
|
44
|
+
}
|
|
45
|
+
get _$AU() {
|
|
46
|
+
return this._$AM._$AU;
|
|
47
|
+
}
|
|
48
|
+
_$AT(t3, e2, i3) {
|
|
49
|
+
this._$Ct = t3, this._$AM = e2, this._$Ci = i3;
|
|
50
|
+
}
|
|
51
|
+
_$AS(t3, e2) {
|
|
52
|
+
return this.update(t3, e2);
|
|
53
|
+
}
|
|
54
|
+
update(t3, e2) {
|
|
55
|
+
return this.render(...e2);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
// ../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/node/async-directive.js
|
|
60
|
+
var s2 = (i3, t3) => {
|
|
61
|
+
const e2 = i3._$AN;
|
|
62
|
+
if (void 0 === e2) return false;
|
|
63
|
+
for (const i4 of e2) i4._$AO?.(t3, false), s2(i4, t3);
|
|
64
|
+
return true;
|
|
65
|
+
};
|
|
66
|
+
var o = (i3) => {
|
|
67
|
+
let t3, e2;
|
|
68
|
+
do {
|
|
69
|
+
if (void 0 === (t3 = i3._$AM)) break;
|
|
70
|
+
e2 = t3._$AN, e2.delete(i3), i3 = t3;
|
|
71
|
+
} while (0 === e2?.size);
|
|
72
|
+
};
|
|
73
|
+
var r2 = (i3) => {
|
|
74
|
+
for (let t3; t3 = i3._$AM; i3 = t3) {
|
|
75
|
+
let e2 = t3._$AN;
|
|
76
|
+
if (void 0 === e2) t3._$AN = e2 = /* @__PURE__ */ new Set();
|
|
77
|
+
else if (e2.has(i3)) break;
|
|
78
|
+
e2.add(i3), c(t3);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
function h(i3) {
|
|
82
|
+
void 0 !== this._$AN ? (o(this), this._$AM = i3, r2(this)) : this._$AM = i3;
|
|
83
|
+
}
|
|
84
|
+
function n(i3, t3 = false, e2 = 0) {
|
|
85
|
+
const r3 = this._$AH, h2 = this._$AN;
|
|
86
|
+
if (void 0 !== h2 && 0 !== h2.size) if (t3) if (Array.isArray(r3)) for (let i4 = e2; i4 < r3.length; i4++) s2(r3[i4], false), o(r3[i4]);
|
|
87
|
+
else null != r3 && (s2(r3, false), o(r3));
|
|
88
|
+
else s2(this, i3);
|
|
89
|
+
}
|
|
90
|
+
var c = (i3) => {
|
|
91
|
+
i3.type == t2.CHILD && (i3._$AP ??= n, i3._$AQ ??= h);
|
|
92
|
+
};
|
|
93
|
+
var f2 = class extends i2 {
|
|
94
|
+
constructor() {
|
|
95
|
+
super(...arguments), this._$AN = void 0;
|
|
96
|
+
}
|
|
97
|
+
_$AT(i3, t3, e2) {
|
|
98
|
+
super._$AT(i3, t3, e2), r2(this), this.isConnected = i3._$AU;
|
|
99
|
+
}
|
|
100
|
+
_$AO(i3, t3 = true) {
|
|
101
|
+
i3 !== this.isConnected && (this.isConnected = i3, i3 ? this.reconnected?.() : this.disconnected?.()), t3 && (s2(this, i3), o(this));
|
|
102
|
+
}
|
|
103
|
+
setValue(t3) {
|
|
104
|
+
if (f(this._$Ct)) this._$Ct._$AI(t3, this);
|
|
105
|
+
else {
|
|
106
|
+
const i3 = [...this._$Ct._$AH];
|
|
107
|
+
i3[this._$Ci] = t3, this._$Ct._$AI(i3, this, 0);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
disconnected() {
|
|
111
|
+
}
|
|
112
|
+
reconnected() {
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
export {
|
|
117
|
+
i,
|
|
118
|
+
s,
|
|
119
|
+
v,
|
|
120
|
+
m,
|
|
121
|
+
p,
|
|
122
|
+
M,
|
|
123
|
+
t2 as t,
|
|
124
|
+
e,
|
|
125
|
+
i2,
|
|
126
|
+
f2 as f
|
|
127
|
+
};
|
|
128
|
+
/*! Bundled license information:
|
|
129
|
+
|
|
130
|
+
lit-html/node/directive-helpers.js:
|
|
131
|
+
(**
|
|
132
|
+
* @license
|
|
133
|
+
* Copyright 2020 Google LLC
|
|
134
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
135
|
+
*)
|
|
136
|
+
|
|
137
|
+
lit-html/node/directive.js:
|
|
138
|
+
lit-html/node/async-directive.js:
|
|
139
|
+
(**
|
|
140
|
+
* @license
|
|
141
|
+
* Copyright 2017 Google LLC
|
|
142
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
143
|
+
*)
|
|
144
|
+
*/
|
|
145
|
+
//# sourceMappingURL=chunk-F44CI35W.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/src/directive-helpers.ts","../../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/src/directive.ts","../../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/src/async-directive.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2020 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {\n _$LH,\n Part,\n DirectiveParent,\n CompiledTemplateResult,\n MaybeCompiledTemplateResult,\n UncompiledTemplateResult,\n} from './lit-html.js';\nimport {\n DirectiveResult,\n DirectiveClass,\n PartInfo,\n AttributePartInfo,\n} from './directive.js';\ntype Primitive = null | undefined | boolean | number | string | symbol | bigint;\n\nconst {_ChildPart: ChildPart} = _$LH;\n\ntype ChildPart = InstanceType<typeof ChildPart>;\n\nconst ENABLE_SHADYDOM_NOPATCH = true;\n\nconst wrap =\n ENABLE_SHADYDOM_NOPATCH &&\n window.ShadyDOM?.inUse &&\n window.ShadyDOM?.noPatch === true\n ? window.ShadyDOM!.wrap\n : (node: Node) => node;\n\n/**\n * Tests if a value is a primitive value.\n *\n * See https://tc39.github.io/ecma262/#sec-typeof-operator\n */\nexport const isPrimitive = (value: unknown): value is Primitive =>\n value === null || (typeof value != 'object' && typeof value != 'function');\n\nexport const TemplateResultType = {\n HTML: 1,\n SVG: 2,\n MATHML: 3,\n} as const;\n\nexport type TemplateResultType =\n (typeof TemplateResultType)[keyof typeof TemplateResultType];\n\ntype IsTemplateResult = {\n (val: unknown): val is MaybeCompiledTemplateResult;\n <T extends TemplateResultType>(\n val: unknown,\n type: T\n ): val is UncompiledTemplateResult<T>;\n};\n\n/**\n * Tests if a value is a TemplateResult or a CompiledTemplateResult.\n */\nexport const isTemplateResult: IsTemplateResult = (\n value: unknown,\n type?: TemplateResultType\n): value is UncompiledTemplateResult =>\n type === undefined\n ? // This property needs to remain unminified.\n (value as UncompiledTemplateResult)?.['_$litType$'] !== undefined\n : (value as UncompiledTemplateResult)?.['_$litType$'] === type;\n\n/**\n * Tests if a value is a CompiledTemplateResult.\n */\nexport const isCompiledTemplateResult = (\n value: unknown\n): value is CompiledTemplateResult => {\n return (value as CompiledTemplateResult)?.['_$litType$']?.h != null;\n};\n\n/**\n * Tests if a value is a DirectiveResult.\n */\nexport const isDirectiveResult = (value: unknown): value is DirectiveResult =>\n // This property needs to remain unminified.\n (value as DirectiveResult)?.['_$litDirective$'] !== undefined;\n\n/**\n * Retrieves the Directive class for a DirectiveResult\n */\nexport const getDirectiveClass = (value: unknown): DirectiveClass | undefined =>\n // This property needs to remain unminified.\n (value as DirectiveResult)?.['_$litDirective$'];\n\n/**\n * Tests whether a part has only a single-expression with no strings to\n * interpolate between.\n *\n * Only AttributePart and PropertyPart can have multiple expressions.\n * Multi-expression parts have a `strings` property and single-expression\n * parts do not.\n */\nexport const isSingleExpression = (part: PartInfo) =>\n (part as AttributePartInfo).strings === undefined;\n\nconst createMarker = () => document.createComment('');\n\n/**\n * Inserts a ChildPart into the given container ChildPart's DOM, either at the\n * end of the container ChildPart, or before the optional `refPart`.\n *\n * This does not add the part to the containerPart's committed value. That must\n * be done by callers.\n *\n * @param containerPart Part within which to add the new ChildPart\n * @param refPart Part before which to add the new ChildPart; when omitted the\n * part added to the end of the `containerPart`\n * @param part Part to insert, or undefined to create a new part\n */\nexport const insertPart = (\n containerPart: ChildPart,\n refPart?: ChildPart,\n part?: ChildPart\n): ChildPart => {\n const container = wrap(containerPart._$startNode).parentNode!;\n\n const refNode =\n refPart === undefined ? containerPart._$endNode : refPart._$startNode;\n\n if (part === undefined) {\n const startNode = wrap(container).insertBefore(createMarker(), refNode);\n const endNode = wrap(container).insertBefore(createMarker(), refNode);\n part = new ChildPart(\n startNode,\n endNode,\n containerPart,\n containerPart.options\n );\n } else {\n const endNode = wrap(part._$endNode!).nextSibling;\n const oldParent = part._$parent;\n const parentChanged = oldParent !== containerPart;\n if (parentChanged) {\n part._$reparentDisconnectables?.(containerPart);\n // Note that although `_$reparentDisconnectables` updates the part's\n // `_$parent` reference after unlinking from its current parent, that\n // method only exists if Disconnectables are present, so we need to\n // unconditionally set it here\n part._$parent = containerPart;\n // Since the _$isConnected getter is somewhat costly, only\n // read it once we know the subtree has directives that need\n // to be notified\n let newConnectionState;\n if (\n part._$notifyConnectionChanged !== undefined &&\n (newConnectionState = containerPart._$isConnected) !==\n oldParent!._$isConnected\n ) {\n part._$notifyConnectionChanged(newConnectionState);\n }\n }\n if (endNode !== refNode || parentChanged) {\n let start: Node | null = part._$startNode;\n while (start !== endNode) {\n const n: Node | null = wrap(start!).nextSibling;\n wrap(container).insertBefore(start!, refNode);\n start = n;\n }\n }\n }\n\n return part;\n};\n\n/**\n * Sets the value of a Part.\n *\n * Note that this should only be used to set/update the value of user-created\n * parts (i.e. those created using `insertPart`); it should not be used\n * by directives to set the value of the directive's container part. Directives\n * should return a value from `update`/`render` to update their part state.\n *\n * For directives that require setting their part value asynchronously, they\n * should extend `AsyncDirective` and call `this.setValue()`.\n *\n * @param part Part to set\n * @param value Value to set\n * @param index For `AttributePart`s, the index to set\n * @param directiveParent Used internally; should not be set by user\n */\nexport const setChildPartValue = <T extends ChildPart>(\n part: T,\n value: unknown,\n directiveParent: DirectiveParent = part\n): T => {\n part._$setValue(value, directiveParent);\n return part;\n};\n\n// A sentinel value that can never appear as a part value except when set by\n// live(). Used to force a dirty-check to fail and cause a re-render.\nconst RESET_VALUE = {};\n\n/**\n * Sets the committed value of a ChildPart directly without triggering the\n * commit stage of the part.\n *\n * This is useful in cases where a directive needs to update the part such\n * that the next update detects a value change or not. When value is omitted,\n * the next update will be guaranteed to be detected as a change.\n *\n * @param part\n * @param value\n */\nexport const setCommittedValue = (part: Part, value: unknown = RESET_VALUE) =>\n (part._$committedValue = value);\n\n/**\n * Returns the committed value of a ChildPart.\n *\n * The committed value is used for change detection and efficient updates of\n * the part. It can differ from the value set by the template or directive in\n * cases where the template value is transformed before being committed.\n *\n * - `TemplateResult`s are committed as a `TemplateInstance`\n * - Iterables are committed as `Array<ChildPart>`\n * - All other types are committed as the template value or value returned or\n * set by a directive.\n *\n * @param part\n */\nexport const getCommittedValue = (part: ChildPart) => part._$committedValue;\n\n/**\n * Removes a ChildPart from the DOM, including any of its content and markers.\n *\n * Note: The only difference between this and clearPart() is that this also\n * removes the part's start node. This means that the ChildPart must own its\n * start node, ie it must be a marker node specifically for this part and not an\n * anchor from surrounding content.\n *\n * @param part The Part to remove\n */\nexport const removePart = (part: ChildPart) => {\n part._$clear();\n part._$startNode.remove();\n};\n\nexport const clearPart = (part: ChildPart) => {\n part._$clear();\n};\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {Disconnectable, Part} from './lit-html.js';\n\nexport {\n AttributePart,\n BooleanAttributePart,\n ChildPart,\n ElementPart,\n EventPart,\n Part,\n PropertyPart,\n} from './lit-html.js';\n\nexport interface DirectiveClass {\n new (part: PartInfo): Directive;\n}\n\n/**\n * This utility type extracts the signature of a directive class's render()\n * method so we can use it for the type of the generated directive function.\n */\nexport type DirectiveParameters<C extends Directive> = Parameters<C['render']>;\n\n/**\n * A generated directive function doesn't evaluate the directive, but just\n * returns a DirectiveResult object that captures the arguments.\n */\nexport interface DirectiveResult<C extends DirectiveClass = DirectiveClass> {\n /**\n * This property needs to remain unminified.\n * @internal\n */\n ['_$litDirective$']: C;\n /** @internal */\n values: DirectiveParameters<InstanceType<C>>;\n}\n\nexport const PartType = {\n ATTRIBUTE: 1,\n CHILD: 2,\n PROPERTY: 3,\n BOOLEAN_ATTRIBUTE: 4,\n EVENT: 5,\n ELEMENT: 6,\n} as const;\n\nexport type PartType = (typeof PartType)[keyof typeof PartType];\n\nexport interface ChildPartInfo {\n readonly type: typeof PartType.CHILD;\n}\n\nexport interface AttributePartInfo {\n readonly type:\n | typeof PartType.ATTRIBUTE\n | typeof PartType.PROPERTY\n | typeof PartType.BOOLEAN_ATTRIBUTE\n | typeof PartType.EVENT;\n readonly strings?: ReadonlyArray<string>;\n readonly name: string;\n readonly tagName: string;\n}\n\nexport interface ElementPartInfo {\n readonly type: typeof PartType.ELEMENT;\n}\n\n/**\n * Information about the part a directive is bound to.\n *\n * This is useful for checking that a directive is attached to a valid part,\n * such as with directive that can only be used on attribute bindings.\n */\nexport type PartInfo = ChildPartInfo | AttributePartInfo | ElementPartInfo;\n\n/**\n * Creates a user-facing directive function from a Directive class. This\n * function has the same parameters as the directive's render() method.\n */\nexport const directive =\n <C extends DirectiveClass>(c: C) =>\n (...values: DirectiveParameters<InstanceType<C>>): DirectiveResult<C> => ({\n // This property needs to remain unminified.\n ['_$litDirective$']: c,\n values,\n });\n\n/**\n * Base class for creating custom directives. Users should extend this class,\n * implement `render` and/or `update`, and then pass their subclass to\n * `directive`.\n */\nexport abstract class Directive implements Disconnectable {\n //@internal\n __part!: Part;\n //@internal\n __attributeIndex: number | undefined;\n //@internal\n __directive?: Directive;\n\n //@internal\n _$parent!: Disconnectable;\n\n // These will only exist on the AsyncDirective subclass\n //@internal\n _$disconnectableChildren?: Set<Disconnectable>;\n // This property needs to remain unminified.\n //@internal\n ['_$notifyDirectiveConnectionChanged']?(isConnected: boolean): void;\n\n constructor(_partInfo: PartInfo) {}\n\n // See comment in Disconnectable interface for why this is a getter\n get _$isConnected() {\n return this._$parent._$isConnected;\n }\n\n /** @internal */\n _$initialize(\n part: Part,\n parent: Disconnectable,\n attributeIndex: number | undefined\n ) {\n this.__part = part;\n this._$parent = parent;\n this.__attributeIndex = attributeIndex;\n }\n /** @internal */\n _$resolve(part: Part, props: Array<unknown>): unknown {\n return this.update(part, props);\n }\n\n abstract render(...props: Array<unknown>): unknown;\n\n update(_part: Part, props: Array<unknown>): unknown {\n return this.render(...props);\n }\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * Overview:\n *\n * This module is designed to add support for an async `setValue` API and\n * `disconnected` callback to directives with the least impact on the core\n * runtime or payload when that feature is not used.\n *\n * The strategy is to introduce a `AsyncDirective` subclass of\n * `Directive` that climbs the \"parent\" tree in its constructor to note which\n * branches of lit-html's \"logical tree\" of data structures contain such\n * directives and thus need to be crawled when a subtree is being cleared (or\n * manually disconnected) in order to run the `disconnected` callback.\n *\n * The \"nodes\" of the logical tree include Parts, TemplateInstances (for when a\n * TemplateResult is committed to a value of a ChildPart), and Directives; these\n * all implement a common interface called `DisconnectableChild`. Each has a\n * `_$parent` reference which is set during construction in the core code, and a\n * `_$disconnectableChildren` field which is initially undefined.\n *\n * The sparse tree created by means of the `AsyncDirective` constructor\n * crawling up the `_$parent` tree and placing a `_$disconnectableChildren` Set\n * on each parent that includes each child that contains a\n * `AsyncDirective` directly or transitively via its children. In order to\n * notify connection state changes and disconnect (or reconnect) a tree, the\n * `_$notifyConnectionChanged` API is patched onto ChildParts as a directive\n * climbs the parent tree, which is called by the core when clearing a part if\n * it exists. When called, that method iterates over the sparse tree of\n * Set<DisconnectableChildren> built up by AsyncDirectives, and calls\n * `_$notifyDirectiveConnectionChanged` on any directives that are encountered\n * in that tree, running the required callbacks.\n *\n * A given \"logical tree\" of lit-html data-structures might look like this:\n *\n * ChildPart(N1) _$dC=[D2,T3]\n * ._directive\n * AsyncDirective(D2)\n * ._value // user value was TemplateResult\n * TemplateInstance(T3) _$dC=[A4,A6,N10,N12]\n * ._$parts[]\n * AttributePart(A4) _$dC=[D5]\n * ._directives[]\n * AsyncDirective(D5)\n * AttributePart(A6) _$dC=[D7,D8]\n * ._directives[]\n * AsyncDirective(D7)\n * Directive(D8) _$dC=[D9]\n * ._directive\n * AsyncDirective(D9)\n * ChildPart(N10) _$dC=[D11]\n * ._directive\n * AsyncDirective(D11)\n * ._value\n * string\n * ChildPart(N12) _$dC=[D13,N14,N16]\n * ._directive\n * AsyncDirective(D13)\n * ._value // user value was iterable\n * Array<ChildPart>\n * ChildPart(N14) _$dC=[D15]\n * ._value\n * string\n * ChildPart(N16) _$dC=[D17,T18]\n * ._directive\n * AsyncDirective(D17)\n * ._value // user value was TemplateResult\n * TemplateInstance(T18) _$dC=[A19,A21,N25]\n * ._$parts[]\n * AttributePart(A19) _$dC=[D20]\n * ._directives[]\n * AsyncDirective(D20)\n * AttributePart(A21) _$dC=[22,23]\n * ._directives[]\n * AsyncDirective(D22)\n * Directive(D23) _$dC=[D24]\n * ._directive\n * AsyncDirective(D24)\n * ChildPart(N25) _$dC=[D26]\n * ._directive\n * AsyncDirective(D26)\n * ._value\n * string\n *\n * Example 1: The directive in ChildPart(N12) updates and returns `nothing`. The\n * ChildPart will _clear() itself, and so we need to disconnect the \"value\" of\n * the ChildPart (but not its directive). In this case, when `_clear()` calls\n * `_$notifyConnectionChanged()`, we don't iterate all of the\n * _$disconnectableChildren, rather we do a value-specific disconnection: i.e.\n * since the _value was an Array<ChildPart> (because an iterable had been\n * committed), we iterate the array of ChildParts (N14, N16) and run\n * `setConnected` on them (which does recurse down the full tree of\n * `_$disconnectableChildren` below it, and also removes N14 and N16 from N12's\n * `_$disconnectableChildren`). Once the values have been disconnected, we then\n * check whether the ChildPart(N12)'s list of `_$disconnectableChildren` is empty\n * (and would remove it from its parent TemplateInstance(T3) if so), but since\n * it would still contain its directive D13, it stays in the disconnectable\n * tree.\n *\n * Example 2: In the course of Example 1, `setConnected` will reach\n * ChildPart(N16); in this case the entire part is being disconnected, so we\n * simply iterate all of N16's `_$disconnectableChildren` (D17,T18) and\n * recursively run `setConnected` on them. Note that we only remove children\n * from `_$disconnectableChildren` for the top-level values being disconnected\n * on a clear; doing this bookkeeping lower in the tree is wasteful since it's\n * all being thrown away.\n *\n * Example 3: If the LitElement containing the entire tree above becomes\n * disconnected, it will run `childPart.setConnected()` (which calls\n * `childPart._$notifyConnectionChanged()` if it exists); in this case, we\n * recursively run `setConnected()` over the entire tree, without removing any\n * children from `_$disconnectableChildren`, since this tree is required to\n * re-connect the tree, which does the same operation, simply passing\n * `isConnected: true` down the tree, signaling which callback to run.\n */\n\nimport {AttributePart, ChildPart, Disconnectable, Part} from './lit-html.js';\nimport {isSingleExpression} from './directive-helpers.js';\nimport {Directive, PartInfo, PartType} from './directive.js';\nexport * from './directive.js';\n\nconst DEV_MODE = true;\n\n/**\n * Recursively walks down the tree of Parts/TemplateInstances/Directives to set\n * the connected state of directives and run `disconnected`/ `reconnected`\n * callbacks.\n *\n * @return True if there were children to disconnect; false otherwise\n */\nconst notifyChildrenConnectedChanged = (\n parent: Disconnectable,\n isConnected: boolean\n): boolean => {\n const children = parent._$disconnectableChildren;\n if (children === undefined) {\n return false;\n }\n for (const obj of children) {\n // The existence of `_$notifyDirectiveConnectionChanged` is used as a \"brand\" to\n // disambiguate AsyncDirectives from other DisconnectableChildren\n // (as opposed to using an instanceof check to know when to call it); the\n // redundancy of \"Directive\" in the API name is to avoid conflicting with\n // `_$notifyConnectionChanged`, which exists `ChildParts` which are also in\n // this list\n // Disconnect Directive (and any nested directives contained within)\n // This property needs to remain unminified.\n (obj as AsyncDirective)['_$notifyDirectiveConnectionChanged']?.(\n isConnected,\n false\n );\n // Disconnect Part/TemplateInstance\n notifyChildrenConnectedChanged(obj, isConnected);\n }\n return true;\n};\n\n/**\n * Removes the given child from its parent list of disconnectable children, and\n * if the parent list becomes empty as a result, removes the parent from its\n * parent, and so forth up the tree when that causes subsequent parent lists to\n * become empty.\n */\nconst removeDisconnectableFromParent = (obj: Disconnectable) => {\n let parent, children;\n do {\n if ((parent = obj._$parent) === undefined) {\n break;\n }\n children = parent._$disconnectableChildren!;\n children.delete(obj);\n obj = parent;\n } while (children?.size === 0);\n};\n\nconst addDisconnectableToParent = (obj: Disconnectable) => {\n // Climb the parent tree, creating a sparse tree of children needing\n // disconnection\n for (let parent; (parent = obj._$parent); obj = parent) {\n let children = parent._$disconnectableChildren;\n if (children === undefined) {\n parent._$disconnectableChildren = children = new Set();\n } else if (children.has(obj)) {\n // Once we've reached a parent that already contains this child, we\n // can short-circuit\n break;\n }\n children.add(obj);\n installDisconnectAPI(parent);\n }\n};\n\n/**\n * Changes the parent reference of the ChildPart, and updates the sparse tree of\n * Disconnectable children accordingly.\n *\n * Note, this method will be patched onto ChildPart instances and called from\n * the core code when parts are moved between different parents.\n */\nfunction reparentDisconnectables(this: ChildPart, newParent: Disconnectable) {\n if (this._$disconnectableChildren !== undefined) {\n removeDisconnectableFromParent(this);\n this._$parent = newParent;\n addDisconnectableToParent(this);\n } else {\n this._$parent = newParent;\n }\n}\n\n/**\n * Sets the connected state on any directives contained within the committed\n * value of this part (i.e. within a TemplateInstance or iterable of\n * ChildParts) and runs their `disconnected`/`reconnected`s, as well as within\n * any directives stored on the ChildPart (when `valueOnly` is false).\n *\n * `isClearingValue` should be passed as `true` on a top-level part that is\n * clearing itself, and not as a result of recursively disconnecting directives\n * as part of a `clear` operation higher up the tree. This both ensures that any\n * directive on this ChildPart that produced a value that caused the clear\n * operation is not disconnected, and also serves as a performance optimization\n * to avoid needless bookkeeping when a subtree is going away; when clearing a\n * subtree, only the top-most part need to remove itself from the parent.\n *\n * `fromPartIndex` is passed only in the case of a partial `_clear` running as a\n * result of truncating an iterable.\n *\n * Note, this method will be patched onto ChildPart instances and called from the\n * core code when parts are cleared or the connection state is changed by the\n * user.\n */\nfunction notifyChildPartConnectedChanged(\n this: ChildPart,\n isConnected: boolean,\n isClearingValue = false,\n fromPartIndex = 0\n) {\n const value = this._$committedValue;\n const children = this._$disconnectableChildren;\n if (children === undefined || children.size === 0) {\n return;\n }\n if (isClearingValue) {\n if (Array.isArray(value)) {\n // Iterable case: Any ChildParts created by the iterable should be\n // disconnected and removed from this ChildPart's disconnectable\n // children (starting at `fromPartIndex` in the case of truncation)\n for (let i = fromPartIndex; i < value.length; i++) {\n notifyChildrenConnectedChanged(value[i], false);\n removeDisconnectableFromParent(value[i]);\n }\n } else if (value != null) {\n // TemplateInstance case: If the value has disconnectable children (will\n // only be in the case that it is a TemplateInstance), we disconnect it\n // and remove it from this ChildPart's disconnectable children\n notifyChildrenConnectedChanged(value as Disconnectable, false);\n removeDisconnectableFromParent(value as Disconnectable);\n }\n } else {\n notifyChildrenConnectedChanged(this, isConnected);\n }\n}\n\n/**\n * Patches disconnection API onto ChildParts.\n */\nconst installDisconnectAPI = (obj: Disconnectable) => {\n if ((obj as ChildPart).type == PartType.CHILD) {\n (obj as ChildPart)._$notifyConnectionChanged ??=\n notifyChildPartConnectedChanged;\n (obj as ChildPart)._$reparentDisconnectables ??= reparentDisconnectables;\n }\n};\n\n/**\n * An abstract `Directive` base class whose `disconnected` method will be\n * called when the part containing the directive is cleared as a result of\n * re-rendering, or when the user calls `part.setConnected(false)` on\n * a part that was previously rendered containing the directive (as happens\n * when e.g. a LitElement disconnects from the DOM).\n *\n * If `part.setConnected(true)` is subsequently called on a\n * containing part, the directive's `reconnected` method will be called prior\n * to its next `update`/`render` callbacks. When implementing `disconnected`,\n * `reconnected` should also be implemented to be compatible with reconnection.\n *\n * Note that updates may occur while the directive is disconnected. As such,\n * directives should generally check the `this.isConnected` flag during\n * render/update to determine whether it is safe to subscribe to resources\n * that may prevent garbage collection.\n */\nexport abstract class AsyncDirective extends Directive {\n // As opposed to other Disconnectables, AsyncDirectives always get notified\n // when the RootPart connection changes, so the public `isConnected`\n // is a locally stored variable initialized via its part's getter and synced\n // via `_$notifyDirectiveConnectionChanged`. This is cheaper than using\n // the _$isConnected getter, which has to look back up the tree each time.\n /**\n * The connection state for this Directive.\n */\n isConnected!: boolean;\n\n // @internal\n override _$disconnectableChildren?: Set<Disconnectable> = undefined;\n /**\n * Initialize the part with internal fields\n * @param part\n * @param parent\n * @param attributeIndex\n */\n override _$initialize(\n part: Part,\n parent: Disconnectable,\n attributeIndex: number | undefined\n ) {\n super._$initialize(part, parent, attributeIndex);\n addDisconnectableToParent(this);\n this.isConnected = part._$isConnected;\n }\n // This property needs to remain unminified.\n /**\n * Called from the core code when a directive is going away from a part (in\n * which case `shouldRemoveFromParent` should be true), and from the\n * `setChildrenConnected` helper function when recursively changing the\n * connection state of a tree (in which case `shouldRemoveFromParent` should\n * be false).\n *\n * @param isConnected\n * @param isClearingDirective - True when the directive itself is being\n * removed; false when the tree is being disconnected\n * @internal\n */\n override ['_$notifyDirectiveConnectionChanged'](\n isConnected: boolean,\n isClearingDirective = true\n ) {\n if (isConnected !== this.isConnected) {\n this.isConnected = isConnected;\n if (isConnected) {\n this.reconnected?.();\n } else {\n this.disconnected?.();\n }\n }\n if (isClearingDirective) {\n notifyChildrenConnectedChanged(this, isConnected);\n removeDisconnectableFromParent(this);\n }\n }\n\n /**\n * Sets the value of the directive's Part outside the normal `update`/`render`\n * lifecycle of a directive.\n *\n * This method should not be called synchronously from a directive's `update`\n * or `render`.\n *\n * @param directive The directive to update\n * @param value The value to set\n */\n setValue(value: unknown) {\n if (isSingleExpression(this.__part as unknown as PartInfo)) {\n this.__part._$setValue(value, this);\n } else {\n // this.__attributeIndex will be defined in this case, but\n // assert it in dev mode\n if (DEV_MODE && this.__attributeIndex === undefined) {\n throw new Error(`Expected this.__attributeIndex to be a number`);\n }\n const newValues = [...(this.__part._$committedValue as Array<unknown>)];\n newValues[this.__attributeIndex!] = value;\n (this.__part as AttributePart)._$setValue(newValues, this, 0);\n }\n }\n\n /**\n * User callbacks for implementing logic to release any resources/subscriptions\n * that may have been retained by this directive. Since directives may also be\n * re-connected, `reconnected` should also be implemented to restore the\n * working state of the directive prior to the next render.\n */\n protected disconnected() {}\n protected reconnected() {}\n}\n"],"mappings":";;;;;AAsBA,IAAA,EAAOA,GAAYC,EAAAA,IAAaC;AAAhC,IAkBaC,IAAeC,CAAAA,OAChB,SAAVA,MAAmC,YAAA,OAATA,MAAqC,cAAA,OAATA;AAnBxD,IAiFaC,IAAsBC,CAAAA,OAAAA,WAChCA,GAA2BC;AAlF9B,IAoFMC,IAAe,MAAMC,SAASC,cAAc,EAAA;AApFlD,IAkGaC,IAAa,CACxBC,IACAC,IACAP,OAAAA;AAEA,QA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AC1B3B,MAAK2B,KAAOC,KAAWxB,IAAOJ,IAAAA;SACzB;AAML,YAAM6B,KAAY,CAAA,GAAK7B,KAAK2B,KAAOtB,IAAAA;AACnCwB,MAAAA,GAAU7B,KAAK8B,IAAAA,IAAqB1B,IACnCJ,KAAK2B,KAAyBC,KAAWC,IAAW7B,MAAM,CAAA;IAC5D;EACF;EAQS,eAAAyB;EAAiB;EACjB,cAAAD;EAAgB;AAAA;","names":["_ChildPart","ChildPart","_$LH","isPrimitive","value","isSingleExpression","part","strings","createMarker","document","createComment","insertPart","containerPart","refPart","container","_$startNode","parentNode","refNode","_$endNode","startNode","insertBefore","endNode","ChildPart","options","nextSibling","oldParent","_$parent","parentChanged","newConnectionState","_$reparentDisconnectables","_$notifyConnectionChanged","_$isConnected","start","n","setChildPartValue","value","directiveParent","_$setValue","RESET_VALUE","setCommittedValue","_$committedValue","getCommittedValue","removePart","_$clear","remove","PartType","ATTRIBUTE","CHILD","PROPERTY","BOOLEAN_ATTRIBUTE","EVENT","ELEMENT","directive","c","values","_$litDirective$","Directive","_partInfo","_$isConnected","this","_$parent","part","parent","attributeIndex","__part","__attributeIndex","props","update","_part","render","notifyChildrenConnectedChanged","parent","isConnected","children","_$disconnectableChildren","obj","removeDisconnectableFromParent","_$parent","delete","size","addDisconnectableToParent","Set","has","add","installDisconnectAPI","reparentDisconnectables","newParent","this","notifyChildPartConnectedChanged","isClearingValue","fromPartIndex","value","_$committedValue","Array","isArray","i","length","type","PartType","CHILD","_$notifyConnectionChanged","_$reparentDisconnectables","AsyncDirective","Directive","constructor","part","attributeIndex","super","_$initialize","_$isConnected","isClearingDirective","reconnected","disconnected","isSingleExpression","__part","_$setValue","newValues","__attributeIndex"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//
|
|
1
|
+
// ../qti-transformers/src/qti-transformers.ts
|
|
2
2
|
var xml = String.raw;
|
|
3
3
|
var xmlToHTML = xml`<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
|
4
4
|
<xsl:output method="html" version="5.0" encoding="UTF-8" indent="yes" />
|
|
@@ -142,10 +142,11 @@ function getShuffleQuerySelectorByTagName(tagName) {
|
|
|
142
142
|
case "qti-associate-interaction":
|
|
143
143
|
return "qti-simple-associable-choice";
|
|
144
144
|
default:
|
|
145
|
+
return null;
|
|
145
146
|
}
|
|
146
147
|
}
|
|
147
148
|
|
|
148
|
-
//
|
|
149
|
+
// ../qti-transformers/src/qti-transform-item.ts
|
|
149
150
|
var qtiTransformItem = (cache = false) => {
|
|
150
151
|
let xmlFragment;
|
|
151
152
|
let xmlUri = "";
|
|
@@ -417,7 +418,7 @@ var qtiTransformItem = (cache = false) => {
|
|
|
417
418
|
return api;
|
|
418
419
|
};
|
|
419
420
|
|
|
420
|
-
//
|
|
421
|
+
// ../qti-transformers/src/qti-transform-manifest.ts
|
|
421
422
|
var qtiTransformManifest = () => {
|
|
422
423
|
let xmlFragment;
|
|
423
424
|
const api = {
|
|
@@ -440,7 +441,7 @@ var qtiTransformManifest = () => {
|
|
|
440
441
|
return api;
|
|
441
442
|
};
|
|
442
443
|
|
|
443
|
-
//
|
|
444
|
+
// ../qti-transformers/src/qti-transform-test.ts
|
|
444
445
|
var qtiTransformTest = () => {
|
|
445
446
|
let xmlFragment;
|
|
446
447
|
const api = {
|
|
@@ -489,4 +490,4 @@ export {
|
|
|
489
490
|
qtiTransformManifest,
|
|
490
491
|
qtiTransformTest
|
|
491
492
|
};
|
|
492
|
-
//# sourceMappingURL=chunk-
|
|
493
|
+
//# sourceMappingURL=chunk-INKI27D5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../qti-transformers/src/qti-transformers.ts","../../qti-transformers/src/qti-transform-item.ts","../../qti-transformers/src/qti-transform-manifest.ts","../../qti-transformers/src/qti-transform-test.ts"],"sourcesContent":["const xml = String.raw;\n\n/* <!-- convert CDATA to comments -->\n <xsl:template match=\"text()[contains(., 'CDATA')]\">\n <xsl:comment>\n <xsl:value-of select=\".\"/>\n </xsl:comment>\n</xsl:template>\n*/\n\n/*\n <!-- remove xml comments -->\n <xsl:template match=\"comment()\" />\n */\n\nconst xmlToHTML = xml`<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">\n<xsl:output method=\"html\" version=\"5.0\" encoding=\"UTF-8\" indent=\"yes\" />\n <xsl:template match=\"@*|node()\">\n <xsl:copy>\n <xsl:apply-templates select=\"@*|node()\"/>\n </xsl:copy>\n </xsl:template>\n\n <!-- remove existing namespaces -->\n <xsl:template match=\"*\">\n <!-- remove element prefix -->\n <xsl:element name=\"{local-name()}\">\n <!-- process attributes -->\n <xsl:for-each select=\"@*\">\n <!-- remove attribute prefix -->\n <xsl:attribute name=\"{local-name()}\">\n <xsl:value-of select=\".\"/>\n </xsl:attribute>\n </xsl:for-each>\n <xsl:apply-templates/>\n </xsl:element>\n</xsl:template>\n</xsl:stylesheet>`;\n\n// Function to extend elements with a specific tag name by adding an extension suffix\nexport function extendElementName(xmlFragment: XMLDocument, tagName: string, extension: string) {\n xmlFragment.querySelectorAll(tagName).forEach(element => {\n const newTagName = `${tagName}-${extension}`;\n const newElement = createElementWithNewTagName(element, newTagName);\n element.replaceWith(newElement);\n });\n}\n\n// Function to extend any element with a specific class pattern (e.g., \"extend:suffix\")\nexport function extendElementsWithClass(xmlFragment: XMLDocument, classNamePattern: string) {\n xmlFragment.querySelectorAll('*').forEach(element => {\n const classList = element.classList;\n if (classList) {\n classList.forEach(className => {\n if (className.startsWith(`${classNamePattern}:`)) {\n const suffix = className.slice(`${classNamePattern}:`.length);\n const newTagName = `${element.nodeName}-${suffix}`;\n const newElement = createElementWithNewTagName(element, newTagName);\n element.replaceWith(newElement);\n }\n });\n }\n });\n}\n\n// Helper function to create a new element with a new tag name and copy attributes and children\nfunction createElementWithNewTagName(element: Element, newTagName: string) {\n // create Elements on the ownerDocument which is usually the XMLDocument\n const newElement = element.ownerDocument.createElement(newTagName);\n // Copy attributes\n for (const attr of element.attributes) {\n newElement.setAttribute(attr.name, attr.value);\n }\n // Copy child nodes\n while (element.firstChild) {\n newElement.appendChild(element.firstChild);\n }\n return newElement;\n}\n\nexport function itemsFromTest(xmlFragment: DocumentFragment) {\n const items: { identifier: string; href: string; category: string }[] = [];\n xmlFragment.querySelectorAll('qti-assessment-item-ref').forEach(el => {\n const identifier = el.getAttribute('identifier');\n const href = el.getAttribute('href');\n const category = el.getAttribute('category');\n items.push({ identifier, href, category });\n });\n return items;\n}\n\n// let currentRequest: XMLHttpRequest | null = null;\n\nexport function loadXML(url: string, signal?: AbortSignal): Promise<XMLDocument | null> {\n return fetch(url, { signal })\n .then(response => {\n if (!response.ok) {\n throw new Error(`HTTP error! status: ${response.status}`);\n }\n return response.text();\n })\n .then(text => {\n const parser = new DOMParser();\n return parser.parseFromString(text, 'text/xml');\n })\n .catch(error => {\n if (error.name === 'AbortError') {\n throw error;\n }\n throw new Error(`Failed to load XML: ${error.message}`);\n });\n}\n\nexport function parseXML(xmlDocument: string) {\n const parser = new DOMParser();\n const xmlFragment = parser.parseFromString(xmlDocument, 'text/xml');\n return xmlFragment;\n}\n\nexport function toHTML(xmlFragment: Document): DocumentFragment {\n const processor = new XSLTProcessor();\n const xsltDocument = new DOMParser().parseFromString(xmlToHTML, 'text/xml');\n processor.importStylesheet(xsltDocument);\n const itemHTMLFragment = processor.transformToFragment(xmlFragment, document);\n return itemHTMLFragment;\n}\n\nexport function setLocation(xmlFragment: DocumentFragment, location: string) {\n if (!location.endsWith('/')) {\n location += '/';\n }\n\n xmlFragment.querySelectorAll('[src],[href],[primary-path]').forEach(elWithSrc => {\n let attr: 'src' | 'href' | 'primary-path' | '' = '';\n\n if (elWithSrc.getAttribute('src')) {\n attr = 'src';\n }\n if (elWithSrc.getAttribute('href')) {\n attr = 'href';\n }\n if (elWithSrc.getAttribute('primary-path')) {\n attr = 'primary-path';\n }\n const attrValue = elWithSrc.getAttribute(attr)?.trim();\n\n if (!/^(data:|https?:|blob:)/.test(attrValue)) {\n const newSrcValue = location + encodeURI(attrValue);\n elWithSrc.setAttribute(attr, newSrcValue);\n }\n });\n}\n\nexport function convertCDATAtoComment(xmlFragment: DocumentFragment) {\n const cdataElements = xmlFragment.querySelectorAll('qti-custom-operator[class=\"js.org\"] > qti-base-value');\n cdataElements.forEach(element => {\n const commentText = document.createComment(element.textContent);\n element.replaceChild(commentText, element.firstChild);\n });\n}\n\nexport function stripStyleSheets(xmlFragment: DocumentFragment) {\n // remove qti-stylesheet tag\n xmlFragment.querySelectorAll('qti-stylesheet').forEach(stylesheet => stylesheet.remove());\n}\n\nexport function getShuffleQuerySelectorByTagName(tagName: string): string | string[] | null {\n switch (tagName) {\n case 'qti-choice-interaction':\n case 'qti-order-interaction':\n return 'qti-simple-choice';\n case 'qti-inline-choice-interaction':\n return 'qti-inline-choice';\n case 'qti-match-interaction':\n return [\n 'qti-simple-match-set:first-of-type qti-simple-associable-choice',\n 'qti-simple-match-set:last-of-type > qti-simple-associable-choice'\n ];\n case 'qti-gap-match-interaction':\n return 'qti-gap-text';\n case 'qti-associate-interaction':\n return 'qti-simple-associable-choice';\n default:\n return null;\n }\n}\n","/**\n * Browser based QTI-XML to HTML transformer.\n * Returns an object with methods to load, parse, transform and serialize QTI XML items.\n * @returns An object with methods to load, parse, transform and serialize QTI XML items.\n * @example\n * const qtiTransformer = qtiTransformItem();\n * await qtiTransformer.load('path/to/xml/file.xml');\n * qtiTransformer.path('/assessmentItem/itemBody');\n * const html = qtiTransformer.html();\n * const xml = qtiTransformer.xml();\n * const htmldoc = qtiTransformer.htmldoc();\n * const xmldoc = qtiTransformer.xmldoc();\n *\n * qtiTransformItem().parse(storyXML).html()\n */\nimport {\n convertCDATAtoComment,\n extendElementName,\n extendElementsWithClass,\n getShuffleQuerySelectorByTagName,\n loadXML,\n parseXML,\n setLocation,\n stripStyleSheets,\n toHTML\n} from './qti-transformers';\n\n// Type definition for module resolution config\nexport interface ModuleResolutionConfig {\n waitSeconds?: number;\n context?: string;\n catchError?: boolean;\n urlArgs?: string;\n paths: {\n [key: string]: string | string[];\n };\n shim?: {\n [key: string]: {\n deps?: string[]; // Array of dependencies\n exports?: string; // The global variable to use as the module's value\n };\n };\n}\n\nexport type transformItemApi = {\n load: (uri: string, signal?: AbortSignal) => Promise<transformItemApi>;\n parse: (xmlString: string) => transformItemApi;\n path: (location: string) => transformItemApi;\n fn: (fn: (xmlFragment: XMLDocument) => void) => transformItemApi;\n pciHooks: (uri: string) => transformItemApi;\n configurePci: (\n baseUrl: string,\n getModuleResolutionConfig: (baseUrl: string, fileUrl: string) => Promise<ModuleResolutionConfig>,\n selector?: string\n ) => Promise<transformItemApi>;\n extendElementName: (elementName: string, extend: string) => transformItemApi;\n extendElementsWithClass: (param?: string) => transformItemApi;\n customInteraction: (baseRef: string, baseItem: string) => transformItemApi;\n convertCDATAtoComment: () => transformItemApi;\n shuffleInteractions: () => transformItemApi;\n stripStyleSheets: () => transformItemApi;\n html: () => string;\n xml: () => string;\n htmlDoc: () => DocumentFragment;\n xmlDoc: () => XMLDocument;\n};\n\nexport const qtiTransformItem = (cache: boolean = false) => {\n let xmlFragment: XMLDocument;\n let xmlUri = '';\n\n const api: transformItemApi = {\n load(uri: string, signal?: AbortSignal) {\n xmlUri = uri;\n const fullKey = encodeURI(uri);\n if (cache) {\n if (sessionStorage.getItem(fullKey)) {\n return Promise.resolve(api.parse(sessionStorage.getItem(fullKey)!));\n }\n }\n return loadXML(uri, signal).then(xml => {\n xmlFragment = xml;\n api.shuffleInteractions();\n if (cache) sessionStorage.setItem(fullKey, new XMLSerializer().serializeToString(xmlFragment));\n return api;\n });\n },\n parse(xmlString: string): typeof api {\n xmlFragment = parseXML(xmlString);\n return api;\n },\n path: (location: string): typeof api => {\n setLocation(xmlFragment, location);\n xmlUri = null;\n return api;\n },\n fn(fn: (xmlFragment: XMLDocument) => void): typeof api {\n fn(xmlFragment);\n return api;\n },\n pciHooks(uri: string): typeof api {\n const attributes = ['hook', 'module'];\n const documentPath = uri.substring(0, uri.lastIndexOf('/'));\n for (const attribute of attributes) {\n const srcAttributes = xmlFragment.querySelectorAll('[' + attribute + ']');\n srcAttributes.forEach(node => {\n const srcValue = node.getAttribute(attribute)!;\n if (!srcValue.startsWith('data:') && !srcValue.startsWith('http')) {\n // Just paste the relative path of the src location after the documentrootPath\n // old pcis can have a .js, new pci's don't\n node.setAttribute('base-url', uri);\n node.setAttribute(\n 'module',\n documentPath + '/' + encodeURI(srcValue + (srcValue.endsWith('.js') ? '' : '.js'))\n );\n }\n });\n }\n return api;\n },\n async configurePci(\n baseUrl: string,\n getModuleResolutionConfig: (baseUrl: string, fileUrl: string) => Promise<ModuleResolutionConfig>,\n selector = 'qti-portable-custom-interaction'\n ): Promise<typeof api> {\n const customInteractionTypeIdentifiers: string[] = [];\n const portableCustomInteractions = xmlFragment.querySelectorAll(selector);\n\n const moduleResolutionConfig = await getModuleResolutionConfig(baseUrl, '/modules/module_resolution.js');\n const moduleResolutionFallbackConfig = await getModuleResolutionConfig(\n baseUrl,\n '/modules/fallback_module_resolution.js'\n );\n\n if (portableCustomInteractions.length > 0) {\n for (const interaction of Array.from(portableCustomInteractions)) {\n // set data-base-url\n interaction.setAttribute('data-base-url', baseUrl);\n\n let customInteractionTypeIdentifier = interaction.getAttribute('custom-interaction-type-identifier');\n if (\n customInteractionTypeIdentifier &&\n customInteractionTypeIdentifiers.includes(customInteractionTypeIdentifier)\n ) {\n customInteractionTypeIdentifier = customInteractionTypeIdentifier + customInteractionTypeIdentifiers.length;\n interaction.setAttribute('custom-interaction-type-identifier', customInteractionTypeIdentifier);\n customInteractionTypeIdentifiers.push(customInteractionTypeIdentifier);\n }\n if (customInteractionTypeIdentifier) {\n customInteractionTypeIdentifiers.push(customInteractionTypeIdentifier);\n }\n\n // Check if qti-interaction-modules already exists\n let modulesElement = interaction.querySelector('qti-interaction-modules');\n\n // If it exists and has primary-configuration, handle that format\n if (modulesElement && modulesElement.getAttribute('primary-configuration')) {\n const primaryConfigPath = modulesElement.getAttribute('primary-configuration');\n if (primaryConfigPath) {\n try {\n // Load the primary configuration\n const primaryConfig = await getModuleResolutionConfig(baseUrl, `/${primaryConfigPath}`);\n\n // Get existing module elements that only have id attributes\n const existingModules = Array.from(modulesElement.querySelectorAll('qti-interaction-module'));\n\n // Update existing modules with paths from config\n for (const moduleEl of existingModules) {\n const moduleId = moduleEl.getAttribute('id');\n if (moduleId && primaryConfig.paths && primaryConfig.paths[moduleId]) {\n const primaryPath = primaryConfig.paths[moduleId];\n const primaryPathString = Array.isArray(primaryPath) ? primaryPath[0] : primaryPath;\n moduleEl.setAttribute('primary-path', primaryPathString);\n\n // Check for fallback path\n if (\n moduleResolutionFallbackConfig &&\n moduleResolutionFallbackConfig.paths &&\n moduleResolutionFallbackConfig.paths[moduleId]\n ) {\n const fallbackPath = moduleResolutionFallbackConfig.paths[moduleId];\n if (Array.isArray(fallbackPath)) {\n moduleEl.setAttribute('fallback-path', fallbackPath[0]);\n } else {\n moduleEl.setAttribute('fallback-path', fallbackPath);\n }\n }\n }\n }\n\n // Add any additional modules from primary config that aren't already present\n if (primaryConfig.paths) {\n for (const moduleId in primaryConfig.paths) {\n const existingModule = modulesElement.querySelector(`qti-interaction-module[id=\"${moduleId}\"]`);\n if (!existingModule) {\n const newModuleElement = xmlFragment.createElement('qti-interaction-module');\n newModuleElement.setAttribute('id', moduleId);\n const primaryPathString = Array.isArray(primaryConfig.paths[moduleId])\n ? primaryConfig.paths[moduleId][0]\n : primaryConfig.paths[moduleId];\n newModuleElement.setAttribute('primary-path', primaryPathString);\n\n // Check for fallback path\n if (\n moduleResolutionFallbackConfig &&\n moduleResolutionFallbackConfig.paths &&\n moduleResolutionFallbackConfig.paths[moduleId]\n ) {\n const fallbackPath = moduleResolutionFallbackConfig.paths[moduleId];\n if (Array.isArray(fallbackPath)) {\n newModuleElement.setAttribute('fallback-path', fallbackPath[0]);\n } else {\n newModuleElement.setAttribute('fallback-path', fallbackPath);\n }\n }\n\n modulesElement.appendChild(newModuleElement);\n }\n }\n }\n\n // Apply urlArgs if present in config\n if (primaryConfig.urlArgs) {\n modulesElement.setAttribute('url-args', primaryConfig.urlArgs);\n }\n } catch (error) {\n console.warn(`Failed to load primary configuration: ${primaryConfigPath}`, error);\n }\n }\n } else {\n // Original logic for when there's no existing qti-interaction-modules or no primary-configuration\n if (moduleResolutionConfig) {\n // Create qti-interaction-modules if it doesn't exist\n if (interaction.querySelector('qti-interaction-modules') === null) {\n modulesElement = xmlFragment.createElement('qti-interaction-modules');\n interaction.appendChild(modulesElement);\n } else {\n modulesElement = interaction.querySelector('qti-interaction-modules');\n }\n\n for (const module in moduleResolutionConfig.paths) {\n const path = moduleResolutionConfig.paths[module];\n let fallbackPath: string | string[] = '';\n\n if (\n moduleResolutionFallbackConfig &&\n moduleResolutionFallbackConfig.paths &&\n moduleResolutionFallbackConfig.paths[module]\n ) {\n fallbackPath = moduleResolutionFallbackConfig.paths[module];\n }\n\n const primaryArray = Array.isArray(path) ? path : [path];\n const fallbackPathArray = Array.isArray(fallbackPath) ? fallbackPath : [fallbackPath];\n\n // create an array with primary and fallback paths.\n const paths = primaryArray.map((primaryPath, i) => {\n const fallbackPath = fallbackPathArray.length > i ? fallbackPathArray[i] : '';\n return {\n primaryPath,\n fallbackPath\n };\n });\n\n // check if all fallbackPath elements are in the array: paths, otherwise add\n for (const fallbackPath of fallbackPathArray) {\n if (!paths.some(p => p.fallbackPath === fallbackPath)) {\n paths.push({\n primaryPath: primaryArray.length > 0 ? primaryArray[0] : fallbackPath,\n fallbackPath\n });\n }\n }\n\n // add the paths to the qti-interaction-modules\n for (const path of paths) {\n const moduleElement = xmlFragment.createElement('qti-interaction-module');\n if (path.fallbackPath) {\n moduleElement.setAttribute('fallback-path', path.fallbackPath);\n }\n moduleElement.setAttribute('id', module);\n moduleElement.setAttribute('primary-path', path.primaryPath);\n\n if (modulesElement) {\n modulesElement.appendChild(moduleElement);\n }\n }\n }\n }\n }\n }\n }\n\n return api;\n },\n shuffleInteractions(): typeof api {\n const shuffleElements = xmlFragment.querySelectorAll(`[shuffle=\"true\"]`);\n const shuffleInteractions = Array.from(shuffleElements).filter(e =>\n e.tagName?.toLowerCase().endsWith('-interaction')\n );\n\n for (const shuffleInteraction of shuffleInteractions) {\n const query = getShuffleQuerySelectorByTagName(shuffleInteraction.tagName.toLowerCase());\n const queries = Array.isArray(query) ? query : [query];\n\n for (const q of queries) {\n const choices = Array.from(shuffleInteraction.querySelectorAll(q)) as HTMLElement[];\n\n const fixedChoices = choices\n .map((choice, originalOrder) => ({\n element: choice,\n fixed: choice.hasAttribute('fixed') && choice.getAttribute('fixed') === 'true',\n originalOrder\n }))\n .filter(choice => choice.fixed);\n\n const nonFixedChoices = choices.filter(\n choice => !choice.hasAttribute('fixed') || choice.getAttribute('fixed') !== 'true'\n );\n\n if (nonFixedChoices.length <= 1) {\n console.warn('Shuffling is not possible with fewer than 2 non-fixed elements.');\n return api;\n }\n\n const originalOrder = [...nonFixedChoices];\n let shuffled = false;\n let attempts = 0;\n\n while (!shuffled && attempts < 20) {\n attempts++;\n for (let i = nonFixedChoices.length - 1; i > 0; i--) {\n const j = Math.floor(Math.random() * (i + 1));\n [nonFixedChoices[i], nonFixedChoices[j]] = [nonFixedChoices[j], nonFixedChoices[i]];\n }\n shuffled = !nonFixedChoices.every((choice, index) => choice === originalOrder[index]);\n }\n\n if (!shuffled) {\n console.warn('Failed to shuffle the choices after multiple attempts.');\n return null;\n }\n\n // Remove the shuffle attribute\n shuffleInteraction.removeAttribute('shuffle');\n\n // Reorder the elements in the DOM\n let nonFixedIndex = 0;\n for (const nonFixedChoice of nonFixedChoices) {\n nonFixedChoice.parentElement.insertBefore(nonFixedChoice, fixedChoices[nonFixedIndex]?.element);\n nonFixedIndex++;\n }\n for (const fixedChoice of fixedChoices) {\n fixedChoice.element.parentElement.insertBefore(\n fixedChoice.element,\n nonFixedChoices[fixedChoice.originalOrder]\n );\n }\n }\n }\n\n return api;\n },\n extendElementName: (tagName: string, extension: string): typeof api => {\n extendElementName(xmlFragment, tagName, extension);\n return api;\n },\n extendElementsWithClass: (param: string = 'extend'): typeof api => {\n extendElementsWithClass(xmlFragment, param);\n return api;\n },\n customInteraction(baseRef: string, baseItem: string): typeof api {\n const qtiCustomInteraction = xmlFragment.querySelector('qti-custom-interaction');\n const qtiCustomInteractionObject = qtiCustomInteraction.querySelector('object');\n\n qtiCustomInteraction.setAttribute('data-base-ref', baseRef);\n qtiCustomInteraction.setAttribute('data-base-item', baseRef + baseItem);\n qtiCustomInteraction.setAttribute('data', qtiCustomInteractionObject.getAttribute('data'));\n qtiCustomInteraction.setAttribute('width', qtiCustomInteractionObject.getAttribute('width'));\n qtiCustomInteraction.setAttribute('height', qtiCustomInteractionObject.getAttribute('height'));\n\n qtiCustomInteraction.removeChild(qtiCustomInteractionObject);\n return api;\n },\n convertCDATAtoComment(): typeof api {\n convertCDATAtoComment(xmlFragment);\n return api;\n },\n stripStyleSheets(): typeof api {\n stripStyleSheets(xmlFragment);\n return api;\n },\n html() {\n if (xmlUri !== null) {\n setLocation(xmlFragment, xmlUri.substring(0, xmlUri.lastIndexOf('/')));\n }\n return new XMLSerializer().serializeToString(toHTML(xmlFragment));\n },\n xml(): string {\n return new XMLSerializer().serializeToString(xmlFragment);\n },\n htmlDoc() {\n if (xmlUri !== null) {\n setLocation(xmlFragment, xmlUri.substring(0, xmlUri.lastIndexOf('/')));\n }\n return toHTML(xmlFragment);\n },\n xmlDoc(): XMLDocument {\n return xmlFragment; // new XMLSerializer().serializeToString(xmlFragment);\n }\n };\n return api;\n};\n","import { loadXML, parseXML } from './qti-transformers';\n\nexport const qtiTransformManifest = (): {\n load: (uri: string, signal?: AbortSignal) => Promise<typeof api>;\n assessmentTest: () => { href: string; identifier: string };\n} => {\n let xmlFragment: XMLDocument;\n\n const api = {\n async load(uri: string, signal: AbortSignal) {\n return new Promise<typeof api>(resolve => {\n loadXML(uri, signal).then(xml => {\n xmlFragment = xml;\n return resolve(api);\n });\n });\n },\n parse(xmlString: string) {\n xmlFragment = parseXML(xmlString);\n },\n assessmentTest() {\n const el = xmlFragment.querySelector('resource[type=\"imsqti_test_xmlv3p0\"]');\n return { href: el.getAttribute('href'), identifier: el.getAttribute('identifier') };\n }\n };\n return api;\n};\n","/**\n * Returns an object with methods to load, parse and transform QTI tests.\n * @returns An object with methods to load, parse and transform QTI tests.\n * @example\n * const qtiTransformer = qtiTransformTest();\n * await qtiTransformer.load('https://example.com/test.xml');\n * const items = qtiTransformer.items();\n * const html = qtiTransformer.html();\n * const xml = qtiTransformer.xml();\n */\n\nimport { itemsFromTest, loadXML, parseXML, setLocation, toHTML } from './qti-transformers';\n\nexport type transformTestApi = {\n load: (uri: string, signal?: AbortSignal) => Promise<transformTestApi>;\n parse: (xmlString: string) => transformTestApi;\n path: (location: string) => transformTestApi;\n fn: (fn: (xmlFragment: XMLDocument) => void) => transformTestApi;\n items: () => { identifier: string; href: string; category: string }[];\n html: () => string;\n xml: () => string;\n htmlDoc: () => DocumentFragment;\n xmlDoc: () => XMLDocument;\n};\n\nexport const qtiTransformTest = (): transformTestApi => {\n let xmlFragment: XMLDocument;\n\n const api: transformTestApi = {\n async load(uri, signal) {\n return new Promise<transformTestApi>((resolve, _) => {\n loadXML(uri, signal).then(xml => {\n xmlFragment = xml;\n\n api.path(uri.substring(0, uri.lastIndexOf('/')));\n return resolve(api);\n });\n });\n },\n parse(xmlString: string) {\n xmlFragment = parseXML(xmlString);\n return api;\n },\n path: (location: string): typeof api => {\n setLocation(xmlFragment, location);\n return api;\n },\n fn(fn: (xmlFragment: XMLDocument) => void) {\n fn(xmlFragment);\n return api;\n },\n items() {\n return itemsFromTest(xmlFragment);\n },\n html() {\n return new XMLSerializer().serializeToString(toHTML(xmlFragment));\n },\n xml(): string {\n return new XMLSerializer().serializeToString(xmlFragment);\n },\n htmlDoc() {\n return toHTML(xmlFragment);\n },\n xmlDoc(): XMLDocument {\n return xmlFragment;\n }\n };\n return api;\n};\n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