@citolab/qti-components 7.5.1 → 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.
@@ -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",
@@ -23003,155 +23180,6 @@
23003
23180
  }
23004
23181
  ]
23005
23182
  },
23006
- {
23007
- "kind": "javascript-module",
23008
- "path": "src/lib/qti-components/qti-interaction/internal/vocabulary/vocabulary-mixin.spec.ts",
23009
- "declarations": [
23010
- {
23011
- "kind": "class",
23012
- "description": "",
23013
- "name": "TestElement",
23014
- "members": [
23015
- {
23016
- "kind": "field",
23017
- "name": "class",
23018
- "type": {
23019
- "text": "string"
23020
- },
23021
- "attribute": "class",
23022
- "reflects": true,
23023
- "inheritedFrom": {
23024
- "name": "VocabularyMixin",
23025
- "module": "src/lib/qti-components/qti-interaction/internal/vocabulary/vocabulary-mixin.ts"
23026
- }
23027
- },
23028
- {
23029
- "kind": "field",
23030
- "name": "shuffle",
23031
- "type": {
23032
- "text": "boolean"
23033
- }
23034
- },
23035
- {
23036
- "kind": "method",
23037
- "name": "validate",
23038
- "return": {
23039
- "type": {
23040
- "text": "boolean"
23041
- }
23042
- },
23043
- "type": {
23044
- "text": "validate() => boolean"
23045
- }
23046
- },
23047
- {
23048
- "kind": "field",
23049
- "name": "value",
23050
- "readonly": true
23051
- },
23052
- {
23053
- "kind": "field",
23054
- "name": "_classes",
23055
- "type": {
23056
- "text": "string[]"
23057
- },
23058
- "privacy": "private",
23059
- "default": "[]",
23060
- "inheritedFrom": {
23061
- "name": "VocabularyMixin",
23062
- "module": "src/lib/qti-components/qti-interaction/internal/vocabulary/vocabulary-mixin.ts"
23063
- }
23064
- },
23065
- {
23066
- "kind": "field",
23067
- "name": "_allLabels",
23068
- "type": {
23069
- "text": "array"
23070
- },
23071
- "privacy": "private",
23072
- "default": "['qti-labels-decimal', 'qti-labels-lower-alpha', 'qti-labels-upper-alpha']",
23073
- "inheritedFrom": {
23074
- "name": "VocabularyMixin",
23075
- "module": "src/lib/qti-components/qti-interaction/internal/vocabulary/vocabulary-mixin.ts"
23076
- }
23077
- },
23078
- {
23079
- "kind": "field",
23080
- "name": "_allLabelSuffixes",
23081
- "privacy": "private",
23082
- "default": "['qti-labels-suffix-period', 'qti-labels-suffix-parenthesis']",
23083
- "inheritedFrom": {
23084
- "name": "VocabularyMixin",
23085
- "module": "src/lib/qti-components/qti-interaction/internal/vocabulary/vocabulary-mixin.ts"
23086
- }
23087
- },
23088
- {
23089
- "kind": "method",
23090
- "name": "_addLabels",
23091
- "privacy": "private",
23092
- "inheritedFrom": {
23093
- "name": "VocabularyMixin",
23094
- "module": "src/lib/qti-components/qti-interaction/internal/vocabulary/vocabulary-mixin.ts"
23095
- }
23096
- },
23097
- {
23098
- "kind": "method",
23099
- "name": "_getLabel",
23100
- "privacy": "private",
23101
- "parameters": [
23102
- {
23103
- "name": "index",
23104
- "type": {
23105
- "text": "number"
23106
- }
23107
- }
23108
- ],
23109
- "inheritedFrom": {
23110
- "name": "VocabularyMixin",
23111
- "module": "src/lib/qti-components/qti-interaction/internal/vocabulary/vocabulary-mixin.ts"
23112
- }
23113
- }
23114
- ],
23115
- "mixins": [
23116
- {
23117
- "name": "VocabularyMixin",
23118
- "module": "/src/lib/qti-components/qti-interaction/internal/vocabulary/vocabulary-mixin"
23119
- }
23120
- ],
23121
- "superclass": {
23122
- "name": "Interaction",
23123
- "module": "/src/lib/exports/interaction"
23124
- },
23125
- "tagName": "test-element",
23126
- "customElement": true,
23127
- "attributes": [
23128
- {
23129
- "name": "class",
23130
- "type": {
23131
- "text": "string"
23132
- },
23133
- "fieldName": "class",
23134
- "inheritedFrom": {
23135
- "name": "VocabularyMixin",
23136
- "module": "src/lib/qti-components/qti-interaction/internal/vocabulary/vocabulary-mixin.ts"
23137
- }
23138
- }
23139
- ],
23140
- "modulePath": "src/lib/qti-components/qti-interaction/internal/vocabulary/vocabulary-mixin.spec.ts",
23141
- "definitionPath": "src/lib/qti-components/qti-interaction/internal/vocabulary/vocabulary-mixin.spec.ts"
23142
- }
23143
- ],
23144
- "exports": [
23145
- {
23146
- "kind": "custom-element-definition",
23147
- "name": "test-element",
23148
- "declaration": {
23149
- "name": "TestElement",
23150
- "module": "src/lib/qti-components/qti-interaction/internal/vocabulary/vocabulary-mixin.spec.ts"
23151
- }
23152
- }
23153
- ]
23154
- },
23155
23183
  {
23156
23184
  "kind": "javascript-module",
23157
23185
  "path": "src/lib/qti-components/qti-interaction/internal/shuffle/shuffle.stories.ts",
@@ -23304,6 +23332,155 @@
23304
23332
  }
23305
23333
  ]
23306
23334
  },
23335
+ {
23336
+ "kind": "javascript-module",
23337
+ "path": "src/lib/qti-components/qti-interaction/internal/vocabulary/vocabulary-mixin.spec.ts",
23338
+ "declarations": [
23339
+ {
23340
+ "kind": "class",
23341
+ "description": "",
23342
+ "name": "TestElement",
23343
+ "members": [
23344
+ {
23345
+ "kind": "field",
23346
+ "name": "class",
23347
+ "type": {
23348
+ "text": "string"
23349
+ },
23350
+ "attribute": "class",
23351
+ "reflects": true,
23352
+ "inheritedFrom": {
23353
+ "name": "VocabularyMixin",
23354
+ "module": "src/lib/qti-components/qti-interaction/internal/vocabulary/vocabulary-mixin.ts"
23355
+ }
23356
+ },
23357
+ {
23358
+ "kind": "field",
23359
+ "name": "shuffle",
23360
+ "type": {
23361
+ "text": "boolean"
23362
+ }
23363
+ },
23364
+ {
23365
+ "kind": "method",
23366
+ "name": "validate",
23367
+ "return": {
23368
+ "type": {
23369
+ "text": "boolean"
23370
+ }
23371
+ },
23372
+ "type": {
23373
+ "text": "validate() => boolean"
23374
+ }
23375
+ },
23376
+ {
23377
+ "kind": "field",
23378
+ "name": "value",
23379
+ "readonly": true
23380
+ },
23381
+ {
23382
+ "kind": "field",
23383
+ "name": "_classes",
23384
+ "type": {
23385
+ "text": "string[]"
23386
+ },
23387
+ "privacy": "private",
23388
+ "default": "[]",
23389
+ "inheritedFrom": {
23390
+ "name": "VocabularyMixin",
23391
+ "module": "src/lib/qti-components/qti-interaction/internal/vocabulary/vocabulary-mixin.ts"
23392
+ }
23393
+ },
23394
+ {
23395
+ "kind": "field",
23396
+ "name": "_allLabels",
23397
+ "type": {
23398
+ "text": "array"
23399
+ },
23400
+ "privacy": "private",
23401
+ "default": "['qti-labels-decimal', 'qti-labels-lower-alpha', 'qti-labels-upper-alpha']",
23402
+ "inheritedFrom": {
23403
+ "name": "VocabularyMixin",
23404
+ "module": "src/lib/qti-components/qti-interaction/internal/vocabulary/vocabulary-mixin.ts"
23405
+ }
23406
+ },
23407
+ {
23408
+ "kind": "field",
23409
+ "name": "_allLabelSuffixes",
23410
+ "privacy": "private",
23411
+ "default": "['qti-labels-suffix-period', 'qti-labels-suffix-parenthesis']",
23412
+ "inheritedFrom": {
23413
+ "name": "VocabularyMixin",
23414
+ "module": "src/lib/qti-components/qti-interaction/internal/vocabulary/vocabulary-mixin.ts"
23415
+ }
23416
+ },
23417
+ {
23418
+ "kind": "method",
23419
+ "name": "_addLabels",
23420
+ "privacy": "private",
23421
+ "inheritedFrom": {
23422
+ "name": "VocabularyMixin",
23423
+ "module": "src/lib/qti-components/qti-interaction/internal/vocabulary/vocabulary-mixin.ts"
23424
+ }
23425
+ },
23426
+ {
23427
+ "kind": "method",
23428
+ "name": "_getLabel",
23429
+ "privacy": "private",
23430
+ "parameters": [
23431
+ {
23432
+ "name": "index",
23433
+ "type": {
23434
+ "text": "number"
23435
+ }
23436
+ }
23437
+ ],
23438
+ "inheritedFrom": {
23439
+ "name": "VocabularyMixin",
23440
+ "module": "src/lib/qti-components/qti-interaction/internal/vocabulary/vocabulary-mixin.ts"
23441
+ }
23442
+ }
23443
+ ],
23444
+ "mixins": [
23445
+ {
23446
+ "name": "VocabularyMixin",
23447
+ "module": "/src/lib/qti-components/qti-interaction/internal/vocabulary/vocabulary-mixin"
23448
+ }
23449
+ ],
23450
+ "superclass": {
23451
+ "name": "Interaction",
23452
+ "module": "/src/lib/exports/interaction"
23453
+ },
23454
+ "tagName": "test-element",
23455
+ "customElement": true,
23456
+ "attributes": [
23457
+ {
23458
+ "name": "class",
23459
+ "type": {
23460
+ "text": "string"
23461
+ },
23462
+ "fieldName": "class",
23463
+ "inheritedFrom": {
23464
+ "name": "VocabularyMixin",
23465
+ "module": "src/lib/qti-components/qti-interaction/internal/vocabulary/vocabulary-mixin.ts"
23466
+ }
23467
+ }
23468
+ ],
23469
+ "modulePath": "src/lib/qti-components/qti-interaction/internal/vocabulary/vocabulary-mixin.spec.ts",
23470
+ "definitionPath": "src/lib/qti-components/qti-interaction/internal/vocabulary/vocabulary-mixin.spec.ts"
23471
+ }
23472
+ ],
23473
+ "exports": [
23474
+ {
23475
+ "kind": "custom-element-definition",
23476
+ "name": "test-element",
23477
+ "declaration": {
23478
+ "name": "TestElement",
23479
+ "module": "src/lib/qti-components/qti-interaction/internal/vocabulary/vocabulary-mixin.spec.ts"
23480
+ }
23481
+ }
23482
+ ]
23483
+ },
23307
23484
  {
23308
23485
  "kind": "javascript-module",
23309
23486
  "path": "src/lib/qti-components/qti-response-processing/qti-expression/qti-gcd/qti.gcd.spec.ts",
@@ -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-K47QFOQX.js.map
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,SAAS,eAAe;AACxB,SAAS,kBAAkB;AAC3B,SAAS,UAAU,aAAa;;;ACFzB,IAAM,mBAAmB,MAAM;AACpC,SAAO,IAAI,KAAK,aAAa,EAAE,OAAO,GAAG,EAAE,QAAQ,OAAO,EAAE;AAC9D;AAEO,IAAM,iCAAiC,CAAC,WAA4B;AAEzE,MAAI,OAAO,WAAW,UAAU;AAC9B,WAAO;AAAA,EACT;AACA,QAAM,OAAO,iBAAiB;AAC9B,MAAI,SAAS,KAAK;AAChB,WAAO,OAAO,eAAe;AAAA,EAC/B,OAAO;AACL,WAAO,OAAO,SAAS,EAAE,QAAQ,KAAK,EAAE,EAAE,QAAQ,MAAM,GAAG;AAAA,EAC7D;AACF;AAEO,SAAS,kBAAkB,OAAgB;AAChD,SAAO,UAAU,QAAQ,UAAU;AACrC;AAEO,SAAS,oBAAoB,KAAa;AAC/C,QAAM,uBAAuB,IAC1B,QAAQ,gBAAgB,IAAI,EAC5B,QAAQ,SAAS,GAAG,EACpB,QAAQ,UAAU,SAAS,EAC3B,QAAQ,WAAW,UAAU;AAChC,SAAO;AACT;;;ADnBO,IAAe,cAAf,cAAmC,WAAW;AAAA,EAiBnC,oBAAoB;AAClC,UAAM,kBAAkB;AACxB,SAAK;AAAA,MACH,IAAI,YAAyB,yBAAyB;AAAA,QACpD,SAAS;AAAA,QACT,UAAU;AAAA,QACV,QAAQ;AAAA,MACV,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEO,kBA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AAM,eAAe,MAAM,KAAK,SAAS,UAAU,EAAE,IAAI,OAAK,CAAY;AAC1E,cAAI,SAAS,SAAS,eAAe,WAAW,KAAK,OAAK,gBAAgB,SAAS,CAAC,CAAC,GAAG;AACtF,YAAC,KAAK,eAAe,EAA+B,YAAY,YAAY;AAAA,UAC9E;AAAA,QACF;AAAA,MACF;AACA,iBAAW,IAAI,iBAAiB,QAAQ;AACxC,eAAS,QAAQ,MAAM,EAAE,WAAW,MAAM,SAAS,KAAK,CAAC;AAEzD,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-UVKOJQ52.js.map
2237
+ //# sourceMappingURL=chunk-FQWMCONA.js.map