@instructure/quiz-core 17.17.3-rc.0 → 17.17.4-rc.1

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 CHANGED
@@ -3,6 +3,14 @@
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
+ ## [17.17.3](https://gerrit.instructure.com/quizzes-ui/compare/v17.17.2...v17.17.3) (2021-10-06)
7
+
8
+ **Note:** Version bump only for package @instructure/quiz-core
9
+
10
+
11
+
12
+
13
+
6
14
  ## [17.17.2](https://gerrit.instructure.com/quizzes-ui/compare/v17.17.1...v17.17.2) (2021-09-22)
7
15
 
8
16
  **Note:** Version bump only for package @instructure/quiz-core
@@ -13,6 +13,7 @@ export function createStimulus(stimulus, parentId, parentType) {
13
13
  var resource = parentType === 'bank' ? 'banks' : 'quizzes';
14
14
  var url = "/api/".concat(resource, "/").concat(parentId, "/stimuli");
15
15
  var stimulusParams = {
16
+ orientation: stimulus.orientation,
16
17
  body: stimulus.body,
17
18
  instructions: stimulus.instructions,
18
19
  parent_stimulus_id: parentStimulusId,
@@ -48,6 +49,7 @@ export function updateStimulus(stimulus, parentId, parentType) {
48
49
  var resource = parentType === 'bank' ? 'banks' : 'quizzes';
49
50
  var url = "/api/".concat(resource, "/").concat(parentId, "/stimuli/").concat(stimulus.id);
50
51
  var stimulusData = {
52
+ orientation: stimulus.orientation,
51
53
  title: stimulus.title,
52
54
  instructions: stimulus.instructions,
53
55
  body: stimulus.body,
@@ -174,7 +174,7 @@ export var QuizEntry = (_dec = themeable(theme, styles), _dec(_class = (_temp =
174
174
  handleValidationErrorsFromApi: this.props.handleValidationErrorsFromApi,
175
175
  clearValidationErrorsFromApi: this.props.clearValidationErrorsFromApi,
176
176
  haveValidationErrorsFromApi: Boolean(Object.values(this.props.validationErrorsFromApi).length)
177
- }, pick(this.props, ['displayPosition', 'guid', 'draggingOnBuild', 'newHoverPosition', 'quizEntry', 'quizEntries', 'quizId', 'setUi', 'switchOffEditing', 'switchOnEditing', 'shouldClone', 'scrollKey', 'editQuizEntryToggle', 'onEditQuizEntryToggle']));
177
+ }, pick(this.props, ['displayPosition', 'guid', 'draggingOnBuild', 'newHoverPosition', 'quizEntry', 'quizEntries', 'quizId', 'setUi', 'switchOffEditing', 'switchOnEditing', 'shouldClone', 'scrollKey', 'editQuizEntryToggle', 'onEditQuizEntryToggle', 'stimulusOrientation']));
178
178
  }
179
179
  }, {
180
180
  key: "isEditing",
@@ -373,7 +373,8 @@ export var QuizEntry = (_dec = themeable(theme, styles), _dec(_class = (_temp =
373
373
  validationErrorsFromApi: PropTypes.objectOf(PropTypes.arrayOf(PropTypes.shape({
374
374
  type: PropTypes.string,
375
375
  text: PropTypes.string
376
- })))
376
+ }))),
377
+ stimulusOrientation: PropTypes.string
377
378
  }, _class2.defaultProps = {
378
379
  childEntries: List(),
379
380
  draggingAboveHalf: false,
@@ -386,6 +387,7 @@ export var QuizEntry = (_dec = themeable(theme, styles), _dec(_class = (_temp =
386
387
  shouldClone: false,
387
388
  tagAssociations: List(),
388
389
  useBankTags: false,
389
- validationErrorsFromApi: {}
390
+ validationErrorsFromApi: {},
391
+ stimulusOrientation: null
390
392
  }, _temp)) || _class);
391
393
  export default QuizEntry;
@@ -13,6 +13,7 @@ import { DragSource } from 'react-dnd';
13
13
  import { IconBankLine } from '@instructure/ui-icons';
14
14
  import { ScreenReaderContent } from '@instructure/ui-a11y-content';
15
15
  import { themeable } from '@instructure/ui-themeable';
16
+ import { TOP } from '@instructure/quiz-common';
16
17
  import t from '@instructure/quiz-i18n/es/format-message';
17
18
  import Item from "../../../../../common/records/Item.js";
18
19
  import Overlay from "../../../../../common/components/shared/overlay/Overlay.js";
@@ -21,22 +22,23 @@ import { ItemTypes, dragSource, collectDrag } from "../../../../../common/compon
21
22
  import PositionBox from "../../../../../common/components/resources/positionBox/PositionBox.js";
22
23
  import DragAndDropZone from "../../../../../common/components/shared/drag_and_drop/DragAndDropZone/index.js";
23
24
  var styles = {
24
- componentId: 'cAGiw',
25
+ componentId: 'fohHO',
25
26
  template: function template(theme) {
26
- return "\n\n.cAGiw_eLmg{transform:translateZ(0)}\n\n.cAGiw_TMNr{background-color:".concat(theme.quizEntryShowBackgroundColor || 'inherit', ";padding:").concat(theme.quizEntryShowPadding || 'inherit', "}\n\n.cAGiw_fsuY{align-items:stretch;display:flex;flex-direction:row;flex-wrap:nowrap;height:").concat(theme.headerHeight || 'inherit', ";padding-right:").concat(theme.headerRightPadding || 'inherit', "}\n\n.cAGiw_bscQ{border:").concat(theme.dndBorder || 'inherit', "}\n\n.cAGiw_cKlw{align-items:center;display:inline-flex;flex:8 0 0;overflow:hidden}\n\n.cAGiw_IoDT{color:").concat(theme.rightHeaderColor || 'inherit', ";display:inline-flex;flex:0 0 auto;text-align:right;z-index:").concat(theme.rightHeaderZIndex || 'inherit', "}\n\n[dir=ltr] .cAGiw_IoDT,[dir=rtl] .cAGiw_IoDT{text-align:right}\n\n.cAGiw_IoDT button{background-color:transparent;background-color:initial}\n\n.cAGiw_eCZW,.cAGiw_cwte,.cAGiw_nvdO{color:").concat(theme.titleInteractionTypeNamePointsColor || 'inherit', ";font-size:").concat(theme.titleInteractionTypeNamePointsFontSize || 'inherit', ";margin-left:").concat(theme.titleInteractionTypeNamePointsLeftMargin || 'inherit', ";margin-right:").concat(theme.titleInteractionTypeNamePointsRightMargin || 'inherit', ";overflow:hidden;text-overflow:ellipsis;white-space:nowrap}\n\n.cAGiw_csjx{margin:").concat(theme.itemHolderMargin || 'inherit', "}\n\n.cAGiw_fPOQ,.cAGiw_gaTA{background-color:transparent;border:none;color:inherit;font-size:").concat(theme.optionsButtonDragDropHandleFontSize || 'inherit', ";margin:").concat(theme.optionsButtonDragDropHandleMargin || 'inherit', "}\n\n.cAGiw_gaTA{cursor:pointer}\n\n@media print{.cAGiw_eLmg{page-break-inside:avoid}}");
27
+ return "\n\n.fohHO_eLmg{transform:translateZ(0)}\n\n.fohHO_TMNr{background-color:".concat(theme.quizEntryShowBackgroundColor || 'inherit', ";padding:").concat(theme.quizEntryShowPadding || 'inherit', "}\n\n.fohHO_fsuY{align-items:stretch;display:flex;flex-direction:row;flex-wrap:nowrap;height:").concat(theme.headerHeight || 'inherit', ";padding-right:").concat(theme.headerRightPadding || 'inherit', "}\n\n.fohHO_bscQ{border:").concat(theme.dndBorder || 'inherit', "}\n\n.fohHO_cKlw{align-items:center;display:inline-flex;flex:8 0 0;overflow:hidden}\n\n.fohHO_eGWt{border-bottom:").concat(theme.phoneConnectingLinesBorderWidth || 'inherit', " dotted;border-color:").concat(theme.phoneConnectingLinesBorderColor || 'inherit', ";border-left:").concat(theme.phoneConnectingLinesBorderWidth || 'inherit', " dotted;height:2rem;margin-right:1.2rem;margin-top:-0.8rem;width:1.2rem}\n\n.fohHO_eGWt,.fohHO_IoDT{display:inline-flex;flex:0 0 auto}\n\n.fohHO_IoDT{color:").concat(theme.rightHeaderColor || 'inherit', ";text-align:right;z-index:").concat(theme.rightHeaderZIndex || 'inherit', "}\n\n[dir=ltr] .fohHO_IoDT,[dir=rtl] .fohHO_IoDT{text-align:right}\n\n.fohHO_IoDT button{background-color:transparent;background-color:initial}\n\n.fohHO_eCZW,.fohHO_cwte,.fohHO_nvdO{color:").concat(theme.titleInteractionTypeNamePointsColor || 'inherit', ";font-size:").concat(theme.titleInteractionTypeNamePointsFontSize || 'inherit', ";margin-left:").concat(theme.titleInteractionTypeNamePointsLeftMargin || 'inherit', ";margin-right:").concat(theme.titleInteractionTypeNamePointsRightMargin || 'inherit', ";overflow:hidden;text-overflow:ellipsis;white-space:nowrap}\n\n.fohHO_csjx{margin:").concat(theme.itemHolderMargin || 'inherit', "}\n\n.fohHO_fPOQ,.fohHO_gaTA{background-color:transparent;border:none;color:inherit;font-size:").concat(theme.optionsButtonDragDropHandleFontSize || 'inherit', ";margin:").concat(theme.optionsButtonDragDropHandleMargin || 'inherit', "}\n\n.fohHO_gaTA{cursor:pointer}\n\n@media print{.fohHO_eLmg{page-break-inside:avoid}}");
27
28
  },
28
- 'quizEntryWrapper': 'cAGiw_eLmg',
29
- 'quizEntryShow': 'cAGiw_TMNr',
30
- 'header': 'cAGiw_fsuY',
31
- 'dndBorder': 'cAGiw_bscQ',
32
- 'leftHeader': 'cAGiw_cKlw',
33
- 'rightHeader': 'cAGiw_IoDT',
34
- 'interactionTypeName': 'cAGiw_eCZW',
35
- 'points': 'cAGiw_cwte',
36
- 'title': 'cAGiw_nvdO',
37
- 'itemHolder': 'cAGiw_csjx',
38
- 'dragAndDropHandle': 'cAGiw_fPOQ',
39
- 'optionsButton': 'cAGiw_gaTA'
29
+ 'quizEntryWrapper': 'fohHO_eLmg',
30
+ 'quizEntryShow': 'fohHO_TMNr',
31
+ 'header': 'fohHO_fsuY',
32
+ 'dndBorder': 'fohHO_bscQ',
33
+ 'leftHeader': 'fohHO_cKlw',
34
+ 'connectingLines': 'fohHO_eGWt',
35
+ 'rightHeader': 'fohHO_IoDT',
36
+ 'interactionTypeName': 'fohHO_eCZW',
37
+ 'points': 'fohHO_cwte',
38
+ 'title': 'fohHO_nvdO',
39
+ 'itemHolder': 'fohHO_csjx',
40
+ 'dragAndDropHandle': 'fohHO_fPOQ',
41
+ 'optionsButton': 'fohHO_gaTA'
40
42
  };
41
43
  import theme from "./theme.js";
42
44
 
@@ -251,7 +253,9 @@ var QuizEntryShow = (_dec = themeable(theme, styles), _dec(_class = (_temp = _cl
251
253
  connectDragPreview = _this$props2.connectDragPreview,
252
254
  displayPosition = _this$props2.displayPosition,
253
255
  draggingOver = _this$props2.draggingOver,
254
- draggingAboveHalf = _this$props2.draggingAboveHalf;
256
+ draggingAboveHalf = _this$props2.draggingAboveHalf,
257
+ quizEntry = _this$props2.quizEntry,
258
+ stimulusOrientation = _this$props2.stimulusOrientation;
255
259
  var positionToDisplay = this.props.quizEntry.positionToDisplay(displayPosition);
256
260
  var positionText = t('Preview of item at position {position}', {
257
261
  position: positionToDisplay
@@ -275,7 +279,9 @@ var QuizEntryShow = (_dec = themeable(theme, styles), _dec(_class = (_temp = _cl
275
279
  "data-automation-item-id": this.props.quizEntry.id
276
280
  }, /*#__PURE__*/React.createElement("div", {
277
281
  className: styles.header
278
- }, /*#__PURE__*/React.createElement(PositionBox, {
282
+ }, quizEntry.isInStimulus && stimulusOrientation === TOP && /*#__PURE__*/React.createElement("div", {
283
+ className: styles.connectingLines
284
+ }), /*#__PURE__*/React.createElement(PositionBox, {
279
285
  position: positionToDisplay,
280
286
  headingText: positionText
281
287
  }), this.renderLeftHeader(), /*#__PURE__*/React.createElement(ActionButtons, {
@@ -328,7 +334,8 @@ var QuizEntryShow = (_dec = themeable(theme, styles), _dec(_class = (_temp = _cl
328
334
  editQuizEntryToggle: PropTypes.bool.isRequired,
329
335
  haveValidationErrorsFromApi: PropTypes.bool,
330
336
  // only used in index.js
331
- interactionTypeName: PropTypes.string
337
+ interactionTypeName: PropTypes.string,
338
+ stimulusOrientation: PropTypes.string
332
339
  }, _class2.defaultProps = {
333
340
  children: null,
334
341
  draggingOver: false,
@@ -337,7 +344,8 @@ var QuizEntryShow = (_dec = themeable(theme, styles), _dec(_class = (_temp = _cl
337
344
  scrollKey: void 0,
338
345
  editQuizEntryToggle: false,
339
346
  haveValidationErrorsFromApi: false,
340
- interactionTypeName: null
347
+ interactionTypeName: null,
348
+ stimulusOrientation: null
341
349
  }, _temp)) || _class);
342
350
  export var QuizEntryShowRaw = QuizEntryShow;
343
351
  export var QuizEntryShowPresenter = DragSource(ItemTypes.QUIZ_ENTRY, dragSource, collectDrag)(QuizEntryShow);
@@ -2,7 +2,8 @@ export default function generator(_ref) {
2
2
  var spacing = _ref.spacing,
3
3
  colors = _ref.colors,
4
4
  typography = _ref.typography,
5
- borders = _ref.borders;
5
+ borders = _ref.borders,
6
+ breakpoints = _ref.breakpoints;
6
7
  return {
7
8
  quizEntryShowPadding: "".concat(spacing.large, " ").concat(spacing.small),
8
9
  quizEntryShowBackgroundColor: colors.white,
@@ -17,6 +18,9 @@ export default function generator(_ref) {
17
18
  titleInteractionTypeNamePointsRightMargin: spacing.xSmall,
18
19
  itemHolderMargin: spacing.xSmall,
19
20
  optionsButtonDragDropHandleFontSize: typography.fontSizeMedium,
20
- optionsButtonDragDropHandleMargin: spacing.xSmall
21
+ optionsButtonDragDropHandleMargin: spacing.xSmall,
22
+ phoneConnectingLinesBorderWidth: borders.widthSmall,
23
+ phoneConnectingLinesBorderColor: colors.ash,
24
+ phoneBreakPoint: "max-width: ".concat(breakpoints.medium)
21
25
  };
22
26
  }
@@ -14,7 +14,7 @@ export default function generator(_ref) {
14
14
  newItemButtonFocusOutline: "2px solid ".concat(colors.brand),
15
15
  newItemButtonFontSize: typography.fontSizeMedium,
16
16
  newItemButtonFontWeight: typography.fontWeightBold,
17
- newItemButtonZIndex: '2222',
17
+ newItemButtonZIndex: '4444',
18
18
  newItemButtonBoxShadow: '2px 2px 3px #ddd',
19
19
  newItemButtonEditingBackgroundColor: colors.crimson,
20
20
  newItemButtonHolderZIndex: '2222',
@@ -2,6 +2,7 @@ import { bindActionCreators } from 'redux';
2
2
  import { connect } from "../../../../react-redux.js";
3
3
  import { openDeleteStimulusModal } from "../../../../actions/modal.js";
4
4
  import { set } from "../../../../actions/ui.js";
5
+ import { featureOn } from "../../../../../common/util/featureCheck.js";
5
6
  import WrappedStimulus from "./presenter.js";
6
7
 
7
8
  var mapStateToProps = function mapStateToProps(state, props) {
@@ -13,7 +14,8 @@ var mapStateToProps = function mapStateToProps(state, props) {
13
14
  childEntries: props.quizEntry.getNestedEntries(),
14
15
  dropIntoEmptyStimulus: draggingOver && dropIntoEmptyStimulus,
15
16
  draggingOver: draggingOver,
16
- draggingAboveHalf: draggingOver && draggingAboveHalf
17
+ draggingAboveHalf: draggingOver && draggingAboveHalf,
18
+ stimulusOrientationEnabled: featureOn('customizable_stimulus_orientation')
17
19
  };
18
20
  };
19
21
 
@@ -19,20 +19,21 @@ import StimulusShow from "../StimulusShow/index.js";
19
19
  import DragAndDropZone from "../../../shared/drag_and_drop/DragAndDropZone/index.js";
20
20
  import { ItemTypes, dragSource, collectDrag } from "../../../../../common/components/shared/drag_and_drop/dragAndDropUtils.js";
21
21
  import wrapWithOutsideClick from "../../../shared/functionality/componentWithOutsideClick.js";
22
- import { DELETE_STIMULUS_DATA } from '@instructure/quiz-common';
22
+ import { DELETE_STIMULUS_DATA, LEFT } from '@instructure/quiz-common';
23
23
  import ConnectedQuizEntry from "../../../../../building/components/resources/quizEntry/QuizEntry/index.js";
24
24
  var styles = {
25
- componentId: 'fsSBy',
25
+ componentId: 'fEUId',
26
26
  template: function template(theme) {
27
- return "\n\n.fsSBy_dRGY{display:flex}\n\n.fsSBy_cZDz{border-right:".concat(theme.leftPanelBorderWidth || 'inherit', " solid ").concat(theme.leftPanelBorderColor || 'inherit', "}\n\n.fsSBy_cZDz,.fsSBy_AmHx{box-sizing:border-box;max-height:90vh;overflow:auto;width:50%}\n\n.fsSBy_AmHx{margin-left:calc(").concat(theme.rightPanelPadding || 'inherit', "*-1);padding-left:").concat(theme.rightPanelPadding || 'inherit', "}\n\n.fsSBy_duqv{display:none}\n\n.fsSBy_ehcZ{transform:translateZ(0)}\n\n.fsSBy_fPOQ{background-color:transparent;border:none;color:inherit;cursor:move;font-size:").concat(theme.dragAndDropHandleFontSize || 'inherit', ";height:0;margin:").concat(theme.dragAndDropHandleMargin || 'inherit', ";margin-top:0;position:relative;z-index:").concat(theme.dragAndDropHandleZIndex || 'inherit', "}\n\n.fsSBy_eLmg{width:100%}\n\n@media print{.fsSBy_cZDz,.fsSBy_AmHx{max-height:none}}");
27
+ return "\n\n.fEUId_dRGY{display:flex}\n\n.fEUId_cZDz{border-right:".concat(theme.leftPanelBorderWidth || 'inherit', " solid ").concat(theme.leftPanelBorderColor || 'inherit', "}\n\n.fEUId_cZDz,.fEUId_AmHx{box-sizing:border-box;max-height:105vh;overflow:auto}\n\n.fEUId_AmHx{margin-left:calc(").concat(theme.rightPanelPadding || 'inherit', "*-1);padding-left:").concat(theme.rightPanelPadding || 'inherit', "}\n\n.fEUId_duqv{display:none}\n\n.fEUId_ehcZ{transform:translateZ(0)}\n\n.fEUId_fPOQ{background-color:transparent;border:none;color:inherit;cursor:move;font-size:").concat(theme.dragAndDropHandleFontSize || 'inherit', ";height:0;margin:").concat(theme.dragAndDropHandleMargin || 'inherit', ";margin-top:0;position:relative;z-index:").concat(theme.dragAndDropHandleZIndex || 'inherit', "}\n\n.fEUId_eLmg{width:100%}\n\n.fEUId_dORw{width:50%}\n\n@media print{.fEUId_cZDz,.fEUId_AmHx{max-height:none}}");
28
28
  },
29
- 'stimulus': 'fsSBy_dRGY',
30
- 'leftPanel': 'fsSBy_cZDz',
31
- 'rightPanel': 'fsSBy_AmHx',
32
- 'hidden': 'fsSBy_duqv',
33
- 'stimulusWrapper': 'fsSBy_ehcZ',
34
- 'dragAndDropHandle': 'fsSBy_fPOQ',
35
- 'quizEntryWrapper': 'fsSBy_eLmg'
29
+ 'stimulus': 'fEUId_dRGY',
30
+ 'leftPanel': 'fEUId_cZDz',
31
+ 'rightPanel': 'fEUId_AmHx',
32
+ 'hidden': 'fEUId_duqv',
33
+ 'stimulusWrapper': 'fEUId_ehcZ',
34
+ 'dragAndDropHandle': 'fEUId_fPOQ',
35
+ 'quizEntryWrapper': 'fEUId_eLmg',
36
+ 'horizontallyAligned': 'fEUId_dORw'
36
37
  };
37
38
  import theme from "./theme.js";
38
39
  export var Stimulus = (_dec = themeable(theme, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
@@ -86,7 +87,9 @@ export var Stimulus = (_dec = themeable(theme, styles), _dec(_class = (_temp = _
86
87
  return /*#__PURE__*/React.createElement("div", {
87
88
  className: styles.quizEntryWrapper,
88
89
  key: childEntry.id
89
- }, /*#__PURE__*/React.createElement(ConnectedQuizEntry, _this2.props.propsForQuizEntry(childEntry, displayPosition)), !_this2.props.draggingOnBuild && /*#__PURE__*/React.createElement(AddContentPopover, {
90
+ }, /*#__PURE__*/React.createElement(ConnectedQuizEntry, Object.assign({}, _this2.props.propsForQuizEntry(childEntry, displayPosition), {
91
+ stimulusOrientation: _this2.props.stimulusOrientationEnabled ? _this2.props.stimulus.orientation : null
92
+ })), !_this2.props.draggingOnBuild && /*#__PURE__*/React.createElement(AddContentPopover, {
90
93
  allowStimulusCreation: false,
91
94
  stimulusId: _this2.props.stimulus.id,
92
95
  parentEntryId: _this2.props.quizEntry.id,
@@ -97,8 +100,8 @@ export var Stimulus = (_dec = themeable(theme, styles), _dec(_class = (_temp = _
97
100
  });
98
101
  }
99
102
  }, {
100
- key: "renderLeftPanel",
101
- value: function renderLeftPanel() {
103
+ key: "renderStimulusPanel",
104
+ value: function renderStimulusPanel() {
102
105
  var StimulusComponent = this.props.isEditing ? StimulusEdit : StimulusShow;
103
106
  var connectDragPreview = this.props.connectDragPreview;
104
107
  return connectDragPreview( /*#__PURE__*/React.createElement("div", {
@@ -126,18 +129,22 @@ export var Stimulus = (_dec = themeable(theme, styles), _dec(_class = (_temp = _
126
129
  }, {
127
130
  key: "renderPanels",
128
131
  value: function renderPanels(propsForDnDZone) {
129
- var _classnames;
132
+ var _classnames2;
130
133
 
131
- var stimulus = this.props.stimulus;
132
- var rightPanelClass = classnames((_classnames = {}, _defineProperty(_classnames, styles.hidden, stimulus.isTemporary()), _defineProperty(_classnames, styles.rightPanel, !stimulus.isTemporary()), _classnames));
134
+ var _this$props2 = this.props,
135
+ stimulus = _this$props2.stimulus,
136
+ stimulusOrientationEnabled = _this$props2.stimulusOrientationEnabled;
137
+ var shouldSetHorizontalOrientation = stimulus.orientation === LEFT || !stimulusOrientationEnabled;
138
+ var stimulusPanelClass = classnames(styles.leftPanel, _defineProperty({}, styles.horizontallyAligned, shouldSetHorizontalOrientation));
139
+ var itemsPanelClass = classnames((_classnames2 = {}, _defineProperty(_classnames2, styles.horizontallyAligned, shouldSetHorizontalOrientation), _defineProperty(_classnames2, styles.hidden, stimulus.isTemporary()), _defineProperty(_classnames2, styles.rightPanel, !stimulus.isTemporary()), _classnames2));
133
140
  return /*#__PURE__*/React.createElement("div", {
134
- className: styles.stimulus,
141
+ className: classnames(_defineProperty({}, styles.stimulus, shouldSetHorizontalOrientation)),
135
142
  ref: this.props.dndRef,
136
143
  "data-automation": "sdk-stimulus"
137
144
  }, /*#__PURE__*/React.createElement("div", {
138
- className: styles.leftPanel
139
- }, this.renderLeftPanel()), /*#__PURE__*/React.createElement("div", {
140
- className: rightPanelClass
145
+ className: stimulusPanelClass
146
+ }, this.renderStimulusPanel()), /*#__PURE__*/React.createElement("div", {
147
+ className: itemsPanelClass
141
148
  }, /*#__PURE__*/React.createElement("div", null), this.renderChildQuizEntries(), /*#__PURE__*/React.createElement(DragAndDropZone, Object.assign({}, propsForDnDZone, {
142
149
  location: "in"
143
150
  })), this.props.childEntries.size === 0 && /*#__PURE__*/React.createElement(AddContentPopover, {
@@ -196,7 +203,8 @@ export var Stimulus = (_dec = themeable(theme, styles), _dec(_class = (_temp = _
196
203
  switchOnEditing: PropTypes.func.isRequired,
197
204
  switchOffEditing: PropTypes.func.isRequired,
198
205
  onEditStimulusToggle: PropTypes.func.isRequired,
199
- editStimulusToggle: PropTypes.bool.isRequired
206
+ editStimulusToggle: PropTypes.bool.isRequired,
207
+ stimulusOrientationEnabled: PropTypes.bool.isRequired
200
208
  }, _class2.defaultProps = {
201
209
  bankEntryWarningWrapperProps: function bankEntryWarningWrapperProps() {},
202
210
  childEntries: List([]),
@@ -1,12 +1,14 @@
1
1
  import { bindActionCreators } from 'redux';
2
2
  import { connect } from "../../../../react-redux.js";
3
3
  import * as modificationActions from "../../../../actions/modifications.js";
4
+ import { featureOn } from "../../../../../common/util/featureCheck.js";
4
5
  import StimulusEditInfo from "./presenter.js";
5
6
 
6
7
  function mapStateToProps(state, props) {
7
8
  return {
8
9
  workingStimulus: props.stimulus.getWorkingInstance(),
9
- errorsShowing: state.getIn(['errorsShowing', props.guid], props.errorsShowing || false)
10
+ errorsShowing: state.getIn(['errorsShowing', props.guid], props.errorsShowing || false),
11
+ stimulusOrientationEnabled: featureOn('customizable_stimulus_orientation')
10
12
  };
11
13
  }
12
14
 
@@ -17,6 +17,10 @@ import { Heading } from '@instructure/ui-heading';
17
17
  import RichContentInput from "../../../RichContentInput/index.js";
18
18
  import { toErrors } from "../../../../util/instUIMessages.js";
19
19
  import Errors from "../../../shared/errors/Errors.js";
20
+ import { SimpleSelect } from '@instructure/ui-simple-select';
21
+ import { IconUpdownLine } from '@instructure/ui-icons';
22
+ import { ToggleDetails } from '@instructure/ui-toggle-details';
23
+ import { TOP } from '@instructure/quiz-common';
20
24
  import t from '@instructure/quiz-i18n/es/format-message';
21
25
  var styles = {
22
26
  componentId: 'doNBF',
@@ -27,6 +31,13 @@ var styles = {
27
31
  'optionalLabel': 'doNBF_fvFs'
28
32
  };
29
33
  import theme from "./theme.js";
34
+
35
+ var _ref3 = /*#__PURE__*/React.createElement(IconUpdownLine, {
36
+ rotate: "90"
37
+ });
38
+
39
+ var _ref4 = /*#__PURE__*/React.createElement(IconUpdownLine, null);
40
+
30
41
  export var StimulusEditInfo = (_dec = themeable(theme, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
31
42
  _inherits(StimulusEditInfo, _Component);
32
43
 
@@ -50,6 +61,14 @@ export var StimulusEditInfo = (_dec = themeable(theme, styles), _dec(_class = (_
50
61
  }
51
62
  };
52
63
 
64
+ _this.onOrientationChange = function (e, _ref) {
65
+ var value = _ref.value;
66
+
67
+ var newData = _this.props.workingStimulus.set('orientation', value);
68
+
69
+ _this.props.modifyStimulus(newData);
70
+ };
71
+
53
72
  _this.onTextInputChange = function (field) {
54
73
  return function (e) {
55
74
  var newData = _this.props.workingStimulus.set(field, e.target.value);
@@ -58,8 +77,8 @@ export var StimulusEditInfo = (_dec = themeable(theme, styles), _dec(_class = (_
58
77
  };
59
78
  };
60
79
 
61
- _this.onBodyChange = function (e, _ref) {
62
- var editorContent = _ref.editorContent;
80
+ _this.onBodyChange = function (e, _ref2) {
81
+ var editorContent = _ref2.editorContent;
63
82
 
64
83
  var newData = _this.props.workingStimulus.set('body', editorContent);
65
84
 
@@ -98,6 +117,29 @@ export var StimulusEditInfo = (_dec = themeable(theme, styles), _dec(_class = (_
98
117
  className: styles.optionalLabel
99
118
  }, optionalText));
100
119
  }
120
+ }, {
121
+ key: "renderStimulusOrientationSelect",
122
+ value: function renderStimulusOrientationSelect() {
123
+ var stimulusOrientation = this.props.workingStimulus.get('orientation');
124
+ return /*#__PURE__*/React.createElement("div", {
125
+ className: styles.section
126
+ }, /*#__PURE__*/React.createElement(SimpleSelect, {
127
+ renderLabel: t('Orientation'),
128
+ onChange: this.onOrientationChange,
129
+ value: stimulusOrientation,
130
+ renderBeforeInput: /*#__PURE__*/React.createElement(IconUpdownLine, {
131
+ rotate: stimulusOrientation === TOP ? '0' : '90'
132
+ })
133
+ }, /*#__PURE__*/React.createElement(SimpleSelect.Option, {
134
+ renderBeforeLabel: _ref3,
135
+ id: "stimulus-orientation-select-option-left",
136
+ value: "left"
137
+ }, t('Questions to the right')), /*#__PURE__*/React.createElement(SimpleSelect.Option, {
138
+ renderBeforeLabel: _ref4,
139
+ id: "stimulus-orientation-select-option-top",
140
+ value: "top"
141
+ }, t('Questions below'))));
142
+ }
101
143
  }, {
102
144
  key: "render",
103
145
  value: function render() {
@@ -137,12 +179,19 @@ export var StimulusEditInfo = (_dec = themeable(theme, styles), _dec(_class = (_
137
179
  errorList: this.errorsList('body')
138
180
  })), /*#__PURE__*/React.createElement("div", {
139
181
  className: styles.section
182
+ }, /*#__PURE__*/React.createElement(ToggleDetails, {
183
+ defaultExpanded: true,
184
+ variant: "filled",
185
+ key: "options",
186
+ summary: t('Options')
187
+ }, this.props.stimulusOrientationEnabled ? this.renderStimulusOrientationSelect() : null, /*#__PURE__*/React.createElement("div", {
188
+ className: styles.section
140
189
  }, /*#__PURE__*/React.createElement(TextInput, {
141
190
  renderLabel: this.renderOptionalLabel(t('Source URL'), t('(optional - not visible to students)')),
142
191
  type: "text",
143
192
  onChange: this.onTextInputChange('sourceUrl'),
144
193
  value: stimulus.get('sourceUrl')
145
- })));
194
+ })))));
146
195
  }
147
196
  }]);
148
197
 
@@ -156,7 +205,8 @@ export var StimulusEditInfo = (_dec = themeable(theme, styles), _dec(_class = (_
156
205
  modifyStimulus: PropTypes.func.isRequired,
157
206
  parentId: PropTypes.string.isRequired,
158
207
  parentType: PropTypes.string.isRequired,
159
- setTitleRef: PropTypes.func
208
+ setTitleRef: PropTypes.func,
209
+ stimulusOrientationEnabled: PropTypes.bool.isRequired
160
210
  }, _class2.defaultProps = {
161
211
  isBankedContent: false,
162
212
  setTitleRef: function setTitleRef() {}
@@ -75,6 +75,7 @@ export var Stimulus = /*#__PURE__*/function (_ReduxRecord) {
75
75
  instructions: '',
76
76
  body: '',
77
77
  sourceUrl: '',
78
- status: 'mutable'
78
+ status: 'mutable',
79
+ orientation: 'left'
79
80
  }));
80
81
  export default Stimulus;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/quiz-core",
3
- "version": "17.17.3-rc.0+18853503d",
3
+ "version": "17.17.4-rc.1+fcf2046a3",
4
4
  "license": "MIT",
5
5
  "description": "The Quiz React SDK by Instructure Inc.",
6
6
  "author": "Instructure, Inc. Engineering and Product Design",
@@ -40,12 +40,12 @@
40
40
  "lib"
41
41
  ],
42
42
  "dependencies": {
43
- "@instructure/outcomes-ui": "^1.1.11",
44
- "@instructure/quiz-common": "17.17.3-rc.0+18853503d",
45
- "@instructure/quiz-i18n": "17.17.3-rc.0+18853503d",
46
- "@instructure/quiz-interactions": "17.17.3-rc.0+18853503d",
47
- "@instructure/quiz-number-input": "17.17.3-rc.0+18853503d",
48
- "@instructure/quiz-rce": "17.17.3-rc.0+18853503d",
43
+ "@instructure/outcomes-ui": "^2.0.0",
44
+ "@instructure/quiz-common": "17.17.4-rc.1+fcf2046a3",
45
+ "@instructure/quiz-i18n": "17.17.4-rc.1+fcf2046a3",
46
+ "@instructure/quiz-interactions": "17.17.4-rc.1+fcf2046a3",
47
+ "@instructure/quiz-number-input": "17.17.4-rc.1+fcf2046a3",
48
+ "@instructure/quiz-rce": "17.17.4-rc.1+fcf2046a3",
49
49
  "@instructure/ui-a11y-content": "^7.11.0",
50
50
  "@instructure/ui-alerts": "^7.11.0",
51
51
  "@instructure/ui-avatar": "^7.11.0",
@@ -106,7 +106,7 @@
106
106
  "eventemitter3": "^3.1.0",
107
107
  "humps": "^2.0.0",
108
108
  "immutable": "^3.8.1",
109
- "instructure-validations": "17.17.3-rc.0+18853503d",
109
+ "instructure-validations": "17.17.4-rc.1+fcf2046a3",
110
110
  "ipaddr.js": "^1.5.4",
111
111
  "isomorphic-fetch": "^2.2.0",
112
112
  "isuuid": "^0.1.0",
@@ -137,7 +137,7 @@
137
137
  "uuid": "^3.2.1"
138
138
  },
139
139
  "devDependencies": {
140
- "@instructure/quiz-scripts": "17.17.3-rc.0+18853503d",
140
+ "@instructure/quiz-scripts": "17.17.4-rc.1+fcf2046a3",
141
141
  "@instructure/ui-axe-check": "^7.11.0",
142
142
  "@instructure/ui-babel-preset": "^7.11.0",
143
143
  "@instructure/ui-karma-config": "^7.11.0",
@@ -156,7 +156,7 @@
156
156
  "intl": "^1.2.4",
157
157
  "jquery": "^2.2.3",
158
158
  "most-subject": "^5.3.0",
159
- "quiz-presets": "17.17.3-rc.0+18853503d",
159
+ "quiz-presets": "17.17.4-rc.1+fcf2046a3",
160
160
  "react": "^16.8.6",
161
161
  "react-addons-test-utils": "^15.6.2",
162
162
  "react-dom": "^16.8.6",
@@ -172,5 +172,5 @@
172
172
  "publishConfig": {
173
173
  "access": "public"
174
174
  },
175
- "gitHead": "18853503d243825abe0984367e2201d7c71af822"
175
+ "gitHead": "fcf2046a3612c26ef19c93fd0a3007f34ecccf7d"
176
176
  }