@citolab/qti-components 6.6.1-1 → 6.6.1-11

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.
@@ -0,0 +1,36 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-KRFEDZFG.cjs');var p=()=>{let r,n={async load(e){return new Promise((t,s)=>{m(e).then(o=>(r=o,t(n)))})},parse(e){return r=u(e),n},path:e=>(x(r,e),n),html(){return a(r)},xml(){return new XMLSerializer().serializeToString(r)}};return n},g= exports.qtiTransformTest =()=>{let r,n={async load(e){return new Promise((t,s)=>{m(e).then(o=>(r=o,t(n)))})},items(){return c(r)},html(){return a(r)},xml(){return new XMLSerializer().serializeToString(r)}};return n},i=`
2
+ <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
3
+ <xsl:output method="html" version="5.0" encoding="UTF-8" indent="yes" />
4
+ <xsl:template match="@*|node()">
5
+ <xsl:copy>
6
+ <xsl:apply-templates select="@*|node()"/>
7
+ </xsl:copy>
8
+ </xsl:template>
9
+
10
+ <!-- convert CDATA to comments -->
11
+ <xsl:template match="text()[contains(., 'CDATA')]">
12
+ <strong>
13
+ <xsl:comment>
14
+ <xsl:value-of select="."/>
15
+ </xsl:comment>
16
+ <strong>
17
+ </xsl:template>
18
+
19
+ <!-- remove xml comments -->
20
+ <xsl:template match="comment()" />
21
+
22
+ <!-- remove existing namespaces -->
23
+ <xsl:template match="*">
24
+ <!-- remove element prefix -->
25
+ <xsl:element name="{local-name()}">
26
+ <!-- process attributes -->
27
+ <xsl:for-each select="@*">
28
+ <!-- remove attribute prefix -->
29
+ <xsl:attribute name="{local-name()}">
30
+ <xsl:value-of select="."/>
31
+ </xsl:attribute>
32
+ </xsl:for-each>
33
+ <xsl:apply-templates/>
34
+ </xsl:element>
35
+ </xsl:template>
36
+ </xsl:stylesheet>`;function c(r){let n=[];return r.querySelectorAll("qti-assessment-item-ref").forEach(e=>{let t=e.getAttribute("identifier"),s=e.getAttribute("href"),o=e.getAttribute("category");n.push({identifier:t,href:s,category:o})}),n}function m(r){return new Promise((n,e)=>{let t=new XMLHttpRequest;t.open("GET",r,!0),t.responseType="document",t.onload=()=>t.status>=200&&t.status<300?n(t.responseXML):(e(t.statusText),null),t.onerror=function(){e(t.statusText)},t.send()})}function u(r){return new DOMParser().parseFromString(r,"text/xml")}function a(r){let n=new XSLTProcessor,e=new DOMParser().parseFromString(i,"text/xml");n.importStylesheet(e);let t=n.transformToFragment(r,document);return new XMLSerializer().serializeToString(t)}function x(r,n){r.querySelectorAll("[src],[href]").forEach(e=>{var o;let t="";e.getAttribute("src")&&(t="src"),e.getAttribute("href")&&(t="href");let s=(o=e.getAttribute(t))==null?void 0:o.trim();if(!s.startsWith("data:")&&!s.startsWith("http")){let l=n+encodeURI(s);e.setAttribute(t,l)}})}exports.qtiTransformItem = p; exports.qtiTransformTest = g;
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Returns an object with methods to load, parse, transform and serialize QTI XML items.
3
+ * @returns An object with methods to load, parse, transform and serialize QTI XML items.
4
+ * @example
5
+ * const qtiTransformer = qtiTransformItem();
6
+ * await qtiTransformer.load('path/to/xml/file.xml');
7
+ * qtiTransformer.path('/assessmentItem/itemBody');
8
+ * const html = qtiTransformer.html();
9
+ * const xml = qtiTransformer.xml();
10
+ *
11
+ * qtiTransformItem().parse(storyXML).html()
12
+ */
13
+ /**
14
+ * This module exports a function that returns an object with methods to load, parse, transform and serialize QTI XML items.
15
+ * @returns An object with methods to load, parse, transform and serialize QTI XML items.
16
+ */
17
+ declare const qtiTransformItem: () => {
18
+ load(uri: any): Promise<any>;
19
+ parse(xmlString: any): any;
20
+ path: (location: string) => any;
21
+ html(): string;
22
+ xml(): string;
23
+ };
24
+ /**
25
+ * Returns an object with methods to load, parse and transform QTI tests.
26
+ * @returns An object with methods to load, parse and transform QTI tests.
27
+ * @example
28
+ * const qtiTransformer = qtiTransformTest();
29
+ * await qtiTransformer.load('https://example.com/test.xml');
30
+ * const items = qtiTransformer.items();
31
+ * const html = qtiTransformer.html();
32
+ * const xml = qtiTransformer.xml();
33
+ */
34
+ declare const qtiTransformTest: () => {
35
+ load(uri: any): Promise<any>;
36
+ items(): {
37
+ identifier: string;
38
+ href: string;
39
+ category: string;
40
+ }[];
41
+ html(): string;
42
+ xml(): string;
43
+ };
44
+
45
+ export { qtiTransformItem, qtiTransformTest };
@@ -1,4 +1,4 @@
1
- import"../chunk-343LZK3D.js";var p=()=>{let r,n={async load(e){return new Promise((t,s)=>{m(e).then(o=>(r=o,t(n)))})},parse(e){return r=u(e),n},path:e=>(x(r,e),n),html(){return a(r)},xml(){return new XMLSerializer().serializeToString(r)}};return n},g=()=>{let r,n={async load(e){return new Promise((t,s)=>{m(e).then(o=>(r=o,t(n)))})},items(){return c(r)},html(){return a(r)},xml(){return new XMLSerializer().serializeToString(r)}};return n},i=`
1
+ import"../chunk-BKTGSVMP.js";var p=()=>{let r,n={async load(e){return new Promise((t,s)=>{m(e).then(o=>(r=o,t(n)))})},parse(e){return r=u(e),n},path:e=>(x(r,e),n),html(){return a(r)},xml(){return new XMLSerializer().serializeToString(r)}};return n},g=()=>{let r,n={async load(e){return new Promise((t,s)=>{m(e).then(o=>(r=o,t(n)))})},items(){return c(r)},html(){return a(r)},xml(){return new XMLSerializer().serializeToString(r)}};return n},i=`
2
2
  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
3
3
  <xsl:output method="html" version="5.0" encoding="UTF-8" indent="yes" />
4
4
  <xsl:template match="@*|node()">
package/package.json CHANGED
@@ -12,14 +12,10 @@
12
12
  "engines": {
13
13
  "node": ">=16.0.0"
14
14
  },
15
- "version": "6.6.1-1",
15
+ "version": "6.6.1-11",
16
16
  "type": "module",
17
17
  "main": "dist/index.js",
18
18
  "exports": {
19
- ".": {
20
- "import": "./dist/index.js",
21
- "require": "./dist/index.cjs"
22
- },
23
19
  "./qti-components": {
24
20
  "import": "./dist/qti-components/index.js",
25
21
  "require": "./dist/qti-components/index.cjs"
@@ -28,15 +24,12 @@
28
24
  "import": "./dist/qti-transformers/index.js",
29
25
  "require": "./dist/qti-transformers/index.cjs"
30
26
  },
31
- "./styles.bundled.css": "./dist/styles.bundled.css",
32
- "./styles.css": "./dist/styles.css"
27
+ "./item.css": "./dist/item.css",
28
+ "./item.minimal.css": "./dist/item.minimal.css"
33
29
  },
34
30
  "types": "./dist/qti-components/index.d.ts",
35
31
  "typesVersions": {
36
32
  "*": {
37
- ".": [
38
- "./dist/index.d.ts"
39
- ],
40
33
  "qti-components": [
41
34
  "./dist/qti-components/index.d.ts"
42
35
  ],
@@ -48,8 +41,8 @@
48
41
  "files": [
49
42
  "dist",
50
43
  "types",
51
- "./dist/styles.css",
52
- "./dist/styles.bundled.css"
44
+ "./dist/item.css",
45
+ "./dist/item.minimal.css"
53
46
  ],
54
47
  "scripts": {
55
48
  "test": "jest",
@@ -74,16 +67,15 @@
74
67
  "prepublishOnly": "echo 'calling prepublishOnly as npm lifecycle hook to build-lib!' && npm run build-lib",
75
68
  "postpublish": "echo 'posthook for prosperity, does nothing for now!'"
76
69
  },
77
- "dependencies": {
78
- "@lit/context": "^1.0.0",
79
- "lit": "^3.0.0"
80
- },
70
+ "dependencies": {},
81
71
  "peerdependencies": {
82
- "@lit/context": ">= 1.0",
83
- "lit": ">= 3 < 4"
72
+ "@lit/context": "^1.1.0",
73
+ "lit": "^3.1.0"
84
74
  },
85
75
  "devDependencies": {
86
- "@arethetypeswrong/cli": "^0.12.2",
76
+ "@lit/context": "^1.1.0",
77
+ "lit": "^3.1.0",
78
+ "@arethetypeswrong/cli": "^0.13.1",
87
79
  "@custom-elements-manifest/analyzer": "^0.9.0",
88
80
  "@jest/globals": "^29.7.0",
89
81
  "@storybook/addon-a11y": "^7.5.3",
@@ -94,21 +86,21 @@
94
86
  "@storybook/blocks": "^7.5.3",
95
87
  "@storybook/jest": "^0.2.3",
96
88
  "@storybook/preview-api": "^7.5.3",
97
- "@storybook/test-runner": "^0.13.0",
89
+ "@storybook/test-runner": "^0.15.1",
98
90
  "@storybook/testing-library": "^0.2.2",
99
91
  "@storybook/web-components": "^7.5.3",
100
92
  "@storybook/web-components-vite": "^7.5.3",
101
93
  "@tailwindcss/nesting": "^0.0.0-insiders.565cd3e",
102
94
  "@tailwindcss/typography": "^0.5.10",
103
- "@types/node": "^20.8.8",
104
- "@typescript-eslint/eslint-plugin": "^6.9.0",
95
+ "@types/node": "^20.9.2",
96
+ "@typescript-eslint/eslint-plugin": "^6.11.0",
105
97
  "autoprefixer": "^10.4.16",
106
98
  "custom-element-vs-code-integration": "^1.2.1",
107
- "eslint": "^8.52.0",
99
+ "eslint": "^8.54.0",
108
100
  "eslint-plugin-import": "^2.29.0",
109
- "eslint-plugin-jest": "^27.4.3",
101
+ "eslint-plugin-jest": "^27.6.0",
110
102
  "eslint-plugin-lit": "^1.10.1",
111
- "eslint-plugin-lit-a11y": "^4.1.0",
103
+ "eslint-plugin-lit-a11y": "^4.1.1",
112
104
  "eslint-plugin-sort-imports-es6-autofix": "^0.6.0",
113
105
  "eslint-plugin-storybook": "^0.6.15",
114
106
  "eslint-plugin-wc": "^2.0.4",
@@ -117,12 +109,12 @@
117
109
  "nodemon": "^3.0.1",
118
110
  "np": "^8.0.4",
119
111
  "path-browserify": "^1.0.1",
120
- "playwright": "^1.39.0",
112
+ "playwright": "^1.40.0",
121
113
  "postcss": "^8.4.31",
122
114
  "postcss-import": "^15.1.0",
123
115
  "postcss-nesting": "^12.0.1",
124
- "prettier": "3.0.3",
125
- "prettier-plugin-tailwindcss": "^0.5.6",
116
+ "prettier": "3.1.0",
117
+ "prettier-plugin-tailwindcss": "^0.5.7",
126
118
  "react": "^18.2.0",
127
119
  "react-dom": "^18.2.0",
128
120
  "remark-gfm": "^4.0.0",
@@ -130,11 +122,11 @@
130
122
  "tailwindcss": "^3.3.2",
131
123
  "ts-jest": "^29.1.1",
132
124
  "ts-node": "^10.9.1",
133
- "tsup": "^7.2.0",
125
+ "tsup": "^8.0.0",
134
126
  "typescript": "^5.2.2",
135
- "vite": "^4.5.0",
127
+ "vite": "^5.0.0",
136
128
  "vite-tsconfig-paths": "^4.2.1",
137
- "wc-storybook-helpers": "^1.0.9"
129
+ "wc-storybook-helpers": "^1.1.0"
138
130
  },
139
131
  "customElements": "custom-elements.json"
140
132
  }
File without changes
File without changes
File without changes