@pie-element/passage 5.3.4-next.0 → 6.0.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.
@@ -1,282 +1,193 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- var _typeof = require("@babel/runtime/helpers/typeof");
6
-
7
4
  Object.defineProperty(exports, "__esModule", {
8
5
  value: true
9
6
  });
10
- exports["default"] = exports.PassageComponent = void 0;
11
-
12
- var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
13
-
14
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
15
-
16
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
17
-
18
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
19
-
20
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
21
-
22
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
23
-
24
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
25
-
7
+ exports.default = exports.PassageComponent = void 0;
26
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
27
-
28
9
  var _react = _interopRequireDefault(require("react"));
29
-
30
10
  var _propTypes = _interopRequireDefault(require("prop-types"));
31
-
32
- var _styles = require("@material-ui/core/styles");
33
-
34
11
  var _configUi = require("@pie-lib/config-ui");
35
-
36
12
  var _editableHtml = _interopRequireWildcard(require("@pie-lib/editable-html"));
37
-
38
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
39
-
40
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
41
-
42
- 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; }
43
-
44
- 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; }
45
-
46
- 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); }; }
47
-
48
- 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; } }
49
-
50
- var PassageComponent = /*#__PURE__*/function (_React$Component) {
51
- (0, _inherits2["default"])(PassageComponent, _React$Component);
52
-
53
- var _super = _createSuper(PassageComponent);
54
-
55
- function PassageComponent(props) {
56
- var _this;
57
-
58
- (0, _classCallCheck2["default"])(this, PassageComponent);
59
- _this = _super.call(this, props);
60
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleChange", function (fieldName, value) {
61
- var _this$props = _this.props,
62
- model = _this$props.model,
63
- onModelChanged = _this$props.onModelChanged,
64
- passageIndex = _this$props.passageIndex;
65
-
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;
66
38
  if (!model.passages || passageIndex < 0 || passageIndex >= model.passages.length) {
67
39
  return;
68
40
  }
69
-
70
- var updatedPassages = (0, _toConsumableArray2["default"])(model.passages);
71
- updatedPassages[passageIndex] = _objectSpread(_objectSpread({}, updatedPassages[passageIndex]), {}, (0, _defineProperty2["default"])({}, fieldName, value));
72
- onModelChanged(_objectSpread(_objectSpread({}, model), {}, {
41
+ const updatedPassages = [...model.passages];
42
+ updatedPassages[passageIndex] = {
43
+ ...updatedPassages[passageIndex],
44
+ [fieldName]: value
45
+ };
46
+ onModelChanged({
47
+ ...model,
73
48
  passages: updatedPassages
74
- }));
49
+ });
75
50
  });
76
- return _this;
77
51
  }
78
-
79
- (0, _createClass2["default"])(PassageComponent, [{
80
- key: "render",
81
- value: function render() {
82
- var _this2 = this;
83
-
84
- var _this$props2 = this.props,
85
- model = _this$props2.model,
86
- classes = _this$props2.classes,
87
- configuration = _this$props2.configuration,
88
- imageSupport = _this$props2.imageSupport,
89
- passageIndex = _this$props2.passageIndex,
90
- uploadSoundSupport = _this$props2.uploadSoundSupport;
91
-
92
- var _ref = configuration || {},
93
- _ref$maxImageWidth = _ref.maxImageWidth,
94
- maxImageWidth = _ref$maxImageWidth === void 0 ? {} : _ref$maxImageWidth,
95
- _ref$maxImageHeight = _ref.maxImageHeight,
96
- maxImageHeight = _ref$maxImageHeight === void 0 ? {} : _ref$maxImageHeight,
97
- _ref$mathMlOptions = _ref.mathMlOptions,
98
- mathMlOptions = _ref$mathMlOptions === void 0 ? {} : _ref$mathMlOptions,
99
- _ref$baseInputConfigu = _ref.baseInputConfiguration,
100
- baseInputConfiguration = _ref$baseInputConfigu === void 0 ? {} : _ref$baseInputConfigu,
101
- _ref$teacherInstructi = _ref.teacherInstructions,
102
- teacherInstructions = _ref$teacherInstructi === void 0 ? {} : _ref$teacherInstructi,
103
- _ref$title = _ref.title,
104
- title = _ref$title === void 0 ? {} : _ref$title,
105
- _ref$subtitle = _ref.subtitle,
106
- subtitle = _ref$subtitle === void 0 ? {} : _ref$subtitle,
107
- _ref$text = _ref.text,
108
- text = _ref$text === void 0 ? {} : _ref$text,
109
- _ref$author = _ref.author,
110
- author = _ref$author === void 0 ? {} : _ref$author;
111
-
112
- var _ref2 = model || {},
113
- _ref2$errors = _ref2.errors,
114
- errors = _ref2$errors === void 0 ? {} : _ref2$errors,
115
- _ref2$passages = _ref2.passages,
116
- passages = _ref2$passages === void 0 ? [] : _ref2$passages,
117
- teacherInstructionsEnabled = _ref2.teacherInstructionsEnabled,
118
- titleEnabled = _ref2.titleEnabled,
119
- subtitleEnabled = _ref2.subtitleEnabled,
120
- authorEnabled = _ref2.authorEnabled,
121
- textEnabled = _ref2.textEnabled;
122
-
123
- var _ref3 = errors || {},
124
- passagesErrors = _ref3.passages;
125
-
126
- var _ref4 = passagesErrors && passagesErrors[passageIndex] || {},
127
- teacherInstructionsError = _ref4.teacherInstructions,
128
- titleError = _ref4.title,
129
- subtitleError = _ref4.subtitle,
130
- authorError = _ref4.author,
131
- textError = _ref4.text;
132
-
133
- var defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;
134
- var defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;
135
-
136
- var getPluginProps = function getPluginProps(customConfiguration) {
137
- return _objectSpread(_objectSpread({}, baseInputConfiguration), customConfiguration);
138
- };
139
-
140
- return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, teacherInstructionsEnabled && /*#__PURE__*/_react["default"].createElement(_configUi.InputContainer, {
141
- label: teacherInstructions.label,
142
- className: classes.inputContainer
143
- }, /*#__PURE__*/_react["default"].createElement(_editableHtml["default"], {
144
- activePlugins: _editableHtml.ALL_PLUGINS,
145
- markup: passages[passageIndex].teacherInstructions || '',
146
- onChange: function onChange(value) {
147
- return _this2.handleChange('teacherInstructions', value);
148
- },
149
- nonEmpty: false,
150
- error: teacherInstructionsError,
151
- maxImageWidth: maxImageWidth && maxImageWidth.teacherInstructions || defaultImageMaxWidth,
152
- maxImageHeight: maxImageHeight && maxImageHeight.teacherInstructions || defaultImageMaxHeight,
153
- mathMlOptions: mathMlOptions,
154
- languageCharactersProps: [{
155
- language: 'spanish'
156
- }, {
157
- language: 'special'
158
- }],
159
- pluginProps: getPluginProps(teacherInstructions === null || teacherInstructions === void 0 ? void 0 : teacherInstructions.inputConfiguration)
160
- }), teacherInstructionsError && /*#__PURE__*/_react["default"].createElement("div", {
161
- className: classes.errorText
162
- }, teacherInstructionsError)), titleEnabled && /*#__PURE__*/_react["default"].createElement(_configUi.InputContainer, {
163
- label: title.label,
164
- className: classes.inputContainer
165
- }, /*#__PURE__*/_react["default"].createElement(_editableHtml["default"], {
166
- activePlugins: _editableHtml.ALL_PLUGINS,
167
- markup: passages[passageIndex].title || '',
168
- onChange: function onChange(value) {
169
- return _this2.handleChange('title', value);
170
- },
171
- nonEmpty: false,
172
- error: titleError,
173
- mathMlOptions: mathMlOptions,
174
- languageCharactersProps: [{
175
- language: 'spanish'
176
- }, {
177
- language: 'special'
178
- }],
179
- pluginProps: getPluginProps(title === null || title === void 0 ? void 0 : title.inputConfiguration)
180
- }), titleError && /*#__PURE__*/_react["default"].createElement("div", {
181
- className: classes.errorText
182
- }, titleError)), subtitleEnabled && /*#__PURE__*/_react["default"].createElement(_configUi.InputContainer, {
183
- label: subtitle.label,
184
- className: classes.inputContainer
185
- }, /*#__PURE__*/_react["default"].createElement(_editableHtml["default"], {
186
- activePlugins: _editableHtml.ALL_PLUGINS,
187
- markup: passages[passageIndex].subtitle || '',
188
- onChange: function onChange(value) {
189
- return _this2.handleChange('subtitle', value);
190
- },
191
- nonEmpty: false,
192
- error: subtitleError,
193
- mathMlOptions: mathMlOptions,
194
- languageCharactersProps: [{
195
- language: 'spanish'
196
- }, {
197
- language: 'special'
198
- }],
199
- pluginProps: getPluginProps(subtitle === null || subtitle === void 0 ? void 0 : subtitle.inputConfiguration)
200
- }), subtitleError && /*#__PURE__*/_react["default"].createElement("div", {
201
- className: classes.errorText
202
- }, subtitleError)), authorEnabled && /*#__PURE__*/_react["default"].createElement(_configUi.InputContainer, {
203
- label: author.label,
204
- className: classes.inputContainer
205
- }, /*#__PURE__*/_react["default"].createElement(_editableHtml["default"], {
206
- activePlugins: _editableHtml.ALL_PLUGINS,
207
- markup: passages[passageIndex].author || '',
208
- onChange: function onChange(value) {
209
- return _this2.handleChange('author', value);
210
- },
211
- nonEmpty: false,
212
- error: authorError,
213
- mathMlOptions: mathMlOptions,
214
- languageCharactersProps: [{
215
- language: 'spanish'
216
- }, {
217
- language: 'special'
218
- }],
219
- pluginProps: getPluginProps(author === null || author === void 0 ? void 0 : author.inputConfiguration)
220
- }), authorError && /*#__PURE__*/_react["default"].createElement("div", {
221
- className: classes.errorText
222
- }, authorError)), textEnabled && /*#__PURE__*/_react["default"].createElement(_configUi.InputContainer, {
223
- label: text.label,
224
- className: classes.inputContainer
225
- }, /*#__PURE__*/_react["default"].createElement(_editableHtml["default"], {
226
- activePlugins: _editableHtml.ALL_PLUGINS,
227
- markup: passages[passageIndex].text || '',
228
- onChange: function onChange(value) {
229
- return _this2.handleChange('text', value);
230
- },
231
- imageSupport: imageSupport,
232
- uploadSoundSupport: uploadSoundSupport,
233
- nonEmpty: false,
234
- error: textError,
235
- maxImageWidth: maxImageWidth && maxImageWidth.text || defaultImageMaxWidth,
236
- maxImageHeight: maxImageHeight && maxImageHeight.text || defaultImageMaxHeight,
237
- mathMlOptions: mathMlOptions,
238
- languageCharactersProps: [{
239
- language: 'spanish'
240
- }, {
241
- language: 'special'
242
- }],
243
- pluginProps: getPluginProps(text === null || text === void 0 ? void 0 : text.inputConfiguration)
244
- }), textError && /*#__PURE__*/_react["default"].createElement("div", {
245
- className: classes.errorText
246
- }, textError)));
247
- }
248
- }]);
249
- return PassageComponent;
250
- }(_react["default"].Component);
251
-
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
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, teacherInstructionsEnabled && /*#__PURE__*/_react.default.createElement(StyledInputContainer, {
97
+ label: teacherInstructions.label
98
+ }, /*#__PURE__*/_react.default.createElement(_editableHtml.default, {
99
+ activePlugins: _editableHtml.ALL_PLUGINS,
100
+ markup: passages[passageIndex].teacherInstructions || '',
101
+ onChange: value => this.handleChange('teacherInstructions', value),
102
+ nonEmpty: false,
103
+ error: teacherInstructionsError,
104
+ maxImageWidth: maxImageWidth && maxImageWidth.teacherInstructions || defaultImageMaxWidth,
105
+ maxImageHeight: maxImageHeight && maxImageHeight.teacherInstructions || defaultImageMaxHeight,
106
+ mathMlOptions: mathMlOptions,
107
+ languageCharactersProps: [{
108
+ language: 'spanish'
109
+ }, {
110
+ language: 'special'
111
+ }],
112
+ pluginProps: getPluginProps(teacherInstructions?.inputConfiguration)
113
+ }), teacherInstructionsError && /*#__PURE__*/_react.default.createElement(ErrorText, null, teacherInstructionsError)), titleEnabled && /*#__PURE__*/_react.default.createElement(StyledInputContainer, {
114
+ label: title.label
115
+ }, /*#__PURE__*/_react.default.createElement(_editableHtml.default, {
116
+ activePlugins: _editableHtml.ALL_PLUGINS,
117
+ markup: passages[passageIndex].title || '',
118
+ onChange: value => this.handleChange('title', value),
119
+ nonEmpty: false,
120
+ error: titleError,
121
+ mathMlOptions: mathMlOptions,
122
+ languageCharactersProps: [{
123
+ language: 'spanish'
124
+ }, {
125
+ language: 'special'
126
+ }],
127
+ pluginProps: getPluginProps(title?.inputConfiguration)
128
+ }), titleError && /*#__PURE__*/_react.default.createElement(ErrorText, null, titleError)), subtitleEnabled && /*#__PURE__*/_react.default.createElement(StyledInputContainer, {
129
+ label: subtitle.label
130
+ }, /*#__PURE__*/_react.default.createElement(_editableHtml.default, {
131
+ activePlugins: _editableHtml.ALL_PLUGINS,
132
+ markup: passages[passageIndex].subtitle || '',
133
+ onChange: value => this.handleChange('subtitle', value),
134
+ nonEmpty: false,
135
+ error: subtitleError,
136
+ mathMlOptions: mathMlOptions,
137
+ languageCharactersProps: [{
138
+ language: 'spanish'
139
+ }, {
140
+ language: 'special'
141
+ }],
142
+ pluginProps: getPluginProps(subtitle?.inputConfiguration)
143
+ }), subtitleError && /*#__PURE__*/_react.default.createElement(ErrorText, null, subtitleError)), authorEnabled && /*#__PURE__*/_react.default.createElement(StyledInputContainer, {
144
+ label: author.label
145
+ }, /*#__PURE__*/_react.default.createElement(_editableHtml.default, {
146
+ activePlugins: _editableHtml.ALL_PLUGINS,
147
+ markup: passages[passageIndex].author || '',
148
+ onChange: value => this.handleChange('author', value),
149
+ nonEmpty: false,
150
+ error: authorError,
151
+ mathMlOptions: mathMlOptions,
152
+ languageCharactersProps: [{
153
+ language: 'spanish'
154
+ }, {
155
+ language: 'special'
156
+ }],
157
+ pluginProps: getPluginProps(author?.inputConfiguration)
158
+ }), authorError && /*#__PURE__*/_react.default.createElement(ErrorText, null, authorError)), textEnabled && /*#__PURE__*/_react.default.createElement(StyledInputContainer, {
159
+ label: text.label
160
+ }, /*#__PURE__*/_react.default.createElement(_editableHtml.default, {
161
+ activePlugins: _editableHtml.ALL_PLUGINS,
162
+ markup: passages[passageIndex].text || '',
163
+ onChange: value => this.handleChange('text', value),
164
+ imageSupport: imageSupport,
165
+ uploadSoundSupport: uploadSoundSupport,
166
+ nonEmpty: false,
167
+ error: textError,
168
+ maxImageWidth: maxImageWidth && maxImageWidth.text || defaultImageMaxWidth,
169
+ maxImageHeight: maxImageHeight && maxImageHeight.text || defaultImageMaxHeight,
170
+ mathMlOptions: mathMlOptions,
171
+ languageCharactersProps: [{
172
+ language: 'spanish'
173
+ }, {
174
+ language: 'special'
175
+ }],
176
+ pluginProps: getPluginProps(text?.inputConfiguration)
177
+ }), textError && /*#__PURE__*/_react.default.createElement(ErrorText, null, textError)));
178
+ }
179
+ }
252
180
  exports.PassageComponent = PassageComponent;
253
- (0, _defineProperty2["default"])(PassageComponent, "propTypes", {
254
- classes: _propTypes["default"].object,
255
- onModelChanged: _propTypes["default"].func.isRequired,
256
- model: _propTypes["default"].object.isRequired,
257
- configuration: _propTypes["default"].object.isRequired,
258
- imageSupport: _propTypes["default"].object.isRequired,
259
- passageIndex: _propTypes["default"].number.isRequired,
260
- uploadSoundSupport: _propTypes["default"].object.isRequired
181
+ (0, _defineProperty2.default)(PassageComponent, "propTypes", {
182
+ onModelChanged: _propTypes.default.func.isRequired,
183
+ model: _propTypes.default.object.isRequired,
184
+ configuration: _propTypes.default.object.isRequired,
185
+ imageSupport: _propTypes.default.object.isRequired,
186
+ passageIndex: _propTypes.default.number.isRequired,
187
+ uploadSoundSupport: _propTypes.default.object.isRequired
261
188
  });
262
- (0, _defineProperty2["default"])(PassageComponent, "defaultProps", {
189
+ (0, _defineProperty2.default)(PassageComponent, "defaultProps", {
263
190
  passageIndex: 0
264
191
  });
265
-
266
- var _default = (0, _styles.withStyles)(function (theme) {
267
- return {
268
- inputContainer: {
269
- paddingTop: theme.spacing.unit * 2,
270
- marginBottom: theme.spacing.unit * 2,
271
- width: '100%'
272
- },
273
- errorText: {
274
- fontSize: theme.typography.fontSize - 2,
275
- color: theme.palette.error.main,
276
- paddingTop: theme.spacing.unit
277
- }
278
- };
279
- })(PassageComponent);
280
-
281
- exports["default"] = _default;
192
+ var _default = exports.default = PassageComponent;
282
193
  //# sourceMappingURL=passage.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/passage.jsx"],"names":["PassageComponent","props","fieldName","value","model","onModelChanged","passageIndex","passages","length","updatedPassages","classes","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","label","inputContainer","ALL_PLUGINS","handleChange","language","inputConfiguration","errorText","React","Component","PropTypes","object","func","isRequired","number","theme","paddingTop","spacing","unit","marginBottom","width","fontSize","typography","color","palette","error","main"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;IAEaA,gB;;;;;AAeX,4BAAYC,KAAZ,EAAmB;AAAA;;AAAA;AACjB,8BAAMA,KAAN;AADiB,qGAIJ,UAACC,SAAD,EAAYC,KAAZ,EAAsB;AACnC,wBAAgD,MAAKF,KAArD;AAAA,UAAQG,KAAR,eAAQA,KAAR;AAAA,UAAeC,cAAf,eAAeA,cAAf;AAAA,UAA+BC,YAA/B,eAA+BA,YAA/B;;AAEA,UAAI,CAACF,KAAK,CAACG,QAAP,IAAmBD,YAAY,GAAG,CAAlC,IAAuCA,YAAY,IAAIF,KAAK,CAACG,QAAN,CAAeC,MAA1E,EAAkF;AAChF;AACD;;AAED,UAAMC,eAAe,uCAAOL,KAAK,CAACG,QAAb,CAArB;AACAE,MAAAA,eAAe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Z7B,QADF,EAeGX,SAAS,iBAAI;AAAK,QAAA,SAAS,EAAExB,OAAO,CAACoC;AAAxB,SAAoCZ,SAApC,CAfhB,CApEJ,CADF;AAyFD;;;EA9JmCa,kBAAMC,S;;;iCAA/BhD,gB,eACQ;AACjBU,EAAAA,OAAO,EAAEuC,sBAAUC,MADF;AAEjB7C,EAAAA,cAAc,EAAE4C,sBAAUE,IAAV,CAAeC,UAFd;AAGjBhD,EAAAA,KAAK,EAAE6C,sBAAUC,MAAV,CAAiBE,UAHP;AAIjBzC,EAAAA,aAAa,EAAEsC,sBAAUC,MAAV,CAAiBE,UAJf;AAKjBxC,EAAAA,YAAY,EAAEqC,sBAAUC,MAAV,CAAiBE,UALd;AAMjB9C,EAAAA,YAAY,EAAE2C,sBAAUI,MAAV,CAAiBD,UANd;AAOjBvC,EAAAA,kBAAkB,EAAEoC,sBAAUC,MAAV,CAAiBE;AAPpB,C;iCADRpD,gB,kBAWW;AACpBM,EAAAA,YAAY,EAAE;AADM,C;;eAsJT,wBAAW,UAACgD,KAAD;AAAA,SAAY;AACpCb,IAAAA,cAAc,EAAE;AACdc,MAAAA,UAAU,EAAED,KAAK,CAACE,OAAN,CAAcC,IAAd,GAAqB,CADnB;AAEdC,MAAAA,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,EAWXzD,gBAXW,C","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@material-ui/core/styles';\nimport { InputContainer } from '@pie-lib/config-ui';\nimport EditableHtml, { ALL_PLUGINS } from '@pie-lib/editable-html';\n\nexport class PassageComponent extends React.Component {\n static propTypes = {\n classes: PropTypes.object,\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, classes, 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 return (\n <React.Fragment>\n {teacherInstructionsEnabled && (\n <InputContainer label={teacherInstructions.label} className={classes.inputContainer}>\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 && <div className={classes.errorText}>{teacherInstructionsError}</div>}\n </InputContainer>\n )}\n\n {titleEnabled && (\n <InputContainer label={title.label} className={classes.inputContainer}>\n <EditableHtml\n activePlugins={ALL_PLUGINS}\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 && <div className={classes.errorText}>{titleError}</div>}\n </InputContainer>\n )}\n\n {subtitleEnabled && (\n <InputContainer label={subtitle.label} className={classes.inputContainer}>\n <EditableHtml\n activePlugins={ALL_PLUGINS}\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 && <div className={classes.errorText}>{subtitleError}</div>}\n </InputContainer>\n )}\n\n {authorEnabled && (\n <InputContainer label={author.label} className={classes.inputContainer}>\n <EditableHtml\n activePlugins={ALL_PLUGINS}\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 && <div className={classes.errorText}>{authorError}</div>}\n </InputContainer>\n )}\n\n {textEnabled && (\n <InputContainer label={text.label} className={classes.inputContainer}>\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 && <div className={classes.errorText}>{textError}</div>}\n </InputContainer>\n )}\n </React.Fragment>\n );\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}))(PassageComponent);\n"],"file":"passage.js"}
1
+ {"version":3,"file":"passage.js","names":["_react","_interopRequireDefault","require","_propTypes","_configUi","_editableHtml","_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","createElement","Fragment","label","activePlugins","ALL_PLUGINS","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';\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 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={ALL_PLUGINS}\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={ALL_PLUGINS}\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={ALL_PLUGINS}\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,aAAA,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,uB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3B,CAEV,CAAC;EAErB;AACF;AAACmB,OAAA,CAAAzD,gBAAA,GAAAA,gBAAA;AAAA,IAAAK,gBAAA,CAAA7B,OAAA,EA9JYwB,gBAAgB,eACR;EACjBS,cAAc,EAAEiD,kBAAS,CAACC,IAAI,CAACC,UAAU;EACzCpD,KAAK,EAAEkD,kBAAS,CAACG,MAAM,CAACD,UAAU;EAClC7C,aAAa,EAAE2C,kBAAS,CAACG,MAAM,CAACD,UAAU;EAC1C5C,YAAY,EAAE0C,kBAAS,CAACG,MAAM,CAACD,UAAU;EACzClD,YAAY,EAAEgD,kBAAS,CAACI,MAAM,CAACF,UAAU;EACzC3C,kBAAkB,EAAEyC,kBAAS,CAACG,MAAM,CAACD;AACvC,CAAC;AAAA,IAAAvD,gBAAA,CAAA7B,OAAA,EARUwB,gBAAgB,kBAUL;EACpBU,YAAY,EAAE;AAChB,CAAC;AAAA,IAAAqD,QAAA,GAAAN,OAAA,CAAAjF,OAAA,GAoJYwB,gBAAgB","ignoreList":[]}
@@ -1,20 +1,23 @@
1
1
  {
2
2
  "name": "@pie-element/passage-configure",
3
3
  "private": true,
4
- "version": "3.3.3",
4
+ "version": "4.0.0-beta.0",
5
5
  "description": "",
6
6
  "main": "lib/index.js",
7
7
  "module": "src/index.js",
8
8
  "author": "pie framework developers",
9
9
  "license": "ISC",
10
10
  "dependencies": {
11
- "@material-ui/core": "^3.9.2",
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",
12
15
  "@pie-framework/pie-configure-events": "^1.3.0",
13
- "@pie-lib/config-ui": "11.30.2",
14
- "@pie-lib/editable-html": "11.21.2",
16
+ "@pie-lib/config-ui": "11.30.4-next.0",
17
+ "@pie-lib/editable-html": "11.21.4-next.0",
15
18
  "lodash": "^4.17.15",
16
19
  "prop-types": "^15.6.2",
17
- "react": "^16.8.1",
18
- "react-dom": "^16.8.1"
20
+ "react": "18.2.0",
21
+ "react-dom": "18.2.0"
19
22
  }
20
23
  }
@@ -3,9 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports["default"] = void 0;
6
+ exports.default = void 0;
7
7
  // TODO: also update '../../configure/src/defaults.js' and '../../src/print.js' when updating defaults
8
- var _default = {
8
+ var _default = exports.default = {
9
9
  authorEnabled: false,
10
10
  // TODO: should be set to true when all Studio content is updated
11
11
  passages: [{
@@ -20,5 +20,4 @@ var _default = {
20
20
  textEnabled: true,
21
21
  titleEnabled: true
22
22
  };
23
- exports["default"] = _default;
24
23
  //# sourceMappingURL=defaults.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/defaults.js"],"names":["authorEnabled","passages","teacherInstructions","title","subtitle","author","text","subtitleEnabled","teacherInstructionsEnabled","textEnabled","titleEnabled"],"mappings":";;;;;;AAAA;eACe;AACbA,EAAAA,aAAa,EAAE,KADF;AACS;AACtBC,EAAAA,QAAQ,EAAE,CACR;AACEC,IAAAA,mBAAmB,EAAE,EADvB;AAEEC,IAAAA,KAAK,EAAE,EAFT;AAGEC,IAAAA,QAAQ,EAAE,EAHZ;AAIEC,IAAAA,MAAM,EAAE,EAJV;AAKEC,IAAAA,IAAI,EAAE;AALR,GADQ,CAFG;AAWbC,EAAAA,eAAe,EAAE,IAXJ;AAYbC,EAAAA,0BAA0B,EAAE,IAZf;AAabC,EAAAA,WAAW,EAAE,IAbA;AAcbC,EAAAA,YAAY,EAAE;AAdD,C","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"],"file":"defaults.js"}
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":[]}