@pie-element/passage 7.1.2-next.5 → 7.2.0-beta.0

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 (89) hide show
  1. package/CHANGELOG.json +227 -0
  2. package/CHANGELOG.md +1473 -0
  3. package/LICENSE.md +5 -0
  4. package/README.md +3 -0
  5. package/configure/CHANGELOG.md +685 -0
  6. package/configure/lib/common.js +74 -0
  7. package/configure/lib/common.js.map +1 -0
  8. package/configure/lib/defaults.js +174 -0
  9. package/configure/lib/defaults.js.map +1 -0
  10. package/configure/lib/design.js +185 -0
  11. package/configure/lib/design.js.map +1 -0
  12. package/configure/lib/index.js +87 -0
  13. package/configure/lib/index.js.map +1 -0
  14. package/configure/lib/passage.js +194 -0
  15. package/configure/lib/passage.js.map +1 -0
  16. package/configure/package.json +23 -0
  17. package/controller/CHANGELOG.json +1 -0
  18. package/controller/CHANGELOG.md +113 -0
  19. package/controller/lib/defaults.js +23 -0
  20. package/controller/lib/defaults.js.map +1 -0
  21. package/controller/lib/index.js +80 -0
  22. package/controller/lib/index.js.map +1 -0
  23. package/controller/package.json +13 -0
  24. package/docs/config-schema.json +1325 -0
  25. package/docs/config-schema.json.md +974 -0
  26. package/docs/demo/config.js +8 -0
  27. package/docs/demo/generate.js +32 -0
  28. package/docs/demo/index.html +1 -0
  29. package/docs/pie-schema.json +775 -0
  30. package/docs/pie-schema.json.md +561 -0
  31. package/lib/index.js +144 -0
  32. package/lib/index.js.map +1 -0
  33. package/lib/print.js +78 -0
  34. package/lib/print.js.map +1 -0
  35. package/lib/stimulus-tabs.js +427 -0
  36. package/lib/stimulus-tabs.js.map +1 -0
  37. package/module/configure.js +1 -0
  38. package/module/controller.js +920 -0
  39. package/module/demo.js +57 -0
  40. package/module/element.js +1 -0
  41. package/module/index.html +21 -0
  42. package/module/manifest.json +10 -0
  43. package/module/print-demo.js +95 -0
  44. package/module/print.html +18 -0
  45. package/module/print.js +1 -0
  46. package/package.json +19 -86
  47. package/configure.js +0 -2
  48. package/controller.js +0 -1
  49. package/dist/author/common.d.ts +0 -36
  50. package/dist/author/common.js +0 -56
  51. package/dist/author/defaults.d.ts +0 -175
  52. package/dist/author/defaults.js +0 -113
  53. package/dist/author/design.d.ts +0 -28
  54. package/dist/author/design.js +0 -120
  55. package/dist/author/index.d.ts +0 -36
  56. package/dist/author/index.js +0 -66
  57. package/dist/author/passage.d.ts +0 -27
  58. package/dist/author/passage.js +0 -127
  59. package/dist/browser/author/index.js +0 -44688
  60. package/dist/browser/author/index.js.map +0 -1
  61. package/dist/browser/controller/index.js +0 -64
  62. package/dist/browser/controller/index.js.map +0 -1
  63. package/dist/browser/delivery/index.js +0 -117
  64. package/dist/browser/delivery/index.js.map +0 -1
  65. package/dist/browser/dist-ByX3voUB.js +0 -9618
  66. package/dist/browser/dist-ByX3voUB.js.map +0 -1
  67. package/dist/browser/dist-CeIdmqCq.js +0 -92
  68. package/dist/browser/dist-CeIdmqCq.js.map +0 -1
  69. package/dist/browser/passage.css +0 -2
  70. package/dist/browser/print/index.js +0 -48
  71. package/dist/browser/print/index.js.map +0 -1
  72. package/dist/browser/stimulus-tabs-CxiQ79gz.js +0 -218
  73. package/dist/browser/stimulus-tabs-CxiQ79gz.js.map +0 -1
  74. package/dist/controller/defaults.d.ts +0 -23
  75. package/dist/controller/defaults.js +0 -17
  76. package/dist/controller/index.d.ts +0 -18
  77. package/dist/controller/index.js +0 -50
  78. package/dist/delivery/index.d.ts +0 -22
  79. package/dist/delivery/index.js +0 -83
  80. package/dist/delivery/stimulus-tabs.d.ts +0 -21
  81. package/dist/delivery/stimulus-tabs.js +0 -220
  82. package/dist/index.d.ts +0 -1
  83. package/dist/index.iife.d.ts +0 -8
  84. package/dist/index.iife.js +0 -145
  85. package/dist/index.js +0 -2
  86. package/dist/print/index.d.ts +0 -15
  87. package/dist/print/index.js +0 -47
  88. package/dist/runtime-support.d.ts +0 -12
  89. package/dist/runtime-support.js +0 -12
@@ -0,0 +1,194 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = exports.PassageComponent = void 0;
8
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
+ var _react = _interopRequireDefault(require("react"));
10
+ var _propTypes = _interopRequireDefault(require("prop-types"));
11
+ var _configUi = require("@pie-lib/config-ui");
12
+ var _editableHtmlTipTap = _interopRequireWildcard(require("@pie-lib/editable-html-tip-tap"));
13
+ var _styles = require("@mui/material/styles");
14
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
15
+ const StyledInputContainer = (0, _styles.styled)(_configUi.InputContainer)(({
16
+ theme
17
+ }) => ({
18
+ paddingTop: theme.spacing(2),
19
+ marginBottom: theme.spacing(2),
20
+ width: '100%'
21
+ }));
22
+ const ErrorText = (0, _styles.styled)('div')(({
23
+ theme
24
+ }) => ({
25
+ fontSize: theme.typography.fontSize - 2,
26
+ color: theme.palette.error.main,
27
+ paddingTop: theme.spacing(1)
28
+ }));
29
+ class PassageComponent extends _react.default.Component {
30
+ constructor(props) {
31
+ super(props);
32
+ (0, _defineProperty2.default)(this, "handleChange", (fieldName, value) => {
33
+ const {
34
+ model,
35
+ onModelChanged,
36
+ passageIndex
37
+ } = this.props;
38
+ if (!model.passages || passageIndex < 0 || passageIndex >= model.passages.length) {
39
+ return;
40
+ }
41
+ const updatedPassages = [...model.passages];
42
+ updatedPassages[passageIndex] = {
43
+ ...updatedPassages[passageIndex],
44
+ [fieldName]: value
45
+ };
46
+ onModelChanged({
47
+ ...model,
48
+ passages: updatedPassages
49
+ });
50
+ });
51
+ }
52
+ render() {
53
+ const {
54
+ model,
55
+ configuration,
56
+ imageSupport,
57
+ passageIndex,
58
+ uploadSoundSupport
59
+ } = this.props;
60
+ const {
61
+ maxImageWidth = {},
62
+ maxImageHeight = {},
63
+ mathMlOptions = {},
64
+ baseInputConfiguration = {},
65
+ teacherInstructions = {},
66
+ title = {},
67
+ subtitle = {},
68
+ text = {},
69
+ author = {}
70
+ } = configuration || {};
71
+ const {
72
+ errors = {},
73
+ passages = [],
74
+ teacherInstructionsEnabled,
75
+ titleEnabled,
76
+ subtitleEnabled,
77
+ authorEnabled,
78
+ textEnabled
79
+ } = model || {};
80
+ const {
81
+ passages: passagesErrors
82
+ } = errors || {};
83
+ const {
84
+ teacherInstructions: teacherInstructionsError,
85
+ title: titleError,
86
+ subtitle: subtitleError,
87
+ author: authorError,
88
+ text: textError
89
+ } = passagesErrors && passagesErrors[passageIndex] || {};
90
+ const defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;
91
+ const defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;
92
+ const getPluginProps = customConfiguration => ({
93
+ ...baseInputConfiguration,
94
+ ...customConfiguration
95
+ });
96
+ const basicPlugins = (_editableHtmlTipTap.ALL_PLUGINS || []).filter(plugin => !['math', 'table', 'bulleted-list', 'numbered-list'].includes(plugin));
97
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, teacherInstructionsEnabled && /*#__PURE__*/_react.default.createElement(StyledInputContainer, {
98
+ label: teacherInstructions.label
99
+ }, /*#__PURE__*/_react.default.createElement(_editableHtmlTipTap.default, {
100
+ activePlugins: _editableHtmlTipTap.ALL_PLUGINS,
101
+ markup: passages[passageIndex].teacherInstructions || '',
102
+ onChange: value => this.handleChange('teacherInstructions', value),
103
+ nonEmpty: false,
104
+ error: teacherInstructionsError,
105
+ maxImageWidth: maxImageWidth && maxImageWidth.teacherInstructions || defaultImageMaxWidth,
106
+ maxImageHeight: maxImageHeight && maxImageHeight.teacherInstructions || defaultImageMaxHeight,
107
+ mathMlOptions: mathMlOptions,
108
+ languageCharactersProps: [{
109
+ language: 'spanish'
110
+ }, {
111
+ language: 'special'
112
+ }],
113
+ pluginProps: getPluginProps(teacherInstructions?.inputConfiguration)
114
+ }), teacherInstructionsError && /*#__PURE__*/_react.default.createElement(ErrorText, null, teacherInstructionsError)), titleEnabled && /*#__PURE__*/_react.default.createElement(StyledInputContainer, {
115
+ label: title.label
116
+ }, /*#__PURE__*/_react.default.createElement(_editableHtmlTipTap.default, {
117
+ activePlugins: basicPlugins,
118
+ markup: passages[passageIndex].title || '',
119
+ onChange: value => this.handleChange('title', value),
120
+ nonEmpty: false,
121
+ error: titleError,
122
+ mathMlOptions: mathMlOptions,
123
+ languageCharactersProps: [{
124
+ language: 'spanish'
125
+ }, {
126
+ language: 'special'
127
+ }],
128
+ pluginProps: getPluginProps(title?.inputConfiguration)
129
+ }), titleError && /*#__PURE__*/_react.default.createElement(ErrorText, null, titleError)), subtitleEnabled && /*#__PURE__*/_react.default.createElement(StyledInputContainer, {
130
+ label: subtitle.label
131
+ }, /*#__PURE__*/_react.default.createElement(_editableHtmlTipTap.default, {
132
+ activePlugins: basicPlugins,
133
+ markup: passages[passageIndex].subtitle || '',
134
+ onChange: value => this.handleChange('subtitle', value),
135
+ nonEmpty: false,
136
+ error: subtitleError,
137
+ mathMlOptions: mathMlOptions,
138
+ languageCharactersProps: [{
139
+ language: 'spanish'
140
+ }, {
141
+ language: 'special'
142
+ }],
143
+ pluginProps: getPluginProps(subtitle?.inputConfiguration)
144
+ }), subtitleError && /*#__PURE__*/_react.default.createElement(ErrorText, null, subtitleError)), authorEnabled && /*#__PURE__*/_react.default.createElement(StyledInputContainer, {
145
+ label: author.label
146
+ }, /*#__PURE__*/_react.default.createElement(_editableHtmlTipTap.default, {
147
+ activePlugins: basicPlugins,
148
+ markup: passages[passageIndex].author || '',
149
+ onChange: value => this.handleChange('author', value),
150
+ nonEmpty: false,
151
+ error: authorError,
152
+ mathMlOptions: mathMlOptions,
153
+ languageCharactersProps: [{
154
+ language: 'spanish'
155
+ }, {
156
+ language: 'special'
157
+ }],
158
+ pluginProps: getPluginProps(author?.inputConfiguration)
159
+ }), authorError && /*#__PURE__*/_react.default.createElement(ErrorText, null, authorError)), textEnabled && /*#__PURE__*/_react.default.createElement(StyledInputContainer, {
160
+ label: text.label
161
+ }, /*#__PURE__*/_react.default.createElement(_editableHtmlTipTap.default, {
162
+ activePlugins: _editableHtmlTipTap.ALL_PLUGINS,
163
+ markup: passages[passageIndex].text || '',
164
+ onChange: value => this.handleChange('text', value),
165
+ imageSupport: imageSupport,
166
+ uploadSoundSupport: uploadSoundSupport,
167
+ nonEmpty: false,
168
+ error: textError,
169
+ maxImageWidth: maxImageWidth && maxImageWidth.text || defaultImageMaxWidth,
170
+ maxImageHeight: maxImageHeight && maxImageHeight.text || defaultImageMaxHeight,
171
+ mathMlOptions: mathMlOptions,
172
+ languageCharactersProps: [{
173
+ language: 'spanish'
174
+ }, {
175
+ language: 'special'
176
+ }],
177
+ pluginProps: getPluginProps(text?.inputConfiguration)
178
+ }), textError && /*#__PURE__*/_react.default.createElement(ErrorText, null, textError)));
179
+ }
180
+ }
181
+ exports.PassageComponent = PassageComponent;
182
+ (0, _defineProperty2.default)(PassageComponent, "propTypes", {
183
+ onModelChanged: _propTypes.default.func.isRequired,
184
+ model: _propTypes.default.object.isRequired,
185
+ configuration: _propTypes.default.object.isRequired,
186
+ imageSupport: _propTypes.default.object.isRequired,
187
+ passageIndex: _propTypes.default.number.isRequired,
188
+ uploadSoundSupport: _propTypes.default.object.isRequired
189
+ });
190
+ (0, _defineProperty2.default)(PassageComponent, "defaultProps", {
191
+ passageIndex: 0
192
+ });
193
+ var _default = exports.default = PassageComponent;
194
+ //# sourceMappingURL=passage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"passage.js","names":["_react","_interopRequireDefault","require","_propTypes","_configUi","_editableHtmlTipTap","_interopRequireWildcard","_styles","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","StyledInputContainer","styled","InputContainer","theme","paddingTop","spacing","marginBottom","width","ErrorText","fontSize","typography","color","palette","error","main","PassageComponent","React","Component","constructor","props","_defineProperty2","fieldName","value","model","onModelChanged","passageIndex","passages","length","updatedPassages","render","configuration","imageSupport","uploadSoundSupport","maxImageWidth","maxImageHeight","mathMlOptions","baseInputConfiguration","teacherInstructions","title","subtitle","text","author","errors","teacherInstructionsEnabled","titleEnabled","subtitleEnabled","authorEnabled","textEnabled","passagesErrors","teacherInstructionsError","titleError","subtitleError","authorError","textError","defaultImageMaxWidth","prompt","defaultImageMaxHeight","getPluginProps","customConfiguration","basicPlugins","ALL_PLUGINS","filter","plugin","includes","createElement","Fragment","label","activePlugins","markup","onChange","handleChange","nonEmpty","languageCharactersProps","language","pluginProps","inputConfiguration","exports","PropTypes","func","isRequired","object","number","_default"],"sources":["../src/passage.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { InputContainer } from '@pie-lib/config-ui';\nimport EditableHtml, { ALL_PLUGINS } from '@pie-lib/editable-html-tip-tap';\nimport { styled } from '@mui/material/styles';\n\nconst StyledInputContainer = styled(InputContainer)(({ theme }) => ({\n paddingTop: theme.spacing(2),\n marginBottom: theme.spacing(2),\n width: '100%',\n}));\n\nconst ErrorText = styled('div')(({ theme }) => ({\n fontSize: theme.typography.fontSize - 2,\n color: theme.palette.error.main,\n paddingTop: theme.spacing(1),\n}));\n\nexport class PassageComponent extends React.Component {\n static propTypes = {\n onModelChanged: PropTypes.func.isRequired,\n model: PropTypes.object.isRequired,\n configuration: PropTypes.object.isRequired,\n imageSupport: PropTypes.object.isRequired,\n passageIndex: PropTypes.number.isRequired,\n uploadSoundSupport: PropTypes.object.isRequired,\n };\n\n static defaultProps = {\n passageIndex: 0,\n };\n\n constructor(props) {\n super(props);\n }\n\n handleChange = (fieldName, value) => {\n const { model, onModelChanged, passageIndex } = this.props;\n\n if (!model.passages || passageIndex < 0 || passageIndex >= model.passages.length) {\n return;\n }\n\n const updatedPassages = [...model.passages];\n updatedPassages[passageIndex] = { ...updatedPassages[passageIndex], [fieldName]: value };\n\n onModelChanged({ ...model, passages: updatedPassages });\n };\n\n render() {\n const { model, configuration, imageSupport, passageIndex, uploadSoundSupport } = this.props;\n const {\n maxImageWidth = {},\n maxImageHeight = {},\n mathMlOptions = {},\n baseInputConfiguration = {},\n teacherInstructions = {},\n title = {},\n subtitle = {},\n text = {},\n author = {},\n } = configuration || {};\n const {\n errors = {},\n passages = [],\n teacherInstructionsEnabled,\n titleEnabled,\n subtitleEnabled,\n authorEnabled,\n textEnabled,\n } = model || {};\n\n const { passages: passagesErrors } = errors || {};\n const {\n teacherInstructions: teacherInstructionsError,\n title: titleError,\n subtitle: subtitleError,\n author: authorError,\n text: textError,\n } = (passagesErrors && passagesErrors[passageIndex]) || {};\n\n const defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;\n const defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;\n\n const getPluginProps = (customConfiguration) => ({ ...baseInputConfiguration, ...customConfiguration });\n\n const basicPlugins = (ALL_PLUGINS || []).filter(plugin => ![\n 'math',\n 'table',\n 'bulleted-list',\n 'numbered-list',\n ].includes(plugin));\n\n return (\n <React.Fragment>\n {teacherInstructionsEnabled && (\n <StyledInputContainer label={teacherInstructions.label}>\n <EditableHtml\n activePlugins={ALL_PLUGINS}\n markup={passages[passageIndex].teacherInstructions || ''}\n onChange={(value) => this.handleChange('teacherInstructions', value)}\n nonEmpty={false}\n error={teacherInstructionsError}\n maxImageWidth={(maxImageWidth && maxImageWidth.teacherInstructions) || defaultImageMaxWidth}\n maxImageHeight={(maxImageHeight && maxImageHeight.teacherInstructions) || defaultImageMaxHeight}\n mathMlOptions={mathMlOptions}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n pluginProps={getPluginProps(teacherInstructions?.inputConfiguration)}\n />\n {teacherInstructionsError && <ErrorText>{teacherInstructionsError}</ErrorText>}\n </StyledInputContainer>\n )}\n\n {titleEnabled && (\n <StyledInputContainer label={title.label}>\n <EditableHtml\n activePlugins={basicPlugins}\n markup={passages[passageIndex].title || ''}\n onChange={(value) => this.handleChange('title', value)}\n nonEmpty={false}\n error={titleError}\n mathMlOptions={mathMlOptions}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n pluginProps={getPluginProps(title?.inputConfiguration)}\n />\n {titleError && <ErrorText>{titleError}</ErrorText>}\n </StyledInputContainer>\n )}\n\n {subtitleEnabled && (\n <StyledInputContainer label={subtitle.label}>\n <EditableHtml\n activePlugins={basicPlugins}\n markup={passages[passageIndex].subtitle || ''}\n onChange={(value) => this.handleChange('subtitle', value)}\n nonEmpty={false}\n error={subtitleError}\n mathMlOptions={mathMlOptions}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n pluginProps={getPluginProps(subtitle?.inputConfiguration)}\n />\n {subtitleError && <ErrorText>{subtitleError}</ErrorText>}\n </StyledInputContainer>\n )}\n\n {authorEnabled && (\n <StyledInputContainer label={author.label}>\n <EditableHtml\n activePlugins={basicPlugins}\n markup={passages[passageIndex].author || ''}\n onChange={(value) => this.handleChange('author', value)}\n nonEmpty={false}\n error={authorError}\n mathMlOptions={mathMlOptions}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n pluginProps={getPluginProps(author?.inputConfiguration)}\n />\n {authorError && <ErrorText>{authorError}</ErrorText>}\n </StyledInputContainer>\n )}\n\n {textEnabled && (\n <StyledInputContainer label={text.label}>\n <EditableHtml\n activePlugins={ALL_PLUGINS}\n markup={passages[passageIndex].text || ''}\n onChange={(value) => this.handleChange('text', value)}\n imageSupport={imageSupport}\n uploadSoundSupport={uploadSoundSupport}\n nonEmpty={false}\n error={textError}\n maxImageWidth={(maxImageWidth && maxImageWidth.text) || defaultImageMaxWidth}\n maxImageHeight={(maxImageHeight && maxImageHeight.text) || defaultImageMaxHeight}\n mathMlOptions={mathMlOptions}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n pluginProps={getPluginProps(text?.inputConfiguration)}\n />\n {textError && <ErrorText>{textError}</ErrorText>}\n </StyledInputContainer>\n )}\n </React.Fragment>\n );\n }\n}\n\nexport default PassageComponent;\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,mBAAA,GAAAC,uBAAA,CAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAA8C,SAAAI,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,CAAAE,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MA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,CAACF,UAAU;EACzC/C,kBAAkB,EAAE6C,kBAAS,CAACG,MAAM,CAACD;AACvC,CAAC;AAAA,IAAA3D,gBAAA,CAAA7B,OAAA,EARUwB,gBAAgB,kBAUL;EACpBU,YAAY,EAAE;AAChB,CAAC;AAAA,IAAAyD,QAAA,GAAAN,OAAA,CAAArF,OAAA,GA2JYwB,gBAAgB","ignoreList":[]}
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "@pie-element/passage-configure",
3
+ "private": true,
4
+ "version": "5.2.0-beta.0",
5
+ "description": "",
6
+ "main": "lib/index.js",
7
+ "module": "src/index.js",
8
+ "author": "pie framework developers",
9
+ "license": "ISC",
10
+ "dependencies": {
11
+ "@emotion/react": "^11.14.0",
12
+ "@emotion/style": "^0.8.0",
13
+ "@mui/icons-material": "^7.3.4",
14
+ "@mui/material": "^7.3.4",
15
+ "@pie-framework/pie-configure-events": "^1.3.0",
16
+ "@pie-lib/config-ui": "13.1.0-beta",
17
+ "@pie-lib/editable-html-tip-tap": "2.2.0-beta",
18
+ "lodash-es": "^4.17.23",
19
+ "prop-types": "^15.8.1",
20
+ "react": "18.3.1",
21
+ "react-dom": "18.3.1"
22
+ }
23
+ }
@@ -0,0 +1 @@
1
+ []
@@ -0,0 +1,113 @@
1
+ # Change Log
2
+
3
+ All notable changes to this project will be documented in this file.
4
+ See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
+
6
+ # [4.1.0-beta.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-controller@4.0.2...@pie-element/passage-controller@4.1.0-beta.0) (2026-08-07)
7
+
8
+ **Note:** Version bump only for package @pie-element/passage-controller
9
+
10
+ ## [4.0.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-controller@4.0.2-next.0...@pie-element/passage-controller@4.0.2) (2026-05-21)
11
+
12
+ **Note:** Version bump only for package @pie-element/passage-controller
13
+
14
+ ## [4.0.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-controller@4.0.0...@pie-element/passage-controller@4.0.1) (2026-04-28)
15
+
16
+ **Note:** Version bump only for package @pie-element/passage-controller
17
+
18
+ ## [2.2.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-controller@2.1.1...@pie-element/passage-controller@2.2.1) (2025-10-16)
19
+
20
+ **Note:** Version bump only for package @pie-element/passage-controller
21
+
22
+ # [2.2.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-controller@2.1.1...@pie-element/passage-controller@2.2.0) (2025-10-15)
23
+
24
+ **Note:** Version bump only for package @pie-element/passage-controller
25
+
26
+ ## [2.1.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-controller@2.0.1...@pie-element/passage-controller@2.1.1) (2025-10-10)
27
+
28
+ **Note:** Version bump only for package @pie-element/passage-controller
29
+
30
+ # [2.1.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-controller@2.0.0...@pie-element/passage-controller@2.1.0) (2025-10-07)
31
+
32
+ **Note:** Version bump only for package @pie-element/passage-controller
33
+
34
+ ## [2.0.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-controller@1.4.8...@pie-element/passage-controller@2.0.1) (2025-10-02)
35
+
36
+ **Note:** Version bump only for package @pie-element/passage-controller
37
+
38
+ # [2.0.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-controller@1.4.8...@pie-element/passage-controller@2.0.0) (2025-10-01)
39
+
40
+ **Note:** Version bump only for package @pie-element/passage-controller
41
+
42
+ ## [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)
43
+
44
+ ### Bug Fixes
45
+
46
+ - add validation for audio content PD-4123 ([f0ce3f1](https://github.com/pie-framework/pie-elements/commit/f0ce3f19a12fd4cfe2d2159ca4af801d866dc8a9))
47
+
48
+ ## [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)
49
+
50
+ ### Bug Fixes
51
+
52
+ - **passage:** correct failing test, validate all passages PD-4040 ([32d4ef2](https://github.com/pie-framework/pie-elements/commit/32d4ef266f33386a0c1a0fba849a698132115648))
53
+
54
+ ## [1.4.6](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-controller@1.4.5...@pie-element/passage-controller@1.4.6) (2024-11-20)
55
+
56
+ ### Bug Fixes
57
+
58
+ - **passage:** enable title and subtitle from controller by default PD-4515 ([954091c](https://github.com/pie-framework/pie-elements/commit/954091cf92cad508ad3b7200f40c92951752ec0d))
59
+
60
+ ## [1.4.5](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-controller@1.4.4...@pie-element/passage-controller@1.4.5) (2024-10-29)
61
+
62
+ **Note:** Version bump only for package @pie-element/passage-controller
63
+
64
+ ## [1.4.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-controller@1.4.3...@pie-element/passage-controller@1.4.4) (2024-10-22)
65
+
66
+ ### Bug Fixes
67
+
68
+ - added complexjs as dependency [PD-4200] ([da393d5](https://github.com/pie-framework/pie-elements/commit/da393d5ae8ef52f17b47ccf32967410a9263180e))
69
+ - added resolutions in controller as well [PD-4200] ([020edc5](https://github.com/pie-framework/pie-elements/commit/020edc5f0bb5de6bf8f344efd0a3b9b0b16b9dc7))
70
+ - reverting changes since the issue is fixed in the latest complex.js [PD-4200] ([42c9f21](https://github.com/pie-framework/pie-elements/commit/42c9f216c4d29b051156489beb43fa7093667eb7))
71
+
72
+ ## [1.4.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-controller@1.4.2...@pie-element/passage-controller@1.4.3) (2024-10-01)
73
+
74
+ **Note:** Version bump only for package @pie-element/passage-controller
75
+
76
+ ## [1.4.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-controller@1.4.1...@pie-element/passage-controller@1.4.2) (2024-09-11)
77
+
78
+ ### Bug Fixes
79
+
80
+ - **passage:** fix validation and update controller default values PD-4068 PD-4006 ([c4976b6](https://github.com/pie-framework/pie-elements/commit/c4976b664a441b225f5ebe47273a5a309cdfa9f7))
81
+
82
+ ## [1.4.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-controller@1.4.0...@pie-element/passage-controller@1.4.1) (2024-09-05)
83
+
84
+ ### Bug Fixes
85
+
86
+ - **passage:** add possibility to enable/disable fields in player PD-4006 PD-4058 ([3b379b1](https://github.com/pie-framework/pie-elements/commit/3b379b18684c3a337b3405a3517e429b4017b51f))
87
+
88
+ # [1.4.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-controller@1.3.0...@pie-element/passage-controller@1.4.0) (2024-06-25)
89
+
90
+ ### Features
91
+
92
+ - **passage:** add dynamic language attribute to indicate content language PD-2483. ([70fcec1](https://github.com/pie-framework/pie-elements/commit/70fcec177c1a920ccc1ea024875e82d2050afa50))
93
+
94
+ # [1.3.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-controller@1.2.0...@pie-element/passage-controller@1.3.0) (2024-06-24)
95
+
96
+ ### Features
97
+
98
+ - **passage:** added validation model for passage PD-3770 ([dfcd62f](https://github.com/pie-framework/pie-elements/commit/dfcd62f8abb79226a8875f938328a97372bfcc79))
99
+ - **passage:** Improvements for passage configure & controller ([ba8f690](https://github.com/pie-framework/pie-elements/commit/ba8f690d60a2faca8eaacf36bae5b80cff18f894))
100
+
101
+ # [1.2.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-controller@1.1.0...@pie-element/passage-controller@1.2.0) (2024-03-04)
102
+
103
+ ### Features
104
+
105
+ - add support for teacher instructions on passage PD-3445 ([54d5f94](https://github.com/pie-framework/pie-elements/commit/54d5f94b927068585eb7666e1f5ef23e0daad9eb))
106
+ - add support for teacher instructions on passage PD-3445 ([f69452e](https://github.com/pie-framework/pie-elements/commit/f69452e920300bd67cd714e298d8c0fc96cf40c4))
107
+ - remove teacher instructions for student PD-3445 ([f763cd5](https://github.com/pie-framework/pie-elements/commit/f763cd576a8503807722a91a9ab4f0d24c4623e7))
108
+
109
+ # 1.1.0 (2024-02-14)
110
+
111
+ ### Features
112
+
113
+ - add controller for passage PD-3445 ([fb51d3e](https://github.com/pie-framework/pie-elements/commit/fb51d3ef2181009e939a1310f1f7dc4769ef404d))
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ // TODO: also update '../../configure/src/defaults.js' and '../../src/print.js' when updating defaults
8
+ var _default = exports.default = {
9
+ authorEnabled: false,
10
+ // TODO: should be set to true when all Studio content is updated
11
+ passages: [{
12
+ teacherInstructions: '',
13
+ title: '',
14
+ subtitle: '',
15
+ author: '',
16
+ text: ''
17
+ }],
18
+ subtitleEnabled: true,
19
+ teacherInstructionsEnabled: true,
20
+ textEnabled: true,
21
+ titleEnabled: true
22
+ };
23
+ //# sourceMappingURL=defaults.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaults.js","names":["_default","exports","default","authorEnabled","passages","teacherInstructions","title","subtitle","author","text","subtitleEnabled","teacherInstructionsEnabled","textEnabled","titleEnabled"],"sources":["../src/defaults.js"],"sourcesContent":["// TODO: also update '../../configure/src/defaults.js' and '../../src/print.js' when updating defaults\nexport default {\n authorEnabled: false, // TODO: should be set to true when all Studio content is updated\n passages: [\n {\n teacherInstructions: '',\n title: '',\n subtitle: '',\n author: '',\n text: '',\n },\n ],\n subtitleEnabled: true,\n teacherInstructionsEnabled: true,\n textEnabled: true,\n titleEnabled: true,\n};\n"],"mappings":";;;;;;AAAA;AAAA,IAAAA,QAAA,GAAAC,OAAA,CAAAC,OAAA,GACe;EACbC,aAAa,EAAE,KAAK;EAAE;EACtBC,QAAQ,EAAE,CACR;IACEC,mBAAmB,EAAE,EAAE;IACvBC,KAAK,EAAE,EAAE;IACTC,QAAQ,EAAE,EAAE;IACZC,MAAM,EAAE,EAAE;IACVC,IAAI,EAAE;EACR,CAAC,CACF;EACDC,eAAe,EAAE,IAAI;EACrBC,0BAA0B,EAAE,IAAI;EAChCC,WAAW,EAAE,IAAI;EACjBC,YAAY,EAAE;AAChB,CAAC","ignoreList":[]}
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.createDefaultModel = createDefaultModel;
8
+ exports.model = model;
9
+ exports.validate = exports.normalize = void 0;
10
+ var _lodashEs = require("lodash-es");
11
+ var _defaults = _interopRequireDefault(require("./defaults"));
12
+ const getContent = html => (html || '').replace(/(<(?!img|iframe|source)([^>]+)>)/gi, '');
13
+ const checkNullish = value => value !== null && value !== undefined;
14
+ const isEnabled = (value, defaultValue) => checkNullish(value) ? value : defaultValue;
15
+ function createDefaultModel(model = {}) {
16
+ return new Promise(resolve => {
17
+ resolve({
18
+ ..._defaults.default,
19
+ ...model
20
+ });
21
+ });
22
+ }
23
+ const normalize = question => ({
24
+ ..._defaults.default,
25
+ ...question
26
+ });
27
+ exports.normalize = normalize;
28
+ const normalizeTeacherInstructions = (instructions, env) => {
29
+ const {
30
+ role,
31
+ mode
32
+ } = env;
33
+ if (role === 'instructor' && (mode === 'view' || mode === 'evaluate')) {
34
+ return instructions || '';
35
+ }
36
+ return '';
37
+ };
38
+
39
+ /**
40
+ *
41
+ * @param {*} question
42
+ * @param {*} session
43
+ * @param {*} env
44
+ */
45
+ async function model(question, session, env) {
46
+ const normalizedQuestion = normalize(question);
47
+ const normalizedPassages = normalizedQuestion.passages.map((passage, index) => ({
48
+ teacherInstructions: isEnabled(passage.teacherInstructionsEnabled, normalizedQuestion.teacherInstructionsEnabled) ? normalizeTeacherInstructions(passage.teacherInstructions, env) : '',
49
+ label: getContent(passage.title) ? passage.title : `Passage ${index + 1}`,
50
+ title: isEnabled(passage.titleEnabled, normalizedQuestion.titleEnabled) ? passage.title || '' : '',
51
+ subtitle: isEnabled(passage.subtitleEnabled, normalizedQuestion.subtitleEnabled) ? passage.subtitle || '' : '',
52
+ author: isEnabled(passage.authorEnabled, normalizedQuestion.authorEnabled) ? passage.author || '' : '',
53
+ text: isEnabled(passage.textEnabled, normalizedQuestion.textEnabled) ? passage.text || '' : ''
54
+ }));
55
+ return {
56
+ ...normalizedQuestion,
57
+ passages: normalizedPassages
58
+ };
59
+ }
60
+ const validate = (model = {}, config = {}) => {
61
+ const errors = {};
62
+ const passagesErrors = {};
63
+ (model.passages || []).forEach((passage, index) => {
64
+ const err = {};
65
+ ['teacherInstructions', 'title', 'subtitle', 'author', 'text'].forEach(field => {
66
+ if (config[field]?.required && !getContent(passage[field])) {
67
+ err[field] = 'This field is required.';
68
+ }
69
+ });
70
+ if (!(0, _lodashEs.isEmpty)(err)) {
71
+ passagesErrors[index] = err;
72
+ }
73
+ });
74
+ if (!(0, _lodashEs.isEmpty)(passagesErrors)) {
75
+ errors.passages = passagesErrors;
76
+ }
77
+ return errors;
78
+ };
79
+ exports.validate = validate;
80
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["_lodashEs","require","_defaults","_interopRequireDefault","getContent","html","replace","checkNullish","value","undefined","isEnabled","defaultValue","createDefaultModel","model","Promise","resolve","defaults","normalize","question","exports","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","isEmpty"],"sources":["../src/index.js"],"sourcesContent":["import { isEmpty } from 'lodash-es';\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"],"mappings":";;;;;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAEA,IAAAC,SAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,MAAMG,UAAU,GAAIC,IAAI,IAAK,CAACA,IAAI,IAAI,EAAE,EAAEC,OAAO,CAAC,oCAAoC,EAAE,EAAE,CAAC;AAE3F,MAAMC,YAAY,GAAIC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CAAC0B,OAAO,CAACmB,KAAK,CAAC,CAAC,EAAE;QAC1DD,GAAG,CAACC,KAAK,CAAC,GAAG,yBAAyB;MACxC;IACF,CAAC,CAAC;IAEF,IAAI,CAAC,IAAAE,iBAAO,EAACH,GAAG,CAAC,EAAE;MACjBF,cAAc,CAACf,KAAK,CAAC,GAAGiB,GAAG;IAC7B;EACF,CAAC,CAAC;EAEF,IAAI,CAAC,IAAAG,iBAAO,EAACL,cAAc,CAAC,EAAE;IAC5BD,MAAM,CAACjB,QAAQ,GAAGkB,cAAc;EAClC;EAEA,OAAOD,MAAM;AACf,CAAC;AAAC1B,OAAA,CAAAwB,QAAA,GAAAA,QAAA","ignoreList":[]}
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "@pie-element/passage-controller",
3
+ "private": true,
4
+ "version": "4.1.0-beta.0",
5
+ "description": "",
6
+ "main": "lib/index.js",
7
+ "module": "src/index.js",
8
+ "author": "",
9
+ "license": "ISC",
10
+ "dependencies": {
11
+ "lodash-es": "^4.17.23"
12
+ }
13
+ }