@pie-element/rubric 2.2.1 → 2.2.2-next.112

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.
@@ -31,11 +31,14 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
31
31
 
32
32
  var Panel = _configUi.settings.Panel,
33
33
  toggle = _configUi.settings.toggle;
34
- var styles = {
35
- design: {
36
- fontFamily: 'Cerebri Sans',
37
- fontSize: '14px'
38
- }
34
+
35
+ var styles = function styles(theme) {
36
+ return {
37
+ design: {
38
+ fontFamily: 'Cerebri Sans',
39
+ fontSize: theme.typography.fontSize
40
+ }
41
+ };
39
42
  };
40
43
 
41
44
  var Main = /*#__PURE__*/function (_React$Component) {
@@ -60,25 +63,26 @@ var Main = /*#__PURE__*/function (_React$Component) {
60
63
 
61
64
  var _ref2 = configuration || {},
62
65
  settingsPanelDisabled = _ref2.settingsPanelDisabled,
63
- showExcludeZero = _ref2.showExcludeZero,
64
- showMaxPoint = _ref2.showMaxPoint;
65
-
66
+ _ref2$showExcludeZero = _ref2.showExcludeZero,
67
+ showExcludeZero = _ref2$showExcludeZero === void 0 ? {} : _ref2$showExcludeZero,
68
+ _ref2$showMaxPoint = _ref2.showMaxPoint,
69
+ showMaxPoint = _ref2$showMaxPoint === void 0 ? {} : _ref2$showMaxPoint;
70
+
71
+ var panelProperties = {
72
+ excludeZeroEnabled: showExcludeZero.settings && toggle(showExcludeZero.label),
73
+ maxPointsEnabled: showMaxPoint.settings && toggle(showMaxPoint.label)
74
+ };
66
75
  return /*#__PURE__*/_react["default"].createElement("div", {
67
76
  className: classes.design
68
- }, settingsPanelDisabled ? /*#__PURE__*/_react["default"].createElement(_rubric.Authoring, {
69
- value: model,
70
- onChange: onModelChanged
71
- }) : /*#__PURE__*/_react["default"].createElement(_configUi.layout.ConfigLayout, {
77
+ }, /*#__PURE__*/_react["default"].createElement(_configUi.layout.ConfigLayout, {
78
+ hideSettings: settingsPanelDisabled,
72
79
  settings: /*#__PURE__*/_react["default"].createElement(Panel, {
73
80
  model: model,
74
81
  onChangeModel: onModelChanged,
75
82
  configuration: configuration,
76
83
  onChangeConfiguration: onConfigurationChanged,
77
84
  groups: {
78
- Properties: {
79
- excludeZeroEnabled: showExcludeZero.settings && toggle(showExcludeZero.label),
80
- maxPointsEnabled: showMaxPoint.settings && toggle(showMaxPoint.label)
81
- }
85
+ Properties: panelProperties
82
86
  }
83
87
  })
84
88
  }, /*#__PURE__*/_react["default"].createElement(_rubric.Authoring, {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/main.jsx"],"names":["Panel","settings","toggle","styles","design","fontFamily","fontSize","Main","props","model","classes","configuration","onConfigurationChanged","onModelChanged","settingsPanelDisabled","showExcludeZero","showMaxPoint","Properties","excludeZeroEnabled","label","maxPointsEnabled","React","Component"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;;;;;AAEA,IAAQA,KAAR,GAA0BC,kBAA1B,CAAQD,KAAR;AAAA,IAAeE,MAAf,GAA0BD,kBAA1B,CAAeC,MAAf;AAEA,IAAMC,MAAM,GAAG;AACbC,EAAAA,MAAM,EAAE;AACNC,IAAAA,UAAU,EAAE,cADN;AAENC,IAAAA,QAAQ,EAAE;AAFJ;AADK,CAAf;;IAOMC,I;;;;;;;;;;;;WACJ,kBAAS;AACP,iBAAkF,KAAKC,KAAL,IAAc,EAAhG;AAAA,UAAQC,KAAR,QAAQA,KAAR;AAAA,UAAeC,OAAf,QAAeA,OAAf;AAAA,UAAwBC,aAAxB,QAAwBA,aAAxB;AAAA,UAAuCC,sBAAvC,QAAuCA,sBAAvC;AAAA,UAA+DC,cAA/D,QAA+DA,cAA/D;;AACA,kBAAiEF,aAAa,IAAI,EAAlF;AAAA,UAAQG,qBAAR,SAAQA,qBAAR;AAAA,UAA+BC,eAA/B,SAA+BA,eAA/B;AAAA,UAAgDC,YAAhD,SAAgDA,YAAhD;;AACA,0BACE;AAAK,QAAA,SAAS,EAAEN,OAAO,CAACN;AAAxB,SACGU,qBAAqB,gBACpB,gCAAC,iBAAD;AAAW,QAAA,KAAK,EAAEL,KAAlB;AAAyB,QAAA,QAAQ,EAAEI;AAAnC,QADoB,gBAGpB,gCAAC,gBAAD,CAAQ,YAAR;AACE,QAAA,QAAQ,eACN,gCAAC,KAAD;AACE,UAAA,KAAK,EAAEJ,KADT;AAEE,UAAA,aAAa,EAAEI,cAFjB;AAGE,UAAA,aAAa,EAAEF,aAHjB;AAIE,UAAA,qBAAqB,EAAEC,sBAJzB;AAKE,UAAA,MAAM,EAAE;AACNK,YAAAA,UAAU,EAAE;AACVC,cAAAA,kBAAkB,EAAEH,eAAe,CAACd,QAAhB,IAA4BC,MAAM,CAACa,eAAe,CAACI,KAAjB,CAD5C;AAEVC,cAAAA,gBAAgB,EAAEJ,YAAY,CAACf,QAAb,IAAyBC,MAAM,CAACc,YAAY,CAACG,KAAd;AAFvC;AADN;AALV;AAFJ,sBAgBE,gCAAC,iBAAD;AAAW,QAAA,KAAK,EAAEV,KAAlB;AAAyB,QAAA,QAAQ,EAAEI;AAAnC,QAhBF,CAJJ,CADF;AA0BD;;;EA9BgBQ,kBAAMC,S;;eAiCV,wBAAWnB,MAAX,EAAmBI,IAAnB,C","sourcesContent":["import React from 'react';\nimport { Authoring } from '@pie-lib/rubric';\nimport { withStyles } from '@material-ui/core/styles';\nimport { layout, settings } from '@pie-lib/config-ui';\n\nconst { Panel, toggle } = settings;\n\nconst styles = {\n design: {\n fontFamily: 'Cerebri Sans',\n fontSize: '14px',\n },\n};\n\nclass Main extends React.Component {\n render() {\n const { model, classes, configuration, onConfigurationChanged, onModelChanged } = this.props || {};\n const { settingsPanelDisabled, showExcludeZero, showMaxPoint } = configuration || {};\n return (\n <div className={classes.design}>\n {settingsPanelDisabled ? (\n <Authoring value={model} onChange={onModelChanged} />\n ) : (\n <layout.ConfigLayout\n settings={\n <Panel\n model={model}\n onChangeModel={onModelChanged}\n configuration={configuration}\n onChangeConfiguration={onConfigurationChanged}\n groups={{\n Properties: {\n excludeZeroEnabled: showExcludeZero.settings && toggle(showExcludeZero.label),\n maxPointsEnabled: showMaxPoint.settings && toggle(showMaxPoint.label),\n },\n }}\n />\n }\n >\n <Authoring value={model} onChange={onModelChanged} />\n </layout.ConfigLayout>\n )}\n </div>\n );\n }\n}\n\nexport default withStyles(styles)(Main);\n"],"file":"main.js"}
1
+ {"version":3,"sources":["../src/main.jsx"],"names":["Panel","settings","toggle","styles","theme","design","fontFamily","fontSize","typography","Main","props","model","classes","configuration","onConfigurationChanged","onModelChanged","settingsPanelDisabled","showExcludeZero","showMaxPoint","panelProperties","excludeZeroEnabled","label","maxPointsEnabled","Properties","React","Component"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;;;;;AAEA,IAAQA,KAAR,GAA0BC,kBAA1B,CAAQD,KAAR;AAAA,IAAeE,MAAf,GAA0BD,kBAA1B,CAAeC,MAAf;;AAEA,IAAMC,MAAM,GAAG,SAATA,MAAS,CAACC,KAAD;AAAA,SAAY;AACzBC,IAAAA,MAAM,EAAE;AACNC,MAAAA,UAAU,EAAE,cADN;AAENC,MAAAA,QAAQ,EAAEH,KAAK,CAACI,UAAN,CAAiBD;AAFrB;AADiB,GAAZ;AAAA,CAAf;;IAOME,I;;;;;;;;;;;;WACJ,kBAAS;AACP,iBAAkF,KAAKC,KAAL,IAAc,EAAhG;AAAA,UAAQC,KAAR,QAAQA,KAAR;AAAA,UAAeC,OAAf,QAAeA,OAAf;AAAA,UAAwBC,aAAxB,QAAwBA,aAAxB;AAAA,UAAuCC,sBAAvC,QAAuCA,sBAAvC;AAAA,UAA+DC,cAA/D,QAA+DA,cAA/D;;AACA,kBAA2EF,aAAa,IAAI,EAA5F;AAAA,UAAQG,qBAAR,SAAQA,qBAAR;AAAA,wCAA+BC,eAA/B;AAAA,UAA+BA,eAA/B,sCAAiD,EAAjD;AAAA,qCAAqDC,YAArD;AAAA,UAAqDA,YAArD,mCAAoE,EAApE;;AAEA,UAAMC,eAAe,GAAG;AACtBC,QAAAA,kBAAkB,EAAEH,eAAe,CAAChB,QAAhB,IAA4BC,MAAM,CAACe,eAAe,CAACI,KAAjB,CADhC;AAEtBC,QAAAA,gBAAgB,EAAEJ,YAAY,CAACjB,QAAb,IAAyBC,MAAM,CAACgB,YAAY,CAACG,KAAd;AAF3B,OAAxB;AAKA,0BACE;AAAK,QAAA,SAAS,EAAET,OAAO,CAACP;AAAxB,sBACE,gCAAC,gBAAD,CAAQ,YAAR;AACE,QAAA,YAAY,EAAEW,qBADhB;AAEE,QAAA,QAAQ,eACN,gCAAC,KAAD;AACE,UAAA,KAAK,EAAEL,KADT;AAEE,UAAA,aAAa,EAAEI,cAFjB;AAGE,UAAA,aAAa,EAAEF,aAHjB;AAIE,UAAA,qBAAqB,EAAEC,sBAJzB;AAKE,UAAA,MAAM,EAAE;AACNS,YAAAA,UAAU,EAAEJ;AADN;AALV;AAHJ,sBAcE,gCAAC,iBAAD;AAAW,QAAA,KAAK,EAAER,KAAlB;AAAyB,QAAA,QAAQ,EAAEI;AAAnC,QAdF,CADF,CADF;AAoBD;;;EA9BgBS,kBAAMC,S;;eAiCV,wBAAWtB,MAAX,EAAmBM,IAAnB,C","sourcesContent":["import React from 'react';\nimport { Authoring } from '@pie-lib/rubric';\nimport { withStyles } from '@material-ui/core/styles';\nimport { layout, settings } from '@pie-lib/config-ui';\n\nconst { Panel, toggle } = settings;\n\nconst styles = (theme) => ({\n design: {\n fontFamily: 'Cerebri Sans',\n fontSize: theme.typography.fontSize,\n },\n});\n\nclass Main extends React.Component {\n render() {\n const { model, classes, configuration, onConfigurationChanged, onModelChanged } = this.props || {};\n const { settingsPanelDisabled, showExcludeZero = {}, showMaxPoint = {} } = configuration || {};\n\n const panelProperties = {\n excludeZeroEnabled: showExcludeZero.settings && toggle(showExcludeZero.label),\n maxPointsEnabled: showMaxPoint.settings && toggle(showMaxPoint.label),\n };\n\n return (\n <div className={classes.design}>\n <layout.ConfigLayout\n hideSettings={settingsPanelDisabled}\n settings={\n <Panel\n model={model}\n onChangeModel={onModelChanged}\n configuration={configuration}\n onChangeConfiguration={onConfigurationChanged}\n groups={{\n Properties: panelProperties,\n }}\n />\n }\n >\n <Authoring value={model} onChange={onModelChanged} />\n </layout.ConfigLayout>\n </div>\n );\n }\n}\n\nexport default withStyles(styles)(Main);\n"],"file":"main.js"}
@@ -5,41 +5,41 @@ import { layout, settings } from '@pie-lib/config-ui';
5
5
 
6
6
  const { Panel, toggle } = settings;
7
7
 
8
- const styles = {
8
+ const styles = (theme) => ({
9
9
  design: {
10
10
  fontFamily: 'Cerebri Sans',
11
- fontSize: '14px',
11
+ fontSize: theme.typography.fontSize,
12
12
  },
13
- };
13
+ });
14
14
 
15
15
  class Main extends React.Component {
16
16
  render() {
17
17
  const { model, classes, configuration, onConfigurationChanged, onModelChanged } = this.props || {};
18
- const { settingsPanelDisabled, showExcludeZero, showMaxPoint } = configuration || {};
18
+ const { settingsPanelDisabled, showExcludeZero = {}, showMaxPoint = {} } = configuration || {};
19
+
20
+ const panelProperties = {
21
+ excludeZeroEnabled: showExcludeZero.settings && toggle(showExcludeZero.label),
22
+ maxPointsEnabled: showMaxPoint.settings && toggle(showMaxPoint.label),
23
+ };
24
+
19
25
  return (
20
26
  <div className={classes.design}>
21
- {settingsPanelDisabled ? (
27
+ <layout.ConfigLayout
28
+ hideSettings={settingsPanelDisabled}
29
+ settings={
30
+ <Panel
31
+ model={model}
32
+ onChangeModel={onModelChanged}
33
+ configuration={configuration}
34
+ onChangeConfiguration={onConfigurationChanged}
35
+ groups={{
36
+ Properties: panelProperties,
37
+ }}
38
+ />
39
+ }
40
+ >
22
41
  <Authoring value={model} onChange={onModelChanged} />
23
- ) : (
24
- <layout.ConfigLayout
25
- settings={
26
- <Panel
27
- model={model}
28
- onChangeModel={onModelChanged}
29
- configuration={configuration}
30
- onChangeConfiguration={onConfigurationChanged}
31
- groups={{
32
- Properties: {
33
- excludeZeroEnabled: showExcludeZero.settings && toggle(showExcludeZero.label),
34
- maxPointsEnabled: showMaxPoint.settings && toggle(showMaxPoint.label),
35
- },
36
- }}
37
- />
38
- }
39
- >
40
- <Authoring value={model} onChange={onModelChanged} />
41
- </layout.ConfigLayout>
42
- )}
42
+ </layout.ConfigLayout>
43
43
  </div>
44
44
  );
45
45
  }
@@ -1,6 +1,43 @@
1
1
  {
2
2
  "type": "object",
3
3
  "properties": {
4
+ "settingsPanelDisabled": {
5
+ "description": "Indicates if the settings panel is not available",
6
+ "type": "boolean",
7
+ "title": "settingsPanelDisabled"
8
+ },
9
+ "showExcludeZero": {
10
+ "title": "ConfigureProp",
11
+ "type": "object",
12
+ "properties": {
13
+ "settings": {
14
+ "description": "Indicates if the item has to be displayed in the Settings Panel",
15
+ "type": "boolean",
16
+ "title": "settings"
17
+ },
18
+ "label": {
19
+ "description": "Indicates the label for the item that has to be displayed in the Settings Panel",
20
+ "type": "string",
21
+ "title": "label"
22
+ }
23
+ }
24
+ },
25
+ "showMaxPoint": {
26
+ "title": "ConfigureProp",
27
+ "type": "object",
28
+ "properties": {
29
+ "settings": {
30
+ "description": "Indicates if the item has to be displayed in the Settings Panel",
31
+ "type": "boolean",
32
+ "title": "settings"
33
+ },
34
+ "label": {
35
+ "description": "Indicates the label for the item that has to be displayed in the Settings Panel",
36
+ "type": "string",
37
+ "title": "label"
38
+ }
39
+ }
40
+ },
4
41
  "showPrompt": {
5
42
  "description": "Determines whether prompt field will be displayed or not",
6
43
  "default": true,
@@ -20,5 +57,23 @@
20
57
  "title": "settingsPartialScoring"
21
58
  }
22
59
  },
60
+ "definitions": {
61
+ "ConfigureProp": {
62
+ "title": "ConfigureProp",
63
+ "type": "object",
64
+ "properties": {
65
+ "settings": {
66
+ "description": "Indicates if the item has to be displayed in the Settings Panel",
67
+ "type": "boolean",
68
+ "title": "settings"
69
+ },
70
+ "label": {
71
+ "description": "Indicates the label for the item that has to be displayed in the Settings Panel",
72
+ "type": "string",
73
+ "title": "label"
74
+ }
75
+ }
76
+ }
77
+ },
23
78
  "$schema": "http://json-schema.org/draft-07/schema#"
24
79
  }
@@ -1,5 +1,33 @@
1
1
  The schema defines the following properties:
2
2
 
3
+ # `settingsPanelDisabled` (boolean)
4
+
5
+ Indicates if the settings panel is not available
6
+
7
+ # `showExcludeZero` (object)
8
+
9
+ Properties of the `showExcludeZero` object:
10
+
11
+ ## `settings` (boolean)
12
+
13
+ Indicates if the item has to be displayed in the Settings Panel
14
+
15
+ ## `label` (string)
16
+
17
+ Indicates the label for the item that has to be displayed in the Settings Panel
18
+
19
+ # `showMaxPoint` (object)
20
+
21
+ Properties of the `showMaxPoint` object:
22
+
23
+ ## `settings` (boolean)
24
+
25
+ Indicates if the item has to be displayed in the Settings Panel
26
+
27
+ ## `label` (string)
28
+
29
+ Indicates the label for the item that has to be displayed in the Settings Panel
30
+
3
31
  # `showPrompt` (boolean)
4
32
 
5
33
  Determines whether prompt field will be displayed or not
@@ -16,4 +44,22 @@ Default: `"Item Stemm"`
16
44
 
17
45
  Indicates whether the settings panel wil allow the author to modify settings for partial scoring
18
46
 
19
- Default: `true`
47
+ Default: `true`
48
+
49
+ ---
50
+
51
+ # Sub Schemas
52
+
53
+ The schema defines the following additional types:
54
+
55
+ ## `ConfigureProp` (object)
56
+
57
+ Properties of the `ConfigureProp` object:
58
+
59
+ ### `settings` (boolean)
60
+
61
+ Indicates if the item has to be displayed in the Settings Panel
62
+
63
+ ### `label` (string)
64
+
65
+ Indicates the label for the item that has to be displayed in the Settings Panel
@@ -58,5 +58,23 @@
58
58
  "element",
59
59
  "id"
60
60
  ],
61
+ "definitions": {
62
+ "ConfigureProp": {
63
+ "title": "ConfigureProp",
64
+ "type": "object",
65
+ "properties": {
66
+ "settings": {
67
+ "description": "Indicates if the item has to be displayed in the Settings Panel",
68
+ "type": "boolean",
69
+ "title": "settings"
70
+ },
71
+ "label": {
72
+ "description": "Indicates the label for the item that has to be displayed in the Settings Panel",
73
+ "type": "string",
74
+ "title": "label"
75
+ }
76
+ }
77
+ }
78
+ },
61
79
  "$schema": "http://json-schema.org/draft-07/schema#"
62
80
  }
@@ -32,4 +32,22 @@ Identifier to identify the Pie Element in html markup, Must be unique within a p
32
32
 
33
33
  # `element` (string, required)
34
34
 
35
- The html Element tag name
35
+ The html Element tag name
36
+
37
+ ---
38
+
39
+ # Sub Schemas
40
+
41
+ The schema defines the following additional types:
42
+
43
+ ## `ConfigureProp` (object)
44
+
45
+ Properties of the `ConfigureProp` object:
46
+
47
+ ### `settings` (boolean)
48
+
49
+ Indicates if the item has to be displayed in the Settings Panel
50
+
51
+ ### `label` (string)
52
+
53
+ Indicates the label for the item that has to be displayed in the Settings Panel
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-element/rubric",
3
- "version": "2.2.1",
3
+ "version": "2.2.2-next.112+4239ce4fb",
4
4
  "main": "lib/index.js",
5
5
  "module": "src/index.js",
6
6
  "description": "Rubric Scoring Interaction",
@@ -14,7 +14,7 @@
14
14
  },
15
15
  "author": "pie framework developers",
16
16
  "license": "ISC",
17
- "gitHead": "4b3c97b360f5c94d400b37d3b900fd42ef8e4f1c",
17
+ "gitHead": "4239ce4fbb67061c98a93b59f5f908a421b4e77e",
18
18
  "scripts": {
19
19
  "postpublish": "../../scripts/postpublish"
20
20
  },