@pie-element/ebsr 7.0.24-next.2 → 7.0.26
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 +48 -0
- package/{configure/node_modules/@pie-element/multiple-choice/LICENSE.md → LICENSE.md} +0 -0
- package/configure/CHANGELOG.md +48 -0
- package/configure/package.json +3 -3
- package/controller/CHANGELOG.md +8 -0
- package/controller/package.json +1 -1
- package/package.json +3 -3
- package/configure/node_modules/@pie-element/multiple-choice/CHANGELOG.json +0 -1972
- package/configure/node_modules/@pie-element/multiple-choice/CHANGELOG.md +0 -1793
- package/configure/node_modules/@pie-element/multiple-choice/PRINT.md +0 -35
- package/configure/node_modules/@pie-element/multiple-choice/README.md +0 -56
- package/configure/node_modules/@pie-element/multiple-choice/choice.png +0 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/CHANGELOG.json +0 -1387
- package/configure/node_modules/@pie-element/multiple-choice/configure/CHANGELOG.md +0 -1334
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/defaults.js +0 -104
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/defaults.js.map +0 -1
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/index.js +0 -198
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/index.js.map +0 -1
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/main.js +0 -599
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/main.js.map +0 -1
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/utils.js +0 -18
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/utils.js.map +0 -1
- package/configure/node_modules/@pie-element/multiple-choice/configure/package.json +0 -20
- package/configure/node_modules/@pie-element/multiple-choice/controller/CHANGELOG.json +0 -527
- package/configure/node_modules/@pie-element/multiple-choice/controller/CHANGELOG.md +0 -768
- package/configure/node_modules/@pie-element/multiple-choice/controller/lib/defaults.js +0 -18
- package/configure/node_modules/@pie-element/multiple-choice/controller/lib/defaults.js.map +0 -1
- package/configure/node_modules/@pie-element/multiple-choice/controller/lib/index.js +0 -305
- package/configure/node_modules/@pie-element/multiple-choice/controller/lib/index.js.map +0 -1
- package/configure/node_modules/@pie-element/multiple-choice/controller/lib/utils.js +0 -36
- package/configure/node_modules/@pie-element/multiple-choice/controller/lib/utils.js.map +0 -1
- package/configure/node_modules/@pie-element/multiple-choice/controller/package.json +0 -15
- package/configure/node_modules/@pie-element/multiple-choice/docs/config-schema.json +0 -353
- package/configure/node_modules/@pie-element/multiple-choice/docs/config-schema.json.md +0 -277
- package/configure/node_modules/@pie-element/multiple-choice/docs/demo/config.js +0 -8
- package/configure/node_modules/@pie-element/multiple-choice/docs/demo/generate.js +0 -52
- package/configure/node_modules/@pie-element/multiple-choice/docs/demo/index.html +0 -1
- package/configure/node_modules/@pie-element/multiple-choice/docs/demo/session.js +0 -7
- package/configure/node_modules/@pie-element/multiple-choice/docs/pie-schema.json +0 -338
- package/configure/node_modules/@pie-element/multiple-choice/docs/pie-schema.json.md +0 -274
- package/configure/node_modules/@pie-element/multiple-choice/lib/choice-input.js +0 -298
- package/configure/node_modules/@pie-element/multiple-choice/lib/choice-input.js.map +0 -1
- package/configure/node_modules/@pie-element/multiple-choice/lib/choice.js +0 -157
- package/configure/node_modules/@pie-element/multiple-choice/lib/choice.js.map +0 -1
- package/configure/node_modules/@pie-element/multiple-choice/lib/feedback-tick.js +0 -174
- package/configure/node_modules/@pie-element/multiple-choice/lib/feedback-tick.js.map +0 -1
- package/configure/node_modules/@pie-element/multiple-choice/lib/index.js +0 -151
- package/configure/node_modules/@pie-element/multiple-choice/lib/index.js.map +0 -1
- package/configure/node_modules/@pie-element/multiple-choice/lib/main.js +0 -97
- package/configure/node_modules/@pie-element/multiple-choice/lib/main.js.map +0 -1
- package/configure/node_modules/@pie-element/multiple-choice/lib/multiple-choice.js +0 -254
- package/configure/node_modules/@pie-element/multiple-choice/lib/multiple-choice.js.map +0 -1
- package/configure/node_modules/@pie-element/multiple-choice/lib/print.js +0 -129
- package/configure/node_modules/@pie-element/multiple-choice/lib/print.js.map +0 -1
- package/configure/node_modules/@pie-element/multiple-choice/lib/session-updater.js +0 -35
- package/configure/node_modules/@pie-element/multiple-choice/lib/session-updater.js.map +0 -1
- package/configure/node_modules/@pie-element/multiple-choice/module/configure.js +0 -843
- package/configure/node_modules/@pie-element/multiple-choice/module/controller.js +0 -20686
- package/configure/node_modules/@pie-element/multiple-choice/module/demo.js +0 -77
- package/configure/node_modules/@pie-element/multiple-choice/module/element.js +0 -2019
- package/configure/node_modules/@pie-element/multiple-choice/module/index.html +0 -21
- package/configure/node_modules/@pie-element/multiple-choice/module/manifest.json +0 -14
- package/configure/node_modules/@pie-element/multiple-choice/module/print-demo.js +0 -115
- package/configure/node_modules/@pie-element/multiple-choice/module/print.html +0 -18
- package/configure/node_modules/@pie-element/multiple-choice/module/print.js +0 -1983
- package/configure/node_modules/@pie-element/multiple-choice/package.json +0 -34
- package/configure/node_modules/@pie-lib/math-rendering/CHANGELOG.json +0 -672
- package/configure/node_modules/@pie-lib/math-rendering/CHANGELOG.md +0 -427
- package/configure/node_modules/@pie-lib/math-rendering/LICENSE.md +0 -5
- package/configure/node_modules/@pie-lib/math-rendering/lib/index.js +0 -30
- package/configure/node_modules/@pie-lib/math-rendering/lib/index.js.map +0 -1
- package/configure/node_modules/@pie-lib/math-rendering/lib/mstack/chtml.js +0 -316
- package/configure/node_modules/@pie-lib/math-rendering/lib/mstack/chtml.js.map +0 -1
- package/configure/node_modules/@pie-lib/math-rendering/lib/mstack/index.js +0 -23
- package/configure/node_modules/@pie-lib/math-rendering/lib/mstack/index.js.map +0 -1
- package/configure/node_modules/@pie-lib/math-rendering/lib/mstack/mml.js +0 -123
- package/configure/node_modules/@pie-lib/math-rendering/lib/mstack/mml.js.map +0 -1
- package/configure/node_modules/@pie-lib/math-rendering/lib/normalization.js +0 -103
- package/configure/node_modules/@pie-lib/math-rendering/lib/normalization.js.map +0 -1
- package/configure/node_modules/@pie-lib/math-rendering/lib/render-math.js +0 -275
- package/configure/node_modules/@pie-lib/math-rendering/lib/render-math.js.map +0 -1
- package/configure/node_modules/@pie-lib/math-rendering/package.json +0 -19
- package/configure/node_modules/@pie-lib/math-rendering/playground/demo.html +0 -872
- package/configure/node_modules/@pie-lib/math-rendering/playground/demo.js +0 -108
- package/configure/node_modules/@pie-lib/math-rendering/playground/main.html +0 -156
- package/configure/node_modules/@pie-lib/math-rendering/playground/main.js +0 -16
- package/configure/node_modules/@pie-lib/math-rendering/playground/webpack.config.js +0 -29
- package/configure/node_modules/@pie-lib/math-rendering/src/index.js +0 -4
- package/configure/node_modules/@pie-lib/math-rendering/src/mstack/chtml.js +0 -215
- package/configure/node_modules/@pie-lib/math-rendering/src/mstack/index.js +0 -13
- package/configure/node_modules/@pie-lib/math-rendering/src/mstack/mml.js +0 -24
- package/configure/node_modules/@pie-lib/math-rendering/src/normalization.js +0 -69
- package/configure/node_modules/@pie-lib/math-rendering/src/render-math.js +0 -234
- package/configure/node_modules/@pie-lib/render-ui/CHANGELOG.json +0 -937
- package/configure/node_modules/@pie-lib/render-ui/CHANGELOG.md +0 -602
- package/configure/node_modules/@pie-lib/render-ui/LICENSE.md +0 -5
- package/configure/node_modules/@pie-lib/render-ui/README.md +0 -33
- package/configure/node_modules/@pie-lib/render-ui/lib/collapsible/index.js +0 -146
- package/configure/node_modules/@pie-lib/render-ui/lib/collapsible/index.js.map +0 -1
- package/configure/node_modules/@pie-lib/render-ui/lib/color.js +0 -134
- package/configure/node_modules/@pie-lib/render-ui/lib/color.js.map +0 -1
- package/configure/node_modules/@pie-lib/render-ui/lib/feedback.js +0 -160
- package/configure/node_modules/@pie-lib/render-ui/lib/feedback.js.map +0 -1
- package/configure/node_modules/@pie-lib/render-ui/lib/has-text.js +0 -24
- package/configure/node_modules/@pie-lib/render-ui/lib/has-text.js.map +0 -1
- package/configure/node_modules/@pie-lib/render-ui/lib/html-and-math.js +0 -102
- package/configure/node_modules/@pie-lib/render-ui/lib/html-and-math.js.map +0 -1
- package/configure/node_modules/@pie-lib/render-ui/lib/index.js +0 -104
- package/configure/node_modules/@pie-lib/render-ui/lib/index.js.map +0 -1
- package/configure/node_modules/@pie-lib/render-ui/lib/input-container.js +0 -60
- package/configure/node_modules/@pie-lib/render-ui/lib/input-container.js.map +0 -1
- package/configure/node_modules/@pie-lib/render-ui/lib/preview-layout.js +0 -133
- package/configure/node_modules/@pie-lib/render-ui/lib/preview-layout.js.map +0 -1
- package/configure/node_modules/@pie-lib/render-ui/lib/preview-prompt.js +0 -162
- package/configure/node_modules/@pie-lib/render-ui/lib/preview-prompt.js.map +0 -1
- package/configure/node_modules/@pie-lib/render-ui/lib/purpose.js +0 -28
- package/configure/node_modules/@pie-lib/render-ui/lib/purpose.js.map +0 -1
- package/configure/node_modules/@pie-lib/render-ui/lib/readable.js +0 -28
- package/configure/node_modules/@pie-lib/render-ui/lib/readable.js.map +0 -1
- package/configure/node_modules/@pie-lib/render-ui/lib/response-indicators.js +0 -160
- package/configure/node_modules/@pie-lib/render-ui/lib/response-indicators.js.map +0 -1
- package/configure/node_modules/@pie-lib/render-ui/lib/withUndoReset.js +0 -206
- package/configure/node_modules/@pie-lib/render-ui/lib/withUndoReset.js.map +0 -1
- package/configure/node_modules/@pie-lib/render-ui/package.json +0 -30
- package/configure/node_modules/@pie-lib/render-ui/src/collapsible/index.jsx +0 -68
- package/configure/node_modules/@pie-lib/render-ui/src/color.js +0 -48
- package/configure/node_modules/@pie-lib/render-ui/src/feedback.jsx +0 -100
- package/configure/node_modules/@pie-lib/render-ui/src/has-text.js +0 -14
- package/configure/node_modules/@pie-lib/render-ui/src/html-and-math.js +0 -40
- package/configure/node_modules/@pie-lib/render-ui/src/index.js +0 -27
- package/configure/node_modules/@pie-lib/render-ui/src/input-container.jsx +0 -41
- package/configure/node_modules/@pie-lib/render-ui/src/preview-layout.jsx +0 -77
- package/configure/node_modules/@pie-lib/render-ui/src/preview-prompt.jsx +0 -90
- package/configure/node_modules/@pie-lib/render-ui/src/purpose.jsx +0 -19
- package/configure/node_modules/@pie-lib/render-ui/src/readable.jsx +0 -19
- package/configure/node_modules/@pie-lib/render-ui/src/response-indicators.jsx +0 -89
- package/configure/node_modules/@pie-lib/render-ui/src/withUndoReset.jsx +0 -118
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
|
|
8
|
-
/** NOTE: teacherInstructions, studentInstructions, rationale & scoringType
|
|
9
|
-
* functionalities are not defined yet - the value for those can belong to
|
|
10
|
-
* model or to configure
|
|
11
|
-
*/
|
|
12
|
-
var _default = {
|
|
13
|
-
model: {
|
|
14
|
-
choiceMode: 'checkbox',
|
|
15
|
-
choicePrefix: 'letters',
|
|
16
|
-
choices: [],
|
|
17
|
-
prompt: 'Question Prompt goes here',
|
|
18
|
-
lockChoiceOrder: true,
|
|
19
|
-
partialScoring: true,
|
|
20
|
-
scoringType: 'auto',
|
|
21
|
-
feedbackEnabled: true,
|
|
22
|
-
promptEnabled: true,
|
|
23
|
-
rationaleEnabled: true,
|
|
24
|
-
teacherInstructionsEnabled: true,
|
|
25
|
-
studentInstructionsEnabled: true,
|
|
26
|
-
toolbarEditorPosition: 'bottom',
|
|
27
|
-
choicesLayout: 'vertical',
|
|
28
|
-
gridColumns: '2'
|
|
29
|
-
},
|
|
30
|
-
configuration: {
|
|
31
|
-
spellCheck: {
|
|
32
|
-
label: 'Spellcheck',
|
|
33
|
-
settings: false,
|
|
34
|
-
enabled: true
|
|
35
|
-
},
|
|
36
|
-
choicesLayout: {
|
|
37
|
-
settings: false,
|
|
38
|
-
label: 'Choices Layout'
|
|
39
|
-
},
|
|
40
|
-
gridColumns: {
|
|
41
|
-
label: 'Grid columns'
|
|
42
|
-
},
|
|
43
|
-
answerChoiceCount: 0,
|
|
44
|
-
addChoiceButton: {
|
|
45
|
-
settings: true,
|
|
46
|
-
label: 'Add a Choice'
|
|
47
|
-
},
|
|
48
|
-
choiceMode: {
|
|
49
|
-
settings: true,
|
|
50
|
-
label: 'Response Type'
|
|
51
|
-
},
|
|
52
|
-
choicePrefix: {
|
|
53
|
-
settings: true,
|
|
54
|
-
label: 'Choice Labels'
|
|
55
|
-
},
|
|
56
|
-
deleteChoice: {
|
|
57
|
-
settings: true
|
|
58
|
-
},
|
|
59
|
-
feedback: {
|
|
60
|
-
settings: true,
|
|
61
|
-
label: 'Feedback'
|
|
62
|
-
},
|
|
63
|
-
prompt: {
|
|
64
|
-
settings: true,
|
|
65
|
-
label: 'Prompt'
|
|
66
|
-
},
|
|
67
|
-
lockChoiceOrder: {
|
|
68
|
-
settings: true,
|
|
69
|
-
label: 'Lock Choice Order'
|
|
70
|
-
},
|
|
71
|
-
partialScoring: {
|
|
72
|
-
settings: false,
|
|
73
|
-
label: 'Allow Partial Scoring'
|
|
74
|
-
},
|
|
75
|
-
rationale: {
|
|
76
|
-
settings: true,
|
|
77
|
-
label: 'Rationale'
|
|
78
|
-
},
|
|
79
|
-
accessibility: {
|
|
80
|
-
settings: false,
|
|
81
|
-
label: 'Accessibility Label'
|
|
82
|
-
},
|
|
83
|
-
scoringType: {
|
|
84
|
-
settings: false,
|
|
85
|
-
label: 'Scoring Type'
|
|
86
|
-
},
|
|
87
|
-
studentInstructions: {
|
|
88
|
-
settings: false,
|
|
89
|
-
label: 'Student Instructions'
|
|
90
|
-
},
|
|
91
|
-
teacherInstructions: {
|
|
92
|
-
settings: true,
|
|
93
|
-
label: 'Teacher Instructions'
|
|
94
|
-
},
|
|
95
|
-
toolbarEditorPosition: {
|
|
96
|
-
settings: false,
|
|
97
|
-
label: 'Toolbar Editor Position'
|
|
98
|
-
},
|
|
99
|
-
minAnswerChoices: 2,
|
|
100
|
-
maxAnswerChoices: 5
|
|
101
|
-
}
|
|
102
|
-
};
|
|
103
|
-
exports["default"] = _default;
|
|
104
|
-
//# sourceMappingURL=defaults.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/defaults.js"],"names":["model","choiceMode","choicePrefix","choices","prompt","lockChoiceOrder","partialScoring","scoringType","feedbackEnabled","promptEnabled","rationaleEnabled","teacherInstructionsEnabled","studentInstructionsEnabled","toolbarEditorPosition","choicesLayout","gridColumns","configuration","spellCheck","label","settings","enabled","answerChoiceCount","addChoiceButton","deleteChoice","feedback","rationale","accessibility","studentInstructions","teacherInstructions","minAnswerChoices","maxAnswerChoices"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;eACe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,UAAU,EAAE,UADP;AAELC,IAAAA,YAAY,EAAE,SAFT;AAGLC,IAAAA,OAAO,EAAE,EAHJ;AAILC,IAAAA,MAAM,EAAE,2BAJH;AAKLC,IAAAA,eAAe,EAAE,IALZ;AAMLC,IAAAA,cAAc,EAAE,IANX;AAOLC,IAAAA,WAAW,EAAE,MAPR;AAQLC,IAAAA,eAAe,EAAE,IARZ;AASLC,IAAAA,aAAa,EAAE,IATV;AAULC,IAAAA,gBAAgB,EAAE,IAVb;AAWLC,IAAAA,0BAA0B,EAAE,IAXvB;AAYLC,IAAAA,0BAA0B,EAAE,IAZvB;AAaLC,IAAAA,qBAAqB,EAAE,QAblB;AAcLC,IAAAA,aAAa,EAAE,UAdV;AAeLC,IAAAA,WAAW,EAAE;AAfR,GADM;AAkBbC,EAAAA,aAAa,EAAE;AACbC,IAAAA,UAAU,EAAE;AACVC,MAAAA,KAAK,EAAE,YADG;AAEVC,MAAAA,QAAQ,EAAC,KAFC;AAGVC,MAAAA,OAAO,EAAC;AAHE,KADC;AAMbN,IAAAA,aAAa,EAAE;AACbK,MAAAA,QAAQ,EAAE,KADG;AAEbD,MAAAA,KAAK,EAAE;AAFM,KANF;AAUbH,IAAAA,WAAW,EAAE;AACXG,MAAAA,KAAK,EAAE;AADI,KAVA;AAabG,IA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QAAQ,EAAE,IADS;AAEnBD,MAAAA,KAAK,EAAE;AAFY,KA7DR;AAiEbL,IAAAA,qBAAqB,EAAE;AACrBM,MAAAA,QAAQ,EAAE,KADW;AAErBD,MAAAA,KAAK,EAAE;AAFc,KAjEV;AAqEbW,IAAAA,gBAAgB,EAAE,CArEL;AAsEbC,IAAAA,gBAAgB,EAAE;AAtEL;AAlBF,C","sourcesContent":["/** NOTE: teacherInstructions, studentInstructions, rationale & scoringType\n * functionalities are not defined yet - the value for those can belong to\n * model or to configure\n */\nexport default {\n model: {\n choiceMode: 'checkbox',\n choicePrefix: 'letters',\n choices: [],\n prompt: 'Question Prompt goes here',\n lockChoiceOrder: true,\n partialScoring: true,\n scoringType: 'auto',\n feedbackEnabled: true,\n promptEnabled: true,\n rationaleEnabled: true,\n teacherInstructionsEnabled: true,\n studentInstructionsEnabled: true,\n toolbarEditorPosition: 'bottom',\n choicesLayout: 'vertical',\n gridColumns: '2',\n },\n configuration: {\n spellCheck: {\n label: 'Spellcheck',\n settings:false,\n enabled:true\n },\n choicesLayout: {\n settings: false,\n label: 'Choices Layout',\n },\n gridColumns: {\n label: 'Grid columns',\n },\n answerChoiceCount: 0,\n addChoiceButton: {\n settings: true,\n label: 'Add a Choice',\n },\n choiceMode: {\n settings: true,\n label: 'Response Type',\n },\n choicePrefix: {\n settings: true,\n label: 'Choice Labels',\n },\n deleteChoice: {\n settings: true,\n },\n feedback: {\n settings: true,\n label: 'Feedback',\n },\n prompt: {\n settings: true,\n label: 'Prompt',\n },\n lockChoiceOrder: {\n settings: true,\n label: 'Lock Choice Order',\n },\n partialScoring: {\n settings: false,\n label: 'Allow Partial Scoring',\n },\n rationale: {\n settings: true,\n label: 'Rationale',\n },\n accessibility: {\n settings: false,\n label: 'Accessibility Label'\n },\n scoringType: {\n settings: false,\n label: 'Scoring Type',\n },\n studentInstructions: {\n settings: false,\n label: 'Student Instructions',\n },\n teacherInstructions: {\n settings: true,\n label: 'Teacher Instructions',\n },\n toolbarEditorPosition: {\n settings: false,\n label: 'Toolbar Editor Position',\n },\n minAnswerChoices: 2,\n maxAnswerChoices: 5\n },\n};\n"],"file":"defaults.js"}
|
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
|
|
10
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
|
|
12
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
-
|
|
14
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
15
|
-
|
|
16
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
17
|
-
|
|
18
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
19
|
-
|
|
20
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
21
|
-
|
|
22
|
-
var _wrapNativeSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/wrapNativeSuper"));
|
|
23
|
-
|
|
24
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
25
|
-
|
|
26
|
-
var _react = _interopRequireDefault(require("react"));
|
|
27
|
-
|
|
28
|
-
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
29
|
-
|
|
30
|
-
var _debug = _interopRequireDefault(require("debug"));
|
|
31
|
-
|
|
32
|
-
var _pieConfigureEvents = require("@pie-framework/pie-configure-events");
|
|
33
|
-
|
|
34
|
-
var _main = _interopRequireDefault(require("./main"));
|
|
35
|
-
|
|
36
|
-
var _configUi = require("@pie-lib/config-ui");
|
|
37
|
-
|
|
38
|
-
var _defaults = _interopRequireDefault(require("lodash/defaults"));
|
|
39
|
-
|
|
40
|
-
var _defaults2 = _interopRequireDefault(require("./defaults"));
|
|
41
|
-
|
|
42
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
43
|
-
|
|
44
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
45
|
-
|
|
46
|
-
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; }
|
|
47
|
-
|
|
48
|
-
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; }
|
|
49
|
-
|
|
50
|
-
var log = (0, _debug["default"])('multiple-choice:configure');
|
|
51
|
-
|
|
52
|
-
var generateFormattedChoices = function generateFormattedChoices(choices) {
|
|
53
|
-
var choiceCount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
54
|
-
|
|
55
|
-
if (!choices || choices.length === 0) {
|
|
56
|
-
var formattedChoices = [];
|
|
57
|
-
|
|
58
|
-
for (var i = 0; i < choiceCount; i++) {
|
|
59
|
-
formattedChoices.push({
|
|
60
|
-
value: "".concat(i),
|
|
61
|
-
label: '',
|
|
62
|
-
feedback: {
|
|
63
|
-
type: 'none',
|
|
64
|
-
value: ''
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
return formattedChoices;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
return choices;
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
var prepareCustomizationObject = function prepareCustomizationObject(config, model) {
|
|
76
|
-
var configuration = (0, _defaults["default"])(config, _defaults2["default"].configuration);
|
|
77
|
-
return {
|
|
78
|
-
configuration: configuration,
|
|
79
|
-
model: _objectSpread(_objectSpread({}, model), {}, {
|
|
80
|
-
choices: generateFormattedChoices(model && model.choices || [], configuration && configuration.answerChoiceCount)
|
|
81
|
-
})
|
|
82
|
-
};
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
var MultipleChoice = /*#__PURE__*/function (_HTMLElement) {
|
|
86
|
-
(0, _inherits2["default"])(MultipleChoice, _HTMLElement);
|
|
87
|
-
|
|
88
|
-
var _super = _createSuper(MultipleChoice);
|
|
89
|
-
|
|
90
|
-
function MultipleChoice() {
|
|
91
|
-
var _this;
|
|
92
|
-
|
|
93
|
-
(0, _classCallCheck2["default"])(this, MultipleChoice);
|
|
94
|
-
_this = _super.call(this);
|
|
95
|
-
_this._model = MultipleChoice.createDefaultModel();
|
|
96
|
-
_this._configuration = _defaults2["default"].configuration;
|
|
97
|
-
_this.onModelChanged = _this.onModelChanged.bind((0, _assertThisInitialized2["default"])(_this));
|
|
98
|
-
_this.onConfigurationChanged = _this.onConfigurationChanged.bind((0, _assertThisInitialized2["default"])(_this));
|
|
99
|
-
return _this;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
(0, _createClass2["default"])(MultipleChoice, [{
|
|
103
|
-
key: "model",
|
|
104
|
-
set: function set(s) {
|
|
105
|
-
this._model = MultipleChoice.createDefaultModel(s);
|
|
106
|
-
|
|
107
|
-
this._render();
|
|
108
|
-
}
|
|
109
|
-
}, {
|
|
110
|
-
key: "configuration",
|
|
111
|
-
set: function set(c) {
|
|
112
|
-
var info = prepareCustomizationObject(c, this._model);
|
|
113
|
-
this.onModelChanged(info.model);
|
|
114
|
-
this._configuration = info.configuration;
|
|
115
|
-
|
|
116
|
-
this._render();
|
|
117
|
-
}
|
|
118
|
-
}, {
|
|
119
|
-
key: "disableSidePanel",
|
|
120
|
-
set: function set(s) {
|
|
121
|
-
this._disableSidePanel = s;
|
|
122
|
-
|
|
123
|
-
this._render();
|
|
124
|
-
}
|
|
125
|
-
}, {
|
|
126
|
-
key: "dispatchModelUpdated",
|
|
127
|
-
value: function dispatchModelUpdated(reset) {
|
|
128
|
-
var resetValue = !!reset;
|
|
129
|
-
this.dispatchEvent(new _pieConfigureEvents.ModelUpdatedEvent(this._model, resetValue));
|
|
130
|
-
}
|
|
131
|
-
}, {
|
|
132
|
-
key: "onModelChanged",
|
|
133
|
-
value: function onModelChanged(m, reset) {
|
|
134
|
-
this._model = m;
|
|
135
|
-
|
|
136
|
-
this._render();
|
|
137
|
-
|
|
138
|
-
this.dispatchModelUpdated(reset);
|
|
139
|
-
}
|
|
140
|
-
}, {
|
|
141
|
-
key: "onConfigurationChanged",
|
|
142
|
-
value: function onConfigurationChanged(c) {
|
|
143
|
-
this._configuration = prepareCustomizationObject(c, this._model).configuration;
|
|
144
|
-
|
|
145
|
-
if (this._model) {
|
|
146
|
-
this.onModelChanged(this._model);
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
this._render();
|
|
150
|
-
}
|
|
151
|
-
/** @param {done, progress, file} handler */
|
|
152
|
-
|
|
153
|
-
}, {
|
|
154
|
-
key: "insertImage",
|
|
155
|
-
value: function insertImage(handler) {
|
|
156
|
-
this.dispatchEvent(new _pieConfigureEvents.InsertImageEvent(handler));
|
|
157
|
-
}
|
|
158
|
-
}, {
|
|
159
|
-
key: "onDeleteImage",
|
|
160
|
-
value: function onDeleteImage(src, done) {
|
|
161
|
-
this.dispatchEvent(new _pieConfigureEvents.DeleteImageEvent(src, done));
|
|
162
|
-
}
|
|
163
|
-
}, {
|
|
164
|
-
key: "_render",
|
|
165
|
-
value: function _render() {
|
|
166
|
-
log('_render');
|
|
167
|
-
|
|
168
|
-
var element = /*#__PURE__*/_react["default"].createElement(_main["default"], {
|
|
169
|
-
model: this._model,
|
|
170
|
-
configuration: this._configuration,
|
|
171
|
-
onModelChanged: this.onModelChanged,
|
|
172
|
-
onConfigurationChanged: this.onConfigurationChanged,
|
|
173
|
-
disableSidePanel: this._disableSidePanel,
|
|
174
|
-
imageSupport: {
|
|
175
|
-
add: this.insertImage.bind(this),
|
|
176
|
-
"delete": this.onDeleteImage.bind(this)
|
|
177
|
-
}
|
|
178
|
-
});
|
|
179
|
-
|
|
180
|
-
_reactDom["default"].render(element, this);
|
|
181
|
-
}
|
|
182
|
-
}]);
|
|
183
|
-
return MultipleChoice;
|
|
184
|
-
}( /*#__PURE__*/(0, _wrapNativeSuper2["default"])(HTMLElement));
|
|
185
|
-
|
|
186
|
-
exports["default"] = MultipleChoice;
|
|
187
|
-
(0, _defineProperty2["default"])(MultipleChoice, "createDefaultModel", function () {
|
|
188
|
-
var model = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
189
|
-
|
|
190
|
-
var normalizedModel = _configUi.choiceUtils.normalizeChoices(_objectSpread(_objectSpread(_objectSpread({}, _defaults2["default"].model), model), {}, {
|
|
191
|
-
choices: generateFormattedChoices(model && model.choices || [])
|
|
192
|
-
})); // This is used for offering support for old models which have the property "verticalMode"
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
normalizedModel.choicesLayout = model.choicesLayout || model.verticalMode === false && 'horizontal' || _defaults2["default"].model.choicesLayout;
|
|
196
|
-
return normalizedModel;
|
|
197
|
-
});
|
|
198
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.js"],"names":["log","generateFormattedChoices","choices","choiceCount","length","formattedChoices","i","push","value","label","feedback","type","prepareCustomizationObject","config","model","configuration","sensibleDefaults","answerChoiceCount","MultipleChoice","_model","createDefaultModel","_configuration","onModelChanged","bind","onConfigurationChanged","s","_render","c","info","_disableSidePanel","reset","resetValue","dispatchEvent","ModelUpdatedEvent","m","dispatchModelUpdated","handler","InsertImageEvent","src","done","DeleteImageEvent","element","React","createElement","Main","disableSidePanel","imageSupport","add","insertImage","onDeleteImage","ReactDOM","render","HTMLElement","normalizedModel","utils","normalizeChoices","choicesLayout","verticalMode"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AAMA;;AACA;;AACA;;AAEA;;;;;;;;;;AAEA,IAAMA,GAAG,GAAG,uBAAM,2BAAN,CAAZ;;AAEA,IAAMC,wBAAwB,GAAG,SAA3BA,wBAA2B,CAACC,OAAD,EAA8B;AAAA,MAApBC,WAAoB,uEAAN,CAAM;;AAC7D,MAAI,CAACD,OAAD,IAAYA,OAAO,CAACE,MAAR,KAAmB,CAAnC,EAAsC;AACpC,QAAIC,gBAAgB,GAAG,EAAvB;;AAEA,SAAK,IAAIC,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGH,WAApB,EAAiCG,CAAC,EAAlC,EAAsC;AACpCD,MAAAA,gBAAgB,CAACE,IAAjB,CAAsB;AACpBC,QAAAA,KAAK,YAAKF,CAAL,CADe;AAEpBG,QAAAA,KAAK,EAAE,EAFa;AAGpBC,QAAAA,QAAQ,EAAE;AACRC,UAAAA,IAAI,EAAE,MADE;AAERH,UAAAA,KAAK,EAAE;AAFC;AAHU,OAAtB;AAQD;;AAED,WAAOH,gBAAP;AACD;;AAED,SAAOH,OAAP;AACD,CAnBD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W;;;iCAAvBlC,c,wBACS,YAAgB;AAAA,MAAfJ,KAAe,uEAAP,EAAO;;AAC1C,MAAMuC,eAAe,GAAGC,sBAAMC,gBAAN,+CACnBvC,sBAAiBF,KADE,GAEnBA,KAFmB;AAGtBZ,IAAAA,OAAO,EAAED,wBAAwB,CAAEa,KAAK,IAAIA,KAAK,CAACZ,OAAhB,IAA4B,EAA7B;AAHX,KAAxB,CAD0C,CAO1C;;;AACAmD,EAAAA,eAAe,CAACG,aAAhB,GAAgC1C,KAAK,CAAC0C,aAAN,IAAwB1C,KAAK,CAAC2C,YAAN,KAAuB,KAAvB,IAAgC,YAAxD,IAAyEzC,sBAAiBF,KAAjB,CAAuB0C,aAAhI;AAEA,SAAOH,eAAP;AACD,C","sourcesContent":["import React from 'react';\nimport ReactDOM from 'react-dom';\nimport debug from 'debug';\nimport {\n DeleteImageEvent,\n InsertImageEvent,\n ModelUpdatedEvent\n} from '@pie-framework/pie-configure-events';\n\nimport Main from './main';\nimport { choiceUtils as utils } from '@pie-lib/config-ui';\nimport defaults from 'lodash/defaults';\n\nimport sensibleDefaults from './defaults';\n\nconst log = debug('multiple-choice:configure');\n\nconst generateFormattedChoices = (choices, choiceCount = 0) => {\n if (!choices || choices.length === 0) {\n let formattedChoices = [];\n\n for (let i = 0; i < choiceCount; i++) {\n formattedChoices.push({\n value: `${i}`,\n label: '',\n feedback: {\n type: 'none',\n value: ''\n }\n });\n }\n\n return formattedChoices;\n }\n\n return choices;\n};\n\nconst prepareCustomizationObject = (config, model) => {\n const configuration = defaults(config, sensibleDefaults.configuration);\n\n return {\n configuration,\n model: {\n ...model,\n choices: generateFormattedChoices((model && model.choices) || [], configuration && configuration.answerChoiceCount)\n }\n };\n};\n\nexport default class MultipleChoice extends HTMLElement {\n static createDefaultModel = (model = {}) => {\n const normalizedModel = utils.normalizeChoices({\n ...sensibleDefaults.model,\n ...model,\n choices: generateFormattedChoices((model && model.choices) || [])\n });\n\n // This is used for offering support for old models which have the property \"verticalMode\"\n normalizedModel.choicesLayout = model.choicesLayout || (model.verticalMode === false && 'horizontal') || sensibleDefaults.model.choicesLayout;\n\n return normalizedModel;\n }\n\n constructor() {\n super();\n this._model = MultipleChoice.createDefaultModel();\n this._configuration = sensibleDefaults.configuration;\n this.onModelChanged = this.onModelChanged.bind(this);\n this.onConfigurationChanged = this.onConfigurationChanged.bind(this);\n }\n\n set model(s) {\n this._model = MultipleChoice.createDefaultModel(s);\n\n this._render();\n }\n\n set configuration(c) {\n const info = prepareCustomizationObject(c, this._model);\n\n this.onModelChanged(info.model);\n this._configuration = info.configuration;\n this._render();\n }\n\n set disableSidePanel(s) {\n this._disableSidePanel = s;\n this._render();\n }\n\n dispatchModelUpdated(reset) {\n const resetValue = !!reset;\n\n this.dispatchEvent(new ModelUpdatedEvent(this._model, resetValue));\n }\n\n onModelChanged(m, reset) {\n this._model = m;\n this._render();\n\n this.dispatchModelUpdated(reset);\n }\n\n onConfigurationChanged(c) {\n this._configuration = prepareCustomizationObject(c, this._model).configuration;\n\n if (this._model) {\n this.onModelChanged(this._model);\n }\n\n this._render();\n }\n\n /** @param {done, progress, file} handler */\n insertImage(handler) {\n this.dispatchEvent(new InsertImageEvent(handler));\n }\n\n onDeleteImage(src, done) {\n this.dispatchEvent(new DeleteImageEvent(src, done));\n }\n\n _render() {\n log('_render');\n let element = React.createElement(Main, {\n model: this._model,\n configuration: this._configuration,\n onModelChanged: this.onModelChanged,\n onConfigurationChanged: this.onConfigurationChanged,\n disableSidePanel: this._disableSidePanel,\n imageSupport: {\n add: this.insertImage.bind(this),\n delete: this.onDeleteImage.bind(this)\n }\n });\n ReactDOM.render(element, this);\n }\n}\n"],"file":"index.js"}
|