@pie-element/passage 3.5.6-next.9 → 3.6.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 +28 -0
- package/configure/CHANGELOG.md +27 -0
- package/configure/lib/common.js +101 -0
- package/configure/lib/common.js.map +1 -0
- package/configure/lib/defaults.js +8 -0
- package/configure/lib/defaults.js.map +1 -1
- package/configure/lib/design.js +117 -172
- package/configure/lib/design.js.map +1 -1
- package/configure/lib/passage.js +276 -0
- package/configure/lib/passage.js.map +1 -0
- package/configure/package.json +2 -2
- package/controller/CHANGELOG.md +11 -0
- package/controller/lib/index.js +0 -6
- package/controller/lib/index.js.map +1 -1
- package/controller/package.json +1 -1
- package/module/configure.js +5110 -504
- package/module/controller.js +0 -6
- package/module/element.js +1 -1
- package/module/manifest.json +1 -1
- package/module/print.js +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,34 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [3.6.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@3.5.5...@pie-element/passage@3.6.0) (2025-05-22)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* conflicts ([fce1a12](https://github.com/pie-framework/pie-elements/commit/fce1a12cacfcdc0f7ded44291eb7539dc3567127))
|
|
12
|
+
* tests PD-5009 ([e00ac85](https://github.com/pie-framework/pie-elements/commit/e00ac85428a335d1dd67012b99a89861926594d0))
|
|
13
|
+
* update pie-lib/pie-toolbox PD-4555, PD-4561 ([a7c878c](https://github.com/pie-framework/pie-elements/commit/a7c878cc1c1440bc0f72acb8ca3ef2a023023066))
|
|
14
|
+
* update pie-lib/pie-toolbox PD-5009, PD-5002 ([9d5d7a3](https://github.com/pie-framework/pie-elements/commit/9d5d7a31ea06b568c346008aee2557dfd2e9a796))
|
|
15
|
+
* **passage:** code review improvements PD-4040 ([2c9d279](https://github.com/pie-framework/pie-elements/commit/2c9d27985c3c8bf26d09b4b9a4722ee9cdf6f034))
|
|
16
|
+
* **passage:** correct failing test, validate all passages PD-4040 ([32d4ef2](https://github.com/pie-framework/pie-elements/commit/32d4ef266f33386a0c1a0fba849a698132115648))
|
|
17
|
+
* **passage:** fix table styling inside passage to be consistent PD-4594 ([6c373ca](https://github.com/pie-framework/pie-elements/commit/6c373ca20180eeaaa84fe484f5c11edb933ee63f))
|
|
18
|
+
* **passage:** get rid of translator PD-4040 ([c76c422](https://github.com/pie-framework/pie-elements/commit/c76c422b40ce80fb2665cd2851b6fc51cc5d54a6))
|
|
19
|
+
* **passage:** reset defaults values to their initial value PD-4040 ([a0aa8bf](https://github.com/pie-framework/pie-elements/commit/a0aa8bf8d8be22a95a3e5c16b5c16ba4076dc59f))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Features
|
|
23
|
+
|
|
24
|
+
* **passage:** add logic for addimg an additional passage PD-4040 ([9ff4eb1](https://github.com/pie-framework/pie-elements/commit/9ff4eb10d7b8380bc33b5ee7448712958e3afea7))
|
|
25
|
+
* **passage:** create logic add remove passage, add translator PD-4040 ([393d6fa](https://github.com/pie-framework/pie-elements/commit/393d6faf700c416887beff69a16baa4a2d3dead1))
|
|
26
|
+
* **passage:** handle corner cases, create new file for common components PD-4040 ([5dfb968](https://github.com/pie-framework/pie-elements/commit/5dfb968b5d8040318615ca537c55ddb5b8cdc305))
|
|
27
|
+
* **passage:** rewrite tests as structure was changed and new func added PD-4040 ([b0693a1](https://github.com/pie-framework/pie-elements/commit/b0693a104cb9cb2b2d5e34ee69941e6398008747))
|
|
28
|
+
* **passage:** update authoring for additional passage, create own component for passage component pd-4040 ([ca61920](https://github.com/pie-framework/pie-elements/commit/ca61920fba2a451d37bcfa829a3712191edfd3fb))
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
6
34
|
## [3.5.5](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@3.5.4...@pie-element/passage@3.5.5) (2025-05-12)
|
|
7
35
|
|
|
8
36
|
|
package/configure/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,33 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [2.5.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-configure@2.4.5...@pie-element/passage-configure@2.5.0) (2025-05-22)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* conflicts ([fce1a12](https://github.com/pie-framework/pie-elements/commit/fce1a12cacfcdc0f7ded44291eb7539dc3567127))
|
|
12
|
+
* tests PD-5009 ([e00ac85](https://github.com/pie-framework/pie-elements/commit/e00ac85428a335d1dd67012b99a89861926594d0))
|
|
13
|
+
* update pie-lib/pie-toolbox PD-4555, PD-4561 ([a7c878c](https://github.com/pie-framework/pie-elements/commit/a7c878cc1c1440bc0f72acb8ca3ef2a023023066))
|
|
14
|
+
* update pie-lib/pie-toolbox PD-5009, PD-5002 ([9d5d7a3](https://github.com/pie-framework/pie-elements/commit/9d5d7a31ea06b568c346008aee2557dfd2e9a796))
|
|
15
|
+
* **passage:** code review improvements PD-4040 ([2c9d279](https://github.com/pie-framework/pie-elements/commit/2c9d27985c3c8bf26d09b4b9a4722ee9cdf6f034))
|
|
16
|
+
* **passage:** correct failing test, validate all passages PD-4040 ([32d4ef2](https://github.com/pie-framework/pie-elements/commit/32d4ef266f33386a0c1a0fba849a698132115648))
|
|
17
|
+
* **passage:** get rid of translator PD-4040 ([c76c422](https://github.com/pie-framework/pie-elements/commit/c76c422b40ce80fb2665cd2851b6fc51cc5d54a6))
|
|
18
|
+
* **passage:** reset defaults values to their initial value PD-4040 ([a0aa8bf](https://github.com/pie-framework/pie-elements/commit/a0aa8bf8d8be22a95a3e5c16b5c16ba4076dc59f))
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Features
|
|
22
|
+
|
|
23
|
+
* **passage:** add logic for addimg an additional passage PD-4040 ([9ff4eb1](https://github.com/pie-framework/pie-elements/commit/9ff4eb10d7b8380bc33b5ee7448712958e3afea7))
|
|
24
|
+
* **passage:** create logic add remove passage, add translator PD-4040 ([393d6fa](https://github.com/pie-framework/pie-elements/commit/393d6faf700c416887beff69a16baa4a2d3dead1))
|
|
25
|
+
* **passage:** handle corner cases, create new file for common components PD-4040 ([5dfb968](https://github.com/pie-framework/pie-elements/commit/5dfb968b5d8040318615ca537c55ddb5b8cdc305))
|
|
26
|
+
* **passage:** rewrite tests as structure was changed and new func added PD-4040 ([b0693a1](https://github.com/pie-framework/pie-elements/commit/b0693a104cb9cb2b2d5e34ee69941e6398008747))
|
|
27
|
+
* **passage:** update authoring for additional passage, create own component for passage component pd-4040 ([ca61920](https://github.com/pie-framework/pie-elements/commit/ca61920fba2a451d37bcfa829a3712191edfd3fb))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
6
33
|
## [2.4.5](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-configure@2.4.4...@pie-element/passage-configure@2.4.5) (2025-05-12)
|
|
7
34
|
|
|
8
35
|
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.RemoveAddButton = exports.PassageButton = exports.ConfimationDialog = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
|
|
14
|
+
var _styles = require("@material-ui/core/styles");
|
|
15
|
+
|
|
16
|
+
var _core = require("@material-ui/core");
|
|
17
|
+
|
|
18
|
+
var _RemoveCircle = _interopRequireDefault(require("@material-ui/icons/RemoveCircle"));
|
|
19
|
+
|
|
20
|
+
var _AddCircle = _interopRequireDefault(require("@material-ui/icons/AddCircle"));
|
|
21
|
+
|
|
22
|
+
var _Dialog = _interopRequireDefault(require("@material-ui/core/Dialog"));
|
|
23
|
+
|
|
24
|
+
var _DialogTitle = _interopRequireDefault(require("@material-ui/core/DialogTitle"));
|
|
25
|
+
|
|
26
|
+
var _DialogContent = _interopRequireDefault(require("@material-ui/core/DialogContent"));
|
|
27
|
+
|
|
28
|
+
var _DialogContentText = _interopRequireDefault(require("@material-ui/core/DialogContentText"));
|
|
29
|
+
|
|
30
|
+
var _DialogActions = _interopRequireDefault(require("@material-ui/core/DialogActions"));
|
|
31
|
+
|
|
32
|
+
var RemoveAddButton = function RemoveAddButton(_ref) {
|
|
33
|
+
var classes = _ref.classes,
|
|
34
|
+
label = _ref.label,
|
|
35
|
+
_ref$type = _ref.type,
|
|
36
|
+
type = _ref$type === void 0 ? 'add' : _ref$type,
|
|
37
|
+
onClick = _ref.onClick;
|
|
38
|
+
var Tag = type === 'add' ? _AddCircle["default"] : _RemoveCircle["default"];
|
|
39
|
+
return /*#__PURE__*/_react["default"].createElement(_core.Button, {
|
|
40
|
+
color: "primary",
|
|
41
|
+
size: "small",
|
|
42
|
+
className: classes.root,
|
|
43
|
+
onClick: onClick
|
|
44
|
+
}, /*#__PURE__*/_react["default"].createElement(Tag, {
|
|
45
|
+
fontSize: 'small',
|
|
46
|
+
color: 'primary',
|
|
47
|
+
className: classes.icon
|
|
48
|
+
}), label);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
exports.RemoveAddButton = RemoveAddButton;
|
|
52
|
+
var PassageButton = (0, _styles.withStyles)(function (theme) {
|
|
53
|
+
return {
|
|
54
|
+
root: {
|
|
55
|
+
textDecoration: 'underline',
|
|
56
|
+
'&:hover': {
|
|
57
|
+
textDecoration: 'underline',
|
|
58
|
+
backgroundColor: 'transparent'
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
label: {
|
|
62
|
+
display: 'flex',
|
|
63
|
+
alignItems: 'center'
|
|
64
|
+
},
|
|
65
|
+
icon: {
|
|
66
|
+
marginRight: theme.spacing.unit / 2
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
})(RemoveAddButton);
|
|
70
|
+
exports.PassageButton = PassageButton;
|
|
71
|
+
|
|
72
|
+
var ConfimationDialog = function ConfimationDialog(_ref2) {
|
|
73
|
+
var content = _ref2.content,
|
|
74
|
+
cancel = _ref2.cancel,
|
|
75
|
+
title = _ref2.title,
|
|
76
|
+
ok = _ref2.ok,
|
|
77
|
+
open = _ref2.open,
|
|
78
|
+
onOk = _ref2.onOk,
|
|
79
|
+
onCancel = _ref2.onCancel;
|
|
80
|
+
return /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
|
|
81
|
+
open: open
|
|
82
|
+
}, /*#__PURE__*/_react["default"].createElement(_DialogTitle["default"], null, title), /*#__PURE__*/_react["default"].createElement(_DialogContent["default"], null, /*#__PURE__*/_react["default"].createElement(_DialogContentText["default"], null, content)), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, onOk && /*#__PURE__*/_react["default"].createElement(_core.Button, {
|
|
83
|
+
onClick: onOk,
|
|
84
|
+
color: "primary"
|
|
85
|
+
}, ok), onCancel && /*#__PURE__*/_react["default"].createElement(_core.Button, {
|
|
86
|
+
onClick: onCancel,
|
|
87
|
+
color: "primary"
|
|
88
|
+
}, cancel)));
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
exports.ConfimationDialog = ConfimationDialog;
|
|
92
|
+
ConfimationDialog.propTypes = {
|
|
93
|
+
content: _propTypes["default"].string.isRequired,
|
|
94
|
+
title: _propTypes["default"].string.isRequired,
|
|
95
|
+
cancel: _propTypes["default"].string.isRequired,
|
|
96
|
+
ok: _propTypes["default"].string.isRequired,
|
|
97
|
+
open: _propTypes["default"].bool.isRequired,
|
|
98
|
+
onCancel: _propTypes["default"].func.isRequired,
|
|
99
|
+
onOk: _propTypes["default"].func.isRequired
|
|
100
|
+
};
|
|
101
|
+
//# sourceMappingURL=common.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/common.jsx"],"names":["RemoveAddButton","classes","label","type","onClick","Tag","AddCircleIcon","RemoveCircleIcon","root","icon","PassageButton","theme","textDecoration","backgroundColor","display","alignItems","marginRight","spacing","unit","ConfimationDialog","content","cancel","title","ok","open","onOk","onCancel","propTypes","PropTypes","string","isRequired","bool","func"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEO,IAAMA,eAAe,GAAG,SAAlBA,eAAkB,OAA+C;AAAA,MAA5CC,OAA4C,QAA5CA,OAA4C;AAAA,MAAnCC,KAAmC,QAAnCA,KAAmC;AAAA,uBAA5BC,IAA4B;AAAA,MAA5BA,IAA4B,0BAArB,KAAqB;AAAA,MAAdC,OAAc,QAAdA,OAAc;AAC5E,MAAMC,GAAG,GAAGF,IAAI,KAAK,KAAT,GAAiBG,qBAAjB,GAAiCC,wBAA7C;AACA,sBACE,gCAAC,YAAD;AAAQ,IAAA,KAAK,EAAC,SAAd;AAAwB,IAAA,IAAI,EAAC,OAA7B;AAAqC,IAAA,SAAS,EAAEN,OAAO,CAACO,IAAxD;AAA8D,IAAA,OAAO,EAAEJ;AAAvE,kBACE,gCAAC,GAAD;AAAK,IAAA,QAAQ,EAAE,OAAf;AAAwB,IAAA,KAAK,EAAE,SAA/B;AAA0C,IAAA,SAAS,EAAEH,OAAO,CAACQ;AAA7D,IADF,EAEGP,KAFH,CADF;AAMD,CARM;;;AAUA,IAAMQ,aAAa,GAAG,wBAAW,UAACC,KAAD;AAAA,SAAY;AAClDH,IAAAA,IAAI,EAAE;AACJI,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,sBAAUC,MAAV,CAAiBC,UAFI;AAG5BT,EAAAA,MAAM,EAAEO,sBAAUC,MAAV,CAAiBC,UAHG;AAI5BP,EAAAA,EAAE,EAAEK,sBAAUC,MAAV,CAAiBC,UAJO;AAK5BN,EAAAA,IAAI,EAAEI,sBAAUG,IAAV,CAAeD,UALO;AAM5BJ,EAAAA,QAAQ,EAAEE,sBAAUI,IAAV,CAAeF,UANG;AAO5BL,EAAAA,IAAI,EAAEG,sBAAUI,IAAV,CAAeF;AAPO,CAA9B","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@material-ui/core/styles';\nimport { Button } from '@material-ui/core';\nimport RemoveCircleIcon from '@material-ui/icons/RemoveCircle';\nimport AddCircleIcon from '@material-ui/icons/AddCircle';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogContentText from '@material-ui/core/DialogContentText';\nimport DialogActions from '@material-ui/core/DialogActions';\n\nexport const RemoveAddButton = ({ classes, label, type = 'add', onClick }) => {\n const Tag = type === 'add' ? AddCircleIcon : RemoveCircleIcon;\n return (\n <Button color=\"primary\" size=\"small\" className={classes.root} onClick={onClick}>\n <Tag fontSize={'small'} color={'primary'} className={classes.icon} />\n {label}\n </Button>\n );\n}\n\nexport const PassageButton = withStyles((theme) => ({\n root: {\n textDecoration: 'underline',\n '&:hover': {\n textDecoration: 'underline',\n backgroundColor: 'transparent',\n },\n },\n label: {\n display: 'flex',\n alignItems: 'center',\n },\n icon: {\n marginRight: theme.spacing.unit / 2,\n },\n}))(RemoveAddButton);\n\nexport const ConfimationDialog = ({ content, cancel, title, ok, open, onOk, onCancel }) => (\n <Dialog open={open}>\n <DialogTitle>{title}</DialogTitle>\n\n <DialogContent>\n <DialogContentText>{content}</DialogContentText>\n </DialogContent>\n\n <DialogActions>\n {onOk && (\n <Button onClick={onOk} color=\"primary\">\n {ok}\n </Button>\n )}\n {onCancel && (\n <Button onClick={onCancel} color=\"primary\">\n {cancel}\n </Button>\n )}\n </DialogActions>\n </Dialog>\n);\n\nConfimationDialog.propTypes = {\n content: PropTypes.string.isRequired,\n title: PropTypes.string.isRequired,\n cancel: PropTypes.string.isRequired,\n ok: PropTypes.string.isRequired,\n open: PropTypes.bool.isRequired,\n onCancel: PropTypes.func.isRequired,\n onOk: PropTypes.func.isRequired,\n};\n"],"file":"common.js"}
|
|
@@ -42,6 +42,9 @@ var _default = {
|
|
|
42
42
|
},
|
|
43
43
|
showParagraphs: {
|
|
44
44
|
disabled: false
|
|
45
|
+
},
|
|
46
|
+
separateParagraphs: {
|
|
47
|
+
disabled: true
|
|
45
48
|
}
|
|
46
49
|
},
|
|
47
50
|
settingsPanelDisabled: false,
|
|
@@ -160,6 +163,11 @@ var _default = {
|
|
|
160
163
|
languageChoices: {
|
|
161
164
|
label: 'Language Choices',
|
|
162
165
|
options: []
|
|
166
|
+
},
|
|
167
|
+
additionalPassage: {
|
|
168
|
+
settings: true,
|
|
169
|
+
label: 'Additional Passage',
|
|
170
|
+
enabled: false
|
|
163
171
|
}
|
|
164
172
|
}
|
|
165
173
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/defaults.js"],"names":["model","authorEnabled","passages","teacherInstructions","title","subtitle","author","text","subtitleEnabled","teacherInstructionsEnabled","textEnabled","titleEnabled","configuration","baseInputConfiguration","audio","disabled","video","image","h3","blockquote","textAlign","showParagraphs","settingsPanelDisabled","settings","label","inputConfiguration","required","maxImageWidth","maxImageHeight","mathMlOptions","mmlOutput","mmlEditing","language","enabled","languageChoices","options"],"mappings":";;;;;;AAAA;eACe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,aAAa,EAAE,IADV;AAELC,IAAAA,QAAQ,EAAE,CACR;AACEC,MAAAA,mBAAmB,EAAE,EADvB;AAEEC,MAAAA,KAAK,EAAE,EAFT;AAGEC,MAAAA,QAAQ,EAAE,EAHZ;AAIEC,MAAAA,MAAM,EAAE,EAJV;AAKEC,MAAAA,IAAI,EAAE;AALR,KADQ,CAFL;AAWLC,IAAAA,eAAe,EAAE,IAXZ;AAYLC,IAAAA,0BAA0B,EAAE,IAZvB;AAaLC,IAAAA,WAAW,EAAE,IAbR;AAcLC,IAAAA,YAAY,EAAE;AAdT,GADM;AAiBbC,EAAAA,aAAa,EAAE;AACbC,IAAAA,sBAAsB,EAAE;AACtBC,MAAAA,KAAK,EAAE;AAAEC,QAAAA,QAAQ,EAAE;AAAZ,OADe;AAEtBC,MAAAA,KAAK,EAAE;AAAED,QAAAA,QAAQ,EAAE;AAAZ,OAFe;AAGtBE,MAAAA,KAAK,EAAE;AAAEF,QAAAA,QAAQ,EAAE;AAAZ,OAHe;AAItBG,MAAAA,EAAE,EAAE;AAAEH,QAAAA,QAAQ,EAAE;AAAZ,OAJkB;AAKtBI,MAAAA,UAAU,EAAE;AAAEJ,QAAAA,QAAQ,EAAE;AAAZ,OALU;AAMtBK,MAAAA,SAAS,EAAE;AAAEL,QAAAA,QAAQ,EAAE;AAAZ,OANW;AAOtBM,MAAAA,cAAc,EAAE;AAAEN,QAAAA,QAAQ,EAAE;AAAZ;
|
|
1
|
+
{"version":3,"sources":["../src/defaults.js"],"names":["model","authorEnabled","passages","teacherInstructions","title","subtitle","author","text","subtitleEnabled","teacherInstructionsEnabled","textEnabled","titleEnabled","configuration","baseInputConfiguration","audio","disabled","video","image","h3","blockquote","textAlign","showParagraphs","separateParagraphs","settingsPanelDisabled","settings","label","inputConfiguration","required","maxImageWidth","maxImageHeight","mathMlOptions","mmlOutput","mmlEditing","language","enabled","languageChoices","options","additionalPassage"],"mappings":";;;;;;AAAA;eACe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,aAAa,EAAE,IADV;AAELC,IAAAA,QAAQ,EAAE,CACR;AACEC,MAAAA,mBAAmB,EAAE,EADvB;AAEEC,MAAAA,KAAK,EAAE,EAFT;AAGEC,MAAAA,QAAQ,EAAE,EAH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AGjBS,MAAAA,OAAO,EAAE;AAHQ;AAxFN;AAjBF,C","sourcesContent":["// TODO: also update '../../controller/src/defaults.js' and '../../src/print.js' when updating defaults\nexport default {\n model: {\n authorEnabled: true,\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 configuration: {\n baseInputConfiguration: {\n audio: { disabled: false },\n video: { disabled: false },\n image: { disabled: false },\n h3: { disabled: true },\n blockquote: { disabled: true },\n textAlign: { disabled: true },\n showParagraphs: { disabled: false },\n separateParagraphs: { disabled: true },\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 textAlign: { disabled: false },\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 textAlign: { disabled: false },\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 h3: { disabled: false },\n blockquote: { disabled: false },\n textAlign: { 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: false,\n label: 'Specify Language',\n enabled: false,\n },\n languageChoices: {\n label: 'Language Choices',\n options: [],\n },\n additionalPassage: {\n settings: true,\n label: 'Additional Passage',\n enabled: false,\n },\n },\n};\n"],"file":"defaults.js"}
|
package/configure/lib/design.js
CHANGED
|
@@ -27,11 +27,15 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
27
27
|
|
|
28
28
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
29
29
|
|
|
30
|
+
var _configUi = require("@pie-lib/pie-toolbox/config-ui");
|
|
31
|
+
|
|
30
32
|
var _styles = require("@material-ui/core/styles");
|
|
31
33
|
|
|
32
|
-
var
|
|
34
|
+
var _Typography = _interopRequireDefault(require("@material-ui/core/Typography"));
|
|
35
|
+
|
|
36
|
+
var _common = require("./common");
|
|
33
37
|
|
|
34
|
-
var
|
|
38
|
+
var _passage = _interopRequireDefault(require("./passage"));
|
|
35
39
|
|
|
36
40
|
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; }
|
|
37
41
|
|
|
@@ -55,24 +59,67 @@ var Main = /*#__PURE__*/function (_React$Component) {
|
|
|
55
59
|
|
|
56
60
|
(0, _classCallCheck2["default"])(this, Main);
|
|
57
61
|
_this = _super.call(this, props);
|
|
58
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "
|
|
59
|
-
|
|
62
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getInnerText", function (html) {
|
|
63
|
+
return (html || '').replaceAll(/<[^>]*>/g, '');
|
|
64
|
+
});
|
|
65
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onDelete", function (model, indexToRemove, onModelChanged) {
|
|
66
|
+
var updatedPassages = model.passages;
|
|
67
|
+
updatedPassages.splice(indexToRemove, 1);
|
|
68
|
+
onModelChanged(_objectSpread(_objectSpread({}, model), {}, {
|
|
69
|
+
passages: updatedPassages
|
|
70
|
+
}));
|
|
71
|
+
|
|
72
|
+
_this.setState({
|
|
73
|
+
showConfirmationDialog: false,
|
|
74
|
+
indexToRemove: -1
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "removeAdditionalPassage", function (indexToRemove) {
|
|
60
78
|
var _this$props = _this.props,
|
|
61
|
-
model = _this$props.model,
|
|
79
|
+
_this$props$model = _this$props.model,
|
|
80
|
+
model = _this$props$model === void 0 ? {} : _this$props$model,
|
|
62
81
|
onModelChanged = _this$props.onModelChanged;
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
82
|
+
var _model$passages = model.passages,
|
|
83
|
+
passages = _model$passages === void 0 ? [] : _model$passages;
|
|
84
|
+
var _passages$indexToRemo = passages[indexToRemove],
|
|
85
|
+
_passages$indexToRemo2 = _passages$indexToRemo.teacherInstructions,
|
|
86
|
+
teacherInstructions = _passages$indexToRemo2 === void 0 ? '' : _passages$indexToRemo2,
|
|
87
|
+
_passages$indexToRemo3 = _passages$indexToRemo.title,
|
|
88
|
+
title = _passages$indexToRemo3 === void 0 ? '' : _passages$indexToRemo3,
|
|
89
|
+
_passages$indexToRemo4 = _passages$indexToRemo.subtitle,
|
|
90
|
+
subtitle = _passages$indexToRemo4 === void 0 ? '' : _passages$indexToRemo4,
|
|
91
|
+
_passages$indexToRemo5 = _passages$indexToRemo.author,
|
|
92
|
+
author = _passages$indexToRemo5 === void 0 ? '' : _passages$indexToRemo5,
|
|
93
|
+
_passages$indexToRemo6 = _passages$indexToRemo.text,
|
|
94
|
+
text = _passages$indexToRemo6 === void 0 ? '' : _passages$indexToRemo6;
|
|
95
|
+
|
|
96
|
+
if (_this.getInnerText(teacherInstructions).trim() || _this.getInnerText(title).trim() || _this.getInnerText(subtitle).trim() || _this.getInnerText(author).trim() || _this.getInnerText(text).trim()) {
|
|
97
|
+
_this.setState({
|
|
98
|
+
showConfirmationDialog: true,
|
|
99
|
+
indexToRemove: indexToRemove
|
|
100
|
+
});
|
|
101
|
+
} else {
|
|
102
|
+
_this.onDelete(model, indexToRemove, onModelChanged);
|
|
66
103
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
104
|
+
});
|
|
105
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "addAdditionalPassage", function () {
|
|
106
|
+
var _this$props2 = _this.props,
|
|
107
|
+
model = _this$props2.model,
|
|
108
|
+
onModelChanged = _this$props2.onModelChanged;
|
|
109
|
+
var updatedPassages = [].concat((0, _toConsumableArray2["default"])(model.passages), [{
|
|
110
|
+
teacherInstructions: '',
|
|
111
|
+
title: '',
|
|
112
|
+
subtitle: '',
|
|
113
|
+
author: '',
|
|
114
|
+
text: ''
|
|
115
|
+
}]);
|
|
70
116
|
onModelChanged(_objectSpread(_objectSpread({}, model), {}, {
|
|
71
117
|
passages: updatedPassages
|
|
72
118
|
}));
|
|
73
119
|
});
|
|
74
120
|
_this.state = {
|
|
75
|
-
|
|
121
|
+
showConfirmationDialog: false,
|
|
122
|
+
indexToRemove: -1
|
|
76
123
|
};
|
|
77
124
|
return _this;
|
|
78
125
|
}
|
|
@@ -82,14 +129,14 @@ var Main = /*#__PURE__*/function (_React$Component) {
|
|
|
82
129
|
value: function render() {
|
|
83
130
|
var _this2 = this;
|
|
84
131
|
|
|
85
|
-
var _this$
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
configuration = _this$
|
|
89
|
-
imageSupport = _this$
|
|
90
|
-
onConfigurationChanged = _this$
|
|
91
|
-
onModelChanged = _this$
|
|
92
|
-
uploadSoundSupport = _this$
|
|
132
|
+
var _this$props3 = this.props,
|
|
133
|
+
classes = _this$props3.classes,
|
|
134
|
+
model = _this$props3.model,
|
|
135
|
+
configuration = _this$props3.configuration,
|
|
136
|
+
imageSupport = _this$props3.imageSupport,
|
|
137
|
+
onConfigurationChanged = _this$props3.onConfigurationChanged,
|
|
138
|
+
onModelChanged = _this$props3.onModelChanged,
|
|
139
|
+
uploadSoundSupport = _this$props3.uploadSoundSupport;
|
|
93
140
|
|
|
94
141
|
var _ref = configuration || {},
|
|
95
142
|
settingsPanelDisabled = _ref.settingsPanelDisabled,
|
|
@@ -97,14 +144,6 @@ var Main = /*#__PURE__*/function (_React$Component) {
|
|
|
97
144
|
language = _ref$language === void 0 ? {} : _ref$language,
|
|
98
145
|
_ref$languageChoices = _ref.languageChoices,
|
|
99
146
|
languageChoices = _ref$languageChoices === void 0 ? {} : _ref$languageChoices,
|
|
100
|
-
_ref$maxImageWidth = _ref.maxImageWidth,
|
|
101
|
-
maxImageWidth = _ref$maxImageWidth === void 0 ? {} : _ref$maxImageWidth,
|
|
102
|
-
_ref$maxImageHeight = _ref.maxImageHeight,
|
|
103
|
-
maxImageHeight = _ref$maxImageHeight === void 0 ? {} : _ref$maxImageHeight,
|
|
104
|
-
_ref$mathMlOptions = _ref.mathMlOptions,
|
|
105
|
-
mathMlOptions = _ref$mathMlOptions === void 0 ? {} : _ref$mathMlOptions,
|
|
106
|
-
_ref$baseInputConfigu = _ref.baseInputConfiguration,
|
|
107
|
-
baseInputConfiguration = _ref$baseInputConfigu === void 0 ? {} : _ref$baseInputConfigu,
|
|
108
147
|
_ref$teacherInstructi = _ref.teacherInstructions,
|
|
109
148
|
teacherInstructions = _ref$teacherInstructi === void 0 ? {} : _ref$teacherInstructi,
|
|
110
149
|
_ref$title = _ref.title,
|
|
@@ -114,49 +153,30 @@ var Main = /*#__PURE__*/function (_React$Component) {
|
|
|
114
153
|
_ref$text = _ref.text,
|
|
115
154
|
text = _ref$text === void 0 ? {} : _ref$text,
|
|
116
155
|
_ref$author = _ref.author,
|
|
117
|
-
author = _ref$author === void 0 ? {} : _ref$author
|
|
156
|
+
author = _ref$author === void 0 ? {} : _ref$author,
|
|
157
|
+
_ref$additionalPassag = _ref.additionalPassage,
|
|
158
|
+
additionalPassage = _ref$additionalPassag === void 0 ? {} : _ref$additionalPassag;
|
|
118
159
|
|
|
119
160
|
var _ref2 = model || {},
|
|
120
|
-
_ref2$errors = _ref2.errors,
|
|
121
|
-
errors = _ref2$errors === void 0 ? {} : _ref2$errors,
|
|
122
161
|
extraCSSRules = _ref2.extraCSSRules,
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
teacherInstructionsEnabled = _ref2.teacherInstructionsEnabled,
|
|
126
|
-
titleEnabled = _ref2.titleEnabled,
|
|
127
|
-
subtitleEnabled = _ref2.subtitleEnabled,
|
|
128
|
-
authorEnabled = _ref2.authorEnabled,
|
|
129
|
-
textEnabled = _ref2.textEnabled;
|
|
130
|
-
|
|
131
|
-
var _ref3 = errors || {},
|
|
132
|
-
passagesErrors = _ref3.passages;
|
|
133
|
-
|
|
134
|
-
var _ref4 = passagesErrors && passagesErrors[0] || {},
|
|
135
|
-
teacherInstructionsError = _ref4.teacherInstructions,
|
|
136
|
-
titleError = _ref4.title,
|
|
137
|
-
subtitleError = _ref4.subtitle,
|
|
138
|
-
authorError = _ref4.author,
|
|
139
|
-
textError = _ref4.text; // only the first passage errors are needed for now
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
var defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;
|
|
143
|
-
var defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;
|
|
162
|
+
passages = _ref2.passages;
|
|
163
|
+
|
|
144
164
|
var panelSettings = {
|
|
145
165
|
titleEnabled: title && title.settings && toggle(title.label),
|
|
146
166
|
subtitleEnabled: subtitle && subtitle.settings && toggle(subtitle.label),
|
|
147
167
|
authorEnabled: author && author.settings && toggle(author.label),
|
|
148
|
-
textEnabled: text && text.settings && toggle(text.label)
|
|
168
|
+
textEnabled: text && text.settings && toggle(text.label),
|
|
169
|
+
'additionalPassage.enabled': additionalPassage && additionalPassage.settings && toggle(additionalPassage.label, true)
|
|
149
170
|
};
|
|
150
171
|
var panelProperties = {
|
|
151
172
|
teacherInstructionsEnabled: teacherInstructions && teacherInstructions.settings && toggle(teacherInstructions.label),
|
|
152
173
|
'language.enabled': language && language.settings && toggle(language.label, true),
|
|
153
174
|
language: language && language.settings && language.enabled && dropdown(languageChoices.label, languageChoices.options)
|
|
154
175
|
};
|
|
155
|
-
|
|
156
|
-
var
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
176
|
+
var confirmationDialogContent = "".concat(additionalPassage.label, " will be deleted");
|
|
177
|
+
var _this$state = this.state,
|
|
178
|
+
indexToRemove = _this$state.indexToRemove,
|
|
179
|
+
showConfirmationDialog = _this$state.showConfirmationDialog;
|
|
160
180
|
return /*#__PURE__*/_react["default"].createElement(_configUi.layout.ConfigLayout, {
|
|
161
181
|
extraCSSRules: extraCSSRules,
|
|
162
182
|
hideSettings: settingsPanelDisabled,
|
|
@@ -174,113 +194,44 @@ var Main = /*#__PURE__*/function (_React$Component) {
|
|
|
174
194
|
Properties: panelProperties
|
|
175
195
|
}
|
|
176
196
|
})
|
|
177
|
-
},
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
mathMlOptions: mathMlOptions,
|
|
211
|
-
languageCharactersProps: [{
|
|
212
|
-
language: 'spanish'
|
|
213
|
-
}, {
|
|
214
|
-
language: 'special'
|
|
215
|
-
}],
|
|
216
|
-
pluginProps: getPluginProps(title === null || title === void 0 ? void 0 : title.inputConfiguration)
|
|
217
|
-
}), titleError && /*#__PURE__*/_react["default"].createElement("div", {
|
|
218
|
-
className: classes.errorText
|
|
219
|
-
}, titleError)), subtitleEnabled && /*#__PURE__*/_react["default"].createElement(_configUi.InputContainer, {
|
|
220
|
-
label: subtitle.label,
|
|
221
|
-
className: classes.inputContainer
|
|
222
|
-
}, /*#__PURE__*/_react["default"].createElement(_editableHtml.EditableHtml, {
|
|
223
|
-
activePlugins: _editableHtml.ALL_PLUGINS,
|
|
224
|
-
markup: passages[0].subtitle || '',
|
|
225
|
-
onChange: function onChange(value) {
|
|
226
|
-
return _this2.handleChange('subtitle', value);
|
|
227
|
-
},
|
|
228
|
-
nonEmpty: false,
|
|
229
|
-
error: subtitleError,
|
|
230
|
-
mathMlOptions: mathMlOptions,
|
|
231
|
-
languageCharactersProps: [{
|
|
232
|
-
language: 'spanish'
|
|
233
|
-
}, {
|
|
234
|
-
language: 'special'
|
|
235
|
-
}],
|
|
236
|
-
pluginProps: getPluginProps(subtitle === null || subtitle === void 0 ? void 0 : subtitle.inputConfiguration)
|
|
237
|
-
}), subtitleError && /*#__PURE__*/_react["default"].createElement("div", {
|
|
238
|
-
className: classes.errorText
|
|
239
|
-
}, subtitleError)), authorEnabled && /*#__PURE__*/_react["default"].createElement(_configUi.InputContainer, {
|
|
240
|
-
label: author.label,
|
|
241
|
-
className: classes.inputContainer
|
|
242
|
-
}, /*#__PURE__*/_react["default"].createElement(_editableHtml.EditableHtml, {
|
|
243
|
-
activePlugins: _editableHtml.ALL_PLUGINS,
|
|
244
|
-
markup: passages[0].author || '',
|
|
245
|
-
onChange: function onChange(value) {
|
|
246
|
-
return _this2.handleChange('author', value);
|
|
247
|
-
},
|
|
248
|
-
nonEmpty: false,
|
|
249
|
-
error: authorError,
|
|
250
|
-
mathMlOptions: mathMlOptions,
|
|
251
|
-
languageCharactersProps: [{
|
|
252
|
-
language: 'spanish'
|
|
253
|
-
}, {
|
|
254
|
-
language: 'special'
|
|
255
|
-
}],
|
|
256
|
-
pluginProps: getPluginProps(author === null || author === void 0 ? void 0 : author.inputConfiguration)
|
|
257
|
-
}), authorError && /*#__PURE__*/_react["default"].createElement("div", {
|
|
258
|
-
className: classes.errorText
|
|
259
|
-
}, authorError)), textEnabled && /*#__PURE__*/_react["default"].createElement(_configUi.InputContainer, {
|
|
260
|
-
label: text.label,
|
|
261
|
-
className: classes.inputContainer
|
|
262
|
-
}, /*#__PURE__*/_react["default"].createElement(_editableHtml.EditableHtml, {
|
|
263
|
-
activePlugins: _editableHtml.ALL_PLUGINS,
|
|
264
|
-
markup: passages[0].text || '',
|
|
265
|
-
onChange: function onChange(value) {
|
|
266
|
-
return _this2.handleChange('text', value);
|
|
197
|
+
}, passages.map(function (passage, passageIndex) {
|
|
198
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, {
|
|
199
|
+
key: passageIndex
|
|
200
|
+
}, passageIndex > 0 && /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
201
|
+
variant: "h5",
|
|
202
|
+
className: classes.additionalPassageHeading
|
|
203
|
+
}, additionalPassage.label), /*#__PURE__*/_react["default"].createElement(_passage["default"], {
|
|
204
|
+
imageSupport: imageSupport,
|
|
205
|
+
uploadSoundSupport: uploadSoundSupport,
|
|
206
|
+
model: model,
|
|
207
|
+
configuration: configuration,
|
|
208
|
+
passageIndex: passageIndex,
|
|
209
|
+
onModelChanged: onModelChanged
|
|
210
|
+
}), passageIndex > 0 && additionalPassage.enabled && /*#__PURE__*/_react["default"].createElement(_common.PassageButton, {
|
|
211
|
+
type: 'remove',
|
|
212
|
+
label: "Remove ".concat(additionalPassage.label),
|
|
213
|
+
onClick: function onClick() {
|
|
214
|
+
return _this2.removeAdditionalPassage(passageIndex);
|
|
215
|
+
}
|
|
216
|
+
}), passageIndex === 0 && additionalPassage.enabled && passages.length < 2 && /*#__PURE__*/_react["default"].createElement(_common.PassageButton, {
|
|
217
|
+
label: "Add ".concat(additionalPassage.label),
|
|
218
|
+
onClick: _this2.addAdditionalPassage
|
|
219
|
+
}));
|
|
220
|
+
}), /*#__PURE__*/_react["default"].createElement(_common.ConfimationDialog, {
|
|
221
|
+
open: showConfirmationDialog,
|
|
222
|
+
title: 'Warning',
|
|
223
|
+
content: confirmationDialogContent,
|
|
224
|
+
cancel: 'Cancel',
|
|
225
|
+
ok: 'Ok',
|
|
226
|
+
onCancel: function onCancel() {
|
|
227
|
+
return _this2.setState({
|
|
228
|
+
showConfirmationDialog: false
|
|
229
|
+
});
|
|
267
230
|
},
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
maxImageWidth: maxImageWidth && maxImageWidth.text || defaultImageMaxWidth,
|
|
273
|
-
maxImageHeight: maxImageHeight && maxImageHeight.text || defaultImageMaxHeight,
|
|
274
|
-
mathMlOptions: mathMlOptions,
|
|
275
|
-
languageCharactersProps: [{
|
|
276
|
-
language: 'spanish'
|
|
277
|
-
}, {
|
|
278
|
-
language: 'special'
|
|
279
|
-
}],
|
|
280
|
-
pluginProps: getPluginProps(text === null || text === void 0 ? void 0 : text.inputConfiguration)
|
|
281
|
-
}), textError && /*#__PURE__*/_react["default"].createElement("div", {
|
|
282
|
-
className: classes.errorText
|
|
283
|
-
}, textError)));
|
|
231
|
+
onOk: function onOk() {
|
|
232
|
+
return _this2.onDelete(model, indexToRemove, onModelChanged);
|
|
233
|
+
}
|
|
234
|
+
}));
|
|
284
235
|
}
|
|
285
236
|
}]);
|
|
286
237
|
return Main;
|
|
@@ -299,15 +250,9 @@ exports.Main = Main;
|
|
|
299
250
|
|
|
300
251
|
var _default = (0, _styles.withStyles)(function (theme) {
|
|
301
252
|
return {
|
|
302
|
-
|
|
253
|
+
additionalPassageHeading: {
|
|
303
254
|
paddingTop: theme.spacing.unit * 2,
|
|
304
|
-
marginBottom: theme.spacing.unit * 2
|
|
305
|
-
width: '100%'
|
|
306
|
-
},
|
|
307
|
-
errorText: {
|
|
308
|
-
fontSize: theme.typography.fontSize - 2,
|
|
309
|
-
color: theme.palette.error.main,
|
|
310
|
-
paddingTop: theme.spacing.unit
|
|
255
|
+
marginBottom: theme.spacing.unit * 2
|
|
311
256
|
}
|
|
312
257
|
};
|
|
313
258
|
})(Main);
|