@pie-element/extended-text-entry 6.8.3 → 6.8.4-annotations.0

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,51 +3,6 @@
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
- ## [6.8.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry@6.8.2...@pie-element/extended-text-entry@6.8.3) (2022-03-08)
7
-
8
- **Note:** Version bump only for package @pie-element/extended-text-entry
9
-
10
-
11
-
12
-
13
-
14
- ## [6.8.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry@6.8.1...@pie-element/extended-text-entry@6.8.2) (2022-02-21)
15
-
16
- **Note:** Version bump only for package @pie-element/extended-text-entry
17
-
18
-
19
-
20
-
21
-
22
- ## [6.8.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry@6.8.0...@pie-element/extended-text-entry@6.8.1) (2022-02-04)
23
-
24
- **Note:** Version bump only for package @pie-element/extended-text-entry
25
-
26
-
27
-
28
-
29
-
30
- # [6.8.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry@6.7.8...@pie-element/extended-text-entry@6.8.0) (2022-01-24)
31
-
32
-
33
- ### Bug Fixes
34
-
35
- * **extended-text-entry:** add static classname for editor DNA-13102 ([3ad662f](https://github.com/pie-framework/pie-elements/commit/3ad662fbc6413f5c1721862f87120696071bfdea))
36
- * **math-inline, extended-text-entry:** use new editors ([2123b8a](https://github.com/pie-framework/pie-elements/commit/2123b8a6d930852a629140053a8459dbc75f281f))
37
- * **multiple-choice-print, ecr-print:** fix toggle issue, change options.mode to options.role ([0b3f534](https://github.com/pie-framework/pie-elements/commit/0b3f534bb4d2f969e21528e74516345e84f18d72))
38
- * **multiple-choice, explicit-constructed-response, extended-text-entry:** print do not show teacher instructions, rationale or prompt if they are diabled DNA-13089 ([06b9555](https://github.com/pie-framework/pie-elements/commit/06b9555b25e094e0b2bce0e6a852a206c6d2c17d))
39
- * use preview prompt for prompt, rationale and teacher instructions to fix table rendering PD-1456 ([f330601](https://github.com/pie-framework/pie-elements/commit/f3306019a2d1c8ce3e2783823dfe9ef0a0394e4f))
40
-
41
-
42
- ### Features
43
-
44
- * **extended-text-entry:** Added the ability for instructor to annotate student's response with comments PD-744 ([6d266f9](https://github.com/pie-framework/pie-elements/commit/6d266f9de59bfe3f9b71089f8e222e9ad9026cbc))
45
- * **extended-text-entry:** implement print PD-1283 ([7e4f7d8](https://github.com/pie-framework/pie-elements/commit/7e4f7d8203f54d905f542369d444232b54261582))
46
-
47
-
48
-
49
-
50
-
51
6
  ## [6.7.8](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry@6.7.7...@pie-element/extended-text-entry@6.7.8) (2022-01-10)
52
7
 
53
8
  **Note:** Version bump only for package @pie-element/extended-text-entry
@@ -3,41 +3,6 @@
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
- ## [5.4.12](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry-configure@5.4.11...@pie-element/extended-text-entry-configure@5.4.12) (2022-03-08)
7
-
8
- **Note:** Version bump only for package @pie-element/extended-text-entry-configure
9
-
10
-
11
-
12
-
13
-
14
- ## [5.4.11](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry-configure@5.4.10...@pie-element/extended-text-entry-configure@5.4.11) (2022-02-21)
15
-
16
- **Note:** Version bump only for package @pie-element/extended-text-entry-configure
17
-
18
-
19
-
20
-
21
-
22
- ## [5.4.10](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry-configure@5.4.9...@pie-element/extended-text-entry-configure@5.4.10) (2022-02-04)
23
-
24
- **Note:** Version bump only for package @pie-element/extended-text-entry-configure
25
-
26
-
27
-
28
-
29
-
30
- ## [5.4.9](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry-configure@5.4.8...@pie-element/extended-text-entry-configure@5.4.9) (2022-01-24)
31
-
32
-
33
- ### Bug Fixes
34
-
35
- * **math-inline, extended-text-entry:** use new editors ([2123b8a](https://github.com/pie-framework/pie-elements/commit/2123b8a6d930852a629140053a8459dbc75f281f))
36
-
37
-
38
-
39
-
40
-
41
6
  ## [5.4.8](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry-configure@5.4.7...@pie-element/extended-text-entry-configure@5.4.8) (2022-01-10)
42
7
 
43
8
  **Note:** Version bump only for package @pie-element/extended-text-entry-configure
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pie-element/extended-text-entry-configure",
3
3
  "private": true,
4
- "version": "5.4.12",
4
+ "version": "5.4.8",
5
5
  "description": "",
6
6
  "main": "lib/index.js",
7
7
  "module": "src/index.js",
@@ -3,14 +3,6 @@
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
- ## [4.1.19](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry-controller@4.1.18...@pie-element/extended-text-entry-controller@4.1.19) (2022-02-04)
7
-
8
- **Note:** Version bump only for package @pie-element/extended-text-entry-controller
9
-
10
-
11
-
12
-
13
-
14
6
  ## [4.1.15](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry-controller@4.1.13...@pie-element/extended-text-entry-controller@4.1.15) (2021-11-11)
15
7
 
16
8
  **Note:** Version bump only for package @pie-element/extended-text-entry-controller
@@ -8,7 +8,72 @@ var _default = {
8
8
  dimensions: {
9
9
  height: 100,
10
10
  width: 500
11
- }
11
+ },
12
+ predefinedAnnotations: [{
13
+ label: 'good',
14
+ text: 'good',
15
+ type: 'positive'
16
+ }, {
17
+ label: '★',
18
+ text: '★',
19
+ type: 'positive'
20
+ }, {
21
+ label: ':-)',
22
+ text: ':-)',
23
+ type: 'positive'
24
+ }, {
25
+ label: 'creative',
26
+ text: 'creative',
27
+ type: 'positive'
28
+ }, {
29
+ label: 'run-on',
30
+ text: 'run-on',
31
+ type: 'negative'
32
+ }, {
33
+ label: 'frag',
34
+ text: 'fragment',
35
+ type: 'negative'
36
+ }, {
37
+ label: 'tran',
38
+ text: 'transition',
39
+ type: 'negative'
40
+ }, {
41
+ label: 'supp',
42
+ text: 'support needed',
43
+ type: 'negative'
44
+ }, {
45
+ label: 'punc',
46
+ text: 'punctuation',
47
+ type: 'negative'
48
+ }, {
49
+ label: 'agr',
50
+ text: 'agreement wrong',
51
+ type: 'negative'
52
+ }, {
53
+ label: 'unclear',
54
+ text: 'unclear',
55
+ type: 'negative'
56
+ }, {
57
+ label: 'cut',
58
+ text: 'cut',
59
+ type: 'negative'
60
+ }, {
61
+ label: 'sp',
62
+ text: 'spelling',
63
+ type: 'negative'
64
+ }, {
65
+ label: 'cap',
66
+ text: 'capitalization',
67
+ type: 'negative'
68
+ }, {
69
+ label: 'inf',
70
+ text: 'informal',
71
+ type: 'negative'
72
+ }, {
73
+ label: 'awk',
74
+ text: 'awkward',
75
+ type: 'negative'
76
+ }]
12
77
  };
13
78
  exports["default"] = _default;
14
79
  //# sourceMappingURL=defaults.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/defaults.js"],"names":["dimensions","height","width"],"mappings":";;;;;;eAAe;AACbA,EAAAA,UAAU,EAAE;AACVC,IAAAA,MAAM,EAAE,GADE;AAEVC,IAAAA,KAAK,EAAE;AAFG;AADC,C","sourcesContent":["export default {\n dimensions: {\n height: 100,\n width: 500,\n }\n};\n"],"file":"defaults.js"}
1
+ {"version":3,"sources":["../src/defaults.js"],"names":["dimensions","height","width","predefinedAnnotations","label","text","type"],"mappings":";;;;;;eAAe;AACbA,EAAAA,UAAU,EAAE;AACVC,IAAAA,MAAM,EAAE,GADE;AAEVC,IAAAA,KAAK,EAAE;AAFG,GADC;AAKbC,EAAAA,qBAAqB,EAAE,CACrB;AACEC,IAAAA,KAAK,E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AAA,IAAI,EAAE,KAFL;AAGDC,IAAAA,IAAI,EAAE;AAHL,GA7CkB,EAiDlB;AACDF,IAAAA,KAAK,EAAE,IADN;AAEDC,IAAAA,IAAI,EAAE,UAFL;AAGDC,IAAAA,IAAI,EAAE;AAHL,GAjDkB,EAqDlB;AACDF,IAAAA,KAAK,EAAE,KADN;AAEDC,IAAAA,IAAI,EAAE,gBAFL;AAGDC,IAAAA,IAAI,EAAE;AAHL,GArDkB,EAyDlB;AACDF,IAAAA,KAAK,EAAE,KADN;AAEDC,IAAAA,IAAI,EAAE,UAFL;AAGDC,IAAAA,IAAI,EAAE;AAHL,GAzDkB,EA6DlB;AACDF,IAAAA,KAAK,EAAE,KADN;AAEDC,IAAAA,IAAI,EAAE,SAFL;AAGDC,IAAAA,IAAI,EAAE;AAHL,GA7DkB;AALV,C","sourcesContent":["export default {\n dimensions: {\n height: 100,\n width: 500,\n },\n predefinedAnnotations: [\n {\n label: 'good',\n text: 'good',\n type: 'positive'\n }, {\n label: '★',\n text: '★',\n type: 'positive'\n }, {\n label: ':-)',\n text: ':-)',\n type: 'positive'\n }, {\n label: 'creative',\n text: 'creative',\n type: 'positive'\n }, {\n label: 'run-on',\n text: 'run-on',\n type: 'negative'\n }, {\n label: 'frag',\n text: 'fragment',\n type: 'negative'\n }, {\n label: 'tran',\n text: 'transition',\n type: 'negative'\n }, {\n label: 'supp',\n text: 'support needed',\n type: 'negative'\n }, {\n label: 'punc',\n text: 'punctuation',\n type: 'negative'\n }, {\n label: 'agr',\n text: 'agreement wrong',\n type: 'negative'\n }, {\n label: 'unclear',\n text: 'unclear',\n type: 'negative'\n }, {\n label: 'cut',\n text: 'cut',\n type: 'negative'\n }, {\n label: 'sp',\n text: 'spelling',\n type: 'negative'\n }, {\n label: 'cap',\n text: 'capitalization',\n type: 'negative'\n }, {\n label: 'inf',\n text: 'informal',\n type: 'negative'\n }, {\n label: 'awk',\n text: 'awkward',\n type: 'negative'\n }\n ]\n};\n"],"file":"defaults.js"}
@@ -72,7 +72,7 @@ function model(_x, _x2, _x3) {
72
72
 
73
73
  function _model() {
74
74
  _model = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(question, session, env) {
75
- var normalizedQuestion, fb, teacherInstructions, equationEditor;
75
+ var normalizedQuestion, fb, teacherInstructions, equationEditor, annotatorMode, disabledAnnotator;
76
76
  return _regenerator["default"].wrap(function _callee2$(_context2) {
77
77
  while (1) {
78
78
  switch (_context2.prev = _context2.next) {
@@ -113,21 +113,27 @@ function _model() {
113
113
  return _context2.abrupt("break", 18);
114
114
 
115
115
  case 18:
116
+ annotatorMode = env.role === 'instructor' || env.mode === 'evaluate';
117
+ disabledAnnotator = env.role !== 'instructor';
116
118
  return _context2.abrupt("return", fb.then(function (feedback) {
117
119
  return {
118
120
  prompt: normalizedQuestion.promptEnabled ? normalizedQuestion.prompt : null,
119
121
  dimensions: normalizedQuestion.dimensions,
120
122
  customKeys: normalizedQuestion.customKeys || [],
123
+ id: normalizedQuestion.id,
121
124
  disabled: env.mode !== 'gather',
122
125
  feedback: feedback,
123
126
  teacherInstructions: teacherInstructions,
124
127
  mathInput: normalizedQuestion.mathInput,
125
128
  equationEditor: equationEditor,
129
+ annotatorMode: annotatorMode,
130
+ disabledAnnotator: disabledAnnotator,
131
+ predefinedAnnotations: normalizedQuestion.predefinedAnnotations,
126
132
  playersToolbarPosition: normalizedQuestion.playersToolbarPosition || 'bottom'
127
133
  };
128
134
  }));
129
135
 
130
- case 19:
136
+ case 21:
131
137
  case "end":
132
138
  return _context2.stop();
133
139
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.js"],"names":["log","createDefaultModel","model","defaults","normalize","question","feedbackEnabled","rationaleEnabled","promptEnabled","teacherInstructionsEnabled","studentInstructionsEnabled","session","env","normalizedQuestion","fb","mode","feedback","Promise","resolve","undefined","teacherInstructions","role","equationEditor","then","prompt","dimensions","customKeys","disabled","mathInput","playersToolbarPosition","outcome","score","completed","note"],"mapp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AACLC,cAAAA,KAAK,EAAE,CADF;AAELC,cAAAA,SAAS,EAAE,KAFN;AAGLC,cAAAA,IAAI,EAAE;AAHD,aADF;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,G","sourcesContent":["import debug from 'debug';\n\nconst log = debug('@pie-element:extended-text-entry:controller');\nimport { getFeedback } from '@pie-lib/feedback';\n\nimport defaults from './defaults';\n\nexport async function createDefaultModel(model = {}) {\n log('[createDefaultModel]', model);\n\n return {\n ...defaults,\n ...model,\n };\n}\n\nexport const normalize = question => ({\n ...defaults,\n feedbackEnabled: true,\n rationaleEnabled: true,\n promptEnabled: true,\n teacherInstructionsEnabled: true,\n studentInstructionsEnabled: true,\n ...question,\n});\n\n\nexport async function model(question, session, env) {\n log('[question]', question);\n const normalizedQuestion = normalize(question);\n\n const fb =\n env.mode === 'evaluate' && normalizedQuestion.feedbackEnabled\n ? getFeedback(normalizedQuestion.feedback, 'Your answer has been submitted')\n : Promise.resolve(undefined);\n\n let teacherInstructions = null;\n if (env.role === 'instructor' && (env.mode === 'view' || env.mode === 'evaluate')) {\n teacherInstructions = normalizedQuestion.teacherInstructionsEnabled ? normalizedQuestion.teacherInstructions : null;\n } else {\n teacherInstructions = null;\n }\n\n let equationEditor = normalizedQuestion.equationEditor || 'miscellaneous';\n\n switch (normalizedQuestion.equationEditor) {\n case 'Grade 1 - 2':\n equationEditor = 1;\n break;\n case 'Grade 3 - 5':\n equationEditor = 3;\n break;\n case 'Grade 6 - 7':\n equationEditor = 6;\n break;\n case 'Grade 8 - HS':\n equationEditor = 8;\n break;\n default:\n break;\n }\n\n return fb.then(feedback => ({\n prompt: normalizedQuestion.promptEnabled ? normalizedQuestion.prompt : null,\n dimensions: normalizedQuestion.dimensions,\n customKeys: normalizedQuestion.customKeys || [],\n disabled: env.mode !== 'gather',\n feedback,\n teacherInstructions,\n mathInput: normalizedQuestion.mathInput,\n equationEditor, \n playersToolbarPosition: normalizedQuestion.playersToolbarPosition || 'bottom'\n }));\n}\n\nexport async function outcome(/*question, session, env*/) {\n return {\n score: 0,\n completed: 'n/a',\n note: 'Requires manual scoring'\n };\n}\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../src/index.js"],"names":["log","createDefaultModel","model","defaults","normalize","question","feedbackEnabled","rationaleEnabled","promptEnabled","teacherInstructionsEnabled","studentInstructionsEnabled","session","env","normalizedQuestion","fb","mode","feedback","Promise","resolve","undefined","teacherInstructions","role","equationEditor","annotatorMode","disabledAnnotator","then","prompt","dimensions","customKeys","id","disabled","mathInput","predefinedAnnotations","playersToolbarPosition","outcome","score","completed","note"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;AAGA;;AAEA;;;;;;AAHA,IAAMA,GAAG,GAAG,uBAAM,6CAAN,CAAZ;;SAKsBC,kB;;;;;sGAAf;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAkCC,YAAAA,KAAlC,2DAA0C,EAA1C;AACLF,YAAAA,GAAG,CAAC,sBAAD,EAAyBE,KAAzB,CAAH;AADK,6EAIAC,oBAJA,GAKAD,KALA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,G;;;;AASA,IAAME,SAAS,GAAG,SAAZA,SAAY,CAAAC,QAAQ;AAAA,yCAC5BF,oBAD4B;AAE/BG,IAAAA,eAAe,EAAE,IAFc;AAG/BC,IAAAA,gBAAgB,EAAE,IAHa;AAI/BC,IAAAA,aAAa,EAAE,IAJgB;AAK/BC,IAAAA,0BAA0B,EAAE,IALG;AAM/BC,IAAAA,0BAA0B,EAAE;AANG,KAO5BL,QAP4B;AAAA,CAA1B;;;;SAWeH,K;;;;;yFAAf,kBAAqBG,QAArB,EAA+BM,OAA/B,EAAwCC,GAAxC;AAAA;AAAA;AAAA;AAAA;AAAA;AACLZ,YAAAA,GAAG,CAAC,YAAD,EAAeK,QAAf,CAAH;AACMQ,YAAAA,kBAFD,GAEsBT,SAAS,CAACC,QAAD,CAF/B;AAICS,YAAAA,EAJD,GAKHF,GAAG,CAACG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AA,UAAU,EAAEd,kBAAkB,CAACc,UAFL;AAG1BC,gBAAAA,UAAU,EAAEf,kBAAkB,CAACe,UAAnB,IAAiC,EAHnB;AAI1BC,gBAAAA,EAAE,EAAEhB,kBAAkB,CAACgB,EAJG;AAK1BC,gBAAAA,QAAQ,EAAElB,GAAG,CAACG,IAAJ,KAAa,QALG;AAM1BC,gBAAAA,QAAQ,EAARA,QAN0B;AAO1BI,gBAAAA,mBAAmB,EAAnBA,mBAP0B;AAQ1BW,gBAAAA,SAAS,EAAElB,kBAAkB,CAACkB,SARJ;AAS1BT,gBAAAA,cAAc,EAAdA,cAT0B;AAU1BC,gBAAAA,aAAa,EAAbA,aAV0B;AAW1BC,gBAAAA,iBAAiB,EAAjBA,iBAX0B;AAY1BQ,gBAAAA,qBAAqB,EAAEnB,kBAAkB,CAACmB,qBAZhB;AAa1BC,gBAAAA,sBAAsB,EAAEpB,kBAAkB,CAACoB,sBAAnB,IAA6C;AAb3C,eAAL;AAAA,aAAhB,CAtCF;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,G;;;;SAuDeC,O;;;;;2FAAf;AAAA;AAAA;AAAA;AAAA;AAAA,8CACE;AACLC,cAAAA,KAAK,EAAE,CADF;AAELC,cAAAA,SAAS,EAAE,KAFN;AAGLC,cAAAA,IAAI,EAAE;AAHD,aADF;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,G","sourcesContent":["import debug from 'debug';\n\nconst log = debug('@pie-element:extended-text-entry:controller');\nimport { getFeedback } from '@pie-lib/feedback';\n\nimport defaults from './defaults';\n\nexport async function createDefaultModel(model = {}) {\n log('[createDefaultModel]', model);\n\n return {\n ...defaults,\n ...model,\n };\n}\n\nexport const normalize = question => ({\n ...defaults,\n feedbackEnabled: true,\n rationaleEnabled: true,\n promptEnabled: true,\n teacherInstructionsEnabled: true,\n studentInstructionsEnabled: true,\n ...question,\n});\n\n\nexport async function model(question, session, env) {\n log('[question]', question);\n const normalizedQuestion = normalize(question);\n\n const fb =\n env.mode === 'evaluate' && normalizedQuestion.feedbackEnabled\n ? getFeedback(normalizedQuestion.feedback, 'Your answer has been submitted')\n : Promise.resolve(undefined);\n\n let teacherInstructions = null;\n if (env.role === 'instructor' && (env.mode === 'view' || env.mode === 'evaluate')) {\n teacherInstructions = normalizedQuestion.teacherInstructionsEnabled ? normalizedQuestion.teacherInstructions : null;\n } else {\n teacherInstructions = null;\n }\n\n let equationEditor = normalizedQuestion.equationEditor || 'miscellaneous';\n\n switch (normalizedQuestion.equationEditor) {\n case 'Grade 1 - 2':\n equationEditor = 1;\n break;\n case 'Grade 3 - 5':\n equationEditor = 3;\n break;\n case 'Grade 6 - 7':\n equationEditor = 6;\n break;\n case 'Grade 8 - HS':\n equationEditor = 8;\n break;\n default:\n break;\n }\n\n const annotatorMode = env.role === 'instructor' || env.mode === 'evaluate';\n const disabledAnnotator = env.role !== 'instructor';\n\n return fb.then(feedback => ({\n prompt: normalizedQuestion.promptEnabled ? normalizedQuestion.prompt : null,\n dimensions: normalizedQuestion.dimensions,\n customKeys: normalizedQuestion.customKeys || [],\n id: normalizedQuestion.id,\n disabled: env.mode !== 'gather',\n feedback,\n teacherInstructions,\n mathInput: normalizedQuestion.mathInput,\n equationEditor,\n annotatorMode,\n disabledAnnotator,\n predefinedAnnotations: normalizedQuestion.predefinedAnnotations,\n playersToolbarPosition: normalizedQuestion.playersToolbarPosition || 'bottom'\n }));\n}\n\nexport async function outcome(/*question, session, env*/) {\n return {\n score: 0,\n completed: 'n/a',\n note: 'Requires manual scoring'\n };\n}\n"],"file":"index.js"}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pie-element/extended-text-entry-controller",
3
3
  "private": true,
4
- "version": "4.1.19",
4
+ "version": "4.1.18",
5
5
  "description": "",
6
6
  "main": "lib/index.js",
7
7
  "module": "src/index.js",
@@ -116,6 +116,41 @@
116
116
  "type": "string",
117
117
  "title": "toolbarEditorPosition"
118
118
  },
119
+ "predefinedAnnotations": {
120
+ "description": "Indicates the predefined annotations for the annotation menu",
121
+ "type": "array",
122
+ "items": {
123
+ "title": "PredefinedAnnotation",
124
+ "type": "object",
125
+ "properties": {
126
+ "label": {
127
+ "description": "Indicates the value displayed in the annotation button",
128
+ "type": "string",
129
+ "title": "label"
130
+ },
131
+ "text": {
132
+ "description": "Indicates the annotation value",
133
+ "type": "string",
134
+ "title": "text"
135
+ },
136
+ "type": {
137
+ "description": "Indicates the type of the annotation",
138
+ "enum": [
139
+ "negative",
140
+ "positive"
141
+ ],
142
+ "type": "string",
143
+ "title": "type"
144
+ }
145
+ },
146
+ "required": [
147
+ "label",
148
+ "text",
149
+ "type"
150
+ ]
151
+ },
152
+ "title": "predefinedAnnotations"
153
+ },
119
154
  "playersToolbarPosition": {
120
155
  "description": "Indicates the editor's toolbar position for the player, which can be 'bottom' or 'top'",
121
156
  "default": ": 'bottom'",
@@ -222,7 +257,37 @@
222
257
  "required": [
223
258
  "type"
224
259
  ]
260
+ },
261
+ "PredefinedAnnotation": {
262
+ "title": "PredefinedAnnotation",
263
+ "type": "object",
264
+ "properties": {
265
+ "label": {
266
+ "description": "Indicates the value displayed in the annotation button",
267
+ "type": "string",
268
+ "title": "label"
269
+ },
270
+ "text": {
271
+ "description": "Indicates the annotation value",
272
+ "type": "string",
273
+ "title": "text"
274
+ },
275
+ "type": {
276
+ "description": "Indicates the type of the annotation",
277
+ "enum": [
278
+ "negative",
279
+ "positive"
280
+ ],
281
+ "type": "string",
282
+ "title": "type"
283
+ }
284
+ },
285
+ "required": [
286
+ "label",
287
+ "text",
288
+ "type"
289
+ ]
225
290
  }
226
291
  },
227
292
  "$schema": "http://json-schema.org/draft-07/schema#"
228
- }
293
+ }
@@ -95,6 +95,31 @@ This element must be one of the following enum values:
95
95
  * `bottom`
96
96
  * `top`
97
97
 
98
+ # `predefinedAnnotations` (array)
99
+
100
+ Indicates the predefined annotations for the annotation menu
101
+
102
+ The object is an array with all elements of the type `object`.
103
+
104
+ The array object has the following properties:
105
+
106
+ ## `label` (string, required)
107
+
108
+ Indicates the value displayed in the annotation button
109
+
110
+ ## `text` (string, required)
111
+
112
+ Indicates the annotation value
113
+
114
+ ## `type` (string, enum, required)
115
+
116
+ Indicates the type of the annotation
117
+
118
+ This element must be one of the following enum values:
119
+
120
+ * `negative`
121
+ * `positive`
122
+
98
123
  # `playersToolbarPosition` (string, enum)
99
124
 
100
125
  Indicates the editor's toolbar position for the player, which can be 'bottom' or 'top'
@@ -176,4 +201,25 @@ This element must be one of the following enum values:
176
201
 
177
202
  ### `default` (string)
178
203
 
179
- Indicates the feedback value
204
+ Indicates the feedback value
205
+
206
+ ## `PredefinedAnnotation` (object)
207
+
208
+ Properties of the `PredefinedAnnotation` object:
209
+
210
+ ### `label` (string, required)
211
+
212
+ Indicates the value displayed in the annotation button
213
+
214
+ ### `text` (string, required)
215
+
216
+ Indicates the annotation value
217
+
218
+ ### `type` (string, enum, required)
219
+
220
+ Indicates the type of the annotation
221
+
222
+ This element must be one of the following enum values:
223
+
224
+ * `negative`
225
+ * `positive`