@citolab/qti-components 7.0.5 → 7.0.6-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cdn/chunk-2F5323DC.js +8 -0
- package/cdn/chunk-2WPNLHGH.js +43 -0
- package/cdn/chunk-3M77CJJH.js +8 -0
- package/cdn/chunk-4DFVJE2A.js +48 -0
- package/cdn/chunk-4HKDXRGE.js +5 -0
- package/cdn/chunk-5WCOPF7O.js +73 -0
- package/cdn/chunk-D4K2EXYX.js +8 -0
- package/cdn/chunk-II7AGB2E.js +11 -0
- package/cdn/chunk-KUOLGIA5.js +1 -0
- package/cdn/chunk-KXRA4DBZ.js +8 -0
- package/cdn/chunk-L4TDHAKL.js +24 -0
- package/cdn/chunk-LY27H7YF.js +1 -0
- package/cdn/chunk-M6AATWPS.js +59 -0
- package/cdn/{chunks/chunk-UIEC4LXR.js → chunk-MFWSHIPH.js} +1 -1
- package/cdn/chunk-NAARXANC.js +11 -0
- package/cdn/chunk-OEBYNBRS.js +129 -0
- package/cdn/chunk-RBATSYIS.js +43 -0
- package/cdn/chunk-RM352RXQ.js +5 -0
- package/cdn/{chunks/chunk-CFXQCNG6.js → chunk-SQDSHH6N.js} +18 -2
- package/cdn/chunk-V2RMP73O.js +1 -0
- package/cdn/chunk-WI7KK7NI.js +8 -0
- package/cdn/chunk-YHB534QY.js +8 -0
- package/cdn/chunk-YXST4IEX.js +5 -0
- package/cdn/qti-components/index.js +131 -116
- package/cdn/qti-item/core/index.global.js +149 -0
- package/cdn/qti-item/core/index.js +5 -0
- package/cdn/qti-loader/index.js +1 -23
- package/cdn/qti-test/components/index.global.js +1 -36
- package/cdn/qti-test/components/index.js +1 -3598
- package/cdn/qti-test/components/styles.js +1 -17
- package/cdn/qti-test/components/test-component.abstract.js +1 -1
- package/cdn/qti-test/components/test-item-link.js +1 -24
- package/cdn/qti-test/components/test-next.js +1 -24
- package/cdn/qti-test/components/test-next.spec.global.js +25 -60
- package/cdn/qti-test/components/test-next.spec.js +247 -4749
- package/cdn/qti-test/components/test-paging-buttons-stamp.js +1 -3
- package/cdn/qti-test/components/test-prev.js +1 -24
- package/cdn/qti-test/components/test-view.js +1 -11
- package/cdn/qti-test/core/index.global.js +205 -0
- package/cdn/qti-test/core/index.js +1 -0
- package/cdn/qti-transformers/index.js +1 -23
- package/dist/{chunks/chunk-Y6UWSECL.js → chunk-2CHF3TMY.js} +2 -2
- package/dist/chunk-2CHF3TMY.js.map +1 -0
- package/dist/{chunks/chunk-ZEFOMZNY.js → chunk-2GKDJDI5.js} +3 -3
- package/dist/chunk-2GKDJDI5.js.map +1 -0
- package/dist/{chunks/chunk-XDMSEAYC.js → chunk-2OA7E3E7.js} +1 -1
- package/dist/chunk-2OA7E3E7.js.map +1 -0
- package/dist/{chunks/chunk-PUBGXXTM.js → chunk-3F3DCHHM.js} +4 -4
- package/dist/chunk-3F3DCHHM.js.map +1 -0
- package/dist/{chunks/chunk-6YE2KJ4C.js → chunk-44VE5POH.js} +1 -1
- package/dist/{chunks/chunk-D3RGDWKP.js → chunk-4CSM2PCC.js} +1 -1
- package/dist/chunk-4CSM2PCC.js.map +1 -0
- package/dist/{chunks/chunk-ELDMXTUQ.js → chunk-4YG2FPKK.js} +1 -1
- package/dist/chunk-4YG2FPKK.js.map +1 -0
- package/dist/{chunks/chunk-W4B23OIP.js → chunk-4YR7ZPE3.js} +4 -4
- package/dist/chunk-4YR7ZPE3.js.map +1 -0
- package/dist/{chunks/chunk-XDFXD3BI.js → chunk-E3656TSN.js} +2 -2
- package/dist/chunk-E3656TSN.js.map +1 -0
- package/dist/{chunks/chunk-HWA4A3SR.js → chunk-ERLGA6TC.js} +4 -4
- package/dist/chunk-ERLGA6TC.js.map +1 -0
- package/dist/{chunks/chunk-3ROZMGAN.js → chunk-EXJQ3ZUE.js} +4 -4
- package/dist/chunk-EXJQ3ZUE.js.map +1 -0
- package/dist/chunk-KI3A6ZT6.js +50 -0
- package/dist/chunk-KI3A6ZT6.js.map +1 -0
- package/dist/{chunks/chunk-LKINC6JO.js → chunk-KVFH5VBC.js} +6 -6
- package/dist/chunk-KVFH5VBC.js.map +1 -0
- package/dist/chunk-LJU3MHXE.js +43 -0
- package/dist/chunk-LJU3MHXE.js.map +1 -0
- package/dist/chunk-MAC76UNI.js +1 -0
- package/dist/chunk-NUXEGEMP.js +65 -0
- package/dist/chunk-NUXEGEMP.js.map +1 -0
- package/dist/chunk-O3GIZH57.js +121 -0
- package/dist/chunk-O3GIZH57.js.map +1 -0
- package/dist/{qti-test/qti-test.js → chunk-QNR4WQAC.js} +307 -239
- package/dist/chunk-QNR4WQAC.js.map +1 -0
- package/dist/chunk-SLMQZKDH.js +568 -0
- package/dist/chunk-SLMQZKDH.js.map +1 -0
- package/dist/chunk-TAQAVEQ2.js +72 -0
- package/dist/chunk-TAQAVEQ2.js.map +1 -0
- package/dist/chunk-TLPISJ3Z.js +78 -0
- package/dist/chunk-TLPISJ3Z.js.map +1 -0
- package/dist/{chunks/chunk-4O5F7WV7.js → chunk-UB5K44DB.js} +1 -1
- package/dist/chunk-UB5K44DB.js.map +1 -0
- package/dist/chunk-UDWEOEOS.js +50 -0
- package/dist/chunk-UDWEOEOS.js.map +1 -0
- package/dist/qti-components/index.d.ts +2 -2
- package/dist/qti-components/index.js +12 -285
- package/dist/qti-components/index.js.map +1 -1
- package/dist/qti-components-jsx.d.ts +83 -83
- package/dist/qti-item/{components/item-container.d.ts → core/index.d.ts} +22 -1
- package/dist/{chunks/chunk-LROTNPC2.js → qti-item/core/index.js} +20 -9
- package/dist/qti-item/core/index.js.map +1 -0
- package/dist/qti-loader/index.d.ts +1 -1
- package/dist/qti-loader/index.js +6 -287
- package/dist/qti-loader/index.js.map +1 -1
- package/dist/{qti-simple-choice-DxWcdKHi.d.ts → qti-simple-choice-DB7hqAMS.d.ts} +1 -1
- package/dist/qti-test/components/index.d.ts +2 -4
- package/dist/qti-test/components/index.js +24 -4135
- package/dist/qti-test/components/index.js.map +1 -1
- package/dist/qti-test/components/styles.js +7 -22
- package/dist/qti-test/components/styles.js.map +1 -1
- package/dist/qti-test/components/test-component.abstract.d.ts +2 -3
- package/dist/qti-test/components/test-component.abstract.js +7 -145
- package/dist/qti-test/components/test-component.abstract.js.map +1 -1
- package/dist/qti-test/components/test-item-link.d.ts +2 -3
- package/dist/qti-test/components/test-item-link.js +9 -198
- package/dist/qti-test/components/test-item-link.js.map +1 -1
- package/dist/qti-test/components/test-next.d.ts +2 -3
- package/dist/qti-test/components/test-next.js +9 -205
- package/dist/qti-test/components/test-next.js.map +1 -1
- package/dist/qti-test/components/test-next.spec.d.ts +3 -7
- package/dist/qti-test/components/test-next.spec.js +140 -11152
- package/dist/qti-test/components/test-next.spec.js.map +1 -1
- package/dist/qti-test/components/test-paging-buttons-stamp.d.ts +2 -3
- package/dist/qti-test/components/test-paging-buttons-stamp.js +8 -214
- package/dist/qti-test/components/test-paging-buttons-stamp.js.map +1 -1
- package/dist/qti-test/components/test-prev.d.ts +2 -3
- package/dist/qti-test/components/test-prev.js +9 -205
- package/dist/qti-test/components/test-prev.js.map +1 -1
- package/dist/qti-test/components/test-view.d.ts +2 -3
- package/dist/qti-test/components/test-view.js +8 -205
- package/dist/qti-test/components/test-view.js.map +1 -1
- package/dist/qti-test/core/index.d.ts +121 -0
- package/dist/qti-test/core/index.js +25 -0
- package/dist/qti-transformers/index.js +6 -287
- package/dist/qti-transformers/index.js.map +1 -1
- package/dist/test-component.abstract-DWJ0XNiI.d.ts +108 -0
- package/dist/{index-Cvrd4KQA.d.ts → test.context-DKSpQHyg.d.ts} +40 -56
- package/dist/{test-base-BJwG9Ie8.d.ts → test.context-K2w-1mWi.d.ts} +19 -29
- package/dist/vscode.html-custom-data.json +21 -21
- package/package.json +70 -75
- package/cdn/chunks/chunk-4UJBK6JO.js +0 -1
- package/cdn/chunks/chunk-5O3Z7TDV.js +0 -1
- package/cdn/chunks/chunk-65LFT33L.js +0 -8
- package/cdn/chunks/chunk-6D25UFJR.js +0 -8
- package/cdn/chunks/chunk-6UGPNL7M.js +0 -1
- package/cdn/chunks/chunk-CSUKVUZF.js +0 -3
- package/cdn/chunks/chunk-CSY3WI5A.js +0 -1
- package/cdn/chunks/chunk-DAZR7RUI.js +0 -0
- package/cdn/chunks/chunk-EOPEMJS3.js +0 -0
- package/cdn/chunks/chunk-G5O7EN45.js +0 -5
- package/cdn/chunks/chunk-GEFUIFM7.js +0 -0
- package/cdn/chunks/chunk-JLNHEMQG.js +0 -1
- package/cdn/chunks/chunk-LPWIM7QJ.js +0 -902
- package/cdn/chunks/chunk-M3YRM3AV.js +0 -1
- package/cdn/chunks/chunk-M6BOWL2U.js +0 -1
- package/cdn/chunks/chunk-P5IE36FO.js +0 -8
- package/cdn/chunks/chunk-PXH5KN5O.js +0 -1
- package/cdn/chunks/chunk-RBEI6NIF.js +0 -1
- package/cdn/chunks/chunk-SMKIYFFI.js +0 -1
- package/cdn/chunks/chunk-SRLMW23F.js +0 -0
- package/cdn/chunks/chunk-T3YDLD2H.js +0 -11
- package/cdn/chunks/chunk-T6IXJ4W4.js +0 -1
- package/cdn/chunks/chunk-TFAUBGP2.js +0 -0
- package/cdn/chunks/chunk-V44O3GTW.js +0 -0
- package/cdn/chunks/chunk-V6B54FQW.js +0 -5
- package/cdn/chunks/chunk-V6KX6BQN.js +0 -1
- package/cdn/chunks/chunk-VYANBI35.js +0 -1
- package/cdn/chunks/chunk-XUJ7TXHW.js +0 -1
- package/cdn/chunks/chunk-ZIZLFFSG.js +0 -0
- package/cdn/index.css +0 -1
- package/cdn/index.global.js +0 -277
- package/cdn/index.js +0 -4503
- package/cdn/qti-item/components/index.css +0 -1
- package/cdn/qti-item/components/index.global.js +0 -149
- package/cdn/qti-item/components/index.js +0 -3549
- package/cdn/qti-item/components/item-container.css +0 -1
- package/cdn/qti-item/components/item-container.global.js +0 -149
- package/cdn/qti-item/components/item-container.js +0 -3549
- package/cdn/qti-item/index.css +0 -1
- package/cdn/qti-item/index.global.js +0 -149
- package/cdn/qti-item/index.js +0 -3549
- package/cdn/qti-item/qti-item.global.js +0 -114
- package/cdn/qti-item/qti-item.js +0 -1
- package/cdn/qti-test/components/index.css +0 -1
- package/cdn/qti-test/components/test-container.css +0 -1
- package/cdn/qti-test/components/test-container.global.js +0 -149
- package/cdn/qti-test/components/test-container.js +0 -3549
- package/cdn/qti-test/components/test-next.spec.css +0 -1
- package/cdn/qti-test/context/index.global.js +0 -58
- package/cdn/qti-test/context/index.js +0 -1
- package/cdn/qti-test/context/test.context.global.js +0 -58
- package/cdn/qti-test/context/test.context.js +0 -1
- package/cdn/qti-test/index.css +0 -1
- package/cdn/qti-test/index.global.js +0 -242
- package/cdn/qti-test/index.js +0 -3598
- package/cdn/qti-test/mixins/index.global.js +0 -1
- package/cdn/qti-test/mixins/index.js +0 -23
- package/cdn/qti-test/mixins/test-loader.mixin.global.js +0 -1
- package/cdn/qti-test/mixins/test-loader.mixin.js +0 -23
- package/cdn/qti-test/mixins/test-navigation.mixin.global.js +0 -1
- package/cdn/qti-test/mixins/test-navigation.mixin.js +0 -1
- package/cdn/qti-test/mixins/test-view.mixin.global.js +0 -1
- package/cdn/qti-test/mixins/test-view.mixin.js +0 -1
- package/cdn/qti-test/qti-assessment-test/index.global.js +0 -170
- package/cdn/qti-test/qti-assessment-test/index.js +0 -1
- package/cdn/qti-test/qti-assessment-test/qti-assessment-item-ref.global.js +0 -170
- package/cdn/qti-test/qti-assessment-test/qti-assessment-item-ref.js +0 -1
- package/cdn/qti-test/qti-assessment-test/qti-assessment-section.global.js +0 -170
- package/cdn/qti-test/qti-assessment-test/qti-assessment-section.js +0 -1
- package/cdn/qti-test/qti-assessment-test/qti-assessment-test.global.js +0 -170
- package/cdn/qti-test/qti-assessment-test/qti-assessment-test.js +0 -1
- package/cdn/qti-test/qti-assessment-test/qti-test-part.global.js +0 -114
- package/cdn/qti-test/qti-assessment-test/qti-test-part.js +0 -1
- package/cdn/qti-test/qti-test.global.js +0 -170
- package/cdn/qti-test/qti-test.js +0 -23
- package/cdn/qti-test/test-base.global.js +0 -170
- package/cdn/qti-test/test-base.js +0 -1
- package/dist/chunks/chunk-3G2DDBJW.js +0 -44
- package/dist/chunks/chunk-3G2DDBJW.js.map +0 -1
- package/dist/chunks/chunk-3NLCJYSX.js +0 -1
- package/dist/chunks/chunk-3OXGDCSU.js +0 -6253
- package/dist/chunks/chunk-3OXGDCSU.js.map +0 -1
- package/dist/chunks/chunk-3ROZMGAN.js.map +0 -1
- package/dist/chunks/chunk-4O5F7WV7.js.map +0 -1
- package/dist/chunks/chunk-AAQCM2FP.js +0 -56
- package/dist/chunks/chunk-AAQCM2FP.js.map +0 -1
- package/dist/chunks/chunk-D3RGDWKP.js.map +0 -1
- package/dist/chunks/chunk-DJLE6EV2.js +0 -36
- package/dist/chunks/chunk-DJLE6EV2.js.map +0 -1
- package/dist/chunks/chunk-ELDMXTUQ.js.map +0 -1
- package/dist/chunks/chunk-EW5CTHAD.js +0 -1
- package/dist/chunks/chunk-HWA4A3SR.js.map +0 -1
- package/dist/chunks/chunk-IKZWK2C5.js +0 -1
- package/dist/chunks/chunk-IKZWK2C5.js.map +0 -1
- package/dist/chunks/chunk-IP7JSYO6.js +0 -1
- package/dist/chunks/chunk-IP7JSYO6.js.map +0 -1
- package/dist/chunks/chunk-JE6BMXZU.js +0 -94
- package/dist/chunks/chunk-JE6BMXZU.js.map +0 -1
- package/dist/chunks/chunk-JSPJGWGT.js +0 -20
- package/dist/chunks/chunk-JSPJGWGT.js.map +0 -1
- package/dist/chunks/chunk-LKINC6JO.js.map +0 -1
- package/dist/chunks/chunk-LROTNPC2.js.map +0 -1
- package/dist/chunks/chunk-MTMT2RMF.js +0 -63
- package/dist/chunks/chunk-MTMT2RMF.js.map +0 -1
- package/dist/chunks/chunk-NDJZGJUR.js +0 -65
- package/dist/chunks/chunk-NDJZGJUR.js.map +0 -1
- package/dist/chunks/chunk-OE2LFIH2.js +0 -1
- package/dist/chunks/chunk-OE2LFIH2.js.map +0 -1
- package/dist/chunks/chunk-OJ2XGDWK.js +0 -1
- package/dist/chunks/chunk-OJ2XGDWK.js.map +0 -1
- package/dist/chunks/chunk-PUBGXXTM.js.map +0 -1
- package/dist/chunks/chunk-QRCUNRP5.js +0 -75
- package/dist/chunks/chunk-QRCUNRP5.js.map +0 -1
- package/dist/chunks/chunk-S6JJYCO7.js +0 -51
- package/dist/chunks/chunk-S6JJYCO7.js.map +0 -1
- package/dist/chunks/chunk-U3AALKEP.js +0 -1
- package/dist/chunks/chunk-U3AALKEP.js.map +0 -1
- package/dist/chunks/chunk-UCQFSRYF.js +0 -34
- package/dist/chunks/chunk-UCQFSRYF.js.map +0 -1
- package/dist/chunks/chunk-URGVQ64M.js +0 -1
- package/dist/chunks/chunk-URGVQ64M.js.map +0 -1
- package/dist/chunks/chunk-V4FXK4TP.js +0 -128
- package/dist/chunks/chunk-V4FXK4TP.js.map +0 -1
- package/dist/chunks/chunk-W4B23OIP.js.map +0 -1
- package/dist/chunks/chunk-XDFXD3BI.js.map +0 -1
- package/dist/chunks/chunk-XDMSEAYC.js.map +0 -1
- package/dist/chunks/chunk-XPDS72XY.js +0 -29
- package/dist/chunks/chunk-XPDS72XY.js.map +0 -1
- package/dist/chunks/chunk-Y6UWSECL.js.map +0 -1
- package/dist/chunks/chunk-ZEFOMZNY.js.map +0 -1
- package/dist/index.d.ts +0 -19
- package/dist/index.js +0 -11153
- package/dist/index.js.map +0 -1
- package/dist/qti-item/components/index.d.ts +0 -3
- package/dist/qti-item/components/index.js +0 -3856
- package/dist/qti-item/components/index.js.map +0 -1
- package/dist/qti-item/components/item-container.js +0 -3856
- package/dist/qti-item/components/item-container.js.map +0 -1
- package/dist/qti-item/index.d.ts +0 -4
- package/dist/qti-item/index.js +0 -3869
- package/dist/qti-item/index.js.map +0 -1
- package/dist/qti-item/qti-item.d.ts +0 -25
- package/dist/qti-item/qti-item.js +0 -26
- package/dist/qti-item/qti-item.js.map +0 -1
- package/dist/qti-test/components/test-container.d.ts +0 -37
- package/dist/qti-test/components/test-container.js +0 -3782
- package/dist/qti-test/components/test-container.js.map +0 -1
- package/dist/qti-test/context/index.d.ts +0 -6
- package/dist/qti-test/context/index.js +0 -9
- package/dist/qti-test/context/index.js.map +0 -1
- package/dist/qti-test/context/test.context.d.ts +0 -6
- package/dist/qti-test/context/test.context.js +0 -9
- package/dist/qti-test/context/test.context.js.map +0 -1
- package/dist/qti-test/index.d.ts +0 -14
- package/dist/qti-test/index.js +0 -4746
- package/dist/qti-test/index.js.map +0 -1
- package/dist/qti-test/mixins/index.d.ts +0 -8
- package/dist/qti-test/mixins/index.js +0 -350
- package/dist/qti-test/mixins/index.js.map +0 -1
- package/dist/qti-test/mixins/test-loader.mixin.d.ts +0 -8
- package/dist/qti-test/mixins/test-loader.mixin.js +0 -240
- package/dist/qti-test/mixins/test-loader.mixin.js.map +0 -1
- package/dist/qti-test/mixins/test-navigation.mixin.d.ts +0 -22
- package/dist/qti-test/mixins/test-navigation.mixin.js +0 -64
- package/dist/qti-test/mixins/test-navigation.mixin.js.map +0 -1
- package/dist/qti-test/mixins/test-view.mixin.d.ts +0 -6
- package/dist/qti-test/mixins/test-view.mixin.js +0 -50
- package/dist/qti-test/mixins/test-view.mixin.js.map +0 -1
- package/dist/qti-test/qti-assessment-test/index.d.ts +0 -6
- package/dist/qti-test/qti-assessment-test/index.js +0 -221
- package/dist/qti-test/qti-assessment-test/index.js.map +0 -1
- package/dist/qti-test/qti-assessment-test/qti-assessment-item-ref.d.ts +0 -6
- package/dist/qti-test/qti-assessment-test/qti-assessment-item-ref.js +0 -85
- package/dist/qti-test/qti-assessment-test/qti-assessment-item-ref.js.map +0 -1
- package/dist/qti-test/qti-assessment-test/qti-assessment-section.d.ts +0 -6
- package/dist/qti-test/qti-assessment-test/qti-assessment-section.js +0 -73
- package/dist/qti-test/qti-assessment-test/qti-assessment-section.js.map +0 -1
- package/dist/qti-test/qti-assessment-test/qti-assessment-test.d.ts +0 -6
- package/dist/qti-test/qti-assessment-test/qti-assessment-test.js +0 -54
- package/dist/qti-test/qti-assessment-test/qti-assessment-test.js.map +0 -1
- package/dist/qti-test/qti-assessment-test/qti-test-part.d.ts +0 -19
- package/dist/qti-test/qti-assessment-test/qti-test-part.js +0 -62
- package/dist/qti-test/qti-assessment-test/qti-test-part.js.map +0 -1
- package/dist/qti-test/qti-test.d.ts +0 -68
- package/dist/qti-test/qti-test.js.map +0 -1
- package/dist/qti-test/test-base.d.ts +0 -6
- package/dist/qti-test/test-base.js +0 -137
- package/dist/qti-test/test-base.js.map +0 -1
- /package/cdn/{chunks/chunk-6DMSHH5X.js → chunk-22HAPLRD.js} +0 -0
- /package/cdn/{chunks/chunk-EHK76KRT.js → chunk-GPDDPZFH.js} +0 -0
- /package/cdn/{chunks/chunk-5FCXUJAG.js → chunk-LVW3MHTI.js} +0 -0
- /package/cdn/{chunks/chunk-T4HD2C4F.js → chunk-VI2WKTN4.js} +0 -0
- /package/dist/{chunks/chunk-3NLCJYSX.js.map → chunk-44VE5POH.js.map} +0 -0
- /package/dist/{chunks/chunk-6YE2KJ4C.js.map → chunk-MAC76UNI.js.map} +0 -0
- /package/dist/{chunks/chunk-EW5CTHAD.js.map → qti-test/core/index.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/qti-test/components/test-next.ts"],"sourcesContent":["import { css, html } from 'lit';\nimport { customElement } from 'lit/decorators.js';\nimport * as styles from './styles';\nimport { TestComponent } from './test-component.abstract';\n\n/**\n * Represents a custom element for navigating to the next test item.\n *\n * @remarks\n * This element provides functionality for navigating to the next test item.\n *\n * @example\n * ```html\n * <test-next></test-next>\n * ```\n */\n@customElement('test-next')\nexport class TestNext extends TestComponent {\n static styles = css`\n :host {\n ${styles.btn};\n }\n :host([disabled]) {\n ${styles.dis};\n }\n `;\n\n constructor() {\n super();\n this._internals.role = 'button';\n this._internals.ariaLabel = 'Next item';\n\n this.addEventListener('click', e => {\n e.preventDefault();\n if (!this.disabled) this._requestItem(this.items[this.itemIndex + 1].identifier);\n });\n }\n\n willUpdate(changedProperties: Map<string | number | symbol, unknown>) {\n super.willUpdate(changedProperties);\n if (changedProperties.has('_testContext')) {\n this.disabled = !this._testElement?.el || this.itemIndex < 0 || this.itemIndex >= this.items.length - 1;\n }\n }\n\n render() {\n return html`<slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-next': TestNext;\n }\n}\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,KAAK,YAAY;AAC1B,SAAS,qBAAqB;AAgBvB,IAAM,WAAN,cAAuB,cAAc;AAAA,EAU1C,cAAc;AACZ,UAAM;AACN,SAAK,WAAW,OAAO;AACvB,SAAK,WAAW,YAAY;AAE5B,SAAK,iBAAiB,SAAS,OAAK;AAClC,QAAE,eAAe;AACjB,UAAI,CAAC,KAAK,SAAU,MAAK,aAAa,KAAK,MAAM,KAAK,YAAY,CAAC,EAAE,UAAU;AAAA,IACjF,CAAC;AAAA,EACH;AAAA,EAEA,WAAW,mBAA2D;AACpE,UAAM,WAAW,iBAAiB;AAClC,QAAI,kBAAkB,IAAI,cAAc,GAAG;AACzC,WAAK,WAAW,CAAC,KAAK,cAAc,MAAM,KAAK,YAAY,KAAK,KAAK,aAAa,KAAK,MAAM,SAAS;AAAA,IACxG;AAAA,EACF;AAAA,EAEA,SAAS;AACP,WAAO;AAAA,EACT;AACF;AA/Ba,SACJ,SAAS;AAAA;AAAA,QAEH,GAAG;AAAA;AAAA;AAAA,QAGH,GAAG;AAAA;AAAA;AANL,WAAN;AAAA,EADN,cAAc,WAAW;AAAA,GACb;","names":[]}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
watch
|
|
3
|
-
} from "./chunk-ELDMXTUQ.js";
|
|
4
1
|
import {
|
|
5
2
|
testContext,
|
|
6
3
|
testElement
|
|
7
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-E3656TSN.js";
|
|
5
|
+
import {
|
|
6
|
+
watch
|
|
7
|
+
} from "./chunk-4YG2FPKK.js";
|
|
8
8
|
import {
|
|
9
9
|
__decorateClass
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-44VE5POH.js";
|
|
11
11
|
|
|
12
12
|
// src/lib/qti-test/components/test-component.abstract.ts
|
|
13
13
|
import { consume } from "@lit/context";
|
|
@@ -115,4 +115,4 @@ __decorateClass([
|
|
|
115
115
|
export {
|
|
116
116
|
TestComponent
|
|
117
117
|
};
|
|
118
|
-
//# sourceMappingURL=chunk-
|
|
118
|
+
//# sourceMappingURL=chunk-KVFH5VBC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/qti-test/components/test-component.abstract.ts","../src/lib/decorators/prop-internal-state.ts"],"sourcesContent":["import { consume } from '@lit/context';\nimport { LitElement } from 'lit';\nimport { state } from 'lit/decorators.js';\nimport { propInternalState } from '../../decorators';\nimport { testContext, testElement, TestElement, TestContext } from '../core/context';\nimport { watch } from '../../decorators/watch';\n\nexport abstract class TestComponent extends LitElement {\n @propInternalState({\n type: Boolean,\n reflect: true,\n aria: 'ariaDisabled' // Maps to `aria-disabled` attribute\n })\n public disabled = true;\n\n @state()\n @consume({ context: testContext, subscribe: true })\n protected _testContext?: TestContext;\n\n @state()\n @consume({ context: testElement, subscribe: true })\n protected _testElement?: TestElement;\n @watch('_testElement')\n _handleTestElementChange(_oldValue: TestElement, newValue: TestElement) {\n if (newValue.el) {\n this.disabled = false;\n }\n }\n\n protected _internals: ElementInternals;\n\n protected items;\n protected itemIndex;\n protected view;\n\n constructor() {\n super();\n this._internals = this.attachInternals();\n }\n\n protected willUpdate(changedProperties: Map<string | number | symbol, unknown>) {\n if (changedProperties.has('_testContext')) {\n const { items = [], navItemId } = this._testContext ?? {};\n this.itemIndex = items.findIndex(item => item.identifier === navItemId);\n this.items = items;\n this.view = this._testContext?.view;\n }\n }\n\n protected _switchView(view: string) {\n this.dispatchEvent(\n new CustomEvent('on-test-switch-view', {\n composed: true,\n bubbles: true,\n detail: view\n })\n );\n }\n\n protected _requestItem(identifier: string): void {\n this.dispatchEvent(\n new CustomEvent('qti-request-test-item', {\n composed: true,\n bubbles: true,\n detail: identifier\n })\n );\n }\n}\n","import { ReactiveElement } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { 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,eAAe;AACxB,SAAS,kBAAkB;AAC3B,SAAS,aAAa;;;ACDtB,SAAS,gBAAgB;AAQlB,SAAS,kBAAkB,SAA+B;AAC/D,SAAO,CAAC,mBAAwB,SAAiB;AAE/C,aAAS,OAAO,EAAE,mBAAmB,IAAI;AAGzC,UAAM,MAAM,KAAK,IAAI;AAErB,WAAO,eAAe,mBAAmB,MAAM;AAAA,MAC7C,MAAM;AACJ,eAAO,KAAK,GAAG;AAAA,MACjB;A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AAS;AAAA,QACT,QAAQ;AAAA,MACV,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEU,aAAa,YAA0B;AAC/C,SAAK;AAAA,MACH,IAAI,YAAY,yBAAyB;AAAA,QACvC,UAAU;AAAA,QACV,SAAS;AAAA,QACT,QAAQ;AAAA,MACV,CAAC;AAAA,IACH;AAAA,EACF;AACF;AAvDS;AAAA,EALN,kBAAkB;AAAA,IACjB,MAAM;AAAA,IACN,SAAS;AAAA,IACT,MAAM;AAAA;AAAA,EACR,CAAC;AAAA,GALmB,cAMb;AAIG;AAAA,EAFT,MAAM;AAAA,EACN,QAAQ,EAAE,SAAS,aAAa,WAAW,KAAK,CAAC;AAAA,GAT9B,cAUV;AAIA;AAAA,EAFT,MAAM;AAAA,EACN,QAAQ,EAAE,SAAS,aAAa,WAAW,KAAK,CAAC;AAAA,GAb9B,cAcV;AAEV;AAAA,EADC,MAAM,cAAc;AAAA,GAfD,cAgBpB;","names":[]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import {
|
|
2
|
+
btn,
|
|
3
|
+
dis
|
|
4
|
+
} from "./chunk-UB5K44DB.js";
|
|
5
|
+
import {
|
|
6
|
+
TestComponent
|
|
7
|
+
} from "./chunk-O3GIZH57.js";
|
|
8
|
+
import {
|
|
9
|
+
__decorateClass
|
|
10
|
+
} from "./chunk-44VE5POH.js";
|
|
11
|
+
|
|
12
|
+
// src/lib/qti-test/components/test-item-link.ts
|
|
13
|
+
import { css, html } from "lit";
|
|
14
|
+
import { customElement, property } from "lit/decorators.js";
|
|
15
|
+
var TestItemLink = class extends TestComponent {
|
|
16
|
+
constructor() {
|
|
17
|
+
super();
|
|
18
|
+
this.itemId = null;
|
|
19
|
+
this.addEventListener("click", () => this._requestItem(this.itemId));
|
|
20
|
+
}
|
|
21
|
+
render() {
|
|
22
|
+
return html` <slot></slot> `;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
TestItemLink.styles = css`
|
|
26
|
+
:host {
|
|
27
|
+
${btn};
|
|
28
|
+
}
|
|
29
|
+
:host([disabled]) {
|
|
30
|
+
${dis};
|
|
31
|
+
}
|
|
32
|
+
`;
|
|
33
|
+
__decorateClass([
|
|
34
|
+
property({ type: String, attribute: "item-id" })
|
|
35
|
+
], TestItemLink.prototype, "itemId", 2);
|
|
36
|
+
TestItemLink = __decorateClass([
|
|
37
|
+
customElement("test-item-link")
|
|
38
|
+
], TestItemLink);
|
|
39
|
+
|
|
40
|
+
export {
|
|
41
|
+
TestItemLink
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=chunk-LJU3MHXE.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/qti-test/components/test-item-link.ts"],"sourcesContent":["import { css, html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { TestComponent } from './test-component.abstract';\nimport * as styles from './styles';\n\n@customElement('test-item-link')\nexport class TestItemLink extends TestComponent {\n static styles = css`\n :host {\n ${styles.btn};\n }\n :host([disabled]) {\n ${styles.dis};\n }\n `;\n\n @property({ type: String, attribute: 'item-id' })\n private itemId: string = null;\n\n constructor() {\n super();\n this.addEventListener('click', () => this._requestItem(this.itemId));\n }\n\n render() {\n return html` <slot></slot> `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-item-link': TestItemLink;\n }\n}\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,KAAK,YAAY;AAC1B,SAAS,eAAe,gBAAgB;AAKjC,IAAM,eAAN,cAA2B,cAAc;AAAA,EAa9C,cAAc;AACZ,UAAM;AAHR,SAAQ,SAAiB;AAIvB,SAAK,iBAAiB,SAAS,MAAM,KAAK,aAAa,KAAK,MAAM,CAAC;AAAA,EACrE;AAAA,EAEA,SAAS;AACP,WAAO;AAAA,EACT;AACF;AArBa,aACJ,SAAS;AAAA;AAAA,QAEH,GAAG;AAAA;AAAA;AAAA,QAGH,GAAG;AAAA;AAAA;AAKR;AAAA,EADP,SAAS,EAAE,MAAM,QAAQ,WAAW,UAAU,CAAC;AAAA,GAVrC,aAWH;AAXG,eAAN;AAAA,EADN,cAAc,gBAAgB;AAAA,GAClB;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=chunk-MAC76UNI.js.map
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// src/lib/decorators/watch.ts
|
|
2
|
+
function watch(propertyName, options) {
|
|
3
|
+
const resolvedOptions = {
|
|
4
|
+
waitUntilFirstUpdate: false,
|
|
5
|
+
...options
|
|
6
|
+
};
|
|
7
|
+
return (proto, decoratedFnName) => {
|
|
8
|
+
const { update } = proto;
|
|
9
|
+
const watchedProperties = Array.isArray(propertyName) ? propertyName : [propertyName];
|
|
10
|
+
proto.update = function(changedProps) {
|
|
11
|
+
watchedProperties.forEach((property) => {
|
|
12
|
+
const key = property;
|
|
13
|
+
if (changedProps.has(key)) {
|
|
14
|
+
const oldValue = changedProps.get(key);
|
|
15
|
+
const newValue = this[key];
|
|
16
|
+
if (oldValue !== newValue) {
|
|
17
|
+
if (!resolvedOptions.waitUntilFirstUpdate || this.hasUpdated) {
|
|
18
|
+
this[decoratedFnName](oldValue, newValue);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
update.call(this, changedProps);
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// src/lib/decorators/live-query.ts
|
|
29
|
+
function liveQuery(querySelector, _options) {
|
|
30
|
+
let observer;
|
|
31
|
+
return (proto, decoratedFnName) => {
|
|
32
|
+
const { connectedCallback, disconnectedCallback } = proto;
|
|
33
|
+
proto.connectedCallback = function() {
|
|
34
|
+
connectedCallback.call(this);
|
|
35
|
+
const callback = (mutationList) => {
|
|
36
|
+
const elementsToWatch = Array.from(this.querySelectorAll(querySelector)).concat(
|
|
37
|
+
Array.from(this.shadowRoot?.querySelectorAll(querySelector) || [])
|
|
38
|
+
);
|
|
39
|
+
for (const mutation of mutationList) {
|
|
40
|
+
const addedNodes = Array.from(mutation.addedNodes).map((e) => e);
|
|
41
|
+
const removedNodes = Array.from(mutation.addedNodes).map((e) => e);
|
|
42
|
+
if (mutation.type === "childList" && addedNodes.find((n) => elementsToWatch.includes(n))) {
|
|
43
|
+
this[decoratedFnName](addedNodes, removedNodes);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
observer = new MutationObserver(callback);
|
|
48
|
+
observer.observe(this, { childList: true, subtree: true });
|
|
49
|
+
const elementsAdded = Array.from(this.querySelectorAll(querySelector)).concat(
|
|
50
|
+
Array.from(this.shadowRoot?.querySelectorAll(querySelector) || [])
|
|
51
|
+
);
|
|
52
|
+
this[decoratedFnName](Array.from(elementsAdded), []);
|
|
53
|
+
};
|
|
54
|
+
proto.disconnectedCallback = function() {
|
|
55
|
+
disconnectedCallback.call(this);
|
|
56
|
+
observer.disconnect();
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export {
|
|
62
|
+
watch,
|
|
63
|
+
liveQuery
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=chunk-NUXEGEMP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/decorators/watch.ts","../src/lib/decorators/live-query.ts"],"sourcesContent":["import type { LitElement } from 'lit';\n\ntype UpdateHandler = (prev?: unknown, next?: unknown) => void;\n\ntype NonUndefined<A> = A extends undefined ? never : A;\n\nexport type UpdateHandlerFunctionKeys<T extends object> = {\n [K in keyof T]-?: NonUndefined<T[K]> extends UpdateHandler ? K : never;\n}[keyof T];\n\ninterface WatchOptions {\n /**\n * If true, will only start watching after the initial update/render\n */\n waitUntilFirstUpdate?: boolean;\n}\n\n/**\n * Runs when observed properties change, e.g. @property or @state, but before the component updates. To wait for an\n * update to complete after a change occurs, use `await this.updateComplete` in the handler. To start watching after the\n * 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 */\nexport function watch(propertyName: string | string[], options?: WatchOptions) {\n const resolvedOptions: Required<WatchOptions> = {\n waitUntilFirstUpdate: false,\n ...options\n };\n return <ElemClass extends LitElement>(\n proto: ElemClass,\n decoratedFnName: UpdateHandlerFunctionKeys<ElemClass> | any\n ) => {\n // @ts-expect-error - update is a protected property\n const { update } = proto;\n const watchedProperties = Array.isArray(propertyName) ? propertyName : [propertyName];\n\n // @ts-expect-error - update is a protected property\n proto.update = function (this: ElemClass, changedProps: Map<keyof ElemClass, ElemClass[keyof ElemClass]>) {\n watchedProperties.forEach(property => {\n const key = property as keyof ElemClass;\n if (changedProps.has(key)) {\n const oldValue = changedProps.get(key);\n const newValue = this[key];\n\n if (oldValue !== newValue) {\n if (!resolvedOptions.waitUntilFirstUpdate || this.hasUpdated) {\n (this[decoratedFnName] as unknown as UpdateHandler)(oldValue, newValue);\n }\n }\n }\n });\n\n update.call(this, changedProps);\n };\n };\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"],"mappings":";AA6BO,SAAS,MAAM,cAAiC,SAAwB;AAC7E,QAAM,kBAA0C;AAAA,IAC9C,sBAAsB;AAAA,IACtB,GAAG;AAAA,EACL;AACA,SAAO,CACL,OACA,oBACG;AAEH,UAAM,EAAE,OAAO,IAAI;AACnB,UAAM,oBAAoB,MAAM,QAAQ,YAAY,IAAI,eAAe,CAAC,YAAY;AAGpF,UAAM,SAAS,SAA2B,cAAgE;AACxG,wBAAkB,QAAQ,cAAY;AACpC,cAAM,MAAM;AACZ,YAAI,aAAa,IAAI,GAAG,GAAG;AACzB,gBAAM,WAAW,aAAa,IAAI,GAAG;AACrC,gBAAM,WAAW,KAAK,GAAG;AAEzB,cAAI,aAAa,UAAU;AACzB,gBAAI,CAAC,gBAAgB,wBA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W;AAAA,IACtB;AAAA,EACF;AACF;","names":[]}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import {
|
|
2
|
+
watch
|
|
3
|
+
} from "./chunk-NUXEGEMP.js";
|
|
4
|
+
import {
|
|
5
|
+
__decorateClass
|
|
6
|
+
} from "./chunk-44VE5POH.js";
|
|
7
|
+
|
|
8
|
+
// src/lib/qti-test/components/test-component.abstract.ts
|
|
9
|
+
import { consume } from "@lit/context";
|
|
10
|
+
import { LitElement } from "lit";
|
|
11
|
+
import { state } from "lit/decorators.js";
|
|
12
|
+
|
|
13
|
+
// src/lib/decorators/prop-internal-state.ts
|
|
14
|
+
import { property } from "lit/decorators.js";
|
|
15
|
+
function propInternalState(options) {
|
|
16
|
+
return (protoOrDescriptor, name) => {
|
|
17
|
+
property(options)(protoOrDescriptor, name);
|
|
18
|
+
const key = `__${name}`;
|
|
19
|
+
Object.defineProperty(protoOrDescriptor, name, {
|
|
20
|
+
get() {
|
|
21
|
+
return this[key];
|
|
22
|
+
},
|
|
23
|
+
set(value) {
|
|
24
|
+
const oldValue = this[key];
|
|
25
|
+
this[key] = value;
|
|
26
|
+
if (oldValue !== value) {
|
|
27
|
+
if (this._internals?.states) {
|
|
28
|
+
const stateName = name.toLowerCase();
|
|
29
|
+
if (value) {
|
|
30
|
+
this._internals.states.add(`--${stateName}`);
|
|
31
|
+
} else {
|
|
32
|
+
this._internals.states.delete(`--${stateName}`);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
if (options.aria && this._internals) {
|
|
36
|
+
const ariaAttribute = options.aria;
|
|
37
|
+
if (value) {
|
|
38
|
+
this._internals[ariaAttribute] = "true";
|
|
39
|
+
} else {
|
|
40
|
+
this._internals[ariaAttribute] = null;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
this.requestUpdate(name, oldValue);
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
configurable: true,
|
|
47
|
+
enumerable: true
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// src/lib/qti-test/core/context/test.context.ts
|
|
53
|
+
import { createContext } from "@lit/context";
|
|
54
|
+
var testContext = createContext(Symbol("test"));
|
|
55
|
+
var testElement = createContext(Symbol("testElement"));
|
|
56
|
+
|
|
57
|
+
// src/lib/qti-test/components/test-component.abstract.ts
|
|
58
|
+
var TestComponent = class extends LitElement {
|
|
59
|
+
constructor() {
|
|
60
|
+
super();
|
|
61
|
+
this.disabled = true;
|
|
62
|
+
this._internals = this.attachInternals();
|
|
63
|
+
}
|
|
64
|
+
_handleTestElementChange(_oldValue, newValue) {
|
|
65
|
+
if (newValue.el) {
|
|
66
|
+
this.disabled = false;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
willUpdate(changedProperties) {
|
|
70
|
+
if (changedProperties.has("_testContext")) {
|
|
71
|
+
const { items = [], navItemId } = this._testContext ?? {};
|
|
72
|
+
this.itemIndex = items.findIndex((item) => item.identifier === navItemId);
|
|
73
|
+
this.items = items;
|
|
74
|
+
this.view = this._testContext?.view;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
_switchView(view) {
|
|
78
|
+
this.dispatchEvent(
|
|
79
|
+
new CustomEvent("on-test-switch-view", {
|
|
80
|
+
composed: true,
|
|
81
|
+
bubbles: true,
|
|
82
|
+
detail: view
|
|
83
|
+
})
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
_requestItem(identifier) {
|
|
87
|
+
this.dispatchEvent(
|
|
88
|
+
new CustomEvent("qti-request-test-item", {
|
|
89
|
+
composed: true,
|
|
90
|
+
bubbles: true,
|
|
91
|
+
detail: identifier
|
|
92
|
+
})
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
__decorateClass([
|
|
97
|
+
propInternalState({
|
|
98
|
+
type: Boolean,
|
|
99
|
+
reflect: true,
|
|
100
|
+
aria: "ariaDisabled"
|
|
101
|
+
// Maps to `aria-disabled` attribute
|
|
102
|
+
})
|
|
103
|
+
], TestComponent.prototype, "disabled", 2);
|
|
104
|
+
__decorateClass([
|
|
105
|
+
state(),
|
|
106
|
+
consume({ context: testContext, subscribe: true })
|
|
107
|
+
], TestComponent.prototype, "_testContext", 2);
|
|
108
|
+
__decorateClass([
|
|
109
|
+
state(),
|
|
110
|
+
consume({ context: testElement, subscribe: true })
|
|
111
|
+
], TestComponent.prototype, "_testElement", 2);
|
|
112
|
+
__decorateClass([
|
|
113
|
+
watch("_testElement")
|
|
114
|
+
], TestComponent.prototype, "_handleTestElementChange", 1);
|
|
115
|
+
|
|
116
|
+
export {
|
|
117
|
+
testContext,
|
|
118
|
+
testElement,
|
|
119
|
+
TestComponent
|
|
120
|
+
};
|
|
121
|
+
//# sourceMappingURL=chunk-O3GIZH57.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/qti-test/components/test-component.abstract.ts","../src/lib/decorators/prop-internal-state.ts","../src/lib/qti-test/core/context/test.context.ts"],"sourcesContent":["import { consume } from '@lit/context';\nimport { LitElement } from 'lit';\nimport { state } from 'lit/decorators.js';\nimport { propInternalState } from '../../decorators';\nimport { testContext, testElement, TestElement, TestContext } from '../core/context';\nimport { watch } from '../../decorators/watch';\n\nexport abstract class TestComponent extends LitElement {\n @propInternalState({\n type: Boolean,\n reflect: true,\n aria: 'ariaDisabled' // Maps to `aria-disabled` attribute\n })\n public disabled = true;\n\n @state()\n @consume({ context: testContext, subscribe: true })\n protected _testContext?: TestContext;\n\n @state()\n @consume({ context: testElement, subscribe: true })\n protected _testElement?: TestElement;\n @watch('_testElement')\n _handleTestElementChange(_oldValue: TestElement, newValue: TestElement) {\n if (newValue.el) {\n this.disabled = false;\n }\n }\n\n protected _internals: ElementInternals;\n\n protected items;\n protected itemIndex;\n protected view;\n\n constructor() {\n super();\n this._internals = this.attachInternals();\n }\n\n protected willUpdate(changedProperties: Map<string | number | symbol, unknown>) {\n if (changedProperties.has('_testContext')) {\n const { items = [], navItemId } = this._testContext ?? {};\n this.itemIndex = items.findIndex(item => item.identifier === navItemId);\n this.items = items;\n this.view = this._testContext?.view;\n }\n }\n\n protected _switchView(view: string) {\n this.dispatchEvent(\n new CustomEvent('on-test-switch-view', {\n composed: true,\n bubbles: true,\n detail: view\n })\n );\n }\n\n protected _requestItem(identifier: string): void {\n this.dispatchEvent(\n new CustomEvent('qti-request-test-item', {\n composed: true,\n bubbles: true,\n detail: identifier\n })\n );\n }\n}\n","import { ReactiveElement } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { 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","import { createContext } from '@lit/context';\nimport { QtiAssessmentTest } from '../qti-assessment-test';\nimport { ItemContext, VariableDeclaration } from '../../../qti-components';\nimport { View } from '../mixins/test-view.mixin';\n\nexport interface TestContext {\n items: (ItemContext & { category?: string })[];\n testOutcomeVariables: VariableDeclaration<string | string[]>[];\n navPartId?: string | null;\n navSectionId?: string | null;\n navItemId?: string | null;\n navItemLoading?: boolean;\n navTestLoading?: boolean;\n view?: View;\n}\n\nexport const testContext = createContext<Readonly<TestContext>>(Symbol('test'));\n\nexport type TestElement = {\n el: QtiAssessmentTest;\n};\n\nexport const testElement = createContext<Readonly<TestElement>>(Symbol('testElement'));\n"],"mappings":";;;;;;;;AAAA,SAAS,eAAe;AACxB,SAAS,kBAAkB;AAC3B,SAAS,aAAa;;;ACDtB,SAAS,gBAAgB;AAQlB,SAAS,kBAAkB,SAA+B;AAC/D,SAAO,CAAC,mBAAwB,SAAiB;AAE/C,aAAS,OAAO,EAAE,mBAAmB,IAAI;AAGzC,UAAM,MAAM,KAAK,IAAI;AAErB,WAAO,eAAe,mBAAmB,MAAM;AAAA,MAC7C,MAAM;AACJ,eAAO,KAAK,GAAG;AAAA,MACjB;AAAA,MACA,IAAI,OAAY;AACd,cAAM,WAAW,KAAK,GAAG;AACzB,aAAK,GAAG,IAAI;AAGZ,YAAI,aAAa,OAAO;AAEtB,cAAI,KAAK,YAAY,QAAQ;AAC3B,kBAAM,YAAY,KAAK,YAAY;AACnC,gBAAI,OAAO;AACT,mBAAK,WAAW,OAAO,IAAI,KAAK,SAAS,EAAE;AAAA,YAC7C,OAAO;AACL,mBAAK,WAAW,OAAO,OAAO,KAAK,SAAS,EAAE;AAAA,YAChD;AAAA,UACF;AAGA,cAAI,QAAQ,QAAQ,KAAK,YAAY;AACnC,kBAAM,gBAAgB,QAAQ;AAC9B,gBAAI,OAAO;AACT,mBAAK,WAAW,aAAa,IAAI;AAAA,YACnC,OAAO;AACL,mBAAK,WAAW,aAAa,IAAI;AAAA,YACnC;AAAA,UACF;AAGA,UAAC,KAAyB,cAAc,MAAM,QAAQ;AAAA,QACxD;AAAA,MACF;AAAA,MACA,cAAc;AAAA,MACd,YAAY;AAAA,IACd,CAAC;AAAA,EACH;AACF;;;ACvDA,SAAS,qBAAqB;AAgBvB,IAAM,cAAc,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