@citolab/qti-components 7.5.2 → 7.6.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 +101 -101
- package/custom-elements.json +178 -1
- package/dist/chunks/{chunk-K47QFOQX.js → chunk-2WTHXWS3.js} +38 -1
- package/dist/chunks/chunk-2WTHXWS3.js.map +1 -0
- package/dist/chunks/{chunk-UVKOJQ52.js → chunk-FQWMCONA.js} +4 -4
- package/dist/chunks/{chunk-7RW7LCEJ.js → chunk-G7ZPPP7O.js} +6 -37
- package/dist/chunks/chunk-G7ZPPP7O.js.map +1 -0
- package/dist/chunks/{chunk-4BDOB6KY.js → chunk-GG4NR5OR.js} +1 -1
- package/dist/index.js +10 -10
- package/dist/qti-components/index.js +2 -2
- package/dist/qti-item/index.js +1 -1
- package/dist/qti-test/index.js +2 -2
- package/package.json +13 -18
- package/dist/chunks/chunk-7RW7LCEJ.js.map +0 -1
- package/dist/chunks/chunk-K47QFOQX.js.map +0 -1
- package/dist/custom-elements.json +0 -29837
- /package/dist/chunks/{chunk-UVKOJQ52.js.map → chunk-FQWMCONA.js.map} +0 -0
- /package/dist/chunks/{chunk-4BDOB6KY.js.map → chunk-GG4NR5OR.js.map} +0 -0
package/custom-elements.json
CHANGED
|
@@ -6501,6 +6501,21 @@
|
|
|
6501
6501
|
"privacy": "private",
|
|
6502
6502
|
"default": "null"
|
|
6503
6503
|
},
|
|
6504
|
+
{
|
|
6505
|
+
"kind": "field",
|
|
6506
|
+
"name": "onMove",
|
|
6507
|
+
"privacy": "private"
|
|
6508
|
+
},
|
|
6509
|
+
{
|
|
6510
|
+
"kind": "field",
|
|
6511
|
+
"name": "onEnd",
|
|
6512
|
+
"privacy": "private"
|
|
6513
|
+
},
|
|
6514
|
+
{
|
|
6515
|
+
"kind": "field",
|
|
6516
|
+
"name": "onCancel",
|
|
6517
|
+
"privacy": "private"
|
|
6518
|
+
},
|
|
6504
6519
|
{
|
|
6505
6520
|
"kind": "field",
|
|
6506
6521
|
"name": "MIN_DRAG_DISTANCE",
|
|
@@ -7978,6 +7993,33 @@
|
|
|
7978
7993
|
"module": "src/lib/qti-components/qti-interaction/internal/drag-drop/drag-drop-interaction-mixin.ts"
|
|
7979
7994
|
}
|
|
7980
7995
|
},
|
|
7996
|
+
{
|
|
7997
|
+
"kind": "field",
|
|
7998
|
+
"name": "onMove",
|
|
7999
|
+
"privacy": "private",
|
|
8000
|
+
"inheritedFrom": {
|
|
8001
|
+
"name": "DragDropInteractionMixin",
|
|
8002
|
+
"module": "src/lib/qti-components/qti-interaction/internal/drag-drop/drag-drop-interaction-mixin.ts"
|
|
8003
|
+
}
|
|
8004
|
+
},
|
|
8005
|
+
{
|
|
8006
|
+
"kind": "field",
|
|
8007
|
+
"name": "onEnd",
|
|
8008
|
+
"privacy": "private",
|
|
8009
|
+
"inheritedFrom": {
|
|
8010
|
+
"name": "DragDropInteractionMixin",
|
|
8011
|
+
"module": "src/lib/qti-components/qti-interaction/internal/drag-drop/drag-drop-interaction-mixin.ts"
|
|
8012
|
+
}
|
|
8013
|
+
},
|
|
8014
|
+
{
|
|
8015
|
+
"kind": "field",
|
|
8016
|
+
"name": "onCancel",
|
|
8017
|
+
"privacy": "private",
|
|
8018
|
+
"inheritedFrom": {
|
|
8019
|
+
"name": "DragDropInteractionMixin",
|
|
8020
|
+
"module": "src/lib/qti-components/qti-interaction/internal/drag-drop/drag-drop-interaction-mixin.ts"
|
|
8021
|
+
}
|
|
8022
|
+
},
|
|
7981
8023
|
{
|
|
7982
8024
|
"kind": "field",
|
|
7983
8025
|
"name": "MIN_DRAG_DISTANCE",
|
|
@@ -11051,6 +11093,33 @@
|
|
|
11051
11093
|
"module": "src/lib/qti-components/qti-interaction/internal/drag-drop/drag-drop-interaction-mixin.ts"
|
|
11052
11094
|
}
|
|
11053
11095
|
},
|
|
11096
|
+
{
|
|
11097
|
+
"kind": "field",
|
|
11098
|
+
"name": "onMove",
|
|
11099
|
+
"privacy": "private",
|
|
11100
|
+
"inheritedFrom": {
|
|
11101
|
+
"name": "DragDropInteractionMixin",
|
|
11102
|
+
"module": "src/lib/qti-components/qti-interaction/internal/drag-drop/drag-drop-interaction-mixin.ts"
|
|
11103
|
+
}
|
|
11104
|
+
},
|
|
11105
|
+
{
|
|
11106
|
+
"kind": "field",
|
|
11107
|
+
"name": "onEnd",
|
|
11108
|
+
"privacy": "private",
|
|
11109
|
+
"inheritedFrom": {
|
|
11110
|
+
"name": "DragDropInteractionMixin",
|
|
11111
|
+
"module": "src/lib/qti-components/qti-interaction/internal/drag-drop/drag-drop-interaction-mixin.ts"
|
|
11112
|
+
}
|
|
11113
|
+
},
|
|
11114
|
+
{
|
|
11115
|
+
"kind": "field",
|
|
11116
|
+
"name": "onCancel",
|
|
11117
|
+
"privacy": "private",
|
|
11118
|
+
"inheritedFrom": {
|
|
11119
|
+
"name": "DragDropInteractionMixin",
|
|
11120
|
+
"module": "src/lib/qti-components/qti-interaction/internal/drag-drop/drag-drop-interaction-mixin.ts"
|
|
11121
|
+
}
|
|
11122
|
+
},
|
|
11054
11123
|
{
|
|
11055
11124
|
"kind": "field",
|
|
11056
11125
|
"name": "MIN_DRAG_DISTANCE",
|
|
@@ -13034,6 +13103,33 @@
|
|
|
13034
13103
|
"module": "src/lib/qti-components/qti-interaction/internal/drag-drop/drag-drop-interaction-mixin.ts"
|
|
13035
13104
|
}
|
|
13036
13105
|
},
|
|
13106
|
+
{
|
|
13107
|
+
"kind": "field",
|
|
13108
|
+
"name": "onMove",
|
|
13109
|
+
"privacy": "private",
|
|
13110
|
+
"inheritedFrom": {
|
|
13111
|
+
"name": "DragDropInteractionMixin",
|
|
13112
|
+
"module": "src/lib/qti-components/qti-interaction/internal/drag-drop/drag-drop-interaction-mixin.ts"
|
|
13113
|
+
}
|
|
13114
|
+
},
|
|
13115
|
+
{
|
|
13116
|
+
"kind": "field",
|
|
13117
|
+
"name": "onEnd",
|
|
13118
|
+
"privacy": "private",
|
|
13119
|
+
"inheritedFrom": {
|
|
13120
|
+
"name": "DragDropInteractionMixin",
|
|
13121
|
+
"module": "src/lib/qti-components/qti-interaction/internal/drag-drop/drag-drop-interaction-mixin.ts"
|
|
13122
|
+
}
|
|
13123
|
+
},
|
|
13124
|
+
{
|
|
13125
|
+
"kind": "field",
|
|
13126
|
+
"name": "onCancel",
|
|
13127
|
+
"privacy": "private",
|
|
13128
|
+
"inheritedFrom": {
|
|
13129
|
+
"name": "DragDropInteractionMixin",
|
|
13130
|
+
"module": "src/lib/qti-components/qti-interaction/internal/drag-drop/drag-drop-interaction-mixin.ts"
|
|
13131
|
+
}
|
|
13132
|
+
},
|
|
13037
13133
|
{
|
|
13038
13134
|
"kind": "field",
|
|
13039
13135
|
"name": "MIN_DRAG_DISTANCE",
|
|
@@ -14512,13 +14608,40 @@
|
|
|
14512
14608
|
"description": "",
|
|
14513
14609
|
"name": "QtiHotspotInteraction",
|
|
14514
14610
|
"members": [
|
|
14611
|
+
{
|
|
14612
|
+
"kind": "field",
|
|
14613
|
+
"name": "imageLoadPromise",
|
|
14614
|
+
"type": {
|
|
14615
|
+
"text": "Promise<HTMLImageElement> | null"
|
|
14616
|
+
},
|
|
14617
|
+
"privacy": "private",
|
|
14618
|
+
"default": "null"
|
|
14619
|
+
},
|
|
14620
|
+
{
|
|
14621
|
+
"kind": "method",
|
|
14622
|
+
"name": "getImageLoadPromise",
|
|
14623
|
+
"privacy": "private",
|
|
14624
|
+
"return": {
|
|
14625
|
+
"type": {
|
|
14626
|
+
"text": "Promise<HTMLImageElement>"
|
|
14627
|
+
}
|
|
14628
|
+
},
|
|
14629
|
+
"parameters": [
|
|
14630
|
+
{
|
|
14631
|
+
"name": "img",
|
|
14632
|
+
"type": {
|
|
14633
|
+
"text": "HTMLImageElement"
|
|
14634
|
+
}
|
|
14635
|
+
}
|
|
14636
|
+
]
|
|
14637
|
+
},
|
|
14515
14638
|
{
|
|
14516
14639
|
"kind": "method",
|
|
14517
14640
|
"name": "positionHotspotOnRegister",
|
|
14518
14641
|
"privacy": "private",
|
|
14519
14642
|
"return": {
|
|
14520
14643
|
"type": {
|
|
14521
|
-
"text": "void"
|
|
14644
|
+
"text": "Promise<void>"
|
|
14522
14645
|
}
|
|
14523
14646
|
},
|
|
14524
14647
|
"parameters": [
|
|
@@ -16246,6 +16369,33 @@
|
|
|
16246
16369
|
"module": "src/lib/qti-components/qti-interaction/internal/drag-drop/drag-drop-interaction-mixin.ts"
|
|
16247
16370
|
}
|
|
16248
16371
|
},
|
|
16372
|
+
{
|
|
16373
|
+
"kind": "field",
|
|
16374
|
+
"name": "onMove",
|
|
16375
|
+
"privacy": "private",
|
|
16376
|
+
"inheritedFrom": {
|
|
16377
|
+
"name": "DragDropInteractionMixin",
|
|
16378
|
+
"module": "src/lib/qti-components/qti-interaction/internal/drag-drop/drag-drop-interaction-mixin.ts"
|
|
16379
|
+
}
|
|
16380
|
+
},
|
|
16381
|
+
{
|
|
16382
|
+
"kind": "field",
|
|
16383
|
+
"name": "onEnd",
|
|
16384
|
+
"privacy": "private",
|
|
16385
|
+
"inheritedFrom": {
|
|
16386
|
+
"name": "DragDropInteractionMixin",
|
|
16387
|
+
"module": "src/lib/qti-components/qti-interaction/internal/drag-drop/drag-drop-interaction-mixin.ts"
|
|
16388
|
+
}
|
|
16389
|
+
},
|
|
16390
|
+
{
|
|
16391
|
+
"kind": "field",
|
|
16392
|
+
"name": "onCancel",
|
|
16393
|
+
"privacy": "private",
|
|
16394
|
+
"inheritedFrom": {
|
|
16395
|
+
"name": "DragDropInteractionMixin",
|
|
16396
|
+
"module": "src/lib/qti-components/qti-interaction/internal/drag-drop/drag-drop-interaction-mixin.ts"
|
|
16397
|
+
}
|
|
16398
|
+
},
|
|
16249
16399
|
{
|
|
16250
16400
|
"kind": "field",
|
|
16251
16401
|
"name": "MIN_DRAG_DISTANCE",
|
|
@@ -17579,6 +17729,33 @@
|
|
|
17579
17729
|
"module": "src/lib/qti-components/qti-interaction/internal/drag-drop/drag-drop-interaction-mixin.ts"
|
|
17580
17730
|
}
|
|
17581
17731
|
},
|
|
17732
|
+
{
|
|
17733
|
+
"kind": "field",
|
|
17734
|
+
"name": "onMove",
|
|
17735
|
+
"privacy": "private",
|
|
17736
|
+
"inheritedFrom": {
|
|
17737
|
+
"name": "DragDropInteractionMixin",
|
|
17738
|
+
"module": "src/lib/qti-components/qti-interaction/internal/drag-drop/drag-drop-interaction-mixin.ts"
|
|
17739
|
+
}
|
|
17740
|
+
},
|
|
17741
|
+
{
|
|
17742
|
+
"kind": "field",
|
|
17743
|
+
"name": "onEnd",
|
|
17744
|
+
"privacy": "private",
|
|
17745
|
+
"inheritedFrom": {
|
|
17746
|
+
"name": "DragDropInteractionMixin",
|
|
17747
|
+
"module": "src/lib/qti-components/qti-interaction/internal/drag-drop/drag-drop-interaction-mixin.ts"
|
|
17748
|
+
}
|
|
17749
|
+
},
|
|
17750
|
+
{
|
|
17751
|
+
"kind": "field",
|
|
17752
|
+
"name": "onCancel",
|
|
17753
|
+
"privacy": "private",
|
|
17754
|
+
"inheritedFrom": {
|
|
17755
|
+
"name": "DragDropInteractionMixin",
|
|
17756
|
+
"module": "src/lib/qti-components/qti-interaction/internal/drag-drop/drag-drop-interaction-mixin.ts"
|
|
17757
|
+
}
|
|
17758
|
+
},
|
|
17582
17759
|
{
|
|
17583
17760
|
"kind": "field",
|
|
17584
17761
|
"name": "MIN_DRAG_DISTANCE",
|
|
@@ -166,10 +166,47 @@ QtiModalFeedback = __decorateClass([
|
|
|
166
166
|
customElement("qti-modal-feedback")
|
|
167
167
|
], QtiModalFeedback);
|
|
168
168
|
|
|
169
|
+
// src/lib/decorators/live-query.ts
|
|
170
|
+
function liveQuery(querySelector, _options) {
|
|
171
|
+
let observer;
|
|
172
|
+
return (proto, decoratedFnName) => {
|
|
173
|
+
const { connectedCallback, disconnectedCallback } = proto;
|
|
174
|
+
proto.connectedCallback = function() {
|
|
175
|
+
connectedCallback.call(this);
|
|
176
|
+
const callback = (mutationList) => {
|
|
177
|
+
const elementsToWatch = Array.from(this.querySelectorAll(querySelector)).concat(
|
|
178
|
+
Array.from(this.shadowRoot?.querySelectorAll(querySelector) || [])
|
|
179
|
+
);
|
|
180
|
+
for (const mutation of mutationList) {
|
|
181
|
+
const addedNodes = Array.from(mutation.addedNodes).map((e) => e);
|
|
182
|
+
const removedNodes = Array.from(mutation.addedNodes).map((e) => e);
|
|
183
|
+
if (mutation.type === "childList" && addedNodes.find((n) => elementsToWatch.includes(n))) {
|
|
184
|
+
this[decoratedFnName](addedNodes, removedNodes);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
observer = new MutationObserver(callback);
|
|
189
|
+
observer.observe(this, { childList: true, subtree: true });
|
|
190
|
+
const elementsAdded = Array.from(this.querySelectorAll(querySelector)).concat(
|
|
191
|
+
Array.from(this.shadowRoot?.querySelectorAll(querySelector) || [])
|
|
192
|
+
);
|
|
193
|
+
this[decoratedFnName](Array.from(elementsAdded), []);
|
|
194
|
+
};
|
|
195
|
+
proto.disconnectedCallback = function() {
|
|
196
|
+
disconnectedCallback.call(this);
|
|
197
|
+
observer.disconnect();
|
|
198
|
+
};
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// src/lib/decorators/prop-internal-state.ts
|
|
203
|
+
import { property as property2 } from "lit/decorators.js";
|
|
204
|
+
|
|
169
205
|
export {
|
|
206
|
+
liveQuery,
|
|
170
207
|
convertNumberToUniversalFormat,
|
|
171
208
|
removeDoubleSlashes,
|
|
172
209
|
QtiFeedback,
|
|
173
210
|
QtiModalFeedback
|
|
174
211
|
};
|
|
175
|
-
//# sourceMappingURL=chunk-
|
|
212
|
+
//# sourceMappingURL=chunk-2WTHXWS3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/qti-components/qti-feedback/qti-modal-feedback/qti-modal-feedback.ts","../../src/lib/qti-components/qti-feedback/qti-feedback.ts","../../src/lib/qti-components/internal/utils.ts","../../src/lib/decorators/live-query.ts","../../src/lib/decorators/prop-internal-state.ts"],"sourcesContent":["import { css, html } from 'lit';\nimport { customElement } from 'lit/decorators.js';\n\nimport { QtiFeedback } from '../qti-feedback';\n\n@customElement('qti-modal-feedback')\nexport class QtiModalFeedback extends QtiFeedback {\n static override styles = css`\n .qti-dialog {\n background: var(--qti-bg);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n border-radius: var(--qti-border-radius);\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1000;\n width: auto;\n max-width: 90%;\n }\n\n .button {\n border-radius: var(--qti-border-radius);\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n background-color: var(--qti-bg-active);\n border: var(--qti-border-active);\n cursor: pointer;\n position: relative;\n display: inline-block;\n }\n\n .button:hover {\n background-color: var(--qti-hover-bg);\n }\n\n .button:disabled {\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n cursor: not-allowed;\n }\n\n .button:focus {\n outline: var(--qti-focus-border-width) solid var(--qti-focus-color);\n }\n `;\n\n override render() {\n return html`\n <dialog class=\"qti-dialog\" part=\"feedback\" ?open=\"${this.showStatus === 'on'}\">\n <slot></slot>\n <div style=\"margin-top: var(--qti-gap-size); text-align: center;\">\n <button class=\"button close-button\" @click=\"${this.closeFeedback}\">Close</button>\n </div>\n </dialog>\n `;\n }\n\n openFeedback() {\n const dialog = this.shadowRoot?.querySelector('dialog') as HTMLDialogElement | null;\n if (dialog && !dialog.open) {\n dialog.showModal();\n }\n }\n\n closeFeedback() {\n const dialog = this.shadowRoot?.querySelector('dialog') as HTMLDialogElement | null;\n if (dialog && dialog.open) {\n dialog.close();\n this.showStatus = 'off';\n }\n }\n\n public connectedCallback(): void {\n super.connectedCallback();\n if (this.showStatus === 'on') {\n this.openFeedback();\n }\n }\n\n protected updated(changedProperties: Map<string | number | symbol, unknown>): void {\n if (changedProperties.has('showStatus')) {\n if (this.showStatus === 'on') {\n this.openFeedback();\n } else {\n this.closeFeedback();\n }\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-modal-feedback': QtiModalFeedback;\n }\n}\n","import { consume } from '@lit/context';\nimport { LitElement } from 'lit';\nimport { property, state } from 'lit/decorators.js';\n\nimport { IsNullOrUndefined } from '../internal/utils';\nimport { itemContext } from '../../exports/qti-assessment-item.context';\n\nimport type { ItemContext } from '../../exports/item.context';\n\nexport abstract class QtiFeedback extends LitElement {\n @property({ type: String, attribute: 'show-hide' })\n protected showHide: string;\n\n @property({ type: String, attribute: 'outcome-identifier' })\n public outcomeIdentifier: string;\n\n @property({ type: String })\n protected identifier: string;\n\n @property({ type: String, attribute: false })\n public showStatus: string;\n\n @consume({ context: itemContext, subscribe: true })\n @state()\n private _context?: ItemContext;\n\n public override connectedCallback() {\n super.connectedCallback();\n this.dispatchEvent(\n new CustomEvent<QtiFeedback>('qti-register-feedback', {\n bubbles: true,\n composed: true,\n detail: this\n })\n );\n }\n\n public checkShowFeedback(outcomeIdentifier: string) {\n const outcomeVariable = this._context.variables.find(v => v.identifier === outcomeIdentifier) || null;\n if (this.outcomeIdentifier !== outcomeIdentifier || !outcomeVariable) return;\n let isFound = false;\n if (Array.isArray(outcomeVariable.value)) {\n isFound = outcomeVariable.value.includes(this.identifier);\n } else {\n isFound =\n (!IsNullOrUndefined(this.identifier) &&\n !IsNullOrUndefined(outcomeVariable?.value) &&\n this.identifier === outcomeVariable.value) ||\n false;\n }\n\n this.showFeedback(isFound);\n }\n\n private showFeedback(value: boolean) {\n this.showStatus = (value && this.showHide === 'show') || (!value && this.showHide === 'hide') ? 'on' : 'off';\n }\n}\n","export const decimalSeparator = () => {\n return new Intl.NumberFormat().format(0.1).replace(/\\d/g, '');\n};\n\nexport const convertNumberToUniversalFormat = (number: number | string) => {\n // check if type is string\n if (typeof number === 'string') {\n return number;\n }\n const dSep = decimalSeparator();\n if (dSep === '.') {\n return number.toLocaleString();\n } else {\n return number.toString().replace('.', '').replace(dSep, '.');\n }\n};\n\nexport function IsNullOrUndefined(value: unknown) {\n return value === null || value === undefined;\n}\n\nexport function removeDoubleSlashes(str: string) {\n const singleForwardSlashes = str\n .replace(/([^:]\\/)\\/+/g, '$1')\n .replace(/\\/\\//g, '/')\n .replace('http:/', 'http://')\n .replace('https:/', 'https://');\n return singleForwardSlashes;\n}\n","// @watch decorator\n//\n// Runs when an observed property changes, e.g. @property or @state, but before the component updates.\n//\n// To wait for an update to complete after a change occurs, use `await this.updateComplete` in the handler. To start\n// watching after the initial update/render, use `{ waitUntilFirstUpdate: true }` or `this.hasUpdated` in the handler.\n//\n// Usage:\n//\n// @watch('propName')\n// handlePropChange(oldValue, newValue) {\n// ...\n// }\n\nimport type { LitElement } from 'lit';\n\ntype UpdateHandler = (prev?: unknown, next?: unknown) => void;\n\ntype NonUndefined<A> = A extends undefined ? never : A;\n\ntype UpdateHandlerFunctionKeys<T extends object> = {\n [K in keyof T]-?: NonUndefined<T[K]> extends UpdateHandler ? K : never;\n}[keyof T];\n\ninterface LiveQueryOptions {\n /**\n * If true, will only start watching after the initial update/render\n */\n}\n\nexport function liveQuery(querySelector: string, _options?: LiveQueryOptions) {\n let observer: MutationObserver;\n // const resolvedOptions: Required<LiveQueryOptions> = {\n // ...options\n // };\n return <ElemClass extends LitElement>(\n proto: ElemClass,\n decoratedFnName: UpdateHandlerFunctionKeys<ElemClass>\n ): void => {\n const { connectedCallback, disconnectedCallback } = proto;\n\n proto.connectedCallback = function (this: ElemClass) {\n connectedCallback.call(this);\n const callback = (mutationList: MutationRecord[]) => {\n const elementsToWatch = Array.from(this.querySelectorAll(querySelector)).concat(\n Array.from(this.shadowRoot?.querySelectorAll(querySelector) || [])\n );\n for (const mutation of mutationList) {\n const addedNodes = Array.from(mutation.addedNodes).map(e => e as Element);\n const removedNodes = Array.from(mutation.addedNodes).map(e => e as Element);\n if (mutation.type === 'childList' && addedNodes.find(n => elementsToWatch.includes(n))) {\n (this[decoratedFnName] as unknown as UpdateHandler)(addedNodes, removedNodes);\n }\n }\n };\n observer = new MutationObserver(callback);\n observer.observe(this, { childList: true, subtree: true });\n\n const elementsAdded = Array.from(this.querySelectorAll(querySelector)).concat(\n Array.from(this.shadowRoot?.querySelectorAll(querySelector) || [])\n );\n (this[decoratedFnName] as unknown as UpdateHandler)(Array.from(elementsAdded), []);\n };\n\n proto.disconnectedCallback = function (this: ElemClass) {\n disconnectedCallback.call(this);\n observer.disconnect();\n };\n };\n}\n","import { property } from 'lit/decorators.js';\n\nimport type { ReactiveElement } from 'lit';\nimport type { PropertyDeclaration } from 'lit';\n\n// Extended decorator options\ninterface InternalStateOptions extends PropertyDeclaration {\n aria?: string; // Corresponding ARIA attribute, e.g., 'aria-disabled'\n}\n\nexport function propInternalState(options: InternalStateOptions) {\n return (protoOrDescriptor: any, name: string) => {\n // Apply the default Lit `@property` decorator\n property(options)(protoOrDescriptor, name);\n\n // Intercept the property descriptor to enhance functionality\n const key = `__${name}`; // Internal backing field\n\n Object.defineProperty(protoOrDescriptor, name, {\n get() {\n return this[key];\n },\n set(value: any) {\n const oldValue = this[key];\n this[key] = value;\n\n // Trigger updates if value changes\n if (oldValue !== value) {\n // Update internals state\n if (this._internals?.states) {\n const stateName = name.toLowerCase();\n if (value) {\n this._internals.states.add(`--${stateName}`);\n } else {\n this._internals.states.delete(`--${stateName}`);\n }\n }\n\n // Update ARIA attributes if specified\n if (options.aria && this._internals) {\n const ariaAttribute = options.aria;\n if (value) {\n this._internals[ariaAttribute] = 'true';\n } else {\n this._internals[ariaAttribute] = null;\n }\n }\n\n // Request an update\n (this as ReactiveElement).requestUpdate(name, oldValue);\n }\n },\n configurable: true,\n enumerable: true\n });\n };\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,KAAK,YAAY;AAC1B,SAAS,qBAAqB;;;ACD9B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YAAM,gBAAgB,MAAM,KAAK,KAAK,iBAAiB,aAAa,CAAC,EAAE;AAAA,QACrE,MAAM,KAAK,KAAK,YAAY,iBAAiB,aAAa,KAAK,CAAC,CAAC;AAAA,MACnE;AACA,MAAC,KAAK,eAAe,EAA+B,MAAM,KAAK,aAAa,GAAG,CAAC,CAAC;AAAA,IACnF;AAEA,UAAM,uBAAuB,WAA2B;AACtD,2BAAqB,KAAK,IAAI;AAC9B,eAAS,WAAW;AAAA,IACtB;AAAA,EACF;AACF;;;ACrEA,SAAS,YAAAA,iBAAgB;","names":["property"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
QtiModalFeedback
|
|
3
|
-
} from "./chunk-K47QFOQX.js";
|
|
4
1
|
import {
|
|
5
2
|
item_default
|
|
6
3
|
} from "./chunk-LSEB52SP.js";
|
|
4
|
+
import {
|
|
5
|
+
QtiModalFeedback
|
|
6
|
+
} from "./chunk-2WTHXWS3.js";
|
|
7
7
|
import {
|
|
8
8
|
watch
|
|
9
9
|
} from "./chunk-ELDMXTUQ.js";
|
|
@@ -2234,4 +2234,4 @@ export {
|
|
|
2234
2234
|
TestScoringFeedback,
|
|
2235
2235
|
TestCheckItem
|
|
2236
2236
|
};
|
|
2237
|
-
//# sourceMappingURL=chunk-
|
|
2237
|
+
//# sourceMappingURL=chunk-FQWMCONA.js.map
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
QtiFeedback,
|
|
3
3
|
convertNumberToUniversalFormat,
|
|
4
|
+
liveQuery,
|
|
4
5
|
removeDoubleSlashes
|
|
5
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-2WTHXWS3.js";
|
|
6
7
|
import {
|
|
7
8
|
watch
|
|
8
9
|
} from "./chunk-ELDMXTUQ.js";
|
|
@@ -38,41 +39,6 @@ import {
|
|
|
38
39
|
import { provide } from "@lit/context";
|
|
39
40
|
import { LitElement, html } from "lit";
|
|
40
41
|
import { customElement, property } from "lit/decorators.js";
|
|
41
|
-
|
|
42
|
-
// src/lib/decorators/live-query.ts
|
|
43
|
-
function liveQuery(querySelector, _options) {
|
|
44
|
-
let observer;
|
|
45
|
-
return (proto, decoratedFnName) => {
|
|
46
|
-
const { connectedCallback, disconnectedCallback } = proto;
|
|
47
|
-
proto.connectedCallback = function() {
|
|
48
|
-
connectedCallback.call(this);
|
|
49
|
-
const callback = (mutationList) => {
|
|
50
|
-
const elementsToWatch = Array.from(this.querySelectorAll(querySelector)).concat(
|
|
51
|
-
Array.from(this.shadowRoot?.querySelectorAll(querySelector) || [])
|
|
52
|
-
);
|
|
53
|
-
for (const mutation of mutationList) {
|
|
54
|
-
const addedNodes = Array.from(mutation.addedNodes).map((e) => e);
|
|
55
|
-
const removedNodes = Array.from(mutation.addedNodes).map((e) => e);
|
|
56
|
-
if (mutation.type === "childList" && addedNodes.find((n) => elementsToWatch.includes(n))) {
|
|
57
|
-
this[decoratedFnName](addedNodes, removedNodes);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
observer = new MutationObserver(callback);
|
|
62
|
-
observer.observe(this, { childList: true, subtree: true });
|
|
63
|
-
const elementsAdded = Array.from(this.querySelectorAll(querySelector)).concat(
|
|
64
|
-
Array.from(this.shadowRoot?.querySelectorAll(querySelector) || [])
|
|
65
|
-
);
|
|
66
|
-
this[decoratedFnName](Array.from(elementsAdded), []);
|
|
67
|
-
};
|
|
68
|
-
proto.disconnectedCallback = function() {
|
|
69
|
-
disconnectedCallback.call(this);
|
|
70
|
-
observer.disconnect();
|
|
71
|
-
};
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
// src/lib/qti-components/qti-assessment-item/qti-assessment-item.ts
|
|
76
42
|
var QtiAssessmentItem = class extends LitElement {
|
|
77
43
|
constructor() {
|
|
78
44
|
super(...arguments);
|
|
@@ -8104,6 +8070,9 @@ function qtiSubtractMixin(Base) {
|
|
|
8104
8070
|
};
|
|
8105
8071
|
}
|
|
8106
8072
|
|
|
8073
|
+
// src/lib/qti-components/qti-response-processing/qti-expression/qti-subtract/index.ts
|
|
8074
|
+
customElements.define("qti-subtract", QtiSubtract);
|
|
8075
|
+
|
|
8107
8076
|
// src/lib/qti-components/qti-response-processing/qti-expression/qti-string-match/qti-string-match.ts
|
|
8108
8077
|
import { property as property36 } from "lit/decorators.js";
|
|
8109
8078
|
var QtiStringMatch = class extends QtiExpression {
|
|
@@ -8792,4 +8761,4 @@ export {
|
|
|
8792
8761
|
QtiOutcomeDeclaration,
|
|
8793
8762
|
QtiResponseDeclaration
|
|
8794
8763
|
};
|
|
8795
|
-
//# sourceMappingURL=chunk-
|
|
8764
|
+
//# sourceMappingURL=chunk-G7ZPPP7O.js.map
|