case-editor-tools 1.0.0-beta.14 → 1.0.0-beta.18

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.
@@ -1 +1 @@
1
- {"version":3,"file":"survey-items.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"survey-items.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -11,11 +11,10 @@ interface OptionProps {
11
11
  displayCondition?: Expression;
12
12
  }
13
13
  interface OptionTextProps extends CommonProps {
14
- key: string;
15
14
  className?: string;
16
15
  }
17
16
  export declare const SingleChoiceOptionTypes: {
18
- option: (key: string, content: Map<string, string> | StyledTextComponentProp[], extraProps: OptionProps) => OptionDef;
17
+ option: (key: string, content: Map<string, string> | StyledTextComponentProp[], extraProps?: OptionProps | undefined) => OptionDef;
19
18
  textInput: (props: TextInputProps & {
20
19
  key: string;
21
20
  displayCondition?: Expression;
@@ -30,7 +29,7 @@ export declare const SingleChoiceOptionTypes: {
30
29
  }) => OptionDef;
31
30
  };
32
31
  export declare const MultipleChoiceOptionTypes: {
33
- option: (key: string, content: Map<string, string> | StyledTextComponentProp[], extraProps: OptionProps) => OptionDef;
32
+ option: (key: string, content: Map<string, string> | StyledTextComponentProp[], extraProps?: OptionProps | undefined) => OptionDef;
34
33
  subtitle: (props: OptionTextProps) => OptionDef;
35
34
  textInput: (props: TextInputProps & {
36
35
  key: string;
@@ -56,6 +55,7 @@ export declare const ClozeItemTypes: {
56
55
  key: string;
57
56
  displayCondition?: Expression;
58
57
  }) => OptionDef;
58
+ clozeLineBreak: () => OptionDef;
59
59
  numberInput: (props: NumericInputProps & {
60
60
  key: string;
61
61
  displayCondition?: Expression;
@@ -3,13 +3,14 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var surveys_surveyEngineExpressions = require('../survey-engine-expressions.js');
6
+ var surveys_utils_randomKeyGenerator = require('./randomKeyGenerator.js');
6
7
  require('../../constants/key-definitions.js');
7
8
  require('../../types/duration.js');
8
9
  require('../../expression-utils/expressionGen.js');
9
10
 
10
11
  const option = (key, content, extraProps) => {
11
12
  const styles = [];
12
- if (extraProps.className !== undefined) {
13
+ if ((extraProps === null || extraProps === void 0 ? void 0 : extraProps.className) !== undefined) {
13
14
  styles.push({
14
15
  key: 'className', value: extraProps.className
15
16
  });
@@ -19,8 +20,8 @@ const option = (key, content, extraProps) => {
19
20
  role: 'option',
20
21
  content: !Array.isArray(content) ? content : undefined,
21
22
  items: Array.isArray(content) ? content : undefined,
22
- displayCondition: extraProps.displayCondition,
23
- disabled: extraProps.disabled,
23
+ displayCondition: extraProps === null || extraProps === void 0 ? void 0 : extraProps.displayCondition,
24
+ disabled: extraProps === null || extraProps === void 0 ? void 0 : extraProps.disabled,
24
25
  style: styles,
25
26
  };
26
27
  };
@@ -32,7 +33,7 @@ const multipleChoiceOptionSubtitle = (props) => {
32
33
  });
33
34
  }
34
35
  return {
35
- key: props.key,
36
+ key: props.key ? props.key : surveys_utils_randomKeyGenerator.generateRandomKey(6),
36
37
  role: 'text',
37
38
  content: !Array.isArray(props.content) ? props.content : undefined,
38
39
  displayCondition: props.displayCondition,
@@ -47,7 +48,7 @@ const markdown = (props) => {
47
48
  });
48
49
  }
49
50
  return {
50
- key: props.key,
51
+ key: props.key ? props.key : surveys_utils_randomKeyGenerator.generateRandomKey(6),
51
52
  role: 'markdown',
52
53
  content: !Array.isArray(props.content) ? props.content : undefined,
53
54
  displayCondition: props.displayCondition,
@@ -131,6 +132,12 @@ const cloze = (props) => {
131
132
  displayCondition: props.displayCondition,
132
133
  };
133
134
  };
135
+ const clozeLineBreak = () => {
136
+ return {
137
+ key: surveys_utils_randomKeyGenerator.generateRandomKey(5),
138
+ role: 'lineBreak',
139
+ };
140
+ };
134
141
  const SingleChoiceOptionTypes = {
135
142
  option,
136
143
  textInput,
@@ -151,6 +158,7 @@ const ClozeItemTypes = {
151
158
  markdown,
152
159
  textInput,
153
160
  dateInput,
161
+ clozeLineBreak,
154
162
  numberInput,
155
163
  dropDown,
156
164
  };
@@ -1 +1 @@
1
- {"version":3,"file":"optionDefGenerators.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"optionDefGenerators.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}