@pie-element/image-cloze-association 4.1.8 → 4.1.9
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 +8 -0
- package/configure/CHANGELOG.md +8 -0
- package/configure/lib/index.js +14 -0
- package/configure/lib/index.js.map +1 -1
- package/configure/lib/root.js +8 -2
- package/configure/lib/root.js.map +1 -1
- package/configure/package.json +4 -3
- package/configure/src/index.js +19 -1
- package/configure/src/root.jsx +6 -0
- package/docs/config-schema.json +1 -1
- package/package.json +4 -4
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
|
+
## [4.1.9](https://github.com/pie-framework/pie-elements/compare/@pie-element/image-cloze-association@4.1.8...@pie-element/image-cloze-association@4.1.9) (2022-09-29)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @pie-element/image-cloze-association
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [4.1.8](https://github.com/pie-framework/pie-elements/compare/@pie-element/image-cloze-association@4.1.7...@pie-element/image-cloze-association@4.1.8) (2022-09-14)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @pie-element/image-cloze-association
|
package/configure/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
|
+
## [4.1.9](https://github.com/pie-framework/pie-elements/compare/@pie-element/image-cloze-association-configure@4.1.8...@pie-element/image-cloze-association-configure@4.1.9) (2022-09-29)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @pie-element/image-cloze-association-configure
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [4.1.8](https://github.com/pie-framework/pie-elements/compare/@pie-element/image-cloze-association-configure@4.1.7...@pie-element/image-cloze-association-configure@4.1.8) (2022-09-14)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @pie-element/image-cloze-association-configure
|
package/configure/lib/index.js
CHANGED
|
@@ -118,6 +118,16 @@ var ImageClozeAssociationConfigure = /*#__PURE__*/function (_HTMLElement) {
|
|
|
118
118
|
value: function onDeleteImage(src, done) {
|
|
119
119
|
this.dispatchEvent(new _pieConfigureEvents.DeleteImageEvent(src, done));
|
|
120
120
|
}
|
|
121
|
+
}, {
|
|
122
|
+
key: "insertSound",
|
|
123
|
+
value: function insertSound(handler) {
|
|
124
|
+
this.dispatchEvent(new _pieConfigureEvents.InsertSoundEvent(handler));
|
|
125
|
+
}
|
|
126
|
+
}, {
|
|
127
|
+
key: "onDeleteSound",
|
|
128
|
+
value: function onDeleteSound(src, done) {
|
|
129
|
+
this.dispatchEvent(new _pieConfigureEvents.DeleteSoundEvent(src, done));
|
|
130
|
+
}
|
|
121
131
|
}, {
|
|
122
132
|
key: "_render",
|
|
123
133
|
value: function _render() {
|
|
@@ -132,6 +142,10 @@ var ImageClozeAssociationConfigure = /*#__PURE__*/function (_HTMLElement) {
|
|
|
132
142
|
imageSupport: {
|
|
133
143
|
add: this.insertImage.bind(this),
|
|
134
144
|
"delete": this.onDeleteImage.bind(this)
|
|
145
|
+
},
|
|
146
|
+
uploadSoundSupport: {
|
|
147
|
+
add: this.insertSound.bind(this),
|
|
148
|
+
"delete": this.onDeleteSound.bind(this)
|
|
135
149
|
}
|
|
136
150
|
});
|
|
137
151
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.js"],"names":["log","ImageClozeAssociationConfigure","_model","createDefaultModel","onModelChanged","bind","_configuration","sensibleDefaults","configuration","s","_render","c","_disableSidePanel","reset","resetValue","dispatchEvent","ModelUpdatedEvent","m","dispatchModelUpdated","config","handler","InsertImageEvent","src","done","DeleteImageEvent","element","React","createElement","Root","disableSidePanel","model","onConfigurationChanged","imageSupport","add","insertImage","onDeleteImage","ReactDOM","render","HTMLElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;
|
|
1
|
+
{"version":3,"sources":["../src/index.js"],"names":["log","ImageClozeAssociationConfigure","_model","createDefaultModel","onModelChanged","bind","_configuration","sensibleDefaults","configuration","s","_render","c","_disableSidePanel","reset","resetValue","dispatchEvent","ModelUpdatedEvent","m","dispatchModelUpdated","config","handler","InsertImageEvent","src","done","DeleteImageEvent","InsertSoundEvent","DeleteSoundEvent","element","React","createElement","Root","disableSidePanel","model","onConfigurationChanged","imageSupport","add","insertImage","onDeleteImage","uploadSoundSupport","insertSound","onDeleteSound","ReactDOM","render","HTMLElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAQA;;AACA;;AACA;;AAEA;;AACA;;;;;;;;;;AAEA,IAAMA,GAAG,GAAG,uBAAM,mCAAN,CAAZ;;IAEqBC,8B;;;;;AAMnB,4CAAc;AAAA;;AAAA;AACZ;AACA,UAAKC,MAAL,GAAcD,8BAA8B,CAACE,kBAA/B,EAAd;AACA,UAAKC,cAAL,GAAsB,MAAKA,cAAL,CAAoBC,IAApB,gDAAtB;AACA,UAAKC,cAAL,GAAsBC,qBAAiBC,aAAvC;AAJY;AAKb;;;;SAED,aAAUC,CAAV,EAAa;AACX,WAAKP,MAAL,GAAcD,8BAA8B,CAACE,kBAA/B,CAAkDM,CAAlD,CAAd;;AACA,WAAKC,OAAL;AACD;;;SAED,aAAkBC,CAAlB,EAAqB;AACnB,WAAKL,cAAL,GAAsBK,CAAtB;;AACA,WAAKD,OAAL;AACD;;;SAED,aAAqBD,CAArB,EAAwB;AACtB,WAAKG,iBAAL,GAAyBH,CAAzB;;AACA,WAAKC,OAAL;AACD;;;WAED,8BAAqBG,KAArB,EAA4B;AAC1B,UAAMC,UAAU,GAAG,CAAC,C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AY,EAAE;AACZC,UAAAA,GAAG,EAAE,KAAKC,WAAL,CAAiB/B,IAAjB,CAAsB,IAAtB,CADO;AAEZ,oBAAQ,KAAKgC,aAAL,CAAmBhC,IAAnB,CAAwB,IAAxB;AAFI,SANwB;AAUtCiC,QAAAA,kBAAkB,EAAE;AAClBH,UAAAA,GAAG,EAAE,KAAKI,WAAL,CAAiBlC,IAAjB,CAAsB,IAAtB,CADa;AAElB,oBAAQ,KAAKmC,aAAL,CAAmBnC,IAAnB,CAAwB,IAAxB;AAFU;AAVkB,OAA1B,CAAd;;AAeAoC,2BAASC,MAAT,CAAgBf,OAAhB,EAAyB,IAAzB;AACD;;;kDAnFyDgB,W;;;iCAAvC1C,8B,wBACS;AAAA,MAAC+B,KAAD,uEAAS,EAAT;AAAA,yCACvBzB,qBAAiByB,KADM,GAEvBA,KAFuB;AAAA,C","sourcesContent":["import {\n ModelUpdatedEvent,\n DeleteImageEvent,\n InsertImageEvent,\n InsertSoundEvent,\n DeleteSoundEvent\n} from '@pie-framework/pie-configure-events';\n\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport debug from 'debug';\n\nimport Root from './root';\nimport sensibleDefaults from './defaults';\n\nconst log = debug('image-cloze-association:configure');\n\nexport default class ImageClozeAssociationConfigure extends HTMLElement {\n static createDefaultModel = (model = {}) => ({\n ...sensibleDefaults.model,\n ...model,\n });\n\n constructor() {\n super();\n this._model = ImageClozeAssociationConfigure.createDefaultModel();\n this.onModelChanged = this.onModelChanged.bind(this);\n this._configuration = sensibleDefaults.configuration;\n }\n\n set model(s) {\n this._model = ImageClozeAssociationConfigure.createDefaultModel(s);\n this._render();\n }\n\n set configuration(c) {\n this._configuration = c;\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.dispatchModelUpdated(reset);\n this._render();\n }\n\n onConfigurationChanged(config) {\n this._configuration = config;\n this._render();\n }\n\n /**\n *\n * @param {done, progress, file} handler\n */\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 insertSound(handler) {\n this.dispatchEvent(new InsertSoundEvent(handler));\n }\n\n onDeleteSound(src, done) {\n this.dispatchEvent(new DeleteSoundEvent(src, done));\n }\n\n _render() {\n log('_render');\n let element = React.createElement(Root, {\n disableSidePanel: this._disableSidePanel,\n model: this._model,\n configuration: this._configuration,\n onModelChanged: this.onModelChanged.bind(this),\n onConfigurationChanged: this.onConfigurationChanged.bind(this),\n imageSupport: {\n add: this.insertImage.bind(this),\n delete: this.onDeleteImage.bind(this)\n },\n uploadSoundSupport: {\n add: this.insertSound.bind(this),\n delete: this.onDeleteSound.bind(this)\n }\n });\n ReactDOM.render(element, this);\n }\n}\n"],"file":"index.js"}
|
package/configure/lib/root.js
CHANGED
|
@@ -74,7 +74,8 @@ var Root = /*#__PURE__*/function (_React$Component) {
|
|
|
74
74
|
configuration = _this$props.configuration,
|
|
75
75
|
onModelChanged = _this$props.onModelChanged,
|
|
76
76
|
onConfigurationChanged = _this$props.onConfigurationChanged,
|
|
77
|
-
imageSupport = _this$props.imageSupport
|
|
77
|
+
imageSupport = _this$props.imageSupport,
|
|
78
|
+
uploadSoundSupport = _this$props.uploadSoundSupport;
|
|
78
79
|
|
|
79
80
|
var _ref = configuration || {},
|
|
80
81
|
_ref$teacherInstructi = _ref.teacherInstructions,
|
|
@@ -119,7 +120,8 @@ var Root = /*#__PURE__*/function (_React$Component) {
|
|
|
119
120
|
nonEmpty: false,
|
|
120
121
|
spellCheck: spellCheckEnabled,
|
|
121
122
|
maxImageWidth: maxImageWidth && maxImageWidth.teacherInstructions,
|
|
122
|
-
maxImageHeight: maxImageHeight && maxImageHeight.teacherInstructions
|
|
123
|
+
maxImageHeight: maxImageHeight && maxImageHeight.teacherInstructions,
|
|
124
|
+
uploadSoundSupport: uploadSoundSupport
|
|
123
125
|
})), "Image cloze association"));
|
|
124
126
|
}
|
|
125
127
|
}]);
|
|
@@ -153,6 +155,10 @@ Root.propTypes = {
|
|
|
153
155
|
imageSupport: _propTypes["default"].shape({
|
|
154
156
|
add: _propTypes["default"].func.isRequired,
|
|
155
157
|
"delete": _propTypes["default"].func.isRequired
|
|
158
|
+
}),
|
|
159
|
+
uploadSoundSupport: _propTypes["default"].shape({
|
|
160
|
+
add: _propTypes["default"].func.isRequired,
|
|
161
|
+
"delete": _propTypes["default"].func.isRequired
|
|
156
162
|
})
|
|
157
163
|
};
|
|
158
164
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/root.jsx"],"names":["Panel","settings","toggle","Root","teacherInstructions","props","onModelChanged","model","classes","configuration","onConfigurationChanged","imageSupport","spellCheck","maxImageWidth","maxImageHeight","spellCheckEnabled","config","Properties","teacherInstructionsEnabled","label","content","promptHolder","prompt","onTeacherInstructionsChanged","React","Component","styles","theme","base","marginTop","spacing","unit","width","paddingTop","propTypes","PropTypes","object","isRequired","func","shape","add"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,IAAQA,KAAR,GAA0BC,kBAA1B,CAAQD,KAAR;AAAA,IAAeE,MAAf,GAA0BD,kBAA1B,CAAeC,MAAf;;IAEaC,I;;;;;;;;;;;;;;;qHACoB,UAACC,mBAAD,EAAyB;AACtD,YAAKC,KAAL,CAAWC,cAAX,iCACK,MAAKD,KAAL,CAAWE,KADhB;AAEEH,QAAAA,mBAAmB,EAAnBA;AAFF;AAID,K;;;;;;WAED,kBAAS;AACP,
|
|
1
|
+
{"version":3,"sources":["../src/root.jsx"],"names":["Panel","settings","toggle","Root","teacherInstructions","props","onModelChanged","model","classes","configuration","onConfigurationChanged","imageSupport","uploadSoundSupport","spellCheck","maxImageWidth","maxImageHeight","spellCheckEnabled","config","Properties","teacherInstructionsEnabled","label","content","promptHolder","prompt","onTeacherInstructionsChanged","React","Component","styles","theme","base","marginTop","spacing","unit","width","paddingTop","propTypes","PropTypes","object","isRequired","func","shape","add"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,IAAQA,KAAR,GAA0BC,kBAA1B,CAAQD,KAAR;AAAA,IAAeE,MAAf,GAA0BD,kBAA1B,CAAeC,MAAf;;IAEaC,I;;;;;;;;;;;;;;;qHACoB,UAACC,mBAAD,EAAyB;AACtD,YAAKC,KAAL,CAAWC,cAAX,iCACK,MAAKD,KAAL,CAAWE,KADhB;AAEEH,QAAAA,mBAAmB,EAAnBA;AAFF;AAID,K;;;;;;WAED,kBAAS;AACP,wBAQI,KAAKC,KART;AAAA,UACEG,OADF,eACEA,OADF;AAAA,UAEED,KAFF,eAEEA,KAFF;AAAA,UAGEE,aAHF,eAGEA,aAHF;AAAA,UAIEH,cAJF,eAIEA,cAJF;AAAA,UAKEI,sBALF,eAKEA,sBALF;AAAA,UAMEC,YANF,eAMEA,YANF;AAAA,UAOEC,kBAPF,eAOEA,kBAPF;;AASA,iBAA+FH,aAAa,IAAI,EAAhH;AAAA,uCAAQL,mBAAR;AAAA,UAAQA,mBAAR,sCAA8B,EAA9B;AAAA,iCAAkCS,UAAlC;AAAA,UAAkCA,UAAlC,gCAA+C,EAA/C;AAAA,oCAAmDC,aAAnD;AAAA,UAAmDA,aAAnD,mCAAmE,EAAnE;AAAA,qCAAuEC,cAAvE;AAAA,UAAuEA,cAAvE,oCAAwF,EAAxF;;AACA,kBAA8BR,KAAK,IAAI,EAAvC;AAAA,UAAQS,iBAAR,SAAQA,iBAAR;;AAEA,0BACE,gCAAC,gBAAD,CAAQ,YAAR;AACE,QAAA,QAAQ,eACN,gCAAC,KAAD;AACE,UAAA,KAAK,EAAET,KADT;AAEE,UAAA,aAAa,EAAEE,aAFjB;AA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KAAK,CAACG,OAAN,CAAcC,IAAd,GAAqB;AAD5B,KADmB;AAIzBV,IAAAA,YAAY,EAAE;AACZW,MAAAA,KAAK,EAAE,MADK;AAEZC,MAAAA,UAAU,EAAEN,KAAK,CAACG,OAAN,CAAcC,IAAd,GAAqB;AAFrB,KAJW;AAQzBT,IAAAA,MAAM,EAAE;AACNW,MAAAA,UAAU,EAAEN,KAAK,CAACG,OAAN,CAAcC,IAAd,GAAqB,CAD3B;AAENC,MAAAA,KAAK,EAAE;AAFD;AARiB,GAAZ;AAAA,CAAf;;AAcA9B,IAAI,CAACgC,SAAL,GAAiB;AACf3B,EAAAA,OAAO,EAAE4B,sBAAUC,MAAV,CAAiBC,UADX;AAEfhC,EAAAA,cAAc,EAAE8B,sBAAUG,IAFX;AAGf7B,EAAAA,sBAAsB,EAAE0B,sBAAUG,IAHnB;AAIfhC,EAAAA,KAAK,EAAE6B,sBAAUC,MAAV,CAAiBC,UAJT;AAKf7B,EAAAA,aAAa,EAAE2B,sBAAUC,MAAV,CAAiBC,UALjB;AAMf3B,EAAAA,YAAY,EAAEyB,sBAAUI,KAAV,CAAgB;AAC5BC,IAAAA,GAAG,EAAEL,sBAAUG,IAAV,CAAeD,UADQ;AAE5B,cAAQF,sBAAUG,IAAV,CAAeD;AAFK,GAAhB,CANC;AAUf1B,EAAAA,kBAAkB,EAAEwB,sBAAUI,KAAV,CAAgB;AAClCC,IAAAA,GAAG,EAAEL,sBAAUG,IAAV,CAAeD,UADc;AAElC,cAAQF,sBAAUG,IAAV,CAAeD;AAFW,GAAhB;AAVL,CAAjB;;eAgBe,wBAAWX,MAAX,EAAmBxB,IAAnB,C","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@material-ui/core/styles';\nimport { settings, layout, InputContainer } from '@pie-lib/config-ui';\nimport EditableHtml from '@pie-lib/editable-html';\n\nconst { Panel, toggle } = settings;\n\nexport class Root extends React.Component {\n onTeacherInstructionsChanged = (teacherInstructions) => {\n this.props.onModelChanged({\n ...this.props.model,\n teacherInstructions,\n });\n };\n\n render() {\n const {\n classes,\n model,\n configuration,\n onModelChanged,\n onConfigurationChanged,\n imageSupport,\n uploadSoundSupport\n } = this.props;\n const { teacherInstructions = {}, spellCheck = {}, maxImageWidth = {}, maxImageHeight = {} } = configuration || {};\n const { spellCheckEnabled } = model || {};\n\n return (\n <layout.ConfigLayout\n settings={\n <Panel\n model={model}\n configuration={configuration}\n onChangeModel={(model) => onModelChanged(model)}\n onChangeConfiguration={(config) => onConfigurationChanged(config)}\n groups={{\n Properties: {\n teacherInstructionsEnabled:\n teacherInstructions.settings &&\n toggle(teacherInstructions.label),\n spellCheckEnabled:\n spellCheck.settings && toggle(spellCheck.label),\n },\n }}\n />\n }\n >\n <div className={classes.content}>\n {model && model.teacherInstructionsEnabled && (\n <InputContainer\n label={teacherInstructions.label}\n className={classes.promptHolder}\n >\n <EditableHtml\n className={classes.prompt}\n markup={model.teacherInstructions || ''}\n onChange={this.onTeacherInstructionsChanged}\n imageSupport={imageSupport}\n nonEmpty={false}\n spellCheck={spellCheckEnabled}\n maxImageWidth={maxImageWidth && maxImageWidth.teacherInstructions}\n maxImageHeight={maxImageHeight && maxImageHeight.teacherInstructions}\n uploadSoundSupport={uploadSoundSupport}\n />\n </InputContainer>\n )}\n Image cloze association\n </div>\n </layout.ConfigLayout>\n );\n }\n}\n\nconst styles = (theme) => ({\n base: {\n marginTop: theme.spacing.unit * 3,\n },\n promptHolder: {\n width: '100%',\n paddingTop: theme.spacing.unit * 2,\n },\n prompt: {\n paddingTop: theme.spacing.unit * 2,\n width: '100%',\n },\n});\n\nRoot.propTypes = {\n classes: PropTypes.object.isRequired,\n onModelChanged: PropTypes.func,\n onConfigurationChanged: PropTypes.func,\n model: PropTypes.object.isRequired,\n configuration: PropTypes.object.isRequired,\n imageSupport: PropTypes.shape({\n add: PropTypes.func.isRequired,\n delete: PropTypes.func.isRequired,\n }),\n uploadSoundSupport: PropTypes.shape({\n add: PropTypes.func.isRequired,\n delete: PropTypes.func.isRequired,\n }),\n};\n\nexport default withStyles(styles)(Root);\n"],"file":"root.js"}
|
package/configure/package.json
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/image-cloze-association-configure",
|
|
3
3
|
"private": true,
|
|
4
|
-
"version": "4.1.
|
|
4
|
+
"version": "4.1.9",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"module": "src/index.js",
|
|
8
8
|
"author": "",
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@material-ui/core": "^3.9.2",
|
|
11
|
-
"@pie-framework/pie-configure-events": "^1.
|
|
12
|
-
"@pie-lib/config-ui": "^11.0.
|
|
11
|
+
"@pie-framework/pie-configure-events": "^1.3.0",
|
|
12
|
+
"@pie-lib/config-ui": "^11.0.19",
|
|
13
|
+
"@pie-lib/editable-html": "^9.2.2",
|
|
13
14
|
"debug": "^3.1.0",
|
|
14
15
|
"prop-types": "^15.7.2",
|
|
15
16
|
"react": "^16.8.6",
|
package/configure/src/index.js
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
ModelUpdatedEvent,
|
|
3
|
+
DeleteImageEvent,
|
|
4
|
+
InsertImageEvent,
|
|
5
|
+
InsertSoundEvent,
|
|
6
|
+
DeleteSoundEvent
|
|
7
|
+
} from '@pie-framework/pie-configure-events';
|
|
2
8
|
|
|
3
9
|
import React from 'react';
|
|
4
10
|
import ReactDOM from 'react-dom';
|
|
@@ -66,6 +72,14 @@ export default class ImageClozeAssociationConfigure extends HTMLElement {
|
|
|
66
72
|
this.dispatchEvent(new DeleteImageEvent(src, done));
|
|
67
73
|
}
|
|
68
74
|
|
|
75
|
+
insertSound(handler) {
|
|
76
|
+
this.dispatchEvent(new InsertSoundEvent(handler));
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
onDeleteSound(src, done) {
|
|
80
|
+
this.dispatchEvent(new DeleteSoundEvent(src, done));
|
|
81
|
+
}
|
|
82
|
+
|
|
69
83
|
_render() {
|
|
70
84
|
log('_render');
|
|
71
85
|
let element = React.createElement(Root, {
|
|
@@ -77,6 +91,10 @@ export default class ImageClozeAssociationConfigure extends HTMLElement {
|
|
|
77
91
|
imageSupport: {
|
|
78
92
|
add: this.insertImage.bind(this),
|
|
79
93
|
delete: this.onDeleteImage.bind(this)
|
|
94
|
+
},
|
|
95
|
+
uploadSoundSupport: {
|
|
96
|
+
add: this.insertSound.bind(this),
|
|
97
|
+
delete: this.onDeleteSound.bind(this)
|
|
80
98
|
}
|
|
81
99
|
});
|
|
82
100
|
ReactDOM.render(element, this);
|
package/configure/src/root.jsx
CHANGED
|
@@ -22,6 +22,7 @@ export class Root extends React.Component {
|
|
|
22
22
|
onModelChanged,
|
|
23
23
|
onConfigurationChanged,
|
|
24
24
|
imageSupport,
|
|
25
|
+
uploadSoundSupport
|
|
25
26
|
} = this.props;
|
|
26
27
|
const { teacherInstructions = {}, spellCheck = {}, maxImageWidth = {}, maxImageHeight = {} } = configuration || {};
|
|
27
28
|
const { spellCheckEnabled } = model || {};
|
|
@@ -61,6 +62,7 @@ export class Root extends React.Component {
|
|
|
61
62
|
spellCheck={spellCheckEnabled}
|
|
62
63
|
maxImageWidth={maxImageWidth && maxImageWidth.teacherInstructions}
|
|
63
64
|
maxImageHeight={maxImageHeight && maxImageHeight.teacherInstructions}
|
|
65
|
+
uploadSoundSupport={uploadSoundSupport}
|
|
64
66
|
/>
|
|
65
67
|
</InputContainer>
|
|
66
68
|
)}
|
|
@@ -95,6 +97,10 @@ Root.propTypes = {
|
|
|
95
97
|
add: PropTypes.func.isRequired,
|
|
96
98
|
delete: PropTypes.func.isRequired,
|
|
97
99
|
}),
|
|
100
|
+
uploadSoundSupport: PropTypes.shape({
|
|
101
|
+
add: PropTypes.func.isRequired,
|
|
102
|
+
delete: PropTypes.func.isRequired,
|
|
103
|
+
}),
|
|
98
104
|
};
|
|
99
105
|
|
|
100
106
|
export default withStyles(styles)(Root);
|
package/docs/config-schema.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/image-cloze-association",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.9",
|
|
4
4
|
"description": "",
|
|
5
5
|
"repository": "pie-framework/pie-elements",
|
|
6
6
|
"publishConfig": {
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
"@material-ui/core": "^3.9.3",
|
|
11
11
|
"@material-ui/icons": "^3.0.1",
|
|
12
12
|
"@pie-framework/pie-player-events": "^0.1.0",
|
|
13
|
-
"@pie-lib/correct-answer-toggle": "^2.3.
|
|
13
|
+
"@pie-lib/correct-answer-toggle": "^2.3.46",
|
|
14
14
|
"@pie-lib/drag": "^1.1.52",
|
|
15
15
|
"@pie-lib/math-rendering": "^2.5.0",
|
|
16
|
-
"@pie-lib/render-ui": "^4.13.
|
|
16
|
+
"@pie-lib/render-ui": "^4.13.6",
|
|
17
17
|
"classnames": "^2.2.6",
|
|
18
18
|
"prop-types": "^15.6.1",
|
|
19
19
|
"react": "^16.8.1",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
"author": "pie framework developers",
|
|
23
23
|
"license": "ISC",
|
|
24
|
-
"gitHead": "
|
|
24
|
+
"gitHead": "f60d1edac928da4682a9789000e3c8cf464348c0",
|
|
25
25
|
"scripts": {
|
|
26
26
|
"postpublish": "../../scripts/postpublish"
|
|
27
27
|
},
|