@pie-element/passage 2.15.1-next.3 → 2.16.1-next.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
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.16.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@2.15.0...@pie-element/passage@2.16.0) (2024-06-24)
7
+
8
+
9
+ ### Features
10
+
11
+ * update pie-lib/pie-toolbox ability to enabled/disable blockquote and h3 (PD-3772, PD-3771) and PD-3813 ([c2cfd9b](https://github.com/pie-framework/pie-elements/commit/c2cfd9b323acdf3d456c05806c1f97f9067bb4fe))
12
+ * **passage:** Add passage configure + initial UI & unit tests PD-3770 ([68a0413](https://github.com/pie-framework/pie-elements/commit/68a041323a9b3e24de0691c30f987bccbaa9e0d7))
13
+ * **passage:** added validation model for passage PD-3770 ([dfcd62f](https://github.com/pie-framework/pie-elements/commit/dfcd62f8abb79226a8875f938328a97372bfcc79))
14
+ * **passage:** fix handleChange in passage-configure PD-3770 ([dd5d23b](https://github.com/pie-framework/pie-elements/commit/dd5d23b04ff9f7f1112f710f4c179ebd7659bd03))
15
+ * **passage:** Improvements for passage configure & controller ([ba8f690](https://github.com/pie-framework/pie-elements/commit/ba8f690d60a2faca8eaacf36bae5b80cff18f894))
16
+ * **passage:** small adjustments for authoring passage PD-3770 ([ec47363](https://github.com/pie-framework/pie-elements/commit/ec473638998779c737268a4a66ce55b8473b492b))
17
+
18
+
19
+
20
+
21
+
6
22
  # [2.15.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@2.14.0...@pie-element/passage@2.15.0) (2024-06-19)
7
23
 
8
24
 
@@ -0,0 +1,15 @@
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
+ # 1.1.0 (2024-06-24)
7
+
8
+
9
+ ### Features
10
+
11
+ * update pie-lib/pie-toolbox ability to enabled/disable blockquote and h3 (PD-3772, PD-3771) and PD-3813 ([c2cfd9b](https://github.com/pie-framework/pie-elements/commit/c2cfd9b323acdf3d456c05806c1f97f9067bb4fe))
12
+ * **passage:** Add passage configure + initial UI & unit tests PD-3770 ([68a0413](https://github.com/pie-framework/pie-elements/commit/68a041323a9b3e24de0691c30f987bccbaa9e0d7))
13
+ * **passage:** fix handleChange in passage-configure PD-3770 ([dd5d23b](https://github.com/pie-framework/pie-elements/commit/dd5d23b04ff9f7f1112f710f4c179ebd7659bd03))
14
+ * **passage:** Improvements for passage configure & controller ([ba8f690](https://github.com/pie-framework/pie-elements/commit/ba8f690d60a2faca8eaacf36bae5b80cff18f894))
15
+ * **passage:** small adjustments for authoring passage PD-3770 ([ec47363](https://github.com/pie-framework/pie-elements/commit/ec473638998779c737268a4a66ce55b8473b492b))
@@ -0,0 +1,139 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _default = {
8
+ model: {
9
+ teacherInstructionsEnabled: true,
10
+ titleEnabled: true,
11
+ subtitleEnabled: true,
12
+ textEnabled: true,
13
+ authorEnabled: true,
14
+ passages: [{
15
+ teacherInstructions: '',
16
+ title: '',
17
+ subtitle: '',
18
+ author: '',
19
+ text: ''
20
+ }]
21
+ },
22
+ configuration: {
23
+ baseInputConfiguration: {
24
+ audio: {
25
+ disabled: false
26
+ },
27
+ video: {
28
+ disabled: false
29
+ },
30
+ image: {
31
+ disabled: false
32
+ }
33
+ },
34
+ settingsPanelDisabled: false,
35
+ title: {
36
+ settings: true,
37
+ label: 'Title',
38
+ inputConfiguration: {
39
+ audio: {
40
+ disabled: true
41
+ },
42
+ video: {
43
+ disabled: true
44
+ },
45
+ image: {
46
+ disabled: true
47
+ }
48
+ },
49
+ required: true
50
+ },
51
+ subtitle: {
52
+ settings: true,
53
+ label: 'Subtitle',
54
+ inputConfiguration: {
55
+ audio: {
56
+ disabled: true
57
+ },
58
+ video: {
59
+ disabled: true
60
+ },
61
+ image: {
62
+ disabled: true
63
+ }
64
+ },
65
+ required: false
66
+ },
67
+ author: {
68
+ settings: true,
69
+ label: 'Author',
70
+ inputConfiguration: {
71
+ audio: {
72
+ disabled: true
73
+ },
74
+ video: {
75
+ disabled: true
76
+ },
77
+ image: {
78
+ disabled: true
79
+ }
80
+ },
81
+ required: false
82
+ },
83
+ text: {
84
+ settings: true,
85
+ label: 'Text',
86
+ inputConfiguration: {
87
+ audio: {
88
+ disabled: false
89
+ },
90
+ video: {
91
+ disabled: false
92
+ },
93
+ image: {
94
+ disabled: false
95
+ }
96
+ },
97
+ required: true
98
+ },
99
+ teacherInstructions: {
100
+ settings: true,
101
+ label: 'Teacher Instructions',
102
+ inputConfiguration: {
103
+ audio: {
104
+ disabled: false
105
+ },
106
+ video: {
107
+ disabled: false
108
+ },
109
+ image: {
110
+ disabled: false
111
+ }
112
+ },
113
+ required: false
114
+ },
115
+ maxImageWidth: {
116
+ teacherInstructions: 300,
117
+ text: 300
118
+ },
119
+ maxImageHeight: {
120
+ teacherInstructions: 300,
121
+ text: 300
122
+ },
123
+ mathMlOptions: {
124
+ mmlOutput: false,
125
+ mmlEditing: false
126
+ },
127
+ language: {
128
+ settings: true,
129
+ label: 'Specify Language',
130
+ enabled: true
131
+ },
132
+ languageChoices: {
133
+ label: 'Language Choices',
134
+ options: []
135
+ }
136
+ }
137
+ };
138
+ exports["default"] = _default;
139
+ //# sourceMappingURL=defaults.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/defaults.js"],"names":["model","teacherInstructionsEnabled","titleEnabled","subtitleEnabled","textEnabled","authorEnabled","passages","teacherInstructions","title","subtitle","author","text","configuration","baseInputConfiguration","audio","disabled","video","image","settingsPanelDisabled","settings","label","inputConfiguration","required","maxImageWidth","maxImageHeight","mathMlOptions","mmlOutput","mmlEdit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AAGlBE,QAAAA,KAAK,EAAE;AAAEF,UAAAA,QAAQ,EAAE;AAAZ;AAHW,OAHD;AAQnBO,MAAAA,QAAQ,EAAE;AARS,KA/CR;AAyDbC,IAAAA,aAAa,EAAE;AACbhB,MAAAA,mBAAmB,EAAE,GADR;AAEbI,MAAAA,IAAI,EAAC;AAFQ,KAzDF;AA6Dba,IAAAA,cAAc,EAAE;AACdjB,MAAAA,mBAAmB,EAAE,GADP;AAEdI,MAAAA,IAAI,EAAE;AAFQ,KA7DH;AAiEbc,IAAAA,aAAa,EAAE;AACbC,MAAAA,SAAS,EAAE,KADE;AAEbC,MAAAA,UAAU,EAAE;AAFC,KAjEF;AAqEbC,IAAAA,QAAQ,EAAE;AACRT,MAAAA,QAAQ,EAAE,IADF;AAERC,MAAAA,KAAK,EAAE,kBAFC;AAGRS,MAAAA,OAAO,EAAE;AAHD,KArEG;AA0EbC,IAAAA,eAAe,EAAE;AACfV,MAAAA,KAAK,EAAE,kBADQ;AAEfW,MAAAA,OAAO,EAAE;AAFM;AA1EJ;AAjBF,C","sourcesContent":["export default {\n model: {\n teacherInstructionsEnabled: true,\n titleEnabled: true,\n subtitleEnabled: true,\n textEnabled: true,\n authorEnabled: true,\n passages: [\n {\n teacherInstructions: '',\n title: '',\n subtitle: '',\n author: '',\n text: '',\n }\n ],\n },\n configuration: {\n baseInputConfiguration: {\n audio: { disabled: false },\n video: { disabled: false },\n image: { disabled: false },\n },\n settingsPanelDisabled: false,\n title: {\n settings: true,\n label: 'Title',\n inputConfiguration: {\n audio: { disabled: true },\n video: { disabled: true },\n image: { disabled: true },\n },\n required: true,\n },\n subtitle: {\n settings: true,\n label: 'Subtitle',\n inputConfiguration: {\n audio: { disabled: true },\n video: { disabled: true },\n image: { disabled: true },\n },\n required: false\n },\n author: {\n settings: true,\n label: 'Author',\n inputConfiguration: {\n audio: { disabled: true },\n video: { disabled: true },\n image: { disabled: true },\n },\n required: false\n },\n text: {\n settings: true,\n label: 'Text',\n inputConfiguration: {\n audio: { disabled: false },\n video: { disabled: false },\n image: { disabled: false },\n },\n required: true\n },\n teacherInstructions: {\n settings: true,\n label: 'Teacher Instructions',\n inputConfiguration: {\n audio: { disabled: false },\n video: { disabled: false },\n image: { disabled: false },\n },\n required: false,\n },\n maxImageWidth: {\n teacherInstructions: 300,\n text:300,\n },\n maxImageHeight: {\n teacherInstructions: 300,\n text: 300,\n },\n mathMlOptions: {\n mmlOutput: false,\n mmlEditing: false,\n },\n language: {\n settings: true,\n label: 'Specify Language',\n enabled: true,\n },\n languageChoices: {\n label: 'Language Choices',\n options: [],\n },\n },\n};\n"],"file":"defaults.js"}
@@ -0,0 +1,311 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports["default"] = exports.Main = void 0;
9
+
10
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
11
+
12
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
13
+
14
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
15
+
16
+ var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
17
+
18
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
19
+
20
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
21
+
22
+ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
23
+
24
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
25
+
26
+ var _react = _interopRequireDefault(require("react"));
27
+
28
+ var _configUi = require("@pie-lib/pie-toolbox/config-ui");
29
+
30
+ var _propTypes = _interopRequireDefault(require("prop-types"));
31
+
32
+ var _Typography = _interopRequireDefault(require("@material-ui/core/Typography"));
33
+
34
+ var _styles = require("@material-ui/core/styles");
35
+
36
+ var _editableHtml = require("@pie-lib/pie-toolbox/editable-html");
37
+
38
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
39
+
40
+ 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; }
41
+
42
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
43
+
44
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
45
+
46
+ var Panel = _configUi.settings.Panel,
47
+ toggle = _configUi.settings.toggle,
48
+ numberFields = _configUi.settings.numberFields,
49
+ dropdown = _configUi.settings.dropdown;
50
+
51
+ var Main = /*#__PURE__*/function (_React$Component) {
52
+ (0, _inherits2["default"])(Main, _React$Component);
53
+
54
+ var _super = _createSuper(Main);
55
+
56
+ function Main(props) {
57
+ var _this;
58
+
59
+ (0, _classCallCheck2["default"])(this, Main);
60
+ _this = _super.call(this, props);
61
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleChange", function (fieldName, value) {
62
+ var index = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
63
+ var _this$props = _this.props,
64
+ model = _this$props.model,
65
+ onModelChanged = _this$props.onModelChanged;
66
+
67
+ if (!model || !onModelChanged || !model.passages || index < 0 || index >= model.passages.length) {
68
+ return;
69
+ }
70
+
71
+ var updatedPassages = (0, _toConsumableArray2["default"])(model.passages);
72
+ updatedPassages[index] = _objectSpread(_objectSpread({}, updatedPassages[index]), {}, (0, _defineProperty2["default"])({}, fieldName, value));
73
+ onModelChanged(_objectSpread(_objectSpread({}, model), {}, {
74
+ passages: updatedPassages
75
+ }));
76
+ });
77
+ _this.state = {
78
+ setDimensions: true
79
+ };
80
+ return _this;
81
+ }
82
+
83
+ (0, _createClass2["default"])(Main, [{
84
+ key: "render",
85
+ value: function render() {
86
+ var _this2 = this;
87
+
88
+ var _this$props2 = this.props,
89
+ model = _this$props2.model,
90
+ classes = _this$props2.classes,
91
+ configuration = _this$props2.configuration,
92
+ imageSupport = _this$props2.imageSupport,
93
+ onConfigurationChanged = _this$props2.onConfigurationChanged,
94
+ onModelChanged = _this$props2.onModelChanged,
95
+ uploadSoundSupport = _this$props2.uploadSoundSupport;
96
+
97
+ var _ref = configuration || {},
98
+ settingsPanelDisabled = _ref.settingsPanelDisabled,
99
+ _ref$language = _ref.language,
100
+ language = _ref$language === void 0 ? {} : _ref$language,
101
+ _ref$languageChoices = _ref.languageChoices,
102
+ languageChoices = _ref$languageChoices === void 0 ? {} : _ref$languageChoices,
103
+ _ref$maxImageWidth = _ref.maxImageWidth,
104
+ maxImageWidth = _ref$maxImageWidth === void 0 ? {} : _ref$maxImageWidth,
105
+ _ref$maxImageHeight = _ref.maxImageHeight,
106
+ maxImageHeight = _ref$maxImageHeight === void 0 ? {} : _ref$maxImageHeight,
107
+ _ref$mathMlOptions = _ref.mathMlOptions,
108
+ mathMlOptions = _ref$mathMlOptions === void 0 ? {} : _ref$mathMlOptions,
109
+ _ref$baseInputConfigu = _ref.baseInputConfiguration,
110
+ baseInputConfiguration = _ref$baseInputConfigu === void 0 ? {} : _ref$baseInputConfigu,
111
+ _ref$teacherInstructi = _ref.teacherInstructions,
112
+ teacherInstructions = _ref$teacherInstructi === void 0 ? {} : _ref$teacherInstructi,
113
+ title = _ref.title,
114
+ subtitle = _ref.subtitle,
115
+ text = _ref.text,
116
+ author = _ref.author;
117
+
118
+ var _ref2 = model || {},
119
+ _ref2$errors = _ref2.errors,
120
+ errors = _ref2$errors === void 0 ? {} : _ref2$errors,
121
+ teacherInstructionsEnabled = _ref2.teacherInstructionsEnabled,
122
+ titleEnabled = _ref2.titleEnabled,
123
+ subtitleEnabled = _ref2.subtitleEnabled,
124
+ authorEnabled = _ref2.authorEnabled,
125
+ textEnabled = _ref2.textEnabled,
126
+ _ref2$passages = _ref2.passages,
127
+ passages = _ref2$passages === void 0 ? [{
128
+ title: title,
129
+ subtitle: subtitle,
130
+ text: text,
131
+ author: author,
132
+ teacherInstructions: teacherInstructions
133
+ }] : _ref2$passages;
134
+
135
+ var _ref3 = errors || {},
136
+ teacherInstructionsError = _ref3.teacherInstructions,
137
+ titleError = _ref3.title,
138
+ subtitleError = _ref3.subtitle,
139
+ authorError = _ref3.author,
140
+ textError = _ref3.text;
141
+
142
+ var defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;
143
+ var defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;
144
+ var panelSettings = {
145
+ titleEnabled: title && title.settings && toggle(title.label),
146
+ subtitleEnabled: subtitle && subtitle.settings && toggle(subtitle.label),
147
+ authorEnabled: author && author.settings && toggle(author.label),
148
+ textEnabled: text && text.settings && toggle(text.label)
149
+ };
150
+ var panelProperties = {
151
+ teacherInstructionsEnabled: teacherInstructions && teacherInstructions.settings && toggle(teacherInstructions.label),
152
+ 'language.enabled': language && language.settings && toggle(language.label, true),
153
+ language: language && language.settings && language.enabled && dropdown(languageChoices.label, languageChoices.options)
154
+ };
155
+
156
+ var getPluginProps = function getPluginProps(props) {
157
+ return Object.assign(_objectSpread({}, baseInputConfiguration), props || {});
158
+ };
159
+
160
+ return /*#__PURE__*/_react["default"].createElement(_configUi.layout.ConfigLayout, {
161
+ hideSettings: settingsPanelDisabled,
162
+ settings: /*#__PURE__*/_react["default"].createElement(Panel, {
163
+ model: model,
164
+ configuration: configuration,
165
+ onChangeModel: function onChangeModel(model) {
166
+ return onModelChanged(model);
167
+ },
168
+ onChangeConfiguration: function onChangeConfiguration(config) {
169
+ return onConfigurationChanged(config);
170
+ },
171
+ groups: {
172
+ Settings: panelSettings,
173
+ Properties: panelProperties
174
+ }
175
+ })
176
+ }, titleEnabled && /*#__PURE__*/_react["default"].createElement(_configUi.InputContainer, {
177
+ label: title.label,
178
+ className: classes.inputContainer
179
+ }, /*#__PURE__*/_react["default"].createElement(_editableHtml.EditableHtml, {
180
+ markup: model.passages[0].title || '',
181
+ onChange: function onChange(value) {
182
+ return _this2.handleChange('title', value);
183
+ },
184
+ nonEmpty: false,
185
+ error: titleError,
186
+ mathMlOptions: mathMlOptions,
187
+ languageCharactersProps: [{
188
+ language: 'spanish'
189
+ }, {
190
+ language: 'special'
191
+ }],
192
+ pluginProps: getPluginProps(title === null || title === void 0 ? void 0 : title.inputConfiguration)
193
+ }), titleError && /*#__PURE__*/_react["default"].createElement("div", {
194
+ className: classes.errorText
195
+ }, titleError)), subtitleEnabled && /*#__PURE__*/_react["default"].createElement(_configUi.InputContainer, {
196
+ label: subtitle.label,
197
+ className: classes.inputContainer
198
+ }, /*#__PURE__*/_react["default"].createElement(_editableHtml.EditableHtml, {
199
+ markup: model.passages[0].subtitle || '',
200
+ onChange: function onChange(value) {
201
+ return _this2.handleChange('subtitle', value);
202
+ },
203
+ nonEmpty: false,
204
+ error: subtitleError,
205
+ mathMlOptions: mathMlOptions,
206
+ languageCharactersProps: [{
207
+ language: 'spanish'
208
+ }, {
209
+ language: 'special'
210
+ }],
211
+ pluginProps: getPluginProps(subtitle === null || subtitle === void 0 ? void 0 : subtitle.inputConfiguration)
212
+ }), subtitleError && /*#__PURE__*/_react["default"].createElement("div", {
213
+ className: classes.errorText
214
+ }, subtitleError)), authorEnabled && /*#__PURE__*/_react["default"].createElement(_configUi.InputContainer, {
215
+ label: author.label,
216
+ className: classes.inputContainer
217
+ }, /*#__PURE__*/_react["default"].createElement(_editableHtml.EditableHtml, {
218
+ markup: model.passages[0].author || '',
219
+ onChange: function onChange(value) {
220
+ return _this2.handleChange('author', value);
221
+ },
222
+ nonEmpty: false,
223
+ error: authorError,
224
+ mathMlOptions: mathMlOptions,
225
+ languageCharactersProps: [{
226
+ language: 'spanish'
227
+ }, {
228
+ language: 'special'
229
+ }],
230
+ pluginProps: getPluginProps(author === null || author === void 0 ? void 0 : author.inputConfiguration)
231
+ }), authorError && /*#__PURE__*/_react["default"].createElement("div", {
232
+ className: classes.errorText
233
+ }, authorError)), teacherInstructionsEnabled && /*#__PURE__*/_react["default"].createElement(_configUi.InputContainer, {
234
+ label: teacherInstructions.label,
235
+ className: classes.inputContainer
236
+ }, /*#__PURE__*/_react["default"].createElement(_editableHtml.EditableHtml, {
237
+ markup: model.passages[0].teacherInstructions || '',
238
+ onChange: function onChange(value) {
239
+ return _this2.handleChange('teacherInstructions', value);
240
+ },
241
+ nonEmpty: false,
242
+ error: teacherInstructionsError,
243
+ maxImageWidth: maxImageWidth && maxImageWidth.teacherInstructions || defaultImageMaxWidth,
244
+ maxImageHeight: maxImageHeight && maxImageHeight.teacherInstructions || defaultImageMaxHeight,
245
+ mathMlOptions: mathMlOptions,
246
+ languageCharactersProps: [{
247
+ language: 'spanish'
248
+ }, {
249
+ language: 'special'
250
+ }],
251
+ pluginProps: getPluginProps(teacherInstructions === null || teacherInstructions === void 0 ? void 0 : teacherInstructions.inputConfiguration)
252
+ }), teacherInstructionsError && /*#__PURE__*/_react["default"].createElement("div", {
253
+ className: classes.errorText
254
+ }, teacherInstructionsError)), textEnabled && /*#__PURE__*/_react["default"].createElement(_configUi.InputContainer, {
255
+ label: text.label,
256
+ className: classes.inputContainer
257
+ }, /*#__PURE__*/_react["default"].createElement(_editableHtml.EditableHtml, {
258
+ activePlugins: _editableHtml.ALL_PLUGINS,
259
+ markup: model.passages[0].text || '',
260
+ onChange: function onChange(value) {
261
+ return _this2.handleChange('text', value);
262
+ },
263
+ imageSupport: imageSupport,
264
+ uploadSoundSupport: uploadSoundSupport,
265
+ nonEmpty: false,
266
+ error: textError,
267
+ maxImageWidth: maxImageWidth && maxImageWidth.text || defaultImageMaxWidth,
268
+ maxImageHeight: maxImageHeight && maxImageHeight.text || defaultImageMaxHeight,
269
+ mathMlOptions: mathMlOptions,
270
+ languageCharactersProps: [{
271
+ language: 'spanish'
272
+ }, {
273
+ language: 'special'
274
+ }],
275
+ pluginProps: getPluginProps(text === null || text === void 0 ? void 0 : text.inputConfiguration)
276
+ }), textError && /*#__PURE__*/_react["default"].createElement("div", {
277
+ className: classes.errorText
278
+ }, textError)));
279
+ }
280
+ }]);
281
+ return Main;
282
+ }(_react["default"].Component);
283
+
284
+ exports.Main = Main;
285
+ (0, _defineProperty2["default"])(Main, "propTypes", {
286
+ onModelChanged: _propTypes["default"].func.isRequired,
287
+ onConfigurationChanged: _propTypes["default"].func,
288
+ model: _propTypes["default"].object.isRequired,
289
+ configuration: _propTypes["default"].object.isRequired,
290
+ imageSupport: _propTypes["default"].object.isRequired,
291
+ uploadSoundSupport: _propTypes["default"].object.isRequired,
292
+ classes: _propTypes["default"].object.isRequired
293
+ });
294
+
295
+ var _default = (0, _styles.withStyles)(function (theme) {
296
+ return {
297
+ inputContainer: {
298
+ paddingTop: theme.spacing.unit * 2,
299
+ marginBottom: theme.spacing.unit * 2,
300
+ width: '100%'
301
+ },
302
+ errorText: {
303
+ fontSize: theme.typography.fontSize - 2,
304
+ color: theme.palette.error.main,
305
+ paddingTop: theme.spacing.unit
306
+ }
307
+ };
308
+ })(Main);
309
+
310
+ exports["default"] = _default;
311
+ //# sourceMappingURL=design.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/design.jsx"],"names":["Panel","settings","toggle","numberFields","dropdown","Main","props","fieldName","value","index","model","onModelChanged","passages","length","updatedPassages","state","setDimensions","classes","configuration","imageSupport","onConfigurationChanged","uploadSoundSupport","settingsPanelDisabled","language","languageChoices","maxImageWidth","maxImageHeight","mathMlOptions","baseInputConfiguration","teacherInstructions","title","subtitle","text","author","errors","teacherInstructionsEnabled","titleEnabled","subtitleEnabled","authorEnabled","textEnabled","teacherInstructionsError","titleError","subtitleError","authorError","textError","defaultImageMaxWidth","prompt","defaultImageMaxHeight","panelSettings","label","panelProperties","enabled","options","getPluginProps","Object","assign","config","Settings","Properties","inputContainer","handleChange","inputConfiguration","errorText","ALL_PLUGINS","React","Component","PropTypes","func","isRequired","object","theme","paddingTop","spacing","unit","marginBottom","width","fontSize","typography","color","palette","error","main"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,IAAQA,KAAR,GAAkDC,kBAAlD,CAAQD,KAAR;AAAA,IAAeE,MAAf,GAAkDD,kBAAlD,CAAeC,MAAf;AAAA,IAAuBC,YAAvB,GAAkDF,kBAAlD,CAAuBE,YAAvB;AAAA,IAAqCC,QAArC,GAAkDH,kBAAlD,CAAqCG,QAArC;;IAEaC,I;;;;;AAWX,gBAAYC,KAAZ,EAAmB;AAAA;;AAAA;AACjB,8BAAMA,KAAN;AADiB,qGAKJ,UAACC,SAAD,EAAYC,KAAZ,EAAiC;AAAA,UAAdC,KAAc,uEAAN,CAAM;AAC9C,wBAAkC,MAAKH,KAAvC;AAAA,UAAQI,KAAR,eAAQA,KAAR;AAAA,UAAeC,cAAf,eAAeA,cAAf;;AACA,UAAI,CAACD,KAAD,IAAU,CAACC,cAAX,IAA6B,CAACD,KAAK,CAACE,QAApC,IAAgDH,KAAK,GAAG,CAAxD,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YAAY,EAAEJ,KAAK,CAACE,OAAN,CAAcC,IAAd,GAAqB,CAFrB;AAGdE,MAAAA,KAAK,EAAE;AAHO,KADoB;AAMpCb,IAAAA,SAAS,EAAE;AACTc,MAAAA,QAAQ,EAAEN,KAAK,CAACO,UAAN,CAAiBD,QAAjB,GAA4B,CAD7B;AAETE,MAAAA,KAAK,EAAER,KAAK,CAACS,OAAN,CAAcC,KAAd,CAAoBC,IAFlB;AAGTV,MAAAA,UAAU,EAAED,KAAK,CAACE,OAAN,CAAcC;AAHjB;AANyB,GAAZ;AAAA,CAAX,EAWXpE,IAXW,C","sourcesContent":["import React from 'react';\nimport { FeedbackSelector, InputContainer, settings, layout } from '@pie-lib/pie-toolbox/config-ui';\nimport PropTypes from 'prop-types';\nimport Typography from '@material-ui/core/Typography';\nimport { withStyles } from '@material-ui/core/styles';\nimport { EditableHtml, ALL_PLUGINS } from '@pie-lib/pie-toolbox/editable-html';\n\nconst { Panel, toggle, numberFields, dropdown } = settings;\n\nexport class Main extends React.Component {\n static propTypes = {\n onModelChanged: PropTypes.func.isRequired,\n onConfigurationChanged: PropTypes.func,\n model: PropTypes.object.isRequired,\n configuration: PropTypes.object.isRequired,\n imageSupport: PropTypes.object.isRequired,\n uploadSoundSupport: PropTypes.object.isRequired,\n classes: PropTypes.object.isRequired,\n };\n\n constructor(props) {\n super(props);\n this.state = { setDimensions: true };\n }\n\n handleChange = (fieldName, value, index = 0) => {\n const { model, onModelChanged } = this.props;\n if (!model || !onModelChanged || !model.passages || index < 0 || index >= model.passages.length) {\n return;\n }\n const updatedPassages = [...model.passages];\n updatedPassages[index] = { ...updatedPassages[index], [fieldName]: value };\n\n onModelChanged({ ...model, passages: updatedPassages });\n };\n\n render() {\n const { model, classes, configuration, imageSupport, onConfigurationChanged, onModelChanged, uploadSoundSupport } =\n this.props;\n const {\n settingsPanelDisabled,\n language = {},\n languageChoices = {},\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 teacherInstructionsEnabled,\n titleEnabled,\n subtitleEnabled,\n authorEnabled,\n textEnabled,\n passages = [{\n title,\n subtitle,\n text,\n author,\n teacherInstructions,\n }]\n } = model || {};\n const { teacherInstructions: teacherInstructionsError, title: titleError, subtitle: subtitleError, author: authorError, text: textError } = errors || {};\n\n const defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;\n const defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;\n\n const panelSettings = {\n titleEnabled: title && title.settings && toggle(title.label),\n subtitleEnabled: subtitle && subtitle.settings && toggle(subtitle.label),\n authorEnabled: author && author.settings && toggle(author.label),\n textEnabled: text && text.settings && toggle(text.label),\n };\n\n const panelProperties = {\n teacherInstructionsEnabled: teacherInstructions && teacherInstructions.settings && toggle(teacherInstructions.label),\n 'language.enabled': language && language.settings && toggle(language.label, true),\n language: language && language.settings && language.enabled && dropdown(languageChoices.label, languageChoices.options),\n };\n\n const getPluginProps = (props) => {\n return Object.assign(\n {\n ...baseInputConfiguration,\n },\n props || {},\n );\n };\n\n return (\n <layout.ConfigLayout\n hideSettings={settingsPanelDisabled}\n settings={\n <Panel\n model={model}\n configuration={configuration}\n onChangeModel={(model) => onModelChanged(model)}\n onChangeConfiguration={(config) => onConfigurationChanged(config)}\n groups={{\n Settings: panelSettings,\n Properties: panelProperties,\n }}\n />\n }\n >\n {titleEnabled && (\n <InputContainer label={title.label} className={classes.inputContainer}>\n <EditableHtml\n markup={model.passages[0].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 && <div className={classes.errorText}>{titleError}</div>}\n </InputContainer>\n )}\n {subtitleEnabled && (\n <InputContainer label={subtitle.label} className={classes.inputContainer}>\n <EditableHtml\n markup={model.passages[0].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 && <div className={classes.errorText}>{subtitleError}</div>}\n </InputContainer>\n )}\n {authorEnabled && (\n <InputContainer label={author.label} className={classes.inputContainer}>\n <EditableHtml\n markup={model.passages[0].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 && <div className={classes.errorText}>{authorError}</div>}\n </InputContainer>\n )}\n {teacherInstructionsEnabled && (\n <InputContainer label={teacherInstructions.label} className={classes.inputContainer}>\n <EditableHtml\n markup={model.passages[0].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 && <div className={classes.errorText}>{teacherInstructionsError}</div>}\n </InputContainer>\n )}\n {textEnabled && (\n <InputContainer label={text.label} className={classes.inputContainer}>\n <EditableHtml\n activePlugins={ALL_PLUGINS}\n markup={model.passages[0].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 && <div className={classes.errorText}>{textError}</div>}\n </InputContainer>\n )}\n </layout.ConfigLayout>\n );\n }\n}\nexport default withStyles((theme) => ({\n inputContainer: {\n paddingTop: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit * 2,\n width: '100%',\n },\n errorText: {\n fontSize: theme.typography.fontSize - 2,\n color: theme.palette.error.main,\n paddingTop: theme.spacing.unit,\n },\n}))(Main);\n"],"file":"design.js"}