@citolab/qti-components 7.0.1 → 7.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/cdn/index.global.js +1 -1
  2. package/cdn/index.js +8297 -0
  3. package/dist/custom-elements.json +27271 -0
  4. package/dist/{qti-test/index.d.ts → index.d.ts} +170 -4
  5. package/dist/index.js +17164 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/item.css +257 -46
  8. package/dist/{qti-loader → loader}/index.d.ts +1 -1
  9. package/dist/qti-components-jsx.d.ts +33 -61
  10. package/dist/{qti-simple-choice-CynLWb8d.d.cts → qti-simple-choice-UTrFa_RQ.d.ts} +11 -19
  11. package/dist/vscode.html-custom-data.json +15 -11
  12. package/package.json +41 -58
  13. package/readme.md +55 -0
  14. package/README.md +0 -85
  15. package/cdn/index.min.cjs +0 -4489
  16. package/cdn/index.min.js +0 -4489
  17. package/dist/qti-components/index.cjs +0 -6704
  18. package/dist/qti-components/index.cjs.map +0 -1
  19. package/dist/qti-components/index.d.cts +0 -150
  20. package/dist/qti-components/index.d.ts +0 -150
  21. package/dist/qti-components/index.js +0 -6593
  22. package/dist/qti-components/index.js.map +0 -1
  23. package/dist/qti-item/index.cjs +0 -89
  24. package/dist/qti-item/index.cjs.map +0 -1
  25. package/dist/qti-item/index.d.cts +0 -24
  26. package/dist/qti-item/index.d.ts +0 -24
  27. package/dist/qti-item/index.js +0 -65
  28. package/dist/qti-item/index.js.map +0 -1
  29. package/dist/qti-loader/index.cjs +0 -332
  30. package/dist/qti-loader/index.cjs.map +0 -1
  31. package/dist/qti-loader/index.d.cts +0 -20
  32. package/dist/qti-simple-choice-CynLWb8d.d.ts +0 -1185
  33. package/dist/qti-test/index.cjs +0 -4632
  34. package/dist/qti-test/index.cjs.map +0 -1
  35. package/dist/qti-test/index.d.cts +0 -304
  36. package/dist/qti-test/index.js +0 -4599
  37. package/dist/qti-test/index.js.map +0 -1
  38. package/dist/qti-transformers/index.cjs +0 -316
  39. package/dist/qti-transformers/index.cjs.map +0 -1
  40. package/dist/qti-transformers/index.d.cts +0 -75
  41. /package/dist/{qti-loader → loader}/index.js +0 -0
  42. /package/dist/{qti-loader → loader}/index.js.map +0 -0
  43. /package/dist/{qti-transformers → transformers}/index.d.ts +0 -0
  44. /package/dist/{qti-transformers → transformers}/index.js +0 -0
  45. /package/dist/{qti-transformers → transformers}/index.js.map +0 -0
@@ -619,6 +619,7 @@
619
619
  "name": "qti-match-interaction",
620
620
  "description": "\n---\n\n\n### **Events:**\n - **qti-register-interaction**\n- **qti-interaction-response**",
621
621
  "attributes": [
622
+ { "name": "class", "values": [] },
622
623
  { "name": "response-identifier", "values": [] },
623
624
  { "name": "min-associations", "values": [] },
624
625
  { "name": "max-associations", "values": [] },
@@ -754,6 +755,7 @@
754
755
  "name": "test-element",
755
756
  "description": "\n---\n\n\n### **Events:**\n - **qti-register-interaction**\n- **qti-interaction-response**",
756
757
  "attributes": [
758
+ { "name": "class", "values": [] },
757
759
  {
758
760
  "name": "shuffle",
759
761
  "description": "<span style=\"color:blue\">some *blue* text</span>. Does not work in storybook",
@@ -769,6 +771,7 @@
769
771
  "name": "test-element",
770
772
  "description": "\n---\n\n\n### **Events:**\n - **qti-register-interaction**\n- **qti-interaction-response**",
771
773
  "attributes": [
774
+ { "name": "class", "values": [] },
772
775
  {
773
776
  "name": "shuffle",
774
777
  "description": "<span style=\"color:blue\">some *blue* text</span>. Does not work in storybook",
@@ -784,6 +787,7 @@
784
787
  "name": "test-element",
785
788
  "description": "\n---\n\n\n### **Events:**\n - **qti-register-interaction**\n- **qti-interaction-response**",
786
789
  "attributes": [
790
+ { "name": "class", "values": [] },
787
791
  {
788
792
  "name": "shuffle",
789
793
  "description": "<span style=\"color:blue\">some *blue* text</span>. Does not work in storybook",
@@ -795,15 +799,6 @@
795
799
  ],
796
800
  "references": []
797
801
  },
798
- {
799
- "name": "qti-item",
800
- "description": "\n---\n\n\n### **Events:**\n - **qti-item-connected**",
801
- "attributes": [
802
- { "name": "identifier", "values": [] },
803
- { "name": "href", "values": [] }
804
- ],
805
- "references": []
806
- },
807
802
  {
808
803
  "name": "qti-assessment-item-ref",
809
804
  "description": "\n---\n\n\n### **Events:**\n - **qti-assessment-item-ref-connected**",
@@ -857,12 +852,12 @@
857
852
  "references": []
858
853
  },
859
854
  {
860
- "name": "qti-player",
855
+ "name": "qti-test",
861
856
  "description": "`<qti-test>` is a custom element designed for rendering and interacting with QTI (Question and Test Interoperability) tests.\n\nThis component leverages several mixins to provide functionality for loading, navigating, processing, and displaying QTI test assessments.\n\n### Example Usage\n\nMinimal markup:\n```html\n<qti-test test=\"./path/to/assessment.xml\">\n <test-container></test-container>\n</qti-test>\n```\n\nWith navigation buttons:\n```html\n<qti-test >\n <test-container test-url=\"./path/to/assessment.xml\"></test-container>\n <div class=\"flex\">\n <test-prev></test-prev>\n <test-next></test-next>\n </div>\n</qti-test>\n```\n\nYou can use normal class names to style the elements.\nAnd you can use the `test-prev` and `test-next` elements to navigate through the test.\n---\n",
862
857
  "attributes": [
863
858
  {
864
859
  "name": "testURL",
865
- "description": "the relative location to the QTI assessment.xml file",
860
+ "description": "the relative location to the QTI assessment.xml file ### Features - **Dynamic Template Loading**: If a `<template>` element is included as a child of `<qti-test>`, its content is dynamically appended to the shadow DOM.",
866
861
  "values": []
867
862
  }
868
863
  ],
@@ -909,6 +904,15 @@
909
904
  { "name": "skip-on-category", "values": [] }
910
905
  ],
911
906
  "references": []
907
+ },
908
+ {
909
+ "name": "qti-item",
910
+ "description": "\n---\n\n\n### **Events:**\n - **qti-item-connected**",
911
+ "attributes": [
912
+ { "name": "identifier", "values": [] },
913
+ { "name": "href", "values": [] }
914
+ ],
915
+ "references": []
912
916
  }
913
917
  ]
914
918
  }
package/package.json CHANGED
@@ -21,51 +21,35 @@
21
21
  "engines": {
22
22
  "node": ">=20.0.0"
23
23
  },
24
- "version": "7.0.1",
24
+ "version": "7.0.3",
25
+ "main": "dist/index.js",
25
26
  "type": "module",
26
27
  "exports": {
27
- "./qti-components": {
28
- "import": "./dist/qti-components/index.js",
29
- "require": "./dist/qti-components/index.cjs"
28
+ ".": {
29
+ "import": "./dist/index.js"
30
30
  },
31
- "./qti-transformers": {
32
- "import": "./dist/qti-transformers/index.js",
33
- "require": "./dist/qti-transformers/index.cjs"
31
+ "./transformers": {
32
+ "import": "./dist/transformers/index.js"
34
33
  },
35
- "./qti-item": {
36
- "import": "./dist/qti-item/index.js",
37
- "require": "./dist/qti-item/index.cjs"
38
- },
39
- "./qti-test": {
40
- "import": "./dist/qti-test/index.js",
41
- "require": "./dist/qti-test/index.cjs"
42
- },
43
- "./qti-loader": {
44
- "import": "./dist/qti-loader/index.js",
45
- "require": "./dist/qti-loader/index.cjs"
34
+ "./loader": {
35
+ "import": "./dist/loader/index.js"
46
36
  },
47
37
  "./item.css": "./dist/item.css",
48
- "./cdn/index.js": "./dist/cdn/index.js",
49
- "./cdn/index.min.js": "./dist/cdn/index.min.js",
50
- "./cdn/index.global.js": "./dist/cdn/index.global.js"
38
+ "./cdn/index.js": "./cdn/index.js",
39
+ "./cdn/index.global.js": "./cdn/index.global.js",
40
+ "./react": "./dist//qti-components-jsx.d.ts"
51
41
  },
52
42
  "types": "./dist/qti-components/index.d.ts",
53
43
  "typesVersions": {
54
44
  "*": {
55
- "qti-components": [
56
- "./dist/qti-components/index.d.ts"
57
- ],
58
- "qti-transformers": [
59
- "./dist/qti-transformers/index.d.ts"
45
+ ".": [
46
+ "./dist/index.d.ts"
60
47
  ],
61
- "qti-item": [
62
- "./dist/qti-item/index.d.ts"
48
+ "transformers": [
49
+ "./dist/transformers/index.d.ts"
63
50
  ],
64
- "qti-test": [
65
- "./dist/qti-test/index.d.ts"
66
- ],
67
- "qti-loader": [
68
- "./dist/qti-loader/index.d.ts"
51
+ "loader": [
52
+ "./dist/loader/index.d.ts"
69
53
  ]
70
54
  }
71
55
  },
@@ -75,20 +59,21 @@
75
59
  ],
76
60
  "scripts": {
77
61
  "storybook": "wireit",
78
- "watch:build": "npm run build --watch",
62
+ "storybook:docs": "wireit",
63
+ "build:watch": "npm run build --watch",
79
64
  "npm:publish": "np",
80
65
  "---": "-",
81
66
  "build": "wireit",
82
67
  "test": "wireit",
83
68
  "attw": "wireit",
84
- "lint": "wireit",
69
+ "lint": "eslint src/**/*.ts",
85
70
  "cem": "wireit",
71
+ "css": "wireit",
86
72
  "act": "act",
87
73
  "vite": "vite",
88
74
  "stylelint": "stylelint \"src/**/*.css\"",
89
75
  "build-storybook": "storybook build",
90
76
  "storybook:test": "test-storybook",
91
- "storybook:docs": "wireit",
92
77
  "storybook:docs:build": "wireit",
93
78
  "chromatic": "node chromatic-runner.cjs",
94
79
  "----hooks----": "-",
@@ -99,7 +84,7 @@
99
84
  "storybook": {
100
85
  "command": "storybook dev -p 6006",
101
86
  "dependencies": [
102
- "cem:watch"
87
+ "storybook:cem:watch"
103
88
  ]
104
89
  },
105
90
  "build": {
@@ -112,16 +97,23 @@
112
97
  "css"
113
98
  ],
114
99
  "files": [
115
- "src/**/*.{ts,css}",
100
+ "src/**/*.{ts}",
101
+ "tsconfig.json",
102
+ "!src/**/*.{test,spec,stories}.ts",
103
+ "package.json"
104
+ ]
105
+ },
106
+ "cem": {
107
+ "command": "cem analyze",
108
+ "files": [
109
+ "src/**/*.ts",
116
110
  "!src/**/*.{test,spec,stories}.ts"
117
- ],
118
- "output": [
119
- "dist/**/*",
120
- "cdn/**/*",
121
- "!dist/item.css",
122
- "!dist/vscode.*",
123
- "!dist/qti-components-jsx.d.ts",
124
- "!dist/custom-element-eslint-rules.js"
111
+ ]
112
+ },
113
+ "css": {
114
+ "command": "postcss src/item.css -d dist -m",
115
+ "files": [
116
+ "src/**/*.css"
125
117
  ]
126
118
  },
127
119
  "test": {
@@ -133,7 +125,7 @@
133
125
  "storybook:docs": {
134
126
  "command": "storybook dev --docs -c .storybook-docs",
135
127
  "dependencies": [
136
- "cem:watch"
128
+ "storybook:cem:watch"
137
129
  ]
138
130
  },
139
131
  "storybook:docs:build": {
@@ -142,13 +134,7 @@
142
134
  "cem"
143
135
  ]
144
136
  },
145
- "lint": {
146
- "command": "eslint --color --cache --cache-location .eslintcache src/lib/**/*.ts"
147
- },
148
- "cem": {
149
- "command": "cem analyze"
150
- },
151
- "cem:watch": {
137
+ "storybook:cem:watch": {
152
138
  "command": "cem analyze --watch",
153
139
  "service": {
154
140
  "readyWhen": {
@@ -156,11 +142,8 @@
156
142
  }
157
143
  }
158
144
  },
159
- "css": {
160
- "command": "postcss src/item.css -d dist -m"
161
- },
162
145
  "attw": {
163
- "command": "attw --pack --exclude-entrypoints ./item.css ./cdn/index.js ./cdn/index.global.js ./cdn/index.min.js",
146
+ "command": "attw --profile esm-only --pack --exclude-entrypoints ./item.css ./cdn/index.js ./cdn/index.global.js ./cdn/index.min.js",
164
147
  "dependencies": [
165
148
  "build"
166
149
  ]
package/readme.md ADDED
@@ -0,0 +1,55 @@
1
+ # @citolab/qti-components
2
+
3
+ <a href="https://www.repostatus.org/#wip"><img src="https://www.repostatus.org/badges/latest/wip.svg" alt="Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public." /></a>
4
+
5
+ [![npm version](https://badge.fury.io/js/%40citolab%2Fqti-components.svg)](https://badge.fury.io/js/%40citolab%2Fqti-components)
6
+ [![License](https://img.shields.io/badge/license-GPL-blue.svg)](https://opensource.org/license/gpl-2-0/)
7
+
8
+ @citolab/qti-components is a web component library that can be used to render 1EdTech QTI items.
9
+ It's highly customizable and can be integrated in almost every web application.
10
+
11
+ ## Installation
12
+
13
+ ### CDN
14
+
15
+ Import the components with the CDN version
16
+
17
+ ```html
18
+ <script type="module">
19
+ import 'https://unpkg.com/@citolab/qti-components/cdn';
20
+ </script>
21
+ ```
22
+
23
+ ### NPM
24
+
25
+ Or use npm to install the package:
26
+
27
+ ```shell
28
+ npm install @citolab/qti-components
29
+ ```
30
+
31
+ To use @citolab/qti-components, you need to register the web components. By registering the web components, the browser knows how to display the item and create a fully functional test.
32
+
33
+ ```javascript
34
+ import '@citolab/qti-components';
35
+ ```
36
+
37
+ ## Storybook
38
+
39
+ Explore the complete description of supported QTI tags, examples, and the ability to interactively play with changing attributes of the QTI items in our [Storybook](https://qti-components.citolab.nl/).
40
+
41
+ ## Contributing
42
+
43
+ Contributions are welcome! Please follow these guidelines when contributing:
44
+
45
+ - Fork the repository and clone it to your local machine
46
+ - Create a new branch for your feature or bug fix
47
+ - Commit your changes with clear and concise messages
48
+ - Push your changes to your forked repository
49
+ - Open a pull request to the original repository
50
+
51
+ ## License
52
+
53
+ This project is licensed under the [GPLv3 License](LICENSE).
54
+
55
+ Please note that the licensing is GPLv3 if you want to use it in another way, feel free to ask!
package/README.md DELETED
@@ -1,85 +0,0 @@
1
- # @citolab/qti-components
2
-
3
- <a href="https://www.repostatus.org/#wip"><img src="https://www.repostatus.org/badges/latest/wip.svg" alt="Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public." /></a>
4
-
5
- [![npm version](https://badge.fury.io/js/%40citolab%2Fqti-components.svg)](https://badge.fury.io/js/%40citolab%2Fqti-components)
6
- [![License](https://img.shields.io/badge/license-GPL-blue.svg)](https://opensource.org/license/gpl-2-0/)
7
-
8
- @citolab/qti-components is a web component library that can be used to render 1EdTech QTI items.
9
- It's highly customizable and can be integrated in almost every web application.
10
-
11
- ## Installation
12
-
13
- Use npm to install the package:
14
-
15
- ```shell
16
- npm install @citolab/qti-components
17
- ```
18
-
19
- ## Usage
20
-
21
- To use @citolab/qti-components, you need to register the web components and import the required CSS file. By registering the web components, the browser knows how to display the item and create a fully functional item.
22
-
23
- Here's a basic example:
24
-
25
- ```javascript
26
- import * as QTI from 'https://unpkg.com/@citolab/qti-components@latest/dist/index.js';
27
- ```
28
-
29
- ```css
30
- @import 'https://unpkg.com/@citolab/qti-components@latest/dist/index.css';'
31
- ```
32
-
33
- ```html
34
- <qti-assessment-item identifier="choice" title="Unattended Luggage" adaptive="false" time-dependent="false">
35
- <qti-response-declaration identifier="RESPONSE" cardinality="single" base-type="identifier">
36
- <qti-correct-response>
37
- <qti-value>ChoiceA</qti-value>
38
- </qti-correct-response>
39
- </qti-response-declaration>
40
- <qti-outcome-declaration identifier="SCORE" cardinality="single" base-type="float">
41
- <qti-default-value>
42
- <qti-value>0</qti-value>
43
- </qti-default-value>
44
- </qti-outcome-declaration>
45
- <qti-item-body>
46
- <p>Look at the text in the picture.</p>
47
- <p>
48
- <img src="images/sign.png" alt="NEVER LEAVE LUGGAGE UNATTENDED" />
49
- </p>
50
- <qti-choice-interaction response-identifier="RESPONSE" shuffle="false" max-choices="1">
51
- <qti-prompt>What does it say?</qti-prompt>
52
- <qti-simple-choice identifier="ChoiceA">You must stay with your luggage at all times.</qti-simple-choice>
53
- <qti-simple-choice identifier="ChoiceB">Do not let someone else look after your luggage.</qti-simple-choice>
54
- <qti-simple-choice identifier="ChoiceC">Remember your luggage when you leave.</qti-simple-choice>
55
- </qti-choice-interaction>
56
- </qti-item-body>
57
- <qti-response-processing template="https://purl.imsglobal.org/spec/qti/v3p0/rptemplates/match_correct.xml" />
58
- </qti-assessment-item>
59
- ```
60
-
61
- You can see a working example here [JSFiddle](https://jsfiddle.net/mrklein/s97Ld0gn).
62
-
63
- ## Storybook
64
-
65
- Explore the complete description of supported QTI tags, examples, and the ability to interactively play with changing attributes of the QTI items in our [Storybook](https://qti-components.citolab.nl/).
66
-
67
- ## Contributing
68
-
69
- Contributions are welcome! Please follow these guidelines when contributing:
70
-
71
- - Fork the repository and clone it to your local machine
72
- - Create a new branch for your feature or bug fix
73
- - Commit your changes with clear and concise messages
74
- - Push your changes to your forked repository
75
- - Open a pull request to the original repository
76
-
77
- ## License
78
-
79
- This project is licensed under the [GPLv3 License](LICENSE).
80
-
81
- Please note that the licensing is GPLv3 if you want to use it in another way, feel free to ask!
82
-
83
- ```
84
-
85
- ```