@pie-element/drawing-response 8.5.7-next.8 → 8.5.7

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/CHANGELOG.md CHANGED
@@ -3,6 +3,21 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [8.5.7](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response@8.5.6...@pie-element/drawing-response@8.5.7) (2025-06-05)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * add validation for audio content PD-4123 ([f0ce3f1](https://github.com/pie-framework/pie-elements/commit/f0ce3f19a12fd4cfe2d2159ca4af801d866dc8a9))
12
+ * update pie-lib pie-toolbox PD-3756 and revert changes for PD-4810 ([1e3030b](https://github.com/pie-framework/pie-elements/commit/1e3030bfdb13d0cce7b54ce0e9a109446c5ec2a2))
13
+ * update pie-lib-pie-toolbox PD-4810 ([6c81afc](https://github.com/pie-framework/pie-elements/commit/6c81afc6a8ad41e001bafb0bd1563164e9f32a10))
14
+ * update pie-lib-pie-toolbox PD-4810 ([0f9dd82](https://github.com/pie-framework/pie-elements/commit/0f9dd827c474e87770fd3bd146d870dd77d296df))
15
+ * update pie-lib/pie-toolbox PD-4888, PD-3542, PD-4873, PD-4679 ([9c3bdef](https://github.com/pie-framework/pie-elements/commit/9c3bdef1b68f128ecc6338ef74f25fb74c482aa6))
16
+
17
+
18
+
19
+
20
+
6
21
  ## [8.5.6](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response@8.5.5...@pie-element/drawing-response@8.5.6) (2025-05-22)
7
22
 
8
23
 
@@ -3,6 +3,20 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [8.4.7](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-configure@8.4.6...@pie-element/drawing-response-configure@8.4.7) (2025-06-05)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * update pie-lib pie-toolbox PD-3756 and revert changes for PD-4810 ([1e3030b](https://github.com/pie-framework/pie-elements/commit/1e3030bfdb13d0cce7b54ce0e9a109446c5ec2a2))
12
+ * update pie-lib-pie-toolbox PD-4810 ([6c81afc](https://github.com/pie-framework/pie-elements/commit/6c81afc6a8ad41e001bafb0bd1563164e9f32a10))
13
+ * update pie-lib-pie-toolbox PD-4810 ([0f9dd82](https://github.com/pie-framework/pie-elements/commit/0f9dd827c474e87770fd3bd146d870dd77d296df))
14
+ * update pie-lib/pie-toolbox PD-4888, PD-3542, PD-4873, PD-4679 ([9c3bdef](https://github.com/pie-framework/pie-elements/commit/9c3bdef1b68f128ecc6338ef74f25fb74c482aa6))
15
+
16
+
17
+
18
+
19
+
6
20
  ## [8.4.6](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-configure@8.4.5...@pie-element/drawing-response-configure@8.4.6) (2025-05-22)
7
21
 
8
22
 
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pie-element/drawing-response-configure",
3
3
  "private": true,
4
- "version": "8.4.6",
4
+ "version": "8.4.7",
5
5
  "description": "",
6
6
  "main": "lib/index.js",
7
7
  "module": "src/index.js",
@@ -9,7 +9,7 @@
9
9
  "dependencies": {
10
10
  "@material-ui/core": "^3.9.2",
11
11
  "@pie-framework/pie-configure-events": "^1.3.0",
12
- "@pie-lib/pie-toolbox": "2.17.4",
12
+ "@pie-lib/pie-toolbox": "2.17.6",
13
13
  "classnames": "^2.2.6",
14
14
  "debug": "^3.1.0",
15
15
  "lodash": "^4.17.15",
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [3.5.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-controller@3.5.0...@pie-element/drawing-response-controller@3.5.1) (2025-06-05)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * add validation for audio content PD-4123 ([f0ce3f1](https://github.com/pie-framework/pie-elements/commit/f0ce3f19a12fd4cfe2d2159ca4af801d866dc8a9))
12
+
13
+
14
+
15
+
16
+
6
17
  # [3.5.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-controller@3.4.1...@pie-element/drawing-response-controller@3.5.0) (2024-10-29)
7
18
 
8
19
 
@@ -85,11 +85,11 @@ outcome() {
85
85
 
86
86
  var getInnerText = function getInnerText(html) {
87
87
  return (html || '').replaceAll(/<[^>]*>/g, '');
88
- }; // remove all html tags except img and iframe
88
+ }; // remove all html tags except img, iframe and source tag for audio
89
89
 
90
90
 
91
91
  var getContent = function getContent(html) {
92
- return (html || '').replace(/(<(?!img|iframe)([^>]+)>)/gi, '');
92
+ return (html || '').replace(/(<(?!img|iframe|source)([^>]+)>)/gi, '');
93
93
  };
94
94
 
95
95
  var validate = function validate() {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.js"],"names":["log","normalize","question","defaults","model","session","env","normalizedQuestion","extraCSSRules","imageUrl","imageDimensions","prompt","promptEnabled","backgroundImageEnabled","language","Promise","resolve","out","disabled","mode","role","teacherInstructions","teacherInstructionsEnabled","createDefaultModel","outcome","score","completed","note","getInnerText","html","replaceAll","getContent","replace","validate","config","errors","forEach","field","required"],"mappings":";;;;;;;;;;;;;;;AAAA;;AACA;;;;;;AAEA,IAAMA,GAAG,GAAG,uBAAM,0CAAN,CAAZ;;AAEO,IAAMC,SAAS,GAAG,SAAZA,SAAY,CAACC,QAAD;AAAA,yCAAoBC,oBAApB,GAAiCD,QAAjC;AAAA,CAAlB;;;;AAEA,SAASE,KAAT,CAAeF,QAAf,EAAyBG,OAAzB,EAAkCC,GAAlC,EAAuC;AAC5C,MAAMC,kBAAkB,GAAGN,SAAS,CAACC,QAAD,CAApC;AACA,MAAQM,aAAR,GAA8GD,kBAA9G,CAAQC,aAAR;AAAA,MAAuBC,QAAvB,GAA8GF,kBAA9G,CAAu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,OAAO,iCACFb,oBADE,GAEFC,KAFE,EAAP;AAID,GALD,CADgC;AAAA,CAA3B;;;;AAQA;AAAiB;AAARoB,OAAT,GAAsC;AAC3C,SAAO,IAAIT,OAAJ,CAAY,UAACC,OAAD,EAAa;AAC9BhB,IAAAA,GAAG,CAAC,YAAD,CAAH;AACAgB,IAAAA,OAAO,CAAC;AACNS,MAAAA,KAAK,EAAE,CADD;AAENC,MAAAA,SAAS,EAAE,KAFL;AAGNC,MAAAA,IAAI,EAAE;AAHA,KAAD,CAAP;AAKD,GAPM,CAAP;AAQD,C,CAED;;;AACA,IAAMC,YAAY,GAAG,SAAfA,YAAe,CAACC,IAAD;AAAA,SAAU,CAACA,IAAI,IAAI,EAAT,EAAaC,UAAb,CAAwB,UAAxB,EAAoC,EAApC,CAAV;AAAA,CAArB,C,CAEA;;;AACA,IAAMC,UAAU,GAAG,SAAbA,UAAa,CAACF,IAAD;AAAA,SAAU,CAACA,IAAI,IAAI,EAAT,EAAaG,OAAb,CAAqB,6BAArB,EAAoD,EAApD,CAAV;AAAA,CAAnB;;AAEO,IAAMC,QAAQ,GAAG,SAAXA,QAAW,GAA6B;AAAA,MAA5B7B,KAA4B,uEAApB,EAAoB;AAAA,MAAhB8B,MAAgB,uEAAP,EAAO;AACnD,MAAMC,MAAM,GAAG,EAAf;AAEA,GAAC,qBAAD,EAAwB,QAAxB,EAAkCC,OAAlC,CAA0C,UAACC,KAAD,EAAW;AAAA;;AACnD,QAAI,iBAAAH,MAAM,CAACG,KAAD,CAAN,wDAAeC,QAAf,IAA2B,CAACP,UAAU,CAAC3B,KAAK,CAACiC,KAAD,CAAN,CAA1C,EAA0D;AACxDF,MAAAA,MAAM,CAACE,KAAD,CAAN,GAAgB,yBAAhB;AACD;AACF,GAJD;AAMA,SAAOF,MAAP;AACD,CAVM","sourcesContent":["import debug from 'debug';\nimport defaults from './defaults';\n\nconst log = debug('pie-elements:drawing-response:controller');\n\nexport const normalize = (question) => ({ ...defaults, ...question });\n\nexport function model(question, session, env) {\n const normalizedQuestion = normalize(question);\n const { extraCSSRules, imageUrl, imageDimensions, prompt, promptEnabled, backgroundImageEnabled, language } = normalizedQuestion;\n\n return new Promise((resolve) => {\n const out = {\n disabled: env.mode !== 'gather',\n mode: env.mode,\n imageDimensions,\n imageUrl,\n prompt: promptEnabled ? prompt : null,\n backgroundImageEnabled,\n language,\n extraCSSRules,\n };\n\n if (env.role === 'instructor' && (env.mode === 'view' || env.mode === 'evaluate')) {\n out.teacherInstructions = normalizedQuestion.teacherInstructionsEnabled\n ? normalizedQuestion.teacherInstructions\n : null;\n } else {\n out.teacherInstructions = null;\n }\n\n resolve(out);\n });\n}\n\nexport const createDefaultModel = (model = {}) =>\n new Promise((resolve) => {\n resolve({\n ...defaults,\n ...model,\n });\n });\n\nexport function outcome(/*config, session*/) {\n return new Promise((resolve) => {\n log('outcome...');\n resolve({\n score: 0,\n completed: 'n/a',\n note: 'Requires manual scoring',\n });\n });\n}\n\n// remove all html tags\nconst getInnerText = (html) => (html || '').replaceAll(/<[^>]*>/g, '');\n\n// remove all html tags except img and iframe\nconst getContent = (html) => (html || '').replace(/(<(?!img|iframe)([^>]+)>)/gi, '');\n\nexport const validate = (model = {}, config = {}) => {\n const errors = {};\n\n ['teacherInstructions', 'prompt'].forEach((field) => {\n if (config[field]?.required && !getContent(model[field])) {\n errors[field] = 'This field is required.';\n }\n });\n\n return errors;\n};\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../src/index.js"],"names":["log","normalize","question","defaults","model","session","env","normalizedQuestion","extraCSSRules","imageUrl","imageDimensions","prompt","promptEnabled","backgroundImageEnabled","language","Promise","resolve","out","disabled","mode","role","teacherInstructions","teacherInstructionsEnabled","createDefaultModel","outcome","score","completed","note","getInnerText","html","replaceAll","getContent","replace","validate","config","errors","forEach","field","required"],"mappings":";;;;;;;;;;;;;;;AAAA;;AACA;;;;;;AAEA,IAAMA,GAAG,GAAG,uBAAM,0CAAN,CAAZ;;AAEO,IAAMC,SAAS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AACG,KAAD,CAAN,wDAAeC,QAAf,IAA2B,CAACP,UAAU,CAAC3B,KAAK,CAACiC,KAAD,CAAN,CAA1C,EAA0D;AACxDF,MAAAA,MAAM,CAACE,KAAD,CAAN,GAAgB,yBAAhB;AACD;AACF,GAJD;AAMA,SAAOF,MAAP;AACD,CAVM","sourcesContent":["import debug from 'debug';\nimport defaults from './defaults';\n\nconst log = debug('pie-elements:drawing-response:controller');\n\nexport const normalize = (question) => ({ ...defaults, ...question });\n\nexport function model(question, session, env) {\n const normalizedQuestion = normalize(question);\n const { extraCSSRules, imageUrl, imageDimensions, prompt, promptEnabled, backgroundImageEnabled, language } = normalizedQuestion;\n\n return new Promise((resolve) => {\n const out = {\n disabled: env.mode !== 'gather',\n mode: env.mode,\n imageDimensions,\n imageUrl,\n prompt: promptEnabled ? prompt : null,\n backgroundImageEnabled,\n language,\n extraCSSRules,\n };\n\n if (env.role === 'instructor' && (env.mode === 'view' || env.mode === 'evaluate')) {\n out.teacherInstructions = normalizedQuestion.teacherInstructionsEnabled\n ? normalizedQuestion.teacherInstructions\n : null;\n } else {\n out.teacherInstructions = null;\n }\n\n resolve(out);\n });\n}\n\nexport const createDefaultModel = (model = {}) =>\n new Promise((resolve) => {\n resolve({\n ...defaults,\n ...model,\n });\n });\n\nexport function outcome(/*config, session*/) {\n return new Promise((resolve) => {\n log('outcome...');\n resolve({\n score: 0,\n completed: 'n/a',\n note: 'Requires manual scoring',\n });\n });\n}\n\n// remove all html tags\nconst getInnerText = (html) => (html || '').replaceAll(/<[^>]*>/g, '');\n\n// remove all html tags except img, iframe and source tag for audio\nconst getContent = (html) => (html || '').replace(/(<(?!img|iframe|source)([^>]+)>)/gi, '');\n\nexport const validate = (model = {}, config = {}) => {\n const errors = {};\n\n ['teacherInstructions', 'prompt'].forEach((field) => {\n if (config[field]?.required && !getContent(model[field])) {\n errors[field] = 'This field is required.';\n }\n });\n\n return errors;\n};\n"],"file":"index.js"}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pie-element/drawing-response-controller",
3
3
  "private": true,
4
- "version": "3.5.0",
4
+ "version": "3.5.1",
5
5
  "description": "",
6
6
  "scripts": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -55,8 +55,8 @@ export function outcome(/*config, session*/) {
55
55
  // remove all html tags
56
56
  const getInnerText = (html) => (html || '').replaceAll(/<[^>]*>/g, '');
57
57
 
58
- // remove all html tags except img and iframe
59
- const getContent = (html) => (html || '').replace(/(<(?!img|iframe)([^>]+)>)/gi, '');
58
+ // remove all html tags except img, iframe and source tag for audio
59
+ const getContent = (html) => (html || '').replace(/(<(?!img|iframe|source)([^>]+)>)/gi, '');
60
60
 
61
61
  export const validate = (model = {}, config = {}) => {
62
62
  const errors = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-element/drawing-response",
3
- "version": "8.5.7-next.8+a98d9306e",
3
+ "version": "8.5.7",
4
4
  "description": "",
5
5
  "repository": "pie-framework/pie-elements",
6
6
  "publishConfig": {
@@ -11,7 +11,7 @@
11
11
  "@mdi/js": "^3.6.95",
12
12
  "@mdi/react": "^1.1.1",
13
13
  "@pie-framework/pie-player-events": "^0.1.0",
14
- "@pie-lib/pie-toolbox": "2.17.4",
14
+ "@pie-lib/pie-toolbox": "2.17.6",
15
15
  "classnames": "^2.2.6",
16
16
  "enzyme-to-json": "^3.3.5",
17
17
  "konva": "^3.4.1",
@@ -23,7 +23,7 @@
23
23
  },
24
24
  "author": "pie framework developers",
25
25
  "license": "ISC",
26
- "gitHead": "a98d9306e52686234b7c27133fcca6f04500c448",
26
+ "gitHead": "148a29a55830c59e50e390d512b19d730e3d1663",
27
27
  "scripts": {
28
28
  "postpublish": "../../scripts/postpublish"
29
29
  },