@pie-element/inline-dropdown 3.6.4-next.85 → 3.7.1-beta.587

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.
@@ -83,6 +83,43 @@
83
83
  }
84
84
  }
85
85
  },
86
+ "spellCheck": {
87
+ "title": "ConfigureProp",
88
+ "type": "object",
89
+ "properties": {
90
+ "settings": {
91
+ "description": "Indicates if the item has to be displayed in the Settings Panel",
92
+ "type": "boolean",
93
+ "title": "settings"
94
+ },
95
+ "label": {
96
+ "description": "Indicates the label for the item that has to be displayed in the Settings Panel",
97
+ "type": "string",
98
+ "title": "label"
99
+ }
100
+ }
101
+ },
102
+ "choiceRationale": {
103
+ "title": "ConfigureProp",
104
+ "type": "object",
105
+ "properties": {
106
+ "settings": {
107
+ "description": "Indicates if the item has to be displayed in the Settings Panel",
108
+ "type": "boolean",
109
+ "title": "settings"
110
+ },
111
+ "label": {
112
+ "description": "Indicates the label for the item that has to be displayed in the Settings Panel",
113
+ "type": "string",
114
+ "title": "label"
115
+ }
116
+ }
117
+ },
118
+ "settingsPanelDisabled": {
119
+ "description": "Indicates if the settings panel is not available",
120
+ "type": "boolean",
121
+ "title": "settingsPanelDisabled"
122
+ },
86
123
  "scoringType": {
87
124
  "title": "ConfigureProp",
88
125
  "type": "object",
@@ -131,6 +168,74 @@
131
168
  }
132
169
  }
133
170
  },
171
+ "maxResponseAreas": {
172
+ "description": "Maximum number of response areas",
173
+ "type": "number",
174
+ "title": "maxResponseAreas"
175
+ },
176
+ "maxResponseAreaChoices": {
177
+ "description": "Maximum number of choices per response area",
178
+ "type": "number",
179
+ "title": "maxResponseAreaChoices"
180
+ },
181
+ "maxImageWidth": {
182
+ "title": "ConfigureMaxImageDimensionsProp",
183
+ "type": "object",
184
+ "properties": {
185
+ "teacherInstructions": {
186
+ "description": "Indicates the max dimension for images in teacher instructions",
187
+ "type": "number",
188
+ "title": "teacherInstructions"
189
+ },
190
+ "prompt": {
191
+ "description": "Indicates the max dimension for images in prompt - this is also the default dimension for all other input fields if it's not specified",
192
+ "type": "number",
193
+ "title": "prompt"
194
+ },
195
+ "rationale": {
196
+ "description": "Indicates the max dimension for images in rationale",
197
+ "type": "number",
198
+ "title": "rationale"
199
+ }
200
+ }
201
+ },
202
+ "maxImageHeight": {
203
+ "title": "ConfigureMaxImageDimensionsProp",
204
+ "type": "object",
205
+ "properties": {
206
+ "teacherInstructions": {
207
+ "description": "Indicates the max dimension for images in teacher instructions",
208
+ "type": "number",
209
+ "title": "teacherInstructions"
210
+ },
211
+ "prompt": {
212
+ "description": "Indicates the max dimension for images in prompt - this is also the default dimension for all other input fields if it's not specified",
213
+ "type": "number",
214
+ "title": "prompt"
215
+ },
216
+ "rationale": {
217
+ "description": "Indicates the max dimension for images in rationale",
218
+ "type": "number",
219
+ "title": "rationale"
220
+ }
221
+ }
222
+ },
223
+ "withRubric": {
224
+ "title": "ConfigureProp",
225
+ "type": "object",
226
+ "properties": {
227
+ "settings": {
228
+ "description": "Indicates if the item has to be displayed in the Settings Panel",
229
+ "type": "boolean",
230
+ "title": "settings"
231
+ },
232
+ "label": {
233
+ "description": "Indicates the label for the item that has to be displayed in the Settings Panel",
234
+ "type": "string",
235
+ "title": "label"
236
+ }
237
+ }
238
+ },
134
239
  "showPrompt": {
135
240
  "description": "Determines whether prompt field will be displayed or not",
136
241
  "default": true,
@@ -166,6 +271,27 @@
166
271
  "title": "label"
167
272
  }
168
273
  }
274
+ },
275
+ "ConfigureMaxImageDimensionsProp": {
276
+ "title": "ConfigureMaxImageDimensionsProp",
277
+ "type": "object",
278
+ "properties": {
279
+ "teacherInstructions": {
280
+ "description": "Indicates the max dimension for images in teacher instructions",
281
+ "type": "number",
282
+ "title": "teacherInstructions"
283
+ },
284
+ "prompt": {
285
+ "description": "Indicates the max dimension for images in prompt - this is also the default dimension for all other input fields if it's not specified",
286
+ "type": "number",
287
+ "title": "prompt"
288
+ },
289
+ "rationale": {
290
+ "description": "Indicates the max dimension for images in rationale",
291
+ "type": "number",
292
+ "title": "rationale"
293
+ }
294
+ }
169
295
  }
170
296
  },
171
297
  "$schema": "http://json-schema.org/draft-07/schema#"
@@ -62,6 +62,34 @@ Indicates if the item has to be displayed in the Settings Panel
62
62
 
63
63
  Indicates the label for the item that has to be displayed in the Settings Panel
64
64
 
65
+ # `spellCheck` (object)
66
+
67
+ Properties of the `spellCheck` object:
68
+
69
+ ## `settings` (boolean)
70
+
71
+ Indicates if the item has to be displayed in the Settings Panel
72
+
73
+ ## `label` (string)
74
+
75
+ Indicates the label for the item that has to be displayed in the Settings Panel
76
+
77
+ # `choiceRationale` (object)
78
+
79
+ Properties of the `choiceRationale` object:
80
+
81
+ ## `settings` (boolean)
82
+
83
+ Indicates if the item has to be displayed in the Settings Panel
84
+
85
+ ## `label` (string)
86
+
87
+ Indicates the label for the item that has to be displayed in the Settings Panel
88
+
89
+ # `settingsPanelDisabled` (boolean)
90
+
91
+ Indicates if the settings panel is not available
92
+
65
93
  # `scoringType` (object)
66
94
 
67
95
  Properties of the `scoringType` object:
@@ -98,6 +126,58 @@ Indicates if the item has to be displayed in the Settings Panel
98
126
 
99
127
  Indicates the label for the item that has to be displayed in the Settings Panel
100
128
 
129
+ # `maxResponseAreas` (number)
130
+
131
+ Maximum number of response areas
132
+
133
+ # `maxResponseAreaChoices` (number)
134
+
135
+ Maximum number of choices per response area
136
+
137
+ # `maxImageWidth` (object)
138
+
139
+ Properties of the `maxImageWidth` object:
140
+
141
+ ## `teacherInstructions` (number)
142
+
143
+ Indicates the max dimension for images in teacher instructions
144
+
145
+ ## `prompt` (number)
146
+
147
+ Indicates the max dimension for images in prompt - this is also the default dimension for all other input fields if it's not specified
148
+
149
+ ## `rationale` (number)
150
+
151
+ Indicates the max dimension for images in rationale
152
+
153
+ # `maxImageHeight` (object)
154
+
155
+ Properties of the `maxImageHeight` object:
156
+
157
+ ## `teacherInstructions` (number)
158
+
159
+ Indicates the max dimension for images in teacher instructions
160
+
161
+ ## `prompt` (number)
162
+
163
+ Indicates the max dimension for images in prompt - this is also the default dimension for all other input fields if it's not specified
164
+
165
+ ## `rationale` (number)
166
+
167
+ Indicates the max dimension for images in rationale
168
+
169
+ # `withRubric` (object)
170
+
171
+ Properties of the `withRubric` object:
172
+
173
+ ## `settings` (boolean)
174
+
175
+ Indicates if the item has to be displayed in the Settings Panel
176
+
177
+ ## `label` (string)
178
+
179
+ Indicates the label for the item that has to be displayed in the Settings Panel
180
+
101
181
  # `showPrompt` (boolean)
102
182
 
103
183
  Determines whether prompt field will be displayed or not
@@ -132,4 +212,20 @@ Indicates if the item has to be displayed in the Settings Panel
132
212
 
133
213
  ### `label` (string)
134
214
 
135
- Indicates the label for the item that has to be displayed in the Settings Panel
215
+ Indicates the label for the item that has to be displayed in the Settings Panel
216
+
217
+ ## `ConfigureMaxImageDimensionsProp` (object)
218
+
219
+ Properties of the `ConfigureMaxImageDimensionsProp` object:
220
+
221
+ ### `teacherInstructions` (number)
222
+
223
+ Indicates the max dimension for images in teacher instructions
224
+
225
+ ### `prompt` (number)
226
+
227
+ Indicates the max dimension for images in prompt - this is also the default dimension for all other input fields if it's not specified
228
+
229
+ ### `rationale` (number)
230
+
231
+ Indicates the max dimension for images in rationale
@@ -2,7 +2,7 @@ const { model } = require('./generate');
2
2
 
3
3
  module.exports = {
4
4
  elements: {
5
- 'inline-dropdown': '../..'
5
+ 'inline-dropdown': '../..',
6
6
  },
7
- models: [model('1', 'inline-dropdown')]
7
+ models: [model('1', 'inline-dropdown')],
8
8
  };
@@ -5,62 +5,74 @@ exports.model = (id, element) => ({
5
5
  mode: 'gather',
6
6
  prompt: 'Use the dropdowns to complete the sentence',
7
7
  promptEnabled: true,
8
+ toolbarEditorPosition: 'bottom',
8
9
  shuffle: true,
9
10
  markup: '<div><p>The {{0}} jumped {{1}} the {{2}}</p></div>',
10
11
  choices: {
11
- '0': [
12
+ 0: [
12
13
  {
13
14
  label: 'cow ',
14
15
  value: '0',
15
- correct: true
16
+ correct: true,
17
+ rationale: 'rationale cow',
16
18
  },
17
19
  {
18
20
  label: 'dog ',
19
21
  value: '1',
20
- correct: false
22
+ correct: false,
23
+ rationale: 'rationale dog',
21
24
  },
22
25
  {
23
26
  label: 'cat ',
24
27
  value: '2',
25
- correct: false
26
- }
28
+ correct: false,
29
+ rationale: 'rationale car',
30
+ },
27
31
  ],
28
- '1': [
32
+ 1: [
29
33
  {
30
34
  label: 'over ',
31
35
  value: '0',
32
- correct: true
36
+ correct: true,
37
+ rationale: 'rationale over',
33
38
  },
34
39
  {
35
40
  label: 'under ',
36
41
  value: '1',
37
- correct: false
42
+ correct: false,
43
+ rationale: 'rationale under',
38
44
  },
39
45
  {
40
46
  label: 'across ',
41
47
  value: '2',
42
- correct: false
43
- }
48
+ correct: false,
49
+ rationale: 'rationale across',
50
+ },
44
51
  ],
45
- '2': [
52
+ 2: [
46
53
  {
47
54
  label: 'moon ',
48
55
  value: '0',
49
- correct: true
56
+ correct: true,
57
+ rationale: 'rationale moon',
50
58
  },
51
59
  {
52
60
  label: 'sun',
53
61
  value: '2',
54
- correct: false
62
+ correct: false,
63
+ rationale: 'rationale sun',
55
64
  },
56
65
  {
57
66
  label: 'house ',
58
67
  value: '3',
59
- correct: false
60
- }
61
- ]
68
+ correct: false,
69
+ rationale: 'rationale house',
70
+ },
71
+ ],
62
72
  },
63
73
  alternateResponse: {
64
- '2': ['2']
65
- }
74
+ 2: ['2'],
75
+ },
76
+ choiceRationaleEnabled: false,
77
+ rubricEnabled: false,
66
78
  });
@@ -28,6 +28,11 @@
28
28
  "description": "Indicates if choice is correct",
29
29
  "type": "boolean",
30
30
  "title": "correct"
31
+ },
32
+ "rationale": {
33
+ "description": "Rationale for the choice",
34
+ "type": "string",
35
+ "title": "rationale"
31
36
  }
32
37
  },
33
38
  "required": [
@@ -107,6 +112,16 @@
107
112
  "type": "boolean",
108
113
  "title": "rationaleEnabled"
109
114
  },
115
+ "spellCheckEnabled": {
116
+ "description": "Indicates if spellcheck is enabled for the author. Default value is true",
117
+ "type": "boolean",
118
+ "title": "spellCheckEnabled"
119
+ },
120
+ "choiceRationaleEnabled": {
121
+ "description": "Indicates if Choice Level Rationales are enabled",
122
+ "type": "boolean",
123
+ "title": "choiceRationaleEnabled"
124
+ },
110
125
  "studentInstructionsEnabled": {
111
126
  "description": "Indicates if Student Instructions are enabled",
112
127
  "type": "boolean",
@@ -117,6 +132,26 @@
117
132
  "type": "boolean",
118
133
  "title": "teacherInstructionsEnabled"
119
134
  },
135
+ "displayType": {
136
+ "description": "Indicates display type for the container of the pie-ui element",
137
+ "type": "string",
138
+ "title": "displayType"
139
+ },
140
+ "toolbarEditorPosition": {
141
+ "description": "Indicates the editor's toolbar position which can be 'bottom' or 'top'",
142
+ "default": ": 'bottom'",
143
+ "enum": [
144
+ "bottom",
145
+ "top"
146
+ ],
147
+ "type": "string",
148
+ "title": "toolbarEditorPosition"
149
+ },
150
+ "rubricEnabled": {
151
+ "description": "Indicates if Rubric is enabled",
152
+ "type": "boolean",
153
+ "title": "rubricEnabled"
154
+ },
120
155
  "id": {
121
156
  "description": "Identifier to identify the Pie Element in html markup, Must be unique within a pie item config.",
122
157
  "type": "string",
@@ -130,7 +165,9 @@
130
165
  },
131
166
  "required": [
132
167
  "alternateResponses",
168
+ "choiceRationaleEnabled",
133
169
  "choices",
170
+ "displayType",
134
171
  "element",
135
172
  "id",
136
173
  "lockChoiceOrder",
@@ -138,7 +175,9 @@
138
175
  "partialScoring",
139
176
  "rationale",
140
177
  "rationaleEnabled",
178
+ "rubricEnabled",
141
179
  "scoringType",
180
+ "spellCheckEnabled",
142
181
  "studentInstructionsEnabled",
143
182
  "teacherInstructionsEnabled"
144
183
  ],
@@ -159,6 +198,27 @@
159
198
  }
160
199
  }
161
200
  },
201
+ "ConfigureMaxImageDimensionsProp": {
202
+ "title": "ConfigureMaxImageDimensionsProp",
203
+ "type": "object",
204
+ "properties": {
205
+ "teacherInstructions": {
206
+ "description": "Indicates the max dimension for images in teacher instructions",
207
+ "type": "number",
208
+ "title": "teacherInstructions"
209
+ },
210
+ "prompt": {
211
+ "description": "Indicates the max dimension for images in prompt - this is also the default dimension for all other input fields if it's not specified",
212
+ "type": "number",
213
+ "title": "prompt"
214
+ },
215
+ "rationale": {
216
+ "description": "Indicates the max dimension for images in rationale",
217
+ "type": "number",
218
+ "title": "rationale"
219
+ }
220
+ }
221
+ },
162
222
  "Choice": {
163
223
  "title": "Choice",
164
224
  "type": "object",
@@ -177,6 +237,11 @@
177
237
  "description": "Indicates if choice is correct",
178
238
  "type": "boolean",
179
239
  "title": "correct"
240
+ },
241
+ "rationale": {
242
+ "description": "Rationale for the choice",
243
+ "type": "string",
244
+ "title": "rationale"
180
245
  }
181
246
  },
182
247
  "required": [
@@ -56,6 +56,14 @@ Indicates teacher instructions
56
56
 
57
57
  Indicates if Rationale are enabled
58
58
 
59
+ # `spellCheckEnabled` (boolean, required)
60
+
61
+ Indicates if spellcheck is enabled for the author. Default value is true
62
+
63
+ # `choiceRationaleEnabled` (boolean, required)
64
+
65
+ Indicates if Choice Level Rationales are enabled
66
+
59
67
  # `studentInstructionsEnabled` (boolean, required)
60
68
 
61
69
  Indicates if Student Instructions are enabled
@@ -64,6 +72,25 @@ Indicates if Student Instructions are enabled
64
72
 
65
73
  Indicates if Teacher Instructions are enabled
66
74
 
75
+ # `displayType` (string, required)
76
+
77
+ Indicates display type for the container of the pie-ui element
78
+
79
+ # `toolbarEditorPosition` (string, enum)
80
+
81
+ Indicates the editor's toolbar position which can be 'bottom' or 'top'
82
+
83
+ This element must be one of the following enum values:
84
+
85
+ * `bottom`
86
+ * `top`
87
+
88
+ Default: `": 'bottom'"`
89
+
90
+ # `rubricEnabled` (boolean, required)
91
+
92
+ Indicates if Rubric is enabled
93
+
67
94
  # `id` (string, required)
68
95
 
69
96
  Identifier to identify the Pie Element in html markup, Must be unique within a pie item config.
@@ -90,6 +117,22 @@ Indicates if the item has to be displayed in the Settings Panel
90
117
 
91
118
  Indicates the label for the item that has to be displayed in the Settings Panel
92
119
 
120
+ ## `ConfigureMaxImageDimensionsProp` (object)
121
+
122
+ Properties of the `ConfigureMaxImageDimensionsProp` object:
123
+
124
+ ### `teacherInstructions` (number)
125
+
126
+ Indicates the max dimension for images in teacher instructions
127
+
128
+ ### `prompt` (number)
129
+
130
+ Indicates the max dimension for images in prompt - this is also the default dimension for all other input fields if it's not specified
131
+
132
+ ### `rationale` (number)
133
+
134
+ Indicates the max dimension for images in rationale
135
+
93
136
  ## `Choice` (object)
94
137
 
95
138
  Properties of the `Choice` object:
@@ -104,4 +147,8 @@ The label of the choice
104
147
 
105
148
  ### `correct` (boolean)
106
149
 
107
- Indicates if choice is correct
150
+ Indicates if choice is correct
151
+
152
+ ### `rationale` (string)
153
+
154
+ Rationale for the choice
package/lib/index.js CHANGED
@@ -35,7 +35,7 @@ var _inlineDropdown = _interopRequireDefault(require("./inline-dropdown"));
35
35
 
36
36
  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); }; }
37
37
 
38
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
38
+ 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; } }
39
39
 
40
40
  var RootInlineDropdown = /*#__PURE__*/function (_HTMLElement) {
41
41
  (0, _inherits2["default"])(RootInlineDropdown, _HTMLElement);
@@ -54,6 +54,7 @@ var RootInlineDropdown = /*#__PURE__*/function (_HTMLElement) {
54
54
  rationale: _this._model.rationale,
55
55
  teacherInstructions: _this._model.teacherInstructions,
56
56
  disabled: _this._model.disabled,
57
+ displayType: _this._model.displayType,
57
58
  markup: _this._model.markup,
58
59
  mode: _this._model.mode,
59
60
  choices: _this._model.choices,
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.js"],"names":["RootInlineDropdown","_model","_session","elem","React","createElement","InlineDropdown","prompt","rationale","teacherInstructions","disabled","markup","mode","choices","value","feedback","onChange","changeSession","ReactDOM","render","dispatchEvent","SessionChangedEvent","tagName","toLowerCase","session","dispatchChangedEvent","_render","m","ModelSetEvent","s","HTMLElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAIA;;AACA;;;;;;IAEqBA,kB;;;;;AACnB,gCAAc;AAAA;;AAAA;AACZ;AADY,gGA4BJ,YAAM;AACd,UAAI,MAAKC,MAAL,IAAe,MAAKC,QAAxB,EAAkC;AAChC,YAAIC,IAAI,gBAAGC,kBAAMC,aAAN,CAAoBC,0BAApB,EAAoC;AAC7CC,UAAAA,MAAM,EAAE,MAAKN,MAAL,CAAYM,MADyB;AAE7CC,UAAAA,SAAS,EAAE,MAAKP,MAAL,CAAYO,SAFsB;AAG7CC,UAAAA,mBAAmB,EAAE,MAAKR,MAAL,CAAYQ,mBAHY;AAI7CC,UAAAA,QAAQ,EAAE,MAAKT,MAAL,CAAYS,QAJuB;AAK7CC,UAAAA,MAAM,EAAE,MAAKV,MAAL,CAAYU,MALyB;AAM7CC,UAAAA,IAAI,EAAE,MAAKX,MAAL,CAAYW,IAN2B;AAO7CC,UAAAA,OAAO,EAAE,MAAKZ,MAAL,CAAYY,OAPwB;AAQ7CC,UAAAA,KAAK,EAAE,MAAKZ,QAAL,CAAcY,KARwB;AAS7CC,UAAAA,QAAQ,EAAE,MAAKd,MAAL,CAAYc,QATuB;AAU7CC,UAAAA,QAAQ,EAAE,MAAKC;AAV8B,SAApC,CAAX;;AAYAC,6BAASC,MAAT,CAAgBhB,IAAhB,kDAA4B,YAAM;AAChC;AACD,SAFD;AAGD;AACF,KA9Ca;AAAA,6GAgDS,YAAM;AAC3B,YAAKiB,aAAL,CACE,IAAIC,oCAAJ,CACE,MAAKC,OAAL,CAAaC,WAAb,EADF,EAEE,MAAKC,OAAL,IAAgB,CAAC,CAAC,MAAKA,OAAL,CAAaV,KAFjC,CADF;AAMD,KAvDa;AAAA,sGAyDE,UAAAA,KAAK,EAAI;AACvB,YAAKU,OAAL,CAAaV,KAAb,GAAqBA,KAArB;;AACA,YAAKW,oBAAL;;AACA,YAAKC,OAAL;AACD,KA7Da;AAEZ,UAAKzB,MAAL,GAAc,IAAd;AACA,UAAKC,QAAL,GAAgB,IAAhB;AAHY;AAIb;;;;SAED,aAAUyB,CAAV,EAAa;AACX,WAAK1B,MAAL,GAAc0B,CAAd;AACA,WAAKP,aAAL,CACE,IAAIQ,8BAAJ,CACE,KAAKN,OAAL,CAAaC,WAAb,EADF,EAEE,KAAKC,OAAL,IAAgB,CAAC,CAAC,KAAKA,OAAL,CAAaV,KAFjC,EAGE,CAAC,CAAC,KAAKb,MAHT,CADF;;AAQA,WAAKyB,OAAL;AACD;;;SAOD,eAAc;AACZ,aAAO,KAAKxB,QAAZ;AACD,K;SAPD,aAAY2B,CAAZ,EAAe;AACb,WAAK3B,QAAL,GAAgB2B,CAAhB;;AACA,WAAKH,OAAL;AACD;;;WAyCD,6BAAoB;AAClB,WAAKA,OAAL;AACD;;;kDAlE6CI,W","sourcesContent":["import React from 'react';\nimport ReactDOM from 'react-dom';\nimport {\n ModelSetEvent,\n SessionChangedEvent\n} from '@pie-framework/pie-player-events';\nimport { renderMath } from '@pie-lib/math-rendering';\nimport InlineDropdown from './inline-dropdown';\n\nexport default class RootInlineDropdown extends HTMLElement {\n constructor() {\n super();\n this._model = null;\n this._session = null;\n }\n\n set model(m) {\n this._model = m;\n this.dispatchEvent(\n new ModelSetEvent(\n this.tagName.toLowerCase(),\n this.session && !!this.session.value,\n !!this._model\n )\n );\n\n this._render();\n }\n\n set session(s) {\n this._session = s;\n this._render();\n }\n\n get session() {\n return this._session;\n }\n\n _render = () => {\n if (this._model && this._session) {\n let elem = React.createElement(InlineDropdown, {\n prompt: this._model.prompt,\n rationale: this._model.rationale,\n teacherInstructions: this._model.teacherInstructions,\n disabled: this._model.disabled,\n markup: this._model.markup,\n mode: this._model.mode,\n choices: this._model.choices,\n value: this._session.value,\n feedback: this._model.feedback,\n onChange: this.changeSession\n });\n ReactDOM.render(elem, this, () => {\n renderMath(this);\n });\n }\n };\n\n dispatchChangedEvent = () => {\n this.dispatchEvent(\n new SessionChangedEvent(\n this.tagName.toLowerCase(),\n this.session && !!this.session.value\n )\n );\n };\n\n changeSession = value => {\n this.session.value = value;\n this.dispatchChangedEvent();\n this._render();\n };\n\n connectedCallback() {\n this._render();\n }\n}\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../src/index.js"],"names":["RootInlineDropdown","_model","_session","elem","React","createElement","InlineDropdown","prompt","rationale","teacherInstructions","disabled","displayType","markup","mode","choices","value","feedback","onChange","changeSession","ReactDOM","render","dispatchEvent","SessionChangedEvent","tagName","toLowerCase","session","dispatchChangedEvent","_render","m","ModelSetEvent","s","HTMLElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;IAEqBA,kB;;;;;AACnB,gCAAc;AAAA;;AAAA;AACZ;AADY,gGAwBJ,YAAM;AACd,UAAI,MAAKC,MAAL,IAAe,MAAKC,QAAxB,EAAkC;AAChC,YAAIC,IAAI,gBAAGC,kBAAMC,aAAN,CAAoBC,0BAApB,EAAoC;AAC7CC,UAAAA,MAAM,EAAE,MAAKN,MAAL,CAAYM,MADyB;AAE7CC,UAAAA,SAAS,EAAE,MAAKP,MAAL,CAAYO,SAFsB;AAG7CC,UAAAA,mBAAmB,EAAE,MAAKR,MAAL,CAAYQ,mBAHY;AAI7CC,UAAAA,QAAQ,EAAE,MAAKT,MAAL,CAAYS,QAJuB;AAK7CC,UAAAA,WAAW,EAAE,MAAKV,MAAL,CAAYU,WALoB;AAM7CC,UAAAA,MAAM,EAAE,MAAKX,MAAL,CAAYW,MANyB;AAO7CC,UAAAA,IAAI,EAAE,MAAKZ,MAAL,CAAYY,IAP2B;AAQ7CC,UAAAA,OAAO,EAAE,MAAKb,MAAL,CAAYa,OARwB;AAS7CC,UAAAA,KAAK,EAAE,MAAKb,QAAL,CAAca,KATwB;AAU7CC,UAAAA,QAAQ,EAAE,MAAKf,MAAL,CAAYe,QAVuB;AAW7CC,UAAAA,QAAQ,EAAE,MAAKC;AAX8B,SAApC,CAAX;;AAcAC,6BAASC,MAAT,CAAgBjB,IAAhB,kDAA4B,YAAM;AAChC;AACD,SAFD;AAGD;AACF,KA5Ca;AAAA,6GA8CS,YAAM;AAC3B,YAAKkB,aAAL,CAAmB,IAAIC,oCAAJ,CAAwB,MAAKC,OAAL,CAAaC,WAAb,EAAxB,EAAoD,MAAKC,OAAL,IAAgB,CAAC,CAAC,MAAKA,OAAL,CAAaV,KAAnF,CAAnB;AACD,KAhDa;AAAA,sGAkDE,UAACA,KAAD,EAAW;AACzB,YAAKU,OAAL,CAAaV,KAAb,GAAqBA,KAArB;;AACA,YAAKW,oBAAL;;AACA,YAAKC,OAAL;AACD,KAtDa;AAEZ,UAAK1B,MAAL,GAAc,IAAd;AACA,UAAKC,QAAL,GAAgB,IAAhB;AAHY;AAIb;;;;SAED,aAAU0B,CAAV,EAAa;AACX,WAAK3B,MAAL,GAAc2B,CAAd;AACA,WAAKP,aAAL,CACE,IAAIQ,8BAAJ,CAAkB,KAAKN,OAAL,CAAaC,WAAb,EAAlB,EAA8C,KAAKC,OAAL,IAAgB,CAAC,CAAC,KAAKA,OAAL,CAAaV,KAA7E,EAAoF,CAAC,CAAC,KAAKd,MAA3F,CADF;;AAIA,WAAK0B,OAAL;AACD;;;SAOD,eAAc;AACZ,aAAO,KAAKzB,QAAZ;AACD,K;SAPD,aAAY4B,CAAZ,EAAe;AACb,WAAK5B,QAAL,GAAgB4B,CAAhB;;AACA,WAAKH,OAAL;AACD;;;WAsCD,6BAAoB;AAClB,WAAKA,OAAL;AACD;;;kDA3D6CI,W","sourcesContent":["import React from 'react';\nimport ReactDOM from 'react-dom';\nimport { ModelSetEvent, SessionChangedEvent } from '@pie-framework/pie-player-events';\nimport { renderMath } from '@pie-lib/math-rendering';\nimport InlineDropdown from './inline-dropdown';\n\nexport default class RootInlineDropdown extends HTMLElement {\n constructor() {\n super();\n this._model = null;\n this._session = null;\n }\n\n set model(m) {\n this._model = m;\n this.dispatchEvent(\n new ModelSetEvent(this.tagName.toLowerCase(), this.session && !!this.session.value, !!this._model),\n );\n\n this._render();\n }\n\n set session(s) {\n this._session = s;\n this._render();\n }\n\n get session() {\n return this._session;\n }\n\n _render = () => {\n if (this._model && this._session) {\n let elem = React.createElement(InlineDropdown, {\n prompt: this._model.prompt,\n rationale: this._model.rationale,\n teacherInstructions: this._model.teacherInstructions,\n disabled: this._model.disabled,\n displayType: this._model.displayType,\n markup: this._model.markup,\n mode: this._model.mode,\n choices: this._model.choices,\n value: this._session.value,\n feedback: this._model.feedback,\n onChange: this.changeSession,\n });\n\n ReactDOM.render(elem, this, () => {\n renderMath(this);\n });\n }\n };\n\n dispatchChangedEvent = () => {\n this.dispatchEvent(new SessionChangedEvent(this.tagName.toLowerCase(), this.session && !!this.session.value));\n };\n\n changeSession = (value) => {\n this.session.value = value;\n this.dispatchChangedEvent();\n this._render();\n };\n\n connectedCallback() {\n this._render();\n }\n}\n"],"file":"index.js"}