@pie-element/passage 3.6.1-next.8 → 3.6.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/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
+ ## [3.6.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@3.6.0...@pie-element/passage@3.6.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
+ * 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
  # [3.6.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@3.5.5...@pie-element/passage@3.6.0) (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
+ ## [2.5.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-configure@2.5.0...@pie-element/passage-configure@2.5.1) (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
  # [2.5.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-configure@2.4.5...@pie-element/passage-configure@2.5.0) (2025-05-22)
7
21
 
8
22
 
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pie-element/passage-configure",
3
3
  "private": true,
4
- "version": "2.5.0",
4
+ "version": "2.5.1",
5
5
  "description": "",
6
6
  "main": "lib/index.js",
7
7
  "module": "src/index.js",
@@ -10,7 +10,7 @@
10
10
  "dependencies": {
11
11
  "@material-ui/core": "^3.9.2",
12
12
  "@pie-framework/pie-configure-events": "^1.3.0",
13
- "@pie-lib/pie-toolbox": "2.17.4",
13
+ "@pie-lib/pie-toolbox": "2.17.6",
14
14
  "lodash": "^4.17.15",
15
15
  "prop-types": "^15.6.2",
16
16
  "react": "^16.8.1",
@@ -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
+ ## [1.4.8](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-controller@1.4.7...@pie-element/passage-controller@1.4.8) (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
  ## [1.4.7](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-controller@1.4.6...@pie-element/passage-controller@1.4.7) (2025-05-22)
7
18
 
8
19
 
@@ -24,7 +24,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
24
24
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
25
25
 
26
26
  var getContent = function getContent(html) {
27
- return (html || '').replace(/(<(?!img|iframe)([^>]+)>)/gi, '');
27
+ return (html || '').replace(/(<(?!img|iframe|source)([^>]+)>)/gi, '');
28
28
  };
29
29
 
30
30
  var checkNullish = function checkNullish(value) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.js"],"names":["getContent","html","replace","checkNullish","value","undefined","isEnabled","defaultValue","createDefaultModel","model","Promise","resolve","defaults","normalize","question","normalizeTeacherInstructions","instructions","env","role","mode","session","normalizedQuestion","normalizedPassages","passages","map","passage","index","teacherInstructions","teacherInstructionsEnabled","label","title","titleEnabled","subtitle","subtitleEnabled","author","authorEnabled","text","textEnabled","validate","config","errors","passagesErrors","forEach","err","field","required"],"mappings":";;;;;;;;;;;;;;;;;AAAA;;AAEA;;;;;;AAEA,IAAMA,UAAU,GAAG,SAAbA,UAAa,CAACC,IAAD;AAAA,SAAU,CAACA,IAAI,IAAI,EAAT,EAAaC,OAAb,CAAqB,6BAArB,EAAoD,EAApD,CAAV;AAAA,CAAnB;;AAEA,IAAMC,YAAY,GAAG,SAAfA,YAAe,CAACC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AuBmB,OAAvB,CAA+B,UAACjB,OAAD,EAAUC,KAAV,EAAoB;AACjD,QAAMiB,GAAG,GAAG,EAAZ;AAEA,KAAC,qBAAD,EAAwB,OAAxB,EAAiC,UAAjC,EAA6C,QAA7C,EAAuD,MAAvD,EAA+DD,OAA/D,CAAuE,UAACE,KAAD,EAAW;AAAA;;AAChF,UAAI,iBAAAL,MAAM,CAACK,KAAD,CAAN,wDAAeC,QAAf,IAA2B,CAAC7C,UAAU,CAACyB,OAAO,CAACmB,KAAD,CAAR,CAA1C,EAA4D;AAC1DD,QAAAA,GAAG,CAACC,KAAD,CAAH,GAAa,yBAAb;AACD;AACF,KAJD;;AAMA,QAAI,CAAC,yBAAQD,GAAR,CAAL,EAAmB;AACjBF,MAAAA,cAAc,CAACf,KAAD,CAAd,GAAwBiB,GAAxB;AACD;AACF,GAZD;;AAcA,MAAI,CAAC,yBAAQF,cAAR,CAAL,EAA8B;AAC5BD,IAAAA,MAAM,CAACjB,QAAP,GAAkBkB,cAAlB;AACD;;AAED,SAAOD,MAAP;AACD,CAvBM","sourcesContent":["import isEmpty from 'lodash/isEmpty';\n\nimport defaults from './defaults';\n\nconst getContent = (html) => (html || '').replace(/(<(?!img|iframe)([^>]+)>)/gi, '');\n\nconst checkNullish = (value) => value !== null && value !== undefined;\n\nconst isEnabled = (value, defaultValue) => (checkNullish(value) ? value : defaultValue);\n\nexport function createDefaultModel(model = {}) {\n return new Promise((resolve) => {\n resolve({ ...defaults, ...model });\n });\n}\n\nexport const normalize = (question) => ({ ...defaults, ...question });\n\nconst normalizeTeacherInstructions = (instructions, env) => {\n const { role, mode } = env;\n\n if (role === 'instructor' && (mode === 'view' || mode === 'evaluate')) {\n return instructions || '';\n }\n\n return '';\n};\n\n/**\n *\n * @param {*} question\n * @param {*} session\n * @param {*} env\n */\nexport async function model(question, session, env) {\n const normalizedQuestion = normalize(question);\n\n const normalizedPassages = normalizedQuestion.passages.map((passage, index) => ({\n teacherInstructions: isEnabled(passage.teacherInstructionsEnabled, normalizedQuestion.teacherInstructionsEnabled)\n ? normalizeTeacherInstructions(passage.teacherInstructions, env)\n : '',\n label: getContent(passage.title) ? passage.title : `Passage ${index + 1}`,\n title: isEnabled(passage.titleEnabled, normalizedQuestion.titleEnabled) ? passage.title || '' : '',\n subtitle: isEnabled(passage.subtitleEnabled, normalizedQuestion.subtitleEnabled) ? passage.subtitle || '' : '',\n author: isEnabled(passage.authorEnabled, normalizedQuestion.authorEnabled) ? passage.author || '' : '',\n text: isEnabled(passage.textEnabled, normalizedQuestion.textEnabled) ? passage.text || '' : '',\n }));\n\n return {\n ...normalizedQuestion,\n passages: normalizedPassages,\n };\n}\n\nexport const validate = (model = {}, config = {}) => {\n const errors = {};\n const passagesErrors = {};\n\n (model.passages || []).forEach((passage, index) => {\n const err = {};\n\n ['teacherInstructions', 'title', 'subtitle', 'author', 'text'].forEach((field) => {\n if (config[field]?.required && !getContent(passage[field])) {\n err[field] = 'This field is required.';\n }\n });\n\n if (!isEmpty(err)) {\n passagesErrors[index] = err;\n }\n });\n\n if (!isEmpty(passagesErrors)) {\n errors.passages = passagesErrors;\n }\n\n return errors;\n};\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../src/index.js"],"names":["getContent","html","replace","checkNullish","value","undefined","isEnabled","defaultValue","createDefaultModel","model","Promise","resolve","defaults","normalize","question","normalizeTeacherInstructions","instructions","env","role","mode","session","normalizedQuestion","normalizedPassages","passages","map","passage","index","teacherInstructions","teacherInstructionsEnabled","label","title","titleEnabled","subtitle","subtitleEnabled","author","authorEnabled","text","textEnabled","validate","config","errors","passagesErrors","forEach","err","field","required"],"mappings":";;;;;;;;;;;;;;;;;AAAA;;AAEA;;;;;;AAEA,IAAMA,UAAU,GAAG,SAAbA,UAAa,CAACC,IAAD;AAAA,SAAU,CAACA,IAAI,IAAI,EAAT,EAAaC,OAAb,CAAqB,oCAArB,EAA2D,EAA3D,CAAV;AAAA,CAAnB;;AAEA,IAAMC,YAAY,GAAG,SAAfA,YA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AAnB,EAAuBmB,OAAvB,CAA+B,UAACjB,OAAD,EAAUC,KAAV,EAAoB;AACjD,QAAMiB,GAAG,GAAG,EAAZ;AAEA,KAAC,qBAAD,EAAwB,OAAxB,EAAiC,UAAjC,EAA6C,QAA7C,EAAuD,MAAvD,EAA+DD,OAA/D,CAAuE,UAACE,KAAD,EAAW;AAAA;;AAChF,UAAI,iBAAAL,MAAM,CAACK,KAAD,CAAN,wDAAeC,QAAf,IAA2B,CAAC7C,UAAU,CAACyB,OAAO,CAACmB,KAAD,CAAR,CAA1C,EAA4D;AAC1DD,QAAAA,GAAG,CAACC,KAAD,CAAH,GAAa,yBAAb;AACD;AACF,KAJD;;AAMA,QAAI,CAAC,yBAAQD,GAAR,CAAL,EAAmB;AACjBF,MAAAA,cAAc,CAACf,KAAD,CAAd,GAAwBiB,GAAxB;AACD;AACF,GAZD;;AAcA,MAAI,CAAC,yBAAQF,cAAR,CAAL,EAA8B;AAC5BD,IAAAA,MAAM,CAACjB,QAAP,GAAkBkB,cAAlB;AACD;;AAED,SAAOD,MAAP;AACD,CAvBM","sourcesContent":["import isEmpty from 'lodash/isEmpty';\n\nimport defaults from './defaults';\n\nconst getContent = (html) => (html || '').replace(/(<(?!img|iframe|source)([^>]+)>)/gi, '');\n\nconst checkNullish = (value) => value !== null && value !== undefined;\n\nconst isEnabled = (value, defaultValue) => (checkNullish(value) ? value : defaultValue);\n\nexport function createDefaultModel(model = {}) {\n return new Promise((resolve) => {\n resolve({ ...defaults, ...model });\n });\n}\n\nexport const normalize = (question) => ({ ...defaults, ...question });\n\nconst normalizeTeacherInstructions = (instructions, env) => {\n const { role, mode } = env;\n\n if (role === 'instructor' && (mode === 'view' || mode === 'evaluate')) {\n return instructions || '';\n }\n\n return '';\n};\n\n/**\n *\n * @param {*} question\n * @param {*} session\n * @param {*} env\n */\nexport async function model(question, session, env) {\n const normalizedQuestion = normalize(question);\n\n const normalizedPassages = normalizedQuestion.passages.map((passage, index) => ({\n teacherInstructions: isEnabled(passage.teacherInstructionsEnabled, normalizedQuestion.teacherInstructionsEnabled)\n ? normalizeTeacherInstructions(passage.teacherInstructions, env)\n : '',\n label: getContent(passage.title) ? passage.title : `Passage ${index + 1}`,\n title: isEnabled(passage.titleEnabled, normalizedQuestion.titleEnabled) ? passage.title || '' : '',\n subtitle: isEnabled(passage.subtitleEnabled, normalizedQuestion.subtitleEnabled) ? passage.subtitle || '' : '',\n author: isEnabled(passage.authorEnabled, normalizedQuestion.authorEnabled) ? passage.author || '' : '',\n text: isEnabled(passage.textEnabled, normalizedQuestion.textEnabled) ? passage.text || '' : '',\n }));\n\n return {\n ...normalizedQuestion,\n passages: normalizedPassages,\n };\n}\n\nexport const validate = (model = {}, config = {}) => {\n const errors = {};\n const passagesErrors = {};\n\n (model.passages || []).forEach((passage, index) => {\n const err = {};\n\n ['teacherInstructions', 'title', 'subtitle', 'author', 'text'].forEach((field) => {\n if (config[field]?.required && !getContent(passage[field])) {\n err[field] = 'This field is required.';\n }\n });\n\n if (!isEmpty(err)) {\n passagesErrors[index] = err;\n }\n });\n\n if (!isEmpty(passagesErrors)) {\n errors.passages = passagesErrors;\n }\n\n return errors;\n};\n"],"file":"index.js"}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pie-element/passage-controller",
3
3
  "private": true,
4
- "version": "1.4.7",
4
+ "version": "1.4.8",
5
5
  "description": "",
6
6
  "main": "lib/index.js",
7
7
  "module": "src/index.js",
@@ -1,5 +1,5 @@
1
- import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom} from "../../../@pie-lib/pie-toolbox-math-rendering-module@4.1.3/module/index.js";
2
- import {_dll_pie_lib__pie_toolbox_config_ui, _dll_pie_lib__pie_toolbox_editable_html} from "../../../@pie-lib/pie-toolbox-module@7.0.2/module/index.js";
1
+ import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom} from "../../../@pie-lib/pie-toolbox-math-rendering-module@4.1.5/module/index.js";
2
+ import {_dll_pie_lib__pie_toolbox_config_ui, _dll_pie_lib__pie_toolbox_editable_html} from "../../../@pie-lib/pie-toolbox-module@7.0.4/module/index.js";
3
3
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
4
4
  function getDefaultExportFromCjs(x) {
5
5
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
@@ -990,7 +990,7 @@ var defaults = {
990
990
  titleEnabled: true,
991
991
  };
992
992
 
993
- const getContent = (html) => (html || '').replace(/(<(?!img|iframe)([^>]+)>)/gi, '');
993
+ const getContent = (html) => (html || '').replace(/(<(?!img|iframe|source)([^>]+)>)/gi, '');
994
994
 
995
995
  const checkNullish = (value) => value !== null && value !== undefined;
996
996
 
package/module/element.js CHANGED
@@ -1,5 +1,5 @@
1
- import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_pie_lib__pie_toolbox_math_rendering} from "../../../@pie-lib/pie-toolbox-math-rendering-module@4.1.3/module/index.js";
2
- import {_dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@7.0.2/module/index.js";
1
+ import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_pie_lib__pie_toolbox_math_rendering} from "../../../@pie-lib/pie-toolbox-math-rendering-module@4.1.5/module/index.js";
2
+ import {_dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@7.0.4/module/index.js";
3
3
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
4
4
  function getDefaultExportFromCjs(x) {
5
5
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
@@ -4,11 +4,11 @@
4
4
  "modules": [
5
5
  {
6
6
  "name": "@pie-lib/pie-toolbox-math-rendering-module",
7
- "version": "4.1.3"
7
+ "version": "4.1.5"
8
8
  },
9
9
  {
10
10
  "name": "@pie-lib/pie-toolbox-module",
11
- "version": "7.0.2"
11
+ "version": "7.0.4"
12
12
  }
13
13
  ]
14
14
  }
package/module/print.js CHANGED
@@ -1,5 +1,5 @@
1
- import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_lodash, _dll_debug} from "../../../@pie-lib/pie-toolbox-math-rendering-module@4.1.3/module/index.js";
2
- import {_dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@7.0.2/module/index.js";
1
+ import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_lodash, _dll_debug} from "../../../@pie-lib/pie-toolbox-math-rendering-module@4.1.5/module/index.js";
2
+ import {_dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@7.0.4/module/index.js";
3
3
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
4
4
  function getDefaultExportFromCjs(x) {
5
5
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-element/passage",
3
- "version": "3.6.1-next.8+a98d9306e",
3
+ "version": "3.6.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -11,13 +11,13 @@
11
11
  "dependencies": {
12
12
  "@material-ui/core": "^3.9.2",
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.5",
16
16
  "prop-types": "^15.6.1",
17
17
  "react": "^16.8.1",
18
18
  "react-dom": "^16.8.1"
19
19
  },
20
- "gitHead": "a98d9306e52686234b7c27133fcca6f04500c448",
20
+ "gitHead": "148a29a55830c59e50e390d512b19d730e3d1663",
21
21
  "scripts": {
22
22
  "postpublish": "../../scripts/postpublish"
23
23
  },